/* ==========================================================================
   LEKANDO Signature X — production identity layer (Phase P1)
   Loaded LAST (after lk-id.css), ONLY when the identity flag is on:
     layout.php: if (lk_identity() === 'signature-x') -> this file
   Rollback: flag off -> file never loads -> legacy identity intact.
   Method: remap the existing design-system variables + restyle chrome and
   shared components. No markup changes. No !important wars; same specificity,
   later cascade. WCAG 2.2 AA rulings applied (teal-ink for text-bearing
   actions; lime for focus/fingerprint only). Performance: heavy animated
   layers are replaced with static gradients; nothing here adds weight beyond
   this one file.
   ========================================================================== */

/* ---------------------------------------------------------- light (pearl) */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #F6F8F7;            /* Pearl White */
  --ink: #171E26;           /* Graphite */
  --text: #171E26;
  --text-2: #4A5A55;
  --muted: #5B6A64; /* m37: was #6B7A74 (4.22:1 on #F6F8F7, RT finding 3) — 5.33:1 now, one token fixes every consumer */
  --gold: #008F83;          /* Signature Teal (variable kept for cascade) */
  --gold-hi: #102D2B;       /* Deep Jade: headings/highlights */
  --blue: #007A6F;          /* Teal Ink: AA-safe links/focus on pearl */
  --cyan: #C5F467;          /* Electric Lime: fingerprint, rare */
  --line: rgba(16, 45, 43, .14);
  --line-soft: rgba(16, 45, 43, .08);
}

/* ------------------------------------------------------------ dark (jade) */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D1716;            /* jade dark */
  --ink: #0D1716;
  --text: #EDF3F0;
  --text-2: #B9C9C2;
  --muted: #8AA097;
  --gold: #008F83;
  --gold-hi: #F2F7F5;
  --blue: #C5F467;          /* lime focus/accent on dark — AA 14.3:1 */
  --cyan: #C5F467;
  --line: rgba(237, 243, 240, .14);
  --line-soft: rgba(237, 243, 240, .08);
}

/* --------------------------------------------------- world: calm, static */
/* Replace the heavy animated stage (orbit rings, floor grid, dust, grain)
   with one static brand gradient. Seriousness + load speed (his rules). */
.world { background: var(--bg); }
.world .w-floor, .world .w-dust, .world .w-grain, .world .w-spot { display: none; }
html[data-theme="light"] .world {
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(0, 143, 131, .06) 0%, transparent 55%),
    var(--bg);
}
html[data-theme="dark"] .world {
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(0, 143, 131, .12) 0%, transparent 55%),
    var(--bg);
}
.world .w-aura { animation: none; opacity: .35; filter: blur(90px); }
html[data-theme="light"] .world .w-aura-a { background: radial-gradient(circle, rgba(0, 143, 131, .10), transparent 62%); }
html[data-theme="light"] .world .w-aura-b { background: radial-gradient(circle, rgba(16, 45, 43, .08), transparent 64%); }
html[data-theme="dark"] .world .w-aura-a { background: radial-gradient(circle, rgba(0, 143, 131, .22), transparent 62%); }
html[data-theme="dark"] .world .w-aura-b { background: radial-gradient(circle, rgba(197, 244, 103, .05), transparent 64%); }

/* ------------------------------------------------------------- header bar */
.bar-mark { border-color: var(--line); background: rgba(255, 255, 255, .72); }
html[data-theme="dark"] .bar-mark { background: rgba(18, 32, 25, .7); }
html[data-theme="light"] .bar-mark .m-gold { stroke: #102D2B; }
html[data-theme="light"] .bar-mark .m-blue { stroke: #008F83; }
.bar-lang, .bar-star, .bar-theme { border-color: var(--line-soft); }
html[data-theme="light"] .bar-lang, html[data-theme="light"] .bar-star { background: rgba(255, 255, 255, .6); }

/* ------------------------------------------------------- buttons & chips */
.btn {
  background: linear-gradient(180deg, #00938A, #007A6F); /* limited gradient, studied gloss */
  color: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 6px 18px -8px rgba(0, 122, 111, .5);
}
.btn:hover { filter: brightness(1.05); }
.btn-ghost {
  background: transparent;
  color: var(--blue);
  box-shadow: inset 0 0 0 1.5px var(--blue);
}
.chip.active {
  background: #007A6F;
  color: #FFFFFF;
  border-color: transparent;
  font-weight: 700;
}
.chip:hover { border-color: #008F83; }

/* ------------------------------------------------------------------ cards */
.hub-card {
  border-radius: 16px;
  background: #FFFFFF;
  border: 1px solid var(--line-soft);
  box-shadow: 0 1px 2px rgba(16, 45, 43, .05), 0 12px 32px -20px rgba(16, 45, 43, .18);
  backdrop-filter: none; -webkit-backdrop-filter: none; /* flat = fast */
}
.hub-card:hover {
  border-color: rgba(0, 143, 131, .45);
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(16, 45, 43, .05), 0 18px 40px -20px rgba(16, 45, 43, .25);
}
html[data-theme="dark"] .hub-card {
  background: #122019;
  border-color: var(--line-soft);
  box-shadow: inset 0 1px 0 rgba(197, 244, 103, .07); /* the 1px lime kiss */
}
html[data-theme="dark"] .hub-card:hover { border-color: rgba(0, 143, 131, .6); }
.hub-kind { color: #007A6F; }
html[data-theme="dark"] .hub-kind { color: #C5F467; }

/* -------------------------------------------------------------- tool out */
.tool-out { border: 1px solid var(--line); background: rgba(0, 143, 131, .05); }
.tool-big { color: var(--gold-hi); font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------- content "paper" */
.paper {
  background: #FFFFFF;
  color: #171E26;
  border: 1px solid var(--line-soft);
  box-shadow: 0 24px 60px -40px rgba(16, 45, 43, .25);
}
.paper a { color: #007A6F; }

/* ------------------------------------------------------------ hero / gate */
/* Calm the gate: no orbit rings, no pulsing. The wordmark carries the page. */
.gate .orbit, .gate .core-glow { display: none; }
.crest-logo { width: clamp(240px, 56vw, 520px); }
.hero-logo { animation: none; filter: none; }
.hero-logo circle { animation: none; }
html[data-theme="light"] .hero-logo [stroke="#FFFFFF"] { stroke: #102D2B; }
html[data-theme="light"] .hero-logo [fill="#FFFFFF"] { fill: #102D2B; }

/* --------------------------------------------------------------- occasions */
.occasion { background: rgba(255, 255, 255, .72); border-color: var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; }
html[data-theme="dark"] .occasion { background: rgba(18, 32, 25, .7); }
.occasion strong { color: var(--gold-hi); }
.occ-dot { background: #C5F467; box-shadow: 0 0 8px rgba(197, 244, 103, .8); } /* one lime detail */

/* ------------------------------------------------------------- focus ring */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 8px; }

/* --------------------------------------------------------- motion discipline */
@media (prefers-reduced-motion: reduce) {
  .hub-card, .btn, .chip { transition: none; }
  .hub-card:hover { transform: none; }
}

/* ==========================================================================
   OVERRIDE LAYER — hard-coded legacy navy (#153E50 / #0F2C3B / #2E6E91 /
   #EAF1F5 / #9CC4DE + rgba(46,110,145) family) found in site.css, hub.css,
   lk-id.css (and pv-light.css on production). Every rule is html[data-theme]
   scoped so it wins on specificity; this file also loads LAST (after the
   pv-light block). Mapping: navy→Deep Jade, steel→Signature Teal,
   pale-steel→mint tints, bright-blue (dark mode)→bright teal. Lime stays
   reserved: focus, active dot, 1px kiss.
   ========================================================================== */

/* ------------------------------------------------- lk-id.css variable set */
html[data-theme="light"] {
  --lk-navy: #102D2B; --lk-blue: #007A6F; --lk-line: #D5E4E0;
  --lk-soft: #EFF6F4; --lk-ink: #122B28; --lk-mut: #58706A;
}
html[data-theme="dark"] {
  --lk-navy: #7FD1C6; --lk-blue: #2FB8A9; --lk-line: #2B3F3A;
  --lk-soft: #142420; --lk-ink: #E8F3F0; --lk-mut: #93A9A2;
}
html[data-theme="dark"] .lk-steps > li::before { color: #06231F; }

/* --------------------------------- site.css :root lk-* constants (inline) */
html[data-theme="light"] {
  --lk-text-hi: #102D2B; --lk-text-dim2: #4A5A55;
  --lk-info: #0E4E48; --lk-info-2: #115F57; --lk-info-3: #147065; --lk-info-4: #17897B;
  --lk-accent: #008F83; --lk-link: #007A6F; --lk-brand: #102D2B;
  --lk-line-lt: #D5E4E0; --lk-line-lt2: #B9D2CB;
  --lk-line-dk: #1E3A35; --lk-callout-dk: #102D2B;
  --lk-track: #E2EDE9; --lk-chip: #E9F1EE;
  --lk-text: #171E26; --lk-dim: #4A5A55;
}
html[data-theme="dark"] {
  --lk-text-hi: #EDF3F0; --lk-text-dim2: #93A9A2;
  --lk-info: #2FB8A9; --lk-info-2: #4CC7B9; --lk-info-3: #6AD3C7; --lk-info-4: #8ADFD5;
  --lk-accent: #008F83; --lk-link: #2FB8A9; --lk-brand: #7FD1C6;
  --lk-line-dk: #2B3F3A; --lk-callout-dk: #122019;
  --lk-track: #1C2E2A; --lk-chip: #1C2E2A;
  --lk-text: #EDF3F0; --lk-dim: #93A9A2;
}

/* --------------------------------------------------------- SVG logo marks */
html[data-theme="light"] linearGradient[id^="lkGold"] stop[offset="0"] { stop-color: #8FDCD2; }
html[data-theme="light"] linearGradient[id^="lkGold"] stop[offset=".45"] { stop-color: #008F83; }
html[data-theme="light"] linearGradient[id^="lkGold"] stop[offset="1"] { stop-color: #102D2B; }
html[data-theme="light"] linearGradient[id^="lkBlue"] stop[offset="0"] { stop-color: #2FB8A9; }
html[data-theme="light"] linearGradient[id^="lkBlue"] stop[offset="1"] { stop-color: #007A6F; }
html[data-theme="dark"] linearGradient[id^="lkGold"] stop[offset="0"] { stop-color: #9FE4DA; }
html[data-theme="dark"] linearGradient[id^="lkGold"] stop[offset=".45"] { stop-color: #2FB8A9; }
html[data-theme="dark"] linearGradient[id^="lkGold"] stop[offset="1"] { stop-color: #0B4A43; }
html[data-theme="dark"] linearGradient[id^="lkBlue"] stop[offset="0"] { stop-color: #5FD8C8; }
html[data-theme="dark"] linearGradient[id^="lkBlue"] stop[offset="1"] { stop-color: #0E8C7E; }
html[data-theme="dark"] .bar-mark .m-gold { stroke: #7FD1C6; }
html[data-theme="dark"] .bar-mark .m-blue { stroke: #008F83; }

/* -------------------------------------------------------- lux 3D buttons */
.lux { --base: linear-gradient(180deg, #102D2B, #0B211F); }
.lux-blue { --base: linear-gradient(180deg, #007A6F, #0B3B35); }
.lux::before { box-shadow: 0 16px 30px -12px rgba(0, 143, 131, .45), 0 2px 0 rgba(6, 35, 31, .6); }
.lux-face {
  background: linear-gradient(180deg, #EAF6F3 0%, #DFF3F0 20%, #008F83 48%, #007A6F 80%, #008F83 100%);
  color: #052A25;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -3px 6px rgba(11, 33, 31, .35), inset 0 0 0 1px rgba(88, 112, 106, .45);
}

/* ------------------------------------------------- gradient-text headings */
html[data-theme="light"] .manifest h1,
html[data-theme="light"] .plain h1,
html[data-theme="light"] .delivery-head h1,
html[data-theme="light"] .occ-card strong {
  background-image: linear-gradient(180deg, #102D2B, #007A6F);
}
html[data-theme="dark"] .manifest h1,
html[data-theme="dark"] .plain h1,
html[data-theme="dark"] .delivery-head h1,
html[data-theme="dark"] .occ-card strong {
  background-image: linear-gradient(180deg, #F2F7F5, #2FB8A9);
}

/* -------------------------------------------------------- vcard / portrait */
.vcard-chip {
  background: linear-gradient(135deg, #DFF3F0, #102D2B 45%, #DFF3F0 60%, #102D2B);
  box-shadow: inset 0 0 0 1px rgba(16, 45, 43, .5);
}
.vcard-chip::before { border-top-color: rgba(16, 45, 43, .45); border-bottom-color: rgba(16, 45, 43, .45); }
.vcard-chip::after { border-left-color: rgba(16, 45, 43, .45); border-right-color: rgba(16, 45, 43, .45); }
.vcard-shine { background: radial-gradient(260px circle at var(--sx, 50%) var(--sy, 0%), rgba(223, 243, 240, .12), transparent 60%); }
.portrait {
  background: linear-gradient(145deg, #DFF3F0, rgba(255, 255, 255, .05) 40%, rgba(197, 244, 103, .55));
  box-shadow: 0 30px 60px -30px rgba(6, 35, 31, .8), 0 0 50px -16px rgba(0, 143, 131, .4);
}

/* ------------------------------------------------------------ frames/drop */
.frame { background: linear-gradient(180deg, rgba(18, 32, 25, .78), rgba(10, 20, 18, .78)); }
html[data-theme="light"] .frame { background: #FFFFFF; }
.frame::before { border-color: rgba(0, 143, 131, .14); }
.frame:hover { border-color: rgba(0, 143, 131, .4); }
.drop:hover, .drop.is-over { background: radial-gradient(circle at 50% 0%, rgba(0, 143, 131, .18), transparent 70%), rgba(18, 32, 25, .8); }
.drop-ic {
  background: linear-gradient(180deg, #DFF3F0, #008F83 55%, #102D2B);
  box-shadow: 0 14px 30px -12px rgba(0, 143, 131, .6);
}

/* -------------------------------------------------------------- hub.css */
::selection { background: rgba(0, 143, 131, .25); }
html[data-theme="dark"] ::selection { background: rgba(47, 184, 169, .35); }

.hub-search button {
  background: linear-gradient(180deg, #00938A, #007A6F);
  color: #FFFFFF;
}
html[data-theme="dark"] .chip.active {
  background: linear-gradient(180deg, #2FB8A9, #008F83);
  color: #06231F;
}
.panel {
  border-color: rgba(0, 143, 131, .16);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.panel input[type="range"] { accent-color: #008F83; }
.panel input[type="file"]:not([hidden])::file-selector-button {
  background: linear-gradient(180deg, #00938A, #007A6F);
  color: #FFFFFF;
}
.paper h2 { border-inline-start-color: #008F83; }
.paper-kicker { color: #007A6F; }
html[data-theme="dark"] .paper { background: #122019; }
html[data-theme="dark"] .paper a { color: #2FB8A9; }
.lk-results a:hover { border-color: #008F83; }
.me-ic { background: rgba(0, 143, 131, .08); }
.count-new { color: #06231F; }

/* ==========================================================================
   OVERRIDE LAYER 2 — full coverage of the deployer's 102-rule navy audit
   (site.css 12, hub.css 37, lk-id.css 3, pv-light.css 50). This file loads
   LAST (after the pv-light block) so equal specificity wins by order;
   pv-light's !important logo rules are answered with !important here.
   ========================================================================== */

/* --- pv-light component token --tkg (set on the components, not :root) --- */
html[data-theme="light"] .tk-card, html[data-theme="light"] .tk-stats,
html[data-theme="light"] .tk-hero, html[data-theme="light"] .tk-faq,
html[data-theme="light"] .tk-next, html[data-theme="light"] .tk-acc,
html[data-theme="light"] .tk-hist, html[data-theme="light"] .tk-inv-totals,
html[data-theme="light"] .ev-flow, html[data-theme="light"] .ev-tl,
html[data-theme="light"] .ev-stats, html[data-theme="light"] .paper details,
html[data-theme="light"] .paper .tk-actions, html[data-theme="light"] .lk-pal-panel,
html[data-theme="light"] .toolbox { --tkg: #102D2B; }
html[data-theme="dark"] .tk-card, html[data-theme="dark"] .tk-stats,
html[data-theme="dark"] .tk-hero, html[data-theme="dark"] .tk-faq,
html[data-theme="dark"] .tk-next, html[data-theme="dark"] .tk-acc,
html[data-theme="dark"] .tk-hist, html[data-theme="dark"] .tk-inv-totals,
html[data-theme="dark"] .ev-flow, html[data-theme="dark"] .ev-tl,
html[data-theme="dark"] .ev-stats, html[data-theme="dark"] .paper details,
html[data-theme="dark"] .paper .tk-actions, html[data-theme="dark"] .lk-pal-panel,
html[data-theme="dark"] .toolbox { --tkg: #7FD1C6; }

/* --- tool buttons (the class tools actually use) --- */
html .tk-btn { background: #007A6F; color: #FFFFFF; }
html .tk-btn:hover { filter: brightness(1.06); }
html .tk-btn-ghost, html .btn-ghost { color: #007A6F; box-shadow: inset 0 0 0 1.5px #007A6F; background: transparent; }
html[data-theme="dark"] .tk-btn-ghost, html[data-theme="dark"] .btn-ghost { color: #2FB8A9; box-shadow: inset 0 0 0 1.5px #2FB8A9; }
html .tk-seg button.on { background: #007A6F; color: #FFFFFF; }
html .tk-check input { accent-color: #008F83; }
html[data-theme="dark"] .btn { background: linear-gradient(180deg, #00938A, #007A6F); color: #FFFFFF; }
html[data-theme] .paper a.tk-btn:not(.tk-btn-ghost),
html[data-theme] .paper .tk-btn:not(.tk-btn-ghost),
html[data-theme] .tk-btn:not(.tk-btn-ghost):not(.tk-mini) { background: #007A6F; color: #FFFFFF; }

/* --- remaining pv-light navy fills --- */
html .search button, html .strip .cd, html .radial-back, html .rad-back,
html .hub-search button, html .panel input[type="file"]:not([hidden])::file-selector-button {
  background: #007A6F; color: #FFFFFF;
}
html .hub-search button { background: linear-gradient(180deg, #00938A, #007A6F); }
html .search input:focus { border-color: #007A6F; }
html #tkBandFill9, html #tkClFill { background: linear-gradient(90deg, #2FB8A9, #008F83); }
html #tkClPrint .cl-item.done .cl-box { background: #008F83; }

/* --- text + icon navy --- */
html[data-theme="light"] .tk-v-x, html[data-theme="light"] #tkClPrint h2,
html[data-theme="light"] .radial-ic, html[data-theme="dark"] .radial-ic,
html[data-theme="light"] .rad-node .ic, html[data-theme="dark"] .rad-node .ic,
html[data-theme="light"] .lk-hg, html[data-theme="light"] .lk-rel .lk-rel-k,
html[data-theme="light"] .fp-grade { color: #102D2B; }
html[data-theme="light"] .fp-grade { --gc: #102D2B; }
html[data-theme="dark"] .tk-v-x, html[data-theme="dark"] .lk-hg,
html[data-theme="dark"] .lk-rel .lk-rel-k { color: #7FD1C6; }
html[data-theme="dark"] #tkClPrint h2 { color: #F2F7F5; }
html[data-theme="dark"] .fp-e91 { --gc: #008F83; }
html ol.paper-list > li::before { color: #007A6F; }
html .lk-cpick-note, html .lk-cpick-note u { color: #007A6F; }
html[data-theme="dark"] .lk-cpick-note, html[data-theme="dark"] .lk-cpick-note u { color: #2FB8A9; }

/* --- heading accent bars + related links --- */
html .tk-card > h2::before, html .paper h2::before {
  background: linear-gradient(180deg, #008F83, #102D2B);
}
html .crumbs a:hover, html .radial-flat a:hover { color: #007A6F; }
html .radial-node:hover .radial-ic, html .radial-node:focus-visible .radial-ic { border-color: #007A6F; }
html .lk-orb-back { background: linear-gradient(160deg, #2FB8A9, #102D2B); }
html .lk-tl .tl-line { stroke: #102D2B; }
html .lk-tl .tl-pay { fill: #007A6F; }
html[data-theme="dark"] .lk-tl .tl-line { stroke: #7FD1C6; }
html[data-theme="dark"] .lk-tl .tl-pay { fill: #2FB8A9; }
html .chip:hover { border-color: #007A6F; color: #102D2B; }
html[data-theme="dark"] .chip:hover { color: #EDF3F0; }
html .tk-chip:hover { border-color: #007A6F; color: #102D2B; }
html[data-theme="dark"] .tk-chip:hover { color: #EDF3F0; }
html .radial-back { background: linear-gradient(180deg, #00938A, #007A6F); }

/* --- logo marks: pv-light forces navy with !important; Signature X answers
       with the duotone (deep jade + teal), pearl duotone in dark --- */
html[data-theme="light"] .logo path, html[data-theme="light"] .logo g path { stroke: #102D2B !important; }
html[data-theme="light"] .logo circle { fill: #102D2B !important; }
html[data-theme="dark"] .logo path, html[data-theme="dark"] .logo g path { stroke: #EDF3F0 !important; }
html[data-theme="dark"] .logo circle { fill: #EDF3F0 !important; }
html[data-theme="light"] .brand-mark .m-gold, html[data-theme="light"] .bar-mark .m-gold, html[data-theme="light"] .m-gold { stroke: #102D2B !important; }
html[data-theme="light"] .brand-mark .m-blue, html[data-theme="light"] .bar-mark .m-blue, html[data-theme="light"] .m-blue { stroke: #008F83 !important; }
html[data-theme="dark"] .brand-mark .m-gold, html[data-theme="dark"] .bar-mark .m-gold, html[data-theme="dark"] .m-gold { stroke: #7FD1C6 !important; }
html[data-theme="dark"] .brand-mark .m-blue, html[data-theme="dark"] .bar-mark .m-blue, html[data-theme="dark"] .m-blue { stroke: #008F83 !important; }
html[data-theme="light"] .pvnavcenter path, html[data-theme="light"] .pvnavcenter line, html[data-theme="light"] .pvnavcenter polyline { stroke: #102D2B !important; }
html[data-theme="light"] .pvnavcenter circle { fill: #102D2B !important; }
html[data-theme="dark"] .pvnavcenter path, html[data-theme="dark"] .pvnavcenter line, html[data-theme="dark"] .pvnavcenter polyline { stroke: #EDF3F0 !important; }
html[data-theme="dark"] .pvnavcenter circle { fill: #EDF3F0 !important; }

/* ==========================================================================
   OVERRIDE LAYER 3 — field-report fixes (2026-12-01, post-first-deploy)
   1) DARK READABILITY: headings/labels were rendering dark teal on dark jade.
   2) LIGHT TEXT: move headings/body to Graphite #171E26 per palette.
   3) TOOL PAGES: full tk-* var set remap (cards, stats, hero, faq, toolbox).
   ========================================================================== */

/* --- (1) dark: brighten the workhorse accent; lime stays focus-only --- */
html[data-theme="dark"] { --gold: #2FB8A9; --blue: #2FB8A9; }
html[data-theme="dark"] :focus-visible { outline-color: #C5F467; }

/* --- (1) dark: all headings/labels light; gradient-text heads re-asserted --- */
html[data-theme="dark"] h1, html[data-theme="dark"] h2,
html[data-theme="dark"] h3, html[data-theme="dark"] h4,
html[data-theme="dark"] legend { color: #F2F7F5; }
html[data-theme="dark"] label, html[data-theme="dark"] .tk-label { color: #B9C9C2; }
html[data-theme="dark"] .manifest h1, html[data-theme="dark"] .plain h1,
html[data-theme="dark"] .delivery-head h1, html[data-theme="dark"] .occ-card strong {
  color: transparent; -webkit-text-fill-color: transparent;
}
html[data-theme="dark"] .frame-link { color: #2FB8A9; }
html[data-theme="dark"] .radial-ic, html[data-theme="dark"] .rad-node .ic { color: #7FD1C6; }
html[data-theme="dark"] .paper-kicker { color: #2FB8A9; }
html[data-theme="dark"] ol.paper-list > li::before { color: #2FB8A9; }

/* --- (2) light: Graphite headings + body per palette --- */
html[data-theme="light"] { --lk-ink: #171E26; --lk-mut: #4A5A55; }
html[data-theme="light"] body { color: #171E26; }
html[data-theme="light"] h1, html[data-theme="light"] h2,
html[data-theme="light"] h3, html[data-theme="light"] h4 { color: #171E26; }
html[data-theme="light"] .manifest h1, html[data-theme="light"] .plain h1,
html[data-theme="light"] .delivery-head h1, html[data-theme="light"] .occ-card strong {
  color: transparent; -webkit-text-fill-color: transparent;
}

/* --- (3) full tk-* component tokens, both themes (same selectors hub.css
       and pv-light set them on; element-level vars need element-level wins) --- */
html[data-theme="light"] .tk-card, html[data-theme="light"] .tk-stats,
html[data-theme="light"] .tk-hero, html[data-theme="light"] .tk-faq,
html[data-theme="light"] .tk-next, html[data-theme="light"] .tk-acc,
html[data-theme="light"] .tk-hist, html[data-theme="light"] .tk-inv-totals,
html[data-theme="light"] .ev-flow, html[data-theme="light"] .ev-tl,
html[data-theme="light"] .ev-stats, html[data-theme="light"] .paper details,
html[data-theme="light"] .paper .tk-actions, html[data-theme="light"] .lk-pal-panel,
html[data-theme="light"] .toolbox, html[data-theme="light"] .lk-tool,
html[data-theme="light"] .lk-summary, html[data-theme="light"] .lk-steps,
html[data-theme="light"] .lk-checklist, html[data-theme="light"] .lk-related-help {
  --tki: #171E26; --tkm: #4A5A55; --tkc: #FFFFFF;
  --tkl: #DCE8E4; --tkb: #F6F8F7; --tkg: #008F83;
}
html[data-theme="dark"] .tk-card, html[data-theme="dark"] .tk-stats,
html[data-theme="dark"] .tk-hero, html[data-theme="dark"] .tk-faq,
html[data-theme="dark"] .tk-next, html[data-theme="dark"] .tk-acc,
html[data-theme="dark"] .tk-hist, html[data-theme="dark"] .tk-inv-totals,
html[data-theme="dark"] .ev-flow, html[data-theme="dark"] .ev-tl,
html[data-theme="dark"] .ev-stats, html[data-theme="dark"] .paper details,
html[data-theme="dark"] .paper .tk-actions, html[data-theme="dark"] .lk-pal-panel,
html[data-theme="dark"] .toolbox, html[data-theme="dark"] .lk-tool,
html[data-theme="dark"] .lk-summary, html[data-theme="dark"] .lk-steps,
html[data-theme="dark"] .lk-checklist, html[data-theme="dark"] .lk-related-help {
  --tki: #EDF3F0; --tkm: #B9C9C2; --tkc: #122019;
  --tkl: #2B3F3A; --tkb: #0D1716; --tkg: #2FB8A9;
}

/* ==========================================================================
   OVERRIDE LAYER 4 — residual dim items (deployer field report, 2026-12-01)
   ========================================================================== */

/* "Recently used" label + chips (home3.php inline <style>, prints AFTER this
   file) and "Change country" (country-nav.php inline) — named selectors with
   html[data-theme] prefix so we beat the body-inline blocks on specificity. */
html[data-theme="dark"] .lkh-rec b { color: #B9C9C2 !important; }
html[data-theme="dark"] .lkh-rec a {
  color: #2FB8A9 !important;
  border-color: rgba(47, 184, 169, .35) !important;
}
html[data-theme="dark"] .lkh-rec a:hover { color: #5FD8C8 !important; }
html[data-theme="dark"] .lk-cc-chg { color: #2FB8A9 !important; }
html[data-theme="dark"] .lk-cc-chg:hover { color: #5FD8C8 !important; }
html[data-theme="light"] .lkh-rec b { color: #4A5A55 !important; }
html[data-theme="light"] .lkh-rec a { color: #007A6F !important; border-color: rgba(0, 122, 111, .3) !important; }
html[data-theme="light"] .lk-cc-chg { color: #007A6F !important; }

/* ==========================================================================
   OVERRIDE LAYER 5 — composition (his order: recoloring is not redesign)
   Bento asymmetry on the EXISTING grids (no markup change), premium frames,
   visual hierarchy, and RESTRAINED motion restored (transform/opacity only,
   prefers-reduced-motion honored). Zero new assets, zero layout shifts.
   ========================================================================== */

/* --- Modern Bento: asymmetric spans on the existing hub grid --- */
@media (min-width: 760px) {
  .hub-grid:not(.hub-grid-inline) { grid-template-columns: repeat(6, 1fr); } /* m38: deployer fix folded in permanently */
  .hub-grid > .hub-card { grid-column: span 2; }
  .hub-grid:not(.hub-grid-inline) > .hub-card:nth-child(1) { grid-column: span 4; }
  .hub-grid:not(.hub-grid-inline) > .hub-card:nth-child(4) { grid-column: span 3; }
  .hub-grid:not(.hub-grid-inline) > .hub-card:nth-child(5) { grid-column: span 3; }
  .hub-grid-inline .hub-card { grid-column: auto; }
}

/* --- Visual Cards: layered elevation + hover sheen (cheap, transform-only) --- */
.hub-card { overflow: hidden; }
.hub-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .35) 48%, transparent 62%);
  transform: translateX(-120%); transition: transform .6s var(--ease, ease);
}
html[data-theme="dark"] .hub-card::after {
  background: linear-gradient(115deg, transparent 30%, rgba(197, 244, 103, .06) 48%, transparent 62%);
}
.hub-card:hover::after { transform: translateX(120%); }

/* --- Premium Frames: gradient hairline on the home frames --- */
.frame { position: relative; }
.frame::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(160deg, rgba(0, 143, 131, .55), rgba(16, 45, 43, .12) 40%, rgba(197, 244, 103, .35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}

/* --- Smart Highlights: kicker + stat emphasis --- */
.paper-kicker, .hub-kind {
  letter-spacing: .14em; font-weight: 700;
}
.tk-stat-num, .tool-big { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* --- Visual Hierarchy: section rhythm --- */
.hub-head h2 { letter-spacing: -.015em; }
.hub { margin-top: 56px; }

/* --- Restrained ambient motion (his order 3): one slow, cheap aura drift --- */
@keyframes lkAuraDrift { 0%, 100% { opacity: .28; } 50% { opacity: .42; } }
.world .w-aura { animation: lkAuraDrift 18s ease-in-out infinite; }
.btn, .tk-btn, .chip, .hub-card, .cdir-card, .cdir-need { will-change: auto; }
.btn:active, .tk-btn:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) {
  .world .w-aura { animation: none; }
  .hub-card::after { display: none; }
  .btn:active, .tk-btn:active { transform: none; }
}

/* ==========================================================================
   OVERRIDE LAYER 6 — Red Team contrast pass 2 (2026-12-01)
   ========================================================================== */

/* 1) Count badges + navy-fill buttons: dark remap made --lk-navy a LIGHT teal,
      so white text on it = 1.77:1. Dark ink on the light fill instead.
      Covers .hm-c i (tools "107" badge), .lks-gh i, .lk-cpick-btn. */
html[data-theme="dark"] .hm-c i,
html[data-theme="dark"] .lks-gh i,
html[data-theme="dark"] .lk-cpick-btn { color: #0B2622 !important; }

/* 2) Country-switcher family on country pages (same blue-on-dark issue as .lk-cc-chg) */
html[data-theme="dark"] .lk-cc-all,
html[data-theme="dark"] .lk-cc-fl { color: #2FB8A9 !important; }
html[data-theme="dark"] .lk-cc-all:hover,
html[data-theme="dark"] .lk-cc-fl:hover { color: #5FD8C8 !important; }
html[data-theme="light"] .lk-cc-all,
html[data-theme="light"] .lk-cc-fl { color: #007A6F !important; }

/* 3) Light-mode muted texts below AA on #F6F8F7 (footer copyright, disclaimer, empty states) */
html[data-theme="light"] .foot,
html[data-theme="light"] .foot .lk-disc,
html[data-theme="light"] .lk-disc,
html[data-theme="light"] .lk-disc-page,
html[data-theme="light"] .lk-empty { color: #5B6A64 !important; opacity: 1; }

/* 4) Dark-mode "bright-white tiles" beside the jade glass — dark-tint treatments */
html[data-theme="dark"] .hm-c {
  background: radial-gradient(circle at 30% 25%, #1A3833, #10231F);
  box-shadow: 0 0 0 5px rgba(47, 184, 169, .08);
}
html[data-theme="dark"] .lks-back { background: #122723; }
html[data-theme="dark"] .lks-pills button.on {
  background: rgba(47, 184, 169, .12);
  border-color: #2FB8A9;
}
html[data-theme="dark"] .lks-pills button { border-color: #2B3F3A; }

/* 5) Schengen "Remove" demoted to ghost (pairs with data-role="del" in the module
      and the same attribute on the legacy inline button) */
html[data-theme] .tk-btn[data-role="del"] { /* m38: deployer fix folded in — prefix + !important */
  background: transparent !important; border: 1px solid var(--line, #d8e2e8);
  color: var(--muted, #5B6A64) !important; font-weight: 500; width: auto; min-height: 40px;
  padding: 0 14px; display: inline-flex;
}
html[data-theme] .tk-btn[data-role="del"]:hover { border-color: var(--tki, #008F83) !important; color: var(--tki, #008F83) !important; }

/* --- Layer 6b: Red Team live-DOM selector confirmations --- */
/* Quick-filter pills are div.lkh-pills > button.lkh-pill (aria-pressed) */
html[data-theme="dark"] .lkh-pill {
  background: #122723 !important;
  border-color: #2B3F3A !important;
  color: #F2F7F5 !important;
}
html[data-theme="dark"] .lkh-pill[aria-pressed="true"] {
  background: rgba(47, 184, 169, .14) !important;
  border-color: #2FB8A9 !important;
  color: #5FD8C8 !important;
}
/* Country select is a native <select class="lk-cs"> with an INLINE style block —
   !important required; color-scheme keeps the native popup dark. */
html[data-theme="dark"] .lk-cs {
  color-scheme: dark;
  background: #122723 !important;
  color: #F2F7F5 !important;
  border-color: rgba(47, 184, 169, .45) !important;
}
html[data-theme="dark"] .lk-cs:focus { outline-color: #2FB8A9 !important; }

/* --- Layer 6c: Red Team stragglers --- */
/* Light footer copyright is a class-less span */
html[data-theme="light"] .foot span:not([class]) { color: #5B6A64 !important; }
/* Country-switcher MENU links (the actual neighbor chips, e.g. Saudi Arabia on /en/ae)
   are class-less <a> inside .lk-cc-menu / .lk-cc-car */
html[data-theme="dark"] .lk-cc-menu a,
html[data-theme="dark"] .lk-cc-car a { color: #2FB8A9 !important; }
html[data-theme="dark"] .lk-cc-menu a:hover,
html[data-theme="dark"] .lk-cc-car a:hover { color: #5FD8C8 !important; }
/* m37: :not([aria-current]) — the current-country pill is solid #153E50 and needs white;
   teal there was 2.19:1 (RT finding 1, caused by this very override).
   #007A6F → #00655C on the tinted chip header: 4.35/3.83 → 6.2:1 (RT finding 2). */
html[data-theme="light"] .lk-cc-menu a:not([aria-current]),
html[data-theme="light"] .lk-cc-car a:not([aria-current]) { color: #00655C !important; }
html[data-theme] .lk-cc-menu a[aria-current="true"],
html[data-theme] .lk-cc-menu a[aria-current="page"],
html[data-theme] .lk-cc-car a[aria-current="true"],
html[data-theme] .lk-cf a[aria-current="true"] { color: #FFFFFF !important; }

/* ================= Layer 7: Country portal — framed topic sections =================
   Ahmed 2026-12-01: sections must read as framed, ordered rows — not random lists.
   Each topic group becomes a bordered frame; each entry inside it is a full row
   with a leading service badge and a trailing directional arrow. No markup change:
   targets the live DOM (details.lk-u93 > summary.lk-u94 + ul > li > a.lk-u95).
   Inline per-page <style> blocks beat this file at equal specificity, so every
   rule is html[data-theme]-prefixed with !important (LESSONS 3+4). */

/* --- 7.1 The frame: each topic <details> becomes a card --- */
html[data-theme] .tk-card details.lk-u93 {
  border: 1px solid rgba(0, 122, 111, .28) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, .55) !important;
  margin: 0 0 14px !important;
  overflow: hidden !important;
}
html[data-theme="dark"] .tk-card details.lk-u93 {
  border-color: rgba(47, 184, 169, .30) !important;
  background: rgba(18, 39, 35, .55) !important;
}

/* --- 7.2 Section header: summary row = flag + section title + count + chevron --- */
html[data-theme] .tk-card details.lk-u93 > summary.lk-u94 {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 15px 16px !important;
  font-weight: 800 !important;
  font-size: 16.5px !important;
  cursor: pointer !important;
  list-style: none !important;
  color: #0B2622 !important;
}
html[data-theme="dark"] .tk-card details.lk-u93 > summary.lk-u94 { color: #F2F7F5 !important; }
html[data-theme] .tk-card details.lk-u93 > summary.lk-u94::-webkit-details-marker { display: none !important; }
/* Directional chevron replaces the raw "+" marker position (template keeps the +;
   CSS draws the chevron after the title — deployer removes the literal + in the
   country view's summary print at the next template touch). */
html[data-theme] .tk-card details.lk-u93 > summary.lk-u94::after {
  content: "›" !important;
  margin-inline-start: auto !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  color: #007A6F !important;
  transition: transform .18s ease !important;
}
html[data-theme="dark"] .tk-card details.lk-u93 > summary.lk-u94::after { color: #2FB8A9 !important; }
html[dir="rtl"] .tk-card details.lk-u93 > summary.lk-u94::after { content: "‹" !important; }
html[data-theme] .tk-card details.lk-u93[open] > summary.lk-u94::after { transform: rotate(90deg) !important; }

/* --- 7.3 Country flag at the head of every section (per-country body class) --- */
html[data-theme] .tk-card details.lk-u93 > summary.lk-u94::before { font-size: 20px !important; line-height: 1 !important; }
body.page-ae .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇦🇪" !important; }
body.page-sa .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇸🇦" !important; }
body.page-qa .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇶🇦" !important; }
body.page-kw .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇰🇼" !important; }
body.page-bh .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇧🇭" !important; }
body.page-om .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇴🇲" !important; }
body.page-eg .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇪🇬" !important; }
body.page-jo .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇯🇴" !important; }
body.page-gb .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇬🇧" !important; }
body.page-tr .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇹🇷" !important; }
body.page-ca .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇨🇦" !important; }
body.page-de .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇩🇪" !important; }
body.page-iq .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇮🇶" !important; }
body.page-tn .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇹🇳" !important; }
body.page-ma .tk-card details.lk-u93 > summary.lk-u94::before { content: "🇲🇦" !important; }

/* --- 7.4 Rows: each entry = full-width row, hairline separator, arrow on the end --- */
html[data-theme] .tk-card details.lk-u93 > ul {
  margin: 0 !important;
  padding: 2px 8px 8px !important;
  list-style: none !important;
}
html[data-theme] .tk-card details.lk-u93 > ul > li { border-top: 1px solid rgba(11, 38, 34, .09) !important; }
html[data-theme="dark"] .tk-card details.lk-u93 > ul > li { border-top-color: rgba(242, 247, 245, .09) !important; }
html[data-theme] .tk-card details.lk-u93 > ul > li:first-child { border-top-color: rgba(0, 122, 111, .22) !important; }
html[data-theme] .tk-card details.lk-u93 a.lk-u95 {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 12px 10px !important;
  border-radius: 10px !important;
  text-decoration: none !important;
}
html[data-theme] .tk-card details.lk-u93 a.lk-u95::after {
  content: "→" !important;
  margin-inline-start: auto !important;
  color: #007A6F !important;
  font-weight: 700 !important;
  opacity: .55 !important;
  transition: opacity .15s ease, transform .15s ease !important;
}
html[dir="rtl"][data-theme] .tk-card details.lk-u93 a.lk-u95::after { content: "←" !important; }
html[data-theme="dark"] .tk-card details.lk-u93 a.lk-u95::after { color: #2FB8A9 !important; }
html[data-theme] .tk-card details.lk-u93 a.lk-u95:hover { background: rgba(0, 122, 111, .07) !important; }
html[data-theme="dark"] .tk-card details.lk-u93 a.lk-u95:hover { background: rgba(47, 184, 169, .10) !important; }
html[data-theme] .tk-card details.lk-u93 a.lk-u95:hover::after { opacity: 1 !important; transform: translateX(3px) !important; }
html[dir="rtl"][data-theme] .tk-card details.lk-u93 a.lk-u95:hover::after { transform: translateX(-3px) !important; }
html[data-theme] .tk-card details.lk-u93 a.lk-u95:focus-visible {
  outline: 2px solid #007A6F !important;
  outline-offset: -2px !important;
}

/* --- 7.5 Service badge slot (per-entry system/device/program mark) ---
   Template prints <span class="lk-badge" data-badge="uaepass"> before the row title
   when the manifest entry names a system; monogram tile is the rights-safe default
   (Layer 7b spec in taxonomy/SERVICE-BADGES.md). */
html[data-theme] .lk-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: .02em !important;
  color: #F2F7F5 !important;
  background: linear-gradient(135deg, #007A6F, #0B2622) !important;
}
html[data-theme="dark"] .lk-badge { background: linear-gradient(135deg, #2FB8A9, #122723) !important; color: #0B2622 !important; }
html[data-theme] .lk-badge img { width: 100% !important; height: 100% !important; object-fit: contain !important; border-radius: 8px !important; }

/* --- 7.6 Sub-sections: nested topic groups get the same treatment, one level down
   (Ahmed 5:09: sub-section organization is mandatory, to the deepest level).
   A details.lk-u93 inside another details.lk-u93 = sub-section: inset frame,
   smaller header, same ordered rows. Works at any depth. --- */
html[data-theme] .tk-card details.lk-u93 details.lk-u93 {
  margin: 8px 6px 8px !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, .35) !important;
}
html[data-theme="dark"] .tk-card details.lk-u93 details.lk-u93 { background: rgba(11, 38, 34, .45) !important; }
html[data-theme] .tk-card details.lk-u93 details.lk-u93 > summary.lk-u94 {
  padding: 11px 14px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}
html[data-theme] .tk-card details.lk-u93 details.lk-u93 > summary.lk-u94::before { content: none !important; }
html[data-theme] .tk-card details.lk-u93 details.lk-u93 a.lk-u95 { padding: 10px 10px !important; }

/* --- 7.7 m33: count badge in section headers + city card --- */
html[data-theme] .tk-card details.lk-u93 > summary.lk-u94 .lk-count {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 26px !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  background: rgba(0, 122, 111, .12) !important;
  color: #00655C !important; /* m39: 4.31:1 on the tint → ~6:1 (RT m33 pass finding 1) */
}
html[data-theme="dark"] .tk-card details.lk-u93 > summary.lk-u94 .lk-count {
  background: rgba(47, 184, 169, .16) !important;
  color: #5FD8C8 !important;
}

html[data-theme] .lk-city-card {
  border: 1px solid rgba(0, 122, 111, .28) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, .55) !important;
  padding: 18px !important;
  margin: 0 0 16px !important;
}
html[data-theme="dark"] .lk-city-card {
  border-color: rgba(47, 184, 169, .30) !important;
  background: rgba(18, 39, 35, .55) !important;
}
html[data-theme] .lk-city-head { display: flex !important; align-items: baseline !important; gap: 12px !important; flex-wrap: wrap !important; }
html[data-theme] .lk-city-name { margin: 0 !important; font-size: 20px !important; font-weight: 800 !important; color: #0B2622 !important; }
html[data-theme="dark"] .lk-city-name { color: #F2F7F5 !important; }
html[data-theme] .lk-city-coords { margin: 0 !important; font-size: 13px !important; color: #5B6A64 !important; direction: ltr !important; }
html[data-theme="dark"] .lk-city-coords { color: #9DB4AC !important; }
html[data-theme] .lk-city-known { font-size: 15px !important; line-height: 1.7 !important; }
html[data-theme] .lk-city-map a { color: #007A6F !important; font-weight: 700 !important; }
html[data-theme="dark"] .lk-city-map a { color: #2FB8A9 !important; }
html[data-theme] .lk-city-near { list-style: none !important; margin: 10px 0 0 !important; padding: 0 !important; }
html[data-theme] .lk-city-near li {
  display: flex !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 8px 2px !important;
  border-top: 1px solid rgba(11, 38, 34, .09) !important;
  font-size: 14.5px !important;
}
html[data-theme="dark"] .lk-city-near li { border-top-color: rgba(242, 247, 245, .09) !important; }
html[data-theme] .lk-city-near-dist { color: #5B6A64 !important; font-weight: 700 !important; }
html[data-theme="dark"] .lk-city-near-dist { color: #9DB4AC !important; }
