:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #16181d; --muted: #6b7280; --line: #e5e7eb;
  --accent: #1d4ed8; --accent-soft: #e8eefc; --ok: #15803d; --ok-soft: #e7f5ec;
  --warn: #b45309; --warn-soft: #fdf3e3; --bad: #b91c1c; --bad-soft: #fdecec;
  --run: #6d28d9; --run-soft: #f1ebfd; --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --card: #171a21; --text: #e8eaee; --muted: #9aa1ad; --line: #2a2f3a;
    --accent: #6b9bff; --accent-soft: #1b2540; --ok: #4ade80; --ok-soft: #13291c;
    --warn: #fbbf24; --warn-soft: #2d2410; --bad: #f87171; --bad-soft: #2e1515;
    --run: #a78bfa; --run-soft: #231b3a;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, sans-serif; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px;
  border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 2; }
.brand { font-weight: 700; display: flex; align-items: center; gap: 10px; }
.brand .muted { font-weight: 400; }
.top-actions { display: flex; align-items: center; gap: 12px; }
#signOut { color: var(--muted); text-decoration: none; }
#signOut:hover { color: var(--text); }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 15px; }
main { max-width: 920px; margin: 0 auto; padding: 28px 16px 40px; }
.intro h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.01em; }
.intro p { margin: 0 0 22px; color: var(--muted); max-width: 640px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card.disabled { opacity: .45; pointer-events: none; }
.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-head h2 { font-size: 17px; margin: 0; }
.num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.check { color: var(--ok); font-weight: 700; margin-left: auto; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 26px 16px; cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop.compact { flex-direction: row; justify-content: center; padding: 10px; gap: 8px; }
.drop.compact .drop-icon, .drop.compact .small { display: none; }
.drop-icon { font-size: 22px; color: var(--accent); }
.summary { margin-top: 12px; padding: 12px 14px; background: var(--ok-soft); border-radius: 10px; }
.summary .chips { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); }
.error { margin-top: 12px; padding: 12px 14px; background: var(--bad-soft); color: var(--bad); border-radius: 10px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.stat { flex: 1 1 140px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.stat b { display: block; font-size: 20px; }
.stat.warn b { color: var(--warn); }
.warn { margin-top: 10px; background: var(--warn-soft); border-radius: 10px; padding: 10px 14px; }
.warn summary { cursor: pointer; color: var(--warn); font-weight: 500; }
.warn ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; max-height: 160px; overflow: auto; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 14px; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.bar.big { height: 12px; margin-top: 4px; }
.upload .small { margin-top: 6px; }
.run { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin: 4px 0 20px; flex-wrap: wrap; }
.estimate { color: var(--muted); font-size: 14px; }
button, a.primary { font: inherit; border-radius: 10px; padding: 10px 18px; cursor: pointer; border: 1px solid var(--line);
  background: var(--card); color: var(--text); text-decoration: none; font-weight: 500; }
.primary { background: var(--accent) !important; color: #fff !important; border-color: var(--accent) !important; }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.ghost { background: transparent; }
.prog-line { display: flex; justify-content: space-between; margin-top: 8px; font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 16px 0; }
.tile { padding: 10px 14px; border-radius: 10px; background: var(--bg); }
.tile b { display: block; font-size: 20px; }
.done-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px; border-radius: 10px; background: var(--ok-soft); margin-bottom: 16px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.filters button { padding: 5px 12px; font-size: 13px; border-radius: 99px; }
.filters button.on { background: var(--text); color: var(--card); border-color: var(--text); }
.table-wrap { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; position: sticky; top: 0; background: var(--card); color: var(--muted); font-weight: 500;
  padding: 8px 12px; border-bottom: 1px solid var(--line); }
td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.file { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; min-width: 260px; width: 40%; }
td .note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.s-queued { background: var(--bg); color: var(--muted); }
.s-transcribing, .s-classifying { background: var(--run-soft); color: var(--run); }
.s-done { background: var(--ok-soft); color: var(--ok); }
.s-review { background: var(--warn-soft); color: var(--warn); }
.s-failed { background: var(--bad-soft); color: var(--bad); }
footer { text-align: center; padding: 0 16px 30px; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px 28px; text-align: center; }
.auth-brand { justify-content: center; margin-bottom: 24px; }
.auth-card h1 { font-size: 22px; margin: 0 0 8px; }
.auth-card > p.muted { margin: 0 0 24px; }
.auth-button { display: block; width: 100%; text-align: center; padding: 12px 18px; border-radius: 10px;
  text-decoration: none; font-weight: 600; border: 1px solid var(--line); color: var(--text); }
.auth-note { margin: 20px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
@media (max-width: 600px) {
  .top { padding: 12px 16px; } .brand .muted { display: none; } .user { display: none; }
  th:nth-child(2), td:nth-child(2) { display: none; }
}
