/* AUTO-SCOPED to .aigov (source: adjudicate/ai-governance/assets/coa-ai.css) so the
   embedded AI-governance app cannot bleed into coa.solutions chrome.
   Re-vendor when Phillip updates coa-ai.css: wrap the whole file in `@scope (.aigov) { … }`,
   then rewrite ONLY the two whole selectors `:root {`→`:scope {` and `body {`→`:scope {`.
   Do NOT substring-replace `body` — it mangles the real classes `.wcard-body`/`.spy-body`
   into `.wcard-:scope`/`.spy-:scope` and silently breaks the dashboard's card collapse. */
@scope (.aigov) {
/* ============================================================
   Coa Solutions — AI Governance & Assurance
   Shared design system for the dashboard + the AI mesh.

   Anchored on the Adjudicate brand tokens (Mercury + Vanta:
   white ground, near-black ink, one navy accent, generous
   whitespace, no gradients). System font = SF Pro on the
   presenter's Mac — premium and fully offline.
   ============================================================ */

:scope {
  /* surfaces */
  --bg: #fcfcfd;
  --bg-soft: #f6f7f9;
  --bg-tint: #fafbfc;
  --card: #ffffff;

  /* ink */
  --ink: #13171e;
  --ink-soft: #586173;
  --ink-faint: #9aa3b1;

  /* navy accent */
  --navy: #0b2a45;
  --navy-600: #0e3354;
  --navy-700: #082138;
  --navy-900: #06182a;
  --navy-tint: rgba(11, 42, 69, 0.055);
  --navy-tint-2: rgba(11, 42, 69, 0.10);

  /* on-navy text ramp */
  --on-navy: #eaf1f8;
  --on-navy-soft: #b9c7d6;
  --on-navy-faint: #7f96ad;

  /* ai / azure */
  --ai: #2f7fd1;
  --ai-deep: #0369a1;
  --assist-bg: #f1f7fd;
  --assist-line: #d9e5f1;
  --sky: #0369a1; --sky-50: #f0f9ff; --sky-200: #bae6fd;

  /* status ramp */
  --green: #1a7a52; --green-50: #f0faf5; --green-200: #b7e5cd;
  --red: #c13530; --red-50: #fdf3f2; --red-200: #f3c1be;
  --amber: #b3650a; --amber-50: #fff7ed; --amber-200: #fed7aa;
  --violet: #6a5acd; --violet-50: #f5f4fd; --violet-200: #d6d0f0;

  /* lines */
  --line: #e7e9ee;
  --line-soft: #eef0f4;
  --line-strong: #d6dae1;

  /* type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* radii */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --fast: 0.16s;
  --med: 0.28s;
  --slow: 0.5s;

  /* shadow */
  --sh-sm: 0 1px 2px rgba(11, 42, 69, 0.05);
  --sh: 0 6px 22px -10px rgba(11, 42, 69, 0.16), 0 2px 6px rgba(11, 42, 69, 0.04);
  --sh-lg: 0 18px 48px -20px rgba(11, 42, 69, 0.30), 0 6px 16px -8px rgba(11, 42, 69, 0.10);

  --maxw: 1240px;
}

* { box-sizing: border-box; }



:scope {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 660; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }

.mono { font-family: var(--mono); }

/* ---------- layout shell ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.section { padding: 64px 0; }
.section--tight { padding: 44px 0; }

/* ---------- top nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(252, 252, 253, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 32px;
  height: 60px; display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 660; letter-spacing: -0.02em; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--navy);
  display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: var(--sh-sm);
}
.brand .sub { color: var(--ink-faint); font-weight: 500; letter-spacing: 0; font-size: 13px; }
.topnav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.topnav a {
  text-decoration: none; color: var(--ink-soft); font-size: 13.5px; font-weight: 500;
  padding: 7px 13px; border-radius: var(--r-pill); transition: all var(--fast) var(--ease);
}
.topnav a:hover { color: var(--ink); background: var(--navy-tint); }
.topnav a.active { color: var(--navy); background: var(--navy-tint); }
.topnav a.cta { background: var(--navy); color: #fff; }
.topnav a.cta:hover { background: var(--navy-600); }

/* ---------- hero (navy band) ---------- */
.hero {
  background: var(--navy);
  color: var(--on-navy);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--navy-900);
}
.hero::before {
  /* hairline dot-grid texture — not a gradient */
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; padding: 72px 32px 64px; position: relative; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 11.5px;
  font-weight: 600; color: var(--on-navy-faint); margin-bottom: 18px;
}
.hero h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.04; letter-spacing: -0.03em; color: #fff; max-width: 16ch; }
.hero .lead { margin-top: 22px; font-size: clamp(17px, 2vw, 21px); color: var(--on-navy-soft); max-width: 60ch; line-height: 1.5; }
.hero .accent { color: #fff; font-weight: 600; }

/* principle pills row */
.pillrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.ppill {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  color: var(--on-navy); border-radius: var(--r-pill); padding: 9px 16px 9px 13px;
  font-size: 13.5px; font-weight: 500; transition: all var(--fast) var(--ease);
}
.ppill:hover { background: rgba(255,255,255,0.12); transform: translateY(-1px); }
.ppill .dot { width: 7px; height: 7px; border-radius: 50%; background: #6fd3a6; box-shadow: 0 0 0 4px rgba(111,211,166,0.18); }
.ppill.is-open { background: #fff; color: var(--navy); border-color: #fff; }

/* expanding drawer under hero pills */
.pdrawer {
  margin-top: 18px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-lg); padding: 0 22px; max-height: 0; overflow: hidden;
  transition: max-height var(--med) var(--ease), padding var(--med) var(--ease), opacity var(--med) var(--ease);
  opacity: 0;
}
.pdrawer.is-open { max-height: 260px; padding: 20px 22px; opacity: 1; }
.pdrawer h4 { color: #fff; font-size: 16px; margin-bottom: 6px; }
.pdrawer p { color: var(--on-navy-soft); font-size: 14.5px; line-height: 1.55; }
.pdrawer .how { margin-top: 10px; font-size: 13px; color: var(--on-navy-faint); }
.pdrawer .how b { color: var(--on-navy); font-weight: 600; }

/* ---------- section header ---------- */
.sec-head { max-width: 760px; margin-bottom: 34px; }
.sec-kicker {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--ai-deep);
  background: var(--assist-bg); border: 1px solid var(--assist-line);
  padding: 5px 12px; border-radius: var(--r-pill); margin-bottom: 16px;
}
.sec-head h2 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -0.025em; }
.sec-head .sub { margin-top: 12px; font-size: 17px; color: var(--ink-soft); line-height: 1.55; }

/* ---------- generic card ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px; transition: box-shadow var(--med) var(--ease), transform var(--med) var(--ease), border-color var(--med) var(--ease);
}
.card:hover { box-shadow: var(--sh); transform: translateY(-2px); border-color: var(--line-strong); }

/* nav/link cards — unmistakably clickable: real elevation, corner button, lift on hover */
.navcard {
  position: relative; cursor: pointer; padding: 30px;
  border: 1px solid var(--line-strong);
  /* even, zero-offset shadow so it wraps all four sides, not just the bottom */
  box-shadow: 0 0 0 1px rgba(11, 42, 69, 0.03), 0 0 26px 2px rgba(11, 42, 69, 0.13);
}
.navcard::after {
  content: "↗"; position: absolute; top: 24px; right: 24px;
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-size: 17px; background: var(--navy-tint); color: var(--navy); border: 1px solid var(--navy-tint-2);
  transition: all var(--med) var(--ease);
}
.navcard:hover {
  transform: translateY(-6px); border-color: var(--navy);
  box-shadow: 0 0 0 1px rgba(11, 42, 69, 0.05), 0 0 42px 4px rgba(11, 42, 69, 0.22);
}
.navcard:hover::after { background: var(--navy); color: #fff; border-color: var(--navy); transform: scale(1.08); }
.navcard:active { transform: translateY(-2px); }
.open-btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px;
  background: var(--navy); color: #fff; padding: 12px 22px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 14.5px; transition: background var(--fast) var(--ease);
}
.navcard:hover .open-btn { background: var(--navy-600); }
.open-btn .arr { transition: transform var(--fast) var(--ease); }
.navcard:hover .open-btn .arr { transform: translateX(4px); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .wrap { padding: 0 20px; } }

/* principle card */
.pcard .pc-ico {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--assist-bg); color: var(--ai-deep); border: 1px solid var(--assist-line);
  margin-bottom: 16px;
}
.pcard h3 { font-size: 17.5px; letter-spacing: -0.01em; }
.pcard p { margin-top: 9px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; }
.pcard .enf {
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--ink-faint);
}
.pcard .enf b { color: var(--ink-soft); font-weight: 600; }

/* keep top-nav anchor jumps clear of the sticky header */
section[id] { scroll-margin-top: 72px; }

/* ---------- principles scroll-spy ---------- */
.spy { display: grid; grid-template-columns: 240px 1fr; gap: 44px; align-items: start; }
@media (max-width: 760px) {
  .spy { grid-template-columns: 1fr; gap: 16px; }
  .spy-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .spy-nav button { border-left: none; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 7px 13px; }
  .spy-nav button.active { background: var(--navy-tint); }
}
.spy-nav { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 1px; }
.spy-nav button {
  text-align: left; background: none; border: none; border-left: 2px solid var(--line);
  padding: 11px 16px; font-size: 14.5px; color: var(--ink-faint); cursor: pointer; font-weight: 500;
  font-family: inherit; transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.spy-nav button:hover { color: var(--ink); }
.spy-nav button.active { color: var(--navy); border-left-color: var(--navy); font-weight: 600; }
.spy-body { display: flex; flex-direction: column; gap: 18px; }
.spanel {
  scroll-margin-top: 84px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 28px 30px; transition: border-color var(--med) var(--ease), box-shadow var(--med) var(--ease);
}
.spanel.active { border-color: var(--line-strong); box-shadow: var(--sh-sm); }
.spanel .pc-ico {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--assist-bg); color: var(--ai-deep); border: 1px solid var(--assist-line); margin-bottom: 16px; font-size: 18px;
}
.spanel h3 { font-size: 21px; letter-spacing: -0.02em; }
.spanel p { margin-top: 11px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.6; }
.spanel .enf { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-faint); }
.spanel .enf b { color: var(--ink-soft); font-weight: 600; }

/* ---------- status chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--r-pill); letter-spacing: 0.01em;
  white-space: nowrap; flex: none;
}
.chip .d { width: 6px; height: 6px; border-radius: 50%; }
.chip-green { background: var(--green-50); color: var(--green); border: 1px solid var(--green-200); }
.chip-green .d { background: var(--green); }
.chip-sky { background: var(--sky-50); color: var(--ai-deep); border: 1px solid var(--sky-200); }
.chip-sky .d { background: var(--ai-deep); }
.chip-violet { background: var(--violet-50); color: var(--violet); border: 1px solid var(--violet-200); }
.chip-violet .d { background: var(--violet); }
.chip-amber { background: var(--amber-50); color: var(--amber); border: 1px solid var(--amber-200); }
.chip-amber .d { background: var(--amber); }
.chip-navy { background: var(--navy-tint); color: var(--navy); border: 1px solid var(--navy-tint-2); }
.chip-navy .d { background: var(--navy); }

/* ---------- pipeline (forward-based process) ---------- */
.pipeline { position: relative; }
.pipe-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0;
  position: relative;
}
@media (max-width: 900px) { .pipe-track { grid-auto-flow: row; grid-auto-columns: auto; } }
.pipe-step {
  position: relative; text-align: left; padding: 20px 18px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card);
  transition: all var(--med) var(--ease);
}
.pipe-step:first-child { border-radius: var(--r-lg) 0 0 var(--r-lg); }
.pipe-step:last-child { border-radius: 0 var(--r-lg) var(--r-lg) 0; }
.pipe-step + .pipe-step { border-left: none; }
@media (max-width: 900px) {
  .pipe-step { border-radius: var(--r) !important; border-left: 1px solid var(--line) !important; }
  .pipe-step + .pipe-step { margin-top: 10px; }
}
.pipe-step:hover { background: var(--bg-soft); z-index: 2; }
.pipe-step.is-active { background: var(--navy); border-color: var(--navy); z-index: 3; box-shadow: var(--sh); }
.pipe-step .num {
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint); font-weight: 600;
}
.pipe-step.is-active .num { color: var(--on-navy-faint); }
.pipe-step .ttl { margin-top: 8px; font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; }
.pipe-step.is-active .ttl { color: #fff; }
.pipe-step .mini { margin-top: 5px; font-size: 12px; color: var(--ink-faint); line-height: 1.4; }
.pipe-step.is-active .mini { color: var(--on-navy-soft); }
.pipe-detail {
  margin-top: 18px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px;
}
@media (max-width: 760px) { .pipe-detail { grid-template-columns: 1fr; } }
.pipe-detail h3 { font-size: 20px; }
.pipe-detail .pd-why { margin-top: 4px; color: var(--ai-deep); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
.pipe-detail p { margin-top: 12px; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.pipe-detail ul { margin: 14px 0 0; padding: 0; list-style: none; }
.pipe-detail li { position: relative; padding-left: 22px; margin-bottom: 9px; font-size: 14px; color: var(--ink-soft); }
.pipe-detail li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--ai); }
.pd-side { background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 18px; }
.pd-side .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); font-weight: 600; margin-bottom: 12px; }
.svc { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; font-size: 13px; font-family: var(--mono); color: var(--ink); }
.svc .sq { width: 7px; height: 7px; border-radius: 2px; background: var(--ai); flex: none; }

/* ---------- weakness/control matrix ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.fbtn {
  font-size: 13px; font-weight: 500; padding: 7px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); cursor: pointer;
  transition: all var(--fast) var(--ease);
}
.fbtn:hover { border-color: var(--line-strong); color: var(--ink); }
.fbtn.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
/* align-items:start so an open card never stretches its partner into a blank box */
.wgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .wgrid { grid-template-columns: 1fr; } }
.wcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 0; overflow: hidden; transition: all var(--med) var(--ease);
}
.wcard:hover { box-shadow: var(--sh); border-color: var(--line-strong); }
.wcard-head {
  padding: 18px 20px; cursor: pointer; display: flex; align-items: center; gap: 14px; min-height: 78px;
}
.wcard-head .risk {
  flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--red-50); color: var(--red); border: 1px solid var(--red-200); font-size: 18px;
}
.wcard-head .wt { flex: 1; }
.wcard-head .wt h3 { font-size: 16.5px; letter-spacing: -0.01em; }
.wcard-head .wt .ref {
  display: inline-block; margin-top: 6px; font-family: var(--mono); font-size: 11px;
  color: var(--ink-faint); background: var(--bg-soft); padding: 2px 8px; border-radius: var(--r-sm);
  border: 1px solid var(--line-soft);
}
.wcard-head .caret { flex: none; color: var(--ink-faint); transition: transform var(--med) var(--ease); margin-top: 4px; }
.wcard.is-open .caret { transform: rotate(180deg); }
/* uniform open height: every opened card is --wopen tall (JS = tallest card at current width).
   align-items:start keeps the collapsed partner at head height — it never stretches into a blank box. */
.wcard-body { height: 0; overflow: hidden; transition: height var(--med) var(--ease); }
.wcard.is-open .wcard-body { height: var(--wopen, 480px); }
@media (max-width: 820px) { .wcard.is-open .wcard-body { height: auto; } }
.wcard-body-inner { padding: 0 20px 20px; }
.wrow { padding: 13px 0; border-top: 1px solid var(--line-soft); }
.wrow .wlbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-faint); font-weight: 600; margin-bottom: 5px; display: flex; align-items: center; gap: 7px; }
.wrow .wlbl .i { width: 14px; height: 14px; }
.wrow .wval { font-size: 14px; color: var(--ink); line-height: 1.5; }
.wrow.is-coa .wval { color: var(--navy); font-weight: 500; }
.wrow .svc-inline { font-family: var(--mono); font-size: 12.5px; color: var(--ai-deep); }

/* ---------- assurance loop ---------- */
.assure { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 880px) { .assure { grid-template-columns: 1fr; } }
.acard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.acard .ah { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.acard .ah h3 { min-width: 0; }
.acard h3 { font-size: 16px; }
.acard p { margin-top: 10px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.acard .watch { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-faint); }
.acard .watch b { color: var(--ink-soft); }

/* ---------- standards strip ---------- */
.std { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 820px) { .std { grid-template-columns: 1fr; } }
.scard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; }
.scard h3 { font-size: 17px; display: flex; align-items: center; gap: 10px; }
.scard .badge { font-family: var(--mono); font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: var(--r-sm); background: var(--navy-tint); color: var(--navy); }
.scard p { margin-top: 10px; font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
.scard .items { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.scard .it { font-size: 12px; padding: 5px 11px; border-radius: var(--r-pill); background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-soft); }

/* ---------- high-impact mapping block ---------- */
.map-block { margin-top: 22px; background: var(--navy); color: var(--on-navy); border-radius: var(--r-lg); padding: 30px 30px 26px; position: relative; overflow: hidden; }
.map-block::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,0.045) 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; }
.map-head { position: relative; max-width: 760px; }
.map-head h3 { color: #fff; font-size: 22px; letter-spacing: -0.02em; }
.map-head p { margin-top: 10px; color: var(--on-navy-soft); font-size: 14.5px; line-height: 1.55; }
.map-head em { color: #fff; font-style: normal; font-weight: 600; }
.map-grid { position: relative; margin-top: 20px; display: flex; flex-direction: column; }
.map-row { display: grid; grid-template-columns: 230px 18px 1fr; align-items: baseline; gap: 12px; padding: 13px 0; border-top: 1px solid rgba(255,255,255,0.10); }
@media (max-width: 640px) { .map-row { grid-template-columns: 1fr; gap: 4px; } .map-arrow { display: none; } }
.map-req { font-size: 13.5px; font-weight: 600; color: #fff; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.map-tick { width: 17px; height: 17px; border-radius: 50%; background: rgba(111,211,166,0.18); color: #6fd3a6; display: grid; place-items: center; font-size: 10px; flex: none; }
.map-arrow { color: var(--on-navy-faint); font-size: 13px; padding-top: 1px; }
.map-coa { font-size: 13px; color: var(--on-navy-soft); line-height: 1.5; max-width: 78ch; text-wrap: pretty; }

/* orphan control — no dangling last lines across the card/prose text */
.sec-head .sub, .lead, .pcard p, .pcard .enf, .acard p, .scard p, .wval, .note,
.pipe-detail p, .pipe-detail li, .acard .watch { text-wrap: pretty; }

/* ---------- callout / honesty note ---------- */
.note {
  background: var(--assist-bg); border: 1px solid var(--assist-line); border-left: 3px solid var(--ai);
  border-radius: var(--r); padding: 16px 20px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.6;
}
.note b { color: var(--ink); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 40px 0; margin-top: 40px; }
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.foot small { color: var(--ink-faint); font-size: 12.5px; line-height: 1.6; }

/* ---------- reveal animation ---------- */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
/* failsafes: never let content stay hidden in print/PDF or for reduced-motion */
@media print { [data-reveal] { opacity: 1 !important; transform: none !important; } .topbar { position: static; } }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; transition: none; } }

/* ============================================================
   MESH PAGE — deep navy stage
   ============================================================ */
.mesh-page { background: var(--bg); }
.mesh-hero { padding: 40px 0 24px; }
.mesh-hero h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.03em; }
.mesh-hero .lead { margin-top: 14px; font-size: 17px; color: var(--ink-soft); max-width: 70ch; }
.mesh-tabs { margin-top: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mtab {
  font-size: 13.5px; font-weight: 560; padding: 8px 18px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); cursor: pointer;
  transition: all var(--fast) var(--ease);
}
.mtab:hover { border-color: var(--line-strong); color: var(--ink); }
.mtab.is-on { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: var(--sh-sm); }
.mesh-caption { font-size: 13px; color: var(--ink-faint); margin-left: 4px; }
@media (max-width: 600px) { .mesh-caption { width: 100%; margin-left: 0; } }

.stage-wrap {
  position: relative; background: var(--navy-900); border-radius: var(--r-xl);
  border: 1px solid #0c2238; overflow: hidden; box-shadow: var(--sh-lg);
}
.stage-wrap::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 26px 26px; pointer-events: none; z-index: 0;
}
#mesh { display: block; width: 100%; height: 620px; position: relative; z-index: 1; }
@media (max-width: 760px) { #mesh { height: 720px; } }

/* stage legend — horizontal top bar (kept off the node field) */
.legend {
  position: absolute; top: 14px; left: 18px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center;
  gap: 7px; max-width: calc(100% - 232px); background: transparent; border: none; padding: 0;
}
.legend .lt { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--on-navy-faint); font-weight: 600; margin: 0 4px 0 0; }
.legend .li {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12px; color: var(--on-navy-soft);
  background: rgba(6,24,42,0.5); border: 1px solid rgba(255,255,255,0.09); padding: 5px 10px; border-radius: var(--r-pill);
  transition: opacity var(--fast) var(--ease), color var(--fast) var(--ease);
}
/* inset embeds (~1000px iframe): six chips must hold one line — round-5 audit
   caught the last chip orphaning at the ai-pilots container width */
@media (max-width: 1080px) {
  .legend { gap: 5px; max-width: calc(100% - 210px); }
  .legend .li { font-size: 11px; padding: 4px 8px; gap: 5px; }
}
.legend .li:hover { opacity: 1; color: #fff; }
.legend .li.dim { opacity: 0.35; }
.legend .li .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; box-shadow: 0 0 8px currentColor; }

/* flow controls */
.mesh-controls { position: absolute; top: 16px; right: 16px; z-index: 4; display: flex; gap: 8px; }
.mctl {
  background: rgba(6,24,42,0.6); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.12);
  color: var(--on-navy); border-radius: var(--r-pill); padding: 8px 15px; font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: all var(--fast) var(--ease); display: inline-flex; align-items: center; gap: 7px;
}
.mctl:hover { background: rgba(255,255,255,0.12); }
.mctl.is-off { opacity: 0.6; }

/* node detail panel */
.npanel {
  position: absolute; right: 16px; bottom: 16px; z-index: 5; width: 320px; max-width: calc(100% - 32px);
  background: rgba(8,28,48,0.92); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-lg); padding: 20px; color: var(--on-navy);
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: all var(--med) var(--spring);
  box-shadow: 0 20px 50px -16px rgba(0,0,0,0.6);
}
.npanel.show { opacity: 1; transform: none; pointer-events: auto; }
.npanel .stage-tag { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; }
.npanel .stage-tag .sw { width: 9px; height: 9px; border-radius: 2px; box-shadow: 0 0 8px currentColor; }
.npanel h3 { color: #fff; font-size: 19px; margin-top: 12px; letter-spacing: -0.01em; }
.npanel p { margin-top: 10px; font-size: 13.5px; color: var(--on-navy-soft); line-height: 1.55; }
.npanel .svc-lbl { margin-top: 16px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--on-navy-faint); font-weight: 600; }
.npanel .svc-list { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px; }
.npanel .svc-list .sc {
  font-family: var(--mono); font-size: 11px; padding: 4px 9px; border-radius: var(--r-sm);
  background: rgba(47,127,209,0.16); border: 1px solid rgba(110,170,230,0.3); color: #bfe0ff;
}
.npanel .close { position: absolute; top: 14px; right: 14px; cursor: pointer; color: var(--on-navy-faint); font-size: 18px; line-height: 1; }
.npanel .close:hover { color: #fff; }

/* hint */
.mesh-hint { position: absolute; bottom: 16px; left: 16px; z-index: 3; font-size: 12px; color: var(--on-navy-faint); }
.mesh-hint b { color: var(--on-navy-soft); }

/* stage rail labels under mesh */
.stage-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; margin-top: 14px; }
.stage-rail .sr {
  text-align: center; font-size: 12px; color: var(--ink-faint); position: relative; padding-top: 14px;
}
.stage-rail .sr .srt { font-weight: 600; color: var(--ink); font-size: 13px; }
.stage-rail .sr::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 9px; height: 9px; border-radius: 50%; background: var(--dotc, var(--ai));
}
@media (max-width: 760px) { .stage-rail { display: none; } }

/* tooltip (lightweight, follows cursor) */
.mtip {
  position: fixed; z-index: 100; pointer-events: none; background: rgba(8,28,48,0.95);
  color: #fff; border: 1px solid rgba(255,255,255,0.16); border-radius: var(--r-sm);
  padding: 6px 11px; font-size: 12.5px; font-weight: 500; opacity: 0; transition: opacity var(--fast);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.5); max-width: 220px;
}
.mtip.show { opacity: 1; }
.mtip .ms { font-family: var(--mono); font-size: 10.5px; color: #9fc6ec; display: block; margin-top: 2px; }

}
