:root {
  --bg: #f5f6f8; --surface: #fff; --fg: #1b2230; --muted: #5b6577; --line: #dde1e8;
  --accent: #2f5d9e; --accent-fg: #fff; --ok: #1f7a4d; --bad: #b3261e; --wait: #8a5a00;
  --s0: #2f5d9e; --s1: #8a3ffc; --s2: #1f7a4d; --s3: #b3261e; --s4: #8a5a00; --s5: #00739e; --s6: #a3317c; --s7: #4d5b1c;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161d; --surface: #1a2029; --fg: #e4e8ef; --muted: #9aa4b5; --line: #2b3340;
    --accent: #7fa8e6; --accent-fg: #0d1420; --ok: #5fcf97; --bad: #ff8a80; --wait: #f0b35a;
    --s0: #7fa8e6; --s1: #c4a1ff; --s2: #5fcf97; --s3: #ff8a80; --s4: #f0b35a; --s5: #5ec8f0; --s6: #f08ac9; --s7: #c2d17a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding: 24px 16px 64px; }
main { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
main.narrow { max-width: 420px; padding-top: 8vh; }
[hidden] { display: none !important; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 18px; margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; }
.bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.bar h1, .bar h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.err { color: var(--bad); margin: 0; min-height: 1.2em; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--fg); }
input, select, textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 9px 16px; background: var(--accent); color: var(--accent-fg); cursor: pointer; }
button.small { padding: 5px 12px; font-size: 14px; }
button.link { background: none; color: var(--accent); padding: 4px 6px; }
button.danger { color: var(--bad); }
a { color: var(--accent); }

.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 28px 16px; text-align: center; cursor: pointer; align-items: center; color: var(--muted); }
.drop b { color: var(--fg); font-size: 17px; }
.drop.over { border-color: var(--accent); background: var(--bg); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.uploads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.uploads li { display: grid; grid-template-columns: minmax(0, 1fr) 160px 130px; gap: 12px; align-items: center; font-size: 14px; }
.uploads .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploads progress { width: 100%; }
.uploads li.bad .s { color: var(--bad); }

.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
td.name { overflow-wrap: anywhere; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.act { white-space: nowrap; text-align: right; }
.pill { display: inline-block; font-size: 13px; padding: 2px 10px; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap; }
.pill.queued { color: var(--muted); }
.pill.running { color: var(--wait); }
.pill.done { color: var(--ok); }
.pill.error { color: var(--bad); cursor: help; }

.downloads { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.spk { font-weight: 600; }
.transcript { border-top: 1px solid var(--line); padding-top: 12px; max-height: 70vh; overflow-y: auto; }
.transcript p { margin: 0 0 8px; max-width: 80ch; }
.transcript time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; margin-right: 10px; }
.transcript b { margin-right: 6px; }
.c0 { color: var(--s0); } .c1 { color: var(--s1); } .c2 { color: var(--s2); } .c3 { color: var(--s3); }
.c4 { color: var(--s4); } .c5 { color: var(--s5); } .c6 { color: var(--s6); } .c7 { color: var(--s7); }

.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.qr { align-self: center; background: #fff; border-radius: 8px; }
.secret { align-self: center; font: 600 15px/1.4 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; user-select: all; }

@media (max-width: 600px) {
  .uploads li { grid-template-columns: 1fr; gap: 2px; }
  th:nth-child(4), td:nth-child(4) { display: none; }
}