  /* ──────────────────────────────────────────────────────────────────────────
     LEGACY TOKEN BRIDGE  (transitional — deleted at the end of Phase 3)

     These names are referenced ~180 times across this file. Rather than touch
     all 180 sites at once, each legacy name now ALIASES a brand token from
     tokens.css. That flips the whole app from light to dark in one move with
     zero markup change, and keeps every later commit a small, reviewable diff.

     Do NOT add a new legacy name here. As each screen migrates to the
     primitives in components.css, its aliases die with it, and this block
     goes with the last one.

     NOTE: --border maps to --bftb-faint (hairlines/dividers), not --bftb-line.
     Hard 2px card outlines are applied per-component during migration, so
     mapping 180 mixed uses to a 0.90 white would read as a wireframe.
     ────────────────────────────────────────────────────────────────────────── */
  :root {
    --bg:         var(--bftb-black);      /* was #ffffff — the light-mode root */
    --surface:    var(--bftb-surface);    /* was #f3f4f6 */
    --surface2:   var(--bftb-surface-2);  /* was #e9ebee */
    --border:     var(--bftb-faint);      /* was #e5e7eb — see NOTE above     */
    --yellow:     var(--bftb-lime);       /* was #ffe500 — THE brand flip     */
    --yellow-dim: var(--bftb-lime);       /* was #d4bc00 — no dim in system   */
    --gold:       var(--bftb-gold);       /* was #c9a800 */
    --white:      var(--bftb-white);
    --black:      var(--bftb-black);      /* was #000000; == --bftb-lime-ink  */
    --green:      var(--bftb-win-bar);    /* was #16a34a — generic green      */
    --red:        var(--bftb-loss-bar);   /* was #dc2626 — generic red        */
    --push:       var(--bftb-void-bar);   /* was #6366f1 — push == void       */
    --muted:      var(--bftb-mute);       /* was #9ca3af */
    --text:       var(--bftb-white);      /* was #111827 */
    --text2:      var(--bftb-mute);       /* was #6b7280 */

    /* Hero wash — DELIBERATE DEVIATION, see BRAND.md "Decisions on record".
       BRAND.md caps the wash at <=12% and fully desaturated. Dylan asked for
       the players photo to read like the old app, so it runs at 35% in colour.

       The scrim is what makes that safe. The photo only shows through where
       there is no card — cards are opaque --bftb-surface — so the text at
       risk is the ScreenHeader eyebrow/title/badge and the compliance footer,
       which sit directly on it.

       Re-solved for the collage, which is a much denser image than the one
       before it — median luminance 0.195 against the old 0.035, so large
       AREAS sit near the worst case rather than a few stray pixels.

       On a light ground the danger is the opposite of the dark one: the risk
       is the background going too DARK behind dark text. Worst case is a
       pure-black pixel under the footer. At 0.30 opacity behind a 0.64 white
       veil that lands the background at 230 and holds --bftb-mute at 4.97:1,
       with ink at 15.9:1. Every combination tested cleared 4.5:1, so this
       pair was chosen for how much of the collage reads, not for safety —
       but do re-measure if the image is ever swapped again.                  */
    --hero-opacity: 0.30;
    --hero-scrim:   var(--bftb-hero-scrim);   /* the value lives in tokens.css */
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--bftb-font-body);
    min-height: 100vh;
  }

  /* ── HOME HEADER ─────────────────────────────────────────────
     Three columns: title block | players lockup | logo + scoreboard.
     This is the layout the app had before the port and the one Dylan
     asked for back; the brand supplies the palette, faces and
     geometry, not the arrangement. */
  .home-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 0 var(--bftb-space-6);
    /* Full-bleed on purpose: the title sits in the left corner and the
       lockup in the right, the way the pre-port header did. Constraining
       this to the shell left a third of the screen empty on both sides. */
    padding: var(--bftb-space-4) var(--bftb-space-6) 0;
    max-width: none;
    margin: 0;
  }

  .home-head__left  { min-width: 0; }
  /* The date, not a decorative eyebrow. It was 12px via --xs, which was
     right when it read "This weekend" and wrong now that it carries the
     actual dates — that is real information and the only place they appear. */
  .home-head__eyebrow {
    color: var(--bftb-accent);
    font-size: var(--bftb-head-sm);
    letter-spacing: var(--bftb-track-label-n);
    margin: 0 0 var(--bftb-space-2);
  }
  .home-head__title   { margin: 0 0 var(--bftb-space-3); }
  .home-head__count   { color: var(--bftb-mute); margin: 0 0 var(--bftb-space-3); font-size: var(--bftb-label); }

  /* The players lockup. Sits flush to the bottom of the header so the
     figures stand on the nav rule, as they did before. */
  .home-head__art {
    align-self: end;
    min-width: 0;
    line-height: 0;
  }
  .home-head__art img {
    display: block;
    height: clamp(200px, 26vw, 420px);
    width: auto;
    max-width: 100%;
    margin: 0 auto;
  }

  .home-head__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--bftb-space-3);
  }
  /* Logo sits above the title in the left column. */
  .home-head__logo { display: block; margin-bottom: var(--bftb-space-3); }
  .home-head__logo img { display: block; height: clamp(34px, 4vw, 62px); width: auto; }

  /* ── SCOREBOARD ──────────────────────────────────────────────
     Four stacked pills. Hard 2px borders, zero radius, mono figures
     so the column of numbers lines up. */
  .scoreboard {
    display: flex;
    flex-direction: column;
    gap: var(--bftb-space-2);
    width: clamp(92px, 9vw, 128px);
  }

  .scorepill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--bftb-space-2) var(--bftb-space-3);
    border: var(--bftb-border) solid var(--bftb-faint);
    background: var(--bftb-surface);
    text-align: center;
  }

  /* The pill label in Anton too, so the box is one face top to bottom.
     Two adjustments come with that: weight drops to 400, since Anton ships
     nothing else and 600 would be synthesised; and the tracking eases from
     0.16em to 0.06em, because Anton is condensed and the wide caps spacing
     that suits Oswald pulls it apart at this size. Sized up a step for the
     same reason — a narrow face reads smaller at the same px. */
  .scorepill .bftb-label {
    font-family: var(--bftb-font-display);
    font-weight: 400;
    font-size: var(--bftb-label-sm);
    letter-spacing: 0.06em;
  }

  /* Anton. These are four separate centred boxes, not a column of figures,
     so Anton's proportional digits cost nothing here — there is nothing for
     them to fail to line up against. Dropped tabular-nums with the swap:
     Anton ships no tnum table, so it was a promise the face cannot keep. */
  .scorepill__v {
    font-family: var(--bftb-font-display);
    font-weight: 400;
    font-size: clamp(var(--bftb-num), 2.4vw, var(--bftb-num-lg));
    letter-spacing: var(--bftb-track-display);
    color: var(--bftb-white);
    line-height: 1.1;
  }

  /* All four pills share one treatment — faint border, ink figure. The
     per-result colouring is gone deliberately: the scoreboard is a single
     reading of the weekend, and four differently coloured boxes made it
     look like four unrelated widgets. Result colour still does its work
     where it carries meaning, on the row spines and the pick blocks. */

  /* Phone-only parts of the header: hidden on desktop. */
  .home-head__date, .scorebar { display: none; }

  /* Phones: the "Scorecard" header (chosen October 2026).
       logo ············· [9–11 OCT]
       WEEKEND TRACKER  (one line)
       ┌ 74%    │ ■ BANKED   46 ┐
       │ STRIKE │ ■ BOTTLED  16 │
       │        │ □ PENDING  12 │
       └ ████████████▓▓▓▓░░░░░░ ┘
     One order of importance — brand, which weekend, how it is going — and
     the result as ONE card rather than four equal boxes. The per-day sport
     counts and the call count are left to the day tabs on phones.
     align-items: stretch matters: the desktop grid's align-items: start
     would otherwise stop the children filling the width. */
  @media (max-width: 768px) {
    .home-head {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: var(--bftb-space-3);
      padding: var(--bftb-space-4) var(--bftb-edge) var(--bftb-space-4);
    }
    .home-head__art { display: none; }

    .home-head__left {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: var(--bftb-space-3);
    }
    .home-head__logo     { grid-column: 1; grid-row: 1; margin: 0; }
    .home-head__logo img { height: 34px; max-width: 100%; object-fit: contain; }
    .home-head__date     { display: inline-block; grid-column: 2; grid-row: 1; white-space: nowrap; }
    .home-head__date:empty { display: none; }
    /* The full date line only shows when there is no short tag — i.e. when it
       carries a message ("Couldn't load the calls…", "Season break…"). */
    .home-head__eyebrow  { grid-column: 1 / -1; grid-row: 2; margin: 0; }
    .home-head__date:not(:empty) ~ .home-head__eyebrow { display: none; }
    .home-head__title {
      grid-column: 1 / -1;
      grid-row: 3;
      white-space: nowrap;
      font-size: clamp(34px, 11.2vw, 50px);
      line-height: 0.95;
      margin: 0;
    }
    .home-head__title br { display: none; }
    /* Scoped so it outranks the later `#sport-breakdown { display: flex }`. */
    .home-head__count, .home-head__left #sport-breakdown { display: none; }

    /* The scorecard: strike rate big on the left, the three counts as rows
       on the right, the bar across the bottom. */
    .home-head__right { align-items: stretch; }
    .scoreboard {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      align-items: center;
      gap: 6px clamp(var(--bftb-space-3), 4vw, var(--bftb-space-5));
      width: 100%;
      padding: var(--bftb-space-3) var(--bftb-space-4);
      border: var(--bftb-border) solid var(--bftb-line);
      background: var(--bftb-surface);
    }
    .scorepill {
      grid-column: 2;
      flex-direction: row;
      align-items: center;
      gap: var(--bftb-space-2);
      min-width: 0;
      padding: 0;
      border: 0;
      background: none;
      text-align: left;
    }
    .scorepill .bftb-label {
      font-family: var(--bftb-font-label);
      font-size: var(--bftb-label-sm);
      letter-spacing: var(--bftb-track-label-n);
      color: var(--bftb-mute);
    }
    .scorepill__v { margin-left: auto; font-size: 22px; }
    /* The key square in front of each count, in its bar colour. */
    .scorepill--w::before, .scorepill--l::before, .scorepill--p::before {
      content: '';
      flex: none;
      width: 10px;
      height: 10px;
    }
    .scorepill--w::before { background: var(--bftb-win-bar); }
    .scorepill--l::before { background: var(--bftb-loss-bar); }
    .scorepill--p::before { background: var(--bftb-meter-fill); outline: var(--bftb-hairline) solid var(--bftb-faint); }

    .scorepill--rate {
      grid-column: 1;
      grid-row: 1 / span 3;
      flex-direction: column-reverse;   /* the number above its label */
      align-items: flex-start;
      padding-right: clamp(var(--bftb-space-3), 4vw, var(--bftb-space-5));
      border-right: var(--bftb-hairline) solid var(--bftb-faint);
    }
    .scorepill--rate .scorepill__v { margin: 0; font-size: clamp(48px, 16vw, 64px); line-height: 1; }
    .scorepill--rate .bftb-label  { font-size: var(--bftb-label-xs); }

    .scorebar {
      grid-column: 1 / -1;
      display: flex;
      gap: 2px;
      height: 8px;
      margin-top: var(--bftb-space-2);
    }
    .scorebar i { display: block; min-width: 0; }
    .scorebar__w { background: var(--bftb-win-bar); }
    .scorebar__l { background: var(--bftb-loss-bar); }
    .scorebar__p { background: var(--bftb-meter-fill); }
  }

  /* ── FULL-PAGE HERO BACKGROUND ─────────────────────────── */
  /* Swap image: change url() in ::before                      */
  /* Tune transparency: --hero-opacity (image) --hero-scrim (veil) */
  .hero-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
  }
  .hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('images/hero-collage.jpg') center center / cover no-repeat;
    opacity: var(--hero-opacity);
  }
  .hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--hero-scrim);
  }

  /* All page content sits above the fixed background */
  header, main, .bftb-compliance { position: relative; z-index: 2; }

  /* The tab bar sticks to the top at every width, so the day tabs stay in
     reach on a long list of calls. Its background is opaque (components.css),
     so the cards scroll cleanly underneath it. */
  .bftb-nav--top { position: sticky; top: 0; z-index: 50; }

  #sport-breakdown {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .sb-row {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .sb-sport { font-size: 1.25rem; width: 28px; flex-shrink: 0; }
  .sb-day {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bftb-surface-2);
    border-radius: var(--bftb-radius);
    padding: 3px 8px;
  }
  .sb-day.sb-zero { opacity: 0.35; }
  .sb-lbl {
    font-family: var(--bftb-font-label);
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--text2);
    font-weight: 600;
    text-transform: uppercase;
  }
  .sb-num {
    font-family: var(--bftb-font-num);
    font-size: 15.4px;
    color: var(--text);
    line-height: 1;
  }

  /* ── NAV ────────────────────────────────────────────────────
     The bar itself is .bftb-nav in components.css. Only what the
     primitive has no opinion about lives here: the responsive
     overflow, and the mobile bottom sheet — the carousel has no
     bottom-sheet equivalent, so there is no primitive for it. */
  a.bftb-nav__item { text-decoration: none; }

  /* Get App still sits hard right, but it is no longer a filled block.
     A solid lime panel in the nav bar was the single loudest thing on the
     screen and it was competing with the picks, which are what lime is
     reserved for. It reads as a nav item like the rest now; its position
     is what marks it out. */
  .bftb-nav__item--cta { margin-left: auto; }
  .bftb-nav__item--more { display: none; }
  .more-sheet-backdrop, .more-sheet { display: none; }

  /* ── DAY HEADER ──────────────────────────────────────────────
     Date eyebrow over the day name, the day's record to its right,
     and the three actions on one row. The old version crammed a
     heading, a badge, three emoji buttons, a status line and a tally
     into a single wrapping flex row. */
  .day-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: var(--bftb-space-3) var(--bftb-space-4);
    padding: 0 var(--bftb-edge) var(--bftb-space-4);
    max-width: var(--bftb-maxw);
    margin: 0 auto;
  }
  .day-head__name   { margin: 0; }
  .day-head__date   { color: var(--bftb-accent); margin: 0 0 var(--bftb-space-1); }
  .day-head__record {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--bftb-space-1);
    text-align: right;
  }
  /* The record is a FormLine over a worded tally, stacked to the right. */
  .day-head__tally {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--bftb-space-2);
  }
  .day-head__form     { justify-content: flex-end; }
  .day-head__tally-txt {
    color: var(--bftb-mute);
    text-align: right;
    font-size: var(--bftb-label-sm);
  }
  .day-head__actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: var(--bftb-space-2);
  }

  /* ── MAIN CONTENT ───────────────────────────────────────── */
  main {
    padding: var(--bftb-space-6) var(--bftb-edge) var(--bftb-space-8);
    max-width: var(--bftb-shell);
    margin: 0 auto;
  }
  .day-panel { display: none; }
  .day-panel.active {
    display: block;
    animation: fadeIn var(--bftb-dur) var(--bftb-ease);
  }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .wx-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text2);
    background: var(--bftb-surface-2);
    border-radius: var(--bftb-radius);
    padding: 2px 7px;
    margin-top: 4px;
    white-space: nowrap;
  }

  /* ── PERFORMANCE STRIP ──────────────────────────────────────
     "This month" and "20XX overall" as chips, under the weekend
     StatTile. Context, not a second hero — the StatTile owns the
     big number. Hidden until real data lands so it never shows a
     hardcoded 0%, and hidden again on the History tab, which shows
     the same figures in full. */
  /* A panel in its own right, spanning the content width rather than
     sitting in the 560px fixture column. It is the track record above the
     picks, so it reads as a statement about the whole card, not as another
     item in the list. */
  .perf-strip {
    display: none;
    max-width: none;
    margin: 0 0 var(--bftb-space-6);
    padding: var(--bftb-space-4) var(--bftb-space-5);
    background: var(--bftb-surface);
    border: var(--bftb-border) solid var(--bftb-line);
  }

  /* ── ACTION BUTTONS ─────────────────────────────────────── */
  .sync-status {
    font-family: var(--bftb-font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-left: 8px;
  }
  .sync-status:empty { display: none; }
  .sync-status.ok  { color: var(--green); }
  .sync-status.err { color: var(--red); }

  /* ── SCROLLBAR ──────────────────────────────────────────── */
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: var(--surface2); }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--bftb-radius); }
  ::-webkit-scrollbar-thumb:hover { background: var(--muted); }

  /* ── PWA — Age Gate ─────────────────────────────────────── */
  @supports (padding: env(safe-area-inset-top)) {
    /* Clear the clock / notch / Dynamic Island. viewport-fit=cover lets the
       page draw under them, and a bare `header` rule here lost to
       .home-head's own padding, so the logo sat under the status bar. */
    .home-head { padding-top: calc(var(--bftb-space-4) + env(safe-area-inset-top)); }
    body { padding-bottom: env(safe-area-inset-bottom); }
    .more-sheet { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  }

  /* Age gate — clean white card, fintech-onboarding feel */
  .age-gate {
    position: fixed; inset: 0;
    background: var(--bftb-black);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 24px;
    text-align: center;
  }
  /* White card — real div so content is genuinely contained */
  .age-gate-card {
    width: min(480px, calc(100% - 32px));
    background: var(--bftb-surface);
    border-radius: var(--bftb-radius);
    padding: 32px 24px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .age-gate-logo {
    max-width: 220px;
    height: auto;
    margin-bottom: 12px;
  }
  .age-gate h2 {
    font-family: var(--bftb-font-head);
    font-size: 1.75rem;
    letter-spacing: 2px;
    color: var(--bftb-white);
    margin-bottom: 12px;
  }
  /* Yellow accent bar under the heading */
  .age-gate h2::after {
    content: '';
    display: block;
    width: 48px;
    height: 4px;
    background: var(--yellow);
    border-radius: var(--bftb-radius);
    margin: 10px auto 0;
  }
  .age-gate p {
    color: var(--bftb-mute);
    font-size: 15.7px;
    line-height: 1.65;
    margin-bottom: 28px;
    max-width: 360px;
  }
  .age-gate p strong { color: var(--bftb-white); }
  .age-gate-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .age-btn {
    padding: 14px 36px;
    border: none;
    border-radius: var(--bftb-radius);
    font-family: var(--bftb-font-label);
    font-size: 1rem;
    letter-spacing: 2px;
    cursor: pointer;
    transition: opacity var(--bftb-dur-fast) var(--bftb-ease);
    text-transform: uppercase;
  }
  .age-btn-yes {
    background: var(--bftb-lime);
    color: var(--bftb-lime-ink);
  }
  .age-btn-yes:hover { opacity: 0.86; }
  .age-btn-no {
    background: transparent;
    color: var(--bftb-mute);
    border: var(--bftb-hairline) solid var(--bftb-faint);
  }
  .age-btn-no:hover { border-color: var(--red); color: var(--red); }
  /* Under-18 exit screen — fills the viewport, footer pinned under it. */
  .bftb-gate-exit {
    min-height: 70vh;
    display: flex;
    align-items: center;
    padding-top: var(--bftb-space-8);
  }

  /* The helpline is a compliance element — it reads in the brand accent,
     never a generic link blue. */
  .age-gate-help {
    color: var(--bftb-accent);
    font-weight: 700;
    text-decoration: underline;
  }

  .age-gate-legal {
    margin-top: 28px;
    font-size: 13px;
    color: var(--bftb-mute);
    max-width: 360px;
    line-height: 1.6;
  }

  /* ── INSTALL MODAL ──────────────────────────────────────── */
  .install-modal {
    position: fixed;
    inset: 0;
    background: var(--bftb-scrim);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  .install-modal.show { display: flex; }
  .install-modal-card {
    background: var(--bftb-surface);
    border-radius: var(--bftb-radius);
    padding: 36px 28px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.35s ease;
  }
  .im-app-icon {
    width: 80px; height: 80px;
    border-radius: var(--bftb-radius);
    margin-bottom: 16px;
  }
  .im-title {
    font-family: var(--bftb-font-head);
    font-size: 1.6rem;
    letter-spacing: 1.5px;
    color: var(--bftb-white);
    margin: 0 0 10px;
  }
  .im-desc {
    font-size: 15.4px;
    color: var(--bftb-mute);
    line-height: 1.6;
    margin: 0 0 24px;
  }
  .im-steps {
    text-align: left;
    padding-left: 20px;
    margin: 0 0 20px;
    color: var(--bftb-mute);
    font-size: 15.1px;
    line-height: 1.8;
  }
  .im-steps li { margin-bottom: 4px; }
  .im-share-icon {
    display: inline-block;
    background: var(--bftb-surface-2);
    color: var(--bftb-white);
    padding: 1px 6px;
    border-radius: var(--bftb-radius);
    font-size: 13px;
  }
  /* Appearance comes from .bftb-btn--lime; only layout lives here. */
  .im-install-btn {
    width: 100%;
    margin-bottom: var(--bftb-space-3);
  }
  .im-skip {
    background: none;
    border: none;
    color: var(--bftb-mute);
    font-size: 14.6px;
    cursor: pointer;
    min-height: var(--bftb-tap);
    padding: 6px 16px;
    text-decoration: underline;
  }

  /* Get App sits in the same 560px column as the fixture cards, with its
     own 16px edge, rather than stretching across the whole shell. */
  #download-panel {
    max-width: var(--bftb-maxw);
    margin: 0 auto;
    padding: 0 var(--bftb-edge);
  }
  .dl-hero {
    text-align: center;
    padding: 32px 0 20px;
  }
  .dl-app-icon {
    display: block;
    width: 88px; height: 88px;
    border: var(--bftb-border) solid var(--bftb-line);
    border-radius: var(--bftb-radius);
    margin: 0 auto 14px;
  }
  .dl-hero h2 {
    font-family: var(--bftb-font-display);
    font-weight: 400;
    font-size: var(--bftb-display-sm);
    letter-spacing: var(--bftb-track-display);
    text-transform: uppercase;
    margin: 0 0 8px;
    color: var(--bftb-white);
  }
  .dl-hero p { color: var(--text2); font-size: 15.4px; line-height: 1.6; margin: 0; }

  .dl-section {
    background: var(--bftb-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--bftb-radius);
    padding: 22px 24px;
    margin: 0 0 16px;
  }
  .dl-section h3 {
    font-family: var(--bftb-font-head);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 14px;
  }
  .dl-section--installed { background: var(--bftb-win-bg); border-color: var(--bftb-win-bar); }
  .dl-installed-badge {
    font-family: var(--bftb-font-label);
    font-size: 1.2rem;
    color: var(--bftb-win-bar);
    margin-bottom: 6px;
  }
  /* Appearance comes from .bftb-btn--lime; only layout lives here. */
  .dl-install-btn {
    width: 100%;
    margin-bottom: var(--bftb-space-2);
    transition: background 0.15s;
  }
  .dl-hint { font-size: 14.1px; color: var(--muted); margin: 0; }
  .dl-steps {
    padding-left: 20px;
    margin: 0;
    color: var(--text);
    font-size: 15.4px;
    line-height: 2;
  }
  .dl-share-icon {
    display: inline-block;
    background: var(--bftb-surface-2);
    color: var(--bftb-white);
    padding: 1px 7px;
    border-radius: var(--bftb-radius);
    font-size: 13px;
  }
  .dl-share-section {
    border-top: 1.5px solid var(--border);
    padding-top: 20px;
    margin-top: 8px;
    text-align: center;
  }
  .dl-share-section h3 {
    font-family: var(--bftb-font-head);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 12px;
  }
  .dl-link-box {
    background: var(--bftb-surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--bftb-radius);
    padding: 10px 14px;
    font-size: 14.6px;
    color: var(--text2);
    font-family: var(--bftb-font-num);
    margin-bottom: 14px;
    word-break: break-all;
  }

  /* ── MOBILE ─────────────────────────────────────────────── */
  @media (max-width: 768px) {

    /* SAFEGUARD: prevent any child from causing horizontal scroll */
    /* clip, not just hidden: overflow-x: hidden turns body into a scroll
       container, which silently breaks position: sticky on the tab bar.
       hidden stays first as the fallback for browsers without clip. */
    html, body { overflow-x: hidden; overflow-x: clip; max-width: 100%; }

    /* Sport breakdown chips */
    .sb-day { background: var(--bftb-surface-2); border: none; padding: 2px 5px; }
    .sb-lbl { font-size: 13px; color: var(--text2); }
    .sb-num { font-size: 0.95rem; color: var(--text); }

    /* 4 equal permanent items (Fri/Sat/Sun/More); the other three are
       reachable through the sheet, so they drop out of the bar. */
    .bftb-nav__item {
      flex: 1 1 0;
      padding: var(--bftb-space-3) var(--bftb-space-1);
    }
    .bftb-nav__item--overflow { display: none; }
    .bftb-nav__item--more     { display: flex; }

    /* ── "MORE" BOTTOM SHEET ── */
    .more-sheet-backdrop {
      display: block;
      position: fixed; inset: 0;
      background: var(--bftb-scrim-light);
      z-index: 9400;
      opacity: 0; pointer-events: none;
      transition: opacity 0.2s ease;
    }
    .more-sheet-backdrop.show { opacity: 1; pointer-events: auto; }

    .more-sheet {
      display: flex;
      flex-direction: column;
      position: fixed; left: 0; right: 0; bottom: 0;
      z-index: 9500;
      background: var(--bftb-surface);
      border-radius: var(--bftb-radius);
      padding-top: 8px;
      max-height: 70vh;
      overflow-y: auto;
      transform: translateY(100%);
      /* Closed, it is also visibility: hidden — out of the tab order, and it
         cannot peek above the iOS toolbar. The visibility flip waits for the
         slide to finish on close, and happens at once on open. */
      visibility: hidden;
      transition: transform 0.3s cubic-bezier(.32,.72,0,1), visibility 0s linear 0.3s;
    }
    .more-sheet.show {
      transform: translateY(0);
      visibility: visible;
      transition: transform 0.3s cubic-bezier(.32,.72,0,1), visibility 0s;
    }
    .more-sheet:not(.show) { pointer-events: none; }

    .more-sheet-handle {
      width: 40px; height: 4px;
      background: var(--bftb-faint); border-radius: var(--bftb-radius);
      margin: 4px auto 12px;
      flex-shrink: 0;
    }

    /* Sheet rows: a left-aligned list, not the equal-width centred bar. */
    .more-sheet-item {
      display: flex; align-items: center; gap: var(--bftb-space-3);
      width: 100%; box-sizing: border-box;
      min-height: var(--bftb-tap);
      padding: var(--bftb-space-4) var(--bftb-space-6);
      border: 0;
      border-bottom: var(--bftb-hairline) solid var(--bftb-faint);
      background: transparent;
      color: var(--bftb-white);
      font-family: var(--bftb-font-label);
      font-weight: 600;
      font-size: var(--bftb-body-sm);
      letter-spacing: var(--bftb-track-label-n);
      text-transform: uppercase;
      text-align: left;
      text-decoration: none;
      cursor: pointer;
    }
    .more-sheet-item:last-child { border-bottom: 0; }
    .more-sheet-item:active { background: var(--bftb-surface-2); }

    /* ── MAIN ── */
    /* No side padding: every child owns its own 16px edge. Main's padding
       used to stack on top of the cards' own, so the header, strip and
       cards each started at a different distance from the screen edge. */
    main { padding: 12px 0 32px; }
    .perf-strip { margin: 0 var(--bftb-edge) var(--bftb-space-6); }
    .perf-strip .bftb-meter__value { font-size: var(--bftb-num-lg); }

    /* ── DAY HEADER ── */
    /* One column: date and day name, then the record full width, then the
       three actions as equal thirds. A right-hand record column was too
       narrow for the FormLine, which wrapped into a block. */
    :root { --bftb-form-square: 26px; }
    .day-head {
      display: flex;
      flex-direction: column;
      align-items: stretch;
    }
    .day-head__record,
    .day-head__tally { align-items: flex-start; text-align: left; }
    .day-head__form { justify-content: flex-start; }
    .day-head__tally-txt { text-align: left; }
    .day-head__actions {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .day-head__actions .bftb-btn {
      min-width: 0;
      white-space: nowrap;
      padding-left: var(--bftb-space-1);
      padding-right: var(--bftb-space-1);
      letter-spacing: 0.06em;
    }
    .sync-status { font-size: 13px; margin-left: 0; }

  }

  /* ── HISTORY TAB ─────────────────────────────────────────── */
  .history-empty {
    color: var(--bftb-mute);
    font-family: var(--bftb-font-label);
    font-weight: 600;
    font-size: var(--bftb-label);
    letter-spacing: var(--bftb-track-label);
    text-transform: uppercase;
    padding: var(--bftb-space-8) 0;
    text-align: center;
  }

  /* The annual StatTile and the month panels sit in the page gutter. */
  .hist-annual,
  .bftb-chiprow,
  .hist-month {
    margin-left: var(--bftb-edge);
    margin-right: var(--bftb-edge);
  }

  /* The week count is a figure, so it takes the scoreboard's face rather
     than rendering as plain body text. */
  #history-weeks-badge {
    font-family: var(--bftb-font-display);
    font-weight: 400;
    font-size: var(--bftb-num-lg);
    letter-spacing: var(--bftb-track-display);
    line-height: 1.1;
    color: var(--bftb-white);
  }

  .hist-annual  { margin-bottom: var(--bftb-space-3); }
  .bftb-chiprow { margin-bottom: var(--bftb-space-7); }
  .hist-month   { margin-bottom: var(--bftb-space-6); }

  /* Month name left, strike rate right, inside the panel title. */
  .hist-month-hdr {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--bftb-space-3);
  }

  .hist-month-pct {
    font-family: var(--bftb-font-num);
    font-variant-numeric: tabular-nums;
  }

  .hist-month-sub { margin-bottom: var(--bftb-space-4); }

  .hist-weeks {
    display: flex;
    flex-direction: column;
    gap: var(--bftb-space-3);
  }
