/* ============================================================
   RALLY · Design System  v3 "Quiet Paper"
   Paper / Forest / Ink / Lime · Plus Jakarta Sans · flat
   ------------------------------------------------------------
   Implements docs/BRAND.md. That file is authoritative; this one
   is its only implementation. If the two disagree, BRAND.md wins.

   WHAT CHANGED IN v3 (BRAND.md §3, §4, §6)
   ----------------------------------------
   The palette, the typography, the radius scale and the motion
   curve are UNCHANGED. The decoration is gone:

     · No box-shadow anywhere. Not offset, not blurred, not a
       focus ring. The only permitted overlay in the whole system
       is a modal scrim, which is a background on a backdrop
       element — not a shadow on a component.
     · No 1.5px Ink outlines. Borders are ONE pixel of a light
       neutral (`--line`, or `--line-strong` on controls that need
       a little more affordance). An Ink border is reserved for the
       one case where something must read as selected — and even
       then a fill change is usually better.
     · No lift on hover. Hover moves TONE, over 140ms. Nothing
       translates, nothing grows.
     · No graphic toolkit — grid texture, dashed paths, marquee,
       outline type, ambient loops, the button sweep. §9 keeps the
       class names alive as inert no-ops so stray markup degrades
       to plain instead of exploding.

   Separation now comes from whitespace, surface tone and type
   hierarchy. If a region does not read as distinct, give it more
   room — do not give it a border you can see from across a desk.

   THREE RULES A FUTURE AGENT WILL OTHERWISE GET WRONG
   ---------------------------------------------------
   1. THE RATIO IS NON-NEGOTIABLE — Paper 60 / Forest 20 / Ink 12
      / Lime 8. Lime is an accent, never a wall. The only things
      that are lime by default in this file are `.btn-brand`, the
      wordmark dot, the pill marker and active states. Do not add
      a fourth.
   2. LIME ON PAPER FAILS AS TEXT (2.2:1). Never set copy, labels
      or links in `--acid` on a light surface. Use `--leaf`
      (Forest) for "green text" and keep lime for the mark next to
      it. Ink-on-Lime (8:1) is fine — that is why the primary
      button is lime FILL with Ink TYPE, not the reverse.
   3. THE TENANT BOUNDARY IS REAL. Everything under
      "BRAND LAYER" is the club's colour, not Rally's. Rally's own
      pages must not paint themselves with `--brand`; tenant pages
      (book / embed / confirm) must not paint themselves lime.
      See BRAND.md §9.

   If you find yourself typing `box-shadow:` in this file, stop.
   ============================================================ */

/* ============================================================
   1 · TOKENS
   ============================================================ */
:root {
  /* ── The six brand tokens (BRAND.md §1) ────────────────────
     These six names always mean the same six hexes on a light
     surface. `--ink` and `--paper` DO swap in dark mode (see
     below) because every existing rule reads `--ink` as "type"
     and `--paper`/`--bg` as "the surface". When you need the
     literal brand hex regardless of theme — Ink type on a lime
     button, for instance — use `--ink-fixed` / `--paper-fixed`,
     which never move. */
  --paper:      #FCFAF7;   /* Paper  — the default page surface   */
  --leaf:       #2E4C38;   /* Forest — feature blocks, footers    */
  --ink:        #151714;   /* Ink    — type (and selected states) */
  --acid:       #9DB90B;   /* Lime   — accent ONLY (8% of a page) */
  --moss:       #D8E892;   /* Moss   — soft lime highlight        */
  --sage:       #6C8B76;   /* Sage   — muted supporting tone      */

  /* Theme-invariant anchors. Never redefined in [data-theme]. */
  --ink-fixed:   #151714;
  --paper-fixed: #FCFAF7;

  /* ── Derived surface + ink scale ───────────────────────────
     Legacy names, unchanged values. Existing markup keeps
     working. */
  --bg:           var(--paper);
  --bg-soft:      #F5F1E9;   /* paper, one step warmer/darker     */
  --bg-elev:      #EDE7DB;   /* raised chips, table zebra         */
  --ink-soft:     #2C3129;   /* softened Ink for long-form copy   */
  --line:         #E4DDCF;   /* THE hairline. Surfaces, dividers. */
  /* Was Ink at 1.5px — "the outline". It is now simply the next
     step down the same hairline: for controls (buttons, inputs,
     toggles) that need a touch more edge than a card does. It is
     still a hairline, still neutral, still not Ink. */
  --line-strong:  #CFC7B6;
  /* Sage is the muted tone (BRAND.md §1). `--muted` is Sage deepened one step
     so it clears 4.5:1 on Paper — it is used for real sentences, not just
     labels. `--sage` itself stays the exact brand hex. */
  --muted:        #4F6B58;   /* 5.5:1 on Paper, 5.1:1 on Sand — was #5F7D69 (4.35, failed AA) */
  --muted-soft:   #8CA694;
  --faint:        #D8D1C1;

  /* Interaction tone. Hover and press are a SURFACE change now
     that nothing lifts, so they get their own two steps rather
     than borrowing `--bg-elev` (which is Forest in dark mode and
     far too loud for a hover). */
  --surface-hover: #F4F0E7;
  --surface-press: #EDE8DD;

  /* ── Semantic ─────────────────────────────────────────────── */
  --pos:          #2E4C38;
  --neg:          #A5342A;
  --warn:         #806012;
  --danger:       #A5342A;
  --danger-soft:  #FAECE8;
  --danger-line:  #E4B6AC;

  /* ── Radius (BRAND.md §3) — 16 base, +5 / +10 / +18 / +26 ─── */
  --r-base: 16px;
  --r-md:   21px;
  --r-lg:   26px;
  --r-xl:   34px;
  --r-2xl:  42px;
  --r-pill: 999px;
  --r-card: 20px;          /* cards are 20, explicitly, per §3   */
  /* legacy aliases — still referenced by page-level CSS */
  --r-xs:   10px;
  --r-sm:   14px;

  /* ── Stroke (BRAND.md §3, revised v4) ─────────────────────
     TWO widths, and only two. `--stroke` is the hairline that
     separates surfaces — dividers, table rules, card edges that
     are only closing a shape. `--stroke-2` is the *drawn* edge:
     anything a finger can hit (buttons, inputs, toggles, tabs,
     selectable tiles) gets 1.5px so the control reads as an
     object rather than as a tint.

     1.5px is the ceiling. Not 2px — at 2px the Ink edge starts
     to read as the comic-panel treatment v3 deliberately
     removed, and on a 1x display 2px is visually twice the
     hairline rather than a step up from it. 1.5px lands on 1.5
     device pixels at 1x (the browser rounds it up to 2 physical
     rows only where it must) and is exactly 3 crisp pixels at
     2x, which is why it holds its weight on a phone. */
  --stroke: 1px;
  --stroke-2: 1.5px;
  /* The colour of a DRAWN edge (anything bordered at --stroke-2).
     Neutral here; the Hulo layer (assets/hulo.css) turns it Ink on
     Rally-owned pages. Tenant pages never load that layer. */
  --edge: var(--line);
  --edge-strong: var(--line-strong);

  /* ── Shadow tokens — deliberately `none` ──────────────────
     BRAND.md §3: no shadows anywhere. The three names stay
     DEFINED so that any page CSS still saying
     `box-shadow: var(--shadow-hard)` resolves to `none` instead
     of to an invalid declaration. Do not give them a value. */
  --shadow-hard:    none;
  --shadow-hard-lg: none;
  --shadow-hard-sm: none;

  /* ── Type (BRAND.md §2, revised v5) ───────────────────────
     TWO families now, with one job each.

       --font-display  Plus Jakarta Sans. Everything that carries
                       weight: headings, the wordmark, buttons,
                       overlines, stat numbers, money totals,
                       table headers. Its tight tracking and
                       ExtraBold are the brand's voice.

       --font          The reading face. Body copy, form labels,
                       hints, table cells, descriptions — the
                       long tail of small text that makes up most
                       of a dashboard.

     WHY A SECOND FACE AT ALL. Plus Jakarta Sans is a display
     family. At 15px it is fine; at the 11–13px where a dense
     booking table actually lives, its tight apertures and −1%
     default tracking close up and it stops being scannable. A
     geometric reading face at those sizes is measurably clearer,
     and the contrast between the two makes the ExtraBold headings
     read as MORE emphatic, not less.

     ON PRODUCT SANS. It is Google's proprietary corporate face —
     not on Google Fonts, not licensable for embedding, and
     shipping it would be a licence violation rather than a design
     choice. It is FIRST in the stack anyway, so a machine that
     already has it installed uses it; everyone else falls through
     to Rubik, which is the closest OFL geometric sans and holds
     up far better at 11px. To swap it for something else, change
     one line here and the `<link>` in the page heads. */
  --font-display: 'Plus Jakarta Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font: 'Product Sans', 'Google Sans', 'Rubik', 'Plus Jakarta Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ── The small-text scale ─────────────────────────────────
     Six steps, covering 11–14.5px — the band where nearly every
     word in a Rally dashboard sits. They exist as tokens for one
     reason: URDU NEEDS THEM BIGGER, and a px literal buried in
     one of 1,600 declarations cannot be made bigger later.

     The floor is 11px and it is a floor, not a suggestion. This
     product shipped text at 7px, 8px and 9px — sizes that are
     not small, they are unreadable, and no amount of tracking
     rescues them. Nothing below `--fs-micro` may be introduced.

     Urdu takes every step up by 1.5px (see §15). Naskh has a
     large x-height but its letterforms carry more detail per em
     than Latin — the dots, the joins, the diacritics — so it
     needs the extra size to stay legible at the same distance. */
  /* v8 (Nov 2026): one notch up across the small sizes. Owners read this on a
     phone at arm's length, some with reading glasses; 12.5px hints were the
     first thing people squinted at. The floor is now 11.5px. */
  --fs-micro: 11.5px;    /* micro labels, chart axes. The floor.  */
  --fs-tiny:  12px;      /* tags, badges, dense table meta        */
  --fs-label: 12.5px;    /* overlines, pills, field labels        */
  --fs-sm:    13.5px;    /* hints, secondary rows                 */
  --fs-body:  14.5px;    /* the workhorse: table cells, cards     */
  --fs-md:    15.5px;    /* buttons, emphasised body              */
  /* Nothing is ever downloaded for this: `ui-monospace` resolves to whatever
     the platform already uses for code (SF Mono, Cascadia, DejaVu Sans Mono),
     and the rest is the fallback chain for platforms that do not know the
     keyword. BRAND.md §2 calls for a "monospace fallback stack", not a second
     web font — Plus Jakarta Sans is the only typeface Rally loads. */
  --mono: ui-monospace, 'SFMono-Regular', 'Roboto Mono', Menlo, Consolas, monospace;

  /* ── Motion (BRAND.md §6, revised v4) ──────────────────────
     `--ease` is still THE curve and still does most of the work.
     v4 adds three siblings, each with one job, so that a page
     never has to invent a bezier inline:

       --ease-out    long, decelerating. Entrances and reveals.
       --ease-in-out symmetric. Things that move and come back
                     (accordions, drawers, height changes).
       --ease-spring one overshoot, ~9%. ONLY for a control
                     acknowledging a tap — a toggle knob, a
                     check landing, a count ticking over. Never
                     on a layout box; an overshooting panel
                     reads as a bug.

     Durations are a scale, not a free number. If a value is not
     on this list, the animation is wrong, not the token. */
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.30, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.42, 0.64, 1);

  --t-lift:   140ms;   /* hover / press tone change              */
  --t-reveal: 240ms;   /* the scroll reveal                      */
  --t-sweep:  140ms;   /* legacy name; the sweep itself is gone  */

  --t-1: 120ms;        /* a state flip you should not notice     */
  --t-2: 200ms;        /* the default for anything interactive   */
  --t-3: 320ms;        /* entrances, accordions, drawers         */
  --t-4: 520ms;        /* a full-panel transition, at most       */

  /* Ambient loop periods. Anything that repeats forever must
     take one of these, so two loops on the same screen either
     agree or are obviously unrelated — never almost-agree,
     which is what makes a page feel jittery. */
  --loop-slow: 18s;
  --loop-med:  9s;
  --loop-fast: 3.2s;

  /* Reveal distance. Small on purpose: the reveal is still
     mostly a fade (BRAND.md §6). 10px is enough to read as
     "arriving" and not enough to read as "sliding in". */
  --reveal-rise: 10px;

  /* ── Script (§10) ──────────────────────────────────────────
     Urdu needs a different family and a much taller line box.
     Both are variables so a page never branches on language —
     it sets `lang="ur"` and the tokens move. See assets/i18n.js. */
  --font-ur: 'Noto Sans Arabic', 'Segoe UI', 'Noto Naskh Arabic', 'Noto Nastaliq Urdu',
             'Plus Jakarta Sans', sans-serif;
  --lh-script: 1.55;
  --tracking-script: -0.01em;
}

/* ── Dark mode ───────────────────────────────────────────────
   Ink becomes the surface, Paper becomes the type, Forest is the
   elevated surface. `--ink` and `--paper` swap so that every
   `color: var(--ink)` in this file inverts for free. The hairline
   tokens invert with them. Nothing here needs to redeclare a
   shadow, because there are no shadows. */
[data-theme="dark"] {
  /* Only Paper and Ink move. Forest, Lime, Moss and Sage are the exact brand
     hexes in both themes — they have to be, or a lime button would not be the
     same lime on two screens of the same product. */
  --paper:        #151714;
  --ink:          #FCFAF7;

  --bg:           #151714;
  --bg-soft:      #1B1F1A;
  --bg-elev:      #2E4C38;   /* Forest is the elevated surface     */
  --ink-soft:     #E6E2D9;
  --line:         #2A2F27;
  --line-strong:  #3A4137;
  --muted:        #93B29C;   /* Sage lifted for legibility on Ink */
  --muted-soft:   #667F6E;
  --faint:        #333A31;

  --surface-hover: #1F231E;
  --surface-press: #262B24;

  --pos:          #D8E892;
  --neg:          #E58B7C;
  --warn:         #D6BE6A;
  --danger:       #E58B7C;
  --danger-soft:  #2A1512;
  --danger-line:  #5E2A22;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*::selection { background: var(--acid); color: var(--ink-fixed); }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* `clip`, not `hidden`. `hidden` on one axis turns the other into `auto`,
     so <html> AND <body> both became scroll containers: mouse-wheel scrolling
     died on long forms (onboarding step 2, Dec 2026) and nothing could stick.
     `clip` cuts the sideways overflow without creating a scroll box. Browsers
     too old for `clip` keep the old `hidden`. */
  overflow-x: hidden;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
svg { flex: none; }

/* ============================================================
   2 · TYPOGRAPHY  (BRAND.md §2 — six styles, exact tracking)
   Unchanged by the minimal pass. Type hierarchy is now doing
   more of the work, not less.
   ============================================================ */
/* Everything in this block is the DISPLAY face. `.h-*`, the
   overlines, the wordmark and the numerals are the brand's voice;
   §1's `--font` reading face carries the prose around them. */
.h-display, .h-1, .h-2, .h-3,
.eyebrow, .label, .overline,
.brand, .rally-wordmark,
.btn, .pill, .tag, .badge,
th, .stat-value, .num {
  font-family: var(--font-display);
}

.h-display {
  font-size: clamp(42px, 7.4vw, 92px);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: -0.045em;
}
.h-1 {
  font-size: clamp(30px, 4.4vw, 48px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.h-2 {
  font-size: clamp(23px, 3vw, 33px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.h-3 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
/* Label / overline / tag — 800, uppercase, +18% tracking. */
.eyebrow,
.label,
.overline {
  font-size: var(--fs-label);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  line-height: 1.3;
  color: var(--muted);
}
.eyebrow-ink { color: var(--ink); }
.mono, .code { font-family: var(--mono); font-weight: 700; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.body { font-weight: 500; line-height: 1.55; }
.lead { font-size: 17px; font-weight: 500; line-height: 1.55; color: var(--ink-soft); }

/* ============================================================
   3 · BUTTONS
   `.btn`        pill · hairline · Paper fill        (secondary)
   `.btn-brand`  BRAND fill · readable type          (primary CTA)
   `.btn-lime`   LIME fill · INK type                (always lime)
   `.btn-dark`   Ink fill · Paper type               (inverse)
   `.btn-forest` Forest fill · Paper type            (inverse)
   `.btn-ghost`  no fill, no border                  (tertiary)

   Every one of them is FLAT. Hover is a 140ms tone change and
   nothing else — no translate, no shadow, no sweep. BRAND.md §6.
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  min-height: 44px;              /* tap target — see FRONTEND_GUIDE rule 5 */
  border-radius: var(--r-pill);
  background: var(--paper);
  /* 1.5px — a button is the canonical "drawn edge" control. */
  border: var(--stroke-2) solid var(--edge-strong);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  /* `transform` is in the transition list ONLY for the :active
     rule below. Hover still moves nothing — see §6. */
  transition:
    background-color var(--t-lift) var(--ease),
    color var(--t-lift) var(--ease),
    border-color var(--t-lift) var(--ease),
    transform var(--t-1) var(--ease-out);
}
.btn svg { width: 17px; height: 17px; }

.btn:hover { background: var(--surface-hover); border-color: var(--muted-soft); }

/* THE ONE TRANSFORM IN THE SYSTEM (BRAND.md §6, v4).
   Press, not hover. It is 2% for ~120ms and it exists because a
   pill with no shadow and no lift has nothing else to confirm a
   tap with on a touchscreen, where there is no hover state at
   all to have confirmed it beforehand. It reverses on release
   and it never fires on a pointer that is merely passing over.
   Do not extend this to :hover. Do not raise it past 0.98. */
.btn:active:not(:disabled):not([aria-disabled="true"]) {
  background: var(--surface-press);
  transform: scale(0.98);
}

/* PRIMARY, always-lime. Lime fill, Ink type — 8:1, the one
   approved lime pair. `--ink-fixed` not `--ink`: the fill stays
   lime in dark mode, so the type has to stay dark or it
   disappears. No border — the fill IS the edge.

   `.btn-brand` — the class the pages actually use — is defined
   in §12 against `--brand`, whose Rally default IS lime; on a
   tenant booking page the same class resolves to the club's
   colour instead. That is deliberate. See §12. */
.btn-lime {
  background: var(--acid);
  color: var(--ink-fixed);
  border-color: var(--acid);
}
.btn-lime:hover { background: #93AD0A; border-color: #93AD0A; }
.btn-lime:active { background: #869E09; border-color: #869E09; }

.btn-dark {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-dark:hover { background: var(--ink-soft); border-color: var(--ink-soft); }
.btn-dark:active { background: var(--ink); border-color: var(--ink); }

.btn-forest {
  background: var(--leaf);
  color: var(--paper-fixed);
  border-color: var(--leaf);
}
.btn-forest:hover { background: #395C45; border-color: #395C45; }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  font-weight: 600;
}
.btn-ghost:hover { background: var(--surface-hover); border-color: transparent; }
.btn-ghost:active { background: var(--surface-press); }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-line);
}
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn-lg  { padding: 16px 28px; font-size: 16px; min-height: 54px; }
.btn-lg svg { width: 19px; height: 19px; }
.btn-sm  { padding: 8px 14px; font-size: var(--fs-sm); min-height: 36px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-icon {
  padding: 0;
  width: 40px;
  min-height: 40px;
  height: 40px;
  border-radius: 50%;
}
.btn-block { width: 100%; }
.btn-tap { min-height: 48px; }

/* THE TOUCH FLOOR. `.btn-sm` (36px) and `.btn-icon` (40px) are correct for a
   mouse and under the 44px minimum for a thumb, and every page in the product
   shipped them unbranched. The query keys on `pointer: coarse` as well as on
   width, deliberately: a 1024px iPad is a wide screen operated by a thumb, and
   a width-only rule leaves exactly that case broken. Padding does not change —
   only the box grows, so a dense toolbar keeps its rhythm. */
@media (max-width: 900px), (pointer: coarse) {
  .btn-sm { min-height: 44px; }
  .btn-icon { width: 44px; height: 44px; min-height: 44px; }
}

/* Disabled must stay VISIBLE and obviously inert — not a ghost.
   A flat grey fill, a hairline and muted type: "a button,
   switched off". */
.btn:disabled,
.btn[aria-disabled="true"],
.btn-brand:disabled {
  cursor: not-allowed;
  background: var(--bg-elev);
  color: var(--muted-soft);
  border-color: var(--line);
  filter: none;
  opacity: 1;
}
[data-theme="dark"] .btn:disabled,
[data-theme="dark"] .btn[aria-disabled="true"] { background: var(--bg-soft); }

/* ============================================================
   4 · SURFACES
   Flat. Hairline. 20px radius. Generous padding. A card is
   separated from the page by its tone and by the space around
   it — the border is there to close the shape, not to announce
   it. BRAND.md §3.
   ============================================================ */
.card {
  position: relative;
  background: var(--paper);
  /* 1.5px of a LIGHT neutral. The width went up, the contrast did
     not — which is the whole trick. A 1.5px `--line` edge reads as
     a deliberately drawn card; a 1px `--line-strong` edge reads as
     a table rule someone forgot to remove. */
  border: var(--stroke-2) solid var(--line);
  border-radius: var(--r-card);
  padding: 26px;
  transition: background-color var(--t-lift) var(--ease), border-color var(--t-lift) var(--ease);
}
/* Only for cards that are actually interactive. Tone, never lift. */
.card:hover { border-color: var(--line-strong); }

/* `.card-flat` used to mean "the card, minus the shadow". Every
   card is flat now, so it is a no-op kept for existing markup. */
.card-flat { }
.card-flat:hover { border-color: var(--line); }

.card-soft {
  background: var(--bg-soft);
  border: var(--stroke-2) solid var(--line);
  border-radius: var(--r-card);
  padding: 26px;
}
.card-moss   { background: var(--moss); color: var(--ink-fixed); border-color: transparent; }
.card-forest { background: var(--leaf); color: var(--paper-fixed); border-color: transparent; }
.card-moss:hover,
.card-forest:hover { border-color: transparent; }
.card-forest .muted,
.card-forest .eyebrow { color: rgba(252,250,247,.74); }
/* Moss is a light surface in BOTH themes, so its secondary type is fixed Ink
   at reduced opacity — `--muted` would invert underneath it in dark mode. */
.card-moss .muted,
.card-moss .eyebrow { color: rgba(21,23,20,.62); }

.panel {
  background: var(--paper);
  border: var(--stroke-2) solid var(--line);
  border-radius: var(--r-card);
}

.divider { height: 1px; background: var(--line); border: 0; }
/* Was an Ink rule at 1.5px. It is the emphatic divider now, which
   means one step darker on the same hairline scale — not Ink. */
.divider-ink { height: 1px; background: var(--line-strong); border: 0; }

/* ============================================================
   5 · INPUTS + FORM CONTROLS
   Hairline border. Focus is drawn with `outline`, never with a
   shadow — BRAND.md §3.
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 7px; }

.input, .select, .textarea {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--r-base);
  border: var(--stroke-2) solid var(--edge-strong);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  outline: none;
  transition: border-color var(--t-lift) var(--ease), background-color var(--t-lift) var(--ease);
}
.input:hover:not(:disabled),
.select:hover:not(:disabled),
.textarea:hover:not(:disabled) { border-color: var(--muted-soft); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--ink);
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-soft); }
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--bg-elev);
  color: var(--muted);
  border-color: var(--line);
  cursor: not-allowed;
}
/* `--bg-elev` is Forest in dark mode, which is right for a raised Rally
   surface and wrong for "switched off" — a disabled field would read as a
   green highlight. One step off the page instead. */
[data-theme="dark"] .input:disabled,
[data-theme="dark"] .select:disabled,
[data-theme="dark"] .textarea:disabled { background: var(--bg-soft); }
.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus,
.select[aria-invalid="true"]:focus,
.textarea[aria-invalid="true"]:focus { outline-color: var(--danger); border-color: var(--danger); }
.field-error { font-size: var(--fs-sm); font-weight: 600; color: var(--danger); }
.hint { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.textarea { min-height: 84px; resize: vertical; }
.select {
  appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 19px) calc(50% + 1px), calc(100% - 13px) calc(50% + 1px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* Form-level error slot on /login and /signup. `.is-loud` is used for the
   things a visitor cannot fix by retyping — rate limits and server
   misconfiguration — so they are not skimmed past as another field hint. It
   earns its emphasis from weight and border tone, not from a shadow. */
.form-alert:empty { display: none; }
.form-alert.is-on {
  display: block;
  padding: 14px 16px;
  border-radius: var(--r-base);
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
  color: var(--ink);
  font-size: var(--fs-body);
  line-height: 1.45;
}
.form-alert.is-on a { color: inherit; text-decoration: underline; }
.form-alert.is-loud {
  border-color: var(--danger);
  font-weight: 700;
}
[data-theme="dark"] .form-alert.is-on { color: #F3C6BC; }

/* hex colour input pairing (onboarding brand step) */
.hex-row { display: flex; align-items: center; gap: 10px; }
.hex-swatch {
  width: 46px; height: 46px;
  border-radius: var(--r-base);
  border: 1px solid var(--line-strong);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  flex: none;
  background: none;
  transition: border-color var(--t-lift) var(--ease);
}
/* Same hover step as the `.input` it sits next to in `.hex-row`.
   Ink here would be a selected state on a control that is never
   selected. */
.hex-swatch:hover { border-color: var(--muted-soft); }
.hex-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.hex-swatch::-webkit-color-swatch { border: none; border-radius: 0; }
.hex-swatch::-moz-color-swatch { border: none; }
.hex-input { font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; }

/* toggle — track goes LIME when on, which is an approved use of it.
   The "on" state is a FILL change, which is exactly what §3 asks
   for in place of a heavy selected border. */
.toggle { position: relative; display: inline-block; width: 46px; height: 27px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--faint);
  border: var(--stroke-2) solid var(--edge-strong);
  border-radius: var(--r-pill);
  transition: background-color var(--t-2) var(--ease), border-color var(--t-2) var(--ease);
}
.toggle-track::before {
  content: ''; position: absolute;
  height: 19px; width: 19px;
  inset-inline-start: 2.5px; top: 2.5px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  /* Spring, because the knob is the one element on screen whose
     entire job is to say "yes, that registered". 200ms with a
     small overshoot; the track colour crossfades underneath it
     on the same clock so the two read as one gesture. */
  transition: transform var(--t-2) var(--ease-spring),
              border-color var(--t-2) var(--ease);
}
.toggle input:checked + .toggle-track { background: var(--acid); border-color: var(--acid); }
/* Logical: in RTL the knob travels the other way. `translateX` on
   an `inset-inline-start` element already flips under `dir=rtl`
   for the offset but not for the sign, so the sign is flipped
   explicitly in §15. */
.toggle input:checked + .toggle-track::before { transform: translateX(19px); border-color: rgba(21,23,20,.22); }
.toggle input:active + .toggle-track::before { width: 23px; border-radius: var(--r-pill); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--ink); outline-offset: 3px; }
.toggle input:disabled + .toggle-track { opacity: .5; cursor: not-allowed; }

/* ============================================================
   6 · CHIPS · PILLS · TAGS
   Quieter than v2: a soft fill, a hairline, and the square brand
   dot. The status variants keep a distinct hue each — that is
   what makes them scannable — but the hue now lives in the FILL,
   with no stroke around it at all.
   ============================================================ */
.pill {
  --dot: var(--acid);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: var(--fs-label);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--dot);
  flex: none;
}
.pill-nodot::before { display: none; }
.pill-dark   { background: var(--ink);  color: var(--paper); border-color: var(--ink); }
.pill-line   { background: transparent; border-color: var(--line-strong); }
.pill-moss   { background: var(--moss); color: var(--ink-fixed); border-color: transparent; --dot: var(--leaf); }
.pill-forest { background: var(--leaf); color: var(--paper-fixed); border-color: transparent; }
.pill-lime   { background: var(--acid); color: var(--ink-fixed); border-color: transparent; --dot: var(--leaf); }

/* `.tag` / `.badge` — the smaller, quieter sibling used inline in
   tables and cards. Same language, no dot, tighter box. */
.tag, .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink);
  font-size: var(--fs-tiny);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  white-space: nowrap;
}
.tag-lime, .badge-lime { background: var(--acid); color: var(--ink-fixed); border-color: transparent; }
.tag-moss, .badge-moss { background: var(--moss); color: var(--ink-fixed); border-color: transparent; }

/* Booking-status pills. Each state keeps its own hue so a glance
   still separates them; the surface is paper-weight and there is
   no stroke. Confirmed is Moss — the one status that gets the
   brand's own highlight surface, because it is the happy path. */
.pill[data-status] { border-color: transparent; }
.pill[data-status="pending"]   { --dot:#B08419; color:#6B5210; background:#FBF2DC; }
.pill[data-status="confirmed"] { --dot:#2E4C38; color:#22381F; background:var(--moss); }
.pill[data-status="completed"] { --dot:#2E4C38; color:#22402F; background:#DCE8DF; }
.pill[data-status="cancelled"] { --dot:#A5342A; color:#8B2A20; background:#F8E5E0; }
.pill[data-status="no_show"]   { --dot:var(--sage); color:var(--muted); background:var(--bg-elev); }
[data-theme="dark"] .pill[data-status="pending"]   { color:#E6C878; background:#2D2410; }
[data-theme="dark"] .pill[data-status="confirmed"] { color:#DCEC9C; background:#22351F; }
[data-theme="dark"] .pill[data-status="completed"] { color:#BFD9C6; background:#1C2C22; }
[data-theme="dark"] .pill[data-status="cancelled"] { color:#EFA79A; background:#2E1512; }
[data-theme="dark"] .pill[data-status="no_show"]   { color:var(--muted); background:var(--bg-soft); }

/* the free-standing dot, used in nav/status lines */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--acid);
  display: inline-block;
  flex: none;
}
.dot-round { border-radius: 50%; }
.dot-ink { background: var(--ink); }
/* A live-status indicator, not decoration — it is kept, but it is
   a single hairline ring rather than a 1.5px one. */
.dot-pulse { position: relative; }
.dot-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 3px;
  border: 1px solid var(--acid);
  animation: ring 1.8s var(--ease) infinite;
}
@keyframes ring {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ============================================================
   7 · THE RALLY MARK
   `rally` + a SQUARE LIME DOT. The dot is the signature; it never
   disappears. On a lime surface it flips to Forest.
   JS equivalent: assets/brand.js → rallyWordmark().
   ============================================================ */
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.11em;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.045em;
  text-transform: lowercase;
  color: var(--ink);
  /* clearspace: a margin equal to the height of the "r" (~0.5em) */
  padding: 0.5em 0;
}
.brand::after {
  content: '';
  width: 0.24em;
  height: 0.24em;
  background: var(--acid);
  display: inline-block;
  flex: none;
}
.brand-on-lime { color: var(--ink-fixed); }
.brand-on-lime::after { background: var(--leaf); }
.brand-on-forest { color: var(--paper-fixed); }

/* The JS-rendered twin (assets/brand.js → rallyWordmark). Identical
   proportions, but the dot is a real element so the mark survives
   in contexts that never loaded this file. Do not give it an
   ::after — it would draw a second dot. */
.rally-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.14em;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  text-transform: lowercase;
}
.rally-wordmark .rally-dot { flex: none; }

/* The app icon motif — Ink rounded square, lime dot. Matches
   scripts/generate-icons.mjs, which draws the PNGs. No border:
   the Ink fill is its own edge. */
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--ink);
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
}
.brand-mark::after {
  content: '';
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--acid);
}

/* ============================================================
   8 · STATE / FEEDBACK
   ============================================================ */
/* `--faint` rather than `--bg-elev` for the highlight: `--bg-elev` is Forest
   in dark mode, and a loading placeholder should never read as brand green. */
.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--faint) 50%, var(--bg-soft) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--r-base);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Whitespace is what makes an empty state read as deliberate
   rather than as a failure, so it gets more of it than it used
   to, not a box around it. */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
}
.empty-state svg { width: 28px; height: 28px; opacity: .45; margin-bottom: 14px; }
.empty-state .h-3, .empty-state .h-2 { color: var(--ink); }
.empty-state .icon-chip { margin: 0 auto 16px; }

/* toasts — a flat Ink block. No shadow; it sits above the page on
   z-index alone, which is what z-index is for. */
.toast-host {
  position: fixed; z-index: 9999;
  bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 14px 17px;
  border: 1px solid var(--ink);
  border-radius: var(--r-base);
  font-size: var(--fs-body);
  font-weight: 700;
  animation: toast-in .24s var(--ease) both;
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
}
/* Fixed hexes, not `--danger`: an error toast is a filled block, and the dark
   theme's danger tone is a light salmon meant for TYPE. Inverting the fill
   would put pale text on a pale surface. */
.toast[data-kind="error"]   { background: #9E3125; color: #FFF6F3; border-color: #9E3125; }
.toast[data-kind="success"] { background: var(--acid); color: var(--ink-fixed); border-color: var(--acid); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* A modal / sheet scrim is the ONE overlay this system allows
   (BRAND.md §3). It is a background on a backdrop element, not a
   shadow on a component — which is why it is not a violation. */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(21, 23, 20, .42);
  z-index: 80;
}

/* ============================================================
   9 · THE OLD GRAPHIC LANGUAGE — INERT NO-OPS
   ------------------------------------------------------------
   BRAND.md §4 removed every one of these. The class names stay
   DEFINED, and deliberately empty, for one reason: pages still
   carry the markup, and four follow-up passes will strip it. An
   undefined class is not an error, but a half-removed rule is —
   so each name below is pinned to a harmless, plain rendering
   here rather than left to chance.

   Do not put styles back into this section. If you want texture,
   the answer is whitespace. See BRAND.md §4.
   ============================================================ */

/* Paper grid texture — removed (§4). `position: relative` is
   KEPT because containers using this class also position children
   against it; only the painted ::before is gone. */
.paper-grid { position: relative; }
.paper-grid::before { content: none; }
.paper-grid-inverse { position: relative; }
.paper-grid-inverse::before { content: none; }

/* Dashed connector paths — removed (§4). These sit on an SVG
   <path>/<line>/<circle>; the plain rendering of a decorative
   connector is no connector, so the stroke and fill are simply
   off. The element stays in the flow and paints nothing. */
.dashed-path { fill: none; stroke: none; }
.dashed-path.is-lime,
.dashed-path.is-ink { stroke: none; }
.dashed-crawl { animation: none; }

/* `.dashed-rule` is the one of these that was doing real work: it
   is a divider, and pages rely on the line being there. It
   degrades to a plain hairline rule rather than to nothing. */
.dashed-rule {
  height: 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Stroked / outline numerals — removed (§4). Numerals set
   normally: solid, ExtraBold, display tracking. */
.outline-type {
  color: inherit;
  -webkit-text-stroke: 0;
  font-weight: 800;
  letter-spacing: -0.045em;
}

/* Marquee strip — removed (§4). The markup contract duplicated
   the item group for a seamless loop, so rendering it "plain"
   would print every phrase twice across a Forest band. The plain
   result of a removed decorative strip is nothing at all, so the
   band does not render. The child classes stay defined and empty
   so nothing inherits a stray rule. */
.marquee { display: none; }
.marquee-track { }
.marquee-group { }
.marquee-item { }

/* Ambient float / spin loops — removed (§4). */
.anim-float { animation: none; }
.anim-float-alt { animation: none; }
.anim-spin-slow { animation: none; }

/* Hover lift — removed (§3, §6). Kept as a name so existing
   markup keeps working; it now does nothing at all, because
   hover state on those elements comes from their own component
   rule. There is deliberately no `:hover` rule here — an empty
   class has nothing to neutralise, and `transform` inside a
   `:hover` is the exact pattern §6 bans. */
.hover-lift { }

/* Icon chips were an 86px stroked-and-shadowed square (§4).
   Reinterpreted, not deleted: icons now sit at their natural
   size in a small, plain, borderless holder. The tinted variants
   survive because a soft fill is not decoration — it is how an
   icon reads as "on Forest" or "on Moss". */
.icon-chip {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
}
.icon-chip svg { width: 24px; height: 24px; }
.icon-chip.is-lime   { background: var(--acid); color: var(--ink-fixed); }
.icon-chip.is-moss   { background: var(--moss); color: var(--ink-fixed); }
.icon-chip.is-forest { background: var(--leaf); color: var(--paper-fixed); }
.icon-chip.is-ink    { background: var(--ink);  color: var(--paper); }
.icon-chip-sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-chip-sm svg { width: 18px; height: 18px; }

/* ============================================================
   10 · MOTION  (BRAND.md §6)
   ============================================================ */

/* Reveal — v4: a fade plus 10px of rise, once.
   CONTRACT (unchanged, landing.js depends on it): the page module
   sets `data-reveal-armed` on <html> — so a no-JS visitor never
   gets invisible content — and adds `.is-in` when the element
   intersects. This file only paints.

   v3 was opacity-only on the grounds that a slide is decoration.
   10px is not a slide; it is the difference between content that
   *appears* and content that *arrives*, and at this distance it
   is below the threshold at which the eye reads it as movement
   at all — you notice its absence, not its presence. Anything
   larger is the thing §6 was right to ban.

   Direction is opt-in per element, and `--reveal-rise` is the
   only distance any of them may use. */
[data-reveal-armed] .reveal {
  opacity: 0;
  transform: translate3d(0, var(--reveal-rise), 0);
}
[data-reveal-armed] .reveal.is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--t-reveal) var(--ease-out),
    transform var(--t-3) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
/* Directional variants. `.reveal-in` uses the inline axis so it
   mirrors correctly under `dir="rtl"` without a second rule. */
[data-reveal-armed] .reveal-none  { transform: none; }
[data-reveal-armed] .reveal-in    { transform: translate3d(calc(var(--reveal-rise) * -1.6), 0, 0); }
[data-reveal-armed] .reveal-scale { transform: scale(0.985); }
[data-reveal-armed] .reveal-in.is-in,
[data-reveal-armed] .reveal-scale.is-in { transform: none; }
[dir="rtl"][data-reveal-armed] .reveal-in { transform: translate3d(calc(var(--reveal-rise) * 1.6), 0, 0); }

/* Stagger. The page module writes `--reveal-delay` per child (see
   assets/motion.js → `stagger()`); these classes are the ceiling
   so no author can hand-roll a 900ms cascade. Six steps of 45ms
   is 225ms of total spread — under the reveal's own duration, so
   the group still lands as a group. */
.stagger > * { --reveal-delay: 0ms; }
.stagger > *:nth-child(1) { --reveal-delay: 0ms; }
.stagger > *:nth-child(2) { --reveal-delay: 45ms; }
.stagger > *:nth-child(3) { --reveal-delay: 90ms; }
.stagger > *:nth-child(4) { --reveal-delay: 135ms; }
.stagger > *:nth-child(5) { --reveal-delay: 180ms; }
.stagger > *:nth-child(n+6) { --reveal-delay: 225ms; }

/* legacy entrance, kept — several pages still call for it. */
@keyframes fadeUp {
  from { opacity: 0; transform: translate3d(0, var(--reveal-rise), 0); }
  to   { opacity: 1; transform: none; }
}
.fade-up { animation: fadeUp var(--t-3) var(--ease-out) both; }

/* ============================================================
   11 · LAYOUT UTILITIES
   ============================================================ */
.row   { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col   { display: flex; flex-direction: column; }
.grow  { flex: 1 1 auto; min-width: 0; }
.wrap  { flex-wrap: wrap; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.grid  { display: grid; gap: 16px; }
.hidden { display: none !important; }
.sr-only {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
.container { width: min(1180px, calc(100vw - 40px)); margin-inline: auto; }
.truncate { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* focus is visible everywhere, on Ink, not on the tenant colour.
   An outline, never a ring drawn with box-shadow. */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sage); border-radius: var(--r-pill); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--leaf); }

/* PWA: respect the iOS home-screen safe area */
.safe-bottom { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.safe-top    { padding-top: max(0px, env(safe-area-inset-top)); }

/* ============================================================
   12 · REDUCED MOTION
   Nothing above may rely on animation to become visible; the
   reveal rule below is what guarantees that.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal-armed] .reveal { opacity: 1; }
}

/* ============================================================
   13 · BRAND LAYER · per-tenant white-label tokens
   ------------------------------------------------------------
   THE TENANT BOUNDARY (BRAND.md §9). These are the ONLY colours a
   club controls, and they are the ONLY colours that appear on
   book.html / embed.html / confirm.html. Those pages inherit this
   system's STRUCTURE — Plus Jakarta Sans, the radius scale, the
   hairline border, the flat surfaces, the motion curve — and none
   of its colour. A club that picked navy and orange gets navy and
   orange, on Paper, with Ink type.

   Conversely: Rally's own pages must not paint themselves with
   `--brand`. `.btn-brand` is the one deliberate crossover and it
   resolves to LIME on Rally surfaces, because the defaults set by
   theme.js make `--brand` lime anyway.

   Set at runtime by assets/theme.js → applyBrand().
   ============================================================ */
:root {
  --brand:            #9DB90B;   /* tenant primary  (hex from onboarding) */
  --brand-accent:     #2E4C38;   /* tenant accent   (hex from onboarding) */
  --brand-ink:        #151714;   /* auto-computed readable text ON brand  */
  --brand-accent-ink: #FCFAF7;
  --brand-soft:       rgba(157,185,11,.14);
  --brand-line:       rgba(157,185,11,.42);
  --brand-glow:       rgba(157,185,11,.28);
}

/* ------------------------------------------------------------
   13b · THE CHROME LAYER — the owner's colour on the owner's app
   ------------------------------------------------------------
   NEW IN v4, AND IT IS A DELIBERATE MOVE OF THE §9 BOUNDARY.

   v3 said: Rally owns the dashboard chrome (sidebar, active
   states, primary buttons); the club owns only its data and its
   public booking page. In practice that produced a club owner
   staring at a Forest sidebar all day that had nothing to do with
   the brand they had just spent an onboarding step choosing.

   v4 splits the difference along OWNERSHIP rather than along
   SURFACE:

     · Rally's *marketing and platform* surfaces — landing, auth,
       onboarding, the platform-admin console — stay Paper /
       Forest / Ink / Lime. Those are Rally talking.
     · The *owner's* dashboard is the owner's product. Its chrome
       takes the owner's own pair. Rally's wordmark comes off the
       sidebar entirely once a club has branded itself; what the
       owner sees at the top-left is their own club.

   The eight tokens below are what makes that possible without a
   single page branching on "has the club got colours yet". They
   are computed once, in JS, by `applyChrome()` in assets/theme.js
   — which is also where the maths lives for the dark-mode
   variants, because deriving a readable dark surface from an
   arbitrary owner hex is real colour work, not a CSS filter.

   With no owner brand the defaults below resolve to EXACTLY the
   v3 Forest sidebar. A Rally-branded club and an unbranded club
   are pixel-identical. That is the compatibility contract.
   ------------------------------------------------------------ */
:root {
  --chrome-bg:         #2E4C38;              /* the sidebar plane          */
  --chrome-bg-2:       #35573F;              /* one step up: hover, tiles  */
  --chrome-bg-3:       #3D6349;              /* two steps: pressed         */
  --chrome-ink:        #FCFAF7;              /* type on the plane          */
  --chrome-ink-dim:    rgba(252,250,247,.72);
  --chrome-line:       rgba(252,250,247,.16);
  --chrome-active-bg:  #151714;              /* the selected nav item      */
  --chrome-active-ink: #FCFAF7;
  --chrome-marker:     #9DB90B;              /* the 7px square beside it   */
  /* The marker's twin, guaranteed against the PLANE rather than against the
     selected chip — badges, the sidebar avatar, a club monogram. Two surfaces,
     two contrast problems; solving only the first is how a green badge ends up
     invisible on a green sidebar. See applyChrome() for the full reasoning. */
  --chrome-badge:      #9DB90B;
  --chrome-badge-ink:  #151714;
  --chrome-scrim:      rgba(21,23,20,.42);
}

/* Painted from the chrome tokens rather than from `--leaf`, so a
   branded club moves the whole plane in one assignment. Any page
   that wants "the app's own dark plane" uses these three classes
   and never touches the tokens directly. */
.chrome-bg   { background: var(--chrome-bg);   color: var(--chrome-ink); }
.chrome-bg-2 { background: var(--chrome-bg-2); color: var(--chrome-ink); }
.chrome-line-b { border-color: var(--chrome-line); }

.brand-bg      { background: var(--brand); color: var(--brand-ink); }
.brand-fg      { color: var(--brand); }
.brand-border  { border-color: var(--brand-line); }
.accent-bg     { background: var(--brand-accent); color: var(--brand-accent-ink); }
.accent-fg     { color: var(--brand-accent); }
.brand-soft-bg { background: var(--brand-soft); }

/* Tenant-surface primary button. On Rally's own pages `--brand`
   is Lime and `--brand-ink` is Ink, so this resolves to exactly
   the spec'd primary CTA; on a booking page it resolves to the
   club's colour. One class, both worlds, no branching.

   It is the one strong colour moment in the system and it keeps
   that — flat fill, no border, no shadow. Hover darkens the fill
   slightly; `filter` rather than a second hex, because the hex is
   the club's and unknown at author time. */
.btn-brand {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}
.btn-brand:hover { background: var(--brand); filter: brightness(0.94); }
.btn-brand:active { filter: brightness(0.88); }
.btn-brand:disabled, .btn-brand[aria-disabled="true"] { filter: none; }

.btn-brand-soft {
  background: var(--brand-soft);
  color: var(--ink);
  border-color: var(--brand-line);
}
.btn-brand-soft:hover { background: var(--brand-soft); border-color: var(--brand); }

.ring-brand:focus-visible,
.focus-brand:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* tenant logo lockup — rendered by theme.js → renderLockup() */
.brand-lockup { display: inline-flex; align-items: center; gap: 11px; }
.brand-logo {
  width: 34px; height: 34px;
  border-radius: 11px;
  object-fit: cover;
  background: var(--brand);
  border: 1px solid var(--line);
  flex: none;
}
.brand-logo-fallback {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: var(--brand);
  color: var(--brand-ink);
  border: 1px solid transparent;
  display: grid; place-items: center;
  font-weight: 800; font-size: var(--fs-md); letter-spacing: -0.03em;
  flex: none;
}
.brand-name { font-weight: 800; letter-spacing: -0.03em; font-size: 16px; }

/* "Powered by Rally" — the whole of Rally's presence on a tenant
   page (§9). One line, one lime dot, nothing else. */
.powered-by {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--muted);
}
.powered-by::after {
  content: '';
  width: 6px; height: 6px; border-radius: 1px;
  background: var(--acid);
}

/* ============================================================
   14 · THE MOTION LIBRARY  (BRAND.md §6, v4)
   ------------------------------------------------------------
   v3 removed the graphic toolkit and, with it, every ambient
   loop — correctly, because what existed was decoration bolted
   onto a static layout. v4 puts motion back on a much narrower
   footing:

     A LOOP IS ONLY ALLOWED INSIDE AN ILLUSTRATION.

   That is the rule that keeps this from becoming §4 again. A
   drifting card is decoration. A ball tracing the rally path
   inside an SVG diagram *of a rally* is the illustration doing
   its job — it is showing you the thing it depicts. So every
   class in this section is scoped to `[data-illo]` or to a
   component that is itself a picture. Nothing here may be put
   on a card, a section, a nav item or a button.

   Everything below is `will-change`-free on purpose: these run
   on compositor-friendly properties (transform, opacity,
   stroke-dashoffset) and a permanent `will-change` on a page
   with a dozen illustrations costs more than it saves.

   Every loop takes one of the three `--loop-*` periods so two
   illustrations on the same screen never almost-agree.
   ============================================================ */

/* ── Entrances ─────────────────────────────────────────────── */
@keyframes rally-pop {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: none; }
}
@keyframes rally-rise {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes rally-sheet-up {
  from { transform: translate3d(0, 14px, 0); opacity: .6; }
  to   { transform: none; opacity: 1; }
}
@keyframes rally-scrim-in { from { opacity: 0; } to { opacity: 1; } }

.anim-pop   { animation: rally-pop   var(--t-3) var(--ease-spring) both; }
.anim-rise  { animation: rally-rise  var(--t-3) var(--ease-out) both; }
.anim-scrim { animation: rally-scrim-in var(--t-2) var(--ease) both; }
.anim-sheet { animation: rally-sheet-up var(--t-3) var(--ease-out) both; }

/* ── Loops — illustration-only ─────────────────────────────── */

/* Line drawing. The element must carry a `pathLength="100"` so
   the dash maths is resolution-independent; see
   assets/illustrations.js, which sets it on every stroked path
   it emits. */
@keyframes rally-draw {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}
/* A dash that crawls along a path — a ball's trail, a data flow.
   NOT the v2 "dashed connector" decoration, which was a static
   dashed border pretending to be a diagram. */
@keyframes rally-crawl { to { stroke-dashoffset: -100; } }

/* The smallest possible ambient motion: a few pixels, very slow.
   Used for the objects *inside* a scene (a ball at rest, a card
   in an exploded diagram) so the scene does not read as a
   screenshot. */
@keyframes rally-bob {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -4px, 0); }
}
@keyframes rally-drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  33%      { transform: translate3d(3px, -3px, 0); }
  66%      { transform: translate3d(-2px, 2px, 0); }
}
@keyframes rally-breathe {
  0%, 100% { opacity: .35; transform: scale(1); }
  50%      { opacity: .8;  transform: scale(1.04); }
}
@keyframes rally-orbit { to { transform: rotate(360deg); } }
/* A value landing — used by the counter in assets/motion.js when
   it finishes, and by any tile whose number just changed. */
@keyframes rally-tick {
  0%   { transform: translate3d(0, 40%, 0); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

[data-illo] .illo-draw {
  stroke-dasharray: 100;
  animation: rally-draw var(--loop-med) var(--ease-in-out) infinite;
}
[data-illo] .illo-crawl {
  stroke-dasharray: 5 7;
  animation: rally-crawl var(--loop-fast) linear infinite;
}
[data-illo] .illo-bob     { animation: rally-bob     var(--loop-med)  var(--ease-in-out) infinite; }
[data-illo] .illo-drift   { animation: rally-drift   var(--loop-slow) var(--ease-in-out) infinite; }
[data-illo] .illo-breathe { animation: rally-breathe var(--loop-med)  var(--ease-in-out) infinite; }
[data-illo] .illo-orbit   { animation: rally-orbit   var(--loop-slow) linear infinite; transform-origin: center; }

/* Offset each sibling so a row of identical parts never pulses in
   unison — unison reads as a strobe, offset reads as alive. */
[data-illo] .illo-seq > *:nth-child(1) { animation-delay: 0ms; }
[data-illo] .illo-seq > *:nth-child(2) { animation-delay: 160ms; }
[data-illo] .illo-seq > *:nth-child(3) { animation-delay: 320ms; }
[data-illo] .illo-seq > *:nth-child(4) { animation-delay: 480ms; }
[data-illo] .illo-seq > *:nth-child(5) { animation-delay: 640ms; }
[data-illo] .illo-seq > *:nth-child(n+6) { animation-delay: 800ms; }

/* An illustration that only runs while it is on screen. motion.js
   adds `.is-live` via IntersectionObserver; off-screen loops are
   the single biggest battery cost on a long marketing page. */
[data-illo]:not(.is-live) * { animation-play-state: paused; }

/* ── Interaction primitives ────────────────────────────────── */

/* `.press` generalises the button's tap acknowledgement to any
   element that is genuinely a control — a nav item, a swatch, a
   slot. Same 2%, same 120ms, same rule: press only, never hover. */
.press { transition: transform var(--t-1) var(--ease-out); }
.press:active:not([aria-disabled="true"]):not(:disabled) { transform: scale(0.98); }

/* The link underline. Lime, growing from the leading edge — an
   approved decorative use of Lime (§1: underlines) and the one
   place the accent is allowed to move. Uses `inset-inline-start`
   and `transform-origin: left` flipped in §15 for RTL. */
.link-grow {
  position: relative;
  text-decoration: none;
}
.link-grow::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: -2px;
  height: 2px;
  background: var(--acid);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--t-2) var(--ease-out);
}
.link-grow:hover::after,
.link-grow:focus-visible::after { transform: scaleX(1); }

/* An accordion that animates its own height without JS measuring
   it. `grid-template-rows: 0fr → 1fr` is the only technique that
   does this correctly for content of unknown height. The child
   MUST have `overflow: hidden` or the collapsed state leaks. */
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-3) var(--ease-in-out); }
.collapse > * { overflow: hidden; min-height: 0; }
.collapse.is-open { grid-template-rows: 1fr; }

/* Cross-fade between two states occupying the same box (an icon
   swapping, a label switching language). Both children are
   stacked; `.is-out` is the one leaving. */
.swap { display: grid; }
.swap > * { grid-area: 1 / 1; transition: opacity var(--t-2) var(--ease), transform var(--t-2) var(--ease-out); }
.swap > .is-out { opacity: 0; transform: translate3d(0, -6px, 0); pointer-events: none; }
.swap > .is-in  { opacity: 1; transform: none; }

/* Reading-progress rail. Fixed, 2px, lime, width driven by
   `--progress` (0–1) from assets/motion.js. It is the one piece
   of fixed chrome that is allowed to be lime, because it *is* a
   measurement — the accent is carrying meaning, not decoration. */
.scroll-progress {
  position: fixed;
  inset-inline: 0;
  top: 0;
  height: 2px;
  z-index: 100;
  background: var(--acid);
  transform: scaleX(var(--progress, 0));
  transform-origin: left center;
  pointer-events: none;
}

/* Focus, animated. Same Ink outline as §11 — it just arrives
   rather than snapping, which makes keyboard traversal legible
   at speed. `outline-offset` is animatable; `outline` is not, so
   the offset is what carries it. */
:focus-visible { transition: outline-offset var(--t-1) var(--ease-out); }

/* A tile whose value just changed. One 320ms tint, no repeat —
   applied and removed by assets/motion.js → `flash()`. */
@keyframes rally-flash {
  0%   { background-color: var(--brand-soft); }
  100% { background-color: transparent; }
}
.is-flash { animation: rally-flash var(--t-4) var(--ease-out) 1; }

/* ============================================================
   15 · SCRIPT + DIRECTION  (Urdu / RTL)
   ------------------------------------------------------------
   Rally ships English and Urdu. Urdu is right-to-left and sets
   in a different family with a taller line box, so BOTH the
   direction and the typography have to move together — which is
   why this is one section and not two.

   THE RULE FOR EVERY FUTURE PAGE: use logical properties.
   `margin-inline-start`, not `margin-left`. `inset-inline`, not
   `left/right`. `text-align: start`, not `left`. A page written
   in logical properties needs ZERO lines in this section; every
   rule below exists because a physical property somewhere could
   not be reached, or because the thing genuinely must not mirror.

   WHAT MUST NOT MIRROR, ever:
     · numerals, times, prices, phone numbers, hex codes
     · the clock and calendar axes (a week still runs Mon→Sun
       left to right in a Pakistani sports club's mental model)
     · logos and the Rally wordmark
     · media controls
   Those get `dir="ltr"` locally. See `.force-ltr` below.
   ============================================================ */

html[lang="ur"] {
  font-family: var(--font-ur);
  line-height: var(--lh-script);
  /* Noto Sans Arabic has a large x-height and no useful negative tracking;
     the display tracking that makes Plus Jakarta Sans sing makes
     Urdu illegible. Reset it at the root and let §2's classes be
     overridden below. */
  letter-spacing: normal;
  /* Arabic script at 15px is smaller to the eye than Latin at 15px. One
     step up across the board rather than per-component. */
  font-size: 16px;

  /* THE WHOLE SMALL-TEXT SCALE MOVES UP 1.5px. This is why §1
     defines those six steps as tokens at all: 385 font-size
     declarations across nine files now resolve through them, so
     Urdu gets a legible size everywhere from six lines here
     rather than from 385 overrides that would drift apart within
     a month.

     +1.5px rather than a percentage because the band is only
     3.5px wide — a ratio would move the top of it three times as
     far as the bottom, and it is the BOTTOM that needs the help.
     The floor rises to 12.5px, which is about where Arabic script stops
     losing its dots at normal viewing distance. */
  --fs-micro: 12.5px;
  --fs-tiny:  13px;
  --fs-label: 13.5px;
  --fs-sm:    14px;
  --fs-body:  15px;
  --fs-md:    16px;
}

/* The display face is Latin-only. Urdu headings take the Urdu
   stack at the display face's WEIGHTS — which is what keeps a
   heading reading as a heading when the script changes. */
html[lang="ur"] .h-display,
html[lang="ur"] .h-1,
html[lang="ur"] .h-2,
html[lang="ur"] .h-3,
html[lang="ur"] .eyebrow,
html[lang="ur"] .label,
html[lang="ur"] .overline,
html[lang="ur"] .btn,
html[lang="ur"] th { font-family: var(--font-ur); }

/* …except the wordmark and anything explicitly Latin. A logo does
   not change script (§10). */
html[lang="ur"] .brand,
html[lang="ur"] .rally-wordmark,
html[lang="ur"] .lang-opt[lang="en"] { font-family: var(--font-display); }
html[lang="ur"] .h-display,
html[lang="ur"] .h-1,
html[lang="ur"] .h-2,
html[lang="ur"] .h-3,
html[lang="ur"] .brand,
html[lang="ur"] .rally-wordmark { letter-spacing: normal; }
/* The three heading sizes come down a notch: Urdu glyphs carry
   more visual weight per em, so matched point sizes look shouted. */
html[lang="ur"] .h-display { font-size: clamp(34px, 6vw, 72px); line-height: 1.22; }
html[lang="ur"] .h-1 { font-size: clamp(26px, 3.8vw, 40px); line-height: 1.32; }
html[lang="ur"] .h-2 { font-size: clamp(21px, 2.7vw, 29px); line-height: 1.36; }
html[lang="ur"] .h-3 { font-size: 18px; line-height: 1.42; }
/* +18% tracking on an uppercase Latin label is the brand's
   signature; applied to Urdu it breaks the joins between letters
   and renders the word unreadable. Overlines lose the tracking
   AND the uppercase transform, which does nothing in Urdu anyway. */
html[lang="ur"] .eyebrow,
html[lang="ur"] .label,
html[lang="ur"] .overline,
html[lang="ur"] .pill,
html[lang="ur"] .tag,
html[lang="ur"] .badge {
  letter-spacing: normal;
  /* Urdu has no case. `uppercase` does nothing to it, and leaving
     it on is a tell that the label was never looked at. */
  text-transform: none;
  /* No font-size here — the six tokens above already moved every
     one of these up. A literal would pin them back down. */
}

/* Anything that is a number or a machine string keeps Latin and
   keeps LTR, whatever the page language is. */
html[lang="ur"] .mono,
html[lang="ur"] .code,
html[lang="ur"] .force-ltr,
html[lang="ur"] [data-ltr] {
  font-family: var(--mono);
  direction: ltr;
  unicode-bidi: isolate;
}
.force-ltr { direction: ltr; unicode-bidi: isolate; }

/* `.machine` — a string that is DATA rather than prose: a phone number, an
   IBAN, a slug, a booking reference, a hex code, a figure with a unit.
   `+92 333 5109827` inside an Urdu paragraph renders as `5109827 333 92+`
   under the plain bidi algorithm, because the spaces are neutral characters
   that take the paragraph's direction and reorder the runs around them.

   `plaintext` rather than `.force-ltr`'s `isolate`: it makes the element its
   own bidi paragraph and derives direction from the string's OWN first strong
   character. That is the difference that matters in a table — a right-aligned
   numeric column stays right-aligned in Urdu while its digits stay in order,
   which forcing LTR would undo. */
.machine { unicode-bidi: plaintext; }
/* `.force-ltr-inline` is for a number sitting inside an Urdu
   sentence: it isolates the bidi run without becoming a block. */
.force-ltr-inline { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ── Direction mirroring ───────────────────────────────────── */
[dir="rtl"] .link-grow::after,
[dir="rtl"] .scroll-progress { transform-origin: right center; }

/* The toggle knob travels the other way. */
[dir="rtl"] .toggle input:checked + .toggle-track::before { transform: translateX(-19px); }

/* Directional glyphs. An arrow that means "forward" must point
   the way the reader is going; an arrow that means "north" must
   not. `data-icon` names carrying a direction are listed here
   explicitly rather than mirroring every SVG on the page, which
   would flip logos, ticks and charts too. */
[dir="rtl"] [data-icon="arrow-right"] svg,
[dir="rtl"] [data-icon="arrow-left"] svg,
[dir="rtl"] [data-icon="chevron-right"] svg,
[dir="rtl"] [data-icon="chevron-left"] svg,
[dir="rtl"] .icon-flip svg,
[dir="rtl"] svg.icon-flip { transform: scaleX(-1); }

/* The `.select` arrow is painted with two background gradients
   pinned to the right edge; under RTL the control's text moves
   left and the arrow has to follow. */
[dir="rtl"] .select {
  padding-right: 15px;
  padding-left: 38px;
  background-position: 19px calc(50% + 1px), 13px calc(50% + 1px);
}

/* Scrollbar, safe areas and the toast host are all inline-safe
   already; the toast host uses `left: 50%` + translate, which is
   direction-agnostic. Nothing to do. */

/* ============================================================
   16 · REDUCED MOTION — the override, restated
   ------------------------------------------------------------
   §12 already flattens every duration. It runs BEFORE this file
   grew a motion library, so it is restated here for the two
   things a blanket duration reset does not catch: an infinite
   loop still runs (at 0.01ms per iteration, which is a busy
   loop), and a paused-until-visible illustration never gets its
   frame. Both are killed outright.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  [data-illo] .illo-draw,
  [data-illo] .illo-crawl,
  [data-illo] .illo-bob,
  [data-illo] .illo-drift,
  [data-illo] .illo-breathe,
  [data-illo] .illo-orbit,
  .is-flash {
    animation: none !important;
  }
  /* A drawn line with no animation must be a FINISHED line, not
     an invisible one. */
  [data-illo] .illo-draw { stroke-dashoffset: 0; }
  [data-illo] .illo-crawl { stroke-dasharray: none; }
  [data-illo]:not(.is-live) * { animation-play-state: running; }
  .btn:active, .press:active { transform: none; }
  [data-reveal-armed] .reveal,
  [data-reveal-armed] .reveal-in,
  [data-reveal-armed] .reveal-scale { opacity: 1; transform: none; }
  .collapse { transition: none; }
}

/* ============================================================
   17 · THE LANGUAGE TOGGLE
   ------------------------------------------------------------
   Markup contract: assets/i18n.js → langToggleHTML(). Two
   buttons over one sliding thumb, sized so both states are the
   same width — "EN" and "اردو" are very different lengths, and a
   control that resizes as you use it is the fastest way to make
   a language switch feel like a second-class feature.

   The thumb is the only moving part. It is positioned with
   `inset-inline-start`, so under `dir="rtl"` it starts from the
   other edge with no extra rule; the `is-ur` translate below is
   the one place a sign has to be flipped, because the thumb
   travels toward the second option in reading order either way.
   ============================================================ */
.lang-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  gap: 0;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  border: var(--stroke-2) solid var(--edge-strong);
  flex: none;
  /* Latin, always — the control's own labels are language names,
     and "EN" set in Naskh is not an improvement. */
  font-family: var(--font);
}
.lang-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  inset-inline-start: 3px;
  width: 46px;
  border-radius: var(--r-pill);
  background: var(--ink);
  transition: transform var(--t-2) var(--ease-spring);
  pointer-events: none;
}
.lang-opt {
  position: relative;
  z-index: 1;
  width: 46px;
  /* 38, not 32: with the toggle's 3px padding this makes the whole control 44
     — the touch floor — without a per-page override. The `.is-sm` variant
     below stays under it deliberately; it is for the embed, which is a guest
     inside somebody else's page and must stay small. */
  min-height: 38px;
  padding: 0 4px;
  border: 0;
  background: none;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  transition: color var(--t-2) var(--ease);
}
.lang-opt[lang="ur"] {
  font-family: var(--font-ur);
  font-size: var(--fs-body);
  letter-spacing: normal;
}
.lang-opt[aria-pressed="true"] { color: var(--paper); }
.lang-opt:hover:not([aria-pressed="true"]) { color: var(--ink); }
.lang-opt:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* The thumb follows the pressed button. `:has()` keeps this
   declarative — no JS writes a class for it. */
.lang-toggle:has(.lang-opt[data-lang="ur"][aria-pressed="true"]) .lang-thumb {
  transform: translateX(46px);
}
[dir="rtl"] .lang-toggle:has(.lang-opt[data-lang="ur"][aria-pressed="true"]) .lang-thumb {
  transform: translateX(-46px);
}

.lang-toggle.is-sm { padding: 2px; }
.lang-toggle.is-sm .lang-opt { width: 38px; min-height: 26px; font-size: var(--fs-label); }
.lang-toggle.is-sm .lang-thumb { width: 38px; top: 2px; bottom: 2px; inset-inline-start: 2px; }
.lang-toggle.is-sm:has(.lang-opt[data-lang="ur"][aria-pressed="true"]) .lang-thumb { transform: translateX(38px); }
[dir="rtl"] .lang-toggle.is-sm:has(.lang-opt[data-lang="ur"][aria-pressed="true"]) .lang-thumb { transform: translateX(-38px); }

/* On the dark chrome plane the toggle borrows the plane's own
   tones instead of the page's, so it does not read as a Paper
   chip stamped onto the sidebar. */
.chrome-bg .lang-toggle,
.sidebar .lang-toggle {
  background: var(--chrome-bg-2);
  border-color: var(--chrome-line);
}
.chrome-bg .lang-opt,
.sidebar .lang-opt { color: var(--chrome-ink-dim); }
.chrome-bg .lang-opt[aria-pressed="true"],
.sidebar .lang-opt[aria-pressed="true"] { color: var(--chrome-active-ink); }
.chrome-bg .lang-thumb,
.sidebar .lang-thumb { background: var(--chrome-active-bg); }

/* No `:has()` (Firefox < 121, older WebKit): the thumb cannot
   track, so it is removed and the pressed state is carried by a
   fill on the button itself. Nothing is lost but the animation. */
@supports not selector(:has(*)) {
  .lang-thumb { display: none; }
  .lang-opt[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
  .sidebar .lang-opt[aria-pressed="true"] { background: var(--chrome-active-bg); }
}

/* ── Owner alerts: Connect WhatsApp (dashboard → Alerts, API_CONTRACT §10d) ── */
.wa-form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.wa-code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 24px; letter-spacing: .5em; text-align: center; max-width: 220px; }
.wa-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px; border: var(--stroke-2) solid var(--edge); border-radius: var(--r-card); background: var(--bg-soft, var(--paper)); }
.wa-num { display: flex; align-items: center; gap: 12px; }
.wa-num svg { width: 26px; height: 26px; flex: none; }
.wa-big { font-weight: 800; font-size: 20px; letter-spacing: -.02em; unicode-bidi: isolate; }
.alert-table { margin-top: 18px; border-top: var(--stroke) solid var(--line); }
.alert-row { display: flex; align-items: center; gap: 18px; padding: 12px 0; border-bottom: var(--stroke) solid var(--line); }
.alert-row .ar-label { font-weight: 700; font-size: var(--fs-sm, 14px); }
.alert-row .ch { width: 64px; flex: none; text-align: center; }
.alert-row .toggle { margin: 0 9px; }
.alert-head { padding-top: 10px; padding-bottom: 8px; }
@media (max-width: 560px) { .alert-row { gap: 6px; } .alert-row .ch { width: 56px; letter-spacing: .02em; font-size: 9.5px; } .alert-row .toggle { margin: 0 5px; } }
/* Free WhatsApp connect: two numbered steps (API_CONTRACT §10d-bis) */
.wa-steps { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.wa-step { display: flex; gap: 14px; align-items: flex-start; padding: 16px;
  border: var(--stroke-2) solid var(--edge); border-radius: var(--r-card); background: var(--paper); }
.wa-step-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-weight: 800; font-size: 13px; }
.wa-step .wa-form { max-width: none; }
.seg { display: inline-flex; padding: 3px; border: var(--stroke-2) solid var(--edge); border-radius: var(--r-pill); background: var(--bg-soft, var(--paper)); }
.seg-btn { border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: var(--r-pill); color: var(--muted); cursor: pointer; }
.seg-btn.is-on { background: var(--ink); color: var(--paper); }
.wa-more { margin-top: 10px; font-size: 13px; }
.wa-more summary { cursor: pointer; font-weight: 700; color: var(--muted); }

/* ── App feel on phones & installed apps (assets/app-feel.js) ─────────────── */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
/* iOS zooms into any focused field under 16px — keep them at 16px on touch. */
@media (pointer: coarse) {
  input, select, textarea, .input, .select, .textarea { font-size: max(16px, 1em); }
}
/* Installed (standalone) launches: no text-selection flashes on buttons and
   nav. (Notch / home-indicator padding is already handled per page.) */
.is-standalone .btn, .is-standalone .nav-item, .is-standalone .tab,
.is-standalone .bottom-nav, .is-standalone .side-nav { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* ── Share row (assets/share.js) ─────────────────────────────── */
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.share-row .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; }
.share-row .share-wa { background: #17793F; color: #fff; border-color: #17793F; }
.share-row .share-wa:hover { background: #126434; border-color: #126434; }
.share-row .share-copy.is-done { background: var(--ink); color: var(--paper); }
.share-row.is-compact .btn { flex: 0 1 auto; }
@media (max-width: 420px) { .share-row .btn { flex: 1 1 100%; } }

/* ── Guided tour (assets/tour.js) ─────────────────────────────── */
.tour { position: fixed; inset: 0; z-index: 900; }
.tour-spot {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(10, 14, 10, .58), 0 0 0 2px var(--acid, #C6F432);
  transition: top .28s var(--ease), left .28s var(--ease), width .28s var(--ease), height .28s var(--ease);
}
.tour-card {
  position: fixed; background: var(--paper); color: var(--ink);
  border: var(--stroke-2, 2px) solid var(--ink); border-radius: 18px;
  box-shadow: 6px 6px 0 var(--ink); padding: 18px; outline: none;
  transition: top .28s var(--ease), left .28s var(--ease);
}
.tour-count { font-size: var(--fs-micro); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tour-title { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-md); margin: 6px 0 4px; letter-spacing: -.01em; }
html[lang="ur"] .tour-title { font-family: var(--font-ur); letter-spacing: normal; }
.tour-body { font-size: var(--fs-body); line-height: 1.5; margin: 0 0 14px; color: var(--ink); }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-actions .btn[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card { transition: none; } }

/* ── Setup checklist (dashboard overview) ─────────────────────── */
.setup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.setup-bar { height: 6px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; margin: 12px 0 6px; }
.setup-bar i { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width .5s var(--ease); }
.setup-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.setup-item { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 12px; }
.setup-item + .setup-item { border-top: var(--stroke) solid var(--line); }
.setup-tick {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line-strong); color: transparent;
}
.setup-item[data-done="1"] .setup-tick { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.setup-item[data-done="1"] .setup-label { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.setup-label { font-weight: 700; font-size: var(--fs-body); }
.setup-sub { font-size: var(--fs-label); color: var(--muted); margin-top: 2px; }
.setup-item .btn { flex: none; }
.setup-share { padding: 4px 6px 10px 42px; }
html[dir="rtl"] .setup-share { padding: 4px 42px 10px 6px; }

/* ── "Use this" refine offer for loud brand colours ───────────── */
.refine-offer {
  display: flex; align-items: center; gap: 12px; margin-top: 10px;
  padding: 10px 12px; border-radius: 14px; background: var(--bg-soft);
  font-size: var(--fs-label); color: var(--ink);
}
.refine-chip { position: relative; flex: none; width: 34px; height: 34px; border-radius: 10px; overflow: hidden; }
.refine-chip span { position: absolute; inset: 0; }
.refine-chip span + span { clip-path: polygon(100% 0, 100% 100%, 0 100%); }

/* ── Voice receptionist setting (Settings → Club) ─────────────── */
.voice-set { margin-top: 26px; padding-top: 22px; border-top: var(--stroke) solid var(--line); }
.voice-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.voice-stat { padding: 12px; border-radius: 14px; background: var(--bg-soft); display: grid; gap: 2px; }
.voice-stat b { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.voice-stat span { font-size: var(--fs-label); color: var(--muted); }

.voice-form { margin-top: 18px; display: grid; gap: 14px; }
.voice-form .btn { justify-self: start; }

.setup-opt { margin-inline-start: 6px; padding: 2px 8px; border-radius: 999px; background: var(--bg-soft); color: var(--muted); font-size: var(--fs-micro); font-weight: 600; vertical-align: middle; }

/* QA (Nov 2026): `.btn` sets display, which beats the `hidden` attribute.
   A hidden button must stay hidden wherever it appears. */
.btn[hidden], .chip[hidden], .badge[hidden] { display: none !important; }
