/* Everything else, in its original order: rules here compete by source order (58 interleaved
   runs across the views), so moving one changes which rule wins. Split a view out only together
   with the rules it competes with — the visual baseline in the PR description is how to check. */
@layer app {
  * { box-sizing: border-box; margin: 0; }
  html { height: 100%; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
  body {
  height: 100dvh; overflow: hidden;
  display: grid; grid-template-rows: auto auto 1fr;
  background: radial-gradient(120% 80% at 50% 0%, var(--room-hi), var(--room) 45%, var(--bg));
  color: var(--bone);
  font: 500 15px/1.4 var(--f-mono);
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
  /* CRT: scanlines + grain + vignette, never interactive */
  html::after, body::before, body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 90; }
  body::before { background: repeating-linear-gradient(to bottom, var(--scan) 0 1px, transparent 1px 3px); opacity: .35; }
  body::after { background: radial-gradient(125% 95% at 50% 42%, transparent 60%, var(--vig) 100%); opacity: .7; }
  html::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: var(--noise-op); mix-blend-mode: var(--noise-blend);
}
  button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
  input, select, textarea { font: inherit; user-select: text; -webkit-user-select: text; }
  code, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
  :focus-visible { outline: 2px solid var(--phos); outline-offset: 2px; }
  .kicker { font: 600 10.5px/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
  .count-led { font: 400 34px/.8 var(--f-led); color: var(--amber); }
  .count-led small { font-size: .55em; color: var(--mute); text-shadow: none; }
  /* ---------- scoreboard ---------- */
  .scoreboard {
  position: relative; z-index: 10;
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center;
  gap: clamp(12px, 2vw, 28px);
  padding: calc(10px + env(safe-area-inset-top)) calc(clamp(14px, 2.4vw, 28px) + env(safe-area-inset-right)) 18px calc(clamp(14px, 2.4vw, 28px) + env(safe-area-inset-left));
  background: linear-gradient(var(--panel-3), var(--panel));
  border-bottom: 1px solid var(--line-2);
  box-shadow: var(--inner);
}
  .smpte { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; display: flex; opacity: .55; }
  .smpte i { flex: 1; }
  .smpte i:nth-child(1) { background: #C0C0C0; }
  .smpte i:nth-child(2) { background: #C0C000; }
  .smpte i:nth-child(3) { background: #00C0C0; }
  .smpte i:nth-child(4) { background: #00C000; }
  .smpte i:nth-child(5) { background: #C000C0; }
  .smpte i:nth-child(6) { background: #C00000; }
  .smpte i:nth-child(7) { background: #0000C0; }
  /* live LED board mark (logo.js) */
  .bm-slot { display: block; flex: none; cursor: pointer; }
  .bm-slot svg { display: block; width: 100%; height: 100%; overflow: visible; }
  .bm-panel { fill: var(--sunk); stroke: var(--phos-dim); stroke-width: 6; }
  .bm-rule { stroke: var(--phos-soft); stroke-width: 3; stroke-dasharray: 2 6; }
  .bm-handle { fill: var(--phos-dim); }
  .bm-handle2 { fill: var(--phos-soft); }
  .bm-dots circle { fill: var(--led-off); transition: fill .05s linear; }
  .bm-dots circle.o { fill: var(--led-off-p); }
  .bm-dots circle.on.i { fill: var(--phos); }
  .bm-dots circle.on.o { fill: var(--cliply-pink); }
  .bm-svg { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--phos) 40%, transparent)); }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .bm-svg { filter: none; }
  }
  :root[data-theme="light"] .bm-svg { filter: none; }
  .brand-hero { display: flex; align-items: center; gap: 18px; margin-top: 26px; padding-top: 22px; border-top: 1px dashed var(--line-2); }
  .brand-hero .bm-hero { width: 124px; height: 104px; }
  .brand-hero b { display: block; font: 400 40px/1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; }
  .brand-hero span { font-size: 12.5px; color: var(--mute); }
  .sb-score { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 1.6vw, 22px); min-width: 0; }
  .sb-team { flex: 1; min-width: 0; font: 600 clamp(11px, 1.4vw, 14px)/1.25 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--bone); text-align: right; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: break-word; min-width: 8ch; }
  .sb-team--away { text-align: left; color: var(--cyan); }
  .sb-num {
  min-width: 1.4ch; padding: 2px 10px 0; text-align: center;
  font: 400 clamp(56px, 7vw, 88px)/.78 var(--f-led); color: var(--amber); text-shadow: var(--glow-a);
  background: var(--sunk); border: 1px solid var(--line); border-radius: 6px;
}
  .sb-num[data-team="away"] { color: var(--cyan); text-shadow: var(--glow-cy); }
  .sb-num.bump { animation: bump .6s cubic-bezier(.2, .9, .3, 1.4); }
  .sb-sep { font: 400 40px/.8 var(--f-led); color: var(--mute); }
  .sb-clock {
  position: relative; display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 12px; row-gap: 2px;
  min-width: 240px; padding: 8px 16px 10px;
  background: var(--sunk); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--inner);
}
  .sb-clock::before, .sb-clock::after { content: ''; position: absolute; width: 10px; height: 10px; border-color: var(--phos-dim); border-style: solid; }
  .sb-clock::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
  .sb-clock::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
  /* z-index: the LED time below leans into this row (line-height .78) and would take the lamp's taps. */
  .sb-period { position: relative; z-index: 1; grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font: 600 10.5px var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
  .sb-time { font: 400 clamp(62px, 7.6vw, 96px)/.78 var(--f-led); font-variant-numeric: tabular-nums; color: var(--phos-dim); }
  .is-running .sb-time { color: var(--phos); text-shadow: var(--glow-p); }
  .sb-remain { font: 500 11px var(--f-mono); letter-spacing: .06em; color: var(--mute); justify-self: end; text-transform: uppercase; }
  .sb-remain.over { color: var(--tally); }
  .sb-progress { grid-column: 1 / -1; height: 3px; margin-top: 6px; background: var(--line); border-radius: 2px; overflow: hidden; }
  .sb-progress i { display: block; height: 100%; width: var(--w, 0%); background: var(--phos); transition: width .25s linear; }
  .sb-ctrl { display: flex; gap: 8px; align-items: center; }
  .adj { display: flex; flex-direction: column; gap: 4px; }
  .adj .btn-ghost { height: 36px; font-size: 12px; padding: 0 10px; }
  .btn-play {
  display: flex; align-items: center; gap: 10px; height: 76px; padding: 0 26px 0 20px;
  background: var(--phos); color: var(--on-phos); border-radius: 8px;
  font: 700 17px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase;
  box-shadow: var(--glow-p), 0 4px 0 var(--phos-soft); transition: transform 150ms ease-out, box-shadow 150ms ease-out;
}
  .btn-play svg { width: 24px; height: 24px; }
  .btn-play:not(:disabled):active { transform: scale(.96); }
  .btn-play.is-running { background: var(--amber); color: var(--on-amber); box-shadow: var(--glow-a), 0 4px 0 var(--amber-dim); }
  .btn-ghost { height: 76px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 8px; font: 600 12px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--bone); background: var(--panel-2); }
  .btn-ghost:active { background: var(--panel-3); }
  .btn-ghost:disabled { opacity: .35; }
  /* ---------- tabs ---------- */
  .tabs { display: flex; overflow-x: auto; scrollbar-width: none; background: var(--panel); border-bottom: 1px solid var(--line-2); padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left); }
  .tabs button {
  flex: 1 0 auto; min-height: 56px; padding: 0 18px; position: relative;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font: 600 13px/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--mute);
  border-right: 1px solid var(--line);
}
  .tabs button:last-child { border-right: 0; }
  .tabs button[aria-current="page"] { color: var(--phos); background: var(--panel-3); }
  .tabs button[aria-current="page"]::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--phos); }
  .count { font: 400 17px/1 var(--f-led); padding: 1px 6px 0; border-radius: 3px; background: var(--sunk); border: 1px solid var(--line-2); color: var(--amber); letter-spacing: 0; text-shadow: none; }
  #view {
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: clamp(12px, 2vw, 22px) calc(clamp(12px, 2vw, 22px) + env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) calc(clamp(12px, 2vw, 22px) + env(safe-area-inset-left));
}
  .zone-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 12px; }
  .zone-h h2 { font: 400 26px/1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; color: var(--bone); }
  .zone-h > span { font: 400 26px/1 var(--f-led); color: var(--amber); }
  .section-h { font: 600 10.5px/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--mute); margin-bottom: 10px; }
  .empty { color: var(--mute); padding: 8px 2px; font-size: 13px; }
  .empty.big { font-size: 18px; padding: 40px 0; text-align: center; }
  .link { font: 600 11px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--phos); min-height: 44px; }
  /* ---------- rotations ---------- */
  #view.fit { overflow: hidden; display: flex; flex-direction: column; padding-bottom: calc(clamp(10px, 1.6vw, 16px) + env(safe-area-inset-bottom)); }
  #view.fit > section { flex: 1; min-height: 0; }
  .hint {
  grid-area: hint; display: flex; align-items: center; gap: 10px; min-height: 46px;
  padding: 4px 6px 4px 14px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r);
  font: 500 13.5px/1.3 var(--f-mono); color: var(--bone);
}
  .hint__dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--mute); }
  .hint > span:not(.hint__dot) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hint button { flex: none; }
  .hint button { height: 42px; padding: 0 14px; border: 1px solid currentColor; border-radius: 6px; font: 600 11px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; }
  .form-chip {
  flex: none; min-height: 40px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--sunk);
  font: 400 22px/1 var(--f-led); color: var(--mute); letter-spacing: .04em;
}
  .form-chip[aria-pressed="true"] { color: var(--on-phos); background: var(--phos); border-color: var(--phos); }
  .rot .subs-feed, .stats .subs-feed { grid-area: feed; }
  .grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .grid--extra { margin-top: 12px; }
  .in { color: var(--phos); font-weight: 600; }
  .out { color: var(--tally); font-weight: 600; }
  .x { width: 38px; height: 38px; flex: none; border-radius: 6px; border: 1px solid var(--line-2); font: 400 20px/1 var(--f-mono); color: var(--mute); }
  .tgt--away { color: var(--cyan); }
  /* A hint, not a reading: it must not inherit the board's LED face from `.zone-h > span`. */
  .zone-h > span.armed-for { font: 500 12px var(--f-mono); letter-spacing: .06em; color: var(--mute); text-shadow: none; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .zone-h h2 + .armed-for { margin-right: auto; text-align: left; }
  .zone-h > span.armed-for.is-on { color: var(--amber); }
  [data-tone="card-g"] { --c: var(--phos); }
  [data-tone="card-y"] { --c: var(--amber); }
  [data-tone="card-r"] { --c: var(--tally); }
  .pill { height: 44px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); font: 600 11px var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
  .pill[aria-pressed="true"] { color: var(--on-phos); background: var(--phos); border-color: var(--phos); }
  .dim { color: var(--mute); }
  .sub { color: var(--mute); max-width: 64ch; font-size: 13px; }
  .sub code { font-size: .92em; padding: 1px 5px; border-radius: 3px; background: var(--sunk); color: var(--bone); }
  .form-grid, .offsets { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
  .field { display: flex; flex-direction: column; gap: 6px; }
  .field > span { font: 600 10px var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
  .inp { width: 100%; height: 50px; padding: 0 12px; background: var(--sunk); color: var(--bone); border: 1px solid var(--line-2); border-radius: 6px; font: 500 15px var(--f-mono); appearance: none; -webkit-appearance: none; }
  select.inp { background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(-45deg, transparent 50%, var(--mute) 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px; }
  textarea.inp { height: 110px; padding: 10px 12px; font: 500 13px/1.45 var(--f-mono); resize: vertical; }
  .inp:focus { outline: none; border-color: var(--phos); box-shadow: var(--glow-p); }
  .icon-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 6px; background: none; font: 400 22px/1 var(--f-mono); color: var(--mute); transition: background-color 150ms, color 150ms; }
  .icon-btn:not(:disabled):active { background: var(--panel-3); color: var(--bone); }
  @media (hover: hover) { .icon-btn:not(:disabled):hover { background: var(--panel-2); color: var(--bone); } }
  .btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
  .btn {
  min-height: 52px; padding: 0 20px; display: inline-flex; align-items: center; gap: 10px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px;
  font: 600 12px/1 var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--bone); cursor: pointer;
}
  .btn { transition: transform 150ms ease-out, background-color 150ms, border-color 150ms, color 150ms; }
  .btn:not(:disabled):active { transform: scale(.96); }
  .btn--primary { background: var(--phos); border-color: var(--phos); color: var(--on-phos); }
  .btn--signal { background: var(--phos); border-color: var(--phos); color: var(--on-phos); }
  .btn--danger { color: var(--tally); border-color: color-mix(in srgb, var(--tally) 45%, var(--line-2)); }
  .btn--ghost { background: none; }
  .file-btn input { display: none; }
  .import { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
  .mbar { display: block; height: 8px; background: var(--sunk); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
  .mbar i { display: block; height: 100%; width: var(--w); background: var(--amber); }
  .preview { max-height: 360px; overflow: auto; overscroll-behavior: contain; padding: 14px 16px; background: var(--sunk); color: var(--phos); border: 1px solid var(--line); border-radius: 6px; font: 500 11.5px/1.55 var(--f-mono); white-space: pre; user-select: text; -webkit-user-select: text; }
  .arch { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
  .arch li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
  .arch li > span { flex: 1; min-width: 200px; }
  .arch .btn { min-height: 42px; padding: 0 14px; }
  /* ---------- install prompt ---------- */
  .install {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 79;
  display: flex; align-items: center; gap: 14px; width: min(560px, calc(100vw - 32px));
  padding: 12px 12px 12px 14px; background: var(--panel-3); color: var(--bone);
  border: 1px solid var(--line-2); border-left: 3px solid var(--amber); border-radius: 10px; box-shadow: var(--shadow);
  transform: translateX(-50%); animation: install-in .36s cubic-bezier(.2, 0, 0, 1);
}
  .install[hidden] { display: none; }
  .install-mark { flex: none; width: 46px; height: 46px; }
  .install-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font: 500 12.5px/1.35 var(--f-mono); color: var(--mute); }
  .install-txt > b { font: 400 20px/1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; color: var(--bone); }
  .install-steps { margin: 2px 0 0; padding-left: 18px; display: grid; gap: 2px; color: var(--bone); }
  .install-steps b { color: var(--amber); font-weight: 700; }
  .ios-share { display: inline-grid; place-items: center; width: 22px; height: 22px; vertical-align: -6px; border: 1px solid var(--line-2); border-radius: 5px; color: var(--amber); }
  .ios-share svg { width: 15px; height: 15px; }
  .install-act { flex: none; display: flex; flex-direction: column; gap: 6px; }
  .install-act .btn { min-height: 40px; padding: 0 14px; }
  @media (max-width: 520px) {
    .install { flex-wrap: wrap; }
    .install-act { flex-direction: row; width: 100%; }
    .install-act .btn { flex: 1; justify-content: center; }
  }
  /* ---------- toast ---------- */
  .sheet:not([hidden]) ~ .toast { pointer-events: none; }
  .toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 80;
  display: flex; align-items: center; gap: 16px; max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 18px; background: var(--panel-3); color: var(--bone);
  border: 1px solid var(--line-2); border-left: 3px solid var(--phos); border-radius: 8px; box-shadow: var(--shadow);
  font: 500 13.5px/1.3 var(--f-mono);
  transform: translate(-50%, calc(100% + 40px)); transition: transform .18s cubic-bezier(.2, 0, 0, 1);
}
  .toast.show { transform: translate(-50%, 0); }
  .toast button { flex: none; height: 42px; padding: 0 14px; background: var(--phos); color: var(--on-phos); border-radius: 5px; font: 700 11px var(--f-mono); letter-spacing: .18em; text-transform: uppercase; }
  /* ---------- motion ---------- */
  .enter :is(.tile, .token, .spot, .card, .cl-patch) { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 22ms); }
  .enter :is(.token, .spot) { animation-name: drop; }
  .shake { animation: shake .4s; }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
  }
  /* ---------- Cliply lockup (ported from sinte / cliply components/broadcast) ---------- */
  .cliply { position: relative; display: inline-block; line-height: 0; color: var(--bone); }
  .cliply .lockup { display: block; width: auto; height: 100%; }
  .cliply.sm { height: 12px; }
  .cliply.lg { height: 30px; }
  .cliply .gl { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; --cliply-pink: currentColor; }
  .cliply .ga { color: #ff4d6d; }
  .cliply .gb { color: #00d0ff; }
  .cliply .ondas { position: absolute; left: -3.18%; top: -16.7%; width: 25.4%; height: 133.3%; overflow: visible; }
  .onda { opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; }
  /* The glitch is a hover flourish: a tap on a tablet would latch :hover and loop it. */
  @media (hover: hover) {
    :is(.byline, .sign-cliply):hover .ga { opacity: 1; animation: cliply-glitch .4s steps(2) infinite; }
    :is(.byline, .sign-cliply):hover .gb { opacity: 1; animation: cliply-glitch .4s steps(2) infinite reverse; }
    :is(.byline, .sign-cliply):hover .onda { animation: cliply-signal .5s ease-out infinite; }
    :is(.byline, .sign-cliply):hover .o2 { animation-delay: .13s; }
    :is(.byline, .sign-cliply):hover .o3 { animation-delay: .26s; }
  }
  .sign { align-items: flex-start; }
  .sign-cliply { display: inline-flex; flex-direction: column; gap: 12px; padding: 8px 0 4px; text-decoration: none; }
  a.btn { text-decoration: none; }
  .status { font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 10px; }
  .status--live { color: var(--tally); }
  .status--live::before { content: '● '; }
  .status--final { color: var(--phos); }
  .preview-card summary { cursor: pointer; font: 400 22px/1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; list-style: none; }
  .preview-card summary::after { content: ' +'; color: var(--mute); }
  .preview-card[open] summary::after { content: ' −'; }
  .logv .filters .link { margin-left: auto; }
  .inp--num, .inp--led { font: 400 28px/1 var(--f-led) !important; color: var(--phos); text-align: center; }
  .note { margin-top: 14px; }
  .sign { margin-top: 26px; padding-top: 20px; border-top: 1px dashed var(--line-2); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
  /* ---------- teams & crests ---------- */
  .crest { width: 34px; height: 34px; flex: none; object-fit: contain; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .6)); }
  .crest--blank { display: grid; place-items: center; border-radius: 50%; background: var(--sunk); border: 1px solid var(--line-2); font: 400 22px/1 var(--f-slate); color: var(--mute); }
  .team-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
  .team-chip { flex: none; display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 14px 8px 10px; background: var(--sunk); border: 1px solid var(--line-2); border-radius: 8px; text-align: left; }
  .team-chip b { display: block; font: 400 17px/1.1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; }
  .team-chip small { font-size: 10.5px; color: var(--mute); letter-spacing: .04em; }
  .team-chip[aria-pressed="true"] { border-color: var(--phos); background: var(--panel-3); }
  .team-chip[aria-pressed="true"] b { color: var(--phos); }
  .sb-crest { width: 34px; height: 34px; object-fit: contain; flex: none; }
  /* ---------- sheet (modal) ---------- */
  .sheet { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
  .sheet[hidden] { display: none; }
  .sheet__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); }
  .sheet.is-opening .sheet__scrim { animation: fade .2s both; }
  .sheet.is-opening .sheet__card { animation: rise .28s cubic-bezier(.2, .8, .2, 1) both; }
  .sheet__card {
  position: relative; width: min(760px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 20px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow), var(--inner);
}
  .sheet__h { display: flex; align-items: center; justify-content: space-between; }
  .sheet__h h2 { font: 400 28px/1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; }
  .sheet__form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
  .sheet__actions { justify-content: flex-end; margin-top: 4px; }
  .sheet .sub { display: flex; align-items: center; gap: 10px; }
  .fixtures { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
  .fixture { display: grid; grid-template-columns: 70px 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 58px; padding: 6px 12px; background: var(--sunk); border: 1px solid var(--line-2); border-radius: 8px; text-align: left; }
  .fixture[aria-pressed="true"] { border-color: var(--amber); background: var(--sel-bg); box-shadow: var(--glow-a); }
  .fixture__when { display: flex; flex-direction: column; }
  .fixture__when b { font: 400 24px/.9 var(--f-led); color: var(--amber); }
  .fixture__when small { font-size: 10px; color: var(--mute); letter-spacing: .08em; text-transform: uppercase; }
  .fixture__who b { display: block; font: 400 17px/1.1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; }
  .fixture__who small { font-size: 11px; color: var(--mute); }
  .fixture__tag { font: 600 9.5px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
  .fixtures .empty { padding: 6px 0; }
  @media (max-width: 600px) {
    .sheet__form { grid-template-columns: minmax(0, 1fr); }
  }
  .sheet__card--wide { width: min(980px, 100%); height: min(760px, calc(100dvh - 32px)); }
  .club-grid { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-content: start; }
  .club { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 104px; padding: 10px; background: var(--sunk); border: 1px solid var(--line-2); border-radius: 8px; font: 600 11.5px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .04em; text-align: center; }
  .club .crest { width: 44px; height: 44px; }
  .club:active { border-color: var(--amber); }
  .club-head { display: flex; align-items: center; gap: 14px; }
  .club-head b { font: 400 26px/1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; }
  .crest--lg { width: 52px; height: 52px; }
  .sheet a { color: var(--phos); }
  body.dragging { cursor: grabbing; }
  body.dragging .rot :is(.token, .spot, .tile) { transition: box-shadow .12s, border-color .12s, transform .12s; }
  body.drag-from-bench .rot :is(.token, .spot):not(.drag-src) { border-color: color-mix(in srgb, var(--amber) 60%, transparent); }
  body.drag-from-field .rot :is(.tile--bench, .token, .spot):not(.drag-src) { border-color: color-mix(in srgb, var(--amber) 60%, transparent); }
  .check { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--sunk); border: 1px solid var(--line-2); border-radius: 8px; text-align: left; }
  .check i { width: 26px; height: 26px; flex: none; border: 1px solid var(--line-2); border-radius: 5px; display: grid; place-items: center; }
  .check[aria-pressed="true"] { border-color: var(--phos-soft); }
  .check[aria-pressed="true"] i { background: var(--phos); border-color: var(--phos); }
  .check[aria-pressed="true"] i::after { content: '✓'; color: var(--on-phos); font: 700 16px/1 var(--f-mono); font-style: normal; }
  .check b { display: block; font: 400 18px/1.1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; }
  .check small { font-size: 11.5px; color: var(--mute); }
  /* ---------- brand block (scoreboard) ---------- */
  /* Same composition as brand/lockup-*.png: board as tall as the text block, THE over BENCH on one left edge. */
  .sb-brand { display: flex; align-items: center; gap: 16px; min-width: 0; padding-right: clamp(4px, 1.4vw, 18px); border-right: 1px solid var(--line); }
  .sb-brand .bm-slot { width: 94px; height: 88px; }
  .brand-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
  .brand-the { font: 600 10px/1 var(--f-mono); letter-spacing: .62em; color: var(--mute); margin: 0 0 5px 2px; }
  .brand-name { font: 400 50px/.8 var(--f-slate); letter-spacing: .035em; color: var(--bone); white-space: nowrap; }
  .byline { display: inline-flex; align-items: center; gap: 7px; margin: 10px 0 0 2px; color: var(--mute); text-decoration: none; font: 600 10px/1 var(--f-mono); letter-spacing: .28em; text-transform: uppercase; }
  .byline .cliply.sm { height: 12px; }
  .sb-period .sb-sig { margin-left: auto; display: inline-flex; align-items: center; gap: 12px; }
  .net { display: inline-flex; align-items: center; gap: 5px; font: 500 9.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
  .net::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .net.ok::before { background: var(--phos); box-shadow: var(--glow-p); }
  .net.off { color: var(--warn); }
  @media (max-width: 1280px) {
    .sb-brand .bm-slot { width: 78px; height: 73px; }
    .brand-name { font-size: 40px; }
  }
  .scoreboard > .sb-brand { min-width: max-content; }
  @media (min-width: 1021px) and (max-width: 1366px) {
    .sb-brand .brand-text { display: none; }
    .sb-brand { gap: 0; }
  }
  .has-group { --gc: var(--mute); }
  .token.has-group .token__role { color: var(--gc); }
  .tile.has-group .tile__pos { color: var(--gc); }
  .groups-edit { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
  .inp--roleadd { width: auto; height: 36px; padding: 0 8px; font-size: 12px; }
  .inp--short { text-transform: uppercase; font-family: var(--f-mono); letter-spacing: .12em; text-align: center; }
  .inp--group { color: var(--gc, var(--bone)); font-family: var(--f-mono); font-size: 13px; }
  /* ---------- bench group dividers ---------- */
  .gdiv { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 6px; font: 600 10px/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--gc); }
  .gdiv:first-child { margin-top: 0; }
  .gdiv i { width: 8px; height: 8px; border-radius: 2px; background: var(--gc); flex: none; }
  .gdiv span { flex: none; }
  .gdiv b { font: 400 16px/1 var(--f-led); letter-spacing: 0; color: var(--mute); font-weight: 400; order: 3; }
  .gdiv::after { content: ''; order: 2; flex: 1; height: 1px; background: linear-gradient(90deg, color-mix(in srgb, var(--gc) 55%, transparent), transparent); }
  .chips-empty { grid-column: 1 / -1; min-height: 64px; }
  /* group colours are user-picked and bright; as text they are pulled toward the ink so they read on paper too */
  .token.has-group .token__role, .tile.has-group .tile__pos, .gdiv, .inp--group { color: color-mix(in srgb, var(--gc) 62%, var(--bone)); }
  .sb-team small { display: block; font: 600 9px/1.2 var(--f-mono); letter-spacing: .2em; color: var(--mute); }
  /* ---------- custom dialogs ---------- */
  .dialog { position: fixed; inset: 0; z-index: 88; display: grid; place-items: center; padding: 16px; }
  .dialog[hidden] { display: none; }
  .dlg__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px); animation: fade .15s both; }
  .dlg {
  position: relative; width: min(520px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 22px 22px 18px;
  background: var(--panel); border: 1px solid var(--line-2); border-top: 3px solid var(--phos); border-radius: 12px;
  box-shadow: var(--shadow), 0 30px 80px -30px rgba(0, 0, 0, .7); animation: rise .22s cubic-bezier(.2, .8, .2, 1) both;
}
  .dlg--danger { border-top-color: var(--tally); }
  .dlg h2 { margin: 0; font: 400 26px/1.05 var(--f-slate); letter-spacing: .03em; text-transform: uppercase; text-wrap: balance; }
  .dlg p { margin: 0; color: var(--mute); font-size: 13.5px; line-height: 1.5; }
  .dlg .field span b { color: var(--tally); letter-spacing: .2em; }
  .dlg #dlg-in { font: 400 28px/1 var(--f-led); letter-spacing: .18em; text-transform: uppercase; }
  .dlg__lead { margin: -4px 0 0; font: 400 22px/1.1 var(--f-slate); letter-spacing: .03em; text-transform: uppercase; color: var(--bone); }
  .dlg__lead em { font-style: normal; font-family: var(--f-led); font-size: 26px; color: var(--amber); letter-spacing: .06em; }
  .dlg__facts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; color: var(--mute); font-size: 12.5px; letter-spacing: .04em; }
  .dlg__facts li { position: relative; }
  .dlg__facts li + li::before { content: '·'; position: absolute; left: -9px; color: var(--mute); opacity: .7; }
  /* Destructive first, primary last; a label never overflows its button, it wraps the row instead. A phone stacks them with the primary on top. */
  .dlg__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
  .dlg__actions .btn { flex: 1 1 0; min-width: max-content; justify-content: center; padding: 0 14px; white-space: nowrap; }
  @media (max-width: 520px) {
    .dlg { padding: 18px 16px 14px; }
    .dlg__actions { flex-direction: column; }
    .dlg__actions .btn { min-width: 0; }
    .dlg__actions .btn--signal, .dlg__actions .btn--danger-solid { order: -1; }
    .dlg__actions .btn--danger { order: 1; }
  }
  .btn--danger-solid { background: var(--tally); border-color: var(--tally); color: #fff; }
  .btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
  /* ---------- device sync ---------- */
  .sync-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .sync-choice { display: flex; flex-direction: column; gap: 8px; padding: 16px; text-align: left; background: var(--sunk); border: 1px solid var(--line-2); border-radius: 10px; }
  @media (hover: hover) { button.sync-choice:hover { border-color: var(--phos); } }
  .sync-choice b { font: 400 22px/1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; }
  .sync-choice > span { font-size: 12.5px; color: var(--mute); }
  .sync-link { display: flex; gap: 8px; margin-top: 4px; }
  .sync-link .inp { flex: 1; min-width: 0; font-size: 13px; }
  .inp--code { font: 400 30px/1 var(--f-led) !important; letter-spacing: .25em; text-transform: lowercase; color: var(--amber); }
  .sync-host { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; }
  .sync-code { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .sync-code .sub { display: block; }
  .sync-code > b { font: 400 64px/.85 var(--f-led); letter-spacing: .22em; color: var(--bone); font-weight: 400; }
  .sync-qr { padding: 10px; background: #F2F0E6; border-radius: 10px; line-height: 0; }
  .sync-qr img, .sync-qr canvas { width: 196px; height: 196px; }
  .sync-wait { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; font-size: 13px; color: var(--mute); }
  .sync-dot { width: 12px; height: 12px; flex: none; border-radius: 50%; background: var(--phos); box-shadow: var(--glow-p); animation: rec 1.6s steps(1) infinite; }
  .sync-dot.is-wait { background: var(--amber); box-shadow: var(--glow-a); }
  .sync-live { display: flex; gap: 14px; align-items: flex-start; padding: 14px; background: var(--sunk); border: 1px solid var(--phos-soft); border-radius: 10px; }
  .sync-live b { font: 400 22px/1.1 var(--f-slate); letter-spacing: .03em; text-transform: uppercase; }
  .sync-live .sub { margin-top: 6px; }
  .sync-req { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--sel-bg); border: 1px solid var(--amber); border-radius: 10px; box-shadow: var(--glow-a); }
  .sync-req b { font: 400 24px/1.1 var(--f-slate); letter-spacing: .03em; text-transform: uppercase; }
  .sync-err { margin: 0; padding: 10px 12px; border: 1px solid var(--tally); border-radius: 8px; color: var(--tally); font-size: 13px; }
  @media (max-width: 640px) {
    .sync-choices, .sync-host { grid-template-columns: minmax(0, 1fr); }
    .sync-code > b { font-size: 48px; }
  }
  /* ---------- end of match ---------- */
  .end-col { display: flex; flex-direction: column; gap: 4px; }
  .end-col .btn-ghost { height: 36px; padding: 0 14px; font-size: 11px; }
  .btn-end { color: var(--tally); border-color: color-mix(in srgb, var(--tally) 45%, var(--line-2)); }
  .btn-end:disabled { color: var(--mute); border-color: var(--line-2); }
  /* ---------- match phase: pre / live / final ---------- */
  .status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 4px; border: 1px solid currentColor; font: 700 9.5px/1 var(--f-mono); font-style: normal; letter-spacing: .18em; text-transform: uppercase; }
  .status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .status-pill.is-pre { color: var(--mute); }
  .status-pill.is-run { color: var(--tally); text-shadow: var(--glow-t); }
  .status-pill.is-run::before { box-shadow: var(--glow-t); animation: rec 1.2s steps(1) infinite; }
  .status-pill.is-pause { color: var(--amber); }
  .status-pill.is-final { color: var(--phos); }
  .sb-period { gap: 8px; }
  .live-strip { flex: 1 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-left: 1px solid var(--line); color: var(--bone); }
  .live-strip b { display: block; font: 700 11px/1.2 var(--f-mono); letter-spacing: .18em; text-transform: uppercase; }
  .live-strip small { font: 500 10px/1.2 var(--f-mono); letter-spacing: .04em; color: var(--mute); }
  .live-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--tally); box-shadow: var(--glow-t); }
  @media (max-width: 900px) {
    .live-strip small { display: none; }
  }
  .late { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px; border: 1px dashed var(--line-2); border-radius: 8px; }
  .late { grid-template-columns: 80px minmax(0, 1fr) auto; align-items: center; }
  .late .kicker { grid-column: 1 / -1; }
  .late .inp { height: 46px; }
  /* ============ portrait: tablet and phone ============ */
  .tab-ico { display: none; width: 22px; height: 22px; flex: none; }
  .scoreboard > .sb-brand { grid-area: brand; }
  .scoreboard > .sb-score { grid-area: score; }
  .scoreboard > .sb-clock { grid-area: clock; }
  .scoreboard > .sb-ctrl { grid-area: ctrl; }
  .scoreboard { grid-template-areas: "brand score clock ctrl"; }
  @media (max-width: 1020px) {
    .scoreboard { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand score score" "clock clock ctrl"; row-gap: 12px; }
    .sb-brand { border-right: 0; padding-right: 0; }
    .sb-brand .bm-slot { width: 64px; height: 60px; }
    .brand-name { font-size: 36px; }
    .sb-clock { min-width: 0; }
  }
  @media (max-width: 600px) {
    body { grid-template-rows: auto minmax(0, 1fr) auto; }
    .scoreboard { order: 1; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand score clock" "ctrl ctrl ctrl"; gap: 8px 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 14px; }
    .sb-brand .brand-text { display: none; }
    .sb-brand .bm-slot { width: 40px; height: 38px; }
    .sb-score { gap: 6px; justify-content: center; }
    .sb-team { font-size: 9.5px; letter-spacing: .06em; min-width: 0; max-width: 9ch; }
    .sb-crest { width: 22px; height: 22px; }
    .sb-num { font-size: 38px; padding: 2px 6px 0; }
    .sb-sep { font-size: 22px; }
    .sb-clock { padding: 4px 8px 6px; grid-template-columns: auto; }
    .sb-clock::before, .sb-clock::after { display: none; }
    .sb-period { gap: 4px; font-size: 8.5px; letter-spacing: .1em; }
    .sb-period .sb-sig { display: none; }
    .status-pill { padding: 2px 5px; font-size: 8px; letter-spacing: .1em; }
    .sb-time { font-size: 38px; }
    .sb-remain, .sb-progress { display: none; }
    .sb-ctrl { gap: 6px; }
    .btn-play { flex: 1; height: 50px; justify-content: center; font-size: 15px; }
    .adj { flex-direction: row; }
    .adj .btn-ghost, .end-col .btn-ghost { height: 50px; }
    .end-col { flex-direction: row; }
    .btn-ghost { height: 50px; padding: 0 10px; font-size: 10.5px; }
    /* bottom navigation within thumb reach */
    .tabs { order: 3; position: relative; z-index: 12; padding: 0 0 env(safe-area-inset-bottom); border-top: 1px solid var(--line-2); border-bottom: 0; overflow: visible; }
    .tabs button { flex: 1 1 0; min-width: 0; min-height: 60px; padding: 6px 2px; flex-direction: column; gap: 4px; font-size: 9px; letter-spacing: .08em; border-right: 0; position: relative; }
    .tabs button[aria-current="page"]::after { top: 0; bottom: auto; left: 22%; right: 22%; }
    .tab-ico { display: block; }
    .tabs .count { position: absolute; top: 5px; left: calc(50% + 8px); font-size: 13px; padding: 0 4px; }
    .live-strip { flex: 0 0 auto; padding: 0 12px; }
    .live-strip > span:last-child { display: none; }
    .tabs .acct-strip { display: none; }
    #view { order: 2; padding: 12px 12px 24px; }
    .toast, .install { bottom: calc(76px + env(safe-area-inset-bottom)); }
    /* rotations & stats scroll naturally on a phone instead of fitting one screen */
    #view.fit { overflow-y: auto; display: block; padding-bottom: 24px; }
    .hint > span:not(.hint__dot) { white-space: normal; }
    .hint { flex-wrap: wrap; }
    .zone-h h2 { font-size: 22px; }
    .sheet { padding: 0; align-items: end; }
    .sheet__card, .sheet__card--wide { width: 100%; max-height: 92dvh; height: auto; border-radius: 16px 16px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  }
  /* a hidden toast parks below the fold; it must never swallow taps meant for the bottom bar */
  /* The most frequent motion in the app (one per action): quick, no overshoot. */
  .toast { pointer-events: none; opacity: 0; transition: transform .18s cubic-bezier(.2, 0, 0, 1), opacity .15s ease-out; }
  .toast.show { pointer-events: auto; opacity: 1; }
  /* ---------- focus mode ---------- */
  .focusbar[hidden] { display: none; }
  .focusbar {
  position: relative; z-index: 10; display: flex; align-items: center; gap: 14px;
  min-height: 56px; padding: calc(6px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 6px calc(12px + env(safe-area-inset-left));
  background: linear-gradient(var(--panel-3), var(--panel)); border-bottom: 1px solid var(--line-2);
  touch-action: pan-x;
}
  body.is-live .focusbar { border-bottom: 2px solid color-mix(in srgb, var(--tally) 55%, var(--line-2)); }
  body.is-focus { grid-template-rows: auto minmax(0, 1fr); }
  body.is-focus .scoreboard, body.is-focus .tabs, body.is-focus .subs-feed { display: none; }
  body.is-focus .rot:not(.has-sel) .hint { display: none; }
  body.is-focus #view.fit { padding-top: 10px; }
  .fb-clock { display: flex; align-items: center; gap: 8px; }
  .fb-clock b { font: 400 34px/.8 var(--f-led); color: var(--phos-dim); font-weight: 400; min-width: 3.2ch; }
  body.running .fb-clock b { color: var(--phos); text-shadow: var(--glow-p); }
  .fb-period { font: 700 10px/1 var(--f-mono); letter-spacing: .14em; color: var(--mute); }
  .fb-score { display: flex; align-items: center; gap: 8px; min-width: 0; font: 600 10px/1.1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
  .fb-score span { max-width: 12ch; overflow-wrap: break-word; }
  .fb-score b { font: 400 30px/.8 var(--f-led); color: var(--amber); text-shadow: var(--glow-a); font-weight: 400; }
  .fb-score b i { font-style: normal; color: var(--mute); margin: 0 3px; }
  .fb-score b .is-away { font-style: normal; color: var(--cyan); text-shadow: none; }
  .fb-tabs { display: flex; gap: 4px; margin-left: auto; padding: 3px; background: var(--sunk); border: 1px solid var(--line-2); border-radius: 8px; }
  .fb-tabs button { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 6px; font: 600 10.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); transition-property: background-color, color; transition-duration: .15s; }
  .fb-tabs .tab-ico { display: block; width: 18px; height: 18px; }
  .fb-tabs button[aria-current="page"] { background: var(--phos); color: var(--on-phos); }
  .fb-ctrl { display: flex; align-items: center; gap: 6px; }
  .fb-div { width: 1px; height: 28px; margin: 0 4px; background: var(--line-2); }
  .fb-endp { white-space: nowrap; }
  .fb-play, .fb-exit { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); font: 600 10.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--bone); }
  .fb-play { background: var(--phos); border-color: var(--phos); color: var(--on-phos); }
  .fb-play.is-running { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
  .fb-play svg, .fb-exit svg { width: 18px; height: 18px; }
  :is(.fb-play, .fb-exit, .fb-tabs button):not(:disabled):active { transform: scale(.96); }
  .btn-focus { width: 50px; padding: 0; display: grid; place-items: center; }
  .btn-ghost.btn-fs { width: 44px; height: 44px; padding: 0; align-self: center; display: grid; place-items: center; color: var(--mute); }
  .btn-fs svg { width: 20px; height: 20px; }
  .btn-fs.is-on { color: var(--phos); }
  .fb-exit.btn-fs { padding: 0; }
  .btn-focus svg { width: 20px; height: 20px; }
  @media (max-width: 900px) {
    .fb-tabs button span { display: none; }
    .fb-score span { display: none; }
  }
  @media (max-width: 600px) {
    body.is-focus { grid-template-rows: auto minmax(0, 1fr); }
    .focusbar { order: 1; gap: 8px; flex-wrap: wrap; row-gap: 6px; }
    .fb-clock .status-pill { display: none; }
    .fb-clock b { font-size: 28px; }
    .fb-ctrl { order: 3; width: 100%; }
    .fb-ctrl .fb-endp { flex: 1; }
    .fb-div { margin-left: auto; }
    .fb-exit span { display: none; }
  }
  /* ---------- rotations fit one screen ---------- */
  .form-chip { min-height: 32px; padding: 0 8px; font-size: 18px; }
  .hint { min-height: 40px; }
  .tgt--away.is-sel { background: color-mix(in srgb, var(--cyan) 10%, var(--panel)); border-color: var(--cyan); box-shadow: none; color: var(--cyan); }
  .tgt--away.is-locked { background: color-mix(in srgb, var(--cyan) 10%, var(--panel)); border-color: var(--cyan); box-shadow: var(--glow-cy); color: var(--cyan); }
  /* ---------- player card (long press) ---------- */
  .pcard { border-top: 3px solid var(--gc, var(--phos)); }
  /* ---------- help ---------- */
  .fb-help { min-width: 44px; padding: 0; font: 400 22px/1 var(--f-led); }
  .help { gap: 10px; }
  .help-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; flex: none; }
  .help-nav button { flex: none; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--sunk); font: 600 10.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
  @media (hover: hover) { .help-nav button:hover { color: var(--phos); border-color: var(--phos-dim); } }
  .help-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
  .help-sec { padding: 14px 0 6px; border-top: 1px solid var(--line); scroll-margin-top: 4px; }
  .help-sec:first-child { border-top: 0; padding-top: 4px; }
  .help-sec h3 { margin: 0 0 10px; font: 400 22px/1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; color: var(--phos); }
  .help-sec dl { margin: 0; display: grid; gap: 10px; }
  .help-sec dl > div { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); gap: 14px; }
  .help-sec dt { font: 700 11px/1.35 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--bone); }
  .help-sec dd { margin: 0; font-size: 13px; line-height: 1.5; color: var(--mute); max-width: 68ch; }
  .help-foot { margin-top: 14px; }
  @media (max-width: 600px) {
    .help-sec dl > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  }
  /* ---------- button icons ---------- */
  .bi { width: 16px; height: 16px; flex: none; }
  .btn.has-bi, .btn-ghost.has-bi, .btn-play.has-bi { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
  .end-col .btn-ghost .bi { width: 13px; height: 13px; }
  .btn-play .bi { width: 20px; height: 20px; }
  .nav-ico { width: 18px; height: 18px; opacity: .9; }
  @media (min-width: 601px) {
    .tabs .tab-ico { display: inline-block; width: 17px; height: 17px; margin-right: 8px; vertical-align: -3px; }
  }
  #view:has(> .matches) { padding-bottom: env(safe-area-inset-bottom); }
  @media (max-width: 600px) {
    .end-col .bi { display: none; }
  }
  /* ---------- scoreboard: roomier control groups ---------- */
  .scoreboard { gap: clamp(16px, 2.6vw, 40px); }
  .sb-ctrl { gap: 12px; }
  .sb-tools { display: flex; flex-direction: column; gap: 6px; padding-left: 14px; border-left: 1px solid var(--line); }
  .btn-ghost.sb-tool { width: 44px; height: 38px; padding: 0; display: grid; place-items: center; border-radius: 8px; color: var(--mute); }
  .btn-ghost.sb-tool svg { width: 18px; height: 18px; }
  @media (hover: hover) { .btn-ghost.sb-tool:hover { color: var(--bone); } }
  .sb-extra { height: 50px; padding: 0 16px; }
  .tabs .tab-help { flex: none; display: flex; align-items: center; justify-content: center; padding: 0 22px; border-left: 1px solid var(--line-2); font: 600 11px var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
  @media (hover: hover) { .tabs .tab-help:hover { color: var(--bone); } }
  @media (max-width: 1020px) {
    .tabs .tab-help .tab-label { display: none; }
    .tabs .tab-help { padding: 0 18px; }
  }
  @media (max-width: 600px) {
    .sb-tools { flex-direction: row; padding-left: 8px; }
    .btn-ghost.sb-tool { width: 40px; height: 40px; }
  }
  .fb-finish { color: var(--tally); border-color: color-mix(in srgb, var(--tally) 45%, var(--line-2)); }
  .fb-finish .bi { width: 16px; height: 16px; }
  @media (max-width: 600px) {
    .fb-finish span { display: none; }
  }
  @media (max-width: 600px) {
    .sb-ctrl { flex-wrap: wrap; gap: 8px; }
    .sb-ctrl .btn-play { order: 1; flex: 1 1 0; }
    .sb-ctrl .sb-tools { order: 2; border-left: 0; padding-left: 0; }
    .sb-ctrl .adj { order: 3; flex: 1 1 36%; flex-direction: row; }
    .sb-ctrl .adj .btn-ghost { flex: 1; height: 44px; }
    .sb-ctrl .end-col { order: 4; flex: 1 1 56%; flex-direction: row; }
    .sb-ctrl .end-col .btn-ghost { flex: 1; height: 44px; }
    .sb-ctrl .sb-extra { order: 3; flex: 1 1 100%; height: 44px; }
  }
  /* ---------- easter egg ---------- */
  .egg { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 70%, rgba(0, 0, 0, .25), rgba(0, 0, 0, .78)); animation: egg-in .3s ease-out both; cursor: pointer; }
  .egg.out { animation: egg-out .4s ease-in forwards; }
  .egg__confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .egg__board { display: flex; flex-direction: column; align-items: center; gap: 18px; transform-origin: 50% 100%; animation: egg-rise .8s cubic-bezier(.2, .9, .3, 1.25) both, egg-sway 1.6s ease-in-out .8s infinite; }
  .egg.out .egg__board { animation: egg-drop .4s ease-in forwards; }
  .egg .bm-slot { width: min(46vw, 300px); height: auto; cursor: pointer; }
  .egg .bm-svg { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--phos) 60%, transparent)); }
  .egg__cap { font: 400 clamp(22px, 4vw, 34px)/1 var(--f-led); letter-spacing: .08em; color: var(--amber); text-shadow: var(--glow-a); text-transform: uppercase; }
  .egg-wave { animation: egg-wave .9s cubic-bezier(.3, 0, .3, 1) var(--egg-d, 0ms) both; }
  @media (prefers-reduced-motion: reduce) {
    .egg__board { animation: none; }
    .egg.out .egg__board { animation: none; }
  }
  .count b { font-weight: 400; }
  .count small { font: 600 9.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
  @media (max-width: 1280px) {
    .count small { display: none; }
  }
  /* ---------- cliply account: the patched line ---------- */
  /* A tally lamp beside the clock. Off (hollow ring) = no account, pink = connected, blinking = uploading,
  amber = the session dropped. Pink is cliply's colour inside this room already (the board's outer LEDs). */
  /* Pink as TEXT reads through --pink-ink (darker on the light skin, 5.3:1); the dots keep --pink. */
  .lamp { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; font: 600 9.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); white-space: nowrap; cursor: pointer; transition: color .15s; }
  .lamp::before { content: ''; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
  .lamp.on { color: var(--pink-ink); }
  .lamp.on::before { background: var(--pink); border-color: var(--pink); box-shadow: var(--glow-c); }
  span.lamp { padding: 0; cursor: default; }
  .cl-hello .lamp { margin-right: 8px; vertical-align: 1px; }
  .btn--cliply { background: var(--pink-ink); border-color: var(--pink-ink); color: var(--on-pink); }
  /* The sign-up card is a link, but it sits beside a button card and must read as its twin. */
  a.sync-choice { color: inherit; text-decoration: none; }
  a.sync-choice b { color: var(--phos); }
  a.sync-choice b::after { content: ' ↗'; font: 600 12px var(--f-mono); letter-spacing: 0; }
  @media (hover: hover) { a.sync-choice:hover { border-color: var(--phos); } }
  .sync-choice--cliply { border-color: var(--pink-ink); }
  .sync-choice--cliply b { color: var(--pink-ink); }
  .cl-hero { display: flex; align-items: center; gap: 18px; padding: 14px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
  .cl-hero > div { display: flex; flex-direction: column; gap: 6px; }
  .cl-hero b { font: 400 28px/1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; }
  .cl-hero .cl-patch__lamp { width: 22px; height: 22px; }
  .cl-head { display: flex; align-items: center; gap: 12px; padding: 10px 0 12px; border-bottom: 1px solid var(--line); }
  .cl-head > div { display: flex; flex-direction: column; gap: 3px; }
  .cl-head b { font: 400 26px/1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; color: var(--pink-ink); }
  .cl-head small { font-size: 12px; color: var(--mute); }
  .cl-actions { margin-top: 14px; }
  .cl-tag--warn { color: var(--warn); }
  .cl-tag--warn i { background: var(--warn); border-color: var(--warn); }
  /* The account in the tab bar: whose, and in what state. */
  .tabs .acct-strip { flex: 0 0 auto; justify-content: flex-start; gap: 10px; padding: 0 16px; border-left: 1px solid var(--line-2); border-right: 0; text-transform: none; letter-spacing: 0; text-align: left; color: var(--mute); }
  .tabs .acct-strip:focus-visible .acct-txt b { color: var(--bone); }
  @media (hover: hover) { .tabs .acct-strip:hover .acct-txt b { color: var(--bone); } }
  .acct-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid currentColor; }
  .acct-strip.on .acct-dot { color: var(--pink); background: var(--pink); border-color: var(--pink); box-shadow: var(--glow-c); }
  .acct-strip.busy .acct-dot { animation: rec 1.2s steps(1) infinite; }
  .acct-strip.dim .acct-dot { background: color-mix(in srgb, var(--pink) 45%, transparent); border-color: transparent; }
  .acct-strip.warn .acct-dot { color: var(--warn); background: var(--warn); border-color: var(--warn); }
  .acct-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .acct-txt b { font: 700 11px/1.1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--bone); white-space: nowrap; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; }
  .acct-strip.on .acct-txt b { color: var(--pink-ink); }
  .acct-strip.off .acct-txt b { color: var(--mute); }
  .acct-strip.warn .acct-txt b { color: var(--warn); }
  .acct-txt small { font: 500 10px/1.1 var(--f-mono); letter-spacing: .04em; color: var(--mute); white-space: nowrap; }
  .acct-strip.off .acct-txt small { color: var(--pink-ink); }
  @media (max-width: 1020px) {
    .acct-txt small { display: none; }
  }
  /* First run: where do we start from? */
  .welcome { position: fixed; inset: 0; z-index: 76; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); }
  .welcome[hidden] { display: none; }
  .welcome__card { width: min(880px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 24px 26px 22px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow), var(--inner); animation: rise .36s cubic-bezier(.2, .8, .2, 1) both; }
  .welcome.is-leaving .welcome__card { opacity: 0; translate: 0 6px; transition: opacity .2s ease-out, translate .2s ease-out; }
  .welcome__head { display: flex; align-items: center; gap: 22px; }
  .welcome__mark { width: 132px; height: 112px; flex: none; }
  .welcome__brand { display: flex; flex-direction: column; }
  .welcome__brand small { font: 600 11px/1 var(--f-mono); letter-spacing: .34em; color: var(--mute); }
  .welcome__brand b { font: 400 64px/.9 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; }
  .welcome__brand .byline { margin: 8px 0 0 2px; }
  .welcome__doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .welcome__door { min-height: 150px; animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(120ms + var(--i, 0) * 100ms); }
  .welcome__door em { display: block; margin-top: 6px; font-style: normal; color: var(--amber); }
  .welcome__door:disabled { opacity: .55; cursor: not-allowed; }
  .welcome__door--cliply { border-color: var(--pink-ink); }
  .welcome__door--cliply b { color: var(--pink-ink); }
  @media (max-width: 760px) {
    .welcome__doors { grid-template-columns: minmax(0, 1fr); }
    .welcome__door { min-height: 0; }
    .welcome__brand b { font-size: 44px; }
    .welcome__mark { width: 92px; height: 80px; }
  }
  /* The offer: an unpatched line, breathing slowly. */
  .cl-patch { position: relative; display: flex; align-items: center; gap: 18px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line-2); border-left: 3px solid var(--pink); border-radius: var(--r); box-shadow: var(--inner); }
  .cl-patch__lamp { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--pink); box-shadow: inset 0 0 0 3px var(--sunk), var(--glow-c); animation: lamp-ask 3.2s ease-in-out 3; }
  .cl-patch__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
  .cl-patch__txt > b { font: 400 24px/1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; color: var(--bone); }
  .cl-patch__act { flex: none; display: flex; flex-direction: column; gap: 6px; }
  .cl-patch__act .btn { min-height: 44px; }
  .cl-patch--sm { padding: 12px 14px; gap: 14px; }
  .cl-patch--sm .cl-patch__txt { gap: 2px; font-size: 12.5px; color: var(--mute); }
  .cl-patch--sm .cl-patch__txt > b { font-size: 18px; }
  .cl-patch--sm .cl-patch__lamp { width: 14px; height: 14px; }
  @media (max-width: 700px) {
    .cl-patch { flex-wrap: wrap; }
    .cl-patch__act { flex-direction: row; width: 100%; }
    .cl-patch__act .btn { flex: 1; justify-content: center; }
  }
  .cl-status { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; color: var(--mute); }
  .cl-status.ok { color: var(--phos); }
  .cl-handoff { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
  .cl-handoff .cl-list { margin: 0; }
  /* Connect sheet: what the line carries, as a patch panel. */
  .cl-panel { display: flex; flex-direction: column; background: var(--sunk); border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
  .cl-panel__row { display: grid; grid-template-columns: 16px 104px minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
  .cl-panel__row:first-child { border-top: 0; }
  .cl-panel__row i { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: var(--glow-c); }
  .cl-panel__row b { font: 400 18px/1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; }
  .cl-panel__row span { font-size: 12.5px; color: var(--mute); }
  @media (max-width: 600px) {
    .cl-panel__row { grid-template-columns: 16px minmax(0, 1fr); }
    .cl-panel__row span { grid-column: 2; }
  }
  .cl-note { margin: 4px 0 8px; }
  .inp--pending { border-color: var(--amber) !important; box-shadow: inset 0 0 0 1px var(--amber); }
  .cl-line { margin: 0 0 10px; font-size: 13px; color: var(--mute); }
  .cl-line.ok { color: var(--phos); }
  /* The tag: one answer to "where is this?" for account, team and match alike. */
  .cl-tag { display: inline-flex; align-items: center; gap: 6px; font: 600 10px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); white-space: nowrap; vertical-align: middle; }
  .cl-tag i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
  .cl-tag--on { color: var(--pink-ink); }
  .cl-tag--on i { background: var(--pink); border-color: var(--pink); box-shadow: var(--glow-c); }
  .cl-tag--up { color: var(--pink-ink); }
  .cl-tag--up i { background: color-mix(in srgb, var(--pink) 45%, transparent); border-color: transparent; }
  .cl-tag--video { color: var(--phos); }
  .cl-tag--video i { width: auto; height: auto; border: 0; border-radius: 0; }
  .cl-tag--video i::before { content: '✓'; font: 700 11px/1 var(--f-mono); }
  .team-chip__tag { margin-left: 4px; align-self: flex-start; }
  .cl-teamline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--mute); }
  .cl-teamline > span { flex: 1; min-width: 220px; }
  .cl-teamline b { color: var(--bone); }
  .cl-teamline .btn { min-height: 44px; }
  .cl-receipt { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; padding: 10px 12px; background: var(--sunk); border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; }
  .cl-legend { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 10px; margin: 2px 0; font-size: 12px; color: var(--mute); }
  .cl-kicker { margin: 8px 0 2px; }
  .cl-row small .cl-tag { margin-right: 2px; }
  .cl-hello { margin: 0 0 8px; font-size: 14px; color: var(--bone); }
  .cl-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; max-height: min(52vh, 480px); overflow: auto; overscroll-behavior: contain; }
  .cl-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 260px); align-items: center; gap: 12px; padding: 10px 12px; background: var(--sunk); border: 1px solid var(--line-2); border-radius: 8px; }
  .cl-row > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .cl-row b { font: 400 16px/1.1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; }
  .cl-row small { font-size: 11px; color: var(--mute); }
  .cl-row .btn { justify-self: end; }
  @media (max-width: 640px) {
    .cl-row { grid-template-columns: minmax(0, 1fr); }
    .cl-row .btn, .cl-row .inp { justify-self: stretch; }
  }
  /* ---------- phone pass (2026-10-19): one hand, no drag, nothing off-screen ---------- */
  .sb-team__abbr { display: none; }
  @media (max-width: 600px) {
    /* scoreboard: codes instead of names, so the score never squeezes them into pieces */
    .sb-team__name, .sb-team small { display: none; }
    .sb-team__abbr { display: inline; font: 600 12px/1 var(--f-mono); letter-spacing: .14em; }
    .sb-team { max-width: none; min-width: 0; flex: none; }
    .sb-score { gap: 8px; }
    .sb-tools .btn-fs { display: none; }
    /* hand-off rows and the dialogs' kin stack */
    .cl-row { grid-template-columns: minmax(0, 1fr); }
    .cl-row .btn { justify-self: stretch; }
  }
  @media (max-height: 520px) and (orientation: landscape) {
    .scoreboard { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "score clock ctrl"; gap: 8px 14px; padding: calc(4px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 8px calc(12px + env(safe-area-inset-left)); }
    .sb-score { grid-area: score; }
    .sb-clock { grid-area: clock; }
    .sb-ctrl { grid-area: ctrl; }
    .sb-brand { display: none; }
    .smpte { display: none; }
    .sb-team__name { display: none; }
    .sb-team__abbr { display: inline; font: 600 12px/1 var(--f-mono); letter-spacing: .14em; }
    .sb-team { flex: none; min-width: 0; }
    .sb-num { font-size: 34px; padding: 2px 6px 0; }
    .sb-sep { font-size: 22px; }
    /* the clock gets what the score and the controls leave: period over time, never beside it */
    .sb-clock { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; min-width: 0; padding: 4px 12px 6px; }
    .sb-clock::before, .sb-clock::after { display: none; }
    .sb-period { max-width: 100%; font-size: 9px; letter-spacing: .14em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; gap: 8px; }
    .sb-period .sb-sig { display: none; }
    .status-pill { white-space: nowrap; }
    .sb-time { font-size: 38px; white-space: nowrap; }
    .sb-tools .btn-fs { display: none; }
    .sb-remain { display: none; }
    .sb-progress { display: none; }
    .btn-play { height: 46px; min-height: 46px; padding: 0 16px; font-size: 14px; }
    .end-col, .adj { flex-direction: row; }
    .end-col .btn-ghost, .adj .btn-ghost { height: 46px; }
    .adj .btn-ghost { padding: 0 8px; }
    .sb-tools { flex-direction: row; }
    .sb-tools .btn-ghost { width: 40px; height: 40px; }
    .tabs button { min-height: 44px; padding: 0 12px; font-size: 11px; }
    .tabs .tab-label:not(.tab-label--short) { display: inline; }
    .tabs .live-strip > span:last-child { display: none; }
    #view { padding-top: 8px; }
    /* 230px of board cannot "fit": the view scrolls, and the bench rides along the bottom as on a portrait phone */
    #view.fit { overflow-y: auto; display: block; padding-bottom: 12px; }
  }
  .sync-shake { display: flex; justify-content: center; align-items: center; gap: 8px; height: 48px; margin-bottom: 10px; }
  .sync-shake i { width: 24px; height: 34px; border: 2px solid var(--phos); border-radius: 6px; box-shadow: var(--glow-p); animation: shake-l .9s cubic-bezier(.2, 0, 0, 1) both; }
  .sync-shake i + i { animation-name: shake-r; }
  @media (prefers-reduced-motion: reduce) {
    .sync-shake i { animation: none; }
  }
  /* More than three choices (a list of tablets) read as a list, not as columns that squeeze the labels. */
  .dlg--list .dlg__actions { flex-direction: column; }
  .dlg--list .dlg__actions .btn { justify-content: flex-start; }
  .dlg--list .dlg__actions .btn--ghost:last-child { justify-content: center; }
  .tab-label--short { display: none; }
  @media (max-width: 600px) {
    .tabs .tab-label { display: none; }
    .tabs .tab-label--short { display: inline; }
  }
  /* cliply: which org this tablet works for, and the org without thebench */
  .cl-orgs { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
  .cl-org { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px 8px 10px; text-align: left; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; transition: border-color .15s, background .15s; }
  .cl-org:not(:disabled):focus-visible { border-color: var(--pink); }
  @media (hover: hover) { .cl-org:not(:disabled):hover { border-color: var(--pink); } }
  .cl-org:not(:disabled):active { transform: scale(.96); }
  .cl-org.is-cur { border-color: var(--pink); box-shadow: inset 3px 0 0 var(--pink); }
  .cl-org__mono { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: var(--sunk); border: 1px solid var(--line-2); font: 400 22px/1 var(--f-slate); text-transform: uppercase; color: var(--pink-ink); }
  .cl-org__t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .cl-org__t b { font: 600 14px/1.2 var(--f-mono); color: var(--bone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cl-org__t small { font: 500 11px var(--f-mono); color: var(--mute); }
  .cl-org__go { font: 400 24px/1 var(--f-mono); color: var(--pink-ink); }
  .cl-org__tag { padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 4px; font: 600 9.5px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
  .cl-org:disabled { cursor: default; background: none; border-style: dashed; }
  .cl-org:disabled .cl-org__mono, .cl-org:disabled .cl-org__t b { color: var(--mute); }
  .cl-blocked { display: flex; align-items: flex-start; gap: 16px; padding: 16px; margin-bottom: 12px; border: 1px solid color-mix(in srgb, var(--warn) 55%, var(--line-2)); border-radius: var(--r); background: color-mix(in srgb, var(--amber) 7%, var(--panel)); }
  .cl-blocked > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .cl-blocked b { font: 400 24px/1.05 var(--f-slate); letter-spacing: .03em; text-transform: uppercase; color: var(--bone); }
  .cl-blocked .kicker { color: var(--warn); }
  .cl-blocked .sub { margin: 0; }
  .cl-blocked__lamp { flex: none; width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; background: var(--warn); }
  /* iPad landscape (1180) clipped "Ayuda": the tabs breathe less before they scroll. */
  @media (min-width: 601px) and (max-width: 1280px) {
    .tabs button { padding: 0 12px; gap: 8px; letter-spacing: .14em; }
    .tabs .tab-help { padding: 0 14px; }
    .tabs .acct-strip { padding: 0 12px; }
  }
  /* Live with no account the strip was a bare ring between tabs: there is nothing to say then. */
  /* The host card needs a visible action like its neighbour. */
  .sync-choice__cta { margin-top: auto; padding-top: 10px; font: 600 11px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--phos); }
  @media (max-width: 600px) {
    .panel-bar > .btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .panel-bar > .btn-row > .btn { justify-content: center; min-width: 0; padding: 0 10px; font-size: 11px; letter-spacing: .06em; line-height: 1.2; text-align: center; }
  }
  /* ---------- open / closed match ---------- */
  /* No match open: the header names the bench and offers the way in. */
  .scoreboard > .sb-idle { grid-area: score; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .sb-idle b { font: 400 clamp(22px, 2.6vw, 30px)/.95 var(--f-slate); letter-spacing: .03em; text-transform: uppercase; color: var(--bone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sb-idle + .sb-ctrl .btn-play .bi { width: 22px; height: 22px; }
  /* The score block sizes the team names by the room it has: whole names that never break in two
  when they fit, the abbreviations (as on a phone) when the clock and the controls squeeze it. */
  /* Not on a landscape phone: there the grid column is auto and a size container collapses it to 0. */
  @media (min-width: 601px) and (min-height: 521px) {
    .scoreboard > .sb-score { container-type: inline-size; }
    @container (min-width: 380px) {
      .sb-team { min-width: var(--nw, 8ch); }
    }
    @container (max-width: 279px) {
      .sb-team__name, .sb-team small { display: none; }
      .sb-team__abbr { display: inline; }
      .sb-team { flex: none; min-width: 0; font-size: 15px; letter-spacing: .1em; }
    }
  }
}
@layer app {
  /* Match mode: the way back to the club, first in the bar. */
  .tabs .tab-exit { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 20px; border-right: 1px solid var(--line-2); font: 600 11px var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--bone); }
  @media (hover: hover) { .tabs .tab-exit:hover { color: var(--phos); } }
  @media (max-width: 600px) {
    .tabs .tab-exit { flex: 1 1 0; min-width: 0; min-height: 60px; padding: 6px 2px; flex-direction: column; gap: 4px; font-size: 9px; letter-spacing: .08em; border-right: 0; }
  }
}
@layer app {
  /* Club mode: no scoreboard to show, so the header is a slim bar — brand, team, the way into a match. */
  body.is-club .scoreboard { gap: 16px; padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 10px; }
  body.is-club .sb-brand { gap: 10px; }
  body.is-club .sb-brand .bm-slot { width: 46px; height: 43px; }
  body.is-club .brand-the { font-size: 8px; margin-bottom: 3px; }
  body.is-club .brand-name { font-size: 26px; }
  body.is-club .byline { display: none; }
  body.is-club .sb-idle b { font-size: 18px; }
  body.is-club .btn-play { height: 44px; padding: 0 18px 0 14px; font-size: 12px; box-shadow: none; }
  body.is-club .btn-play svg, body.is-club .sb-idle + .sb-ctrl .btn-play .bi { width: 18px; height: 18px; }
  body.is-club .sb-tool { width: 44px; height: 44px; }
  @media (max-width: 600px) {
    body.is-club .scoreboard { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand score ctrl"; padding-bottom: 8px; }
    body.is-club .sb-brand .bm-slot { width: 36px; height: 34px; }
    body.is-club .btn-play { flex: none; height: 40px; padding: 0 12px; font-size: 11px; letter-spacing: .1em; }
    body.is-club .sb-tools { display: none; }
  }
}
@layer app {
  /* The account is the club's: inside a match its strip stays out of the bar. */
  body:not(.is-club) .tabs .acct-strip { display: none; }
}
@layer app {
  /* Secondary actions beside a labelled primary: same 44px, outlined, icon only. */
  .icon-btn--line { border-color: var(--line-2); }
  .icon-btn svg { width: 18px; height: 18px; }
  .icon-btn--danger:not(:disabled):active { color: var(--tally); border-color: var(--tally); }
  @media (hover: hover) { .icon-btn--danger:not(:disabled):hover { color: var(--tally); border-color: var(--tally); } }
}
@layer app {
  /* Presses ease the same everywhere and never on a disabled control. */
  :is(.chip-f, .fb-play, .fb-exit, .fb-tabs button, .cl-org, .quick__center, .quick__item, .swap-chip, .pw-m, .role-chip) { transition-property: transform, scale, background-color, color, border-color; transition-duration: 150ms; transition-timing-function: ease-out; }
  /* Touch targets: 44px. */
  .btn-ghost.sb-tool { height: 44px; }
  .fb-tabs button, .chip-f, .help-nav button { min-height: 44px; }
  .x { width: 44px; height: 44px; }
}
