/* stt: mobile-first, follows the approved mockup in the Pardubice city style: the city's red as the head
   band, its cool grey as the surface, near-black type, Bricolage Grotesque, small radii. Red means the city
   and "recording / stop", nothing else; speakers get the city's other inks. Which parts of the session
   page show is driven by body[data-view] and the .view-* classes at the end. */

@font-face { font-family: "Bricolage Grotesque"; font-weight: 300 800; font-stretch: 75% 100%; font-display: swap;
  src: url(fonts/bricolage-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 300 800; font-stretch: 75% 100%; font-display: swap;
  src: url(fonts/bricolage-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }

:root {
  --red: #de091c; --red-ink: #b00716; --on-red: #ffffff;
  --bg: #e8ecf0; --card: #ffffff; --ink: #191c1f; --ink-2: #3b3f44; --muted: #5f6368; --line: #c9cfd6; --field: #7d838b;
  --ok: #067352; --warn: #965200; --off: #5f6368; --info: #0b5a8a;
  --s1: #0b5a8a; --s2: #067352; --s3: #965200; --s4: #6b3fa0; --s5: #0e6f78; --s6: #3b3f44;
  --radius: 6px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --red: #c40818; --red-ink: #ff7b84; --on-red: #ffffff;
    --bg: #15181b; --card: #1e2226; --ink: #eceff2; --ink-2: #c3c8ce; --muted: #9aa1a9; --line: #343a40; --field: #6c737b;
    --ok: #4fc79a; --warn: #e2a24a; --off: #9aa1a9; --info: #6fb3e0;
    --s1: #6fb3e0; --s2: #4fc79a; --s3: #e2a24a; --s4: #b99af0; --s5: #5cc8d2; --s6: #c3c8ce;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; font: 400 16px/1.45 "Bricolage Grotesque", system-ui, sans-serif; font-optical-sizing: auto;
       font-variant-numeric: tabular-nums; background: var(--bg); color: var(--ink); }
a { color: var(--info); }

/* --- app chrome: head band, status strip, content, dock, footer ---------------------------------- */
.app { display: flex; flex-direction: column; height: 100dvh; max-width: 46rem; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; background: var(--red); color: var(--on-red); }
.brand { font-weight: 800; font-stretch: 85%; font-size: 19px; letter-spacing: -.01em; }
.brand small { font-weight: 500; font-stretch: 100%; font-size: 13px; opacity: .85; margin-left: 4px; }
.session-title { color: rgba(255, 255, 255, .9); font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; }
.session-title:not(:empty)::before { content: "· "; }
.elapsed { font-weight: 800; font-size: 19px; }
.rec-dot { display: none; width: 11px; height: 11px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .28); }
.content { flex: 1; min-height: 0; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.dock { padding: 12px 16px 14px; background: var(--card); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.site-footer { padding: 10px 16px 14px; font-size: 12px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); background: var(--card); }

/* --- cards and forms ---------------------------------------------------------------------------- */
.card { background: var(--card); border-radius: var(--radius); padding: 20px 18px; display: flex; flex-direction: column; gap: 12px; }
.card--center { margin: auto 0; }
.card-title { font-size: 26px; font-weight: 800; font-stretch: 88%; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
.lead { color: var(--ink-2); margin: 0; }
.hint { font-size: 13.5px; color: var(--muted); margin: 0; }
.field-label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: -6px; }
.field { width: 100%; font: inherit; font-size: 17px; padding: 13px 12px; border-radius: 4px; border: 1.5px solid var(--field);
         background: var(--card); color: var(--ink); }
.form-error { margin: 0; color: var(--red-ink); font-weight: 700; }
.form-error:empty { display: none; }
.context-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 4px; background: var(--bg);
                border-left: 4px solid var(--red); font-size: 14px; color: var(--ink-2); }
.context-note b { color: var(--ink); }
body[data-mode="password"] .context-note { display: none; }

/* --- buttons ------------------------------------------------------------------------------------ */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; border-radius: 4px; border: 0;
       font-family: inherit; font-size: 17px; font-weight: 700; line-height: 1; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn--primary { background: var(--red); color: var(--on-red); }
.btn--stop { background: var(--red); color: var(--on-red); min-height: 62px; font-size: 19px; font-weight: 800; }
.btn--ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--field); }
.icon-stop { width: 15px; height: 15px; background: currentColor; border-radius: 2px; }
.icon-mic { width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.button-row { display: flex; gap: 10px; }
.button-row .btn { flex: 1; }

/* --- saving status: a strip under the band ------------------------------------------------------ */
.statusbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.statusbar-note { color: var(--muted); font-size: 12.5px; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }
.pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pill[data-status="ok"] { color: var(--ok); }
.pill[data-status="saving"] { color: var(--warn); }
.pill[data-status="offline"] { color: var(--off); }
.pill[data-status="reconnecting"] { color: var(--info); }
.pill[data-status="down"] { color: var(--red-ink); }

/* --- live transcript ---------------------------------------------------------------------------- */
.transcript { display: flex; flex-direction: column; gap: 10px; }
.transcript:empty { display: none; }
.turn { --c: var(--s1); background: var(--card); border-radius: 4px; border-left: 4px solid var(--c); padding: 8px 12px 10px; }
.turn[data-color="2"] { --c: var(--s2); } .turn[data-color="3"] { --c: var(--s3); } .turn[data-color="4"] { --c: var(--s4); }
.turn[data-color="5"] { --c: var(--s5); } .turn[data-color="6"] { --c: var(--s6); }
.turn-who { font-size: 13px; font-weight: 800; color: var(--c); }
.turn-time { color: var(--muted); font-weight: 500; margin-left: 6px; }
.turn-text { margin: 2px 0 0; font-size: 16.5px; }
.interim { color: var(--muted); padding: 0 12px 0 16px; }
.break-marker { text-align: center; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; font-weight: 600; }
.break-marker::before, .break-marker::after { content: ""; flex: 1; height: 0; border-top: 1.5px dashed var(--field); }

/* --- notices and the finished screen ------------------------------------------------------------ */
.notice { --c: var(--warn); border-radius: 4px; padding: 14px; font-size: 14.5px; display: flex; gap: 10px; background: var(--card); border-left: 4px solid var(--c); }
.notice b { display: block; margin-bottom: 2px; }
.notice b.inline { display: inline; margin: 0; }
.notice--warn { --c: var(--warn); }
.notice--ok { --c: var(--ok); }
.notice-link { display: block; font-weight: 700; }
.icon { font-size: 18px; line-height: 1.2; }
.finished { flex: 1; flex-direction: column; gap: 14px; min-height: 0; }
.transcript-text { width: 100%; flex: 1; min-height: 16rem; font: 13.5px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; padding: 12px;
                   border-radius: 4px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); resize: none; }

/* --- views of the session page ------------------------------------------------------------------ */
[class*="view-"] { display: none; }
body[data-view="loading"] .view-loading,
body[data-view="ready"] .view-ready,
body[data-view="recording"] .view-recording,
body[data-view="taken"] .view-taken,
body[data-view="finishing"] .view-finishing,
body[data-view="finished"] .view-finished { display: flex; }
body[data-view="loading"] p.view-loading, body[data-view="ready"] p.view-ready { display: block; }
body[data-view="recording"] .rec-dot { display: block; }
body[data-view="taken"] .transcript, body[data-view="taken"] .elapsed { opacity: .55; }
body[data-view="finished"] .transcript { display: none; }
body[data-view="finished"] .dock, body[data-view="loading"] .dock, body[data-view="error"] .dock { display: none; }
/* the taken / error notice stays in view above a long transcript */
.content > .notice { position: sticky; top: 0; z-index: 1; }
