:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #17171a;
  --muted: #6b6b73;
  --line: #e4e2dc;
  --accent: #17171a;
  --accent-text: #ffffff;
  --ok: #1f8a4c;
  --warn: #b7791f;
  --bad: #c0392b;
  --drop: #faf9f6;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113; --card: #1a1a1d; --text: #ededf0; --muted: #9a9aa3; --line: #2c2c31;
    --accent: #ededf0; --accent-text: #111113; --drop: #151518; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111113; --card: #1a1a1d; --text: #ededf0; --muted: #9a9aa3; --line: #2c2c31;
  --accent: #ededf0; --accent-text: #111113; --drop: #151518; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
main { max-width: 680px; margin: 0 auto; padding: 48px 16px 64px; }
header { margin-bottom: 28px; }
.mark { font-size: 11px; letter-spacing: .28em; color: var(--muted); font-weight: 600; }
h1 { font-size: 30px; margin: 6px 0 8px; font-weight: 600; letter-spacing: -.01em; }
.tag { font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; vertical-align: middle; }
.lede { color: var(--muted); margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 16px; }
.hidden { display: none !important; }
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.row.center { justify-content: center; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
#code { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; }
.num { width: 80px; }
button { font: inherit; border-radius: 9px; padding: 9px 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
.msg { min-height: 1.5em; margin: 8px 0 0; color: var(--bad); font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.status-line { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); flex: none; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.drop { border: 1.5px dashed var(--line); border-radius: 12px; padding: 28px 16px; text-align: center; background: var(--drop); transition: border-color .15s; }
.drop p { margin: 4px 0; }
.drop.over { border-color: var(--text); }
.advanced { margin: 16px 0 4px; }
.advanced summary { cursor: pointer; color: var(--muted); font-size: 14px; }
#progress { margin-top: 20px; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
#bar-fill { height: 100%; width: 0; background: var(--text); transition: width .3s; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 6px; }
.stats div { display: flex; flex-direction: column; }
.k { font-size: 12px; color: var(--muted); }
.v { font-size: 17px; font-variant-numeric: tabular-nums; font-weight: 500; }
.list { list-style: none; padding: 0; margin: 18px 0 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.list li .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.list li .state { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.list li.done .state { color: var(--ok); }
.list li.err .state { color: var(--bad); }
@media (max-width: 520px) {
  main { padding-top: 28px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
