:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #fbf7ee; color: #062947; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #fffaf0, #f8f4eb); }
.listener-shell { width: min(100%, 44rem); margin: 0 auto; padding: max(1.25rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(4rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); }
.site-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; align-items: center; padding-bottom: 1rem; margin-bottom: 2rem; border-bottom: .125rem solid #a0f4f0; }
.brand { color: #062947; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.privacy-note { color: #3f6274; font-size: .82rem; font-weight: 650; }
.eyebrow { margin: 0 0 .6rem; color: #3f6274; font-size: .78rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 7vw, 3.25rem); line-height: 1.08; letter-spacing: -.03em; }
.muted { max-width: 38rem; color: #3f6274; line-height: 1.55; }
.caption-card { min-height: 16rem; margin-top: 2rem; padding: clamp(1.25rem, 5vw, 2rem); border: 1px solid #d6e7e8; border-radius: 1.6rem; background: #fffdf9; box-shadow: 0 .75rem 2rem #06294712; }
.status-line { display: flex; gap: .65rem; align-items: center; min-height: 1.75rem; }
.status-dot { width: .7rem; height: .7rem; flex: 0 0 auto; border-radius: 50%; background: #0a858c; }
.status { margin: 0; color: #315568; font-size: .9rem; font-weight: 700; }
.caption-heading { margin: 1.75rem 0 .55rem; color: #3f6274; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.target-caption { margin: 0; overflow-wrap: anywhere; font-size: clamp(1.8rem, 6.5vw, 3rem); font-weight: 700; line-height: 1.22; }
.source-caption { margin: 1.25rem 0 0; padding-top: 1.1rem; border-top: 1px solid #dcebf1; color: #3f6274; font-size: 1rem; line-height: 1.55; }
.controls { display: grid; grid-template-columns: 2.75rem repeat(2, minmax(0, 1fr)); gap: clamp(.4rem, 2vw, .75rem); margin-top: 1rem; align-items: end; }
button, select { width: 100%; min-height: 2.75rem; border: 1px solid #9db2bc; border-radius: .8rem; background: #fffdf9; color: #062947; font: inherit; padding: .55rem .7rem; }
button { font-weight: 650; cursor: pointer; }
button:hover { border-color: #0a858c; }
button:focus-visible, select:focus-visible { outline: .2rem solid #ef7132; outline-offset: .18rem; }
label { display: grid; min-width: 0; gap: .3rem; color: #315568; font-size: .82rem; font-weight: 650; }
.tts-toggle { display: grid; width: 2.75rem; padding: .55rem; place-items: center; }
.tts-icon { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tts-icon-on, .tts-toggle[aria-pressed="true"] .tts-icon-off { display: none; }
.tts-toggle[aria-pressed="true"] .tts-icon-on { display: block; }
.retry { width: auto; margin-top: 1.5rem; }
.guidance { margin-top: 1.5rem; padding: 1rem 1.1rem; border-radius: 1rem; background: #fff5e8; color: #234b60; line-height: 1.5; }
.guidance ol { margin: .55rem 0; padding-left: 1.35rem; }
.guidance p { margin: .55rem 0 0; font-size: .88rem; }
.language-control { margin-top: 1.5rem; padding: 1.1rem; border: 1px solid #e6bd70; border-radius: 1rem; background: #fffaf0; }
.language-control h2 { margin: 0 0 .8rem; font-size: 1.15rem; }
.language-control .muted { margin-bottom: 0; }
button:disabled, select:disabled { color: #667985; background: #f0ede7; cursor: not-allowed; }
.recent { margin-top: 2.5rem; }
.recent h2 { margin: 0 0 1rem; font-size: 1.2rem; }
.history { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.history li { padding: 1rem 1.1rem; border: 1px solid #e1e6e3; border-left: .38rem solid #d4a94e; border-radius: 1rem; background: #fffdf9; line-height: 1.4; overflow-wrap: anywhere; }
.history li:nth-child(even) { border-left-color: #0a858c; }
.history small { display: block; margin-top: .4rem; color: #3f6274; }
.listener-shell[data-text-size="large"] .target-caption { font-size: clamp(2.25rem, 8vw, 3.75rem); }
.listener-shell[data-text-size="xlarge"] .target-caption { font-size: clamp(2.7rem, 9vw, 4.5rem); }
.listener-shell[data-text-size="large"] .source-caption, .listener-shell[data-text-size="large"] .history { font-size: 1.15rem; }
.listener-shell[data-text-size="xlarge"] .source-caption, .listener-shell[data-text-size="xlarge"] .history { font-size: 1.3rem; }
.listener-shell[data-mode="local"] .caption-card, .listener-shell[data-mode="global"] .caption-card { border-color: #e6bd70; }
.listener-shell[data-mode="online"][data-state="waiting"] .caption-card, .listener-shell[data-mode="online"][data-state="capacity"] .caption-card, .listener-shell[data-mode="online"][data-state="unreachable"] .caption-card { border-color: #f6d491; background: #fffaf2; }
.listener-shell[data-mode="online"][data-state="reconnecting"] .caption-card, .listener-shell[data-mode="online"][data-state="ended"] .caption-card, .listener-shell[data-mode="online"][data-state="expired"] .caption-card, .listener-shell[data-mode="online"][data-state="invalid"] .caption-card, .listener-shell[data-mode="online"][data-state="unsupported"] .caption-card { border-color: #a0f4f0; background: #f8fdfc; }
.listener-shell[data-state="reconnecting"] .status-dot, .listener-shell[data-state="unreachable"] .status-dot, .listener-shell[data-mode="global"] .status-dot { background: #c55420; }
.listener-shell[data-state="expired"] .status-dot, .listener-shell[data-state="unsupported"] .status-dot, .listener-shell[data-state="invalid"] .status-dot { background: #536b78; }
.listener-shell[data-mode="online"][data-state="waiting"] .status-dot, .listener-shell[data-mode="online"][data-state="capacity"] .status-dot, .listener-shell[data-mode="online"][data-state="unreachable"] .status-dot { background: #c55420; }
.listener-shell[data-mode="online"][data-state="reconnecting"] .status-dot, .listener-shell[data-mode="online"][data-state="ended"] .status-dot { background: #0a858c; }
.listener-shell[data-mode="online"][data-state="expired"] .status-dot, .listener-shell[data-mode="online"][data-state="unsupported"] .status-dot, .listener-shell[data-mode="online"][data-state="invalid"] .status-dot { background: #536b78; }
@media (max-width: 34rem) { .caption-card { min-height: 14rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
@media (forced-colors: active) { .status-dot { border: 1px solid CanvasText; } .caption-card, .history li { border-color: CanvasText; } }
