/* =====================================================================
   /ai-visibility-map — Griff's AI Visibility & Accountability Map,
   restyled on the homepage system. Loads after home-base.css and
   home-final.css and uses only their tokens (var(--…)) and the recipes
   those files already use (glass, forest plate, amber pill, badges).
   No new colours. Spacing on the 8 / 16 / 24 / 40 / 64 / 88 scale.
   ===================================================================== */

/* ---------- Page shell ---------- */
.aimap-hero .hero-copy h1 { max-width: 12ch; }
.aimap-hero .stance-plate { justify-content: flex-start; gap: 16px; }
.aimap-hero .stance-route-list { margin-top: 8px; }
.aimap-band { padding-top: 88px; }
.aimap-noscript { text-align: center; color: var(--ink-2); }

/* Shared helpers the bundle relies on */
#root .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
#root button, #root input, #root select, #root textarea {
  font-family: var(--sans); font-size: inherit; color: inherit;
}
#root button { cursor: pointer; background: none; border: 0; padding: 0; }
#root svg { flex: none; }
#root h1, #root h2, #root h3, #root p, #root dl, #root dd { margin: 0; }
#root .skip { display: none; }

#root .eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--amber-ink);
  line-height: 1.4;
}
#root .micro {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
}

/* ---------- Buttons (site .btn recipes) ---------- */
#root .primary,
#root .quiet,
#root .summary-button,
#root .reset-button,
#root .people-conclusion > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 140ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
#root .primary,
#root .summary-button {
  background: linear-gradient(180deg, #F0AF4D 0%, #E39B30 100%);
  color: var(--ink);
  border-color: rgba(196, 128, 22, 0.45);
  box-shadow: 0 8px 20px -6px rgba(227, 155, 48, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
#root .quiet,
#root .reset-button,
#root .people-conclusion > button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-color: rgba(22, 20, 15, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 3px 10px -4px rgba(22, 20, 15, 0.06);
}
#root .icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(22, 20, 15, 0.12);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 3px 10px -4px rgba(22, 20, 15, 0.06);
}
#root .text-button {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--amber-ink);
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
}
#root .primary:active, #root .quiet:active, #root .summary-button:active, #root .reset-button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  #root .primary:hover, #root .summary-button:hover { background: linear-gradient(180deg, #F5B85B 0%, #EAA33A 100%); transform: translateY(-1px); }
  #root .quiet:hover, #root .reset-button:hover, #root .icon-button:hover, #root .people-conclusion > button:hover {
    background: rgba(255, 255, 255, 0.94); border-color: rgba(22, 20, 15, 0.24); transform: translateY(-1px);
  }
}
#root .summary-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--forest); }

/* ---------- Layout: the map as one glass pavilion ---------- */
#root .app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "head head"
    "nav  nav"
    "bar  bar"
    "main main"
    "note priv";
  column-gap: 16px;
}
#root .workspace, #root .sidebar { display: contents; }

/* Section head (the map's own intro) */
#root .sidebar-top {
  grid-area: head;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 40px;
}
#root .sidebar-top .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; margin-bottom: 16px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 6px rgba(22, 20, 15, 0.04);
  color: var(--muted);
}
#root .sidebar-top .eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.22);
}
#root .sidebar-top h2 {
  font-size: clamp(26px, 3vw, 37px); font-weight: 800; line-height: 1.08; letter-spacing: -0.032em;
}
#root .sidebar-top h2 em { font-style: normal; color: var(--amber-ink); }
#root .sidebar-top p { margin-top: 16px; font-size: 15.5px; color: var(--ink-2); }

/* Story navigation: three step cards (homepage rail cards) */
#root .story-nav {
  grid-area: nav;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  margin-bottom: 16px;
}
#root .story-nav > button {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 16px 20px; min-height: 80px; text-align: left;
  border-radius: var(--r-md);
  background: var(--glass-1);
  backdrop-filter: blur(18px) saturate(145%); -webkit-backdrop-filter: blur(18px) saturate(145%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  transition: transform 140ms var(--ease), border-color 160ms var(--ease);
}
#root .story-nav b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
#root .story-nav small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
#root .story-nav .step-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: var(--amber-bg); color: var(--amber-ink); border: 1px solid var(--amber-line);
}
#root .story-nav > button > svg { color: var(--muted); }
#root .story-nav > button.active {
  background:
    radial-gradient(circle at 84% 16%, rgba(232, 163, 61, 0.14), transparent 52%),
    radial-gradient(circle at 14% 88%, rgba(84, 145, 108, 0.36), transparent 56%),
    linear-gradient(155deg, rgba(31, 56, 44, 0.96), rgba(22, 40, 31, 0.95));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 52px -20px rgba(18, 34, 26, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: var(--on-dark);
}
#root .story-nav > button.active small { color: var(--on-dark-muted); }
#root .story-nav > button.active .step-number { background: var(--amber); color: var(--ink); border-color: var(--amber); }
#root .story-nav > button.active > svg { color: var(--amber); }
@media (hover: hover) and (pointer: fine) {
  #root .story-nav > button:not(.active):hover { transform: translateY(-1px); border-color: var(--amber-line); }
}

/* Tool bar (the map's header actions) */
#root .topbar {
  grid-area: bar;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 8px 8px 8px 20px; margin-bottom: 16px;
  border-radius: var(--r-pill);
  background: var(--glass-1);
  backdrop-filter: blur(22px) saturate(165%); -webkit-backdrop-filter: blur(22px) saturate(165%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px -12px rgba(22, 20, 15, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
#root .topbar .brand { display: none; }
#root .top-caption {
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted);
}
#root .top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#root .top-actions > span {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--green-bg); color: var(--forest); border: 1px solid var(--green-line);
}

/* Main stage pavilion (homepage light frosted pavilion) */
#root main {
  grid-area: main;
  min-width: 0;
  padding: 40px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 12% 16%, rgba(232, 163, 61, 0.10), transparent 52%),
    radial-gradient(circle at 88% 84%, rgba(62, 107, 82, 0.08), transparent 50%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.78), rgba(247, 244, 237, 0.72));
  backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 56px -24px rgba(22, 20, 15, 0.12), inset 0 1.5px 0 rgba(255, 255, 255, 0.96);
  scroll-margin-top: 96px;
}
#root main:focus { outline: none; }

#root .page-heading {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin-bottom: 40px;
}
#root .page-heading > div { max-width: 760px; }
#root .page-heading h1 {
  margin-top: 8px;
  font-size: clamp(26px, 3vw, 37px); font-weight: 800; line-height: 1.08; letter-spacing: -0.032em;
}
#root .page-heading p { margin-top: 16px; font-size: 15.5px; line-height: 1.52; color: var(--ink-2); }
#root .interactive-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--amber-bg); color: var(--amber-ink); border: 1px solid var(--amber-line);
}
#root .interactive-badge > span { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }

/* Sidebar note + privacy link sit under the pavilion */
#root .sidebar-note {
  grid-area: note;
  display: flex; align-items: flex-start; gap: 16px;
  margin-top: 16px; padding: 16px 20px;
  border-radius: var(--r-md);
  background: var(--glass-1); border: 1px solid var(--glass-border); box-shadow: var(--shadow-soft);
  color: var(--ink-2); font-size: 14px; line-height: 1.5;
}
#root .sidebar-note > svg { color: var(--amber-ink); margin-top: 2px; }
#root .sidebar-note strong { color: var(--ink); }
#root .privacy-link {
  grid-area: priv;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; padding: 16px 20px;
  border-radius: var(--r-md);
  background: var(--green-bg); border: 1px solid var(--green-line) !important; box-shadow: var(--shadow-soft);
  color: var(--forest); font-size: 14px; font-weight: 600;
}

/* ---------- Forest plate (dark coloured boxes, homepage stance-plate) ---------- */
#root .map-board,
#root .stage-detail,
#root .privacy-panel {
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 84% 16%, rgba(232, 163, 61, 0.14), transparent 52%),
    radial-gradient(circle at 14% 88%, rgba(84, 145, 108, 0.36), transparent 56%),
    linear-gradient(155deg, rgba(31, 56, 44, 0.96), rgba(22, 40, 31, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 52px -20px rgba(18, 34, 26, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: var(--on-dark);
}
#root .map-board .eyebrow, #root .stage-detail .eyebrow { color: #F6B95E; }

/* White glass card (homepage perim-pass / form-plate) */
#root .inspector,
#root .living-record {
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-glass);
  color: var(--ink);
}

/* ---------- Stage 01: pressures ---------- */
#root .explore-layout {
  display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 24px; align-items: stretch;
}
#root .map-board { padding: 24px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
#root .board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
#root .board-toolbar > span {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.07em;
  padding: 5px 12px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.18); color: #F6B95E;
}
#root .board-indicator { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.22); }
#root .segmented {
  display: inline-flex; gap: 4px; padding: 4px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.18);
}
#root .segmented button {
  min-height: 34px; padding: 0 16px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; color: var(--on-dark);
}
#root .segmented button.selected {
  background: linear-gradient(180deg, #F0AF4D 0%, #E39B30 100%); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

#root .pain-angles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
#root .angle-card,
#root .gap-nodes button,
#root .role-node {
  text-align: left; min-width: 0;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: var(--on-dark);
  transition: transform 140ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease);
}
#root .angle-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; }
#root .angle-top { display: flex; align-items: center; justify-content: space-between; color: var(--amber); }
#root .angle-top > span { font-family: var(--mono); font-size: 11px; font-weight: 700; }
#root .angle-card h3 { margin-top: 8px; font-size: 18px; font-weight: 800; line-height: 1.2; letter-spacing: -0.025em; color: inherit; }
#root .angle-tag { font-size: 13px; color: var(--on-dark-muted); }
#root .angle-divider { height: 1px; margin: 8px 0; background: rgba(255, 255, 255, 0.16); }
#root .angle-list { display: grid; gap: 8px; font-size: 13.5px; line-height: 1.45; flex: 1; }
#root .angle-list > span { display: grid; grid-template-columns: 6px minmax(0, 1fr); gap: 8px; align-items: start; }
#root .angle-list i { width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: var(--amber); }
#root .angle-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 8px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--on-dark-muted);
}
#root .angle-card.selected,
#root .gap-nodes button.selected,
#root .role-node.selected {
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--amber) !important;
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.22);
  color: var(--ink);
}
#root .angle-card.selected .angle-tag,
#root .angle-card.selected .angle-bottom { color: var(--amber-ink); border-top-color: rgba(22, 20, 15, 0.10); }
#root .angle-card.selected .angle-top { color: var(--amber-ink); }
#root .angle-card.selected .angle-divider { background: rgba(22, 20, 15, 0.10); }
#root .angle-card.selected .angle-list i { background: var(--amber-ink); }
@media (hover: hover) and (pointer: fine) {
  #root .angle-card:not(.selected):hover,
  #root .gap-nodes button:not(.selected):hover,
  #root .role-node:not(.selected):hover { border-color: var(--amber) !important; transform: translateY(-1px); }
}

#root .convergence { position: relative; height: 88px; margin: -8px 0; }
#root .convergence svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: rgba(255, 255, 255, 0.34); stroke-width: 1.2px; }
#root .convergence circle { fill: var(--amber); stroke: none; }
#root .convergence span {
  position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; padding: 4px 12px; border-radius: var(--r-pill);
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em;
  background: rgba(31, 56, 44, 0.96); border: 1px solid rgba(255, 255, 255, 0.18); color: var(--on-dark-muted);
}
#root .gap-nodes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
#root .gap-nodes button {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 20px;
}
#root .gap-nodes button > svg:first-child { color: var(--amber); }
#root .gap-nodes button.selected > svg:first-child { color: var(--amber-ink); }
#root .gap-nodes small { display: block; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.07em; color: #F6B95E; }
#root .gap-nodes button.selected small { color: var(--amber-ink); }
#root .gap-nodes h3 { margin-top: 4px; font-size: 18px; font-weight: 800; letter-spacing: -0.025em; color: inherit; }
#root .gap-nodes p { margin-top: 4px; font-size: 13.5px; color: var(--on-dark-muted); }
#root .gap-nodes button.selected p { color: var(--ink-2); }

#root .board-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13px; color: var(--on-dark-muted);
}
#root .board-bottom > span { display: inline-flex; align-items: center; gap: 8px; }
#root .rotate { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--on-dark); }
#root .rotate button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.24); color: var(--on-dark);
}

/* Inspector */
#root .inspector { padding: 28px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
#root .small-pill {
  display: inline-flex; align-self: flex-start;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--amber-bg); color: var(--amber-ink); border: 1px solid var(--amber-line);
}
#root .inspector h2 { font-size: 22px; font-weight: 800; line-height: 1.2; letter-spacing: -0.028em; }
#root .inspector > p { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
#root .inspector-divider { height: 1px; background: rgba(22, 20, 15, 0.10); }
#root .gap-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--amber-ink); }
#root .ask-box {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start;
  padding: 16px 20px; border-radius: var(--r-md);
  background: var(--amber-bg); border: 1px solid var(--amber-line);
}
#root .ask-box > svg { color: var(--amber-ink); margin-top: 2px; }
#root .ask-box small { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; color: var(--amber-ink); }
#root .ask-box p { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--ink); }
#root .inspector .primary { margin-top: auto; width: 100%; }
#root .pressure-inspector .micro { margin-top: -8px; }
#root .role-kind { font-family: var(--mono); font-size: 11px !important; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted) !important; margin-top: -8px; }
#root .mini-block {
  padding: 16px 20px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.72); border: 1px solid rgba(22, 20, 15, 0.08);
}
#root .mini-block small { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; color: var(--muted); }
#root .mini-block p { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
#root .mini-block.warning { background: var(--amber-bg); border-color: var(--amber-line); }
#root .mini-block.warning small { color: var(--amber-ink); }
#root .mini-block.positive { background: var(--green-bg); border-color: var(--green-line); }
#root .mini-block.positive small { color: var(--forest); }

/* Moustr approach strip (homepage chapter-bridge pill) */
#root .principle-strip {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px;
  margin-top: 24px; padding: 16px 24px;
  border-radius: var(--r-pill);
  background: rgba(255, 254, 250, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}
#root .principle-strip > span { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.07em; color: var(--amber-ink); }
#root .principle-strip p { font-size: 15px; font-weight: 600; color: var(--ink); }
#root .principle-strip > svg { color: var(--amber-ink); }

/* ---------- Stage 02: people ---------- */
#root .people-map {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 8px;
  min-height: 460px;
}
#root .people-lines {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  fill: none; stroke: rgba(255, 255, 255, 0.34); stroke-width: 1.2px; stroke-dasharray: 5 7;
}
#root .people-lines .highlight { stroke: var(--amber); stroke-width: 2px; }
#root .connected .people-lines { stroke-dasharray: none; stroke: rgba(255, 255, 255, 0.42); }
#root .role-column { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 16px; }
#root .role-node { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 16px; min-height: 80px; }
#root .role-node > svg { color: var(--amber); }
#root .role-node.selected > svg { color: var(--amber-ink); }
#root .role-node b { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.3; }
#root .role-node small { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.4; color: var(--on-dark-muted); }
#root .role-node.selected small { color: var(--amber-ink); }
#root .record-hub { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; min-width: 0; padding: 16px 0; }
#root .hub-orbit { position: absolute; width: min(100%, 300px); aspect-ratio: 1; border-radius: 50%; border: 1px dashed rgba(232, 163, 61, 0.5); }
#root .connected .hub-orbit { border-style: solid; border-color: rgba(255, 255, 255, 0.34); }
#root .hub-core {
  position: relative; z-index: 1;
  width: min(88%, 260px); aspect-ratio: 1; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 24px;
  background: rgba(22, 40, 31, 0.92); border: 1px solid var(--amber);
  box-shadow: 0 0 0 8px rgba(232, 163, 61, 0.10);
  color: var(--on-dark);
}
#root .hub-core > svg { color: var(--amber); margin-bottom: 8px; }
#root .hub-core h3 { font-size: 19px; font-weight: 800; line-height: 1.2; letter-spacing: -0.025em; color: inherit; }
#root .hub-core p { margin: 8px 0 16px; white-space: pre-line; font-size: 13px; line-height: 1.5; color: var(--on-dark-muted); }
#root .hub-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: #FBF0DE; color: var(--amber-ink); border: 1px solid var(--amber-line);
}
#root .connected .hub-core { background: rgba(255, 255, 255, 0.96); color: var(--ink); border-color: var(--green-line); box-shadow: 0 0 0 8px rgba(62, 107, 82, 0.18); }
#root .connected .hub-core > svg { color: var(--green); }
#root .connected .hub-core p { color: var(--ink-2); }
#root .connected .hub-status { background: var(--green-bg); color: var(--forest); border-color: var(--green-line); }
#root .people-conclusion {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.16);
}
#root .connection-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-dark-muted); }
#root .connection-legend i { width: 24px; border-top: 1.5px dashed var(--amber); }
#root .connected .connection-legend i { border-top-style: solid; border-color: var(--on-dark-muted); }

#root .handoff-focus {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
  margin-top: 24px; padding: 16px 24px;
  border-radius: var(--r-md);
  background: var(--amber-bg); border: 1px solid var(--amber-line);
}
#root .handoff-focus p { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14.5px; line-height: 1.55; color: var(--ink); }
#root .handoff-focus p span { color: var(--ink-2); }

#root .ownership-model {
  margin-top: 24px; padding: 40px;
  border-radius: var(--r-lg);
  background: var(--glass-1);
  backdrop-filter: blur(26px) saturate(160%); -webkit-backdrop-filter: blur(26px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  scroll-margin-top: 96px;
}
#root .model-intro { max-width: 720px; margin-bottom: 40px; }
#root .model-intro h2 { margin-top: 8px; font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; line-height: 1.1; letter-spacing: -0.032em; }
#root .model-intro p { margin-top: 16px; font-size: 15.5px; line-height: 1.52; color: var(--ink-2); }
#root .owner-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
#root .owner-fields label {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.74); border: 1px solid rgba(255, 255, 255, 0.94); box-shadow: var(--shadow-soft);
}
#root .owner-fields label > span { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
#root .owner-fields i {
  font-style: normal; font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--amber-bg); color: var(--amber-ink); border: 1px solid var(--amber-line);
}
#root .owner-fields small { font-size: 13px; line-height: 1.45; color: var(--muted); flex: 1; }
#root input,
#root select,
#root textarea {
  width: 100%; min-height: 42px; padding: 8px 16px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(22, 20, 15, 0.14);
  color: var(--ink); font-size: 14px;
  box-shadow: inset 0 1px 2px rgba(22, 20, 15, 0.04);
}
#root input::placeholder, #root textarea::placeholder { color: var(--muted); opacity: 1; }
#root input:focus, #root select:focus, #root textarea:focus { outline: 2px solid var(--amber-ink); outline-offset: 1px; }
#root .model-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 24px; font-size: 13px; color: var(--muted);
}
#root .model-foot > span { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Stage 03: maturity ---------- */
#root .maturity-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
  margin-bottom: 24px; padding: 16px 24px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.74); border: 1px solid rgba(255, 255, 255, 0.94); box-shadow: var(--shadow-soft);
}
#root .maturity-toolbar p { margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; font-size: 16px; font-weight: 600; }
#root .maturity-toolbar p > span { color: var(--amber-ink); }
#root .compare-controls { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
#root .compare-controls > svg { color: var(--amber-ink); margin-bottom: 12px; }
#root .compare-controls label { display: flex; flex-direction: column; gap: 8px; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
#root .compare-controls select { min-width: 180px; font-family: var(--sans); font-size: 14px; letter-spacing: 0; text-transform: none; font-weight: 600; }

#root .maturity-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
#root .maturity-steps > button {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 20px; min-width: 0; text-align: left;
  border-radius: var(--r-md);
  background: var(--glass-1); border: 1px solid var(--glass-border); box-shadow: var(--shadow-soft);
  color: var(--ink);
}
#root .maturity-steps > button.in-range { background: var(--amber-bg); border-color: var(--amber-line); }
#root .maturity-steps > button.selected {
  background:
    radial-gradient(circle at 84% 16%, rgba(232, 163, 61, 0.14), transparent 52%),
    radial-gradient(circle at 14% 88%, rgba(84, 145, 108, 0.36), transparent 56%),
    linear-gradient(155deg, rgba(31, 56, 44, 0.96), rgba(22, 40, 31, 0.95));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 52px -20px rgba(18, 34, 26, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: var(--on-dark);
}
#root .maturity-index {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(22, 20, 15, 0.12); color: var(--ink);
}
#root .maturity-steps > button.selected .maturity-index { background: var(--amber); border-color: var(--amber); color: var(--ink); }
#root .maturity-steps b { font-size: 17px; font-weight: 800; letter-spacing: -0.025em; }
#root .maturity-steps small { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--amber-ink); }
#root .maturity-steps > button.selected small { color: #F6B95E; }
#root .stage-chevron { position: absolute; top: 50%; right: -13px; transform: translateY(-50%); z-index: 1; color: var(--amber-ink); background: var(--bg); border-radius: 50%; }
@media (hover: hover) and (pointer: fine) {
  #root .maturity-steps > button:not(.selected):hover { border-color: var(--amber); transform: translateY(-1px); }
}
#root .journey-note {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap;
  margin: 16px 0 24px; font-size: 14px; color: var(--ink-2);
}
#root .journey-note span {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: rgba(233, 230, 220, 0.85); color: var(--ink-2); border: 1px solid rgba(22, 20, 15, 0.12);
}
#root .journey-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 24px; align-items: stretch; }
#root .stage-detail { padding: 32px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
#root .stage-detail h2 { font-size: clamp(24px, 2.4vw, 30px); font-weight: 800; line-height: 1.12; letter-spacing: -0.03em; color: var(--on-dark); }
#root .stage-detail > p { font-size: 15px; line-height: 1.55; color: var(--on-dark-muted); }
#root .evidence-box,
#root .next-box,
#root .boundary {
  padding: 16px 20px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.16);
}
#root .evidence-box { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; }
#root .evidence-box > svg { color: var(--amber); }
#root .evidence-box small { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; color: #F6B95E; }
#root .evidence-box p { margin-top: 8px; font-size: 14.5px; line-height: 1.5; color: var(--on-dark); }
#root .next-box { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: rgba(255, 255, 255, 0.94); border-color: var(--amber); }
#root .next-box .eyebrow { color: var(--amber-ink) !important; }
#root .next-box p { font-size: 14.5px; line-height: 1.5; color: var(--ink); }
#root .next-box .primary { margin-top: 8px; }
#root .boundary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; }
#root .boundary > svg { color: #64A480; }
#root .boundary p { font-size: 13.5px; line-height: 1.5; color: var(--on-dark-muted); }

#root .living-record { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
#root .record-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 24px 28px; border-bottom: 1px solid rgba(22, 20, 15, 0.08);
}
#root .record-header h3 { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; letter-spacing: -0.025em; }
#root .record-header h3 svg { color: var(--green); }
#root .record-stage {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: linear-gradient(145deg, #2D5341, #213D2F); color: var(--on-dark); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
#root .record-content { padding: 16px 28px 8px; flex: 1; }
#root .record-intro { font-size: 13.5px; line-height: 1.5; color: var(--muted); margin-bottom: 8px; }
#root .living-record dl { display: grid; }
#root .record-row {
  display: grid; grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.6fr); gap: 16px; align-items: center;
  padding: 12px 8px; border-bottom: 1px solid rgba(22, 20, 15, 0.06);
  border-radius: var(--r-xs);
}
#root .record-row:last-child { border-bottom: 0; }
#root .record-row dt { font-size: 13px; font-weight: 700; color: var(--ink); }
#root .record-row dd { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); min-width: 0; }
#root .record-row dd > span:first-child { min-width: 0; overflow-wrap: anywhere; }
#root .record-row dd select { width: auto; min-width: 200px; max-width: 100%; min-height: 36px; padding: 4px 12px; font-weight: 600; }
#root .record-row.locked dt { color: var(--muted); }
#root .record-row.stage-addition { background: var(--amber-bg); box-shadow: inset 3px 0 0 var(--amber); padding-left: 16px; }
#root .source-tag {
  flex: none; font-family: var(--mono); font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: var(--r-pill); white-space: nowrap;
  background: var(--amber-bg); color: var(--amber-ink); border: 1px solid var(--amber-line);
}
#root .source-tag.observation { background: var(--green-bg); color: var(--forest); border-color: var(--green-line); }
#root .missing-value {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  padding: 2px 10px; border-radius: var(--r-pill); border: 1px dashed rgba(22, 20, 15, 0.2);
}
#root .missing-value span { color: var(--amber-ink); font-weight: 700; }
#root .record-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 28px; border-top: 1px solid rgba(22, 20, 15, 0.08);
  background: rgba(255, 255, 255, 0.55);
  font-size: 13px; color: var(--muted);
}

#root .action-capture {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr) auto; align-items: center; gap: 24px;
  margin-top: 24px; padding: 24px 28px;
  border-radius: var(--r-lg);
  background: var(--amber-bg); border: 1px solid var(--amber-line); box-shadow: var(--shadow-soft);
}
#root .action-capture h3 { margin-top: 8px; font-size: 20px; font-weight: 800; letter-spacing: -0.025em; }

/* ---------- Privacy panel and footer ---------- */
#root .privacy-panel { margin-top: 24px; padding: 32px; display: grid; gap: 16px; }
#root .privacy-panel > div { display: flex; align-items: center; gap: 16px; }
#root .privacy-panel > div svg { color: var(--amber); }
#root .privacy-panel h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.028em; color: var(--on-dark); }
#root .privacy-panel p { font-size: 14.5px; line-height: 1.55; color: var(--on-dark-muted); max-width: 900px; }
#root .privacy-panel .quiet { justify-self: start; }

#root .footer {
  margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(22, 20, 15, 0.08);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: center;
  font-size: 13px; color: var(--muted);
}
#root .footer > div:first-child { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
#root .footer strong { color: var(--forest); font-weight: 700; }
#root .footer > div:first-child > span { color: var(--ink-2); }
#root .footer-privacy { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--amber-ink); text-decoration: underline; text-underline-offset: 4px; }
#root .four-as { display: flex; gap: 8px; flex-wrap: wrap; }
#root .four-as span {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: rgba(235, 232, 222, 0.85); color: var(--ink-2); border: 1px solid rgba(22, 20, 15, 0.08);
}
#root .footer > p { grid-column: 1 / -1; font-size: 12.5px; line-height: 1.5; color: var(--muted); }

/* ---------- Dialogs ---------- */
#root dialog {
  width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  margin: auto; padding: 32px; overflow: auto;
  border-radius: var(--r-lg);
  background: rgba(255, 254, 250, 0.97);
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 56px -24px rgba(22, 20, 15, 0.32), inset 0 1.5px 0 rgba(255, 255, 255, 0.96);
  color: var(--ink);
}
#root dialog::backdrop { background: rgba(22, 20, 15, 0.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#root dialog[open] { display: flex; flex-direction: column; gap: 16px; }
#root .dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
#root dialog h2 { margin-top: 8px; font-size: 26px; font-weight: 800; letter-spacing: -0.032em; line-height: 1.1; }
#root .dialog-intro, #root .reset-dialog > p { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
#root dialog textarea {
  min-height: 300px; padding: 16px; resize: vertical;
  font-family: var(--mono); font-size: 12px; line-height: 1.7;
  white-space: pre-wrap;
}
#root .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
#root dialog .micro { text-align: right; }

/* Print: only the discussion brief */
#root .print-brief { display: none; }
@media print {
  body.aimap-body { background: #FFFFFF; }
  .optical-backdrop, .header-shell, .aimap-hero, .swiss-footer, .moustr-showcase-dock, #moustr-showcase-dock,
  #root .topbar, #root .workspace, #root .sidebar-top, #root .story-nav, #root .sidebar-note, #root .privacy-link, #root main, #root dialog { display: none !important; }
  .page-frame { padding: 0; max-width: none; }
  .aimap-band { padding: 0; }
  #root .app-shell { display: block; }
  #root .print-brief { display: block !important; padding: 16px; color: var(--ink); }
  #root .print-brief h1 { margin-bottom: 24px; font-size: 22px; }
  #root .print-brief pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.8 var(--sans); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  #root .explore-layout { grid-template-columns: minmax(0, 1fr); }
  #root .journey-grid { grid-template-columns: minmax(0, 1fr); }
  #root .stage-chevron { display: none; }
  #root .action-capture { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  #root .action-capture .primary { justify-self: start; }
}
@media (max-width: 900px) {
  #root main { padding: 28px; }
  #root .story-nav { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #root .story-nav > button { min-height: 64px; padding: 12px 16px; }
  #root .pain-angles { grid-template-columns: minmax(0, 1fr); }
  #root .convergence { display: none; }
  #root .owner-fields { grid-template-columns: minmax(0, 1fr); }
  #root .ownership-model { padding: 28px; }
  #root .people-map { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 16px; }
  #root .people-lines { display: none; }
  #root .role-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #root .record-hub { order: -1; }
  #root .hub-core { width: min(100%, 240px); }
  #root .hub-orbit { width: min(100%, 272px); }
}
@media (max-width: 768px) {
  .aimap-band { padding-top: 56px; }
  #root .app-shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "nav" "bar" "main" "note" "priv"; }
  #root .privacy-link { margin-top: 8px; }
  #root .topbar { border-radius: var(--r-md); padding: 12px 16px; }
  #root .principle-strip { grid-template-columns: minmax(0, 1fr); gap: 8px; border-radius: var(--r-md); }
  #root .principle-strip > svg { display: none; }
  #root .maturity-steps { display: flex; flex-wrap: wrap; gap: 8px; }
  #root .maturity-steps > button { flex: 1 1 150px; }
  #root .footer { grid-template-columns: minmax(0, 1fr); }
  #root .record-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
@media (max-width: 560px) {
  #root main { padding: 20px 16px; border-radius: var(--r-lg); }
  #root .map-board { padding: 16px; }
  #root .inspector, #root .stage-detail { padding: 20px; }
  #root .gap-nodes { grid-template-columns: minmax(0, 1fr); }
  #root .role-column { grid-template-columns: minmax(0, 1fr); }
  #root .maturity-steps > button { flex-basis: 100%; }
  #root .record-header, #root .record-content, #root .record-foot { padding-left: 16px; padding-right: 16px; }
  #root .ownership-model, #root .action-capture { padding: 20px; }
  #root .compare-controls { flex-direction: column; align-items: stretch; }
  #root .compare-controls > svg { display: none; }
  #root .compare-controls select { min-width: 0; }
  #root .record-row dd select { min-width: 0; width: 100%; }
  #root dialog { padding: 20px; }
  #root .top-actions { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #root * { transition: none !important; }
}

/* Fit refinements */
#root .boundary { margin-top: auto; }
#root .action-capture textarea { min-height: 64px; resize: vertical; line-height: 1.5; }
@media (max-width: 560px) {
  #root .owner-fields input { padding: 8px 12px; font-size: 13px; }
}

/* =====================================================================
   v2 (23 Nov, Will t2094u): the tool is the main stage, straight under
   the title; intro, privacy and other details sit below it. On desktop
   the tool is landscape (full content width, short) and
   ai-map-fit.v1.js scales it to fit one screen under the site header.
   ===================================================================== */
.aimap-band { padding-top: 0; }
.aimap-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap;
  margin: 0 0 16px;
}
.aimap-title h1 { font-size: clamp(26px, 2.6vw, 36px); font-weight: 800; line-height: 1.1; letter-spacing: -0.032em; }
.aimap-title .coord-index { margin: 0; }
#root .app-shell { transform-origin: top left; }

/* Phone and tablet: tool first, intro and details after it */
#root .app-shell {
  grid-template-areas:
    "nav  nav"
    "bar  bar"
    "main main"
    "head head"
    "note priv";
}
#root .sidebar-top { margin: 40px 0 0; }
@media (max-width: 768px) {
  #root .app-shell { grid-template-areas: "nav" "bar" "main" "head" "note" "priv"; }
}

/* ---------- Desktop stage (1100px and wider) ---------- */
@media (min-width: 1100px) {
  .page-frame { padding-bottom: 64px; }
  #root .app-shell {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "nav   acts"
      "head2 head2"
      "scene scene"
      "cap   cap"
      "intro intro"
      "note  priv"
      "foot  foot"
      "pp    pp";
    column-gap: 16px;
  }
  /* The stage frame: homepage light frosted pavilion behind rows 1 to 3 */
  #root .app-shell::before {
    content: ""; grid-column: 1 / -1; grid-row: 1 / 4;
    border-radius: var(--r-xl);
    background:
      radial-gradient(circle at 12% 16%, rgba(232, 163, 61, 0.10), transparent 52%),
      radial-gradient(circle at 88% 84%, rgba(62, 107, 82, 0.08), transparent 50%),
      linear-gradient(155deg, rgba(255, 255, 255, 0.78), rgba(247, 244, 237, 0.72));
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 24px 56px -24px rgba(22, 20, 15, 0.12), inset 0 1.5px 0 rgba(255, 255, 255, 0.96);
  }
  #root .topbar, #root main, #root .scene, #root .explore-layout, #root .journey-grid { display: contents; }
  #root main { padding: 0; }

  /* Row 1: stage nav + actions */
  #root .story-nav {
    grid-area: nav; margin: 16px 0 0 16px;
    display: flex; gap: 8px; flex-wrap: wrap;
  }
  #root .story-nav > button { min-height: 0; padding: 8px 16px 8px 8px; gap: 8px; border-radius: var(--r-pill); }
  #root .story-nav b { font-size: 14px; }
  #root .story-nav small { font-size: 12px; margin-top: 0; }
  #root .story-nav > button > svg { display: none; }
  #root .top-actions { grid-area: acts; margin: 16px 16px 0 0; align-self: center; justify-content: flex-end; }
  #root .top-caption { grid-area: cap; margin-top: 40px; text-align: center; }

  /* Row 2: stage heading in one line */
  #root .page-heading {
    grid-area: head2; margin: 16px 24px 16px;
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 8px 24px;
  }
  #root .page-heading > div { display: contents; max-width: none; }
  #root .page-heading .eyebrow { grid-column: 1 / -1; }
  #root .page-heading h1 { grid-column: 1; margin: 0; font-size: 24px; line-height: 1.15; white-space: nowrap; }
  #root .page-heading p { grid-column: 2; margin: 0 0 2px; font-size: 14px; line-height: 1.4; }
  #root .page-heading .interactive-badge { grid-column: 3; grid-row: 2; margin-bottom: 2px; }

  /* Scenes: every block is placed on one stage grid */
  #root .app-shell > * { min-width: 0; }
  #root .map-board, #root .inspector, #root .principle-strip, #root .handoff-focus, #root .ownership-model,
  #root .maturity-toolbar, #root .maturity-steps, #root .journey-note, #root .stage-detail, #root .living-record, #root .action-capture {
    margin: 0;
  }

  /* Below the stage */
  #root .sidebar-top { grid-area: intro; margin: 16px 0 0; }
  #root .sidebar-note { grid-area: note; }
  #root .privacy-link { grid-area: priv; }
  #root .footer { grid-area: foot; margin-top: 24px; }
  #root .privacy-panel { grid-area: pp; }
}

/* The scene grid lives on a wrapper the bundle does not have, so each scene
   gets its own placement inside the "scene" row via a sub-grid on .scene's children.
   (Implemented in the next block with :has() on the shell.) */
@media (min-width: 1100px) {
  #root .app-shell { grid-template-rows: auto auto auto; }
  #root .scene { display: grid !important; grid-area: scene; margin: 0 16px 16px; gap: 16px; align-items: stretch; }
  #root .scene .explore-layout, #root .scene .journey-grid { display: contents; }

  /* Stage 01: board | inspector; Moustr approach under the board */
  #root .scene:has(.pain-board) { grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto auto; }
  #root .pain-board { grid-column: 1; grid-row: 1; }
  #root .pressure-inspector { grid-column: 2; grid-row: 1 / span 2; }
  #root .scene:has(.pain-board) .principle-strip { grid-column: 1; grid-row: 2; padding: 8px 24px; }

  #root .pain-board { padding: 16px 20px; gap: 16px; }
  #root .pain-angles { gap: 12px; }
  #root .angle-card { padding: 16px; gap: 4px; }
  #root .angle-card h3 { margin-top: 4px; font-size: 17px; }
  #root .angle-divider { margin: 4px 0; }
  #root .angle-list { gap: 4px; font-size: 13px; }
  #root .angle-bottom { margin-top: 4px; padding-top: 8px; }
  #root .convergence { height: 48px; margin: -8px 0; }
  #root .convergence span { top: 10px; }
  #root .gap-nodes button { padding: 12px 16px; }
  #root .gap-nodes p { margin-top: 0; }
  #root .board-bottom { padding-top: 12px; }
  #root .rotate button { width: 32px; height: 32px; }
  #root .inspector { padding: 20px 24px; gap: 12px; }
  #root .inspector h2 { font-size: 20px; }
  #root .inspector > p { font-size: 14px; }
  #root .ask-box { padding: 12px 16px; }
  #root .ask-box p { margin-top: 4px; font-size: 14px; }

  /* Stage 02: people board | role detail | handoff + ownership model */
  #root .scene:has(.people-board) { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.8fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  #root .people-board { grid-column: 1; grid-row: 1 / span 2; padding: 16px 20px; gap: 12px; }
  #root #role-detail { grid-column: 2; grid-row: 1 / span 2; }
  #root .handoff-focus { grid-column: 3; grid-row: 1; padding: 12px 16px; gap: 8px; }
  #root .handoff-focus p { margin-top: 4px; font-size: 13.5px; gap: 2px 8px; }
  #root .ownership-model { grid-column: 3; grid-row: 2; padding: 16px 20px; }
  #root .model-intro { margin-bottom: 12px; }
  #root .model-intro h2 { margin-top: 4px; font-size: 18px; }
  #root .model-intro p { margin-top: 8px; font-size: 13px; line-height: 1.45; }
  #root .owner-fields { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #root .owner-fields label { padding: 8px 12px; gap: 4px; display: grid; grid-template-columns: minmax(0, 1fr); }
  #root .owner-fields label > span { font-size: 13.5px; }
  #root .owner-fields small { font-size: 12px; line-height: 1.35; }
  #root .owner-fields input { min-height: 34px; padding: 4px 12px; font-size: 13px; }
  #root .model-foot { margin-top: 12px; gap: 8px; font-size: 12.5px; }
  #root .people-map { min-height: 0; gap: 8px; }
  #root .role-column { gap: 8px; }
  #root .role-node { min-height: 0; padding: 10px 12px; gap: 12px; }
  #root .role-node b { font-size: 13.5px; }
  #root .role-node small { margin-top: 2px; font-size: 12px; }
  #root .hub-core { width: min(92%, 220px); padding: 16px; }
  #root .hub-core h3 { font-size: 17px; }
  #root .hub-core p { margin: 4px 0 8px; font-size: 12px; }
  #root .hub-orbit { width: min(100%, 250px); }
  #root .people-conclusion { padding-top: 12px; }
  #root .mini-block { padding: 10px 16px; }
  #root .mini-block p { margin-top: 4px; font-size: 13.5px; }

  /* Stage 03: toolbar + steps across; stage detail | living record */
  #root .scene:has(.maturity-steps) { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.5fr); }
  #root .maturity-toolbar { grid-column: 1 / -1; padding: 8px 16px; }
  #root .maturity-toolbar p { font-size: 15px; }
  #root .compare-controls { gap: 8px 16px; flex-wrap: nowrap; align-items: center; }
  #root .compare-controls label { flex-direction: row; align-items: center; gap: 8px; }
  #root .compare-controls > svg { margin: 0; }
  #root .compare-controls select { min-width: 150px; min-height: 36px; padding: 4px 12px; }
  #root .maturity-steps { grid-column: 1 / -1; gap: 12px; }
  #root .maturity-steps > button {
    display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; row-gap: 0;
    align-items: center; padding: 10px 16px;
  }
  #root .maturity-index { grid-row: 1 / span 2; width: 30px; height: 30px; }
  #root .maturity-steps b { font-size: 15px; }
  #root .journey-note { grid-column: 1 / -1; margin: -4px 0; font-size: 13px; }
  #root .stage-detail { grid-column: 1; grid-row: 4; padding: 20px 24px; gap: 12px; }
  #root .stage-detail h2 { font-size: 22px; }
  #root .stage-detail > p { font-size: 14px; }
  #root .evidence-box, #root .next-box, #root .boundary { padding: 12px 16px; }
  #root .evidence-box p { margin-top: 4px; font-size: 13.5px; }
  #root .next-box p { font-size: 13.5px; }
  #root .next-box .primary { margin-top: 4px; min-height: 36px; }
  #root .boundary p { font-size: 12.5px; }
  #root .living-record { grid-column: 2; grid-row: 4 / span 2; }
  #root .record-header { padding: 12px 20px; }
  #root .record-header h3 { margin-top: 2px; font-size: 17px; }
  #root .record-content { padding: 8px 16px 8px; }
  #root .record-intro { font-size: 12.5px; margin-bottom: 8px; }
  #root .living-record dl { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
  #root .record-row { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 6px 8px; align-items: start; }
  #root .record-row:nth-last-child(2) { border-bottom: 0; }
  #root .record-row dt { font-size: 12px; }
  #root .record-row dd { font-size: 12.5px; gap: 4px 8px; }
  #root .record-row dd select { min-height: 30px; min-width: 0; width: 100%; font-size: 12.5px; }
  #root .record-row.stage-addition { padding-left: 12px; }
  #root .record-foot { padding: 8px 20px; font-size: 12.5px; }
  #root .action-capture { grid-column: 1; grid-row: 5; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 12px 16px; }
  #root .action-capture > div { grid-column: 1 / -1; }
  #root .action-capture h3 { margin-top: 2px; font-size: 16px; }
  #root .action-capture textarea { min-height: 42px; height: 42px; }
  #root .action-capture .primary { min-height: 40px; padding: 0 16px; }
}

/* ---------- v2 refinements: shorter stages ---------- */
@media (min-width: 1100px) {
  /* Stage heading: eyebrow, title, line and badge on one row */
  #root .page-heading { grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; margin: 12px 24px 12px; }
  #root .page-heading .eyebrow { grid-column: 1; grid-row: 1; }
  #root .page-heading h1 { grid-column: 2; grid-row: 1; font-size: 22px; }
  #root .page-heading p { grid-column: 3; grid-row: 1; margin: 0; font-size: 13.5px; color: var(--muted); }
  #root .page-heading .interactive-badge { grid-column: 4; grid-row: 1; margin: 0; }

  /* Stage 02: handoff strip under the board; ownership model in its own column */
  #root .scene:has(.people-board) { grid-template-rows: minmax(0, 1fr) auto; }
  #root .people-board { grid-row: 1; }
  #root .handoff-focus { grid-column: 1; grid-row: 2; }
  #root .ownership-model { grid-column: 3; grid-row: 1 / span 2; display: flex; flex-direction: column; }
  #root .owner-fields { flex: 1; align-content: start; }
  #root #role-detail { gap: 10px; }
  #root #role-detail .primary { min-height: 38px; }

  /* Stage 03: three columns: where you are | the stage | the record */
  #root .scene:has(.maturity-steps) {
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr) minmax(0, 1.3fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 12px 16px;
  }
  #root .maturity-toolbar { grid-column: 1; grid-row: 1; padding: 12px 16px; flex-direction: column; align-items: stretch; gap: 8px; }
  #root .maturity-toolbar p { font-size: 14px; }
  #root .compare-controls { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 8px; }
  #root .compare-controls > svg { display: none; }
  #root .compare-controls label { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 8px; }
  #root .compare-controls select { min-width: 0; width: 100%; min-height: 32px; }
  #root .maturity-steps { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; gap: 6px; }
  #root .maturity-steps > button { padding: 6px 12px; }
  #root .maturity-steps > button .stage-chevron { display: none; }
  #root .maturity-index { width: 26px; height: 26px; font-size: 10.5px; }
  #root .maturity-steps b { font-size: 14px; }
  #root .maturity-steps small { font-size: 10px; }
  #root .journey-note { grid-column: 1; grid-row: 3; margin: 0; align-self: start; flex-direction: column; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.45; }
  #root .stage-detail { grid-column: 2; grid-row: 1 / span 2; }
  #root .action-capture { grid-column: 2; grid-row: 3; align-self: stretch; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #root .action-capture .primary { justify-self: start; }
  #root .living-record { grid-column: 3; grid-row: 1 / span 3; }
  #root .record-row dd > span:first-child { font-size: 12.5px; }
}
@media (min-width: 1100px) {
  #root .scene:has(.people-board) { grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.85fr) minmax(0, 0.95fr); }
  #root .hub-core { width: 196px; min-height: 196px; aspect-ratio: auto; height: auto; padding: 12px 16px; }
  #root .hub-core h3 { font-size: 16px; }
  #root .hub-core p { font-size: 11.5px; }
  #root .hub-orbit { width: 228px; }
  #root .people-map { grid-template-columns: minmax(0, 1fr) 216px minmax(0, 1fr); }
}
@media (min-width: 1100px) {
  .aimap-title { margin-bottom: 12px; }
  .aimap-title h1 { font-size: clamp(26px, 2.3vw, 32px); }
  #root .story-nav { margin-top: 12px; }
  #root .top-actions { margin-top: 12px; }
  #root .page-heading { margin: 8px 24px 12px; }
  #root .compare-controls label { grid-template-columns: 112px minmax(0, 1fr); font-size: 10px; }
  #root .record-intro { font-size: 12px; margin-bottom: 4px; }
  #root .record-row { padding: 5px 8px; }
  #root .record-header { padding: 10px 20px; }
}
@media (min-width: 1100px) {
  #root .action-capture textarea { height: 48px; min-height: 48px; padding: 6px 12px; font-size: 12.5px; line-height: 1.4; }
}


/* seomap1: crawlable details sit below the tool. Existing homepage
   plates and lists only; spacing follows the site rhythm (88 / 56).
   The fit script still scales only #root, so one-screen fit is unchanged. */
.aimap-details { margin-top: 88px; display: grid; gap: 88px; }
.aimap-details-intro { display: grid; gap: 16px; }
.aimap-details-block {
  display: grid;
  gap: 16px;
  padding: 32px;
  border-radius: var(--r-lg);
  background: var(--glass-1);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  color: var(--ink);
}
.aimap-details .coord-index { justify-self: start; margin-bottom: 0; }
.aimap-details h2 { font-size: clamp(26px, 3vw, 37px); font-weight: 800; line-height: 1.08; letter-spacing: -0.032em; margin: 0; }
.aimap-details .stance-plate { margin: 0; }
.aimap-details-block .stance-lead { color: var(--ink-2); }
.aimap-details-block .stance-route-item strong { color: var(--ink); }
.aimap-details-block .stance-route-item span { color: var(--ink-2); }
.aimap-details .stance-route-item div { display: grid; gap: 6px; }
.aimap-details .stance-route-item span { display: block; }
@media (max-width: 768px) {
  .aimap-details { margin-top: 56px; gap: 56px; }
  .aimap-details-block { padding: 20px; }
}
