/* TLG theme layer — Fix 10 (2026-11-13). Light theme for the whole site.
   Dark is the default and the locked design; this file only adds the light
   layer, keyed on html[data-theme="light"], which the inline head init sets
   before first paint from the visitor's stored choice (localStorage
   tlg.theme.v1, cookie mirror tlg_theme). Fix 33 (2026-11-16, owner
   directive): with no stored choice the default follows the device setting
   (prefers-color-scheme), dark only when no preference can be detected; a
   stored choice still always wins. (Supersedes the 2026-11-13 ruling's
   always-dark default.)

   Architecture (Fix 10 audit + Claude design review, both binding):
   - The build is variable-driven; the light theme is a second variable layer
     over the DS tokens + tlg-locks.css values. This file loads AFTER
     tlg-locks.css and tlg-ambience.css in every route document.
   - tlg-ambience.css forces surface-panel sections dark with !important, and
     TlgOS.js injects html,body{background:#0A0A0C !important} plus dark scoop
     section gradients at runtime. Every rule below that answers one of those
     carries strictly higher specificity (the html[data-theme="light"] prefix)
     so it wins regardless of stylesheet order.
   - Baked snapshot colors cannot flip (the snapshot is replaced by the live
     tree at hydration); the pre-hydration instant is a named residual in the
     Fix 10 report, not hidden.
   - Fix 21 (2026-11-15, owner correction): the light page FIELD is now
     #ECEEF3 (cool off-white); Pearl #F8F9FF remains only on surfaces
     (.tlg-glass base, --surface-glass) so cards sit brighter than the field.
   - Fix 23 (2026-11-15, owner-approved medallion fix): Fix 21 passed every
     measured gate and the owner still judged light mode not good — the
     brand layer (emblem, orbs, aurora) was rendered in tints that vanish
     on a light field. The emblem now rides an Onyx medallion in the holo
     engine (both themes) and runs its full palette in light; this layer
     deepens the field one more step (#ECEEF3 -> #E4E7EF), raises the
     aurora wash so colour actually shows, and gives light cards, hairlines
     and ghost numerals real definition so surfaces separate from the page.
   - Contrast (measured on Pearl #F8F9FF / depth #EEF0F7): pure Aurora Teal
     #42F5E6 as text on light is 1.29:1, Signal Gold #FFD84D is 1.32:1,
     Aurora Violet #9D5CFF is 3.70:1. Small accent text therefore uses ink
     derivatives: --accent-ink #0E6B62 (6.06 / 5.59), --gold-ink #7A5C00
     (5.95 / 5.49), --violet-ink #7C3AED (5.42 / 5.00). The pure locked tokens
     still carry every fill, glow, gradient stop on dark surfaces, and the
     emblem. The ink values are accessibility derivatives, not brand tokens. */

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

/* ---------- variable layer ---------- */
html[data-theme="light"] {
  --black: #E4E7EF;
  --onyx: #E4E7EF;
  --midnight: #E8EBF2;
  --emerald: #E9F1EE;
  --surface-page: #E4E7EF;
  --surface-card: linear-gradient(180deg, rgba(10,10,12,.065), rgba(10,10,12,.025));
  --surface-panel: rgba(10,10,12,.05);
  --surface-sunken: rgba(10,10,12,.05);
  --surface-glass: rgba(248,249,255,.97);
  --surface-tint-teal: rgba(14,107,98,.07);
  --surface-tint-gold: rgba(122,92,0,.06);
  --text-strong: #0A0A0C;
  --text-body: #2A3138;
  --text-soft: #333B44;
  --text-dim: #45505A;
  --text-muted: #55616C;
  --text-faint: #626D77;
  --muted: #55616C;
  /* Fix 27 (2026-11-16, owner: light borders/trim still invisible): the
     border ladder is raised to measured floors against the field #E4E7EF
     and Pearl — hair .40 (2.63 / 2.69, decorative floor 2.5), soft .46
     (3.13 / 3.23, structural floor 3), strong .55 (4.15 / 4.34), teal .75
     (3.25 / 3.61). Gold trim leaves the olive ink for the emblem's own
     brand-hue gold (148,123,44, hue 46.9° = Signal Gold's angle) at .95
     (3.09 / 3.59): the gold boxes read as gold, with an edge. */
  --border-hair: rgba(10,10,12,.40);
  --border-soft: rgba(10,10,12,.46);
  --border-strong: rgba(10,10,12,.55);
  --border-teal: rgba(14,107,98,.75);
  --border-gold: rgba(148,123,44,.95);
  --accent: #0E6B62;
  --accent-ink: #0E6B62;
  --gold-ink: #7A5C00;
  --violet-ink: #7C3AED;
  --focus-ring: rgba(14,107,98,.30);
  --aurora-glow:
    radial-gradient(45% 55% at 30% 30%, rgba(66,245,230,.17), transparent 70%),
    radial-gradient(40% 50% at 70% 35%, rgba(157,92,255,.12), transparent 70%);
  --danger: #D92D20;
  --danger-text: #B3261E;
  --ok: #0E6B62;
}

/* ---------- page base (answers TlgOS's injected !important body rule) ---------- */
html[data-theme="light"],
html[data-theme="light"] body { background: #E4E7EF !important; background-image: none !important; }
html[data-theme="light"] body { color: #2A3138; }

/* Page roots that carry the dark theme's base inline (background #0A0A0C,
   color Pearl): without this, every descendant without its own color
   inherits pearl and vanishes on the light page. */
/* FIX 23: background transparent, NOT the field color. The shell (TlgOS) keeps view
   roots transparent so the fixed holo canvas paints through them; the opaque field
   here (Fix 21) buried the canvas on Home, the one view whose root spans the full
   page, and hid the hero emblem in light mode. The field still reads #E4E7EF:
   body paints var(--surface-page) beneath everything. The color half stays. */
html[data-theme="light"] [data-tlg-root] { background: transparent !important; color: #2A3138 !important; }

/* ---------- ambience mirrors ---------- */
/* surface-panel sections: ambience forces rgba(10,10,12,.72) !important in dark. */
html[data-theme="light"] section[style*="background: var(--surface-panel)"] { background: rgba(248,249,255,.80) !important; }

/* Solid dark sections (the #05060e / var(--black) class): ambience already
   makes them transparent in dark so the body shows; in light the body is
   Pearl, so transparent is again the right answer. Both serializations are
   covered (source hex/var forms and baked rgb forms). */
html[data-theme="light"] section[style*="background: #05060e"],
html[data-theme="light"] section[style*="background:#05060e"],
html[data-theme="light"] section[style*="background: var(--black)"],
html[data-theme="light"] section[style*="background: rgb(5, 6, 14)"],
html[data-theme="light"] section[style*="background-color: rgb(5, 6, 14)"],
html[data-theme="light"] section[style*="background: rgb(10, 10, 12)"],
html[data-theme="light"] section[style*="background-color: rgb(10, 10, 12)"] { background: transparent !important; }

/* TlgOS scoop sections (dark gradients, !important, injected at runtime). */
@media (min-width: 980px) {
  html[data-theme="light"] main section[data-tlg-scoop="odd"],
  html[data-theme="light"] main section[data-tlg-scoop="even"] { background: transparent !important; }
}
@media (max-width: 979.98px) {
  html[data-theme="light"] main section[data-tlg-scoop="odd"],
  html[data-theme="light"] main section[data-tlg-scoop="even"] { background: linear-gradient(180deg, rgba(219,222,232,.92), rgba(228,231,239,.68)) !important; }
}
/* section top hairlines (TlgOS paints a pearl-alpha line).
   Fix 23: deepened one step (.08 -> .13) so page structure reads.
   Fix 27: .13 still measured 1.3:1 on the field; raised to .40 (2.63:1),
   the decorative floor this pass enforces. */
html[data-theme="light"] main > section,
html[data-theme="light"] main > div > section,
html[data-theme="light"] main > x-import > section { box-shadow: 0 -1px 0 rgba(10,10,12,.40); }

/* ---------- gradient headline text ---------- */
/* Clipped-gradient headings, in both serializations: the live React form
   carries "background-clip: text" as its own declaration; the baked form
   carries the shorthand "background: linear-gradient(...) text;". The
   deepened gradient keeps every stop at or above 5:1 on the light surfaces
   (large text needs 3:1), and at or above 3.1:1 even where a heading sits
   on a band that stays dark. */
html[data-theme="light"] [style*="background-clip: text"],
html[data-theme="light"] [style*=") text;"] {
  background-image: linear-gradient(100deg, #0E6B62 0%, #0E6B62 55%, #7C3AED 100%) !important;
}

/* Page titles whose plain (non-gradient) part inherits the dark theme's
   pearl from a hero wrapper take the onyx title color in light. Gradient
   spans inside keep their transparent fill and the deepened gradient. */
html[data-theme="light"] h1 { color: #0A0A0C !important; }

/* ---------- literal text colors that cannot flip by variable ---------- */
/* gold small text */
html[data-theme="light"] [style*="color: var(--gold)"],
html[data-theme="light"] [style*="; color: rgb(255, 216, 77)"],
html[data-theme="light"] [style^="color: rgb(255, 216, 77)"] { color: #7A5C00 !important; }
/* teal small text (literals; var(--accent) text flips with the variable) */
html[data-theme="light"] [style*="color: var(--teal)"],
html[data-theme="light"] [style*="color: #42F5E6"],
html[data-theme="light"] [style*="color: #42f5e6"],
html[data-theme="light"] [style*="; color: rgb(66, 245, 230)"],
html[data-theme="light"] [style^="color: rgb(66, 245, 230)"] { color: #0E6B62 !important; }
/* pale violet text */
html[data-theme="light"] [style*="color: #C9A8FF"],
html[data-theme="light"] [style*="color: #c9a8ff"],
html[data-theme="light"] [style*="; color: rgb(201, 168, 255)"],
html[data-theme="light"] [style^="color: rgb(201, 168, 255)"] { color: #7C3AED !important; }
/* dark-theme grays used as text (baked rgb forms and source hex forms) */
html[data-theme="light"] [style*="; color: rgb(135, 150, 164)"],
html[data-theme="light"] [style^="color: rgb(135, 150, 164)"] { color: #45505A !important; }
html[data-theme="light"] [style*="; color: rgb(154, 171, 184)"],
html[data-theme="light"] [style^="color: rgb(154, 171, 184)"],
html[data-theme="light"] [style*="; color: rgb(152, 168, 181)"],
html[data-theme="light"] [style^="color: rgb(152, 168, 181)"] { color: #55616C !important; }
html[data-theme="light"] [style*="; color: rgb(186, 199, 209)"],
html[data-theme="light"] [style^="color: rgb(186, 199, 209)"],
html[data-theme="light"] [style*="; color: rgb(194, 204, 213)"],
html[data-theme="light"] [style^="color: rgb(194, 204, 213)"],
html[data-theme="light"] [style*="; color: rgb(196, 210, 221)"],
html[data-theme="light"] [style^="color: rgb(196, 210, 221)"],
html[data-theme="light"] [style*="; color: rgb(197, 208, 216)"],
html[data-theme="light"] [style^="color: rgb(197, 208, 216)"],
html[data-theme="light"] [style*="color: #C5D0D8"],
html[data-theme="light"] [style*="color: #BAC7D1"] { color: #45505A !important; }
html[data-theme="light"] [style*="; color: rgb(127, 144, 159)"],
html[data-theme="light"] [style^="color: rgb(127, 144, 159)"],
html[data-theme="light"] [style*="; color: rgb(110, 126, 139)"],
html[data-theme="light"] [style^="color: rgb(110, 126, 139)"],
html[data-theme="light"] [style*="color: #6E7E8B"],
html[data-theme="light"] [style*="; color: rgb(155, 171, 183)"],
html[data-theme="light"] [style^="color: rgb(155, 171, 183)"],
html[data-theme="light"] [style*="color: #9AABB8"],
html[data-theme="light"] [style*="color: #98A8B5"] { color: #55616C !important; }
/* Fix 16 addition: the Pathfinder route-box labels (#61737F) were the one
   slate literal this battery missed; on the light glass they measured
   4.32:1 analytically (9px labels, AA floor 4.5). Same treatment as the
   sibling slates above. */
html[data-theme="light"] [style*="; color: rgb(97, 115, 127)"],
html[data-theme="light"] [style^="color: rgb(97, 115, 127)"],
html[data-theme="light"] [style*="color: #61737F"] { color: #55616C !important; }

/* Pearl-literal text (the dark theme's primary text color used as a literal):
   in light it takes the onyx title color. Protected exceptions: footer
   links (the footer's own higher-specificity rules win), and pearl-text
   controls carrying their own dark background (the counter-rule below the
   ghost rule, higher specificity still). */
html[data-theme="light"] [style*="color: #F8F9FF"],
html[data-theme="light"] [style*="color:#F8F9FF"],
html[data-theme="light"] [style*="; color: rgb(248, 249, 255)"],
html[data-theme="light"] [style^="color: rgb(248, 249, 255)"] { color: #0A0A0C !important; }

/* Ghost buttons and links inside page content carry pearl text for the dark
   theme; on light surfaces they take onyx with a visible outline. Scoped to
   <main> so the footer (which flips to a dark panel) and the nav (which
   handles its own colors) are untouched. */
html[data-theme="light"] main a[style*="color: rgb(248, 249, 255)"],
html[data-theme="light"] main a[style*="color: #F8F9FF"],
html[data-theme="light"] main a[style*="color: var(--pearl)"],
html[data-theme="light"] main button[style*="color: rgb(248, 249, 255)"],
html[data-theme="light"] main button[style*="color: #F8F9FF"] { color: #0A0A0C !important; border-color: rgba(10,10,12,.55) !important; }
/* Counter-rule: pearl-text controls that carry their OWN dark background
   (dark pill buttons, e.g. the Resume page's report link on its gold card)
   keep their dark pill and their pearl text. Higher attribute specificity
   than the ghost rule above, so it wins regardless of order. Scoped to
   genuinely dark backgrounds only: a tinted chip (e.g. a teal-alpha
   pathfinder tab) is NOT a dark pill and must flip with the battery. */
html[data-theme="light"] main a[style*="background: #0A0A0C"][style*="color: #F8F9FF"],
html[data-theme="light"] main a[style*="background: rgb(10, 10, 12)"][style*="color: rgb(248, 249, 255)"],
html[data-theme="light"] main button[style*="background: #0A0A0C"][style*="color: #F8F9FF"],
html[data-theme="light"] main button[style*="background: rgb(10, 10, 12)"][style*="color: rgb(248, 249, 255)"] { color: #F8F9FF !important; }

/* Dark glass chips and panels (inline rgba(10,10,12,alpha) backgrounds)
   become pearl glass in light; their muted text, deepened by the battery
   above, stays readable on it. Gradient backgrounds are untouched (only
   the color under them changes, which a gradient covers). */
html[data-theme="light"] [style*="background: rgba(10, 10, 12, 0."],
html[data-theme="light"] [style*="background: rgba(10,10,12,."],
html[data-theme="light"] [style*="background-color: rgba(10, 10, 12, 0."],
html[data-theme="light"] [style*="background-color: rgba(10,10,12,."] { background-color: rgba(248,249,255,.88) !important; }

/* ---------- the logo on light ---------- */
/* tlg-logo.png is a transparent PNG whose "THE LOVE GROUP" tagline is
   near-white; on Pearl it vanishes. Every logo placement (nav, footer,
   404) therefore carries two artworks: tlg-logo.png for dark mode and
   tlg-logo-light.png for light mode, the identical lockup with the
   tagline in Onyx. The light artwork is hidden by default; in light
   mode the dark artwork is hidden and the light one shown, no plate. */
.tlg-logo-light { display: none !important; }
html[data-theme="light"] .tlg-logo-dark { display: none !important; }
html[data-theme="light"] .tlg-logo-light { display: block !important; }
html[data-theme="light"] img.logo.tlg-logo-light { display: inline !important; }

/* ---------- footer (live component and baked copies share inline styles) ---------- */
html[data-theme="light"] footer[data-tlg-footer] {
  background: linear-gradient(180deg, rgba(248,249,255,.94), #E8EBF2) !important;
  color: #45505A !important;
  /* Fix 27: the footer top trim at .28 measured 1.49:1; .75 is the
     structural teal this pass standardizes on (3.25:1 on the field). */
  border-top-color: rgba(14,107,98,.75) !important;
  box-shadow: 0 -1px 0 rgba(10,10,12,.06), 0 -24px 60px -30px rgba(14,107,98,.20) !important;
}
html[data-theme="light"] footer[data-tlg-footer] a { color: #0E6B62 !important; }
html[data-theme="light"] footer[data-tlg-footer] nav a,
html[data-theme="light"] footer[data-tlg-footer] > div:last-child a { color: #45505A !important; }
html[data-theme="light"] footer[data-tlg-footer] span[aria-hidden="true"] { background: rgba(10,10,12,.40) !important; }
html[data-theme="light"] footer[data-tlg-footer] > div:last-child { border-top-color: rgba(10,10,12,.40) !important; }
/* Fix 27: the legal row's own divider carries a pearl .07 inline border
   that no variable reaches; on the light footer it vanished. */
html[data-theme="light"] footer[data-tlg-footer] [style*="border-top: 1px solid rgba(248, 249, 255, 0.07)"] { border-top-color: rgba(10,10,12,.40) !important; }

/* ---------- TlgOS HUD (aria-hidden OS readout chip; inline styles) ---------- */
html[data-theme="light"] #tlg-os-hud {
  background: rgba(248,249,255,.90) !important;
  border-color: rgba(14,107,98,.75) !important;
  color: #55616C !important;
  box-shadow: 0 16px 40px -20px rgba(10,10,12,.35) !important;
}
html[data-theme="light"] #tlg-os-hud span { color: #45505A !important; }
html[data-theme="light"] #tlg-os-hud span:first-child { color: #0E6B62 !important; }
html[data-theme="light"] #tlg-os-hud i { background: #0E6B62 !important; box-shadow: 0 0 8px rgba(14,107,98,.8) !important; }

/* ---------- compact hub band (PageFrame aside, inline dark gradient) ---------- */
html[data-theme="light"] aside:has(> canvas) {
  background: linear-gradient(180deg, #F8F9FF 0%, #F8F9FF 78%, rgba(248,249,255,0) 100%) !important;
}

/* ---------- form controls in light (Fix N1, Board Audit Round 2) ---------- */
/* The DS Field paints control text var(--pearl) inline, and --pearl is a
   dark-theme literal this layer never redefines, so typed text sat at
   ~1.1:1 on the light sunken field (invisible). Typed and selected text
   takes the onyx strong-text value, placeholders the faint-text value
   (opacity forced for Firefox), the native dropdown list gets an explicit
   option pairing, and the control border at the strengthened
   --border-strong value (Fix 27: .42 measured 2.78:1; .55 measures
   4.15:1 on the field) so the edge reads against both page and field
   fill. The border rule is scoped to the DS border variable so a field
   in its error state keeps its danger border. Dark mode is untouched. */
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select { color: #0A0A0C !important; caret-color: #0A0A0C; }
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #626D77 !important; opacity: 1; }
html[data-theme="light"] input[style*="var(--border-strong)"],
html[data-theme="light"] textarea[style*="var(--border-strong)"],
html[data-theme="light"] select[style*="var(--border-strong)"] { border-color: rgba(10,10,12,.55) !important; }
html[data-theme="light"] select option { color: #0A0A0C; background-color: #F8F9FF; }

/* ---------- focus visibility (no module shipped :focus-visible rules) ---------- */
/* Both themes carry !important: the DS Field sets inline outline: none on
   every control, which beats a non-important stylesheet rule and left
   keyboard focus invisible in dark mode (WCAG 2.4.7, Round 2 item #8). */
html[data-theme="light"] :focus-visible { outline: 2px solid #0E6B62 !important; outline-offset: 2px; }
html[data-theme="dark"] :focus-visible { outline: 2px solid rgba(66,245,230,.75) !important; outline-offset: 2px; }

/* ---------- print: force the light rendering on paper ---------- */
@media print {
  html[data-theme="dark"] body, html[data-theme="dark"] main section {
    background: #FFFFFF !important; background-image: none !important;
  }
  html[data-theme="dark"] body, html[data-theme="dark"] h1, html[data-theme="dark"] h2,
  html[data-theme="dark"] h3, html[data-theme="dark"] h4, html[data-theme="dark"] p,
  html[data-theme="dark"] li, html[data-theme="dark"] span, html[data-theme="dark"] a {
    color: #14181D !important; -webkit-text-fill-color: #14181D !important;
  }
}

/* ---------- pre-hydration snapshot in light (fleet pass, Round 2 residual a) ---------- */
/* The baked snapshot plate (#tlg-prerender) carries an inline #0A0A0C
   background and its own baked header gradient; the light battery above
   flips its text but never touched the plate, leaving dark-on-dark before
   the swap on every route but Home. The wrapper/header backgrounds are
   non-important inline styles, so this layer closes the gap: Pearl plate,
   light header glass, snapshot nav labels in the light text ramp (the
   active label keeps the onyx the nav's own injected light rule gives it,
   now readable on the light header). */
html[data-theme="light"] #tlg-prerender { background: #E4E7EF !important; }
html[data-theme="light"] #tlg-prerender header {
  background: linear-gradient(rgba(248,249,255,.88), rgba(248,249,255,.55)) !important;
  box-shadow: inset 0 1px 0 rgba(10,10,12,.04) !important;
}
html[data-theme="light"] #tlg-prerender .tlgnav-l { color: #2A3138 !important; }
html[data-theme="light"] #tlg-prerender .tlgnav-l[aria-current="page"] { color: #0A0A0C !important; }

/* ---------- snapshot supporting text in light (owner contrast pass, 2026-11-26) ---------- */
/* Owner review of the light snapshot: the supporting text washed out
   on the Pearl field. The general light battery above maps the baked
   gray literals to #45505A (primary body) and #55616C (secondary text
   and small labels). On this surface only, the owner prescribes a
   deeper slate ramp: primary body #334155, secondary text #475569,
   small labels and footer #475569. The ID scope confines the deeper
   ramp to the baked snapshot layer; the settled live pages keep the
   battery values. The Pearl background, the brand colors, and dark
   mode are untouched. The footer description literal rgb(159, 176,
   189) is the one baked gray the battery never mapped (it rendered
   #9FB0BD, about 1.9:1 on the light footer); as footer text it takes
   #475569 here. The legal row's muted spans carry no inline color of
   their own, so the row is named structurally. */
html[data-theme="light"] #tlg-prerender [style*="; color: rgb(135, 150, 164)"],
html[data-theme="light"] #tlg-prerender [style^="color: rgb(135, 150, 164)"],
html[data-theme="light"] #tlg-prerender [style*="; color: rgb(186, 199, 209)"],
html[data-theme="light"] #tlg-prerender [style^="color: rgb(186, 199, 209)"],
html[data-theme="light"] #tlg-prerender [style*="; color: rgb(194, 204, 213)"],
html[data-theme="light"] #tlg-prerender [style^="color: rgb(194, 204, 213)"],
html[data-theme="light"] #tlg-prerender [style*="; color: rgb(196, 210, 221)"],
html[data-theme="light"] #tlg-prerender [style^="color: rgb(196, 210, 221)"],
html[data-theme="light"] #tlg-prerender [style*="; color: rgb(197, 208, 216)"],
html[data-theme="light"] #tlg-prerender [style^="color: rgb(197, 208, 216)"],
html[data-theme="light"] #tlg-prerender [style*="color: #C5D0D8"],
html[data-theme="light"] #tlg-prerender [style*="color: #BAC7D1"] { color: #334155 !important; }
html[data-theme="light"] #tlg-prerender [style*="; color: rgb(154, 171, 184)"],
html[data-theme="light"] #tlg-prerender [style^="color: rgb(154, 171, 184)"],
html[data-theme="light"] #tlg-prerender [style*="; color: rgb(152, 168, 181)"],
html[data-theme="light"] #tlg-prerender [style^="color: rgb(152, 168, 181)"],
html[data-theme="light"] #tlg-prerender [style*="; color: rgb(127, 144, 159)"],
html[data-theme="light"] #tlg-prerender [style^="color: rgb(127, 144, 159)"],
html[data-theme="light"] #tlg-prerender [style*="; color: rgb(110, 126, 139)"],
html[data-theme="light"] #tlg-prerender [style^="color: rgb(110, 126, 139)"],
html[data-theme="light"] #tlg-prerender [style*="color: #6E7E8B"],
html[data-theme="light"] #tlg-prerender [style*="; color: rgb(155, 171, 183)"],
html[data-theme="light"] #tlg-prerender [style^="color: rgb(155, 171, 183)"],
html[data-theme="light"] #tlg-prerender [style*="color: #9AABB8"],
html[data-theme="light"] #tlg-prerender [style*="color: #98A8B5"],
html[data-theme="light"] #tlg-prerender [style*="; color: rgb(97, 115, 127)"],
html[data-theme="light"] #tlg-prerender [style^="color: rgb(97, 115, 127)"],
html[data-theme="light"] #tlg-prerender [style*="color: #61737F"],
html[data-theme="light"] #tlg-prerender [style*="; color: rgb(159, 176, 189)"],
html[data-theme="light"] #tlg-prerender [style^="color: rgb(159, 176, 189)"] { color: #475569 !important; }
html[data-theme="light"] #tlg-prerender footer[data-tlg-footer] > div:last-child span { color: #475569 !important; }
/* Footer link restoration: the primary literal group above also
   matches the baked footer links (they carry rgb(135, 150, 164)),
   but the owner named no footer link; they were not weak (#45505A
   at about 6.9:1, the Client Portals link teal #0E6B62 by design).
   These two rules re-declare the theme's own footer link values
   with the snapshot scope added, so inside the snapshot footer the
   links keep exactly their prior colors and only the named footer
   text (description, legal row) takes the deeper ramp. */
html[data-theme="light"] #tlg-prerender footer[data-tlg-footer] a { color: #0E6B62 !important; }
html[data-theme="light"] #tlg-prerender footer[data-tlg-footer] nav a,
html[data-theme="light"] #tlg-prerender footer[data-tlg-footer] > div:last-child a { color: #45505A !important; }
html[data-theme="light"] #tlg-prerender footer[data-tlg-footer] nav span { color: #45505A !important; }

/* ---------- settled live pages: supporting text in light (owner contrast extension, 2026-11-26) ---------- */
/* The snapshot pass above deepened the supporting text on the baked
   snapshot layer only, on the owner's surface scoping. The settled
   live pages carry the same battery values (#45505A primary, #55616C
   secondary), so a visitor read deepened text during load and paler
   text after hydration. The owner directed the same correction onto
   the settled pages: the identical literal groups, at the battery's
   own specificity and later in the file, so the deeper ramp governs
   exactly the elements the battery paints on the live tree. Inside
   the snapshot the ID-scoped rules above keep their (identical)
   values. Elements governed by stronger component rules (the glass
   tabs, the footer links, whose own footer rules outrank this
   specificity) keep their existing colors. The footer description
   literal rgb(159, 176, 189), unmapped by the battery, takes #475569
   as footer text, and the legal row's spans are named structurally,
   mirroring the snapshot block. Backgrounds, gradients, the Pearl
   field, brand colors, and dark mode are untouched. */
html[data-theme="light"] [style*="; color: rgb(135, 150, 164)"],
html[data-theme="light"] [style^="color: rgb(135, 150, 164)"],
html[data-theme="light"] [style*="; color: rgb(186, 199, 209)"],
html[data-theme="light"] [style^="color: rgb(186, 199, 209)"],
html[data-theme="light"] [style*="; color: rgb(194, 204, 213)"],
html[data-theme="light"] [style^="color: rgb(194, 204, 213)"],
html[data-theme="light"] [style*="; color: rgb(196, 210, 221)"],
html[data-theme="light"] [style^="color: rgb(196, 210, 221)"],
html[data-theme="light"] [style*="; color: rgb(197, 208, 216)"],
html[data-theme="light"] [style^="color: rgb(197, 208, 216)"],
html[data-theme="light"] [style*="color: #C5D0D8"],
html[data-theme="light"] [style*="color: #BAC7D1"] { color: #334155 !important; }
html[data-theme="light"] [style*="; color: rgb(154, 171, 184)"],
html[data-theme="light"] [style^="color: rgb(154, 171, 184)"],
html[data-theme="light"] [style*="; color: rgb(152, 168, 181)"],
html[data-theme="light"] [style^="color: rgb(152, 168, 181)"],
html[data-theme="light"] [style*="; color: rgb(127, 144, 159)"],
html[data-theme="light"] [style^="color: rgb(127, 144, 159)"],
html[data-theme="light"] [style*="; color: rgb(110, 126, 139)"],
html[data-theme="light"] [style^="color: rgb(110, 126, 139)"],
html[data-theme="light"] [style*="color: #6E7E8B"],
html[data-theme="light"] [style*="; color: rgb(155, 171, 183)"],
html[data-theme="light"] [style^="color: rgb(155, 171, 183)"],
html[data-theme="light"] [style*="color: #9AABB8"],
html[data-theme="light"] [style*="color: #98A8B5"],
html[data-theme="light"] [style*="; color: rgb(97, 115, 127)"],
html[data-theme="light"] [style^="color: rgb(97, 115, 127)"],
html[data-theme="light"] [style*="color: #61737F"],
html[data-theme="light"] [style*="; color: rgb(159, 176, 189)"],
html[data-theme="light"] [style^="color: rgb(159, 176, 189)"] { color: #475569 !important; }
html[data-theme="light"] footer[data-tlg-footer] > div:last-child span { color: #475569 !important; }

/* The snapshot header was baked with the light glass gradient as an
   inline style, so in dark mode the pearl band survived at the top of
   the dark page: its baked Pearl labels and the dark artwork's
   near-white tagline both washed out on it. The light pass above has
   no dark counterpart; this rule gives the snapshot header the live
   dark header's own gradient (measured at the top of the page), so
   the baked labels and the tagline read in dark before the swap. */
html[data-theme="dark"] #tlg-prerender header {
  background: linear-gradient(rgba(10,10,12,.7), rgba(10,10,12,.35)) !important;
  box-shadow: inset 0 1px 0 rgba(248,249,255,.04) !important;
}

/* Snapshot stat numerals whose baked gradient serialized empty
   (background-image: ; with background-clip: text and transparent fill)
   render invisible in dark before the swap (Round 2 item N5). Give the
   snapshot copies a solid teal fill in dark; the live tree is untouched
   and light already re-gradients them via the battery above. */
html[data-theme="dark"] #tlg-prerender [style*="background-image: ;"] {
  color: #42F5E6 !important; -webkit-text-fill-color: #42F5E6 !important;
}

/* ---------- light glass (Fix 16, Claude design spec 2026-11-14) ---------- */
/* L0 head fix. TlgOS paints every card/panel surface (.tlg-glass) as a dark
   background-image gradient !important; the layers above flipped variables,
   background-color and text, but background-image paints ABOVE
   background-color, so in light mode every glass surface stayed charcoal
   (measured painted luminance 0.01) under flipped dark text. This section
   gives the glass a designed light treatment from the design seat's spec
   ("frosted porcelain": white falling to the depth tone, the sibling of the
   dark glass's charcoal-to-Onyx falloff — not an inversion). Every rule is
   keyed on html[data-theme="light"]; dark is untouched. The consent card is
   not part of this system (#tlg-consent carries its own classes and its own
   light rule in TlgConsent.js) and no rule here reaches it. */
html[data-theme="light"] .tlg-glass {
  background-color: #F8F9FF !important; /* fixed backdrop: deterministic contrast on any section */
  background-image: linear-gradient(160deg,
    rgba(255,255,255,.94) 0%,
    rgba(246,247,252,.90) 45%,
    rgba(235,238,244,.92) 100%) !important;
  /* border-color deliberately left alone: the corner-cut rule keeps it
     transparent and the ::after frame below carries the visible edge. */
  /* Fix 23: a crisper near shadow and a deeper ambient drop, so the card
     reads as a defined surface on the deepened field, not a float. */
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -1px 0 rgba(10,10,12,.06),
    0 1px 0 rgba(14,107,98, calc(.25 + var(--lit, 0) * .25)),
    0 2px 6px rgba(10,10,12,.10),
    0 18px 44px -22px rgba(10,10,12, calc(.32 + var(--lit, 0) * .10)),
    0 26px 60px -30px rgba(14,107,98, calc(.14 + var(--lit, 0) * .18))
    !important;
}
/* The ::after 1px frame, re-inked for light (teal opening, ink middle,
   violet and gold-ink closing, --lit scaling preserved in form).
   Fix 23: every stop deepened one step — this frame IS the card's visible
   border in light mode, and at the old alphas cards dissolved into the
   field.
   Fix 27: measured stop by stop against the glass surface, the Fix 23
   stops still fell short (ink middle 1.4:1, violet 2.35:1, gold 2.33:1).
   Every stop now meets the decorative floor at rest (--lit 0) and the
   structural stops pass 3:1: teal .78 (3.63), ink .40 / .38 (2.66 /
   2.51), violet .75 (3.32), and the closing stop is the emblem's own
   brand-hue gold (148,123,44) at .90 (3.28), so card trim and the mark
   share one gold. */
html[data-theme="light"] .tlg-glass::after {
  background: linear-gradient(135deg,
    rgba(14,107,98, calc(.78 + var(--lit, 0) * .22)) 0%,
    rgba(10,10,12, calc(.40 + var(--lit, 0) * .05)) 22%,
    rgba(10,10,12, .38) 55%,
    rgba(124,58,237, calc(.75 + var(--lit, 0) * .20)) 82%,
    rgba(148,123,44, calc(.90 + var(--lit, 0) * .10)) 100%) !important;
}
/* Sheen: kept, but the specular spot is white (it can only raise the
   surface luminance, never cut text contrast); pointer vars are --lx/--ly. */
html[data-theme="light"] .tlg-glass::before {
  background:
    radial-gradient(460px circle at var(--lx, 50%) var(--ly, -40%),
      rgba(255,255,255, calc(.35 + var(--lit, 0) * .40)), transparent 46%),
    linear-gradient(118deg, rgba(255,255,255,.70) 0%, transparent 24%, transparent 72%, rgba(255,255,255,0) 100%) !important;
}
/* Nested glass (e.g. AWS detail rows inside a glass card): stop stacked
   drops from muddying. */
html[data-theme="light"] .tlg-glass .tlg-glass {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -1px 0 rgba(10,10,12,.06),
    0 1px 2px rgba(10,10,12,.05) !important;
}
/* A pure Aurora Teal focus ring is ~1.2:1 on light; glass content takes
   the deepened-teal ring (the layer-wide rule above already sets this for
   light generally; restated at glass scope per the spec). */
html[data-theme="light"] .tlg-glass :focus-visible {
  outline: 2px solid #0E6B62 !important;
  outline-offset: 2px;
}
/* Advisory / TLG AI lane tabs (they live inside the glass card): the glass
   flip restores legibility; the selected state gets its own light
   treatment per the spec. */
html[data-theme="light"] .tlg-glass [role="tab"] {
  color: #45505A !important;
  background: transparent !important;
  border-color: rgba(10,10,12,.40) !important;
}
html[data-theme="light"] .tlg-glass [role="tab"]:hover {
  color: #0A0A0C !important;
  background: rgba(10,10,12,.04) !important;
}
html[data-theme="light"] .tlg-glass [role="tab"][aria-selected="true"] {
  color: #0A0A0C !important;
  background: rgba(14,107,98,.10) !important;
  border-color: rgba(14,107,98,.75) !important;
  box-shadow: inset 0 -2px 0 #0E6B62 !important;
}
/* Pathfinder panel's outline action (the one anchor inside the glass
   tabpanel): deepened-teal on a white lift, solid border (a .60-alpha
   border tests ~2.6:1, below the 3:1 non-text floor); hover inverts. */
html[data-theme="light"] #pathfinder [role="tabpanel"] a {
  color: #0E6B62 !important;
  background: rgba(255,255,255,.70) !important;
  border: 1px solid #0E6B62 !important;
}
html[data-theme="light"] #pathfinder [role="tabpanel"] a:hover {
  color: #F8F9FF !important;
  background: #0E6B62 !important;
}
/* Ghost section numerals: the pure-teal 1px stroke (.22) nearly vanishes
   on Pearl. Deepened teal at .28 keeps the same quiet visual weight the
   dark stroke has on Onyx; width unchanged.
   Fix 23: one step deeper again (.28 -> .38) on the deepened field, so the
   numeral registers as structure at a glance. */
html[data-theme="light"] main section[data-tlg-ghost]::before {
  -webkit-text-stroke: 1px rgba(14,107,98,.38) !important;
}
/* Home hero at desktop widths (diagnosis L12): the emblem anchors
   low/right and the right half read as an empty pale wash. Theme-layer
   only, Home-scoped via its [data-tlg-home] wrapper: three quiet light
   pools behind the emblem's half (pure tokens are decorative here and sit
   away from the headline column), plus the emblem canvas gets a soft teal
   drop-shadow and a saturation lift. The canvas filter is desktop-only so
   mobile compositing (the emblem engine's scroll behavior) is untouched. */
html[data-theme="light"] [data-tlg-home] section#top {
  background-image:
    radial-gradient(42% 58% at 74% 62%, rgba(66,245,230,.22) 0%, rgba(66,245,230,0) 70%),
    radial-gradient(30% 40% at 86% 34%, rgba(157,92,255,.14) 0%, rgba(157,92,255,0) 70%),
    radial-gradient(26% 30% at 64% 82%, rgba(255,216,77,.13) 0%, rgba(255,216,77,0) 70%) !important;
}
@media (min-width: 980px) {
  html[data-theme="light"] aside > canvas {
    filter: drop-shadow(0 24px 48px rgba(14,107,98,.22)) saturate(1.15);
  }
}
/* Calendar card's own dark fill (L0 sub-instance): the Contact "Select a
   day" card is a div carrying inline background #05060e (serialized
   rgb(5, 6, 14)); the battery above neutralizes that value on sections
   only. Extended here to the card, scoped to #schedule: an unscoped
   any-element extension would also strip intentional dark chips carrying
   the same fill (e.g. the Partners monogram tiles, whose aurora-clipped
   glyphs need the dark chip). The card is glass-free; with the fill
   neutralized it sits on the flipped section surface like its sibling
   card. Both serializations covered, live tree and baked snapshots. */
html[data-theme="light"] #schedule div[style*="background: #05060e"],
html[data-theme="light"] #schedule div[style*="background:#05060e"],
html[data-theme="light"] #schedule div[style*="background: rgb(5, 6, 14)"],
html[data-theme="light"] #schedule div[style*="background-color: rgb(5, 6, 14)"] { background: transparent !important; }

/* ---------- Fix 27 (2026-11-16): the literal border battery ---------- */
/* The variable ladder above cannot reach borders written as literal
   colors in the views. On light surfaces those literals are the dark
   theme's pearl and aurora alphas, and they measure at or near 1:1 —
   the invisible trim the owner flagged, the gold boxes first. Each rule
   below recolors one serialized literal to this pass's deepened stroke
   (measured on the field / Pearl / glass in the Fix 27 census):
   pearl card edges -> ink .46 (3.13-3.23:1), pearl section dividers ->
   ink .40 (2.63-2.69:1), bright teal -> deep teal .75 (3.25-3.61:1),
   bright gold -> the emblem's brand-hue gold at .95 (3.09-3.59:1),
   bright violet -> violet ink .75 (3.15-3.49:1). Scoped to <main> (the
   nav and footer carry their own light rules) and off .tlg-glass
   elements themselves, whose ::after frame above is their edge; nested
   non-glass cards inside glass panels are exactly what this is for.
   Dark mode has no html[data-theme="light"] match and is untouched. */
html[data-theme="light"] main [style*="border: 1px solid rgba(248, 249, 255, 0.12)"]:not(.tlg-glass),
html[data-theme="light"] main [style*="border-top: 1px solid rgba(248, 249, 255, 0.12)"]:not(.tlg-glass),
html[data-theme="light"] main [style*="border: 1px solid rgba(248, 249, 255, 0.14)"]:not(.tlg-glass),
html[data-theme="light"] main [style*="border: 1px solid rgba(248, 249, 255, 0.1)"]:not(.tlg-glass),
html[data-theme="light"] main [style*="border: 1px solid rgba(248, 249, 255, 0.09)"]:not(.tlg-glass) { border-color: rgba(10,10,12,.46) !important; }
html[data-theme="light"] main [style*="border-bottom: 1px solid rgba(248, 249, 255, 0.08)"],
html[data-theme="light"] main [style*="border-bottom: 1px solid rgba(248, 249, 255, 0.1)"] { border-bottom-color: rgba(10,10,12,.40) !important; }
html[data-theme="light"] main [style*="border: 1px solid rgba(66, 245, 230, 0.34)"],
html[data-theme="light"] main [style*="border: 1px solid rgba(66, 245, 230, 0.55)"],
html[data-theme="light"] main [style*="border: 1px solid rgba(66, 245, 230, 0.6)"],
html[data-theme="light"] main [style*="border-bottom: 1px solid rgba(66, 245, 230, 0.45)"] { border-color: rgba(14,107,98,.75) !important; }
html[data-theme="light"] main [style*="border-bottom: 1px solid rgba(66, 245, 230, 0.45)"] { border-bottom-color: rgba(14,107,98,.75) !important; }
html[data-theme="light"] main [style*="border: 1px solid rgba(255, 216, 77, 0.34)"],
html[data-theme="light"] main [style*="border: 1px solid rgba(255, 216, 77, 0.55)"],
html[data-theme="light"] main [style*="border: 1px solid rgba(255, 216, 77, 0.6)"] { border-color: rgba(148,123,44,.95) !important; }
html[data-theme="light"] main [style*="border: 1px solid rgba(157, 92, 255, 0.45)"],
html[data-theme="light"] main [style*="border: 1px solid rgba(157, 92, 255, 0.5)"],
html[data-theme="light"] main [style*="border: 1px solid rgba(157, 92, 255, 0.55)"],
html[data-theme="light"] main [style*="border: 1px solid rgba(157, 92, 255, 0.6)"] { border-color: rgba(124,58,237,.75) !important; }
/* The two-lane tabs' selected underline is a bright-teal inset shadow in
   the inline style; outside a glass card nothing else reaches it. */
html[data-theme="light"] main [style*="box-shadow: rgb(66, 245, 230) 0px -2px 0px inset"] { box-shadow: rgb(14,107,98) 0px -2px 0px inset !important; }
/* The OS radial menu (desktop, TlgOS) flips to pearl glass via the
   background battery above; its ring and item borders stay behind. */
html[data-theme="light"] #tlg-os-radial [style*="border: 1px solid rgba(248, 249, 255, 0.18)"] { border-color: rgba(10,10,12,.46) !important; }
html[data-theme="light"] #tlg-os-radial [style*="border: 1px solid rgba(66, 245, 230, 0.3)"] { border-color: rgba(14,107,98,.55) !important; }
html[data-theme="light"] #tlg-os-radial [style*="border: 1px solid rgba(66, 245, 230, 0.8)"] { border-color: rgba(14,107,98,.85) !important; }
