:root {
  --bg:#484848;
  --header:#39393a;
  --accent:#5172e2;
  --accent-hover:#6382ec;
  --icon:#9ab0ff;
  --surface:#414141;
  --text:#f1f1f1;
  --muted:#bebebe;
  --blue:#9ab0ff;
  --border:#595959;
}
* {
  box-sizing:border-box;
}
html,body {
  margin:0;
  min-width:250px;
  background:var(--bg);
  color:var(--text);
  font-family:"Microsoft YaHei","Segoe UI",sans-serif;
  font-size:12px;
  -webkit-user-select:none;
  user-select:none;
}
button,input {
  font:inherit;
}
button {
  cursor:pointer;
}
button:focus,summary:focus {
  outline:none;
}
.keyboard-navigation .help:focus,.keyboard-navigation .close:focus,.keyboard-navigation summary:focus {
  color:var(--text);
}
.keyboard-navigation .btn:focus {
  filter:brightness(1.12);
}
button:disabled {
  opacity:.45;
  cursor:default;
}
.svg-defs {
  position:absolute;
  width:0;
  height:0;
  overflow:hidden;
}
.panel {
  width:100%;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
#metadataSettings { margin:10px 0 0; }
#metadataSettings[hidden] { display:none; }
#metadataAdvice { flex:1; min-width:0; margin:0; font-size:10px; line-height:1.4; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#metadataAdvice[data-recommendation=deep] { color:#e4c59e; }
.scan-row { display:flex; align-items:center; min-height:20px; color:var(--muted); }
#scanMetadata { flex:none; border:0; padding:4px 0 4px 6px; background:transparent; color:var(--icon); font-size:10px; }
.title-row {
  display:flex;
  align-items:center;
  min-height:38px;
  flex-shrink:0;
  padding:0 14px;
  background:var(--header);
  border-bottom:1px solid #515151;
}
.title-icon {
  width:18px;
  height:18px;
  margin-right:8px;
}
h1 {
  font-size:14px;
  line-height:24px;
  font-weight:600;
  margin:0;
  white-space:nowrap;
}
.help {
  border:1px solid #777;
  border-radius:50%;
  width:17px;
  height:17px;
  flex-shrink:0;
  background:transparent;
  color:#c4c4c4;
  font-size:11px;
  line-height:15px;
  padding:0;
}
.help:hover,.keyboard-navigation .help:focus {
  color:var(--text);
  border-color:var(--icon);
  background:#4c5368;
}
#optionCount {
  margin-left:auto;
  margin-right:9px;
  padding-left:8px;
  white-space:nowrap;
  font-size:10px;
  color:var(--muted);
}
.panel-content {
  width:100%;
  max-width:270px;
  margin:0 auto;
  padding:14px 16px 10px;
  flex-shrink:0;
}
.panel-controls { width:100%; max-width:270px; margin:0 auto; padding:0 16px 12px; flex-shrink:0; }
.grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  grid-gap:17px 6px;
  margin-bottom:6px;
}
.cell {
  border:0;
  background:none;
  color:var(--icon);
  min-width:0;
  padding:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  transition:color .15s;
}
.cell:focus {
  outline:none;
}
.icon-box {
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  width:54px;
  height:46px;
  border:1px solid var(--border);
  border-radius:5px;
  background:var(--surface);
  transition:background .15s,border-color .15s,color .15s;
}
.icon-box svg {
  width:27px;
  height:27px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.6;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.lbl {
  margin-top:6px;
  font-size:11px;
  color:#d2d2d2;
  white-space:nowrap;
  text-align:center;
}
#modeNative .lbl,#modeDeep .lbl { font-size:9px; }
@media(min-width:270px) { #modeNative .lbl,#modeDeep .lbl { font-size:10px; } }
.cell[aria-pressed=true] {
  color:#e2e9ff;
}
.cell[aria-pressed=true] .icon-box {
  background:#4c60af;
  border-color:#7187d5;
}
.cell:hover:not(:disabled),.keyboard-navigation .cell:focus {
  color:#d1dbff;
}
.cell:hover:not(:disabled) .icon-box,.keyboard-navigation .cell:focus .icon-box {
  border-color:#7382ab;
  background:#4c5368;
}
.cell[aria-pressed=true]:hover:not(:disabled),.keyboard-navigation .cell[aria-pressed=true]:focus {
  color:#fff;
}
.cell[aria-pressed=true]:hover:not(:disabled) .icon-box,.keyboard-navigation .cell[aria-pressed=true]:focus .icon-box {
  border-color:#a1b2f7;
  background:#6077c8;
}
.cell[aria-pressed=true] .lbl {
  color:#dce4ff;
}
.cell:hover .lbl,.keyboard-navigation .cell:focus .lbl {
  color:#fff;
}
.save-option {
  border-top:1px solid #606060;
  padding-top:10px;
  margin-bottom:11px;
}
.overwrite {
  display:flex;
  align-items:center;
  cursor:pointer;
  width:max-content;
  position:relative;
}
.overwrite input {
  position:absolute;
  opacity:0;
  width:16px;
  height:16px;
  margin:0;
}
.checkbox-art {
  width:15px;
  height:15px;
  border:1px solid #8a8a8a;
  border-radius:4px;
  margin-right:9px;
  background:#414141;
}
.overwrite input:checked+.checkbox-art {
  background:var(--accent);
  border-color:var(--accent);
}
.overwrite input:checked+.checkbox-art:after {
  content:'✓';
  display:block;
  color:white;
  font-size:11px;
  line-height:13px;
  text-align:center;
}
.keyboard-navigation .overwrite input:focus+.checkbox-art {
  outline:none;
  border-color:var(--icon);
}
.save-option p {
  display:none;
  margin:4px 0 0 24px;
  color:var(--muted);
  font-size:10px;
  line-height:1.4;
}
.actions {
  display:grid;
  grid-template-columns:1fr 1fr;
  grid-gap:8px 10px;
}
.actions .btn-primary { grid-column:1 / -1; }
.actions .btn-primary { height:32px; }
.actions .btn-secondary,.actions .btn-text { height:28px; font-size:11px; }
#cancelCleanup[hidden] { display:none; }
#cancelCleanup { width:100%; margin-top:6px; }
.btn {
  width:100%;
  height:30px;
  border-radius:20px;
  border:1px solid transparent;
  font-size:12px;
  font-weight:500;
  transition:background .15s;
}
.btn+.btn {
  margin-top:0;
}
.btn-primary {
  background:var(--accent);
  color:white;
  position:relative;
}
.btn-primary:hover:not(:disabled) {
  background:var(--accent-hover);
}
.btn-secondary {
  background:var(--surface);
  border-color:#6a6a6a;
  color:var(--text);
}
.btn-secondary:hover:not(:disabled) {
  background:#505050;
}
.btn-text {
  background:transparent;
  color:#d2d2d2;
  height:24px;
  font-size:11px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.btn-text svg {
  width:15px;
  height:15px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.3;
  margin-right:7px;
}
.btn-text:hover:not(:disabled) {
  color:var(--icon);
  background:#4c5368;
}
footer {
  border-top:1px solid #555;
  position:relative;
  margin-top:auto;
  flex-shrink:0;
  padding:5px 12px;
  background:var(--header);
}
.status-row {
  display:flex;
  align-items:center;
  font-size:10px;
  min-height:17px;
  color:var(--muted);
  min-width:0;
  flex:1;
}
.status-dot {
  width:5px;
  height:5px;
  background:#88b8a1;
  border-radius:50%;
  margin-right:7px;
  flex-shrink:0;
}
#status {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.status-dot[data-state=error] {
  background:#e7a26c;
}
.status-dot[data-state=busy] {
  background:var(--icon);
  animation:pulse 1s infinite;
}
.status-dot[data-state=preview] {
  background:#aaa;
}
details {
  margin:4px 0 0;
  flex-shrink:0;
}
footer summary { gap:4px; }
summary {
  display:flex;
  justify-content:space-between;
  list-style:none;
  color:#b4b4b4;
  font-size:10px;
  cursor:pointer;
}
summary::-webkit-details-marker {
  display:none;
}
details[open] summary span {
  transform:rotate(180deg);
}
.log {
  position:static;
  margin:6px 0 0;
  max-height:130px;
  overflow:auto;
  white-space:pre-wrap;
  word-break:break-word;
  background:#343434;
  border:1px solid #595959;
  border-radius:6px;
  padding:9px;
  font-size:10px;
  line-height:1.7;
  color:#ccc;
  -webkit-user-select:text;
  user-select:text;
}
.modal[hidden] {
  display:none;
}
.modal {
  position:fixed;
  top:0;
  right:0;
  bottom:0;
  left:0;
  background:rgba(0,0,0,.6);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:2;
}
.dialog {
  background:var(--header);
  border:1px solid #606060;
  border-radius:12px;
  width:360px;
  max-width:100%;
  max-height:90vh;
  overflow:auto;
  padding:20px;
  box-shadow:0 15px 50px #0006;
}
.dialog header {
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.dialog h2 {
  margin:0;
  font-size:16px;
  font-weight:600;
}
.close {
  border:0;
  background:transparent;
  color:#c4c4c4;
  font-size:24px;
  padding:0 4px;
}
.dialog dl {
  margin:18px 0;
}
.dialog dt {
  color:var(--icon);
  font-weight:500;
  margin-top:13px;
}
.dialog dd {
  margin:5px 0 0;
  color:#d2d2d2;
  font-size:11px;
  line-height:1.7;
}
.dialog-note {
  font-size:10px;
  line-height:1.7;
  color:var(--muted);
  border-top:1px solid #606060;
  padding-top:12px;
}
::-webkit-scrollbar {
  width:5px;
}
::-webkit-scrollbar-thumb {
  background:#6a6a6a;
  border-radius:4px;
}
@keyframes pulse {
  50% {
    opacity:.3;
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    animation:none!important;
    transition:none!important;
  }
}
