/* ============================================================
   JK & ASSOCIATES — Africa Aviation Advisory Platform
   Design system / shared stylesheet (v3.0)

   Brand: the phoenix rising within an Adinkra-patterned ring.
   Palette is sampled directly from the mark — a warm ramp that
   runs oxblood → terracotta → ember → amber → sand, laid over
   warm ink and parchment neutrals. Nothing here is cool-toned;
   the whole system is deliberately one temperature.
   ============================================================ */

:root {
  /* ---- brand ramp (sampled from the logo artwork) ---- */
  --jk-ink:        #16100D;  /* warm near-black — dark bands, body text */
  --jk-ink-soft:   #2A1E18;  /* raised surface on dark                  */
  --jk-oxblood:    #5B1408;  /* deepest brand red                       */
  --jk-terracotta: #9E3116;  /* PRIMARY accent — links, buttons, rules  */
  --jk-terra-deep: #7A2410;  /* accent hover/pressed                    */
  --jk-ember:      #C4551F;  /* mid burnt-orange — gradients, emphasis  */
  --jk-amber:      #E08A34;  /* highlight on dark (the old "gold" slot) */
  --jk-amber-lt:   #FDF2E4;  /* amber wash for callout panels           */
  --jk-sand:       #E8C9A0;  /* warm light — bar tracks, dark-band rule */
  --jk-sand-lt:    #F6E7D4;  /* selected-option fill                    */

  /* ---- neutrals (warm, never grey-blue) ---- */
  --jk-parchment:  #FAF6F1;  /* section background                      */
  --jk-parchment-2:#F2EAE1;  /* deeper parchment                        */
  --jk-muted:      #6E625C;  /* secondary text — 5.4:1 on white         */
  --jk-line:       rgba(22,16,13,.10);
  --jk-line-2:     rgba(22,16,13,.16);
  --jk-white:      #FFFFFF;

  /* ---- RAG / status ----
     The brand accent is itself a warm red, so the "critical" signal is
     pushed cooler and brighter than terracotta (hue ~0° vs ~13°, higher
     value) to stay separable side-by-side. Status is never colour-alone:
     every RAG token ships with a text label and a shape. */
  --jk-red:        #C62828;
  --jk-red-dk:     #A31D1D;
  --jk-amber-sig:  #B87503;
  --jk-green:      #1E7A4A;
  --jk-green-lt:   #E8F3ED;

  /* ---- semantic accent (overridable by ?partner=) ---- */
  --accent:        var(--jk-terracotta);
  --accent-deep:   var(--jk-terra-deep);
  --accent-tint:   rgba(158,49,22,.10);
  --accent-tint-2: rgba(158,49,22,.18);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow:       0 6px 24px rgba(45,20,10,.07);
  --shadow-hover: 0 14px 36px rgba(45,20,10,.13);
  --shadow-lg:    0 18px 48px rgba(45,20,10,.16);
  --maxw: 1140px;
  --maxw-wide: 1280px;

  /* motion — one signature ease (decelerating, unhurried, "expensive")
     plus a small set of duration tokens applied consistently. */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-out: cubic-bezier(.33, 1, .68, 1);
  --dur-fast: .18s;
  --dur-base: .32s;
  --dur-slow: .6s;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;

  /* ---- spacing scale ----
     A flat section padding makes a dense data block and a two-line
     statement occupy the same vertical envelope, which is what produced
     the dead zones. These let rhythm follow content: tight between
     related blocks, generous between movements. */
  --s-1: .25rem; --s-2: .5rem;  --s-3: .75rem; --s-4: 1rem;
  --s-5: 1.5rem; --s-6: 2rem;   --s-7: 3rem;   --s-8: 4rem;
  --s-9: 5.5rem; --s-10: 7rem;
  --sec-y: clamp(3.5rem, 6vw, 5.5rem);   /* standard movement */
  --sec-y-tight: clamp(2.5rem, 4vw, 3.5rem);
}

/* ============================================================
   FIGURES — read this before touching numeric type.

   Cormorant Garamond ships OLD-STYLE (text) figures by default: "11"
   renders as "II", the 3 in "$1.3" drops below the baseline, and the 0
   in "110+" sits at x-height. That is correct for running prose and
   actively wrong for data — in the venture tools it made "12–24" read
   as "I2–24" and financial totals look broken.

   LINING is set at the root and inherited, rather than enumerated per
   selector. An allow-list is the wrong shape here: it silently misses
   inline-styled and JS-generated markup — which is exactly what happened
   to the hero stat figures on the first attempt — and every new numeric
   surface would have to remember to opt in. DM Sans carries only lining
   figures, so this is a no-op for body copy and corrects Cormorant
   everywhere it is used, including markup that does not exist yet.
   ============================================================ */
body { font-variant-numeric: lining-nums; }

/* Tabular on top, for figures that sit in columns or update in place, so
   digits keep a constant advance width and numbers do not jitter as they
   change under the cursor. */
.tnum, .kpi .kv, .meter-val, .pg-meter, .stack-row .sv, .metrics .m .v,
.index-ring .inner b, .result-panel .rng, .dtable td.num, .dtable th.num,
.gap-table td, #capex-total, .field input[type="number"],
.holder-row input[type="number"], #lookthrough td {
  font-variant-numeric: lining-nums tabular-nums;
}

/* ---------- reset / base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--jk-ink);
  background: var(--jk-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* Tracking is optical, not fixed: a display face set at 3.6rem needs to be
   pulled tighter than the same face at 1.3rem, where negative tracking just
   makes it muddy. Line-height tightens as size grows for the same reason.
   text-wrap:balance stops a headline stranding one word on its own line. */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; margin: 0 0 .4em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem);   line-height: 1.06; letter-spacing: -.022em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.12; letter-spacing: -.016em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem);  line-height: 1.18; letter-spacing: -.008em; }
h4 { line-height: 1.25; letter-spacing: 0; }
/* Body copy wants a sane measure and no orphans. */
p { text-wrap: pretty; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.eyebrow { font-family: var(--sans); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: .72rem; color: var(--accent); margin: 0 0 .8rem; }
.muted { color: var(--jk-muted); }
.center { text-align: center; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: var(--maxw-wide); margin: 0 auto; padding: 0 24px; }
section { padding: var(--sec-y) 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
/* On the ink surfaces a terracotta ring disappears into the background; the
   focus indicator has to be visible against whatever it lands on. */
.band-dark :focus-visible, .hero-ink :focus-visible,
.result-panel :focus-visible, .footer :focus-visible { outline-color: var(--jk-amber); }

/* Selection picks up the brand rather than the browser's default blue. */
::selection { background: var(--jk-sand); color: var(--jk-ink); }
.band-dark ::selection, .hero-ink ::selection, .result-panel ::selection,
.footer ::selection { background: var(--jk-amber); color: var(--jk-ink); }

/* Anchored jumps must clear the sticky header instead of hiding the
   heading behind it. */
:target { scroll-margin-top: 88px; }
[id] { scroll-margin-top: 88px; }

/* skip link — keyboard users land here first */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--jk-ink); color: #fff; padding: .8rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) 0; font-weight: 700; font-size: .9rem;
}
.skip-link:focus { left: 0; text-decoration: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-weight: 700; font-size: .98rem;
  padding: .85rem 1.5rem; border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  text-decoration: none; will-change: transform;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: .05s; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
/* On the ink surfaces a terracotta ring disappears into the background; the
   focus indicator has to be visible against whatever it lands on. */
.band-dark :focus-visible, .hero-ink :focus-visible,
.result-panel :focus-visible, .footer :focus-visible { outline-color: var(--jk-amber); }

/* Selection picks up the brand rather than the browser's default blue. */
::selection { background: var(--jk-sand); color: var(--jk-ink); }
.band-dark ::selection, .hero-ink ::selection, .result-panel ::selection,
.footer ::selection { background: var(--jk-amber); color: var(--jk-ink); }

/* Anchored jumps must clear the sticky header instead of hiding the
   heading behind it. */
:target { scroll-margin-top: 88px; }
[id] { scroll-margin-top: 88px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); box-shadow: 0 8px 22px rgba(158,49,22,.34); }
.btn-primary:disabled { background: var(--jk-muted); cursor: not-allowed; opacity: .65; transform: none; box-shadow: none; }
/* the "ember" button — the warm gradient CTA, brand's loudest voice */
.btn-ember { background: linear-gradient(135deg, var(--jk-ember) 0%, var(--jk-terracotta) 100%); color: #fff; }
.btn-ember:hover { background: linear-gradient(135deg, #d2601f 0%, #ad3617 100%); box-shadow: 0 10px 26px rgba(196,85,31,.40); color: #fff; }
.btn-amber { background: var(--jk-amber); color: var(--jk-ink); }
.btn-amber:hover { background: #ea9743; box-shadow: 0 8px 22px rgba(224,138,52,.40); }
.btn-ghost { background: transparent; color: var(--jk-ink); border-color: var(--jk-line-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost:disabled { border-color: var(--jk-line); color: var(--jk-muted); cursor: not-allowed; transform: none; }
.btn-ghost-lt { background: transparent; color: #fff; border-color: rgba(255,255,255,.34); }
.btn-ghost-lt:hover { border-color: #fff; background: rgba(255,255,255,.08); color: #fff; }
.btn-dark { background: var(--jk-ink); color: #fff; }
.btn-dark:hover { background: #2a1e18; box-shadow: 0 8px 22px rgba(22,16,13,.30); }
.btn-lg { padding: 1.05rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: .55rem 1rem; font-size: .86rem; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.93); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--jk-line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; font-family: var(--serif); font-weight: 700; font-size: 1.22rem; color: var(--jk-ink); }
.brand:hover { text-decoration: none; }
.brand .logo { width: 42px; height: 42px; flex: 0 0 auto; }
.brand small { display: block; font-family: var(--sans); font-weight: 500; font-size: .6rem; letter-spacing: .13em; text-transform: uppercase; color: var(--jk-muted); }
.nav-links { display: flex; align-items: center; gap: 1.3rem; }
.nav-links a { color: var(--jk-ink); font-weight: 600; font-size: .93rem; transition: color var(--dur-fast) var(--ease); }
.dd-caret { display: inline-block; vertical-align: -1px; margin-left: .18rem; opacity: .55; transition: transform var(--dur-base) var(--ease), opacity var(--dur-fast) var(--ease); }
.dropdown:hover .dd-caret, .dropdown:focus-within .dd-caret { transform: rotate(180deg); opacity: 1; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
.nav-current { color: var(--accent); font-weight: 700; font-size: .93rem; cursor: default; position: relative; }
.nav-current::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--accent); border-radius: 2px; }
.nav-links a.nav-section { color: var(--accent); font-weight: 700; position: relative; }
.nav-links a.nav-section::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--accent); opacity: .45; border-radius: 2px; }
@media (max-width: 980px) { .nav-current::after, .nav-links a.nav-section::after { display: none; } }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--jk-ink); line-height: 1; padding: .2rem .4rem; }

/* dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: 130%; left: 0; min-width: 268px;
  background: #fff; border: 1px solid var(--jk-line-2); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: .5rem; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease), visibility var(--dur-base);
  z-index: 100;
}
.dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a { display: block; padding: .55rem .7rem; border-radius: 6px; font-size: .89rem; }
.dropdown-menu a:hover { background: var(--jk-parchment); text-decoration: none; }
.dropdown-menu .dd-head { font-size: .66rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--jk-muted); padding: .5rem .7rem .2rem; }
@media (max-width: 980px) {
  .dropdown-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 1rem; min-width: 0; }
}

/* ---------- hero ---------- */
.hero { background: linear-gradient(180deg, var(--jk-parchment) 0%, #fff 100%); padding: 84px 0 64px; position: relative; overflow: hidden; }
.hero h1 span { color: var(--accent); }
.hero .lead { font-size: 1.18rem; color: #362923; max-width: 640px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.8rem; }
/* Centring a tall left stack against a shorter right panel left both
   floating. Aligning to the top lets the headline and the panel share a
   baseline and kills the dead band under the hero. */
.hero-grid { display: grid; grid-template-columns: 1.12fr .88fr; gap: clamp(32px, 4vw, 56px); align-items: start; }
/* The hero carries the emblem alone — the ring reads as a graphic device
   at this size, where the full lockup read as a second logo. */
.hero-mark { width: 82px; height: 82px; margin: 0 0 1.4rem; }
.hero-logo { height: 132px; width: auto; margin: -8px 0 1.1rem -4px; }

/* dark hero variant — the phoenix on ink, used on the platform home */
.hero-ink {
  padding: clamp(3.5rem, 6vw, 5rem) 0 clamp(3rem, 5vw, 4.5rem);
  background:
    radial-gradient(900px 520px at 12% 18%, rgba(158,49,22,.42) 0%, transparent 62%),
    radial-gradient(700px 460px at 78% 8%, rgba(224,138,52,.20) 0%, transparent 60%),
    var(--jk-ink);
  color: #fff; position: relative; overflow: hidden;
}
.hero-ink h1 { color: #fff; }
.hero-ink h1 span { color: var(--jk-amber); }
.hero-ink .lead { color: rgba(255,255,255,.82); }
.hero-ink .eyebrow { color: var(--jk-amber); }
.hero-ink .trust-strip { border-top-color: rgba(255,255,255,.16); }
.hero-ink .trust-strip .ti { color: rgba(255,255,255,.9); }
.hero-ink .trust-strip .ti svg { color: var(--jk-amber); }

/* trust strip */
.trust-strip { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 2rem; padding-top: 1.6rem; border-top: 1px solid var(--jk-line); }
.trust-strip .ti { display: flex; align-items: center; gap: .55rem; font-size: .89rem; font-weight: 600; color: #362923; }
.trust-strip .ti svg { color: var(--jk-green); flex: 0 0 auto; }

/* ---------- the two doors (audience split) ---------- */
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.door {
  position: relative; display: block; padding: 34px 32px 30px;
  border-radius: var(--radius-lg); border: 1px solid var(--jk-line-2);
  background: #fff; color: var(--jk-ink); overflow: hidden;
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.door::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 5px;
  background: linear-gradient(180deg, var(--jk-ember), var(--jk-terracotta));
  transition: width var(--dur-base) var(--ease);
}
.door:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: var(--accent); text-decoration: none; }
.door:hover::before { width: 8px; }
.door:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.door .door-k { font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.door h3 { font-size: 1.55rem; margin: .5rem 0 .5rem; }
.door p { color: var(--jk-muted); font-size: .93rem; margin-bottom: 1rem; }
.door ul { margin: 0 0 1.2rem; padding-left: 1.1rem; }
.door li { font-size: .87rem; color: #45362f; margin-bottom: .3rem; }
.door .door-go { font-weight: 700; font-size: .92rem; color: var(--accent); display: inline-flex; align-items: center; gap: .4rem; }
.door:hover .door-go { gap: .7rem; }
.door .door-go span { transition: transform var(--dur-base) var(--ease); }

/* ---------- cards / grids ---------- */
.grid { display: grid; gap: 24px; }
/* grid children default to min-width:auto, which lets wide content blow out
   the track and overflow the page — min-width:0 lets them shrink instead. */
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2,1fr); }
.g3 { grid-template-columns: repeat(3,1fr); }
/* Four tracks across a 1140px container left roughly a 30-character
   measure — technically legible, but it reads as cramped and stacks
   two-word lines. Cards get more room and a floor on their width. */
.g4 { grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }
.card { background: #fff; border: 1px solid var(--jk-line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--jk-line-2); }
.card h3 { margin-top: 0; }
.card .ref { font-family: var(--sans); font-weight: 700; font-size: .72rem; letter-spacing: .1em; color: var(--accent); }
.card-flat { box-shadow: none; }
.card-flat:hover { transform: none; box-shadow: var(--shadow); }

/* domain / feature tiles */
.tile { background: var(--jk-parchment); border-radius: var(--radius); padding: 22px; border-left: 4px solid var(--jk-ember);
  transition: transform var(--dur-base) var(--ease), border-left-width var(--dur-fast) var(--ease); }
.tile:hover { transform: translateY(-3px); border-left-width: 6px; }
.tile h4 { margin: 0 0 .35rem; font-family: var(--sans); font-weight: 700; font-size: 1rem; }
.tile p { margin: 0; font-size: .88rem; color: var(--jk-muted); }

/* ---------- bands ---------- */
.band-dark { background: var(--jk-ink); color: #fff; }
/* A metrics strip is a punctuation mark between movements; giving it the
   full section envelope is what left it floating in dead space. */
section.band-dark:has(.metrics) { padding: var(--sec-y-tight) 0; }
.band-dark h2, .band-dark h3, .band-dark h4 { color: #fff; }
.band-dark .eyebrow { color: var(--jk-amber); }
.band-dark .muted { color: rgba(255,255,255,.66); }
.band-ember { background: linear-gradient(135deg, var(--jk-terracotta) 0%, var(--jk-oxblood) 100%); color: #fff; }
.band-ember h2, .band-ember h3, .band-ember p { color: #fff; }
.band-ember .eyebrow { color: var(--jk-sand); }
.band-parchment { background: var(--jk-parchment); }

/* metric tiles */
.metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: rgba(255,255,255,.12); border-radius: var(--radius); overflow: hidden; }
.metrics .m { background: var(--jk-ink); padding: 30px 18px 26px; text-align: center; }
.metrics .m .v { font-family: var(--serif); font-size: clamp(2rem, 3.4vw, 2.6rem); font-weight: 700; color: var(--jk-amber); line-height: 1; letter-spacing: -.02em; }
.metrics .m .l { font-size: .8rem; color: #d3c8c2; margin-top: .4rem; }
.metrics .m .src { font-size: .68rem; color: #8d817b; margin-top: .3rem; }

/* ---------- engagement phases ---------- */
.phases { counter-reset: ph; display: grid; grid-template-columns: repeat(5,1fr); gap: 18px; }
.phase { position: relative; padding: 24px 18px; background: #fff; border: 1px solid var(--jk-line); border-radius: var(--radius);
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease); }
.phase:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--jk-line-2); }
.phase::before { counter-increment: ph; content: counter(ph); display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; margin-bottom: .7rem; transition: transform var(--dur-base) var(--ease); }
.phase:hover::before { transform: scale(1.08); }
.phase .days { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--jk-ember); }
.phase h4 { font-family: var(--sans); font-size: .98rem; margin: .2rem 0 .4rem; }
.phase p { font-size: .82rem; color: var(--jk-muted); margin: 0; }
button.phase { text-align: left; font: inherit; cursor: pointer; display: block; width: 100%; }
button.phase:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
/* On the ink surfaces a terracotta ring disappears into the background; the
   focus indicator has to be visible against whatever it lands on. */
.band-dark :focus-visible, .hero-ink :focus-visible,
.result-panel :focus-visible, .footer :focus-visible { outline-color: var(--jk-amber); }

/* Selection picks up the brand rather than the browser's default blue. */
::selection { background: var(--jk-sand); color: var(--jk-ink); }
.band-dark ::selection, .hero-ink ::selection, .result-panel ::selection,
.footer ::selection { background: var(--jk-amber); color: var(--jk-ink); }

/* Anchored jumps must clear the sticky header instead of hiding the
   heading behind it. */
:target { scroll-margin-top: 88px; }
[id] { scroll-margin-top: 88px; }
.phase-hint { display: inline-block; margin-top: .6rem; font-size: .74rem; font-weight: 700; letter-spacing: .05em; color: var(--accent); }
.phase-detail { display: block; margin-top: .7rem; padding-top: .7rem; border-top: 1px dashed var(--jk-line-2); font-size: .82rem; }
.phase-detail b { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--jk-ember); margin: .5rem 0 .2rem; }
.phase-detail ul { margin: 0; padding-left: 1.05rem; color: var(--jk-muted); }
.phase-detail li { margin-bottom: .15rem; }
.phase-detail .po { color: var(--jk-ink); }
.phase.open { border-color: var(--accent); }

/* guarantee / callout box */
.guarantee { background: var(--jk-amber-lt); border: 1px solid var(--jk-amber); border-radius: var(--radius); padding: 22px 26px; display: flex; gap: 1rem; align-items: flex-start; }
.guarantee svg { color: var(--jk-ember); flex: 0 0 auto; }
.cta-alt { font-size: .84rem; color: var(--jk-muted); margin: .6rem 0 0; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-deep); text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--jk-ink); }

/* note / caution panels */
.note { border-left: 4px solid var(--accent); background: var(--jk-parchment); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 20px; font-size: .89rem; margin: 1rem 0; }
.note.warn { border-left-color: var(--jk-amber-sig); background: var(--jk-amber-lt); }
.note.ok { border-left-color: var(--jk-green); background: var(--jk-green-lt); }
.note b { display: block; margin-bottom: .2rem; }
/* A .note dropped inside a dark panel keeps its light background, so it must
   also re-assert dark ink — otherwise it inherits the panel's white text and
   renders invisible. */
.result-panel .note, .band-dark .note, .hero-ink .note { color: var(--jk-ink); }
.result-panel .note a, .band-dark .note a, .hero-ink .note a { color: var(--accent-deep); }

/* ---------- footer ---------- */
.footer { background: var(--jk-ink); color: #cbbfb8; padding: 54px 0 28px; }
.footer h4 { color: #fff; font-family: var(--sans); font-size: .88rem; letter-spacing: .06em; text-transform: uppercase; }
.footer a { color: #cbbfb8; }
.footer a:hover { color: var(--jk-amber); }
.footer .cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
.footer .ver { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: .77rem; color: #9a8c85; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.footer p { font-size: .89rem; margin-bottom: .45rem; }
/* the mark on dark surfaces uses the pre-lightened artwork, not a filter —
   brightness(0) invert(1) would flatten the gradient to a white silhouette
   and throw away the whole point of the phoenix. */
.logo-invert { filter: none; }

/* ============================================================
   DIAGNOSTIC (scorecard) page
   ============================================================ */
.diag-head { background: var(--jk-parchment); padding: 40px 0 26px; }
.reassure { background: var(--jk-green-lt); border: 1px solid rgba(30,122,74,.35); border-radius: var(--radius-sm); padding: .8rem 1.1rem; font-size: .91rem; display: flex; gap: .6rem; align-items: center; margin-top: 1rem; }
.reassure svg { color: var(--jk-green); flex: 0 0 auto; }

.diag-layout { display: grid; grid-template-columns: 1fr 290px; gap: 36px; align-items: start; padding: 40px 0 80px; }
@media (max-width: 900px){ .diag-layout { grid-template-columns: 1fr; } }

.progress-wrap { position: sticky; top: 72px; background: #fff; padding: 14px 0; z-index: 10; }
.progress-bar { height: 8px; background: var(--jk-parchment-2); border-radius: 99px; overflow: hidden; }
.progress-bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--jk-amber)); transition: width var(--dur-base) var(--ease); }
.progress-label { font-size: .82rem; color: var(--jk-muted); margin-top: .4rem; }

.domain { border: 1px solid var(--jk-line); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.domain > header { background: var(--jk-ink); color: #fff; padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.domain > header .dn-name { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; }
.domain > header .dn-w { font-size: .73rem; color: var(--jk-amber); letter-spacing: .06em; text-transform: uppercase; }
.domain .qbody { padding: 8px 22px 18px; }
.q { padding: 18px 0; border-bottom: 1px dashed var(--jk-line-2); }
.q:last-child { border-bottom: 0; }
.q .qtext { font-weight: 600; margin-bottom: .7rem; }
.q .qtext b { color: var(--accent); margin-right: .4rem; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; align-items: flex-start; gap: .6rem; padding: .6rem .8rem; border: 1px solid var(--jk-line-2); border-radius: var(--radius-sm); cursor: pointer; font-size: .9rem;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.opt:hover { border-color: var(--accent); background: var(--jk-parchment); transform: translateX(2px); }
.opt input { margin-top: .2rem; accent-color: var(--accent); }
.opt.sel { border-color: var(--accent); background: var(--jk-sand-lt); }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.privacy-panel { position: sticky; top: 88px; background: #fff; border: 1px solid var(--jk-green); border-radius: var(--radius); overflow: hidden; }
.privacy-panel header { background: var(--jk-green); color: #fff; padding: 14px 18px; display: flex; align-items: center; gap: .55rem; font-weight: 700; }
.privacy-panel ul { list-style: none; margin: 0; padding: 16px 18px; }
.privacy-panel li { display: flex; gap: .6rem; align-items: flex-start; font-size: .85rem; margin-bottom: .9rem; }
.privacy-panel li svg { color: var(--jk-green); flex: 0 0 auto; margin-top: .15rem; }

.diag-actions { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin-top: 8px; }

.partner-banner { background: var(--jk-sand-lt); border-radius: var(--radius-sm); padding: .7rem 1rem; font-size: .85rem; font-weight: 600; color: var(--accent-deep); display: none; align-items: center; gap: .6rem; }
body.has-partner .partner-banner { display: flex; }
.partner-logo { height: 30px; display: none; }
body.has-partner .partner-logo { display: block; }

/* ============================================================
   RESULTS page
   ============================================================ */
.score-hero { background: var(--jk-ink); color: #fff; padding: 48px 0; }
.score-hero h1 { color: #fff; }
.index-ring { --p: 0; width: 168px; height: 168px; border-radius: 50%;
  background: conic-gradient(var(--ring-color, var(--jk-amber)) calc(var(--p)*1%), rgba(255,255,255,.14) 0);
  display: grid; place-items: center; }
.index-ring .inner { width: 132px; height: 132px; border-radius: 50%; background: var(--jk-ink); display: grid; place-items: center; text-align: center; }
.index-ring .inner b { font-family: var(--serif); font-weight: 700; font-size: 2.8rem; color: #fff; line-height: 1; letter-spacing: -.02em; }
.index-ring .inner span { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--jk-amber); }
.score-hero .summary { display: flex; gap: 36px; align-items: center; flex-wrap: wrap; }

/* gap table */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gap-table { width: 100%; border-collapse: collapse; font-size: .91rem; min-width: 520px; }
.gap-table th, .gap-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--jk-line); }
.gap-table th { font-family: var(--sans); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--jk-muted); }
.gap-table tr:hover td { background: var(--jk-parchment); }
.barcell { min-width: 160px; }
.bar { height: 10px; background: var(--jk-parchment-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; }
.rag { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .82rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.rag-red .dot, .fill-red { background: var(--jk-red); } .rag-red { color: var(--jk-red-dk); }
.rag-amber .dot, .fill-amber { background: var(--jk-amber-sig); } .rag-amber { color: #96600a; }
.rag-green .dot, .fill-green { background: var(--jk-green); } .rag-green { color: var(--jk-green); }

.radar-box { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
@media (max-width: 820px){ .radar-box { grid-template-columns: 1fr; } }

/* prescriber */
.rx { border-left: 4px solid var(--accent); background: var(--jk-parchment); border-radius: 0 var(--radius) var(--radius) 0; padding: 20px 24px; margin-bottom: 16px;
  transition: border-left-width var(--dur-fast) var(--ease), box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease); }
.rx:hover { border-left-width: 6px; box-shadow: 0 2px 8px rgba(158,49,22,.12); }
.rx h4 { margin: 0 0 .3rem; font-family: var(--sans); font-size: 1.05rem; }
.rx .cat { font-size: .9rem; font-style: italic; color: var(--jk-muted); margin-top: .2rem; }
.rx .jk-tool { font-size: .84rem; color: var(--accent-deep); margin-top: .8rem; font-weight: 600; }
.rx .jk-tool a { color: var(--accent-deep); }
.rx .std { font-size: .82rem; color: var(--jk-ink); margin-top: .4rem; }
.disclaimer { font-size: .8rem; color: var(--jk-muted); font-style: italic; }
.bench { font-size: .78rem; color: var(--accent-deep); margin-top: .45rem; line-height: 1.45; }
.bench b { font-weight: 700; }
.bench .src { color: var(--jk-muted); font-style: italic; }
.std strong { color: var(--accent-deep); }

.sources { background: var(--jk-parchment); padding: 28px 0; }
.sources ul { margin: .4rem 0 .8rem; padding-left: 1.1rem; columns: 2; column-gap: 32px; }
.sources li { font-size: .84rem; color: var(--jk-ink); margin-bottom: .3rem; }
@media (max-width: 680px){ .sources ul { columns: 1; } }

/* locked toolboxes */
.locked-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.toolcard { border: 1px solid var(--jk-line-2); border-radius: var(--radius); padding: 18px; position: relative; background: #fff; min-height: 140px; }
.toolcard[href] { cursor: pointer; display: block;
  transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease); }
.toolcard[href]:hover { border-color: var(--accent); box-shadow: 0 12px 30px rgba(158,49,22,.18); transform: translateY(-3px); text-decoration: none; }
.toolcard[href]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
/* On the ink surfaces a terracotta ring disappears into the background; the
   focus indicator has to be visible against whatever it lands on. */
.band-dark :focus-visible, .hero-ink :focus-visible,
.result-panel :focus-visible, .footer :focus-visible { outline-color: var(--jk-amber); }

/* Selection picks up the brand rather than the browser's default blue. */
::selection { background: var(--jk-sand); color: var(--jk-ink); }
.band-dark ::selection, .hero-ink ::selection, .result-panel ::selection,
.footer ::selection { background: var(--jk-amber); color: var(--jk-ink); }

/* Anchored jumps must clear the sticky header instead of hiding the
   heading behind it. */
:target { scroll-margin-top: 88px; }
[id] { scroll-margin-top: 88px; }
.toolcard .lockicon { position: absolute; top: 14px; right: 14px; color: var(--jk-muted); }
.toolcard.unlocked .lockicon { color: var(--jk-green); }
.toolcard h4 { font-family: var(--sans); font-size: .95rem; margin: 0 0 .3rem; padding-right: 1.6rem; }
.toolcard .ref { font-size: .7rem; font-weight: 700; letter-spacing: .08em; color: var(--accent); }
.toolcard p { font-size: .82rem; color: var(--jk-muted); margin: .4rem 0 0; }
.keybar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: 10px 0 22px; }
.keybar input { padding: .7rem .9rem; border: 1px solid var(--jk-line-2); border-radius: var(--radius-sm); font-family: var(--sans); font-size: .95rem; min-width: 230px; }
.keymsg { font-size: .85rem; font-weight: 600; }
.empty { text-align: center; padding: 80px 20px; }

/* ============================================================
   SHARED TOOL CHROME — used by every tool page
   ============================================================ */
.tool-head { background: var(--jk-parchment); padding: 40px 0 30px; border-bottom: 1px solid var(--jk-line); }
.tool-head .ref { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.tool-head h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); margin-bottom: .3rem; }
.tool-head .lead { font-size: 1.05rem; color: #45362f; max-width: 720px; }

/* form fields */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .91rem; margin-bottom: .35rem; }
.field .hint { font-size: .78rem; color: var(--jk-muted); margin-top: .25rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .78rem 1rem; border: 1px solid var(--jk-line-2);
  border-radius: var(--radius-sm); font-size: 1rem; font-family: var(--sans);
  background: #fff; color: var(--jk-ink);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.field input[type="number"] { font-variant-numeric: tabular-nums; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field-row > * { min-width: 0; }
@media (max-width: 620px){ .field-row { grid-template-columns: 1fr; } }

.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.calc > * { min-width: 0; }
@media (max-width: 900px){ .calc { grid-template-columns: 1fr; } }
.result-panel { background: var(--jk-ink); color: #fff; border-radius: var(--radius); padding: 30px; }
.result-panel h3 { color: #fff; }
.result-panel .rng { font-family: var(--serif); font-weight: 700; font-size: 2.5rem; color: var(--jk-amber); line-height: 1.1; letter-spacing: -.02em; }
.result-panel .qual { margin-top: .6rem; color: #ded4ce; }
.result-panel .muted { color: rgba(255,255,255,.6); }

/* sticky results rail on wide tool pages.
   Grid children default to min-width:auto, which means a wide child — a
   .dtable with a min-width inside an overflow-x:auto scroller — pushes its
   whole track wider than the viewport instead of scrolling inside its own
   box. min-width:0 lets the track shrink and hands the overflow back to
   the scroller that was built to take it. */
.tool-layout { display: grid; grid-template-columns: 1fr 380px; gap: 36px; align-items: start; }
.tool-layout > * { min-width: 0; }
@media (max-width: 1000px){ .tool-layout { grid-template-columns: 1fr; } }
.rail { position: sticky; top: 88px; min-width: 0; }

/* segmented control / sector picker */
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.seg {
  border: 1px solid var(--jk-line-2); background: #fff; color: var(--jk-ink);
  border-radius: 99px; padding: .5rem 1.05rem; font: inherit; font-size: .87rem; font-weight: 600;
  cursor: pointer; transition: all var(--dur-fast) var(--ease);
}
.seg:hover { border-color: var(--accent); color: var(--accent); }
.seg[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* sector cards */
.sector-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 18px; }
.sector-grid > * { min-width: 0; }
.sector {
  text-align: left; font: inherit; cursor: pointer; position: relative;
  background: #fff; border: 1.5px solid var(--jk-line-2); border-radius: var(--radius);
  padding: 22px 22px 20px; transition: all var(--dur-base) var(--ease);
}
.sector:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.sector[aria-pressed="true"] { border-color: var(--accent); background: linear-gradient(180deg, var(--jk-amber-lt) 0%, #fff 70%); box-shadow: var(--shadow); }
.sector[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 16px; right: 18px; color: #fff; background: var(--accent); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .76rem; font-weight: 700; }
.sector:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
/* On the ink surfaces a terracotta ring disappears into the background; the
   focus indicator has to be visible against whatever it lands on. */
.band-dark :focus-visible, .hero-ink :focus-visible,
.result-panel :focus-visible, .footer :focus-visible { outline-color: var(--jk-amber); }

/* Selection picks up the brand rather than the browser's default blue. */
::selection { background: var(--jk-sand); color: var(--jk-ink); }
.band-dark ::selection, .hero-ink ::selection, .result-panel ::selection,
.footer ::selection { background: var(--jk-amber); color: var(--jk-ink); }

/* Anchored jumps must clear the sticky header instead of hiding the
   heading behind it. */
:target { scroll-margin-top: 88px; }
[id] { scroll-margin-top: 88px; }
/* Emoji glyphs have wildly different intrinsic heights, so a bare
   line-height:1 leaves the titles misaligned across a row. Fixing the box
   height puts every title on the same baseline. */
.sector .s-ico { font-size: 1.6rem; line-height: 1; display: flex; align-items: center; height: 2rem; margin-bottom: .45rem; }
.sector h4 { font-family: var(--sans); font-size: 1rem; margin: 0 0 .25rem; padding-right: 1.8rem; }
.sector p { font-size: .82rem; color: var(--jk-muted); margin: 0; }
.sector .s-reg { font-size: .72rem; color: var(--accent-deep); font-weight: 600; margin-top: .55rem; }

/* ---------- certification phase rail ---------- */
.phase-rail { display: grid; gap: 14px; }
.pgate {
  border: 1px solid var(--jk-line-2); border-radius: var(--radius); overflow: hidden; background: #fff;
  transition: border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.pgate.is-open { border-color: var(--accent); box-shadow: var(--shadow); }
/* the phase title is an <h3> wrapping the disclosure button (the ARIA
   accordion pattern), so these are descendant rather than child selectors */
.pg-h { margin: 0; font: inherit; }
.pgate .pg-head {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 20px;
  background: none; border: 0; font: inherit; text-align: left; cursor: pointer;
}
.pgate .pg-head:hover { background: var(--jk-parchment); }
.pgate .pg-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.pg-num {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--jk-parchment-2); color: var(--jk-muted); font-weight: 700; font-size: .95rem;
  border: 2px solid transparent; transition: all var(--dur-base) var(--ease);
}
.pgate.done .pg-num { background: var(--jk-green); color: #fff; }
.pgate.active .pg-num { background: var(--accent); color: #fff; }
.pg-title { flex: 1; min-width: 0; }
.pg-title b { display: block; font-family: var(--sans); font-size: 1rem; }
.pg-title span { font-size: .8rem; color: var(--jk-muted); }
.pg-meter { flex: 0 0 auto; text-align: right; font-size: .8rem; font-weight: 700; color: var(--jk-muted); min-width: 64px; }
.pgate.done .pg-meter { color: var(--jk-green); }
.pg-body { padding: 4px 20px 20px 72px; border-top: 1px dashed var(--jk-line-2); }
@media (max-width: 620px){ .pg-body { padding-left: 20px; } }
.pg-body h4 { font-family: var(--sans); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--jk-ember); margin: 1.1rem 0 .5rem; font-weight: 700; }
.pg-body h4:first-child { margin-top: .8rem; }

/* checklist item */
.chk { display: flex; gap: .7rem; align-items: flex-start; padding: .5rem .6rem; border-radius: var(--radius-sm); cursor: pointer; font-size: .89rem;
  transition: background-color var(--dur-fast) var(--ease); }
.chk:hover { background: var(--jk-parchment); }
.chk input { margin-top: .28rem; accent-color: var(--accent); flex: 0 0 auto; width: 16px; height: 16px; }
.chk.done .chk-t { text-decoration: line-through; color: var(--jk-muted); }
.chk-t b { display: block; font-weight: 600; }
.chk-t small { display: block; color: var(--jk-muted); font-size: .8rem; margin-top: .1rem; }
.chk:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }

/* regulatory citation chip */
.cite {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .7rem; font-weight: 700;
  padding: .16rem .55rem; border-radius: 99px; letter-spacing: .02em;
  background: var(--accent-tint); color: var(--accent-deep); border: 1px solid transparent;
  white-space: nowrap; margin: .3rem .3rem 0 0;
}
.cite.unverified { background: var(--jk-amber-lt); color: #8a5a06; border-color: rgba(184,117,3,.4); }
.cite.unverified::before { content: "?"; font-weight: 800; }
.cite a { color: inherit; text-decoration: underline; }

/* readiness meter */
.meter { display: flex; align-items: center; gap: 12px; }
.meter-track { flex: 1; height: 12px; background: var(--jk-parchment-2); border-radius: 99px; overflow: hidden; }
.meter-track > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--jk-ember), var(--jk-amber)); transition: width var(--dur-slow) var(--ease); }
.meter-val { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; min-width: 68px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- capital stack ---------- */
.stack { display: grid; gap: 6px; margin: 1rem 0; }
.stack-row { display: grid; grid-template-columns: 132px 1fr 96px; align-items: center; gap: 12px; font-size: .86rem; }
.stack-row .sl { font-weight: 600; }
.stack-row .sv { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.stack-bar { height: 22px; border-radius: 5px; background: var(--jk-parchment-2); overflow: hidden; }
.stack-bar > i { display: block; height: 100%; transition: width var(--dur-slow) var(--ease); }
.sb-debt   > i { background: linear-gradient(90deg, var(--jk-oxblood), var(--jk-terracotta)); }
.sb-equity > i { background: linear-gradient(90deg, var(--jk-terracotta), var(--jk-ember)); }
.sb-sub    > i { background: linear-gradient(90deg, var(--jk-ember), var(--jk-amber)); }
.sb-grant  > i { background: linear-gradient(90deg, var(--jk-amber), var(--jk-sand)); }
.sb-gap    > i { background: repeating-linear-gradient(45deg, var(--jk-red) 0 8px, #d94a4a 8px 16px); }
@media (max-width: 560px){ .stack-row { grid-template-columns: 96px 1fr 78px; font-size: .8rem; } }

/* KPI strip inside tools */
/* Tiles stretch to a common height so a two-line label never leaves its
   neighbour floating in a short box. */
.kpis { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 14px; align-items: stretch; }
.kpis > * { min-width: 0; }
.kpi { background: var(--jk-parchment); border-radius: var(--radius-sm); padding: 16px 18px; border-left: 3px solid var(--accent);
  display: flex; flex-direction: column; justify-content: flex-start; }
/* A currency figure must never break between its unit and its number —
   "USD 6.33M" split across two lines reads as two separate facts. The size
   is fluid so a long value shrinks to fit rather than wrapping. */
.kpi .kv {
  font-family: var(--serif); font-weight: 700; line-height: 1.08;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  letter-spacing: -.015em; white-space: nowrap;
  overflow-wrap: normal; hyphens: none;
}
.kpi .kl { font-size: .72rem; color: var(--jk-muted); letter-spacing: .05em; text-transform: uppercase; margin-top: .3rem; line-height: 1.3; text-wrap: balance; }
.kpi.is-red   { border-left-color: var(--jk-red);       } .kpi.is-red .kv   { color: var(--jk-red-dk); }
.kpi.is-amber { border-left-color: var(--jk-amber-sig); } .kpi.is-amber .kv { color: #96600a; }
.kpi.is-green { border-left-color: var(--jk-green);     } .kpi.is-green .kv { color: var(--jk-green); }
.result-panel .kpi { background: rgba(255,255,255,.07); border-left-color: var(--jk-amber); }
.result-panel .kpi .kv { color: #fff; }
.result-panel .kpi .kl { color: rgba(255,255,255,.62); }

/* data table (structure/org/venture tools) */
.dtable { width: 100%; border-collapse: collapse; font-size: .87rem; min-width: 560px; }
.dtable th, .dtable td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--jk-line); vertical-align: top; }
.dtable th { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--jk-muted); font-weight: 700; background: var(--jk-parchment); }
.dtable tbody tr:hover td { background: var(--jk-parchment); }
.dtable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dtable tfoot td { font-weight: 700; border-top: 2px solid var(--jk-line-2); border-bottom: 0; }

/* ---------- corporate structure diagram ---------- */
/* Grid tracks size to their content's minimum by default, so a fixed-width
   input inside a tier can push the whole tree wider than its column.
   min-width:0 on every level keeps the tree inside the layout column. */
.entity-tree { display: grid; gap: 0; }
.entity-tree > *, .tier > *, .entity { min-width: 0; }
.tier { position: relative; padding: 0 0 34px; }
.tier:last-child { padding-bottom: 0; }
/* connector from each tier down to the next */
.tier:not(:last-child)::after {
  content: ""; position: absolute; left: 50%; bottom: 8px; width: 2px; height: 26px;
  background: linear-gradient(180deg, var(--jk-ember), var(--jk-sand)); transform: translateX(-50%);
}
.entity {
  border: 1.5px solid var(--jk-line-2); border-radius: var(--radius); background: #fff;
  padding: 18px 22px; box-shadow: var(--shadow);
}
.entity.is-hold { border-color: var(--jk-terracotta); border-top: 4px solid var(--jk-terracotta); }
.entity.is-spv  { border-color: var(--jk-ember);      border-top: 4px solid var(--jk-ember); }
.entity.is-op   { border-color: var(--jk-amber);      border-top: 4px solid var(--jk-amber); }
.entity.is-trust{ border-color: var(--jk-oxblood);    border-top: 4px solid var(--jk-oxblood); }
.entity .e-jur { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--jk-muted); }
.entity h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; margin: .2rem 0 .5rem; letter-spacing: 0; }
.entity .e-note { font-size: .8rem; color: var(--jk-muted); margin: 0; }
/* Holder rows carry a flexible name field and a fixed percentage field;
   let them wrap rather than overflow on a narrow phone. */
.holder-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .4rem; }
.holder-row > input[type="text"] { flex: 1 1 140px; min-width: 0; }
.holder-row > input[type="number"] { flex: 0 0 84px; width: 84px; }
.holders { display: flex; flex-wrap: wrap; gap: 8px; margin: .6rem 0 .2rem; }
.holder { font-size: .78rem; background: var(--jk-parchment); border: 1px solid var(--jk-line); border-radius: 99px; padding: .25rem .7rem; }
.holder b { color: var(--accent-deep); }

/* ---------- organogram ---------- */
.org-level { display: grid; gap: 14px; margin-bottom: 26px; }
.org-level h5 { font-family: var(--sans); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--jk-ember); margin: 0 0 .2rem; }
.org-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 14px; }
.org-row > * { min-width: 0; }
.role {
  border: 1px solid var(--jk-line-2); border-radius: var(--radius-sm); padding: 14px 16px; background: #fff;
  transition: border-color var(--dur-base) var(--ease), transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.role:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.role.is-postholder { border-left: 4px solid var(--jk-terracotta); background: linear-gradient(90deg, var(--jk-amber-lt) 0%, #fff 40%); }
.role.is-vacant { border-style: dashed; background: var(--jk-parchment); }
.role b { display: block; font-family: var(--sans); font-size: .93rem; }
.role .r-rep { font-size: .76rem; color: var(--jk-muted); margin-top: .18rem; }
.role .r-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: .5rem; }
.tag { font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .16rem .5rem; border-radius: 4px; background: var(--jk-parchment-2); color: var(--jk-muted); }
.tag.kcaa { background: var(--accent-tint); color: var(--accent-deep); }
.tag.dep  { background: var(--jk-green-lt); color: var(--jk-green); }
.tag.gap  { background: #fdecec; color: var(--jk-red-dk); }

/* ---------- utilities ---------- */
.mt0{margin-top:0}.mb0{margin-bottom:0}.mt1{margin-top:1rem}.mt2{margin-top:2rem}.mb1{margin-bottom:1rem}.mb2{margin-bottom:2rem}
.flex{display:flex}.between{justify-content:space-between}.items-center{align-items:center}.gap{gap:1rem}.wrapf{flex-wrap:wrap}
.pill { display:inline-block; padding:.3rem .8rem; border-radius:99px; background:var(--jk-sand-lt); color:var(--accent-deep); font-size:.78rem; font-weight:700; }
.pill-ghost { background: transparent; border: 1px solid var(--jk-line-2); color: var(--jk-muted); }
.small { font-size: .84rem; }
.tnum { font-variant-numeric: tabular-nums; }

@media (max-width: 980px){
  .hero-grid, .g4, .g3, .g2, .metrics, .phases, .locked-grid, .footer .cols, .doors { grid-template-columns: 1fr; }
  .g4, .metrics { grid-template-columns: 1fr 1fr; }
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; position: absolute; top: 72px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 1rem 24px; border-bottom: 1px solid var(--jk-line); gap: .5rem; box-shadow: var(--shadow); max-height: calc(100vh - 72px); overflow-y: auto; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .hero-logo { height: 100px; }
  .hero-mark { width: 64px; height: 64px; margin-bottom: 1.1rem; }
}
@media (max-width: 620px){
  .g4, .metrics, .footer .cols { grid-template-columns: 1fr; }
}

/* print-only branded header (hidden on screen) */
.print-head { display: none; align-items: center; gap: 18px; padding: 0 0 14px; border-bottom: 2px solid var(--jk-ink); margin-bottom: 18px; }
.print-head img { height: 64px; width: auto; }
.print-head .ph-meta { font-size: .92rem; line-height: 1.4; }

@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; }
  body { color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .nav, .footer, .diag-actions, .btn, .nav-toggle, #retake, #print,
  .keybar, .locked-grid, .jk-rec-panel, .empty, .skip-link,
  .email-capture-section, .book-cta-section, .share-bar, .shared-banner,
  #calibrate-section, #capture-nudge, .no-print { display: none !important; }
  .print-head { display: flex !important; }
  .score-hero, .result-panel, .band-dark, .band-ember, .hero-ink { background: #fff !important; color: #000 !important; padding: 0 0 10px !important; }
  .score-hero .eyebrow, .score-hero h1, .score-hero #index-text, .score-hero #index-band,
  .result-panel *, .band-dark *, .band-dark h2, .band-dark h3, .band-ember h2, .band-ember p,
  .hero-ink *, .result-panel .kpi .kv, .result-panel .kpi .kl { color: var(--jk-ink) !important; }
  .band-parchment, .sources, .tool-head { background: #fff !important; }
  section { padding: 12px 0 !important; }
  .rag, .bar, .bar > i, .index-ring, #radar polygon, #radar circle, .dot,
  .meter-track > i, .stack-bar > i, .kpi { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .rx, .gap-table tr, .radar-box, .guarantee, .summary, .print-head,
  .pgate, .entity, .role, .kpi, .stack-row { break-inside: avoid; page-break-inside: avoid; }
  h1, h2 { page-break-after: avoid; }
  a[data-email] { color: var(--jk-ink) !important; text-decoration: underline; }
  .table-scroll { overflow: visible !important; }
  /* every collapsed disclosure prints expanded — a printed pack must be complete */
  .pg-body[hidden], .phase-detail[hidden] { display: block !important; }
  /* Scroll-reveal must never reach paper. A visitor who lands and prints
     immediately has scrolled nothing, so every un-revealed block would
     print blank. */
  .has-reveal .will-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .card, .entity, .pgate { box-shadow: none !important; }
}

/* ============================================================
   Share / capture / book-a-call
   ============================================================ */
.shared-banner {
  background: var(--jk-amber-lt); border: 1px solid var(--jk-amber);
  border-radius: var(--radius-sm); padding: .6rem 1.1rem;
  font-size: .88rem; font-weight: 600; color: var(--jk-ink);
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.shared-banner a { color: var(--accent-deep); text-decoration: underline; }
.share-bar { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: .55rem; }
.share-btn {
  font-size: .82rem; padding: .52rem .95rem; font-weight: 700;
  border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: .4rem;
  cursor: pointer; text-decoration: none; border: 2px solid transparent; line-height: 1.3;
  transition: transform var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.share-btn:hover { text-decoration: none; transform: translateY(-2px); }
.share-btn:active { transform: translateY(0) scale(.98); transition-duration: .05s; }
.share-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.share-btn-wa { background: #25D366; color: #fff; border-color: #25D366; }
.share-btn-wa:hover { background: #1da851; border-color: #1da851; color: #fff; }
.share-btn-li { background: #0077B5; color: #fff; border-color: #0077B5; }
.share-btn-li:hover { background: #005e8f; border-color: #005e8f; color: #fff; }
.share-btn-copy { background: transparent; color: rgba(255,255,255,.82); border-color: rgba(255,255,255,.28); }
.share-btn-copy:hover { color: #fff; border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.06); }

.email-capture-section { background: var(--jk-sand-lt); padding: 40px 0; }
.ec-card { background: #fff; border-radius: var(--radius); padding: 32px 36px; box-shadow: var(--shadow); display: flex; gap: 36px; align-items: flex-start; flex-wrap: wrap; }
.ec-icon { font-size: 2.1rem; flex: 0 0 auto; padding-top: .2rem; }
.ec-body { flex: 1; min-width: 200px; }
.ec-body h3 { margin: 0 0 .3rem; font-family: var(--sans); font-size: 1.18rem; font-weight: 700; }
.ec-body p { margin: 0; font-size: .9rem; }
.ec-form { display: flex; flex-wrap: wrap; gap: .55rem; align-items: flex-start; flex: 2; min-width: 260px; }
.ec-form input[type="email"], .ec-form input[type="text"], .ec-form select {
  flex: 1 1 150px; padding: .72rem 1rem; border: 1px solid var(--jk-line-2); border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: .94rem; background: #fff;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.ec-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.ec-msg { width: 100%; margin: .15rem 0 0; font-size: .84rem; font-weight: 600; min-height: 1.2em; }

.book-cta-section { padding: 48px 0; }
.book-cta { background: linear-gradient(135deg, var(--jk-ink) 0%, #3a2118 100%); border-radius: var(--radius); padding: 36px 40px; display: flex; gap: 36px; align-items: center; flex-wrap: wrap; }
.book-cta-body { flex: 1; min-width: 260px; }
.book-cta-body h3 { color: #fff; margin: 0 0 .5rem; font-family: var(--sans); font-size: 1.35rem; font-weight: 700; }
.book-cta-body p { color: rgba(255,255,255,.78); margin: 0; max-width: 520px; line-height: 1.6; }
.book-cta-actions { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
.book-cta-actions .cta-note { margin: 0; font-size: .8rem; color: rgba(255,255,255,.5); }
.book-cta-actions .btn-copy-link { background: transparent; color: rgba(255,255,255,.72); border: 2px solid rgba(255,255,255,.22); font-size: .85rem; padding: .55rem 1rem; }
.book-cta-actions .btn-copy-link:hover { color: #fff; border-color: rgba(255,255,255,.5); }

@media (max-width: 680px) {
  .ec-card { padding: 22px 18px; }
  .book-cta { padding: 24px 20px; }
  .book-cta-actions { width: 100%; }
  .book-cta-actions .btn { width: 100%; justify-content: center; }
}

.btn-preview-trigger { transition: background-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.btn-preview-trigger:hover { background: var(--accent-tint-2) !important; transform: translateY(-1px); }
.btn-preview-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#tool-preview-modal #modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- scroll reveal ----------
   Only applies once JS has added .has-reveal, so a no-JS visitor never
   sees hidden content. Opacity and a 10px lift only — no scale, no
   blur, nothing that costs a repaint or shifts layout. */
/* The transition sits on .is-in, not on the hidden state. With it on the
   base rule the element animated *into* hiding — content rendered, then
   visibly faded out over half a second before it could fade back in.
   Hiding must be instantaneous; only the reveal is animated. */
.has-reveal .will-reveal {
  opacity: 0;
  transform: translateY(10px);
}
.has-reveal .will-reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity .55s var(--ease), transform .55s var(--ease);
  transition-delay: calc(var(--reveal-i, 0) * 45ms);
}

/* ============================================================
   Reduced motion — everything above is progressive polish. A
   visitor who asks for less motion gets a calm, instant interface
   with every hover/focus state still legible.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover, .card:hover, .tile:hover, .phase:hover, .door:hover,
  .sector:hover, .role:hover, .toolcard[href]:hover,
  .btn-preview-trigger:hover { transform: none; }
  /* Belt and braces: mountReveal() bails out under reduced motion, but if
     it ever ran anyway, content must still be visible rather than stuck
     at opacity 0. */
  .has-reveal .will-reveal { opacity: 1 !important; transform: none !important; }
}
