:root {
  --bg: #0f172a; --panel: #111c33; --card: #17233f; --text: #e2e8f0; --muted: #94a3b8; --border: #26344f; --line: #1a2741;
  --accent: #38bdf8; --link: #7dd3fc; --expl: #cbd5e1; --tr: #9fb3d1; --topic: #1e3a5f; --hover: #1d2c4d;
  --false: #ef4444; --misleading: #f97316; --mostly_true: #84cc16; --true: #22c55e; --unverifiable: #eab308;
  --checking: #64748b; --inconsistent: #a855f7; --tscale: 1; color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f8fafc; --panel: #eef2f7; --card: #ffffff; --text: #0f172a; --muted: #475569; --border: #cbd5e1; --line: #e2e8f0;
  --accent: #0284c7; --link: #0369a1; --expl: #334155; --tr: #475569; --topic: #dbeafe; --hover: #e0f2fe; color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    --bg: #f8fafc; --panel: #eef2f7; --card: #ffffff; --text: #0f172a; --muted: #475569; --border: #cbd5e1; --line: #e2e8f0;
    --accent: #0284c7; --link: #0369a1; --expl: #334155; --tr: #475569; --topic: #dbeafe; --hover: #e0f2fe; color-scheme: light;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text);
  height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.off { display: none !important; }
[hidden] { display: none !important; }
label { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
select, button, input[type=text], input[type=search] { background: var(--card); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 13px; font-family: inherit; }
button { cursor: pointer; } button:disabled { opacity: .4; cursor: default; }
button:focus-visible, select:focus-visible, input:focus-visible, .tog:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary { background: #dc2626; border-color: #dc2626; color: #fff; font-weight: 700; }
button.danger { background: transparent; border-color: #dc2626; color: #f87171; font-weight: 700; }
.icon-btn { background: transparent; border: none; font-size: 18px; padding: 4px 8px; }
.icon-btn[data-badge]:not([data-badge=""]) { position: relative; }
.icon-btn[data-badge]:not([data-badge=""])::after { content: attr(data-badge); position: absolute; top: -2px; right: -2px;
  background: #dc2626; color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; min-width: 16px; line-height: 16px; text-align: center; }
.admin-users { list-style: none; padding: 0; margin: 6px 0; }
.admin-users li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.admin-users li.pending { background: color-mix(in srgb, #f59e0b 12%, transparent); }
.admin-users li.rejected { opacity: .6; }
.admin-users .chip { font-size: 11px; border: 1px solid var(--border); border-radius: 8px; padding: 0 6px; }
.admin-users .acts { display: flex; gap: 6px; flex-shrink: 0; }
#googleBox { margin: 8px 0 14px; }
#googleBox .primary { width: 100%; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }
.count { background: var(--card); border-radius: 10px; padding: 1px 8px; font-size: 12px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- top bar ---------- */
header#bar { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 8px calc(14px + env(safe-area-inset-left)); border-bottom: 1px solid var(--border); min-height: 52px; }
.logo { margin: 0 6px 0 0; font-size: 19px; white-space: nowrap; } .logo span { color: var(--accent); }
.nav { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 2px; }
.nav button { border: none; background: transparent; color: var(--muted); padding: 5px 10px; border-radius: 8px; position: relative; }
.nav button.active { background: var(--card); color: var(--text); }
.nav .ic { margin-right: 4px; }
.phone-only { display: none !important; }
.live-info { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; overflow: hidden; }
.status { font-size: 13px; color: var(--muted); white-space: nowrap; }
.status.live { color: #f87171; font-weight: 600; } .status.live::before { content: "● "; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.elapsed { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.source-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { border-radius: 16px; white-space: nowrap; }
.toggles { display: flex; gap: 4px; }
.tog { position: relative; cursor: pointer; border: 1px solid var(--border); border-radius: 16px; padding: 5px 10px; color: var(--muted);
  background: transparent; user-select: none; white-space: nowrap; }
.tog input { position: absolute; opacity: 0; pointer-events: none; }
.tog:has(input:checked) { background: var(--topic); border-color: var(--accent); color: var(--text); }
.tog:has(input:disabled) { opacity: .45; cursor: default; }
.tog .ic { filter: grayscale(1); } .tog:has(input:checked) .ic { filter: none; }
#alertsBox.snoozed .ic::after { content: "z"; font-size: 10px; vertical-align: super; color: var(--muted); }
.alerts { background: var(--false); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.review-only { display: none; }
body[data-view="live"]:not(.running).has-data .review-only { display: inline-block; }
#stop { display: none; } body.running #stop { display: inline-block; }
body.running .nav, body.running #newBtn { } /* nav stays usable while live */
body:not(.running) .elapsed:empty { display: none; }
#serverMsg { padding: 0 14px; }

/* ---------- screens ---------- */
.view { display: none !important; }
body[data-view="pick"] .view[data-for="pick"], body[data-view="sessions"] .view[data-for="sessions"] { display: block !important; }
body[data-view="live"] .view[data-for="live"] { display: grid !important; }
.picker, .sessions { flex: 1; overflow-y: auto; padding: 4px 16px 90px; }
.tips { margin-top: 12px; border-left: 4px solid var(--accent); font-size: 14px; line-height: 1.5; }
.tips ol { margin: 6px 0 8px; padding-left: 20px; }
.tips .mark { padding: 0 4px; border-radius: 4px; border-bottom: 3px solid; white-space: nowrap; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tile, .ch-card { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 12px;
  background: var(--card); border: 2px solid var(--border); color: var(--text); }
.tile:hover, .ch-card:hover { background: var(--hover); }
.tile.sel, .ch-card.sel { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.tile .big { font-size: 26px; } .tile b { font-size: 15px; } .tile small { color: var(--muted); font-size: 12px; line-height: 1.35; }

.ch-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-top: 22px; }
.ch-head h2 { margin: 0; }
.ch-head input[type=search] { flex: 0 1 320px; min-width: 200px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.chips button { border-radius: 16px; padding: 4px 11px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.chips button.on { background: var(--topic); border-color: var(--accent); color: var(--text); }
.chips .sep { width: 1px; background: var(--border); margin: 2px 4px; }
.grp-title { font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
.channel-grid .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.ch-card { position: relative; padding: 10px 34px 10px 12px; }
.ch-card .name { font-weight: 600; font-size: 14px; }
.ch-card .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ch-card .star { position: absolute; top: 6px; right: 6px; font-size: 16px; padding: 2px 4px; color: var(--muted); }
.ch-card .star.on { color: #facc15; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--checking); }
.dot.live { background: #ef4444; animation: blink 1.4s infinite; } .dot.connecting, .dot.reconnecting { background: var(--unverifiable); }
.empty { padding: 24px; text-align: center; color: var(--muted); }

.start-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; align-items: center; justify-content: flex-end;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-top: 1px solid var(--border); backdrop-filter: blur(6px); z-index: 5; }
.start-bar .selected { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.start-bar #start { font-size: 16px; padding: 10px 28px; border-radius: 24px; }

/* ---------- live / review ---------- */
main#live { flex: 1; grid-template-columns: 1.4fr 1fr; min-height: 0; }
.transcript { padding: 12px 16px; overflow-y: auto; border-right: 1px solid var(--border); position: relative; }
aside { padding: 12px 16px; overflow-y: auto; background: var(--panel); }
.context-strip { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.ctx-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctx-format { font-weight: 700; text-transform: capitalize; font-size: 15px; }
.ctx-format small { font-weight: 400; color: var(--muted); }
.ctx-summary { margin-top: 4px; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ctx-summary.open { -webkit-line-clamp: unset; }
.topics span { display: inline-block; font-size: 12px; background: var(--topic); border-radius: 10px; padding: 2px 8px; margin: 4px 4px 0 0; }
.speakers { display: flex; gap: 6px; flex-wrap: wrap; }
.speaker { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 20px;
  padding: 2px 10px 2px 3px; font-size: 12px; color: var(--text); }
.speaker .role { color: var(--muted); }
.speaker.editable { cursor: pointer; } .speaker.editable:hover { border-color: var(--accent); }
.chip { display: inline-block; min-width: 26px; text-align: center; border-radius: 12px; padding: 1px 6px; font-weight: 700; font-size: 11px; color: #0f172a; }
.filter-bar { margin: 4px 0 8px; }
.filter-bar button .chip { margin-right: 4px; }

.segments { font-size: calc(15px * var(--tscale)); }
.segment { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); line-height: 1.55; }
.segment .who { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.segment .who .time { display: block; font-size: 11px; opacity: .7; }
mark.claim { background: transparent; color: inherit; border-bottom: 3px solid var(--checking); cursor: pointer; padding: 0 1px; border-radius: 2px; }
mark.claim .vic { font-size: .75em; margin-left: 3px; font-weight: 700; }
mark.claim.v-false { background: rgba(239,68,68,.22); border-color: var(--false); } mark.claim.v-false .vic { color: var(--false); }
mark.claim.v-misleading { background: rgba(249,115,22,.2); border-color: var(--misleading); } mark.claim.v-misleading .vic { color: var(--misleading); }
mark.claim.v-mostly_true { border-color: var(--mostly_true); } mark.claim.v-mostly_true .vic { color: var(--mostly_true); }
mark.claim.v-true { border-color: var(--true); } mark.claim.v-true .vic { color: var(--true); }
mark.claim.v-unverifiable { border-color: var(--unverifiable); border-bottom-style: dotted; } mark.claim.v-unverifiable .vic { color: var(--unverifiable); }
mark.claim.v-tracked { border-color: #475569; border-bottom-style: dotted; }
mark.claim.inconsistent { outline: 2px dashed var(--inconsistent); outline-offset: 1px; }
mark.claim.provisional { border-bottom-style: dashed; background: transparent; }
mark.claim.open { box-shadow: 0 0 0 2px var(--accent); }
.claim-detail { grid-column: 2; margin: 4px 0 6px; font-size: .92em; cursor: default; }
.claim-detail .actions { display: flex; gap: 8px; margin-top: 6px; font-size: 12px; }
.claim-detail .actions button { padding: 3px 8px; font-size: 12px; }
.segment .tr { grid-column: 2; margin-top: -4px; color: var(--tr); font-style: italic; font-size: .95em; border-left: 2px solid var(--border); padding-left: 8px; }
body.no-translate .segment .tr { display: none; }
.lang-badge { margin-left: 4px; padding: 0 4px; border: 1px solid var(--border); border-radius: 4px; font-size: 10px; text-transform: uppercase; }
.segment.partial { color: var(--muted); font-style: italic; border-bottom-style: dashed; }
.jump { position: sticky; bottom: 8px; left: 50%; transform: translateX(-50%); display: block; margin: 0 auto; border-radius: 16px;
  background: var(--accent); color: #0f172a; border: none; font-weight: 700; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
mark.flash, .card.flash { animation: flash 1.2s; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px var(--accent); } }

/* filters (transcript and claims list) */
body.f-issues .segment:not(.issue):not(.partial),
body.f-issues .claim-card:not(.v-false):not(.v-misleading):not(.inconsistent) { display: none; }

.legend { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; }
.legend .mark { padding: 2px 6px; border-radius: 4px; border-bottom: 3px solid; }
.legend .v-false, .tips .v-false { border-color: var(--false); } .legend .v-misleading, .tips .v-misleading { border-color: var(--misleading); }
.legend .v-mostly_true { border-color: var(--mostly_true); } .legend .v-true, .tips .v-true { border-color: var(--true); }
.legend .v-unverifiable, .tips .v-unverifiable { border-color: var(--unverifiable); } .legend .v-checking { border-color: var(--checking); }
.legend .inconsistent, .tips .inconsistent { border-color: transparent; outline: 2px dashed var(--inconsistent); }
aside #claims, aside #inconsistencies { font-size: calc(14px * var(--tscale)); }
.claim-card { border-left: 4px solid var(--checking); cursor: pointer; }
.claim-card.v-false { border-left-color: var(--false); } .claim-card.v-misleading { border-left-color: var(--misleading); }
.claim-card.v-mostly_true { border-left-color: var(--mostly_true); } .claim-card.v-true { border-left-color: var(--true); }
.claim-card.v-unverifiable { border-left-color: var(--unverifiable); }
.claim-card .head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.badge { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: var(--checking); color: #0f172a; white-space: nowrap; }
.badge.v-false { background: var(--false); } .badge.v-misleading { background: var(--misleading); }
.badge.v-mostly_true { background: var(--mostly_true); } .badge.v-true { background: var(--true); }
.badge.v-unverifiable { background: var(--unverifiable); }
.badge.provisional { background: transparent !important; color: var(--text); outline: 1px dashed currentColor; }
.badge.provisional.v-false { color: var(--false); } .badge.provisional.v-misleading { color: var(--misleading); }
.badge.provisional.v-true, .badge.provisional.v-mostly_true { color: var(--true); }
.conf { display: inline-block; width: 40px; height: 5px; border-radius: 3px; background: var(--border); vertical-align: middle; margin-left: 6px; overflow: hidden; }
.conf i { display: block; height: 100%; background: var(--accent); }
.claim-card .text { margin: 6px 0; font-weight: 500; }
.explanation { font-size: .93em; color: var(--expl); }
.correction { font-size: .93em; margin-top: 4px; color: var(--true); }
.sources { list-style: none; margin: 6px 0 0; padding: 0; font-size: .86em; }
.sources li { margin: 3px 0; display: flex; gap: 6px; align-items: baseline; }
.sources img { width: 14px; height: 14px; border-radius: 3px; flex: none; position: relative; top: 2px; }
.sources a, .inc-card a, .contra a { color: var(--link); }
.sources q { color: var(--muted); }
.contra { margin-top: 6px; color: var(--inconsistent); font-size: .9em; }
.contra a { cursor: pointer; text-decoration: underline; }
.inc-card { border-left: 4px solid var(--inconsistent); font-size: 13px; }
.inc-card a { cursor: pointer; text-decoration: underline; color: var(--inconsistent); }
.clip-divider { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; color: var(--accent); font-size: 13px; font-weight: 600; }
.clip-divider::before, .clip-divider::after { content: ""; flex: 1; border-top: 1px dashed var(--accent); opacity: .6; }

/* ---------- saved sessions ---------- */
.sess-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.sess { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-align: left; padding: 10px 12px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border); color: var(--text); }
.sess:hover { background: var(--hover); }
.sess .title { font-weight: 600; } .sess .sub { grid-column: 1; font-size: 12px; color: var(--muted); }
.sess .stats { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 8px; align-items: center; font-size: 13px; white-space: nowrap; }

/* ---------- channel audio ---------- */
.mini-player { position: fixed; right: 16px; bottom: 16px; z-index: 6; display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 24px; box-shadow: 0 8px 24px rgba(0,0,0,.45); max-width: calc(100% - 32px); }
.mp-info { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mini-player input[type=range] { width: 90px; }
.mini-player button { border-radius: 16px; padding: 4px 10px; }

/* ---------- alerts: big banner (severe) and toasts ---------- */
.alert { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(680px, calc(100% - 16px)); z-index: 50;
  background: #2a1d45; color: #f1f5f9; border: 2px solid var(--inconsistent); border-left-width: 10px; border-radius: 10px; padding: 12px 44px 12px 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.65); cursor: pointer; animation: drop .25s ease-out; }
.alert.v-false { background: #3b1218; border-color: var(--false); }
.alert.v-misleading { background: #3b2210; border-color: var(--misleading); }
.alert .title { font-size: 20px; font-weight: 800; letter-spacing: .02em; color: #e9d5ff; cursor: pointer; }
.alert.v-false .title { color: #fca5a5; } .alert.v-misleading .title { color: #fdba74; }
.alert .body { font-size: 17px; line-height: 1.4; margin-top: 4px; white-space: pre-line; max-height: 45vh; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding-right: 4px; }
.alert .hint { font-size: 12px; color: #94a3b8; margin-top: 6px; display: flex; gap: 10px; align-items: center; }
.alert .close { position: absolute; top: 6px; right: 6px; background: transparent; border: none; font-size: 24px; line-height: 1; padding: 4px 10px; min-height: 0; color: #94a3b8; }
.snooze { background: transparent; border: 1px solid #475569; color: #cbd5e1; border-radius: 12px; padding: 2px 8px; font-size: 12px; min-height: 0 !important; }
@keyframes drop { from { transform: translate(-50%, -30px); opacity: 0; } }
.toasts { position: fixed; top: 60px; right: 12px; z-index: 40; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100% - 24px)); }
.toast { background: var(--card); border: 1px solid var(--border); border-left: 6px solid var(--inconsistent); border-radius: 10px; padding: 8px 32px 8px 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,.4); cursor: pointer; position: relative; animation: slide .2s ease-out; font-size: 13px; }
.toast.v-misleading { border-left-color: var(--misleading); } .toast.v-false { border-left-color: var(--false); }
.toast b { display: block; margin-bottom: 2px; }
.toast .body { max-height: 4.5em; overflow-y: auto; white-space: pre-line; color: var(--expl); }
.toast .close { position: absolute; top: 2px; right: 2px; background: transparent; border: none; font-size: 18px; color: var(--muted); }
.toast .snooze { color: var(--muted); border-color: var(--border); margin-top: 4px; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }

/* ---------- settings ---------- */
.settings { width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 40px); border: 1px solid var(--border); border-radius: 14px;
  background: var(--bg); color: var(--text); padding: 0 18px 16px; }
.settings::backdrop { background: rgba(0,0,0,.55); }
.settings header { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--bg); padding-top: 12px; }
.settings h2 { margin: 0; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--text); }
.settings h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 6px; border-top: 1px solid var(--border); padding-top: 12px; }
.settings .row { color: var(--text); font-size: 14px; margin: 6px 0; flex-wrap: wrap; }
.settings select { flex: 1; min-width: 160px; }
.settings p { margin: 4px 0; }
.settings footer { margin-top: 18px; font-size: 11px; }

.server-msg { display: flex; align-items: center; gap: .6rem; margin: .4rem 0; padding: .45rem .7rem; border-radius: 8px;
  background: var(--topic); border: 1px solid var(--accent); font-size: .92rem; }
.server-msg.warning { background: #4a2a0a; border-color: var(--misleading); color: #fde68a; }
.server-msg span { flex: 1; }
.server-msg button { white-space: nowrap; }

@media (max-width: 1100px) { .tog .tx, #export .tx, #newBtn .tx, #nextClip .tx { display: none; } }
@media (max-width: 900px) { main#live { grid-template-columns: 1fr; } .transcript { border-right: none; } }

/* ---------- phones: bottom navigation, one pane at a time, touch-sized controls ---------- */
@media (max-width: 760px) {
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  header#bar { gap: 6px; padding: calc(6px + env(safe-area-inset-top)) 10px 6px; flex-wrap: wrap; }
  .logo { font-size: 17px; }
  body.running .logo { display: none; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; border-radius: 0; border-width: 1px 0 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: var(--panel); justify-content: space-around; }
  .nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11px; padding: 6px 2px; min-height: 48px; }
  .nav .ic { margin: 0; font-size: 19px; }
  .nav .alerts { position: absolute; top: 2px; left: calc(50% + 6px); }
  .phone-only { display: flex !important; }
  .live-info { order: 1; flex: 1 1 100%; }
  .toggles { flex: 1; justify-content: flex-end; }
  .tog { padding: 8px 10px; }
  select, button, input[type=search] { min-height: 40px; font-size: 15px; }
  .icon-btn { min-height: 40px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { padding: 10px; } .tile small { display: none; }
  .channel-grid .cards { grid-template-columns: 1fr; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 8px -16px; padding: 0 16px; }
  .chips button { min-height: 34px; }
  .ch-head input[type=search] { flex: 1 1 100%; }
  .start-bar { bottom: calc(58px + env(safe-area-inset-bottom)); padding: 8px 12px; }
  .start-bar #start { flex: 0 0 auto; }
  .picker, .sessions { padding: 4px 12px 80px; }
  .mini-player { left: 8px; right: 8px; bottom: calc(64px + env(safe-area-inset-bottom)); justify-content: space-between; }
  .mini-player input[type=range] { width: 70px; }
  main#live { display: block; overflow: hidden; }
  main#live > section, main#live > aside { height: 100%; padding: 8px 10px; }
  body:not([data-tab="claims"]) main#live > aside, body[data-tab="claims"] main#live > .transcript { display: none; }
  body[data-view="live"] main#live { display: block !important; }
  .segment { grid-template-columns: 1fr; gap: 2px; }
  .segment .tr, .claim-detail { grid-column: 1; margin-top: 0; }
  .segment .who .time { display: inline; margin-left: 6px; }
  mark.claim { border-bottom-width: 4px; }
  .legend { display: none; }
  .toasts { top: auto; bottom: calc(70px + env(safe-area-inset-bottom)); left: 8px; right: 8px; width: auto; }
}

/* narrow phones: icon-only Stop so ⚙ stays on the top row */
@media (max-width: 420px) { #stop .tx { display: none; } #stop { min-width: 44px; } }

/* ---------- split screen / short window while live: only the essentials ---------- */
@media (max-height: 560px) {
  body.running .logo, body.running .nav, body.running .context-strip, body.running .filter-bar, body.running .legend,
  body.running #langChip, body.running #settingsBtn, body.running #feedBox, body.running #listenBox { display: none !important; }
  body.running { padding-bottom: 0; }
  body.running header#bar { padding: calc(3px + env(safe-area-inset-top)) 8px 3px; gap: 6px; flex-wrap: nowrap; min-height: 0; }
  body.running .live-info { order: 0; flex: 1; }
  body.running .tog { padding: 4px 8px; } body.running button { min-height: 34px; }
  body.running main#live > section, body.running main#live > aside { padding: 6px 8px; }
  body.running aside h2 { margin: 6px 0 4px; }
  body.running .mini-player { bottom: 6px; }
  .alert { top: 4px; padding: 8px 40px 8px 12px; } .alert .title { font-size: 18px; } .alert .body { font-size: 16px; }
}

/* the channel mini player is docked: the page ends above it, so it never covers text */
:root { --mp-h: 50px; }
body.has-player { padding-bottom: var(--mp-h); }
body.has-player .mini-player { left: 0; right: 0; bottom: 0; height: var(--mp-h); border-radius: 0; border-width: 1px 0 0; box-shadow: none;
  max-width: none; justify-content: center; }
body.has-player .start-bar { bottom: var(--mp-h); }
@media (max-width: 760px) {
  body.has-player { padding-bottom: calc(62px + var(--mp-h) + env(safe-area-inset-bottom)); }
  body.has-player .mini-player { bottom: calc(62px + env(safe-area-inset-bottom)); padding: 4px 10px; justify-content: space-between; }
  body.has-player .start-bar { bottom: calc(62px + var(--mp-h) + env(safe-area-inset-bottom)); }
}
@media (max-height: 560px) { body.running.has-player { padding-bottom: var(--mp-h); } body.running.has-player .mini-player { bottom: 0; } }
