:root { --size: 26px; --bg: #111214; --ink: #f2f3f5; --muted: #9ba1aa; --dim: #7d838c; --line: #26292e; --accent: #7aa2f7; color-scheme: dark; }
@media (prefers-color-scheme: light) { :root { --bg: #fbfbfc; --ink: #15171a; --muted: #5d636c; --dim: #8a9099; --line: #e4e6ea; --accent: #2457c5; color-scheme: light; } }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; min-height: 100vh; padding-bottom: 96px; }
header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
h1 { font-size: 17px; margin: 0; font-weight: 600; }
.tools { display: flex; gap: 6px; }
button { font: inherit; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-height: 40px; cursor: pointer; }
.switch { color: var(--accent); border-color: var(--accent); }
.banner { margin: 16px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; }
main { padding: 8px 16px; }
.line { font-size: var(--size); line-height: 1.45; margin: 0 0 0.6em; overflow-wrap: anywhere; }
.line.original { color: var(--muted); }
.line.interim { opacity: .9; }   /* still being spoken: readable, only slightly lighter */
.latest { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(56px + env(safe-area-inset-bottom)); background: var(--accent); border-color: var(--accent); color: #fff; border-radius: 999px; padding: 8px 18px; }
footer { position: fixed; bottom: 0; left: 0; right: 0; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--muted); background: var(--bg); border-top: 1px solid var(--line); }
.choose { position: fixed; inset: 0; z-index: 5; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; }
.choose[hidden], .latest[hidden], .banner[hidden] { display: none; }
.choose-title { text-align: center; font-size: 20px; margin: 0 0 8px; }
.choose-title span { color: var(--muted); font-size: 16px; }
.choice { width: min(320px, 100%); font-size: 22px; padding: 16px; border-radius: 12px; }

/* screen readers hear each finished sentence once (the caption list itself is not announced) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* no translation could be made: the original is shown, marked */
.line.fallback { opacity: .8; font-style: italic; }
.line.fallback::after { content: " ⋯"; opacity: .6; }
.banner.warn { color: #b4441b; }
