/* MY CA PILOT AUCTION — one design system, two surfaces.
 *
 * Doc 01 §21: midnight navy, violet actions, cyan live accents, restrained
 * gold celebrations, LIGHT setup and report surfaces, HIGH-CONTRAST live-room
 * surfaces — and both must "feel like one product".
 *
 * That is done here with ONE set of tokens and a scoping class rather than two
 * stylesheets: `.room` (and `.projector`) repoint the same semantic variables
 * at the dark palette, so a component written once works on both surfaces and
 * cannot drift into looking like two products.
 *
 * ACCESSIBILITY IS NOT A SECTION AT THE BOTTOM. Doc 01 §21:
 *   - status is never colour alone — every state chip carries a word;
 *   - `prefers-reduced-motion` removes animation, and no animation ever delays
 *     an action (a pulsing timer that has to finish before a tap registers is
 *     the failure this rules out);
 *   - tabular numerals on every amount, so a price does not jitter as it
 *     changes under a countdown;
 *   - 44px minimum tap targets, and 16px minimum font size on inputs, because
 *     anything smaller makes iOS Safari zoom the whole page on focus.
 *
 * THERE ARE NO EXTERNAL FONTS AND NO EXTERNAL IMAGES. `core/middleware.py`
 * says `font-src 'self'` and `img-src 'self' data: blob:` and it stays that
 * way. The type stack below asks for Inter / Plus Jakarta Sans if the device
 * has them and settles on the platform UI face if not; every illustration is
 * an SVG in static/img/art/.
 */

/* ------------------------------------------------------------------ tokens */
:root {
  --navy-900: #0B1020;
  --navy-800: #121A33;
  --navy-700: #1B2547;
  --navy-600: #2A365E;
  --violet-700: #5A4BD3;
  --violet-600: #6C5CE7;
  --violet-500: #8271F0;
  --violet-100: #EDEAFD;
  --violet-50:  #F5F3FE;
  --cyan-400: #22D3EE;
  --cyan-100: #CFFAFE;
  --cyan-ink: #0E7490;
  --gold-400: #F2C14E;
  --gold-ink: #8A6D1F;
  --red-600: #D64545;
  --red-100: #FDECEC;
  --green-600: #1F8A4C;
  --green-100: #E4F5EB;
  --amber-100: #FDF3DC;
  --grey-50: #F7F8FB;
  --grey-100: #EEF0F6;
  --grey-200: #DDE1EC;
  --grey-300: #C9CFDD;
  --grey-400: #98A0B5;
  --grey-600: #5B6479;
  --grey-900: #171B26;

  /* Semantic. Components only ever use these. */
  --bg: var(--grey-50);
  --surface: #FFFFFF;
  --surface-2: var(--grey-100);
  --surface-3: var(--grey-200);
  --border: var(--grey-200);
  --border-strong: var(--grey-300);
  --text: var(--grey-900);
  --text-muted: var(--grey-600);
  --text-faint: var(--grey-400);
  --accent: var(--violet-600);
  --accent-strong: var(--violet-700);
  --accent-soft: var(--violet-100);
  --accent-text: #FFFFFF;
  --live: var(--cyan-ink);         /* cyan, darkened for contrast on light */
  --live-soft: var(--cyan-100);
  --focus: var(--violet-600);

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --gutter: 16px;                  /* the 375px side gutter */
  --tap: 44px;
  --container: 1120px;

  --shadow-xs: 0 1px 2px rgb(11 16 32 / 5%);
  --shadow-sm: 0 1px 2px rgb(11 16 32 / 5%), 0 4px 12px rgb(11 16 32 / 5%);
  --shadow:    0 1px 2px rgb(11 16 32 / 5%), 0 10px 30px rgb(11 16 32 / 8%);
  --shadow-lg: 0 20px 60px rgb(11 16 32 / 16%), 0 4px 14px rgb(11 16 32 / 8%);
  --shadow-accent: 0 10px 26px rgb(108 92 231 / 32%);

  --ease: cubic-bezier(.2, .7, .2, 1);
  --fast: 150ms;
  --normal: 220ms;

  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
          Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Plus Jakarta Sans", "Inter", "Segoe UI Variable Display", "Segoe UI",
               system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", SFMono-Regular, Consolas, Menlo, monospace;
}

/* ------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Notch and home-indicator safe areas — doc 02 §18. */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
  min-height: 100dvh;
  display: flex; flex-direction: column;
}
main#main { flex: 1 0 auto; }

/* Every amount, everywhere. Without this a price jumps sideways as its digits
 * change under a one-second countdown, which reads as the page glitching. */
.amount, .money, td.num, .tabular { font-variant-numeric: tabular-nums; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.15; margin: 0 0 .5rem;
  letter-spacing: -.022em; font-weight: 800; color: var(--text);
}
/* Calmer page headings (the owner, 1 Oct 2026: "too large font?"). A page
 * title topped out at 2.6rem (42px) on a desktop, which is a poster size on
 * a working screen; the marketing hero keeps its own larger size. */
h1 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); }
h2 { font-size: clamp(1.2rem, 1.1rem + .4vw, 1.45rem); letter-spacing: -.018em; }
h3 { font-size: 1.1rem; letter-spacing: -.01em; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: .3rem; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
img, svg { max-width: 100%; height: auto; }
small { font-size: .875rem; }
strong { font-weight: 700; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--text);
  padding: .75rem 1rem; z-index: 100; border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.skip-link:focus { left: 8px; top: 8px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Icons come from the sprite in templates/partials/icons.html. */
.icon { width: 1.15em; height: 1.15em; flex: 0 0 auto; vertical-align: -.2em;
        fill: none; }
.icon-lg { width: 1.5em; height: 1.5em; }

/* ----------------------------------------------------------------- layout */
.page { max-width: var(--container); margin: 0 auto; padding: 2rem var(--gutter) 4rem; width: 100%; }
.page.narrow { max-width: 760px; }
.page.wide { max-width: 1280px; }
.page > h1:first-child, .page > .page-head:first-child { margin-top: .25rem; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between;
             gap: 1rem 1.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin-bottom: .2rem; }
.page-head .card-meta { margin: 0; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.eyebrow {
  font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .5rem;
}
.section-head { display: flex; align-items: baseline; justify-content: space-between;
                gap: 1rem; flex-wrap: wrap; margin: 2.25rem 0 .75rem; }
.section-head h2 { margin: 0; display: inline-flex; align-items: center; gap: .5rem; }
.section-head .more { font-weight: 600; text-decoration: none; display: inline-flex;
                      align-items: center; gap: .3rem; min-height: 32px; }
.section-head .more:hover { text-decoration: underline; }

.breadcrumb, p.room-back { margin: 0 0 1rem; font-size: .9rem; }
.breadcrumb a, p.room-back a {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 32px;
  color: var(--text-muted); text-decoration: none; font-weight: 600;
}
.breadcrumb a:hover, p.room-back a:hover { color: var(--text); }

/* ----------------------------------------------------------------- header */
.site-head {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.25rem;
  padding: .6rem var(--gutter);
  background: rgb(255 255 255 / 86%);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-head-inner { max-width: 1280px; margin: 0 auto; width: 100%;
                   display: flex; align-items: center; gap: 1.25rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none;
         color: inherit; min-height: var(--tap); flex: 0 0 auto; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: #FFFFFF; border: 1px solid var(--border);
  display: grid; place-items: center; box-shadow: var(--shadow-xs);
  transition: transform var(--fast) var(--ease);
}
.brand-mark img { width: 30px; height: 30px; display: block; }
.brand:hover .brand-mark { transform: translateY(-1px); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-head); font-weight: 800; letter-spacing: -.02em;
              font-size: 1.02rem; white-space: nowrap; color: var(--navy-800); }
.brand-name .w-pilot { color: var(--accent); }
.brand-sub {
  font-size: .64rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--cyan-ink); margin-top: .18rem;
}

.site-nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: .45rem .7rem; border-radius: 999px; min-height: 40px;
  display: inline-flex; align-items: center;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }
.site-actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; }

/* The phone menu. A <details>, so it needs no script: the header's nav is
   rendered twice — inline for wide screens, inside this panel for narrow —
   and CSS shows exactly one of them. */
.site-menu { display: none; position: relative; }
.site-menu > summary {
  list-style: none; cursor: pointer;
  width: var(--tap); height: var(--tap); border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu > summary .icon { width: 22px; height: 22px; }
.site-menu > summary .i-close { display: none; }
.site-menu[open] > summary .i-menu { display: none; }
.site-menu[open] > summary .i-close { display: inline; }
.site-menu-panel {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 60;
  min-width: 15rem; width: max-content; max-width: calc(100vw - 2 * var(--gutter));
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .5rem;
  display: grid; gap: .15rem;
}
.site-menu-panel a, .site-menu-panel button {
  display: flex; align-items: center; gap: .6rem; min-height: var(--tap);
  padding: .5rem .75rem; border-radius: var(--radius-sm); text-decoration: none;
  color: var(--text); font-weight: 600; font: inherit; background: none; border: 0;
  width: 100%; text-align: left; cursor: pointer;
}
.site-menu-panel a:hover, .site-menu-panel button:hover { background: var(--surface-2); }
.site-menu-panel a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }
.site-menu-panel .menu-sep { border-top: 1px solid var(--border); margin: .35rem 0; }
.site-menu-panel .menu-user { padding: .5rem .75rem .25rem; font-size: .85rem; color: var(--text-muted); }
.site-menu-panel .menu-user strong { display: block; color: var(--text); font-size: .95rem; }
.site-menu-panel form { margin: 0; }

/* ------------------------------------------------------------ account menu */
.account-menu { position: relative; }
.account-menu summary {
  list-style: none; cursor: pointer; min-height: var(--tap);
  display: flex; align-items: center; gap: .5rem; padding: 0 .5rem 0 .25rem;
  border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: background var(--fast) var(--ease);
}
.account-menu summary:hover { background: var(--surface-2); }
.account-menu summary::-webkit-details-marker { display: none; }
.account-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(140deg, var(--violet-500), var(--violet-700));
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem;
  letter-spacing: .02em;
}
.account-panel {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 60; min-width: 16rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .6rem;
  display: grid; gap: .15rem;
}
.account-panel a, .account-panel button {
  display: flex; align-items: center; gap: .6rem; min-height: var(--tap);
  padding: .5rem .75rem; border-radius: var(--radius-sm); text-decoration: none;
  color: var(--text); font: inherit; font-weight: 600; background: none; border: 0;
  width: 100%; text-align: left; cursor: pointer;
}
.account-panel a:hover, .account-panel button:hover { background: var(--surface-2); }
.account-panel form { margin: 0; }
.account-org { font-weight: 700; margin: 0; padding: .5rem .75rem 0; }
.account-roles { color: var(--text-muted); font-size: .85rem; margin: 0 0 .35rem;
                 padding: 0 .75rem .5rem; border-bottom: 1px solid var(--border); }

/* ----------------------------------------------------------------- footer */
.site-foot {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 2.5rem var(--gutter) calc(2rem + env(safe-area-inset-bottom));
  color: var(--text-muted); font-size: .9rem; margin-top: auto;
}
.site-foot-inner { max-width: var(--container); margin: 0 auto;
                   display: grid; gap: 1.5rem 2rem; grid-template-columns: 1.4fr 1fr 1fr; }
.site-foot .brand { margin-bottom: .5rem; }
.site-foot h3 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
                color: var(--text-faint); margin-bottom: .5rem; }
.site-foot nav { display: grid; gap: .1rem; }
/* A 22 px link is under the 24 px floor a thumb needs, and these are the
   links somebody reaches for on a phone: privacy, terms, help. Padding
   rather than a height, so the row still wraps. */
.site-foot nav a {
  display: inline-flex; align-items: center; min-height: 32px; padding: .2rem 0;
  color: var(--text-muted); text-decoration: none;
}
.site-foot nav a:hover { color: var(--text); text-decoration: underline; }
.site-foot .foot-note { grid-column: 1 / -1; border-top: 1px solid var(--border);
                        padding-top: 1.25rem; display: flex; gap: 1rem; flex-wrap: wrap;
                        justify-content: space-between; align-items: center; }
.site-foot .foot-note p { margin: 0; }
.credit { margin: 0; font-size: .85rem; }

/* --------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: var(--tap); padding: .55rem 1.1rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  line-height: 1.2; white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
              color var(--fast) var(--ease), transform var(--fast) var(--ease),
              box-shadow var(--fast) var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: var(--grey-400); color: var(--text); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn .icon { width: 1.1em; height: 1.1em; }

.btn-primary {
  background: linear-gradient(180deg, var(--violet-500), var(--violet-600));
  border-color: var(--violet-600); color: var(--accent-text);
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--violet-600), var(--violet-700));
                     border-color: var(--violet-700); color: #fff; }
.btn-danger { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.btn-danger:hover { background: #B83A3A; border-color: #B83A3A; color: #fff; }
.btn-quiet { background: transparent; border-color: transparent; box-shadow: none; }
.btn-quiet:hover { background: var(--surface-2); border-color: transparent; }
.btn-ghost { background: transparent; border-color: currentColor; box-shadow: none; }
.btn-lg { min-height: 52px; padding: .75rem 1.5rem; font-size: 1.05rem; border-radius: 12px; }
.btn-sm { min-height: 36px; padding: .35rem .8rem; font-size: .9rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed;
                                            transform: none; box-shadow: none; }

/* 16px minimum. Anything smaller and iOS Safari zooms the whole page when the
 * field takes focus, which on the captain screen scrolls the bid button away. */
input, select, textarea {
  font: inherit; font-size: 16px;
  min-height: var(--tap);
  width: 100%;
  padding: .55rem .8rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: var(--grey-400); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgb(108 92 231 / 18%);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6479' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 1.1rem;
  padding-right: 2.4rem;
}
textarea { min-height: 6rem; resize: vertical; }
input[type="file"] { padding: .5rem; background: var(--surface-2); border-style: dashed; }
label { display: block; font-weight: 600; margin: 1.1rem 0 .3rem; font-size: .95rem; }
label:first-child { margin-top: 0; }
.hint { color: var(--text-muted); font-size: .9rem; margin: .35rem 0 0; line-height: 1.5; }
.hint + .hint { margin-top: .25rem; }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.5rem; align-items: center; }
.form-inline { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.form-inline label { margin: 0; }
.form-inline input, .form-inline select { width: auto; flex: 1 1 14rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: .5rem; }

/* A form in a card. Long setup forms read as one object instead of a column
   of loose fields, and the sticky actions have an edge to settle against. */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm);
  margin: 1.25rem 0;
}
.form-card > h2:first-child, .form-card > h3:first-child { margin-bottom: .25rem; }
.form-card > .lede { margin-bottom: 1rem; }
.form-grid { display: grid; gap: 0 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.player-id { font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.player-check { display: flex; align-items: center; gap: .65rem; min-height: var(--tap); }
.player-check input { width: 1.25rem; min-height: 1.25rem; height: 1.25rem; flex: 0 0 1.25rem; padding: 0; accent-color: var(--accent); }
.player-details { margin: .65rem 0; font-size: .9rem; }
.player-details summary { cursor: pointer; padding: .6rem 0; min-height: var(--tap); font-weight: 600; }
.player-details dl { margin: .75rem 0; white-space: normal; overflow-wrap: anywhere; }
.player-details dt { color: var(--text-muted); font-weight: 600; margin-top: .6rem; }
.player-details dd { margin: .15rem 0 0; font-weight: 400; }

/* ------------------------------------------------------------- feedback */
.messages { list-style: none; margin: 0 auto; padding: .75rem var(--gutter) 0;
            max-width: var(--container); width: 100%; }
.msg {
  border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: .5rem;
  border: 1px solid transparent; border-left-width: 4px; font-weight: 500;
  display: flex; gap: .6rem; align-items: flex-start;
}
.msg-success { background: var(--green-100); border-color: var(--green-600); color: #0F5132; }
.msg-error   { background: var(--red-100);   border-color: var(--red-600);   color: #6A1B1B; }
.msg-warning { background: var(--amber-100); border-color: var(--gold-400);  color: #6A4E00; }
.msg-info    { background: var(--violet-100);border-color: var(--violet-600);color: #2F2470; }

.problem, .ok, .warn { padding: .8rem 1rem; border-radius: var(--radius-sm);
                       border: 1px solid transparent; border-left-width: 4px; }
.problem { background: var(--red-100);   border-color: var(--red-600);   color: #6A1B1B; }
.ok      { background: var(--green-100); border-color: var(--green-600); color: #0F5132; }
.warn    { background: var(--amber-100); border-color: var(--gold-400);  color: #6A4E00; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.lede { font-size: 1.05rem; color: var(--text-muted); line-height: 1.55; max-width: 62ch; }

.callout {
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); background: var(--surface);
  padding: 1rem 1.25rem; margin: 1.5rem 0; box-shadow: var(--shadow-xs);
}
.callout h2 { font-size: 1.05rem; }
.callout h3 { font-size: 1rem; }
.callout > :last-child { margin-bottom: 0; }
.callout-live { border-left-color: var(--live); background: var(--live-soft); }
.callout-soft { background: var(--violet-50); }

/* --- added 26 Sep 2026: tiers, edit screens, sharing, practice ------------ */
/* Tiered bid steps on the rules screen. */
.slab-fields, .choice-fields { margin: 1rem 0 .5rem; padding: 1rem 1.1rem; border: 1px solid var(--border);
               border-radius: var(--radius); background: var(--surface-2); }
.choice-fields legend, .slab-fields legend { font-weight: 700; }
.choice-fields .check-row { margin: .35rem 0 0; flex-wrap: wrap; column-gap: .5rem; }
.slab-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
            gap: .5rem .6rem; align-items: center; margin-top: .5rem; }
.slab-row label { margin: 0; font-weight: 600; color: var(--text-muted); }
.slab-row input { margin: 0; }
.slab-list { list-style: none; margin: .3rem 0 0; padding: 0; font-size: .95rem;
             color: var(--text-muted); }
.slab-list li { margin: 0; }
.rules-change { margin-top: 1.25rem; }
@media (max-width: 640px) {
  .slab-row { grid-template-columns: auto minmax(0, 1fr); }
}

/* Edit screens: the irreversible actions sit apart, never beside Save. */
.danger-card { border-color: rgb(214 69 69 / 35%); margin-top: 1.25rem; }
.danger-card h2 { font-size: 1.15rem; }
.danger-card h3 { margin-top: 1.25rem; font-size: 1rem; }
input[type="color"] { width: 100%; min-height: var(--tap); padding: .25rem; cursor: pointer; }

/* Copy and WhatsApp share. */
.share-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: .75rem 0; }
.share-row .btn[hidden] { display: none; }
.share-box { margin: .5rem 0 0; }
.share-url { margin: 0; padding: .6rem .8rem; border-radius: var(--radius-sm);
             background: var(--surface-2); border: 1px solid var(--border); }
.share-url code { word-break: break-all; font-size: .95rem; background: none; padding: 0; }
.share-card { border-left: 4px solid var(--accent); }
.share-card h2 { display: flex; align-items: center; gap: .5rem; }
/* On the dark room screens (board, console). */
.room .share-url { background: rgb(255 255 255 / 5%); border-color: #2A365E; }
.room-head > .room-share { margin-left: auto; flex: none; }
.room-share .btn { min-height: 36px; padding: .3rem .75rem; font-size: .9rem;
                   background: rgb(255 255 255 / 8%); color: #E8ECF8; border-color: #35447A; }
.room-head > .room-share + .room-status { margin-left: .75rem; }
.console-share > summary { list-style: none; cursor: pointer; }
.console-share > summary::-webkit-details-marker { display: none; }
.console-share[open] { flex-basis: 100%; }
.console-share .share-box { margin-top: .6rem; }
.btn-whatsapp { background: #25D366; border-color: #1FB457; color: #07361D; }
.btn-whatsapp:hover { background: #1FB457; color: #04230F; }

/* The one-click practice auction on the workspace home. */
.practice-band { display: flex; align-items: center; justify-content: space-between;
                 gap: 1rem 1.5rem; flex-wrap: wrap; margin: 0 0 1.5rem;
                 padding: 1.1rem 1.35rem; border-radius: var(--radius-lg);
                 background: linear-gradient(135deg, var(--violet-50), var(--surface));
                 border: 1px solid var(--violet-100); }
.practice-band h2 { margin: 0 0 .25rem; font-size: 1.15rem; }
.practice-band .hint { margin: 0; max-width: 60ch; }
.practice-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.practice-actions select { width: auto; margin: 0; }
@media (max-width: 640px) {
  .practice-actions, .practice-actions .btn, .practice-actions select { width: 100%; }
}
.pool-finish { margin: -.25rem 0 .75rem; }

/* "Set up from an Excel workbook" (templates/app/workbook_setup.html). */
.steps-list { list-style: none; counter-reset: step; padding: 0; margin: 1.25rem 0;
              display: grid; gap: 1rem; }
.steps-list > li { counter-increment: step; position: relative; margin: 0;
                   padding: 1.1rem 1.25rem 1.1rem 3.6rem; background: var(--surface);
                   border: 1px solid var(--border); border-radius: var(--radius); }
.steps-list > li::before { content: counter(step); position: absolute; left: 1.1rem; top: 1.1rem;
                           width: 32px; height: 32px; border-radius: 9px; display: grid;
                           place-items: center; font-weight: 800; color: #fff;
                           background: var(--accent); }
.steps-list h2 { font-size: 1.1rem; margin-bottom: .35rem; }
.problem-list { margin: .5rem 0 1rem; }
.problem-list li { color: var(--red-600); }
.share-cell { white-space: nowrap; }
.share-cell .btn + .btn { margin-left: .35rem; }

.dev-banner {
  margin: 0; padding: .35rem var(--gutter); text-align: center;
  background: var(--gold-400); color: #3A2B00; font-weight: 600; font-size: .85rem;
}

/* ------------------------------------------------------------------ cards */
.card-grid {
  display: grid; gap: 1rem; margin: 1rem 0 1.5rem; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem 1.25rem; box-shadow: var(--shadow-sm);
  transition: transform var(--normal) var(--ease), box-shadow var(--normal) var(--ease),
              border-color var(--normal) var(--ease);
  display: flex; flex-direction: column; gap: .35rem; min-width: 0;
}
.card-grid > .card:hover, a.card:hover, .card.is-link:hover {
  transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--grey-300);
}
.card h3 { margin-bottom: .1rem; font-size: 1.12rem; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--accent-strong); }
.card > p { margin: 0; }
.card-meta { color: var(--text-muted); font-size: .9rem; display: flex; align-items: center;
             gap: .35rem; flex-wrap: wrap; }
.card-meta .icon { color: var(--text-faint); }
.card-status { margin: 0 0 .35rem; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.card-cta { margin-top: auto; padding-top: .75rem; }
.card-cta .btn { width: 100%; }
.card-cover {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin: -1.15rem -1.25rem .75rem; padding: .75rem 1.25rem;
  background: linear-gradient(135deg, var(--violet-50), var(--cyan-100));
  border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0;
}
.card-cover .sport { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700;
                     font-size: .85rem; color: var(--navy-800); letter-spacing: .02em; }
.card-cover .sport .icon { width: 22px; height: 22px; color: var(--accent); }
.card.is-live .card-cover { background: linear-gradient(135deg, var(--cyan-100), #E6FBFF); }

/* A status is NEVER colour alone. Every chip carries a word, because roughly
 * one man in twelve cannot tell the red one from the green one. */
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; line-height: 1;
  border: 1px solid transparent; border-radius: 999px;
  padding: .32rem .6rem; background: var(--surface-2); color: var(--text-muted);
  white-space: nowrap; vertical-align: middle;
}
.chip::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%;
                background: currentColor; flex: none; }
.chip-live     { color: var(--live); background: var(--live-soft); }
.chip-live::before { box-shadow: 0 0 0 0 rgb(14 116 144 / 45%); animation: pulse 1.8s var(--ease) infinite; }
.chip-paused   { color: var(--gold-ink); background: var(--amber-100); }
.chip-recovery { color: #9E2B2B; background: var(--red-100); }
.chip-demo     { color: var(--grey-600); background: var(--surface-2); border-color: var(--border); }
.chip-ok       { color: #0F5132; background: var(--green-100); }
.chip-accent   { color: var(--accent-strong); background: var(--accent-soft); }
.chip-plain::before { display: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(14 116 144 / 45%); }
                   100% { box-shadow: 0 0 0 7px rgb(14 116 144 / 0%); } }

.empty-state {
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: 2rem 1.25rem; text-align: center; color: var(--text-muted);
  background: var(--surface); display: grid; gap: .5rem; justify-items: center;
  margin: 1rem 0;
}
.empty-state img { width: min(220px, 60%); height: auto; margin-bottom: .25rem; }
.empty-state strong { color: var(--text); font-size: 1.05rem; }
.empty-state p { margin: 0; max-width: 46ch; }
.empty-state .btn { margin-top: .5rem; }

/* The home page's single "nothing public yet" band (templates/public/home.html). */
.directory-empty { display: flex; align-items: center; gap: 1.5rem; margin: 1rem 0 0;
                   padding: 1.5rem 1.75rem; background: var(--surface);
                   border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.directory-empty img { width: 160px; height: auto; flex: none; }
.directory-empty h2 { margin: 0 0 .35rem; font-size: 1.25rem; }
.directory-empty p { margin: 0; color: var(--text-muted); max-width: 60ch; }
.directory-empty .cta-row { margin-top: 1rem; display: flex; gap: .6rem; flex-wrap: wrap; }
@media (max-width: 640px) {
  .directory-empty { flex-direction: column; text-align: center; padding: 1.25rem; }
  .directory-empty .cta-row { justify-content: center; }
  .directory-empty .cta-row .btn { flex: 1 1 auto; }
}

.setting-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .85rem; }
.setting-card { background: var(--surface); border: 1px solid var(--border);
                border-left: 4px solid var(--border-strong);
                border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow-xs); }
.setting-card.is-ready { border-left-color: var(--green-600); }
.setting-card.is-incomplete { border-left-color: var(--red-600); }
.setting-card.is-optional { border-left-color: var(--grey-400); }
.setting-card h2 { font-size: 1.1rem; }
.setting-card h2 a { text-decoration: none; color: inherit; }
.setting-card h2 a:hover { color: var(--accent-strong); }
.setting-card > :last-child { margin-bottom: 0; }
.setting-card .card-meta { margin-bottom: .5rem; }

.uri-list, .link-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.uri-list code { word-break: break-all; }
.link-list .muted { display: block; font-size: .9rem; }
p.link-list { display: flex; gap: 1rem; flex-wrap: wrap; }
p.link-list a { min-height: 32px; display: inline-flex; align-items: center; font-weight: 600; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0 0 1rem; }
.kv dt { font-weight: 600; color: var(--text-muted); }
.kv dd { margin: 0; }

code { background: var(--surface-2); padding: .12rem .4rem; border-radius: 5px;
       font-size: .9em; font-family: var(--font-mono); }
pre { background: var(--navy-900); color: #E6EAF5; padding: 1rem; border-radius: var(--radius-sm);
      overflow: auto; font-family: var(--font-mono); font-size: .9rem; }

/* A row of quick links that reads as a toolbar rather than a paragraph. */
.action-list { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0 0; padding: 0; list-style: none; }
.action-list .btn { min-height: 38px; padding: .4rem .8rem; font-size: .92rem; }

/* Stat tiles: one number, one label, and never a number that was not counted. */
.stat-grid { display: grid; gap: .85rem; margin: 1rem 0 1.5rem;
             grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 1rem 1.15rem; box-shadow: var(--shadow-xs); display: grid; gap: .15rem; }
.stat .num { font-family: var(--font-head); font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em;
             line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .label { font-size: .85rem; color: var(--text-muted); font-weight: 600; }
.stat .icon { color: var(--accent); width: 22px; height: 22px; }

/* Tabs: the tournament's fixtures / standings / predictions strip. */
nav.tabs { display: flex; gap: .3rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
           padding: .25rem 0; margin: .25rem 0 1.25rem; border-bottom: 1px solid var(--border);
           scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs a {
  flex: none; display: inline-flex; align-items: center; gap: .4rem; min-height: var(--tap);
  padding: .5rem .9rem; text-decoration: none; color: var(--text-muted); font-weight: 600;
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
nav.tabs a:hover { color: var(--text); }
nav.tabs a[aria-current="page"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
nav.tabs.pills { border: 0; gap: .4rem; }
nav.tabs.pills a { border: 1px solid var(--border); border-radius: 999px; min-height: 38px; margin: 0; }
nav.tabs.pills a[aria-current="page"] { background: var(--accent-soft); border-color: var(--accent-soft); }

/* -------------------------------------------------------------- help FAB */
.help-fab {
  position: fixed; right: 1rem; z-index: 40;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: var(--tap); padding: 0 1.1rem 0 .9rem;
  background: #25D366; color: #06331A;
  border-radius: 999px; box-shadow: var(--shadow-lg);
  font-weight: 700; text-decoration: none;
  transition: transform var(--fast) var(--ease);
}
.help-fab:hover { transform: translateY(-2px); color: #06331A; }
.help-fab .icon { width: 22px; height: 22px; }
/* The captain's bid button lives at the bottom of the live room. The help
 * button must not sit on top of it — doc 08 §16 asks for exactly this. */
[data-surface="room"] .help-fab, body.room .help-fab, body.picks .help-fab { display: none; }

/* ------------------------------------------------------------------ hero */
.hero-band {
  position: relative; overflow: hidden; color: #F2F4FB;
  background: linear-gradient(160deg, #1A1650 0%, #121A33 55%, var(--navy-900) 100%);
}
.hero-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 82% 18%, rgb(34 211 238 / 18%), transparent 42%),
    radial-gradient(circle at 12% 88%, rgb(108 92 231 / 40%), transparent 48%);
}
.hero {
  position: relative; max-width: var(--container); margin: 0 auto;
  padding: 3.5rem var(--gutter) 3rem;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: center;
}
.hero h1 { color: #fff; font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.6rem); letter-spacing: -.035em;
           line-height: 1.04; margin-bottom: .9rem; }
.hero h1 .accent { color: #67E8F9; }
.hero .eyebrow { color: #A5F3FC; }
.hero .lede { color: #C3CAE6; font-size: 1.15rem; max-width: 34rem; margin-bottom: .5rem; }
.hero .sub { color: #9AA3C7; max-width: 36rem; margin-bottom: 1.5rem; }
.hero .form-actions { margin-top: 0; gap: .75rem; }
.hero .btn { border-color: rgb(255 255 255 / 22%); background: rgb(255 255 255 / 8%); color: #fff;
             box-shadow: none; }
.hero .btn:hover { background: rgb(255 255 255 / 14%); border-color: rgb(255 255 255 / 40%); }
.hero .btn-primary { background: linear-gradient(180deg, var(--violet-500), var(--violet-600));
                     border-color: var(--violet-500); box-shadow: var(--shadow-accent); }
.hero .btn-primary:hover { background: linear-gradient(180deg, var(--violet-600), var(--violet-700)); }
.hero-points { display: flex; gap: 1.25rem 1.75rem; flex-wrap: wrap; margin: 1.75rem 0 0; padding: 0;
               list-style: none; }
.hero-points li { display: flex; align-items: center; gap: .5rem; font-size: .92rem; color: #C3CAE6;
                  margin: 0; }
.hero-points .icon { color: var(--cyan-400); width: 20px; height: 20px; }
.hero-art { position: relative; min-width: 0; }
.hero-art img { width: 100%; height: auto; display: block;
                filter: drop-shadow(0 30px 50px rgb(0 0 0 / 45%)); }

/* Feature tiles. */
.feature-grid { display: grid; gap: 1rem; margin: 1.25rem 0 0;
                grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
           padding: 1.25rem; box-shadow: var(--shadow-xs); display: grid; gap: .5rem;
           align-content: start;
           transition: transform var(--normal) var(--ease), box-shadow var(--normal) var(--ease); }
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feature .feature-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
                         background: var(--accent-soft); color: var(--accent-strong); }
.feature .feature-icon .icon { width: 24px; height: 24px; }
.feature.tint-cyan .feature-icon { background: var(--cyan-100); color: var(--cyan-ink); }
.feature.tint-gold .feature-icon { background: var(--amber-100); color: var(--gold-ink); }
.feature.tint-green .feature-icon { background: var(--green-100); color: var(--green-600); }
.feature h3 { margin: .35rem 0 0; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.feature ul { margin: 0; padding-left: 1.1rem; color: var(--text-muted); font-size: .95rem; }

/* Illustrated split section: art one side, copy the other. */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center;
         margin: 2.5rem 0; }
.split.reverse .split-art { order: 2; }
.split-art img { width: 100%; height: auto; display: block; border-radius: var(--radius-lg); }
.split h2 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.9rem); }
.split .lede { margin-bottom: .75rem; }
.split ul { color: var(--text-muted); padding-left: 1.15rem; }

/* Numbered steps. */
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .6rem; }
.step-grid { display: grid; gap: 1rem; margin: 1.25rem 0 0; padding: 0; list-style: none;
             grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); counter-reset: step; }
.step-grid li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
                padding: 1.25rem; box-shadow: var(--shadow-xs); counter-increment: step; margin: 0;
                display: grid; gap: .4rem; align-content: start; }
.step-grid li::before {
  content: counter(step); width: 40px; height: 40px; border-radius: 12px;
  background: var(--navy-800); color: var(--cyan-400); font-family: var(--font-head);
  font-weight: 800; font-size: 1.1rem; display: grid; place-items: center; margin-bottom: .35rem;
}
.step-grid strong { display: block; font-size: 1.05rem; font-family: var(--font-head); }
.step-grid p { margin: 0; color: var(--text-muted); font-size: .95rem; }

/* The trust panel: what this product is NOT. Doc 01 §7 wants no fake social
   proof, and a plain statement of limits is the honest version of trust. */
.trust { background: var(--navy-900); color: #DCE1F2; border-radius: var(--radius-lg);
         padding: 2rem; margin: 2.5rem 0; display: grid; grid-template-columns: 1.2fr 1fr;
         gap: 1.5rem 3rem; align-items: center; }
.trust h2 { color: #fff; }
.trust p { margin: 0; color: #B6BDD9; }
.trust ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.trust li { display: flex; gap: .6rem; align-items: flex-start; margin: 0; }
.trust .icon { color: var(--cyan-400); margin-top: .15rem; }

.cta-band { border-radius: var(--radius-lg); padding: 2.25rem; margin: 2.5rem 0 0;
            background: linear-gradient(135deg, var(--violet-600), #3D2FB8);
            color: #fff; display: flex; align-items: center; justify-content: space-between;
            gap: 1.5rem; flex-wrap: wrap; box-shadow: var(--shadow-accent); }
.cta-band h2 { color: #fff; margin: 0 0 .25rem; }
.cta-band p { margin: 0; color: #E4E0FF; }
.cta-band .btn { background: #fff; color: var(--violet-700); border-color: #fff; }
.cta-band .btn:hover { background: #F3F0FF; }

/* The event front door's header. */
.event-head { display: grid; gap: .5rem; margin-bottom: 1.25rem; }
.event-head h1 { margin: 0; }
.cta-row { display: flex; gap: .6rem; flex-wrap: wrap; margin: .25rem 0 1.5rem; }
/* The players list on the event page: a small avatar beside a long name, a search
 * box that is as wide as the table, and rows that hide cleanly when filtered. */
.pool-search { margin: .25rem 0 0; }
.pool-search input { max-width: 26rem; }
.pool-counts { margin-bottom: .5rem; }
.pool-scroll-hint { display: none; }
@media (max-width: 640px) {
  .pool-scroll-hint { display: block; }
}
#pool-table tbody tr[hidden] { display: none; }
[data-filter-empty][hidden] { display: none; }
#pool-table .name-col { min-width: 15rem; }
#pool-table .pool-initials, #pool-table .pool-photo {
  width: 28px; height: 28px; border-radius: 8px; font-size: .68rem; margin-right: .55rem;
  vertical-align: middle; object-fit: cover;
}
#pool-table .pool-note { display: block; font-weight: 400; font-size: .85rem; margin-left: 2.1rem; }
#pool-table td { vertical-align: middle; }
.team-dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%;
            background: var(--team-colour, var(--grey-400)); margin-right: .45rem;
            vertical-align: -.05rem; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }

/* Sign-in. */
.auth { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border);
        border-radius: var(--radius-lg); overflow: hidden; background: var(--surface);
        box-shadow: var(--shadow); margin: 1rem 0; }
.auth-art { background: linear-gradient(160deg, #1A1650, var(--navy-900)); padding: 2rem;
            display: grid; align-content: center; gap: 1rem; color: #C3CAE6; }
.auth-art img { width: 100%; height: auto; }
.auth-art h2 { color: #fff; margin: 0; }
.auth-art p { margin: 0; }
.auth-body { padding: 2.25rem; display: grid; gap: .5rem; align-content: center; }
.auth-body h1 { margin-bottom: .25rem; }
.btn-google { gap: .6rem; }
.btn-google .icon { width: 20px; height: 20px; }
/* The emailed code (ADR-027). The "or" rule belongs to the Google block, so the
   iOS app, which hides that block, shows no dangling divider. */
.auth-google { display: grid; gap: .5rem; }
.auth-or { display: flex; align-items: center; gap: .75rem; margin: .25rem 0;
           color: var(--text-muted); font-size: .9rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1 1 auto; height: 1px;
                                    background: var(--border); }
.auth-email { display: grid; gap: .4rem; }
.auth-email .form-actions { margin-top: .75rem; }
.auth-step { font-size: 1.1rem; margin: 0; }
.auth-email-more { display: flex; flex-wrap: wrap; gap: .5rem; }
.auth-email-more .btn { min-height: var(--tap, 44px); }

/* ------------------------------------------------------------- data grids */
/* The estate's grid rules, in one place (_BRAIN §B1, §B4, §B6):
 *   - amounts right-aligned with tabular numerals, so a column of figures
 *     lines up and does not jitter as it changes;
 *   - NAME COLUMNS WIDE AND WRAPPING, because truncating a person's name with
 *     an ellipsis is how the wrong player gets bought;
 *   - a frozen header, so scrolling a long player list does not lose it;
 *   - and the whole thing scrolls horizontally inside its own box rather than
 *     pushing the page sideways on a phone.
 */
/* `position: relative` MAKES THE WRAPPER THE CONTAINING BLOCK. Without it an
   absolutely positioned child — every `.visually-hidden` label in a cell —
   is positioned against the page instead, escapes the scroll box, and widens
   the document: the players screen was 557px wide on a 390px phone, so the
   whole page panned sideways. */
.grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0;
             position: relative;
             border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
             box-shadow: var(--shadow-xs); }
.grid-wrap > .grid { margin: 0; border: 0; border-radius: 0; box-shadow: none; }

.grid {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.grid th, .grid td {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.grid thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2);
  font-size: .76rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700; white-space: nowrap;
}
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: var(--grey-50); }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Wide and WRAPPING. Never `text-overflow: ellipsis` on a person's name. */
.grid .name-col { min-width: 14rem; overflow-wrap: anywhere; font-weight: 600; }
.grid td .muted { font-weight: 400; }

/* Import preview rows, so a refusal is visible at a glance and by its text. */
.grid .row-create td { background: rgb(31 138 76 / 6%); }
.grid .row-skip   td { color: var(--text-muted); }
.grid .row-error  td { background: rgb(214 69 69 / 8%); }

.ladder { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.ladder code { margin: 0; padding: .3rem .55rem; background: var(--accent-soft); color: var(--accent-strong);
               font-weight: 600; }

.check-list { list-style: none; padding: 0; display: grid; gap: .25rem; }
.check-list label { display: flex; align-items: center; gap: .7rem; margin: 0;
                    font-weight: 500; min-height: var(--tap); padding: .1rem .25rem; border-radius: var(--radius-xs); }
.check-list label:hover { background: var(--surface-2); }
.check-list input { width: auto; min-height: auto; }
.check-list li { margin: 0; }
.check-row { display: flex; align-items: center; gap: .7rem; font-weight: 500; min-height: var(--tap);
             margin: .35rem 0; }
.check-row input[type="checkbox"], .check-row input[type="radio"],
.check-list input[type="checkbox"], li > label > input[type="checkbox"] {
  /* A native box is 13x13 px. People aim at the BOX, not the label, so it
     gets a thumb-sized target of its own. */
  width: 24px; height: 24px; min-height: 24px; flex: 0 0 auto;
  accent-color: var(--accent); margin: 0;
}
.check-row input { width: auto; min-height: auto; }

details.callout > summary {
  cursor: pointer; min-height: var(--tap); display: flex; align-items: center; gap: .5rem;
  list-style: none; font-weight: 700;
}
details.callout > summary::-webkit-details-marker { display: none; }
details.callout > summary::before {
  content: ""; width: .5rem; height: .5rem; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin-right: .35rem;
  transition: transform var(--fast) var(--ease); flex: none;
}
details.callout[open] > summary::before { transform: rotate(45deg); }

/* --------------------------------------------------------------- avatars */
/* A badge is 40px in a grid and 96px on the board. It is ALWAYS square and
 * always the same size whether it holds a photo or initials, so a row with no
 * photo does not collapse and the column does not jump as photos load. */
.badge {
  width: 40px; height: 40px; border-radius: 11px;
  object-fit: cover; display: inline-flex; flex: none;
  align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-muted);
  font-weight: 700; font-size: .8rem; letter-spacing: .02em;
  border: 1px solid var(--border);
}
/* A player has no team colour yet, so the fallback is the brand's own
   gradient rather than the panel grey — white initials on light grey were
   invisible on the players screen. */
.badge-initials { background: var(--team, linear-gradient(140deg, var(--violet-500), var(--navy-700)));
                  color: #fff; border-color: transparent; }

.badge-form { display: flex; align-items: center; gap: .4rem; margin: 0; }
/* The file input itself is hidden and the LABEL is the target, because a
 * native file input cannot be styled and is 200px wide in every browser. The
 * label keeps a 44px tap target. */
.badge-upload input[type="file"] {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.badge-upload {
  display: inline-flex; align-items: center; cursor: pointer;
  min-height: var(--tap); padding: 0 .4rem; margin: 0;
  font-size: .82rem; font-weight: 600; color: var(--accent);
}
.badge-upload:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.consent-form { margin: 0; }
.consent-form select {
  min-width: 12rem;
  /* NEVER below 16px: iOS Safari zooms the page when a smaller field takes
     focus, and this one repeats once per player. */
  font-size: 1rem;
  min-height: var(--tap);
}

/* The board and the projector. */
.lot-photo { width: 96px; height: 96px; border-radius: 22px; font-size: 1.7rem; }
.proj .lot-photo { width: 10vw; height: 10vw; border-radius: 1.4vw; font-size: 3vw; }

/* --------------------------------------------- long forms on a phone

   A SCORECARD FOR A FIFTEEN-PLAYER SQUAD IS SEVEN SCREENS TALL. Measured at
   375px it comes to 7,693px. The person filling it in is standing at a
   ground on a phone, and making them scroll all the way back to find Save is
   how a half-entered scorecard gets abandoned.

   `sticky`, not `fixed`. The live room's bid bar is fixed because that room
   never ends; a form does, and a fixed bar would sit on top of its last
   field for ever. A sticky one rides along and then settles at the bottom of
   the form where it belongs. */
.sticky-actions {
  position: sticky; z-index: 30;
  bottom: calc(env(safe-area-inset-bottom) + .5rem);
  margin-top: 1.5rem; padding: .65rem;
  background: rgb(255 255 255 / 92%);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex; gap: .5rem; flex-wrap: wrap; align-items: center;
}
.sticky-actions .btn { min-height: var(--tap); }
.form-progress { flex-basis: 100%; margin: 0; font-size: .85rem; color: var(--text-muted); }

/* ------------------------------------------------- the update notice

   Bottom-LEFT, small, and dismissible. The bottom-right is the help FAB and
   the bottom-centre is the bid bar; an update notice must not land on either.
   It is also never shown while a lot is open — see static/js/pwa.js. */
.pwa-update {
  position: fixed; z-index: 40;
  left: var(--gutter); bottom: calc(env(safe-area-inset-bottom) + .75rem);
  max-width: min(22rem, calc(100vw - 2 * var(--gutter)));
  display: flex; gap: .4rem; align-items: center; flex-wrap: wrap;
  padding: .6rem .75rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); font-size: .9rem; color: var(--text);
}
.pwa-update .btn { min-height: 36px; padding: .25rem .6rem; }

/* --------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------- the room */
/* Everything below is the dark, high-contrast live surface. It uses the SAME
 * tokens as the light setup surface -- `.room` just repoints them -- so a
 * component written once looks right on both and the product cannot drift into
 * feeling like two (doc 01 §21). */
body.room { background: var(--navy-900); }
body.room, .projector { color-scheme: dark; }
body.room .dev-banner { background: #B08A2E; color: #1A1200; }

/* `.projector` IS ON THIS LIST because it is the same dark surface. Without it
   the projector kept the LIGHT tokens: every h1 took `--text` (#171B26) and the
   player's name — the one thing the back of the hall is there to read — was
   near-black on navy, and the initials tile was a pale grey square. */
.room, body.room .room-head, .projector {
  --bg: var(--navy-900);
  --surface: var(--navy-800);
  --surface-2: var(--navy-700);
  --surface-3: var(--navy-600);
  --border: #2A365E;
  --border-strong: #35447A;
  --text: #F2F4FB;
  --text-muted: #A6B0CC;
  --text-faint: #6F7A9B;
  --accent: var(--violet-500);
  --accent-strong: #9A8BFF;
  --accent-soft: rgb(130 113 240 / 18%);
  --live: var(--cyan-400);
  --live-soft: rgb(34 211 238 / 14%);
  --focus: var(--cyan-400);
  --shadow: 0 10px 30px rgb(0 0 0 / 35%);
  --shadow-sm: 0 4px 14px rgb(0 0 0 / 30%);
  --shadow-xs: none;
  --shadow-lg: 0 20px 50px rgb(0 0 0 / 55%);
  color: var(--text);
}
.room h1, .room h2, .room h3, .room h4,
.projector h1, .projector h2, .projector h3 { color: var(--text); }
.room a { color: var(--accent-strong); }
/* The LAYOUT is for the container inside <main>, never for the body — the
   body carries the same class purely to switch the palette, and a body
   turned into a grid sizes its column to the widest descendant, which is how
   a phone ends up with a board wider than its screen. */
.room:not(body) {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem var(--gutter) 9.5rem;   /* room for the fixed bid bar */
  display: grid;
  gap: 1rem;
  width: 100%;
  min-width: 0;
}
.room .hint { color: var(--text-muted); }
.room .btn { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); box-shadow: none; }
.room .btn:hover { background: var(--surface-3); border-color: #4A5A96; }
.room .btn-primary { background: linear-gradient(180deg, var(--violet-500), var(--violet-600));
                     border-color: var(--violet-500); color: #fff; box-shadow: var(--shadow-accent); }
.room .btn-primary:hover { background: linear-gradient(180deg, #8F80F3, var(--violet-600)); }
.room .btn-danger { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.room .btn-quiet { background: transparent; border-color: transparent; }
.room .btn-quiet:hover { background: rgb(255 255 255 / 6%); }
/* background-COLOR, not the shorthand: the shorthand resets the select's
   chevron to repeat from the top-left corner, which tiles it across the
   whole field. */
.room input, .room select, .room textarea { background-color: var(--navy-700); color: var(--text);
                                            border-color: var(--border-strong); }
.room select { background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A6B0CC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.room input:focus, .room select:focus, .room textarea:focus {
  border-color: var(--cyan-400); box-shadow: 0 0 0 4px rgb(34 211 238 / 18%);
}
.room .chip { background: rgb(255 255 255 / 8%); color: var(--text-muted); }
.room .chip-live { color: var(--cyan-400); background: rgb(34 211 238 / 14%); }
.room .chip-demo { color: #C9CFDD; border-color: #35447A; background: rgb(255 255 255 / 6%); }
.room .chip-paused { color: var(--gold-400); background: rgb(242 193 78 / 14%); }
.room .chip-recovery { color: #FF8A8A; background: rgb(214 69 69 / 18%); }
.room .ok   { background: rgb(31 138 76 / 16%); border-color: var(--green-600); color: #9BE3B8; }
.room .warn { background: rgb(242 193 78 / 12%); border-color: var(--gold-400); color: #F6D98A; }
.room .problem { background: rgb(214 69 69 / 16%); border-color: var(--red-600); color: #FFB3B3; }
.room .callout { background: var(--surface); border-color: var(--border); }
.room .empty-state { background: transparent; border-color: var(--border-strong); }
.room .grid, .room .grid-wrap { background: var(--surface); border-color: var(--border); }
.room .grid thead th { background: var(--navy-700); color: var(--text-muted); }
.room .grid th, .room .grid td { border-color: var(--border); }
.room .grid tbody tr:hover td { background: rgb(255 255 255 / 3%); }
.room code { background: rgb(255 255 255 / 8%); }

.room-head {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem var(--gutter);
  padding-top: calc(.55rem + env(safe-area-inset-top));
  background: rgb(18 26 51 / 92%); color: #F2F4FB;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid #2A365E;
  position: sticky; top: 0; z-index: 30;
}
.room-head > div { min-width: 0; flex: 1 1 auto; }
.room-back { color: inherit; text-decoration: none; font-size: 1.3rem;
             min-width: var(--tap); min-height: var(--tap); border-radius: 12px; flex: none;
             display: inline-flex; align-items: center; justify-content: center;
             background: rgb(255 255 255 / 6%); transition: background var(--fast) var(--ease); }
.room-back:hover { background: rgb(255 255 255 / 12%); color: inherit; }
.room-back .icon { width: 22px; height: 22px; }
.room-title { margin: 0; font-weight: 700; font-family: var(--font-head); letter-spacing: -.01em;
              line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-team  { margin: .1rem 0 0; font-size: .82rem; color: #A6B0CC;
              border-left: 3px solid var(--team, var(--violet-500));
              padding-left: .5rem; line-height: 1.2; }
.room-status { margin: 0 0 0 auto; font-size: .8rem; color: #A6B0CC; flex: none;
               display: inline-flex; align-items: center; gap: .4rem; font-weight: 600;
               max-width: 45%; text-align: right; }
.room-status::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%;
                       background: currentColor; flex: none; opacity: .8; }
.room-status[data-kind="ok"]    { color: var(--cyan-400); }
.room-status[data-kind="warn"]  { color: var(--gold-400); }
.room-status[data-kind="error"] { color: #FF8A8A; }

.lot-card, .purse-card, .squad-card, .teams-panel, .console-actions,
.pool, .seat-claim, .control-lease, .readiness, .watch-head, .sales-panel {
  background: var(--navy-800); border: 1px solid #2A365E;
  border-radius: var(--radius-lg); padding: 1.25rem; box-shadow: var(--shadow-sm);
}
.watch-head { display: flex; align-items: center; gap: .75rem 1rem; flex-wrap: wrap; }
.watch-head h1 { margin: 0; font-size: clamp(1.25rem, 1rem + 1.2vw, 1.8rem); flex: 1 1 auto; min-width: 0; }
.watch-head .room-status { margin-left: 0; max-width: none; }
.readiness { border-left: 4px solid var(--red-600); }
.readiness ul { margin-bottom: .5rem; }
.control-lease { display: flex; align-items: center; gap: .75rem 1rem; flex-wrap: wrap;
                 padding: .9rem 1.25rem; }
.control-lease .ok   { background: transparent; color: var(--cyan-400); padding: 0; border: 0;
                       margin: 0; font-weight: 600; display: inline-flex; align-items: center; gap: .5rem; }
.control-lease .warn { background: transparent; color: var(--gold-400); padding: 0; border: 0;
                       margin: 0; font-weight: 600; flex: 1 1 16rem; }
.control-lease .ok::before, .control-lease .warn::before { content: ""; width: .55rem; height: .55rem;
                       border-radius: 50%; background: currentColor; flex: none; display: inline-block;
                       margin-right: .5rem; }

.lot-card { position: relative; overflow: hidden;
            background: radial-gradient(120% 90% at 100% 0%, rgb(108 92 231 / 22%), transparent 55%),
                        var(--navy-800); }
.lot-head { display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.lot-head .lot-photo { flex: none; }
.lot-head > div { min-width: 0; }
.lot-label { margin: 0 0 .35rem; font-size: .72rem; letter-spacing: .18em;
             text-transform: uppercase; color: #A6B0CC; font-weight: 700; }
.lot-card h1, .lot-card h2 { font-size: clamp(1.35rem, 1.1rem + 1.4vw, 2rem); margin: 0; line-height: 1.15; }
.lot-category { color: #A6B0CC; margin: .2rem 0 0; font-size: .95rem; }

/* `max(7.5rem, 30%)`: three tiles to a row on a card, two on a phone. With a
   bare 7.5rem the desktop card made FIVE tracks, so once the current bid took
   a row of its own the other three tiles sat squeezed into the left half. */
.lot-figures { display: grid;
               grid-template-columns: repeat(auto-fit, minmax(max(7.5rem, 30%), 1fr));
               gap: .75rem; margin: 1rem 0 0; }
.purse-card .lot-figures { grid-template-columns: repeat(auto-fit, minmax(max(7.5rem, 22%), 1fr)); }
.lot-figures > div { background: rgb(255 255 255 / 4%); border: 1px solid rgb(255 255 255 / 6%);
                     border-radius: var(--radius-sm); padding: .65rem .8rem; min-width: 0;
                     container-type: inline-size; }
.lot-figures dt { font-size: .7rem; letter-spacing: .12em; font-weight: 700;
                  text-transform: uppercase; color: #A6B0CC; margin-bottom: .2rem; }
.lot-figures dd { margin: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.2;
                  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* AN AMOUNT NEVER BREAKS ACROSS LINES. `overflow-wrap: anywhere` above is for
   names; on a figure it printed a rupee bid as "24,00,000.0" with the last
   "0" on a line of its own. Amounts stay on one line and SCALE to their box
   (container units), so "1,00,00,000.00" fits a phone's half-width tile and a
   points total keeps its full size wherever there is room. */
.lot-figures dd.amount { white-space: nowrap; overflow-wrap: normal; }
.lot-figures .big { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); color: var(--cyan-400);
                    font-family: var(--font-head); letter-spacing: -.02em; }
/* A currency with paise is up to five characters longer ("1,00,00,000.00"),
   so in a rupee auction the figures scale to their tile. Points keep their
   full size: shrinking every "1,000" to fit a figure it never shows would be
   a loss on the screens that do not need it. */
[data-unit-scale="2"] .lot-figures dd.amount { font-size: clamp(.85rem, 12.5cqi, 1.25rem); }
[data-unit-scale="2"] .lot-figures dd.amount.big { font-size: clamp(1.4rem, 12.5cqi, 2.6rem); }
/* The current bid gets a row of its own at every width: squeezed into two of
   four columns it was the figure most likely to wrap, and it is the one the
   whole room is reading. */
.lot-figures > div.is-big { grid-column: 1 / -1; background: rgb(34 211 238 / 8%);
                            border-color: rgb(34 211 238 / 18%); }
/* TIME LEFT IS READ AS MUCH AS THE PRICE: a bidder decides on it. Bigger
 * than the other tiles, and gold under five seconds (live.js data-urgent). */
.lot-figures dd.countdown { font-size: 1.6rem; font-family: var(--font-head); }
/* On a phone (two tiles to a row) the leading team takes a row of its own,
 * so a long name is not wrapped into half a tile and "Time left" no longer
 * sits alone beside an empty cell (seen on the live board, 1 Oct 2026). */
@media (max-width: 640px) {
  .lot-figures > div.is-leader { grid-column: 1 / -1; }
}

/* THE SOLD MOMENT (live.js `renderResult`). Gold is the product's
   "celebration" colour (doc 01 §21: restrained gold celebrations), and the
   stamp carries WORDS — "Sold to Pune Panthers for 24,00,000" — so the state
   is never colour alone. Nothing here animates: a stamp that flies in is a
   stamp that delays the next present. */
.lot-card.is-sold { border-color: rgb(242 193 78 / 55%);
                    background: radial-gradient(120% 90% at 100% 0%, rgb(242 193 78 / 16%), transparent 55%),
                                var(--navy-800); }
.lot-card.is-sold .lot-label, .proj-main.is-sold .proj-label { color: var(--gold-400); }
.lot-card.is-sold .lot-figures .big { color: var(--gold-400); }
.lot-card.is-unsold { opacity: .92; }
.lot-card.is-unsold .lot-label { color: #C9CFDD; }
.lot-result { margin: .9rem 0 0; padding: .55rem .9rem; border-radius: var(--radius-sm);
              font-weight: 700; font-family: var(--font-head); letter-spacing: -.01em;
              background: rgb(242 193 78 / 14%); border: 1px solid rgb(242 193 78 / 45%);
              color: #F6D98A; }
.lot-result[hidden] { display: none; }
.lot-card.is-unsold .lot-result { background: rgb(255 255 255 / 5%); border-color: #35447A;
                                  color: #C9CFDD; }

/* Recent sales. A board, not the register: the last few, newest first, with
   the running count above them (_BRAIN B5: counts on every summary). */
.sales-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.sale-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .75rem;
            align-items: center; margin: 0; padding: .5rem .75rem;
            background: rgb(255 255 255 / 4%); border: 1px solid rgb(255 255 255 / 5%);
            border-left: 4px solid var(--team, #4A5A96); border-radius: var(--radius-sm); }
.sale-player { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.sale-team { color: #A6B0CC; font-size: .85rem; font-weight: 700; letter-spacing: .04em; }
.sale-amount { color: var(--gold-400); font-weight: 700; white-space: nowrap;
               font-variant-numeric: tabular-nums; }
.sale-empty { color: var(--text-muted); font-size: .9rem; list-style: none; }
.sales-progress { margin: -.35rem 0 .6rem; }

.countdown { font-variant-numeric: tabular-nums; }
/* A colour change, never a flash, and never anything that delays a tap. */
.countdown[data-urgent] { color: var(--gold-400); }

.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.team-row { display: grid; grid-template-columns: 1fr auto auto; gap: .75rem; align-items: center;
            padding: .55rem .75rem; background: rgb(255 255 255 / 4%);
            border: 1px solid rgb(255 255 255 / 5%);
            border-left: 4px solid var(--team, #4A5A96);
            border-radius: var(--radius-sm); }
.team-row.is-leader { background: rgb(34 211 238 / 10%); border-color: rgb(34 211 238 / 25%);
                      border-left-color: var(--team, var(--cyan-400)); }
.team-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.team-purse { font-variant-numeric: tabular-nums; color: var(--cyan-400); font-weight: 700; }
.team-squad { color: #A6B0CC; font-variant-numeric: tabular-nums; font-size: .9rem; }
.teams-panel h2, .squad-card h2, .purse-card h2, .pool h2, .console-actions h2 {
  font-size: 1.05rem; margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }

.squad-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.squad-list li { display: flex; justify-content: space-between; gap: 1rem; margin: 0;
                 padding: .45rem .6rem; border-radius: var(--radius-xs); background: rgb(255 255 255 / 3%); }

/* THE BID BAR. Fixed, inside the safe area, and the only thing under the
 * thumb. Doc 01 §14 and doc 08 §16: the keyboard must not cover the bid state,
 * and the chat sheet has to stay away from this tap target. */
.bid-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  padding: .75rem var(--gutter) calc(.75rem + env(safe-area-inset-bottom));
  background: rgb(18 26 51 / 94%);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid #2A365E; box-shadow: 0 -10px 30px rgb(0 0 0 / 35%);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem;
  align-items: center;
}
.bid-bar-inner { display: contents; }
.bid-bar input { background-color: var(--navy-700); color: #F2F4FB; border-color: #35447A;
                 min-height: 56px; font-size: 1.15rem; font-weight: 700; text-align: center;
                 font-variant-numeric: tabular-nums; border-radius: 12px; }
.bid-button { min-height: 56px; font-size: 1.1rem; border-radius: 12px; }
.bid-button .amount { font-family: var(--font-head); letter-spacing: -.01em; }
.bid-reason { grid-column: 1 / -1; margin: 0; font-size: .85rem;
              color: var(--gold-400); min-height: 1.2em; font-weight: 500; }
/* Nothing is typed: the bid is the next step, and where the rules allow a
 * jump, "+" and "−" sit beside the bid button (the owner, 1 Oct 2026). With
 * jumps off the stepper is hidden and the bid button takes the whole row. */
/* One column on a phone: "−" and "+" on their own row ABOVE the bid button,
 * because a rupee amount ("13,00,000.00") beside two buttons ran off a 390px
 * screen. Side by side from tablet width up. */
.bid-stepper { display: grid; grid-template-columns: minmax(3.5rem, 5rem) minmax(0, 1fr); gap: .5rem; }
.bid-stepper[hidden] { display: none; }
@media (min-width: 720px) {
  .bid-bar { grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr); }
  .bid-bar > .bid-stepper[hidden] + .bid-button { grid-column: 1 / -1; }
}
.console .bid-stepper { display: inline-grid; }
.step-btn { min-width: 3.25rem; min-height: 56px; font-size: 1.25rem; font-weight: 800;
            border-radius: 12px; padding: .4rem .75rem; font-variant-numeric: tabular-nums; }
.step-btn [data-step-size] { font-size: .95rem; margin-left: .1rem; }
.room .step-btn { background: var(--navy-700); color: #F2F4FB; border-color: #35447A; }
.bid-step { grid-column: 1 / -1; margin: 0; font-size: .9rem; color: #C3CAE6;
            font-variant-numeric: tabular-nums; min-height: 1.2em; }
.console .bid-step { color: var(--text-muted); }
.console .step-btn { min-height: 44px; }

.button-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .5rem; }
.button-row select, .button-row input { width: auto; flex: 1 1 8rem; }
.console-actions h3 { margin-top: 1.25rem; font-size: .95rem; letter-spacing: .06em;
                      text-transform: uppercase; color: var(--text-muted); }
.danger-heading { color: var(--gold-400); }
.danger-zone { margin-top: 1rem; padding: 1rem; border: 1px dashed rgb(242 193 78 / 45%);
               border-radius: var(--radius-sm); background: rgb(242 193 78 / 5%); }
.danger-zone h3 { margin-top: 0; }

.pool-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem;
             max-height: 26rem; overflow-y: auto; overscroll-behavior: contain; }
.pool-list li { margin: 0; }
.pool-list .btn { width: 100%; justify-content: space-between; gap: 1rem; text-align: left;
                  white-space: normal; padding: .6rem .8rem; }
.pool-list .btn .amount { color: var(--cyan-400); font-weight: 700; flex: none; }
.pool-list .btn .muted { flex: 1 1 auto; font-size: .85rem; }

/* The console is a desktop surface: its bid bar is in the flow, not fixed. */
.console { padding-bottom: 2rem; }
.console .bid-bar { position: static; border: 0; padding: 0; box-shadow: none;
                    background: transparent; grid-template-columns: 1fr; backdrop-filter: none; }
@media (min-width: 900px) {
  /* `dense`: the pool spans two rows in the right-hand column, and without
     back-filling it was placed BELOW the row the lot card started in, leaving
     an empty cell beside the player on the block. */
  .console { grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 1fr); align-items: start;
             grid-auto-flow: row dense; }
  .console .control-lease, .console .readiness { grid-column: 1 / -1; }
  .console .lot-card { grid-column: 1; }
  .console .console-actions { grid-column: 1; }
  .console .pool { grid-column: 2; grid-row: span 2; position: sticky; top: 4.5rem; }
  .console .teams-panel { grid-column: 1 / -1; }
  .console .sales-panel { grid-column: 2; }
  .console .teams-panel .team-list { grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
}
@media (min-width: 900px) {
  /* Teams and chat share a column so the conversation stays directly below
     the teams, regardless of the player card's height. */
  .watch { grid-template-columns: minmax(0, 1.6fr) minmax(18rem, 1fr); align-items: start;
           grid-auto-flow: row dense; }
  .watch .watch-head { grid-column: 1 / -1; }
  .watch .lot-card { grid-column: 1; }
  .watch .watch-community { grid-column: 2; grid-row: auto / span 3; }
  .watch .watch-chat-shortcut { grid-column: 1 / -1; }
  .watch .sales-panel { grid-column: 1; }
  .watch > .hint { grid-column: 1; }
  .watch .chat-sheet { grid-column: 1 / -1; }
  .captain-grid { grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 1fr); align-items: start; }
  .captain-grid .seat-claim, .captain-grid .lot-card { grid-column: 1 / -1; }
  .captain-grid .teams-panel { grid-column: 1 / -1; }
  .captain-grid .chat-sheet { grid-column: 1 / -1; }
}

/* Captain and auctioneer surfaces: quieter panels, clear action/state colours. */
body.room-bidding { background: #0B1524; }
body.room-bidding .room, body.room-bidding .room-head {
  --navy-800: #14243A; --navy-700: #1C304B; --navy-600: #263D5B;
  --surface: #14243A; --surface-2: #1C304B; --surface-3: #263D5B;
  --border: #304762; --border-strong: #456282;
  --text: #F3F7FC; --text-muted: #BDCBDE; --text-faint: #A5B5CB;
  --cyan-400: #67E4F2; --gold-400: #FFD57A;
}
body.room-bidding .room-head { background: rgb(14 29 47 / 96%); border-color: #304762; }
.room-bidding .room-status { padding: .35rem .6rem; border-radius: 8px; background: rgb(255 255 255 / 5%); }
.room-bidding .lot-card, .room-bidding .purse-card, .room-bidding .squad-card,
.room-bidding .sales-panel, .room-bidding .teams-panel, .room-bidding .console-actions,
.room-bidding .pool, .room-bidding .control-lease { border-color: #304762; border-radius: 16px; box-shadow: none; }
.room-bidding .lot-card { background: linear-gradient(125deg, #192E48, #14243A 70%); padding: 1rem; }
.room-bidding .lot-card.is-sold { background: linear-gradient(125deg, #383428, #14243A 70%); border-color: #B68D44; }
.room-bidding .lot-topline { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.room-bidding .lot-label { margin: 0; color: #BDCBDE; letter-spacing: .12em; }
.bid-state { font-size: .75rem; font-weight: 700; padding: .3rem .55rem; border: 1px solid #456282;
  border-radius: 7px; color: #BDCBDE; background: #1C304B; text-align: center; }
.bid-state[data-kind="open"] { color: #8AEEF6; border-color: #35828D; background: #173A49; }
.bid-state[data-kind="leading"] { color: #A2F3CF; border-color: #34826C; background: #183E35; }
.bid-state[data-kind="settled"], .bid-state[data-kind="paused"], .bid-state[data-kind="updating"], .bid-state[data-kind="closing"] {
  color: #FFD57A; border-color: #7C6842; background: #373329;
}
.room-bidding .lot-head { gap: .8rem; margin-bottom: .6rem; }
.room-bidding .lot-head .lot-photo { width: 64px; height: 64px; border-radius: 13px; font-size: 1.35rem; }
.room-bidding .lot-category { color: #BDCBDE; font-size: .9rem; }
.room-bidding .lot-figures { gap: .55rem; margin-top: .75rem; }
.room-bidding .lot-figures > div { background: #1A2E46; border-color: #324D6C; border-radius: 10px; padding: .7rem; }
.room-bidding .lot-figures dt { color: #BDCBDE; letter-spacing: .07em; }
.room-bidding .lot-figures > div.is-big { background: #163D4C; border-color: #326B7A; }
.room-bidding .lot-clock-note { margin: .65rem 0 0; font-size: .8rem; }
.room-bidding [data-bidding-state="leading"] .lot-card { border-color: #448B76; }
.room-bidding [data-bidding-state="leading"] .lot-figures > .is-leader { background: #1A3B34; border-color: #448B76; }
.room-bidding .lot-figures > div:has(.countdown[data-urgent]) { background: #42382A; border-color: #B68D44; }
.room-bidding .purse-card, .room-bidding .squad-card { padding: 1rem; }
.room-bidding .purse-card .lot-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.room-bidding .purse-card [data-my-purse] { color: #8AEEF6; }
.room-bidding .purse-card [data-my-safe-maximum] { color: #A2F3CF; }
.room-bidding .purse-card [data-my-reserve] { color: #FFD57A; }
.budget-help { margin-top: .75rem; font-size: .8rem; color: #BDCBDE; }
.budget-help > summary { cursor: pointer; padding: .3rem 0; }
.budget-help > .hint { margin: .4rem 0 0; }
.squad-count { margin-left: auto; padding: .22rem .45rem; font-size: .75rem; border-radius: 6px;
  color: #A2F3CF; background: #1A3B34; font-variant-numeric: tabular-nums; }
.squad-list-labels { display: flex; justify-content: space-between; gap: .5rem; color: #BDCBDE;
  font-size: .72rem; padding: 0 .6rem .45rem; }
.room-bidding .squad-list li { padding: .65rem .7rem; align-items: center; background: #1A2E46; border: 1px solid #324D6C; gap: .7rem; }
.squad-player { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.squad-place { display: block; margin-top: .18rem; color: var(--text-muted); font-size: .8rem; font-weight: 400; }
.room-bidding .squad-list .amount { color: #A2F3CF; font-weight: 700; white-space: nowrap; }
.room-bidding .squad-list .squad-empty { color: #BDCBDE; font-size: .85rem; }
.room-bidding .bid-bar { background: rgb(14 29 47 / 98%); border-color: #456282; box-shadow: 0 -4px 16px rgb(0 0 0 / 20%); }
.room-bidding .room .bid-button { background: linear-gradient(180deg, #67E4F2, #3AC5DD); color: #072D3D;
  border-color: #67E4F2; box-shadow: none; font-weight: 800; }
.room-bidding .room .bid-button:hover:not(:disabled) { background: #8AEEF6; }
.room-bidding .room .bid-button:disabled { background: #263B53; border-color: #456282; color: #BDCBDE; opacity: 1; box-shadow: none; }
.room-bidding [data-bidding-state="leading"] .bid-reason { color: #A2F3CF; }
.room-bidding .bid-reason:empty, .room-bidding .bid-step:empty { display: none; }
.room-bidding .team-row, .room-bidding .sale-row { border-top-color: #324D6C; border-right-color: #324D6C; border-bottom-color: #324D6C; background: #1A2E46; }
.room-bidding .chat-panel { background: #14243A; border-color: #304762; border-radius: 16px; }
.room-bidding .chat-msg { background: #1C304B; }
@media (min-width: 760px) {
  .room-bidding .captain-grid .lot-card .lot-figures { grid-template-columns: 1.45fr 1.45fr 1fr 1fr; }
  .room-bidding .captain-grid .lot-card .lot-figures > div.is-big { grid-column: auto; }
  .room-bidding .captain-grid .lot-card .lot-figures > div { display: flex; flex-direction: column; justify-content: center; }
  .room-bidding .captain-grid .lot-card .big { font-size: clamp(1.6rem, 18cqi, 2.4rem); }
}
@media (min-width: 900px) {
  .room-bidding .captain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .room-bidding .room-status { max-width: 35%; font-size: .72rem; padding: .25rem .4rem; }
  .room-bidding .lot-topline { flex-wrap: wrap; }
  .room-bidding .bid-state { font-size: .7rem; }
  .room-bidding .lot-head .lot-photo { width: 54px; height: 54px; }
}

/* --------------------------------------------------------------- chat

   The panel scrolls inside itself. Bidding screens use a collapsible sheet;
   the public watch board keeps conversation visible. Doc 08 §16: "bidding stays primary and fixed; chat in a
   collapsible sheet/tab AWAY FROM THE BID TAP TARGET. Keyboard opening cannot
   cover the bid state or fire shortcut bids."

   The practical version of that last sentence is the `max-height` below: the
   log is bounded by the viewport rather than growing, so opening the keyboard
   shrinks the log instead of pushing the bid bar off the screen. */
.chat { display: flex; flex-direction: column; gap: .5rem;
        border: 1px solid var(--border); border-radius: var(--radius);
        background: var(--surface); padding: .9rem; min-width: 0; box-shadow: var(--shadow-xs); }
.chat-head { display: flex; justify-content: space-between; align-items: baseline;
             gap: .5rem; flex-wrap: wrap; }
.chat-head h2 { margin: 0; font-size: 1.05rem; }
.chat-state { margin: 0; font-size: .85rem; color: var(--text-muted);
              display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

.chat-log { list-style: none; margin: 0; padding: .25rem; overflow-y: auto;
            display: flex; flex-direction: column; gap: .5rem;
            max-height: min(46vh, 26rem);
            overscroll-behavior: contain; }
.chat-log li { margin: 0; flex: 0 0 auto; }
.chat-log:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.chat-log-mod { max-height: none; }

.chat-msg { padding: .5rem .65rem; border-radius: var(--radius-sm);
            background: var(--surface-2); }
.chat-meta { margin: 0 0 .15rem; font-size: .8rem; display: flex; gap: .4rem;
             align-items: center; flex-wrap: wrap; color: var(--text-muted); }
.chat-author { font-weight: 600; color: var(--text); }
/* The role badge is SERVER-WRITTEN and styled distinctly. Doc 08 §15: "Official
   event updates have server-generated style/role markers that user content
   cannot reproduce" — a body is escaped text in a <p>, so it can print the
   characters of a badge but never become one. */
.chat-role { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
             padding: .1rem .4rem; border-radius: 999px;
             background: var(--violet-100); color: var(--violet-600); }
.chat-body { margin: 0; overflow-wrap: anywhere; }
.chat-official { border-left: 3px solid var(--accent); background: var(--accent-soft); }
.chat-official .chat-role { background: var(--accent); color: var(--accent-text); }
.chat-pending { opacity: .75; border-left: 3px dashed var(--grey-400); }
.chat-gone { background: transparent; border: 1px dashed var(--border); }
.chat-tombstone { color: var(--text-muted); font-style: italic; font-size: .85rem; }
.chat-empty, .chat-older { list-style: none; text-align: center;
                           color: var(--text-muted); font-size: .85rem; }
/* Report and Block (ADR-028). Quiet, after the text, and a full tap target. */
.chat-actions { margin: .2rem 0 0; display: flex; gap: .25rem; flex-wrap: wrap;
                justify-content: flex-end; }
.chat-actions .btn { min-height: 32px; padding: .2rem .6rem; font-size: .8rem;
                     color: var(--text-muted); }
.chat-inline { margin-top: .4rem; padding: .6rem; border: 1px solid var(--border);
               border-radius: var(--radius-sm); background: var(--surface);
               display: grid; gap: .35rem; }
.chat-inline label { margin: 0; font-size: .85rem; font-weight: 600; }
.chat-inline select, .chat-inline textarea { width: 100%; margin: 0; }
.chat-inline p { margin: 0; }
.chat-inline-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.chat-inline-buttons .btn { min-height: var(--tap); }
.chat-action-status:empty { display: none; }
/* The account page's list of blocked people. */
.block-list { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.block-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
                 padding: .5rem 0; border-top: 1px solid var(--border); }
.block-list .name-col { flex: 1 1 15rem; min-width: 0; font-weight: 600;
                        overflow-wrap: anywhere; }
.block-list form { margin: 0; }
.block-list .btn { min-height: var(--tap); }

.chat-form { display: flex; flex-direction: column; gap: .4rem; }
.chat-compose { display: flex; gap: .5rem; align-items: flex-end; }
.chat-compose textarea { flex: 1 1 auto; margin: 0; resize: vertical;
                         min-height: var(--tap); }
.chat-compose .btn { min-height: var(--tap); }
.chat-rules { font-size: .85rem; }
.chat-conduct { white-space: pre-line; color: var(--text-muted); }
.chat-note { margin: 0; min-height: 1.2em; font-size: .85rem; }
.chat-note.warn { color: var(--red-600); background: transparent; border: 0; padding: 0; }
.chat-closed { margin: 0; padding: .6rem .75rem; border-radius: var(--radius-sm);
               background: var(--surface-2); color: var(--text-muted);
               font-size: .9rem; }

/* In the live room the panel sits in a collapsible sheet, BELOW the bid
   controls in source order so a tab press reaches the bid button first. */
.chat-sheet { margin-top: .25rem; }
.chat-sheet > summary { cursor: pointer; padding: .7rem .9rem; border-radius: var(--radius-sm);
                        background: var(--surface); border: 1px solid var(--border); font-weight: 600;
                        min-height: var(--tap); display: flex; align-items: center; gap: .5rem;
                        list-style: none; }
.chat-sheet > summary::-webkit-details-marker { display: none; }
.chat-sheet > summary::after { content: ""; margin-left: auto; width: .5rem; height: .5rem;
                               border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
                               transform: rotate(45deg); transition: transform var(--fast) var(--ease); }
.chat-sheet[open] > summary { margin-bottom: .5rem; }
.chat-sheet[open] > summary::after { transform: rotate(-135deg); }

/* Keep the conversation visible beside the player and bid button on desktop.
   The fixed bid bar ends before chat, so neither covers the other's controls.
   On smaller screens the same panel remains a collapsible sheet. */
@media (min-width: 1100px) {
  .room-with-chat { --room-chat-width: clamp(300px, 27vw, 360px); }
  .room-with-chat .captain-grid, .room-with-chat .console {
    width: calc(100% - var(--room-chat-width) - var(--gutter));
    max-width: none; margin: 0;
  }
  .room-with-chat .captain-grid .bid-bar { right: calc(var(--room-chat-width) + var(--gutter)); }
  .room-with-chat .room > .chat-docked {
    position: fixed; top: 4.75rem; right: var(--gutter); bottom: 1rem;
    width: var(--room-chat-width); margin: 0; z-index: 29;
  }
  .chat-docked > summary { display: none; }
  .chat-docked > .chat { position: absolute; inset: 0; height: 100%; min-height: 0; overflow: hidden; }
  .chat-docked .chat-log { flex: 1 1 0; min-height: 0; max-height: none;
    overflow-y: auto; scrollbar-gutter: stable; -webkit-overflow-scrolling: touch; }
  .chat-docked .chat-form { max-height: 50%; overflow-y: auto; }
  .chat-docked .chat-head, .chat-docked .chat-form,
  .chat-docked .chat-closed { flex: 0 0 auto; }
}

/* Conversation is visible on the watch board; bidding screens keep their sheet. */
.watch-chat-shortcut { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.watch-chat-shortcut .hint { margin: 0; }
.watch-community { display: grid; gap: 1rem; min-width: 0; }
.watch-chat { min-width: 0; scroll-margin-top: 5rem; }
.watch-chat .chat { width: 100%; }

.room > .auction-timing { grid-column: 1 / -1; padding: .8rem 1rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.auction-timing .auction-schedule { margin: 0; }
.auction-timing .hint { margin: .35rem 0 0; }

@media (min-width: 1024px) {
  /* Doc 08 §16's "optional 300–340 px chat panel" on the desktop board. */
  .chat-aside { width: 320px; flex: 0 0 320px; }
  .chat-aside .chat-log { max-height: 60vh; }
}

/* The projector's approved-message strip. A SEPARATE PANEL, deliberately
   small and deliberately out of the way: doc 08 §14 wants "approved message
   snippets in a separate panel", and the auctioneer's wall must not become a
   wall of chat. */
.proj-chat { grid-area: chat; align-self: end; max-height: 18vh; overflow: hidden; }
.proj-chat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .3vw; }
/* Floored like the rest of the projector: 1.4vw is 5 px on a phone, and a
   phone is how an operator checks the feed before walking to the hall. */
.proj-chat-line { font-size: max(.75rem, 1.4vw); opacity: .85; overflow: hidden;
                  text-overflow: ellipsis; white-space: nowrap; }
.proj-chat-author { font-weight: 700; margin-right: .5vw; }
.proj-chat-official { opacity: 1; color: var(--gold-400); }

/* ------------------------------------------------------------ results */
.squad-grid { display: grid; gap: 1rem; margin: 1rem 0 1.5rem;
              grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.squad { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
         box-shadow: var(--shadow-xs); overflow: hidden; display: flex; flex-direction: column; }
.squad-head { padding: .9rem 1.15rem; border-bottom: 1px solid var(--border);
              border-top: 4px solid var(--team-colour, var(--accent));
              display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.squad-head h3 { margin: 0; }
.squad-head .card-meta { margin: 0; }
.squad .grid-wrap { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.squad .grid { border: 0; border-radius: 0; }
.squad .muted { padding: 1rem 1.15rem; }

.rank-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .4rem; counter-reset: rank; }
.rank-list li { counter-increment: rank; display: flex; align-items: center; gap: .75rem; margin: 0;
                padding: .6rem .8rem; background: var(--surface); border: 1px solid var(--border);
                border-radius: var(--radius-sm); }
.rank-list li::before { content: counter(rank); width: 28px; height: 28px; border-radius: 8px; flex: none;
                        background: var(--accent-soft); color: var(--accent-strong); font-weight: 800;
                        display: grid; place-items: center; font-size: .85rem; }
.rank-list .amount { margin-left: auto; font-weight: 700; }

/* --------------------------------------------------------------- narrow */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.5rem; padding-bottom: 2.25rem; gap: 1.75rem; }
  .hero-art { max-width: 520px; margin: 0 auto; }
  .split, .trust, .auth { grid-template-columns: 1fr; }
  .split.reverse .split-art { order: 0; }
  .site-foot-inner { grid-template-columns: 1fr 1fr; }
  .site-foot-inner > :first-child { grid-column: 1 / -1; }
  .lot-figures > div.is-big { grid-column: 1 / -1; }
  .auth-art { padding: 1.5rem; }
  .auth-art img { max-width: 360px; margin: 0 auto; }
}

@media (max-width: 900px) {
  .site-nav { display: none; }
  .site-menu { display: block; }
}

@media (max-width: 768px) {
  .site-head { gap: .75rem; padding: .5rem var(--gutter); }
  .site-head-inner { gap: .75rem; }
  .site-nav { display: none; }
  .site-menu { display: block; }
  .site-actions > .btn-quiet.desktop-only, .site-actions > .account-menu,
  .site-actions > .header-create { display: none; }
  /* Keep support reachable without covering form fields or submit buttons. */
  .help-fab {
    position: static; display: flex; width: max-content;
    margin: 1rem var(--gutter) calc(1rem + env(safe-area-inset-bottom)) auto;
  }
  .brand-sub { display: none; }
  .kv { grid-template-columns: 1fr; gap: .15rem; }
  .kv dt { margin-top: .5rem; }
  .kv dd { margin-bottom: .25rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-card { padding: 1.15rem; }
  .trust { padding: 1.5rem; }
  .cta-band { padding: 1.5rem; }
  .cta-band .btn { width: 100%; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
}

@media (max-width: 640px) {
  .page { padding-top: 1.5rem; padding-bottom: 3rem; }
  .grid { font-size: .95rem; }
  .grid th, .grid td { padding: .55rem .6rem; }
  .grid .name-col { min-width: 9rem; }
  .form-actions .btn, .cta-row .btn { flex: 1 1 auto; }
  .messages { padding-top: .5rem; }
  .lot-figures { gap: .5rem; }
  .lot-figures > div { padding: .55rem .65rem; }
  .lot-photo { width: 72px; height: 72px; border-radius: 18px; font-size: 1.3rem; }
  .site-foot-inner { grid-template-columns: 1fr; }
  .site-foot .foot-note { flex-direction: column; align-items: flex-start; }
  .stat .num { font-size: 1.5rem; }
  .auth-body { padding: 1.5rem; }
  .card-grid { gap: .85rem; }
  .bid-bar { gap: .5rem; }
}

@media (max-width: 400px) {
  /* The same action remains available inside the phone menu. */
  .site-actions > .header-create { display: none; }
  .hero .form-actions .btn { width: 100%; }
}

/* The overview's "Starts and emails" card and the console's auto-sell note. */
#notify h3 { margin-top: 1.75rem; }
#notify .form-actions { margin-top: 0.75rem; }
.briefing { white-space: pre-wrap; font: inherit; font-size: 0.9rem; line-height: 1.55; margin: 0.75rem 0 0; }
.auto-note { margin-top: 0.5rem; }

/* The auctioneer's "Bidders at their seats" panel. */
.presence-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.presence-list li { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; padding: 0.5rem 0.75rem;
  border-left: 4px solid var(--team, #8b93a7); border-radius: 0.5rem; background: rgba(255, 255, 255, 0.04); }
.presence-list li[data-here="true"] span { color: #34d399; }
.presence-list li[data-here="false"] span { color: #fbbf24; }


/* Room themes load later; retain a readable select without shrinking the large bid input. */
@media (max-width:820px){
  select{font-size:16px!important}
  .grid a[href]{display:inline-flex;align-items:center;min-width:32px;min-height:32px;
    max-width:100%;overflow-wrap:anywhere}
  .card h3 a[href]{display:inline-flex;align-items:center;min-height:44px;
    max-width:100%;overflow-wrap:anywhere}
}

/* Every navigation action stays reachable on a short landscape phone. */
.site-menu-panel,.account-panel{
 max-height:calc(100vh - 100px);
 max-height:calc(100dvh - 100px - env(safe-area-inset-bottom,0px));
 overflow-y:auto;overscroll-behavior:contain;
}

/* ------------------------------------------------------------- appearance
 * Owner, 29 Oct 2026: "add this text size option in all our other apps also (default normal - existing) and
 * some colour themes if they dont have" (MCP ERP's Appearance panel is the model). One choice per browser,
 * applied before the first paint by static/js/theme-start.js and saved by ui.js.
 *
 * EVERY RULE BELOW IS KEYED TO html[data-theme="light"]. The live room, console, captain and projector pages
 * set data-theme="dark" and keep their own palette and room theme (room-themes.css) untouched. "MCP Violet"
 * and "Normal" set no attribute at all, so the default look is exactly the CSS above.
 * Every theme keeps text and white-on-accent at 4.5:1 or better (tests/test_appearance.py). */
.site-actions { position: relative; }
.appearance-menu { position: static; }
.appearance-menu > summary {
  list-style: none; cursor: pointer; min-height: var(--tap);
  display: inline-flex; align-items: center; gap: .45rem; padding: 0 .75rem;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  color: var(--text); font-weight: 600; font-size: .95rem;
}
.appearance-menu > summary::-webkit-details-marker { display: none; }
.appearance-menu > summary:hover { background: var(--surface-2); }
.appearance-menu > summary .icon { width: 20px; height: 20px; }
.appearance-panel {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 60;
  width: 21rem; max-width: calc(100vw - 2 * var(--gutter));
  max-height: calc(100dvh - 100px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .85rem;
  display: grid; gap: .5rem; color: var(--text);
}
.appearance-heading { margin: 0; font-size: .85rem; font-weight: 700; color: var(--text-muted); }
.appearance-panel label { font-size: .85rem; font-weight: 700; color: var(--text-muted); margin-top: .35rem; }
.appearance-swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.appearance-swatches button {
  display: flex; align-items: center; gap: .5rem; min-height: var(--tap); padding: .35rem .6rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font: inherit; font-size: .9rem; font-weight: 600; text-align: left; cursor: pointer;
  min-width: 0; overflow-wrap: anywhere;
}
.appearance-swatches button:hover { background: var(--surface-2); }
.appearance-swatches button[aria-pressed="true"] { border: 2px solid var(--accent); padding: calc(.35rem - 1px) calc(.6rem - 1px); }
.appearance-swatch {
  flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgb(0 0 0 / 18%);
  background: linear-gradient(135deg, var(--sw-a) 0 50%, var(--sw-b) 50% 100%);
}
[data-theme-pick="violet"]   .appearance-swatch { --sw-a: #6C5CE7; --sw-b: #F5F3FE; }
[data-theme-pick="ocean"]    .appearance-swatch { --sw-a: #1D5FD1; --sw-b: #F1F6FE; }
[data-theme-pick="emerald"]  .appearance-swatch { --sw-a: #0E7A4F; --sw-b: #EFFAF4; }
[data-theme-pick="teal"]     .appearance-swatch { --sw-a: #0F766E; --sw-b: #EEFAF8; }
[data-theme-pick="sunset"]   .appearance-swatch { --sw-a: #C2305A; --sw-b: #FEF2F5; }
[data-theme-pick="saffron"]  .appearance-swatch { --sw-a: #A9500A; --sw-b: #FEF6EC; }
[data-theme-pick="plum"]     .appearance-swatch { --sw-a: #8E3A9E; --sw-b: #FAF2FB; }
[data-theme-pick="midnight"] .appearance-swatch { --sw-a: #8271F0; --sw-b: #0B1020; }
[data-theme-pick="contrast"] .appearance-swatch { --sw-a: #0030B8; --sw-b: #000000; }
.appearance-note { margin: 0; font-size: .85rem; color: var(--text-muted); }
/* Below 1200px the button is an icon, so the header row still fits where it fitted before. */
@media (max-width: 1199px) {
  .appearance-menu > summary { width: var(--tap); padding: 0; justify-content: center; }
  .appearance-label { display: none; }
}
@media (min-width: 901px) and (max-width: 1199px) {
  .site-head-inner { gap: .75rem; }
}
@media (max-width: 380px) {
  /* The extra button still leaves the 16px side gutter clear on a 360px phone. */
  .site-head-inner { gap: .5rem; }
  .site-actions { gap: .35rem; }
}

/* Colour themes: the accent family. Semantic tokens above read these, so buttons, links, chips, focus rings
   and tabs all follow. */
html[data-theme="light"][data-ui-theme="ocean"] {
  --violet-500: #2F6FE0; --violet-600: #1D5FD1; --violet-700: #174BA8; --violet-100: #E3EDFD; --violet-50: #F1F6FE;
  --shadow-accent: 0 10px 26px rgb(29 95 209 / 30%);
}
html[data-theme="light"][data-ui-theme="emerald"] {
  --violet-500: #13885A; --violet-600: #0E7A4F; --violet-700: #0A6340; --violet-100: #DDF4E9; --violet-50: #EFFAF4;
  --shadow-accent: 0 10px 26px rgb(14 122 79 / 28%);
}
html[data-theme="light"][data-ui-theme="teal"] {
  --violet-500: #118A80; --violet-600: #0F766E; --violet-700: #0B5E58; --violet-100: #D8F3F0; --violet-50: #EEFAF8;
  --shadow-accent: 0 10px 26px rgb(15 118 110 / 28%);
}
html[data-theme="light"][data-ui-theme="sunset"] {
  --violet-500: #D03A66; --violet-600: #C2305A; --violet-700: #A12549; --violet-100: #FCE4EB; --violet-50: #FEF2F5;
  --shadow-accent: 0 10px 26px rgb(194 48 90 / 28%);
}
html[data-theme="light"][data-ui-theme="saffron"] {
  --violet-500: #C25E10; --violet-600: #A9500A; --violet-700: #8A4108; --violet-100: #FDEBD8; --violet-50: #FEF6EC;
  --shadow-accent: 0 10px 26px rgb(169 80 10 / 28%);
}
html[data-theme="light"][data-ui-theme="plum"] {
  --violet-500: #9C47AC; --violet-600: #8E3A9E; --violet-700: #742E82; --violet-100: #F4E3F7; --violet-50: #FAF2FB;
  --shadow-accent: 0 10px 26px rgb(142 58 158 / 28%);
}
html[data-theme="light"][data-ui-theme="contrast"] {
  --violet-500: #0038D6; --violet-600: #0030B8; --violet-700: #00228A; --violet-100: #E6ECFF; --violet-50: #F3F6FF;
  --bg: #FFFFFF; --surface-2: #F0F0F0; --surface-3: #E0E0E0;
  --border: #5A5A5A; --border-strong: #000000;
  --text: #000000; --text-muted: #2B2B2B; --text-faint: #4A4A4A;
  --focus: #000000; --shadow-accent: none; --red-600: #B42318;
}
html[data-theme="light"][data-ui-theme="contrast"] a { text-decoration: underline; }
html[data-theme="light"][data-ui-theme="contrast"] .site-nav a,
html[data-theme="light"][data-ui-theme="contrast"] .site-menu-panel a,
html[data-theme="light"][data-ui-theme="contrast"] .account-panel a,
html[data-theme="light"][data-ui-theme="contrast"] a.btn { text-decoration: none; }
html[data-theme="light"][data-ui-theme="contrast"] :focus-visible { outline: 3px solid #000000; outline-offset: 2px; }
html[data-theme="light"][data-ui-theme="contrast"] .brand-name { color: #000000; }
html[data-theme="light"][data-ui-theme="contrast"] .site-head { background: #FFFFFF; border-bottom-color: #000000; }
html[data-theme="light"][data-ui-theme="contrast"] #mcp-policy-controls { color: #2B2B2B; }

/* Midnight: the dark surface the live room already uses, applied to the setup and report pages. */
html[data-theme="light"][data-ui-theme="midnight"] {
  color-scheme: dark;
  --bg: var(--navy-900); --surface: var(--navy-800); --surface-2: var(--navy-700); --surface-3: var(--navy-600);
  --border: #2A365E; --border-strong: #35447A;
  --text: #F2F4FB; --text-muted: #A6B0CC; --text-faint: #8590B0;
  --accent: #9A8BFF; --accent-strong: #B9AEFF; --accent-soft: rgb(130 113 240 / 18%);
  --live: var(--cyan-400); --live-soft: rgb(34 211 238 / 14%); --focus: var(--cyan-400);
  --grey-400: #4A5A96;
  --shadow: 0 10px 30px rgb(0 0 0 / 35%); --shadow-sm: 0 4px 14px rgb(0 0 0 / 30%);
  --shadow-xs: none; --shadow-lg: 0 20px 50px rgb(0 0 0 / 55%);
}
html[data-theme="light"][data-ui-theme="midnight"] .site-head { background: rgb(18 26 51 / 90%); }
html[data-theme="light"][data-ui-theme="midnight"] .brand-name,
html[data-theme="light"][data-ui-theme="midnight"] .card-cover .sport { color: var(--text); }
html[data-theme="light"][data-ui-theme="midnight"] .brand-sub { color: var(--cyan-400); }
html[data-theme="light"][data-ui-theme="midnight"] .card-cover,
html[data-theme="light"][data-ui-theme="midnight"] .card.is-live .card-cover {
  background: linear-gradient(135deg, rgb(130 113 240 / 18%), rgb(34 211 238 / 10%));
}
html[data-theme="light"][data-ui-theme="midnight"] .sticky-actions { background: rgb(18 26 51 / 92%); }
html[data-theme="light"][data-ui-theme="midnight"] select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A6B0CC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Text size. Desktop enlarges the whole page the way MCP ERP does (zoom); a phone gets larger text instead, so
   nothing is pushed off a 375px screen. Each panel's height cap is divided by the zoom so it still ends above
   the bottom of the window. */
@media screen and (min-width: 801px) {
  html[data-theme="light"][data-text-size="large"] body > .site-head,
  html[data-theme="light"][data-text-size="large"] body > .messages,
  html[data-theme="light"][data-text-size="large"] body > main,
  html[data-theme="light"][data-text-size="large"] body > .site-foot { zoom: 1.12; }
  html[data-theme="light"][data-text-size="xlarge"] body > .site-head,
  html[data-theme="light"][data-text-size="xlarge"] body > .messages,
  html[data-theme="light"][data-text-size="xlarge"] body > main,
  html[data-theme="light"][data-text-size="xlarge"] body > .site-foot { zoom: 1.25; }
  html[data-theme="light"][data-text-size="large"] :is(.site-menu-panel, .account-panel, .appearance-panel) {
    max-height: calc((100dvh - 100px) / 1.12);
  }
  html[data-theme="light"][data-text-size="xlarge"] :is(.site-menu-panel, .account-panel, .appearance-panel) {
    max-height: calc((100dvh - 100px) / 1.25);
  }
}
/* A zoomed header has less room: a long account name is cut short (the full name is in the menu), and the
   header switches to the phone menu and an icon button at a wider window than Normal does. */
@media screen and (min-width: 801px) {
  html[data-theme="light"][data-text-size] .account-name {
    max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  html[data-theme="light"][data-text-size="large"] :is(.site-menu-panel, .appearance-panel) {
    max-width: calc((100vw - 2 * var(--gutter)) / 1.12);
  }
  html[data-theme="light"][data-text-size="xlarge"] :is(.site-menu-panel, .appearance-panel) {
    max-width: calc((100vw - 2 * var(--gutter)) / 1.25);
  }
}
@media screen and (min-width: 801px) and (max-width: 1279px) {
  html[data-theme="light"][data-text-size="large"] .appearance-menu > summary { width: var(--tap); padding: 0; justify-content: center; }
  html[data-theme="light"][data-text-size="large"] .appearance-label { display: none; }
}
@media screen and (min-width: 801px) and (max-width: 1420px) {
  html[data-theme="light"][data-text-size="xlarge"] .appearance-menu > summary { width: var(--tap); padding: 0; justify-content: center; }
  html[data-theme="light"][data-text-size="xlarge"] .appearance-label { display: none; }
}
@media screen and (min-width: 801px) and (max-width: 1300px) {
  html[data-theme="light"][data-text-size="large"] .site-nav { display: none; }
  html[data-theme="light"][data-text-size="large"] .site-menu { display: block; }
}
@media screen and (min-width: 801px) and (max-width: 1360px) {
  html[data-theme="light"][data-text-size="xlarge"] .site-nav { display: none; }
  html[data-theme="light"][data-text-size="xlarge"] .site-menu { display: block; }
}
/* ...and to the phone header (the account links move into the menu) where Normal would at 768px. */
@media screen and (min-width: 801px) and (max-width: 910px) {
  html[data-theme="light"][data-text-size="large"] .site-actions > :is(.btn-quiet.desktop-only, .account-menu, .header-create) { display: none; }
}
@media screen and (min-width: 801px) and (max-width: 1010px) {
  html[data-theme="light"][data-text-size="xlarge"] .site-actions > :is(.btn-quiet.desktop-only, .account-menu, .header-create) { display: none; }
}
@media screen and (max-width: 800px) {
  html[data-theme="light"][data-text-size="large"] { font-size: 112.5%; }
  html[data-theme="light"][data-text-size="xlarge"] { font-size: 125%; }
  html[data-theme="light"][data-text-size] body { font-size: 1rem; }
  html[data-theme="light"][data-text-size] :is(input, select, textarea) { font-size: 1rem; }
  /* A long email address or link no longer fits a phone line once the text is bigger. */
  html[data-theme="light"][data-text-size] main :is(p, li, dd, h1, h2, h3) { overflow-wrap: break-word; }
}
@media screen and (max-width: 480px) {
  /* Bigger text leaves no room for Login beside the menu on a phone; it is the menu's own Login link. */
  html[data-theme="light"][data-text-size] .site-actions > .header-login { display: none; }
}
