:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #1b1b1a;
  --muted: #6b6a66;
  --line: #e3e1db;
  --accent: #f38020;
  --accent-text: #ffffff;
  --ok: #1f8a4c;
  --err: #c2392b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --card: #1d1d1b;
    --text: #ecebe7;
    --muted: #9a9892;
    --line: #2e2d2a;
    --ok: #4cc27c;
    --err: #ff6b5b;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
main { max-width: 680px; margin: 0 auto; padding: 32px 16px 64px; }
header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; }
h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 24px 0 8px; }
label[for="password"] { display: block; font-weight: 600; margin-bottom: 6px; }
.row { display: flex; gap: 8px; }
input[type="password"], input.url {
  flex: 1; min-width: 0;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--text); font: inherit;
}
button {
  padding: 10px 16px; border: 0; border-radius: 8px;
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer;
}
button.small { padding: 5px 10px; font-size: 13px; }
button.link { background: none; color: var(--muted); padding: 0; font-weight: 500; text-decoration: underline; }
button.small.link { padding: 5px 4px; }
.error { color: var(--err); margin: 8px 0 0; }

#drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 48px 16px; border: 2px dashed var(--line); border-radius: 14px;
  background: var(--card); cursor: pointer; text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
#drop.over, #drop:hover { border-color: var(--accent); }
#drop strong { font-size: 17px; }
#drop span { color: var(--muted); }
#file-input { display: none; }
.hint { color: var(--muted); font-size: 13px; margin: 12px 2px 0; }

ul { list-style: none; padding: 0; margin: 0; }
#queue { margin-top: 20px; display: grid; gap: 12px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.item-head, .item-foot { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { color: var(--muted); font-size: 13px; white-space: nowrap; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 10px 0 8px; }
.fill { height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.item.done .fill { background: var(--ok); }
.stats { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 6px; }
.result { display: flex; gap: 8px; margin-top: 10px; }
input.url { font-size: 13px; padding: 6px 10px; }

#unfinished-list li, #files li {
  display: flex; justify-content: space-between; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
#unfinished-list li span:last-child, #files li span:last-child { color: var(--muted); white-space: nowrap; }
#files a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#files-box { margin-top: 28px; }
#files-box summary { cursor: pointer; color: var(--muted); font-weight: 600; }
#files { margin-top: 8px; }
