:root {
  --bg: #ffffff;
  --text: #1f2328;
  --muted: #59636e;
  --line: #d1d9e0;
  --accent: #c2410c;
  --ok: #1a7f37;
  --bad: #cf222e;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1f1f;
    --text: #e6edf3;
    --muted: #9198a1;
    --line: #3d444d;
    --accent: #f97316;
    --ok: #3fb950;
    --bad: #f85149;
  }
}
/* Teams tells the page its theme; app.js sets this. */
:root[data-theme="dark"], :root[data-theme="contrast"] {
  --bg: #1f1f1f;
  --text: #e6edf3;
  --muted: #9198a1;
  --line: #3d444d;
  --accent: #f97316;
  --ok: #3fb950;
  --bad: #f85149;
}
:root[data-theme="default"] {
  --bg: #ffffff;
  --text: #1f2328;
  --muted: #59636e;
  --line: #d1d9e0;
  --accent: #c2410c;
  --ok: #1a7f37;
  --bad: #cf222e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
}
main { padding: 16px; max-width: 520px; }
h1 { font-size: 18px; margin: 0 0 4px; }
.lead, .small { color: var(--muted); }
.lead { margin: 0 0 16px; }
.small { font-size: 13px; }

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 0 0 16px;
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

button {
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  min-height: 44px;
}
button:disabled { opacity: .6; cursor: default; }
button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.meter {
  margin-top: 16px;
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
#meter { height: 100%; width: 0; background: var(--ok); transition: width 60ms linear; }
#meter-note { margin: 6px 0 0; color: var(--muted); }

#result { font-weight: 600; margin: 16px 0 4px; }
#result.ok { color: var(--ok); }
#result.bad { color: var(--bad); }

/* ── Captions (index.html): fills the side panel; the feed scrolls, newest at the bottom. ── */
body.captions {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 8px;
}
.bar h1 { margin: 0; }
.bar .small { margin: 2px 0 0; }
.small.bad { color: var(--bad); }
button.stop { background: transparent; color: var(--text); border: 1px solid var(--line); }
.level { height: 3px; margin: 0 16px; background: var(--line); border-radius: 2px; overflow: hidden; }
#level { height: 100%; width: 0; background: var(--ok); transition: width 60ms linear; }

.feed {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.empty { color: var(--muted); margin: 0; }
.line {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 0 0 14px;
}
.line .body { min-width: 0; }
.line p { margin: 0; overflow-wrap: anywhere; }
/* The translation is what the other person reads, so it is the strongest text on the line. */
.tr { color: var(--accent); font-weight: 600; margin-top: 2px !important; }
.tr.waiting { color: var(--muted); font-weight: 400; }
.tr.failed { color: var(--bad); font-weight: 400; font-size: 13px; }
.also { color: var(--muted); font-size: 13px; }
.lang {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
}
.partial {
  min-height: 1.45em;
  margin: 0;
  padding: 8px 16px 12px;
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--line);
}
