/* Before the Barrier, 2026 look (stage 1 of the app redesign, 10 Nov 2026).
   The app wears the welcome page's design (public/welcome/, built with the taste skill): Familjen Grotesk for words,
   IBM Plex Mono for figures, white and ink with the seal's red, pill buttons, sharp-cornered cards with fine lines,
   and the black-and-amber next-to-jump board. Loaded after styles.css, so it restyles every screen; remove the one
   <link> to go back to the racebook look. Data screens stay dense: this is a form guide, not a landing page. */

:root {
  --paper: #ffffff;
  --paper-2: #f4f4f4;
  --ink: #111111;
  --ink-2: #3d3d3d;
  --muted: #686868;
  --rule: rgba(17, 17, 17, 0.14);
  --rule-soft: rgba(17, 17, 17, 0.08);
  --line: rgba(17, 17, 17, 0.1);
  --line-strong: rgba(17, 17, 17, 0.2);
  --red: #d3222a;
  --red-ink: #ffffff;
  --red-soft: #fdeeee;
  --green: #11743a;
  --tote: #0b0b0b;
  --tote-line: rgba(255, 176, 0, 0.16);
  --amber-label: #c9a24f;
  --r-sm: 4px; --r-md: 6px; --r-lg: 8px; --r-btn: 999px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px -12px rgba(0, 0, 0, 0.18);
  --display: 'Familjen Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Familjen Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --dots: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --wrap: 1240px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #0d0f12; --paper-2: #171a1f; --ink: #f2f1ed; --ink-2: #d2d0ca; --muted: #9a978f;
    --rule: rgba(242, 241, 237, 0.16); --rule-soft: rgba(242, 241, 237, 0.09); --line: rgba(242, 241, 237, 0.12); --line-strong: rgba(242, 241, 237, 0.24);
    --red: #ff4b50; --red-soft: #3a1517; --green: #3fd27b; --tile: #f2f1ed; --tile-ink: #0d0f12;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme='dark'] {
  --paper: #0d0f12; --paper-2: #171a1f; --ink: #f2f1ed; --ink-2: #d2d0ca; --muted: #9a978f;
  --rule: rgba(242, 241, 237, 0.16); --rule-soft: rgba(242, 241, 237, 0.09); --line: rgba(242, 241, 237, 0.12); --line-strong: rgba(242, 241, 237, 0.24);
  --red: #ff4b50; --red-soft: #3a1517; --green: #3fd27b; --tile: #f2f1ed; --tile-ink: #0d0f12;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
}

/* ---------- type ---------- */
html { font-size: 16px; }
html[data-text='large'] { font-size: 19px; }
body { font: 400 1rem/1.5 var(--body); letter-spacing: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; text-transform: none; letter-spacing: -0.02em; line-height: 1.12; }
h1 { font-size: clamp(2rem, 2.4vw + 1.2rem, 3rem); letter-spacing: -0.03em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 2px; }
.container { max-width: var(--wrap); padding: 0 32px; }
.lede { font-size: 1.05rem; color: var(--ink-2); line-height: 1.55; }
.loading { font: 500 0.85rem var(--mono); text-transform: none; letter-spacing: 0; }

/* Everything the racebook set in condensed capitals now reads in sentence case. */
.btn, .nav a, .nav-more, .logo-words, .tile, .silk, .rno, .race-no, .race-no small, .race-track, .runner-name, .rank-tag,
.kpi .value, .tabs button, .factor-name, .case h3, .case-grid dd, .tk-horse, .stamp, .mini-stamp, .hsum-name, .hsum-stat b,
.hcard-rate .v, .runs-title, .more-head strong, .more-links a, .htile-tx b, .sr-item b, .rnav-btn, .banner strong,
.select select, .field span, .checks legend, .tote-title, .mt-head h2, .footer b, .install-card strong, .about-horse h4,
.rules h3, .prose h2, .card-head h2, .card-head h3, .card.empty h2, .section-title h2, .sec h2, .install-help h2 {
  font-family: var(--display); text-transform: none; letter-spacing: -0.01em;
}
/* Small labels stay small capitals, in the figures face. */
th, .aside, .dateline, .rmeta, .pill, .tote-cols, .legend, .table-foot, .kpi .label, .case-grid dt, .factor-score, .factor .conf,
.draw-note, .guide-note, .reasons, .bb-tally, .bb-save-label, .tool, .menu-btn, .back, .more-row > span:first-child, .legend-row {
  font-family: var(--mono); letter-spacing: 0.04em;
}

/* ---------- controls: pill buttons, as on the welcome page ---------- */
.btn {
  min-height: 44px; padding: 0 20px; gap: 8px; border: 1px solid var(--line-strong); border-radius: var(--r-btn);
  background: var(--paper); color: var(--ink); font: 500 0.95rem/1 var(--display); white-space: nowrap;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.12s var(--ease);
}
.btn:hover { background: var(--paper-2); color: var(--ink); border-color: rgba(17, 17, 17, 0.32); }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn.primary { background: var(--red); border-color: var(--red); color: var(--red-ink); }
.btn.primary:hover { background: #b51d24; border-color: #b51d24; color: #fff; }
.btn.primary::after { content: ''; width: 12px; height: 12px; margin-right: -2px; background: currentColor; transition: transform 0.18s var(--ease);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4.5 2.5 8 6l-3.5 3.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4.5 2.5 8 6l-3.5 3.5' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (hover: hover) { .btn.primary:hover::after { transform: translateX(3px); } }
.btn.ghost { border-color: transparent; }
.tool {
  border: 1px solid var(--line-strong); border-radius: var(--r-btn); padding: 0 14px; min-height: 40px;
  font: 500 0.8rem var(--mono); text-transform: none; letter-spacing: 0.01em; transition: background-color 0.18s var(--ease);
}
.tool:hover { background: var(--paper-2); }
.tool[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tool.install { background: var(--red); border-color: var(--red); }
select.tool { padding-right: 30px; }
.select select { font: 500 0.95rem var(--display); border: 1px solid var(--line-strong); border-radius: var(--r-btn); padding: 0 44px 0 16px; min-height: 44px; }
.select::after { border-width: 5px; border-top-color: var(--muted); right: 16px; margin-top: -2px; }
input[type='date'], .field input, .bb-note textarea, .race-search input {
  border: 1px solid var(--line-strong); border-radius: var(--r-md); font: 500 0.95rem var(--display); background: var(--paper); color: var(--ink);
}
input[type='date'] { border-radius: var(--r-btn); padding: 0 14px; font-family: var(--mono); font-size: 0.85rem; }
.field input:focus, .bb-note textarea:focus, .race-search input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(211, 34, 42, 0.14); }
.field span, .checks legend { font: 500 0.9rem/1.2 var(--display); }

/* ---------- tags ---------- */
.pill { border: 1px solid currentColor; border-radius: var(--r-btn); padding: 4px 9px 3px; font: 500 0.66rem/1 var(--mono); letter-spacing: 0.04em; }
.pill.tier-A { background: var(--red); border-color: var(--red); color: #fff; }
.pill.brand { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- surfaces: fine lines and sharp-cornered cards ---------- */
.page-head { border-bottom: 0; margin: 36px 0 22px; padding-bottom: 0; align-items: flex-end; }
.page-head h1 { line-height: 1.05; }
.dateline { font: 500 0.78rem var(--mono); text-transform: none; letter-spacing: 0.02em; color: var(--muted); margin-top: 10px; }
.section-title, .sec { border-top: 1px solid var(--line); margin: 40px 0 16px; padding-top: 16px; align-items: center; }
.section-title h2, .sec h2 { font-size: 1.5rem; }
.aside { font: 500 0.75rem var(--mono); text-transform: none; letter-spacing: 0.01em; color: var(--muted); }
.card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); padding: 18px 20px; margin: 0 0 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { padding: 0 0 12px; }
.card-head h2 { font-size: 1.35rem; }
.card-head h3 { font-size: 1.15rem; }
.card.empty { padding: 22px 20px; }
.card.empty h2 { font-size: 1.35rem; }
.banner { border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: var(--r-md); background: var(--paper); }
.banner strong { font: 500 1.05rem/1.25 var(--display); }
.banner.info { border-left-color: var(--muted); }
.notice { border-radius: var(--r-md); }

/* ---------- saddlecloth numbers ---------- */
.tile, .silk { font: 500 0.95rem/1 var(--mono); border-radius: var(--r-sm); min-width: 1.9em; height: 1.9em; }
.tile.lg, .silk.lg { font-size: 1.4rem; }

/* ---------- tables ---------- */
table { font-size: 0.9rem; }
th { font: 500 0.68rem var(--mono); letter-spacing: 0.05em; border-bottom: 1px solid var(--line-strong); color: var(--muted); }
td { border-bottom: 1px solid var(--rule-soft); }
td.num { font-weight: 500; }

/* ---------- the next-to-jump board: black and amber, as on the welcome page ---------- */
.tote { background: var(--tote); color: #ffb000; border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; margin: 0; }
.tote::before { display: none; }
.tote-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--tote-line); }
.tote-title { font: 500 1.05rem/1.2 var(--display); color: #fff; letter-spacing: -0.01em; }
.tote-clock { font: 500 1rem var(--mono); color: #fff; text-shadow: none; letter-spacing: 0.02em; }
.tote-cols { color: var(--amber-label); font: 500 0.66rem var(--mono); letter-spacing: 0.06em; padding: 10px 20px 4px; }
.tote-cols, .tote-row { grid-template-columns: 4.6em minmax(0, 1.9fr) 4em minmax(0, 1.1fr) 5.4em; gap: 12px; padding-left: 20px; padding-right: 20px; }
.tote-cols > span { white-space: nowrap; }
.tote-cols { font-size: 0.66rem; }
.tote-row { font: 500 0.88rem var(--mono); text-shadow: none; border-top: 1px solid var(--tote-line); color: #ffb000; text-transform: none; padding-top: 11px; padding-bottom: 11px; }
.tote-row:hover { background: #161616; color: #ffc233; }
.tote-row .n { border-radius: 3px; }
.tote-row.soon .t-in { color: #ff6a4a; animation: none; }
.tote-empty { font: 500 0.95rem var(--mono); text-shadow: none; color: #ffb000; padding: 18px 20px; }
.tote-chip { font: 500 0.82rem var(--mono); text-shadow: none; border-radius: var(--r-btn); padding: 4px 10px; }
.tote-all { background: transparent; border-top: 1px solid var(--tote-line); color: #fff; font: 500 0.85rem var(--display); text-transform: none; letter-spacing: 0; padding: 13px 20px; }
.tote-all:hover { background: #161616; color: #fff; }
.tote td { font: 500 0.9rem var(--mono); text-shadow: none; }

/* ---------- tickets keep their paper, with the new faces ---------- */
.ticket { font-family: var(--mono); }
.tk-horse { font: 500 1.3rem/1.1 var(--display); letter-spacing: -0.01em; }
.stamp, .mini-stamp { font: 600 1.05rem/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- header: the welcome page's bar (seal and name, tabs in the middle, account and menu) ---------- */
.mast { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); background: color-mix(in oklab, var(--paper) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.mast-in { max-width: var(--wrap); padding: 0 32px; }
.mast-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 20px; min-height: 68px; padding: 0; }
.logo { gap: 10px; }
.logo > .seal { width: 36px; height: 36px; }
.logo-words { font: 600 1.05rem/1 var(--display); letter-spacing: -0.015em; white-space: nowrap; }
.mast .nav { justify-self: center; display: flex; gap: 4px; padding: 0; }
.mast .nav a, .mast .nav-more { font: 500 0.95rem/1 var(--display); color: var(--ink-2); padding: 10px 14px; border: 0; border-radius: var(--r-btn); transition: background-color 0.18s var(--ease), color 0.18s var(--ease); }
.mast .nav a:hover { background: var(--paper-2); color: var(--ink); }
.mast .nav a.active { color: var(--ink); background: var(--paper-2); box-shadow: inset 0 -2px 0 var(--red); border-radius: var(--r-btn) var(--r-btn) var(--r-sm) var(--r-sm); }
.mast-actions { justify-self: end; }
.menu-btn { border: 1px solid var(--line-strong); border-radius: var(--r-btn); padding: 0 14px; min-height: 40px; font: 500 0.88rem var(--display); text-transform: none; letter-spacing: 0; }
.menu-btn:hover { background: var(--paper-2); }
#acctBtn { background: var(--ink); border-color: var(--ink); color: var(--paper); }
#acctBtn:hover { background: #2a2a2a; color: #fff; }
.edition { display: none; }

/* ---------- the More sheet ---------- */
.more-sheet { border-left: 1px solid var(--line); box-shadow: -20px 0 40px -20px rgba(0, 0, 0, 0.3); padding-top: 20px; }
.more-head strong { font: 500 1.35rem var(--display); }
.more-links { border-top: 1px solid var(--line); }
.more-links a { font: 500 1.05rem var(--display); border-bottom: 1px solid var(--line); padding: 14px 2px; }
.more-row > span:first-child { font: 500 0.75rem var(--mono); text-transform: none; }

/* ---------- footer: the welcome page's columns ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 44px 32px 40px; max-width: var(--wrap); font-size: 0.88rem; color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 28px 32px; }
.foot-grid:has(> .host-link:not([hidden])) { grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); }
.foot-col[hidden] { display: none; }
.foot-brand .logo { margin-bottom: 10px; }
.foot-brand p { max-width: 34ch; color: var(--ink-2); }
.foot-col h3 { font: 500 0.78rem var(--mono); letter-spacing: 0.04em; color: var(--muted); margin: 6px 0 12px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.foot-col a { text-decoration: none; color: var(--ink); }
.foot-col a:hover { color: var(--red); }
.foot-legal { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.8rem; }
.foot-legal p { margin: 0; max-width: none; }

/* ---------- home ---------- */
.hhero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: stretch; margin: 40px 0 28px; }
.hhero-text { display: flex; flex-direction: column; justify-content: center; padding: 8px 0; }
.eyebrow { font: 500 0.8rem var(--mono); color: var(--muted); margin: 0 0 14px; letter-spacing: 0.02em; }
.eyebrow .live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 0 0 rgba(211, 34, 42, 0.5); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(211, 34, 42, 0.45); } 70%, 100% { box-shadow: 0 0 0 8px rgba(211, 34, 42, 0); } }
.hhero h1 { font-size: clamp(2.4rem, 3vw + 1.2rem, 3.6rem); margin: 0 0 16px; }
.hhero .lede { margin: 0 0 24px; max-width: 42ch; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.hstats { display: flex; gap: 28px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.hstat b { display: block; font: 500 1.6rem/1 var(--display); letter-spacing: -0.02em; }
.hstat span { font: 500 0.72rem var(--mono); color: var(--muted); }
.hhero-board { display: flex; flex-direction: column; min-width: 0; }
.hhero-board .tote { flex: 1; display: flex; flex-direction: column; }
.hhero-board .tote .tote-all { margin-top: auto; }

.home-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 28px; }
.hcard2 { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); text-decoration: none; color: var(--ink); min-width: 0;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease); }
.hcard2:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.hcard2-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hcard2-ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--red-soft); color: var(--red); }
.hcard2-ic svg { width: 20px; height: 20px; }
.hcard2-go { color: var(--muted); font-size: 1.2rem; transition: transform 0.2s var(--ease); }
.hcard2:hover .hcard2-go { transform: translateX(3px); color: var(--red); }
.hcard2 h2 { font-size: 1.15rem; margin: 10px 0 0; }
.hcard2 .sub { font-size: 0.88rem; color: var(--muted); margin: 0; }
.hlist { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--line); }
.hlist li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--rule-soft); font-size: 0.86rem; min-width: 0; }
.hlist li:last-child { border-bottom: 0; }
.hlist .tile { font-size: 0.75rem; }
.hlist .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.hlist .mt { flex: 0 1 auto; max-width: 58%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 500 0.75rem var(--mono); color: var(--muted); }
.hlist .nm { flex: 1 1 40%; }
.hlist .none { color: var(--muted); }
.home-welcome { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--r-lg); background: var(--paper-2); margin: 0 0 24px; }
.home-welcome p { margin: 0; color: var(--ink-2); }

/* ---------- races: the card ---------- */
.datebar { gap: 8px; }
.datebar .btn { min-height: 40px; padding: 0 16px; }
.race-search { margin: 0 0 24px; }
.race-search input { border-radius: var(--r-btn); padding: 14px 18px 14px 48px; font-size: 1rem; }
.race-search .rs-ic { left: 18px; top: 50%; }
.search-results { border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.sr-item b { font: 500 1rem/1.2 var(--display); }
.races-board { margin: 0 0 8px; }
.meetings { gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); }
.meeting { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--paper); }
.mt-head { background: var(--paper-2); color: var(--ink); padding: 14px 18px; align-items: center; border-bottom: 1px solid var(--line); }
.mt-head h2 { font-size: 1.15rem; }
.mt-head span { font: 500 0.75rem var(--mono); text-transform: none; letter-spacing: 0.01em; color: var(--muted); }
.race-row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--rule-soft); transition: background-color 0.15s var(--ease); }
.race-row:last-child { border-bottom: 0; }
.race-row:hover { background: var(--paper-2); }
.rno { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-md); border: 1px solid var(--line-strong); font: 500 0.95rem/1 var(--mono); }
.rmeta { font: 500 0.75rem var(--mono); text-transform: none; letter-spacing: 0.01em; }
.rname { font-weight: 500; font-size: 0.95rem; margin-top: 3px; }
.rstate { font: 500 0.75rem var(--mono); text-transform: none; }

/* ---------- race page (stage 3b): hero + board, the meeting strip, the glance table, the speed map ---------- */
.rhero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 32px; align-items: stretch; margin: 28px 0 20px; }
.rhero-text { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.rhero .back { display: inline-block; align-self: flex-start; margin: 0 0 14px; font: 500 0.78rem var(--mono); color: var(--muted); text-decoration: none; }
.rhero .back:hover { color: var(--red); }
.rhero h1 { font-size: clamp(2.2rem, 2.6vw + 1.2rem, 3.4rem); margin: 0; line-height: 1.02; }
.rh-no { color: var(--red); white-space: nowrap; }
.rh-name { margin: 10px 0 0; font-size: 1.05rem; color: var(--ink-2); }
.rfacts { list-style: none; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 14px 30px; }
.rfacts li { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rfacts span { font: 500 0.7rem var(--mono); color: var(--muted); letter-spacing: 0.04em; }
.rfacts b { font: 500 1.15rem/1.1 var(--display); letter-spacing: -0.01em; white-space: nowrap; }
.rfacts small { font: 500 0.7rem var(--mono); color: var(--muted); }
.rhero-board { background: var(--tote); color: #ffb000; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px 22px 20px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.rb-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 500 1.05rem/1.2 var(--display); color: #fff; }
.rhero-board .pill { color: #ffb000; background: transparent; border-color: currentColor; }
.rb-clock { font: 500 clamp(2.6rem, 2.6vw + 1.4rem, 3.8rem)/1 var(--mono); color: #ffb000; margin: 16px 0 12px; font-variant-numeric: tabular-nums; }
.rb-sub { margin: 0; font: 500 0.78rem/1.45 var(--mono); color: var(--amber-label); }
.rb-podium { list-style: none; margin: 12px 0 0; padding: 0; }
.rb-podium li { display: grid; grid-template-columns: 2.6em auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--tote-line); font: 500 0.92rem var(--mono); }
.rb-pos { color: var(--amber-label); }
.rb-nm { color: #fff; font: 500 1rem var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-sp { color: #ffb000; }
.rb-podium .tile { background: #ffb000; color: #0b0b0b; }

.rstrip { display: flex; align-items: stretch; gap: 8px; margin: 0 0 22px; }
.rs-step { flex: none; display: grid; place-items: center; width: 44px; border: 1px solid var(--line-strong); border-radius: var(--r-btn); text-decoration: none; color: var(--ink); font: 500 1.3rem/1 var(--display); transition: background-color 0.18s var(--ease); }
.rs-step:hover { background: var(--paper-2); color: var(--ink); }
.rs-step.off { opacity: 0.3; }
.rs-list { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.rs-list::-webkit-scrollbar { display: none; }
.rs-race { flex: 1 0 auto; min-width: 74px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--ink);
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease); }
.rs-race b { font: 600 0.95rem/1 var(--display); }
.rs-race span { font: 500 0.68rem var(--mono); color: var(--muted); }
.rs-race:hover { border-color: var(--line-strong); background: var(--paper-2); color: var(--ink); }
.rs-race.done span { color: var(--green); }
.rs-race.on, .rs-race.on:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.rs-race.on span { color: inherit; opacity: 0.72; }

.banner { padding: 12px 16px; margin: 0 0 10px; font-size: 0.92rem; }
.banner strong { display: block; font-size: 0.98rem; margin-bottom: 2px; }
.bb-mine { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border: 1px solid var(--red); background: var(--red-soft); border-radius: var(--r-md); margin: 0 0 10px; font-size: 0.92rem; }
.bb-mine > svg { width: 20px; height: 20px; color: var(--red); flex: none; }
.bb-dot { display: inline-grid; place-items: center; vertical-align: -2px; margin-left: 6px; color: var(--red); }
.bb-dot svg { width: 15px; height: 15px; }

.host-only { position: relative; margin-top: 18px; }
.host-tag { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px; padding: 3px 9px; border-radius: var(--r-btn); background: var(--ink); color: var(--paper); font: 500 0.66rem/1.2 var(--mono); letter-spacing: 0.04em; }
.host-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.host-only > .section-title, .host-only > section > .section-title, .host-only > .bb-save { margin-top: 0; }
.ph-only { display: none; }
@media (max-width: 760px) { .ph-only { display: block; } }
.g-sortsel { display: none; align-items: center; gap: 10px; margin: 0 0 12px; font: 500 0.78rem var(--mono); color: var(--muted); }
.g-sortsel .select { flex: 1; }
.g-sortsel select { width: 100%; }
.glance { border: 1px solid var(--line); border-radius: var(--r-lg); }
.glance table { min-width: 980px; }
.glance th { padding: 0; white-space: nowrap; background: var(--paper-2); }
.glance th button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 11px 8px 10px; cursor: pointer; }
.glance th.num button { text-align: right; }
.glance th button:hover, .glance th[aria-sort] { color: var(--ink); }
.glance th button:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.glance th[aria-sort='ascending'] button::after { content: ' ↑'; color: var(--red); }
.glance th[aria-sort='descending'] button::after { content: ' ↓'; color: var(--red); }
.glance td { padding: 10px 8px; vertical-align: middle; font-size: 0.88rem; background: var(--paper); transition: background-color 0.15s var(--ease); }
.glance tbody tr { cursor: pointer; }
.glance tbody tr:hover td { background: var(--paper-2); }
.glance tbody tr:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.glance tr.top-pick td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.glance tr.mine td { background: color-mix(in oklab, var(--red-soft) 70%, var(--paper)); }
.glance td small { font: 500 0.72rem var(--mono); color: var(--muted); }
.glance .mono { font: 500 0.82rem var(--mono); }
.g-runner { white-space: nowrap; }
.g-runner .tile { margin-right: 10px; vertical-align: middle; }
.g-id { display: inline-flex; flex-direction: column; gap: 2px; vertical-align: middle; max-width: 23ch; }
.g-id b { font: 500 0.98rem/1.2 var(--display); }
.g-id small { overflow: hidden; text-overflow: ellipsis; }
.g-id .pill { vertical-align: 1px; }
.g-chance { min-width: 92px; }
.g-chance b { display: block; font: 500 0.9rem var(--mono); }
.g-bar { display: block; height: 4px; margin-top: 5px; background: var(--rule-soft); border-radius: 2px; overflow: hidden; }
.g-bar i { display: block; height: 100%; background: var(--red); border-radius: 2px; }

.smap { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.sm-lane { display: grid; grid-template-columns: 150px minmax(0, 1fr); border-top: 1px solid var(--rule-soft); }
.sm-lane:first-child { border-top: 0; }
.sm-l { display: flex; align-items: center; padding: 12px 16px; font: 500 0.75rem var(--mono); color: var(--muted); background: var(--paper-2); }
.sm-run { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
.sm-h { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border: 1px solid var(--line); border-radius: var(--r-btn); text-decoration: none; color: var(--ink);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease); }
.sm-h:hover { border-color: var(--line-strong); color: var(--ink); transform: translateY(-1px); }
.sm-h.pick { border-color: var(--red); }
.sm-h .tile { font-size: 0.8rem; }
.sm-nm { font: 500 0.92rem/1.1 var(--display); }
.sm-h small { font: 500 0.7rem var(--mono); color: var(--muted); }
.sm-empty { align-self: center; padding: 6px 2px; font: 500 0.78rem var(--mono); color: var(--muted); }

/* ---------- pub tools (11 Nov 2026): quick take, shortlist, quaddie helper, tap-to-explain, sharing ---------- */
.term { all: unset; cursor: help; font: inherit; color: inherit; letter-spacing: inherit; border-bottom: 1px dotted currentColor; }
.term:hover { color: var(--red); }
.term:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 2px; }
.term-pop { position: fixed; z-index: 90; width: min(340px, calc(100vw - 16px)); max-height: min(70vh, 460px); overflow-y: auto; padding: 14px 16px 12px; border-radius: var(--r-lg); background: var(--ink); color: var(--paper); box-shadow: var(--shadow); font: 400 0.9rem/1.45 var(--body); }
.term-pop p { margin: 0 0 10px; }
.term-pop b { display: block; margin-bottom: 2px; font: 500 0.72rem var(--mono); letter-spacing: 0.04em; opacity: 0.75; }
.term-close { all: unset; cursor: pointer; display: inline-block; padding: 6px 12px; border: 1px solid currentColor; border-radius: var(--r-btn); font: 500 0.78rem var(--display); opacity: 0.85; }
.term-close:hover { opacity: 1; }
.toast { position: fixed; left: 50%; top: 84px; z-index: 95; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: var(--r-btn); background: var(--ink); color: var(--paper); font: 500 0.9rem var(--display);
  box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, -8px); pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.btn svg, .sl-btn svg { width: 16px; height: 16px; flex: none; }

.sl-btn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 20px; border: 1px solid var(--line-strong); border-radius: var(--r-btn);
  background: var(--paper); color: var(--ink); font: 500 0.95rem/1 var(--display); white-space: nowrap; transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.12s var(--ease); }
.sl-btn:hover { background: var(--paper-2); }
.sl-btn:active { transform: scale(0.97); }
.sl-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sl-btn[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.sl-btn.compact { width: 40px; min-height: 40px; padding: 0; font: 500 1.15rem/1 var(--mono); }
.hcard-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.hcard-actions > * { margin: 0; }
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 5px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font: 600 0.66rem/1 var(--mono); vertical-align: 1px; }
.nav-count[hidden] { display: none; }

.qt { margin: 0 0 22px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--paper); overflow: hidden; }
.qt-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 16px 18px 12px; }
.qt-head h2 { font-size: 1.3rem; margin: 0; }
.qt-head h2 a { color: inherit; text-decoration: none; }
.qt-head h2 a:hover { color: var(--red); }
.qt-head .aside { flex: 1; min-width: 0; }
.qt-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.qt-row { display: grid; grid-template-columns: 2.4em auto minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--rule-soft); transition: background-color 0.15s var(--ease); }
.qt-row[data-open-runner] { cursor: pointer; }
.qt-row[data-open-runner]:hover { background: var(--paper-2); }
.qt-row.first { box-shadow: inset 3px 0 0 var(--red); }
.qt-rank { font: 500 0.8rem var(--mono); color: var(--red); }
.qt-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.qt-id b { font: 500 1.1rem/1.2 var(--display); }
.qt-id small { font-size: 0.86rem; line-height: 1.35; color: var(--ink-2); }
.qt-link { min-width: 0; color: inherit; text-decoration: none; }
.qt-link:hover b { color: var(--red); }
.qt-num { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 4.4em; }
.qt-num b { font: 500 1.05rem/1 var(--mono); }
.qt-num small { font: 500 0.66rem var(--mono); color: var(--muted); white-space: nowrap; }
.qt-pace { margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--rule-soft); font-size: 0.92rem; color: var(--ink-2); }
.qt-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 18px; background: var(--paper-2); }
.qt-foot .btn { min-height: 40px; padding: 0 16px; background: var(--paper); }

.mainm-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: start; margin: 0 0 8px; }
.mainm-grid.single { grid-template-columns: 1fr; }
.mainm-grid.single .mainm-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.mainm-take .qt { margin: 0; }
.mainm-list { display: grid; gap: 12px; }
.mm-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); }
.mm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.mm-head h3 { margin: 0; font-size: 1.15rem; }
.mm-head .aside { margin-left: auto; }
.mm-next { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 0.92rem; }
.mm-next:hover { color: var(--red); }
.mm-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 0.95rem; }
.mm-pick small { font: 500 0.74rem var(--mono); color: var(--muted); }
.mm-links { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 10px; border-top: 1px solid var(--line); font: 500 0.88rem var(--display); }
.mm-links a { color: var(--ink); }
.mm-links a:hover { color: var(--red); }
.meeting.city { border-color: var(--line-strong); }
.mt-head h2 .pill { vertical-align: 3px; margin-left: 6px; }
.mt-head span a { color: var(--ink); }
.g-price small { display: block; }

.sl-list { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.sl-row { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--rule-soft); }
.sl-row:first-child { border-top: 0; }
.sl-row.won { box-shadow: inset 3px 0 0 var(--green); }
.sl-row.void { opacity: 0.6; }
.sl-race, .sl-horse { color: var(--ink); text-decoration: none; min-width: 0; }
.sl-race { display: flex; flex-direction: column; gap: 2px; }
.sl-race b { font: 500 0.95rem var(--mono); }
.sl-race span { font: 500 0.74rem var(--mono); color: var(--muted); }
.sl-horse { display: flex; align-items: center; gap: 10px; }
.sl-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sl-id b { font: 500 1.05rem/1.2 var(--display); }
.sl-id small { font: 500 0.74rem var(--mono); color: var(--muted); }
.sl-horse:hover b { color: var(--red); }
.sl-x { min-height: 36px; }
.sl-actions { margin: 0 0 8px; }

.qd-ticket { position: sticky; top: 76px; z-index: 5; margin: 0 0 18px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--tote); color: #fff; box-shadow: var(--shadow); }
.qd-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; }
.qd-sum > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.qd-sum span { font: 500 0.68rem var(--mono); letter-spacing: 0.04em; color: var(--amber-label); }
.qd-sum b { font: 500 1.5rem/1 var(--mono); color: #ffb000; }
.qd-sum small { font: 500 0.7rem var(--mono); color: rgba(255, 255, 255, 0.7); }
.qd-spend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--tote-line); }
.qd-spend .tool { color: #fff; border-color: rgba(255, 255, 255, 0.3); background: transparent; }
.qd-spend .tool:hover { background: #1c1c1c; }
.qd-spend .tool[aria-pressed='true'] { background: #ffb000; border-color: #ffb000; color: #0b0b0b; }
.qd-spend .btn { margin-left: auto; min-height: 40px; }
.qd-ticket .neg { color: #ff6a4a; margin: 10px 0 0; }
.qd-legs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 14px; }
.qd-leg { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); min-width: 0; }
.qd-leg.done { background: var(--paper-2); }
.qd-leg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 12px; }
.qd-leg-head h3 { margin: 0; font-size: 1.1rem; }
.qd-leg-head h3 a { color: var(--red); text-decoration: none; }
.qd-runners { display: grid; gap: 6px; }
.qd-runner { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 44px; padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: var(--r-md);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease); }
.qd-runner:hover { border-color: var(--line-strong); }
.qd-runner:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.qd-runner[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.qd-runner[aria-pressed='true'] .tile { background: var(--red); color: #fff; }
.qd-runner.won { box-shadow: inset 3px 0 0 var(--green); }
.qd-nm { font: 500 0.98rem var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qd-ch { font: 500 0.74rem var(--mono); opacity: 0.75; white-space: nowrap; }
.page-head ~ .qd-ticket, a.back { scroll-margin-top: 84px; }
a.back { display: inline-block; margin: 24px 0 0; font: 500 0.78rem var(--mono); color: var(--muted); text-decoration: none; }
a.back:hover { color: var(--red); }
a.back + .page-head { margin-top: 12px; }
.bb-alerts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper-2); font-size: 0.92rem; }
.bb-alerts:empty { display: none; }
.bb-alerts p { margin: 0; flex: 1 1 280px; }
.bb-alerts .btn { min-height: 40px; }

/* ---------- best bets (stage 3c): the race page's hero and board, tickets in an even grid ---------- */
.bbhero h1 { font-size: clamp(2.4rem, 3vw + 1.2rem, 3.6rem); }
.bbhero .rh-name { max-width: 52ch; }
.bb-daybar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.bb-daybar .btn { min-height: 40px; padding: 0 16px; }
.bb-daybar .btn.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.bb-daybar .mini-stamp { margin-left: 6px; }
.rb-next { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; margin: 0 0 8px; border-top: 1px solid var(--tote-line); border-bottom: 1px solid var(--tote-line); text-decoration: none; }
.rb-next .tile { background: #ffb000; color: #0b0b0b; }
.rb-next:hover .rb-nm { text-decoration: underline; }
.rb-units { font-size: clamp(2.4rem, 2.4vw + 1.2rem, 3.4rem); }
.rb-units.pos { color: #3fd27b; }
.rb-units.neg { color: #ff6a4a; }
.rb-big { font-size: 0.9rem; margin-top: 12px; }
.bb-save { gap: 8px; margin: 0 0 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper-2); }
.bb-save-label { font: 500 0.78rem var(--mono); text-transform: none; letter-spacing: 0.02em; color: var(--muted); }
.bb-save .btn { min-height: 40px; padding: 0 16px; }
.tickets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 20px; padding: 6px 0 18px; }
.tickets-grid > .ticket-wrap { display: flex; transition: transform 0.2s var(--ease); }
.tickets-grid > .ticket-wrap > .ticket { width: 100%; }
@media (hover: hover) { .tickets-grid > a.ticket-wrap:hover { transform: translateY(-2px); } }
.howto { margin: 8px 0 0; border: 1px solid var(--line); border-radius: var(--r-lg); }
.howto > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; font: 500 1rem var(--display); }
.howto > summary::-webkit-details-marker { display: none; }
.howto > summary .chev { color: var(--muted); transition: transform 0.15s var(--ease); }
.howto[open] > summary .chev { transform: rotate(90deg); }
.howto-body { padding: 0 18px 8px; color: var(--ink-2); font-size: 0.95rem; }
.howto-body p { margin: 0 0 12px; max-width: 75ch; }
.bb-chart { padding: 18px 20px 12px; }
.bb-chart .chart { display: block; margin-top: 4px; }
.chart { font: 500 11px var(--mono); }
.bb-changes li { grid-template-columns: 8.5em 1fr; }
tr.is-current td { background: var(--red-soft); }
tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--red); }

.hcard { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; scroll-margin-top: 84px; transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.hcards { display: grid; gap: 8px; }
.hcard:hover { border-color: var(--line-strong); }
.hcard[open] { box-shadow: var(--shadow); }
.hsum { padding: 12px 16px; gap: 12px; transition: background-color 0.15s var(--ease); }
.hsum-meta { font: 500 0.74rem var(--mono); }
.hsum-form { font: 500 0.85rem var(--mono); }
.hbody { padding: 6px 16px 18px; }
.hcard-rate { gap: 0; margin: 14px 0 4px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.hcard-rate .rk { padding: 12px 14px; border-right: 1px solid var(--line); }
.hcard-rate .rk:nth-child(3) { border-right: 0; }
.hcard-rate .k { font: 500 0.68rem var(--mono); letter-spacing: 0.04em; text-transform: none; }
.hcard-rate .s { font: 500 0.72rem var(--mono); }
.hcard-rate .rate-bar { grid-column: 1 / -1; margin: 0; border-radius: 0; }
.hcard-about { margin: 14px 0; padding: 14px 16px; background: var(--paper-2); border-radius: var(--r-md); }
.hcard-about p { font-size: 0.92rem; line-height: 1.5; }
.hcard-about p:last-child { margin-bottom: 0; }
.runs th { background: var(--paper-2); }
.hcard-records .recs { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.hcard-records .rec { align-items: center; border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; }
.hcard-records .rl { font: 500 0.68rem var(--mono); letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
.hcard-why > summary { font: 500 0.88rem var(--display); }
.hcard-top { border-color: var(--red); }
.hsum-name { font: 500 1.1rem/1.2 var(--display); }
.hsum-stat b { font: 500 1.1rem/1 var(--mono); }
.hcard-rate .v { font: 500 1.35rem/1 var(--display); }
.runs-title { font: 500 1rem/1.2 var(--display); }
.rsub { font-family: var(--body); }
.rank-tag { font: 500 0.8rem var(--mono); letter-spacing: 0.02em; }
.stalls { gap: 6px; padding: 0 0 4px; scrollbar-width: thin; }
.table-foot { text-transform: none; font: 500 0.72rem/1.5 var(--mono); letter-spacing: 0.01em; }
.stall { flex: 1 0 74px; max-width: 120px; padding: 20px 6px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); }
.stall::before { display: none; }
.stall:last-child { border-right: 1px solid var(--line); }
.stall .bno { font: 500 0.7rem var(--mono); letter-spacing: 0.04em; }
.stall .bno::before { content: 'Gate '; }
.stall .tile { margin: 8px auto 6px; }
.stall .who { font: 500 0.78rem/1.2 var(--display); text-transform: none; letter-spacing: 0; color: var(--ink-2); }
.stall.pick { background: var(--red-soft); border-color: var(--red); }
.stall .flag { top: 5px; left: 0; right: 0; text-align: center; font: 500 0.58rem var(--mono); letter-spacing: 0.06em; }
.draw-note { font: 500 0.75rem var(--mono); text-transform: none; letter-spacing: 0.01em; margin-top: 10px; }
.kpis { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.kpi .value { font: 500 1.8rem/1.1 var(--display); letter-spacing: -0.02em; }
.factor-grid { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.factor-name { font: 500 1rem var(--display); }
.case-grid { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.case-grid dd { font: 500 1.5rem/1.1 var(--display); }
.tabs button { font: 500 0.9rem var(--display); border: 1px solid var(--line-strong); border-radius: var(--r-btn); padding: 8px 16px; }
.rules { border: 1px solid var(--line); border-radius: var(--r-lg); }
.rules li::before { font: 500 1.6rem/1 var(--mono); }
.prose h2 { font-size: 1.5rem; border-top: 1px solid var(--line); padding-top: 16px; }
.htile { border: 1px solid var(--line); border-radius: var(--r-lg); }
.install-card { border: 1px solid var(--line); border-radius: var(--r-lg); }
.install-card strong { font: 500 1.1rem var(--display); }
.install-help { border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.bb-head h3 { font-size: 1.2rem; }
.bb-card { border-top: 1px solid var(--line); }
.acct-form .btn-row { margin-top: 8px; }

/* ---------- tablet and phone ---------- */
@media (max-width: 1100px) {
  .mast .nav a, .mast .nav-more { padding: 10px 10px; }
}
@media (max-width: 960px) {
  .hhero { grid-template-columns: 1fr; gap: 24px; margin-top: 28px; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
  .mast-top { grid-template-columns: auto minmax(0, 1fr) auto; }
  .rhero { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 760px) {
  /* Phones: the tabs are a row under the logo that stays stuck to the top of the screen as you scroll (only the logo
     row slides away). Not along the bottom: on iPhones that strip belongs to the home swipe and Safari's toolbar, so a
     bottom bar there hid, floated and missed taps (owner, 10 Nov). */
  html, body { overflow-x: clip; }
  .mast { position: sticky; top: -56px; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--paper); }
  .tote-cols { display: none; }
  .tote-row { grid-template-columns: 4.6em minmax(0, 1fr) auto; grid-template-areas: 'time race in' 'dist class class'; row-gap: 2px; padding-top: 10px; padding-bottom: 10px; }
  .tote-row .t-dist, .tote-row .t-class { font-size: 0.78rem; color: var(--amber-label); }
  .container, .mast-in { padding: 0 16px; }
  .mast-top { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'logo actions' 'nav nav'; gap: 0 12px; min-height: 0; padding: 0; }
  .mast-top > .logo { grid-area: logo; height: 56px; }
  .mast-actions { grid-area: actions; }
  .logo > .seal { width: 32px; height: 32px; }
  .logo-words { font-size: 1rem; }
  .mast .nav { grid-area: nav; position: static; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); justify-self: stretch; gap: 0; margin: 0 -16px; padding: 0 2px;
    border-top: 1px solid var(--line); background: var(--paper); }
  .mast .nav a, .mast .nav-more { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 62px; padding: 6px 0;
    font: 500 0.74rem/1.1 var(--display); white-space: nowrap; color: var(--ink-2); background: none; border: 0; border-radius: 0; box-shadow: inset 0 -3px 0 transparent; }
  .mast .nav a.active, .mast .nav-more.active { color: var(--red); background: none; box-shadow: inset 0 -3px 0 var(--red); }
  .mast .nav a svg, .mast .nav-more svg { display: block; width: 25px; height: 25px; }
  body { padding-bottom: 0; }
  #acctBtn { display: inline-flex; min-height: 36px; padding: 0 14px; font-size: 0.85rem; }
  .hcard { scroll-margin-top: 76px; }
  .page-head { margin: 24px 0 18px; }
  .hhero { margin: 20px 0 20px; }
  .hhero h1 { font-size: 2.3rem; }
  .hstats { gap: 20px; }
  .home-cards { grid-template-columns: 1fr; gap: 12px; }
  .hcard2 { padding: 16px; }
  .btn-row .btn { flex: 1 1 auto; }
  .tote-head, .tote-row, .tote-cols, .tote-all, .tote-empty { padding-left: 14px; padding-right: 14px; }
  .tote-row { font-size: 0.85rem; }
  .race-row { grid-template-columns: 36px minmax(0, 1fr); padding: 12px 14px; gap: 12px; }
  .rno { width: 32px; height: 32px; }
  .mt-head { padding: 12px 14px; }
  .footer { padding: 32px 16px 28px; margin-top: 48px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .rhero { margin: 18px 0 16px; }
  .rhero h1 { font-size: 2.1rem; }
  .rfacts { gap: 12px 22px; margin-top: 16px; padding-top: 14px; }
  .rfacts b { font-size: 1rem; }
  .rhero-board { padding: 16px 16px 18px; }
  .rb-clock { font-size: 2.6rem; margin: 12px 0 10px; }
  /* Nothing on a phone scrolls sideways (owner, 10 Nov): strips wrap, tables become stacked cards, small tables tighten. */
  .table-wrap table { font-size: 0.8rem; }
  .table-wrap th, .table-wrap td { padding-left: 5px; padding-right: 5px; white-space: normal; overflow-wrap: anywhere; }
  .table-wrap th { letter-spacing: 0.01em; }
  .table-wrap th:first-child, .table-wrap td:first-child { padding-left: 0; }
  .table-wrap th:last-child, .table-wrap td:last-child { padding-right: 0; }
  .tote .ph-x { display: none; }
  .rs-step { display: none; }
  .rs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); overflow: visible; }
  .rs-race { min-width: 0; padding: 8px 4px; }
  .stalls { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); overflow: visible; }
  .stall { max-width: none; }
  .ticket-row { flex-direction: column; align-items: stretch; overflow: visible; scroll-snap-type: none; }
  .toast { top: 72px; }
  /* The shortlist count sits on its tab's icon, so the label keeps its room. */
  .mast .nav a { position: relative; }
  .mast .nav .nav-count { position: absolute; top: 5px; left: calc(50% + 5px); margin: 0; }
  /* The race page's countdown board shrinks to a strip, so the quick take is on the first screen. */
  .rhero-board { padding: 12px 14px; }
  .rhero-board .rb-head { font-size: 0.95rem; }
  .rhero-board .rb-clock { font-size: 2rem; margin: 6px 0 4px; }
  .rhero-board .rb-sub { font-size: 0.72rem; }
  .rh-name { font-size: 0.95rem; margin-top: 6px; }
  .qt-head { padding: 14px 14px 10px; }
  /* A quick-take row on a phone: number, name and why, the shortlist button; our chance and the best price beneath. */
  .qt-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 10px; padding: 12px 14px; }
  .qt-row .qt-rank { display: none; }
  .qt-row > .tile { grid-column: 1; grid-row: 1; align-self: start; }
  .qt-row > .qt-id, .qt-row > .qt-link { grid-column: 2; grid-row: 1; }
  .qt-row > .sl-btn { grid-column: 3; grid-row: 1; align-self: start; }
  .qt-row > .qt-num { grid-row: 2; grid-column: 2; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 6px; min-width: 0; }
  .qt-row > .qt-num + .qt-num { grid-column: 3; justify-content: flex-end; }
  .qt-pace, .qt-foot { padding-left: 14px; padding-right: 14px; }
  .qt-foot .btn { flex: 1 1 auto; }
  .mainm-grid { grid-template-columns: 1fr; }
  .sl-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'race state' 'horse horse' 'x x'; gap: 8px 10px; padding: 12px 14px; }
  .sl-race { grid-area: race; flex-direction: row; align-items: baseline; gap: 8px; }
  .sl-horse { grid-area: horse; }
  .sl-state { grid-area: state; }
  .sl-x { grid-area: x; justify-self: start; }
  .sl-actions .btn { flex: 1 1 auto; }
  .qd-ticket { top: 62px; padding: 12px 14px; }
  .qd-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
  .qd-sum b { font-size: 1.25rem; }
  .qd-spend { margin-top: 10px; padding-top: 10px; }
  .qd-spend .btn { margin-left: 0; flex: 1 1 100%; }
  .qd-legs { grid-template-columns: 1fr; }
  .qd-leg { padding: 14px; }
  .tickets-grid { grid-template-columns: 1fr; gap: 16px; }
  .tickets-grid > .ticket-wrap > .ticket { max-width: 420px; margin: 0 auto; }
  .bb-save { padding: 12px; }
  .bb-save-label { flex: 1 0 100%; }
  .bb-save .btn { flex: 1 1 40%; }
  .bb-changes li { grid-template-columns: 1fr; gap: 2px; }
  .g-sortsel { display: flex; }
  .glance { border: 0; border-radius: 0; overflow: visible; }
  .glance table, .glance tbody { display: block; min-width: 0; width: 100%; }
  .glance thead { display: none; }
  .glance tbody tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 10px; margin: 0 0 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); }
  .glance tbody tr:hover td, .glance td { background: none; }
  .glance tbody tr:active { background: var(--paper-2); }
  .glance tr.top-pick { border-color: var(--red); }
  .glance tr.top-pick td:first-child { box-shadow: none; }
  .glance tr.mine { background: color-mix(in oklab, var(--red-soft) 70%, var(--paper)); }
  .glance tr.mine td { background: none; }
  .glance td { display: block; min-width: 0; padding: 0; border: 0; text-align: left; white-space: normal; font-size: 0.9rem; }
  .glance td.num { text-align: left; }
  .glance td::before { content: attr(data-l); display: block; margin-bottom: 3px; font: 500 0.62rem var(--mono); letter-spacing: 0.04em; color: var(--muted); }
  .glance td.g-runner { grid-column: span 3; order: -2; white-space: nowrap; }
  .glance td.g-runner::before { content: none; }
  .glance td.g-rank { order: -1; text-align: right; }
  .glance td.g-rank::before { content: none; }
  .g-id { max-width: calc(100% - 3em); }
  .g-id b { white-space: normal; }
  .g-chance { min-width: 0; }
  /* A horse's past runs: each run is two short lines instead of a 12-column table. */
  .hcard-runs .table-wrap { overflow: visible; }
  table.runs, .runs tbody { display: block; width: 100%; }
  .runs thead { display: none; }
  .runs tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; padding: 10px 0; border-top: 1px solid var(--rule-soft); }
  table.runs td { display: inline; padding: 0; border: 0; font-size: 0.86rem; text-align: left; }
  .runs td[data-l]::before { content: attr(data-l) ' '; font: 500 0.64rem var(--mono); color: var(--muted); }
  table.runs td { order: 3; }
  table.runs td.r-date { order: 1; flex: 1 0 55%; font-weight: 600; }
  table.runs td.r-fin { order: 2; }
  .runs .rsub { display: inline; margin-left: 4px; }
  .sm-lane { grid-template-columns: 1fr; }
  .sm-l { padding: 8px 12px; }
  h1 { font-size: 2.1rem; }
  .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .eyebrow .live-dot { animation: none; } .hcard2:hover { transform: none; } }

/* Account alerts (16 Nov 2026): the "Turn on alerts" card above every page, and the way out after an alert. */
.alert-bar { padding-top: 14px; }
.alert-card { display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--r-lg); background: var(--paper-2); border-left: 4px solid var(--red); }
.alert-card p { margin: 0; flex: 1 1 280px; }
.alert-card .btn-row { margin: 0; flex-wrap: wrap; }
.alert-card [role=status]:empty { display: none; }
.alert-card [role=status] { flex-basis: 100%; }
@media (max-width: 760px) {
  .alert-card { padding: 12px 14px; }
  .alert-card .btn-row { width: 100%; }
}
