/* HÉBÉ shared design system — single source of truth for palette, type,
   and motion across every page (index.html scan, onboarding.html,
   recommend.html dashboard).

   2026-08-23 rebrand: this file now implements the finalized brand
   handoff (Downloads/HÉBÉ brand guide design/exports/HANDOFF.md +
   hebe-tokens.css/json), superseding the earlier Fraunces/Italiana/
   Cormorant Garamond system documented in git history. Source of truth
   for color/type/logo is that handoff, not hebe_brand.md's older values
   (hebe_brand.md has been updated to match — see its own note). Read
   HANDOFF.md's "Component rules" before adding anything new: bronze is
   an accent only and never fills a large field, cards take no border/
   shadow, the tab bar has no icons.

   Direction: warm neutrals carry the interface; primary text (--ink) is
   bronze-metallic in both themes — a deep bronze on the light warm-white/
   sand ground, a light bronze-gold on the dark charcoal ground — per
   user feedback after the initial handoff-literal pass (charcoal ink)
   shipped: the bronze-toned text was part of what made the app feel
   premium and was missed, especially on dark. --ink is derived from
   --gold's own hue at a much darker/lighter lightness rather than the
   handoff's literal charcoal, so body text and the accent still read as
   one coherent metallic family instead of two unrelated colors. --gold
   itself stays the single vivid highlight, used sparingly (the brand
   mark, active states, CTAs) — never decorative, never frequent. No
   saturated colour anywhere — status and warnings read through ink
   weight and fine marks, never red.

   Dark theme derivation: the handoff doesn't define a full dark palette,
   but it does name --hebe-charcoal-2 ("raised card on dark") and
   --hebe-taupe-light ("secondary text ON dark surfaces") explicitly, and
   its own app-icon/reversed-logo assets use warm-white ink on a charcoal
   ground — enough to derive the rest of a real dark theme in the same
   spirit rather than leave the app's existing light/dark toggle
   stranded. --muted's dark value is brightened (not the literal taupe-
   light hex) for the same reason --muted's light value is darkened below
   — see that comment.

   Legacy token names (--cream, --charcoal, --warn, …) are kept as aliases
   mapped onto the new palette so pages migrate cleanly one at a time
   without a flash of the old colours. New/converted pages use the
   canonical names (--warm-white, --stone, --ink, --muted, --accent, …).

   Typography: Newsreader is the brand serif for headline moments —
   HANDOFF.md: never below 15px. It is NOT the logo: the lockup
   (hebe-logo.svg) is "HÉBÉ" in Helvetica Neue Light caps with 0.16em
   tracking plus the capsule mark, as on hebehealth.app. Helvetica Neue (below) is UI/body text throughout — an
   earlier pass used Work Sans for this role; the Helvetica Neue redesign
   (below) replaced it everywhere, and its now-unused @font-face/asset
   were removed 2026-09-11 rather than left loading dead weight. No
   separate wordmark-only face this time (the old Italiana rule): the
   real lockup is the hebe-logo.svg/.png asset; --wordmark below is for
   small inline brand mentions (the "HÉBÉ · home" breadcrumb pattern) set
   live in Newsreader, not a full lockup replacement.

   2026-08-24: the Google Fonts @import that used to live on the next
   line is gone, and the fonts are now self-hosted (static/fonts/, below)
   rather than fetched from fonts.googleapis.com at all. Real incident:
   @import inside an authored stylesheet is render-blocking for the WHOLE
   file it's in, including every rule below it -- every page's own local
   <style> block (structural CSS: flex, padding, radius) rendered fine
   regardless, since it has no external dependency, but every color/font
   that resolves through a var(--ink)/var(--gold)/var(--serif)/
   var(--stone) token defined in THIS file's :root stayed unresolved
   until the Google Fonts fetch finished. On a slow or filtered
   connection to fonts.googleapis.com that's an indefinite, silent hold —
   the exact "structure is fine, every color and font defaulted to plain
   black/serif" failure reported against account.html and recommend.html.
   This sandbox's fast, unfiltered path to Google Fonts never reproduced
   it. A non-blocking <link> (loading the same Google-hosted CSS from
   each page's own <head> instead of via @import) would have fixed the
   blocking, but still left the app's actual typography hostage to
   fonts.googleapis.com being reachable at all -- self-hosting removes
   that dependency entirely rather than just making its failure mode less
   bad. */

@font-face {
  font-family: 'Newsreader';
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  src: url('/fonts/Newsreader-Variable.woff2') format('woff2');
}
/* ── Helvetica Neue — the redesign's primary face (the reference's own
   type, supplied as OTFs and converted here to latin-subset woff2: 2.3MB
   of desktop fonts down to 135KB across six upright weights). Six
   separate @font-face rules rather than one variable file because
   Helvetica Neue predates variable fonts — there is no weight axis, just
   discrete cuts.

   The sub-400 weights are the point: the reference's whole character is
   Helvetica Neue UltraLight/Thin set very large (see --text-display /
   .hebe-display below). Never set 100/200 below ~28px — a hairline
   stroke at body size is unreadable, and at that size 400 is correct.

   Self-hosted for the same render-blocking reason in this file's header
   — never re-add a Google Fonts @import. NOTE: Helvetica Neue is a
   commercial Linotype/Monotype face; shipping it in a public app needs a
   webfont licence. ── */
@font-face { font-family: 'Helvetica Neue App'; font-weight: 100; font-style: normal; font-display: swap; src: url('/fonts/HelveticaNeue-100.woff2') format('woff2'); }
@font-face { font-family: 'Helvetica Neue App'; font-weight: 200; font-style: normal; font-display: swap; src: url('/fonts/HelveticaNeue-200.woff2') format('woff2'); }
@font-face { font-family: 'Helvetica Neue App'; font-weight: 300; font-style: normal; font-display: swap; src: url('/fonts/HelveticaNeue-300.woff2') format('woff2'); }
@font-face { font-family: 'Helvetica Neue App'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/HelveticaNeue-400.woff2') format('woff2'); }
@font-face { font-family: 'Helvetica Neue App'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/HelveticaNeue-500.woff2') format('woff2'); }
@font-face { font-family: 'Helvetica Neue App'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/HelveticaNeue-700.woff2') format('woff2'); }

:root {
  color-scheme: light dark;

  /* ── canonical palette — LIGHT (default) ──
     From HANDOFF.md: warm-white ground, sand cards, charcoal ink, bronze
     as the one sparing accent. Named --warm-white/--stone/--ink/etc. to
     match this file's existing token names rather than the handoff's own
     --hebe-* prefixes — --stone now IS the handoff's "sand" (cards), and
     --faint now IS the handoff's "stone" (dividers/track), so the role
     each token plays is unchanged even though the hex values moved. */
  --warm-white: #F7F4EF;   /* page ground */
  --stone:      #EDEAE2;   /* cards / panels ("sand" in the handoff) */
  --stone-lift: #F1EEE7;   /* raised inner surface — handoff doesn't define a third light tier; derived between warm-white and stone */
  --surface:    #FFFFFF;   /* input/field fill */
  /* --ink: user feedback after shipping the charcoal-ink rebrand — missed
     the bronze-metallic text identity the app had before (both the
     accent AND colored ink, especially in dark mode), and wanted it back
     without reverting the new brand's actual hue. So this isn't the old
     --ink hex restored verbatim: it's the handoff's own --hebe-bronze
     (#B87333) hue, held at a much darker lightness for body-text
     contrast — same relationship as before (ink = a deep, muted version
     of the accent's hue, --gold = the vivid version), now derived from
     the new brand's bronze rather than the old, unrelated gold. */
  --ink:        #603C1B;   /* primary text — bronze-metallic, dark */
  /* --muted/--placeholder: the handoff's literal taupe (#8A8175) measures
     3.19-3.83:1 against this theme's backgrounds -- under WCAG AA's
     4.5:1, and worse than what was here before. Same fix as the
     pre-rebrand Phase 6 contrast pass: darken the same hue until it
     clears 4.5:1 against the darkest real background (--stone), rather
     than use the swatch value verbatim on functional text (labels,
     captions, placeholders shown at 10.5-13px throughout). Verified, not
     eyeballed -- see the contrast table in this session's design log. */
  --muted:      #70695F;   /* secondary text — corrected taupe */
  --placeholder:#70695F;   /* handoff gives one taupe for both roles */
  --accent:     #70695F;   /* NOTE: quiet by design, aliases --muted. The single
                              warm HIGHLIGHT the spec calls for is --gold below,
                              used sparingly (the mark, active nav, CTAs). */
  --gold:       #B87333;   /* THE one warm accent — "bronze," used sparingly per the handoff */
  --metallic-a: #8C4A1E;   /* brand gradient, deep stop — matches hebe-logo.svg/hebe-mark.svg exactly */
  --metallic-b: #E8B489;   /* brand gradient, light stop */
  --metallic-c: #7A3E19;   /* brand gradient, deepest stop (gradient's 100% mark) */
  /* Real bug (2026-08-31): .hebe-btn.primary's text used to read
     var(--warm-white) directly. --warm-white is a page-GROUND token (light
     in light mode, near-black in dark mode) -- fine for a flat surface, but
     this button's background is the animated 5-stop metallic gradient
     (metallic-a...metallic-b...metallic-a), which spans from a dark stop
     (metallic-a, relative luminance ~0.11) to a light one (metallic-b,
     ~0.52) in EITHER theme, since the gradient stops themselves are
     theme-invariant. In dark mode, --warm-white's near-black value gave
     ~10:1 contrast against the light half of the shimmer but only ~2.78:1
     against the dark half (measured) -- a real WCAG AA failure, not just a
     light-mode/dark-mode mismatch. No single fixed color can hit 4.5:1
     against both ends of this gradient's actual range (verified: the
     theoretical best-case single-luminance compromise tops out around
     1.9:1) -- the light-mode value already reads acceptably throughout in
     practice (a light text stays legible against this bronze family), so
     fixing this means keeping that SAME light value in both themes rather
     than letting it invert with the page ground. */
  --btn-primary-text: #F7F4EF;
  --deep:       #8C4A1E;   /* maximum emphasis, and the weight that replaces red — bronze-deep */
  --faint:      #E4DFD4;   /* hairlines, empty tracks ("stone" in the handoff) */
  --hair:       rgba(228, 223, 212, 0.5);   /* softer than --faint — between-row dividers */

  /* ── type ──
     The redesign moves the app onto Helvetica Neue as its voice. --sans
     is now Helvetica for ALL UI text; --serif (Newsreader) is retained
     but demoted to the narrative quote only — the one place an editorial
     italic still earns its place. --headline is Helvetica too: the
     reference's headlines are thin grotesque set large, not serif. */
  --sans:     'Helvetica Neue App', 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;
  --headline: 'Helvetica Neue App', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --serif:    'Newsreader', Georgia, 'Times New Roman', serif;   /* narrative quote only */
  --wordmark: 'Helvetica Neue App', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* ── type scale — rebuilt around the reference's much wider dynamic
     range. The old scale topped out at 48px and never went below 400
     weight, so every screen read at one uniform volume. Display sizes
     are meant to be paired with --weight-display (200) and
     --track-display; see .hebe-display. ── */
  --text-mega:    68px;   /* the single hero numeral / statement per screen */
  --text-display: 44px;   /* screen-opening headline */
  --text-h1:      30px;   /* page-level headline */
  --text-h2:      21px;   /* section/card title */
  --text-body:    15px;   /* base UI text */
  --text-caption: 12.5px; /* secondary read (labels, notes) */
  --text-micro:   11px;   /* eyebrows, uppercase tags — 11px is the floor for
                             functional text; wide tracking makes small caps
                             harder to read, not easier, so this never goes lower */

  /* Thin weights + negative tracking are what make Helvetica read as
     display rather than as big body text. Optical tracking tightens as
     size grows — the reference's headlines are noticeably tight. */
  --weight-display: 200;
  --weight-light:   300;
  --weight-body:    400;
  --weight-medium:  500;
  --track-mega:    -0.035em;
  --track-display: -0.025em;
  --track-h1:      -0.02em;
  --track-eyebrow:  0.22em;   /* the wide-tracked uppercase eyebrow, straight off Eight Sleep */

  /* ── aurora + glass — LIGHT.
     The three references split two-to-one on this: Hims is a pale blue-grey
     with a bright orb, Pinterest is a light pastel mesh, and only Eight
     Sleep is dark. So the aurora is themed rather than forced dark — light
     gets the airy pastel mesh, dark gets the luminous one (further down).
     The blobs blend `normal` here; `plus-lighter` over a light ground just
     blows out to white. ── */
  --aurora-ground: #F4EADC;
  --aurora-blend:  normal;
  --aurora-blur:   46px;
  --aurora-1: rgba(250, 212, 144, 0.92);   /* pale brass */
  --aurora-2: rgba(242, 172, 128, 0.86);   /* apricot */
  --aurora-3: rgba(231, 162, 154, 0.78);   /* dusty rose */
  --aurora-4: rgba(255, 205, 168, 0.74);   /* warm peach */
  --aurora-5: rgba(255, 250, 241, 0.88);   /* cream highlight */
  /* Light-mode scrim LIFTS the centre instead of darkening it — the text
     over it is dark, so legibility needs more light there, not less. */
  --aurora-scrim: rgba(255, 251, 245, 0.42);
  --aurora-edge:  rgba(150, 108, 66, 0.20);
  --aurora-ink:     #4A2E14;
  --aurora-ink-dim: #7A6550;
  --aurora-grain-blend: multiply;
  --aurora-grain-alpha: 0.05;

  --glass-bg:     linear-gradient(158deg, rgba(255,255,255,0.62) 0%, rgba(255,255,255,0.34) 46%, rgba(255,255,255,0.20) 100%);
  --glass-rim:    rgba(255,255,255,0.85);
  --glass-edge:   rgba(120, 88, 56, 0.16);
  /* 2026-09-01: a crisp, fully-visible perimeter border (not just the
     faint inset --glass-edge highlight above) -- per the exact reference
     the user pointed to (a Figma glassmorphism community file), whose
     card has a bright, clearly-drawn stroke on all four sides. Bronze-
     tinted rather than that reference's neon pink, same "one accent"
     restraint as everywhere else. */
  --glass-border: rgba(184, 115, 51, 0.38);
  --glass-under:  rgba(120, 88, 56, 0.10);
  --glass-drop:   0 18px 40px -18px rgba(90, 62, 34, 0.34);
  /* Inset controls (inputs, switch troughs) sitting ON a glass pane —
     recessed rather than raised, so they read as cut into the surface. */
  /* Shader palette (aurora.js). Solid hex, no alpha: the shader mixes
     these itself rather than compositing translucent layers. c0 is the
     ground the flow sits in; c4 is the brightest highlight. */
  --aurora-c0: #F7EFE3;
  --aurora-c1: #F3C165;
  --aurora-c2: #EC9159;
  --aurora-c3: #DE8189;
  --aurora-c4: #FFD2A1;
  --aurora-additive: 0;   /* light theme tints toward each light */
  --aurora-gain: 1.0;
  --aurora-dither: 0.020;
  --field-bg:       rgba(255,255,255,0.42);
  --field-bg-focus: rgba(255,255,255,0.66);
  --switch-trough:  rgba(140, 104, 64, 0.10);

  /* ── spacing scale — magic-number margins/paddings migrate onto this
     during Phase 4 page passes. ── */
  --space-4: 4px;   --space-8: 8px;   --space-12: 12px;  --space-16: 16px;
  --space-24: 24px; --space-32: 32px; --space-48: 48px;  --space-64: 64px;

  /* ── radius scale (HANDOFF.md: sm 8 / md 10 / lg 20 / pill) ── */
  --radius-sm:   8px;    /* dose-gauge zone/tooltip */
  --radius-md:   10px;   /* cards (mechanism-card et al) */
  --radius-lg:   20px;   /* large blocks (skeleton loaders) */
  --radius-pill: 999px;  /* fully-rounded chips/pills/bars */

  /* ── elevation scale — 3 levels max. --shadow-sm is today's one real
     recipe (was a repeated rgba literal on the dose-gauge marker);
     --shadow-md/--shadow-lg are prepared for the finding-card's expanded
     state and future sheets/modals, same "define ahead of the consumer"
     pattern as --dur-slow below. ── */
  --shadow-sm: 0 2px 8px -1px rgba(43, 40, 35, 0.28);
  --shadow-md: 0 6px 20px -4px rgba(43, 40, 35, 0.32);
  --shadow-lg: 0 16px 40px -8px rgba(43, 40, 35, 0.36);

  /* ── motion — weighted, luxurious, never bouncy ── */
  --ease:     cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-lux: cubic-bezier(0.16, 1, 0.30, 1);   /* slow-out, heavy settle */
  --ease-pop: cubic-bezier(0.23, 1, 0.32, 1);   /* strong ease-out, used for range/tick pop-ins */
  --dur-instant: 0.12s;  /* micro-feedback, e.g. button press */
  --dur-quick:   0.28s;
  --dur-calm:    0.55s;
  --dur-slow:    0.85s;  /* consumed by recommend.html's goal-coverage bar-fill transition */
  --stagger-base: 0.02s; /* .hebe-stagger's first-child delay */
  --stagger-step: 0.06s; /* .hebe-stagger's per-child increment */

  /* ── legacy aliases → new palette (so un-migrated pages inherit the look) ── */
  --cream:         var(--warm-white);
  --cream-lift:    var(--stone-lift);
  --paper:         var(--stone);
  --charcoal:      var(--ink);
  --charcoal-soft: var(--deep);
  --line:          var(--faint);
  --line-soft:     var(--stone);
  --warn:          var(--deep);   /* deliberately NOT red */
}

/* ── DARK — charcoal ground, warm-white ink ──
   Derived (see header comment): the handoff names --hebe-charcoal-2
   ("raised card on dark") and --hebe-taupe-light ("secondary text ON
   dark surfaces") explicitly, and its own app-icon uses warm-white ink
   on a charcoal ground — this extends that into a full theme rather
   than leave the existing light/dark toggle without real dark values.
   System-preference signal; a manual override (below) always wins. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    /* 2026-08-25 redesign: deepened from the original #2B2823 warm-charcoal
       toward a real near-black per the approved concept-board direction
       ("B — darker premium", an Eight-Sleep-style dark dashboard feel,
       HÉBÉ's bronze standing in for Eight Sleep's navy). Still warm, not
       neutral/cool black — same undertone as the light theme's warm-white,
       just pushed to the opposite end. Contrast only ever improves going
       darker for a fixed-lightness ink/muted color against it, so --ink/
       --muted below are unchanged and stay comfortably above the AA
       minimums already verified against the old, lighter #2B2823. */
    --warm-white: #14110C;
    --stone:      #211C15;
    --stone-lift: #29231A;
    --surface:    #1C1811;
    --ink:        #E0B68F;   /* primary text — bronze-metallic, light (see light-mode --ink comment: derived from --hebe-bronze's hue, not plain warm-white — this is specifically the dark-mode "colored ink" the user asked to keep */
    /* --hebe-taupe-light (#A69C8C) measures 3.86-4.44:1 here, just under
       AA -- brightened the same hue for the same reason light --muted
       was darkened above (see that comment). */
    --muted:      #B2A99B;
    --placeholder:#B2A99B;
    --accent:     #B2A99B;
    --gold:       #E8B489;   /* bronze-light — brighter for pop on dark, same pattern as before the rebrand */
    --metallic-a: #8C4A1E;   /* same gradient stops both themes — the handoff's own app-icon uses this exact gradient on a dark ground already */
    --metallic-b: #E8B489;
    --metallic-c: #7A3E19;
    --btn-primary-text: #F7F4EF;   /* theme-invariant, see :root's comment */
    --deep:       #E8B489;   /* max emphasis flips to the brightest bronze on dark ground */
    --faint:      #362F24;
    --hair:       rgba(54, 47, 36, 0.5);

    /* Aurora + glass, DARK — the Eight-Sleep end of the reference set:
       near-black ground, additive light, deeper scrim. See the light
       definitions in :root for why this is themed rather than fixed. */
    --aurora-ground: #0B0906;
    --aurora-blend:  plus-lighter;
    --aurora-1: rgba(247, 206, 138, 0.78);
    --aurora-2: rgba(206, 118,  74, 0.72);
    --aurora-3: rgba(170,  96,  58, 0.70);
    --aurora-4: rgba(214, 140, 126, 0.60);
    --aurora-5: rgba(255, 232, 198, 0.42);
    --aurora-scrim: rgba(10, 7, 5, 0.48);
    --aurora-edge:  rgba(8, 6, 4, 0.50);
    --aurora-ink:     #F7EFE6;
    --aurora-ink-dim: #C3B4A0;
    --aurora-grain-blend: overlay;
    --aurora-grain-alpha: 0.055;

    --glass-bg:    linear-gradient(158deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.06) 42%, rgba(255,255,255,0.02) 100%);
    --glass-rim:   rgba(255,255,255,0.42);
    --glass-edge:  rgba(255,255,255,0.09);
    --glass-border: rgba(232, 180, 137, 0.42);
    --glass-under: rgba(0,0,0,0.28);
    --glass-drop:  0 18px 44px -18px rgba(0,0,0,0.72);
    --aurora-c0: #0A0806;
    --aurora-c1: #C98442;
    --aurora-c2: #B0603A;
    --aurora-c3: #8E4A2E;
    --aurora-c4: #F2D3A8;
    --aurora-additive: 1;   /* dark theme adds real light */
    --aurora-gain: 0.42;
    --aurora-additive: 1;
  --aurora-gain: 0.42;
  --aurora-dither: 0.026;
    --field-bg:       rgba(255,255,255,0.07);
    --field-bg-focus: rgba(255,255,255,0.12);
    --switch-trough:  rgba(10,7,5,0.34);
  }
}

/* ── manual override — theme-toggle.js stamps data-theme on <html>;
   this must win over the media query in both directions. ── */
:root[data-theme="dark"] {
  --warm-white: #14110C; --stone: #211C15; --stone-lift: #29231A; --surface: #1C1811;
  --ink: #E0B68F; --muted: #B2A99B; --placeholder: #B2A99B; --accent: #B2A99B;
  --gold: #E8B489; --metallic-a: #8C4A1E; --metallic-b: #E8B489; --metallic-c: #7A3E19;
  --btn-primary-text: #F7F4EF;
  --deep: #E8B489; --faint: #362F24; --hair: rgba(54, 47, 36, 0.5);

  --aurora-ground: #0B0906; --aurora-blend: plus-lighter; --aurora-blur: 44px;
  --aurora-1: rgba(247, 206, 138, 0.78); --aurora-2: rgba(206, 118, 74, 0.72);
  --aurora-3: rgba(170, 96, 58, 0.70);   --aurora-4: rgba(214, 140, 126, 0.60);
  --aurora-5: rgba(255, 232, 198, 0.42);
  --aurora-scrim: rgba(10, 7, 5, 0.48);  --aurora-edge: rgba(8, 6, 4, 0.50);
  --aurora-ink: #F7EFE6; --aurora-ink-dim: #C3B4A0;
  --aurora-grain-blend: overlay; --aurora-grain-alpha: 0.055;

  --glass-bg:    linear-gradient(158deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.06) 42%, rgba(255,255,255,0.02) 100%);
  --glass-rim:   rgba(255,255,255,0.42); --glass-edge: rgba(255,255,255,0.09);
  --glass-border: rgba(232, 180, 137, 0.42);
  --glass-under: rgba(0,0,0,0.28);       --glass-drop: 0 18px 44px -18px rgba(0,0,0,0.72);
  --aurora-c0: #0A0806;
  --aurora-c1: #C98442;
  --aurora-c2: #B0603A;
  --aurora-c3: #8E4A2E;
  --aurora-c4: #F2D3A8;
  --aurora-additive: 1;
  --aurora-gain: 0.42;
  --aurora-dither: 0.026;
  --field-bg: rgba(255,255,255,0.07); --field-bg-focus: rgba(255,255,255,0.12);
  --switch-trough: rgba(10,7,5,0.34);
}
:root[data-theme="light"] {
  --warm-white: #F7F4EF; --stone: #EDEAE2; --stone-lift: #F1EEE7; --surface: #FFFFFF;
  --ink: #603C1B; --muted: #70695F; --placeholder: #70695F; --accent: #70695F;
  --gold: #B87333; --metallic-a: #8C4A1E; --metallic-b: #E8B489; --metallic-c: #7A3E19;
  --btn-primary-text: #F7F4EF;
  --deep: #8C4A1E; --faint: #E4DFD4; --hair: rgba(228, 223, 212, 0.5);

  --aurora-ground: #F4EADC; --aurora-blend: normal; --aurora-blur: 46px;
  --aurora-1: rgba(250, 212, 144, 0.92); --aurora-2: rgba(242, 172, 128, 0.86);
  --aurora-3: rgba(231, 162, 154, 0.78); --aurora-4: rgba(255, 205, 168, 0.74);
  --aurora-5: rgba(255, 250, 241, 0.88);
  --aurora-scrim: rgba(255, 251, 245, 0.42); --aurora-edge: rgba(150, 108, 66, 0.20);
  --aurora-ink: #4A2E14; --aurora-ink-dim: #7A6550;
  --aurora-grain-blend: multiply; --aurora-grain-alpha: 0.05;

  --glass-bg:    linear-gradient(158deg, rgba(255,255,255,0.62) 0%, rgba(255,255,255,0.34) 46%, rgba(255,255,255,0.20) 100%);
  --glass-rim:   rgba(255,255,255,0.85); --glass-edge: rgba(120, 88, 56, 0.16);
  --glass-border: rgba(184, 115, 51, 0.38);
  --glass-under: rgba(120, 88, 56, 0.10); --glass-drop: 0 18px 40px -18px rgba(90, 62, 34, 0.34);
  /* Shader palette (aurora.js). Solid hex, no alpha: the shader mixes
     these itself rather than compositing translucent layers. c0 is the
     ground the flow sits in; c4 is the brightest highlight. */
  --aurora-c0: #F7EFE3;
  --aurora-c1: #F3C165;
  --aurora-c2: #EC9159;
  --aurora-c3: #DE8189;
  --aurora-c4: #FFD2A1;
  --aurora-additive: 0;   /* light theme tints toward each light */
  --aurora-gain: 1.0;
  --aurora-dither: 0.020;
  --field-bg: rgba(255,255,255,0.42); --field-bg-focus: rgba(255,255,255,0.66);
  --switch-trough: rgba(140, 104, 64, 0.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Explicit background on <html> itself, not just <body> -- WKWebView can
   show a black flash during a page navigation in the gap before <body>
   has painted (its own default ground, not this app's), and this is the
   first thing to check for that exact symptom regardless of what else
   is animating during the transition. */
html { background: var(--warm-white); }
html, body { overscroll-behavior-y: contain; }
/* No page-level sideways movement anywhere, except a deliberate card
   carousel's OWN internal scroll/drag (those set overflow-x on their own
   track element, e.g. .ob-feature-track, a circular-carousel's drag
   gesture, .hebe-opt-list) -- this only clips the outer page, it doesn't
   touch any child's own horizontal scrolling. Catches anything that
   overflows the viewport width (a too-wide row, an absolutely positioned
   element drifting past the edge) rather than letting the whole page pan
   sideways to reveal it. */
html, body { overflow-x: hidden; }

/* ── native-feel: no visible scrollbar track anywhere, on any scrollable
   element (the page itself, sheets, horizontal carousels) -- a persistent
   scrollbar/"sidebar" strip is a desktop-browser affordance a real iOS/
   Android app never shows; momentum/overscroll behavior above is
   unaffected, this only hides the visual track/thumb. A handful of pages
   already had a narrower, local version of this same rule on their own
   horizontal carousels (e.g. shop.html's .goal-strip/.filter-pills) --
   this makes it the default everywhere instead of something each new
   scrollable container has to remember to add. */
* {
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* legacy Edge */
}
*::-webkit-scrollbar { display: none; } /* WebKit/Chromium (incl. the native app's WKWebView/WebView) */

body { background: var(--warm-white); font-family: var(--sans); transition: background var(--dur-calm) var(--ease-lux); }

/* ── native-feel: suppress the long-press callout and text-selection
   highlight on interactive chrome (buttons, nav, pills, sheets) without
   touching normal readable content (ingredient names, body copy, prices)
   that a user may legitimately want to select or copy. ── */
button,
.hebe-btn,
.icon-btn,
.back-btn,
.theme-toggle,
.navbar button,
.seg-pill,
.menu-row,
.shop-tile,
.shop-tile-add,
.rem-close,
.streak-chip,
[role="button"] {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ── page-to-page arrival — every "page" here is a separate full HTML
   document (no client-side router), so a plain navigation is an
   instant, flat cut with no way for the outgoing page to visibly move
   at all.
   Tried, in order, across several earlier rounds: the browser's own
   cross-document View Transitions API (a real WKWebView black-flash bug
   at first, then -- once that seemed fixed -- still choppy, since it
   snapshot-composites the entire outgoing/incoming page as bitmaps,
   genuinely expensive work on this engine); a plain CSS transform+
   opacity slide-in on .shell/.app (still not smooth); a pure opacity-
   only fade, the cheapest animation there is (still not smooth, slowed
   down, still not smooth) -- all of that dropped at the time in favor
   of a plain instant cut.
   2026-09-18: reinstated, now that the black flash itself has a real
   fix underneath it (AppDelegate.swift's syncWebViewBackground, now
   KVO-observed so Capacitor's own internal resets can't silently undo
   it -- see that file's comment; and theme-toggle.js's synchronous
   inline background on <html>, matching the APP's actual theme rather
   than the OS's, for the narrower gap between HTML parsing and
   theme.css finishing its own load). Every earlier "still not smooth"
   verdict on a fade was rendered while fading IN OVER a genuinely wrong
   background colour underneath it -- that alone would read as jank
   regardless of how cheap or well-tuned the fade itself was. A plain
   opacity fade (the cheapest animation there is, no transform/layout
   cost) on .shell/.app, modest duration, is worth trying again now that
   the thing it was fading over is actually correct. */
@media (prefers-reduced-motion: no-preference) {
  :root[data-nav-transition="tab"] .shell,
  :root[data-nav-transition="tab"] .app,
  :root[data-nav-transition="push"] .shell,
  :root[data-nav-transition="push"] .app,
  :root[data-nav-transition="pop"] .shell,
  :root[data-nav-transition="pop"] .app {
    animation: hebe-shell-fade-in 0.32s var(--ease-lux) both;
  }
}
@keyframes hebe-shell-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── keyboard focus — one consistent ring in the same --gold accent used
   for active nav/CTAs, applied globally so buttons/nav/chips/toggles don't
   need a per-page rule. Text inputs keep their existing outline:none +
   border-color focus treatment (still a visible indicator); this rule
   simply doesn't get overridden there since that's equal-specificity,
   later-in-cascade page-local CSS. :focus-visible (not :focus) so mouse
   clicks don't show a ring, only keyboard/assistive-tech focus. */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── text selection — the browser default (usually a blue tint) is the
   cheapest tell that a page's surfaces weren't actually designed. Same
   gold/warm-white pairing already proven elsewhere (e.g. .today-row.done
   .today-check, .reminder-toggle-btn.on), so it holds contrast correctly
   in both themes without a separate dark-mode override. ── */
::selection {
  background: var(--gold);
  color: var(--warm-white);
}

/* ── screen-reader-only label — for inputs where the placeholder already
   carries the visible hint and a visible <label> would disrupt an
   established compact layout (e.g. an inline "add" row next to a button).
   Still gives the input a real accessible name via a proper <label for>. ── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Large display moments (wordmark, the dial's big numeral) get the
   brand's brushed-bronze gradient instead of a flat fill — the one place
   the "metallic" read gets literal shine, per "bronze is an accent only,
   never fills a large field." Every other text on the page stays a flat
   --ink/--gold for legibility at smaller sizes. Stops match hebe-logo.svg/
   hebe-mark.svg exactly (140deg, 5-stop) so live-text brand mentions read
   identically to the actual logo asset. */
.hebe-metallic {
  background: linear-gradient(140deg, var(--metallic-a) 0%, var(--gold) 28%, var(--metallic-b) 50%, var(--gold) 72%, var(--metallic-c) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Small inline brand mentions only (the "HÉBÉ · home" breadcrumb) — the
   real lockup is the brand/hebe-logo.svg image asset, not live text; this
   is for cases too small/inline for an image tag. Combine with
   .hebe-metallic for the brushed-bronze treatment (<span class="hebe-
   wordmark hebe-metallic">HÉBÉ</span>); never stretch/rotate/shadow, and
   never render below 15px per HANDOFF.md's Newsreader floor. */
.hebe-wordmark { font-family: var(--wordmark); }

/* ── theme toggle button — a quiet sun/moon crossfade, shared markup:
   <button class="theme-toggle"><svg class="ti-sun">…</svg><svg class="ti-moon">…</svg></button>
   Both icons are always in the DOM, absolutely stacked on top of each
   other (button is the positioning context) and cross-fade + settle
   with a small rotate/scale on --ease-lux, rather than the old instant
   display:none/block swap. */
.theme-toggle {
  position: relative; border: none; background: none; padding: 12px; color: var(--ink); cursor: pointer;
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  transition: transform var(--dur-instant) var(--ease);
}
.theme-toggle:hover { background: none; opacity: 0.7; }
.theme-toggle:active { transform: scale(0.9); }
.theme-toggle svg {
  position: absolute; top: 50%; left: 50%; width: 20px; height: 20px;
  transform: translate(-50%, -50%) rotate(0deg) scale(1); opacity: 1;
  transition: opacity var(--dur-quick) var(--ease-lux), transform var(--dur-quick) var(--ease-lux);
}
.theme-toggle .ti-moon { opacity: 0; transform: translate(-50%, -50%) rotate(-70deg) scale(0.5); }
:root[data-theme="dark"] .theme-toggle .ti-sun { opacity: 0; transform: translate(-50%, -50%) rotate(70deg) scale(0.5); }
:root[data-theme="dark"] .theme-toggle .ti-moon { opacity: 1; transform: translate(-50%, -50%) rotate(0deg) scale(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .ti-sun { opacity: 0; transform: translate(-50%, -50%) rotate(70deg) scale(0.5); }
  :root:not([data-theme]) .theme-toggle .ti-moon { opacity: 1; transform: translate(-50%, -50%) rotate(0deg) scale(1); }
}


/* ── shared motion primitives (namespaced to avoid clashing with any
   page-local @keyframes) ── */
@keyframes hebe-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hebe-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes hebe-breathe {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}
@keyframes hebe-shimmer {
  from { background-position: -180% 0; }
  to   { background-position: 180% 0; }
}
@keyframes hebe-dial-draw {
  from { stroke-dashoffset: var(--dash-len, 515); }
  to   { stroke-dashoffset: var(--dash-off, 0); }
}
@keyframes hebe-bar-draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(var(--fill, 1)); }
}

/* A thin, filled meter bar -- the shared visual language for any grade/
   fit/coverage quantity shown as a proportion (Hebe Grade, dose fit,
   goal coverage). One accent (--gold) reserved for the strongest tier;
   everything below it reads through ink-weight (--ink/--muted), never a
   second hue -- same "no traffic lights" rule every badge/verdict in the
   app already follows, just given a real fill instead of a flat pill.
   Usage: <div class="hebe-bar"><span class="hebe-bar-fill tier-x"
   style="--fill:0.7"></span></div> */
.hebe-bar { height: 3px; border-radius: var(--radius-pill); background: var(--faint); overflow: hidden; }
.hebe-bar-fill {
  display: block; height: 100%; border-radius: var(--radius-pill); transform-origin: left;
  animation: hebe-bar-draw 0.9s var(--ease-lux) both;
}
.hebe-bar-fill.tier-excellent { background: var(--gold); }
.hebe-bar-fill.tier-good { background: var(--ink); }
.hebe-bar-fill.tier-fair, .hebe-bar-fill.tier-limited { background: var(--muted); }

/* On page load, the main content rises in with weight. Individual pages can
   add `.hebe-stagger` to a container to cascade its direct children. */
.hebe-enter { animation: hebe-rise var(--dur-calm) var(--ease-lux) both; }

.hebe-stagger > * { animation: hebe-rise var(--dur-calm) var(--ease-lux) both; }
.hebe-stagger > *:nth-child(1) { animation-delay: calc(var(--stagger-base) + var(--stagger-step) * 0); }
.hebe-stagger > *:nth-child(2) { animation-delay: calc(var(--stagger-base) + var(--stagger-step) * 1); }
.hebe-stagger > *:nth-child(3) { animation-delay: calc(var(--stagger-base) + var(--stagger-step) * 2); }
.hebe-stagger > *:nth-child(4) { animation-delay: calc(var(--stagger-base) + var(--stagger-step) * 3); }
.hebe-stagger > *:nth-child(5) { animation-delay: calc(var(--stagger-base) + var(--stagger-step) * 4); }
.hebe-stagger > *:nth-child(6) { animation-delay: calc(var(--stagger-base) + var(--stagger-step) * 5); }
.hebe-stagger > *:nth-child(n+7) { animation-delay: calc(var(--stagger-base) + var(--stagger-step) * 6); }

/* A calm, non-spinning "working" surface — a slow breathing shimmer on a
   stone block, luxurious rather than busy. Used for the multi-minute
   recommendation wait. */
.hebe-skeleton {
  background: linear-gradient(100deg, var(--stone) 30%, var(--stone-lift) 50%, var(--stone) 70%);
  background-size: 200% 100%;
  animation: hebe-shimmer 2.2s var(--ease) infinite;
  border-radius: var(--radius-lg);
}
.hebe-skeleton-card {
  background: var(--stone); border-radius: var(--radius-lg);
  padding: 18px; margin-bottom: 14px;
}
.hebe-skeleton-card .hebe-skeleton { height: 14px; margin-bottom: 10px; }
.hebe-skeleton-card .hebe-skeleton:nth-child(1) { width: 55%; height: 16px; }
.hebe-skeleton-card .hebe-skeleton:nth-child(2) { width: 90%; }
.hebe-skeleton-card .hebe-skeleton:nth-child(3) { width: 70%; margin-bottom: 0; }
.hebe-breathe { animation: hebe-breathe 2.4s var(--ease) infinite; }

/* ── shared spring-bounce pop — a genuine damped-oscillation overshoot
   (scale past 1, settle back, small rebound), not a plain ease-out scale.
   For small, rare confirmation moments a single micro-interaction is
   allowed real physics: adding to a cart/stack, a badge count bumping, a
   toggle landing "on". Apply by adding/removing the class (e.g. after a
   successful add) rather than via :active, since it's a one-shot response
   to an outcome, not continuous press feedback. animationend removes the
   class itself in JS (see e.g. shop.html's addToCart) so it can replay on
   a repeat trigger. */
@keyframes hebe-bounce-pop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.32); }
  55%  { transform: scale(0.92); }
  78%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.hebe-bounce { animation: hebe-bounce-pop 0.5s var(--ease) both; }

/* h-mark "calm wait" treatment — loading.js's showLoading() routes its
   full-page (non-`compact`) state through this instead of a spinning ring:
   a fresh photo-identify or the multi-minute recommendation build reads
   calmer than a spinning ring. `compact:true` keeps the plain ring — still
   correct at inline-status size next to a button.
   2026-08-24: given the brushed-copper fill (loading.js builds the SVG
   with an inline <linearGradient> using these same --metallic-a/--gold/
   --metallic-b stops, gated behind prefers-reduced-motion for the sweep),
   this is now a third deliberate use of the metallic treatment alongside
   the wordmark and dial numeral — the most-seen of the three, since every
   wait routes through it, so the sweep stays slow and the scale-breathe
   stays subtle rather than reaching for the ring-spin energy this
   replaced. Renders the real brand mark (brand/hebe-mark-mono.svg's path,
   inlined by the caller) rather than a glyph — HANDOFF.md: "use this one
   inside components." */
.hebe-mark-load { width: 40px; height: 40px; color: var(--ink); display: block; animation: hebe-mark-pulse 2.6s var(--ease) infinite; }
.hebe-mark-load svg { width: 100%; height: 100%; display: block; }
@keyframes hebe-mark-pulse {
  0%, 100% { transform: scale(0.96); opacity: 0.85; }
  50%      { transform: scale(1.05); opacity: 1; }
}

/* loading.js's showLoading() shared component (spinner/panel/message/
   inline). 2026-08-24: previously duplicated per-page (index.html,
   account.html each defined their own copy) with no canonical version —
   stack.html, recommend.html, and improve.html never got a copy at all,
   so their loading state rendered with zero layout (no centering, no
   padding), reading as "stuck in the corner." One definition here now,
   loaded everywhere via the shared stylesheet. */
.loading-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  /* Approximates the space actually left after the sticky header and
     bottom nav (~150-165px combined across recommend/stack/improve/
     account) rather than a flat vh fraction, so the mark centers in the
     real available area instead of the whole viewport including chrome
     it doesn't occupy. */
  min-height: calc(100vh - 165px);
  padding: 20px; animation: hebe-fade var(--dur-calm) var(--ease) both;
}

/* Full-panel wait's backdrop -- a genuine hebe-aurora-scene (same grain/
   soft-light-source system as the app's real hero auras, mounted via
   window.hebeAurora.mount() by loading.js), not a separate loading-only
   visual language. Grown 2026-08-30 to read as one dominant, alive orb
   (a real reference's "generating" moment) rather than three small,
   separately-scaled layers -- bigger, locally boosted saturation/contrast
   so the SAME bronze palette pools richer at this size (never a new hue:
   still only --aurora-1..5). Real feedback (2026-08-31): that same pass
   also swapped the ring's asymmetric rotating swirl for a symmetric glow
   pulse, on the theory the hard rotation read as a borrowed mechanical
   spinner -- the user preferred the original organic, asymmetric swirl
   and asked for it back at this new, bigger size. The swirl ring is
   restored below (hebe-load-swirl), scaled up from its original 92px to
   match this orb's size the same way it was scaled at the smaller size;
   only the orb's own overall size and breathe stay from the 08-30 pass. */
/* The breathe animation lives on this OUTER, non-clipping wrapper rather
   than on .hebe-load-aura itself: scaling the SAME element that also
   does the circular overflow:hidden clip produced a real rendering bug
   (confirmed via computed styles + a debug screenshot, 2026-08-30) --
   the WebGL canvas's square bounding box intermittently showed through
   at the corners while the clip boundary was mid-transform, since
   GPU-composited content can desync from a rounded clip mask that's
   itself being scaled. Keeping .hebe-load-aura static and animating a
   wrapper around it sidesteps that entirely: the clip boundary never
   moves, only the whole orb's apparent size does. */
.hebe-load-aura-wrap {
  width: 260px; height: 260px; margin: 0 auto 26px;
  animation: hebe-orb-breathe 4.4s var(--ease) infinite;
}
.hebe-load-aura {
  width: 100%; height: 100%; border-radius: 50%;
  /* border-radius + overflow:hidden alone let the WebGL canvas (its own
     GPU-composited layer) and the grain overlay (mix-blend-mode, also
     its own layer) show their square bounding box at the corners --
     clip-path is evaluated per-pixel rather than as box-model overflow,
     and reliably clips composited content the box-model version doesn't
     (confirmed via a debug screenshot, 2026-08-30). */
  clip-path: circle(50%);
  display: flex; align-items: center; justify-content: center;
}
.hebe-load-aura.hebe-aurora-scene { background: var(--aurora-ground); }
/* .hebe-aurora has its OWN overflow:hidden (theme.css, to contain the
   drifting CSS-fallback blobs) but no border-radius of its own -- when
   the outer .hebe-load-aura's clip is rounded but this direct child's
   clip isn't, Chromium's compositor can fail to intersect the two
   correctly for a GPU-composited canvas, leaking its square bounds at
   the corners (confirmed via a debug screenshot, 2026-08-30, on the
   WebGL canvas specifically -- CSS-only content wasn't affected).
   Matching this container's own radius to its parent's fixes it. */
.hebe-load-aura .hebe-aurora { border-radius: 50%; filter: saturate(1.4) contrast(1.06); }
.hebe-load-aura .hebe-aurora b { animation-duration: 5.5s, 5.5s; }
@keyframes hebe-orb-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.035); }
}
/* The original trick, restored: an asymmetric inset box-shadow (three
   offset "blobs," not a symmetric ring) rotated via transform -- a
   symmetric shadow would look static under rotation, this one visibly
   swirls. Sized at 116px (was 92px against a 190px orb; this orb is now
   260px, same ~45% ratio) with its box-shadow offsets scaled up to
   match. Same bronze accent (--gold/--metallic-a/-b/-c) as before. */
.hebe-load-ring {
  position: relative; z-index: 1; width: 116px; height: 116px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.hebe-load-ring::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  animation: hebe-load-swirl 5s linear infinite;
}
@keyframes hebe-load-swirl {
  0% {
    transform: rotate(90deg);
    box-shadow:
      0 8px 16px 0 var(--metallic-b) inset,
      0 15px 24px 0 var(--gold) inset,
      0 40px 43px 0 var(--metallic-a) inset,
      0 0 5px 1.8px rgba(232,180,137,0.4),
      0 0 10px 2.5px rgba(184,115,51,0.28);
  }
  50% {
    transform: rotate(270deg);
    box-shadow:
      0 8px 16px 0 var(--gold) inset,
      0 15px 10px 0 var(--metallic-c) inset,
      0 30px 43px 0 var(--gold) inset,
      0 0 5px 1.8px rgba(232,180,137,0.4),
      0 0 10px 2.5px rgba(184,115,51,0.28);
  }
  100% {
    transform: rotate(450deg);
    box-shadow:
      0 8px 16px 0 var(--metallic-b) inset,
      0 15px 24px 0 var(--gold) inset,
      0 40px 43px 0 var(--metallic-a) inset,
      0 0 5px 1.8px rgba(232,180,137,0.4),
      0 0 10px 2.5px rgba(184,115,51,0.28);
  }
}
.hebe-load-aura .hebe-mark-load { position: relative; z-index: 2; width: 40px; height: 40px; color: var(--aurora-ink); }
@media (prefers-reduced-motion: reduce) {
  .hebe-load-aura-wrap { animation: none; }
  .hebe-load-ring::before { animation: none; transform: rotate(180deg); }
}

/* Real feedback (2026-08-31): this used to be a filled, bordered pill --
   removed entirely. The shimmering text below is the whole visual cue
   now; a rounded rectangle sitting behind it just competed with it. Both
   classes are now plain flex wrappers with no surface of their own. */
/* Real feedback (2026-09-11): this read heavier than the rest of the
   app's typography -- weight 500 with no family override, next to
   headline-style text everywhere else (.hebe-title, .rem-title, ...)
   built on --weight-light (300) over the same --headline family. */
.loading-status-pill { display: inline-flex; align-items: center; font-family: var(--headline); font-size: 15px; font-weight: var(--weight-light); }
.loading-message { font-family: var(--headline); font-weight: var(--weight-light); font-size: 19px; color: var(--deep); transition: opacity 0.35s var(--ease); }
.loading-inline { display: inline-flex; align-items: center; font-size: 13px; }
.loading-inline span { transition: opacity 0.35s var(--ease); }

/* Shimmering bronze text -- replaces the small spinner-dot that used to
   sit beside loading captions. Real bug found and fixed (2026-08-31,
   third pass): the previous version used --deep as the base and
   --metallic-b as the one bright highlight -- correct in light mode, but
   --deep and --metallic-b resolve to the IDENTICAL hex value (#E8B489)
   in dark mode (--deep "flips to the brightest bronze on dark ground" by
   design, same theme.css comment as its own definition) -- so the
   "highlight" and "base" were literally the same color there, meaning
   zero visible shimmer in dark mode, which is almost certainly what
   read as "not shimmering." Rebuilt on --metallic-a/--metallic-b
   instead -- both are deliberately THEME-INVARIANT (identical values in
   light and dark, same as the wordmark/breathing-mark's own gradient),
   so this now has real, guaranteed contrast in both themes rather than
   working in one and silently collapsing in the other. Reference
   structure (dark base, one bright flash at the midpoint, same color
   before and after so a looping tile has no visible seam) kept as-is --
   text-clip rather than an animated SVG gradient (loading.js's
   hebe-mark-load) since this is plain caption text, no icon glyph to
   fill. */
.hebe-shine-text {
  background: linear-gradient(100deg,
    var(--metallic-a) 0%, var(--metallic-a) 40%, var(--metallic-b) 50%,
    var(--metallic-a) 60%, var(--metallic-a) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: hebe-shine-sweep 2s linear infinite;
}
@keyframes hebe-shine-sweep { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) {
  .hebe-shine-text { animation: none; background: none; -webkit-text-fill-color: var(--deep); color: var(--deep); }
}
.spinner {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--faint); border-top-color: var(--ink);
  animation: hebe-spin 0.9s linear infinite; margin: 0 0 18px;
}
/* Small inline spinners (compact waits, the status pill) get the bronze
   accent on their moving edge instead of plain ink -- the "gradient
   aurora energy, not a flat moving line" this component was missing;
   a true conic sweep is reserved for hebe-mark-load's SVG gradient, but
   a bronze-tipped ring reads as the same family at this tiny size. */
.spinner-sm { width: 16px; height: 16px; border-width: 2px; margin: 0; flex-shrink: 0; border-top-color: var(--gold); }
@keyframes hebe-spin { to { transform: rotate(360deg); } }

/* Pull-to-refresh (pull-refresh.js, native-only) now drags the real
   header .app-bar-brand-mark directly -- see that script's own comment
   for why -- so it needs no separate indicator element/styles here
   anymore. */

/* ── Narrative summary — an AI-written editorial framing line above the
   structured breakdown on /recommend and /stack. Serif pull-quote
   treatment: one of the few deliberate --serif display moments beyond
   the wordmark/dial, per "spend your boldness in one place" above.
   Tone reads through the same left-rule/ink-weight system every verdict
   already uses (recommend.html's .tone-*), never a new colour scale. ── */
.narrative-quote {
  font-family: var(--headline); font-size: 17px; line-height: 1.55; font-weight: var(--weight-light);
  color: var(--ink); padding-left: 16px; border-left: 2px solid var(--faint);
  margin: 4px 0 18px;
}
.narrative-quote.tone-positive { border-left-color: var(--gold); }
.narrative-quote.tone-watch    { border-left-color: var(--faint); }
.narrative-quote.tone-caution  { border-left-color: var(--muted); }
.narrative-quote.tone-stop     { border-left-color: var(--deep); }
.narrative-placeholder {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted);
  padding: 10px 0 18px;
}

/* ── Mechanism stacking — grouped by shared pathway rather than a network
   diagram: with typically 2-4 contributors per finding, a graph adds
   visual complexity without adding information a grouped list doesn't
   already carry, and network diagrams are a well-known generic-AI-
   dashboard tell. Severity reuses recommend.html's .interaction-card
   weight/ink language exactly (same class names), not a parallel scale. ── */
.mechanism-card { padding: 13px 14px; border-radius: var(--radius-md); margin-bottom: 8px; font-size: 13px; }
.mechanism-card:last-child { margin-bottom: 0; }
.mechanism-card.severity-contraindicated, .mechanism-card.severity-major {
  background: var(--stone-lift); box-shadow: inset 0 0 0 1.5px var(--deep);
}
.mechanism-card.severity-moderate, .mechanism-card.severity-minor { background: var(--stone); }
.mechanism-label { font-weight: 500; margin-bottom: 2px; }
.mechanism-concern { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.mechanism-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mechanism-chip {
  font-size: 11.5px; padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--faint); color: var(--ink);
}
.mechanism-action { font-size: 12px; color: var(--accent); margin-top: 8px; }

/* ── Body-weight dosing — a plain list, deliberately not a chart: the
   data is raw mg/kg with no studied per-kg reference range to plot
   against, so a bar/gauge would imply a scale that doesn't exist. ── */
.bw-dosing-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 10px; padding: 8px 0;
  border-bottom: 1px solid var(--hair); font-size: 13px;
}
.bw-dosing-row:last-child { border-bottom: none; }
.bw-dosing-name { color: var(--ink); text-transform: capitalize; flex-shrink: 0; }
.bw-dosing-value { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The "unavailable" reason is a full sentence, not a short numeral --
   unlike the numeral case above, it must wrap, and reads better dropped
   to its own full-width line under the name than fighting for horizontal
   room beside it (which is what forced the numeral's nowrap rule off the
   edge of the card in the first place). */
.bw-dosing-value.unavailable { font-style: italic; white-space: normal; flex-basis: 100%; text-align: left; }

/* ── Compact gaps list — "what's missing and why", one line per
   uncovered goal, linking out to /improve for the full podium reveal
   rather than duplicating it here. ── */
.gap-row { padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.gap-row:last-child { border-bottom: none; }
.gap-outcome { font-weight: 500; text-transform: capitalize; }
.gap-rationale { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.gap-see-more {
  display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 500;
  color: var(--gold); text-decoration: none; white-space: nowrap;
}

/* ── Segmented single-select pills (sex, activity level, etc. on
   /account) — same component and "on" treatment (ink fill, not gold —
   gold stays reserved for the dial-hero and confirmed nav/toggle states)
   as onboarding.html's page-local .seg-pill, so a picker built once reads
   identically wherever it's used next. ── */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
/* 2026-09-01: resting pills are glass; the selected ("on") state stays a
   solid ink fill on purpose -- same rule the rebuilt nav already
   established (glass = available, solid = the one active/selected
   choice), so "which one is picked" never gets ambiguous under glass's
   own translucency. */
.seg-pill {
  border: none; background: var(--glass-bg); color: var(--ink); border-radius: var(--radius-pill);
  padding: 14px 16px; font-size: 13px; cursor: pointer; font-family: var(--sans);
  backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: inset 0 1px 0.5px var(--glass-rim), inset 0 0 0 1.5px var(--glass-border);
  transition: background var(--dur-quick) var(--ease), color var(--dur-quick) var(--ease), transform var(--dur-instant) var(--ease);
}
.seg-pill:hover { background: linear-gradient(158deg, rgba(232,180,137,0.18) 0%, rgba(232,180,137,0.06) 100%); }
.seg-pill:active { transform: scale(0.96); }
.seg-pill.on { background: var(--ink); color: var(--warm-white); box-shadow: none; }

/* ── Stat block — Whoop's "big number, small caption" pattern (/account's
   age · weight · activity row). Plain --ink only: this is decorative
   status display, not a confirmed state, so it never reaches for --gold. ── */
.stat-row { display: flex; gap: 22px; margin: 4px 0 26px; flex-wrap: wrap; }
.stat-block { flex: 1; min-width: 84px; }
.stat-value {
  font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-value .stat-unit { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.stat-label {
  font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  margin-top: 4px;
}

/* ── Dose gauge — a visual, tap-for-numbers replacement for the old thin
   .dosage-bar line. Icon + shaded zone carry the status at a glance;
   exact numbers sit in a tap-revealed micro-label on the marker instead
   of the resting layout, so a card reads as "here's where you stand,"
   not a chart to interpret. Shared across /recommend, /stack, /improve —
   one component, not three drifting copies of a bar mid-redesign. ── */
.dose-gauge { position: relative; height: 34px; margin: 14px 0 4px; }
.dose-gauge-track {
  position: absolute; top: 50%; left: 0; right: 0; height: 2px;
  background: var(--faint); transform: translateY(-50%);
}
.dose-gauge-zone {
  position: absolute; top: 50%; height: 12px; border-radius: var(--radius-sm);
  background: var(--stone-lift); box-shadow: inset 0 0 0 1px var(--faint);
  transform: translateY(-50%);
}
.dose-gauge-marker {
  position: absolute; top: 50%; width: 26px; height: 26px; margin-left: -13px;
  transform: translateY(-50%); border-radius: 50%; border: none; cursor: pointer;
  background: var(--warm-white); box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--faint);
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: box-shadow var(--dur-quick) var(--ease), transform var(--dur-quick) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .dose-gauge-marker:hover { transform: translateY(-50%) scale(1.06); }
}
.dose-gauge-marker:active { transform: translateY(-50%) scale(0.94); }
.dose-gauge-marker svg { width: 13px; height: 13px; }
.dose-gauge-marker.status-within_range {
  box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--gold); color: var(--gold);
}
.dose-gauge-marker.status-below_effective_range,
.dose-gauge-marker.status-above_studied_range {
  box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--ink); color: var(--ink);
}
.dose-gauge-marker.status-no_dose_data,
.dose-gauge-marker.status-no_evidence,
.dose-gauge-marker.status-form_mismatch {
  box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--faint); color: var(--muted);
}

.dose-gauge-tooltip {
  position: absolute; bottom: 100%; left: 50%; margin-bottom: 8px;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink); color: var(--warm-white); font-size: 11.5px; font-weight: 500;
  padding: 5px 10px; border-radius: var(--radius-sm); white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--dur-quick) var(--ease), transform var(--dur-quick) var(--ease);
}
.dose-gauge-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; margin-left: -4px;
  border: 4px solid transparent; border-top-color: var(--ink);
}
.dose-gauge-marker.open .dose-gauge-tooltip { opacity: 1; transform: translateX(-50%) translateY(0); }

.dose-gauge-caption { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; margin-top: 6px; }
.dose-gauge-caption.status-within_range { color: var(--gold); }
.dose-gauge-caption.status-below_effective_range,
.dose-gauge-caption.status-above_studied_range { color: var(--ink); }
.dose-gauge-caption.status-no_dose_data,
.dose-gauge-caption.status-no_evidence,
.dose-gauge-caption.status-form_mismatch { color: var(--muted); }

/* ── Driver chips — plain-language factors behind a verdict
   (verdict.py's plain_factors, already translated out of reviewer
   vocabulary), replacing the old numeric score breakdown. A row of
   small labeled pills to glance at, not a bulleted audit trail. ── */
.driver-chips-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
  margin: 12px 0 6px;
}
.driver-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.driver-chip {
  font-size: 11.5px; padding: 4px 11px; border-radius: var(--radius-pill);
  background: var(--stone-lift); color: var(--ink); cursor: default;
}

/* ── mechanism ("why this might help", e.g. ashwagandha/cortisol) ──
   Deliberately NOT the .narrative-quote serif treatment -- that's the
   one per-page editorial moment ("spend your boldness in one place"),
   and this is a smaller, per-card aside. Just as deliberately not styled
   like .verdict-reason either: this is general textbook pharmacology,
   not a claim this app's own literature review made, and conflating the
   two visually would blur a real distinction (recommendation/
   mechanism.py's module docstring). Italic marks it as a different
   register of claim; small and muted keeps it a supporting note, not
   competing with the verdict headline for attention. ── */
.mechanism-why {
  font-size: 11.5px; font-style: italic; color: var(--muted);
  margin-top: 6px; line-height: 1.5;
}

/* ── Bottom tab nav — shared across recommend/stack/improve/account.
   Consolidated here 2026-08 after the Phase 0 audit found it drifted into
   two near-duplicate implementations, then rebuilt 2026-08-24 into a
   floating icon overlay per direct request, superseding HANDOFF.md's
   "Tab bar — 9.5–11px Work Sans... No icons" rule (the text-only
   version this replaced) -- and 2026-09-09 gets a labelled reversal of
   THAT: each icon now carries a caption underneath naming its page,
   closer to the original Work-Sans-label spirit but keeping the icons
   this rebuild added, rather than fully reverting to text-only. Down to
   5 items (home/stack/add/improve/shop) -- profile and wearables removed
   from primary nav.

   `position: sticky`, not `fixed`: fixed was the first attempt and broke
   in real testing -- .shell/.app (this nav's ancestor on every page)
   carries .hebe-enter, whose hebe-rise keyframe ends on `transform:
   translateY(0)` with fill-mode `both`, so that transform stays applied
   to the ancestor indefinitely after the animation completes, even
   though it's visually a no-op. A `transform` on any ancestor -- even a
   translateY(0) -- redefines the containing block for `position: fixed`
   descendants to that ancestor instead of the viewport, so the nav
   scrolled away with the page instead of staying pinned. `sticky` has no
   such gotcha (unaffected by ancestor transforms) and is what the
   original flush, non-floating nav already used correctly -- kept the
   floating-pill look (rounded, inset, shadowed) but reverted the
   positioning mechanism.

   Pages must not reintroduce a page-local .navbar override — extend this
   rule instead. Markup: <nav class="navbar"><div class="navbar-item">
   <button data-nav="x" class="active (on current page)" aria-label="…"
   aria-current="page (if active)"><svg>…</svg></button><span
   class="navbar-label">X</span></div>…</nav> -- one .navbar-item per
   tab, button+label as siblings inside it (the label is NOT inside the
   button, so the button itself stays the exact circular glass hit target
   this section already establishes). Still floats above content visually
   (margin instead of flush edges) and is out of the page's own
   padding-bottom reservation the old flush bar didn't need — every page
   using it must reserve bottom clearance itself (padding-bottom on
   .main, comment there points back to this one; the label row adds
   ~18px to this nav's own height versus the icon-only version, so that
   reservation needs a matching bump). */
/* 2026-09-10: reference request ("build a glass translucent bar for the
   buttons") -- back to ONE connected glass bar (the pre-2026-08-31
   shape) rather than each tab its own separated circular pane, now that
   every tab carries a label: a shared bar reads as a single navigation
   surface with icon+caption columns inside it, which is what the
   reference showed, rather than five independent glass chips. The Add
   button (below) keeps its own distinct raised-circle treatment -- that
   part of the reference has no equivalent (a plain 4-item bar with no
   center action), and HÉBÉ's own primary-write-action affordance is
   worth keeping distinct from an ordinary destination tab regardless. */
/* 2026-09-17: shrunk and made icon-only (labels below still exist in the
   DOM -- kept as a harmless a11y fallback, just visually hidden at rest)
   rather than icon+caption, closing most of the height this pill used
   to spend on a permanent label row. Still the same sticky, centered,
   floating capsule it already was (width:calc(...)/max-width/margin:
   auto below), just a slimmer, narrower one -- max-width also cut from
   360 to 300 now that 5 bare icons need noticeably less room than 5
   icon+caption columns did. */
.navbar {
  position: sticky; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 5;
  width: calc(100% - 44px); max-width: 280px; height: 62px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 8px;
  border-radius: 999px; border: none;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    inset 0 1px 0.5px var(--glass-rim),
    inset 0 -1px 0.5px var(--glass-under),
    inset 0 0 0 1.5px var(--glass-border),
    var(--shadow-md);
  /* Explicit height, not padding-derived auto height -- a hard cap that
     can't be inflated by anything inside it, however that content is
     sized (padding-based sizing kept looking taller than intended
     across several rounds of tuning; an explicit height removes the
     ambiguity outright rather than trying to out-guess it again).
     position:sticky above already establishes a containing block for
     .navbar-lens-content's absolute positioning further below, so it
     needs no extra positioning here. touch-action:none hands the whole
     bar's gesture handling to navbar-lens.js's own pointer events --
     nothing here needs native scrolling, and pan-y would let the
     browser hijack a vertical finger drift mid-drag as a page scroll
     attempt instead. */
  touch-action: none;
}
/* Explicit width (matching every button's own 36px) rather than
   relying on each column's content to size it -- keeps all five
   columns equal regardless of content, not just correct for whatever
   happens to be in flow inside each one today. */
.navbar-item { display: flex; flex-direction: column; align-items: center; width: 44px; }
.navbar-label {
  font-family: var(--sans); font-size: 9.5px; font-weight: 500; color: var(--muted);
  letter-spacing: 0.02em; line-height: 1;
  /* Visually hidden at rest (see the block comment above) -- kept as
     real text in the DOM as a harmless a11y fallback (every button
     already carries its own aria-label regardless). */
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
/* 2026-09-18: shrunk from 44px to 36px, then back up slightly to 40px
   once the bar itself came up from 48 to 56px ("a little taller") --
   .navbar has an explicit height (above) instead of sizing around this
   button, so this no longer needs to stay at the old HIG-minimum 44pt
   figure to keep the bar's own height correct. Still a real, if
   slightly smaller than ideal, tap target; the repeated, explicit ask
   across several rounds was specifically that this bar read as visibly
   smaller, which a 44px button was never going to do no matter how
   tight the surrounding padding got. */
.navbar button {
  border: none; background: none; box-shadow: none; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 14px; /* squircle, not a circle, per reference -- HIG minimum touch target */
  transition: color var(--dur-quick) var(--ease), background var(--dur-quick) var(--ease), transform var(--dur-instant) var(--ease);
}
.navbar button svg { width: 22px; height: 22px; }
/* The "improve" button is the actual brand mark's spark glyph, not a
   generic line icon (see the markup comment above) -- sized up and given
   the same brushed-metal gradient as the wordmark/Excellent grade,
   always on regardless of active state, so it reads as the brand mark
   it is rather than a fourth interchangeable icon. */
.navbar button[data-nav="improve"] svg { width: 21px; height: 21px; }
.navbar button:hover { background: var(--stone-lift); color: var(--ink); }
.navbar button:active { transform: scale(0.92); }
/* Active tab: a soft bronze tint, not a solid fill -- now that every tab
   shares one glass bar (rather than being its own separated glass pane),
   a fully opaque fill here would read as a hole punched in that shared
   surface. Still the nav's one deliberate "one accent" moment. */
.navbar button.active {
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--gold);
}

/* ── Press-and-drag magnifying glass (navbar-lens.js) — a real optical
   loupe, not an icon preview: press-hold or drag anywhere along the bar
   and a small circular window shows an ENLARGED view of whatever is
   directly underneath it, following the finger continuously (not
   snapped to icon positions) across the bar's whole width, exactly like
   sliding a literal magnifying glass over a page. Release to navigate
   to whichever button is currently nearest the glass's centre; drag
   away vertically to cancel. A quick tap still just navigates directly
   (see the script for the tap/drag threshold) -- none of this ever
   engages for an ordinary tap.

   2026-09-17: rebuilt after the first version rendered as a rainbow-
   fringed rectangle instead of a clean circular zoom. Two real WebKit
   issues, not tuning: (1) `clip-path: circle(... at var(--x) ...)` was
   silently failing to clip AT ALL on-device (custom properties inside a
   clip-path shape function are unreliable on this WKWebView), leaving
   the full, unclipped rectangle visible -- the "inorganic blob". (2)
   the cloned .nav-add button still carried ITS OWN backdrop-filter,
   and scaling a backdrop-filter element via an ancestor transform is a
   known WebKit rendering bug -- the "refractive rainbow" was that
   filter sampling incorrectly once transformed. Fixed by switching the
   clip mechanism to plain `overflow:hidden` on a circular window (far
   more reliably supported than clip-path everywhere, this engine
   included) and stripping backdrop-filter from everything inside the
   clone outright (it's a flattened, read-only optical stand-in, not a
   real glass surface itself -- .navbar-lens-window below carries the
   one glass/blur treatment instead, and it's never the transformed
   element, so it can't trigger the same bug).

   .navbar-lens-window is the visible circular viewport -- moves with
   the pointer (left set by the script, in the bar's own px), clips its
   child via plain overflow:hidden. .navbar-lens-content (a CHILD of the
   window, not of the bar) is a full clone of the bar's own .navbar-item
   row, sized to match the bar's real content box exactly (width/height/
   padding copied from the live bar by the script, not hardcoded here,
   so they can't drift out of sync) and scaled up -- its own left/top
   are recomputed every pointermove so that whatever point is under the
   finger lands at the window's own centre, the same "zoom pinned to a
   point" idea as before, just done with ordinary top/left math instead
   of transform-origin, since the window itself is what's now moving. */
/* 2026-09-18: misread the original request -- the blur/translucency/
   rainbow sheen was never the bug, it's the actual desired "Liquid
   Glass" material (iOS 26's own refractive-glass language) this is
   meant to look like. Pulled backdrop-filter here entirely in the
   previous round trying to chase down the rectangle/rainbow rendering
   bug; wrong target. Restored, but the rainbow specifically now comes
   from an explicit ::after gradient layer (below) instead of leaning on
   backdrop-filter's own sampling to accidentally produce it -- a
   deliberate, controlled effect rather than the side effect of a filter
   bug, so it looks the same regardless of whatever WebKit's blur
   sampling happens to do at this element's edges. This element itself
   is still never the transformed one (only its child .navbar-lens-
   content is scaled, and that child still has NO backdrop-filter on it
   or anything inside it -- see below), and only has a plain translate
   for centring, not a scale -- the specific WebKit bug found earlier
   (scaling a backdrop-filter element distorts its own sampling) doesn't
   apply to a translated-only element, so backdrop-filter is safe here. */
/* 2026-09-18: squircle, not a full circle -- matching the same rounded-
   rect language the active-tab highlight already uses (.navbar
   button's own border-radius, further above), so both "selection"
   surfaces in this bar read as one shape system instead of one being
   round and the other not. */
.navbar-lens-window {
  position: absolute; top: 50%; left: 0; width: 56px; height: 56px;
  transform: translate(-50%, -50%); border-radius: 20px; overflow: hidden;
  pointer-events: none; z-index: 2; opacity: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(10px) saturate(200%); -webkit-backdrop-filter: blur(10px) saturate(200%);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.6), inset 0 -2px 6px rgba(0,0,0,0.14), var(--shadow-lg);
  transition: opacity 0.12s var(--ease);
}
/* The rainbow refraction -- real glass bends light most at its edges,
   barely at all through its centre, so the conic rainbow sweep is now
   masked down to a ring around the rim (radial-gradient mask:
   transparent through the middle, opaque from ~55% of the radius out)
   instead of tinting the whole window uniformly -- a strong, visible
   chromatic fringe at the boundary with the centre left clear so the
   magnified icon underneath still reads plainly, the same balance the
   reference photo shows. ::after (not ::before) so it paints on top of
   .navbar-lens-content -- looking THROUGH tinted glass at the
   magnified icon, not the icon on top of the tint. */
/* 2026-09-18: swapped the generic pink/blue/purple sweep for HÉBÉ's own
   metallic-a/gold/metallic-b/metallic-c bronze palette -- direct
   request, same colours the wordmark shimmer, the "improve" spark icon,
   and the Add button's own gradient already use, so the lens reads as
   this app's own material catching light rather than a generic prism
   effect. color-mix() (not rgba()) since these are CSS custom
   properties -- rgba() can't pull channel values back out of a hex
   variable on its own. */
.navbar-lens-window::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: conic-gradient(from 0deg,
    color-mix(in srgb, var(--metallic-a) 70%, transparent),
    color-mix(in srgb, var(--gold) 62%, transparent),
    color-mix(in srgb, var(--metallic-b) 55%, transparent),
    color-mix(in srgb, var(--gold) 62%, transparent),
    color-mix(in srgb, var(--metallic-c) 68%, transparent),
    color-mix(in srgb, var(--metallic-a) 70%, transparent));
  -webkit-mask-image: radial-gradient(circle, transparent 52%, black 78%, black 100%);
  mask-image: radial-gradient(circle, transparent 52%, black 78%, black 100%);
  mix-blend-mode: overlay;
}
.navbar.lensing .navbar-lens-window { opacity: 1; }
.navbar-lens-content {
  position: absolute; top: 0; left: 0; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-around;
  transform-origin: 0 0; pointer-events: none;
}
/* Flattened stand-in, not a second real glass surface -- backdrop-
   filter is what's caused every rendering bug found in this lens so
   far, so it's stripped everywhere inside it, not just on the one
   element that was first suspected. */
.navbar-lens-content, .navbar-lens-content * {
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
/* The clone's own labels never need to render (icon-only lens, same as
   the bar at rest) and its buttons must never themselves be tappable
   (this is a read-only optical stand-in drawn over the real, live row). */
.navbar-lens-content .navbar-label { display: none; }
.navbar-lens-content button { pointer-events: none; cursor: default; }
@media (prefers-reduced-motion: reduce) {
  .navbar-lens-window, .navbar-lens-content { transition: none; }
}

/* ── Centered header brand mark — shared across every page's own
   .app-bar/.topbar (two header lineages exist across this app; both are
   `display:flex` with `position:sticky`, which is enough of a containing
   block for this to center correctly inside either one). Replaces the
   old left-aligned "HÉBÉ · pagename" text-crumb (.app-title/.brand-mini
   or .brand-crumb, depending on which lineage a given page was on) with
   just the mark glyph (static/brand/hebe-mark.svg's path -- the capsule
   IS the "pill" this is, per hebe_brand.md's own description) -- no
   wordmark alongside it, per direct request. Filled with the same
   brushed-metal gradient recipe the bottom nav's "improve" tab glyph
   already uses (metallic-a/gold/metallic-b/gold/metallic-c), not a flat
   --gold, so it reads as the physical brand mark rather than a flat icon.

   Absolutely positioned and centered independent of whatever the left
   (back button) and right (page actions) zones contain, rather than a
   flex `justify-content: space-between` middle slot -- stays dead-center
   regardless of how many action icons a given page's header carries.
   pointer-events: none so it can never intercept a tap meant for the
   back button or an action icon even if it visually overlaps one at a
   very narrow viewport.
   2026-09-18: real bug -- `top: 50%` centers against the WHOLE header
   box, top padding and all, but that padding is wildly asymmetric
   (calc(20-22px + env(safe-area-inset-top)), ~60-80px on a real device,
   vs a flat 14-16px on the bottom, no safe-area involved). The box's
   own geometric centre sits well above where the actual content row
   (back button, page actions) visually is, dragging the mark up into/
   near the notch on every page -- confirmed by the math, not just a
   guess: with ~80px top padding and ~44px content, the box centre is
   roughly 30px above the content row's real centre. Anchored from
   `bottom` instead, which never has a safe-area term and barely
   differs between the two header lineages (14px vs 16px -- picked one
   shared value close enough to both that the ~2px gap is invisible),
   so the mark lands at the content row's own vertical centre
   regardless of how tall the top safe-area inset happens to be on a
   given device. */
.app-bar-brand {
  position: absolute; left: 50%; bottom: 37px; transform: translateX(-50%);
  display: flex; align-items: center; pointer-events: none;
}
.app-bar-brand-mark { width: 24px; height: 24px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════════
   2026-08-25 redesign additions (Phase 1) — shared primitives for the
   "B" direction (darker premium, Eight-Sleep-style hero data) plus an
   opt-in "C" glass/aura surface treatment for specific hero moments,
   both confirmed from live concept-board review. Net-new; existing
   components above are unchanged. Page-local duplicates of .panel/
   .grade/.dgauge (recommend.html/stack.html/improve.html — each
   already comments "if you change one, change all three") migrate
   onto shared versions during each page's own redesign phase, not
   here — this section only adds what doesn't exist yet.
   ══════════════════════════════════════════════════════════════════ */

/* ── Hero score dial — a big semicircle arc gauge for a stack/session's
   single aggregate number (Stack Score today; any future 0-100 hero
   metric later), scaled up from the exact same drawn-arc convention
   /recommend's and /stack's existing small .grade-ring already use
   (same hebe-dial-draw keyframe, same tier-excellent-gets-the-brushed-
   metal-gradient rule) rather than a stylistically different gauge.
   Semicircle (not grade-ring's full circle) specifically because that
   reads as a "hero" instrument at this size, matching the Eight-Sleep-
   style reference the concept board confirmed.

   Contract: the caller sets two inline custom properties on
   .hebe-dial-arc — --dash-len (the arc path's own total length; fixed
   per the viewBox below, given here so callers don't need to compute
   it) and --dash-off (= (1 - value/100) * var(--dash-len), so 0 draws
   a full arc and --dash-len draws none), plus a tier-* class for
   color exactly like .grade-ring-arc. Markup:
   <div class="hebe-dial">
     <svg viewBox="0 0 200 110">
       <path class="hebe-dial-track" d="M14,100 A86,86 0 0 1 186,100"/>
       <path class="hebe-dial-arc tier-excellent" d="M14,100 A86,86 0 0 1 186,100"
             style="--dash-len:270.18; --dash-off:54"/>
     </svg>
     <div class="hebe-dial-num">78</div>
   </div>
   <div class="hebe-dial-cap">Stack Score</div> */
.hebe-dial { position: relative; width: 200px; max-width: 100%; aspect-ratio: 200 / 110; margin: 0 auto; }
.hebe-dial svg { width: 100%; height: 100%; overflow: visible; }
.hebe-dial-track { stroke: var(--faint); stroke-width: 10; fill: none; stroke-linecap: round; }
.hebe-dial-arc {
  stroke-width: 10; fill: none; stroke-linecap: round;
  stroke-dasharray: var(--dash-len, 270.18);
  animation: hebe-dial-draw 0.9s var(--ease-lux) both;
}
.hebe-dial-arc.tier-excellent {
  /* .hebe-metallic's own 5-stop gradient, as an SVG stroke rather than a
     text-clip — same brushed-bronze identity, different CSS mechanism
     because stroke can't take background-clip:text. Defined once via
     the inline <linearGradient id="hebeDialMetallic"> every hero dial's
     SVG must include (see markup contract above / page implementations). */
  stroke: url(#hebeDialMetallic);
}
.hebe-dial-arc.tier-good { stroke: var(--ink); }
.hebe-dial-arc.tier-fair, .hebe-dial-arc.tier-limited { stroke: var(--muted); }
.hebe-dial-num {
  position: absolute; left: 0; right: 0; bottom: 6%; text-align: center;
  font-family: var(--headline); font-weight: var(--weight-light); font-size: var(--text-display);
  font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1;
}
.hebe-dial-cap {
  text-align: center; font-size: var(--text-micro); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted); margin-top: 6px;
}
/* A row of 2-4 small supporting stats under the hero dial (goal coverage /
   evidence quality / safety, today) — plain ink, not a second accent
   colour, same "decorative status display" rule .stat-row above follows. */
.hebe-dial-stats { display: flex; gap: 8px; margin-top: 18px; }
.hebe-dial-stat { flex: 1; background: var(--stone); border-radius: var(--radius-md); padding: 9px 10px; text-align: center; }
.hebe-dial-stat b { display: block; font-family: var(--headline); font-weight: var(--weight-light); font-size: 16px; color: var(--ink); }
.hebe-dial-stat span { font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

/* ── Option pill with an icon tile — onboarding's goal/profile questions,
   one deliberate step up from the plain .seg-pill chip row above:
   .seg-pill stays for compact same-row choices (sex, activity level);
   .hebe-opt is for a single-column list of a few weightier options with
   real descriptive text. Was a plain numbered pill (Alo's "Question X of
   Y") until the icon-tile pass (Hims' numbered glass tiles, redrawn in
   HÉBÉ's own bronze/ink instead of Balance's saturated per-goal colour —
   the brand's no-saturated-colour rule holds even for a per-goal icon
   set). Markup:
   <div class="hebe-opt-list">
     <button class="hebe-opt on"><span class="hebe-opt-icon">{svg}</span><span class="hebe-opt-text">Sleep quality</span></button>
     ...
   </div> */
.hebe-opt-list { display: flex; flex-direction: column; gap: 10px; }
.hebe-opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--stone); border: none; border-radius: var(--radius-md);
  padding: 12px 16px; cursor: pointer; font-family: var(--sans);
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: background var(--dur-quick) var(--ease), box-shadow var(--dur-quick) var(--ease), transform var(--dur-instant) var(--ease);
}
.hebe-opt:hover { background: var(--stone-lift); }
.hebe-opt:active { transform: scale(0.98); }
.hebe-opt.on { background: var(--stone-lift); box-shadow: inset 0 0 0 1.5px var(--gold); }
.hebe-opt-icon {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: var(--radius-md);
  background: var(--warm-white); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-quick) var(--ease), color var(--dur-quick) var(--ease);
}
.hebe-opt-icon svg { width: 19px; height: 19px; }
.hebe-opt.on .hebe-opt-icon {
  background: linear-gradient(140deg, var(--metallic-a) 0%, var(--gold) 28%, var(--metallic-b) 50%, var(--gold) 72%, var(--metallic-c) 100%);
  color: var(--btn-primary-text);
}
.hebe-opt-text { font-size: 14px; font-weight: 500; color: var(--ink); }
/* Step progress dots — one per step, current step widens into a short bar.
   Reuses .hebe-bar's "one accent, spent deliberately" rule (--gold for
   the current step only, --faint for the rest). Box is always pill-sized
   (14x5, border-radius:999px so it self-clamps to a circle at rest and a
   full pill when scaled up) — the "grow" is a transform:scaleX, not an
   animated width/border-radius, so the resting-state layout is fixed and
   this never triggers reflow on toggle. */
.hebe-step-dots { display: flex; gap: 5px; justify-content: center; margin-top: 16px; }
.hebe-step-dot {
  width: 14px; height: 5px; border-radius: 999px; background: var(--faint);
  transform: scaleX(0.357); transform-origin: center;
  transition: transform var(--dur-quick) var(--ease), background var(--dur-quick) var(--ease);
}
.hebe-step-dot.on { background: var(--gold); transform: scaleX(1); }

/* ═══════════════════════════════════════════════════════════════════
   AURORA — the living mesh-gradient ground.

   This replaces the earlier static .hebe-aura, which layered three small
   blurred circles and read as flat painted haze rather than light. The
   difference is scale and motion: these blobs are viewport-sized (70-130%),
   blurred far past their own edges, additively blended, and each one drifts
   on its own long, prime-ish cycle (19/23/29/31/37s) so the composition
   never visibly loops — it just keeps evolving.

   WHY CSS KEYFRAMES, NOT JS: this animates continuously for as long as the
   screen is open, including while the page is fetching and rendering data.
   CSS animations on transform run on the compositor and keep moving through
   main-thread jank; a requestAnimationFrame loop would stutter every time a
   recommendation payload lands. Only transform/opacity animate here — no
   layout, no paint.

   DARK BY DESIGN: an aurora scene sets its own near-black ground instead of
   reading --warm-white, so it looks identical in either theme. Same
   deliberate exception the previous hero treatment made — this is an
   atmosphere, not a themed surface. Pages therefore use it for immersive
   moments (login, onboarding, hero blocks), and keep dense scrolling data
   on ordinary themed cards where legibility beats mood.

   Markup:
     <div class="hebe-aurora fixed">
       <b class="a1"></b><b class="a2"></b><b class="a3"></b><b class="a4"></b><b class="a5"></b>
       <i class="hebe-aurora-grain"></i><i class="hebe-aurora-vignette"></i>
     </div>
   <b>/<i> rather than <span>/<div> purely to keep this markup short — it
   repeats on every screen that opts in, and carries no semantics.
   ═══════════════════════════════════════════════════════════════════ */
.hebe-aurora {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: var(--aurora-ground, #0B0906);
}
.hebe-aurora.fixed { position: fixed; }
/* The shader canvas. Stretched over the host; it renders below its own CSS
   size (aurora.js RENDER_SCALE) and is upscaled, which is invisible on a
   field this soft. */
.hebe-aurora-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Once a GL context is live the blob layer is redundant — but it stays in the
   DOM so that a lost context or a blocked WebGL simply un-sets .gl and the
   CSS version reappears. */
.hebe-aurora.gl > b { display: none; }
/* The shader dithers internally, and its own flow supplies the texture the
   grain overlay was compensating for. */
.hebe-aurora.gl > .hebe-aurora-grain { display: none; }
.hebe-aurora b {
  position: absolute; display: block; border-radius: 50%;
  /* Blur radius is deliberately larger than most blobs' own radius: past
     that point the shape stops reading as "a circle" and becomes light. */
  filter: blur(var(--aurora-blur, 46px)); mix-blend-mode: var(--aurora-blend, plus-lighter);
  will-change: transform;
  animation-iteration-count: infinite;
  /* Each keyframe set is a closed CIRCUIT (0% and 100% identical) rather
     than an A-to-B pair played with `alternate`. Alternate looked almost
     static in practice: an ease-in-out curve parks the blob at both
     endpoints, so most of the cycle was spent barely moving. A circuit
     with `linear` keeps every blob in continuous motion, and because the
     five durations don't share factors the composite never repeats. */
  animation-direction: normal;
  animation-timing-function: linear;
}
/* PALETTE — the first attempt used five blobs from one copper family and
   they summed to a single flat brown; additive blending needs HUE contrast
   or it just saturates. The range here is the real metal palette the brand
   already owns: pale brass (yellow-green cast) against hot copper
   (red-orange cast), with dusty rose as the third note and deep umber
   anchoring the corners. Same warm world, but the hues actually separate.

   COMPOSITION — light is pushed to the corners and edges, leaving the
   optical centre darker, because that is where page content sits. This is
   also what gives glass something to refract: a pane spanning a bright
   corner and a dark middle shows a real gradient through it, whereas a pane
   over a uniform field reads as a flat grey box. */
.hebe-aurora .a1 { width:  74%; height: 44%; left: -22%; top: -14%;   background: radial-gradient(circle at 50% 50%, var(--aurora-1), transparent 66%); animation-name: aurora-drift-1; animation-duration: 8s; }
.hebe-aurora .a2 { width:  66%; height: 40%; right:-18%; top:  -2%;   background: radial-gradient(circle at 50% 50%, var(--aurora-2), transparent 68%); animation-name: aurora-drift-2; animation-duration: 7s; }
.hebe-aurora .a3 { width:  82%; height: 46%; left: -20%; bottom:-16%; background: radial-gradient(circle at 50% 50%, var(--aurora-3), transparent 66%); animation-name: aurora-drift-3; animation-duration: 11s; }
.hebe-aurora .a4 { width:  58%; height: 34%; right:-10%; bottom:-10%; background: radial-gradient(circle at 50% 50%, var(--aurora-4), transparent 66%); animation-name: aurora-drift-4; animation-duration: 13s; }
.hebe-aurora .a5 { width:  48%; height: 28%; left:  -4%; top:  44%;   background: radial-gradient(circle at 50% 50%, var(--aurora-5), transparent 64%); animation-name: aurora-drift-5; animation-duration: 17s; }

/* Travel is deliberately large — 30-55% of each blob's own size, plus real
   scale and rotation swings. The previous version moved ~14% and read as a
   still image: against a 68px blur, small translations produce almost no
   visible change. Rotation counts here because the blobs are ellipses, not
   circles; rotating an ellipse genuinely reshapes the light. */
@keyframes aurora-drift-1 {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  25%  { transform: translate3d(34%, 20%, 0) scale(1.28) rotate(9deg); }
  50%  { transform: translate3d(16%, 44%, 0) scale(0.92) rotate(-6deg); }
  75%  { transform: translate3d(-24%, 22%, 0) scale(1.18) rotate(5deg); }
  100% { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
}
@keyframes aurora-drift-2 {
  0%   { transform: translate3d(0, 0, 0) scale(1.1) rotate(0deg); }
  25%  { transform: translate3d(-38%, 26%, 0) scale(0.88) rotate(-11deg); }
  50%  { transform: translate3d(-14%, 52%, 0) scale(1.3) rotate(7deg); }
  75%  { transform: translate3d(22%, 24%, 0) scale(0.96) rotate(-4deg); }
  100% { transform: translate3d(0, 0, 0) scale(1.1) rotate(0deg); }
}
@keyframes aurora-drift-3 {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  25%  { transform: translate3d(30%, -28%, 0) scale(1.24) rotate(8deg); }
  50%  { transform: translate3d(-18%, -46%, 0) scale(0.9) rotate(-9deg); }
  75%  { transform: translate3d(-34%, -16%, 0) scale(1.16) rotate(4deg); }
  100% { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
}
@keyframes aurora-drift-4 {
  0%   { transform: translate3d(0, 0, 0) scale(0.94) rotate(0deg); }
  25%  { transform: translate3d(-30%, -34%, 0) scale(1.32) rotate(-13deg); }
  50%  { transform: translate3d(26%, -18%, 0) scale(1.02) rotate(10deg); }
  75%  { transform: translate3d(40%, 18%, 0) scale(0.86) rotate(-5deg); }
  100% { transform: translate3d(0, 0, 0) scale(0.94) rotate(0deg); }
}
@keyframes aurora-drift-5 {
  0%   { transform: translate3d(0, 0, 0) scale(1.05) rotate(0deg); }
  25%  { transform: translate3d(46%, -14%, 0) scale(0.85) rotate(12deg); }
  50%  { transform: translate3d(70%, 26%, 0) scale(1.35) rotate(-8deg); }
  75%  { transform: translate3d(24%, 40%, 0) scale(1.0) rotate(6deg); }
  100% { transform: translate3d(0, 0, 0) scale(1.05) rotate(0deg); }
}

/* Grain stops the gradient banding that large soft blends always produce on
   8-bit displays, and keeps the surface reading as film rather than vector. */
.hebe-aurora-grain {
  position: absolute; inset: 0; pointer-events: none;
  opacity: var(--aurora-grain-alpha, 0.055); mix-blend-mode: var(--aurora-grain-blend, overlay);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* Darkens the extremes so foreground type keeps its contrast wherever a
   bright blob happens to drift — without this, text legibility changes as
   the animation moves, which is the classic failure of gradient grounds. */
/* Centre scrim calms the middle of the screen so content always reads
   against a settled field while the corners stay luminous — without it,
   text contrast changes as the blobs drift underneath, which is the classic
   failure of animated gradient grounds. The scrim DARKENS on dark themes
   and LIGHTENS on light ones (see --aurora-scrim), since the text over it
   flips too. */
.hebe-aurora-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(96% 62% at 50% 50%, var(--aurora-scrim) 0%, transparent 76%),
    radial-gradient(130% 92% at 50% 46%, transparent 42%, var(--aurora-edge) 100%);
}

/* Content sits above the aurora. A scene is any container that hosts one. */
.hebe-aurora-scene { position: relative; overflow: hidden; background: var(--aurora-ground); color: var(--aurora-ink); }
.hebe-aurora-scene > *:not(.hebe-aurora) { position: relative; z-index: 1; }
.hebe-aurora-scene .hebe-muted { color: var(--aurora-ink-dim); }

/* ── GLASS — refraction, not just translucency.
   Four things separate real glass from a semi-transparent <div>, and the
   previous version only had the first two:
     1. backdrop blur + saturation boost (colour bleeds through, enriched)
     2. a gradient fill, brighter at the top edge (light falls from above)
     3. a RIM: a bright hairline on the top/left edge and a dark one below,
        which is what actually reads as "a pane with thickness"
     4. an inner top highlight, the specular streak on that pane
   Requires something visually busy behind it — over a flat fill there is
   nothing to refract and it collapses back into a grey box. */
/* 2026-09-01: a crisp, fully-visible border replaces the old 1px --glass-
   edge hairline as point 3's rim -- per the exact reference the user
   pointed to, whose glass card reads a clearly-drawn stroke on all four
   sides, not just a faint top/left catch-light. --glass-border is
   bronze-tinted at real opacity (not the old near-invisible 0.09-0.16
   alpha), so the pane's outline is legible even sitting on a plain
   ground with nothing colorful behind it to refract. */
.hebe-glass {
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(200%); -webkit-backdrop-filter: blur(28px) saturate(200%);
  box-shadow:
    inset 0 1px 0.5px var(--glass-rim),
    inset 0 -1px 0.5px var(--glass-under),
    inset 0 0 0 1.5px var(--glass-border),
    var(--glass-drop);
}
/* Selected / active state: the pane takes on the accent through its own
   tint and a brighter rim — NOT an outer coloured glow. The luminosity on
   these screens comes from the aurora behind the glass; a pane that also
   emits its own halo reads as generic "dark UI glow" and flattens the
   depth the backdrop-filter is doing. */
.hebe-glass.on {
  background: linear-gradient(158deg, rgba(232,180,137,0.34) 0%, rgba(232,180,137,0.12) 50%, rgba(184,115,51,0.06) 100%);
  box-shadow:
    inset 0 1px 0.5px rgba(255,240,224,0.66),
    inset 0 0 0 1.5px rgba(232,180,137,0.62),
    0 18px 44px -18px rgba(0,0,0,0.72);
}
/* A darker pane for use over BRIGHT aurora regions, where the standard
   white-tinted glass loses its edge definition. */
.hebe-glass.deep {
  background: linear-gradient(158deg, rgba(20,14,9,0.52) 0%, rgba(20,14,9,0.34) 100%);
  box-shadow:
    inset 0 1px 0.5px rgba(255,255,255,0.24),
    inset 0 0 0 1px rgba(255,255,255,0.07),
    0 18px 44px -18px rgba(0,0,0,0.8);
}

/* ── SPOTLIGHT — a cursor-tracked glow that traces a card's own edge,
   for the rare card that should feel alive under the pointer (dosage/
   recommendation panels on /stack — see recommend.html's mount call,
   NOT a default card treatment). Deliberately NOT an outer blurred halo
   bleeding past the card: that's the exact "dark UI glow" anti-pattern
   already rejected for .hebe-glass above. This only lights the card's
   own border ring (the mask trick below paints the radial gradient
   solely into the border-box/padding-box difference) plus a faint inner
   wash contained by the card's own background — a rim catching light,
   not a halo around it.
   --x/--y are plain numbers (not px), set ONCE on :root by spotlight.js
   (a single shared pointermove listener) and inherited down to every
   .hebe-spotlight instance — mounting more cards costs nothing extra.
   background-attachment:fixed is what makes one raw viewport coordinate
   line up correctly on every card despite each being a different
   element with its own local background-position origin. */
:root { --x: 50; --y: -40; }

.hebe-spotlight {
  position: relative;
  --spotlight-size: 240px;
  --spotlight-ring: 2px;
  /* A thin, always-on bronze frame — unlike the cursor-tracked glow
     above, this doesn't need to wait for a pointer to say "this card is
     one of the special ones." Inset so it reads as an edge, not a drawn
     border fighting the card's own border-radius. */
  box-shadow: inset 0 0 0 1px var(--spotlight-frame-color);
}
.hebe-spotlight::before {
  content: ''; pointer-events: none; position: absolute; z-index: 2;
  inset: calc(var(--spotlight-ring) * -1);
  border: var(--spotlight-ring) solid transparent;
  border-radius: inherit;
  background-attachment: fixed; background-repeat: no-repeat;
  background-image: radial-gradient(
    var(--spotlight-size) var(--spotlight-size) at calc(var(--x) * 1px) calc(var(--y) * 1px),
    var(--spotlight-ring-color), transparent 70%
  );
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  transition: opacity var(--dur-quick) var(--ease);
}
.hebe-spotlight::after {
  content: ''; pointer-events: none; position: absolute; inset: 0; z-index: 0;
  border-radius: inherit;
  background-attachment: fixed; background-repeat: no-repeat;
  background-image: radial-gradient(
    calc(var(--spotlight-size) * 0.9) calc(var(--spotlight-size) * 0.9) at calc(var(--x) * 1px) calc(var(--y) * 1px),
    var(--spotlight-wash-color), transparent 75%
  );
  opacity: 0.5;
}
.hebe-spotlight > * { position: relative; z-index: 1; }

/* Light: a soft neutral sheen (like glass catching light) — NOT bronze.
   Dark: the actual bronze/gold family, per the handoff's one accent.
   The resting frame (--spotlight-frame-color) is bronze in both themes
   though — a static 1px hairline reads as a considered detail rather
   than the "large bronze field" the handoff warns against, so it doesn't
   need the same light/dark split the big cursor-driven glow does. */
:root {
  --spotlight-ring-color: color-mix(in srgb, var(--ink) 22%, transparent);
  --spotlight-wash-color: color-mix(in srgb, var(--warm-white) 85%, transparent);
  --spotlight-frame-color: color-mix(in srgb, var(--gold) 32%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --spotlight-ring-color: color-mix(in srgb, var(--gold) 80%, transparent);
    --spotlight-wash-color: color-mix(in srgb, var(--metallic-b) 30%, transparent);
    --spotlight-frame-color: color-mix(in srgb, var(--gold) 45%, transparent);
  }
}
:root[data-theme="dark"] {
  --spotlight-ring-color: color-mix(in srgb, var(--gold) 80%, transparent);
  --spotlight-frame-color: color-mix(in srgb, var(--gold) 45%, transparent);
  --spotlight-wash-color: color-mix(in srgb, var(--metallic-b) 30%, transparent);
}

/* Cursor-tracking is a hover-pointer thing; on touch there's no ambient
   position to follow, so the ring/wash stay put at their idle :root
   default instead of chasing a stale or absent coordinate. */
@media not all and (hover: hover) and (pointer: fine) {
  .hebe-spotlight::before, .hebe-spotlight::after { opacity: 0.35; }
}

/* ── GLARE — per-card 3D tilt + a radial glare that tracks the pointer
   relative to THAT card's own center (see glare.js), not a shared
   viewport position. Reserved for the rare sparse-hero moment that earns
   real playfulness (onboarding's welcome feature grid) — .hebe-spotlight
   above is the one dosage/recommendation panels use, deliberately calmer
   since those are dense data, not a first impression. transform/opacity
   only, so it stays composited even while tilting. */
.hebe-glare {
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform 0.5s var(--ease-lux), box-shadow var(--dur-quick) var(--ease);
  will-change: transform;
}
.hebe-glare::before, .hebe-glare::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  opacity: 0; transition: opacity var(--dur-quick) var(--ease);
}
.hebe-glare::before {
  z-index: 1;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), var(--glare-color), transparent 68%);
  mix-blend-mode: soft-light;
}
.hebe-glare::after {
  z-index: 2; padding: 1px;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), var(--glare-edge-color), transparent 55%);
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.hebe-glare.is-glaring::before, .hebe-glare.is-glaring::after { opacity: 1; }
.hebe-glare.is-glaring { box-shadow: 0 20px 40px -20px rgba(0,0,0,0.5); }
.hebe-glare > * { position: relative; z-index: 3; }

:root {
  --glare-color: color-mix(in srgb, var(--gold) 55%, transparent);
  --glare-edge-color: color-mix(in srgb, var(--gold) 90%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glare-color: color-mix(in srgb, var(--metallic-b) 60%, transparent);
    --glare-edge-color: color-mix(in srgb, var(--gold) 95%, transparent);
  }
}
:root[data-theme="dark"] {
  --glare-color: color-mix(in srgb, var(--metallic-b) 60%, transparent);
  --glare-edge-color: color-mix(in srgb, var(--gold) 95%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .hebe-glare { transition: none; transform: none; }
  .hebe-glare::before, .hebe-glare::after { display: none; }
}
@media not all and (hover: hover) and (pointer: fine) {
  /* No ambient pointer on touch -- the tilt/glare has nothing to react
     to, so it stays off rather than getting stuck mid-effect. */
  .hebe-glare::before, .hebe-glare::after { display: none; }
}

/* ── Display typography — the reference's actual voice: thin Helvetica,
   very large, tracked tight. Only ever one of these per screen. ── */
.hebe-mega    { font-family: var(--headline); font-size: var(--text-mega);    font-weight: var(--weight-display); letter-spacing: var(--track-mega);    line-height: 0.94; }
.hebe-display { font-family: var(--headline); font-size: var(--text-display); font-weight: var(--weight-display); letter-spacing: var(--track-display); line-height: 1.06; text-wrap: balance; }
.hebe-title   { font-family: var(--headline); font-size: var(--text-h1);      font-weight: var(--weight-light);   letter-spacing: var(--track-h1);      line-height: 1.16; text-wrap: balance; }
/* The wide-tracked uppercase micro-label above a headline or stat. */
.hebe-eyebrow {
  font-family: var(--headline); font-size: var(--text-micro); font-weight: var(--weight-light);
  text-transform: uppercase; letter-spacing: var(--track-eyebrow); color: var(--muted);
}
.hebe-aurora-scene .hebe-eyebrow { color: #C3B4A0; }
/* Tabular figures everywhere a number can change in place, so digits don't
   jitter as they count up. */
.hebe-num { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  /* The aurora KEEPS its colour and composition and simply stops moving —
     reduced motion means less movement, not a stripped-back page. Each blob
     is frozen at a hand-picked offset rather than all at translate(0), so
     the still frame is a composed image instead of five stacked circles. */
  /* `animation: none` MUST be declared at the same specificity as the
     per-blob rules that set animation-name (.hebe-aurora .a1 = 0,2,0). An
     earlier version put it on `.hebe-aurora b` (0,1,1), which loses the
     cascade — the blobs kept animating at full speed for reduced-motion
     users while appearing correct in code review. Verified by asserting
     the transform is stable over time under emulation, not by reading. */
  .hebe-aurora .a1,
  .hebe-aurora .a2,
  .hebe-aurora .a3,
  .hebe-aurora .a4,
  .hebe-aurora .a5 { animation: none; }
  .hebe-aurora .a1 { transform: translate3d(7%, 5%, 0) scale(1.09); }
  .hebe-aurora .a2 { transform: translate3d(-8%, 7%, 0) scale(1.03); }
  .hebe-aurora .a3 { transform: translate3d(6%, -6%, 0) scale(1.11); }
  .hebe-aurora .a4 { transform: translate3d(5%, -2%, 0) scale(1.07); }
  .hebe-aurora .a5 { transform: translate3d(-7%, -4%, 0) scale(1.0); }

  .hebe-enter, .hebe-stagger > *, .hebe-breathe, .hebe-bounce { animation: none; }
  .hebe-mark-load { animation: none; }
  .spinner { animation: none; }
  .loading-panel { animation: none; }
  .hebe-skeleton { animation: none; }
  /* .grade-fill (recommend/stack/improve.html) is a page-local class name
     for the identical Hebe Grade meter bar -- same hebe-bar-draw keyframe
     as .hebe-bar-fill, just not the shared class, so it needs its own
     entry here rather than inheriting the one above by name. */
  .hebe-bar-fill, .grade-fill { animation: none; transform: scaleX(var(--fill, 1)); }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }

  /* hebe-fade and hebe-dial-draw are consumed by name (animation: hebe-fade
     ...) from page-local CSS on login/stack/improve/account/recommend —
     redefining the keyframes here (rather than trying to list every
     page's selector) neutralizes them wherever they're used, including
     future pages, without editing those files. Jumps straight to each
     animation's resting state, same convention as .hebe-bar-fill above. */
  @keyframes hebe-fade { from, to { opacity: 1; } }
  @keyframes hebe-dial-draw { from, to { stroke-dashoffset: var(--dash-off, 0); } }

  /* CSS transitions (as opposed to @keyframes animations) aren't touched
     by the rules above — neutralize the ones defined in this file too. */
  body,
  .seg-pill,
  .dose-gauge-marker,
  .dose-gauge-tooltip,
  .theme-toggle,
  .theme-toggle svg,
  .navbar button {
    transition: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   ADHERENCE COMPONENTS — week strip, activity heatmap, delta chip,
   stat trio, range gauge.

   All five are driven by ONE data source: streaks.trend()'s per-day
   {date, active, checked, pct}. Nothing here is decorative-only; a cell,
   ring, or delta that has no real day behind it renders as "no data"
   rather than as zero, because "you took nothing" and "you had no stack
   yet" are different facts and must not look alike.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Week strip — seven days, each a ring of that day's adherence.
   Today is filled; past days keep their ring so the week reads as a
   record rather than a countdown. ── */
.hebe-week { display: flex; gap: 6px; justify-content: space-between; }
.hebe-week-day {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; padding: 4px 0; font-family: var(--sans); cursor: default;
}
.hebe-week-ring { position: relative; width: 38px; height: 38px; }
.hebe-week-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hebe-week-track { stroke: var(--faint); stroke-width: 3; fill: none; }
.hebe-week-arc   { stroke: var(--gold); stroke-width: 3; fill: none; stroke-linecap: round; }
.hebe-week-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums;
}
.hebe-week-lbl { font-size: 10px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
/* Today: the ring's centre fills, so the current day is unmistakable
   without relying on colour alone. */
.hebe-week-day.today .hebe-week-num {
  background: var(--gold); color: var(--aurora-ground, #0B0906);
  border-radius: 50%; inset: 4px; font-weight: 600;
}
.hebe-week-day.today .hebe-week-lbl { color: var(--ink); }
/* A day before the stack existed has nothing to report. */
.hebe-week-day.void .hebe-week-track { stroke: var(--hair); }
.hebe-week-day.void .hebe-week-num { color: var(--muted); opacity: 0.45; }

/* ── Activity heatmap — one cell per day, three states. Rounded bars
   rather than squares, matching the reference's cell shape. ── */
.hebe-heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.hebe-heat i {
  display: block; aspect-ratio: 1 / 1.5; border-radius: 999px; background: var(--faint);
}
.hebe-heat i.full    { background: var(--gold); }
.hebe-heat i.partial { background: var(--gold); opacity: 0.42; }
.hebe-heat i.none    { background: var(--faint); }
/* Dashed, not filled: a day with no stack is absent data, not a miss. */
.hebe-heat i.void    { background: none; box-shadow: inset 0 0 0 1.5px var(--faint); }
.hebe-heat-legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px;
  font-size: var(--text-micro); color: var(--muted);
}
.hebe-heat-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hebe-heat-legend b { display: block; width: 16px; height: 10px; border-radius: 999px; background: var(--faint); }
.hebe-heat-legend b.full { background: var(--gold); }
.hebe-heat-legend b.partial { background: var(--gold); opacity: 0.42; }
.hebe-heat-legend b.void { background: none; box-shadow: inset 0 0 0 1.5px var(--faint); }

/* ── Delta chip — "+12% from last week". Direction is carried by the
   arrow glyph AND the wording, never by colour alone (this palette has
   no red, and a bronze-vs-muted pair is not a reliable signal). ── */
.hebe-delta {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 5px 12px; background: var(--stone-lift); font-size: var(--text-caption);
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.hebe-delta svg { width: 13px; height: 13px; color: var(--gold); }
.hebe-delta.down svg { color: var(--muted); }
.hebe-delta.flat svg { color: var(--muted); }

/* ── Stat trio — three facts on one line, divided not boxed. ── */
.hebe-stats3 { display: flex; align-items: stretch; }
.hebe-stats3 > div { flex: 1; min-width: 0; text-align: center; padding: 0 8px; }
.hebe-stats3 > div + div { border-left: 1px solid var(--hair); }
.hebe-stats3 b {
  display: block; font-family: var(--headline); font-weight: var(--weight-light);
  font-size: 20px; letter-spacing: var(--track-h1); color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.hebe-stats3 span { display: block; font-size: var(--text-micro); color: var(--muted); margin-top: 3px; }

/* ── Range gauge — a value placed within a known low/high band, with the
   current reading called out on the track. Used for "your dose against
   the studied range": the band is what the literature used, the chip is
   what you actually take. ── */
.hebe-range { padding-top: 4px; }
.hebe-range-track {
  position: relative; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--faint) 0%, var(--gold) 50%, var(--faint) 100%);
}
/* The studied band, drawn over the track. transform-origin: center so it
   grows outward from the middle (the track's own gradient already peaks
   at 50%) rather than sliding in from one edge -- left/right insets set
   the real final size inline (per-instance data), the animation only
   ever touches transform/opacity on top of that. */
.hebe-range-band {
  position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--gold);
  transform-origin: center;
  animation: hebe-range-band-in 0.6s var(--ease-pop) both;
}
@keyframes hebe-range-band-in {
  from { opacity: 0; transform: scaleX(0); }
  to { opacity: 1; transform: scaleX(1); }
}
.hebe-range-chip {
  position: absolute; top: 50%;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  background: var(--gold); color: var(--aurora-ground, #0B0906);
  border-radius: 999px; padding: 3px 9px; font-size: 11.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; box-shadow: 0 2px 8px -2px rgba(0,0,0,0.4);
  /* Pops in slightly after the band -- the track draws in first, then the
     "here's what you actually take" chip drops onto it, same beat
     dose-gauge.tsx's own marker-after-zone sequencing already uses. */
  animation: hebe-range-chip-in 0.4s var(--ease-pop) 0.2s both;
}
@keyframes hebe-range-chip-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.hebe-range-chip svg { width: 11px; height: 11px; }
@media (prefers-reduced-motion: reduce) {
  .hebe-range-band, .hebe-range-chip { animation-duration: 0.01ms !important; animation-delay: 0ms !important; }
}
.hebe-range-ends {
  display: flex; justify-content: space-between; margin-top: 14px;
  font-size: var(--text-micro); color: var(--muted); font-variant-numeric: tabular-nums;
}
.hebe-range-ends b { color: var(--ink); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════════
   GRADIENT GROUND — every page, not just the aurora heroes.

   Dark mode was a flat #14110C fill, which made the ordinary pages read
   as a different product from login/onboarding. This gives every page a
   soft, fixed gradient ground in the brand's own palette.

   Deliberately far weaker than the aurora: it sits behind body copy and
   data, so it never moves and never approaches the contrast of the text
   on top of it. `background-attachment: fixed` keeps it still while
   content scrolls, so it reads as depth in the page rather than as a
   pattern travelling with the content.
   ═══════════════════════════════════════════════════════════════════ */
body {
  background-color: var(--warm-white);
  background-image: var(--page-gradient, none);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

:root {
  /* Light: barely-there warmth in the corners, keeping the middle clean
     for text. */
  --page-gradient:
    radial-gradient(120% 68% at 12% -6%,  rgba(247, 214, 160, 0.34) 0%, transparent 62%),
    radial-gradient(110% 62% at 96% 10%,  rgba(238, 176, 140, 0.26) 0%, transparent 58%),
    radial-gradient(130% 70% at 50% 108%, rgba(226, 170, 168, 0.24) 0%, transparent 60%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    /* Dark carries more of it — a near-black ground with copper light
       pooling at the edges, the same world as the aurora screens. */
    --page-gradient:
      radial-gradient(115% 62% at 8% -8%,   rgba(201, 132, 66, 0.20) 0%, transparent 60%),
      radial-gradient(105% 58% at 100% 12%, rgba(176, 96, 58, 0.17)  0%, transparent 56%),
      radial-gradient(135% 72% at 50% 106%, rgba(140, 74, 30, 0.22)  0%, transparent 62%);
  }
}
:root[data-theme="dark"] {
  --page-gradient:
    radial-gradient(115% 62% at 8% -8%,   rgba(201, 132, 66, 0.20) 0%, transparent 60%),
    radial-gradient(105% 58% at 100% 12%, rgba(176, 96, 58, 0.17)  0%, transparent 56%),
    radial-gradient(135% 72% at 50% 106%, rgba(140, 74, 30, 0.22)  0%, transparent 62%);
}
:root[data-theme="light"] {
  --page-gradient:
    radial-gradient(120% 68% at 12% -6%,  rgba(247, 214, 160, 0.34) 0%, transparent 62%),
    radial-gradient(110% 62% at 96% 10%,  rgba(238, 176, 140, 0.26) 0%, transparent 58%),
    radial-gradient(130% 70% at 50% 108%, rgba(226, 170, 168, 0.24) 0%, transparent 60%);
}

/* A sticky top bar sat on a flat --warm-white gradient-to-transparent, which
   showed as a hard band once the page behind it had a gradient. Fading the
   solid colour only, over a transparent base, keeps the scrim invisible. */
.topbar { background: linear-gradient(var(--warm-white) 62%, rgba(0,0,0,0)) !important; }

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS — the reference's pill pair: a filled primary and a quiet
   secondary, both fully rounded, both able to carry a leading icon.
   ═══════════════════════════════════════════════════════════════════ */
.hebe-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 999px; cursor: pointer;
  font-family: var(--sans); font-size: 13px; font-weight: var(--weight-light);
  text-transform: uppercase; letter-spacing: var(--track-eyebrow);
  padding: 14px 22px; text-decoration: none; white-space: nowrap;
  transition: opacity var(--dur-quick) var(--ease), transform var(--dur-instant) var(--ease),
              background var(--dur-quick) var(--ease);
}
.hebe-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.hebe-btn:active { transform: scale(0.985); }
.hebe-btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.hebe-btn.block { width: 100%; }

/* Primary — the brand's metal, used once per screen. The gradient is the
   Real bug fixed 2026-08-31 ("shimmering weirdly," a hard diagonal seam
   visibly cutting across the button on a loop): this used to copy
   .hebe-metallic's stops verbatim (metallic-a→gold→metallic-b→gold→
   metallic-c, PLUS a stray 6th "gold 100%" stop) — a gradient built for
   ONE-SHOT static text (background-clip:text never repeats, so its own
   start/end colors never need to match). Tiled and animated via
   background-position the way this button is, that mismatch is exactly
   the bug: the pattern's own 100% edge (gold) butts against the next
   tile's 0% edge (metallic-a) every loop, and that mismatch is what
   scrolls across the button as a hard seam. Fixed by making this its
   own true 5-stop PALINDROME (starts AND ends on metallic-a) so the tile
   boundary is invisible — doubled end-to-end (220% background-size) so
   animating background-position reads as a slow, liquid shimmer moving
   across the metal, the same "moving highlight" idea loading.js's
   spinner already uses via an animated SVG gradient, done here in plain
   CSS since a button doesn't need its own canvas/WebGL context for it.
   Ambient at rest (this is a "once per screen" element, not a frequent
   one, so continuous motion is in-budget per the animate philosophy),
   quickens on hover, and a click gets a one-shot ripple from the actual
   tap point (see ripple.js) — the surface visibly responds to touch
   instead of just recoloring. */
/* 2026-09-01: frosted-glass pass -- the shimmer gradient/grain/ripple
   above are untouched (that craft stays); the stops are now translucent
   (rgba of the exact same metallic-a/gold/metallic-b hues, not new
   colors) and a backdrop-filter blur is added, so the button reads as a
   glass pane with the brushed-metal shimmer moving *inside* it rather
   than a flat opaque fill -- same material language as the rebuilt nav's
   glass circles and Add button. */
.hebe-btn.primary {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg,
    rgba(140,74,30,0.88) 0%, rgba(184,115,51,0.90) 25%, rgba(232,180,137,0.86) 50%,
    rgba(184,115,51,0.90) 75%, rgba(140,74,30,0.88) 100%);
  background-size: 220% 100%;
  backdrop-filter: blur(18px) saturate(180%); -webkit-backdrop-filter: blur(18px) saturate(180%);
  color: var(--btn-primary-text);
  box-shadow: 0 10px 24px -12px rgba(0,0,0,0.55), inset 0 1px 0.5px rgba(255,255,255,0.42), inset 0 0 0 1.5px var(--glass-border);
  animation: hebe-btn-shimmer 6s linear infinite;
  transition: opacity var(--dur-quick) var(--ease), transform var(--dur-instant) var(--ease),
              box-shadow var(--dur-quick) var(--ease);
}
.hebe-btn.primary:hover {
  opacity: 1; animation-duration: 2s;
  box-shadow: 0 14px 30px -12px rgba(0,0,0,0.6), inset 0 1px 0.5px rgba(255,255,255,0.5), inset 0 0 0 1.5px var(--glass-border);
}
/* Real feedback (2026-09-06): the fill-drift shimmer above didn't read
   as "shimmering" on its own -- a moving highlight chasing the BORDER
   specifically is what a metal rim catching light actually looks like.
   ::before (the fill shimmer/grain already own the background/::after)
   sized to the button's own box, painted with a conic-gradient "comet"
   (bright head fading to transparent, then dark the rest of the way
   around), then masked down to a thin ring via the standard gradient-
   border trick (content-box cut out of border-box via mask-composite)
   -- entirely inside the box, so it never needs `overflow: visible` on
   an element that relies on `overflow: hidden` for the grain and fill
   shimmer. Same copper family as the fill (gold/metallic-a/b/c), no new
   color -- this is the existing metal shimmering at its own edge, not a
   different effect bolted on. */
/* Real bug, caught by screenshot: animating `transform: rotate()` on the
   ::before ITSELF rotates its whole box -- fine for a circle, but this
   is an elongated pill, so rotating the box tilted the ring's own
   pill-shaped mask off-axis from the real (un-rotated) button beneath
   it, and the tilted ring's edge sliced across the middle as a visible
   diagonal seam. The mask/ring geometry must stay perfectly static; only
   the gradient's OWN angle should move, which needs @property to
   interpolate smoothly (a plain custom property snaps between keyframes
   instead of animating). */
@property --hebe-btn-spin {
  syntax: '<angle>'; inherits: false; initial-value: 0deg;
}
.hebe-btn.primary::before {
  content: '';
  position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  /* Both ends of the loop match (transparent) so the 0deg/360deg wrap
     is invisible -- a mismatched pair here is the same "hard seam"
     bug in a different guise. */
  background: conic-gradient(from var(--hebe-btn-spin),
    transparent 0deg, transparent 290deg, var(--metallic-a) 300deg,
    var(--gold) 315deg, var(--metallic-b) 328deg, var(--gold) 341deg,
    var(--metallic-a) 352deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: hebe-btn-border-spin 2.8s linear infinite;
  pointer-events: none;
}
.hebe-btn.primary:hover::before { animation-duration: 1.1s; }
@keyframes hebe-btn-border-spin { to { --hebe-btn-spin: 360deg; } }
/* The same film-grain noise texture .hebe-aurora-grain uses on the aurora
   scenes -- a brushed-metal finish on the metallic gradient instead of a
   flat, vector-smooth fill, matching the "grainy gradient" the aurora
   treatment already established elsewhere in this redesign. ::after (not
   ::before) so it paints over the gradient and reads as surface texture
   rather than sitting under it; overlay blend at low opacity so it never
   competes with the button's own text for legibility. */
.hebe-btn.primary::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.09; mix-blend-mode: overlay;
}
.hebe-btn.primary:active {
  transform: scale(0.97);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.35);
}
@keyframes hebe-btn-shimmer { to { background-position: -220% 0; } }

.hebe-ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 72%);
  transform: scale(0); animation: hebe-btn-ripple 0.15s var(--ease-lux) forwards;
}
@keyframes hebe-btn-ripple { to { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .hebe-btn.primary { animation: none; background-position: 0 0; }
  .hebe-btn.primary::before { animation: none; }
  .hebe-ripple { display: none; }
}

/* Secondary — the reference's white counterpart to the filled pill.
   2026-09-01: now a real glass pane (.hebe-glass's own recipe, inlined
   rather than stacking classes so :hover can still restyle it as one
   rule) instead of a flat --surface fill. */
.hebe-btn.secondary {
  background: var(--glass-bg); color: var(--ink);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 1px 0.5px var(--glass-rim), inset 0 -1px 0.5px var(--glass-under), inset 0 0 0 1.5px var(--glass-border);
}
.hebe-btn.secondary:hover {
  background: linear-gradient(158deg, rgba(232,180,137,0.22) 0%, rgba(232,180,137,0.08) 50%, rgba(184,115,51,0.04) 100%);
}

/* Quiet — text-weight action that still has a hit area. */
.hebe-btn.ghost { background: none; color: var(--gold); padding: 10px 4px; }
.hebe-btn.ghost:hover { opacity: 0.7; background: none; }

@media (prefers-reduced-motion: reduce) { .hebe-btn { transition: none; } }

/* ═══════════════════════════════════════════════════════════════════
   PAGE RHYTHM — cards instead of one continuous column.

   The dense pages were a flat stack of sections separated by margin only,
   so a long page read as one uninterrupted scroll of text with no sense of
   where one idea ended and the next began. The references all do the same
   thing instead: group related content into a contained card, and let the
   gap between cards carry the structure.
   ═══════════════════════════════════════════════════════════════════ */
.hebe-card {
  background: var(--stone); border-radius: 24px;
  padding: 22px 20px; margin-top: 16px;
}
.hebe-card > .hebe-eyebrow { display: block; margin-bottom: 4px; }
/* Card titles sit tighter to their eyebrow than a page-level heading does. */
.hebe-card-title {
  font-family: var(--headline); font-weight: var(--weight-light);
  font-size: var(--text-h2); letter-spacing: var(--track-h1);
  margin: 0 0 16px; text-wrap: balance;
}
/* A group of cards that belong to one theme gets a label above the run,
   with real air before it — this is the beat the pages were missing. */
.hebe-group { margin-top: 40px; }
.hebe-group:first-child { margin-top: 8px; }
.hebe-group > .hebe-eyebrow { display: block; margin-bottom: 2px; }
.hebe-group-title {
  font-family: var(--headline); font-weight: var(--weight-display);
  font-size: var(--text-h1); letter-spacing: var(--track-h1);
  line-height: 1.14; margin: 0 0 6px; text-wrap: balance;
}
.hebe-group-sub { font-size: var(--text-caption); color: var(--muted); line-height: 1.55; margin-bottom: 4px; }

/* Scroll reveal — resting state before reveal.js releases it. Transform +
   opacity only, so it composites; the class is removed on arrival and never
   reapplied. */
.hebe-reveal { opacity: 0; transform: translateY(16px); }
.hebe-reveal, .hebe-card, .hebe-group {
  transition: opacity var(--dur-calm) var(--ease-lux), transform var(--dur-calm) var(--ease-lux);
}

@media (prefers-reduced-motion: reduce) {
  /* reveal.js strips the class outright under reduced motion, but neutralise
     the resting state too in case a page renders before the script runs. */
  .hebe-reveal { opacity: 1; transform: none; }
  .hebe-reveal, .hebe-card, .hebe-group { transition: none; }
}

/* ── Aurora, arched.
   A welcome screen wants the light gathered into a dome at the top with the
   content sitting in calm dark beneath it, rather than an even field. Masking
   the aurora (canvas AND the CSS-blob fallback) shapes it without touching
   the shader — the flow is identical, it just falls off below the arch. */
.hebe-aurora.arch .hebe-aurora-gl,
.hebe-aurora.arch > b {
  -webkit-mask-image: radial-gradient(140% 105% at 50% 4%, #000 0%, #000 40%, rgba(0,0,0,0.55) 68%, rgba(0,0,0,0.22) 92%, rgba(0,0,0,0.1) 100%);
          mask-image: radial-gradient(140% 105% at 50% 4%, #000 0%, #000 40%, rgba(0,0,0,0.55) 68%, rgba(0,0,0,0.22) 92%, rgba(0,0,0,0.1) 100%);
}
/* The vignette would re-darken the arch it's meant to sit under. */
.hebe-aurora.arch > .hebe-aurora-vignette { display: none; }

/* ═══════════════════════════════════════════════════════════════════
   ADD BUTTON — the centre action in the nav bar.

   2026-09-17: normalized to a plain .navbar button, same as its four
   siblings. It used to be a raised, oversized, gradient-filled circle
   living outside the flex row entirely (position:absolute, so its
   column had zero real width) -- several rounds of trying to tune that
   circle's own size/raise never fixed the row's actual skewed/uneven
   spacing, because the ROOT cause was this button never being a normal
   flex item in the first place. Putting it back in flow as an ordinary
   .navbar button removes that whole class of bug outright: all five
   columns are now the same real button, laid out by the exact same
   rules, nothing special to keep in sync. No more distinct fill/raise/
   position -- "a normal button like the rest of them," per direct
   request, not a toned-down version of the old treatment. */

/* ── Reminder sheet ──────────────────────────────────────────────────
   The old reminder control was a single on/off pill, which recorded that
   someone wanted reminding but never when or how often — the only two
   things a reminder needs. This asks both. */
.rem-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.34); opacity: 0; transition: opacity var(--dur-quick) var(--ease);
}
.rem-overlay.open { opacity: 1; }
@media (min-width: 560px) { .rem-overlay { align-items: center; } }
/* 2026-09-02: frosted glass (the same crisp-bordered recipe as .hebe-glass
   -- see its own comment) instead of a flat --stone fill, plus an iOS-
   style grip bar (::before) at the top -- both per a direct reference the
   user pointed to (a phone photo of a bottom sheet with exactly this
   material and handle). sheet-drag.js is what makes the handle actually
   draggable, not just decorative -- this file only draws it and defines
   the slide transform it animates; the gesture logic lives there so
   every .rem-overlay across the app (dynamically created or static
   markup alike) gets it for free, without each open*Sheet() needing its
   own drag code. */
.rem-sheet {
  position: relative;
  width: 100%; max-width: 440px; max-height: 86vh; overflow-y: auto;
  touch-action: pan-y;
  background: var(--glass-bg); color: var(--ink); border-radius: 26px 26px 0 0;
  backdrop-filter: blur(28px) saturate(200%); -webkit-backdrop-filter: blur(28px) saturate(200%);
  box-shadow:
    inset 0 1px 0.5px var(--glass-rim), inset 0 -1px 0.5px var(--glass-under),
    inset 0 0 0 1.5px var(--glass-border), var(--glass-drop);
  padding: 14px 22px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform var(--dur-calm) var(--ease-lux);
}
.rem-sheet::before {
  content: ''; display: block; width: 36px; height: 4px; border-radius: var(--radius-pill);
  background: var(--glass-border); margin: 0 auto 18px;
}
/* Real bug: dragging the whole sheet fought the browser's own native
   touch-scroll handling (needed elsewhere in the sheet for a long
   ingredient list, the goals grid, etc.) and reliably lost on an actual
   touch device -- a mouse-simulated test still "worked" since there's no
   competing native pan gesture for a mouse. sheet-drag.js now injects
   this as a real element (not just the ::before decoration above) sized
   for an actual touch target, positioned over the same visual handle,
   with its OWN touch-action so it -- and only it -- owns the drag
   gesture; the rest of the sheet's scrolling is untouched. */
.rem-sheet-grip {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 120px; height: 36px; touch-action: none; cursor: grab;
}
.rem-sheet-grip:active { cursor: grabbing; }
.rem-overlay.open .rem-sheet { transform: translateY(0); }
@media (min-width: 560px) {
  /* Centered-modal presentation at this width isn't anchored to the
     bottom edge, so a "drag down to dismiss" affordance doesn't apply --
     both the visual bar and its real hit-target (sheet-drag.js's
     .rem-sheet-grip) hide here. */
  .rem-sheet { border-radius: 26px; padding-top: 22px; transform: translateY(20px) scale(0.97); opacity: 0;
               transition: transform var(--dur-calm) var(--ease-lux), opacity var(--dur-calm) var(--ease-lux); }
  .rem-sheet::before, .rem-sheet-grip { display: none; }
  .rem-overlay.open .rem-sheet { transform: none; opacity: 1; }
}
.rem-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rem-title { font-family: var(--headline); font-weight: var(--weight-light); font-size: var(--text-h2); letter-spacing: var(--track-h1); }
.rem-for { font-size: var(--text-caption); color: var(--muted); margin-top: 3px; }
.rem-close { border: none; background: none; color: var(--muted); cursor: pointer; padding: 4px; }
.rem-close:hover { opacity: 0.72; }
.rem-close:active { opacity: 0.5; transform: scale(0.92); transition: transform var(--dur-instant) var(--ease), opacity var(--dur-instant) var(--ease); }
.rem-close svg { width: 19px; height: 19px; }
.rem-label {
  font-size: var(--text-micro); font-weight: 500; text-transform: uppercase;
  letter-spacing: var(--track-eyebrow); color: var(--muted); margin: 24px 0 10px;
}
/* Doses per day drives how many time pickers appear — the count and the
   schedule can't disagree because the count IS the number of times. */
.rem-count { display: flex; gap: 8px; }
.rem-count button {
  flex: 1; border: none; border-radius: 14px; padding: 13px 0; cursor: pointer;
  background: var(--warm-white); color: var(--muted);
  font-family: var(--sans); font-size: var(--text-body); font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: background var(--dur-quick) var(--ease), color var(--dur-quick) var(--ease);
}
.rem-count button:hover { background: var(--stone-lift); color: var(--ink); }
.rem-count button.on { background: var(--gold); color: var(--warm-white); }
.rem-times { display: flex; flex-direction: column; gap: 10px; }
.rem-time { display: flex; align-items: center; gap: 12px; background: var(--warm-white); border-radius: 14px; padding: 12px 14px; }
.rem-time span { flex: 1; font-size: var(--text-caption); color: var(--muted); }
.rem-time input {
  border: none; background: none; color: var(--ink); font-family: var(--sans);
  font-size: var(--text-h2); font-weight: 500; font-variant-numeric: tabular-nums;
  padding: 0; outline: none;
}
.rem-actions { display: flex; gap: 10px; margin-top: 26px; }
.rem-note { font-size: var(--text-micro); color: var(--muted); margin-top: 14px; line-height: 1.5; text-align: center; }
.rem-link {
  display: block; border: none; background: none; cursor: pointer;
  font-family: var(--sans); font-size: var(--text-caption); font-weight: 500;
  color: var(--gold); margin: 12px 0 0; padding: 6px 0; text-align: left;
}
.rem-link:active { opacity: 0.6; }

/* ── Score-impact popup (index.html's showScoreImpactPopup) ───────────
   A real, per-ingredient breakdown of what a just-added product did to
   the Stack Score. Positive movement gets the one accent (gold); a flat
   or negative delta stays plain ink weight rather than reaching for red
   -- "The No Red Rule" (DESIGN.md): status reads through ink weight
   here, never alarm color, same as every other status surface in the
   app. */
.rem-title.impact-up { color: var(--gold); }
.rem-title.impact-down, .rem-title.impact-flat { color: var(--ink); }
.impact-rows { display: flex; flex-direction: column; gap: 10px; }
.impact-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  background: var(--warm-white); border-radius: 14px; padding: 12px 14px;
}
.impact-row b { font-family: var(--sans); font-size: var(--text-caption); font-weight: 500; color: var(--ink); }
.impact-row-detail { font-size: var(--text-micro); color: var(--muted); margin-top: 3px; line-height: 1.45; }
.impact-row-delta {
  flex-shrink: 0; font-variant-numeric: tabular-nums; font-size: var(--text-caption); font-weight: 600;
  color: var(--gold);
}

/* Streak sheet hero -- the loop motif (streak-widget.js's loopMotifSvg)
   sits behind the number as a quiet flourish, not a data visualization
   with its own meaning; z-index keeps the actual number/label readable
   on top of it regardless of how the loops happen to fall. */
.streak-hero { position: relative; display: flex; align-items: center; justify-content: center; height: 220px; margin: 0 auto; }
.streak-hero-motif { position: absolute; inset: 0; width: 100%; height: 100%; }
.streak-hero-inner { position: relative; z-index: 1; text-align: center; }
.streak-big-num { font-family: var(--headline); font-weight: var(--weight-display); font-size: 44px; line-height: 1; letter-spacing: var(--track-h1); }
.streak-hero-label { font-size: var(--text-caption); color: var(--muted); margin-top: 4px; }

@media (prefers-reduced-motion: reduce) {
  .rem-overlay, .rem-sheet, .rem-count button, .navbar button { transition: none; }
}
