:root { color-scheme: light; font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); background: var(--page); --page: #fff; --text: #171717; --control: #f5f5f5; --border: #888; --button: #242424; --pulse-button: #444; --button-text: #fff; --disabled: #d6d6d6; --disabled-text: #555; --muted: #555; --error: #a00; --focus: #555; }
:root[data-theme="dark"] { color-scheme: dark; --page: #171717; --text: #f1f1f1; --control: #292929; --border: #aaa; --button: #f1f1f1; --pulse-button: #d8d8d8; --button-text: #171717; --disabled: #444; --disabled-text: #bbb; --muted: #bbb; --error: #ff8787; --focus: #ddd; }
* { box-sizing: border-box; }
body { min-height: 100svh; display: flex; flex-direction: column; margin: 0; padding: clamp(16px, 3vw, 32px); }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#engine-status { margin: 12px 0 0; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.1; font-weight: 600; margin: 0; }
main { width: min(100%, 680px); margin-top: 24px; }
#theme-toggle { display: grid; place-items: center; width: 32px; height: 32px; padding: 3px; flex: none; }
#theme-toggle svg { width: 18px; height: 18px; }
#theme-toggle .sun, :root[data-theme="dark"] #theme-toggle .moon { display: none; }
:root[data-theme="dark"] #theme-toggle .sun { display: block; }
button, select, textarea { font: inherit; color: inherit; cursor: pointer; }
button { padding: 2px 8px; border: 1px solid var(--button); background: var(--button); color: var(--button-text); }
button:disabled { border-color: var(--disabled); background: var(--disabled); color: var(--disabled-text); cursor: default; }
a { color: inherit; text-underline-offset: 3px; }
select { appearance: none; -webkit-appearance: none; display: block; width: 100%; background-color: var(--page); background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%); background-position: calc(100% - 7px) 50%, calc(100% - 3px) 50%; background-size: 4px 4px; background-repeat: no-repeat; border: 0; border-radius: 0; padding: 4px 20px 4px 0; }
.controls { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; }
#audio-toggle:not(:disabled)[data-active="false"] { animation: audio-idle 1.5s ease-in-out infinite; }
@keyframes audio-idle { 50% { background-color: var(--pulse-button); } }
@media (prefers-reduced-motion: reduce) { #audio-toggle { animation: none !important; } }
#audio-hint { margin: 8px 0 0; color: var(--muted); }
#status { display: grid; place-items: center; width: 24px; height: 24px; flex: none; }
#status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--status-color); }
#status[data-state="idle"] { --status-color: #777; }
#status[data-state="waiting"] { --status-color: #bb8200; }
#status[data-state="active"] { --status-color: #198754; }
#status[data-state="error"] { --status-color: #d43f3f; }
:root[data-theme="dark"] #status[data-state="idle"] { --status-color: #aaa; }
:root[data-theme="dark"] #status[data-state="waiting"] { --status-color: #f0b429; }
:root[data-theme="dark"] #status[data-state="active"] { --status-color: #40c98b; }
:root[data-theme="dark"] #status[data-state="error"] { --status-color: #ff8787; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
#upcoming { padding: 0; margin: 16px 0 0; list-style: none; }
#upcoming li { display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 12px; padding: 2px 4px; margin: 0 0 8px; background: #e5e5e5; color: #000; }
#upcoming li span:first-child { overflow-wrap: anywhere; }
#upcoming li span:last-child { text-align: right; white-space: nowrap; }
#upcoming li[data-line="Yellow"] { background: #FFFF33; }
#upcoming li[data-line="Orange"] { background: #FF9933; }
#upcoming li[data-line="Green"] { background: #339933; }
#upcoming li[data-line="Red"] { background: #FF0000; }
#upcoming li[data-line="Blue"] { background: #0099CC; }
#upcoming li[data-line="Grey"] { background: #B0BEC7; }
#upcoming li[aria-current="true"] { font-weight: 700; }
#preview { width: min(100%, 680px); margin-bottom: 32px; }
#preview summary { font-size: 1rem; font-weight: 600; cursor: pointer; }
#implementation { color: var(--muted); }
label { display: block; margin-top: 16px; }
textarea { width: 100%; resize: vertical; padding: 8px; border: 1px solid var(--border); background: var(--control); cursor: text; }
#voice { width: auto; margin-bottom: 16px; }
#preview-status { min-height: 1.7em; color: var(--muted); }
#preview-status[data-error] { color: var(--error); }
footer { margin-top: auto; padding-top: 48px; }
.credits { margin: 0; font-size: 12px; line-height: 1.9; color: var(--muted); }
.credits a[href="https://michael.romanenko.kg"] { display: inline-block; margin-top: 24px; font-weight: 600; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
