/* FairwayFinda Caddy — shared components.
   Built only from ff-tokens.css. Every class is ff- prefixed; nothing here
   touches an element that has not opted in with an ff- class.

   Conventions
   - One block class per component, parts as .ff-block__part, variants as
     .ff-block--variant. State is never a class: it is [aria-pressed],
     [aria-checked], [aria-current], [aria-busy], [disabled] or [data-state].
   - A parent passes state to its parts through local custom properties
     (--ff-notice-tone, --ff-marker-disc-fill …) so selectors stay one class deep.
   - Solid paper means known or chosen. Hollow dashed means estimated. Dotted
     means unknown. A gold ring outside an ink gap means "this object is selected".
   - No :hover. Press feedback is :active; keyboard focus is the one ring at the
     end of this file.

   Sections: type · button · icon button · chip + segmented · surface · sheet ·
   list row · radio card · score mark · putt ball ·
   stepper · stat tile · notice · veil + block · nav group · marker + connector ·
   ground figure + position · caption · status mark · focus · reduced motion */


/* ---- Shared control reset ------------------------------------------------ */

.ff-button,
.ff-icon-button,
.ff-chip,
.ff-segmented__option,
.ff-list-row,
.ff-radio-card,
.ff-putt-ball,
.ff-nav-group__step,
.ff-nav-group__current,
.ff-notice__action,
.ff-notice__dismiss {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  margin: 0;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--ff-dur-press) var(--ff-ease-state),
    border-color var(--ff-dur-state) var(--ff-ease-state),
    color var(--ff-dur-state) var(--ff-ease-state),
    box-shadow var(--ff-dur-state) var(--ff-ease-state),
    transform var(--ff-dur-press) var(--ff-ease-state);
}


/* ---- Type ---------------------------------------------------------------- */

.ff-eyebrow {
  margin: 0;
  color: var(--ff-text-2);
  font: var(--ff-weight-heavy) var(--ff-size-12) / var(--ff-leading-tight) var(--ff-font-ui);
  letter-spacing: var(--ff-tracking-eyebrow);
  text-transform: uppercase;
}

.ff-numeral {
  font-family: var(--ff-font-display);
  font-weight: var(--ff-weight-display);
  font-variant-numeric: var(--ff-numeric);
  letter-spacing: var(--ff-tracking-heading);
}

.ff-icon {
  width: var(--ff-glyph);
  height: var(--ff-glyph);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* ---- Button --------------------------------------------------------------
   <button class="ff-button ff-button--primary">Play this hole</button>
   Variants: --primary (one per view), --secondary, --quiet.
   Sizes: default 44, --lg 56. --block fills its row.
   States: :active, [disabled] / [aria-disabled="true"], [aria-busy="true"]. */

.ff-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ff-space-8);
  min-width: var(--ff-touch-min);
  min-height: var(--ff-touch-min);
  padding: 0 var(--ff-space-24);
  border: var(--ff-border) solid transparent;
  border-radius: var(--ff-radius-pill);
  background: var(--ff-surface);
  color: var(--ff-paper);
  font: var(--ff-weight-heavy) var(--ff-size-14) / var(--ff-leading-tight) var(--ff-font-ui);
  letter-spacing: var(--ff-tracking-label);
  text-transform: uppercase;
  white-space: nowrap;
}

.ff-button:active { transform: scale(var(--ff-press-scale)); }

.ff-button--primary {
  background: var(--ff-action);
  color: var(--ff-ink);
}
.ff-button--primary:active { background: var(--ff-action-press); }

.ff-button--secondary { border-color: var(--ff-line-control); }
.ff-button--secondary:active { background: var(--ff-surface-raised); }

.ff-button--quiet {
  padding: 0 var(--ff-space-12);
  background: transparent;
  text-decoration: underline;
  text-decoration-color: var(--ff-line-control);
  text-decoration-thickness: var(--ff-border-strong);
  text-underline-offset: var(--ff-space-4);
}
.ff-button--quiet:active { background: var(--ff-surface-raised); }

.ff-button--lg {
  min-height: var(--ff-touch-primary);
  padding: 0 var(--ff-space-32);
  font-size: var(--ff-size-16);
}

.ff-button--block { display: flex; width: 100%; }

/* A label can carry the choice it acts on, in sentence case:
   <button class="ff-button ff-button--primary">Start round<span class="ff-button__detail">Blue 5,890 m</span></button> */
.ff-button__detail {
  min-width: 0;
  overflow: hidden;
  font-weight: var(--ff-weight-strong);
  letter-spacing: var(--ff-tracking-normal);
  text-overflow: ellipsis;
  text-transform: none;
}

.ff-button[disabled],
.ff-button[aria-disabled="true"] {
  border-color: var(--ff-line);
  background: var(--ff-surface);
  color: var(--ff-text-3);
  text-decoration: none;
  cursor: default;
  pointer-events: none;
}

/* Busy keeps the label and adds a spinner in the label colour. */
.ff-button[aria-busy="true"] { pointer-events: none; }
.ff-button[aria-busy="true"]::before {
  content: "";
  box-sizing: border-box;
  width: var(--ff-space-16);
  height: var(--ff-space-16);
  flex: none;
  border: var(--ff-border-strong) solid currentColor;
  border-right-color: transparent;
  border-radius: var(--ff-radius-pill);
  animation: ff-spin var(--ff-dur-spin) linear infinite;
}


/* ---- Icon button ---------------------------------------------------------
   <button class="ff-icon-button" aria-label="Menu"><svg class="ff-icon">…</svg></button>
   Variants: --quiet (no edge), --primary (lime). Size: --lg 56.
   States: [aria-pressed="true"] (toggle on), :active, [disabled]. */

.ff-icon-button {
  display: inline-grid;
  place-items: center;
  width: var(--ff-touch-min);
  height: var(--ff-touch-min);
  flex: none;
  padding: 0;
  border: var(--ff-border) solid var(--ff-line-control);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-surface);
  color: var(--ff-paper);
  font: var(--ff-weight-ui) var(--ff-size-24) / var(--ff-leading-display) var(--ff-font-ui);
}

.ff-icon-button:active {
  background: var(--ff-surface-raised);
  transform: scale(var(--ff-press-scale));
}

.ff-icon-button--lg { width: var(--ff-touch-primary); height: var(--ff-touch-primary); }

.ff-icon-button--quiet { border-color: transparent; background: transparent; }

.ff-icon-button--primary {
  border-color: transparent;
  background: var(--ff-action);
  color: var(--ff-ink);
}
.ff-icon-button--primary:active { background: var(--ff-action-press); }

.ff-icon-button[aria-pressed="true"] {
  border-color: var(--ff-paper);
  background: var(--ff-paper);
  color: var(--ff-ink);
}

.ff-icon-button[disabled],
.ff-icon-button[aria-disabled="true"] {
  border-color: var(--ff-line);
  background: var(--ff-surface);
  color: var(--ff-text-3);
  cursor: default;
  pointer-events: none;
}


/* ---- Chip + Segmented ----------------------------------------------------
   <div class="ff-chip-row"><button class="ff-chip" aria-pressed="true">Fairway</button>…</div>
   <div class="ff-segmented" role="radiogroup">
     <button class="ff-segmented__option" role="radio" aria-checked="true">Metres</button>…
   </div>
   One selected style for both: solid paper, ink text. */

.ff-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ff-touch-gap);
}

.ff-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ff-space-8);
  min-width: var(--ff-touch-min);
  min-height: var(--ff-touch-min);
  padding: 0 var(--ff-space-16);
  border: var(--ff-border) solid var(--ff-line-control);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-surface);
  color: var(--ff-paper);
  font: var(--ff-weight-strong) var(--ff-size-14) / var(--ff-leading-tight) var(--ff-font-ui);
  white-space: nowrap;
}

.ff-chip:active {
  background: var(--ff-surface-raised);
  transform: scale(var(--ff-press-scale));
}

.ff-chip[aria-pressed="true"],
.ff-chip[aria-checked="true"] {
  border-color: var(--ff-paper);
  background: var(--ff-paper);
  color: var(--ff-ink);
}

.ff-chip[disabled],
.ff-chip[aria-disabled="true"] {
  border-color: var(--ff-line);
  color: var(--ff-text-3);
  cursor: default;
  pointer-events: none;
}

.ff-segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: var(--ff-touch-gap);
  box-sizing: border-box;
  padding: var(--ff-space-4);
  border: var(--ff-border) solid var(--ff-line);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-surface);
}

.ff-segmented__option {
  min-width: var(--ff-touch-min);
  min-height: var(--ff-touch-min);
  padding: 0 var(--ff-space-12);
  border: 0;
  border-radius: var(--ff-radius-pill);
  background: transparent;
  color: var(--ff-text-2);
  font: var(--ff-weight-strong) var(--ff-size-14) / var(--ff-leading-tight) var(--ff-font-ui);
  white-space: nowrap;
}

.ff-segmented__option:active { background: var(--ff-surface-raised); }

.ff-segmented__option[aria-checked="true"],
.ff-segmented__option[aria-pressed="true"] {
  background: var(--ff-paper);
  color: var(--ff-ink);
}

.ff-segmented__option[disabled] {
  color: var(--ff-text-3);
  cursor: default;
  pointer-events: none;
}


/* ---- Surface -------------------------------------------------------------
   <section class="ff-surface">…</section>
   Variants: --raised (lifted, e1), --scrim (the only surface allowed over the
   live scene), --flush (no padding). */

.ff-surface {
  box-sizing: border-box;
  padding: var(--ff-space-16);
  border: var(--ff-border) solid var(--ff-line);
  border-radius: var(--ff-radius-16);
  background: var(--ff-surface);
  color: var(--ff-paper);
  font: var(--ff-weight-ui) var(--ff-size-16) / var(--ff-leading-body) var(--ff-font-ui);
}

.ff-surface--raised {
  background: var(--ff-surface-raised);
  box-shadow: var(--ff-e1);
}

.ff-surface--scrim {
  background: var(--ff-scrim);
  -webkit-backdrop-filter: blur(var(--ff-blur));
  backdrop-filter: blur(var(--ff-blur));
}

.ff-surface--flush { padding: 0; }


/* ---- Sheet ---------------------------------------------------------------
   <div class="ff-sheet-scrim" data-state="open"></div>
   <section class="ff-sheet" role="dialog" aria-modal="true" data-state="open">
     <div class="ff-sheet__handle"></div>
     <header class="ff-sheet__header"><h2 class="ff-sheet__title">…</h2>…</header>
     <div class="ff-sheet__body">…</div>
     <footer class="ff-sheet__footer">…</footer>
   </section>
   data-state: "open" | "closed" (default). --inline places a sheet in normal
   flow (documentation and tablet side panels). */

.ff-sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--ff-z-sheet);
  background: var(--ff-backdrop);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--ff-dur-exit) var(--ff-ease-exit),
    visibility 0s linear var(--ff-dur-exit);
}

.ff-sheet-scrim[data-state="open"] {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--ff-dur-enter) var(--ff-ease-enter), visibility 0s;
}

.ff-sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--ff-z-sheet);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--ff-measure);
  max-height: calc(100% - var(--ff-safe-top) - var(--ff-space-48));
  margin: 0 auto;
  padding:
    var(--ff-space-8)
    calc(var(--ff-space-16) + var(--ff-safe-right))
    calc(var(--ff-space-16) + var(--ff-safe-bottom))
    calc(var(--ff-space-16) + var(--ff-safe-left));
  border: var(--ff-border) solid var(--ff-line);
  border-bottom: 0;
  border-radius: var(--ff-radius-24) var(--ff-radius-24) 0 0;
  background: var(--ff-surface);
  box-shadow: var(--ff-e2);
  color: var(--ff-paper);
  font: var(--ff-weight-ui) var(--ff-size-16) / var(--ff-leading-body) var(--ff-font-ui);
  transform: translateY(100%);
  visibility: hidden;
  transition:
    transform var(--ff-dur-exit) var(--ff-ease-exit),
    visibility 0s linear var(--ff-dur-exit);
}

.ff-sheet[data-state="open"] {
  transform: none;
  visibility: visible;
  transition: transform var(--ff-dur-enter) var(--ff-ease-enter), visibility 0s;
}

.ff-sheet--inline {
  position: static;
  max-height: none;
  transform: none;
  visibility: visible;
}

/* The handle is a 24px-tall drag strip; the bar is drawn inside it. */
.ff-sheet__handle {
  display: grid;
  place-items: center;
  flex: none;
  height: var(--ff-space-24);
  touch-action: none;
}
.ff-sheet__handle::before {
  content: "";
  width: var(--ff-handle-width);
  height: var(--ff-handle-height);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-line-control);
}

.ff-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ff-space-12);
  flex: none;
  padding-bottom: var(--ff-space-12);
}

.ff-sheet__title {
  margin: 0;
  color: var(--ff-paper);
  font: var(--ff-weight-display) var(--ff-size-24) / var(--ff-leading-tight) var(--ff-font-display);
  letter-spacing: var(--ff-tracking-heading);
}

/* The body scrolls, so it clips. Its padding (cancelled by the margin) leaves
   room for selection and focus rings on the controls inside. */
.ff-sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 calc(-1 * var(--ff-space-8));
  padding: var(--ff-space-8);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ff-sheet__footer {
  display: grid;
  gap: var(--ff-touch-gap);
  flex: none;
  padding-top: var(--ff-space-16);
}


/* ---- List row ------------------------------------------------------------
   <button class="ff-list-row">
     <span class="ff-list-row__leading">…</span>
     <span class="ff-list-row__body">
       <span class="ff-list-row__title">Mona Vale</span>
       <span class="ff-list-row__meta">18 holes · Par 72</span>
     </span>
     <span class="ff-list-row__trailing">5,810 m</span>
   </button>
   Works as <button>, <a> or a static <div>. Rows draw their own divider. */

.ff-list { display: grid; }

.ff-list-row {
  display: flex;
  align-items: center;
  gap: var(--ff-space-12);
  width: 100%;
  min-height: var(--ff-touch-primary);
  padding: var(--ff-space-8) var(--ff-space-4);
  border: 0;
  border-bottom: var(--ff-border) solid var(--ff-line);
  background: transparent;
  color: var(--ff-paper);
  font: var(--ff-weight-ui) var(--ff-size-16) / var(--ff-leading-tight) var(--ff-font-ui);
  text-align: left;
}

.ff-list-row:active { background: var(--ff-surface-raised); }

.ff-list-row[aria-current="true"] { box-shadow: inset 3px 0 0 var(--ff-gold); }

.ff-list-row[disabled],
.ff-list-row[aria-disabled="true"] {
  color: var(--ff-text-3);
  cursor: default;
  pointer-events: none;
}

.ff-list-row__leading {
  display: grid;
  place-items: center;
  flex: none;
  min-width: var(--ff-glyph);
  margin-left: var(--ff-space-8);
  color: var(--ff-text-2);
}

.ff-list-row__body {
  display: grid;
  gap: var(--ff-space-4);
  flex: 1 1 auto;
  min-width: 0;
}

.ff-list-row__title {
  overflow: hidden;
  font-weight: var(--ff-weight-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ff-list-row__meta {
  color: var(--ff-text-2);
  font-size: var(--ff-size-14);
  font-variant-numeric: var(--ff-numeric);
}

.ff-list-row__trailing {
  flex: none;
  margin-right: var(--ff-space-8);
  color: var(--ff-text-2);
  font: var(--ff-weight-display) var(--ff-size-16) / var(--ff-leading-tight) var(--ff-font-display);
  font-variant-numeric: var(--ff-numeric);
}


/* ---- Search field --------------------------------------------------------
   <div class="ff-search">
     <svg class="ff-icon ff-search__icon" aria-hidden="true">…</svg>
     <input class="ff-search__input" type="search" placeholder="Search courses" aria-label="Search courses">
     <span class="ff-search__clear"><button class="ff-icon-button ff-icon-button--quiet" aria-label="Clear search">×</button></span>   (optional)
   </div>
   The one text entry. The input is the pill, so the focus ring follows its edge.
   16px text so iOS does not zoom the page on focus.
   --plain: a text entry with no glass (a name, an email, a code): the input alone, in the .ff-search box. */

.ff-search {
  position: relative;
  display: block;
}

.ff-search__input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: var(--ff-touch-primary);
  margin: 0;
  padding: 0 var(--ff-space-48);
  border: var(--ff-border) solid var(--ff-line-control);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-surface);
  color: var(--ff-paper);
  font: var(--ff-weight-ui) var(--ff-size-16) / var(--ff-leading-tight) var(--ff-font-ui);
  user-select: text;
  -webkit-user-select: text;
}

.ff-search__input--plain { padding: 0 var(--ff-space-16); }

.ff-search__input::placeholder { color: var(--ff-text-3); }
.ff-search__input::-webkit-search-cancel-button { display: none; }

.ff-search__icon {
  position: absolute;
  top: 50%;
  left: var(--ff-space-16);
  color: var(--ff-text-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.ff-search__clear {
  position: absolute;
  top: 50%;
  right: var(--ff-space-4);
  transform: translateY(-50%);
}


/* ---- Radio card ----------------------------------------------------------
   <div class="ff-radio-group" role="radiogroup" aria-label="Tee">
     <button class="ff-radio-card" role="radio" aria-checked="true">
       <span class="ff-radio-card__swatch" style="--ff-swatch:#1d4ed8"></span>
       <span class="ff-radio-card__title">Blue</span>
       <span class="ff-radio-card__meta">Men · 71.4 / 128</span>
       <span class="ff-radio-card__value">5,810<small class="ff-radio-card__unit">m</small></span>
       <span class="ff-radio-card__note">Tee positions mapped on 14 of 18 holes</span>   (optional)
     </button>…
   </div>
   The note is a caveat about the card and runs the full width under the value.
   --ff-swatch is data (a tee colour), set inline; it is the one sanctioned
   non-token colour and never carries text. */

.ff-radio-group {
  display: grid;
  gap: var(--ff-space-12);
}

.ff-radio-card {
  --ff-block-selection-label: "";
  --ff-block-selection-gap: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: var(--ff-space-12);
  row-gap: var(--ff-space-4);
  width: 100%;
  min-height: var(--ff-touch-primary);
  padding: var(--ff-space-12) var(--ff-space-16);
  border: var(--ff-border) solid var(--ff-line-control);
  border-radius: var(--ff-radius-16);
  background: var(--ff-surface);
  color: var(--ff-paper);
  font: var(--ff-weight-ui) var(--ff-size-16) / var(--ff-leading-tight) var(--ff-font-ui);
  text-align: left;
}

.ff-radio-card:active { background: var(--ff-surface-raised); }

.ff-radio-card[aria-checked="true"] {
  --ff-block-selection-label: "✓ Selected";
  --ff-block-selection-gap: var(--ff-space-8);
  border-color: transparent;
  --ff-focus-under: var(--ff-select-ring-focus);
  --ff-focus-offset-local: var(--ff-focus-offset-selected);
  background: var(--ff-surface-raised);
  box-shadow: var(--ff-select-ring);
}

.ff-radio-card[disabled],
.ff-radio-card[aria-disabled="true"] {
  border-color: var(--ff-line);
  color: var(--ff-text-3);
  cursor: default;
  pointer-events: none;
}

.ff-radio-card__swatch {
  grid-column: 1;
  grid-row: 1 / span 2;
  box-sizing: border-box;
  width: var(--ff-glyph);
  height: var(--ff-glyph);
  border: var(--ff-border-strong) solid var(--ff-paper);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-swatch, var(--ff-text-3));
}

.ff-radio-card__title {
  grid-column: 2;
  font-weight: var(--ff-weight-strong);
}

.ff-radio-card__title::after {
  content: var(--ff-block-selection-label);
  display: inline-block;
  margin-inline-start: var(--ff-block-selection-gap);
  color: var(--ff-paper);
  font: var(--ff-weight-strong) var(--ff-size-14) / var(--ff-leading-tight) var(--ff-font-ui);
}

.ff-radio-card__meta {
  grid-column: 2;
  color: var(--ff-text-2);
  font-size: var(--ff-size-14);
  font-variant-numeric: var(--ff-numeric);
}

.ff-radio-card__note {
  grid-column: 2 / -1;
  grid-row: 3;
  color: var(--ff-text-2);
  font-size: var(--ff-size-14);
  font-variant-numeric: var(--ff-numeric);
}

.ff-radio-card__value {
  grid-column: 3;
  grid-row: 1 / span 2;
  font: var(--ff-weight-display) var(--ff-size-24) / var(--ff-leading-display) var(--ff-font-display);
  font-variant-numeric: var(--ff-numeric);
  letter-spacing: var(--ff-tracking-heading);
}

.ff-radio-card__unit {
  margin-left: var(--ff-space-4);
  color: var(--ff-text-2);
  font: var(--ff-weight-strong) var(--ff-size-14) / var(--ff-leading-display) var(--ff-font-ui);
  letter-spacing: var(--ff-tracking-normal);
}


/* ---- Score mark ----------------------------------------------------------
   The scorecard standard (CLAUDE.md "Design system"): how a hole's score is drawn
   everywhere, the figure inside the mark. Built only by app/src/ui/score-mark.js.
     data-score="eagle"    green disc      eagle or better
     data-score="birdie"   rose disc
     data-score="par"      white disc, black figure (seen on dark ground, lost on white)
     data-score="bogey"    blue tile
     data-score="double"   dark tile with a double rule: double bogey or worse, a pick-up
     data-score="unknown"  the figure alone, quiet (a score without a par)
   <span class="club-mark club-mark--row" data-score="birdie">3</span>
   Size: the base 23 takes the surrounding type; --nine 24 (the nines across),
   --row 30 (a hole to a row, the hole page's list), --tally 30 (the round's tally),
   --band 28 (the hole card's band; 26 and 24 on narrow cards), --top 44 (the hole
   screen's banner). No ring around it and no shape inside it. */

.club-mark {
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  width: var(--ff-mark-xs);
  height: var(--ff-mark-xs);
  color: var(--ff-paper);
  font: inherit;
  border-radius: var(--ff-mark-radius);
}
.club-mark[data-score="par"] { color: var(--ff-scorecard-par-figure); background: var(--ff-scorecard-par); border-radius: 50%; }
.club-mark[data-score="eagle"] { color: var(--ff-scorecard-figure); background: var(--ff-scorecard-eagle); border-radius: 50%; }
.club-mark[data-score="birdie"] { color: var(--ff-scorecard-figure); background: var(--ff-scorecard-birdie); border-radius: 50%; }
.club-mark[data-score="bogey"] { color: var(--ff-scorecard-figure); background: var(--ff-scorecard-bogey); }
.club-mark[data-score="double"] { color: var(--ff-scorecard-figure); background: var(--ff-scorecard-double); border: var(--ff-mark-rule) double var(--ff-scorecard-double-rule); }
.club-mark[data-score="unknown"] { color: var(--ff-text-3); }

.club-mark--tally { width: var(--ff-mark-lg); height: var(--ff-mark-lg); font: var(--ff-weight-ui) var(--ff-mark-figure-14) / var(--ff-leading-display) var(--ff-font-ui); }
.club-mark--band { width: var(--ff-mark-md); height: var(--ff-mark-md); font: var(--ff-weight-ui) var(--ff-mark-figure-15) / var(--ff-leading-display) var(--ff-font-ui); }
.club-mark--top { width: var(--ff-mark-xl); height: var(--ff-mark-xl); font: var(--ff-weight-ui) var(--ff-mark-figure-22) / var(--ff-leading-display) var(--ff-font-ui); }
.club-mark--row { width: var(--ff-mark-lg); height: var(--ff-mark-lg); font-size: var(--ff-mark-figure-16); }
.club-mark--nine { width: var(--ff-mark-cell); height: var(--ff-mark-cell); }
/* The band on a narrow hole card (the card is the container). */
@container (max-width: 330px) {
  .club-mark--band { width: var(--ff-mark-sm); height: var(--ff-mark-sm); font-size: var(--ff-mark-figure-14); }
}
@container (max-width: 300px) {
  .club-mark--band { width: var(--ff-mark-cell); height: var(--ff-mark-cell); font-size: var(--ff-mark-figure-13); }
}


/* ---- Putt ball -----------------------------------------------------------
   <div class="ff-putt-row" role="radiogroup" aria-label="Putts">
     <button class="ff-putt-ball" role="radio" aria-checked="false">0</button>
     <button class="ff-putt-ball" role="radio" aria-checked="false" data-state="estimated">2</button>…
   </div>
   Resting: ringed. data-state="estimated": hollow dashed paper ring (the
   caddie's guess, not yet the player's). aria-checked="true": a solid paper
   ball with an ink numeral. Chosen always wins over estimated. */

.ff-putt-row {
  display: flex;
  justify-content: space-between;
  gap: var(--ff-touch-gap);
}

.ff-putt-ball {
  display: inline-grid;
  place-items: center;
  width: var(--ff-touch-primary);
  height: var(--ff-touch-primary);
  flex: none;
  padding: 0;
  border: var(--ff-border-strong) solid var(--ff-line-control);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-surface);
  color: var(--ff-paper);
  font: var(--ff-weight-display) var(--ff-size-24) / var(--ff-leading-display) var(--ff-font-display);
  font-variant-numeric: var(--ff-numeric);
}

.ff-putt-ball:active {
  background: var(--ff-surface-raised);
  transform: scale(var(--ff-press-scale));
}

.ff-putt-ball[data-state="estimated"] {
  border-style: dashed;
  border-color: var(--ff-paper);
}

.ff-putt-ball[aria-checked="true"],
.ff-putt-ball[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--ff-paper);
  background: var(--ff-paper);
  box-shadow: var(--ff-e1);
  color: var(--ff-ink);
}

.ff-putt-ball[disabled],
.ff-putt-ball[aria-disabled="true"] {
  border-color: var(--ff-line);
  color: var(--ff-text-3);
  cursor: default;
  pointer-events: none;
}


/* ---- Stepper -------------------------------------------------------------
   <div class="ff-stepper" role="group" aria-label="Strokes">
     <button class="ff-icon-button ff-icon-button--lg" aria-label="One fewer"><svg class="ff-icon">…</svg></button>
     <output class="ff-stepper__value">4</output>
     <button class="ff-icon-button ff-icon-button--lg" aria-label="One more"><svg class="ff-icon">…</svg></button>
   </div>
   The buttons are IconButtons; the stepper only owns layout and the value. */

.ff-stepper {
  display: inline-grid;
  grid-template-columns: auto minmax(var(--ff-touch-primary), 1fr) auto;
  align-items: center;
  gap: var(--ff-touch-gap);
}

.ff-stepper--block { display: grid; }

.ff-stepper__value {
  color: var(--ff-paper);
  font: var(--ff-weight-display) var(--ff-size-44) / var(--ff-leading-display) var(--ff-font-display);
  font-variant-numeric: var(--ff-numeric);
  letter-spacing: var(--ff-tracking-display);
  text-align: center;
}


/* ---- Figure ---------------------------------------------------------------
   <div class="ff-figure-row">
     <span class="ff-figure">
       <span class="ff-figure__value club-fig">76</span>
       <span class="ff-figure__word">rounds</span>
     </span>…
   </div>
   A big number (or a short word, --sm) in the heavy italic figure font with the word that says what it is, standing free:
   no box, no border. A hairline rule sits between neighbours. Built by ui/figure.js (figure, figureRow); the account page's
   plate and its Profile card use it. A figure always carries its word. */

.ff-figure-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.ff-figure {
  position: relative;
  display: grid;
  flex: 1 1 auto;
  gap: var(--ff-space-4);
  min-width: 0;
  padding: 0 var(--ff-space-12);
}

.ff-figure:first-child { padding-left: 0; }
.ff-figure:last-child { padding-right: 0; }

.ff-figure + .ff-figure::before {
  content: "";
  position: absolute;
  top: var(--ff-space-4);
  bottom: var(--ff-space-4);
  left: 0;
  width: var(--ff-border);
  background: var(--ff-line-control);
}

.ff-figure__value {
  color: var(--ff-paper);
  font-size: var(--ff-size-32);
  line-height: var(--ff-leading-display);
  white-space: nowrap;
}

.ff-figure--sm .ff-figure__value { font-size: var(--ff-size-24); }

.ff-figure__unit {
  margin-left: var(--ff-space-4);
  color: var(--ff-text-2);
  font: var(--ff-weight-strong) var(--ff-size-14) / var(--ff-leading-display) var(--ff-font-ui);
  font-style: normal;
  letter-spacing: var(--ff-tracking-normal);
}

.ff-figure__word {
  color: var(--ff-text-2);
  font: var(--ff-weight-strong) var(--ff-size-14) / var(--ff-leading-tight) var(--ff-font-ui);
}


/* ---- Avatars --------------------------------------------------------------
   <span class="ff-avatars"><span class="ff-avatars__one" data-active="true">M</span><span class="ff-avatars__one" data-active="false">A</span></span>
   Initials in a row, overlapping, the active one ringed in lime. Decorative: the words beside it say the count.
   Built by ui/avatar-stack.js (the account page's This device card). The ring is a shadow, never a border. */

.ff-avatars { display: inline-flex; align-items: center; padding-left: var(--ff-space-16); }

.ff-avatars__one {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: var(--ff-space-48);
  height: var(--ff-space-48);
  margin-left: calc(-1 * var(--ff-space-8));
  border-radius: var(--ff-radius-pill);
  background: var(--ff-surface-raised);
  box-shadow: 0 0 0 var(--ff-space-4) var(--ff-surface);
  color: var(--ff-paper);
  font: var(--ff-weight-heavy) var(--ff-size-20) / 1 var(--ff-font-display);
}

.ff-avatars__one[data-active="true"] {
  background: var(--ff-action);
  box-shadow: 0 0 0 var(--ff-space-4) var(--ff-surface), 0 0 0 calc(var(--ff-space-4) + 2px) var(--ff-action);
  color: var(--ff-ink);
}

.ff-avatars__more { font-size: var(--ff-size-14); }


/* ---- Reach rings ------------------------------------------------------------
   <svg class="ff-reach"> three rings around "You": Friends, Friends of friends, Everyone, each labelled.
   The score's reach is filled (--ff-reach-score-fill) in every ring up to its setting; who can contact you is a bold outline
   (--ff-reach-contact) at its setting; "Nobody" leaves only "You". Built by ui/reach-rings.js (the account page's Privacy card). */

.ff-reach { display: block; width: 100%; height: auto; }
.ff-reach__ring { fill: none; stroke: var(--ff-line-control); stroke-width: 1; }
.ff-reach__ring[data-filled="true"] { fill: var(--ff-reach-score-fill); stroke: var(--ff-reach-score); }
.ff-reach__contact { fill: none; stroke: var(--ff-reach-contact); stroke-width: 4; }
.ff-reach__lead { fill: none; stroke: var(--ff-line-control); stroke-width: 1; }
.ff-reach__pin { fill: var(--ff-paper); }
.ff-reach__label { fill: var(--ff-paper); font: var(--ff-weight-strong) var(--ff-size-14) / 1 var(--ff-font-ui); }
.ff-reach__you { fill: var(--ff-paper); }
.ff-reach__you-text { fill: var(--ff-ink); font: var(--ff-weight-heavy) var(--ff-size-14) / 1 var(--ff-font-display); }


/* ---- Progress bar --------------------------------------------------------
   Segments filled up to how far along. Decorative: the words beside it say the count.
   <div class="ff-progress"><span data-done="true"></span><span data-done="false"></span>…</div>
   Built by ui/progress-bar.js (My Bag's four questions, the account page's Getting started). --ff-progress-n is the segment count. */

.ff-progress {
  display: grid;
  grid-template-columns: repeat(var(--ff-progress-n, 4), 1fr);
  gap: var(--ff-space-8);
  margin: 0 0 var(--ff-space-24);
}

.ff-progress > span {
  height: var(--ff-space-4);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-line-control);
}

.ff-progress > span[data-done="true"] { background: var(--ff-action); }


/* ---- Notice --------------------------------------------------------------
   <div class="ff-notice ff-notice--toast" data-tone="info">
     <span class="ff-notice__glyph" aria-hidden="true"></span>
     <div class="ff-notice__body">
       <strong class="ff-notice__title">…</strong>      (optional)
       <span class="ff-notice__message">…</span>
     </div>
     <button class="ff-notice__action">Undo</button>     (optional)
   </div>
   Kinds: --inline (in flow), --toast (in .ff-notice-layer), --blocking
   (role="alertdialog", title takes .ff-notice__title--display, and
   .ff-notice__actions holds ff-buttons).
   data-tone: "info" (default) | "warn" | "error". The glyph is shape-coded:
   circle i, triangle !, octagon ×. Toast lifecycle: data-state="leaving".
   The layer sits above every surface; a screen with a bottom bar raises toasts
   by setting --ff-notice-offset on the layer or on :root. */

.ff-notice-layer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--ff-z-notice);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ff-space-8);
  box-sizing: border-box;
  padding:
    0
    calc(var(--ff-space-16) + var(--ff-safe-right))
    calc(var(--ff-notice-offset, var(--ff-space-16)) + var(--ff-safe-bottom))
    calc(var(--ff-space-16) + var(--ff-safe-left));
  pointer-events: none;
}

.ff-notice-layer[data-blocking="true"] {
  top: 0;
  justify-content: center;
  padding-top: calc(var(--ff-space-24) + var(--ff-safe-top));
  background: var(--ff-backdrop);
  pointer-events: auto;
}

.ff-notice {
  --ff-notice-tone: var(--ff-info);
  --ff-notice-shape: circle(50%);
  --ff-notice-char: "i";
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: var(--ff-space-12);
  row-gap: var(--ff-space-16);
  box-sizing: border-box;
  width: 100%;
  max-width: var(--ff-measure);
  padding: var(--ff-space-12) var(--ff-space-16);
  border: var(--ff-border) solid var(--ff-line);
  border-radius: var(--ff-radius-16);
  background: var(--ff-surface);
  color: var(--ff-paper);
  font: var(--ff-weight-ui) var(--ff-size-16) / var(--ff-leading-tight) var(--ff-font-ui);
  pointer-events: auto;
}

.ff-notice[data-tone="warn"] {
  --ff-notice-tone: var(--ff-warn);
  --ff-notice-shape: polygon(50% 2%, 100% 94%, 0 94%);
  --ff-notice-char: "!";
}

.ff-notice[data-tone="error"] {
  --ff-notice-tone: var(--ff-danger);
  --ff-notice-shape: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  --ff-notice-char: "×";
}

.ff-notice--toast {
  border-color: var(--ff-line-control);
  background: var(--ff-surface-raised);
  box-shadow: var(--ff-e2);
  animation: ff-notice-in var(--ff-dur-enter) var(--ff-ease-enter) both;
  transition:
    opacity var(--ff-dur-exit) var(--ff-ease-exit),
    transform var(--ff-dur-exit) var(--ff-ease-exit);
}

.ff-notice--toast[data-state="leaving"] {
  opacity: 0;
  transform: translateY(var(--ff-space-8));
}

.ff-notice--blocking {
  grid-template-columns: auto 1fr;
  align-items: start;
  padding: var(--ff-space-24);
  border-radius: var(--ff-radius-24);
  box-shadow: var(--ff-e2);
  animation: ff-notice-in var(--ff-dur-enter) var(--ff-ease-enter) both;
}

.ff-notice__glyph {
  display: grid;
  place-items: center;
  width: var(--ff-glyph);
  height: var(--ff-glyph);
  flex: none;
  background: var(--ff-notice-tone);
  clip-path: var(--ff-notice-shape);
  color: var(--ff-ink);
  font: var(--ff-weight-heavy) var(--ff-size-14) / var(--ff-leading-display) var(--ff-font-ui);
}
.ff-notice__glyph::before { content: var(--ff-notice-char); }

.ff-notice__body {
  display: grid;
  gap: var(--ff-space-4);
  min-width: 0;
}

.ff-notice__title { font-weight: var(--ff-weight-strong); }

.ff-notice__title--display {
  font: var(--ff-weight-display) var(--ff-size-24) / var(--ff-leading-tight) var(--ff-font-display);
  letter-spacing: var(--ff-tracking-heading);
}

.ff-notice__message { color: var(--ff-paper); }

.ff-notice__action {
  min-width: var(--ff-touch-min);
  min-height: var(--ff-touch-min);
  padding: 0 var(--ff-space-16);
  border: var(--ff-border) solid var(--ff-line-control);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-ink);
  color: var(--ff-action);
  font: var(--ff-weight-heavy) var(--ff-size-14) / var(--ff-leading-tight) var(--ff-font-ui);
  letter-spacing: var(--ff-tracking-label);
  text-transform: uppercase;
  white-space: nowrap;
}

.ff-notice__action:active {
  color: var(--ff-action-press);
  transform: scale(var(--ff-press-scale));
}

.ff-notice__dismiss {
  display: inline-grid;
  place-items: center;
  width: var(--ff-touch-min);
  height: var(--ff-touch-min);
  padding: 0;
  border: 0;
  border-radius: var(--ff-radius-pill);
  background: transparent;
  color: var(--ff-text-2);
  font: var(--ff-weight-ui) var(--ff-size-24) / var(--ff-leading-display) var(--ff-font-ui);
}
.ff-notice__dismiss:active { background: var(--ff-ink); }

.ff-notice__actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  grid-column: 1 / -1;
  gap: var(--ff-touch-gap);
}

@keyframes ff-notice-in {
  from { opacity: 0; transform: translateY(var(--ff-space-16)); }
  to { opacity: 1; transform: none; }
}


/* ---- Veil + Empty / Error block ------------------------------------------
   <div class="ff-veil" data-state="open">
     <div class="ff-block" data-tone="error">
       <p class="ff-block__eyebrow">Course data</p>
       <h2 class="ff-block__title">This hole isn't mapped yet.</h2>
       <p class="ff-block__message">…</p>
       <div class="ff-block__actions"><button class="ff-button ff-button--primary">…</button></div>
     </div>
   </div>
   The veil is opaque ink above everything. The block also stands alone inside
   a surface as an empty state. data-tone: "error" tints only the eyebrow.
   .ff-spinner is the one loading indicator. */

.ff-veil {
  position: fixed;
  inset: 0;
  z-index: var(--ff-z-veil);
  display: grid;
  align-content: center;
  justify-items: center;
  box-sizing: border-box;
  padding:
    calc(var(--ff-space-24) + var(--ff-safe-top))
    calc(var(--ff-space-24) + var(--ff-safe-right))
    calc(var(--ff-space-24) + var(--ff-safe-bottom))
    calc(var(--ff-space-24) + var(--ff-safe-left));
  background: var(--ff-ink);
  color: var(--ff-paper);
  transition:
    opacity var(--ff-dur-exit) var(--ff-ease-exit),
    visibility 0s linear var(--ff-dur-exit);
}

.ff-veil[data-state="closed"] {
  opacity: 0;
  visibility: hidden;
}

.ff-veil--inline { position: static; }

.ff-block {
  --ff-block-tone: var(--ff-text-2);
  display: grid;
  justify-items: start;
  gap: var(--ff-space-12);
  width: 100%;
  max-width: var(--ff-measure);
  color: var(--ff-paper);
  font: var(--ff-weight-ui) var(--ff-size-16) / var(--ff-leading-body) var(--ff-font-ui);
  text-align: left;
}

.ff-block[data-tone="error"] { --ff-block-tone: var(--ff-danger); }
.ff-block[data-tone="warn"] { --ff-block-tone: var(--ff-warn); }

.ff-block__eyebrow {
  margin: 0;
  color: var(--ff-block-tone);
  font: var(--ff-weight-heavy) var(--ff-size-12) / var(--ff-leading-tight) var(--ff-font-ui);
  letter-spacing: var(--ff-tracking-eyebrow);
  text-transform: uppercase;
}

.ff-block__title {
  margin: 0;
  font: var(--ff-weight-display) var(--ff-size-32) / var(--ff-leading-display) var(--ff-font-display);
  letter-spacing: var(--ff-tracking-display);
}

.ff-block__message {
  margin: 0;
  color: var(--ff-text-2);
}

.ff-block__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ff-touch-gap);
  margin-top: var(--ff-space-12);
}

.ff-spinner {
  display: inline-block;
  box-sizing: border-box;
  width: var(--ff-glyph);
  height: var(--ff-glyph);
  border: 3px solid var(--ff-line);
  border-top-color: var(--ff-paper);
  border-radius: var(--ff-radius-pill);
  animation: ff-spin var(--ff-dur-spin) linear infinite;
}

@keyframes ff-spin { to { transform: rotate(360deg); } }


/* ---- Nav group -----------------------------------------------------------
   <nav class="ff-nav-group" aria-label="Hole">
     <button class="ff-nav-group__step" aria-label="Previous hole"><svg class="ff-icon">…</svg></button>
     <button class="ff-nav-group__current" aria-haspopup="dialog">
       <span class="ff-nav-group__label">Hole</span>
       <span class="ff-nav-group__value">7</span>
     </button>
     <button class="ff-nav-group__step" aria-label="Next hole">…</button>
   </nav>
   One scrim pill that floats over the scene. */

.ff-nav-group {
  display: inline-grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--ff-touch-gap);
  box-sizing: border-box;
  padding: var(--ff-space-4);
  border: var(--ff-border) solid var(--ff-line);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-scrim);
  -webkit-backdrop-filter: blur(var(--ff-blur));
  backdrop-filter: blur(var(--ff-blur));
}

.ff-nav-group__step {
  display: inline-grid;
  place-items: center;
  width: var(--ff-touch-min);
  height: var(--ff-touch-min);
  padding: 0;
  border: 0;
  border-radius: var(--ff-radius-pill);
  background: transparent;
  color: var(--ff-paper);
  font: var(--ff-weight-strong) var(--ff-size-20) / var(--ff-leading-display) var(--ff-font-ui);
}

.ff-nav-group__step:active {
  background: var(--ff-surface-raised);
  transform: scale(var(--ff-press-scale));
}

.ff-nav-group__step[disabled],
.ff-nav-group__step[aria-disabled="true"] {
  color: var(--ff-text-3);
  cursor: default;
  pointer-events: none;
}

.ff-nav-group__current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ff-space-8);
  min-width: var(--ff-touch-primary);
  min-height: var(--ff-touch-min);
  padding: 0 var(--ff-space-12);
  border: 0;
  border-radius: var(--ff-radius-pill);
  background: transparent;
  color: var(--ff-paper);
}

.ff-nav-group__current:active { background: var(--ff-surface-raised); }

.ff-nav-group__label {
  color: var(--ff-text-2);
  font: var(--ff-weight-heavy) var(--ff-size-12) / var(--ff-leading-display) var(--ff-font-ui);
  letter-spacing: var(--ff-tracking-eyebrow);
  text-transform: uppercase;
}

.ff-nav-group__value {
  font: var(--ff-weight-display) var(--ff-size-24) / var(--ff-leading-display) var(--ff-font-display);
  font-variant-numeric: var(--ff-numeric);
  letter-spacing: var(--ff-tracking-heading);
}


/* ---- Marker + connector (SVG) --------------------------------------------
   SVG presentation attributes cannot read var(), so paint comes from here and
   only geometry stays in markup. Position with a wrapper <g transform>.
   <g transform="translate(120 80)">
     <g class="ff-marker" data-state="confirmed" data-selected="true">
       <circle class="ff-marker__select" r="17.5"/>
       <circle class="ff-marker__halo" r="16"/>
       <circle class="ff-marker__disc" r="11"/>
       <text class="ff-marker__label">2</text>
     </g>
   </g>
   data-state: "confirmed" (solid paper disc, ink numeral, ink ring)
               "estimated" (hollow, paper numeral, dashed paper ring)
               "unlocated" (hollow, dotted ring, 60% opacity)
   data-selected="true" (any state): scale 1.12 and a gold ring outside an ink
   ring, so size and the double ring carry selection. Nothing on the map is lime.
   <g class="ff-connector" data-state="estimated">
     <path class="ff-connector__casing" d="…"/><path class="ff-connector__line" d="…"/>
   </g> */

.ff-marker {
  --ff-marker-disc-fill: var(--ff-marker-fill);
  --ff-marker-disc-stroke: var(--ff-marker-ink);
  --ff-marker-disc-dash: none;
  --ff-marker-disc-cap: butt;
  --ff-marker-label-fill: var(--ff-marker-ink);
  --ff-marker-halo-fill: var(--ff-marker-halo);
  --ff-marker-select-stroke: transparent;
  transform-box: fill-box;
  transform-origin: center;
  transition: scale var(--ff-dur-state) var(--ff-ease-enter);
}

.ff-marker[data-state="estimated"] {
  --ff-marker-disc-fill: var(--ff-marker-hollow);
  --ff-marker-disc-stroke: var(--ff-marker-fill);
  --ff-marker-disc-dash: var(--ff-marker-dash);
  --ff-marker-label-fill: var(--ff-marker-fill);
}

.ff-marker[data-state="unlocated"] {
  --ff-marker-disc-fill: var(--ff-marker-hollow);
  --ff-marker-disc-stroke: var(--ff-marker-fill);
  --ff-marker-disc-dash: var(--ff-marker-dot);
  --ff-marker-disc-cap: round;
  --ff-marker-label-fill: var(--ff-marker-fill);
  opacity: var(--ff-marker-unlocated-opacity);
}

.ff-marker[data-selected="true"] {
  --ff-marker-halo-fill: var(--ff-marker-ink);
  --ff-marker-select-stroke: var(--ff-marker-select);
  scale: var(--ff-marker-selected-scale);
}

.ff-marker__halo {
  fill: var(--ff-marker-halo-fill);
  stroke: none;
}

.ff-marker__select {
  fill: none;
  stroke: var(--ff-marker-select-stroke);
  stroke-width: var(--ff-marker-select-width);
}

.ff-marker__disc {
  fill: var(--ff-marker-disc-fill);
  stroke: var(--ff-marker-disc-stroke);
  stroke-width: var(--ff-marker-ring);
  stroke-dasharray: var(--ff-marker-disc-dash);
  stroke-linecap: var(--ff-marker-disc-cap);
}

.ff-marker__label {
  fill: var(--ff-marker-label-fill);
  font: var(--ff-weight-heavy) var(--ff-size-14) / var(--ff-leading-display) var(--ff-font-display);
  font-variant-numeric: var(--ff-numeric);
  text-anchor: middle;
  dominant-baseline: central;
}

.ff-connector { --ff-connector-line-dash: none; }
.ff-connector[data-state="estimated"] { --ff-connector-line-dash: var(--ff-connector-dash); }

.ff-connector__casing {
  fill: none;
  stroke: var(--ff-marker-ink);
  stroke-width: var(--ff-connector-casing-width);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ff-connector__line {
  fill: none;
  stroke: var(--ff-marker-fill);
  stroke-width: var(--ff-connector-width);
  stroke-dasharray: var(--ff-connector-line-dash);
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* ---- Ground figure + position (SVG) --------------------------------------
   Figures painted flat on the ground of a hole picture (On Course (4.5)), the way a caddy paints a
   distance in the grass. Built only by app/src/ui/ground-figure.js: the group's matrix lays ground
   metres on the picture, so a figure foreshortens with the tee-to-green ground and reads upright
   from the golfer; in the plan view it lies flat. Size, baseline and edge width are geometry (in
   markup, in metres); paint comes from here. Light ink on a dark edge, the heavy italic figures.
   <g class="ff-ground-fig" data-kind="aim" transform="matrix(…)">
     <text class="ff-ground-fig__big" font-size="14" stroke-width="2.2">212</text>
     <text class="ff-ground-fig__small" …>146 to centre</text>
   </g>
   data-kind: "aim" (the golfer to the aim; on to the green's centre) | "hazard" (a bunker's carry
   over its reach, .ff-ground-fig__reach) | "water" (the same, in the water tone).
   <g class="ff-position" data-state="live"><path class="ff-position__disc" d="…"/></g>
     the fix's accuracy on the ground; data-state "estimated" (a weak fix) dashes its edge.
   <g class="ff-aim"><path class="ff-aim__case" d="…"/><path class="ff-aim__ring" d="…"/></g>
     the aim point's ring on the ground.
   The golfer is the Marker (ff-marker): confirmed on a live fix, estimated where they placed it. */

.ff-ground-fig { pointer-events: none; }

.ff-ground-fig__big,
.ff-ground-fig__small,
.ff-ground-fig__reach {
  fill: var(--ff-ground-ink);
  stroke: var(--ff-ground-case);
  stroke-linejoin: round;
  paint-order: stroke;
  font-family: var(--ff-font-figure);
  font-style: italic;
  font-weight: 900;
  font-variant-numeric: var(--ff-numeric);
  letter-spacing: var(--ff-tracking-heading);
  text-anchor: middle;
}

.ff-ground-fig__small { font-weight: var(--ff-weight-heavy); letter-spacing: var(--ff-tracking-normal); }
.ff-ground-fig__reach { fill: var(--ff-ground-reach); font-weight: var(--ff-weight-heavy); }
.ff-ground-fig[data-kind="water"] .ff-ground-fig__big,
.ff-ground-fig[data-kind="water"] .ff-ground-fig__reach { fill: var(--ff-ground-water); }

.ff-position__disc {
  fill: var(--ff-position-disc);
  fill-opacity: var(--ff-position-disc-opacity);
  stroke: var(--ff-position-disc);
  stroke-opacity: var(--ff-position-edge-opacity);
  stroke-width: var(--ff-border);
}
.ff-position[data-state="estimated"] .ff-position__disc { stroke-dasharray: var(--ff-marker-dash); }

.ff-aim__case {
  fill: none;
  stroke: var(--ff-ground-case);
  stroke-width: var(--ff-connector-casing-width);
}

.ff-aim__ring {
  fill: none;
  stroke: var(--ff-ground-aim);
  stroke-width: var(--ff-border-strong);
}


/* ---- Caption -------------------------------------------------------------
   The caddie's one line.
   <p class="ff-caption">
     <span class="ff-caption__text">148 to the front edge, plays 153 uphill</span>
     <span class="ff-caption__tag">≈ estimated</span>      (optional)
   </p>
   One line, truncating. The tag is dashed because dashed means estimated. */

.ff-caption {
  display: flex;
  align-items: center;
  gap: var(--ff-space-8);
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  min-height: var(--ff-touch-min);
  margin: 0;
  padding: var(--ff-space-8) var(--ff-space-8) var(--ff-space-8) var(--ff-space-16);
  border: var(--ff-border) solid var(--ff-line);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-scrim);
  -webkit-backdrop-filter: blur(var(--ff-blur));
  backdrop-filter: blur(var(--ff-blur));
  color: var(--ff-paper);
  font: var(--ff-weight-ui) var(--ff-size-16) / var(--ff-leading-tight) var(--ff-font-ui);
}

.ff-caption__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ff-caption__tag {
  flex: none;
  padding: var(--ff-space-4) var(--ff-space-8);
  border: var(--ff-border) dashed var(--ff-paper);
  border-radius: var(--ff-radius-pill);
  color: var(--ff-paper);
  font: var(--ff-weight-strong) var(--ff-size-12) / var(--ff-leading-tight) var(--ff-font-ui);
  white-space: nowrap;
}


/* ---- Status mark ---------------------------------------------------------
   <span class="ff-status" data-status="green">Green</span>
   A pill with a dot that states where something stands; never pressed. The player app guide
   (guide/build.mjs) marks each function with it, the state computed from its checks.
   data-status: "green" (proven now) | "pending" (asked for, not yet proven) | "red" (its proof fails).
   The label always names the state or carries its count, so the dot's colour is never the only signal. */

.ff-status {
  --ff-status-dot: var(--ff-text-3);
  display: inline-flex;
  align-items: center;
  gap: var(--ff-space-8);
  box-sizing: border-box;
  padding: var(--ff-space-4) var(--ff-space-12) var(--ff-space-4) var(--ff-space-8);
  border: var(--ff-border) solid var(--ff-line-control);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-ink);
  color: var(--ff-paper);
  font: var(--ff-weight-heavy) var(--ff-size-12) / var(--ff-leading-tight) var(--ff-font-ui);
  font-variant-numeric: var(--ff-numeric);
  letter-spacing: var(--ff-tracking-label);
  text-transform: uppercase;
  white-space: nowrap;
}

.ff-status::before {
  content: "";
  flex: none;
  width: var(--ff-space-8);
  height: var(--ff-space-8);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-status-dot);
}

/* --plain: the dot and its words with no pill (inside a card, where nothing may sit in a box). */
.ff-status--plain { padding: 0; border: 0; background: none; letter-spacing: var(--ff-tracking-normal); text-transform: none; font-size: var(--ff-size-14); }

.ff-status[data-status="green"] { --ff-status-dot: var(--ff-status-green); }
.ff-status[data-status="pending"] { --ff-status-dot: var(--ff-status-pending); }
.ff-status[data-status="red"] { --ff-status-dot: var(--ff-status-red); border-color: var(--ff-status-red); }


/* ---- Focus ---------------------------------------------------------------
   One ring for every ff- element: 3px white outside a 2px ink gap, keyboard
   focus only. A selected card keeps its gold ring; the white ring moves outside it. */

[class^="ff-"]:focus-visible,
[class*=" ff-"]:focus-visible {
  outline: var(--ff-focus-width) solid var(--ff-focus);
  outline-offset: var(--ff-focus-offset-local, var(--ff-focus-offset));
  box-shadow: var(--ff-focus-under, var(--ff-focus-gap));
}


/* ---- Reduced motion ------------------------------------------------------
   Scoped to ff- elements: the duration tokens collapse on the element itself,
   so every transition above resolves to instant without a specificity fight.
   Looping animation stops; busy state is still announced by aria-busy. */

@media (prefers-reduced-motion: reduce) {
  [class^="ff-"],
  [class*=" ff-"] {
    --ff-dur-press: 0ms;
    --ff-dur-state: 0ms;
    --ff-dur-enter: 0ms;
    --ff-dur-exit: 0ms;
    --ff-press-scale: 1;
    animation-iteration-count: 1;
  }

  .ff-spinner,
  .ff-button[aria-busy="true"]::before {
    animation-name: none;
  }
}


/* ---- Plan target (the hole scoring screen, ui/plan-target.js) --------------
   The golfer's planned target for the next shot: a faint crosshair on the ground, and its distance in the golfer's unit (m or yd)
   from where the shot is played in the figure font on the scrim. Never a ball (no disc, no ring
   round a ball) and never a touch target: it takes no pointer.
   <div class="ff-plan-target" data-metres="152">
     <svg class="ff-plan-target__mark">ring, cross, dot</svg>
     <span class="ff-plan-target__fig"><span class="ff-plan-target__main"><span class="club-fig ff-plan-target__value">152</span><span class="ff-plan-target__unit">m</span></span>
       <span class="ff-plan-target__left">87 to pin</span></span></div>   (the last line only where what it leaves to the pin is known)
   Placed by its centre (translate3d on the element, as the markers are). */
.ff-plan-target {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--ff-plan-size);
  height: var(--ff-plan-size);
  margin: calc(var(--ff-plan-size) / -2) 0 0 calc(var(--ff-plan-size) / -2);
  pointer-events: none;
}
.ff-plan-target[hidden] { display: none; }
.ff-plan-target__mark { display: block; width: 100%; height: 100%; overflow: visible; }
.ff-plan-target__ring,
.ff-plan-target__cross {
  fill: none;
  stroke: var(--ff-plan);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: var(--ff-plan-opacity);
}
.ff-plan-target__ring { stroke-dasharray: 4 4; }
.ff-plan-target__dot { fill: var(--ff-plan); opacity: var(--ff-plan-opacity); }
.ff-plan-target__fig {
  position: absolute;
  left: 50%;
  top: calc(100% + var(--ff-space-4));
  translate: -50% 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 2px var(--ff-space-8);
  border-radius: var(--ff-radius-8);
  background: var(--ff-scrim);
  color: var(--ff-paper);
  white-space: nowrap;
}
.ff-plan-target__main { display: inline-flex; align-items: baseline; gap: 2px; }
.ff-plan-target__left { font: var(--ff-weight-strong) var(--ff-size-12) / 1.2 var(--ff-font-ui); color: var(--ff-paper); }
.ff-plan-target__value { font-size: var(--ff-size-20); line-height: 1; }
.ff-plan-target__unit { font: var(--ff-weight-strong) var(--ff-size-12) / 1 var(--ff-font-ui); color: var(--ff-text-2); }


/* ---- Score picker ---------------------------------------------------------
   A hole's likely scores as chips, each its score mark (ui/score-picker.js): one tap chooses, a tap
   on the chosen one clears. Where the golfer, not the card, says the score.
   <div class="ff-chip-row ff-score-picker" role="radiogroup">
     <button class="ff-chip ff-score-picker__chip" role="radio" aria-checked="true"><span class="club-mark" data-score="par">4</span></button>…</div> */
.ff-score-picker { flex-wrap: nowrap; justify-content: center; overflow-x: auto; scrollbar-width: none; }
.ff-score-picker__chip { flex: none; padding: 0 var(--ff-space-8); }
.ff-score-picker__chip[aria-checked="true"] { border-color: var(--ff-paper); }


/* ---- Slope + pin badge + map tag (the hole scoring screen's green, ui/slope.js) --------
   The green's grade from the course's held terrain (geo/green-grade.js); none drawn without it.
   <g class="ff-slope"><g class="ff-slope__drift" data-band="2"><path class="ff-slope__case" d="…"/>
     <path class="ff-slope__arrow" data-band="2" d="…"/></g>…</g>   (SVG, downhill)
   <div class="ff-slope-key"><span class="ff-slope-key__head">↓ Slope</span>
     <span class="ff-slope-key__band" data-band="0">&lt;1%</span>…</div>
   data-band: 0 under 1 %, 1 to 2.5 %, 2 to 4.5 %, 3 steeper (--ff-slope-*).
   <span class="ff-pin-badge" data-state="estimated">Unconfirmed today</span>
     the pin's badge: dashed while the pin is the course's (estimated), solid once the golfer placed it.
   <span class="ff-map-tag">Putt 1 · 5.2 m</span>   a leg's figure on the map, on the scrim.
   <g class="ff-connector ff-connector--putt">…</g>   a putt's line to the next start or the cup, dashed.
   Each arrow sits in <g class="ff-slope__drift" data-band> on an ink casing (ff-slope__case) and
   drifts downhill along --ff-slope-ux/uy (set by ui/slope.js), faster the steeper its band
   (--ff-slope-drift-*), each from its own --ff-slope-phase; held still under reduced motion. */

.ff-slope__drift {
  animation: ff-slope-drift var(--ff-slope-drift-0) linear infinite;
  animation-delay: calc(var(--ff-slope-phase, 0) * var(--ff-slope-drift-0) * -1);
  pointer-events: none;
}
.ff-slope__drift[data-band="1"] { animation-duration: var(--ff-slope-drift-1); animation-delay: calc(var(--ff-slope-phase, 0) * var(--ff-slope-drift-1) * -1); }
.ff-slope__drift[data-band="2"] { animation-duration: var(--ff-slope-drift-2); animation-delay: calc(var(--ff-slope-phase, 0) * var(--ff-slope-drift-2) * -1); }
.ff-slope__drift[data-band="3"] { animation-duration: var(--ff-slope-drift-3); animation-delay: calc(var(--ff-slope-phase, 0) * var(--ff-slope-drift-3) * -1); }
@keyframes ff-slope-drift {
  0% { transform: translate(calc(var(--ff-slope-ux, 0) * var(--ff-slope-travel) * -1), calc(var(--ff-slope-uy, 0) * var(--ff-slope-travel) * -1)); opacity: 0; }
  18%, 78% { opacity: 1; }
  100% { transform: translate(calc(var(--ff-slope-ux, 0) * var(--ff-slope-travel)), calc(var(--ff-slope-uy, 0) * var(--ff-slope-travel))); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ff-slope__drift { animation: none; }
}
.ff-slope__case,
.ff-slope__arrow {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.ff-slope__case {
  stroke: var(--ff-slope-case);
  stroke-width: var(--ff-slope-case-width);
  opacity: var(--ff-slope-case-opacity);
}
.ff-slope__arrow {
  stroke: var(--ff-slope-0);
  stroke-width: var(--ff-slope-width);
  opacity: var(--ff-slope-opacity);
}
.ff-slope__arrow[data-band="1"] { stroke: var(--ff-slope-1); }
.ff-slope__arrow[data-band="2"] { stroke: var(--ff-slope-2); }
.ff-slope__arrow[data-band="3"] { stroke: var(--ff-slope-3); }

.ff-slope-key {
  display: flex;
  align-items: center;
  gap: var(--ff-space-12);
  box-sizing: border-box;
  padding: var(--ff-space-4) var(--ff-space-12);
  border: var(--ff-border) solid var(--ff-line);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-scrim);
  color: var(--ff-paper);
  font: var(--ff-weight-strong) var(--ff-size-12) / var(--ff-leading-tight) var(--ff-font-ui);
  font-variant-numeric: var(--ff-numeric);
  white-space: nowrap;
}
.ff-slope-key[hidden] { display: none; }
.ff-slope-key__band { color: var(--ff-slope-0); }
.ff-slope-key__band[data-band="1"] { color: var(--ff-slope-1); }
.ff-slope-key__band[data-band="2"] { color: var(--ff-slope-2); }
.ff-slope-key__band[data-band="3"] { color: var(--ff-slope-3); }

.ff-pin-badge,
.ff-map-tag {
  position: absolute;
  left: 0;
  top: 0;
  padding: var(--ff-space-4) var(--ff-space-8);
  border: var(--ff-border) solid var(--ff-paper);
  border-radius: var(--ff-radius-pill);
  background: var(--ff-scrim);
  color: var(--ff-paper);
  font: var(--ff-weight-strong) var(--ff-size-12) / var(--ff-leading-tight) var(--ff-font-ui);
  font-variant-numeric: var(--ff-numeric);
  white-space: nowrap;
  pointer-events: none;
}
.ff-pin-badge[data-state="estimated"] { border-style: dashed; }
.ff-map-tag { border-color: var(--ff-line); }
.ff-connector--putt { --ff-connector-line-dash: var(--ff-connector-dash); }

/* ---- History band ----------------------------------------------------------
   <div class="cp-hist" role="img" aria-label="Your last scores here, …">           (ui/hole-history-band.js)
     <div class="cp-hist__last">
       <span class="ff-eyebrow cp-hist__label">Your last 5</span>
       <ol class="cp-hist__marks"><li class="cp-hist__score"><span class="club-mark club-mark--band" data-score="par">4</span></li>…</ol>
     </div>
     <div class="cp-hist__stat">
       <span class="cp-hist__avg course-fig">4.6</span><span class="cp-hist__rel course-fig" data-sign="over">+0.6</span>
       <span class="ff-eyebrow cp-hist__label">Your avg</span>
       <span class="cp-hist__note">excl. pickups</span>                                  (optional)
     </div>
   </div>
   The golfer's last scores on a hole, newest first, as the score page's marks, and their average there
   with its distance from par. A scrim surface. Placement is the caller's: the course preview's hole card
   lays it over its foot (host.css .cp-hole .cp-hist); --bar sets it inline and compact, in On Course's
   bottom bar between the hole arrows. */

.cp-hist { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; box-sizing: border-box; padding: var(--ff-hist-pad); color: var(--ff-paper); background: var(--ff-scrim); border: var(--ff-border) solid var(--ff-line); border-radius: var(--ff-radius-12); box-shadow: var(--ff-e1); }
.cp-hist__label { display: block; font-size: var(--ff-hist-label); line-height: 1; letter-spacing: .14em; white-space: nowrap; }
.cp-hist__last { display: grid; align-content: space-between; gap: var(--ff-space-8); min-width: 0; }
.cp-hist__marks { display: flex; align-items: center; gap: var(--ff-space-8); margin: 0; padding: 0; list-style: none; }
.cp-hist__score { display: flex; flex: none; }
.cp-hist__stat { display: grid; grid-template-columns: auto auto; grid-template-rows: 1fr auto; align-items: end; column-gap: var(--ff-hist-col-gap); row-gap: var(--ff-hist-row-gap); margin-left: var(--ff-space-12); padding-left: var(--ff-space-12); border-left: var(--ff-border) solid var(--ff-line); }
.cp-hist__avg { grid-row: 1; font-size: var(--ff-hist-avg); line-height: .8; }
/* Heavier and tighter than the figure font's own (.course-fig, host.css), whichever sheet loads last. */
.cp-hist .cp-hist__avg { font-weight: 900; letter-spacing: -.05em; }
.cp-hist__rel { grid-row: 1; align-self: end; padding-bottom: 1px; color: var(--ff-score-par); font-size: var(--ff-hist-rel); font-weight: 800; line-height: 1; }
.cp-hist__rel[data-sign="under"] { color: var(--ff-score-under); }
.cp-hist__rel[data-sign="over"] { color: var(--ff-score-over); }
.cp-hist__stat .cp-hist__label { grid-column: 1 / 3; grid-row: 2; }
.cp-hist__note { grid-column: 1 / 3; grid-row: 3; margin-top: -2px; color: var(--ff-text-3); font: var(--ff-weight-strong) var(--ff-hist-note) / 1 var(--ff-font-ui); letter-spacing: .02em; white-space: nowrap; }
/* Inline and compact (On Course's bottom bar): the label, the marks in a row of small tiles, then the average in one
   line under them; no surface of its own (the bar is the surface). */
.cp-hist--bar { grid-template-columns: minmax(0, 1fr); row-gap: 3px; min-width: 0; padding: 0; border-color: transparent; background: transparent; box-shadow: none; }
.cp-hist--bar .cp-hist__label { letter-spacing: var(--ff-tracking-label); }
.cp-hist--bar .cp-hist__last { gap: 3px; }
.cp-hist--bar .cp-hist__marks { gap: 3px; }
.cp-hist--bar .club-mark--band { width: var(--ff-hist-bar-mark); height: var(--ff-hist-bar-mark); font-size: var(--ff-mark-figure-13); }
.cp-hist--bar .cp-hist__stat { display: flex; align-items: baseline; gap: var(--ff-space-4); margin: 0; padding: 0; border-left: 0; }
.cp-hist--bar .cp-hist__stat .cp-hist__label { order: -1; }
.cp-hist--bar .cp-hist__avg { font-size: var(--ff-hist-bar-avg); line-height: 1; }
.cp-hist--bar .cp-hist__note { display: none; }

/* ---- Courses map (ui/course-map.js) --------------------------------------
   Pins on Australia in SVG. Zoomed out: the hand-drawn outline. Zoomed in (data loaded): the real coast, lakes,
   rivers, urban tint, roads and names, drawn by zoom. Strokes are hairlines at every zoom (non-scaling) and labels
   keep one screen size, set here on a --ff-map-halo backing. Colours: the --ff-map-* tokens only.
   Usage: <div class="course-map"><svg class="course-map__svg">...</svg><div class="course-map__zooms">...</div></div> */
.course-map { position: relative; aspect-ratio: 1 / 1.05; max-height: 62vh; overflow: hidden; background: var(--ff-map-sea); border: var(--ff-border) solid var(--ff-line); border-radius: var(--ff-radius-16); }
.course-map__svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.course-map__land path, .course-map__land-real path { fill: var(--ff-map-land); stroke: var(--ff-map-coast); stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.course-map__water path { fill: var(--ff-map-sea); stroke: var(--ff-map-coast); stroke-width: 1; vector-effect: non-scaling-stroke; }
.course-map__urban path { fill: var(--ff-map-urban); stroke: none; }
.course-map__rivers path { fill: none; stroke: var(--ff-map-water-line); stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.course-map__roads path { fill: none; stroke: var(--ff-map-road); stroke-width: 1; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.course-map__roads .course-map__road--major { stroke: var(--ff-map-road-major); }
.course-map__labels { pointer-events: none; }
.course-map__label { font: 600 var(--ff-size-12) / 1 var(--ff-font-ui); fill: var(--ff-map-label); stroke: var(--ff-map-halo); stroke-width: 3px; paint-order: stroke; stroke-linejoin: round; }
.course-map__label--course { font-weight: 700; fill: var(--ff-map-label-course); }
.course-pin { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.course-pin__hit { fill: transparent; }
.course-pin__dot { fill: var(--ff-action); stroke: var(--ff-ink); stroke-width: 2; }
.course-pin[data-picked="true"] .course-pin__dot { fill: var(--ff-paper); stroke: var(--ff-action); stroke-width: 4; }
.course-pin:focus-visible .course-pin__dot { stroke: var(--ff-paper); stroke-width: 3; }
.course-map__zooms { position: absolute; top: var(--ff-space-8); right: var(--ff-space-8); display: grid; gap: var(--ff-space-8); }
.course-map__glyph { width: 20px; height: 20px; }
.course-map__glyph svg { display: block; width: 100%; height: 100%; stroke-width: 3; }
.course-map__note { position: absolute; left: var(--ff-space-8); bottom: var(--ff-space-8); margin: 0; padding: var(--ff-space-4) var(--ff-space-12); color: var(--ff-text-2); font: 600 var(--ff-size-14) / 1.2 var(--ff-font-ui); background: var(--ff-scrim); border-radius: var(--ff-radius-pill); }
