/* =========================================================
   TeeCast — design prototype tokens + components
   Paper-card aesthetic, forest + cream + antique brass.
   One file, shared across all screens.
   ========================================================= */

/* Inter via Google Fonts — loaded via <link> in each HTML file for
   better sandbox compatibility. System-font fallback below still works
   if Inter fails to load. */

/* =========================================================
   v2 (TeeCast) design tokens — landed Phase A (v63).
   Token diff from manifest §4 / reference/teecast/tokens.css.
   Value changes (brass, paper-rule, score-amber/red, ink-300,
   paper-bg) intentionally ripple to existing screens as the rebrand.
   ========================================================= */
:root {
  /* Ink */
  --ink-900: #10201A;
  --ink-700: #2A3B33;
  --ink-500: #5A6862;
  --ink-300: #8C968F;            /* v2: was #A8B0AB */

  /* Paper / parchment */
  --paper-bg: #EFE6D0;           /* v2: warmer parchment (was #F4ECD8) */
  --paper-surface: #FBF6E9;      /* card surface (design's --cream) */
  --cream: #FBF6E9;              /* v2 alias — design references --cream */
  --paper-band: #F2EAD6;         /* v2 NEW: segmented controls, chips, stat tiles */
  --paper-rule: #E1D6B5;         /* v2: warmer hairline (was #D9CFB5) */
  --rule-soft: #EAE0C6;          /* v2 NEW token: faint dividers, row borders */

  /* Forest */
  --forest-700: #0E3B2B;
  --forest-600: #14422D;         /* v2 NEW: wordmark, nav active */
  --forest-500: #1C5A3F;
  --forest-300: #6E9A7E;
  --forest-100: #D9E6DE;
  --sage-300:  #6E9A7E;          /* v2 NEW name (= forest-300): trend sparkline, weekly chips */

  /* Brass — antique gold per brand brief */
  --brass-500: #A0782A;          /* v2: antique gold (was #B8935A) */
  --brass-400: #B8935A;          /* v2 NEW: lighter brass for dark surfaces (old brass-500) */
  --brass-300: #D9BF8A;
  --brass-100: #EBDCB8;

  /* Scoring tiers */
  --score-green: #2E6B3E;        /* Eagle / Birdie */
  --score-amber: #B07E1E;        /* Par — v2: was #B98422 */
  --score-rose:  #B5645B;        /* v2 NEW: Bogey (intermediate warm tone) */
  --score-red:   #9A2E2A;        /* Double Bogey — v2: was #8E2E2E */
  --score-green-bg: #E4EDDF;
  --score-amber-bg: #F3E7CE;
  --score-red-bg:   #EBD6D0;
  /* Segment-bar fills (Outlook bar mode) — v2 NEW */
  --seg-green: #3B7A4C;
  --seg-amber: #B98422;
  --seg-rose:  #C4837A;
  --seg-red:   #9A2E2A;
  /* Soft-alpha variants used by the v1 hero-card histogram (kept until
     the Home redesign, Phase E, replaces that usage). */
  --score-green-soft: rgba(46, 107, 62, 0.85);
  --score-amber-soft: rgba(185, 132, 34, 0.85);
  --score-red-soft:   rgba(142, 46, 46, 0.55);

  /* Font families — v2.
     --serif: headlines + course names. --sans: body/labels/buttons AND
     score numerals (Chris's override — scores stay bold sans, not serif).
     --mono: tabular readouts (times, dates, slider values). */
  --serif: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --sans:  'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-modal: 12px;              /* v2 NEW: detail modal */
  --r-sheet: 18px;             /* v2 NEW: bottom sheet top corners */

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(16, 32, 26, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 32, 26, 0.08);
  --shadow-lg: 0 10px 30px rgba(16, 32, 26, 0.10);
  --shadow-card: 0 1px 2px rgba(40,30,10,.04), 0 8px 22px -14px rgba(40,30,10,.18); /* v2 NEW */
}

/* ---------- Reset + base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--sans);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
  background: #EAE1C9; /* behind the phone frame */
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---------- Phone frame (prototype chrome) ----------
   Fixed 393x852 when there's room. On narrower viewports (preview
   panels, small windows) the phone frame collapses into an edge-to-edge
   mobile page so layout doesn't clip.

   `dvh` (dynamic viewport height) is the key here — `vh` historically
   does NOT shrink when Safari's URL bar / tab bar appears in browser
   mode, so the bottom of our tab bar would render UNDER Safari's UI.
   `dvh` tracks the actual visible area dynamically. Falls back to `vh`
   on iOS < 15.4. */

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px 80px;
  background:
    radial-gradient(ellipse at top, rgba(14, 59, 43, 0.08), transparent 60%),
    #EAE1C9;
}

.phone {
  width: 393px;
  height: 852px;
  background: var(--paper-bg);
  border-radius: 48px;
  box-shadow:
    0 0 0 10px #1a1a1a,
    0 0 0 12px #2a2a2a,
    0 30px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.phone::before { /* notch */
  content: '';
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 30px;
  background: #1a1a1a;
  border-radius: 20px;
  z-index: 10;
}

.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding-top: 54px; /* under notch */
  overflow: hidden;
}

.scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--s-5);
}

.scroll::-webkit-scrollbar { width: 0; }

/* Narrow viewport fallback — edge-to-edge, no phone chrome.
   `padding-top` adds env(safe-area-inset-top) on top of the base 20px
   so the app bar sits comfortably below the iPhone dynamic island /
   notch with breathing room, instead of right at the boundary. */
@media (max-width: 480px) {
  .stage {
    padding: 0;
    background: var(--paper-bg);
  }
  .phone {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
  .phone::before { display: none; }
  .screen { padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
}

/* ---------- Typography ---------- */
.micro {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}

.micro-ink { color: var(--ink-900); }
.micro-brass { color: var(--brass-500); }

.h1 { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; color: var(--ink-900); }
.h2 { font-size: 22px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink-900); }
.h3 { font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--ink-900); }
.body { font-size: 15px; font-weight: 400; line-height: 1.5; color: var(--ink-700); }
.small { font-size: 13px; font-weight: 400; line-height: 1.45; color: var(--ink-500); }
.num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---------- Header (app bar) ---------- */
.appbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-3) var(--s-5) var(--s-4);
  position: relative;
}

.appbar::after {
  content: '';
  position: absolute;
  left: var(--s-5); right: var(--s-5); bottom: 0;
  height: 1px;
  background: var(--paper-rule);
}

/* Brand lockup (mark + wordmark).
   The gap is --s-3 rather than --s-2 because the mark's artwork runs nearly to
   the edge of its own viewBox (only ~5% right-side padding, vs ~14% on the old
   mark) AND its sun rays point right, toward the wordmark. At an 8px gap the
   rays visually collide with the "T". 12px restores the optical spacing. */
.brand {
  display: flex; align-items: center; gap: var(--s-3);
}

.monogram {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--brass-500);
  display: grid; place-items: center;
  color: var(--brass-500);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0;
}

/* TeeMark brand mark (v2) — holds the tee + partly-cloudy + brass-sun
   SVG. No circle border (unlike the old monogram); same 28px footprint
   so the app bar layout doesn't shift. */
/* The brand mark is PORTRAIT (272x336). Size it by HEIGHT and let the width
   follow, otherwise it fits to width and overflows the box vertically. */
.brand-mark {
  height: 38px;
  display: grid; place-items: center;
  flex-shrink: 0;
}

/* Every rendering of the mark (see lib/brand-mark.js) fills its container's
   height and keeps its aspect ratio. */
.teemark { height: 100%; width: auto; display: block; }

.wordmark {
  font-family: var(--serif);     /* v2: Cormorant Garamond */
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--forest-600);
}

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: var(--ink-700);
  border-radius: var(--r-sm);
}

.icon-btn:hover { background: rgba(16, 32, 26, 0.04); }

/* ---------- Tab bar ----------
   `padding-bottom` adds env(safe-area-inset-bottom) ON TOP of the
   normal padding (calc(+) pattern), not max() which would let the
   tap targets sit right at the home-indicator boundary. With calc(+),
   icons + labels have ~12px of breathing room ABOVE the safe area.
   Top padding bumped to s-3 + label font to 11px to match. */
.tabbar {
  border-top: 1px solid var(--paper-rule);
  background: var(--paper-surface);
  padding: var(--s-3) var(--s-5) calc(var(--s-3) + env(safe-area-inset-bottom, 0px));
  display: grid;
  /* 3 tabs as of v64 (v2 redesign): Home / Tee Times / Tune. Course +
     Manage were folded into Tune's Courses accordion; per-course
     drill-in moves to the shared Scorecard modal. Wider cells than the
     old 4-tab bar, so "Tee Times" fits on one line at 393px. */
  grid-template-columns: repeat(3, 1fr);
}

/* The tab is the BADGE — content-sized (inline-flex) and centered
   within its 1fr grid cell. Padding/border-radius are identical
   active vs inactive so the icon + label never move when the active
   state toggles. Active state changes BG + text/stroke color only.
   v58 — replaces v57's icon-only badge, which made the active tab
   appear taller than the others. */
.tab {
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--ink-500);
  text-decoration: none;
  justify-self: center;
}

.tab.active {
  background: var(--forest-700);
  color: var(--paper-surface);   /* propagates to .tab-label (no override) + svg.i stroke (currentColor) */
}

.tab-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;   /* keep "Tee Times" on one line inside the badge */
}

/* ---------- Cards ---------- */
.card {
  background: var(--paper-surface);
  border: 1px solid var(--paper-rule);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-sm);
}

.card-elevated {
  background: var(--paper-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: var(--s-5);
}

/* ---------- Hero score cell (scorecard total box) ---------- */
.hero-window {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: var(--s-5);
  align-items: center;
  background: var(--paper-surface);
  border: 1px solid var(--paper-rule);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.hero-window::before {
  content: '';
  position: absolute;
  top: 10px; right: 12px;
  width: 10px; height: 10px;
  border-top: 1px solid var(--brass-500);
  border-right: 1px solid var(--brass-500);
}

.hero-window::after {
  content: '';
  position: absolute;
  bottom: 10px; left: 12px;
  width: 10px; height: 10px;
  border-bottom: 1px solid var(--brass-500);
  border-left: 1px solid var(--brass-500);
}

.score-box {
  aspect-ratio: 1;
  border: 1.5px solid rgba(14, 59, 43, 0.35);
  border-radius: var(--r-md);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: var(--s-2);
  background: var(--paper-bg);
  text-align: center;
}

.score-box .score-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink-500);
  text-transform: uppercase;
}

.score-box .score-value {
  font-size: 52px;
  font-weight: 700;
  line-height: 1;
  color: var(--forest-700);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  align-self: center;
  display: block;
  width: 100%;
  text-align: center;
}

/* Score = 100 has 3 digits and overflows the square box at the
   default 52px. Scale down so it stays centered without crowding. */
.score-box .score-value.three-digit { font-size: 40px; letter-spacing: -0.04em; }

.score-box .score-grade {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--score-green);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.hero-meta { display: flex; flex-direction: column; gap: var(--s-2); }
.hero-course { font-size: 17px; font-weight: 700; color: var(--forest-700); letter-spacing: -0.01em; }
.hero-time { font-size: 13px; color: var(--ink-700); font-variant-numeric: tabular-nums; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px;
  background: var(--paper-bg);
  border: 1px solid var(--paper-rule);
  border-radius: 999px;
  font-size: 11px;
  color: var(--ink-700);
  font-variant-numeric: tabular-nums;
}

/* ---------- Week timeline (scorecard rows) ---------- */
.week {
  margin-top: var(--s-4);
  background: var(--paper-surface);
  border: 1px solid var(--paper-rule);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.week-header {
  display: grid;
  grid-template-columns: 82px 1fr;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--paper-rule);
  background: var(--paper-bg);
  align-items: center;
}

.week-header .cols {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  text-align: center;
}

.week-header .cols span { font-size: 9px; font-weight: 600; letter-spacing: 0.14em; color: var(--ink-500); text-transform: uppercase; }

.week-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  padding: var(--s-3) var(--s-4);
  align-items: center;
  border-bottom: 1px solid var(--paper-rule);
}

.week-row:last-child { border-bottom: none; }

.week-day {
  display: flex; flex-direction: column; gap: 1px;
}

.week-day .day-name { font-size: 14px; font-weight: 600; color: var(--ink-900); letter-spacing: -0.01em; }
.week-day .day-date { font-size: 11px; color: var(--ink-500); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

.week-cells {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.cell {
  aspect-ratio: 1 / 1.1;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
  cursor: pointer;
}

.cell.green { background: var(--score-green-bg); color: var(--score-green); border-color: rgba(46, 107, 62, 0.25); }
.cell.amber { background: var(--score-amber-bg); color: var(--score-amber); border-color: rgba(185, 132, 34, 0.25); }
.cell.red   { background: var(--score-red-bg);   color: var(--score-red);   border-color: rgba(142, 46, 46, 0.25); }
.cell.empty { background: transparent; color: var(--ink-300); border-color: var(--paper-rule); border-style: dashed; }

.cell:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ---------- Section header with micro-label ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: var(--s-6) 0 var(--s-3);
}

/* ---------- Window detail score ring ---------- */
.score-ring-wrap {
  display: grid;
  place-items: center;
  padding: var(--s-6) 0 var(--s-4);
}

.score-ring {
  position: relative;
  width: 168px; height: 168px;
  border-radius: 50%;
  background: var(--paper-surface);
  box-shadow: var(--shadow-md);
  /* Flex column so the {big number + caption} stack centers as a group.
     `display: grid; place-items: center` would put each child in its
     own centered cell, biasing the number toward the upper half. */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1.5px solid var(--brass-500);
}

.score-ring::before {
  content: '';
  position: absolute; inset: -10px;
  border-radius: 50%;
  border: 1px solid var(--brass-300);
  opacity: 0.6;
}

.score-ring .big {
  font-size: 68px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--forest-700);
  line-height: 1;
  text-align: center;
}

/* 3-digit score in the big ring */
.score-ring .big.three-digit { font-size: 56px; letter-spacing: -0.04em; }

.score-ring .of {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink-500);
  text-transform: uppercase;
  margin-top: 4px;
}

.score-ring-grade {
  margin-top: var(--s-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--score-green);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ---------- Scorecard cell ----------
   The hero element on window-detail.html. Mimics how a golfer fills
   in their stroke count: a printed cell (always present, thin black
   square), with a hand-drawn pencil marker (circle/double/square/
   double-square) drawn around the score. Par has no marker — the
   number stands alone, exactly like par on a paper card.

   The number is rendered in Caveat (a neat handwriting font), tilted
   slightly, in graphite color. The marker uses tier color via
   currentColor so green=birdie/eagle, amber=bogey, red=double-bogey. */

.scorecard-cell-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-6) 0 var(--s-4);
}

.scorecard-cell {
  width: 184px;
  height: 184px;
  background: var(--paper-surface);
  border: 2px solid var(--ink-900);
  border-radius: 3px;
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}

/* Tiny printed registration ticks at top-left + bottom-right —
   subtle "this came off a printed scorecard" detail. */
.scorecard-cell::before,
.scorecard-cell::after {
  content: '';
  position: absolute;
  width: 7px; height: 7px;
  pointer-events: none;
}
.scorecard-cell::before {
  top: 5px; left: 5px;
  border-top: 1px solid var(--ink-900);
  border-left: 1px solid var(--ink-900);
}
.scorecard-cell::after {
  bottom: 5px; right: 5px;
  border-bottom: 1px solid var(--ink-900);
  border-right: 1px solid var(--ink-900);
}

/* Pencil marker (circle/square) drawn inside the cell.
   Inset so it doesn't touch the printed border. */
.scorecard-cell .scorecard-marker {
  position: absolute;
  inset: 18px;
  pointer-events: none;
  color: var(--score-green);   /* default; JS overrides per grade tier */
  display: grid;
  place-items: center;
}

/* The score number — handwritten pencil style. */
.scorecard-cell .pencil-score {
  position: relative;
  z-index: 1;
  font-family: 'Caveat', 'Kalam', 'Bradley Hand', cursive;
  font-size: 96px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink-700);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  /* Slight tilt + subtle horizontal nudge so it doesn't look perfectly
     typeset — mirrors how an actual hand writes a number into a cell. */
  transform: rotate(-2deg) translateX(1px);
}

/* "100" needs to come down so it doesn't crowd the cell. */
.scorecard-cell .pencil-score.three-digit {
  font-size: 72px;
}

/* The "OUT OF 100" caption sits below the cell now, not inside. */
.scorecard-of {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink-500);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* ---------- Breakdown rows ---------- */
.breakdown {
  background: var(--paper-surface);
  border: 1px solid var(--paper-rule);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.bd-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  column-gap: var(--s-3);
  row-gap: 6px;
  padding: var(--s-4);
  border-bottom: 1px solid var(--paper-rule);
  align-items: center;
}

.bd-row:last-child { border-bottom: none; }

.bd-icon {
  width: 32px; height: 32px;
  background: var(--forest-100);
  color: var(--forest-700);
  border-radius: var(--r-sm);
  display: grid; place-items: center;
}

.bd-title { font-size: 14px; font-weight: 600; color: var(--ink-900); }
.bd-subtitle {
  grid-column: 2 / -1;
  font-size: 12px;
  color: var(--ink-500);
  line-height: 1.45;
}
.bd-value {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--forest-700);
  letter-spacing: -0.01em;
  text-align: right;
  min-width: 36px;
}
.bd-value.three-digit { font-size: 17px; letter-spacing: -0.02em; }

.bd-bar {
  grid-column: 1 / -1;
  margin-top: 4px;
  height: 4px;
  background: var(--paper-bg);
  border-radius: 2px;
  overflow: hidden;
}

.bd-bar > div {
  height: 100%;
  background: var(--forest-500);
  border-radius: 2px;
}

/* ---------- Hour-by-hour stack ----------
   One row per hour. Each row shows hour label, weather conditions,
   and that hour's score chip. Transparency-first: the user can scan
   down and see exactly which hour pulled the window's score up or down. */

.hour-stack {
  background: var(--paper-surface);
  border: 1px solid var(--paper-rule);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.hour-stack-header {
  display: grid;
  grid-template-columns: 50px 1fr 56px;
  column-gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--paper-bg);
  border-bottom: 1px solid var(--paper-rule);
}

.hour-stack-header .micro { color: var(--ink-500); }
.hour-stack-header .micro:nth-child(2) { text-align: left; }
.hour-stack-header .micro:nth-child(3) { text-align: right; }

.hour-row {
  display: grid;
  grid-template-columns: 50px 1fr 56px;
  column-gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  align-items: center;
  border-bottom: 1px solid var(--paper-rule);
}

.hour-row:last-child { border-bottom: none; }

.hour-row .hour-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.hour-row .hour-conds {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
  font-size: 12px;
  color: var(--ink-700);
  font-variant-numeric: tabular-nums;
}

.hour-row .hour-cond {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hour-row .hour-cond .label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink-500);
  text-transform: uppercase;
}

.hour-row .hour-score {
  height: 36px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
  letter-spacing: -0.01em;
}

.hour-row .hour-score.green { background: var(--score-green-bg); color: var(--score-green); border-color: rgba(46, 107, 62, 0.25); }
.hour-row .hour-score.amber { background: var(--score-amber-bg); color: var(--score-amber); border-color: rgba(185, 132, 34, 0.25); }
.hour-row .hour-score.red   { background: var(--score-red-bg);   color: var(--score-red);   border-color: rgba(142, 46, 46, 0.25); }
.hour-row .hour-score.three-digit { font-size: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 52px;
  padding: 0 var(--s-6);
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform 0.06s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--forest-700);
  color: var(--paper-surface);
  width: 100%;
}

.btn-primary:hover { background: var(--forest-500); }

.btn-ghost {
  background: transparent;
  color: var(--forest-700);
}

.btn-text {
  color: var(--forest-700);
  font-weight: 600;
  font-size: 14px;
}

/* ---------- Onboarding preset cards ---------- */
.progress-dots {
  display: flex; gap: 6px; justify-content: center; padding: var(--s-4) 0;
}

.dot { width: 18px; height: 3px; border-radius: 2px; background: var(--paper-rule); }
.dot.active { background: var(--forest-700); }
.dot.complete { background: var(--forest-300); }

.preset {
  background: var(--paper-surface);
  border: 1.5px solid var(--paper-rule);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  margin-bottom: var(--s-3);
  position: relative;
  cursor: pointer;
  transition: border-color 0.12s ease;
}

.preset.selected {
  border-color: var(--forest-700);
  box-shadow: var(--shadow-sm);
}

.preset.selected::after {
  content: '';
  position: absolute;
  top: -1px; right: -1px;
  width: 16px; height: 16px;
  border-top: 2px solid var(--brass-500);
  border-right: 2px solid var(--brass-500);
  border-top-right-radius: var(--r-lg);
}

.preset-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: var(--s-1);
}

.preset-title { font-size: 17px; font-weight: 700; color: var(--ink-900); letter-spacing: -0.01em; }
.preset-sub { font-size: 13px; color: var(--ink-500); line-height: 1.4; }
.preset-meta {
  display: flex; gap: var(--s-3);
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--paper-rule);
}

.preset-meta-item {
  display: flex; flex-direction: column; gap: 2px;
}

.preset-meta-item .mv-label { font-size: 9px; font-weight: 600; letter-spacing: 0.14em; color: var(--ink-500); text-transform: uppercase; }
.preset-meta-item .mv-val { font-size: 13px; font-weight: 600; color: var(--forest-700); font-variant-numeric: tabular-nums; }

/* ---------- Segmented control (round length toggle, etc.) ---------- */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--paper-bg);
  border: 1px solid var(--paper-rule);
  border-radius: var(--r-md);
  padding: 4px;
}

.segmented .seg {
  font: inherit;
  padding: 10px 12px;
  border-radius: calc(var(--r-md) - 4px);
  background: transparent;
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, box-shadow 0.14s;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none;
}

.segmented .seg .seg-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-500);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.segmented .seg.active {
  background: var(--forest-700);
  color: var(--paper-surface);
  box-shadow: var(--shadow-sm);
}

.segmented .seg.active .seg-sub {
  color: var(--brass-300);
}

/* ---------- Sliders (customize step) ---------- */
/* Each tolerance category sits in its own subtle recessed panel so the
   Tune > Weather settings read as visually separate categories (was a
   bare hairline divider, which felt cramped). */
.slider-group {
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-3);
  background: var(--paper-bg);
  border: 1px solid var(--paper-rule);
  border-radius: var(--r-md);
}

.slider-group:last-child { margin-bottom: 0; }

.slider-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-3);
}

.slider-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.005em;
}

.slider-sub {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 2px;
}

.slider-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--forest-700);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.slider {
  position: relative;
  height: 28px;
  margin: 0 10px;
}

.slider-track {
  position: absolute;
  top: 12px;
  left: 0; right: 0;
  height: 4px;
  background: var(--paper-rule);
  border-radius: 2px;
}

.slider-fill {
  position: absolute;
  top: 12px;
  height: 4px;
  background: var(--forest-500);
  border-radius: 2px;
}

.slider-thumb {
  position: absolute;
  top: 4px;
  width: 20px; height: 20px;
  margin-left: -10px;
  border-radius: 50%;
  background: var(--paper-surface);
  border: 2px solid var(--forest-700);
  box-shadow: var(--shadow-sm);
}

.slider-thumb::after {
  content: '';
  position: absolute;
  top: -3px; left: -3px;
  right: -3px; bottom: -3px;
  border-radius: 50%;
  border: 1px solid var(--brass-500);
  opacity: 0;
  transition: opacity 0.12s;
}

.slider-thumb.active::after { opacity: 0.8; }

.slider-bounds {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding: 0 2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-300);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* Toggle (lightning) */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--paper-rule);
}

.toggle-row:last-child { border-bottom: none; }

.toggle {
  width: 44px; height: 26px;
  background: var(--forest-700);
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px; right: 3px;
  width: 20px; height: 20px;
  background: var(--paper-surface);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.toggle.off { background: var(--paper-rule); }
.toggle.off::after { right: auto; left: 3px; }

.preset-bar {
  background: var(--paper-surface);
  border: 1px solid var(--paper-rule);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
}

.preset-bar .preset-bar-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 2px;
}

.preset-bar .preset-bar-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--forest-700);
}

/* ---------- Course list ---------- */
.course-row {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--paper-rule);
  align-items: center;
  gap: var(--s-3);
}

.course-row:last-child { border-bottom: none; }

.course-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 6px;
}

.course-loc {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 2px;
}

.star { color: var(--brass-500); }

/* ---------- Upgrade card ---------- */
.upgrade {
  margin-top: var(--s-6);
  background: var(--forest-700);
  color: var(--paper-surface);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  position: relative;
  overflow: hidden;
}

.upgrade::before {
  content: '';
  position: absolute;
  top: 10px; right: 12px;
  width: 12px; height: 12px;
  border-top: 1px solid var(--brass-300);
  border-right: 1px solid var(--brass-300);
}

.upgrade::after {
  content: '';
  position: absolute;
  bottom: 10px; left: 12px;
  width: 12px; height: 12px;
  border-bottom: 1px solid var(--brass-300);
  border-left: 1px solid var(--brass-300);
}

.upgrade-head { color: var(--brass-300); letter-spacing: 0.14em; font-size: 10px; font-weight: 700; text-transform: uppercase; margin-bottom: var(--s-2); }
.upgrade-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: var(--s-2); }
.upgrade-body { font-size: 13px; line-height: 1.5; opacity: 0.85; margin-bottom: var(--s-4); }

.upgrade .btn {
  background: var(--brass-500);
  color: var(--forest-700);
  height: 42px;
  width: 100%;
}

/* ---------- Back / nav links ---------- */
.nav-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--forest-700);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Launcher (index page) ---------- */
.launch {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 24px;
  color: var(--ink-900);
}

.launch h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-2);
  color: var(--forest-700);
}

.launch p {
  font-size: 16px;
  color: var(--ink-700);
  margin-bottom: var(--s-8);
  max-width: 560px;
}

.launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s-6);
}

.launch-card {
  background: var(--paper-surface);
  border: 1px solid var(--paper-rule);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-3);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.launch-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.launch-thumb {
  aspect-ratio: 393 / 520;
  background: var(--paper-bg);
  border: 1px solid var(--paper-rule);
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
}

.launch-title { font-size: 18px; font-weight: 700; color: var(--ink-900); letter-spacing: -0.01em; }
.launch-desc { font-size: 13px; color: var(--ink-500); line-height: 1.45; }

/* ---------- Inline SVG icon defaults ---------- */
svg.i { width: 20px; height: 20px; stroke-width: 1.8; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }
svg.i-sm { width: 14px; height: 14px; stroke-width: 2; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }
svg.i-lg { width: 28px; height: 28px; stroke-width: 1.5; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Utility ---------- */
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mb-2 { margin-bottom: var(--s-2); }
.mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); }
.center { text-align: center; }
.pad-5 { padding: var(--s-5); }

/* ---- Loading skeletons (shimmer). Generic `.sk` — used by the hero
   "Scoreboard" loading card and any future skeleton. ---- */
.sk {
  background: linear-gradient(90deg, var(--paper-surface) 0%, var(--paper-rule) 50%, var(--paper-surface) 100%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.6s ease-in-out infinite;
  border-radius: 4px; display: block;
}
.sk-label { height: 9px; width: 70px; }
.sk-line  { height: 14px; width: 140px; }
@keyframes sk-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Phase G cleanup: removed the dead `hero-c3-*` hero-card CSS (replaced
   by `hero-sb-*` in Phase E) and the entire Course-View `cv-*` CSS
   (course.html / course.js deleted in Phase E) — ~900 lines pruned. */

/* =========================================================
   Scorecard modal (v2 / Phase D) — shared detail surface.
   Mounts into .screen; component in components/scorecard-modal.js.
   ========================================================= */
.sc-backdrop {
  position: absolute; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-5);
  background: rgba(16, 26, 18, 0.42);
  -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.sc-backdrop.open { opacity: 1; pointer-events: auto; }

.sc-modal {
  width: 100%; max-height: 82%;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper-surface);
  border: 1px solid var(--paper-rule); border-radius: var(--r-modal);
  box-shadow: 0 24px 60px rgba(20, 26, 18, 0.32);
  transform: translateY(28px); opacity: 0.4;
  transition: transform 0.26s cubic-bezier(.2,.8,.2,1), opacity 0.26s;
}
.sc-backdrop.open .sc-modal { transform: translateY(0); opacity: 1; }

.sc-head {
  flex-shrink: 0; display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s-3); padding: 16px 18px 12px; border-bottom: 1px solid var(--paper-rule);
}
.sc-eyebrow {
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--brass-500);
}
.sc-course {
  font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.15;
  color: var(--forest-700); letter-spacing: -0.01em; margin-top: 3px;
}
.sc-close {
  flex-shrink: 0; width: 30px; height: 30px; display: grid; place-items: center;
  background: none; border: none; color: var(--ink-500); cursor: pointer; border-radius: var(--r-sm);
}
.sc-close:hover { background: rgba(16, 32, 26, 0.05); }

.sc-scroll { overflow-y: auto; padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px)); }

/* Best-window block */
.sc-best { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.sc-best-l { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-start; }
/* Score numeral stays bold SANS (Inter), not serif — locked decision. */
.sc-score { font-family: var(--sans); font-weight: 700; font-size: 56px; line-height: 0.82; letter-spacing: -0.03em; color: var(--forest-700); font-variant-numeric: tabular-nums; }
.sc-grade { font-family: var(--sans); font-weight: 700; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; margin-top: 4px; }
.sc-best-r { flex: 1; min-width: 0; }
.sc-best-k { font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-500); }
.sc-best-range { font-family: var(--sans); font-size: 17px; font-weight: 600; color: var(--ink-900); margin-top: 3px; }
.sc-best-meta { font-family: var(--mono); font-size: 11.5px; color: var(--ink-500); margin-top: 5px; }
.sc-reset { margin-top: 6px; background: none; border: none; padding: 0; cursor: pointer; font-family: var(--sans); font-size: 11.5px; font-weight: 600; color: var(--brass-500); text-decoration: underline; }

/* Day-profile chart */
.sc-chart-wrap { background: rgba(217, 207, 181, 0.18); border: 1px solid var(--paper-rule); border-radius: var(--r-md); padding: 10px 8px 6px; margin-bottom: 14px; }
.sc-chart-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 6px 4px; }
.sc-chart-k { font-family: var(--sans); font-size: 9.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-500); }
.sc-chart-hint { font-family: var(--serif); font-style: italic; font-size: 11px; color: var(--brass-500); }
.sc-chart-svg { width: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.sc-window { cursor: grab; }
.sc-window:active { cursor: grabbing; }

/* Scored-rules table */
.sc-rules { display: block; margin-bottom: 14px; }
.sc-rules-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 24px; column-gap: 8px; align-items: center; border: 1px solid var(--paper-rule); border-radius: var(--r-md); padding: 4px 12px 8px; }
.sc-rh { font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-500); padding: 8px 0 6px; }
.sc-rh.r { text-align: right; } .sc-rh.c { text-align: center; }
.sc-rule { font-size: 12.5px; color: var(--ink-900); padding: 7px 0; border-top: 1px solid var(--paper-rule); }
.sc-pref { font-family: var(--mono); font-size: 12px; color: var(--ink-500); text-align: right; padding: 7px 0; border-top: 1px solid var(--paper-rule); }
.sc-val { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-900); text-align: right; padding: 7px 0; border-top: 1px solid var(--paper-rule); }
.sc-val.fail { color: var(--score-red); }
.sc-ck { font-size: 12px; font-weight: 700; text-align: center; padding: 7px 0; border-top: 1px solid var(--paper-rule); }
.sc-ck.pass { color: var(--score-green); } .sc-ck.fail { color: var(--score-red); }

/* "Also in this window" — not scored */
.sc-also { margin-top: 0; border: 1px solid var(--paper-rule); border-radius: var(--r-md); overflow: hidden; }
.sc-also-head { display: flex; align-items: baseline; justify-content: space-between; padding: 9px 12px; background: var(--paper-band); }
.sc-also-k { font-family: var(--sans); font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-500); }
.sc-also-note { font-family: var(--serif); font-style: italic; font-size: 10.5px; color: var(--ink-500); }
.sc-also-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-top: 1px solid var(--paper-rule); font-size: 12.5px; color: var(--ink-900); }
.sc-also-row .num { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-700); }

/* Add to Tee Times — compact header pill (moved out of the scroll so it
   never requires scrolling to reach). */
.sc-head-actions { flex-shrink: 0; display: flex; align-items: center; gap: var(--s-2); }
.sc-add-mini { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; background: var(--forest-700); color: var(--paper-surface); border: none; border-radius: 999px; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.01em; cursor: pointer; white-space: nowrap; transition: background 0.14s, transform 0.12s; }
.sc-add-mini:hover { background: var(--forest-600); }
.sc-add-mini:active { transform: scale(0.97); }
.sc-add-mini.done { background: var(--score-green); }
.sc-add-mini .sc-add-ico { display: grid; place-items: center; }
.sc-add-mini .sc-add-ico svg { width: 14px; height: 14px; }

.sc-unavailable { padding: var(--s-8) var(--s-4); text-align: center; color: var(--ink-500); font-size: 13px; }

/* =========================================================
   Hero "Scoreboard" card + 10-day outlook (v2 / Phase E).
   ========================================================= */
.hero-sb-card {
  position: relative; background: var(--paper-surface);
  border: 1px solid var(--paper-rule); border-radius: var(--r-sm);
  box-shadow: var(--shadow-card); padding: 16px 18px 18px;
}
.hero-sb-brass { position: absolute; width: 15px; height: 15px; border: 1.5px solid var(--brass-500); pointer-events: none; }
.hero-sb-brass.tl { top: 9px; left: 9px; border-right: none; border-bottom: none; }
.hero-sb-brass.br { bottom: 9px; right: 9px; border-left: none; border-top: none; }

.hero-sb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.hero-sb-head-l { min-width: 0; }
.hero-sb-eyebrow { display: flex; align-items: center; gap: 4px; font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass-500); }
.hero-sb-eyebrow span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-sb-pin { flex-shrink: 0; }
.hero-sb-course { font-family: var(--serif); font-weight: 600; font-size: 23px; line-height: 1.1; color: var(--forest-700); letter-spacing: -0.01em; margin-top: 4px; }
.hero-sb-actions { flex-shrink: 0; display: flex; gap: 2px; }
.hero-sb-iconbtn { width: 32px; height: 32px; display: grid; place-items: center; background: none; border: none; color: var(--ink-500); cursor: pointer; border-radius: var(--r-sm); }
.hero-sb-iconbtn:hover { background: rgba(16,32,26,0.05); color: var(--forest-700); }
.hero-sb-hair { height: 1px; background: var(--paper-rule); margin: 13px 0; }

/* Score block — fixed 3-col so it never resizes on day/mode change */
.hero-sb-scoreblock { display: grid; grid-template-columns: 120px 1px 1fr; gap: 14px; align-items: stretch; }
.hero-sb-score-l { display: flex; flex-direction: column; justify-content: center; text-align: center; }   /* center score+grade+"out of 100" in the stretched cell (was top-nudged) */
/* Score numeral: bold SANS (locked decision), not serif. */
.hero-sb-score { font-family: var(--sans); font-weight: 700; font-size: 60px; line-height: 0.85; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--forest-700); }
.hero-sb-score.three-digit { font-size: 48px; }
.hero-sb-grade { font-family: var(--sans); font-weight: 700; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; margin-top: 9px; white-space: nowrap; }
.hero-sb-outof { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-500); margin-top: 5px; }
.hero-sb-vdiv { background: var(--paper-rule); }
.hero-sb-score-r { padding-top: 2px; min-width: 0; }
.hero-sb-bw-k { font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass-500); }
.hero-sb-bw-range { font-family: var(--sans); font-size: 14.5px; font-weight: 600; color: var(--ink-900); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-sb-bw-range.no-window { color: var(--score-red); }
.hero-sb-bw-date { font-family: var(--mono); font-size: 9.5px; color: var(--ink-500); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.hero-sb-tiles { display: flex; gap: 6px; margin-top: 11px; }
.hero-sb-tile { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: 7px; background: var(--paper-band); border: 1px solid var(--paper-rule); }
.hero-sb-tile-k { font-family: var(--sans); font-size: 8px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-500); }
.hero-sb-tile-v { font-family: var(--mono); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-900); white-space: nowrap; }
.hero-sb-tile-u { opacity: 0.6; }

/* Outlook rail */
.hero-sb-outlook-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: var(--s-2); }
.hero-sb-outlook-k { font-family: var(--sans); font-size: 9.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-500); }
.hero-sb-outlook-ctl { display: flex; align-items: center; gap: 8px; }
.hero-sb-details { font-family: var(--sans); font-size: 10.5px; font-weight: 700; color: var(--forest-700); background: var(--paper-surface); border: 1px solid var(--paper-rule); border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.hero-sb-details:hover { border-color: var(--forest-300); }
.hero-sb-mode { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: var(--paper-band); border: 1px solid var(--paper-rule); }
.hero-sb-mode-btn { width: 30px; height: 22px; display: grid; place-items: center; border: none; background: none; color: var(--ink-500); cursor: pointer; border-radius: 6px; transition: background 0.12s, color 0.12s; }
.hero-sb-mode-btn.active { background: var(--forest-700); color: var(--paper-surface); }
.hero-sb-outlook-scroll { display: flex; gap: 1px; overflow-x: auto; scrollbar-width: none; }
.hero-sb-outlook-scroll::-webkit-scrollbar { display: none; }
.hero-sb-day { position: relative; flex: 0 0 calc((100% - 6px) / 7); height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 2px; border: none; background: none; cursor: pointer; border-radius: 4px; transition: background 0.12s; }
/* Weekend-filter cue: non-weekend days recede so weekend cells stand out. */
.hero-sb-day.dimmed { opacity: 0.4; }
.hero-sb-day.sel { background: rgba(160,120,42,0.12); }
.hero-sb-day.sel::before, .hero-sb-day.sel::after { content: ''; position: absolute; width: 7px; height: 7px; border: 1.25px solid var(--brass-500); }
.hero-sb-day.sel::before { top: 4px; left: 2px; border-right: none; border-bottom: none; }
.hero-sb-day.sel::after { bottom: 4px; right: 2px; border-left: none; border-top: none; }
.hero-sb-star { position: absolute; top: 1px; right: 4px; color: var(--brass-500); font-size: 9px; line-height: 1; z-index: 2; }
.hero-sb-day-letter { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-500); }
.hero-sb-day.sel .hero-sb-day-letter { color: var(--forest-700); }
.hero-sb-day-date { font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--ink-300); }
/* Outlook day score: bold sans (locked decision), not serif. */
.hero-sb-day-score { font-family: var(--sans); font-size: 17px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; margin-top: 1px; }
.hero-sb-bars { display: flex; align-items: flex-end; justify-content: center; gap: 1.5px; height: 30px; }
.hero-sb-bar { width: 4px; border-radius: 1px; }

.hero-sb-sun { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--paper-rule); font-family: var(--mono); font-size: 11px; color: var(--ink-700); }
.hero-sb-sun-icon { width: 15px; height: 15px; color: var(--brass-500); }
.hero-sb-sun-sep { color: var(--ink-300); }

.hero-sb-errband { padding: var(--s-5) var(--s-3); text-align: center; }
.hero-sb-errband-t { font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--score-red); }
.hero-sb-errband-s { font-size: 12px; color: var(--ink-500); margin-top: 5px; }

/* =========================================================
   Kebab menu (anchored dropdown on the hero card).
   ========================================================= */
.kebab-menu {
  position: absolute; z-index: 45; top: 46px; right: 16px;
  background: var(--paper-surface); border: 1px solid var(--paper-rule);
  border-radius: 10px; box-shadow: 0 12px 30px rgba(20,26,18,0.18);
  padding: 6px; min-width: 196px;
}
.kebab-item { display: flex; align-items: center; gap: 11px; width: 100%; background: none; border: none; cursor: pointer; text-align: left; padding: 10px 11px; border-radius: 7px; font-family: var(--sans); font-size: 13.5px; color: var(--ink-900); }
.kebab-item:hover { background: rgba(160,120,42,0.10); }
.kebab-item .i { width: 16px; height: 16px; flex-shrink: 0; color: var(--ink-500); }
.kebab-item.danger { color: var(--score-red); }
.kebab-item.danger .i { color: var(--score-red); }
.kebab-item .pro { margin-left: auto; font-family: var(--sans); font-size: 8.5px; font-weight: 600; letter-spacing: 0.12em; color: var(--brass-500); border: 1px solid var(--brass-500); border-radius: 4px; padding: 2px 4px; }
.kebab-sep { height: 1px; background: var(--paper-rule); margin: 5px 4px; }

/* =========================================================
   Bottom sheet (shared) — slides up from the bottom of .screen.
   Used by the Tune profile switcher, the Home share sheet, and the
   Tee Times new/edit form. (Previously scoped inside customize.html;
   moved here in Phase F so every page's sheet is actually styled —
   that omission was the Home "share sheet" styling bug.)
   ========================================================= */
.sheet-backdrop {
  position: absolute; inset: 0; z-index: 50; background: rgba(20, 24, 20, 0.4);
  display: flex; align-items: flex-end; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; background: var(--paper-bg);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: var(--s-4) var(--s-5) calc(var(--s-5) + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%); transition: transform 0.22s ease; max-height: 80%; overflow-y: auto;
}
.sheet-backdrop.open .sheet { transform: translateY(0); }
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--paper-rule); margin: 0 auto var(--s-3); }
.sheet-title { font-family: var(--serif); font-weight: 700; font-size: 19px; color: var(--ink-900); margin-bottom: var(--s-3); }

/* =========================================================
   Share sheet (reuses .sheet-backdrop / .sheet bottom-sheet).
   ========================================================= */
/* Rendered share-image preview (WYSIWYG — the exact PNG that gets shared) */
.share-preview { display: grid; place-items: center; min-height: 160px; border-radius: 12px; background: var(--paper-band); border: 1px solid var(--paper-rule); overflow: hidden; }
.share-img { display: block; width: 100%; height: auto; }
.share-preview-load { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-500); }

.share-card { border-radius: 12px; overflow: hidden; border: 1px solid var(--paper-rule); box-shadow: 0 10px 26px -16px rgba(40,30,10,0.4); }
.share-brandbar { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 11px; background: var(--forest-700); }
.share-brandbar .wm { font-family: var(--serif); font-weight: 600; font-size: 18px; color: var(--paper-surface); letter-spacing: -0.005em; }
.share-scorecard { position: relative; background: var(--paper-surface); padding: 16px 18px; }
.share-scorecard .hero-sb-brass { width: 13px; height: 13px; }
.share-channels { display: flex; gap: 6px; margin-top: 18px; }
.share-chan { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; background: none; border: none; cursor: pointer; }
.share-chan-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 17px; }
.share-chan-l { font-family: var(--sans); font-size: 10.5px; font-weight: 500; color: var(--ink-700); }
.share-copy { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 16px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--paper-rule); background: var(--paper-band); cursor: pointer; font-family: inherit; }
.share-copy .i { width: 16px; height: 16px; flex-shrink: 0; color: var(--ink-700); }
.share-copy.copied .i { color: var(--score-green); }
.share-copy .lnk { font-family: var(--mono); font-size: 12.5px; font-weight: 500; flex: 1; text-align: left; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-copy.copied .lnk { color: var(--score-green); }
