/*! Tells — © 2026 Francisco Togores Carbonell. All rights reserved. Proprietary; see LICENSE. */

/* One hand-written layer, one definition per selector. Theme tokens are the
   :root block below; later wins at equal specificity. */

/* Type: two self-hosted faces (CSP font-src 'self') and a system body font.
   --font-display: titles. --font-note: poker NOTATION only (stacks, pots, BB,
   positions, the typed hand), never prose. --font-ui: the system stack. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plexmono-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--surface-3) transparent;
  scrollbar-width: thin;
}

/* Author display rules must never defeat the hidden attribute. */

[hidden] {
  display: none !important;
}

/* A modal holds the focus as a whole; a ring round the whole sheet says nothing. */
[role="dialog"]:focus {
  outline: none;
}

/* Said to a screen reader, never painted. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Theme tokens (walnut, dark-only). */

:root,
body[data-theme=dark] {
  color-scheme: dark;
  /* Darker than the original walnut: all text is light on it, so this can only
     raise contrast, and surfaces read as objects on the table. */
  --bg: #0d0a07;
  --surface: #1a1511;
  --surface-2: #241c17;
  --surface-3: #342820;
  --ink: #f1e8dc;
  --muted: #aa9c8c;
  --line: #403229;
  --accent: #2f8f63;
  /* Separate token for the FILLED state: --accent passes as text on the surface
     and fails as a background under white. Darkening --accent would break its
     uses as a colour, so the fill has its own value. */
  --accent-fill: #2a7d57;
  --accent-dark: #72c99a;
  --accent-soft: #173728;
  /* Text ON a saturated fill (badges, warning pip): white fails, near-black passes. */
  --on-fill: #14110e;
  /* --ink-bright: display voice, headings only. --champ-hi: focus/highlight only,
     never prose (on the felt it only passes as non-text). */
  --ink-bright: #f8f2e6;
  --champ-hi: #e0b57a;
  --gold: #c69a55;
  --gold-soft: #382918;
  --blue: #6faaa2;
  --red: #d16d5e;
  --red-soft: #3d211d;
  --felt: #145c3f;
  --felt-dark: #092f22;
  /* The felt's own vocabulary, named at the values that were already there:
     the stack yellow, the physical card (ink, red suit, back stripes), the two
     action hues the sequence chips speak, and the paused amber. #fff stays
     literal on purpose: its 20 sites carry four different meanings. */
  --stack-gold: #f4cf6a;
  --card-ink: #1b2430;
  --card-red: #cc2118;
  --card-back: #12664f;
  --card-back-dark: #0b4637;
  --act-allin: #9a3bd0;
  /* Two all-in hues, decided from photographs: the button belongs to a palette of
     four actions, where the purple is what separates it from the gold raise beside
     it; the felt marks a STATE over dark green, where the orange is what reads. */
  --felt-allin: #ff9c6b;
  --act-fold: #b23a3a;
  --paused: #d69e2e;
  /* Referenced as var(--danger, fallback) since it was written, defined never:
     the fallback did all the work. Defined at the value that already renders. */
  --danger: #ff6b6b;
  /*! Third-party: Lucide icons, https://lucide.dev (the four glyph paths below)
ISC License

Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

The MIT License (MIT) (for portions derived from Feather)

Copyright (c) 2013-2023 Cole Bemis

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
  /* A note says what it is with a glyph from the app's own icon set (Lucide), masked
     so it takes the note's colour: the alert, the stop, the fact and the tip. One
     device per job: the glyph and the tint, never a rail down the side as well. */
  --glyph-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
  --glyph-stop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E");
  --glyph-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
  --glyph-tip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5'/%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3C/svg%3E");

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-note: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  /* The layers, in the order they are allowed to cover each other. Five
     backdrop-and-sheet pairs wrote one relationship as six different number
     pairs (79/80, 82/84 twice, 84/85 twice, 86/87); measured, no two of those
     sheets are ever open together - ending a session closes its sheet before the
     cool-down opens - so they share one step. The replay overlay sat on the nav's
     own number and stayed on top only because it comes later in the markup.
     Not here: the Turnstile pair (9998/9999), which is deliberately above
     everything of ours, and the small values local to one panel's stacking. */
  --z-topbar: 30;
  --z-nav: 40;
  --z-replay: 60;
  --z-backdrop: 80;
  --z-sheet: 81;
  --z-toast: 90;

  /* The sticky topbar's height. Read by html's scroll-padding-top: a
     scrollIntoView that ignores it lands the target behind the bar. */
  --topbar-h: 48px;

  /* The floating nav's own height, plus the gap it leaves under itself. The
     toast sits above it and the shell scrolls past it; both used to carry a
     hand-summed number, so a change to the nav silently moved neither. */
  --nav-h: 54px;
  --nav-gap: .75rem;
  --nav-space: calc(var(--nav-h) + var(--nav-gap) + env(safe-area-inset-bottom, 0px));

  /* Corner radii, and the rule that assigns them: what CONTAINS reads --r-lg,
     what is PRESSED reads --r-sm; --r-pill is the deliberate pill. The 4px and
     6px details (note strips, the playing-card glyph) stay literal on purpose.
     Decided 2026-08-31 from photographs: four whole-app renders were
     indistinguishable at 412px, so the choice was maintenance, not looks. */
  --r-sm: 8px;
  --r-lg: 12px;
  --r-pill: 999px;

  /* Seven steps, one job each, a whole pixel apart at a phone held at arm's length
     (sixteen were measured on the photographs where seven can be told apart): the
     screen's one loud figure, the screen title, a figure, a block title, prose,
     notes and controls, and the label in capitals. All rem, so 150 % text scales
     everything; do not add a px step. hero is the landing's own. */
  --t-hero: clamp(1.9rem, 7.6vw, 2.9rem);
  --t-figure-xl: 2.25rem;
  --t-title: 1.5rem;
  --t-figure: 1.25rem;
  --t-section: 1.125rem;
  --t-body: 1rem;
  /* control, note and small are one size: running text under the prose reads at
     14 px whatever its role. The three names stay, so a rule still says which. */
  --t-control: .875rem;
  --t-note: .875rem;
  --t-small: .875rem;
  --t-micro: .75rem;
  /* The one step under 12 px: words the player typed into a chip, measured to wrap
     at 12 px in both languages. */
  --t-micro-tight: .72rem;
  /* Spacing in steps of 4: inside a pair, between siblings, between blocks, a
     card's padding, between sections, before a screen title. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 40px;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh; /* dvh tracks the real visible height on phones (URL bar). */
  overscroll-behavior: none; /* kill accidental pull-to-refresh mid-hand */
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* Kill double-tap zoom and the 300ms touch delay. Scripted edits: ".segmented {"
   also appears as the last selector of this group — anchor on something unique. */
button,
select,
label,
.segmented {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

label {
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 700;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding: 0 1.25rem calc(var(--nav-space) + 2.5rem);
  max-width: 1480px;
}

.topbar,
.home-view,
.workspace,
.database-panel,
.editor-panel {
  width: 100%;
}

.topbar {
  gap: 18px;
  margin: 0 auto 18px;
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  min-height: var(--topbar-h);
  justify-content: space-between;
  /* One row of 48: the 44 px targets and 2 px each side. The name of the screen is
     the bar's text; the mark alone says Tells. */
  padding-top: calc(.125rem + env(safe-area-inset-top, 0px));
  padding-bottom: .125rem;
  max-width: 1440px;
  margin-bottom: 14px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  display: flex;
  align-items: center;
}

/* Until the first render sets body[data-view] the shell is its English markup:
   show the mark on the walnut, not a skeleton. */
body:not([data-view]) .app-shell > :not(.topbar),
body:not([data-view]) .bottom-nav,
body:not([data-view]) #appContextTitle {
  visibility: hidden;
}

.brand-button,
h2,
h3,
p {
  margin: 0;
}

/* Display face ships at ONE weight (700); 800/900 would be a smeared synthetic
   bold, so every heading pins 700. Tight tracking: the face is drawn wide. */

h1,
h2,
h3 {
  font-family: var(--font-display);
  /* The only place --ink-bright lives: a title is lighter than prose, not bigger. */
  color: var(--ink-bright);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.15;
  text-wrap: balance;
}

.brand-button {
  border: 0;
  color: var(--ink);
  background: transparent;
  display: flex;
  align-items: center;
  min-width: 0;
  /* 44px: text alone left this tap target a fraction under the bar. */
  min-height: 44px;
  gap: .75rem;
  border-radius: var(--r-sm);
  padding: .25rem;
  text-align: left;
}

/* The screen's name, in the display voice: the one title every screen has. */
.brand-button strong {
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: var(--t-title);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--ink-bright);
}

/* An eyebrow names the block under it: caps and tracking make it a label; muted,
   600 so it never competes with numbers or spends the accent on furniture. */
.eyebrow {
  margin-bottom: .3rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  font-size: var(--t-micro);
  letter-spacing: .1em;
}

/* The one eyebrow with no room to spare: tracked capitals over a figure that is
   already as wide as its card ("Resultado en BB" wraps at 12 px, measured). */
#bankrollEyebrow {
  font-size: var(--t-micro);
}

.topbar-tools,
.panel-heading,
.form-actions,
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-tools {
  /* One row always: the screen's name shrinks, the tools never drop under it. */
  flex-wrap: nowrap;
  flex-shrink: 0;
  justify-content: flex-end;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(420px, 1fr) minmax(300px, 390px);
  margin: 0 auto;
  max-width: 1440px;
  gap: 18px;
}

/* The page is the surface: the rivals are the cards, and a box around the list
   (or around the profile open beside it) was a card holding cards. */
.database-panel,
.editor-panel {
  min-height: calc(100vh - 120px);
  min-height: calc(100dvh - 120px);
}

.panel-heading {
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

.panel-heading p {
  margin-top: .25rem;
  font-size: var(--t-control);
  line-height: 1.25rem;
  line-height: 1.375;
  color: var(--muted);
}

/* One shape for every button, then one block of colour each. The shape used to be
   written out five times, so a change to it was five edits and a hunt for the one
   that was missed. .nav-button is not the same shape and says so on its own. */

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  /* Sides only. Not what sizes the Settings gear — .topbar .icon-button sets an
     explicit box further down and wins. */
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: var(--t-control);
  line-height: 1.25rem;
  font-weight: 700;
  transition: transform .15s ease,
    background .15s ease,
    border-color .15s ease,
    box-shadow .15s ease,
    color .15s ease;
}

.nav-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 0 15px;
  font-weight: 700;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface);
}

.primary-button {
  color: #fff;
  background: var(--accent-fill);
}

.primary-button:hover {
  background: var(--accent-dark);
  color: var(--bg);
  transform: translateY(-1px);
}

/* The second action wears the ink and a line, never the green: one filled green
   per screen, and green means you and winning (DESIGN section 4). */
.secondary-button {
  color: var(--ink);
  border-color: var(--line);
  background: transparent;
}

.ghost-button {
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
  border-color: transparent;
  background: transparent;
}

/* Clear Form, armed: the next tap destroys an unsaved parse. The danger button's
   lightened red, since --red on --red-soft measured 4.2:1. */
.ghost-button.confirming {
  color: #db7f70;
  border-color: color-mix(in srgb, var(--red) 28%, var(--line));
  background: var(--red-soft);
}

.danger-button {
  /* --red on --red-soft misses 4.5:1; lightened here, not in the token (--red is
     also a border and background). The same reason it is not --danger: that one
     is vivid because it only ever lands on a dark surface. */
  color: #db7f70;
  border-color: color-mix(in srgb, var(--red) 28%, var(--line));
  background: var(--red-soft);
}

.icon-button {
  place-items: center;
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
  border-color: transparent;
  background: transparent;
  width: 2.5rem;
  padding: 0;
}

body[data-theme="dark"] .icon-button {
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
  border-color: transparent;
  background: transparent;
}

.nav-button.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent-fill);
}

.bottom-nav {
  margin: 0 auto;
  position: fixed;
  /* Unconditional, not only under 412px: a 430px phone has a home indicator too,
     and the nav was landing inside it on every Plus and Pro Max. */
  bottom: max(var(--nav-gap), env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: var(--z-nav);
  display: grid;
  width: calc(100% - 24px);
  max-width: 560px;
  transform: translateX(-50%);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .25rem;
  padding: .375rem;
  right: auto;
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  border-radius: var(--r-lg);
}

.bottom-nav .nav-button {
  width: 100%;
  display: flex;
  height: 54px;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .125rem;
  border-width: 0;
  /* Sides at .25rem, not .5rem: with five columns "Profiles" is wider than the
     content box .5rem leaves at 320px, and a single word cannot wrap, so it was
     living in the padding. Measured by tests/label-fit-tests.html. */
  padding: .25rem;
  /* 12 px, the label step: the five labels are measured at the 320px floor in both
     languages, and "Profiles" has 1px of slack in its slot there. */
  font-size: var(--t-micro);
  font-weight: 700;
  background: transparent;
  color: var(--muted);
  border-radius: var(--r-sm);
}

/* While the hero is up, "start a session" is on screen three times: the hero's
   button, the guide's row, and the card. The cards step aside for it and the nav
   below keeps every destination one tap away. They are back the moment it goes. */

body[data-view="home"][data-home-hero="on"] .home-actions {
  display: none;
}

/* Home fills the space under the topbar; dvh tracks the real visible height. */

body[data-view="home"] .app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.home-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 860px;
}

/* Home is designed to fit one screen via .home-actions; nothing enforces it.
   Do NOT add overflow: hidden — whether Home fits depends on the guide card,
   not the viewport, and clipping content with no way to scroll is worse. */

.home-intro h2 {
  max-width: 720px;
  font-size: var(--t-title);
  line-height: 2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.home-intro {
  display: grid;
  gap: 10px;
  margin-bottom: 1rem;
}

.home-intro:empty {
  display: none;
}

/* Resume-session banner on Home */

/* What Home knows about you. Rows exist only when there is a fact; quieter
   than the resume banner (an action) because these are a report. */
/* No box: a thin rule separates rows; a border around them carries nothing. */
.home-status {
  display: grid;
  margin-top: 4px;
}

.home-status-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 11px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  font: inherit;
  text-align: left;
  color: var(--ink);
  background: none;
}

.home-status-row:last-child {
  border-bottom: 0;
}

button.home-status-row {
  cursor: pointer;
}

/* The label names the fact, so it does not compete with the figure. It is an
   .eyebrow and takes --t-micro and the shared tracking; only the layout differs. */
.home-status-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Figure in mono, tabular-nums: notation, and a BB column must not shift. */
.home-status-value {
  flex: 0 0 auto;
  font-family: var(--font-note);
  font-variant-numeric: tabular-nums;
  font-size: var(--t-body);
  text-align: right;
  color: var(--ink);
}

/* Green wins, red loses. Set by JS only when there is a sign to show. */
.home-status-value.up { color: var(--accent-dark); }
.home-status-value.down { color: var(--red); }

/* The last session is the screen's loud figure: its label above, the result in
   the loud size, the night's facts beside it (the art director's mockup). */
.home-status-lead {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: var(--s-3);
  padding: 0 2px var(--s-2);
  border-bottom: 0;
}

.home-status-lead .home-status-label {
  grid-column: 1 / -1;
  flex: none;
}

.home-status-lead .home-status-value {
  font-size: var(--t-figure-xl);
  font-weight: 700;
  line-height: 1.1;
  /* A mono space is a full character: pull "+5 BB" back to one figure. */
  word-spacing: -.22em;
  text-align: left;
}

.home-status-meta {
  color: var(--muted);
  font-size: var(--t-note);
}

/* The last hand, one row under the destinations: cards, title and date, verdict. */
.home-after {
  display: grid;
  gap: var(--s-1);
}

.home-after:empty {
  display: none;
}

.home-after .eyebrow {
  margin: var(--s-2) 0 0;
}

.home-hand-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 64px;
  padding: var(--s-2) 2px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.home-hand-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.home-hand-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-hand-text span {
  color: var(--muted);
  font-size: var(--t-note);
}

.home-hand-stamp {
  font-weight: 700;
  white-space: nowrap;
}

.home-hand-stamp.up { color: var(--accent-dark); }
.home-hand-stamp.down { color: var(--red); }

/* The question a session open since yesterday puts on Home: the hour it started,
   and the way out of it. */
.session-ask {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.session-ask-text {
  display: grid;
  gap: 2px;
}

.session-ask-text span {
  color: var(--muted);
  font-size: var(--t-note);
}

/* A paused tournament's card: the ask's frame, its two ways on side by side. */
.session-ask-actions {
  display: flex;
  gap: .5rem;
}

/* The first-run hero: the demo hand playing itself under the sentence that
   would have produced it. The felt inside is the app's own replay felt and
   only its width is set here, so seats, cards and bets keep the proportions
   they are tuned at everywhere else. */

/* The demo stands on the page: a felt is the one object of colour, and a card
   around it made the screen's first thing a box. */
.home-hero {
  display: grid;
  gap: 10px;
  width: 100%;
}

/* The notation face, because this is meant to read as something typed. */
.home-hero-said {
  margin: 0;
  font-family: var(--font-note);
  font-size: var(--t-small);
  line-height: 1.62;
  color: var(--ink);
}

/* The sentence lights up as the hand plays. app.js sets [data-lit] only once the
   segments have rebuilt the translated sentence byte for byte, so without it this
   is inert and the line keeps full contrast. No padding or border on the lit
   phrase: any box change would reflow the paragraph under the reader. */
.home-hero-said[data-lit] .hero-seg {
  color: #8a7d6e;
}

.home-hero-said[data-lit] .hero-seg.on {
  color: var(--ink-bright);
  box-shadow: inset 0 -2px 0 var(--accent-dark);
}

@media (prefers-reduced-motion: no-preference) {
  .home-hero-said[data-lit] .hero-seg {
    transition: color .2s ease, box-shadow .2s ease;
  }
}

.home-hero-felt {
  display: grid;
  place-items: center;
}

/* Narrower than the replay modal's felt, which owns a whole screen. Specificity (0,5,0) so it also wins
   over the wide-screen ceilings further down, the tucked one included. */
.home-hero-felt .mini-felt-table.replay-felt.tucked[data-size],
.home-hero-felt .mini-felt-table.replay-felt {
  width: min(100%, 300px);
}

.home-hero-cta {
  width: 100%;
  min-height: 48px;
}

/* Wide enough for two columns, which is mostly a phone lying down: stacked, this
   card measured three screenfuls at 915x412, and a hero whose two halves cannot
   be seen at once has stopped making its argument. Photographed at that size
   before and after. */
@media (min-width: 700px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "said felt" "cta felt";
    grid-template-rows: auto 1fr;
    align-items: start;
    column-gap: 22px;
  }

  .home-hero-said {
    grid-area: said;
    align-self: center;
    font-size: var(--t-note);
  }

  .home-hero-felt {
    grid-area: felt;
  }

  .home-hero-cta {
    grid-area: cta;
  }
}

/* The hero felt has a floor of 300px and must not be capped below it. Seat boxes
   do not shrink with the felt (their width clamps to 94px on a wide viewport),
   so a narrower felt closes the seats over the board and ellipsises the pot. */

/* First-launch guide on Home; retires itself once all steps are done. */

/* The guide is a list with lines under a label, not a card of cards. */
.onboard-card {
  display: grid;
  gap: 0;
  width: 100%;
  text-align: left;
}

/* Home's line for a hand remembered: one quiet row, the whole width a thumb can find. */
.home-recall {
  border: 1px solid var(--line);
  background: var(--surface);
  width: 100%;
  justify-content: flex-start;
  min-height: 44px;
  text-align: left;
  white-space: normal;
}

/* Shown once, right after an invite is redeemed: a card, because it closes whole,
   and the only mark it needs is its own line. */
.beta-welcome {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: .875rem;
  /* Room for the close button, so a long line never runs under it. */
  padding-right: 2.75rem;
  border-radius: var(--r-lg);
}

.beta-welcome p {
  margin: 0;
  text-wrap: pretty;
  color: var(--muted);
  font-size: var(--t-control);
}

/* The yes and the no weigh the same: one class, one width. */
.usage-consent .settings-actions > button {
  flex: 1 1 0;
}

.beta-welcome-how {
  justify-self: start;
  margin-top: 4px;
}

.beta-welcome-close {
  position: absolute;
  top: .35rem;
  right: .35rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  line-height: 1;
}

/* Home's door to the account, shown only while accounts are open: the welcome's card without its close,
   so a stranger's two buttons and a beta player's three facts sit in the same frame. */
.account-ask {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: .875rem;
  border-radius: var(--r-lg);
}

.account-ask p {
  margin: 0;
  text-wrap: pretty;
  color: var(--muted);
  font-size: var(--t-control);
}

.account-ask .settings-actions {
  margin-top: 4px;
}

.account-ask .settings-actions button {
  flex: 1 1 auto;
  min-height: 44px;
}

.account-ask a,
#accountPrivacyLine a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  text-decoration: underline;
}

/* What an account does, before it is made: three short notes and the policy, a gap apart. */
.account-facts {
  display: grid;
  gap: 4px;
}

.onboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: .5rem;
}

.onboard-head strong {
  font-size: var(--t-note);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.onboard-skip {
  padding: 4px 1rem;
}

.onboard-step {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  min-height: 52px;
  padding: .5rem 2px;
  border-radius: 0;
  background: transparent;
}

.onboard-step.done {
  opacity: 0.62;
}

/* Blocked step: still tappable (routes to the unblocking step), so dashed edge
   only — a greyed label would make a working control look broken. */
.onboard-step.blocked {
  border-style: dashed;
  background: transparent;
}

.onboard-step.blocked .onboard-num {
  color: var(--muted);
  opacity: 0.7;
}

.onboard-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--t-note);
  font-weight: 700;
}

.onboard-step.next .onboard-num {
  border-color: var(--accent);
  background: var(--accent-fill);
  color: #fff;
}

.onboard-step.done .onboard-num {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.onboard-text {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.onboard-text strong {
  font-size: var(--t-body);
}

.onboard-text span {
  color: var(--muted);
  font-size: var(--t-note);
  font-weight: 700;
  /* A two-line hint never leaves one word alone on its second line. */
  text-wrap: pretty;
}

/* Splits the remaining height evenly so nothing scrolls, intro or not. */

/* The four destinations as the night uses them: start a session is the one filled
   green, record a hand wears a line, Profiles and Stats are two rows. While a paused
   tournament waits, Resume holds the green and the session tile wears a line. */
.home-actions {
  min-height: 0;
  grid-template-columns: 1fr;
  gap: var(--s-2);
  display: grid;
}

.home-choice[data-view="session"]:where(:not([data-resume-first])) {
  min-height: 3.5rem;
  border-color: var(--accent-fill);
  background: var(--accent-fill);
  box-shadow: none;
}

.home-choice[data-view="session"]:where(:not([data-resume-first])) > div > span,
.home-choice[data-view="session"]:where(:not([data-resume-first])) .home-choice-icon,
.home-choice[data-view="session"]:where(:not([data-resume-first])) strong {
  color: #fff;
}

.home-choice[data-view="record"],
.home-choice[data-view="session"][data-resume-first] {
  min-height: 3.5rem;
  background: transparent;
  box-shadow: none;
}

.home-choice[data-view="database"],
.home-choice[data-view="stats"] {
  min-height: 64px;
  padding-inline: .25rem;
  border-width: 1px 0 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-choice {
  align-content: center;
  color: var(--ink);
  display: grid;
  min-height: 92px;
  width: 100%;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  text-align: left;
  grid-template-columns: 46px minmax(0, 1fr) 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;
  border-radius: var(--r-lg);
}

.home-choice span {
  color: var(--accent-dark);
  font-size: var(--t-note);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

/* The second line describes or reports; only a figure inside it is a figure. */
.home-choice strong {
  max-width: 360px;
  font-size: var(--t-note);
  font-weight: 400;
  line-height: 1.2;
  color: var(--muted);
}

body[data-view="home"] .workspace,
body:not([data-view="home"]) .home-view {
  display: none;
}

body[data-view="session"] .workspace,
body[data-view="stats"] .workspace,
body[data-view="record"] .workspace {
  grid-template-columns: minmax(520px, 980px);
  justify-content: center;
}

body[data-view="database"] .workspace {
  grid-template-columns: minmax(300px, 440px) minmax(360px, 560px);
  justify-content: center;
}

body[data-view="database"] .hand-panel {
  display: none;
}

.editor-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

/* Hidden by default: with the roster beside it there is nothing to go back to. */
.editor-back {
  display: none;
  min-height: 44px;
  padding: 0 6px 0 0;
  margin-left: -6px;
  border: 0;
  background: none;
}

.editor-back svg {
  width: 22px;
  height: 22px;
}

.editor-back-label {
  display: none;
  font-weight: 700;
}

.bar-named .editor-back-label {
  display: inline;
}

/* The bar already says the rival's name; the heading stays for screen readers. */
.bar-named #editorTitle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Placeholder while nothing is selected; not an .editor-panel, which would read
   as a card that failed to load. */
.editor-empty {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 32px;
  text-align: center;
  min-height: calc(100vh - 120px);
  min-height: calc(100dvh - 120px);
}

.editor-empty strong {
  font-size: var(--t-section);
  color: var(--ink);
}

.editor-empty p {
  margin: 0;
  max-width: 26ch;
  color: var(--muted);
  font-size: var(--t-control);
  text-wrap: pretty;
}

/* The detail column only means anything beside the roster. Written as "not
   Profiles" rather than listed per view, so a view added later inherits it. */
body:not([data-view="database"]) .editor-empty {
  display: none;
}

body[data-view="record"] .workspace {
  grid-template-columns: minmax(520px, 980px);
  justify-content: center;
}

body[data-view="session"] .session-panel,
body[data-view="stats"] .stats-panel {
  display: grid;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 980px;
}

body[data-view="session"][data-session-active="true"] .live-panel {
  display: grid;
  order: -1;
}

/* With a session running the "New session" heading is noise. */

body[data-session-active="true"] .session-panel > .panel-heading {
  display: none;
}

body[data-view="session"][data-session-active="true"] .session-panel {
  order: 1;
}

body[data-view="session"] .database-panel,
body[data-view="session"] .hand-panel,
body[data-view="session"] .editor-panel,
body[data-view="stats"] .database-panel,
body[data-view="stats"] .hand-panel,
body[data-view="stats"] .editor-panel {
  display: none;
}

body[data-view="record"] .database-panel,
body[data-view="record"] .editor-panel {
  display: none;
}

/* Settings is a real view: single centred column, other panels hidden. */

.settings-panel {
  display: none;
}

/* min(320px, 100%): the shell adds 12px each side, so at the 320px floor the
   track is 296px and a hard 320 overflows. */
body[data-view="settings"] .workspace {
  grid-template-columns: minmax(min(320px, 100%), 640px);
  justify-content: center;
}

/* min-width: 0 is load-bearing: a grid item defaults to min-width: auto, so an
   unshrinkable child would inflate this panel past its parent at 320px. */
body[data-view="settings"] .settings-panel {
  display: grid;
  gap: var(--s-5);
  align-content: start;
  min-width: 0;
}

body[data-view="settings"] .database-panel,
body[data-view="settings"] .hand-panel,
body[data-view="settings"] .editor-panel {
  display: none;
}

/* Reference text: note size and a measured line length. */
.settings-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-note);
  line-height: 1.45;
  max-width: 58ch;
  text-wrap: pretty;
}

.account-status:empty {
  display: none;
}

/* The two states of the account line. --accent-dark and not --accent: the filled green
   reads as a button against the card, and this is a sentence. */
.account-status.ok {
  color: var(--accent-dark);
}

.account-status.danger {
  color: var(--danger);
}

/* While a request is out, the card dims rather than moving: a panel that reflows under
   the thumb mid-tap is how a phone loses a password to the field below. */
.set-page.is-busy {
  opacity: 0.72;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* A field's name over a control that is not a form field (the language pill):
   the same voice as the labels of the fields around it. */
.settings-label {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-note);
  font-weight: 700;
}

/* Links read as links: no box, no pill, the thumb's height each. */
.settings-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
}

.settings-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--ink);
  font-size: var(--t-note);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}

.settings-link:hover {
  text-decoration-color: currentColor;
}

/* ---- Settings as a list: a group is its title and its rows, never a box. ---- */
.set-group {
  display: grid;
  min-width: 0;
}

.set-group > .set-title {
  margin: 0 0 var(--s-2);
  font-size: var(--t-section);
}

/* One row: the name and its state at the left; a figure, a control or a glyph at the far end. */
.set-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 56px;
  padding: var(--s-2) 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
}

button.set-row,
label.set-row {
  cursor: pointer;
}

.set-row.is-fact {
  cursor: default;
}

.set-row-text {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}

/* 600 on what a tap moves, 400 on what is only read. */
.set-row-name {
  font-size: var(--t-body);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.set-row.is-fact .set-row-name {
  font-weight: 400;
}

.set-row-state {
  font-size: var(--t-note);
  font-weight: 400;
  line-height: 1.4;
  color: var(--muted);
  text-wrap: pretty;
}

.set-row-figure {
  flex: none;
  font-size: var(--t-note);
  color: var(--ink);
}

/* A stated figure is notation: the mono; "Not set" is a word. */
.set-row-figure:not(.is-unset) {
  font-family: var(--font-note);
  font-variant-numeric: tabular-nums;
}

.set-row-figure.is-unset {
  color: var(--muted);
}

/* Seats are notation too: the mono, as the figures are. */
.set-row-state.is-notation {
  font-family: var(--font-note);
  font-variant-numeric: tabular-nums;
}

.set-row-state.danger {
  color: var(--danger);
}

/* The account's state wears Home's sync mark in front of its words: the same cloud, the same rules. */
.set-row-state.has-mark,
.sync-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.set-row-state.has-mark svg,
.sync-line svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  overflow: visible;
}

/* A row armed for its second tap (sign out everywhere) wears the armed ghost button's red. */
.set-row.confirming .set-row-name {
  color: #db7f70;
}

/* The one thing to do before anything else (install): a card, since the whole of it is tapped. */
.set-todo {
  min-height: 56px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.set-row > svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.set-row input.set-short {
  flex: none;
  width: 6rem;
  text-align: center;
}

/* What belongs to the row above it (a status and its way back), as wide as the page. */
.set-under {
  display: grid;
  gap: var(--s-1);
  padding: 0 0 var(--s-3);
}

.set-under:empty {
  display: none;
}

.set-lead {
  margin: 0 0 var(--s-3);
}

.set-seats {
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}

/* The way into the account: the list's one filled green, the column wide. */
.set-wide {
  width: 100%;
  min-height: 48px;
}

/* The signed-in account screen: its groups stand a step apart, as the list's do. */
.account-panel.account-groups {
  gap: var(--s-5);
}

.set-page-who {
  margin: 0 0 var(--s-1);
  overflow-wrap: anywhere;
  font-size: var(--t-body);
  color: var(--ink);
}

/* Inside a screen the lists keep their rows; a button that acts on the list is a row too. */
.set-group .account-list li {
  border-top: 1px solid var(--line);
  padding: var(--s-2) 0;
  min-height: 56px;
}

.set-group .account-row-text > span:first-child {
  font-size: var(--t-body);
  color: var(--ink);
}

.set-group .sync-preview li {
  border-top: 0;
  min-height: 0;
  padding: 0;
}

.set-group .sync-notices li {
  border-top: 0;
  min-height: 0;
  padding: 6px 0;
}

/* The add-passkey steps under the keys keep the 8px the block had; the rows draw their own rule. */
#passkeyBlock > .account-block,
#passkeyBlock > .account-status,
#passkeyBlock > .settings-actions {
  margin-top: var(--s-2);
}

/* The way out of the account: the ghost button it is today, under the rows and above the erasure. */
.set-out {
  padding: var(--s-1) 0;
  border-top: 1px solid var(--line);
}

/* A screen inside Settings (seats, install, account): the list steps aside while one is open, and its first
   line is the way back, as in a rival's profile. */
.set-page {
  display: none;
}

/* .ghost-button.set-back: the phone rule that pads every ghost button by 12px comes later and weighs the same. */
.ghost-button.set-back {
  display: none;
  justify-self: start;
  min-height: 44px;
  padding: 0 6px 0 0;
  margin: -8px 0 -8px -6px;
  border: 0;
  background: none;
}

.set-back svg {
  width: 22px;
  height: 22px;
}

body[data-settings-page] .settings-panel > :not(.set-back):not(.set-page) {
  display: none;
}

body[data-settings-page] .set-back {
  display: inline-flex;
}

body[data-settings-page="seats"] #positionNamesCard,
body[data-settings-page="install"] #installCard,
body[data-settings-page="account"] #accountCard {
  display: grid;
}

/* The dictation select keeps its markup; its label takes the rows' voice and the group's rule above it. */
.set-group .voice-settings {
  padding: var(--s-3) 0;
  border-top: 1px solid var(--line);
}

.set-group .voice-settings label > span {
  color: var(--ink);
  font-size: var(--t-body);
  font-weight: 400;
}

/* You: the face and the name on one line. The empty face is the button that adds a photo. */
.set-self {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0 0;
  border-top: 1px solid var(--line);
}

.set-self .player-photo-preview.is-empty {
  cursor: pointer;
  border: 1px dashed var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--t-figure);
  font-weight: 400;
}

.set-self-actions {
  padding-top: var(--s-2);
}

/* The links of the last groups: one line, the thumb's height each. */
.set-group > .settings-links {
  border-top: 1px solid var(--line);
  padding-top: var(--s-1);
}

.set-foot {
  display: grid;
  gap: var(--s-1);
  padding-top: var(--s-2);
  border-top: 1px solid var(--line);
}

/* The erase: its consequence, then its button, last on the page and with no title of its own. */
.set-danger {
  gap: var(--s-3);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  justify-items: start;
}

/* A long name on a narrow phone at large text breaks into two lines instead of leaving the column. */
.set-danger .danger-button {
  max-width: 100%;
  padding-block: var(--s-2);
  text-align: left;
}

/* The install guide (install-guide.js), in the app's Settings and on the landing: one chip with the
   glyph the phone shows, one short line each. The tokens are the app's, which the landing loads too. */
.install-guide {
  display: grid;
  gap: 12px;
}

.install-guide.is-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg, 12px);
  background: var(--surface);
  padding: 16px;
}

.install-guide-title {
  margin: 0;
  font-size: var(--t-control);
}

.install-guide-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.install-guide-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 0;
  color: var(--ink);
  font-size: var(--t-control);
  line-height: 1.4;
}

.install-guide-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-small);
  line-height: 1.4;
}

.install-guide-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--r, 10px);
  background: var(--surface-2);
  color: var(--accent-dark);
}

.install-guide-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}

/* Inside another app: one line saying so, then the two ways out side by side. */
.install-guide-lead {
  margin: 0;
  color: var(--ink);
  font-size: var(--t-body);
  line-height: 1.4;
}

.install-guide-actions {
  display: flex;
  gap: 8px;
}

.install-guide-actions .install-guide-button {
  flex: 1;
  min-height: 48px;
}

/* On a computer: the code the phone's camera reads, white because a code needs its quiet zone. */
.install-guide-qr {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 144 px box, 6 px padding: 132 px of code is 4 px a module, so the edges stay crisp. */
.install-guide-qr img {
  flex: none;
  width: 144px;
  height: 144px;
  padding: 6px;
  border-radius: 8px;
  background: #fff;
}

.install-guide-qr .install-guide-text {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-size: var(--t-control);
  line-height: 1.4;
}

/* The step to try by hand, lit when the open button seemed to do nothing. */
.install-guide-step.is-hint {
  border-radius: var(--r, 10px);
  background: var(--surface-2);
  padding: 4px;
}

/* The address shown for copying by hand, when nothing could copy it. */
.install-guide-address {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r, 10px);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
}

/* The clipboard fallback's field: selected so the browser can copy it, never seen. */
.install-guide-copybox {
  position: fixed;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* Home's install card: the guide in its frame, with a way to put it away. */
.home-install {
  position: relative;
}

.home-install .install-guide-title {
  padding-right: 2.75rem;
}

.home-install-close {
  position: absolute;
  top: .35rem;
  right: .35rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  line-height: 1;
}

/* Home backup nudge — amber "act now" card under the intro. */

/* Attention without alarm: a gold rail on a quiet row, never a filled box. */
.backup-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 0;
}

.backup-nudge-text {
  display: grid;
  gap: 2px;
}

.backup-nudge-text span {
  color: var(--muted);
  font-size: var(--t-note);
}

/* The caution is the alert glyph in the title, the same as every caveat's. */
.backup-nudge-text strong::before {
  content: "";
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  margin-right: .45em;
  vertical-align: -.2em;
  background-color: var(--gold);
  -webkit-mask: var(--glyph-alert) center / contain no-repeat;
  mask: var(--glyph-alert) center / contain no-repeat;
}

.backup-nudge-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Below the card's threshold: one quiet line, no frame, until the first export. */
.backup-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--muted);
  font-size: var(--t-note);
}

.backup-line-export {
  flex-shrink: 0;
  min-height: 44px;
}

/* The warm-up's one door, off: a text line under the start button, the same
   size and ink as the line that turns it off under the warm-up. */
.routine-nudge {
  display: flex;
  justify-content: center;
}

.routine-nudge .routine-nudge-on {
  min-height: 44px;
  font-size: var(--t-small);
  color: var(--muted);
}

/* The last session under the start button: Home's status row, ruled above instead
   of below because nothing follows it on this screen. */
.session-last {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

/* "Hands from: <session>" banner above the Saved list. */

.hand-session-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 12px;
}

.session-filter-label {
  color: var(--muted);
  font-size: var(--t-note);
}

/* "View hands (N)" link at the foot of a session history card. */

.session-hands-link {
  display: inline-flex;
  margin-top: 6px;
}

.file-button input {
  display: none;
}

.search-field,
.player-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: var(--t-note);
  font-weight: 700;
}

.search-field {
  margin: 18px 0 12px;
  position: relative;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 11px;
  color: var(--ink);
  background: var(--surface);
}

select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 1px 2px rgba(18, 31, 25, .03);
  transition: border-color .15s ease,
    box-shadow .15s ease,
    background .15s ease;
}

/* The green line marks the active field; the RING is what :focus-visible draws,
   and these rules must not cancel it. A translucent glow alone measured 1.48:1. */
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

textarea {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 1px 2px rgba(18, 31, 25, .03);
  transition: border-color .15s ease,
    box-shadow .15s ease,
    background .15s ease;
  resize: vertical;
  line-height: 1.55;
}

.filter-row {
  flex-wrap: wrap;
  margin-bottom: 14px;
  gap: 7px;
}

.filter-pill {
  padding: 7px 10px;
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--r-pill);
  color: var(--muted);
  background: var(--surface);
  font-size: var(--t-small);
  font-weight: 700;
  transition: background .15s ease,
    border-color .15s ease,
    color .15s ease;
}

.filter-pill.active {
  color: var(--accent-dark);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--accent-soft);
}

/* No inner scroll: on a phone the page must win the gesture, so the list is as
   tall as it is. */
.player-list {
  display: grid;
  padding-right: 4px;
  gap: 9px;
}

.player-card {
  display: grid;
  gap: 9px;
  width: 100%;
  text-align: left;
  color: var(--ink);
  cursor: grab;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(18, 31, 25, .04);
  transition: transform .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
  padding: 14px;
  border-radius: var(--r-lg);
}

.player-card:active {
  cursor: grabbing;
}

.player-card.dragging {
  opacity: 0.58;
  transform: scale(0.985);
}

.player-card.active {
  border-color: var(--accent);
}

.player-card header,
.player-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.player-card strong {
  overflow-wrap: anywhere;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag,
.style-badge,
.confidence-badge {
  border-radius: var(--r-pill);
  padding: 4px 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 700;
}

.confidence-badge,
.tag {
  border-radius: var(--r-pill);
  /* A pill is one line; "confianza media" broke in two beside a long stat line. */
  white-space: nowrap;
}

/* Hand tags: editor presets, Saved filter row, card chips, review star. */

.tag-presets {
  display: flex;
  flex-wrap: wrap;
  margin-top: 6px;
  gap: 7px;
}

.tag-preset {
  padding: 4px 10px;
  cursor: pointer;
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--r-pill);
  color: var(--muted);
  background: var(--surface);
  font-size: var(--t-small);
  font-weight: 700;
  transition: background .15s ease,
    border-color .15s ease,
    color .15s ease;
}

.tag-preset:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  margin: 4px 0 10px;
  gap: 7px;
}

.tag-filter-chip {
  padding: 5px 11px;
  cursor: pointer;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--r-pill);
  color: var(--muted);
  background: var(--surface);
  font-size: var(--t-small);
  font-weight: 700;
  transition: background .15s ease,
    border-color .15s ease,
    color .15s ease;
}

.tag-filter-chip.active {
  color: var(--accent-dark);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--accent-soft);
}

/* Only the clickable tag grows to tap height; .tag shares its padding with
   badges nobody taps. */
.tag-clickable {
  cursor: pointer;
  border: 1px solid transparent;
  padding-top: 8px;
  padding-bottom: 8px;
}

.tag.tag-active {
  background: var(--accent-fill);
  color: #fff;
}

.hand-review-toggle.active {
  color: var(--accent-dark);
}

/* Replay scrubber under the felt. */

/* Street ticks drawn from the steps' own street, so they cannot disagree with
   the frames they mark. */

.replay-scrub-row {
  position: relative;
  padding: 8px 2px 2px;
}

.replay-scrub-ticks {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 8px;
  height: 44px;
  pointer-events: none;
}

.replay-scrub-ticks span {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 12px;
  margin-top: -6px;
  border-radius: 1px;
  background: hsla(41, 70%, 65%, 0.55);
}

.replay-scrub {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  height: 44px;
  min-height: 0;
  padding: 0;
  border: 0;
  -moz-appearance: none;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.style-badge {
  color: #fff;
  background: var(--accent-dark);
  border-radius: var(--r-pill);
}

.player-card p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--t-note);
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* A label line (VPIP Alto · PFR Medio · 3B Bajo) beside the confidence pill: at the
   label step it shares the row with the pill; at 14 px both wrapped, measured. */
.mini-stats {
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 700;
}

/* A pill in the felt's corner: the label and the count, one tap target. */
.seat-control {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 4px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 700;
}

/* The felt's other corner, across from the seat count: the same pill. */
#liveNewTableBtn {
  position: absolute;
  top: 0;
  left: 0;
  min-height: 44px;
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: var(--t-note);
}

.seat-control select {
  width: auto;
  min-width: 3.6rem;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--t-body);
  font-weight: 700;
}

/* Pure layout, no chrome: the border, background and shadow used to be granted
   with the database and editor panels 1300 lines up and taken straight back here.
   The view rules above outrank this by specificity, so they still do the showing. */

.session-panel,
.stats-panel {
  display: none;
  gap: 14px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  box-shadow: none;
}

/* Restores the panel's grid gap for children one level deeper. */

.stats-results {
  display: grid;
  gap: 14px;
}

/* Four selectors that used to be dealt chrome three times and stripped of it once.
   .session-history-card is not here: it defines itself in full further down. */

/* A section of the Mindset tab, not a card: its heading and rows stand on the page,
   and a hairline parts one section from the next. */
.mindset-card {
  display: grid;
  gap: 12px;
}

.mindset-card + .mindset-card {
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* Only the Full review disclosure lives here, and closed it is a line of text:
   no box around a line. */
.active-session-card {
  display: grid;
  gap: 12px;
}

.session-form,
.routine-block {
  display: grid;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  box-shadow: none;
}

.session-form {
  gap: 14px;
}

.routine-block {
  gap: 12px;
}

.session-grid,
.score-row,
.end-session-grid,
.stats-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.emotion-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.emotion-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px;
  color: var(--ink);
  background: var(--surface);
  font-size: var(--t-note);
  font-weight: 700;
}

.emotion-grid input {
  accent-color: var(--accent);
}

.session-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.score-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.end-session-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.session-form label,
.routine-block label,
.end-session-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: var(--t-note);
  font-weight: 700;
}

/*!important: STATE rules, and some nodes are styled by #id whose specificity
   would leak cash fields into tournament mode. */

.session-type-cash [data-session-field="tournament"],
.session-type-cash [data-end-field="tournament"],
.session-type-tournament [data-session-field="cash"],
.session-type-tournament [data-end-field="cash"] {
  display: none !important;
}

.stakes-hint {
  margin: 0;
  font-size: var(--t-note);
  color: var(--muted);
}

.stakes-hint.is-bad {
  color: var(--red);
}

/* The refusal under a tournament's blinds spans the form's two columns. */
#startBlindsHint {
  grid-column: 1 / -1;
}

.routine-mode-quick .full-routine-field {
  display: none;
}

.active-session-card.empty {
  color: var(--muted);
  border-style: dashed;
  padding: 18px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.session-history-card header,
.mindset-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* A place typed as one long word breaks inside the card instead of widening the page. */
.session-history-card h3,
.mindset-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

/* The app's history rows. The landing renders the same <details>, open, as its
   sample of a closed session. */
.session-history-card.is-row > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 4px 0;
  cursor: pointer;
  list-style: none;
}

.session-history-card.is-row > summary::-webkit-details-marker {
  display: none;
}

.session-history-card.is-row > summary header {
  flex: 1;
  align-items: center;
}

.session-history-card.is-row .session-stamp {
  font-family: var(--font-note);
  font-size: var(--t-body);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* A row is a line, not a card: a hairline above it, nothing at its sides. The
   date leads in the ink (it is what changes per row), the place follows muted. */
.session-history-card.is-row {
  padding: var(--s-2) 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.session-history-card.is-row .eyebrow {
  margin: 0 0 2px;
  font-size: var(--t-note);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.session-history-card.is-row .session-stamp.up { color: var(--accent-dark); }
.session-history-card.is-row .session-stamp.down { color: var(--red); }

.session-history-card.is-row h3 {
  font-family: var(--font-ui);
  font-size: var(--t-note);
  font-weight: 400;
  color: var(--muted);
}

.session-history-card.is-row[open] > summary {
  margin-bottom: 10px;
}

.session-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

/* A measure, not a box: a hairline above each tile replaces a border inside an
   already bordered card. No background: a tile sits on several parents. */
.metric-tile {
  display: grid;
  gap: 2px;
  align-content: start;
  min-height: 68px;
  padding: 9px 10px 10px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.metric-tile span {
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* Notation: mono voice, tabular figures so a column lines up on the decimal. */
/* A monospace space is a full character wide, so "200 BB" reads as two columns;
   pull it back while the digits stay tabular. */
.metric-tile strong {
  font-family: var(--font-note);
  font-size: var(--t-figure);
  font-weight: 600;
  letter-spacing: -.02em;
  word-spacing: -.22em;
  font-variant-numeric: tabular-nums;
}

/* Set by JS only when there is a sign: a duration or count is not a result. */
.metric-tile strong.up { color: var(--accent-dark); }
.metric-tile strong.down { color: var(--red); }

/* The hours behind a rate: the tile's quiet voice, no capitals, under the figure. */
.metric-tile .metric-note {
  color: var(--muted);
  font-size: var(--t-small);
}

.post-routine-form {
  display: grid;
  gap: 10px;
}

.session-list,
.mindset-content {
  display: grid;
  gap: 10px;
}

.session-list {
  gap: 9px;
}

/* ---- Mind vs results insight ---- */

/* The mind's glyph says "a remark about the numbers above"; nothing frames it. */
.stats-insight {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
}

.insight-icon {
  font-size: var(--t-title);
  line-height: 1;
}

.insight-text {
  font-size: var(--t-body);
  font-weight: 700;
  line-height: 1.4;
}

.form-hint {
  margin: 8px 0 0;
  font-size: var(--t-note);
  font-weight: 600;
  color: var(--muted);
}

/* Two numeric fields (SB / BB): no "/" to hunt for on a phone keypad. */

.blinds-pair {
  display: flex;
  align-items: center;
  gap: 8px;
}

.blinds-pair input {
  width: 100%;
  min-width: 0;
}

.blinds-sep {
  color: var(--muted);
  font-weight: 700;
}

/* ---- Bankroll tracker ---- */

/* A card is for an object (hand, rival, session); a section of a screen is
   space, a hairline and a label. Same rule as .stats-insight. */
.bankroll-panel {
  display: grid;
  gap: 14px;
  --bankroll-hero: 1;
  border: 0;
  background: none;
  box-shadow: none;
  padding: 4px 0 0;
  border-radius: 0;
}

.bankroll-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.bankroll-head h3 {
  margin: 2px 0 0;
  font-size: var(--t-section);
}

.bankroll-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* The mental toggle says what it draws: a word before three renderings. */
.mental-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.segmented {
  display: inline-flex;
  overflow: hidden;
  gap: .25rem;
  padding: .25rem;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--r-pill);
  background: var(--surface-2);
}

.segmented button {
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  /* 44 px: the smallest target a finger hits without touching the neighbour. */
  min-width: 44px;
  min-height: 44px;
  border-width: 0;
  padding-left: .875rem;
  padding-right: .875rem;
  font-size: var(--t-small);
  line-height: 1rem;
  /* 600: the selected item is marked by its fill, not by weight. */
  font-weight: 600;
  border-radius: var(--r-pill);
  color: var(--muted);
  background: transparent;
  padding-left: .8rem;
  padding-right: .8rem;
}

/* Selected must be BRIGHTER, not darker: a darker fill reads as disabled.
   No accent colour — a chosen filter is not "you" or money. */
.segmented button.active {
  color: var(--ink-bright, var(--ink));
  background: var(--surface-3);
  box-shadow: none;
}

/* ---- Toasts ---- */

#toastHost {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-space) + .5rem);
  transform: translateX(-50%);
  z-index: var(--z-toast);
  width: max-content;
  max-width: calc(100vw - 28px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  font-size: var(--t-control);
  font-weight: 700;
  animation: toastIn 0.22s ease-out;
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--surface-3) 94%, transparent);
  color: var(--ink);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* The clip's pace in the share sheet, between the link row and the two clips it sets. */
.share-pace {
  margin: 4px 0 10px;
}

/* A toast with a button keeps its height: the 44 px button takes the padding's room. */
.toast:has(button) {
  padding-block: 4px;
}

.toast button {
  min-height: 44px;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: var(--t-control);
  cursor: pointer;
  padding: 4px 6px;
  color: var(--accent-dark);
}

@keyframes toastIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---- End-session bottom sheet ---- */

#endSheetBackdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  background: rgba(8, 14, 12, 0.45);
}

/* z-index 79: directly under #cardPicker (80). */
#cardPickerBackdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  background: rgba(8, 14, 12, 0.45);
}

#endSheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: var(--z-sheet);
  width: min(460px, 100vw);
  box-sizing: border-box;
  display: grid;
  gap: 10px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface);
  animation: surface-enter .2s ease-out both;
}

.end-sheet-title {
  font-size: var(--t-section);
}

#endSheet label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--t-note);
  font-weight: 700;
}

#endSheet.session-type-cash [data-end-field="tournament"],
#endSheet.session-type-tournament [data-end-field="cash"] {
  display: none !important;
}

.end-sheet-delta {
  margin: 0;
  min-height: 1.1em;
  color: var(--accent-dark);
  font-size: var(--t-control);
  font-weight: 700;
}

.end-sheet-delta.negative {
  color: var(--red);
}

/* Green means "you won". A note about what will NOT be recorded is neither a
   win nor a loss, so it takes the neutral of the three-state verdict. */
.end-sheet-delta.neutral {
  color: var(--muted);
  font-weight: 700;
}

/* Multi-day escape hatch: clearly not "end" — the session pauses for Day 2. */

.end-sheet-still-in {
  width: 100%;
  justify-content: center;
  margin-bottom: 2px;
}

.end-sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.end-sheet-actions .ghost-button {
  margin-right: auto;
}

/* ---- Hand-saved bottom sheet ---- */

#handSavedSheetBackdrop,
#shareLinkSheetBackdrop,
#shareSheetBackdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  background: rgba(8, 14, 12, 0.45);
}

#handSavedSheet,
#shareLinkSheet,
#shareSheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: var(--z-sheet);
  width: min(460px, 100vw);
  box-sizing: border-box;
  display: grid;
  gap: 12px;
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface);
  animation: surface-enter .2s ease-out both;
}

.saved-sheet-actions {
  display: grid;
  gap: 8px;
}

.saved-sheet-actions button {
  width: 100%;
}

.saved-sheet-actions button svg {
  width: 18px;
  height: 18px;
}

/* One row, one outcome: the link, a 1:1 clip, a 9:16 clip. The fact that decides
   sits under the name (the line the page opens with and how long the link lives; where a clip goes). */
.share-row {
  justify-content: flex-start;
  text-align: left;
  min-height: 58px;
  padding: 8px 14px;
  gap: 12px;
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface-2);
}

.share-row svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--accent-dark);
}

.share-row span {
  display: grid;
  gap: 2px;
  line-height: 1.2;
}

.share-row strong {
  font-size: var(--t-body);
  font-weight: 600;
}

.share-row small {
  font-size: var(--t-note);
  font-weight: 600;
  color: var(--muted);
}

.share-sheet-hand {
  margin: -6px 0 0;
}

/* Off on every open: the felt goes out with positions unless this box says otherwise. */
.share-names {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: var(--t-control);
  min-height: 44px;
}

.share-names input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

/* Deleting a link takes the whole sheet: nothing else to read while deciding. */
#shareSheet.unlinking > :not(.share-unlink-confirm) {
  display: none;
}

.share-unlink-confirm {
  display: grid;
  gap: 12px;
}


/* ---- Card picker (bottom sheet) ---- */

#cardPicker {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: var(--z-sheet);
  width: min(460px, 100vw);
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface);
  animation: surface-enter .2s ease-out both;
}

.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.picker-head strong {
  font-size: var(--t-body);
}

.picker-tools {
  display: flex;
  gap: 6px;
}

.picker-grid {
  display: grid;
  gap: 6px;
}

.picker-grid.ranks {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.picker-grid.suits {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* ---- Cloudflare Turnstile ----
   Created by app.js. Above everything: a blocking question the parse waits on.
   Centred so it never lands on the bottom nav. pointer-events stays OFF until
   it has something to ask — an invisible box that swallows taps is worse. */

#turnstile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(4, 8, 7, 0.72);
  /* Dims, never traps: a div defaults to pointer-events: auto and would swallow
     every tap meant for the app. The widget keeps its own. */
  pointer-events: none;
}

#turnstile-holder {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  pointer-events: none;
}

#turnstile-holder[data-interactive="1"] {
  pointer-events: auto;
}

/* The only rule that hides the widget (the holder has no visibility/display
   otherwise). Keyed on data-retired, NOT data-interactive="0": that is also an
   invisible challenge still deciding, and hiding it breaks it. */
#turnstile-holder[data-retired="1"] {
  visibility: hidden;
}

/* ---- Framing a photo ---- Above every other sheet (86/87), below the toast (90). */

#photoFramerBackdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  background: rgba(8, 14, 12, 0.45);
}

#photoFramer {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: var(--z-sheet);
  width: min(460px, 100vw);
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface);
  animation: surface-enter .2s ease-out both;
}

.framer-hint {
  margin: 0 0 10px;
  font-size: var(--t-small);
  color: var(--muted);
}

/* Shrink-wraps the image so the overlay is positioned against the picture.
   overflow: hidden is load-bearing: the circle's dim is a huge spread shadow. */
/* fit-content + auto margins, not inline-block, so the photo is centred. */
.framer-stage {
  position: relative;
  display: block;
  width: fit-content;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--r-lg);
  line-height: 0;
  cursor: grab;
  /* touch-action: none, or the browser claims a vertical drag as a scroll and
     cancels ours. user-select: none stops selection flicker under the finger. */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.framer-stage.is-dragging {
  cursor: grabbing;
}

/* The slider makes the drag work: at zoom 1 the short axis has zero spare.
   44px tall; label beside it so the sheet does not grow a row. */
.framer-zoom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px auto 0;
  width: fit-content;
  max-width: 100%;
}

.framer-zoom label {
  font-size: var(--t-micro);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.framer-zoom input[type="range"] {
  width: 220px;
  max-width: 60vw;
  height: 44px;
  accent-color: var(--accent);
  /* Must NOT claim its pointers, or the slider dies when a finger drifts off-axis. */
  touch-action: pan-x;
}

/* Both axes auto with both maxima: the element box must BE the painted picture,
   since tap coordinates are measured against it. */
.framer-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 46vh;
}

/* The dim is the whole explanation; a lighter one vanished on dark photos. */
.framer-window {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(4, 8, 7, 0.78);
  pointer-events: none;
  /* No transition, ever: repositioned every frame while a finger is down, and
     this file computes transition-property: all onto <html>/<body>. */
  transition: none;
}

.picker-key {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--t-body);
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  border-radius: var(--r-sm);
}

.picker-key:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.picker-key.suit-red {
  /* Not --card-red: that value is tuned as ink on a white card face, and this key
     sits on a dark panel, where it needs the extra light. Two floors, one idea. */
  color: #d23c3c;
}

.picker-key.picker-back {
  background: transparent;
  color: var(--muted);
}

/* ---- Chips (1-tap choices) ---- */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 10px 16px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--r-pill);
  color: var(--muted);
  background: var(--surface);
  font-size: var(--t-small);
  font-weight: 700;
  transition: background .15s ease,
    border-color .15s ease,
    color .15s ease;
}

.chip:hover {
  border-color: var(--accent);
}

.chip.active {
  color: var(--accent-dark);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--accent-soft);
}

/* ---- Collapsible sections (fewer visible forms) ---- */

/* Closed, a disclosure is a line of text with a chevron, not a box: nothing in it
   is an object yet. Open, it becomes the box that holds its form. */
.collapse {
  display: grid;
  gap: 10px;
  padding: 4px 0;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  border-radius: var(--r-lg);
}

/* display: grid on a <details> host broke closed-state hiding in older
   engines; hide closed content explicitly. */

.collapse:not([open]) > :not(summary) {
  display: none;
}

/* Closed, the row is its summary alone: the engine's empty content slot still
   took a grid gap, and two closed rows stood a gap apart for nothing. */
.collapse:not([open]) {
  gap: 0;
}

.collapse > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 2px;
  font-size: var(--t-note);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

.collapse > summary::-webkit-details-marker {
  display: none;
}

/* A drawn chevron, not a text triangle: two borders of a small square, turned. It
   points right closed and down open, and it needs no glyph the font may lack. */
.collapse > summary::before {
  content: "";
  flex: 0 0 auto;
  width: .45em;
  height: .45em;
  margin: 0 .35em 0 .15em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-.1em) rotate(-45deg);
  color: var(--accent);
}

.collapse[open] > summary::before {
  transform: translateY(-.25em) rotate(45deg);
}

/* ---- Warm-up wizard (one question per card) ---- */

.routine-wizard:empty {
  display: none;
}

.wizard-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  padding: 16px;
  background: var(--surface);
  border-radius: var(--r-lg);
}

.wizard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wizard-head strong {
  font-size: var(--t-body);
}

.wizard-head span {
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 700;
}

.wizard-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wizard-chip {
  min-width: 52px;
  min-height: 46px;
  font-size: var(--t-body);
  text-align: center;
}

/* A face with its word under it: the glyph is the system's, the word is ours. */
.chip.has-word {
  display: inline-grid;
  justify-items: center;
  gap: 1px;
  padding: 5px 9px;
  line-height: 1.15;
}

.chip-face {
  font-size: var(--t-body);
}

.chip-word {
  font-size: var(--t-micro-tight);
  font-weight: 600;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.wizard-done {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  font-weight: 700;
  font-size: var(--t-control);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
}

/* ---- Warm-up gate + cool-down sheet ----
   Setup does not exist until the warm-up is answered; cool-down runs when a
   session ends. Both tap-only. */

#sessionSetupBlock {
  /* Keeps the 14px gap the pieces had as direct grid items of .session-form. */
  display: grid;
  gap: 14px;
}

/* Warm-up reads FIRST; the setup block is hidden meanwhile, then this collapses
   to a one-line "done" summary above the fields. */
#preRoutineBlock {
  order: -1;
}

.wizard-head .wizard-back {
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: var(--t-section);
  line-height: 1;
  cursor: pointer;
}

.wizard-head .wizard-back:hover {
  color: var(--ink);
}

.wizard-opt-out {
  justify-self: center;
  font-size: var(--t-small);
  color: var(--muted);
}

/* ---- Cool-down bottom sheet ---- */

#coolDownBackdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  background: rgba(8, 14, 12, 0.45);
}

#coolDownSheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: var(--z-sheet);
  width: min(460px, 100vw);
  box-sizing: border-box;
  display: grid;
  gap: 12px;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface);
}

.cooldown-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.cooldown-head strong {
  font-size: var(--t-section);
}

.cooldown-head span {
  color: var(--muted);
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
}

.cooldown-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: var(--t-small);
}

.cooldown-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Thumb-sized, because this is tapped standing up at the cage. */
.cooldown-chip {
  min-width: 56px;
  min-height: 50px;
  font-size: var(--t-body);
}

.cooldown-nav {
  display: flex;
  justify-content: flex-start;
}

.cooldown-done strong {
  display: block;
  font-size: var(--t-section);
}

.cooldown-done p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--t-note);
}

.session-review-link,
.mindset-pending .secondary-button {
  justify-self: start;
}

.mindset-pending {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
}

/* ---- The routine editor ----
   Order IS priority (no separate field). Arrows, not drag: untestable and a
   fight at 412px. */

.routine-rows {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Rows with a hairline between them, not a box per line with a box per control. */
.routine-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border-bottom: 1px solid var(--line);
}

.routine-row-text {
  flex: 1;
  min-width: 0;
  /* Plain text until touched: the field line shows on focus, and the text keeps
     the left edge of the heading above it. */
  margin-left: -8px;
  padding: 8px;
  font: inherit;
  font-size: var(--t-note);
  line-height: 1.35;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  /* A textarea that sizes to its text: one row, two when the question needs them. */
  resize: none;
  overflow: hidden;
  field-sizing: content;
  max-height: calc(2 * 1.35em + 18px);
}

.routine-row-controls {
  display: flex;
  flex: none;
  gap: 3px;
}

/* The 44px floor for a thumb control: a routine line's three buttons and an entry's remove. */
.routine-row-btn,
.rebuy-remove {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: var(--t-control);
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
}

.routine-row-btn:hover:not(:disabled) {
  color: var(--ink);
}

.routine-row-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.routine-row-remove:hover:not(:disabled),
.rebuy-remove:hover {
  color: var(--danger);
}

.routine-add {
  display: flex;
  gap: 6px;
}

.routine-add-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font: inherit;
  font-size: var(--t-note);
  color: var(--ink);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
}

.routine-cap {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-small);
}

.routine-ideas > summary {
  cursor: pointer;
  padding: 4px 0;
  color: var(--muted);
  font-size: var(--t-small);
}

.routine-idea-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 6px;
}

.routine-idea {
  font-size: var(--t-small);
  text-align: left;
}

.routine-reset {
  justify-self: start;
  font-size: var(--t-small);
}

/* Your own reminders: read, not answered, so quiet. */
.warmup-reminders {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: var(--t-small);
}

.cooldown-prompts-label {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 700;
}

#coolDownSheet .routine-list {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-small);
}

/* ---- Edit-session bottom sheet ---- */

/* The Mesa sheet and its backdrop share the edit-session sheet's shape. */
#tableSheetBackdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  background: rgba(8, 14, 12, 0.45);
}

#seatSheetBackdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  background: rgba(8, 14, 12, 0.45);
}

#seatSheet,
#tableSheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: var(--z-sheet);
  width: min(460px, 100vw);
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface);
}

.table-sheet-title {
  font-size: 1.12rem;
}

/* New table keeps its 44 px target without making the title's row taller. */
.table-sheet-head .ghost-button {
  margin-block: -10px;
}

.table-sheet-label {
  color: var(--muted);
  font-size: var(--t-control);
}

/* Nine sizes do not fit a phone at 44 px a chip: two rows of five and four. */
.table-sheet-chips {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.table-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table-sheet-chips .chip {
  padding: 0;
  justify-content: center;
}

.table-sheet-stack {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-sheet-stack input {
  width: 120px;
  min-height: 48px;
  font-size: 1.2rem;
  font-weight: 700;
}

.table-sheet-others {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* The straddle's size, inside its chip row; it wraps under the chips on a narrow phone. */
.table-sheet-inline-size {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.table-sheet-inline-size input {
  width: 64px;
  min-height: 44px;
}

.table-sheet-seats {
  display: grid;
  gap: 8px;
}

.table-sheet-seat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.table-sheet-seat input {
  width: 110px;
  min-height: 44px;
}

.table-sheet-note {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-note);
}

/* On a short phone the sheet scrolls under Done, which stays at its foot. The band is
   --surface spelled out (rgb 26 21 17): the sheet itself, not a light. */
#tableSheet > .primary-button:last-child {
  position: sticky;
  bottom: 0;
  box-shadow: 0 0 0 10px rgb(26, 21, 17), 0 24px 0 10px rgb(26, 21, 17);
}

.table-line {
  min-width: 0;
  color: var(--muted);
  font-size: var(--t-control);
  line-height: 1.35;
}

#editSessionBackdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-backdrop);
  background: rgba(8, 14, 12, 0.45);
}

#editSessionSheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: var(--z-sheet);
  width: min(460px, 100vw);
  box-sizing: border-box;
  display: grid;
  gap: 12px;
  /* The sheet is taller than the cool-down one and datetime pickers push it
     further; it scrolls inside itself rather than under the viewport. */
  max-height: 88vh;
  overflow-y: auto;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface);
}

.edit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.edit-head strong {
  font-size: var(--t-section);
}

.edit-head span {
  color: var(--muted);
  font-size: var(--t-note);
}

.edit-form {
  display: grid;
  gap: 10px;
}

.edit-field {
  display: grid;
  gap: 4px;
}

.edit-field > span {
  font-size: var(--t-small);
  color: var(--muted);
}

.edit-field small {
  font-size: var(--t-note);
  color: var(--muted);
}

/* The entries' title is not a label, so it takes the labels' weight itself. */
.edit-rebuys > span {
  font-weight: 700;
}

.edit-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.edit-error {
  margin: 0;
  font-size: var(--t-note);
  color: var(--red);
}

.edit-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.edit-delete {
  justify-self: start;
}

.session-edit-link {
  justify-self: start;
}

.starting-point-offer {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.starting-point-offer p {
  margin: 0;
  font-size: var(--t-note);
  color: var(--muted);
}

.starting-point-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.import-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.import-row > span {
  font-size: var(--t-small);
  color: var(--muted);
}

.import-row > strong {
  font-variant-numeric: tabular-nums;
}

.import-row > small {
  grid-column: 1 / -1;
  font-size: var(--t-note);
  color: var(--muted);
}

.bankroll-chart {
  display: grid;
  gap: 6px;
}

.line-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-baseline {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.55;
}

/* viewBox UNITS, not CSS px, hence a bare number: the svg is viewBox 320 at
   width: 100%. A rem would be reinterpreted as user units and need ~21% of
   the chart for a gutter at 150% text — a chart redesign, not a font size. */
.chart-tick,
.chart-xtick {
  fill: var(--muted);
  font-size: var(--t-small);
  font-weight: 700;
  font-family: inherit;
}

.chart-end {
  font-size: var(--t-note);
  font-weight: 700;
  font-family: inherit;
}

.bankroll-empty,
.bankroll-note,
.bankroll-sub {
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 700;
}

.bankroll-sub {
  margin: 4px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: var(--t-micro);
}

.bankroll-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.bankroll-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 700;
}

.bankroll-legend i {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

.bankroll-legend i.dashed {
  background: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 9px) !important;
}

.session-history-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 14px;
  border-radius: var(--r-lg);
}

.session-history-card p,
.mindset-card p {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-note);
  line-height: 1.45;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.routine-pill {
  border: 1px solid var(--line);
  padding: 6px 9px;
  color: var(--ink);
  background: var(--surface);
  font-size: var(--t-small);
  font-weight: 700;
  border-radius: var(--r-pill);
}

.routine-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.routine-list li {
  padding: 4px 0;
  color: var(--ink);
  font-size: var(--t-control);
  line-height: 1.35;
}

.live-panel {
  display: none;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  box-shadow: none;
}

.live-actions,
.live-seat-panel,
.rebuy-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px;
  background: var(--surface);
}

/* By id: the phone-width rule below folds every .rebuy-panel to one column, and
   this one stays a line at every width. */
#liveRebuyPanel {
  grid-template-columns: auto minmax(0, 1fr);
}

#liveRebuyPanel h3 {
  margin: 0;
  font-family: var(--font-ui);
}

#liveRebuyPanel .rebuy-controls {
  grid-template-columns: minmax(0, 1fr) auto;
}

/* The rebuys made so far, under the line, only once there is one: a row each, the
   hour, the amount and its remove. */
.rebuy-list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 14px;
  row-gap: 2px;
  margin: 0;
  color: var(--muted);
  font-size: var(--t-note);
  font-variant-numeric: tabular-nums;
}

/* The border and background are already the group's above; only these two differ. */

.live-seat-panel {
  border-radius: var(--r-lg);
  scroll-margin-bottom: calc(var(--nav-space) + 12px);
}

/* One line over the felt, no card: what is running with its facts under it, the
   clock, and End. The felt is the one object of colour on the screen. */
.live-session-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.live-session-id {
  flex: 1 1 auto;
  min-width: 0;
}

.live-session-id p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--t-small);
  overflow-wrap: anywhere;
}

.live-session-bar h2,
.live-seat-panel h3,
.rebuy-panel h3 {
  margin: 0;
}

/* What is running, with a live dot: the screen's name is in the topbar. */
.live-session-bar h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: var(--t-control);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

.live-session-bar h2::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-dark);
}

.live-seat-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.live-seat-avatar {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  background: var(--accent-fill);
  color: #fff;
  font-weight: 700;
  font-size: 1.4rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  border-radius: 50%;
}

/* Same fix as the avatars above; separate rule because it is a different size. */
.live-seat-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-timer-box {
  flex: none;
  display: grid;
  justify-items: end;
  color: var(--accent-dark);
}

/* Frozen clock reads as paused, not running. */

.live-timer-box.paused {
  border-color: rgba(214, 158, 46, 0.55);
}

.live-timer-box.paused strong {
  color: var(--paused);
}

.live-timer-box.paused span {
  color: var(--paused);
}

.live-timer-box span {
  color: var(--muted);
  font-weight: 700;
  font-size: var(--t-micro);
}

.live-timer-box strong {
  font-size: var(--t-figure);
  line-height: 1.2;
  /* Not the accent: green means you and winning (DESIGN section 4), and a clock is
     neither. The card's green rail already says the session is live. */
  color: var(--ink-bright);
  font-variant-numeric: tabular-nums;
}

/* The tournament's blinds beside Pause: the word, then an ordinary field at the
   button's height. The field keeps the 16 px every input has, or iOS zooms in. */
.live-level-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-level-box span {
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 700;
}

.live-level-box input {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  text-align: center;
}

.live-actions {
  /* Record hand across, and Pause beside the blinds under it only in a tournament. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* The one filled green of the screen, at the height a thumb finds. */
#liveRecordHandBtn {
  grid-column: 1 / -1;
  min-height: 3.5rem;
}

/* The felt stands on the page: no card around the one object of colour on the
   screen. position: relative seats the seats control in its corner. */
.live-table-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 520px;
  /* Room for the seats pill above the felt: over it, it covered seat 7. */
  padding-top: 48px;
}

.live-felt-table {
  position: relative;
  /* Seats anchor to an ellipse inset by these so they render inside the felt. */
  --seat-rx: 87px;
  --seat-ry: 55px;
  width: min(96%, 860px);
  aspect-ratio: 1.55;
  border: 12px solid #6b442b;
  border-radius: var(--r-pill);
  /* The replay felt's own drawing, rings gone: one table on every screen. */
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.12), transparent 42%),
    linear-gradient(145deg, var(--felt), var(--felt-dark));
  border-color: #39291f;
  outline: 1px solid rgba(198, 154, 85, .52);
  outline-offset: -6px;
  box-shadow: inset 0 0 0 7px hsla(0, 0%, 100%, .06),
    inset 0 0 68px rgba(0, 0, 0, .32),
    0 22px 54px rgba(9, 38, 29, .2);
}

.live-felt-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(56%, 180px);
  margin: 0;
  text-align: center;
  color: var(--ink);
  font-size: var(--t-note);
  line-height: 1.35;
  pointer-events: none;
}

.live-seat {
  position: absolute;
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 8px;
  align-items: center;
  width: clamp(118px, 16vw, 168px);
  min-height: 86px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  padding: 8px;
  color: #fff;
  transform: translate(-50%, -50%);
  border-width: 1px;
  border-color: hsla(0, 0%, 100%, .28);
  border-radius: var(--r-sm);
  background: rgba(13, 21, 17, .88);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .32);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Fuller tables push seats outward and shrink cards a step per seat, so
   clearance is maximised at every size. */

.live-felt-table[data-size="7"] {
  --seat-rx: 78px;
  --seat-ry: 49px;
}

.live-felt-table[data-size="7"] .live-seat {
  width: clamp(104px, 14vw, 146px);
  min-height: 74px;
}

.live-felt-table[data-size="8"] {
  --seat-rx: 72px;
  --seat-ry: 46px;
}

.live-felt-table[data-size="8"] .live-seat {
  width: clamp(96px, 12.5vw, 132px);
  min-height: 68px;
}

.live-felt-table[data-size="9"] {
  --seat-rx: 67px;
  --seat-ry: 43px;
}

.live-felt-table[data-size="9"] .live-seat {
  width: clamp(88px, 11.5vw, 122px);
  min-height: 64px;
}

.live-felt-table[data-size="10"] {
  --seat-rx: 63px;
  --seat-ry: 41px;
}

.live-felt-table[data-size="10"] .live-seat {
  width: clamp(82px, 10.5vw, 112px);
  min-height: 60px;
  padding: 6px;
}

.live-seat.empty {
  border-style: dashed;
  border-color: hsla(0, 0%, 100%, .16);
  background: rgba(13, 21, 17, .42);
}

.live-seat.selected {
  border-color: hsla(41, 70%, 65%, .9);
  background: rgba(12, 43, 34, .95);
  box-shadow: 0 0 0 3px hsla(41, 70%, 65%, .18), 0 8px 20px rgba(0, 0, 0, .32);
}

/* A playing style is not a win, a loss or money, so it takes none of the three
   colours that mean those. Six hues by taxonomy put red — the colour of losing —
   on "aggressive" and green on "balanced"; the word already says which style it
   is. The ring's information is only "there is a read on this seat", so it is one
   colour for all of them, and --blue is the token that carries no verdict. */

.live-seat[data-style] .seat-avatar {
  box-shadow: 0 0 0 3px var(--blue);
}

.style-badge[data-style] {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
}

.seat-avatar,
.player-avatar,
.player-photo-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  /* Containing block for the absolutely positioned photo (as a grid item its
     height: 100% did not resolve). The initials fallback stays a grid item. */
  position: relative;
  border-radius: 50%;
  background: var(--accent-fill);
  color: #fff;
  font-weight: 700;
}

.seat-avatar {
  grid-row: 1 / span 3;
  width: 34px;
  height: 34px;
}

/* Absolute + inset: 0. As a plain grid item the img's percentage height had
   nothing to resolve against, fell back to its own aspect, and object-fit/
   object-position were inert — portrait photos always showed their middle.
   Tests assert the geometry, not the style string. */
.seat-avatar img,
.player-avatar img,
.player-photo-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-seat strong,
.live-seat span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-seat .live-seat-number {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.68rem;
  font-weight: 700;
}

/* An open seat says its number once, in the avatar's ring, and the open word. */
.live-seat.empty .live-seat-number {
  display: none;
}

.live-seat .live-seat-stack {
  color: var(--stack-gold);
  font-weight: 700;
}

.live-seat .live-seat-read {
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--t-micro);
}

.live-seat-controls,
.rebuy-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(110px, 0.6fr) minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.live-seat-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 700;
}

/* Quick-read note spans the whole controls row and stays compact. */

#liveSeatNoteField,
#liveAnteHint {
  grid-column: 1 / -1;
}

/* Who a typed name may already be: the whole row, the question in bold. */
#liveSeatMatch {
  grid-column: 1 / -1;
}

#liveSeatMatch p {
  font-weight: 700;
}

#liveSeatNote {
  min-height: 42px;
  resize: vertical;
}

/* Unit toggle sits on its own row so it never disturbs the control grid. */

.live-stack-unit {
  grid-column: 1 / -1;
  justify-self: start;
}

.live-stack-unit button {
  padding: 5px 14px;
}

/* A labelled block with a line over it, not a card: nothing here is one object. */
.rebuy-panel {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  padding: var(--s-3) 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#liveStackPanel h3 {
  margin: 0;
  font-family: var(--font-ui);
}

.rebuy-controls {
  grid-template-columns: 140px auto;
}

/* Consent line: muted and small, a caution not an error. */
.photo-consent-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--t-small);
  line-height: 1.45;
}

/* The face and the two things you can do to it, on the page: a box around one
   avatar was a card holding a control. */
.photo-editor {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: start;
  gap: 12px;
  align-items: center;
}

/* The label is the picker button; the raw file input stays hidden but receives
   the forwarded click. */

.photo-pick-button {
  text-align: center;
}

.photo-pick-button input {
  display: none;
}

/* The preview is a <button> (opens the framer); strip the button chrome. */
.player-photo-preview {
  width: 58px;
  height: 58px;
  appearance: none;
  padding: 0;
  border: 2px solid transparent;
  font: inherit;
  cursor: pointer;
}

/* No photo, nothing to frame: the control is off and must LOOK off. The ring
   is the whole affordance. */
.player-photo-preview:disabled {
  cursor: default;
  border-color: transparent;
}

.player-photo-preview:enabled {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
}

.player-photo-preview:enabled:hover,
.player-photo-preview:focus-visible {
  border-color: var(--accent);
}

.player-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

.seat-number {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.7rem;
  font-weight: 700;
}

.seat-name {
  max-width: 100%;
  overflow: hidden;
  font-size: var(--t-control);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tabular figures but NOT the mono family: felt geometry is pinned to the pixel
   by tests and a monospace is wider per digit. */
.seat-stack {
  max-width: 100%;
  overflow: hidden;
  color: var(--stack-gold);
  font-size: var(--t-small);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-style {
  max-width: 100%;
  text-align: center;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--t-micro);
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Mixed case: the capitals did not fit a ten-seat plate on a 360 px phone. */
.seat-style.is-straddle {
  text-transform: none;
}

.player-form {
  display: grid;
  margin-top: 18px;
  gap: 14px;
}

.form-grid,
.stat-grid {
  display: grid;
  gap: 10px;
}

.form-grid {
  grid-template-columns: 1fr 1fr;
}

.stat-grid {
  grid-template-columns: repeat(3, 1fr);
}

.form-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .625rem;
}

/* "Like last time": the one loud block of a returning player's new-session screen. */
.like-last {
  display: grid;
  gap: 6px;
  margin: 0 0 var(--s-4);
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: var(--r-lg);
  background: var(--accent-soft);
}

.like-last-label {
  margin: 0;
  color: var(--accent-dark);
  font-size: var(--t-small);
  font-weight: 700;
}

.like-last-line {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: var(--t-section);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.like-last-or {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: var(--t-small);
}

/* An editor's Delete opens the footer row in red text, and the auto margin sends Save
   to the far end of the same row; Undo in the toast covers a slip. */
.form-actions > .danger-button {
  margin-inline-end: auto;
  padding-inline: 0;
  border-color: transparent;
  background: none;
}

.session-start-actions {
  justify-items: start;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 10px;
}

.hand-panel {
  display: grid;
  gap: 14px;
  border-radius: var(--r-sm);
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.hand-form {
  display: grid;
  gap: 14px;
}

.hand-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: var(--t-note);
  font-weight: 700;
}

/* The seat list stands on the page; the box it wore held no object. */
.hand-setup {
  display: grid;
  gap: 10px;
}

.live-hand-builder {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(13, 124, 102, 0.28);
  padding: 12px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  border-radius: var(--r-lg);
}

.builder-head,
.builder-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.builder-head p:last-child {
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--t-note);
  line-height: 1.35;
}

.builder-metrics {
  display: grid;
  gap: 3px;
  min-width: 116px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px;
  text-align: center;
  background: var(--surface);
}

.builder-metrics span {
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 700;
  text-transform: uppercase;
}

.builder-metrics strong {
  color: var(--gold);
  font-size: var(--t-section);
}

/* ---- Immersive live builder ---- */

.live-hand-builder.immersive {
  display: grid;
  gap: 14px;
}

.immersive-dealer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.immersive-dealer label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 700;
  flex: 1 1 200px;
}

.immersive-stage {
  padding: 16px;
  min-height: 92px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--r-lg);
}

.stage-empty,
.sequence-empty {
  color: var(--muted);
  font-size: var(--t-note);
  font-weight: 700;
  text-align: center;
  width: 100%;
}

.player-hands {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.player-hands-list {
  display: grid;
  gap: 8px;
}

.player-hand-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(18, 31, 25, .04);
  transition: transform .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
  border-radius: var(--r-lg);
}

.player-hand-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.player-hand-info strong {
  font-size: var(--t-body);
}

.player-hand-meta {
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 700;
}

.player-hand-replay {
  flex: 0 0 auto;
}

/* Observed per-rival stats (from your recorded hands) */

.observed-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.observed-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  padding: 6px 12px;
  background: var(--bg);
  border-radius: var(--r-pill);
}

.observed-pill span {
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 700;
  text-transform: uppercase;
}

.observed-pill strong {
  font-size: var(--t-note);
}

.live-stack-chart:empty {
  display: none;
}

.stage-toact {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.stage-pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--accent-fill);
  color: #fff;
  font-weight: 700;
  font-size: var(--t-section);
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.stage-who {
  display: grid;
  gap: 3px;
}

.stage-who strong {
  font-size: var(--t-section);
  line-height: 1.1;
}

.stage-who span {
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 700;
}

.stage-facing {
  display: grid;
  gap: 2px;
  text-align: right;
}

.stage-facing span {
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 700;
  text-transform: uppercase;
}

.stage-facing strong {
  color: var(--gold);
  font-size: var(--t-figure);
}

.stage-done {
  display: grid;
  gap: 3px;
  width: 100%;
}

.stage-done .eyebrow {
  color: var(--muted);
}

.stage-done strong {
  font-size: var(--t-section);
}

.stage-done span {
  color: var(--muted);
  font-size: var(--t-note);
  font-weight: 700;
}

.immersive-sizing {
  display: grid;
  grid-template-columns: 1fr 130px minmax(140px, 1fr);
  align-items: end;
  gap: 10px;
}

.immersive-sizing label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 700;
}

.sizing-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: end;
  min-height: 40px;
  align-content: end;
}

.sizing-chip {
  padding: 8px 12px;
  cursor: pointer;
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--r-pill);
  color: var(--muted);
  background: var(--surface);
  font-size: var(--t-small);
  font-weight: 700;
  transition: background .15s ease,
    border-color .15s ease,
    color .15s ease;
}

.sizing-chip:hover {
  color: var(--accent-dark);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--accent-soft);
}

.immersive-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

/* BB / Chips entry toggle in the hand recorder. */

.unit-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 2px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-lg);
}

.unit-toggle {
  display: inline-flex;
  gap: .25rem;
  padding: .25rem;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--r-pill);
  background: var(--surface-2);
}

.unit-toggle button {
  border: none;
  padding: 6px 16px;
  cursor: pointer;
  min-height: 2.25rem;
  border-width: 0;
  padding-left: .875rem;
  padding-right: .875rem;
  font-size: var(--t-small);
  line-height: 1rem;
  font-weight: 700;
  border-radius: var(--r-pill);
  color: var(--muted);
  background: transparent;
}

.unit-toggle button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(18, 31, 25, .12);
}

.unit-hint {
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 600;
}

/* Editable tournament blinds inline, so the chips↔BB scale is current. */

.unit-toggle-row .unit-level {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 9rem;
  min-width: 0;
}

.unit-level span {
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 700;
  text-transform: uppercase;
}

.unit-level input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 10px 6px;
  color: var(--ink);
  font-size: var(--t-body);
  font-weight: 700;
}

/* Until the entry unit is chosen this is a one-tap question with no default:
   a silent BB default misread chip amounts. */

.unit-question {
  margin: 0;
  font-size: var(--t-note);
  font-weight: 700;
}

.unit-toggle button small {
  display: none;
}

.unit-toggle-row.choosing {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  border-color: color-mix(in srgb, var(--gold) 52%, var(--line));
  background: var(--gold-soft);
}

.unit-toggle-row.choosing .unit-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: none;
  border-radius: 0;
  background: none;
  padding: 0;
}

.unit-toggle-row.choosing .unit-toggle button {
  display: grid;
  gap: 2px;
  justify-items: center;
  min-height: 56px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.unit-toggle-row.choosing .unit-toggle button strong {
  font-size: var(--t-section);
}

.unit-toggle-row.choosing .unit-toggle button small {
  display: block;
  color: var(--muted);
  font-size: var(--t-note);
  font-weight: 600;
}

.unit-toggle-row.choosing .unit-level {
  flex: none;
  justify-content: center;
}

/* "Choose" in the readiness list lands here; a short pulse marks the chooser. */

@keyframes unit-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
  50% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent);
  }
}

.unit-toggle-row.pulse {
  animation: unit-pulse 0.9s ease 2;
}

.immersive-action,
.immersive-primary {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  background: var(--surface);
  font-size: var(--t-body);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.12s ease;
}

.immersive-action:active,
.immersive-primary:active {
  transform: translateY(1px);
}

.immersive-primary {
  grid-column: 1 / -1;
  background: var(--accent-fill);
  color: #fff;
  border-color: var(--accent);
  border-radius: var(--r-sm);
}

.immersive-action.act-fold {
  border-color: rgba(200, 60, 60, 0.5);
  color: var(--act-fold);
}

.immersive-action.act-fold:hover {
  background: rgba(200, 60, 60, 0.1);
}

.immersive-action.act-check,
.immersive-action.act-call {
  border-color: rgba(13, 124, 102, 0.5);
  color: var(--accent-dark);
}

.immersive-action.act-check:hover,
.immersive-action.act-call:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.immersive-action.act-raise {
  border-color: var(--gold);
  color: var(--gold);
}

.immersive-action.act-raise:hover {
  background: color-mix(in srgb, var(--gold) 14%, var(--surface));
}

.immersive-action.act-allin {
  border-color: var(--act-allin);
  color: var(--act-allin);
}

.immersive-action.act-allin:hover {
  background: rgba(154, 59, 208, 0.1);
}

.immersive-sequence {
  display: grid;
  gap: 8px;
}

.sequence-street {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: start;
  gap: 10px;
}

.sequence-label {
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 700;
  text-transform: uppercase;
  padding-top: 4px;
}

.sequence-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sequence-chip {
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px 10px;
  background: var(--surface);
  font-size: var(--t-small);
  font-weight: 700;
}

.sequence-chip.act-fold {
  color: var(--act-fold);
  border-color: rgba(200, 60, 60, 0.35);
}

.sequence-chip.act-raise {
  color: var(--gold);
  border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
}

.sequence-chip.act-call,
.sequence-chip.act-check {
  color: var(--accent-dark);
  border-color: rgba(13, 124, 102, 0.35);
}

/* JS builds sequence-chip act-${type} and the all-in type is "allin", so this
   must be .act-allin. */

.sequence-chip.act-allin {
  color: var(--act-allin);
  border-color: rgba(154, 59, 208, 0.4);
}

.hand-seat-list {
  display: grid;
  gap: 8px;
}

.hand-seats-reset {
  justify-self: start;
}

.hand-player-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 4px;
}

.hand-player-pill {
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 7px 10px;
  color: var(--ink);
  background: var(--surface);
  font-size: var(--t-small);
  font-weight: 700;
  cursor: grab;
}

/* One line per seat; cards/showdown expand only when tapped. */

.hand-seat-row {
  display: grid;
  grid-template-columns: minmax(64px, auto) minmax(0, 1fr) 78px 92px;
  align-items: center;
  gap: 8px;
}

.hand-seat-row span {
  color: var(--muted);
  font-size: var(--t-note);
  font-weight: 700;
  white-space: nowrap;
}

.hand-seat-toggle {
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 700;
  padding: 8px 6px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.hand-seat-toggle.has-cards {
  color: var(--ink);
  border-color: var(--accent);
}

.hand-seat-row .stakes-hint {
  grid-column: 1 / -1;
}

.hand-seat-extra {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.board-entry {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  border-radius: var(--r-lg);
}

/* The felt stands on the page here too: one table, no box (the live screen's rule). */
.hand-visual-table {
  display: grid;
  place-items: center;
  min-height: 360px;
}

.mini-felt-table {
  position: relative;
  width: min(92%, 760px);
  aspect-ratio: 1.7;
  border: 10px solid #6b442b;
  /* A stadium, the table everywhere: straight rails, round ends of half the short side. */
  border-radius: var(--r-pill);
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.12), transparent 42%),
    linear-gradient(145deg, var(--felt), var(--felt-dark));
  border-color: #39291f;
  outline: 1px solid rgba(198, 154, 85, .52);
  outline-offset: -6px;
  box-shadow: inset 0 0 0 7px hsla(0, 0%, 100%, .06),
    inset 0 0 68px rgba(0, 0, 0, .32),
    0 22px 54px rgba(9, 38, 29, .2);
}

/* The replay felt's aspect lives OUTSIDE any media query: it is tall because of
   what is on it (hero's cards, board, pot down the centre), not the screen.
   1.7 above is the seat builder's. The phone block's [data-size] rules still
   win by order; the per-size rules below carry the same numbers everywhere. */
.mini-felt-table.replay-felt {
  aspect-ratio: .86;
  border-radius: var(--r-pill);
}

/* 7 is the only size whose ring did not fit: at .98 the felt is almost square,
   so the six outer seats sat shoulder to shoulder. A 360px phone is the binding
   case — there the old aspect still puts 42 pairs of hole cards on top of each
   other; a 412px felt has since grown enough to hide it. */
.mini-felt-table.replay-felt[data-size="7"] {
  aspect-ratio: .9;
}

.mini-felt-table.replay-felt[data-size="8"] {
  aspect-ratio: .88;
}

.mini-felt-table.replay-felt[data-size="9"] {
  aspect-ratio: .8;
}

.mini-felt-table.replay-felt[data-size="10"] {
  aspect-ratio: .74;
}

/* Ceiling for wide screens, capped BY WIDTH, not max-height: clamping height
   under a definite width makes the box violate its aspect-ratio and go flat.
   92% of the container, 520px on a monitor, 53vh so a short window is never
   outgrown (53vh wide = 62vh tall at .86). */
@media (min-width: 821px) {
  .mini-felt-table.replay-felt {
    width: min(92%, 520px, 53vh);
  }
}

/* A tucked hand stands above its plate, so up to six seats the table is taller than it was, and as tall on
   the screen as it was (62vh), never under 300px. 7-10 keep their aspects. A short window (a phone lying
   down) keeps the old table and scrolls, as it did. */
@media (min-width: 821px) and (min-height: 561px) {
  .mini-felt-table.replay-felt.tucked[data-size="2"],
  .mini-felt-table.replay-felt.tucked[data-size="3"],
  .mini-felt-table.replay-felt.tucked[data-size="4"],
  .mini-felt-table.replay-felt.tucked[data-size="5"],
  .mini-felt-table.replay-felt.tucked[data-size="6"] {
    width: min(92%, 520px, max(45vh, 300px));
    aspect-ratio: .74;
  }
}

/* The full-screen replay on a portrait phone: the felt has the height its controls leave
   (fitReplayFelt writes --felt-aspect, width over that room). The other felts keep the aspects above. */
@media (max-width: 640px) and (orientation: portrait) {
  /* A tucked hand stands above its plate, so a phone's table is taller than wide (.7 where it was .74-.98).
     A phone lying down or a tablet keeps the old table. */
  .mini-felt-table.replay-felt.tucked[data-size] {
    aspect-ratio: var(--felt-aspect, .7);
  }

  .replay-modal:not(.replay-inline) .mini-felt-table.replay-felt.tucked[data-size] {
    aspect-ratio: var(--felt-aspect, .78);
  }
}

.mini-hand-seat {
  position: absolute;
  display: grid;
  place-items: center;
  gap: 2px;
  width: 132px;
  min-height: 88px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  padding: 7px;
  color: #fff;
  transform: translate(-50%, -50%);
  border-width: 1px;
  border-color: hsla(0, 0%, 100%, .28);
  border-radius: var(--r-sm);
  background: rgba(13, 21, 17, .88);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .32);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.mini-hand-seat.empty {
  border-style: dashed;
  color: rgba(255, 255, 255, 0.72);
  border-color: hsla(0, 0%, 100%, .16);
  background: rgba(13, 21, 17, .42);
}

.mini-hand-seat.drop-target {
  border-color: var(--stack-gold);
  background: rgba(7, 93, 77, 0.96);
  box-shadow:
    0 0 0 5px rgba(244, 207, 106, 0.24),
    0 16px 28px rgba(0, 0, 0, 0.28);
}

.mini-cards {
  color: var(--stack-gold);
  font-size: 0.8rem;
  font-weight: 700;
}

.mini-board {
  position: absolute;
  inset: 42% auto auto 50%;
  display: flex;
  gap: 6px;
  transform: translate(-50%, -50%);
}

.mini-pot {
  position: absolute;
  inset: 56% auto auto 50%;
  display: grid;
  gap: 2px;
  min-width: 106px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--r-sm);
  padding: 7px 9px;
  text-align: center;
  color: #fff;
  background: rgba(8, 30, 24, 0.72);
  transform: translate(-50%, -50%);
}

/* At rest with a button straddle the pot steps up, into the empty board's place: his chip sits
   in front of the seat, on the pot, and covered the amount. */
.mini-pot[data-straddle="btn"] {
  top: 46%;
}

/* ---- Replay chips + pot ---- */

/* Bet chips: a flat token (dashed ring = edge spots), amount in a pill. */

.replay-chip {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 3;
}

.chip-disc {
  display: inline-block;
  vertical-align: middle;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #e2b954 55%, #a87f22);
  border: 2px dashed rgba(255, 255, 255, 0.9);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.45),
    inset 0 0 0 3px rgba(0, 0, 0, 0.12);
  flex: 0 0 auto;
}

.mini-pot strong .chip-disc {
  width: 13px;
  height: 13px;
  margin-right: 5px;
}

/* On the replay felt this pill IS the bet, so it must read alone on felt, seat
   panel or card: near-opaque ground, champagne (the money colour). */
.chip-amt {
  color: var(--stack-gold);
  font-size: 0.64rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  padding: 3px 7px;
  border-radius: var(--r-pill);
  background: rgba(6, 22, 17, 0.88);
  border: 1px solid rgba(244, 207, 106, 0.34);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.replay-chip.chip-drop {
  animation: chipDrop 0.42s cubic-bezier(0.22, 1.2, 0.4, 1);
}

/* A bet travels FROM its owner. The keyframes name no endpoint: the animation
   fills it from the computed style, i.e. the spot betSpotFor() set. */
.replay-chip.chip-travel {
  animation: chipTravel 0.34s cubic-bezier(0.22, 0.9, 0.3, 1);
}

@keyframes chipTravel {
  0% { left: var(--from-x, 50%); top: var(--from-y, 50%); opacity: 0; }
  30% { opacity: 1; }
}

/* Street close: bets sweep to the middle. opacity starts at 0, so with
   animations off (reduced motion, every suite) only the settled frame shows. */
.chip-sweep {
  position: absolute;
  left: 50%;
  top: 57%;
  transform: translate(-50%, -50%);
  opacity: 0;
  z-index: 3;
  pointer-events: none;
  animation: chipSweep 0.46s ease-in forwards;
}

@keyframes chipSweep {
  0% { left: var(--from-x, 50%); top: var(--from-y, 50%); opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .chip-sweep { animation: none; opacity: 0; }
}

@keyframes chipDrop {
  0% { transform: translate(-50%, -140%) scale(0.4); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* A disc and one line, never growing: anchored on its centre, every extra row
   hits the board and hero's cards at once. Winner name capped and ellipsised.
   Held by replay-felt-geometry-tests. */
/* A row, not a stack, to free the band between board and hero's cards. Width
   CAPPED: betSpotFor()'s keep-out rectangle must be a constant, or a box that
   grew with the digits would move other people's bets. */
.replay-pot-stack {
  position: absolute;
  inset: 62% auto auto 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 36%;
  padding: 5px 8px;
  border-radius: var(--r-sm);
  background: rgba(8, 30, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.22);
  z-index: 3;
}

.pot-total,
.pot-award-line {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Small, or the row exceeds the width betSpotFor() reserves for the box. */
.pot-disc {
  width: 16px;
  height: 16px;
}

.pot-total {
  color: var(--stack-gold);
  font-size: var(--t-note);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}


.mini-pot span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mini-pot strong {
  color: var(--stack-gold);
  font-size: var(--t-control);
}

.action-builder {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--r-lg);
}

.action-row {
  display: grid;
  grid-template-columns: 150px 100px minmax(0, 1fr) auto;
  gap: 10px;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-actions button {
  padding: 8px 11px;
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--r-pill);
  color: var(--muted);
  background: var(--surface);
  font-size: var(--t-small);
  font-weight: 700;
  transition: background .15s ease,
    border-color .15s ease,
    color .15s ease;
}

.action-list {
  display: grid;
  gap: 8px;
}

.action-empty {
  color: var(--muted);
  font-size: var(--t-note);
}

.action-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(18, 31, 25, .04);
  transition: transform .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
}

.action-item span {
  color: var(--accent-dark);
  font-size: var(--t-micro);
  font-weight: 700;
  text-transform: uppercase;
}

.action-item em {
  color: var(--muted);
  font-style: normal;
  font-size: var(--t-note);
}

.board-preview,
.hand-board {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.board-preview {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px;
  background: var(--surface-2);
}

.board-street {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* > span:not(.playing-card), not span: this styles the street LABEL, and the
   cards are spans of spans. A plain descendant rule set --muted DIRECTLY on
   every pip, and a value set on an element beats one inherited from
   .playing-card.card-red whatever the specificity. */
.board-street > span:not(.playing-card) {
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 700;
  text-transform: uppercase;
}

/* The Saved tab's main content — grows with the page (no inner scrollbar). */

.hand-list {
  display: grid;
  gap: 9px;
}

/* "Show more (N older)" pager row at the bottom of the Saved list. */

.hand-list-more {
  justify-self: center;
  margin-top: 4px;
}

.hand-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(18, 31, 25, .04);
  transition: transform .16s ease,
    border-color .16s ease,
    box-shadow .16s ease;
  padding: 14px;
  border-radius: var(--r-lg);
}

/* A row until tapped: summary = title, date, stamp, doubt chip, board; the tap
   opens actions, meta, showdown, notes and tags. Same shape as the session rows. */
.hand-card.is-row > summary {
  display: grid;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.hand-card.is-row > summary::-webkit-details-marker {
  display: none;
}

/* Closed, the cards are a glance, not a study: zoom keeps every size token as it
   is and scales the row as one picture. On the ROW, not on each item: a zoomed flex
   item is still measured at its unzoomed width, and the hole line wrapped over the board. */
.hand-card.is-row:not([open]) .hand-cards-row {
  zoom: .74;
}

/* Closed, the street names go: three groups of 3, 1 and 1 cards say flop, turn and
   river by themselves, and with your cards on the same line the words did not fit
   412 px. Open, the labels come back with the full-size board. */
.hand-card.is-row:not([open]) .board-street > span:not(.playing-card) {
  display: none;
}

.hand-card.is-row[open] > summary {
  margin-bottom: 4px;
}

/* Title/date on their own line: sharing a row let five buttons wrap the title. */

.hand-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.hand-card header > div:first-child {
  flex: 1 1 100%;
}

/* Title left, stamp right, on ONE row: sessions already read this way, and a
   stamp that wraps to its own line reads as a second heading.
   Written as a CHILD selector on purpose: `.hand-card header div{display:grid}`
   below is (0,1,1) and would beat a bare class, which is the same specificity
   trap that shrank the bankroll figure on Home. */
.hand-card header > .hand-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.hand-stamp {
  flex: none;
  font-family: var(--font-note);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hand-stamp.up { color: var(--accent-dark); }
.hand-stamp.down { color: var(--red); }

/* A title typed as one long word breaks inside the card instead of widening the page. */
.hand-card header div {
  display: grid;
  gap: 3px;
  overflow-wrap: anywhere;
}

.hand-card header span,
.hand-meta,
.hand-showdown,
.hand-notes {
  color: var(--muted);
  font-size: var(--t-note);
  line-height: 1.35;
}

/* A hand history ("Hero: Ah Kh · SB: Folded …") is notation: ranks and
   positions column up. .hand-meta/.hand-notes are prose and stay body face. */
.hand-showdown {
  font-family: var(--font-note);
  font-size: var(--t-small);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

/* The closed row's line of cards: yours, "vs", each rival who showed. Mini cards,
   the felt's own, so the list and the table draw a queen the same way. */
.hand-hole {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hand-hole-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.hand-hole-vs {
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 700;
}

.hand-hole-who {
  margin-left: 3px;
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 700;
  /* A long rival name is cut here: the row is a glance, the open card has the full name. */
  max-width: 6ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Your cards and the board share one row, so the closed card keeps its height. */
.hand-cards-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

/* The board's own row wraps between streets; in this row it is one item. */
.hand-cards-row .hand-board {
  flex-wrap: nowrap;
}

/* The seeded example wears its name; see ownHands() for what it does not count in.
   Qualified with the header so it wins the size and colour the header's span rule sets. */
.hand-example-head {
  margin: var(--s-3) 0 0;
}

.hand-card header .hand-demo-chip {
  display: inline-block;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 700;
}

/* A sentence waiting for a read, or changes to a hand never updated: dashed, because
   neither is a saved hand yet. */
.pending-read,
.pending-edit {
  border-style: dashed;
}

.pending-read .hand-card-head,
.pending-edit .hand-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 10px;
}

.pending-read .hand-card-head span,
.pending-edit .hand-card-head span {
  color: var(--muted);
  font-size: var(--t-note);
}

.pending-read-text {
  margin: 0;
  font-size: var(--t-note);
  line-height: 1.4;
}

.pending-read-hint {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-note);
  line-height: 1.4;
}

/* Explains a detail of the picture above; quieter than the meta lines. */

.hand-suit-note {
  color: var(--muted);
  font-size: var(--t-small);
  line-height: 1.3;
  opacity: .8;
}

/* Results filters change the tiles as well as the list. They wrap rather than
   scroll sideways — a control found by swiping is one most never find. */

.stats-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: var(--s-2) 0 0;
}

/* One chip per filter, naming its choice; the chevron turns while its options are open. */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
  font-size: var(--t-control);
}

.filter-chip::after {
  content: "";
  width: .45em;
  height: .45em;
  margin-top: -.25em;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}

.filter-chip[aria-expanded="true"] {
  border-color: var(--accent);
}

.filter-chip[aria-expanded="true"]::after {
  margin-top: .25em;
  transform: rotate(-135deg);
}

.session-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 8px;
}

.session-list-head .eyebrow {
  margin: 0;
}

/* Gold with the fact glyph: explaining a choice the app made, not an error. */

.session-sort-note {
  --note-glyph: var(--glyph-info);
  position: relative;
  margin: 0 0 10px;
  padding: 8px 10px 8px calc(18px + 1.15em);
  border-radius: var(--r-sm);
  background: var(--gold-soft);
  color: var(--ink);
  font-size: var(--t-small);
  line-height: 1.4;
}

/* One month; the heading carries its own subtotal. */

.session-month {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

/* Wraps: the subtotal grows one part per currency, and alone it fits a line,
   so wrapping repairs both title and subtotal. One currency never wraps. */
.session-month-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.session-month-head h3 {
  margin: 0;
  font-size: var(--t-body);
}

/* ::first-letter, not capitalize: "agosto de 2026" must not become "Agosto De". */

.session-month-head h3::first-letter {
  text-transform: uppercase;
}

.session-month-total {
  color: var(--muted);
  font-size: var(--t-small);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.session-list-more {
  width: 100%;
  justify-content: center;
}

/* Unconfirmed seating. NOT muted: this says the hand may be WRONG in a way the
   felt does not show. Same red as the review's .is-misread note. */

.hand-seat-note,
.replay-seat-note {
  margin: 0;
  padding: 6px 9px;
  border-radius: var(--r-sm);
  background: var(--red-soft);
  color: var(--ink);
  font-size: var(--t-small);
  line-height: 1.4;
  font-weight: 700;
}

/* In the list it is a chip: the sentence belongs where the hand is open. */
.hand-seat-note {
  align-self: flex-start;
  padding: 4px 9px;
  border-radius: var(--r-pill);
}

.replay-seat-note {
  --note-ink: var(--red);
  --note-glyph: var(--glyph-stop);
  position: relative;
  margin-bottom: 10px;
  padding: 8px 10px 8px calc(18px + 1.15em);
}

/* The saved card's question stands on its own, not under a note. */
.hand-seat-question {
  margin: 8px 0 0;
  border-radius: 4px;
}

.hand-notes {
  color: var(--ink);
  white-space: pre-wrap;
}

.empty-state {
  padding: 24px 12px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.58);
}

/* Inside the roster's own panel a dashed box is a box in a box (DESIGN section 5):
   the empty state is the screen, so it gets space and a sentence, not a frame. */
#playerList .empty-state {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 4px 0 12px;
}

/* The empty roster shows a rival instead of describing one: a greyed example card. */
.roster-empty {
  display: grid;
  gap: var(--s-3);
}

.roster-example {
  cursor: default;
  border-style: dashed;
  opacity: .6;
}

.roster-example p {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-note);
}

.roster-example header > strong {
  margin-right: auto;
}

.roster-empty-line {
  margin: 0;
  color: var(--ink);
}

.roster-empty-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

body[data-theme="dark"] .empty-state {
  background: rgba(23, 33, 30, 0.58);
}

/* Voice hand entry */

/* No accent stripe (green means you/winning), no --shadow-lift (for things
   floating over the page). The 1px border separates capture from the felt. */
/* Under the felt, on the page: the box and its two buttons are not an object. */
.voice-panel {
  position: relative;
  display: grid;
  gap: .75rem;
  overflow: hidden;
}

.voice-controls {
  position: relative;
  flex-wrap: wrap;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .625rem;
}

/* The card before a read: the sentence against the table, shown in place of the Build button. */
.pre-read-card {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--line));
  border-radius: var(--r-sm);
  background: var(--gold-soft);
  scroll-margin-bottom: calc(var(--nav-space) + 12px);
}

.voice-panel.has-pre-read .mic-button {
  grid-column: 1 / -1;
}

.pre-read-title {
  margin: 0;
  font-size: var(--t-control);
  font-weight: 700;
  color: var(--ink);
}

.pre-read-lines {
  display: grid;
  gap: var(--s-2);
  margin: 0;
  padding-left: 1.1em;
  font-size: var(--t-control);
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.pre-read-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .625rem;
}

.pre-read-actions button {
  min-height: 44px;
  overflow-wrap: anywhere;
}

/* Parse pre-flight: blockers (red) disable Parse, warnings (gold) flag input. */

.parse-readiness {
  display: grid;
  gap: 6px;
  border-radius: var(--r-sm);
}

.readiness-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: var(--t-note);
  line-height: 1.3;
  border: 1px solid color-mix(in srgb, var(--red) 45%, var(--line));
  background: color-mix(in srgb, var(--red) 9%, var(--surface));
}

.readiness-item.warn {
  border-color: color-mix(in srgb, var(--gold) 50%, var(--line));
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
}

/* A fact, not a caution: the week's reads spent, in the walnut greys. */
.readiness-item.note {
  border-color: var(--line);
  background: var(--surface-2);
}

.readiness-icon {
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: var(--t-micro);
  font-weight: 700;
  color: #fff;
  background: var(--red);
}

.readiness-item.warn .readiness-icon {
  background: var(--gold);
  /* White on this gold fails; near-black passes. The red variant keeps white. */
  color: var(--on-fill);
}

.readiness-item.note .readiness-icon {
  background: var(--muted);
  color: var(--on-fill);
}

.readiness-label {
  flex: 1;
}

/* A sentence about the screen with an inline pill, not a card; it removes
   itself once answered. */
.stats-currency-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: var(--t-note);
  line-height: 1.5;
}

.stats-currency-hint span {
  flex: 1 1 14rem;
}

.readiness-fix {
  flex: none;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  /* Padding, not fixed height, so the pill hugs its label at any text scale. */
  padding: 9px 10px;
  font: inherit;
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--surface);
  cursor: pointer;
}

/* Quieter than the fix beside it — dismissing is second-best. The 30px box is
   a touch target. */

.readiness-dismiss {
  flex: none;
  width: 44px;
  height: 44px;
  /* The 44 px target overflows the row's padding instead of making the row taller. */
  margin: -6px -6px -6px 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  font: inherit;
  font-size: var(--t-body);
  line-height: 1;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.readiness-dismiss:hover,
.readiness-dismiss:focus-visible {
  color: var(--ink);
  background: color-mix(in srgb, var(--line) 45%, transparent);
}

/* Live table-setup checklist; fix buttons reuse .readiness-fix. */

/* Under the felt, as a list with lines: a label opens it, each step is a row. */
.live-setup {
  display: grid;
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.live-setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: var(--s-2);
  font-size: var(--t-note);
}

.live-setup-dismiss {
  min-height: 44px;
  border: none;
  background: none;
  padding: 8px 8px;
  font: inherit;
  font-size: var(--t-small);
  color: var(--muted);
  cursor: pointer;
}

.live-setup-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--s-2) 0;
  border-top: 1px solid var(--line);
  font-size: var(--t-note);
  line-height: 1.3;
}

.setup-step-num {
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: var(--t-micro);
  font-weight: 700;
  color: #fff;
  background: var(--accent-fill);
}

.live-setup-step.done .setup-step-num {
  background: var(--muted);
}

.setup-step-text {
  flex: 1;
  display: grid;
}

.setup-step-text span {
  color: var(--muted);
  font-size: var(--t-small);
}

.live-setup-step.done .setup-step-text strong {
  color: var(--muted);
  font-weight: 600;
}

.mic-button.recording {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
  animation: micPulse 1.3s ease-in-out infinite;
}

@keyframes micPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(185, 75, 75, 0.5);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(185, 75, 75, 0);
  }
}

.voice-status {
  min-height: 1.1em;
  font-size: var(--t-note);
  line-height: 1.35;
  color: var(--muted);
  /* A status that wraps keeps its last words together, as the guide's hints do. */
  text-wrap: pretty;
}

/* Empty at rest, it takes no room: the buttons sit on the box. */
.voice-status:empty {
  display: none;
}

/* A read that failed wears the reads-left row's gold box and its warning mark, not a hint's grey. */
.voice-status.is-failure {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--line));
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
  color: var(--ink);
}

.voice-status.is-failure::before {
  content: "!";
  content: "!" / "";
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: var(--t-micro);
  font-weight: 700;
  color: var(--on-fill);
  background: var(--gold);
}

/* A 2 px rule under the controls while a read or a transcription is in flight. It sweeps only
   where motion is allowed and stands still otherwise; either way it is a state, not ambience. */
.voice-panel[data-busy="true"] .voice-controls::after,
.voice-panel[data-transcribing="true"] .voice-controls::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
}

/* The build button keeps its look while the read runs: disabled and aria-busy say it is
   busy, and the label says what it is doing. */
.voice-panel[data-busy="true"] #parseHandBtn {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .voice-panel[data-busy="true"] .voice-controls::after,
  .voice-panel[data-transcribing="true"] .voice-controls::after {
    animation: parseSweep 1.2s linear infinite;
  }

  @keyframes parseSweep {
    from { background-position: -40% 0; }
    to { background-position: 140% 0; }
  }

  /* A soft band of fixed height goes down the sentence while a read or a transcription is in flight. */
  .voice-panel[data-busy="true"] .voice-transcript,
  .voice-panel[data-transcribing="true"] .voice-transcript {
    background-image: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 30%, transparent), transparent);
    background-size: 100% 3rem;
    background-repeat: no-repeat;
    animation: readScan 1.8s ease-in-out infinite;
  }

  @keyframes readScan {
    from { background-position: 0 -3rem; }
    to { background-position: 0 calc(100% + 3rem); }
  }
}

.parse-cancel {
  justify-self: start;
  min-height: 44px;
}

/* The status and Cancel share one row, so the sentence below moves once, on the tap. At rest
   the wrapper has no box of its own. */
.read-wait {
  display: contents;
}

/* The row is as tall as Cancel from the first frame; Cancel only appears in it later. */
.voice-panel[data-busy="true"] .read-wait,
.voice-panel[data-transcribing="true"] .read-wait {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
}

.read-wait > .voice-status {
  flex: 1;
  min-width: 0;
}

/* The doors a failed read leaves open, under the line that says it failed. */
.read-failure-doors {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.read-failure-doors button {
  min-height: 44px;
  flex: 1 1 auto;
}

.read-failure-note {
  flex: 1 1 100%;
  margin: 0;
  font-size: var(--t-small);
  line-height: 1.4;
  color: var(--muted);
}

/* Collapsible "how to narrate" guide above the transcript. */

/* A line under the box, not a card: the summary reads as the box's caption and the
   list opens beneath it. */
.dictation-guide {
  padding: 0 2px;
  font-size: var(--t-note);
  line-height: 1.45;
  color: var(--ink);
}

/* The collapse's chevron, and a quiet line: help you open, not a section heading. */
.dictation-guide > summary {
  font-weight: 400;
  color: var(--muted);
}

.dictation-guide ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.dictation-guide .guide-example {
  margin: 8px 0 2px;
  color: var(--muted);
}

/* Four rows, the example's own height in both languages; the box grows with the
   sentence (growTranscriptBox). The global textarea minimum would add a fifth. */
.voice-transcript {
  resize: vertical;
  width: 100%;
  padding: .875rem;
  font-size: var(--t-body);
  line-height: 1.5rem;
  min-height: 0;
  background: var(--surface-2);
}

/* Unsaved-text offer, shown only while the box is empty. It wraps: the label
   can grow (translation, text scale). */
.draft-offer {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
  align-items: center;
}

.draft-offer-restore,
.draft-offer-dismiss {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

/* Far edge, away from the button you want: this one destroys text, no undo. */
.draft-offer-dismiss {
  margin-left: auto;
  color: var(--muted);
}

/* The age is what makes this an offer, not a restore; muted, it qualifies. */
.draft-offer-age {
  color: var(--muted);
  font-size: var(--t-note);
  font-variant-numeric: tabular-nums;
}

/* The age is a fact beside the verb, not part of the order: "ahora mismo" read as
   an imperative until the dot set it apart. */
.draft-offer-age::before {
  content: "· ";
}

/* Over an open edit: which hand, and the way out. */
.editing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: var(--t-note);
}

/* Under the final stack: the same number in the other unit. */
.end-sheet-other {
  margin: 0;
  color: var(--muted);
  font-size: var(--t-note);
}

.editing-banner-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

/* The stack typed in a hand, offered as the buy-in: one tap fills the field. */
.end-sheet-suggest {
  border: 1px solid var(--line);
  background: var(--surface);
  justify-self: start;
  max-width: 100%;
  text-align: left;
  white-space: normal;
}

.editing-banner-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.editing-banner-night {
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* New-hand table wizard (players → hero): the question is the screen's loud line,
   on the page, with the nine numbers under it. */

.hand-setup {
  display: grid;
  gap: 14px;
  padding: 6px 0 0;
}

.setup-head {
  display: grid;
  gap: 6px;
}

/* The question is the title; a line under it only when it adds a fact. */
.setup-head p {
  margin: 0;
  font-size: var(--t-note);
  color: var(--muted);
}

.setup-head span {
  font-family: var(--font-display);
  font-size: var(--t-title);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--ink-bright);
}

.setup-size-grid {
  display: grid;
  /* 2..10 = 9 buttons: 3x3 fits exactly (4-up left an orphan on its own row). */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.setup-size-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: var(--t-figure);
  font-weight: 700;
  cursor: pointer;
  min-height: 68px;
  border-color: var(--line);
  background: var(--surface-2);
  transition: transform .15s ease,
    border-color .15s ease,
    background .15s ease,
    box-shadow .15s ease;
  border-radius: var(--r-sm);
}

.setup-size-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* The running session's table, offered, not chosen. */
.setup-size-btn.is-suggested {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* The lit size says why in words, so the light is not only a colour. */
.setup-size-btn[data-hint]::after {
  content: attr(data-hint);
  font-size: var(--t-micro);
  font-weight: 600;
  color: var(--accent-dark);
}

/* The position question: a ring name per button, up to four rows at ten players. */
.setup-pos-btn {
  min-height: 56px;
  font-size: var(--t-section);
}

/* The table the question is asked on, with a real button to leave it. */
.setup-table-bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.setup-table-bar span {
  flex: 1;
  min-width: 0;
  font-size: var(--t-control);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.setup-table-bar button {
  flex: none;
}

/* Why a table is being asked about again: one quiet line between the question and its answers. */
.setup-reason {
  margin: 0 0 var(--s-3);
  color: var(--muted);
  font-size: var(--t-note);
  overflow-wrap: anywhere;
}

/* The one bar over the felt while the table is being corrected; it rides under the top bar. */
.roster-change-bar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid color-mix(in srgb, var(--gold) 50%, var(--line));
  border-radius: var(--r-sm);
  background: var(--gold-soft);
}

.roster-change-bar p {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: var(--t-control);
  line-height: 1.3;
  color: var(--ink);
}

.roster-change-bar button {
  flex: none;
  width: auto;
  min-height: 44px;
}

/* While the table is corrected every seat says its number, empty or not. */
.live-felt-table.is-roster-change .live-seat .live-seat-number,
.live-felt-table.is-roster-change .live-seat.empty .live-seat-number {
  display: block;
  color: var(--gold);
  font-weight: 800;
}

.setup-next {
  margin-top: 14px;
  color: var(--muted);
  font-size: var(--t-note);
}

.setup-pos-hint {
  margin-top: 0;
  text-align: center;
}

/* Your stack on the position question: a real button that says the number and where it comes from. */
.setup-stack-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  width: 100%;
  min-height: 52px;
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--t-control);
  line-height: 1.35;
  text-align: left;
}

.setup-stack-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.setup-stack-text strong {
  color: var(--ink-bright);
}

.setup-stack-source {
  color: var(--muted);
}

.setup-stack-change {
  flex: none;
  color: var(--muted);
  font-weight: 700;
}

.setup-stack-edit {
  display: grid;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.setup-stack-edit label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--t-control);
}

.setup-stack-edit input {
  min-height: 48px;
  font-size: 1.2rem;
  font-weight: 700;
}

.setup-stack-actions {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.setup-stack-actions .primary-button {
  width: auto;
}

/* The sentence you would say, in the face the typed hand wears everywhere. */
.setup-example {
  color: var(--ink);
  font-family: var(--font-note);
  font-size: var(--t-note);
  line-height: 1.6;
}

.setup-felt .mini-hand-seat {
  cursor: pointer;
}

/* The straddle chip is drawn on the felt, not a target: the seat under it takes the tap. */
.setup-felt .replay-chip {
  pointer-events: none;
}

/* The wizard's written answers: the session's table or another, the button one
   seat on or the felt. One column, the suggested answer first and lit. */
.setup-choice {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.setup-choice-btn {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 14px 16px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
}

.setup-choice-btn span {
  color: var(--muted);
  font-size: var(--t-note);
}

.setup-choice-btn span:empty {
  display: none;
}

.setup-choice-btn.is-suggested {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.setup-choice-btn.is-suggested strong {
  /* The light green: --accent on its own soft ground read 3.24:1. */
  color: var(--accent-dark);
}

/* What the hand was played in: the answer being filled stays marked, the last answer offered
   again sits above the three with the same box, and the form opens under them. */
.setup-choice-btn.is-picked {
  border-color: var(--accent);
}

.setup-choice-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.setup-same {
  margin-bottom: var(--s-3);
  width: 100%;
}

.setup-same strong {
  color: var(--ink-bright);
}

.setup-amounts-form {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.setup-amounts-label {
  color: var(--muted);
  font-size: var(--t-control);
  font-weight: 700;
}

.setup-blinds-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.setup-blinds-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  font-size: 1.2rem;
  font-weight: 700;
}

.setup-blinds-slash {
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 700;
}

.setup-ante-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.setup-amounts-form > input {
  min-height: 48px;
  font-size: 1.2rem;
  font-weight: 700;
}

.setup-felt .mini-hand-seat:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
}

/* Lives in the Settings view (Dictation & parsing card). */

.voice-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 4px;
}

/* Narrow on purpose: four characters at most. */
.settings-inline {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.settings-inline label {
  display: grid;
  gap: 6px;
  justify-items: start;
  color: var(--muted);
  font-size: var(--t-note);
  font-weight: 700;
}

/* 6rem, not 7ch: ch is the width of "0" and padding comes out of the same box,
   so 7ch truncated the placeholder. rem grows with the text. */
.settings-inline input {
  width: 6rem;
  text-align: center;
}

/* Own rule: the shared input is 6rem and centred for a 4-char currency. */
#selfNameInput {
  width: 100%;
  text-align: left;
}

/* Same escape as #selfNameInput, and the same reason: an address, a password and six digits
   are not a 4-character currency. The label stretches too, or the input has nothing to fill. */
.settings-inline.account-form label {
  justify-items: stretch;
}

.settings-inline.account-form input {
  width: 100%;
  text-align: left;
}

/* The age and terms box: a thumb-sized row, the sentence at its own weight, the links underlined. */
.settings-inline.account-form .account-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
  min-height: 44px;
}

/* The terms card's sentence is one line or two: centred in its 44 px row, so one line leaves no hole under it. */
.legal-accept .account-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.settings-inline.account-form .account-consent input,
.legal-accept .account-consent input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
}

.account-consent span {
  font-weight: 400;
}

.account-consent a {
  color: var(--accent);
  text-decoration: underline;
}

/* Six digits, spaced so a thumb can check them against the mail. */
#accountCode,
#accountEraseCode,
#accountKeyCode {
  letter-spacing: 0.25em;
  font-variant-numeric: tabular-nums;
}

/* The seconds left on "Send it again" keep their width as they count down. */
#accountResendBtn,
#accountEraseAskBtn,
#accountKeyAskBtn {
  font-variant-numeric: tabular-nums;
}

/* The two halves of the card are grids like the card itself, so their parts stand a gap apart. */
.account-panel {
  display: grid;
  gap: 14px;
}

/* A block of the signed-in card: a name, its rows, its action. */
.account-block {
  display: grid;
  gap: 8px;
}

.account-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.account-list:empty {
  display: none;
}

.account-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
}

.account-row-text {
  display: grid;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* The numbers of the first upload are short lines to read, not rows to tap. */
.sync-preview li {
  min-height: 0;
}

.sync-progress {
  width: 100%;
  accent-color: var(--accent);
}

/* A notice about the copy that lost: its sentence, then its two buttons under it. */
.sync-notices li {
  flex-wrap: wrap;
  padding: 6px 0;
}

.voice-settings label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--t-note);
  font-weight: 700;
}

/* .hand-card header div (grid) matches this div at higher specificity and
   turned the buttons into a one-column tower; out-rank it here. Wraps: five
   labels do not fit one row. */

.hand-card .hand-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* Trimmed side padding fits the five English labels on one row; in Spanish
   "Borrar" wraps to its own row, which is deliberate. */

.hand-card .hand-card-actions button {
  padding: 0 8px;
}

/* Weight matches intent: Replay is the answer, Share/Edit sit back, Delete is
   quiet until hovered. Carried by COLOUR, never padding — the row is pinned
   to ≤2 lines. */

/* White, not --on-fill: --on-fill is for saturated fills where white fails;
   --accent-fill is calibrated for white. */
.hand-card .hand-card-actions button.hand-replay {
  color: #fff;
  border-color: transparent;
  background: var(--accent-fill);
  font-weight: 600;
}

.hand-card .hand-card-actions button.hand-replay:hover {
  border-color: transparent;
  background: color-mix(in srgb, var(--accent-fill) 84%, #fff);
}

.hand-card .hand-card-actions button.hand-share,
.hand-card .hand-card-actions button.hand-edit {
  color: var(--muted);
  border-color: transparent;
  background: none;
}

.hand-card .hand-card-actions button.hand-share:hover,
.hand-card .hand-card-actions button.hand-edit:hover {
  color: var(--ink);
  border-color: var(--line);
}

/* Board replayer */

.replay-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-replay);
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(8, 14, 11, .68);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.replay-overlay.open {
  display: grid;
}

.replay-modal {
  display: grid;
  gap: 14px;
  width: min(920px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  grid-template-columns: minmax(0, 1fr);
  overflow-anchor: none;
  overscroll-behavior: contain;
  animation: surface-enter .2s ease-out both;
  animation-name: modal-enter;
  border-radius: var(--r-lg);
}

/* The modal box used inline. The class brings behaviour: overflow: auto +
   overscroll-behavior: contain + max-height make a scroll container that
   swallows the page gesture. The entrance animation goes too (starts at
   opacity 0; the headless rigs freeze the animation clock). (0,2,0) so it
   beats the base rule and the max-width override in any order. */
.replay-modal.replay-inline {
  overflow: visible;
  overscroll-behavior: auto;
  max-height: none;
  height: auto;
  animation: none;
  /* On the public pages the felt stands on the page: no box around it, the head
     and the transport flush with the column, as the record screen draws it. */
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.replay-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.replay-modal-head span {
  font-size: var(--t-body);
  font-weight: 700;
}

.replay-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

/* The speaker: icon only, muted grey until it is on, then the accent. Same height
   as Close beside it so the head does not jump when the icon swaps. */
.replay-head-right .replay-sound {
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  padding: 0;
  color: var(--muted);
}

.replay-head-right .replay-sound svg {
  width: 18px;
  height: 18px;
}

.replay-head-right .replay-sound[aria-pressed="true"] {
  color: var(--accent-dark);
}

/* Breakdown is a CHILD of .replay-pot, not a sibling: four heads with three
   layouts share it and a sibling would need placing by each parent. */
.replay-pot {
  display: inline-grid;
  justify-items: end;
  gap: 1px;
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

/* Reserved AND line-height pinned: an empty span (min-height) and one with
   text (line-height: normal) differ, and the felt slid under the thumb. */
.replay-pot-breakdown {
  min-height: 1.15em;
  line-height: 1.15;
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Quiet subtitle; overrides the head's bold-span rule. */

.replay-modal-head .replay-meta {
  display: block;
  margin-top: 2px;
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--muted);
}

.replay-table {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  overflow: hidden;
}

/* Seats overhang the rail by half a card by design; the containers need that
   room or overflow: hidden clips the top/bottom seats. */

.replay-table,
.hand-visual-table {
  padding: 8px 0;
}

.replay-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* Transport: Prev left, Next right. Wraps except on a portrait phone (see the phone
   block below); space-between still pins the ends. */

.replay-transport {
  justify-content: space-between;
  align-items: center;
}

.replay-transport-mid {
  display: flex;
  gap: 8px;
  align-items: center;
}

.replay-transport > button {
  flex: 0 0 auto;
}

/* Secondary actions (units / Save) sit on their own row below, and the row is not
   drawn while none of them is showing. */

.replay-actions {
  margin-top: 8px;
}

.replay-actions:not(:has(> button:not([hidden]))) {
  display: none;
}

/* Inline parse review under the voice panel; the overlay stays for replays. */

.voice-review {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border-radius: var(--r-lg);
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.review-head span {
  font-size: var(--t-body);
  font-weight: 700;
}

/* The AI's mark on a cloud read: a quiet pill in the head's own row, no height of its own. */
.review-head .review-ai {
  flex: none;
  margin-right: auto;
  padding: 4px 7px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--t-micro);
  white-space: nowrap;
}

.review-cta {
  display: grid;
  gap: 8px;
}

/* Save and Share side by side; the quick note under them. */
.review-cta-row {
  display: flex;
  gap: 10px;
}

.review-quick-note {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  font: inherit;
  font-size: var(--t-note);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.review-cta button {
  flex: 1;
  padding: 14px 16px;
  font-size: var(--t-body);
}

/* The wide slot belongs to Save, not to its colour: as "Save with doubts" it steps down
   to secondary and still needs the room for its longer label. */
#reviewSaveBtn {
  flex: 1.6;
}

/* A check says nothing is in doubt; without it the label also fits a 360 px phone. */
#reviewSaveBtn.secondary-button .lucide {
  display: none;
}

/* Heavy editing surfaces fold away (kept in the DOM — Edit brings them back). */

.hand-form.review-collapsed .live-hand-builder,
.hand-form.review-collapsed .board-entry,
.hand-form.review-collapsed .board-preview,
.hand-form.review-collapsed .hand-visual-table,
.hand-form.review-collapsed .form-actions,
.hand-form.review-collapsed .collapse,
.hand-form.review-collapsed .unit-toggle-row {
  display: none;
}

/* Manual editing HIDDEN, not deleted: the inputs stay so buildHandFromForm()
   keeps feeding save, replay, notes and capture, and Edit stacks / Fix cards /
   Redo here reveal one block. #handDetailsBlock is not a fallback. Editing a
   saved hand keeps the form's buttons: Update and Delete live nowhere else. */

.hand-form.manual-hidden > .collapse:not(#handDetailsBlock),
.hand-form.manual-hidden:not(.editing-saved) > .form-actions {
  display: none;
}

/* The table size stays on the capture screen: once Clear form keeps the table,
   this row is the one way to change it without rebuilding it. Not under the
   review, whose felt it sits beneath. */
.hand-form.review-collapsed .hand-table-size {
  display: none;
}

/* Table size under the felt. A size that would strand actions on seats it
   removes is disabled in the list rather than warned about after the fact. */

/* One line over the felt: what the table is, and the door that changes it. */
.hand-table-size {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 7px 10px;
  padding: 0 2px;
}

/* Kept in the DOM for its text and its hidden flag (the Mesa sheet reads both);
   under the felt only the table line speaks. */
.hand-table-size-note {
  display: none;
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: var(--t-small);
  line-height: 1.45;
}

/* Two ways out of a review, both about the INPUT: full-width and equal. */

.review-fix {
  display: flex;
  /* The row wraps; labels do not (below). Row nowrap bet that translated labels
     fit, and .hand-panel (min-width: auto) made the page overflow instead. */
  flex-wrap: wrap;
  gap: 10px;
}

/* white-space: nowrap used to be here; with the row wrapping, a label only
   breaks when a single button exceeds the screen (Spanish at 150% text). */
/* flex: 0 1 auto, not flex: 1: a basis of 0 makes the row's hypothetical size
   zero, so flex-wrap can never fire and the label breaks instead. */
.review-fix button {
  flex: 0 1 auto;
  min-width: 0;
  padding: 0 10px;
}

.review-fix button[hidden] {
  display: none;
}

.review-fix button.active {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* Alpha parse report; opens a panel that says what is attached before sending. */

/* Shares the row with Fix text: it is one of the two moves, not a footnote. */

/* 44px min-width. button.hand-edit so it does not depend on out-ranking
   .secondary-button by source order. */
button.hand-edit {
  min-width: 44px;
}

.review-report-toggle {
  font-size: var(--t-control);
}

.review-report {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}

.review-report-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--t-note);
  color: var(--muted);
}

.review-report-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 68px;
  font: inherit;
  font-size: var(--t-body);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px;
}

.review-report-field textarea:focus {
  border-color: var(--accent);
}

.review-report-note {
  margin: 0;
  font-size: var(--t-small);
  line-height: 1.4;
  color: var(--muted);
}

.review-report-actions {
  display: flex;
  gap: 10px;
}

.review-report-actions button {
  flex: 1;
}

.review-hero-cards input {
  max-width: 140px;
}

/* Touchable timeline: tapping a line redoes the hand from that action. */

.review-timeline {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 38vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  padding: 8px;
  background: var(--surface);
  border-radius: var(--r-sm);
  overflow-anchor: none;
  overscroll-behavior: contain;
}

.timeline-street {
  font-size: var(--t-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 6px 6px 2px;
}

.timeline-street.current {
  color: var(--accent);
}

.timeline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  text-align: left;
  border: 1px solid transparent;
  padding: 9px 10px;
  background: transparent;
  color: inherit;
  font-size: var(--t-body);
  border-radius: var(--r-sm);
}

.timeline-row .fix-hint {
  color: var(--muted);
  font-size: var(--t-note);
}

.timeline-row.done {
  opacity: 0.75;
}

.timeline-row.current {
  color: var(--accent-dark);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: var(--accent-soft);
}


/* "Could not verify the result": calmer than an error, left rule so it reads as
   attached to the result. */
/* Guidance, not a caveat: every caveat in this review is gold with the alert, so
   the one line that tells you what to do next is green with the tip. */

.review-coach {
  --note-ink: var(--accent-dark);
  --note-glyph: var(--glyph-tip);
  position: relative;
  margin: 0;
  padding: 8px 10px 8px calc(18px + 1.15em);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: var(--t-note);
  line-height: 1.45;
  font-weight: 600;
}

/* The demo's one instruction carries its own Play, on the same line. */
.review-coach.has-play {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.review-coach.has-play::before {
  top: calc(50% - .575em);
}

.review-coach-play {
  flex: none;
  min-height: 44px;
}

.review-derived-note {
  /* --gold, not --red: a caveat. The exception is .is-misread below. */
  --note-ink: var(--gold);
  --note-glyph: var(--glyph-alert);
  position: relative;
  margin: 0;
  padding: 8px 10px 8px calc(18px + 1.15em);
  border-radius: var(--r-sm);
  background: var(--gold-soft);
  color: var(--ink);
  font-size: var(--t-note);
  line-height: 1.45;
}

/* The one note that is NOT a caveat: an unplaceable seat name means an action
   may be on the wrong player in a hand that looks right. Keep the others gold
   — red only stands out if spent nowhere else. */

.review-derived-note.is-misread {
  --note-ink: var(--red);
  --note-glyph: var(--glyph-stop);
  background: var(--red-soft);
  font-weight: 700;
}

/* Cards taken from the sentence are right, so the note only informs: grey, no alert. */
.review-derived-note.is-info {
  --note-ink: var(--muted);
  --note-glyph: var(--glyph-info);
  background: var(--surface);
  color: var(--muted);
}

/* The glyph that opens a note, hung in the note's left margin so a second line
   aligns with the first: its shape from --note-glyph, its colour from --note-ink. */
.review-coach::before,
.review-derived-note::before,
.replay-seat-note::before,
.session-sort-note::before {
  content: "";
  position: absolute;
  left: 10px;
  top: calc(8px + .15em);
  width: 1.15em;
  height: 1.15em;
  background-color: var(--note-ink, var(--gold));
  -webkit-mask: var(--note-glyph, var(--glyph-alert)) center / contain no-repeat;
  mask: var(--note-glyph, var(--glyph-alert)) center / contain no-repeat;
}

/* The headline is the whole message; the rest is folded so the chips that
   answer the question are the next thing on screen, not the fourth. */
.review-note-line {
  display: block;
}

.review-note-why {
  margin-top: 6px;
  font-weight: 400;
}

.review-note-why summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--muted);
  cursor: pointer;
}

.review-note-why p {
  margin: 0 0 2px;
}

/* Hangs off the note above: the same gold ground, flush under it and over its
   rounded foot, its content under the note's text. Nothing here is destructive. */
.review-name-offer {
  margin: calc(-1 * var(--r-sm)) 0 0;
  padding: calc(var(--r-sm) + 2px) 10px 10px calc(18px + 1.15 * var(--t-note));
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: var(--gold-soft);
}

.review-name-offer-row + .review-name-offer-row {
  margin-top: 8px;
}

/* Full width: at 412px it is the one thing to do next, not a chip. */

.review-reparse-btn {
  width: 100%;
  justify-content: center;
}

.review-name-offer-ask {
  display: block;
  margin-bottom: 6px;
  font-size: var(--t-small);
  color: var(--muted);
}

.review-name-offer-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Smaller than a ghost button: ten of these wrap inside a phone-width note. */
.review-name-offer-seat {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  font-size: var(--t-small);
  border-color: var(--line);
  background: var(--surface);
}

/* Seat-naming editor: one chip row per table size in play; tapping a chip
   swaps it for an input in place. */

.position-names-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.position-names-size-tag {
  flex: none;
  min-width: 52px;
  font-size: var(--t-micro);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.position-names-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* The other sizes: the shared closed line, and open their rows stand where the rows above
   stand, 8 px apart, with no box of their own around chips. */
.collapse.position-names-more[open] {
  gap: 0;
  padding: 0;
  border-width: 0;
  background: transparent;
}

.collapse.position-names-more[open] > summary {
  border-bottom: 0;
}

.position-chip {
  min-height: 44px;
  padding: 9px 9px;
  font: inherit;
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  cursor: pointer;
}

.position-chip:hover,
.position-chip:focus-visible {
  color: var(--ink);
}

/* A renamed seat has to be findable at a glance ("what have I changed?"). */
.position-chip.renamed {
  color: var(--accent-dark);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
}

.position-chip-input {
  width: 88px;
  padding: 3px 8px;
  font-size: var(--t-small);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
}

/* Quiet: unstated suits are the normal case, not a fault. */
.review-cards-legend {
  display: block;
  margin-top: 6px;
  font-size: var(--t-note);
  line-height: 1.4;
  color: var(--muted);
}

/* One-tap "as parsed" suggestions offered back after a review fix. */

.immersive-suggested {
  grid-column: 1 / -1;
  border: 1px solid var(--accent);
  padding: 12px;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  border-radius: var(--r-sm);
}

.immersive-suggested.rest {
  border-style: dashed;
  font-weight: 600;
}

/* Re-opens just the card surfaces; the wrapper <details> comes back (JS opens
   it) without border/summary. */

.hand-form.review-collapsed.fix-cards #boardDetails {
  display: grid;
  border: 0;
  padding: 0;
  background: none;
}

.hand-form.review-collapsed.fix-cards #boardDetails > summary {
  display: none;
}

.hand-form.review-collapsed.fix-cards .board-entry {
  display: grid;
}

.hand-form.review-collapsed.fix-cards .board-preview {
  display: flex;
}

.mini-hand-seat.folded {
  opacity: 0.4;
  filter: grayscale(0.6);
}

/* A folded seat whose cards the story named: the seat stays grey, the cards do not. */
.mini-hand-seat.folded.told {
  opacity: 1;
  filter: none;
}

.mini-hand-seat.folded.told > :not(.mini-cards) {
  opacity: 0.4;
  filter: grayscale(0.6);
}

.mini-hand-seat.active {
  border-color: hsla(41, 70%, 65%, .9);
  background: rgba(12, 43, 34, .95);
  box-shadow: 0 0 0 3px hsla(41, 70%, 65%, .18), 0 8px 20px rgba(0, 0, 0, .32);
}

.mini-hand-seat.to-act {
  border-color: #2fb99c;
  box-shadow:
    0 0 0 4px rgba(47, 185, 156, 0.45),
    0 16px 28px rgba(0, 0, 0, .32);
  animation: toActPulse 1.4s ease-in-out infinite;
}

@keyframes toActPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(47, 185, 156, 0.45), 0 16px 28px rgba(0, 0, 0, .32); }
  50% { box-shadow: 0 0 0 7px rgba(47, 185, 156, 0.22), 0 16px 28px rgba(0, 0, 0, .32); }
}

.mini-hand-seat.is-button::after {
  content: "D";
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.seat-bet {
  min-height: 0.9em;
  color: var(--stack-gold);
  font-size: var(--t-micro-tight);
  font-weight: 700;
  text-transform: uppercase;
}

/* A shoved seat stays visibly all-in for the rest of the hand. */

.mini-hand-seat.allin {
  border-color: var(--felt-allin);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--felt-allin) 25%, transparent),
    0 16px 28px rgba(0, 0, 0, .32);
}

.mini-hand-seat.allin .seat-bet {
  color: var(--felt-allin);
}

/* Champagne wins on the award frame: the badge says what the seat COLLECTED.
   Equal specificity (0,2,0), so it must sit after the rule above. */

.mini-hand-seat.winner .seat-bet {
  color: var(--stack-gold);
}

/* ---- Replayer declutter ----
   .replay-felt renders hole cards and the ALL-IN badge OUTSIDE a short seat
   box so it never reaches the board/pot band; cards hang on the felt-centre
   side. Builder/wizard felts untouched. [data-size] out-ranks the per-size
   min-height rules below. */

.mini-felt-table.replay-felt[data-size] .mini-hand-seat {
  min-height: 0;
  gap: 0;
  padding: 4px 6px;
}

/* Compact box text (pos / name / stack) keeps side seats off the board. */

.replay-felt .mini-hand-seat {
  width: clamp(76px, 21vw, 94px);
}

.replay-felt .seat-number {
  font-size: 0.54rem;
  line-height: 1.15;
}

.replay-felt .seat-name {
  font-size: 0.74rem;
  line-height: 1.15;
}

.replay-felt .seat-stack {
  font-size: 0.62rem;
  line-height: 1.15;
}

/* The dealer's mark on a seat with no top line: before the name, never a line of its
   own, so the panel is as tall as the rest of the ring. */
.seat-name.dealer::before {
  content: "\24B9\00a0";
}


.replay-felt .mini-hand-seat .mini-cards {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  z-index: 2;
}

.replay-felt .mini-hand-seat.cards-above .mini-cards {
  bottom: calc(100% + 3px);
}

.replay-felt .mini-hand-seat.cards-below .mini-cards {
  top: calc(100% + 3px);
}

/* Pot just below centre so the lower column stays free for hero's cards. */

.replay-felt .replay-pot-stack {
  top: 57%;
}

/* Tighter board keeps the upper seats off the community cards at ≤6. */

.replay-felt .mini-board {
  gap: 4px;
}

/* A board card that does not play is greyed, not removed. Award frame only,
   winner's five only, only when the engine proved them. */
.mini-board .playing-card.card-idle {
  opacity: 0.42;
  filter: grayscale(0.65);
}

/* Badge out of the box's flow, so the seat box is a constant that never
   re-grows when its owner acts (betSpotFor() assumes this). Hangs on the
   OUTER side, away from board, pot and bets. */

.replay-felt .mini-hand-seat .seat-bet {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  min-height: 0;
  line-height: 1.1;
  font-size: 0.6rem;
  white-space: nowrap;
  /* Carries a hand name at showdown; capped so an edge seat cannot push it out. */
  max-width: 104px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.replay-felt .mini-hand-seat.cards-above .seat-bet {
  top: calc(100% + 2px);
}

/* The street's earlier action, kept under a plate that is not the one acting. */
.replay-felt .mini-hand-seat .seat-bet.persist {
  color: rgba(255, 255, 255, 0.68);
  font-weight: 600;
}

.replay-felt .mini-hand-seat.cards-below .seat-bet {
  bottom: calc(100% + 2px);
}

/* A seat nobody sat in is a pill, not a panel: on a 9-max with four players the
   five empty boxes took the room the live bets need. The eyebrow goes with it —
   the dealer button cannot land on an empty seat (placeButtonAtSeat refuses it
   and the dealer select is built from seated players only). Specificity (0,5,0)
   so it outranks the per-size width rules in the phone block below. */

.mini-felt-table.replay-felt[data-size] .mini-hand-seat.empty {
  width: auto;
  min-width: 0;
  padding: 2px 8px;
  background: transparent;
  border-style: dotted;
}

.replay-felt .mini-hand-seat.empty .seat-number,
.replay-felt .mini-hand-seat.empty .seat-stack {
  display: none;
}

.replay-felt .mini-hand-seat.empty .seat-name {
  font-size: 0.5rem;
  font-weight: 600;
  opacity: 0.6;
}

/* Realistic playing cards */

.playing-card {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 54px;
  border-radius: 6px;
  border: 1px solid #c7d0ca;
  background: #fdfdfb;
  box-shadow: 0 2px 5px rgba(12, 30, 24, 0.22);
  color: var(--card-ink);
  font-weight: 700;
  overflow: hidden;
}

/* Brighter than brick red, which read as brown at a 20px pip. */

.playing-card.card-red {
  color: var(--card-red);
}

.playing-card.card-black {
  color: var(--card-ink);
}

.playing-card .pc-corner {
  position: absolute;
  top: 3px;
  left: 4px;
  display: grid;
  justify-items: center;
  line-height: 0.9;
}

.playing-card .pc-rank {
  font-size: 0.74rem;
  font-weight: 700;
}

.playing-card .pc-suit {
  font-size: 0.6rem;
}

.playing-card .pc-pip {
  font-size: 1.5rem;
  line-height: 1;
}

.playing-card.card-unknown {
  color: var(--muted);
  background: var(--surface-2);
}

.playing-card.card-unknown .pc-rank {
  font-size: var(--t-control);
}

.playing-card.card-empty {
  border-style: dashed;
  border-color: var(--line);
  background: transparent;
  box-shadow: none;
}

.playing-card.card-back {
  border-color: #0b4637;
  background:
    repeating-linear-gradient(45deg, var(--card-back), var(--card-back) 4px, var(--card-back-dark) 4px, var(--card-back-dark) 8px);
}

.playing-card.card-mini {
  width: 24px;
  height: 34px;
  border-radius: 4px;
}

.playing-card.card-mini .pc-corner {
  top: 1px;
  left: 2px;
}

.playing-card.card-mini .pc-rank {
  font-size: 0.56rem;
}

.playing-card.card-mini .pc-suit {
  font-size: 0.44rem;
}

.playing-card.card-mini .pc-pip {
  font-size: 0.95rem;
}

/* The replayer's hole cards are FANNED, the way a hand is held: each card is
   bigger and the PAIR is narrower than the old side-by-side one. Side by side
   does not fit -- measured 2026-09-17 on the ring, where the binding gap between
   two seats is VERTICAL, so a narrower pair buys nothing and a taller card costs.
   Per table size and per width, because the ring tightens both ways: the tightest
   clearance measured is 8 px at 412 px and 6 px at 360. At 8 and 9 seats the fan
   BUYS room -- today those pairs sit 2 px apart. The builder/wizard felt keeps the
   plain pair; nothing there is read at a glance. */

.mini-felt-table.replay-felt[data-size] .mini-cards {
  gap: 0;
}

.mini-felt-table.replay-felt[data-size] .playing-card.card-mini {
  width: 32px;
  height: 44px;
  border-radius: 5px;
}

.mini-felt-table.replay-felt[data-size] .mini-cards .playing-card + .playing-card {
  margin-left: -13px;
}

.mini-felt-table.replay-felt[data-size] .playing-card.card-mini .pc-rank {
  font-size: 0.74rem;
}

.mini-felt-table.replay-felt[data-size] .playing-card.card-mini .pc-suit {
  font-size: 0.58rem;
}

.mini-felt-table.replay-felt[data-size] .playing-card.card-mini .pc-pip {
  font-size: 1.25rem;
}

@media (max-width: 820px) {
  .mini-felt-table.replay-felt[data-size="7"] .playing-card.card-mini {
    width: 24px;
    height: 33px;
  }

  .mini-felt-table.replay-felt[data-size="7"] .mini-cards .playing-card + .playing-card {
    margin-left: -9px;
  }

  .mini-felt-table.replay-felt[data-size="7"] .playing-card.card-mini .pc-rank {
    font-size: 0.56rem;
  }

  .mini-felt-table.replay-felt[data-size="7"] .playing-card.card-mini .pc-suit {
    font-size: 0.44rem;
  }

  .mini-felt-table.replay-felt[data-size="7"] .playing-card.card-mini .pc-pip {
    font-size: 0.95rem;
  }

  .mini-felt-table.replay-felt[data-size="8"] .playing-card.card-mini {
    width: 20px;
    height: 28px;
  }

  .mini-felt-table.replay-felt[data-size="8"] .mini-cards .playing-card + .playing-card {
    margin-left: -8px;
  }

  .mini-felt-table.replay-felt[data-size="8"] .playing-card.card-mini .pc-rank {
    font-size: 0.5rem;
  }

  .mini-felt-table.replay-felt[data-size="8"] .playing-card.card-mini .pc-suit {
    font-size: 0.4rem;
  }

  .mini-felt-table.replay-felt[data-size="8"] .playing-card.card-mini .pc-pip {
    font-size: 0.8rem;
  }

  .mini-felt-table.replay-felt[data-size="9"] .playing-card.card-mini {
    width: 18px;
    height: 25px;
  }

  .mini-felt-table.replay-felt[data-size="9"] .mini-cards .playing-card + .playing-card {
    margin-left: -7px;
  }

  .mini-felt-table.replay-felt[data-size="9"] .playing-card.card-mini .pc-rank {
    font-size: 0.48rem;
  }

  .mini-felt-table.replay-felt[data-size="9"] .playing-card.card-mini .pc-suit {
    font-size: 0.38rem;
  }

  .mini-felt-table.replay-felt[data-size="9"] .playing-card.card-mini .pc-pip {
    font-size: 0.75rem;
  }

  .mini-felt-table.replay-felt[data-size="10"] .playing-card.card-mini {
    width: 15px;
    height: 21px;
  }

  .mini-felt-table.replay-felt[data-size="10"] .mini-cards .playing-card + .playing-card {
    margin-left: -6px;
  }

  .mini-felt-table.replay-felt[data-size="10"] .playing-card.card-mini .pc-rank {
    font-size: 0.45rem;
  }

  .mini-felt-table.replay-felt[data-size="10"] .playing-card.card-mini .pc-suit {
    font-size: 0.35rem;
  }

  .mini-felt-table.replay-felt[data-size="10"] .playing-card.card-mini .pc-pip {
    font-size: 0.7rem;
  }

}

/* A 360 px phone has no room to spare: there the fan moderates the size and keeps
   the clearance instead. */
@media (max-width: 399px) {
  .mini-felt-table.replay-felt[data-size] .playing-card.card-mini {
    width: 27px;
    height: 38px;
  }

  .mini-felt-table.replay-felt[data-size] .mini-cards .playing-card + .playing-card {
    margin-left: -11px;
  }

  .mini-felt-table.replay-felt[data-size] .playing-card.card-mini .pc-rank {
    font-size: 0.6rem;
  }

  .mini-felt-table.replay-felt[data-size] .playing-card.card-mini .pc-suit {
    font-size: 0.48rem;
  }

  .mini-felt-table.replay-felt[data-size] .playing-card.card-mini .pc-pip {
    font-size: 1.05rem;
  }

  .mini-felt-table.replay-felt[data-size="7"] .playing-card.card-mini {
    width: 19px;
    height: 27px;
  }

  .mini-felt-table.replay-felt[data-size="7"] .mini-cards .playing-card + .playing-card {
    margin-left: -8px;
  }

  .mini-felt-table.replay-felt[data-size="7"] .playing-card.card-mini .pc-rank {
    font-size: 0.56rem;
  }

  .mini-felt-table.replay-felt[data-size="7"] .playing-card.card-mini .pc-suit {
    font-size: 0.44rem;
  }

  .mini-felt-table.replay-felt[data-size="7"] .playing-card.card-mini .pc-pip {
    font-size: 0.95rem;
  }

  .mini-felt-table.replay-felt[data-size="8"] .playing-card.card-mini {
    width: 17px;
    height: 23px;
  }

  .mini-felt-table.replay-felt[data-size="8"] .mini-cards .playing-card + .playing-card {
    margin-left: -7px;
  }

  .mini-felt-table.replay-felt[data-size="8"] .playing-card.card-mini .pc-rank {
    font-size: 0.48rem;
  }

  .mini-felt-table.replay-felt[data-size="8"] .playing-card.card-mini .pc-suit {
    font-size: 0.38rem;
  }

  .mini-felt-table.replay-felt[data-size="8"] .playing-card.card-mini .pc-pip {
    font-size: 0.7rem;
  }

  .mini-felt-table.replay-felt[data-size="9"] .playing-card.card-mini {
    width: 15px;
    height: 21px;
  }

  .mini-felt-table.replay-felt[data-size="9"] .mini-cards .playing-card + .playing-card {
    margin-left: -6px;
  }

  .mini-felt-table.replay-felt[data-size="9"] .playing-card.card-mini .pc-rank {
    font-size: 0.44rem;
  }

  .mini-felt-table.replay-felt[data-size="9"] .playing-card.card-mini .pc-suit {
    font-size: 0.35rem;
  }

  .mini-felt-table.replay-felt[data-size="9"] .playing-card.card-mini .pc-pip {
    font-size: 0.6rem;
  }

  .mini-felt-table.replay-felt[data-size="10"] .playing-card.card-mini {
    width: 15px;
    height: 21px;
  }

  .mini-felt-table.replay-felt[data-size="10"] .mini-cards .playing-card + .playing-card {
    margin-left: -6px;
  }

  .mini-felt-table.replay-felt[data-size="10"] .playing-card.card-mini .pc-rank {
    font-size: 0.45rem;
  }

  .mini-felt-table.replay-felt[data-size="10"] .playing-card.card-mini .pc-suit {
    font-size: 0.35rem;
  }

  .mini-felt-table.replay-felt[data-size="10"] .playing-card.card-mini .pc-pip {
    font-size: 0.7rem;
  }

}
.mini-cards {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

/* ---- THE TUCKED FELT: every felt the engine draws (`fitted` marks the full-screen phone replay) ----
   --bw board card, --hw hole card, --pw plate (per table size); --cw is the row's card width. `roomy`: up
   to six. The pixels below are the fitted felt's, and the fallback of every other one. */

.replay-felt.tucked {
  --bw: 40px;
  --hw: 34px;
  --pw: clamp(80px, 23vw, 88px);
}

.replay-felt.tucked[data-size="2"] { --hw: 38px; }
.replay-felt.tucked[data-size="3"] { --hw: 38px; }
.replay-felt.tucked[data-size="4"] { --pw: clamp(78px, 22.5vw, 84px); }
.replay-felt.tucked[data-size="7"] { --hw: 30px; --pw: clamp(82px, 21.4vw, 88px); }
.replay-felt.tucked[data-size="8"] { --hw: 28px; --pw: clamp(64px, 22vw, 92px); }
.replay-felt.tucked[data-size="9"] { --hw: 26px; --pw: clamp(60px, 21vw, 88px); }
.replay-felt.tucked[data-size="10"] { --hw: 24px; --pw: clamp(56px, 20vw, 84px); }

@media (min-width: 400px) {
  .replay-felt.tucked { --hw: 40px; --pw: clamp(88px, 24vw, 100px); }
  .replay-felt.tucked[data-size="2"] { --hw: 46px; }
  .replay-felt.tucked[data-size="3"] { --hw: 46px; }
  .replay-felt.tucked[data-size="4"] { --pw: clamp(84px, 22vw, 92px); }
  .replay-felt.tucked[data-size="7"] { --hw: 34px; }
  .replay-felt.tucked[data-size="8"] { --hw: 30px; }
  .replay-felt.tucked[data-size="9"] { --hw: 28px; }
  .replay-felt.tucked[data-size="10"] { --hw: 26px; }
}

/* Every felt not fitted to a screen is a container: cards and plates are a share of ITS cloth (the 360x640
   numbers). Not the fitted one: a container on every felt doubled the replay suite's run time. The pixels
   above are the fitted felt's and the fallback of a browser with no container units. */
@supports (width: 1cqw) {
  .replay-felt.tucked:not(.fitted) { container-type: inline-size; --bw: 12.4cqw; --hw: 10.5cqw; --pw: 25.6cqw; }
  .replay-felt.tucked:not(.fitted)[data-size="2"] { --hw: 11.7cqw; }
  .replay-felt.tucked:not(.fitted)[data-size="3"] { --hw: 11.7cqw; }
  .replay-felt.tucked:not(.fitted)[data-size="4"] { --pw: 25cqw; }
  .replay-felt.tucked:not(.fitted)[data-size="7"] { --hw: 9.3cqw; --pw: 23.8cqw; }
  .replay-felt.tucked:not(.fitted)[data-size="8"] { --hw: 8.6cqw; --pw: 24.4cqw; }
  .replay-felt.tucked:not(.fitted)[data-size="9"] { --hw: 8cqw; --pw: 23.3cqw; }
  .replay-felt.tucked:not(.fitted)[data-size="10"] { --hw: 7.4cqw; --pw: 22.2cqw; }
}

.replay-felt.tucked .mini-board {
  --cw: var(--bw);
  gap: 3px;
}

.replay-felt.tucked .mini-cards {
  --cw: var(--hw);
}

.replay-felt.tucked[data-size] .playing-card.card-mini {
  width: var(--cw);
  height: calc(var(--cw) * 1.4);
  border-radius: calc(var(--cw) * .14);
}

.replay-felt.tucked[data-size] .mini-cards .playing-card + .playing-card {
  margin-left: calc(var(--cw) * -.42);
}

.replay-felt.tucked[data-size] .playing-card.card-mini .pc-rank {
  font-size: calc(var(--cw) * .37);
}

.replay-felt.tucked[data-size] .playing-card.card-mini .pc-suit {
  font-size: calc(var(--cw) * .29);
}

.replay-felt.tucked[data-size] .playing-card.card-mini .pc-pip {
  font-size: calc(var(--cw) * .62);
}

/* The engine's rulers for a hole card and for the hand's widest bet: laid out, never seen. */
.replay-felt .hole-ghost,
.replay-felt .pill-ghost {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  pointer-events: none;
}

.replay-felt.tucked[data-size] .mini-hand-seat {
  width: var(--pw);
}

/* A hand is scaled by --hand-k from the plate's edge and hidden behind it by --hand-tuck of its own
   height; the rules below pick the pair the hand has (the engine writes --hero-*, --show-*). */
.replay-felt.tucked .mini-hand-seat .mini-cards:has(.playing-card) {
  --hand-k: 1;
  --hand-tuck: var(--hole-tuck);
  bottom: 100%;
  transform-origin: 50% 100%;
  transform: translate(-50%, calc(var(--hand-k) * var(--hand-tuck) * 100%)) scale(var(--hand-k));
  clip-path: inset(0 0 calc(var(--hand-tuck) * 100%) 0);
}

.replay-felt.tucked .mini-hand-seat.hero .mini-cards:has(.playing-card) {
  --hand-k: var(--hero-k);
  --hand-tuck: var(--hero-tuck);
}

/* Showdown: a rival's cards leave the plate as far as the felt has room (--show-tuck) and grow by
   --show-k; the winner's rise a little by showing more of themselves; the losers' are dimmed. */
.replay-felt.tucked .mini-hand-seat:not(.hero) .mini-cards.showdown-reveal:has(.playing-card) {
  --hand-k: var(--show-k);
  --hand-tuck: var(--show-tuck, 0);
}

.replay-felt.tucked .mini-hand-seat.winner .mini-cards.showdown-reveal:has(.playing-card) {
  transform: translate(-50%, calc(var(--hand-k) * var(--hand-tuck) * 100% - var(--win-lift))) scale(var(--hand-k));
  clip-path: inset(0 0 calc(var(--hand-tuck) * 100% - var(--win-lift) / var(--hand-k)) 0);
}

.replay-felt.tucked.has-winner .mini-hand-seat:not(.winner) .mini-cards.showdown-reveal {
  opacity: .5;
}

/* Text on a tucked plate comes off the type scale: bigger up to six seats (a step down on a narrow
   phone), 7 keeps its own, 8-10 get a bigger name and stack in a wider plate. */
.replay-felt.tucked.roomy .seat-name {
  font-size: var(--t-micro);
}

.replay-felt.tucked.roomy .seat-stack {
  font-size: .7rem;
}

.replay-felt.tucked.roomy .seat-number {
  font-size: .56rem;
}

.replay-felt.tucked.roomy .mini-hand-seat .seat-bet {
  font-size: .7rem;
}

@media (min-width: 400px) {
  .replay-felt.tucked.roomy .seat-name {
    font-size: .8rem;
  }

  .replay-felt.tucked.roomy .seat-stack {
    font-size: var(--t-note);
  }

  .replay-felt.tucked.roomy .seat-number {
    font-size: .6rem;
  }
}

.replay-felt.tucked:not(.roomy):not([data-size="7"]) .seat-name {
  font-size: .8rem;
}

.replay-felt.tucked:not(.roomy):not([data-size="7"]) .seat-stack {
  font-size: var(--t-micro);
}

/* A felt with under 300px of cloth (the Home hero, a narrow share page): the compact plate the old felt had. */
@container (max-width: 300px) {
  .mini-felt-table.replay-felt.tucked:not(.fitted)[data-size] .seat-name {
    font-size: .74rem;
  }

  .mini-felt-table.replay-felt.tucked:not(.fitted)[data-size] .seat-stack {
    font-size: .62rem;
  }

  .mini-felt-table.replay-felt.tucked:not(.fitted)[data-size] .seat-number {
    font-size: .54rem;
  }

  .mini-felt-table.replay-felt.tucked:not(.fitted)[data-size] .mini-hand-seat .seat-bet {
    font-size: .62rem;
  }
}

.replay-felt.tucked .replay-chip .chip-amt,
.replay-felt.tucked .pill-ghost .chip-amt {
  font-size: .8rem;
  padding: 4px 9px;
}

/* Nine and ten seats have no room for a wide pill: a step down, the ghost follows. */
.replay-felt.tucked[data-size="9"] .replay-chip .chip-amt,
.replay-felt.tucked[data-size="9"] .pill-ghost .chip-amt,
.replay-felt.tucked[data-size="10"] .replay-chip .chip-amt,
.replay-felt.tucked[data-size="10"] .pill-ghost .chip-amt {
  font-size: var(--t-micro-tight);
  padding: 3px 6px;
}

.replay-felt.tucked .replay-pot-stack {
  max-width: 40%;
  padding: 6px 10px;
}

.replay-felt.tucked .pot-total,
.replay-felt.tucked .pot-award-line {
  font-size: var(--t-body);
}

.replay-felt.tucked .pot-disc {
  width: 18px;
  height: 18px;
}

/* Smaller seat cards at 7-max and up; seatPosition() staggers alternate seats. */

.mini-felt-table[data-size="7"] .mini-hand-seat {
  width: 114px;
  min-height: 78px;
  padding: 5px;
}

.mini-felt-table[data-size="8"] .mini-hand-seat {
  width: 102px;
  min-height: 70px;
  padding: 4px;
  gap: 1px;
}

.mini-felt-table[data-size="9"] .mini-hand-seat {
  width: 92px;
  min-height: 66px;
  padding: 3px;
  gap: 1px;
}

.mini-felt-table[data-size="10"] .mini-hand-seat {
  width: 84px;
  min-height: 60px;
  padding: 3px;
  gap: 1px;
}

.mini-felt-table[data-size="7"] .seat-name {
  font-size: 0.8rem;
}

.mini-felt-table[data-size="8"] .seat-name {
  font-size: var(--t-micro);
}

.mini-felt-table[data-size="9"] .seat-name {
  font-size: var(--t-micro-tight);
}

.mini-felt-table[data-size="10"] .seat-name {
  font-size: 0.68rem;
}

.mini-felt-table[data-size="7"] .seat-stack,
.mini-felt-table[data-size="7"] .seat-bet {
  font-size: var(--t-micro-tight);
}

.mini-felt-table[data-size="8"] .seat-stack,
.mini-felt-table[data-size="8"] .seat-bet {
  font-size: 0.7rem;
}

.mini-felt-table[data-size="9"] .seat-stack,
.mini-felt-table[data-size="9"] .seat-bet {
  font-size: 0.66rem;
}

.mini-felt-table[data-size="10"] .seat-stack,
.mini-felt-table[data-size="10"] .seat-bet {
  font-size: 0.62rem;
}

/* The replay felt keeps its own scale on purpose: a 12 px floor here was measured
   and refused, because at 7 and at 10 seats the taller boxes put settled bets on a
   neighbour's action badge and hole cards on a neighbour's (replay-chip-spots,
   replay-felt-size). The per-size rules above are what buys the room. */

/* Empty rows still cost grid height — collapse them. */

.mini-hand-seat .seat-bet:empty,
.mini-hand-seat .mini-cards:empty {
  display: none;
}

/* Showdown theatre: reveals flip in, mucks fade, the pot pulses once. */

.mini-cards.showdown-reveal .playing-card {
  animation: cardReveal 0.5s ease both;
  animation-delay: var(--reveal-delay, 0ms);
}

/* A show turns its hand over on the step that says SHOW, in the plate's tuck, with the flip the showdown uses. */
.mini-cards.turned .playing-card {
  animation: cardReveal 0.5s ease both;
}

/* A hand already face up on the frame before (the hero's, or one tabled earlier) does not flip again. */
.mini-cards.showdown-reveal.already-up .playing-card {
  animation: none;
}

@keyframes cardReveal {
  from {
    transform: rotateY(90deg) scale(0.6);
    opacity: 0;
  }
  60% {
    transform: rotateY(0deg) scale(1.12);
    opacity: 1;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.mini-cards.muck-fade {
  animation: muckFade 0.6s ease both;
}

@keyframes muckFade {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0.45;
    transform: translateY(3px);
  }
}

.replay-pot-stack.showdown-pot .chip-disc {
  animation: potPulse 0.7s ease 0.3s;
}

/* Pot award: winner glows, a transient chip flies to the seat. The chip is its
   OWN element so .replay-pot-stack never moves or resizes (held by tests). */

.mini-hand-seat.winner {
  border-color: var(--stack-gold);
  box-shadow: 0 0 0 1px var(--stack-gold), 0 0 14px rgba(244, 207, 106, 0.55);
}

.pot-award-line {
  color: var(--stack-gold);
  font-size: var(--t-micro);
  font-weight: 700;
  white-space: nowrap;
}

/* Launches from the disc, not the box centre, or it sits on the award line (--fly-start and --fly-start-x,
   measured by placeFeltChips; custom properties because an animation outranks inline style), and is
   invisible until the flight starts: in its 0.65 s wait it would cover the line it is named after. */
.pot-fly {
  position: absolute;
  left: var(--fly-start-x, 50%);
  top: var(--fly-start, calc(57% - 12px));
  transform: translate(-50%, -50%);
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  animation: potFly 0.9s ease-in-out 0.65s forwards;
}

.pot-fly .chip-disc {
  width: 22px;
  height: 22px;
}

@keyframes potFly {
  0% { left: var(--fly-start-x, 50%); top: var(--fly-start, calc(57% - 12px)); opacity: 1; }
  80% { opacity: 1; }
  100% { left: var(--fly-x, 50%); top: var(--fly-y, 20%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pot-fly { animation: none; opacity: 0; }
}

@keyframes potPulse {
  0%, 100% {
    transform: none;
  }
  50% {
    transform: scale(1.35);
  }
}

/* The prize lands once the hands are up: after the last flip (--flips-end, written by the engine) the
   winner's hand eases up from where the others stand and the others dim. Not on a frame drawn again. */
.replay-felt.tucked:not(.redrawn) .mini-hand-seat.winner .mini-cards.showdown-reveal:has(.playing-card) {
  animation: winLift 0.3s ease-out var(--flips-end, 0ms) backwards;
}

.replay-felt.tucked.has-winner:not(.redrawn) .mini-hand-seat:not(.winner) .mini-cards.showdown-reveal {
  animation: loserDim 0.3s ease var(--flips-end, 0ms) backwards;
}

/* A hand tabled on an all-in runout sits tucked at the face-down size; at the showdown it takes the
   showdown's size and place with no flip to hide the move, so it eases there (and the loser dims with it). */
.replay-felt.tucked:not(.redrawn) .mini-hand-seat:not(.hero) .mini-cards.showdown-reveal.already-up:has(.playing-card) {
  animation: tabledRise 0.3s ease-out backwards;
}

.replay-felt.tucked.has-winner:not(.redrawn) .mini-hand-seat:not(.winner):not(.hero) .mini-cards.showdown-reveal.already-up:has(.playing-card) {
  animation: tabledRise 0.3s ease-out backwards, loserDim 0.3s ease var(--flips-end, 0ms) backwards;
}

@keyframes tabledRise {
  from {
    transform: translate(-50%, calc(var(--hole-tuck) * 100%)) scale(1);
    clip-path: inset(0 0 calc(var(--hole-tuck) * 100%) 0);
  }
}

@keyframes winLift {
  from {
    transform: translate(-50%, calc(var(--hand-k) * var(--hand-tuck) * 100%)) scale(var(--hand-k));
    clip-path: inset(0 0 calc(var(--hand-tuck) * 100%) 0);
  }
}

@keyframes loserDim {
  from { opacity: 1; }
}

/* A street's cards turn over where they lie, one after another at the deal sound's pace. The back stays up
   through the delay and the first half of the turn, so no slot is ever empty; the border follows it. */
.mini-board .playing-card.board-deal {
  animation: boardTurn 420ms ease-out backwards;
  animation-delay: calc(var(--deal-i, 0) * 110ms);
}

.mini-board .playing-card.board-deal::after,
.mini-cards .playing-card.hole-turn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(45deg, var(--card-back), var(--card-back) 4px, var(--card-back-dark) 4px, var(--card-back-dark) 8px);
  opacity: 0;
  animation: boardBack 420ms step-end backwards;
  animation-delay: var(--deal-delay, calc(var(--deal-i, 0) * 110ms));
}

@keyframes boardTurn {
  0%, 49.9% { border-color: var(--card-back-dark); }
  50% { transform: scaleX(0); }
}

@keyframes boardBack {
  from { opacity: 1; }
  50% { opacity: 0; }
}

/* The opening deal: a hand's cards rise from behind their plate, seat by seat (--deal-delay, written by the
   engine); a face-up hand also turns with the board's flip. A rival's backs only rise, as dealt face down. */
.mini-cards .playing-card.hole-deal {
  animation: holeDeal 420ms ease-out backwards;
  animation-delay: var(--deal-delay, 0ms);
}

.mini-cards .playing-card.hole-deal.hole-turn {
  animation: holeDeal 420ms ease-out backwards, boardTurn 420ms ease-out backwards;
  animation-delay: var(--deal-delay, 0ms);
}

@keyframes holeDeal {
  from { translate: 0 45%; opacity: 0; }
  50% { opacity: 1; }
}

/* A fold sends the folder's backs a little toward the middle and out; the seat greys over the same beat.
   At rest (and under reduced motion) the cards are gone, as a folded seat has always shown. */
.mini-hand-seat .mini-cards.folding {
  opacity: 0;
  pointer-events: none;
  animation: foldAway 250ms ease-in backwards;
}

.mini-hand-seat.folded.folding {
  animation: foldDim 250ms ease-out backwards;
}

@keyframes foldAway {
  from { opacity: 1; translate: 0 0; }
  to { opacity: 0; translate: calc(var(--toss-x, 0) * var(--cw) * .6) calc(var(--toss-y, 0) * var(--cw) * .6); }
}

@keyframes foldDim {
  from { opacity: 1; }
}

/* A frame drawn again onto the felt that showed it (the unit toggle, a resize, a language switch) lands
   settled: each entry animation is over at once, in the state it ends in, so only the motion is left out. */
.replay-felt.redrawn .showdown-reveal .playing-card,
.replay-felt.redrawn .turned .playing-card,
.replay-felt.redrawn .mini-board .playing-card.board-deal,
.replay-felt.redrawn .mini-board .playing-card.board-deal::after,
.replay-felt.redrawn .muck-fade,
.replay-felt.redrawn .showdown-pot .chip-disc,
.replay-felt.redrawn .replay-chip,
.replay-felt.redrawn .pot-fly,
.replay-felt.redrawn .chip-sweep {
  animation-duration: 0s;
  animation-delay: 0s;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(270px, 360px) 1fr;
  }

  body[data-view="database"] .workspace {
    grid-template-columns: minmax(270px, 360px) 1fr;
  }

  body[data-view="record"] .workspace {
    grid-template-columns: minmax(0, 980px);
  }

  .editor-panel {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .player-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* >, not a descendant: label:last-of-type reached the picker label inside
     .photo-editor and spanned it across the photo row. */

  .player-form > label:last-of-type,
  .form-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding-left: var(--s-4);
    padding-right: var(--s-4);
    padding-bottom: 6rem;
  }

  /* iOS Safari zooms into inputs under 16px; keep form text at 16px on phones. */

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .workspace {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar {
    min-height: 54px;
    margin-bottom: 10px;
  }

  .workspace {
    gap: 12px;
  }

  /* Home on phones: tighter gaps; card heights stay fluid. */

  .home-view {
    gap: 10px;
  }

  .home-actions {
    gap: 10px;
  }

  .home-choice {
    min-height: 78px;
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    gap: 12px;
    padding: 10px 12px;
  }

  .home-choice span {
    font-size: var(--t-small);
  }

  .home-choice strong {
    font-size: var(--t-body);
  }

  body[data-view="database"] .workspace,
  body[data-view="record"] .workspace,
  body[data-view="session"] .workspace,
  body[data-view="stats"] .workspace {
    grid-template-columns: 1fr;
  }

  /* One column: no detail column to explain, so no placeholder. */
  .editor-empty {
    display: none;
  }

  /* One column: a profile is a SCREEN, not a section under the roster. The
     roster steps aside while one is open and the back control brings it back. */
  body[data-view="database"][data-profile-open="true"] .database-panel {
    display: none;
  }

  .editor-back {
    display: inline-flex;
  }

  .database-panel,
  .editor-panel {
    min-height: auto;
  }

  /* No max-height here: a cap with no overflow paints content outside its box,
     and .app-shell's 100dvh keeps the page one viewport tall — unreachable rows.
     The value that reaches a phone is the one inside the media query. */

  /* Keep the Settings gear right-aligned in the topbar on phones. */

  .topbar-tools {
    justify-content: flex-end;
  }

  .action-row,
  .action-item {
    grid-template-columns: 1fr;
  }

  /* Single-line seat rows: ~290px, so fixed columns are trimmed. */

  .hand-seat-row {
    grid-template-columns: minmax(44px, auto) minmax(0, 1fr) 56px 72px;
    gap: 6px;
  }

  .hand-seat-row input {
    padding-inline: 8px;
  }

  .hand-setup {

  }

  /* Board cards stay on one compact row — they are tiny 3-char inputs. */

  .board-entry {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .hand-visual-table {
    min-height: 390px;
  }

  /* Near square on a phone, where a stadium is a circle and the plates of 2-7 seats hang off its
     rim by up to 21px: the rounded square stays. 8-10 are tall enough to be a stadium. */
  .mini-felt-table {
    width: 96%;
    aspect-ratio: 1.05;
    border-radius: 34%;
  }

  /* Taller than the builder's felt: hero's cards, board and pot stack down the
     centre. 7-10 keep their own aspects below. */

  .mini-felt-table.replay-felt {
    aspect-ratio: 0.86;
  }

  .mini-hand-seat {
    width: clamp(92px, 24.8vw, 102px);
    min-height: 76px;
  }

  /* Crowded felts: taller ellipse + smaller cards so the ring never overlaps. */

  .mini-felt-table[data-size="7"] {
    aspect-ratio: 0.98;
  }

  .mini-felt-table[data-size="8"] {
    aspect-ratio: 0.88;
    border-radius: var(--r-pill);
  }

  .mini-felt-table[data-size="9"] {
    aspect-ratio: 0.8;
    border-radius: var(--r-pill);
  }

  .mini-felt-table[data-size="10"] {
    aspect-ratio: 0.74;
    border-radius: var(--r-pill);
  }

  .mini-felt-table[data-size="7"] .mini-hand-seat {
    width: clamp(82px, 21.4vw, 88px);
    min-height: 62px;
    padding: 4px;
  }

  .mini-felt-table[data-size="8"] .mini-hand-seat {
    width: clamp(72px, 19.4vw, 80px);
    min-height: 54px;
    padding: 3px;
  }

  .mini-felt-table[data-size="9"] .mini-hand-seat {
    width: clamp(64px, 18vw, 74px);
    min-height: 48px;
    padding: 3px;
  }

  .mini-felt-table[data-size="10"] .mini-hand-seat {
    width: clamp(58px, 16vw, 66px);
    min-height: 45px;
    padding: 2px;
  }

  .mini-felt-table[data-size="7"] .playing-card.card-mini {
    width: 19px;
    height: 27px;
  }

  .mini-felt-table[data-size="7"] .pc-pip {
    font-size: var(--t-note);
  }

  .mini-felt-table[data-size="8"] .playing-card.card-mini {
    width: 16px;
    height: 23px;
  }

  .mini-felt-table[data-size="8"] .pc-rank {
    font-size: 0.48rem;
  }

  .mini-felt-table[data-size="8"] .pc-suit {
    font-size: 0.38rem;
  }

  .mini-felt-table[data-size="8"] .pc-pip {
    font-size: 0.7rem;
  }

  .mini-felt-table[data-size="9"] .playing-card.card-mini {
    width: 14px;
    height: 20px;
  }

  .mini-felt-table[data-size="9"] .pc-rank {
    font-size: 0.44rem;
  }

  .mini-felt-table[data-size="9"] .pc-suit {
    font-size: 0.35rem;
  }

  .mini-felt-table[data-size="9"] .pc-pip {
    font-size: 0.6rem;
  }

  .mini-felt-table[data-size="10"] .playing-card.card-mini {
    width: 13px;
    height: 18px;
  }

  .mini-felt-table[data-size="10"] .pc-rank {
    font-size: 0.4rem;
  }

  .mini-felt-table[data-size="10"] .pc-suit {
    font-size: 0.35rem;
  }

  .mini-felt-table[data-size="10"] .pc-pip {
    font-size: 0.5rem;
  }

  .form-grid,
  .session-grid,
  .score-row,
  .end-session-grid,
  .emotion-grid,
  .session-metrics,
  .stats-summary {
    /* 2×2 tiles: four stacked full-width tiles waste half a screen on phones */
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* An odd tile out closes the grid across both columns instead of leaving a hole. */
  .stats-summary > .metric-tile:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  /* One column: the two-column grid only paired Name with the photo row, and a
     photo row in a half column stacked into ~188px of height. */

  .player-form {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .voice-controls {
    flex-wrap: wrap;
  }

  .panel-heading,
  .form-actions {
    flex-wrap: wrap;
  }

  .voice-settings {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The floor is what the bottom seat ACTUALLY needs: measured, it reaches 378px below
     the top of the box on a 412px phone. Below the floor the modal scrolls, which is the
     escape hatch it already has; at 300 the row was squeezed and the seat was cut. */
  .replay-table {
    min-height: 400px;
  }

  .live-seat-panel,
  .rebuy-panel,
  .live-seat-controls,
  .rebuy-controls,
  .builder-head,
  .immersive-sizing {
    grid-template-columns: 1fr;
  }


  .builder-head {
    display: grid;
  }

  /* Undo / Next Street / Replay on one row: stacked they cost three rows. */

  .builder-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .builder-actions button {
    padding-inline: 8px;
    font-size: var(--t-note);
  }

  /* Fold · Check/Call · Bet/Raise · All-in: one row of four; chips span it. */

  .immersive-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .immersive-action,
  .immersive-primary {
    min-height: 52px;
    font-size: var(--t-note);
    padding-inline: 6px;
  }

  /* Dealer / Ante / Straddle / Str.BB / Rotate / Reset: 2-up grid, not six rows. */

  .immersive-dealer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  /* No width: the row shrinks to its one button so the heading keeps it beside the
     tabs. .panel-heading wraps, so a phone too narrow for both drops it to its own
     line by itself -- measured: it fits from 412px, not at 360px. */
  #recordToolButtons {
    flex-wrap: wrap;
  }

  /* min-width: 0 against the flex default of auto, which stopped the label
     shrinking and overflowed the page at 320px and again at 150% text. */
  #recordToolButtons button {
    min-width: 0;
    padding-inline: 8px;
    font-size: var(--t-note);
  }

  /* Everything full-width: an open seat shows Create Here, a taken one Clear seat,
     never both. */

  .live-seat-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .live-seat-controls > * {
    grid-column: 1 / -1;
  }

  /* Warm-up wizard: five mood chips must fit one row inside the nested card. */

  .wizard-options {
    gap: 6px;
  }

  .wizard-chip {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 10px;
  }

  .stage-toact {
    grid-template-columns: auto 1fr;
    row-gap: 8px;
  }

  .stage-facing {
    grid-column: 1 / -1;
    text-align: left;
    flex-direction: row;
  }

  .sequence-street {
    grid-template-columns: 60px 1fr;
  }

  .live-table-wrap {
    min-height: 0;
  }

  .live-felt-table {
    --seat-rx: 56px;
    --seat-ry: 36px;
    width: 100%;
    aspect-ratio: 0.9;
    border-width: 8px;
  }

  /* Compact seat cards; the per-seat read line lives in the panel below. */

  /* vw-clamped: max at 412px, min the safe size at 360px. */

  .live-seat {
    width: clamp(100px, 27.7vw, 114px);
    min-height: 60px;
    padding: 4px 5px;
    column-gap: 5px;
    grid-template-columns: 20px 1fr;
    border-width: 1.5px;
  }

  /* span 3 keeps all text lines in the wide column. */

  .live-seat .seat-avatar {
    width: 20px;
    height: 20px;
    grid-row: 1 / span 3;
    font-size: 0.58rem;
  }

  .live-seat strong {
    font-size: 0.7rem;
  }

  .live-seat .live-seat-number {
    font-size: 0.54rem;
  }

  .live-seat .live-seat-stack {
    font-size: 0.64rem;
  }

  .live-seat .live-seat-read {
    display: none;
  }

  /* Smaller cards + taller felt so seats never overlap at ~412px (verify through
     an iframe — the headless window clamps to ~500px). */

  .live-felt-table[data-size="7"] {
    --seat-rx: 45px;
    --seat-ry: 29px;
    aspect-ratio: 0.82;
  }

  .live-felt-table[data-size="7"] .live-seat {
    width: clamp(84px, 22.8vw, 94px);
    min-height: 52px;
  }

  .live-felt-table[data-size="8"] {
    --seat-rx: 40px;
    --seat-ry: 26px;
    aspect-ratio: 0.76;
  }

  .live-felt-table[data-size="8"] .live-seat {
    width: clamp(74px, 20.4vw, 84px);
    min-height: 48px;
    padding: 4px;
    column-gap: 4px;
    grid-template-columns: 16px 1fr;
  }

  .live-felt-table[data-size="8"] .seat-avatar {
    width: 16px;
    height: 16px;
    font-size: 0.5rem;
  }

  .live-felt-table[data-size="8"] .live-seat strong {
    font-size: 0.6rem;
  }

  .live-felt-table[data-size="8"] .live-seat-number,
  .live-felt-table[data-size="8"] .live-seat-stack {
    font-size: 0.58rem;
  }

  .live-felt-table[data-size="9"] {
    --seat-rx: 36px;
    --seat-ry: 23px;
    aspect-ratio: 0.7;
  }

  .live-felt-table[data-size="9"] .live-seat {
    width: clamp(66px, 18.4vw, 76px);
    min-height: 45px;
    padding: 3px;
    column-gap: 3px;
    grid-template-columns: 15px 1fr;
  }

  .live-felt-table[data-size="9"] .seat-avatar {
    width: 15px;
    height: 15px;
    font-size: 0.48rem;
  }

  .live-felt-table[data-size="9"] .live-seat strong {
    font-size: 0.58rem;
  }

  .live-felt-table[data-size="9"] .live-seat-number,
  .live-felt-table[data-size="9"] .live-seat-stack {
    font-size: 0.55rem;
  }

  .live-felt-table[data-size="10"] {
    --seat-rx: 33px;
    --seat-ry: 21px;
    aspect-ratio: 0.64;
  }

  .live-felt-table[data-size="10"] .live-seat {
    width: clamp(60px, 16.5vw, 68px);
    min-height: 42px;
    padding: 2px 3px;
    column-gap: 3px;
    grid-template-columns: 14px 1fr;
  }

  .live-felt-table[data-size="10"] .seat-avatar {
    width: 14px;
    height: 14px;
    font-size: 0.45rem;
  }

  .live-felt-table[data-size="10"] .live-seat strong {
    font-size: 0.55rem;
  }

  .live-felt-table[data-size="10"] .live-seat-number,
  .live-felt-table[data-size="10"] .live-seat-stack {
    font-size: 0.5rem;
  }
}

/* An open seat is only its number in a dashed ring: the dashes already say "open",
   so the seats with a player are what the eye finds. After the size rules, to win. */
.live-felt-table .live-seat.empty {
  display: grid;
  grid-template: 1fr / 1fr;
  place-items: center;
  width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.live-felt-table .live-seat.empty .seat-avatar {
  grid-row: auto;
  width: auto;
  height: auto;
  background: none;
  color: var(--muted);
  font-size: var(--t-small);
}

.live-felt-table .live-seat.empty strong,
.live-felt-table .live-seat.empty .live-seat-stack,
.live-felt-table .live-seat.empty .live-seat-read {
  display: none;
}

/* ---- View & theme rules adopted from the ex-walnut layer ----
   Kept in original relative order; later wins at equal specificity. */

html {
  background: var(--bg);
  /* Android paints a blue flash on every tappable thing (a saved hand's row was
     one); the press is told by the element itself. Inherited, so set once here. */
  -webkit-tap-highlight-color: transparent;
  /* The topbar is sticky, so block: "start" put the target's first 61px behind
     it -- a rival's profile opened with the name and Delete hidden. Set on the
     scroll container so every scrollIntoView in the app obeys it. */
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

::-moz-selection {
  color: #fff;
  background: var(--accent-fill);
}

::selection {
  color: #fff;
  background: var(--accent-fill);
}

/* Solid champagne ring: the old translucent accent ring composited to ~1.5:1,
   under the 3:1 non-text focus bar — opacity was the fault. One ring for
   everything; two rings differing only in opacity is a token split by accident. */
:focus-visible {
  outline: 3px solid var(--champ-hi);
  outline-offset: 2px;
}

.brand-mark {
  display: grid;
  height: 2rem;
  width: 2rem;
  flex-shrink: 0;
  place-items: center;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--felt-dark);
  box-shadow: inset 0 0 0 1px hsla(0, 0%, 100%, .14);
}

.brand-mark img {
  height: 100%;
  width: 100%;
  -o-object-fit: cover;
  object-fit: cover;
}

.topbar .icon-button {
  /* 2.75rem = 44px: this explicit box, not the shared padding, sizes the gear. */
  height: 2.75rem;
  width: 2.75rem;
  border-color: transparent;
  background: transparent;
}

.home-choice svg,
.icon-button svg,
.nav-button svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.9;
}

.topbar .icon-button svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.9;
}

/* The account's sync, left of the gear: quiet grey, and the warning gold only for the dot. */
.topbar .icon-button.sync-mark {
  color: var(--muted);
}

.topbar .sync-mark svg {
  overflow: visible;
}

.sync-mark-dot {
  fill: var(--gold);
  stroke: var(--bg);
  stroke-width: 1.6;
}

/* The sentence of the terms box carries its links inline, not as 44 px rows. */
.legal-accept .account-consent a {
  display: inline;
  min-height: 0;
}

/* The answer line stays in the page as a live region and takes no room (it leaves the grid, so no gap) until it has words. */
.legal-accept {
  position: relative;
}

.legal-accept #legalAcceptMsg:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.bottom-nav .nav-button svg {
  width: 20px;
  height: 20px;
}

.bottom-nav .nav-button.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.home-choice:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--choice-color,var(--accent)) 40%, var(--line));
}

.home-choice:active {
  transform: scale(.99);
}

/* No per-item colours: :nth-child colours claimed four things differ when only
   DOM order did. Green is you/up, red down, gold at stake; a destination is
   none. --choice-color still resolves (hover, arrow). */
.home-choice {
  --choice-color: var(--accent);
  --choice-soft: var(--accent-soft);
}

/* No filled chip behind the icon: a fifth surface with no job. */
.home-choice-icon {
  display: grid;
  height: 2.75rem;
  width: 2.75rem;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--muted);
  background: none;
}

.home-choice:hover .home-choice-icon {
  color: var(--accent-dark);
}

.home-choice-icon svg,
svg.home-choice-icon {
  width: 22px;
  height: 22px;
}

.home-choice > div {
  display: grid;
  min-width: 0;
  gap: .125rem;
}

/* <span> is the destination, <strong> the description; the name leads in the
   display voice. Markup unchanged, so no i18n key moves. */
.home-choice > div > span {
  font-family: var(--font-display);
  font-size: var(--t-section);
  font-weight: 700;
  letter-spacing: -.015em;
  text-transform: none;
  color: var(--ink);
}

.home-choice > div > strong {
  font-size: var(--t-note);
  font-weight: 400;
  line-height: 1.35;
  color: var(--muted);
}

/* Same classes/tokens as .home-status-value: the same signed result said
   elsewhere. Only the figure is coloured; mono, tabular. */
/* --t-control, not --t-note: here the figure IS the whole line. */
/* Two classes for SPECIFICITY: .home-choice span { font-size } in the 412px
   query is a descendant selector that reaches this nested span at (0,1,1). */
.home-choice-state .home-choice-figure {
  font-family: var(--font-note);
  font-variant-numeric: tabular-nums;
  font-size: var(--t-figure);
  font-weight: 700;
  word-spacing: -.22em;
}

.home-choice-state .home-choice-figure.up { color: var(--accent-dark); }
.home-choice-state .home-choice-figure.down { color: var(--red); }

body[data-view=record] .hand-panel {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 980px;
}

/* One value each, 700 because that is the only weight the display face ships. */
.panel-heading h2 {
  font-size: var(--t-title);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.015em;
}

.secondary-button:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 74%, var(--surface));
}

.icon-button svg {
  flex: none;
}

.ghost-button:hover,
.icon-button:hover {
  border-color: transparent;
  background: var(--surface-2);
  color: var(--ink);
}

.danger-button:active,
.ghost-button:active,
.icon-button:active,
.primary-button:active,
.secondary-button:active {
  transform: scale(.98);
}

/* Marked, not removed: a button the table blocks reads and looks the same as a
   disabled one, and keeps its place in the tab order. */
button:disabled,
button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .4;
  box-shadow: none;
  transform: none;
}

button[aria-disabled="true"]:hover {
  transform: none;
}

input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]) {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 1px 2px rgba(18, 31, 25, .03);
  transition: border-color .15s ease,
    box-shadow .15s ease,
    background .15s ease;
}

input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):hover,
select:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--muted) 40%, var(--line));
}

input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):focus {
  border-color: var(--accent);
}

/* The field a refusal is about: the line says why, the border says where. */
input[aria-invalid="true"]:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),
input[aria-invalid="true"]:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):focus {
  border-color: var(--danger);
}

label input,
label select,
label textarea {
  color: var(--ink);
  font-size: var(--t-body);
  font-weight: 600;
}

.collapse > summary:before {
  color: var(--muted);
}

.collapse[open] {
  padding: 4px 12px 14px;
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  background: var(--surface);
}

.collapse[open] > summary {
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

.hand-panel > .panel-heading {
  position: sticky;
  z-index: 20;
  padding-top: .5rem;
  padding-bottom: .5rem;
  top: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.voice-controls button {
  width: 100%;
}

.mic-button {
  color: var(--gold);
  border-color: color-mix(in srgb, var(--gold) 32%, var(--line));
  background: var(--gold-soft);
}

.timeline-row:hover {
  background: var(--surface-2);
}

.search-field input {
  background: var(--surface-2);
}

.hand-card:hover,
.player-card:hover,
.player-hand-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.replay-modal-head > :first-child {
  min-width: 0;
}

/* The step head is two lines and always two: the counter with the street on a
   quiet line, the action on the loud one. One line ellipsised the action away on
   almost every step in Spanish at 412px. Always two, so the felt never shifts. */

.replay-modal-head #replayLabel,
.review-head #reviewLabel {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.replay-modal-head .replay-step-count,
.review-head .replay-step-count {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.replay-modal-head .replay-step-action,
.review-head .replay-step-action {
  min-width: 0;
  font-size: var(--t-body);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-head .replay-pot {
  flex: none;
}

@media (max-width: 640px) {
  /* Edge to edge: the frame of the modal is pixels the felt can have. */
  .replay-overlay {
    padding: max(4px, env(safe-area-inset-top)) 0 max(4px, env(safe-area-inset-bottom));
  }

  /* The screen the phone HAS, not 720 fixed pixels: the cap left 105px unused on a
     849px phone while the felt was being squeezed out of its own box below. The
     overlay already reserves the safe areas. */
  /* A column whose felt row takes the spare height, so the air sits around the felt
     and the controls stay together under it instead of the gaps growing apart. */
  .replay-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-height: 100%;
    padding: 10px;
    gap: 10px;
  }

  .replay-modal > .replay-table {
    flex: 1 0 auto;
  }

  /* The full-screen replay drops its frame and keeps its rows as thin as their targets allow:
     the felt gets the rest. The inline replay (share page, landing) keeps its own spacing. */
  .replay-modal:not(.replay-inline) {
    padding: 8px;
    gap: 6px;
    border: 0;
    border-radius: 0;
  }

  .replay-modal:not(.replay-inline) .replay-table {
    padding: 2px 0;
  }

  .replay-modal:not(.replay-inline) .replay-scrub-row {
    padding: 0;
  }

  .replay-modal:not(.replay-inline) .replay-scrub-ticks {
    top: 0;
  }

  .replay-modal:not(.replay-inline) .replay-actions {
    margin-top: 0;
  }

  /* THE FELT IS THE SCREEN. Everything on it is sized in pixels — panels, cards,
     bet pills — so every px of felt is a px of clearance between them. Measured
     at 412: 319x371 in a bordered box with 48px of air above and below, which
     the builder's 1.7 felt needed and this one does not (the top seat sat 30px
     inside the rail). Dropping the box takes it to 374x435, +37% of area, with
     no scroll at any table size. */
  /* min-content, not a number: the box is overflow: hidden and it is a grid item,
     so a short phone squeezed the row and cut the bottom seat off. The floor is
     whatever the felt needs at this table size; below it the modal scrolls,
     which is the escape hatch it already has. */
  .replay-table {
    min-height: min-content;
    padding: 14px 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .mini-felt-table.replay-felt {
    width: 100%;
  }
}

/* ---- A PHONE LYING DOWN ----
   915x412 takes the desktop rule, whose ceiling is 53vh. On a screen that short
   that is a 218px felt with ten seats on it: measured there, 261 bets on text and
   417 panels overlapping each other. The vh term exists so a SHORT DESKTOP WINDOW
   is never outgrown, and on a phone lying down it is the whole screen instead.

   The answer is the configuration this felt already measures clean in: capped by
   WIDTH alone, the same 520px a desktop gets, with the modal scrolling — which it
   already does whenever the screen is shorter than the hand. A landscape phone has
   the width; what it does not have is the height, and no cap can invent it. */

@media (max-height: 560px) {
  .mini-felt-table.replay-felt {
    width: min(92%, 520px);
  }
}
/* `none`, never `.01ms`: under a stalled animation clock a .01ms transition never
   finishes and freezes the property at its starting value. Two selectors here
   start at opacity 0, so that would blank the app. */
@media (prefers-reduced-motion: reduce) {
  *,
  :after,
  :before {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 820px) {
  .home-choice-icon {
    height: 2.5rem;
    width: 2.5rem;
  }

  .home-intro h2 {
    font-size: var(--t-title);
    line-height: 1.75rem;
  }

  .hand-panel > .panel-heading {
    top: 54px;
  }

  .panel-heading h2 {
    font-size: var(--t-section);
    line-height: 1.75rem;
  }

  .voice-panel {
    padding: .75rem;
  }
}

@media (max-width: 412px) {
  /* On :root, not on .bottom-nav: the shell and the toast read --nav-space and
     neither is a descendant of the nav. */
  :root {
    --nav-h: 50px;
  }

  /* THIS rule decides the nav label on a phone; the un-nested one is for tablets.
     Verifying at 320px proves nothing — it is inside this query too. */
  .bottom-nav .nav-button {
    height: 50px;
    /* 12 px, the label step: "Profiles" has 1px of slack in its slot at 320. */
    font-size: var(--t-micro);
  }

  .home-actions {
    gap: 8px;
  }

  .onboard-card {
    padding: 10px;
  }

  .danger-button,
  .ghost-button,
  .primary-button,
  .secondary-button {
    padding-right: 12px;
    padding-left: 12px;
  }

  /* Its own rule outranks the one above; "Guardar con dudas" needs these 8 px at 360. */
  .review-cta button {
    padding-right: 12px;
    padding-left: 12px;
  }
}

#sessionTypeChips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 430px);
}

#sessionTypeChips .chip {
  min-height: 48px;
  width: 100%;
  font-size: var(--t-control);
}

#stakesChips {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, 570px);
}

#stakesChips .chip {
  width: 100%;
  padding-right: 10px;
  padding-left: 10px;
}

.session-start-actions .primary-button {
  min-width: 170px;
}

.hand-panel > .panel-heading {
  padding: 8px 0 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

#recordToolButtons {
  gap: 7px;
}

/* Floating-bar chrome (border, lift shadow, blur) only earns its keep on a
   sticky bar. The review CTA is static, so it gets none of it. */
.hand-form > .form-actions:last-child {
  z-index: 18;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  /* Sticky as the form's last child, so the bar lifts only over its own space. */
  position: sticky;
  bottom: 72px;
}

/* Review Save bar deliberately NOT sticky: pinned above the nav it covered the
   replay transport on first paint. "Reserve space" cannot work — a sticky
   element lifts over what precedes it and trailing padding permits MORE lift.
   Held by record-view-chrome-tests as geometry. */
.voice-review .review-cta {
  position: static;
}

.hand-form > .form-actions:last-child #saveHandBtn {
  flex: 1 1 auto;
}

@keyframes surface-enter {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%);
  }
}

@media (min-width: 720px) {
  .home-view {
    max-width: 980px;
  }

  /* Sized by content on desktop: fr rows + flex: 1 stretched four cards to the
     viewport. min-height below keeps them obvious targets. */
  .home-actions {
    flex: 0 0 auto;
    min-height: 0;
    align-content: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    gap: 12px;
  }

  .home-choice {
    min-height: 126px;
    grid-template-columns: 52px minmax(0, 1fr) 22px;
    padding: 18px;
  }

  .home-choice-icon {
    width: 48px;
    height: 48px;
  }

  .onboard-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .onboard-head {
    grid-column: 1/-1;
  }

  .onboard-step {
    align-items: flex-start;
    min-height: 62px;
  }
}

@media (min-width: 1024px) {
  /* A SCALE step for ≥1024px, not a new layout: same markup and i18n keys.
     720–1023 is the tablet range where the smaller step is right. */
  .home-view {
    max-width: 1240px;
    gap: 20px;
  }

  .home-actions {
    gap: 20px;
  }

  .home-choice {
    min-height: 170px;
    grid-template-columns: 72px minmax(0, 1fr) 26px;
    gap: 1.5rem;
    padding: 26px;
    border-radius: var(--r-lg);
  }

  .home-choice-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--r-sm);
  }

  /* Both selectors: ui.js replaces <i class="home-choice-icon"> with an <svg> of
     the same class, and the app must work without ui.js. With it, svg.…
     (0,1,1) outranks the box rule; without it the <i> keeps the box. The box
     rule is the fallback. */
  .home-choice-icon svg,
  svg.home-choice-icon {
    width: 32px;
    height: 32px;
  }

  .home-choice > div {
    gap: .35rem;
  }

  .home-choice > div > span {
    font-size: var(--t-section);
  }

  .home-choice > div > strong {
    font-size: var(--t-body);
  }

  /* Four steps, four columns: three left a widow. */
  .onboard-card {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  /* align-items: start: a grid row stretches its items, so an empty roster
     rendered as a tall blank card. */
  body[data-view=database] .workspace {
    grid-template-columns: minmax(310px, 430px) minmax(460px, 680px);
    align-items: start;
  }

  .app-shell {
    max-width: 1540px;
    padding-right: 30px;
    padding-bottom: 40px;
    padding-left: 126px;
  }

  .bottom-nav {
    top: 92px;
    right: auto;
    bottom: auto;
    left: 18px;
    width: 92px;
    max-width: 92px;
    transform: none;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 7px;
  }

  .bottom-nav .nav-button {
    height: 68px;
    gap: 4px;
    font-size: var(--t-micro);
  }

  .bottom-nav .nav-button svg {
    width: 22px;
    height: 22px;
  }

  /* Review's CTA is static: bottom would do nothing and read as a live rule. */
  .hand-form > .form-actions:last-child {
    bottom: 12px;
  }

  #toastHost {
    bottom: 24px;
  }
}

@media (max-width: 560px) {
  #stakesChips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #stakesChips .chip:last-child {
    grid-column: span 2;
  }

  .session-start-actions .primary-button {
    width: 100%;
  }

  .session-start-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hand-form > .form-actions:last-child {
    bottom: 68px;
  }
}

/* No entrance reveal on a view change: motion marks a state change, never
   ambience, and an opacity-0 start is a blank screen if the clock stalls. */

#recordToolButtons .ghost-button,
#recordToolButtons .secondary-button {
  min-height: 44px;
  padding-inline: 13px;
  border-radius: var(--r-pill);
  font-size: var(--t-small);
}

#recordToolButtons svg {
  width: 15px;
  height: 15px;
}

/* The way out of a hand, not its goal: muted ink, no border, no icon. The armed
   second tap keeps .confirming's colour, which is where the danger is said. */
#recordToolButtons .record-clear:not(.confirming) {
  color: var(--muted);
  border-color: transparent;
  background: transparent;
  font-weight: 600;
}

/* The only End of the night, beside the clock: small, with a border so it reads as
   a button, and the danger red on hover. */
#liveEndTopBtn {
  flex: none;
  padding: 0 12px;
  font-size: var(--t-small);
  border-color: var(--line);
}

#liveEndTopBtn:hover {
  color: #db7f70;
  border-color: color-mix(in srgb, var(--red) 28%, var(--line));
  background: var(--red-soft);
}

.transport-step {
  width: 54px;
  padding-inline: 0;
}

.transport-step svg {
  width: 22px;
  height: 22px;
}

#replayPlay,
#reviewPlay {
  min-width: 104px;
  border-radius: var(--r-pill);
}

/* The replay's transport on a portrait phone: Prev, Play, speed, Share and Next in one
   row, every target 44 tall. Play at the end restarts the hand and the scrubber rewinds,
   so Reset is not drawn. Share is its icon alone (the word is cut at most phone widths);
   export progress is the only readout while a clip builds, so it takes the icon's place. */
@media (max-width: 640px) and (orientation: portrait) {
  .replay-overlay .replay-transport {
    flex-wrap: nowrap;
  }

  .replay-overlay #replayReset {
    display: none;
  }

  .replay-overlay .replay-transport-mid {
    min-width: 0;
  }

  .replay-overlay .replay-share span {
    display: none;
  }

  .replay-overlay .replay-transport .replay-share {
    padding: 0;
  }

  .replay-overlay .replay-transport .replay-share.is-progress {
    padding: 0 6px;
  }

  .replay-overlay .replay-transport .replay-share.is-progress span {
    display: inline;
  }

  .replay-overlay .replay-transport .replay-share.is-progress svg {
    display: none;
  }

  .replay-overlay .transport-step {
    width: 48px;
  }

  .replay-overlay #replayPlay {
    min-width: 88px;
  }

  .replay-overlay .replay-transport,
  .replay-overlay .replay-transport-mid {
    gap: 6px;
  }
}

@media (max-width: 380px) and (orientation: portrait) {
  .replay-overlay #replayPlay {
    min-width: 72px;
  }
}

@media (max-width: 340px) and (orientation: portrait) {
  .replay-overlay .transport-step {
    width: 44px;
  }

  .replay-overlay #replayPlay {
    min-width: 64px;
  }

  .replay-overlay .replay-transport,
  .replay-overlay .replay-transport-mid {
    gap: 4px;
  }
}

#replaySpeed,
#replayReset,
#reviewReset {
  min-width: 44px;
  padding: 0;
  border-radius: var(--r-pill);
}

#replayReset svg,
#reviewReset svg {
  width: 18px;
  height: 18px;
}

.replay-actions button {
  min-height: 44px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: var(--t-note);
}

/* The one door out of the replay has button weight and sits in the transport; the
   actions row stays grey. Ready means a recorded clip waits, so it turns primary. */
.replay-transport .replay-share {
  min-width: 44px;
  padding: 0 14px;
  gap: 6px;
  color: var(--accent-dark);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  background: var(--accent-soft);
  font-size: var(--t-control);
}

.replay-transport .replay-share:hover {
  color: var(--ink-bright, var(--ink));
  background: var(--accent-soft);
}

.replay-transport .replay-share.is-ready,
.replay-transport .replay-share.is-ready:hover {
  color: #fff;
  border-color: transparent;
  background: var(--accent-fill);
}

.replay-transport .replay-share svg {
  width: 17px;
  height: 17px;
}

.replay-actions button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.replay-scrub::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
}

.replay-scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--accent-dark);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}

.replay-scrub::-moz-range-track {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
}

.replay-scrub::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--accent-dark);
}

@media (max-width: 640px) {
  .hand-visual-table {
    min-height: 0;
    padding: 36px 8px;
  }

  .voice-transcript {
    min-height: 132px;
  }

  .hand-form,
  .session-form {
    gap: 11px;
  }
}

/* ---- Language toggle (ES / ENG) ----
   Appended at the end so nothing above can silently override it. State lives
   on aria-pressed, not a class: one fact. Both axes clear the 44px floor; no
   uppercase tracking for ordinary words. */

.lang-toggle {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  /* A grid parent would stretch this edge to edge and read as two separate buttons. */
  justify-self: start;
  /* Same touch treatment as .segmented: no 300ms delay, no tap flash. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.lang-toggle .lang-option {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--t-note);
  font-weight: 700;
  transition: background-color .15s ease, color .15s ease;
}

/* The chosen option wears the segmented fill, not the green: the green is a screen's one action. */
.lang-toggle .lang-option[aria-pressed="true"] {
  background: var(--surface-3);
  color: var(--ink-bright);
}

/* Inherits the global ring: one focus style in the system. */
.lang-toggle .lang-option:focus-visible {
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .lang-toggle .lang-option {
    transition: none;
  }
}

/* ---- The betting line ----
   The hand in poker shorthand under the felt (see #reviewHandLine in
   index.html). --font-note: notation. Green is YOU, nothing else is coloured. */

.hand-line {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.hand-line-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: .5rem;
  align-items: baseline;
}

/* The street is a label, not notation; it names its row and steps back. */
.hand-line-street {
  color: var(--muted);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hand-line-body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 0;
  min-width: 0;
}

/* --muted, not --line: --line is a border colour, illegible as type. A token
   meant to be nearly invisible must not paint a glyph. */
.hand-line-sep {
  padding: 0 .38rem;
  color: var(--muted);
}

/* A control (tapping drives the felt) that must read as TEXT: no border, fill
   or pill; hover is the only affordance. */
/* Vertical padding is a TAP TARGET: inline words cannot reach 44px without
   becoming a toolbar (WCAG exempts inline targets); 7px a side buys ~33px.
   The felt transport is the full-size way to walk the hand. */
.hand-line-act {
  padding: 7px 2px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink);
  font-family: var(--font-note);
  font-size: var(--t-small);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: color .14s ease, background .14s ease;
}

.hand-line-act:hover {
  color: var(--ink-bright, var(--ink));
  background: var(--surface-2);
}

/* Green is you — the only colour allowed in this block. */
.hand-line-act.is-hero {
  color: var(--accent-dark);
}

/* Where the felt is standing right now, so the two views are visibly one model. */
.hand-line-act.current {
  color: var(--on-fill);
  background: var(--accent-dark);
  font-weight: 600;
}

/* Already played: dimmed, not hidden, so the whole hand stays readable. */
.hand-line-act.done:not(.current) {
  color: var(--muted);
}

.hand-line-act:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}

/* ---- Results, data first ----
   The result is a NUMBER and a CURVE, and both lead the screen. */

/* Headline figure: notation voice, tabular so it does not jump on filter changes. */
#bankrollTotal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .45rem;
  line-height: 1.15;
}

.bankroll-figure {
  font-family: var(--font-note);
  font-size: var(--t-figure-xl);
  font-weight: 600;
  letter-spacing: -.03em;
  /* Monospace space is a full character; same correction as the metric tiles. */
  word-spacing: -.22em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-bright, var(--ink));
}

/* "across 9 sessions" is scope, not the finding. */
.bankroll-qualifier {
  font-family: var(--font-ui);
  font-size: var(--t-note);
  font-weight: 400;
  color: var(--muted);
}

/* Explains a filter; must not compete with the number above it. */
.bankroll-note,
#bankrollPanel > p:not(.eyebrow) {
  font-size: var(--t-note);
  font-weight: 400;
  color: var(--muted);
}

/* Give the chart room to be a chart. */
.bankroll-chart {
  margin-top: 2px;
}
