/* Frames, borders, focus rings and chevrons use the skin's light button blue, not green (Micha 26 Oct 11:38); green stays only where it means status. */
:root { --ds-frame: var(--ds-btn-strong, #0098D7); }
/* Dash styles: Manager's look (zinc + emerald, dark), v12 layout. Landscape first: header cards in one row and two columns (timeline | 2x3 gauges) on tablet landscape / desktop (max ~1100 px), one column up to ~680 px on tablet portrait, Manager's "open on a tablet or computer" note instead of the app on phones (the stacked view-only phone layout below is kept for a later minimal phone Dash, only used with body.phone-dash = dev flag ?phone=1); 44 px+ touch targets, 100dvh and safe-area insets. */
:root {
  --zinc-200: #e4e4e7; --zinc-300: #d4d4d8; --zinc-400: #a1a1aa; --zinc-500: #71717a; --zinc-700: #3f3f46; --zinc-800: #27272a; --zinc-900: #18181b; --zinc-950: #09090b;
  --emerald-300: #6ee7b7; --emerald-400: #34d399; --emerald-600: #059669; --emerald-700: #047857; --teal-700: #0f766e;
  --red: #f87171; --red-600: #dc2626; --red-700: #b91c1c; --amber: #fbbf24; --amber-bg: rgba(251, 191, 36, 0.12); --blue: #60a5fa;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100dvh; background: var(--zinc-950); color: #fff; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 16px; -webkit-tap-highlight-color: transparent; }
.app { min-height: 100dvh; display: flex; flex-direction: column; }
h2 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.muted { color: var(--zinc-400); }
.small { font-size: 0.85rem; }
[hidden] { display: none !important; }
.loading { padding: 2rem; text-align: center; }

/* ----- phone note vs app (Manager's note look; body.phone-dash = dev flag ?phone=1 shows the view-only app instead) ----- */
.phone-note { display: none; }
@media (max-width: 699px), (orientation: landscape) and (max-height: 500px) {
  /* Host on a phone (Micha 28 Oct): the app stays up. Only the Controls tab is shown. */
  .phone-note { display: none !important; }
  .tabbar .tab:not(#tab-controls) { display: none; }
}

.pv-phone { width: min(390px, 100%); margin: 0 auto; }
.pv-frame { width: 100%; height: min(78dvh, 740px); border: 0; border-radius: 28px; background: #111; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
/* ----- buttons (Manager) ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 44px; padding: 0 1.1rem; border-radius: 0.7rem; border: 2px solid transparent; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; color: #fff; white-space: nowrap; background: none; }
.btn.small { padding: 0 0.8rem; font-size: 0.9rem; }
.btn.big { min-height: 56px; padding: 0 1.4rem; font-size: 1.05rem; }
.btn.primary { background: var(--emerald-700); border-color: var(--ds-frame); } /* green fill = data change; outline blue like every frame (Micha 26 Oct 13:04) */
/* Button colour rule (Micha 26 Oct 11:40): green/red only for actions that change data; navigation, open, view, pickers, toggles and tabs are blue. */
.btn.primary.nav { background: var(--ds-btn-fade, linear-gradient(#4CC5F7, #0098D7)); border-color: var(--ds-frame); color: #fff; }
.btn.primary.nav:active { background: var(--ds-btn-deeper, #00638C); }

.btn.secondary { background: var(--zinc-800); border-color: var(--zinc-700); }
.btn.ghost { color: var(--zinc-300); }
.btn.ghost:hover { background: var(--zinc-800); }
.gauge .btn.launch.stop { background: var(--red-700); border-color: var(--red-600); }
.btn.danger-fill { background: var(--red-700); border-color: var(--red-600); }
.btn:active:not([disabled]) { transform: scale(0.98); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn:focus-visible, .seg-btn:focus-visible, .ev-select:focus-visible, .host-filter:focus-visible { outline: 3px solid var(--ds-frame); outline-offset: 2px; }

/* ----- top bar ----- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 0.8rem; padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); background: rgba(9, 9, 11, 0.95); border-bottom: 1px solid var(--zinc-800); backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 0.5rem; color: #fff; text-decoration: none; cursor: default; user-select: none; font-weight: 800; font-size: 1.1rem; min-height: 44px; flex: none; }
.brand img { width: 4.5rem; }
.brand span { color: var(--blue); }
/* Server name next to the title, same size, white (the title word stays blue) (Micha 28 Oct). Hidden when unset. */
.brand .env-name { color: #fff; font-weight: 800; font-size: 1.1rem; white-space: nowrap; }
.brand .env-name[hidden] { display: none !important; }
.ev-picker { position: relative; min-width: 0; max-width: 26rem; flex: 0 1 26rem; }
.ev-select { display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 44px; min-width: 0; padding: 0 0.7rem; border-radius: 0.6rem; border: 1px solid var(--zinc-700); background: var(--zinc-900); color: #fff; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.ev-picker.open .ev-select { border-color: var(--ds-frame); }
.ev-cur { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-caret { flex: none; color: var(--zinc-400, #a1a1aa); }
.ev-tag { flex: none; font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 999px; color: var(--zinc-400, #a1a1aa); border: 1px solid var(--zinc-700); }
.ev-tag.ev-live { color: #04130c; background: #34d399; border-color: #34d399; }
.ev-list { position: absolute; top: calc(100% + 4px); left: 10%; width: 80%; z-index: 60; margin: 0; padding: 0.3rem; list-style: none; max-height: 60vh; overflow-y: auto; background: var(--zinc-900); border: 1px solid var(--zinc-700); border-radius: 0.7rem; box-shadow: 0 12px 32px rgba(0,0,0,.55); }
.ev-list[hidden] { display: none; }
.ev-opt { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0.35rem 0.6rem; border-radius: 0.5rem; cursor: pointer; font-weight: 600; }
.ev-opt.active { background: var(--zinc-800, #27272a); }
.ev-check { flex: none; width: 1rem; color: #34d399; }
.ev-opt-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 0.4rem; }
.seg { display: inline-flex; border: 1px solid var(--zinc-700); border-radius: 0.6rem; overflow: hidden; }
.seg-btn { min-height: 44px; min-width: 44px; padding: 0 0.6rem; border: 0; background: transparent; color: var(--zinc-300); font: inherit; font-weight: 700; cursor: pointer; }
.seg-btn.on { background: var(--ds-frame); color: #fff; }

/* ----- page ----- */
.page { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 0.75rem max(16px, env(safe-area-inset-right)) 0.5rem max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 0.75rem; }
.panel { background: var(--zinc-900); border: 1px solid var(--zinc-800); border-radius: 1rem; padding: 0.9rem 1rem; min-width: 0; }
.message { text-align: center; padding: 2rem 1rem; width: 100%; max-width: 560px; margin: 2rem auto; }
.empty-note { margin: 1.5rem 0; text-align: center; }
.warn-banner { padding: 0.7rem 1rem; border-radius: 0.75rem; background: var(--amber-bg); border: 1px solid var(--amber); color: var(--amber); font-weight: 600; }
.foot { text-align: center; color: var(--zinc-500); font-size: 0.8rem; padding: 0.5rem 1rem max(0.6rem, env(safe-area-inset-bottom)); }

/* info line */
.infobar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.live-stamp { color: var(--muted, #9ca3af); font-variant-numeric: tabular-nums; }
.live-stamp.lost { color: #fde047; }
.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--zinc-800); color: var(--zinc-300); }
.badge.st-active { background: rgba(52, 211, 153, 0.15); color: var(--emerald-300); }
.badge.st-active::before { content: ''; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--emerald-400); margin-right: 0.35rem; vertical-align: 0.05rem; }
.badge.st-planned, .badge.st-authorised { background: rgba(167, 139, 250, 0.2); color: #c4b5fd; }
.badge.demo { background: var(--amber-bg); color: var(--amber); }
.view-only-note { flex-basis: 100%; margin: 0; font-size: 0.85rem; color: var(--zinc-300); background: var(--zinc-900); border: 1px dashed var(--zinc-700); border-radius: 0.6rem; padding: 0.5rem 0.7rem; }

/* header cards (v12): EVENT | STARTED | ENDED | TIME LAPSE | Start / End event */
.cards { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 0.6rem; }
.card { display: flex; flex-direction: column; justify-content: center; gap: 0.2rem; min-height: 72px; padding: 0.6rem 0.9rem; border-radius: 0.9rem; background: var(--zinc-900); border: 1px solid var(--zinc-800); min-width: 0; }
.card-label { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--zinc-400); font-weight: 700; }
.card-value { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-event .card-value { font-size: 1.2rem; }
.card-sub { font-size: 0.8rem; }
.c-lapse { background: var(--teal-700); border-color: #14b8a6; text-align: center; align-items: center; }
.c-lapse .card-label { color: #ccfbf1; }
.c-lapse .card-value { font-size: 1.5rem; }
.card-actions { display: flex; flex-direction: column; gap: 0.4rem; justify-content: center; }
.card-actions .btn.big { min-height: 48px; font-size: 1rem; }

/* main area */
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
.p-timeline { display: flex; flex-direction: column; }
.chart { position: relative; flex: 1 1 0; min-height: 260px; touch-action: pan-y; }
.chart svg { display: block; position: absolute; inset: 0; } /* out of the flow, so the box size comes from the layout only */
.chart .grid line { stroke: var(--zinc-800); }
.chart .ax { fill: var(--zinc-400); font-size: 11px; }
.chart .ht { stroke: var(--zinc-400); stroke-dasharray: 5 5; }
.chart .cursor { stroke: var(--zinc-500); }
.tip { position: absolute; z-index: 2; width: 170px; padding: 0.5rem 0.6rem; border-radius: 0.6rem; background: rgba(24, 24, 27, 0.96); border: 1px solid var(--zinc-700); font-size: 0.8rem; pointer-events: none; }
.tip div { display: flex; align-items: center; gap: 0.35rem; }
.legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem 1rem; margin-bottom: 0.4rem; font-size: 0.8rem; color: var(--zinc-300); }
.legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.8rem; }
.legend li { display: inline-flex; align-items: center; gap: 0.3rem; }
.legend i, .tip i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.legend-markers { color: var(--zinc-400); }

/* gauges */
.gauges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
.gauge { display: flex; flex-direction: column; align-items: center; padding: 0.5rem 0.4rem 0.55rem; border-radius: 0.8rem; background: var(--zinc-950); border: 1px solid var(--zinc-800); text-align: center; min-width: 0; }
.gauge h3 { margin: 0 0 0.1rem; font-size: 0.9rem; }
.arc-wrap { position: relative; width: 100%; max-width: 130px; }
.arc { display: block; width: 100%; height: auto; }
.played { position: absolute; left: 0; right: 0; bottom: -0.1rem; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.of { margin: 0.15rem 0 0; font-size: 0.78rem; color: var(--zinc-400); }
.left { font-weight: 700; color: var(--zinc-500); }
.left.has-left { color: var(--amber); }
.gauge .btn.launch { margin-top: 0.35rem; min-height: 44px; min-width: 7rem; padding: 0 0.9rem; background: var(--emerald-700); border-color: var(--ds-frame); font-size: 0.95rem; }
.done-pill { margin-top: 0.35rem; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 7rem; padding: 0 0.9rem; border-radius: 0.6rem; background: var(--zinc-800); color: var(--zinc-400); font-weight: 700; font-size: 0.9rem; }

/* tablet landscape / desktop: two columns, the screen fits one view */
@media (min-width: 900px) and (min-height: 501px) and (orientation: landscape) {
  .grid2 { grid-template-columns: minmax(0, 1.55fr) minmax(330px, 1fr); flex: 1; min-height: 0; }
  .chart { min-height: 240px; }
  .gauges { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
  .gauge { padding: 0.35rem 0.3rem 0.45rem; }
  .gauge .btn.launch, .done-pill { min-width: 0; width: 100%; padding: 0 0.3rem; }
  .grid2 { grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr); }
  .arc-wrap { max-width: 104px; }
  .played { font-size: 1.3rem; }
  .gauge .btn.launch { margin-top: 0.25rem; }
  .done-pill { margin-top: 0.25rem; }
  .panel { padding: 0.75rem 0.9rem; }
  .card { min-height: 66px; }
}

/* tablet portrait: one column up to ~680 px, cards in two rows */
@media (orientation: portrait) and (min-width: 700px) {
  .page { max-width: 712px; }
  .cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
  .c-event { grid-column: 1 / -1; }
  .card-actions { grid-column: 1 / -1; flex-direction: row; }
  .card-actions .btn { flex: 1; }
  .chart { min-height: 360px; }
  .gauges { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* any not-landscape-wide layout below 900 px that is not portrait tablet (e.g. small landscape windows) */
@media (max-width: 899px) and (orientation: landscape) and (min-height: 501px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .c-event, .card-actions { grid-column: 1 / -1; }
  .card-actions { flex-direction: row; }
  .card-actions .btn { flex: 1; }
  .gauges { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* phones: stacked, view-only (no editing controls are rendered). Off by default (phones get the note above); kept for a later minimal phone Dash, shown only with the dev flag ?phone=1. */
@media (max-width: 699px), (orientation: landscape) and (max-height: 500px) {
  .topbar { flex-wrap: wrap; gap: 0.4rem 0.6rem; }
  .brand img { width: 3.6rem; }
  .ev-picker { order: 3; flex: 1 1 100%; max-width: none; }
  .hide-phone { display: none; }
  .cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.45rem; }
  .c-event, .c-lapse { grid-column: 1 / -1; }
  .card { min-height: 60px; padding: 0.5rem 0.7rem; }
  .card-value { font-size: 0.95rem; }
  .c-lapse .card-value { font-size: 1.2rem; }
  .chart { min-height: 260px; }
  .gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .played { font-size: 1.25rem; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .gauges { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* toasts + confirm */
#toasts { position: fixed; z-index: 50; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 0.4rem; width: min(92vw, 520px); }
.toast { padding: 0.75rem 1rem; border-radius: 0.7rem; background: var(--zinc-800); border: 1px solid var(--zinc-700); color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(0, 0, 0, 0.6); }
.modal { width: min(460px, 100%); padding: 1.3rem; border-radius: 1rem; background: var(--zinc-900); border: 1px solid var(--zinc-700); }
.modal h2 { font-size: 1.25rem; }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .btn:active { transform: none !important; } }

/* game control (host.js): one compact row on landscape, wraps elsewhere */
.host { padding: 0.55rem 0.9rem; }
.host h2 { margin: 0; white-space: nowrap; }
.host-row { display: flex; align-items: center; gap: 0.5rem 0.8rem; flex-wrap: wrap; }
.host-note { margin: 0.2rem 0 0; }
.host-ev { flex: 0 1 14rem; }
.host-evname { font-weight: 700; color: var(--zinc-300); }
.host-chooser { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.5rem; }
.host-filter { min-height: 44px; min-width: 7.5rem; padding: 0 0.55rem; border-radius: 0.6rem; border: 1px solid var(--zinc-700); background: var(--zinc-900); color: #fff; font: inherit; font-weight: 600; color-scheme: dark; }
.host-pick-empty { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip { min-height: 44px; padding: 0 0.75rem; border-radius: 999px; border: 1px solid var(--zinc-700); background: var(--zinc-950); color: #fff; font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.chip.on { background: var(--ds-frame); border-color: var(--ds-frame); }
.chip[disabled] { opacity: 0.4; cursor: not-allowed; }
.chip small { color: var(--zinc-400); font-weight: 500; }
.host .btn.big { min-height: 48px; }
.host-status { font-weight: 700; color: var(--zinc-400); font-variant-numeric: tabular-nums; }
.host-status.countdown { color: var(--amber); font-size: 1.15rem; }
.host-status.running { color: var(--emerald-300); }

/* ----- counters panel (counters.js): groups in fan-journey order; 2 columns on phones, more on iPad/desktop ----- */
.p-counters h2 { margin-bottom: 0.6rem; }
.ctr-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
.ctr-group h3, .ctr-funnel h3, .ctr-games h3 { margin: 0 0 0.4rem; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--zinc-400); }
.ctr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
.ctr { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; min-height: 64px; padding: 0.5rem 0.7rem; border-radius: 0.75rem; border: 1px solid var(--zinc-800); background: var(--zinc-950); color: #fff; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.ctr:focus-visible { outline: 3px solid var(--ds-frame); outline-offset: 2px; }
.ctr-label { font-size: 0.78rem; color: var(--zinc-300); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ctr-value { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ctr-src { font-size: 0.68rem; color: var(--emerald-300); }
.ctr.etl .ctr-src { color: var(--zinc-500); }
.ctr-hint { display: none; font-size: 0.75rem; color: var(--zinc-300); line-height: 1.3; }
.ctr.show-hint .ctr-hint { display: block; }
.ctr-funnel, .ctr-games { margin-top: 0.9rem; }
.ctr-funnel ol { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.ctr-funnel li { display: flex; gap: 0.35rem; align-items: baseline; padding: 0.25rem 0.55rem; border-radius: 999px; background: var(--zinc-800); font-size: 0.82rem; }
.ctr-funnel li + li::before { content: '→'; color: var(--zinc-500); margin-right: 0.2rem; }
.ctr-games table { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.ctr-games th { text-align: left; color: var(--zinc-400); font-weight: 600; padding: 0.25rem 0.4rem; border-bottom: 1px solid var(--zinc-800); }
.ctr-games td { padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--zinc-800); }
.ctr-run { color: var(--emerald-300); }
.card-active { color: var(--emerald-300); }
@media (min-width: 700px) { .ctr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) {
  .ctr-groups { grid-template-columns: repeat(5, minmax(0, 1fr)); } .ctr-grid { grid-template-columns: minmax(0, 1fr); gap: 0.35rem; }
  .ctr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.5rem; min-height: 0; padding: 0.4rem 0.6rem; }
  .ctr-value { font-size: 1.1rem; grid-row: span 2; align-self: center; } .ctr-hint { grid-column: 1 / -1; }
}

/* V.XY deploy version badge (shared/version.js): small and muted; tap shows release, commit and deploy time */
.ver-badge { background: none; border: 0; padding: 2px 4px; color: var(--zinc-500, #71717a); font: 500 0.72rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.02em; cursor: pointer; white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }
.ver-badge:hover, .ver-badge:focus-visible { color: var(--zinc-300, #d4d4d8); }
.warn-banner.err { background: rgba(248, 113, 113, 0.12); border-color: var(--red); color: var(--red); }

/* Launch window "Optional teams for this game" (launch-window.js) */
.lw-list { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.8rem 0; max-height: 50vh; overflow: auto; }
.lw-row { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.6rem 0.7rem; border: 1px solid var(--zinc-700); border-radius: 0.7rem; cursor: pointer; }
.lw-row:has(input:checked) { border-color: var(--lime-400, #a3e635); }
.lw-row input { width: 1.2rem; height: 1.2rem; margin-top: 0.15rem; flex: none; }
.lw-text { display: flex; flex-direction: column; gap: 0.15rem; }
.lw-warn { color: #fbbf24; }

/* ----- Dash tabs (Micha 25 Oct 2026): pinned header (top bar + event / status / current game + tab bar), one tab panel at a time ----- */
.dash-pin { position: sticky; top: 0; z-index: 10; background: rgba(9, 9, 11, 0.97); border-bottom: 1px solid var(--zinc-800); backdrop-filter: blur(6px); }
.dash-pin .topbar { position: static; border-bottom: 0; background: none; backdrop-filter: none; }
.tabbar { display: flex; gap: 0.25rem; max-width: 1100px; margin: 0 auto; padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabbar::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; min-height: 44px; padding: 0 1rem; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--zinc-300, #d4d4d8); font: 600 0.95rem/1 system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.tab.on { color: #fff; border-bottom-color: var(--ds-frame); }
.tab:focus-visible { outline: 2px solid var(--ds-frame); outline-offset: -2px; }
.tabpanel { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.tabpanel[hidden] { display: none; }
/* iPad / short landscape: the pinned block must never eat the screen (lesson of #227: a tall sticky column got cut); there it scrolls with the page */
@media (orientation: landscape) and (max-height: 600px) { .dash-pin { position: static; } }
@media (max-width: 699px) { .tab { padding: 0 0.7rem; font-size: 0.9rem; } }
/* Graphs tab: graph pull-down (Micha 26 Oct 02:14) */
.graph-pick { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.75rem; font-weight: 600; }
.graph-pick select { min-height: 44px; min-width: 12rem; padding: 0 0.75rem; border-radius: 10px; font: inherit; background: var(--card, #161a24); color: inherit; border: 1px solid rgba(255,255,255,0.25); }
/* Host graphs (graphs.js) */
.mw-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
/* Controls Match breaks: column of buttons (Graphs keeps the inline row). Exclusive open break is unchanged. */
.mw-row.mw-stack { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 0.4rem; }
.mw-row.mw-stack .mw-btn { width: 100%; }
/* Host panel titles match Audience → Languages (Micha 28 Oct): bold white sentence case, optional .muted.small meta on the same baseline row.
   languages.css .lg-title is the reference and stays as it is. Not the EVENT .card-label. */
.panel h2 { font-size: 1.05rem; font-weight: 700; letter-spacing: normal; text-transform: none; color: #fff; }
.panel-title { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.panel-title h2 { margin: 0; }
/* Match breaks record data (graphs): green buttons per the colour rule (Micha 26 Oct 11:55); the open break gets a white ring. */
.btn.mw-btn.mw-open { box-shadow: 0 0 0 2px #fff; }
.p-graph .gsvg { width: 100%; height: auto; display: block; }
.p-graph .ax, .gsvg .ax { fill: var(--zinc-400); font-size: 11px; }
.gbars { display: grid; gap: 0.35rem; }
.gbar { display: grid; grid-template-columns: minmax(7rem, 14rem) 1fr auto auto; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.gbar-t { height: 0.9rem; background: var(--zinc-800); border-radius: 0.3rem; overflow: hidden; }
.gbar-t i { display: block; height: 100%; border-radius: 0.3rem; }
.gtable { width: 100%; border-collapse: collapse; }
.gtable th, .gtable td { text-align: right; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--zinc-800); }
.gtable th:first-child, .gtable td:first-child { text-align: left; }
.graph-meta { margin-top: 0.6rem; }
.chart .poll-n { fill: #22d3ee; font-weight: 600; }
.tip .tip-q { display: block; margin: 0.2rem 0 0.3rem; color: var(--zinc-200); }

/* Controls layout + one Event card (Micha 26 Oct 03:34-03:36) */
.ctl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0.6rem; align-items: start; }
.ctl-left, .ctl-right { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.ctl-left > .panel, .ctl-right > .panel { margin: 0; }
.ctl-left .gauges { grid-template-columns: minmax(0, 1fr); }
.ctl-grid .cards, .ctl-grid .cards[class] { display: block; }
.ctl-grid .c-event { gap: 0.35rem; }
.c-event .ev-name { white-space: normal; }
.ev-lines { display: flex; flex-direction: column; gap: 0.2rem; margin-top: 0.3rem; padding-top: 0.4rem; border-top: 1px solid var(--zinc-800); }
.ev-line { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.ev-line-label { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--zinc-400); font-weight: 700; }
.ev-line .card-value, .c-lapse .ev-line .card-value { font-size: 1rem; }
.ev-line.live .card-value { color: #5eead4; }
.c-event .card-actions { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
@media (max-width: 899px) { .ctl-grid { grid-template-columns: minmax(0, 1fr); } .ctl-left .gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sum-modal { width: min(720px, 100%); max-height: calc(100vh - 2rem); overflow: auto; }
.sum-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.sum-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.45rem 1rem; margin: 0.6rem 0 0; }
.sum-row { display: contents; }
.sum-row dt { color: var(--zinc-400); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; padding-top: 0.1rem; }
.sum-row dd { margin: 0; }
.sum-row ul { margin: 0; padding-left: 1.1rem; }
@media (max-width: 599px) { .sum-list { grid-template-columns: minmax(0, 1fr); } .sum-row dd { margin-bottom: 0.4rem; } }
