:root {
  --ground: #e9eeed;
  --panel: #fafcfb;
  --field: #ffffff;
  --line: #d0dad7;
  --line-strong: #b0bfbb;
  --ink: #0e1a17;
  --muted: #52625e;
  --accent: #0b8a66;
  --accent-ink: #ffffff;
  --accent-soft: #d7f0e7;
  --good: #0b7a5a;
  --warn: #a35f00;
  --bad: #c0303c;
  --shadow: 0 1px 0 rgba(14,26,23,.04), 0 14px 34px -18px rgba(14,26,23,.3);
  --sans: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  --ground: #0b1412;
  --panel: #121e1b;
  --field: #0c1614;
  --line: #22332f;
  --line-strong: #345049;
  --ink: #e6f0ed;
  --muted: #95a9a3;
  --accent: #3fd6a2;
  --accent-ink: #052018;
  --accent-soft: #123a2e;
  --good: #46dba6;
  --warn: #f0b04a;
  --bad: #ff7a85;
  --shadow: 0 14px 34px -18px rgba(0,0,0,.7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0b1412; --panel: #121e1b; --field: #0c1614; --line: #22332f; --line-strong: #345049;
    --ink: #e6f0ed; --muted: #95a9a3; --accent: #3fd6a2; --accent-ink: #052018; --accent-soft: #123a2e;
    --good: #46dba6; --warn: #f0b04a; --bad: #ff7a85; --shadow: 0 14px 34px -18px rgba(0,0,0,.7);
  }
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px 56px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.brand small { font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tools { display: flex; gap: 8px; align-items: center; }
.lang { display: flex; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); overflow: hidden; }
.lang button { border: 0; background: transparent; padding: 6px 11px; cursor: pointer; font: 600 12px var(--mono); color: var(--muted); letter-spacing: .04em; }
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.theme-btn { border: 1px solid var(--line-strong); background: var(--panel); border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.theme-btn:hover { border-color: var(--accent); }

.intro { padding: 26px 0 26px; max-width: 660px; }
.intro h1 { margin: 0 0 10px; font-size: clamp(30px, 5vw, 46px); line-height: 1.04; letter-spacing: -.035em; font-weight: 750; text-wrap: balance; }
.intro p { margin: 0; color: var(--muted); font-size: 16px; max-width: 56ch; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.side { position: sticky; top: 16px; display: grid; gap: 16px; }
@media (max-width: 860px) { .side { position: static; } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.hint { font-size: 13px; color: var(--muted); }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 190px; border: 1.5px dashed var(--line-strong); border-radius: 8px; background: var(--field); cursor: pointer; padding: 24px;
}
.drop { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 400; color: var(--ink); }
.drop strong { font-weight: 650; }
.drop:hover, .drop.dragging { border-color: var(--accent); background: var(--accent-soft); }
.drop-mark { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.drop-mark svg { width: 22px; height: 22px; }
.drop .sub { color: var(--muted); font-size: 13px; }

.file-list { display: grid; gap: 8px; margin-top: 14px; }
.file-list:empty { display: none; }
.file-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); }
.file-row img { width: 48px; height: 48px; border-radius: 4px; object-fit: cover; background:
  conic-gradient(#0000 25%, rgba(120,130,150,.18) 0 50%, #0000 0 75%, rgba(120,130,150,.18) 0) 0 0/10px 10px; }
.file-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 14px; }
.file-meta { font: 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.file-meta b { color: var(--ink); font-weight: 600; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .35s ease; }
.bar.worse i { background: var(--warn); }
.file-act { text-align: right; font-size: 13px; display: grid; gap: 4px; justify-items: end; }
.file-act a { color: var(--accent); font-weight: 650; text-decoration: none; }
.file-act a:hover { text-decoration: underline; }
.file-act .pct { font: 600 13px var(--mono); color: var(--good); }
.file-act .pct.worse { color: var(--warn); }
.file-act .err { color: var(--bad); font-size: 12px; }
.rm { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 4px 6px; border-radius: 4px; }
.rm:hover { color: var(--bad); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.range { display: flex; align-items: center; gap: 12px; }
.range input { flex: 1; accent-color: var(--accent); }
.range output { font: 13px var(--mono); min-width: 74px; text-align: right; font-variant-numeric: tabular-nums; }
.note { margin: 0; font-size: 12.5px; color: var(--muted); min-height: 18px; }
select { width: 100%; padding: 10px 12px; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--field); }
select:hover { border-color: var(--accent); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.btn { border: 1px solid var(--line-strong); background: var(--panel); border-radius: 6px; padding: 10px 14px; font-weight: 650; cursor: pointer; min-height: 44px; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); grid-column: 1 / -1; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn[hidden], .linkbtn[hidden] { display: none; }
.linkbtn { border: 0; background: none; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 13px; padding: 10px 4px; }
.linkbtn:hover { color: var(--bad); }
.status { margin: 12px 0 0; min-height: 20px; font-size: 13px; color: var(--muted); }

.summary .big { font: 750 44px/1 var(--sans); letter-spacing: -.04em; color: var(--accent); font-variant-numeric: tabular-nums; }
.summary .sum-line { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.summary[hidden] { display: none; }

footer { margin-top: 32px; color: var(--muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) { .bar i { transition: none; } }
