/* Shared base for every screen: reset, page frame, labels, buttons, modal, toast. */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }   /* no gray flash on any tap; taps give their own feedback */
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 400 var(--fs-md)/1.4 var(--font); letter-spacing: var(--ls); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, select, input, textarea { font: inherit; color: inherit; }
/* Oct 27 (round 3): +0.03em on all text, in each element's own em (an inherited body value would be fixed px).
   :where() keeps it at zero specificity, so explicit letter-spacings (which add var(--ls)) win; their children inherit. */
:where(body *) { letter-spacing: var(--ls); }
:where(.lbl, .lbl2, .step, .eyb, .jhead .jl, .field > span, .sec h3) * { letter-spacing: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
button, summary, label, .cell { touch-action: manipulation; }   /* quick taps never double-tap-zoom (no 300ms wait either) */
button, summary { -webkit-user-select: none; user-select: none; }   /* a long press on a control doesn't select its text */
/* Nov 26 (Justin): a long press on the app's links and controls (the tab bar, buttons, faces, icons) doesn't open the
   browser's link menu (Open, Add to Reading List, Copy Link, Share) or select their text. Text fields keep both. */
a, button, summary, [role=button], img, svg { -webkit-touch-callout: none; }
a, [role=button] { -webkit-user-select: none; user-select: none; }
img { -webkit-user-drag: none; }
/* Oct 29: with the tap highlight off, a press needs its own feedback: a quick .97 squeeze. :where() keeps it at zero
   specificity, so a button's own transition (or its own :active, like .ob .btn's .98) still wins; those list transform themselves. */
:where(.btn, .ok, .btn3, .btn3s, .rvopen, .todo-row, .yesbtn, .jaway, .seg3 button, .pill button, .xpick .rk) { transition: transform var(--t-fast) var(--ease-out); }
:where(.btn, .ok, .btn3, .btn3s, .rvopen, .todo-row, .yesbtn, .jaway, .seg3 button, .pill button, .xpick .rk):active:not(:disabled) { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { :where(.btn, .ok, .btn3, .btn3s, .rvopen, .todo-row, .yesbtn, .jaway, .seg3 button, .pill button, .xpick .rk):active:not(:disabled) { transform: none; } }
/* Nov 25 motion pass: the rest of the app's pressables get the same squeeze (an audit found ~40 without one). Small
   controls .97; wide cards and rows .98, where .97 would read as a lurch. No hover motion anywhere: hover stays colour. */
:where(.back, .ce-back, .btn2, .sugg button, .chips button, .seg button, .lcard .sec .edit, .lcard .close, .facebtn, .linkbtn, .carrow, .ipt,
  .pk-x, .hint-act, .hint-ok, .pk-list button, .sh-back, .sh-btn, .sh-btn2, .tabbar a, .pp-cog, .pp-btn, .pp-btn2, .pp-earlier, .ppill button, .jswitch button,
  .jname, .jmenu button, .notice .x, .okn, .pbar2 .pback, .pa-pen, .pa-add, .pa-eb, .pa-leave, .pa-hist, .st-btn, .edm, .rpop .hb) { transition: transform var(--t-fast) var(--ease-out); }
:where(.back, .ce-back, .btn2, .sugg button, .chips button, .seg button, .lcard .sec .edit, .lcard .close, .facebtn, .linkbtn, .carrow, .ipt,
  .pk-x, .hint-act, .hint-ok, .pk-list button, .sh-back, .sh-btn, .sh-btn2, .tabbar a, .pp-cog, .pp-btn, .pp-btn2, .pp-earlier, .ppill button, .jswitch button,
  .jname, .jmenu button, .notice .x, .okn, .pbar2 .pback, .pa-pen, .pa-add, .pa-eb, .pa-leave, .pa-hist, .st-btn, .edm, .rpop .hb):active:not(:disabled) { transform: scale(.97); }
:where(.sc, .crow, .pm-space, .mename, .pp .jl[data-edit], .padd .jl, .aplist li[data-space]) { transition: transform var(--t-fast) var(--ease-out); }
:where(.sc, .crow, .pm-space, .mename, .pp .jl[data-edit], .padd .jl, .aplist li[data-space]):active:not(:disabled) { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) { :where(.back, .ce-back, .btn2, .sugg button, .chips button, .seg button, .lcard .sec .edit, .lcard .close, .facebtn, .linkbtn, .carrow, .ipt,
  .pk-x, .hint-act, .hint-ok, .pk-list button, .sh-back, .sh-btn, .sh-btn2, .tabbar a, .pp-cog, .pp-btn, .pp-btn2, .pp-earlier, .ppill button, .jswitch button,
  .jname, .jmenu button, .notice .x, .okn, .pbar2 .pback, .pa-pen, .pa-add, .pa-eb, .pa-leave, .pa-hist, .st-btn, .edm, .rpop .hb,
  .sc, .crow, .pm-space, .mename, .pp .jl[data-edit], .padd .jl, .aplist li[data-space], .st-btn, .switch):active { transform: none; } }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Text fields (Nov 25, Justin: no highlight glow around a focused text area): no ring outside the field and no colored
   glow. Focus is a quiet 1px edge in --ink3 drawn over the field's own edge (its border or inset line), plus the caret.
   One rule for every field, whatever draws its edge. */
:is(input:not([type=checkbox], [type=radio], [type=range], [type=color], [type=button], [type=submit]), textarea, select):focus-visible { outline: 1px solid var(--ink3); outline-offset: -1px; }

/* page frame: one phone-width column, safe-area aware */
.app { max-width: 480px; margin: 0 auto; min-height: 100dvh;
  padding: calc(16px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) calc(32px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
/* Any route that hasn't drawn yet (Nov 27, #37): a title bar and soft rows instead of a blank page, which read as broken
   on a slow connection (a board was blank from ~0.3s to ~2.8s throttled). CSS only; it goes the moment the page renders
   into #app. No shimmer: it's brief and frequent. Personal draws its own frame inside the shell (personal.js). It fades in
   only after 180ms of emptiness, so a warm page change (Challenges -> a board leaves #app empty for ~50ms) doesn't flash it. */
.app:empty::before { content: ''; display: block; height: 28px; width: 46%; margin: var(--sp-3) 0 var(--sp-4); border-radius: var(--r-sm); background: var(--soft); animation: app-ph var(--t) var(--ease) 180ms both; }
.app:empty::after { content: ''; display: block; height: 220px; border-radius: var(--r-card); background: repeating-linear-gradient(to bottom, var(--soft) 0 22px, transparent 22px 28px); opacity: .7; animation: app-ph var(--t) var(--ease) 180ms both; }
@keyframes app-ph { from { opacity: 0; } }
.lbl { font: 500 var(--fs-label)/1 var(--font); letter-spacing: calc(.08em + var(--ls)); text-transform: uppercase; color: var(--ink3); }
.muted { color: var(--ink2); }

/* One avatar look everywhere (Oct 27, round 4, G12): the board's .av and the onboarding/lobby .av2 share it.
   A disc tinted 22% with the person's color (--m), the drawing on top at its own scale. Drawings are one dark
   shade, so in dark mode they're lifted to read on the dark disc. "Plain" (no drawing) stays a solid disc. */
:root {   /* tuned on /gallery/tuner.html, "Lobby chips and avatars" (round 5) */
  /* @knobs Lobby chips and avatars */
  --av-tint: 22%;   /* @knob 0–60pct step 1 order 1 "Face disc tint" "How much color sits behind the drawing. Shared: the board’s avatars change too." */
  --av-ink: 1;   /* @knob 0.4–1.2x step 0.05 order 2 "Drawing darkness (light)" "Below 1 darkens the drawing’s lines in light mode, if faces look faint on the disc." */
  --av-lift: 1.8;   /* @knob 1–2.6x step 0.05 order 3 "Drawing lift (dark)" "How much the drawing’s dark lines are lightened in dark mode so they read on a dark disc." */
}
:is(.av, .av2:not(.plain)) { background: color-mix(in oklab, var(--m) var(--av-tint), var(--card)); }
/* Oct 28 (Justin): each face is its own layer. The drawing's filter would otherwise paint it above the next face's disc
   where faces overlap (the lobby's row of faces). */
:is(.av, .av2) { isolation: isolate; }
:is(.av, .av2) img { filter: brightness(var(--av-ink)); }   /* below 1 darkens the drawing's stroke */
:is(.av, .av2) img { -webkit-touch-callout: none; -webkit-user-drag: none; }   /* a long press on a face doesn't pop iOS's image menu */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.av, .av2) img { filter: brightness(var(--av-lift)); } }
:root[data-theme="dark"] :is(.av, .av2) img { filter: brightness(var(--av-lift)); }
/* A member's hue: one locked lightness + chroma for everyone, only the hue varies. With the avatar's shape below, moved
   here from ob.css (Nov 28) so a page that doesn't load ob.css (Challenges' Starting soon and Now cards) draws the
   same faces as the lobby. */
.hu { --m: oklch(var(--L, .66) var(--C, .11) var(--h)); --mt: oklch(var(--tl, .5) var(--C, .11) var(--h)); --msoft: color-mix(in oklab, oklch(var(--L, .66) var(--C, .11) var(--h)) 22%, var(--card)); }
/* avatars: a doodle, or a plain circle in their color */
.av2 { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; overflow: hidden; }
.av2 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av2.lg { width: 44px; height: 44px; } .av2.xl { width: 72px; height: 72px; }
.av2.plain { background: var(--m); }

/* buttons */
.btn { height: 44px; padding: 0 18px; border-radius: var(--r-btn); background: var(--card); box-shadow: 0 0 0 1px var(--line2); font-weight: 600; }
.btn.primary { background: var(--ink); color: var(--bg); box-shadow: none; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: var(--scrim); }
.modal-card { width: min(100%, 340px); background: var(--card); border-radius: var(--r-card); padding: var(--sp-10); box-shadow: var(--shadow-panel); }   /* the same shape as every other popup (8px, 20px: the player card's, Nov 27) */
.modal-card h2 { margin: 0 0 var(--sp-5); font-size: var(--fs-lg); font-weight: 600; text-wrap: balance; }
.modal-card ul { margin: 0 0 var(--sp-7); padding-left: 18px; display: grid; gap: var(--sp-4); font-size: var(--fs-md); color: var(--ink2); }
.modal-card ul b { color: var(--ink); font-weight: 600; }
.modal-card li { text-wrap: pretty; }
.modal-card .ok { width: 100%; height: 44px; border-radius: var(--r-btn); background: var(--ink); color: var(--bg); font-weight: 600; }
/* enter like the board's other dialogs (.smodal sfade/srise): the scrim fades, the card rises a little */
.modal:not([hidden]) .modal-card { animation: mrise var(--t-medium) var(--ease-out); }
@keyframes mfade { from { opacity: 0; } }
@keyframes mrise { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal:not([hidden]) { animation: mfade var(--t) var(--ease); }
/* …and leaves (Nov 25): `hidden` keeps it on screen for --t-out (display waits, allow-discrete) while the scrim fades and
   the card settles a touch, faster than it came. Every way a dialog closes (Done, Escape, the scrim, a re-render that
   hides it) just sets `hidden`, so they all get it. Taps go through at once. */
.modal { transition: opacity var(--t-out) var(--ease-exit), display var(--t-out) allow-discrete; }
.modal[hidden] { opacity: 0; pointer-events: none; }
.modal-card { transition: opacity var(--t-out) var(--ease-exit), transform var(--t-out) var(--ease-exit); }
.modal[hidden] .modal-card { opacity: 0; transform: translateY(4px) scale(.98); }
@media (prefers-reduced-motion: reduce) { .modal:not([hidden]) { animation: mfade var(--t) var(--ease); } .modal:not([hidden]) .modal-card { animation: none; } }

/* One scrim for every dialog (--scrim), and Reduce transparency (the app's switch sets .rt on <html>, or the OS setting)
   makes every one of them solid (--scrim-solid). The editor, passkey and base dialogs used to stay see-through. */
.rt :is(.modal, .smodal, .lpop, .rvpop, .cemodal, .pk-modal) { background: var(--scrim-solid); }
@media (prefers-reduced-transparency: reduce) { :root :is(.modal, .smodal, .lpop, .rvpop, .cemodal, .pk-modal) { background: var(--scrim-solid); } }

/* toast: one quiet line near the bottom */
/* Centered by margins, not a -50% translate: a translated left: 50% box shrink-wraps to half the screen and wrapped a
   one-line message onto three lines. It can now run the full width less 16px each side. z-index 90: above every dialog
   and its scrim (the editor is 45, passkey and the color picker 60, the day bar 70), so a toast fired from one isn't dimmed. */
.toast { position: fixed; left: 16px; right: 16px; width: fit-content; margin-inline: auto; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); font-size: var(--fs-sm); padding: var(--sp-4) var(--sp-6); border-radius: var(--r-md); opacity: 0; pointer-events: none; z-index: 90; text-align: center;
  transform: translateY(8px); transition: opacity var(--t-out) var(--ease-exit), transform var(--t-out) var(--ease-exit); }
/* rises 8px as it appears (the modal card's rise) and fades out a touch faster; Reduce Motion: a fade only, so the
   resting offset goes too (the global rule would otherwise snap it down 8px as it fades out) */
.toast.on { opacity: 1; transform: none; transition: opacity var(--t-in) var(--ease-out), transform var(--t-in) var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .toast { transform: none; } }
.toast.act.on { pointer-events: auto; padding-right: var(--sp-2); }   /* same-day undo (Nov 26): a toast with one button (ui.js toastAction); 4px around it keeps its corner concentric (8 - 4) */
.toast .tact { margin-left: var(--sp-5); padding: var(--sp-2) var(--sp-5); min-height: 32px; border-radius: var(--r-xs); font: inherit; font-weight: 600; color: inherit; background: color-mix(in oklab, var(--bg) 18%, transparent); }

/* "Waiting to connect" (design polish #34, ui.js connBanner): floats over the top of the page while check-ins wait to
   send, so nothing under it moves. z-index 80: over every dialog and the day bar (70), under the toast (90; the toast
   is at the bottom, so they don't meet). It sits under the status bar / notch (safe-area top) plus --cb-y: 8px clears
   Personal's title and cog; the board sets 45px, just under its header buttons (board.css). The floating surface's
   card, ring and shadow, grey words and dot (grayscale-safe). In with a 6px drop and fade (--t-in), out a touch faster;
   Reduce Motion: the fade only. */
.connban { position: fixed; z-index: 80; top: calc(env(safe-area-inset-top, 0px) + var(--cb-y, 8px)); left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); max-width: 420px; margin-inline: auto;
  background: var(--card); color: var(--ink); border-radius: var(--r-md); box-shadow: var(--shadow-panel), 0 0 0 1px var(--line); overflow: hidden;
  opacity: 0; transform: translateY(-6px); transition: opacity var(--t-out) var(--ease-exit), transform var(--t-out) var(--ease-exit); }
.connban.on { opacity: 1; transform: none; transition: opacity var(--t-in) var(--ease-out), transform var(--t-in) var(--ease-out); }
.connban[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .connban { transform: none; } }
/* With a dialog open, the page's header is under the scrim, so the banner moves up to the dialog's top margin (dialog
   cards start 16px down, their titles ~36px): it no longer sits on a tall dialog's title. While the editor is lifted
   over the keyboard (commit/ce.css .ce-kb), the card starts below it. */
:root:has(.lpop, .smodal, .modal:not([hidden]), .cemodal, .pk-modal, .rvpop) .connban { --cb-y: 8px !important; }
.cb-b { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 28px; padding: 0 var(--sp-5); border: 0; border-radius: inherit; background: none; color: inherit; font: 500 var(--fs-sm)/1 var(--font); letter-spacing: var(--ls); text-align: left; cursor: pointer; }
.cb-b:focus-visible { outline-offset: -2px; }
.cb-b i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink3); flex: none; }
.cb-b span { flex: 1; }
.cb-b svg { width: 14px; height: 14px; flex: none; color: var(--ink2); }
.cb-note { margin: 0; padding: 0 var(--sp-5) var(--sp-4) calc(var(--sp-5) + 7px + var(--sp-3)); font-size: var(--fs-sm); line-height: 1.4; color: var(--ink2); }

/* popups and inner lists keep their scroll to themselves: reaching the end doesn't scroll the board behind (Oct 29) */
:is(.jnews, .smodal .xcard, .aplist, .lcard) { overscroll-behavior: contain; }
@media (pointer: coarse) { html:has(.lpop:not(.leaving), .smodal:not(.leaving), .modal:not([hidden])) { overflow: hidden; } }   /* the board can't scroll behind an open popup (touch only: no desktop scrollbar jump) */

/* a plain centered message (no token, errors) */
.empty { display: grid; gap: var(--sp-5); place-items: center; text-align: center; padding: 64px var(--sp-8); color: var(--ink2); }
.empty h1 { margin: 0; font-size: var(--fs-xl); font-weight: 600; color: var(--ink); }

/* Reduce Motion: fewer and gentler, not zero. Things stop moving (transforms, sizes snap) but fades and color changes stay. */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-property: opacity, color, background-color, border-color, box-shadow, display !important; } }

/* The NEW tag (Nov 25): a small filled pill, text knocked out in the page color. One component: the deal cards' NEW
   (M-B) and the "New:" of the tabs note. */
.newtag { display: inline-flex; align-items: center; height: 18px; padding: 0 var(--sp-3); border-radius: 4px; background: var(--ink); color: var(--bg); font: 700 10px/1 var(--font); letter-spacing: .06em; vertical-align: middle; text-transform: uppercase; white-space: nowrap; }
/* In a hint, the tag sits on its own line above the text (Justin, Nov 25). */
.hint .hint-tag { display: flex; width: fit-content; margin: 0 0 var(--sp-3); }

/* ---------- Settings rows (Nov 25; settings.js): one format for Personal's Settings and a challenge's own ----------
   Section titles are the board's section heading ("Everyone"; Justin approved it for Settings, Nov 25). Rows sit on one
   soft card, a hairline between them. One switch and one segmented control for every setting. */
.st-sec { margin: var(--sp-16) 0 0; }
.st-sec:first-of-type { margin-top: var(--sp-10); }
.st-h { margin: 0 0 var(--sp-4); font-size: var(--fs-md); font-weight: 600; color: var(--ink); letter-spacing: var(--ls); text-transform: none; }
.st-list { display: flex; flex-direction: column; border-radius: var(--r-card); background: var(--soft); }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-6); width: 100%; min-height: 52px; padding: var(--sp-4) var(--sp-7); box-sizing: border-box;
  border: 0; background: transparent; font: inherit; color: var(--ink); text-align: left; }
.st-row + .st-row, .st-row + .st-collapse, .st-collapse + .st-row { border-top: 1px solid var(--line2); }
.st-l { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.st-l b { font-weight: 600; font-size: var(--fs-md); overflow-wrap: anywhere; }
.st-l small { font-size: var(--fs-sm); color: var(--ink2); }
.st-v { font-size: var(--fs-note); color: var(--ink2); flex: none; }
.st-link { cursor: pointer; border-radius: 0; }
.st-list > .st-link:first-child { border-radius: var(--r-card) var(--r-card) 0 0; } .st-list > .st-link:last-child { border-radius: 0 0 var(--r-card) var(--r-card); } .st-list > .st-link:only-child { border-radius: var(--r-card); }
.st-chev { width: 14px; height: 14px; flex: none; color: var(--ink3); transition: transform var(--t-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .st-link { transition: background-color var(--t-fast) var(--ease); } .st-link:hover { background: color-mix(in oklab, var(--ink) 4%, transparent); } .st-link:hover .st-chev { transform: translateX(2px); } }
.st-link:active, .st-radio:not(.grey):active { background: color-mix(in oklab, var(--ink) 7%, transparent); }
.st-radio { transition: background-color var(--t-fast) var(--ease); }
.st-link:focus-visible, .st-row :focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.st-note { margin: var(--sp-4) var(--sp-1) 0; font-size: var(--fs-sm); line-height: 1.45; color: var(--ink2); text-wrap: pretty; }
.st-btn { flex: none; min-height: 36px; padding: 0 var(--sp-7); border-radius: var(--r-btn); border: 0; background: var(--ink); color: var(--bg); font: inherit; font-size: var(--fs-note); font-weight: 600; cursor: pointer; }
.st-btn.quiet { background: var(--card); color: var(--ink); }
.st-btn:disabled { opacity: .5; cursor: default; }
.st-btn:active { transform: scale(.97); } .st-btn { transition: transform var(--t-fast) var(--ease-out); }
/* a row that opens more grows open (grid rows 0fr → 1fr) instead of popping; Reduce Motion snaps it (the rule above) */
.st-collapse { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 200ms var(--ease-out), opacity 160ms var(--ease); }
.st-collapse > div { min-height: 0; overflow: hidden; }
.st-collapse.open { grid-template-rows: 1fr; opacity: 1; }
.st-collapse:not(.open) { border-top-color: transparent !important; }
.st-in { display: flex; gap: var(--sp-4); padding: var(--sp-2) var(--sp-7) var(--sp-6); }
.st-in input { flex: 1; min-width: 0; min-height: 40px; border: 0; border-radius: var(--r-sm); padding: 0 var(--sp-6); background: var(--card); font: inherit; color: var(--ink); }
@media (pointer: coarse) { .st-in input { font-size: var(--fs-input); } }   /* no iOS focus zoom */
/* A switch's time row (the gear's Notifications sheet; Settings → Notifications' daily reminder, D1): it belongs to the
   switch above it, so no hairline between them. Moved here from board.css (Nov 25 night) so Settings has it on its own. */
.nftime { min-height: 44px; padding-top: 0; color: var(--ink2); }
.nftime .st-l { padding-left: var(--sp-8); }   /* the time belongs to the switch above it */
.st-row + .nftime, .st-row + .st-collapse[data-nt-c] { border-top: 0; }
.nftime input { font: inherit; font-size: var(--fs-input); color: var(--ink); background: var(--card); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); min-height: 36px; border: 0; }   /* 16px: iOS zooms the page on anything smaller */
.nftime input:disabled { color: var(--ink2); }
/* the one switch: the knob slides, the track fills */
/* One switch everywhere (Nov 25: the player card's and Bring's copies folded in; they set --sw-off / --sw-on). */
.switch { width: 44px; height: 26px; padding: 0; border: 0; border-radius: var(--r-pill); background: var(--sw-off, color-mix(in oklab, var(--ink) 32%, var(--card))); position: relative; flex: none; cursor: pointer;
  transition: background-color var(--t-medium) var(--ease); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--on-fill); box-shadow: 0 1px 3px oklch(0 0 0 / .25);
  transition: transform var(--t-medium) var(--ease-out), background-color var(--t-medium) var(--ease); }
.switch[aria-checked=true] { background: var(--sw-on, var(--pc, var(--ink))); }
/* On, the knob stays --card as before: with no person color in scope the track is --ink, which is near-white in dark mode,
   and a white knob there all but vanished (1.13:1). Only the off state takes the light knob. */
.switch[aria-checked=true]::after { transform: translateX(18px); background: var(--card); }
.switch:active::after { transform: scale(.94); } .switch[aria-checked=true]:active::after { transform: translateX(18px) scale(.94); }
.switch:disabled { opacity: .45; cursor: default; }
@media (prefers-reduced-motion: reduce) { .st-btn:active, .switch:active::after { transform: none; } .switch[aria-checked=true]:active::after { transform: translateX(18px); } }
/* the one segmented control. The selection is one thumb (::before) that slides to the checked option (Nov 27, #3),
   like the switch's knob, instead of a cross-fade in place. Options share the width equally so the thumb's place is
   pure CSS (:has picks the index); no JS, so every re-render and aria-checked change just works. Reduce Motion: the
   global rule drops the transform transition, so the thumb jumps. */
.seg3 { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: color-mix(in oklab, var(--ink) 7%, transparent); border-radius: var(--r-md); padding: var(--sp-1); gap: var(--sp-1); flex: none;
  position: relative; isolation: isolate; --seg-n: 3; --seg-i: 0; }
.seg3:not(:has(> button:nth-of-type(3))) { --seg-n: 2; }
.seg3:has(> button:nth-of-type(2)[aria-checked="true"]) { --seg-i: 1; }
.seg3:has(> button:nth-of-type(3)[aria-checked="true"]) { --seg-i: 2; }
.seg3::before { content: ''; position: absolute; z-index: -1; top: var(--sp-1); bottom: var(--sp-1); left: var(--sp-1);
  width: calc((100% - (var(--seg-n) + 1) * var(--sp-1)) / var(--seg-n)); border-radius: var(--r-sm); background: var(--card); box-shadow: 0 1px 2px oklch(0 0 0 / .12);
  transform: translateX(calc(var(--seg-i) * (100% + var(--sp-1)))); transition: transform var(--t-in) var(--ease-out); }
.seg3:not(:has(> button[aria-checked="true"]))::before { opacity: 0; }
.seg3 button { min-height: 32px; min-width: 44px; padding: 0 var(--sp-5); border: 0; border-radius: var(--r-sm); background: transparent; font: inherit; font-size: var(--fs-sm); font-weight: 500; color: var(--ink2); cursor: pointer; position: relative;
  transition: color var(--t) var(--ease); }
.seg3 button::after { content: ''; position: absolute; inset: -6px 0; }   /* 44px tall target; side by side, so no sideways growth */
.seg3 button[aria-checked="true"] { color: var(--ink); }
/* Dark (Nov 27, #30): --card is darker than the --soft row there, so the thumb read as a hole. Raise it instead, a step
   lighter than the row, so it means the same as in light. Both dark selectors, as tokens.css does. */
:root[data-theme="dark"] .seg3::before { background: color-mix(in oklab, var(--ink) 18%, var(--soft)); box-shadow: 0 1px 2px oklch(0 0 0 / .3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg3::before { background: color-mix(in oklab, var(--ink) 18%, var(--soft)); box-shadow: 0 1px 2px oklch(0 0 0 / .3); } }
/* a settings sheet: the same sections inside a dialog, a little tighter */
.modal-card.st-card { width: min(100%, 380px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-10); }
.st-card > h2 { margin-bottom: 0; }
.st-card .st-h { font-size: var(--fs-md); margin: 0 0 var(--sp-4); }   /* not the dialog title's size */
body.bf-tabs .modal { z-index: 31; }   /* a dialog's scrim covers the tab bar too, so its last row never sits under it */
.st-card .st-sec { margin-top: var(--sp-10); }
.st-card .ok { margin-top: var(--sp-10); }
/* moving between settings screens in a dialog (a challenge's settings ⇄ its notifications): the new screen slides in
   from the side it comes from; the scrim stays put. Reduce Motion: a fade (the rule above drops the movement). */
.modal.st-from-r, .modal.st-from-l { animation: none !important; }
.modal.st-from-r .modal-card { animation: st-in-r 200ms var(--ease-out) both !important; }
.modal.st-from-l .modal-card { animation: st-in-l 200ms var(--ease-out) both !important; }
@keyframes st-in-r { from { opacity: 0; transform: translateX(24px); } }
@keyframes st-in-l { from { opacity: 0; transform: translateX(-24px); } }
@media (prefers-reduced-motion: reduce) { @keyframes st-in-r { from { opacity: 0; } } @keyframes st-in-l { from { opacity: 0; } } }
/* …and the one being left goes out the other side, its scrim gone at once (the next sheet's is already up) */
.modal.st-to-l[hidden], .modal.st-to-r[hidden] { background: transparent; }
.modal.st-to-l[hidden] .modal-card { transform: translateX(-24px); }
.modal.st-to-r[hidden] .modal-card { transform: translateX(24px); }
.st-gap { margin-top: var(--sp-4); }
.st-radio { cursor: pointer; }
.st-radio.grey { cursor: default; } .st-radio.grey .st-l { opacity: .5; }
.st-check { width: 16px; height: 16px; flex: none; color: var(--pc, var(--ink)); opacity: 0; transform: scale(.85); transition: opacity var(--t) var(--ease), transform var(--t-medium) var(--ease-out); }
.st-radio[aria-checked=true] .st-check { opacity: 1; transform: none; }
.st-sub { margin: var(--sp-8) var(--sp-1) var(--sp-3); font-size: var(--fs-sm); font-weight: 600; color: var(--ink2); }

/* ---------- motion helpers (motion.js) ---------- */
.mo-stretching { overflow: hidden !important; }   /* a surface animating to its new height clips while it moves */
/* A page push (motion.js snapshot/play; Challenges ⇄ a board, onboarding's steps, the lobby ⇄ its practice board,
   Personal ⇄ Settings): the page being left is a still copy above or below the page. 200ms, the house ease-out. */
.sh-under { position: fixed; z-index: 0; overflow: hidden; pointer-events: none; background: var(--bg); box-sizing: border-box; }
.sh-push-in { animation: sh-from-right var(--t-slide) var(--ease-out) both; position: relative; z-index: 1; background: var(--bg); }
.sh-push-under { animation: sh-to-left var(--t-slide) var(--ease-out) both; }
.sh-pop-in { animation: sh-from-left var(--t-slide) var(--ease-out) both; }
.sh-pop-under { animation: sh-to-right var(--t-slide) var(--ease-out) both; }
@keyframes sh-from-right { from { transform: translateX(100%); } }
@keyframes sh-to-left { to { transform: translateX(-30%); opacity: .4; } }
@keyframes sh-from-left { from { transform: translateX(-30%); opacity: .4; } }
@keyframes sh-to-right { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .sh-push-in, .sh-push-under, .sh-pop-in, .sh-pop-under { animation: none; } }
html.mo-sliding { overflow-x: clip; }   /* nothing scrolls sideways while a page slides (motion.js sets it) */

/* ---------- the countdown's number (LB1, flag `dec`; countdown.js) ----------
   "Your challenge begins in [5] days" (the lobby) and "Starts in [5] days" (Challenges' Starting soon cards, Nov 27): the
   number in a quiet neutral rounded rectangle (Justin, Nov 26: it isn't about any one player, so no hue), the app's
   soft fill with a hairline and full ink. Its own clip window, so the number can slide from the one you saw last time
   (countdown.js slideCount): both numbers share one grid cell while it plays. Sized by the line it sits in. */
.cdn { display: inline-grid; vertical-align: baseline; overflow: hidden; padding: 0 .32em; margin: 0 .06em; border-radius: 6px;
  background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink);
  font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.cdn-n { grid-area: 1 / 1; justify-self: center; }
