/* ---------------------------------------------------------------
   The white-background skin.

   Pete, 2026-11-04: "make it an option for client users to make the
   background white instead of dark."

   Loaded after styles.css and scoped to :root[data-theme="light"], so
   it only ever applies once theme.js has put that attribute on <html>.
   Nothing in styles.css is edited for it, which is the point: dark mode
   is byte-for-byte what it was, and a client who never opens the toggle
   cannot see a difference.

   WHY THIS BEATS THE BRAND PALETTES
   brand.js writes a <style id="brand-palette"> after this sheet, with
   `:root { --bg: ...; }`. That is specificity (0,1,0). `:root[data-theme]`
   is (0,2,0), so the neutral tokens below win over every brand's dark
   ones regardless of source order. What a brand sets that is NOT in this
   file -- its gold, its primary, its on-accent ink -- is left alone on
   purpose: the white skin keeps the brand's own colours.

   TWO KINDS OF RULE
   1. Tokens (this block). The app is written against var(--surface-*),
      var(--text-*) and friends, so redefining them repaints most of it.
   2. Overrides for what the tokens cannot reach: literals written as
      #hex / rgba() / "white" in styles.css, light-on-dark text colours,
      white-alpha hover and border states that vanish on white, and
      shadows tuned for a dark ground. Those follow below, grouped by the
      section of styles.css they correct, each saying what it replaces.

   LEFT DARK ON PURPOSE
   Things that are a "scene" rather than a surface stay dark in both
   skins: the brain map, camera and video frames, modal scrims, and text
   laid over a photograph with its own dark gradient.
---------------------------------------------------------------- */

:root[data-theme="light"] {
  color-scheme: light;

  /* Surfaces. White page; cards are white too and are told apart by a
     real border and a soft shadow rather than by being lighter. The
     greys are warm to sit with the gold, as the dark ones do. */
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --surface-1: #ffffff;
  --surface-2: #f6f5f1;
  --surface-3: #edebe5;
  --surface-4: #e0ddd4;

  --line: rgba(26, 26, 24, .12);
  --line-strong: rgba(26, 26, 24, .24);
  /* The 1px highlight along the top of a raised surface. On white it
     has nothing to catch, so it goes. */
  --edge-light: rgba(255, 255, 255, 0);

  /* Tokens the stylesheet reads WITH a fallback but never defines, so
     in dark they resolve to their white-alpha fallback. Defined here so
     the light skin gets a dark-alpha value instead of an invisible one. */
  --hairline: rgba(26, 26, 24, .12);
  --surface-sunken: rgba(26, 26, 24, .05);
  --surface-raised: rgba(26, 26, 24, .09);

  --text-primary: #1a1a18;
  --text-secondary: #46453f;
  --text-muted: #5d5c53;
  --text-faint: #6f6e64;   /* 5.1:1 on white, 4.7 on --surface-2: small captions and placeholders read */

  --series-1: #2f6fd0;
  --series-2: #c24d1d;
  --series-3: #12875f;
  --good: #10805a;         /* 4.9:1 on white, 4.5 on --surface-2: green text on a card top still passes */
  --warn: #926000;         /* 5.4:1 on white, 4.9 on --surface-2 */
  --bad: #c0352b;

  /* Gold used AS TEXT or a thin line. --gold itself stays the brand's
     (it is also a button background, with dark ink on it), so text that
     needs to be readable on white takes this instead: the brand's own
     gold, pulled toward black. Derived, so every brand gets its own. */
  --gold-ink: color-mix(in srgb, var(--gold) 48%, #1a1400);

  --shadow-card: 0 1px 2px rgba(26, 26, 24, .06), 0 8px 24px -16px rgba(26, 26, 24, .22);
  --shadow-lift: 0 2px 6px rgba(26, 26, 24, .08), 0 18px 40px -20px rgba(26, 26, 24, .28);
  --shadow-pop:  0 4px 12px rgba(26, 26, 24, .10), 0 32px 64px -26px rgba(26, 26, 24, .34);
}

/* styles.css paints two faint colour washes behind the page "so large
   dark areas are not dead flat". On white they read as a smudge. */
:root[data-theme="light"] body {
  background: var(--bg);
}

/* ================================================================
   styles.css 81-520  (chunk-1)
   ================================================================ */
/* ---------------------------------------------------------------
   styles-light.css fragment 1 of 8: styles.css lines 81-520
   (body reset, buttons and fields, auth, shell, layout pieces, KPI,
   top values, module rows, pills, tools, lesson carousel, upsell).

   Grounds used for every ratio below: page and cards #ffffff,
   --surface-2 #f6f5f1, --surface-3 #edebe5. Semi-transparent tints are
   composited over those first. Small text needs 4.5:1, UI outlines 3:1.

   gold-ink for each brand gold in brand.js (mix 48% gold + 52% #1a1400)
   on #ffffff: #d4af37 -> #735e1a 6.28:1, #be9e44 -> #695621 7.11:1,
   #0e7fd4 -> #144766 9.89:1, #0077c0 -> #0e445c 10.50:1. Lowest is 6.28:1.

   NOT overridden on purpose (see notes returned with this fragment):
   .topbar background (line 310 is superseded by the token rule at line
   1050), .btn-primary (brand fill), .mode-toggle-btn.is-active, .value-rank,
   .mod-check.is-done (brand fills with dark ink), .area-icon (black plate).

   ALSO LEFT DARK ON PURPOSE: .tool-icon-brain svg and
   .section-carousel-brain-mini .brain-svg. brain.js brainSvg() paints its
   own #05070c plate and blue anatomy inside the SVG, so it is a dark scene
   on a white card by design (same as the main brain diagram).

   theme.js keeps the sign-in screen dark (rule 1 there), so the
   .btn.btn-google, .auth-divider and .auth-code-or overrides below only
   matter if the door ever follows the skin. They are harmless otherwise.
   .auth-note is different: it is used in cards across the signed-in app.

   HANDED TO OTHER CHUNKS: .linkbtn.is-danger (styles.css line 2947
   re-declares color:#e66767, 3.23:1 on white) and the white-alpha
   .btn:hover border at line 959.
---------------------------------------------------------------- */

/* ---- auth ---- */
:root[data-theme="light"] .auth-note.is-error { color: var(--bad); } /* was #e66767 (3.23:1 on #fff). --bad #c0352b is 5.55:1 on the white auth card */
:root[data-theme="light"] .auth-note.is-ok { color: color-mix(in srgb, var(--good) 80%, #000); } /* was var(--good) #12875f, which is 4.51:1 on #fff but only 4.13:1 on --surface-2 and 3.78:1 on --surface-3, and .auth-note is used inside .card all over the app (top of a card is --surface-2). 80% --good + black = #0e6c4c: 6.43:1 on #fff, 5.89:1 on --surface-2, 5.39:1 on --surface-3 */
:root[data-theme="light"] .auth-divider,
:root[data-theme="light"] .auth-code-or { color: var(--text-muted); } /* was --text-faint #8a897f (3.52:1) on the "or" label at .8rem. --text-muted #66655b is 5.87:1 on #fff */
:root[data-theme="light"] .btn.btn-google { border-color: var(--line-strong); } /* was #fff: a white button with a white border on a white card has no edge. Label #1f1f1f on #fff stays 16.48:1. Also beats the white-alpha .btn:hover border at line 959 */

/* ---- shell: brand menu, sidebar, nav ---- */
:root[data-theme="light"] .brand-menu { box-shadow: var(--shadow-pop); } /* was 0 12px 32px rgba(0,0,0,.35), a dark-ground shadow */
:root[data-theme="light"] .nav-item.is-active::before { background: var(--gold-ink); } /* was gold-lit > gold > gold-deep gradient; the pale gold-lit end is 1.28:1 on #fff. gold-ink is 6.28:1 or better for every brand */
:root[data-theme="light"] .demo-toggle.is-active { border-color: var(--gold-ink); color: var(--gold-ink); } /* was var(--gold) outline (2.10:1) and var(--gold-lit) text (1.28:1). gold-ink text is 6.28:1 on #fff */

/* ---- section headings ---- */
:root[data-theme="light"] .section-head h2::before { background: var(--gold-ink); } /* same gold-lit > gold > gold-deep gradient as the nav bar; thin 3px line on white, so gold-ink (6.28:1) */

/* ---- pills and notes (status colours made for a dark ground) ---- */
:root[data-theme="light"] .pill.free { color: #1d4f9c; } /* was #7db2ef (1.85:1). 6.61:1 on rgba(57,135,229,.16) over #fff, 5.64:1 over --surface-3; the tint itself is left as is */
:root[data-theme="light"] .pill.locked { color: #7a4d00; } /* was #e0a93c (1.79:1). 6.15:1 on rgba(201,133,0,.16) over #fff, 5.29:1 over --surface-3 */
:root[data-theme="light"] .pill.draft { color: #5436c9; } /* was #a894ff (2.00:1). 6.08:1 on rgba(124,92,255,.18) over #fff, 5.19:1 over --surface-3 */
:root[data-theme="light"] .draft-note { color: #5436c9; } /* was #a894ff (2.16:1) on rgba(124,92,255,.12). 6.55:1 on the tint over #fff, 5.58:1 over --surface-3 */

/* ---- tools grid (Health tools) ---- */
:root[data-theme="light"] .tool-icon { color: var(--gold-ink); } /* was var(--gold) as an icon stroke (2.10:1 on #fff for the default gold). gold-ink is 6.28:1 */
:root[data-theme="light"] .tool-label { color: var(--gold-ink); } /* was var(--gold) as small uppercase text (2.10:1). gold-ink is 6.28:1 on #fff and 5.75:1 on --surface-2 */

/* ---- lesson section carousel ---- */
:root[data-theme="light"] .section-carousel-dot.is-active { background: var(--gold-ink); border-color: var(--gold-ink); } /* was var(--gold) (2.10:1 on #fff) for the current-slide dot. gold-ink is 6.28:1 */

/* ---- Marketing Hub board drag target ---- */
:root[data-theme="light"] .marketing-col[data-status-col].is-drop-target > .card { outline-color: var(--gold-ink); } /* was var(--gold, var(--good)) dashed outline (2.10:1 on #fff). gold-ink is 6.28:1, over the 3:1 needed for a UI outline */

/* ================================================================
   styles.css 521-1000  (chunk-2)
   ================================================================ */
/* ==================================================================
   WHITE SKIN, section 2 of 8: styles.css lines 521 to 1002
   (first complete rule is .wheel-question at 523; the rule that
   straddles line 1000 is `.field input:focus, ...` which ends at 1002).

   Contrast figures are WCAG 2 ratios computed in node. Grounds used:
   page and cards #ffffff, --surface-2 #f6f5f1, --surface-3 #edebe5,
   --surface-4 #e0ddd4. --gold-ink is color-mix(gold 48%, #1a1400), so
   it is worked out per brand: #735e1a for the origin gold #d4af37
   (6.28:1 on white), #695621 for #be9e44 (7.11:1), #144766 for the
   blue brand #0e7fd4 (9.89:1). "Gold hairline" below means
   color-mix(in srgb, var(--gold-ink) 70%, transparent): 3.23:1 on
   white for the origin gold, 3.47:1 plouton, 4.31:1 blue.

   Selectors re-declared later in styles.css, and which declaration this
   file beats:
     .pill.warn      802 and 1071 (1071 is the last)
     .slot.is-active 879 and 1201 (1201 is the last, it replaces all three
                     properties of 879)
     .cal-dow        730 and 2430 (2430 adds opacity .55)
     .cal-cell       734 and 2436 (2436 repaints the background with a
                     white alpha; that one belongs to the section that
                     owns 2425-2455, not to this file)
   Every override here is :root[data-theme="light"] + the original
   selector, which adds (0,2,0) and so beats each of those.

   Left dark on purpose, no override written: .scrim (567),
   .video-embed (585), .camera-overlay (850), .camera-frame video (858).

   INDEPENDENT REVIEW, what changed from the first draft:
   - Removed the four .wheel-svg attribute rules. wellth-wheel.js now
     writes inline style="...var(--token, fallback)", which out-ranks any
     rule here; the tokens are defined in styles-light.css and js-tokens.css.
   - Removed the .draft-card border override. In dark that gold border is
     dead (the later .card rule wins), so the override would have added
     something the dark skin does not have.
   - Added .wheel-track i (gold-ink progress line), .tier-features li::before
     (--good on --surface-2 was 4.13:1), and brand-following glows for
     .btn-primary and .btn-gold (were hardcoded blue and origin gold).
   - Replaced three hardcoded literals (#2a64bf, #a82a21, rgba(47,111,208))
     with color-mix() on --series-1 and --bad so they follow the tokens.
   - Every override that remains was checked in headless Chrome against the
     real cascade (hover rules with :hover swapped for a class): it computes
     to the intended value in the white skin for the origin, plouton and
     blue brands, and the rule it replaces is live in the dark skin, so the
     white skin does not add an effect that dark does not have.
   ================================================================== */


/* ---- WELLth Wheel: gold used as text and as a thin outline ---- */
:root[data-theme="light"] .wheel-track i { background: var(--gold-ink); } /* was var(--gold) as the 3px progress line. Gold on the --surface-3 track is 1.76:1 for the origin gold (2.16 plouton), a thin line with no ink on it, so it takes gold-ink like .rest-bar i in section 3: 5.24:1 on the track, 6.28:1 on white (plouton 5.96 / 7.11, blue 8.26 / 9.89) */
:root[data-theme="light"] .wheel-qmeta b { color: var(--gold-ink); } /* was var(--gold) as .72rem bold text; gold-ink 6.28:1 on white */
:root[data-theme="light"] .wheel-opt:hover { border-color: var(--gold-ink); } /* was var(--gold) outline; 6.28:1 on white */
:root[data-theme="light"] .wheel-opt.is-on { border-color: var(--gold-ink); } /* was var(--gold) outline; the rgba(212,175,106,.10) fill is left, it reads fine on white */
:root[data-theme="light"] .wheel-back:hover { color: var(--gold-ink); } /* was var(--gold) text on hover; 6.28:1 on white */


/* ---- WELLth Wheel: the chart itself ----
   No rules here on purpose. wellth-wheel.js wheelSvg() now writes its
   colours as inline style="stroke:var(--hairline, ...)" / var(--ink-gold, ...) /
   var(--chart-halo, ...), and an inline style out-ranks any stylesheet rule,
   so CSS from this file could not change them anyway. The light values come
   from the tokens instead: --hairline is defined in styles-light.css, and
   --ink-gold (-> --gold-ink) and --chart-halo (-> white) are defined in
   js-tokens.css. Four attribute-selector rules that used to sit here
   (.wheel-svg polygon[fill="none"], .wheel-svg line, polygon[stroke="#d4af6a"],
   circle[fill="#d4af6a"]) were dead after that change and were removed in
   review: the first two lose to the inline style, the last two no longer
   match because the colour moved from an attribute into the style. */


/* ---- membership tiers ---- */
:root[data-theme="light"] .tier-card.is-current { border-color: var(--gold-ink); } /* was var(--gold) outline on a white card; 6.28:1. The 1px var(--gold-soft) ring beside it is left. */
:root[data-theme="light"] .tier-features li::before { color: color-mix(in srgb, var(--good) 85%, #000); } /* was var(--good) #12875f, 4.51:1 on white but 4.13 on --surface-2 and 3.78 on --surface-3, and a .card runs from --surface-2 at the top to white at 52%. 85% --good + black is #0f7351: 5.87:1 on white, 5.38 on --surface-2, 4.92 on --surface-3. Same token treatment as .auth-note.is-ok in section 1 */


/* ---- in-lesson index ---- */
:root[data-theme="light"] .lesson-index-item:hover { border-color: color-mix(in srgb, var(--gold-ink) 70%, transparent); } /* was rgba(212,175,106,.5) literal, 1.41:1 on white; gold hairline 3.23:1 */
:root[data-theme="light"] .lesson-index-item.is-current { border-color: var(--gold-ink); } /* was var(--gold) outline; 6.28:1. The gold-wash fill is left. */


/* ---- ask your assistant ---- */
:root[data-theme="light"] .assistant-answer { border-color: color-mix(in srgb, var(--gold-ink) 70%, transparent); } /* was var(--gold-soft) (gold at .30), a 1.2:1 hairline on white that is the only thing marking this callout; gold hairline 3.07:1 on its --surface-2 fill */
:root[data-theme="light"] #assistant-form .vx-mic { --vx-fg: var(--gold-ink); } /* was var(--gold-lit) #f6e39a icon on the mic's rgba(127,127,127,.16) disc, 1.07:1; gold-ink 5.24:1 on that disc */


/* ---- comments & reactions ---- */
:root[data-theme="light"] .reaction.is-mine { border-color: var(--gold-ink); } /* was var(--gold) outline; 6.28:1. The var(--gold-soft) fill is left. */
:root[data-theme="light"] .reaction.is-mine .reaction-count { color: var(--text-secondary); } /* was var(--text-muted) .74rem on the gold-soft fill: 4.75:1 origin, 4.54 plouton, 3.96 blue brand (fails). text-secondary is 7.78 / 7.44 / 6.49 */


/* ---- calendar ---- */
:root[data-theme="light"] .cal-cell.is-today .cal-daynum { color: color-mix(in srgb, var(--series-1) 88%, #000); } /* was var(--series-1) #2f6fd0, 4.47:1 on a --surface-2 cell (fails 4.5). 88% series-1 + black is #2962b7: 5.48:1 on --surface-2, 5.97 on white. (The cell is transparent in the final cascade, so white is the real ground, where plain series-1 is already 4.88.) */
:root[data-theme="light"] .cal-dow { opacity: 1; } /* 2430 sets opacity:.55 on top of --text-muted, which on white is 2.32:1. At full opacity --text-muted is 5.87:1 */

@media (max-width: 860px) {
  :root[data-theme="light"] .cal-event { background: var(--text-faint); } /* below 860px the event is a 6px bar with no text; its --surface-3 fill was 1.09:1 on a --surface-2 cell and 1.19:1 on white. --text-faint is 3.23:1 / 3.52:1, enough for a graphic mark */
}


/* ---- install-as-app banner ---- */
:root[data-theme="light"] .install-banner { border-color: color-mix(in srgb, var(--gold-ink) 70%, transparent); } /* was var(--gold-soft) hairline on a white card over a white page, 1.2:1; gold hairline 3.23:1 */


/* ---- plate tracker ---- */
:root[data-theme="light"] .pill.warn { color: #7a5000; } /* was #e6b23f (1071; 802 had #e0a93c), 1.68:1 on its rgba(213,147,0,.16) tint. #7a5000 is 6.11:1 over white, 5.66 over --surface-2, 5.23 over --surface-3. The tint is left. */
:root[data-theme="light"] .plate-coach { border-left-color: var(--gold-ink); } /* was var(--gold) 2px rule; 6.28:1 on white. The .08 gold gradient wash is left. */
/* .draft-total.is-off { color: var(--warn) } (874) has no override on purpose, for the same reason as .draft-card below: the element is <p class="sub draft-total is-off"> inside a .card, and `.card p.sub { color: var(--text-secondary) }` (1030, specificity 0,2,1) beats it. Checked in a real browser: in the dark skin the warning colour never shows and the line is text-secondary. In the white skin it is text-secondary too, #46453f, 8.07:1 on --surface-3 and more on lighter grounds. */
/* .draft-card { border-color: var(--gold-soft) } (869) has no override on purpose. The element is class="card draft-card" (health.js) and the v2 `.card { border-color: var(--line) }` at 1022 has the same specificity and comes later, so in the dark skin that gold border never shows. An override here would have put a gold outline on the card in the white skin that dark does not have. It takes the --line border from .card like every other card. */


/* ---- buttons (design system v2 layer) ---- */
:root[data-theme="light"] .btn:hover { border-color: rgba(26, 26, 24, .32); } /* was rgba(255,255,255,.2), which on white erases the border the button had at rest (the rest border is --line-strong, .20). .32 is a step up from that, 2.04:1 on white */
:root[data-theme="light"] .btn-primary:hover,
:root[data-theme="light"] .btn-gold:hover { border-color: transparent; } /* these two are filled and have no rest border; keep them that way now that .btn:hover above is a dark line. Same specificity, so source order puts this one last. */
:root[data-theme="light"] .btn-danger:hover { color: color-mix(in srgb, var(--bad) 86%, #000); } /* hover swaps the red tint for the --surface-4 to --surface-3 gradient, and --bad #c0352b is then 4.08:1 at the top of it (fails). 86% --bad + black is #a52e25: 5.13:1 on --surface-4, 5.85 on --surface-3. At rest --bad on its tint is 5.03:1 over white and is left. */


:root[data-theme="light"] .btn-primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 4px 14px -6px color-mix(in srgb, var(--primary) 55%, transparent); } /* was the same shadow with a hardcoded blue glow rgba(74,143,240,.7) whatever the brand: on white that reads as a blue haze under a burgundy (plouton), green (bewellthy) or gold (faf) button. Inset highlight restated unchanged (a box-shadow is one property); the glow now follows --primary and is eased from .7 to .55 because a coloured shadow shows more on white than on near-black. The fill itself is left. */
:root[data-theme="light"] .btn-gold { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 4px 16px -6px color-mix(in srgb, var(--gold) 50%, transparent); } /* was a hardcoded origin-gold glow rgba(212,175,55,.6), yellow under the blue brands' gold-slot button. Now follows --gold at 50%. Inset highlight restated unchanged; the fill is left. */


/* ---- fields ---- */
:root[data-theme="light"] .field input,
:root[data-theme="light"] .field select,
:root[data-theme="light"] .field textarea { box-shadow: inset 0 1px 2px rgba(26, 26, 24, .06); } /* was inset 0 1px 2px rgba(0,0,0,.25), a recessed-in-the-dark shadow that reads as a smudge on a pale field */
:root[data-theme="light"] .field input::placeholder,
:root[data-theme="light"] .field textarea::placeholder { color: var(--text-muted); } /* was var(--text-faint) #8a897f, 3.23:1 on the --surface-2 field and 2.95:1 once focus moves it to --surface-3 (fails). --text-muted is 5.38:1 and 4.92:1 */
:root[data-theme="light"] .field input:focus,
:root[data-theme="light"] .field select:focus,
:root[data-theme="light"] .field textarea:focus { box-shadow: inset 0 1px 2px rgba(26, 26, 24, .06), 0 0 0 3px color-mix(in srgb, var(--series-1) 18%, transparent); } /* was the same two-part shadow with a .25 black inset and the dark-mode blue (74,143,240) ring; now an 18% ring of the light --series-1, which is also the focus border colour. Border and fill already come from tokens. */


/* ---- scrollbars ---- */
:root[data-theme="light"] * { scrollbar-color: rgba(26, 26, 24, .30) transparent; } /* was var(--surface-3) thumb, #edebe5 on white is 1.2:1 so the thumb is not there. .30 is 1.94:1 */
:root[data-theme="light"] *::-webkit-scrollbar-thumb { background: rgba(26, 26, 24, .30); } /* same, WebKit */
:root[data-theme="light"] *::-webkit-scrollbar-thumb:hover { background: rgba(26, 26, 24, .48); } /* was var(--surface-4); 3.15:1 on white */


/* ---- chips (the LAST .slot.is-active is 1201, not 879) ---- */
:root[data-theme="light"] .slot.is-active { color: var(--gold-ink); border-color: color-mix(in srgb, var(--gold-ink) 70%, transparent); } /* was color var(--gold-lit) #f6e39a, 1.12:1 on its own gold tint, and a var(--gold-soft) border. gold-ink on the darker (.20) end of the tint is 5.46:1 origin, 6.00 plouton, 7.65 blue; hairline border 3.23:1. The gold gradient fill is left. Placed after .btn:hover above so that, as in styles.css, the active chip keeps its border on hover. */

/* ================================================================
   styles.css 1001-1480  (chunk-3)
   ================================================================ */
/* ---------------------------------------------------------------
   White-skin fragment, section 3 of 8
   Source: styles.css lines 1001 to 1480.

   Range as read: first complete rule at or after 1001 is `.field textarea`
   (1003); the last rule is the finance dashboard block, which ends at
   1473 (`@media (max-width: 620px)`). Lines 1475-1480 are only the comment
   that introduces the brain section, whose first rule is at 1481 and
   belongs to section 4. The `.field input:focus` rule that straddles 1001
   (lines 999-1002) belongs to section 2.

   Everything not listed here already reads tokens (--surface-*, --line,
   --text-*, --edge-light, --shadow-*, --good, --bad, --series-*) and is
   repainted by the base block in styles-light.css: .field textarea,
   .field-pw*, .card, .kpi, .topbar, .sidebar, .nav-item, .seg, .search,
   .row-*, .skeleton, .toast, .ex-*, .set-grid, .set-row, .set-add,
   .rest-timer, .plan-*, .meal, .finance-*, the .sheet panel itself.

   Reviewed independently (second pass). Contrast re-computed for every brand
   gold in brand.js (#d4af37 origin, #be9e44 plouton, #0e7fd4, #0077c0). Changes
   in review: .slot.is-active ring aligned with chunk-2 (hairline, not full
   gold-ink); .pill.gold tint now follows --gold instead of the hardcoded origin
   gold; eight --text-faint rules lifted to --text-muted (see that section).
   Cascade note: .slot.is-active and .pill.warn are also emitted by chunk-2.
   The values now agree (same ring, same gold-ink; .pill.warn differs by 2 in
   the last hex digit and both pass), so order barely matters, but keep this
   fragment AFTER chunk-2 so the declarations that are last in styles.css
   (lines 1201 and 1071) also win here, as they do in dark.

   Contrast: WCAG 2 relative luminance, semi-transparent tints composited
   over their real ground first. Grounds used: page/cards #ffffff,
   --surface-2 #f6f5f1, --surface-3 #edebe5, --surface-4 #e0ddd4.
   --gold-ink = color-mix(gold 48%, #1a1400); worked out for the origin gold
   #d4af37 (-> #735e1a) and the other brand golds, #be9e44 (-> #695621) and
   #0e7fd4 (-> #144766). All three clear every threshold quoted below; the
   ratio in each comment is the origin gold, the weakest of the three.
---------------------------------------------------------------- */


/* ---- status pills (line 1070-1072) ---- */

/* .pill.warn is declared twice (line 802 and line 1071); 1071 is the last,
   so this is written against it. Only colour is emitted: both tints are
   the same amber at .16 and both are fine on white. */
:root[data-theme="light"] .pill.good { color: #0a6b4a; } /* was #4fd3a5 (mint for dark). 5.57:1 on rgba(31,174,125,.16) over white, 5.17:1 over --surface-2 */
:root[data-theme="light"] .pill.warn { color: #7a5200; } /* was #e6b23f (light amber for dark). 6.00:1 on rgba(213,147,0,.16) over white, 5.54:1 over --surface-2 */
:root[data-theme="light"] .pill.gold { color: var(--gold-ink); background: color-mix(in srgb, var(--gold) 16%, transparent); } /* was color var(--gold-lit), a pale gold made for dark, on a background of rgba(212,175,55,.16), the ORIGIN gold hardcoded, so a blue brand got navy ink on a yellow tint. The tint now follows --gold at the same 16%. Ink on its own tint: origin 5.59 over white, 5.18 over --surface-2, 4.79 over --surface-3; the other brand golds are higher (plouton 5.32 worst, blue 6.85 worst) */


/* ---- bottom tab bar, mobile only (lines 1084-1123) ---- */

@media (max-width: 860px) {
  :root[data-theme="light"] .tab-item.is-active { color: var(--gold-ink); } /* was var(--gold) as text on the bar, 10px caps. 6.24:1 on white, 5.72 on --surface-2 (gold itself is 2.10:1); plouton 7.10, blue 9.85 */
  :root[data-theme="light"] .tab-item.is-active .tab-ico { filter: none; } /* was drop-shadow(0 0 10px rgba(212,175,55,.45)); a glow is a dark-ground idiom and only smudges on white, the gold-ink stroke already carries the state */
  :root[data-theme="light"] .tab-fab { box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--gold-deep) 55%, transparent), inset 0 1px 0 rgba(255,255,255,.45); } /* was 0 6px 20px -6px rgba(212,175,55,.75) glow; now a softer brand-tinted drop shadow. The inset highlight sits on the gold face, so it stays. Gold fill and its --on-accent ink are untouched */
}


/* ---- sheet / dialog (lines 1134-1162) ---- */

/* .sheet-scrim is rgba(0,0,0,.6) and stays: see leftDarkOnPurpose. */
:root[data-theme="light"] .sheet-action-ico { color: var(--gold-ink); } /* was var(--gold) icon stroke on --surface-3. 5.24:1 on #edebe5 (gold itself is 1.76:1); plouton 5.96, blue 8.26 */


/* ---- chips (lines 1201-1204) ---- */

/* .slot.is-active is declared twice (line 879 blue, line 1201 gold); 1201
   is the last. The three properties it sets are all restated here, so this
   wins whatever section 2 emitted for the line-879 version regardless of
   where the fragments are concatenated. The gold tint is derived from
   var(--gold) so it follows the brand. */
:root[data-theme="light"] .slot.is-active {
  color: var(--gold-ink); /* was var(--gold-lit). On the 20% end of its own gold tint: origin 5.43 over white, 5.05 over --surface-2, 4.69 over --surface-3; plouton 5.17 and blue 6.52 are the worst cases for those brands */
  border-color: color-mix(in srgb, var(--gold-ink) 70%, transparent); /* was var(--gold-soft) (30% gold, 1.24:1 on white). Same value chunk-2 emits for this selector, so the two fragments agree whichever one the cascade picks: a hairline ring that is 3.23:1 on white for the origin gold, 3.47 plouton, 4.31 blue. A full-strength gold-ink ring (6.24:1) read as a heavy brown outline and contradicted chunk-2 */
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 20%, transparent), color-mix(in srgb, var(--gold) 8%, transparent)); /* same tint as the original rgba(212,175,55,.2 -> .08), now following the brand gold */
}


/* ---- training: rest timer and volume trend (lines 1340-1342, 1366-1371) ---- */

/* The gold-to-gold-lit fill vanishes against the light --surface-4 track
   (gold 1.55:1, gold-lit 1.06:1). Solid gold-ink is 4.60:1 against the track
   for the origin gold (plouton 5.23, blue 7.25). */
:root[data-theme="light"] .rest-bar i { background: var(--gold-ink); } /* was linear-gradient(90deg, var(--gold), var(--gold-lit)) */
/* The rule above ties on specificity (0,3,1) with the finished state
   (.rest-timer.is-done .rest-bar i) and comes later, so it would turn the
   done bar gold. The green is restated one level higher to stop that. */
:root[data-theme="light"] .rest-timer.is-done .rest-bar i { background: var(--good); } /* unchanged value, re-asserted so the light gold fill above cannot override it */

/* The newest bar: gold-lit at the top is 1.28:1 on white, so the bar
   disappears. Top is now gold pulled 40% toward gold-ink; the fade into
   --gold-soft at the bottom is kept, as the blue bars do with series-1. */
:root[data-theme="light"] .trend-col:last-child .trend-bar { background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 60%, var(--gold-ink)), var(--gold-soft)); } /* was linear-gradient(180deg, var(--gold-lit), var(--gold-soft)). Top is #ad8f2c, 3.12:1 on white (3.74:1 for #be9e44, 5.84:1 for #0e7fd4); a graphic, so 3:1 applies */


/* ---- faint text that carries information (added in review) ----
   These rules use var(--text-faint) correctly, but the light value of that
   token (#8a897f) is 3.52:1 on white and 3.23:1 on --surface-2, under 4.5 for
   the small sizes below. The proper fix is one line in the base block of
   styles-light.css; until that lands, each rule takes --text-muted (5.87:1
   white, 5.38 --surface-2, 4.92 --surface-3), as chunk-1 and chunk-2 do for
   their faint text. If the base token is darkened these become redundant but
   harmless. .set-check (an 18px icon, 3.23:1) and .tax-swatch are graphics
   and need only 3:1, so they are left on the token. */
:root[data-theme="light"] .set-row.is-head { color: var(--text-muted); } /* was --text-faint, 10px caps column labels, 3.52:1 on white */
:root[data-theme="light"] .set-prev { color: var(--text-muted); } /* was --text-faint, last session's numbers shown in the row (the decision aid the section comment describes), 3.52:1 */
:root[data-theme="light"] .set-row input::placeholder { color: var(--text-muted); } /* was --text-faint. The placeholder IS last session's weight and reps (workouts.js 782-784), 3.23:1 on the --surface-2 input and 2.95:1 once focus moves it to --surface-3. Same fix chunk-2 applies to .field textarea::placeholder */
:root[data-theme="light"] .trend-label { color: var(--text-muted); } /* was --text-faint, 10px week labels under the volume bars, 3.52:1 */
:root[data-theme="light"] .plan-list em { color: var(--text-muted); } /* was --text-faint, 11px detail line on a --surface-2 plan card, 3.23:1 */
:root[data-theme="light"] .finance-bucket-count { color: var(--text-muted); } /* was --text-faint, .76rem account count on a --surface-2 bucket, 3.23:1 */
:root[data-theme="light"] .finance-note { color: var(--text-muted); } /* was --text-faint, .78rem disclaimer line, 3.52:1 */
:root[data-theme="light"] .field-hint { color: var(--text-muted); } /* was --text-faint, .78rem form hint, 3.52:1 on white and 3.23:1 on --surface-2 */


/* ---- finance dashboard (lines 1445-1446) ---- */

/* --good (#12875f) is 4.51:1 on white but 4.13:1 on the top of the card
   gradient (--surface-2), where this line sits at .85rem. Darkened 10%
   toward black. Fixes only this rule; the token is unchanged. */
:root[data-theme="light"] .finance-delta.is-up { color: color-mix(in srgb, var(--good) 90%, #000); } /* was var(--good). #107a56 is 4.92:1 on #f6f5f1 (5.36 on white) */

/* ================================================================
   styles.css 1481-1960  (chunk-4)
   ================================================================ */
/* ---------------------------------------------------------------
   Light skin, chunk 4 of 8: styles.css lines 1481 to 1961
   (the Interactive Brain, Service Desk, WELLth Vault, notification bell).

   Contrast figures are WCAG 2 ratios computed in node (c4-contrast.js).
   Grounds used: page and cards #ffffff, card gradient top #f6f5f1,
   .pill #edebe5 (--surface-3). Brand golds checked: #d4af37 (default),
   #be9e44, #0e7fd4, #0077c0; --gold-ink is 6.2:1 or better on white for
   all four (6.28, 7.11, 9.89, 10.50).

   Specificity note: every rule below is :root[data-theme="light"] + the
   original selector, which is +(0,2,0). Where a rule here changes a
   property that a :hover / .is-active state of the same element also
   sets, the state is restated after it, in the original order, so the
   state does not lose to the base override.
---------------------------------------------------------------- */


/* ---- brain: region and state tiles (sit on white cards) ---- */

:root[data-theme="light"] .brain-state-btn:hover { border-color: var(--gold-ink); } /* was var(--gold) as a 1px outline; 2.1-2.6:1 on white for the gold brands, gold-ink is 6.2:1+ */
:root[data-theme="light"] .brain-state-btn.is-active { border-color: var(--gold-ink); } /* was var(--gold) selected-state outline; same reason. The 1px --gold-soft ring beside it is a pale halo and stays */

:root[data-theme="light"] .brain-region-btn:hover { border-color: color-mix(in srgb, var(--gold-ink) 70%, transparent); } /* was rgba(212,175,106,.5), a pale gold outline that disappears on white. 70% gold-ink over white is 3.2:1 (default gold) to 4.5:1 (blue brands) */
:root[data-theme="light"] .brain-region-btn.is-active { border-color: var(--gold-ink); } /* was var(--gold) selected-state outline on the gold-wash tile; gold-ink is 6.2:1+ on white. Text stays --text-primary */


/* ---- brain: inline-coloured labels (colour comes from brain.js style="", so it is darkened rather than replaced) ---- */

/* The region and anatomy accordion headings are set to the region's stroke
   colour inline (#a67c3d #729468 #6b7688 #bfa06a #8f3850 #614e80, and #a98a3f
   for secondary anatomy). Those were chosen to read on the dark panel; on the
   white accordion several are 2.5-3.8:1. The label span inherits the inline
   colour, so mixing it 64% with black keeps each region's hue. Worst case
   #bfa06a becomes 5.5:1, the rest 6.8:1 or better (pixel-sampled in headless
   Chrome: #bfa06a renders as rgb(122,102,68)). The chevron is a sibling
   span with its own token colour and is not touched. */
:root[data-theme="light"] .brain-acc-summary > span:first-child { color: color-mix(in srgb, currentcolor 64%, #000); } /* was the raw region stroke colour from inline style, 2.5:1 to 3.8:1 for five of the seven on white */

/* "How you can tell" / "Running on" labels in the state card carry the
   state's tone inline (#c25b73 #d4af6a #a3c49a #8d7ab0), which is 1.8-3.8:1 on
   the card. An inline style cannot be out-ranked by a selector, and a colour
   cannot be derived from itself, so the element is darkened with a filter:
   brightness(.58) multiplies each sRGB channel by .58, the same as mixing with
   black. Against the card's darkest point, the gradient top (#f6f5f1), that gives 8.4:1
   (#c25b73), 5.1:1 (#d4af6a), 4.8:1 (#a3c49a), 7.9:1 (#8d7ab0). Only labels
   whose style attribute starts with color: match, so the "What actually
   shifts it" label (token colour) is left alone. */
:root[data-theme="light"] .brain-state-card .brain-field-label[style^="color:"] { filter: brightness(.58); } /* was inline tone colours made for a dark card: 1.8:1 (#a3c49a), 1.9:1 (#d4af6a), 3.5:1 (#8d7ab0), 3.8:1 (#c25b73) */


/* ---- brain: the streetlight (kept dark, so its TEXT needs light ink) ---- */

/* The panel (#0b0e16) and the unlit/lit lamps are deliberately unchanged:
   it is a signal head, the same navy family as the diagram next to it. What
   breaks is the text, which reads --text-* tokens that are now dark ink on
   a dark panel (1.1:1 for the "on" label). The unlit label needs nothing:
   --text-faint is #8a897f in the light skin, 5.5:1 on #0b0e16, and still
   clearly dimmer than the lit label. */
:root[data-theme="light"] .brain-lamp-row.is-on .brain-lamp-label { color: #f7f6f3; } /* was var(--text-primary), which is #1a1a18 in the light skin: 1.1:1 on the dark panel. Lit label is 17.9:1 */
/* Literals on purpose: the panel stays dark in both skins and there is no on-dark text token, so these are fixed values rather than tokens that flip with the skin. */
:root[data-theme="light"] .brain-lamp-note { color: #a3a9b6; } /* was var(--text-muted), #66655b in the light skin: 3.3:1 on the dark panel. Now 8.2:1 */


/* ---- service desk: gold used as text, line or control fill ---- */

:root[data-theme="light"] .sd-char.is-risky { color: var(--gold-ink); } /* was var(--gold-lit), pale gold for a dark ground. Gold-ink on the gold-wash tile is 5.5:1 (default gold) to 8.7:1 (blue brands) over the darkest card ground, #f6f5f1 */
:root[data-theme="light"] .sd-checkfield input { accent-color: var(--gold-ink); } /* was var(--gold) as the checked-box fill; 2.1-2.6:1 against white for the gold brands, below the 3:1 a control needs. Gold-ink is 6.2:1+ */
:root[data-theme="light"] .sd-tab.is-active { border-bottom-color: var(--gold-ink); } /* was var(--gold) 2px selected-tab underline; same reason. Text stays --text-primary */
:root[data-theme="light"] .sd-preview-banner { border-left-color: var(--gold-ink); } /* was var(--gold) 3px accent line on the "previewing a client" banner; gold-ink is 6.2:1+ on white */


/* ---- service desk: text that sits on cards (card top is --surface-2, #f6f5f1, so it must pass there, not just on white) ---- */

:root[data-theme="light"] .sd-warn { color: color-mix(in srgb, var(--warn) 90%, #000); } /* review fix. was var(--warn) #9a6700: 4.87:1 on white but 4.46:1 on #f6f5f1 (fails), and .sd-warn is used in cards (service-desk.js 4090, 4400). 90% --warn + black is #8b5d00: 5.28:1 on #f6f5f1, 5.76:1 on white. Same pattern chunk 1 and 3 use for --good text */
:root[data-theme="light"] .sd-searchbar input::placeholder { color: var(--text-muted); } /* review fix. was var(--text-faint) #8a897f, 3.52:1 on the white search bar (fails). --text-muted #66655b is 5.87:1. Same fix chunks 2 and 3 apply to the other placeholders */


/* ---- service desk: status pills (sit on --surface-3, #edebe5) ---- */

:root[data-theme="light"] .pill.is-blocked { color: #7a5200; } /* was var(--warn), #9a6700 in the light skin: 4.1:1 on the pill's #edebe5. Darker amber, same hue: 5.8:1 */
:root[data-theme="light"] .pill.is-clear { color: #0b6b4a; } /* was var(--good), #12875f in the light skin: 3.8:1 on the pill's #edebe5. Darker green, same hue: 5.5:1 */


/* ---- notification bell: dropdown panel ---- */

:root[data-theme="light"] .notif-panel { box-shadow: var(--shadow-pop); } /* was 0 12px 32px rgba(0,0,0,.35), a dark-ground drop shadow that reads as a grey smear on white */

/* ================================================================
   styles.css 1961-2440  (chunk-5)
   ================================================================ */
/* ---------------------------------------------------------------
   Light skin, fragment 5 of 8: styles.css lines 1962-2440.
   First rule: .notif-row:hover. Last rule: .cal-cell (the cash
   calendar cell, ends at 2440).

   Ratios are WCAG 2 against the real ground (page and cards #ffffff,
   --surface-2 #f6f5f1, --surface-3 #edebe5). Gold-ink figures are for
   the default gold #d4af37 (the weakest of the four brand golds in
   brand.js: #d4af37, #be9e44, #0e7fd4, #0077c0, which give 6.2 / 7.1 /
   9.9 / 10.6 against white).

   TWO CASCADE FACTS THAT SHAPE THIS FRAGMENT
   1. `:root[data-theme="light"]` adds (0,2,0), so an override of a
      LESS specific selector would also beat its more specific sibling
      (.foot-chip over .foot-chip.is-lead). .foot-chip is therefore
      written with :not() so the hover and lead variants are untouched.
   2. .cal-cell / .cal-dow are declared three times (lines 730-741,
      2430-2440 and 2577). The background: rgba(255,255,255,.02) at
      2439 is DEAD in dark too: 2577 re-declares `.cal-cell` with
      `background: transparent` at equal specificity, later. No
      override is written for it. .cal-dow has opacity only at 2430;
      its colour (var(--text-muted)) comes from 730.
---------------------------------------------------------------- */

/* ---- Service desk: ink on gold, accent stripes, selected row ---- */
:root[data-theme="light"] .sd-tab-ask { color: var(--on-accent); } /* was var(--bg), which is white here: white on gold 2.1:1. --on-accent is the brand's own dark ink on its gold: 8.03:1 default, 7.2 on #be9e44, 4.72 on #0e7fd4, 4.22 on #0077c0 (the last is the brand's own ink/gold pairing, the same one .chip.is-active and .foot-chip.is-lead already use, so left to the brand). Safe against .sd-tab-count: it is a <span> badge inside .sd-tab, and no parent rule sets its colour */
:root[data-theme="light"] .sd-step.is-done .sd-step-n { color: var(--on-accent); } /* was var(--bg) as ink on the gold step badge, same fault: 2.1:1 -> 8.03:1 */
:root[data-theme="light"] .sd-ask,
:root[data-theme="light"] .sd-setup { border-left-color: var(--gold-ink); } /* was var(--gold) 3px stripe, 2.1:1 on white. gold-ink 6.24:1 */
:root[data-theme="light"] .sd-carrier-row.is-on { border-color: var(--gold-ink); } /* was var(--gold) 1px outline marking the chosen carrier, 2.1:1 on white. gold-ink 6.24:1 */
:root[data-theme="light"] .sd-carrier-row input { accent-color: var(--gold-ink); } /* was accent-color var(--gold): the checked box is a state indicator and gold fill on white is 2.1:1 (needs 3:1); the browser picks a white tick for a dark fill. gold-ink 6.24:1 default, 7.1 / 9.9 / 10.5 on the other three brand golds. Matches the gold-ink border on .is-on just above */

/* ---- Disclosure footer chips ---- */
:root[data-theme="light"] .foot-chip:not(:hover):not(.is-lead) { color: var(--gold-ink); } /* was var(--gold-lit) (#f6e39a, a light gold for dark) on the gold wash: about 1.2:1. gold-ink 5.91:1 on the wash over white. :not() keeps .foot-chip:hover (text-primary) and .foot-chip.is-lead (on-accent on solid gold) exactly as styles.css has them */

/* ---- Sidebar crest ---- */
:root[data-theme="light"] .nav-crest:hover { border-color: var(--gold-ink); } /* was var(--gold) hairline on hover, 2.1:1 on white. gold-ink 6.24:1 */

/* ---- Client financial dashboard: money in / money out ---- */
:root[data-theme="light"] .flow-in { color: #0f7551; } /* was #4ea87a (2.91:1 on white, fails even as 20px bold large text at 3:1 by a hair). Darker same-hue green: 5.70:1 white */
:root[data-theme="light"] .flow-out { color: var(--bad); } /* was #c9656b, 3.78:1 on white. --bad #c0352b: 5.55:1 */
:root[data-theme="light"] .flow-bar.is-in { background: var(--good); } /* was #4ea87a bar, 2.91:1 on white. --good #12875f: 4.51:1 */
:root[data-theme="light"] .flow-bar.is-out { background: var(--bad); } /* was #c9656b bar, 3.78:1. --bad: 5.55:1 */
:root[data-theme="light"] .spend-fill.is-over { background: var(--bad); } /* was #c9656b over-budget fill on the --surface-3 track, 3.17:1 -> --bad 4.65:1 */
:root[data-theme="light"] .spend-fill.is-done { background: var(--good); } /* was #4ea87a goal-met fill on the --surface-3 track, 2.44:1 -> --good 3.78:1 */
:root[data-theme="light"] .spend-amt.is-over { color: var(--bad); } /* was #c9656b amount text, 3.78:1 on white. --bad: 5.55:1 */
:root[data-theme="light"] .spend-row.is-editable:focus-visible,
:root[data-theme="light"] .goal-row.is-editable:focus-visible { outline-color: var(--gold-ink); } /* was var(--gold) 2px focus ring, 2.1:1 on white (needs 3:1). gold-ink 6.24:1 */
:root[data-theme="light"] .acct-bal.is-debt { color: var(--bad); } /* was #c9656b debt balance, 3.78:1 on white. --bad: 5.55:1 */
:root[data-theme="light"] .tx-amt.is-in { color: #0f7551; } /* was #4ea87a incoming amount, 2.91:1 on white. Darker same-hue green: 5.70:1 white, 5.23:1 on --surface-2 */

/* ---- Row dividers drawn in --surface-2 (1.09:1 on white, near invisible) ---- */
:root[data-theme="light"] .tx-row { border-bottom-color: var(--line); } /* was var(--surface-2): barely distinct from white. --line is rgba(26,26,24,.10), 1.22:1, the same weight the dark rule has (1.18:1). The :last-child { border-bottom: 0 } is untouched because only the colour is set */

/* ---- VIP roster badges and messages ---- */
:root[data-theme="light"] .vip-badge.is-carrier { color: var(--gold-ink); } /* was var(--gold) .7rem text on the gold wash, 1.99:1. gold-ink 5.91:1 on the wash over white */
:root[data-theme="light"] .vip-badge.is-inactive { color: var(--bad); } /* was #c9656b on rgba(201,101,107,.08), 3.45:1. --bad: 5.06:1 on the tint over white, 4.66:1 over --surface-2 */
:root[data-theme="light"] .vip-badge.is-vip { color: #0f7551; } /* was #4ea87a on rgba(78,168,122,.1), 2.65:1. Darker same-hue green: 5.19:1 on the tint over white, 4.78:1 over --surface-2. --good would be only 4.1:1 here */
:root[data-theme="light"] .vipmsg.is-them { border-left-color: var(--gold-ink); } /* was var(--gold) 2px rule marking the other party, 2.1:1 on white. gold-ink 6.24:1 */

/* ---- Community board ---- */
:root[data-theme="light"] .chip.is-cat { color: var(--gold-ink); } /* was var(--gold) .7rem category text on the gold wash, 1.99:1. gold-ink 5.91:1 */
:root[data-theme="light"] .board-post:hover .board-post-title { color: var(--gold-ink); } /* was var(--gold) title text on hover, 2.1:1 on white. gold-ink 6.24:1 */
:root[data-theme="light"] .board-post,
:root[data-theme="light"] .board-reply { border-bottom-color: var(--line); } /* was var(--surface-2) divider, 1.09:1 on white. --line 1.22:1. :last-child / :last-of-type { border-bottom: 0 } untouched, only the colour is set */

/* ---- Cash calendar: totals and weekday header ---- */
:root[data-theme="light"] .cal-in { color: #0f7551; } /* was #4ec98a (light mint for dark), 2.09:1 on white. Darker same-hue green: 5.70:1 */
:root[data-theme="light"] .cal-out { color: var(--bad); } /* was #d98b8b, 2.62:1 on white. --bad: 5.55:1 */
:root[data-theme="light"] .cal-net.is-over { color: var(--bad); } /* was #d98b8b, 2.62:1 on white. --bad: 5.55:1 */
:root[data-theme="light"] .cal-dow { opacity: 1; } /* was opacity .55 over var(--text-muted) (set at line 730): 2.32:1 on white. Full opacity is --text-muted #66655b, 5.87:1 */

/* ================================================================
   styles.css 2441-2920  (chunk-6)
   ================================================================ */
/* ---------------------------------------------------------------
   Light skin, fragment 6 of 8: styles.css lines 2441-2921.
   First rule: .cal-cell.is-blank (2441). Last rule: .faf-contents-label,
   which straddles line 2920 and ends at 2921.

   Covers: the cash-calendar month grid and day view, the Ripple Book
   tabs, running totals, the reservoir and its worked-example frame, the
   "new build" pill, budgets, the Plouton help bubble, the family tree,
   the Everyone-page bars, and the Fulfilled AF menu marks.

   Ratios are WCAG 2 against the real ground: page and cards #ffffff,
   --surface-2 #f6f5f1, --surface-3 #edebe5, --surface-4 #e0ddd4.
   --gold-ink is derived per brand, so ratios are quoted for the default
   gold #d4af37 (-> #735e1a), the weakest of the five golds in use
   (#d4af37, #be9e44, #c9a86a fallback, #0e7fd4, #0077c0): 6.28:1 on
   white and 5.27:1 on --surface-3. The others are all higher.
   Green TEXT uses #0f7551 (5.70:1 on white) as fragment 5 does, because
   --good is only 4.51:1 on white and 4.13:1 on --surface-2.

   CASCADE FACTS THAT SHAPE THIS FRAGMENT
   1. The `:root[data-theme="light"]` prefix adds (0,2,0), so an override
      of a LESS specific selector would beat its more specific sibling in
      the original. Where that mattered the sibling is restated or the
      override is narrowed with :not():
        .ripple-tab:hover vs .ripple-tab.is-active   (active keeps gold)
        .cal-cell.has-events vs button.cal-cell:hover (hover keeps winning)
        .fam-union vs .fam-union.is-couple
        .fam-node ...:hover .fam-card over .is-self / .is-partner
   2. .cal-cell is declared at 737, 2436 and 2577. The 2439 background
      (rgba(255,255,255,.02)) is dead in dark too: 2577 re-declares
      `.cal-cell` as `background: transparent`, later at equal
      specificity. No override is written for it.
   3. The sample frame (.res-sample-frame) dims EVERYTHING inside it with
      opacity, so text contrast there is the text colour composited at
      that opacity, not the token's own ratio. Checked on that basis.
   4. The Everyone-page rules (.mm-*, .mstr-*) belong to the Business
      View, which theme.js keeps dark. They are written anyway so the
      skin is correct if that rule ever changes.
   5. (Review) Some of the reservoir's colours are INLINE styles written
      by finance.js (style="fill:var(--ink-pos, #4ec98a)" and friends).
      No class rule can beat an inline style, so those are fixed by
      defining the custom properties they read, on .res-svg only, rather
      than with !important. The same file also draws the tank's centre
      figure and caption on top of the blue water; those get a halo.
---------------------------------------------------------------- */

/* ---- Cash calendar: month grid and day view ---- */
:root[data-theme="light"] .cal-cell.has-events { background: var(--surface-sunken); } /* was rgba(255,255,255,.06), invisible on white. Now the 5% ink wash, with the date still primary text */
:root[data-theme="light"] button.cal-cell:hover { background: var(--surface-3); } /* restated unchanged: in dark button.cal-cell:hover (0,2,1) beats .cal-cell.has-events (0,2,0); with the prefix on has-events above it would flip, so hover is lifted by the same prefix */
:root[data-theme="light"] .cal-cell.is-today { outline-color: var(--gold-ink); } /* was var(--gold) 1px outline, 2.10:1 on white. gold-ink 6.28:1 */
:root[data-theme="light"] .cal-cell.is-selected,
:root[data-theme="light"] .cal-cell:focus-visible { outline-color: var(--gold-ink); } /* was var(--gold) 2px selected and focus rings, 2.10:1 on white (needs 3:1). gold-ink 6.28:1 */
:root[data-theme="light"] .cal-dot.is-in { background: var(--good); } /* was #4ec98a (light mint for dark), 2.09:1 on white. --good #12875f: 4.51:1 on white, 4.08:1 on the has-events wash */
:root[data-theme="light"] .cal-dot.is-out { background: var(--bad); } /* was #d98b8b, 2.62:1 on white. --bad #c0352b: 5.55:1, 5.02:1 on the has-events wash */
:root[data-theme="light"] .cal-dot.is-windfall { background: var(--gold-ink); } /* was var(--gold) 5px dot, 2.10:1 on white. gold-ink 6.28:1, 5.69:1 on the has-events wash */
:root[data-theme="light"] .linkbtn.is-on { color: var(--gold-ink); } /* was var(--gold) as text on white, 2.10:1. gold-ink 6.28:1. Still beats .linkbtn:hover, as .is-on does in dark */

/* ---- Ripple Book tabs ---- */
:root[data-theme="light"] .ripple-tab:not(.is-active):hover { background: var(--surface-sunken); } /* was rgba(255,255,255,.05) hover wash, invisible on white. :not(.is-active) so the gold active tab keeps its fill on hover, as it does in dark */
:root[data-theme="light"] .ripple-tab:not(.is-active) .ripple-tab-n { background: var(--surface-raised); } /* was rgba(255,255,255,.12) count chip, invisible on white. The active tab's rgba(0,0,0,.18) chip on gold is left alone. Count text is --text-primary, 14.54:1 on the chip */

/* ---- Running totals ---- */
:root[data-theme="light"] .cal-run-end.is-over,
:root[data-theme="light"] .cal-low,
:root[data-theme="light"] .cal-run.is-over { color: var(--bad); } /* was #d98b8b, 2.62:1 on white. --bad: 5.55:1 */
:root[data-theme="light"] .spend-foot .is-over,
:root[data-theme="light"] .spend-foot .is-over strong { color: var(--bad); } /* was #c9656b, 3.78:1 on white. --bad: 5.55:1 */
:root[data-theme="light"] .spend-foot .is-left strong { color: #0f7551; } /* was #4ec98a, 2.09:1 on white. Darker same-hue green, 5.70:1 */

/* ---- Reservoir ---- */
:root[data-theme="light"] .res-in { fill: #0f7551; } /* was #4ec98a figure ("coming in"), 22px bold so large text needs 3:1; it had 2.09:1. Darker same-hue green: 5.70:1 on white, 3.83:1 at the sample frame's .8 dim */
:root[data-theme="light"] .res-out { fill: var(--bad); } /* was #d98b8b figure ("going out"), 2.62:1 on white. --bad: 5.55:1, 3.96:1 at the sample frame's .8 dim */
:root[data-theme="light"] .res-kept.is-dry { fill: var(--bad); } /* was #d98b8b 28px figure when the tank is dry, 2.62:1. --bad: 5.55:1 */
:root[data-theme="light"] .res-tab:focus-visible { outline-color: var(--gold-ink); } /* was var(--gold, #c9a86a) 2px focus ring, 2.10:1 on white. gold-ink 6.28:1 */
:root[data-theme="light"] .res-svg {
  --ink-pos: #0f7551;
  --ink-gold: var(--gold-ink);
  --chart-in: #0f7551;
  --chart-out: var(--bad);
} /* REVIEW ADDITION. finance.js reservoirSvg() paints with inline style="fill:var(--ink-pos, #4ec98a)", "fill:var(--ink-gold, #e8c98a)", "stroke:var(--chart-in, #4ec98a)" and "stroke:var(--chart-out, #d98b8b)". None of the four is defined anywhere (styles.css, styles-light.css, brand.js, theme.js), so in white they fall back to the dark-ground literals. Inline style beats any class rule, so the only reach is to define the tokens, scoped to the one SVG so --ink-gold does not leak into vision-board, webinars or the brain panel, which also read it. Replaces: the 15px bold .res-mark labels ("$32,220", "12 mo", the gold "you" figures) at 2.09:1 green and 1.60:1 gold on white; the 10px income stream and the drain at 2.09:1 and 2.62:1 (graphics need 3:1). Now: green #0f7551 5.70:1 on white (3.83:1 at the sample frame's .8 dim, but the sample is the monthly flow view, which has no .res-mark), gold-ink 6.28:1, drain --bad 5.55:1 (3.96:1 dimmed). Water, wave and the two crossing lines (with their dark under-stroke) are a scene and stay as they are */
:root[data-theme="light"] .res-svg .res-kept,
:root[data-theme="light"] .res-svg .res-kept + .res-sub {
  paint-order: stroke fill; stroke: var(--surface-1); stroke-opacity: .75; stroke-width: 3px; stroke-linejoin: round;
} /* REVIEW ADDITION. The tank's centre figure and its caption ("stays every month") are drawn ON the blue water (#6cc4ea at the surface to #2a6f9e at depth). --text-secondary on that is 5.06:1 at the surface and 1.95:1 at depth for 12px text; --text-primary under the 28px figure is 9.16:1 at the surface and 3.52:1 at depth (large text, passes, but marginal). A 1.5px white halo at .75 behind the glyphs (paint-order puts the stroke under the fill) makes the local contrast the text's own against near-white: --text-secondary vs the halo over surface water 8.24:1, over deep water 6.89:1. On a dry tank there is no water and the halo vanishes into --surface-2. .res-kept + .res-sub is the caption directly after the figure in the markup, so the margin captions that share .res-sub are untouched. Dark gets no halo and is worse (light text on light water), left as it was */

/* ---- Worked-example frame ---- */
:root[data-theme="light"] .res-sample-frame { opacity: .8; border-color: var(--line-strong); } /* was opacity .72 over a --hairline dashed border. At .72 the frame's secondary text composites to 4.36:1 and its muted text to 3.20:1, both below the line. At .8: secondary 5.41:1, the green figure 3.83:1 (large text), the red one 3.96:1. The dashed border was 1.19:1 once dimmed, now 1.39:1 (dark is about 1.55:1). Still visibly dimmer than live data, and the pill, dashed frame and Example tag carry the disclaimer */
:root[data-theme="light"] .res-sample-frame::after { color: var(--text-secondary); } /* was var(--text-muted), which after the frame's dim is 3.77:1 at .8 (3.20:1 at .72) for 0.68rem text. --text-secondary at .8: 5.41:1 */
:root[data-theme="light"] .res-sample-frame .fam-gen { fill: var(--text-secondary); } /* generation labels in the example tree: --text-muted at the .8 dim is 3.77:1 for 11px text. --text-secondary at .8: 5.41:1 */

/* ---- "A new build is out" pill ---- */
:root[data-theme="light"] .build-stale { box-shadow: var(--shadow-pop); } /* was 0 8px 30px rgba(0,0,0,.55), a dark-ground shadow that reads as a smudge under a pill on white. Gold fill and its dark ink are brand colours, left alone */
:root[data-theme="light"] .build-stale:focus-visible { outline-color: var(--text-primary); } /* was #fff ring, which is invisible (1.00:1) on a white page. --text-primary: 17.43:1 */

/* ---- Budgets ---- */
:root[data-theme="light"] .budget-unlinked { color: var(--gold-ink); border-color: var(--gold-ink); } /* was var(--gold) text, 2.07:1 on its own rgba(201,168,106,.12) tint, with a rgba(201,168,106,.4) border. gold-ink text: 5.75:1 on the tint, 5.34:1 on the .22 hover tint. Tint backgrounds are fine on white and left alone */
:root[data-theme="light"] .budget-unlinked:focus-visible { outline-color: var(--gold-ink); } /* was var(--gold) 2px focus ring, 2.10:1 on white. gold-ink 6.28:1 */
:root[data-theme="light"] .budget-undated { border-left-color: var(--gold-ink); } /* was rgba(201,168,106,.5) 2px rule, 1.47:1 on white. gold-ink 6.28:1 */

/* ---- Plouton help bubble ---- */
:root[data-theme="light"] .help-fab { box-shadow: var(--shadow-lift); } /* the button is --surface-3 (#edebe5, 1.2:1 against white) with a 30% gold border; dark gets its separation from the ground, white needs a shadow to float */
:root[data-theme="light"] .help-fab:hover { border-color: var(--gold-ink); } /* was var(--gold) hover border, 2.10:1 on white. gold-ink 6.28:1 */
:root[data-theme="light"] .help-fab:focus-visible { outline-color: var(--gold-ink); } /* was var(--gold) 2px focus ring, 2.10:1 on white. gold-ink 6.28:1 */
:root[data-theme="light"] .help-fab-mark { color: var(--gold-ink); } /* was var(--gold) "?" on its gold wash over --surface-3, 1.69:1. gold-ink 5.04:1 */
:root[data-theme="light"] .help-compose input[type="text"]:focus { border-color: var(--gold-ink); } /* was var(--gold) as the only focus indicator (outline is none), 2.10:1 against the white field. gold-ink 6.28:1 */
:root[data-theme="light"] .help-error { color: var(--bad); } /* was #d98b8b on the panel's --surface-2, 2.40:1. --bad: 5.09:1 */

/* ---- Family tree: lines ---- */
:root[data-theme="light"] .fam-union { stroke: var(--gold-ink); opacity: .75; } /* was var(--gold) marriage bar at .55 opacity, 1.49:1 on white. gold-ink at .75: 3.59:1 (dark is 3.48:1) */
:root[data-theme="light"] .fam-union.is-couple { opacity: .95; } /* restated: the original .85 sits on (0,2,0), which the .fam-union override above would otherwise beat and flatten to .75. The client's own marriage stays the heaviest line: gold-ink at .95 is 5.59:1 */
:root[data-theme="light"] .fam-stem { stroke: var(--gold-ink); opacity: .55; } /* was var(--gold) at .38 opacity, 1.31:1 on white. gold-ink at .55: 2.41:1 (dark is 2.25:1); quiet by design, it is plumbing */
:root[data-theme="light"] .fam-bus { stroke: var(--gold-ink); opacity: .55; } /* the bracket is the stem's sibling: same ink, same quiet, so it reads as plumbing */
:root[data-theme="light"] .fam-bus-drop { stroke: var(--gold-ink); opacity: .4; }
:root[data-theme="light"] .fam-pick input:checked + .fam-pick-body { border-color: var(--gold-ink); box-shadow: inset 0 0 0 1px var(--gold-ink); } /* a selected control needs 3:1 against white; --gold is 2.1-2.6:1, gold-ink is 6.2:1+ */
:root[data-theme="light"] .fam-pick input:checked + .fam-pick-body::after { border-color: var(--gold-ink); background: radial-gradient(circle, var(--gold-ink) 0 42%, transparent 46%); }
:root[data-theme="light"] .fam-pick-error { color: var(--gold-ink); } /* gold as text: gold-ink is 6.28:1 on white */
:root[data-theme="light"] .fam-pick input:focus-visible + .fam-pick-body { outline-color: var(--gold-ink); }
:root[data-theme="light"] .fam-edge { stroke: color-mix(in srgb, var(--gold-ink) 60%, transparent); } /* was var(--gold-soft) descent curve (30% gold), 1.24:1 on white. 60% gold-ink: 2.66:1 (dark is 1.83:1) */

/* ---- Family tree: cards ---- */
:root[data-theme="light"] .fam-node.is-self .fam-card { stroke: color-mix(in srgb, var(--gold-ink) 65%, transparent); } /* was var(--gold-soft) 2px outline on the client's card, 1.24:1 on white. 65% gold-ink: 2.93:1. The self card is not editable, so it has no hover state to compete with */
:root[data-theme="light"] .fam-node.is-self .fam-mono { fill: var(--gold-ink); } /* was var(--gold) initials on rgba(201,168,106,.26), 1.66:1. gold-ink: 4.96:1 on that tint over the card's gold wash (5.16:1 and up on the other brand golds) */
:root[data-theme="light"] .fam-node.is-partner .fam-card { stroke: color-mix(in srgb, var(--gold-ink) 40%, transparent); } /* was rgba(201,168,106,.34), 1.29:1 on white: the same as the plain --hairline card (1.28:1), so "picked out" was lost. 40% gold-ink: 1.85:1, quieter than the client's 2.93:1 as intended */
:root[data-theme="light"] .fam-node.is-blank .fam-mono-bg { stroke: var(--line-strong); } /* was var(--hairline) dashed ring on an empty seat (empty seats only exist inside the sample frame): 1.21:1 once dimmed. --line-strong: 1.39:1 once dimmed */
:root[data-theme="light"] .fam-node.is-blank .fam-rel { opacity: 1; } /* was fill at .75 opacity. Inside the sample frame's dim that compounds to 2.71:1 for 11.5px text. Full opacity, dimmed once by the frame: 5.10:1. Still italic, so empty seats still read as such */
:root[data-theme="light"] .fam-node.is-gone .fam-mono { fill: var(--text-primary); } /* was var(--text-secondary) at .72 opacity on --surface-4, 3.68:1 for 13px initials. --text-primary at .72: 5.89:1 */
:root[data-theme="light"] .fam-node[data-family-edit]:hover .fam-card,
:root[data-theme="light"] .fam-node[data-family-edit]:focus-visible .fam-card { stroke: var(--gold-ink); } /* was var(--gold) hover and focus outline, 2.10:1 on white (needs 3:1). gold-ink 6.28:1. Written last and at (0,6,0) so it still beats the .is-partner stroke above (0,5,0), as the original (0,4,0) beats (0,3,0) in dark */
:root[data-theme="light"] .fam-doc-dot { stroke: color-mix(in srgb, var(--gold-ink) 55%, transparent); } /* was var(--gold-soft) outline on the document-count dot, 1.24:1 on white, so the badge barely existed. 55% gold-ink: 2.41:1 */
:root[data-theme="light"] .fam-doc-n { fill: var(--gold-ink); } /* was var(--gold) count on its own gold wash, 1.83:1 for 10.5px text. gold-ink: 5.48:1 on the dot over --surface-2 */

/* ---- Everyone page (Business View; kept dark by theme.js, written in case that changes) ---- */
:root[data-theme="light"] .mm-bar > span { background: var(--gold-ink); } /* was var(--gold) proportion fill on the --surface-3 track, 1.76:1. gold-ink: 5.27:1 */
:root[data-theme="light"] .mm-chart rect { fill: var(--gold-ink); } /* was fill="var(--gold)" bar attribute, 2.10:1 on white. gold-ink 6.28:1. A CSS fill beats the presentation attribute */
:root[data-theme="light"] .mm-chart text { fill: var(--text-muted); } /* was fill="var(--text-faint)" 10px month labels, 3.52:1 on white. --text-muted: 5.87:1 */
:root[data-theme="light"] .mstr-flabel { color: var(--text-muted); } /* was var(--text-faint) .76rem filter label, 3.52:1 on white. --text-muted: 5.87:1 */

/* ---- Fulfilled AF menu marks ---- */
:root[data-theme="light"] .faf-nav-item.is-done .nav-ico { color: var(--gold-ink); } /* was var(--gold) completed-chapter icon, 2.10:1 on white. gold-ink 6.28:1, 5.27:1 on the active row's --surface-3 */
:root[data-theme="light"] .nav-ico-art.is-started { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--gold-ink) 50%, transparent); } /* was a 1.5px ring in var(--gold-soft) (30% gold), 1.24:1 on white. 50% gold-ink: 2.2:1 and it sits against the dark tile it rings. Still clearly lighter than the done ring */
:root[data-theme="light"] .nav-ico-art.is-done { box-shadow: 0 0 0 1.5px var(--gold-ink); } /* was a 1.5px ring in var(--gold), 2.10:1 on white. gold-ink 6.28:1 */

/* ================================================================
   styles.css 2921-3400  (chunk-7)
   ================================================================ */
/* ---------------------------------------------------------------
   Chunk 7 of 8: styles.css lines 2921-3404.
   (Range 2921-3400; the .faf-turn rule that straddles line 3400 ends at 3404.)
   Covers: the admin filter bar and row actions, the Steps/Dedication nav
   group, the chapter opener, the mode switch, the audiobook player, the
   flip reader (board, leaves, papyrus page, marks, dog-ear), the selection
   toolbar and note composer, My notes, Ask Pete, and the page-turn arrows.

   Ratios are WCAG 2. Ground is #fff (page, cards), surface-2 #f6f5f1.
   gold-ink is derived from each brand's gold, so ratios are given for the
   default #d4af37 and, where it matters, the other brand golds in brand.js.

   Re-declarations checked: .linkbtn.is-danger is also set at 125/126 (the
   :hover rule there is why the light override below is specified so that
   it holds on hover too). .faf-book / .faf-page / .faf-markbar / .faf-turn
   are re-declared later only for size and position inside @media blocks,
   never for colour.

   Left dark / unchanged on purpose (no override written):
   - .faf-page and everything printed on it (.faf-page-body, .faf-h,
     .faf-page-no, .faf-hl, .faf-ear and its flap): a fixed papyrus sheet
     with dark ink in both skins.
   - .faf-art img: the chapter plates are carved-marble renders on a
     near-black ground (brands/faf/art/*.jpg, set by
     sql/2026-10-31-faf-stone-heroes.sql), a picture like a photograph, so
     a dark plate on a white page is correct. Its border is
     var(--border), defined nowhere, so it has no frame in either skin.
   - .faf-mode.is-on, .faf-markbar-actions button:hover, .faf-turn:hover:
     brand-gold fills with the brand's own --on-primary ink.
---------------------------------------------------------------- */

/* ---- admin filter bar and row actions ---- */
:root[data-theme="light"] .faf-chip.is-on { border-color: var(--gold-ink); color: var(--gold-ink); } /* was --gold-lit text (pale gold for dark) + 30% gold border. gold-ink is 5.94:1 on the gold-wash tint over white (6.65 on the #be9e44 brand, 8.94 on the blue brand); full-strength border so the selected chip reads against its siblings */
:root[data-theme="light"] .linkbtn.is-danger { color: var(--bad); } /* was #e66767 (3.23:1 on white, 2.96 on surface-2). --bad #c0352b is 5.55:1 on white, 5.09 on surface-2. Also wins on :hover (0,4,0 against the base 0,3,0), so the link stays red there instead of turning amber */
:root[data-theme="light"] .linkbtn.is-danger:hover { color: color-mix(in srgb, var(--bad) 80%, #000); } /* review fix. The base :hover rule (line 126) also sets opacity .8, which still applies: --bad at .8 opacity is 3.97:1 on white (3.73 on surface-2), under 4.5 for .85rem text. 80% --bad + 20% black is #9a2a22; at .8 opacity it is 4.99:1 on white, 4.70 on surface-2 (7.70 / 7.06 at full opacity), and reads as a deeper red on hover */

/* ---- small informational text that sits on --text-faint ---- */
:root[data-theme="light"] .faf-filter-count,
:root[data-theme="light"] .faf-tools { color: var(--text-muted); } /* review fix. Was var(--text-faint) #8a897f: 3.52:1 on white (3.23 on surface-2) for .8rem/.82rem informational text, under 4.5. --text-muted #66655b is 5.87:1 on white, 5.38 on surface-2. .faf-tool-link and the tool icons keep gold-ink through their own rules below, which target the elements directly */

/* ---- Steps 1-4 / Dedication nav group ---- */
:root[data-theme="light"] .nav-sep { background: linear-gradient(90deg, color-mix(in srgb, var(--gold-ink) 45%, transparent), transparent); } /* was --gold-soft: 30% gold is 1.24:1 on white (1.83:1 on the dark ground). gold-ink at 45% is 2.01:1, the same weight the hairline has in dark */

/* ---- gold left-edge accents (2px/3px bars) ---- */
:root[data-theme="light"] .faf-warn,
:root[data-theme="light"] .faf-epigraph,
:root[data-theme="light"] .faf-ask-strip .card { border-left-color: var(--gold-ink); } /* was var(--gold): 2.10:1 on white as a thin line. gold-ink is 6.28:1 */

/* ---- audiobook player ---- */
:root[data-theme="light"] .faf-scrub { accent-color: var(--gold-ink); } /* was var(--gold) on the slider thumb/fill: 2.10:1 on white, under the 3:1 UI minimum. gold-ink 6.28:1 */

/* ---- the flip reader: the board and its page-edge stripes ---- */
:root[data-theme="light"] .faf-book {
  border-color: color-mix(in srgb, var(--gold-ink) 70%, transparent); /* was --gold-soft (1.24:1 on white). Gilt hairline at 70% gold-ink is 3.24:1 on white (3.48 on #be9e44, 4.32 on the blue brand) */
  box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-lift); /* was inset 1px rgba(0,0,0,.55) bevel + 26px/60px rgba(0,0,0,.9) drop shadow + faint gold underline, all tuned for a dark ground. A hard black ring and a heavy shadow read as a smear on white */
}
:root[data-theme="light"] .faf-book::before,
:root[data-theme="light"] .faf-book::after { background: repeating-linear-gradient(to right, rgba(150, 128, 92, .45) 0 1px, rgba(150, 128, 92, .12) 1px 2px); } /* was cream rgba(226,216,193,.50) / rgba(120,110,92,.30) stripes, which are 1.26:1 against each other on a white board. Warm tan stripes are 1.48:1, enough to read as a stack of page edges */

/* ---- what the reader can do, said out loud ---- */
:root[data-theme="light"] .faf-tool svg,
:root[data-theme="light"] .faf-tool-link { color: var(--gold-ink); } /* was var(--gold) on icons and the "My notes" link: 2.10:1 on white. gold-ink 6.28:1 (text and graphic) */

/* ---- the selection toolbar and note composer ---- */
:root[data-theme="light"] .faf-markbar {
  background: var(--surface-1); /* was #121212. Its buttons are var(--text-primary), which is near-black in this skin and would vanish on the dark bar; a white bar makes the existing token ink correct (17.43:1) and keeps the composer's surface-2 textarea and .btn buttons on their intended ground */
  border-color: color-mix(in srgb, var(--gold-ink) 70%, transparent); /* was --gold-soft; 3.24:1 on white at 70% gold-ink */
  box-shadow: var(--shadow-pop); /* was 0 8px 26px rgba(0,0,0,.6) */
}
:root[data-theme="light"] .faf-ear-ico { border-right-color: var(--gold-ink); } /* was var(--gold): the miniature dog-ear in the "Dog-ear" button, 2.10:1 on the white bar. gold-ink 6.28:1. The base :hover rule (higher specificity) still turns it to --on-primary on the gold hover fill */
:root[data-theme="light"] .faf-markbar-note textarea { border: 1px solid var(--line-strong); } /* styles.css writes var(--border), which is defined nowhere, so the declaration is invalid and the field has no edge in either skin. In dark the surface-2 fill separates it from the bar; surface-2 on white is 1.08:1, so it needs a real border here */
:root[data-theme="light"] .faf-markbar-note textarea:focus { outline-color: var(--gold-ink); } /* was var(--gold) focus ring: 2.10:1 on white. gold-ink 6.28:1 on the bar, 5.75:1 on the textarea's surface-2 */

/* ---- My notes ---- */
:root[data-theme="light"] .faf-note-quote { border-left-color: color-mix(in srgb, var(--gold-ink) 50%, transparent); } /* was --gold-soft (1.24:1 on white). Decorative 2px quote rule; gold-ink at 50% is 2.20:1 */

/* ---- page-turn arrows (over the papyrus on desktop, on the white page in the phone footer row) ---- */
:root[data-theme="light"] .faf-turn {
  background: rgba(255, 255, 255, .9); /* was rgba(9,9,9,.72). In the phone layout .faf-book-foot .faf-turn puts these on the white page, where that disc turns mid-grey; a white disc works over the papyrus and over the page */
  color: var(--gold-ink); /* was var(--gold). Chevron is 6.15:1 on the disc over papyrus, 6.28:1 over white (6.96 / 7.11 on #be9e44) */
  border-color: color-mix(in srgb, var(--gold-ink) 70%, transparent); /* was --gold-soft; 3.24:1 on white */
  box-shadow: var(--shadow-card); /* lifts the white disc off cream paper; the dark disc had no shadow */
}
:root[data-theme="light"] .faf-turn:hover:not(:disabled) { background: var(--gold); color: var(--on-primary); } /* restated unchanged: the rule above ties it on specificity and loads later, so without this the brand-gold hover fill would be lost */

/* ================================================================
   styles.css 3401-end  (chunk-8)
   ================================================================ */
/* ---------------------------------------------------------------
   Light skin, fragment 8 of 8: styles.css lines 3401-3900.
   First complete rule: .faf-turn:hover:not(:disabled) (3405). Last
   rule: .app-tile-count (3892-3900).

   Covers: the book-foot turn arrows, the reading nook (dark "room"
   with the shelf), read-along highlight and switch, the thank-you
   list, the packing label, touch minimums, chapter-art caption, the
   sign-in legal links (no light rule, see below), the Tools launcher
   tiles and the VIP messages rail.

   Ratios are WCAG 2 against the real ground (page and cards #ffffff,
   --surface-2 #f6f5f1, --surface-3 #edebe5). Gold-ink figures are for
   the default gold #d4af37, the weakest of the four brand golds in
   brand.js (#d4af37, #be9e44, #0e7fd4, #0077c0 give 6.24 / 7.10 /
   9.85 / 10.56 against white, from color-mix(gold 48%, #1a1400) in
   sRGB, which is what the browser computes; checked in Chrome).

   Re-declarations checked (grep of styles.css and every .js/.html in
   the app): .faf-turn, .faf-nook, .faf-book3d, .faf-vol, .faf-art,
   .faf-transport, .faf-topbar and .faf-resume-bar are re-declared
   inside @media blocks in this range for size and position only,
   never colour. .faf-switch*, .app-tile*, .vm-rail-*, .auth-legal
   and .vm-note are declared once. No inline <style> or JS-injected
   CSS touches any of them.

   NOT TOUCHED, AND WHY
   - .faf-turn base rule (3397-3404) straddles line 3400, so it
     belongs to fragment 7, which already writes it (white disc) and
     restates the :hover fill. Nothing is added here.
   - Layout-only rules need nothing: .faf-book-foot, .faf-chapter-nav,
     .faf-topbar, .faf-transport, .faf-tp (and .faf-tp-n, which is
     opacity only), .faf-readalong, .faf-rl-foot, the 560px phone
     block, the whole (hover: none) touch block, .faf-scratch*,
     .faf-resume-bar*, .faf-public, .app-grid, .vm-bar, .vm-search,
     .vm-layout, .vm-rail, .vm-row-acts, .app-tile-mark/name.
   - Already token-correct in light: .faf-unlocked (text-secondary /
     text-primary), .order-addr (surface-2, line-strong, text-primary),
     .faf-switch off state (surface-3 track, text-muted knob 4.92:1),
     .faf-nook-copy h1/p once the nook keeps its dark tokens (below).
   - .auth-legal and its gold hover (3796-3803): the element exists only
     in index.html's #auth block, and theme.js (effectiveTheme) never
     puts data-theme="light" on <html> while signed out, because the
     sign-in screen is dark for everyone by Pete's instruction. A
     gold-ink hover there would be dark gold on a dark ground, so no
     light rule is written. An earlier draft had one; it was removed.
   - Opacity-dimmed ink that still passes: .app-tile-blurb (.65 of
     text-primary, 5.40:1 on white, 5.22 on surface-2) and
     .vm-rail-count (.7, 6.42:1). .vm-note does NOT pass at its .75 and
     has a rule below: .card is a gradient from surface-2 at the top to
     white at 52% (styles.css 1022), so the ground is not plain white.
   - ::highlight(faf-readalong), rgba(96,148,214,.32): it paints over
     the papyrus page, which is the same cream with #221c12 ink in
     both skins. Ink on the highlight is 10.32:1 on #efe6d2 (9.23 on
     the darkest fibre, 11.72 on the lightest). Identical in both.
---------------------------------------------------------------- */

/* ---- reading nook: stays a dark room ---- */
/* The nook is a scene (lamp, vignette, wooden shelf, book spines), so it
   stays dark in both skins. What breaks is not its own colours but the
   tokens it reads: its gradient ends at var(--bg), and its h1 and p take
   var(--text-primary) / var(--text-secondary). All three flip in the
   white skin, which would run the gradient from #17130c to white and set
   near-black ink on dark brown. Re-declaring the dark tokens on the nook
   itself fixes that for the nook and everything inside it, and nothing
   outside it. The shelf, plank, spines, cover shadows, vignette and
   .is-locked dimming are literal dark values and are not touched. */
:root[data-theme="light"] .faf-nook {
  --bg: #0d0d0c; /* was var(--bg), white here: gradient #17130c -> white. #0d0d0c is the styles.css dark ground; brands tint theirs a few levels (#0a0806, #090909, #080a0f), which is not visible at the end of this gradient under the vignette */
  --text-primary: #f7f6f3; /* the dark-skin value. h1 on the brightest point of the lamp glow (#332b16) is 13.00:1, 17.12:1 on the plain #17130c stop. Left as the light token it would be #1a1a18 on #332b16, 1.24:1 */
  --text-secondary: #bdbcb2; /* the dark-skin value. Paragraph on the lamp glow is 7.36:1, 9.69:1 on #17130c */
  --gold-ink: var(--gold); /* on a dark ground gold is already the readable gold, so anything inside the nook that the white skin would send to gold-ink keeps the brand's own gold */
}

/* ---- Follow-the-words switch ---- */
:root[data-theme="light"] .faf-switch.is-on .faf-switch-track { border-color: var(--gold-ink); } /* was var(--gold) outline round the gold fill, 2.10:1 on white (a switch edge needs 3:1). gold-ink 6.24:1. The gold fill itself is the brand fill and stays */
:root[data-theme="light"] .faf-switch:focus-visible { outline-color: var(--gold-ink); } /* was var(--gold) 2px focus ring, 2.10:1 on white (needs 3:1). gold-ink 6.24:1 */

/* ---- chapter-art caption ---- */
:root[data-theme="light"] .faf-art figcaption { color: var(--gold-ink); } /* was var(--gold) italic 1.04rem caption on the page, 2.10:1. gold-ink 6.24:1 on white, 5.72:1 on surface-2 */

/* ---- Tools launcher tiles ---- */
:root[data-theme="light"] .app-tile:hover,
:root[data-theme="light"] .app-tile:focus-visible { border-color: var(--gold-ink); } /* was var(--gold) 1px tile outline, 2.10:1 on white. gold-ink 6.24:1 */
:root[data-theme="light"] .app-tile:focus-visible { outline-color: var(--gold-ink); } /* was var(--gold) 2px focus ring, 2.10:1 on white (needs 3:1). gold-ink 6.24:1 */
:root[data-theme="light"] .app-tile-count { color: var(--gold-ink); opacity: 1; } /* was var(--gold) .76rem uppercase text at opacity .8, which is 1.80:1. gold-ink at the original .8 would be only 3.98:1 on white (3.75 on surface-2) and fail, so opacity goes to 1: gold-ink 6.24:1 on white, 5.72:1 on surface-2 (7.10 / 6.51 on #be9e44) */

/* ---- VIP messages rail ---- */
/* The hover rule is written with :not(.is-active) because styles.css has
   .vm-rail-item.is-active { border-color: transparent } at the same
   specificity as :hover, declared after it, so an active tab keeps its
   transparent border while hovered. An unqualified override here would
   beat that. It is also written BEFORE the .is-hot rule below, because
   in styles.css .is-hot (0,3,0) outranks :hover (0,2,0): a hovered hot
   tab keeps its alert border. Same specificity, later wins, same result. */
:root[data-theme="light"] .vm-rail-item:hover:not(.is-active) { border-color: var(--gold-ink); } /* was var(--gold) 1px outline on hover, 2.10:1 on white. gold-ink 6.24:1. The active tab is a solid gold fill with #111 ink and is left alone */
:root[data-theme="light"] .vm-rail-item.is-hot:not(.is-active) { border-color: var(--bad); } /* was #d98574 (salmon for dark) 1px outline on the "needs attention" tab, 2.78:1 on white (3:1 needed). --bad #c0352b 5.55:1 */
:root[data-theme="light"] .vm-rail-item.is-hot:not(.is-active) .vm-rail-count { color: var(--bad); } /* was #d98574 .78rem bold count, 2.78:1 on white. --bad 5.55:1 (opacity is already 1 on this rule) */
:root[data-theme="light"] .vm-note { opacity: .85; } /* was opacity .75 on --text-secondary, italic .87rem. .vm-list is a .card, whose ground runs from --surface-2 at the top to white at 52%: .75 is 4.72:1 on white but 4.49:1 on --surface-2 (4.53 at 10% down), just under 4.5. .85 is 5.83:1 on --surface-2, 6.22 on white */

/* ================================================================
   colours written inline by JS, as custom properties  (js-tokens)
   ================================================================ */
/* ---------------------------------------------------------------
   Light skin: colour tokens that the CLIENT-FACING JAVASCRIPT reads.

   WHY THIS FILE EXISTS
   finance.js, wellth-wheel.js, brain.js, voice.js, webinars.js and
   vision-board.js write colours into the page themselves: inline
   style="" on template strings, SVG attributes, and <style> blocks
   injected at runtime. A stylesheet fragment cannot out-rank an inline
   style, so each of those literals was replaced with
   var(--token, <the original literal>). Nothing here is defined in the
   dark skin, so the fallback applies and dark renders exactly as it
   did before. These definitions are the ONLY thing that changes in the
   white skin.

   Load after styles-light.css. Every rule is scoped to
   :root[data-theme="light"], like the rest of the skin.

   Grounds used for the ratios: page, cards and the live-chat panel are
   #ffffff; --surface-2 (menus, popovers) is #f6f5f1. Small text needs
   4.5:1, graphics and outlines need 3:1. Ratios are WCAG 2 figures
   computed in node, with semi-transparent colours composited over their
   real ground first.

   TOKENS THE JS READS BUT THAT THE BASE SKIN ALREADY DEFINES
   --hairline, --surface-sunken, --surface-raised (defined in
   styles-light.css, undefined in dark, so the JS fallbacks apply in
   dark): wellth-wheel.js grid rings and spokes, the vision-board row
   and menu hover fills.
---------------------------------------------------------------- */

:root[data-theme="light"] {

  /* ---- ink: colours used as TEXT ---- */

  /* Green text for "money in / the target". finance.js benchmark labels
     ("$32,220" and "12 mo") on the reservoir gauge.
     Was #4ec98a, 2.1:1 on white.
     #0f7a55 is 5.34:1 on white and 4.89:1 on #f6f5f1. */
  --ink-pos: #0f7a55;

  /* Red text for a destructive menu action. vision-board.js "danger"
     item in the board menu (sits on --surface-2, and on the hover fill
     rgba(26,26,24,.09) over it, which composites to #e2e1dd).
     Was #d98574, 2.8:1 on white.
     #b02e24 is 6.44:1 on white, 5.90:1 on #f6f5f1, 4.92:1 on the
     hover fill. */
  --ink-neg: #b02e24;

  /* Gold used as text, a thin line or an icon stroke. This is the skin's
     own --gold-ink (brand gold pulled toward black), so every brand gets
     its own: it is not a hardcoded gold. Read by: finance.js ("you"
     marker labels), wellth-wheel.js (polygon outline and data dots),
     brain.js (anatomy panel top rule and dot), voice.js (mic focus
     ring), webinars.js (own-name colour and offer outline in the live
     chat), vision-board.js (selected swatch and tip rings, tab and
     board-switcher hover outlines, "+" tab, badge, menu headings, focus
     rings).
     Was #e8c98a, #d4af6a, #e8c87a and #c9a227, 1.6:1 to 2.4:1 on white.
     Ratios for the four brand golds (#d4af37 #be9e44 #0e7fd4 #0077c0):
       on white      6.28  7.11  9.89  10.50
       on #f6f5f1    5.75  6.52  9.07   9.62
       on the 28% gold tint under the wheel outline (#f3e9d5)
                     5.21  5.90  8.21   8.71
     The worst case anywhere is 5.21:1. */
  --ink-gold: var(--gold-ink);

  /* Heading ink for a hover that used to brighten text toward cream.
     vision-board.js board-archive toggle. Was #ece8df, invisible on the
     light menu surface. #1a1a18 is 15.98:1 on #f6f5f1. */
  --ink-strong: var(--text-primary);

  /* ---- chart: strokes and rings in SVG ---- */

  /* The stream coming IN on the monthly reservoir (10px stroke and
     arrowhead), and the two 2px leader lines that tie the stepped-down
     benchmark label back to its line. finance.js.
     Was #4ec98a, 2.1:1 on white.
     #0f7a55 is 5.34:1 on white (3:1 needed); the leaders are drawn at
     75% opacity, which composites to 3.33:1. Same green as --ink-pos. */
  --chart-in: #0f7a55;

  /* The stream going OUT on the monthly reservoir (10px stroke,
     arrowhead, and the 3px "dry tank" line). finance.js.
     Was #d98b8b, 2.6:1 on white. A dusty red on purpose: the app does
     not sell with alarm. #b94a4a is 5.07:1 on white and 4.65:1 on
     #f6f5f1 (3:1 needed). */
  --chart-out: #b94a4a;

  /* The ring around each data dot on the Wellth wheel. wellth-wheel.js.
     Was #0f0f0e: it cut the dot out of the dark page. On white the cut
     is white. Not text; it separates the gold-ink dot from the gold-tint
     polygon behind it. */
  --chart-halo: #ffffff;

  /* ---- vision board: the controls around the board ---- */

  /* A hairline edge so a pale colour swatch (the sticky-note palette
     includes #e8e3d8) and the pen-tip preview dot do not dissolve into a
     white toolbar. vision-board.js .vb-swatch border and .vb-nib-dot
     ring. rgba(26,26,24,.5) over white composites to #8d8d8c, 3.32:1
     (3:1 needed for the outline of a control). */
  --swatch-edge: rgba(26, 26, 24, .5);

  /* Shadow under the board-switcher list and the board menu. Was
     0 10px 30px rgba(0,0,0,.45), tuned for a dark ground. The skin's
     own popover shadow instead. */
  --pop-shadow: var(--shadow-pop);

  /* ---- vision board: the board itself is a dark stage in BOTH skins ----
     Exports paint a #17171a ground, item text is cream (#eee) and the
     sticky-note and pen palettes are pale, so a white board would lose
     pale pens and disagree with the exported image. The board's own
     background reads `--surface`, which the skin leaves undefined, so it
     happens to stay dark; this pins it so a future `--surface` in the
     skin cannot break it. File and link cards sit ON the board and were
     reading --surface-2 and --line, which ARE white-skin values: with
     cream text on them that is #eee on #f6f5f1. Pinned to the dark skin's
     own values below.
     Cream item text on the board: #eee is 15.88:1 on #141414 and 14.23:1
     on the card #1f1f1d. */
  --vb-board: #141414;
  --vb-card: #1f1f1d;
  --vb-card-line: rgba(255, 255, 255, .07);

  /* ---- webinar live chat ---- */

  /* The chat panel next to the video. It read `--surface` (undefined, so
     #141414) while its text inherits the page ink, which is #1a1a18 in the
     white skin: dark text on a dark panel. It follows the skin instead.
     The video frame beside it stays black. #1a1a18 on #ffffff is
     17.43:1; the muted timestamps (#66655b) are 5.87:1. */
  --wc-bg: var(--surface-1);
}

/* ================================================================
   Added by hand after the independent review
   ================================================================ */

/* Form controls. At rest they drew --line on a --surface-2 fill: about
   1.2:1 against a white card, so a field read as a smudge rather than a
   box you can type in. Rest state only (:not(:focus)) so the focus rules
   in styles.css keep their own border colour. */
:root[data-theme="light"] .field input:not(:focus),
:root[data-theme="light"] .field select:not(:focus),
:root[data-theme="light"] .field textarea:not(:focus) { border-color: var(--line-strong); }

/* The help bubble (portal-help.js). Bot bubbles are --surface-3 on a
   --surface-2 panel and the chips use a .12 hairline: about 1.1:1 apart on
   white, so the conversation had no visible edges. A real border on both. */
:root[data-theme="light"] .help-msg.is-bot { border: 1px solid var(--line); }
:root[data-theme="light"] .help-chip { border-color: var(--line-strong); }

/* The hand-drawn nav, tool and book icons are all filled from one shared
   gradient (#navGoldGrad in index.html, re-pointed per brand by
   applyBrand()). Its top stop is a pale yellow made for a dark ground: on
   white the icon's highlight vanishes and it reads as a thin outline. CSS
   beats the stop-color attribute, so the white skin gets stops pulled
   toward black from whatever gold the brand set: still one metallic family,
   now with something to see. Derived, so every brand gets its own. */
:root[data-theme="light"] #navGoldGrad stop:nth-child(1) { stop-color: color-mix(in srgb, var(--gold) 72%, #1a1400); }
:root[data-theme="light"] #navGoldGrad stop:nth-child(2) { stop-color: var(--gold-ink); }
:root[data-theme="light"] #navGoldGrad stop:nth-child(3) { stop-color: color-mix(in srgb, var(--gold) 34%, #1a1400); }

/* The income tax tags (finance.js taxChip). The tag colour is mixed toward
   the text colour so it reads on the dark skin; on white the gold one fell
   below AA contrast. Mixed much harder toward the text colour here, the same
   reasoning as --gold-ink for gold text on white. Found by review. */
:root[data-theme="light"] .res-tax { color: color-mix(in srgb, var(--tax-c, var(--text-secondary)) 42%, var(--text-primary)); }
