:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel2: #1d212a;
  --line: #2a2f3a;
  --text: #e6e8ee;
  --muted: #99a1b3;
  --accent: #6ea8fe;
  --good: #4ade80;
  --bad: #f87171;
  --warn: #fbbf24;
  --openai: #10a37f;
  --deepgram: #a78bfa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

h1 { font-size: 18px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 8px; }
h3 { font-size: 14px; margin: 0 0 10px; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
.block { display: block; margin-bottom: 6px; }
.hidden { display: none !important; }
.center { align-items: center; }
.wrap { flex-wrap: wrap; }
.row { display: flex; }
.gap { gap: 10px; }
.sep { width: 1px; background: var(--line); align-self: stretch; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.banner {
  background: #2a1f10;
  border-bottom: 1px solid #4a3a18;
  color: #f5d08a;
  padding: 8px 18px;
  font-size: 12px;
}

.tabs { display: flex; gap: 4px; padding: 10px 18px 0; border-bottom: 1px solid var(--line); }
.tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 7px 7px 0 0;
  cursor: pointer;
  font-size: 13px;
}
.tab.active { background: var(--panel); border-color: var(--line); color: var(--text); }

main { padding: 16px 18px 60px; max-width: 1400px; margin: 0 auto; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

button {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 13px;
  cursor: pointer;
  font-size: 13px;
}
button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { background: var(--accent); color: #0b0e14; border-color: var(--accent); font-weight: 600; }
button.ghost { background: transparent; }
button.link { background: none; border: none; color: var(--accent); padding: 2px 4px; font-size: 12px; text-decoration: underline; }
button.rec { background: var(--bad); border-color: var(--bad); color: #fff; }

input, select, textarea {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}
textarea { width: 100%; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
label { color: var(--muted); }
label input, label select { margin-left: 5px; color: var(--text); }
.check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; cursor: pointer; }
.check input { margin: 0; }

.filebtn {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 13px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
}
.filebtn:hover { border-color: var(--accent); }
.filebtn input { display: none; }

.chips { display: inline-flex; gap: 6px; }
.chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel2);
}
.chip.ok { border-color: #2f6f4b; color: var(--good); }
.chip.miss { border-color: #6f2f2f; color: var(--bad); }

.tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.tag.generated { border-color: #4a5a2f; color: #b6d47a; }
.tag.real { border-color: #2f4a6f; color: #8ab6f0; }
.tag.unverified { border-color: #6f5a2f; color: var(--warn); }
.tag.calibrated { border-color: #2f6f4b; color: var(--good); }

.provider h3 { border-bottom: 2px solid var(--line); padding-bottom: 6px; }
#liveCard-openai h3 { border-color: var(--openai); }
#liveCard-deepgram h3 { border-color: var(--deepgram); }
.tagline { color: var(--muted); font-weight: 400; font-size: 11px; }

.metrics { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; }
.metric b { display: block; font-size: 15px; font-family: ui-monospace, Menlo, monospace; }
.metric span { color: var(--muted); font-size: 11px; }

.transcript {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  min-height: 70px;
  max-height: 300px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 13px;
}
.stream {
  background: #101319;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  min-height: 0;
  max-height: 120px;
  overflow: auto;
  font-size: 12px;
  color: var(--muted);
}
.stream:empty { display: none; }
.stream .final { color: var(--text); }

.progress { height: 5px; background: var(--panel2); border-radius: 3px; overflow: hidden; }
#progressBar { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }

.bench-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.bench-row:last-child { border-bottom: none; }
.bench-row .title { font-size: 13px; }
.bench-row .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.bench-row .res { display: flex; gap: 12px; font-size: 12px; align-items: center; }
.bench-row .res .cell { min-width: 92px; text-align: right; }

audio { width: 100%; height: 34px; }

table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 7px 9px; text-align: right; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
th.l, td.l { text-align: left; }
th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
tr.winner td { background: rgba(74, 222, 128, 0.07); }
td.win { color: var(--good); font-weight: 600; }
td.lose { color: var(--bad); }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  width: min(520px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-box label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.modal-box input { width: 100%; }

.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 54px 30px;
  text-align: center;
  margin-bottom: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.hero.drag { border-color: var(--accent); background: #1a2333; }
.hero-icon { font-size: 42px; line-height: 1; margin-bottom: 14px; }
.hero h2 { font-size: 22px; margin: 0 0 8px; }
.hero-sub { color: var(--muted); max-width: 520px; margin: 0 auto 26px; font-size: 14px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-hint { color: var(--muted); font-size: 12px; margin: 22px 0 0; }

.bigbtn {
  font-size: 15px;
  padding: 14px 26px;
  border-radius: 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
}
.bigbtn:hover { border-color: var(--accent); }
.bigbtn.primary { background: var(--accent); color: #0b0e14; border-color: var(--accent); font-weight: 600; }
.bigbtn input { display: none; }

.recdot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bad); animation: pulse 1.1s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner.inline { display: inline-block; width: 10px; height: 10px; border-width: 2px; vertical-align: -1px; }

.hero-toggle { margin-top: 18px; font-size: 13px; color: var(--muted); }

.verdict { display: flex; flex-direction: column; gap: 2px; }
.bn-row {
  display: grid;
  grid-template-columns: 1fr minmax(170px, 250px) 1fr;
  align-items: center;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.bn-row:last-of-type { border-bottom: none; }
.bn { text-align: center; opacity: 0.5; }
.bn.win { opacity: 1; }
.bn-v { font-size: 38px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bn.win .bn-v { color: var(--good); font-weight: 400; }
.bn-p { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 5px; }
.bn-mid { text-align: center; }
.bn-label { font-size: 13px; color: var(--text); }
.bn-note { font-size: 11px; color: var(--muted); margin-top: 3px; }
.bn-foot { margin: 14px 0 0; text-align: center; }
@media (max-width: 700px) {
  .bn-row { grid-template-columns: 1fr 1fr; }
  .bn-mid { grid-column: 1 / -1; order: -1; }
  .bn-v { font-size: 30px; }
}

.verdict-legacy { display: flex; flex-wrap: wrap; gap: 10px; }
.verdict-item {
  flex: 1 1 210px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
}
.verdict-item .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.verdict-item .v { font-size: 19px; font-weight: 600; margin: 5px 0 3px; }
.verdict-item .n { font-size: 12px; color: var(--muted); }
.verdict-item.win { border-color: #2f6f4b; }
.verdict-item.win .v { color: var(--good); }

.advanced { padding: 0; }
.advanced summary { padding: 13px 14px; color: var(--muted); }
.advanced[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; color: var(--accent); }
.advanced > *:not(summary) { padding: 0 14px; }
.advanced > *:last-child { padding-bottom: 14px; }

.diff { font-size: 13px; line-height: 1.9; }
.diff .sub { background: rgba(248, 113, 113, 0.18); color: #ffb4b4; border-bottom: 2px solid var(--bad); }
.diff .del { background: rgba(251, 191, 36, 0.14); color: var(--warn); text-decoration: line-through; }
.diff .ins { background: rgba(110, 168, 254, 0.16); color: var(--accent); }
.legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); }

details summary { cursor: pointer; font-size: 12px; color: var(--accent); padding: 4px 0; }
.err { color: var(--bad); font-size: 12px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 2px; }
.section-title h2 { margin: 0; }
