/* Audience phone page. Dark by default: it is read in darkened halls, next to a lit stage.
   Three looks (html[data-theme]): dark (default), light (daytime, bright halls), hc (black and yellow).
   Older text uses fixed grey steps, not opacity, so every step keeps 4.5:1 on its background
   (checked by scripts/contrast_check.py; research/R4-mobile-ux.md 1, 3(c)). */
:root {
  --bg: #0B0D12;
  --panel: #151924;
  --panel-2: #1C2130;
  --line: #262C3B;
  --fg: #F2F3F6;     /* current sentence */
  --fg-2: #AEB4C0;   /* earlier sentences, drafts */
  --fg-3: #959CAA;   /* the original under a translation */
  --muted: #A3AAB8;
  --dim: #8E95A4;    /* small labels, also on panels */
  --accent: #3DB7FF;
  --accent-ink: #04131D;
  --sel: #12263A;
  --mark: rgba(61, 183, 255, .28);
  --live: #FF4D57;
  --warn: #F0B04A;
  --speaking: #80868F;
  --toast-bg: #EEF0F4;
  --toast-fg: #10131A;
  --outside: #06070A;
  --event-bg: radial-gradient(70% 120% at 15% 10%, rgba(61, 183, 255, .35), transparent 70%), linear-gradient(160deg, #18203a, #10131f);
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", Roboto, "Segoe UI", sans-serif;
  --fs: 1;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F6F7F9;
  --panel: #FFFFFF;
  --panel-2: #EEF0F4;
  --line: #D5DAE3;
  --fg: #11141B;
  --fg-2: #4E5461;
  --fg-3: #555C6A;
  --muted: #555C6A;
  --dim: #5F6676;
  --accent: #0B67AD;
  --accent-ink: #FFFFFF;
  --sel: #E3F0FA;
  --mark: rgba(11, 103, 173, .18);
  --live: #C8202C;
  --warn: #8A5A00;
  --speaking: #6B7280;
  --toast-bg: #1B1F29;
  --toast-fg: #F2F3F6;
  --outside: #E4E7EC;
  --event-bg: linear-gradient(160deg, #E6F1FB, #FFFFFF);
  color-scheme: light;
}
:root[data-theme="hc"] {
  --bg: #000000;
  --panel: #0E0E0E;
  --panel-2: #1A1A1A;
  --line: #5A5A5A;
  --fg: #FFE14D;
  --fg-2: #CFB43C;
  --fg-3: #D9D9D9;
  --muted: #FFFFFF;
  --dim: #D9D9D9;
  --accent: #FFE14D;
  --accent-ink: #000000;
  --sel: #2A2500;
  --mark: rgba(255, 225, 77, .35);
  --live: #FF6B73;
  --warn: #FFB347;
  --speaking: #8F7E2B;
  --toast-bg: #FFE14D;
  --toast-fg: #000000;
  --outside: #000000;
  --event-bg: #0E0E0E;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
body { overflow: hidden; overscroll-behavior: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:lang(zh) { font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", var(--font); }
:lang(ja) { font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", var(--font); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app { height: 100%; display: flex; flex-direction: column; }

/* ---- switches and buttons ------------------------------------------------------------------ */
.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; margin: 0; cursor: pointer; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.cta { border: 0; border-radius: 14px; background: var(--fg); color: var(--bg); font-weight: 800; font-size: 16px; padding: 15px; min-height: 52px; }
.cta:active { transform: scale(.99); }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; min-height: 34px; white-space: nowrap; }
.fine { font-size: 12px; color: var(--dim); text-align: center; line-height: 1.6; margin: 0; }

/* ---- gate ------------------------------------------------------------------------------------ */
.gate { flex: 1; display: grid; place-items: center; text-align: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
.gate h1 { font-size: 21px; margin: 18px 0 6px; line-height: 1.4; }
.gate p { color: var(--muted); margin: 0; max-width: 30ch; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .14em; color: var(--muted); }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); }
.spinner { width: 28px; height: 28px; margin: 22px auto 0; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- join ------------------------------------------------------------------------------------- */
.join { flex: 1; overflow-y: auto; }
.join-in { min-height: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px;
  padding: calc(env(safe-area-inset-top) + 20px) max(18px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 20px) max(18px, env(safe-area-inset-left)); }
.event { border-radius: 18px; padding: 18px 18px 20px; background: var(--event-bg); border: 1px solid var(--line); }
.kicker { font-size: 11px; letter-spacing: .16em; color: var(--muted); }
.event h1 { margin: 6px 0 0; font-size: 23px; line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
.pick { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.langs { display: grid; gap: 8px; }
.lang { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; min-height: 60px; }
.lang b { display: block; font-size: 17px; }
.lang small { display: block; font-size: 12px; color: var(--muted); }
.lang[aria-checked="true"] { border-color: var(--accent); background: var(--sel); }
.lang[aria-checked="true"]::after { content: "✓"; color: var(--accent); font-weight: 800; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; padding: 4px 2px; }
.pin { display: grid; gap: 6px; }
.pin label { font-size: 13px; color: var(--muted); }
.pin input { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 20px; letter-spacing: .2em; }
.err { color: var(--live); font-size: 13px; margin: 0; }
.join .cta { margin-top: auto; }

/* ---- event theme (app/brand.py) ----------------------------------------------------------------------
   A: the entry card carries the key visual (darkened so white text keeps contrast on any picture), the logo,
   name, date/place and organisers. B: the header band takes the event colour with black or white text, whichever
   the server found readable. Caption text never takes the event colour; the high-contrast look ignores it. */
.ev-logo { display: block; max-height: 44px; max-width: 70%; object-fit: contain; margin-bottom: 14px; }
/* 11-14: a key-visual card carries a title-block logo (several lines), so it may be much larger */
.event.kv .ev-logo { max-height: 150px; max-width: 88%; }
.ev-info { margin: 8px 0 0; font-size: 14px; line-height: 1.5; word-break: keep-all; }
.ev-hosts { margin: 10px 0 0; font-size: 12px; line-height: 1.5; word-break: keep-all; }
.event { color: var(--fg); }
.event .ev-info, .event .ev-hosts { color: var(--muted); }
:root.branded .event { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
:root.branded .event .kicker, :root.branded .event .ev-info, :root.branded .event .ev-hosts { color: var(--brand-ink); }
/* at least 62% black everywhere: white text keeps 5.7:1 even on a white picture (54% is the bare minimum,
   codex-opinion-7 2); scripts/contrast_check.py checks it */
.event.kv { min-height: 34vh; display: flex; flex-direction: column; justify-content: flex-end; border-color: transparent; color: #FFFFFF;
  background: linear-gradient(rgba(0, 0, 0, .62), rgba(0, 0, 0, .8)), var(--kv) center / cover no-repeat, #202020; }
:root.branded .event.kv { background: linear-gradient(rgba(0, 0, 0, .62), rgba(0, 0, 0, .8)), var(--kv) center / cover no-repeat, #202020; color: #FFFFFF; }
.event.kv .kicker, .event.kv .ev-info, .event.kv .ev-hosts, :root.branded .event.kv .kicker,
:root.branded .event.kv .ev-info, :root.branded .event.kv .ev-hosts { color: #FFFFFF; }
:root[data-theme="hc"] .event, :root[data-theme="hc"].branded .event { background: var(--panel); color: var(--fg); border-color: var(--line); min-height: 0; }
:root[data-theme="hc"] .event .kicker, :root[data-theme="hc"] .event .ev-info, :root[data-theme="hc"] .event .ev-hosts { color: var(--muted); }
:root.edge:not([data-theme="hc"]) .lang[aria-checked="true"] { border-color: var(--brand); }
:root.edge:not([data-theme="hc"]) .lang[aria-checked="true"]::after { color: var(--fg); }
.bar-logo { height: 26px; max-width: 34%; object-fit: contain; flex: none; }
:root.branded:not([data-theme="hc"]) .bar { background: var(--brand); color: var(--brand-ink); border-bottom-color: transparent; }
:root.branded:not([data-theme="hc"]) .bar-title span,
:root.branded:not([data-theme="hc"]) .conn { color: var(--brand-ink); }
:root.branded:not([data-theme="hc"]) .chip { background: var(--bg); color: var(--fg); border-color: transparent; }

/* ---- live screen ------------------------------------------------------------------------------- */
.main { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.bar { display: flex; align-items: center; gap: 10px; background: var(--bg); border-bottom: 1px solid var(--line);
  padding: calc(env(safe-area-inset-top) + 10px) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
.bar-title { flex: 1; min-width: 0; line-height: 1.3; }
.bar-title b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title span { font-size: 12px; color: var(--muted); }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--dim); white-space: nowrap; }
.conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.conn.live { color: var(--live); }
.conn.live::before { animation: pulse 1.6s infinite; }
.conn.off { color: var(--warn); }
@keyframes pulse { 50% { opacity: .3; } }

.view { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 16px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left)); }
.caps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; font-size: calc(20px * var(--fs)); }
/* three steps: current sentence (bold, --fg) / earlier ones (--fg-2) / the original (0.8x, --fg-3) */
.caps li { color: var(--fg-2); transition: color .35s; }
.caps li.cur { color: var(--fg); }
.caps li.cur .t { font-weight: 700; }
.caps li.draft .t { color: var(--fg-2); }  /* a quick draft; the final translation replaces it when the sentence ends */
.caps li.new { animation: rise .4s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.t { margin: 0; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.t:lang(en) { word-break: normal; overflow-wrap: break-word; }
.t:lang(zh) { word-break: normal; line-break: strict; }
.t:lang(ja) { word-break: auto-phrase; }
.o { margin: 4px 0 0; font-size: .8em; color: var(--fg-3); line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.tag { display: inline-block; margin-top: 5px; font-size: 11px; line-height: 18px; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.empty { color: var(--dim); text-align: center; margin: 48px 0; font-size: 14px; }
.interim { margin-top: 16px; font-size: calc(20px * var(--fs)); line-height: 1.5; color: var(--muted); word-break: keep-all; }
.interim.tr-draft { color: var(--fg-2); }
.interim.text { display: flex; flex-direction: column; gap: 16px; }
.interim .il { margin: 0; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.interim .il.tent { color: var(--fg-3); font-size: .85em; }
.interim.text .il.last::after { content: "▍"; margin-left: 2px; color: var(--accent); animation: blink 1s steps(1) infinite; }
/* a line not yet in the reader's language: the original small and faint until its translation comes */
.caps li.missing .t, .caps li.missing.cur .t { color: var(--fg-3); font-size: .8em; font-weight: 400; }
.interim.dots { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.interim.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: hop 1s infinite; }
.interim.dots i:nth-child(2) { animation-delay: .15s; }
.interim.dots i:nth-child(3) { animation-delay: .3s; }
.interim.dots span { margin-left: 4px; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes hop { 50% { opacity: .25; transform: translateY(-2px); } }
.to-latest { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 78px); z-index: 3;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px; padding: 9px 18px; box-shadow: 0 6px 20px rgba(0, 0, 0, .45); }

/* focus view (R3, like the venue LED): the last two lines and the words being spoken, larger, at the bottom of
   the screen; nothing above them moves while you read. Earlier lines are in the History tab. */
body.focus .view.cap { display: flex; flex-direction: column; justify-content: flex-end; }
body.focus .caps { font-size: calc(24px * var(--fs)); gap: 14px; }
body.focus .caps li:not(.recent) { display: none; }
body.focus .caps li .o, body.focus .caps li .tag { display: none; }
body.focus .interim, body.focus .interim.text { font-size: calc(24px * var(--fs)); }
body.focus .interim .il:not(:nth-last-child(-n+2)) { display: none; }  /* the words being spoken: last two sentences */
body.focus.big .caps, body.focus.big .interim { font-size: calc(30px * var(--fs)); }

/* large text (separate from contrast: pick the high-contrast look under "screen") */
body.big .caps { font-size: calc(30px * var(--fs)); gap: 22px; }
body.big .caps .t { font-weight: 800; line-height: 1.38; }
body.big .caps .tag { display: none; }
body.big .interim { font-size: calc(30px * var(--fs)); font-weight: 800; line-height: 1.38; }
body.big .interim.dots { font-size: 16px; }

/* ---- listen ------------------------------------------------------------------------------------- */
.listen { display: flex; flex-direction: column; gap: 16px; }
.now { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; }
.now-state { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.badge { margin-left: auto; font-size: 11px; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; color: var(--dim); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.bars i { width: 3px; height: 30%; background: var(--accent); border-radius: 2px; }
.now.playing .bars i { animation: bar .9s infinite ease-in-out; }
.bars i:nth-child(2) { animation-delay: .1s; } .bars i:nth-child(3) { animation-delay: .25s; }
.bars i:nth-child(4) { animation-delay: .4s; } .bars i:nth-child(5) { animation-delay: .55s; }
@keyframes bar { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.now-text { margin: 10px 0 0; font-size: calc(20px * var(--fs)); font-weight: 700; line-height: 1.5; min-height: 1.5em; word-break: keep-all; overflow-wrap: anywhere; }
.now-text:lang(en) { word-break: normal; }
.now-text:lang(ja) { word-break: auto-phrase; }
.play { align-self: center; width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--fg); color: var(--bg); display: grid; place-items: center; }
.play svg { width: 30px; height: 30px; fill: currentColor; }
.play:disabled { opacity: .4; cursor: not-allowed; }
.rates { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.rates button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 14px; font-size: 14px; min-height: 36px; }
.rates button[aria-checked="true"] { border-color: var(--accent); color: var(--accent); }
.warn { margin: 0; font-size: 13px; color: var(--warn); text-align: center; }
.hint { margin: 0; font-size: 12.5px; color: var(--dim); text-align: center; line-height: 1.6; }
.prev { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.prev li { border-left: 2px solid var(--line); padding-left: 10px; line-height: 1.5; }

/* ---- history ------------------------------------------------------------------------------------- */
.search { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--dim); stroke-width: 2; }
.search input { flex: 1; min-width: 0; background: none; border: 0; padding: 11px 0; font-size: 16px; outline: none; }
.dl { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.dl span { flex: 1; }
.btn { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 6px 14px; font-size: 13px; font-weight: 700; text-decoration: none; min-height: 36px; }
.hist-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.hist-list li { padding: 10px 0 12px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; font-size: calc(16px * var(--fs)); }
.ts { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
mark { background: var(--mark); color: var(--fg); border-radius: 3px; padding: 0 1px; }
.rep { justify-self: start; margin-top: 2px; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: var(--muted); min-height: 30px; }
.rep:disabled { opacity: .5; }

/* ---- tabs ---------------------------------------------------------------------------------------- */
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; background: var(--panel); border-top: 1px solid var(--line);
  padding: 6px max(6px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 6px) max(6px, env(safe-area-inset-left)); }
.tabs.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tabs button { background: none; border: 0; border-radius: 10px; padding: 6px 2px; min-height: 50px; display: grid; justify-items: center; align-content: center; gap: 2px; font-size: 11.5px; color: var(--muted); }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs button.on { color: var(--fg); }
.tabs button.on svg { stroke: var(--accent); }

/* ---- settings sheet ----------------------------------------------------------------------------- */
.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 10; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; max-height: 88%; overflow-y: auto; background: var(--panel); border-radius: 20px 20px 0 0;
  display: grid; gap: 14px; padding: 18px max(18px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 18px) max(18px, env(safe-area-inset-left)); }
.sheet h2 { margin: 0; font-size: 17px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; }
.set-row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.set-row.col > span { font-size: 13px; color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 8px 6px; font-size: 14px; font-weight: 700; min-height: 42px; }
.seg button[aria-checked="true"] { border-color: var(--accent); color: var(--accent); }
.size { display: flex; align-items: center; gap: 10px; }
.size button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; min-width: 46px; min-height: 40px; font-weight: 800; }
.size input { flex: 1; accent-color: var(--accent); }
/* one line in the current size and look, so a change shows before closing the sheet */
.preview { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  display: grid; gap: 4px; font-size: calc(20px * var(--fs)); line-height: 1.45; word-break: keep-all; }
.preview b { color: var(--fg); }
.preview span { color: var(--fg-2); font-size: .8em; }
body.big .preview { font-size: calc(30px * var(--fs)); }

/* ---- toast --------------------------------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 84px); z-index: 20; transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  background: var(--toast-bg); color: var(--toast-fg); font-size: 14px; font-weight: 600; border-radius: 12px; padding: 10px 14px; max-width: calc(100% - 32px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Tablets and laptops: keep a readable phone-width column in the middle. */
@media (min-width: 700px) {
  body { background: var(--outside); }
  .app { max-width: 560px; margin: 0 auto; background: var(--bg); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .sheet { max-width: 560px; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- R4 3(c) C: sponsor band (32-40px, above the tabs; one logo at a time, slow fade) ---- */
.sponsors { position: relative; height: 36px; flex: none; background: var(--panel); border-top: 1px solid var(--line); overflow: hidden; }
.sponsors img { position: absolute; inset: 4px 0; margin: auto; max-height: 28px; max-width: 60%; object-fit: contain; opacity: 0; transition: opacity 1.2s ease; }
.sponsors img.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .sponsors img { transition: none; } }
/* ---- D: break card (takes the caption area; the captions come back when someone speaks) ---- */
.break { display: none; flex: 1; min-height: 0; flex-direction: column; justify-content: center; gap: 18px; padding: 24px 22px; overflow-y: auto; }
body.on-break #vCap:not([hidden]) { display: none; }
body.on-break #vCap:not([hidden]) + .break { display: flex; }
.break .b-kicker { margin: 0; font-size: 22px; font-weight: 700; color: var(--fg); }
.break .b-next { display: grid; gap: 4px; padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.break .b-label { font-size: 13px; color: var(--muted); }
.break .b-next b { font-size: 19px; line-height: 1.4; }
.break .b-meta { font-size: 14px; color: var(--muted); }
.break .b-sponsor { max-width: 100%; max-height: 120px; object-fit: contain; align-self: center; }
.break .b-info { align-self: flex-start; background: none; border: 1px solid var(--line); color: var(--fg); border-radius: 999px; padding: 8px 14px; font-size: 14px; }
.break .b-hint { margin: 0; font-size: 13px; color: var(--muted); }
:root[data-theme="hc"] .break .b-next { border-color: #fff; }
/* ---- E: event information sheet ---- */
.bar-logo, .bar-title { cursor: pointer; }
.info-sheet h3 { margin: 16px 0 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.info-sheet p { margin: 0; line-height: 1.5; }
.info-sheet .prog { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.info-sheet .prog li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; padding: 8px 6px; border-radius: 10px; align-items: start; }
.info-sheet .prog li.now { background: var(--panel-2); }
.info-sheet .prog .tm { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.info-sheet .prog b { display: block; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.info-sheet .prog div span { font-size: 13px; color: var(--muted); }
.info-sheet .prog em { font-style: normal; font-size: 12px; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 1px 8px; }
.info-sheet .sp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.info-sheet .sp-grid img { width: 100%; height: 44px; object-fit: contain; background: #fff; border-radius: 8px; padding: 6px; box-sizing: border-box; }

/* ---- A11Y: states never by colour alone; touch targets at least 44px ---- */
.tabs button { position: relative; min-height: 50px; }
.tabs button.on::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: 3px; height: 3px; border-radius: 3px; background: var(--accent); }
.tabs button.on span { font-weight: 700; }
.seg button[aria-checked="true"], .rates button[aria-checked="true"] { font-weight: 700; }
.seg button[aria-checked="true"]::before, .rates button[aria-checked="true"]::before { content: "✓ "; }
:root[data-theme="hc"] .tabs button.on::after { background: #fff; }
.chip { min-height: 44px; min-width: 44px; }
.row, .set-row:not(.col) { min-height: 44px; }
.bar-title { min-height: 44px; display: flex; flex-direction: column; justify-content: center; }
.seg button { min-height: 44px; }
.seg { grid-template-columns: repeat(auto-fit, minmax(min(70px, 100%), 1fr)); }
.size button { min-height: 44px; min-width: 46px; }
.sheet h2, .set-row > span, .seg button { overflow-wrap: anywhere; }
.break .b-info { min-height: 44px; }
.sheet { grid-template-columns: minmax(0, 1fr); }
.sheet > * { min-width: 0; }
/* at 200% text zoom a phone is about 195 px wide: the session title takes its own line in the band */
@media (max-width: 300px) {
  .bar { flex-wrap: wrap; row-gap: 4px; }
  .bar-title { order: 3; flex: 1 0 100%; }
}
.size input { min-width: 0; width: 100%; }
.bar { padding-top: calc(env(safe-area-inset-top) + 6px); padding-bottom: 6px; }


/* 2026-11-12 대표 요청: no boxes around lines, the newest line 100 %, the one before 80 %, older 60 %; every line
   the same size and spacing. Phones reading a translation get a fixed dots row instead of a draft box. */
.caps li, .caps li.cur, .caps li.draft { color: var(--fg); opacity: .6; transition: opacity .35s; background: none; border: 0; padding: 0; }
.caps li.prev1 { opacity: .8; }
.caps li.cur { opacity: 1; }
.caps li .t, .caps li.cur .t, .caps li.draft .t { font-weight: 600; color: inherit; font-size: 1em; }
body.big .caps li .t { font-weight: 800; }
.interim { margin-top: 16px; background: none; border: 0; padding: 0; }
.interim.own { color: var(--fg); opacity: .45; }
.interim.own .il { margin: 0; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.interim.typing { display: flex; align-items: center; gap: 6px; height: calc(1.5em * 1); font-size: calc(20px * var(--fs)); }
.interim.typing i { width: .32em; height: .32em; border-radius: 50%; background: var(--muted); opacity: 0; }
.interim.typing.on i { opacity: 1; animation: hop 1s infinite; }
.interim.typing.on i:nth-child(2) { animation-delay: .15s; }
.interim.typing.on i:nth-child(3) { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) { .interim.typing.on i { animation: none; } }


/* ---- 2026-11-12 ui-ux-pro-max review (phone) ---- */
.app { height: 100dvh; }
#vCap { position: relative; display: flex; flex-direction: column; }
#caps { margin-top: auto; }  /* captions sit at the bottom like the design; scrolling up still reaches the start */
.sr { top: 0; left: 0; }      /* the screen-reader line no longer stretches the page */
.interim.own { color: var(--speaking); opacity: 1; font-weight: 400; }
.caps .tag { display: none; }  /* 'edited' only in the history tab */
.to-latest { min-height: 44px; }
.rates button, .btn, .rep { min-height: 44px; }
.now-text:lang(zh) { word-break: normal; line-break: strict; }

/* header: '‹ EN' first (it goes back), the event name on one line, date and place under it */
.bar { padding-top: max(10px, env(safe-area-inset-top)); }
.bar .chip { min-height: 36px; min-width: 52px; }
.bar-title b { font-size: 15px; font-weight: 700; }
.bar-title span { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title span:empty { display: none; }
.conn.paused { color: var(--warn); }
.conn.paused::before { animation: none; }

/* the item on now */
.nowband { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; width: 100%; text-align: left;
  background: var(--panel); border: 0; border-bottom: 1px solid var(--line); color: var(--fg); cursor: pointer; }
.nowband:active { background: var(--panel-2, var(--panel)); }
.nb-no { flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.nb-no small { font-size: 10px; color: var(--muted); letter-spacing: .04em; }
.nb-no b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nb-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nb-tx b { font-size: 15px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nb-tx span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-tx span:empty { display: none; }
.nb-go { flex: none; font-size: 22px; color: var(--muted); }
@media (max-height: 600px) { .nowband { min-height: 52px; } .nb-tx span { display: none; } }

/* no captions now / a break */
.break { justify-content: flex-start; gap: 16px; padding: 28px 20px; }
.break .b-kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.break .b-title { margin: 0; font-size: 26px; line-height: 1.3; font-weight: 700; }
.break .b-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--fg-2); }
.break .b-next { display: flex; flex-direction: column; gap: 10px; }
.b-row { display: flex; gap: 12px; align-items: flex-start; }
.b-no { flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.b-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.b-col b { font-size: 17px; line-height: 1.4; }
.b-pill { margin-top: 4px; align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--accent-ink, #0B0D12); background: var(--accent); border-radius: 999px; padding: 2px 8px; }
.b-prog { display: flex; flex-direction: column; gap: 8px; }
.b-prog ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.b-prog li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); }
.b-prog li.now { border-color: var(--accent); }
.b-prog li.done { color: var(--muted); }
.b-prog .pn { width: 26px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.b-prog .pt { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-prog .ps { font-size: 11px; color: var(--muted); }
.break .b-info { min-height: 44px; }
.break .b-sponsor { margin-top: auto; max-height: 64px; }
.prog li.done { opacity: 1; color: var(--muted); }

/* first screen */
.pick { font-size: 18px; font-weight: 700; color: var(--fg); }
.event { min-height: clamp(180px, 32dvh, 300px); display: flex; flex-direction: column; justify-content: flex-end; }
.event h1 { font-size: clamp(24px, 7.4vw, 32px); line-height: 1.2; text-wrap: balance; }
.lang::after { content: "›"; font-size: 20px; color: var(--muted); }
.lang[aria-checked="true"]::after { content: "✓"; }
.lang:active { background: var(--panel-2, var(--panel)); transform: scale(.98); }
.back { align-self: flex-start; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); font-size: 22px; }
@media (prefers-reduced-motion: reduce) { .lang:active { transform: none; } }
#vCap > * { flex-shrink: 0; }  /* the dots row and the captions never squeeze when the list overflows */
