/* ──────────────────────────────────────────────────────────────────────
 * Mitigate Hub — shared styles for the new panel modules.
 * Token-only — no hardcoded hex except in fallbacks for older browsers.
 * Aligns with Montana Editorial palette in styles/base.css.
 * ────────────────────────────────────────────────────────────────────── */

/* Sidecar-unavailable state (used by mitigate-science-client) */
.guide-state.guide-state--unavail {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 18px;
  background: var(--bg-3, #F7F5F0);
  border: 1px dashed var(--border-subtle, #dcd7c8);
  border-radius: 12px;
  color: var(--text-muted, #6B6B73);
}
.guide-state.guide-state--unavail .guide-state-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(132, 166, 90, 0.12);
  color: var(--ai-accent, #84A65A);
  border-radius: 50%;
  margin-bottom: 10px;
}
.guide-state.guide-state--unavail .guide-state-icon i {
  width: 22px;
  height: 22px;
}
.guide-state.guide-state--unavail .guide-state-title {
  font-size: var(--guide-fs-md);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  margin-bottom: 4px;
}
.guide-state.guide-state--unavail .guide-state-reason {
  font-size: var(--guide-fs-xs);
  line-height: 1.5;
  max-width: 420px;
}
.guide-state.guide-state--unavail .guide-state-citation {
  font-size: var(--guide-fs-2xs);
  font-style: italic;
  margin-top: 8px;
  color: var(--text-tertiary, #6B6B73);
}
.guide-state.guide-state--unavail .guide-state-action {
  margin-top: 12px;
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: var(--ai-accent, #84A65A);
  color: var(--text-primary, #1A1A1F);
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  cursor: pointer;
}

/* Mitigate citation footer — appears at the bottom of every panel */
.mitigate-citation {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
  margin-top: 8px;
  text-align: right;
  font-style: italic;
}

/* Stream-depletion sliders */
.msd-slider input[type="range"] {
  accent-color: var(--mt-slate, #3B5A7A);
}

/* Drought outlook tiles */
#mitigate-drought-outlook a {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#mitigate-drought-outlook a:hover {
  box-shadow: var(--guide-shadow-raised);
}

/* Mobile collapse for stream-depletion sliders */
@media (max-width: 720px) {
  .msd-controls {
    grid-template-columns: 1fr !important;
  }
}

/* Sage AI quick-action pill (used by ai-service for Mitigate prompts) */
.mitigate-ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--ai-accent, #84A65A);
  color: var(--text-primary, #1A1A1F);
  border-radius: 999px;
  font-size: var(--guide-fs-2xs);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease;
}
.mitigate-ai-pill:hover {
  background: rgba(132, 166, 90, 0.85);
}
.mitigate-ai-pill i {
  width: 14px;
  height: 14px;
}

/* ──────────────────────────────────────────────────────────────────────
 * Phase M0 — Mitigate Hub cockpit, persona row, section navigator,
 * grouped section layout. Mirrors the Hydrology / Enforce hub patterns.
 * ────────────────────────────────────────────────────────────────────── */

/* ── Cockpit ──────────────────────────────────────────────────────── */
.mit-cockpit {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  margin: 12px 0 8px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 14px;
  box-shadow: var(--guide-shadow-raised);
}
.mit-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.mit-kpi {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #e6e0cf);
  border-radius: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mit-kpi:hover {
  box-shadow: var(--guide-shadow-raised);
}
.mit-kpi-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--guide-color-plum) 8%, transparent);
  border-radius: 8px;
  flex-shrink: 0;
}
.mit-kpi-icon i {
  width: 18px;
  height: 18px;
}
.mit-kpi-data { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.mit-kpi-val {
  font-size: var(--guide-fs-lg);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  font-variant-numeric: tabular-nums;
}
.mit-kpi-label {
  font-size: var(--guide-fs-2xs);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.06em;
  color: var(--text-tertiary, #6B6B73);
  font-weight: 600;
}

.mit-cockpit-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Sidecar status pill */
.mit-sidecar-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: var(--guide-fs-2xs);
  font-weight: 600;
  border: 1px solid var(--border-subtle, #dcd7c8);
  background: var(--bg-0, #FFFEFA);
  color: var(--text-secondary, #4B4B53);
}
.mit-sidecar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9CA3AF;
  box-shadow: 0 0 0 0 currentColor;
}
.mit-sidecar-pill[data-state="online"]       .mit-sidecar-dot { background: var(--guide-color-moss); box-shadow: 0 0 0 3px color-mix(in srgb, var(--guide-color-moss) 18%, transparent); }
.mit-sidecar-pill[data-state="online"]       { color: #166534; border-color: color-mix(in srgb, var(--guide-color-moss) 40%, transparent); }
.mit-sidecar-pill[data-state="offline"]      .mit-sidecar-dot { background: var(--guide-color-status-crit); }
.mit-sidecar-pill[data-state="offline"]      { color: var(--guide-color-status-crit); border-color: color-mix(in srgb, var(--guide-color-status-crit) 40%, transparent); }
.mit-sidecar-pill[data-state="unconfigured"] .mit-sidecar-dot { background: var(--guide-color-ochre); }
.mit-sidecar-pill[data-state="unconfigured"] { color: #92400E; border-color: color-mix(in srgb, var(--guide-color-ochre) 40%, transparent); }

.mit-cmdk-hint {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--bg-2, #F2EFE6);
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
  cursor: pointer;
}
.mit-cmdk-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--guide-fs-2xs);
  line-height: 1;
  color: var(--text-secondary, #4B4B53);
}

/* ── Section navigator ────────────────────────────────────────────── */
.mit-secnav {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  padding: 3px;
  background: var(--guide-color-paper-2);
  border: 1px solid var(--guide-color-line);
  border-radius: var(--guide-radius-md, 8px);
  margin: 0 0 16px;
}
.mit-secnav-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--guide-radius-sm, 6px);
  background: transparent;
  border: 0;
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  color: var(--guide-color-ink-soft);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
/* The segmented control: a recessed track (solid, not frosted, though it
   sticks), the current section a raised sheet in ink. */
.mit-secnav-chip i { width: 13px; height: 13px; color: currentcolor; }
.mit-secnav-chip:hover {
  color: var(--guide-color-ink);
}
.mit-secnav-chip--active {
  background: var(--guide-color-raised);
  box-shadow: var(--guide-shadow-rest);
  color: var(--guide-color-ink);
}
.mit-secnav-chip--active i { color: var(--guide-color-action); }

/* ── Sections ─────────────────────────────────────────────────────── */
.mit-section {
  margin: 0 0 28px;
  padding: 0;
  scroll-margin-top: 64px;
  transition: opacity 0.18s ease;
}
/* Brief flash when a hero Workspace card drives the page to this section. */
.mit-section-flash { animation: mitSectionFlash 1.35s ease-out; }

/* Section headline: the same flat treatment as the other hubs' section heads —
   no band, border, shadow or medallion; a 1px rule above, a display-face title
   and one sentence. Sections are not told apart by hue (SECTIONS[].color is
   not drawn), so --sec-color is deliberately unused. */
.mit-section-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0 0;
  margin: 40px 0 18px;
  border-top: 1px solid var(--guide-color-line);
  scroll-margin-top: 72px;
}
/* The first section shouldn't carry the big top gap (it follows the nav). */
.mit-section:first-of-type > .mit-section-head { margin-top: 10px; }
.mit-section-head-icon { display: none; }
.mit-section-head-body { flex: 1; min-width: 0; }
.mit-section-title {
  font-family: var(--guide-font-display, Georgia, serif);
  font-size: var(--guide-fs-xl);
  font-weight: 600;
  color: var(--guide-color-ink);
  margin: 0;
  line-height: 1.2;
}
.mit-section-sub {
  font-size: var(--guide-fs-md);
  color: var(--guide-color-ink-soft);
  margin: 4px 0 0;
}
.mit-section-head-tail { flex-shrink: 0; }

/* ── Understand cards (Phase M1) ──────────────────────────────────── */
.mit-understand-grid {
  display: grid;
  /* Was 320px minmax — the SVG animations need more room to feel like
     a peer to the depletion infographic, so bump to 380px. */
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 18px;
}
.mit-uc {
  display: flex;
  flex-direction: column;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--guide-shadow-raised);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.mit-uc:hover {
  box-shadow: var(--guide-shadow-overlay);
}
.mit-uc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 0;
}
.mit-uc-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--guide-color-paper-2);
  color: var(--guide-color-ink-soft);
  border-radius: 10px;
  flex-shrink: 0;
}
.mit-uc-icon i { width: 20px; height: 20px; }
.mit-uc-title {
  margin: 0;
  font-size: var(--guide-fs-lg);
  font-weight: 800;
  color: var(--text-primary, #1A1A1F);
  letter-spacing: -0.01em;
}
.mit-uc-subtitle {
  margin: 2px 0 0;
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
  font-style: italic;
}

.mit-uc-figure {
  padding: 12px 16px 0;
  position: relative;
}
/* Direct-child combinator ONLY — a plain descendant selector (`.mit-uc-figure
   svg`) also matched the play-circle icon inside .mit-uc-figure-badge, where
   min-height:200px + background inflated the tiny "Animated" pill into a
   ~90×200 box that covered the animation it labels. */
.mit-uc-figure > svg {
  display: block;
  width: 100%;
  height: auto;
  /* Was 160px — bumped so the Adequacy / Recharge / Market-flow
     animations read at the same size class as the depletion animation
     they live alongside. */
  max-height: 280px;
  min-height: 200px;
  border-radius: 8px;
  background: var(--guide-color-paper-2);
}
/* "▶ Animated" badge on the figure so learners read the SVG as an
   animation (matches the depletion-animation idiom). */
.mit-uc-figure--animated .mit-uc-figure-badge {
  position: absolute;
  top: 14px;
  left: 22px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 6px;
  background: rgba(26, 26, 31, 0.78);
  color: var(--guide-color-text-on-accent, #fff);
  border-radius: 999px;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: var(--guide-label-case, uppercase);
  z-index: 1;
  pointer-events: none;
}
.mit-uc-figure--animated .mit-uc-figure-badge svg {
  width: 12px;
  height: 12px;
  display: inline-block;
}
.mit-uc-body {
  padding: 8px 18px 12px;
  flex: 1;
}
.mit-uc-body p {
  margin: 0 0 8px;
  font-size: var(--guide-fs-sm);
  line-height: 1.55;
  color: var(--text-secondary, #4B4B53);
}
.mit-uc-body p:last-child { margin-bottom: 0; }
.mit-uc-body strong { color: var(--text-primary, #1A1A1F); }
.mit-uc-foot {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border-subtle, #dcd7c8);
}
.mit-uc-cta {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--guide-color-action);
  color: var(--guide-color-text-on-accent, #fff);
  border: none;
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.12s ease;
}
.mit-uc-cta:hover { filter: brightness(1.08);}

/* ── Hoist tile rail (Phase M2 — Diagnose at a glance / Plan toolkit) ── */
.mit-hoist-rail {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--bg-2, #F2EFE6);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 12px;
}
.mit-hoist-rail-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.05em;
  color: var(--text-tertiary, #6B6B73);
  margin-bottom: 10px;
}
.mit-hoist-rail-title i { width: 13px; height: 13px; color: var(--guide-color-ochre); }
.mit-hoist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}
.mit-hoist-tile {
  display: grid;
  grid-template-columns: 32px 1fr 16px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.mit-hoist-tile:hover {
  border-color: var(--tile-color, #3B5A7A);
  box-shadow: var(--guide-shadow-raised);
}
.mit-hoist-tile-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--tile-color, #3B5A7A) 12%, var(--bg-0));
  color: var(--tile-color, #3B5A7A);
  border-radius: 8px;
}
.mit-hoist-tile-icon i { width: 18px; height: 18px; }
.mit-hoist-tile-body { min-width: 0; }
.mit-hoist-tile-label {
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mit-hoist-tile-sub {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mit-hoist-tile-arrow {
  color: var(--text-tertiary, #6B6B73);
  display: flex;
  align-items: center;
}
.mit-hoist-tile-arrow i { width: 14px; height: 14px; }
.mit-hoist-tile:hover .mit-hoist-tile-arrow { color: var(--tile-color, #3B5A7A); }

/* ── Glossary terms (inline) + tooltip ─────────────────────────────── */
/* A term with a definition: tabindex=0, cursor:help, a tooltip on hover and
   focus. That is an interactive text affordance, so it takes the link token
   rather than the raw brand blue, which sat at 2.58:1 on the dark page. The
   dotted rule underneath follows currentColor so the two can never drift — it
   is the same affordance, drawn twice. */
.mit-gloss-term {
  border-bottom: 1px dotted currentColor;
  cursor: help;
  color: var(--guide-color-link);
  font-weight: 600;
}
.mit-gloss-term:focus { outline: 2px solid var(--mt-slate, #3B5A7A); outline-offset: 2px; }

.mit-gloss-tip {
  position: absolute;
  z-index: var(--guide-z-max, 10000);
  max-width: 320px;
  padding: 10px 12px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
  box-shadow: var(--guide-shadow-overlay);
  pointer-events: none;
  animation: mit-gloss-fade-in 0.12s ease-out;
}
.mit-gloss-tip-title {
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.04em;
  color: var(--mt-slate, #3B5A7A);
  margin-bottom: 4px;
}
.mit-gloss-tip-def {
  font-size: var(--guide-fs-xs);
  line-height: 1.5;
  color: var(--text-secondary, #4B4B53);
}
.mit-gloss-tip-cite {
  margin-top: 6px;
  font-size: var(--guide-fs-2xs);
  font-style: italic;
  color: var(--text-tertiary, #6B6B73);
}

/* ── MAR feasibility panel (Phase M3) ────────────────────────────── */
.mar-feasibility { padding: 4px 0; }
.mar-intro {
  font-size: var(--guide-fs-sm);
  color: var(--text-secondary, #4B4B53);
  line-height: 1.55;
  margin-bottom: 14px;
}
.mar-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.mar-field { display: flex; flex-direction: column; gap: 4px; }
.mar-field label {
  font-size: var(--guide-fs-2xs);
  font-weight: 600;
  color: var(--text-secondary, #4B4B53);
  letter-spacing: 0.01em;
}
.mar-field input,
.mar-field select {
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle, #dcd7c8);
  background: var(--bg-0, #FFFEFA);
  font-size: var(--guide-fs-sm);
  color: var(--text-primary, #1A1A1F);
  font-family: inherit;
}
.mar-field input:focus,
.mar-field select:focus {
  outline: 2px solid var(--mt-slate, #3B5A7A);
  outline-offset: 1px;
}
.mar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.mar-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--mt-slate, #3B5A7A);
  color: var(--guide-color-text-on-accent, #fff);
  border: none;
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.12s ease;
}
.mar-btn-primary:hover { filter: brightness(1.1); }
.mar-btn-primary:disabled { opacity: 0.6; cursor: wait; }
.mar-btn-primary i { width: 14px; height: 14px; }
.mar-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary, #4B4B53);
  border: 1px solid var(--border-subtle, #dcd7c8);
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  cursor: pointer;
}
.mar-btn-ghost i { width: 14px; height: 14px; }
.mar-source-tag {
  font-size: var(--guide-fs-2xs);
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--bg-2, #F2EFE6);
  color: var(--text-tertiary, #6B6B73);
  font-weight: 600;
}
.mar-source-tag[data-source="sidecar"] { background: color-mix(in srgb, var(--guide-color-moss) 12%, transparent); color: #166534; }
.mar-source-tag[data-source="fallback (browser)"] { background: color-mix(in srgb, var(--guide-color-ochre) 14%, transparent); color: #92400E; }

/* Result — gauge + sub-cards */
.mar-result {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 16px;
  align-items: start;
}
.mar-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  background: var(--guide-color-raised);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 14px;
  text-align: center;
}
.mar-gauge-score {
  font-size: 44px;
  font-weight: 800;
  color: var(--rating, #6B6B73);
  line-height: 1;
  letter-spacing: -0.03em;
}
.mar-gauge-max { font-size: var(--guide-fs-md); color: var(--text-tertiary, #6B6B73); font-weight: 600; }
.mar-gauge-label {
  margin-top: 6px;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.06em;
  color: var(--rating, #6B6B73);
}
.mar-subgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.mar-subcard {
  padding: 10px 12px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 8px;
}
.mar-subcard-head {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.mar-subcard-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--sub-color, #6B6B73) 12%, var(--bg-0));
  color: var(--sub-color, #6B6B73);
  border-radius: 6px;
}
.mar-subcard-icon i { width: 15px; height: 15px; }
.mar-subcard-title {
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
}
.mar-subcard-score {
  font-size: var(--guide-fs-lg);
  font-weight: 800;
  color: var(--sub-color, #6B6B73);
}
.mar-subcard-note {
  font-size: var(--guide-fs-2xs);
  line-height: 1.5;
  color: var(--text-secondary, #4B4B53);
}
.mar-recommendation {
  grid-column: 1 / -1;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--ai-accent, #84A65A) 8%, var(--bg-1));
  border: 1px solid color-mix(in srgb, var(--ai-accent, #84A65A) 30%, var(--border-subtle));
  border-radius: 10px;
}
.mar-rec-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.05em;
  color: var(--ai-accent, #84A65A);
  margin-bottom: 4px;
}
.mar-rec-title i { width: 13px; height: 13px; }
.mar-rec-method {
  font-size: var(--guide-fs-lg);
  font-weight: 800;
  color: var(--text-primary, #1A1A1F);
  margin-bottom: 4px;
}
.mar-rec-reason {
  font-size: var(--guide-fs-xs);
  color: var(--text-secondary, #4B4B53);
  line-height: 1.5;
}

@media (max-width: 720px) {
  .mar-result { grid-template-columns: 1fr; }
}

/* ── Forbearance / lease-to-stream (Phase M4) ─────────────────────── */
.forbearance { padding: 4px 0; }
.forbearance-intro {
  font-size: var(--guide-fs-sm);
  color: var(--text-secondary, #4B4B53);
  line-height: 1.55;
  margin-bottom: 14px;
}
.forbearance-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.forbearance-result {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: var(--guide-fs-xs);
  line-height: 1.5;
}
.forbearance-result--ok {
  background: color-mix(in srgb, var(--guide-color-moss) 12%, var(--bg-1));
  border: 1px solid color-mix(in srgb, var(--guide-color-moss) 30%, var(--border-subtle));
  color: var(--text-primary, #1A1A1F);
}
.forbearance-result--error {
  background: color-mix(in srgb, var(--guide-color-status-crit) 10%, var(--bg-1));
  border: 1px solid color-mix(in srgb, var(--guide-color-status-crit) 30%, var(--border-subtle));
  color: #7F1D1D;
}
.fb-result-title {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: #166534;
}
.fb-result-title i { width: 14px; height: 14px; }
.fb-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 14px;
  margin-bottom: 6px;
}
.fb-k {
  font-size: var(--guide-fs-2xs);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.04em;
  color: var(--text-tertiary, #6B6B73);
  font-weight: 700;
  margin-right: 4px;
}
.fb-v {
  font-size: var(--guide-fs-xs);
  color: var(--text-primary, #1A1A1F);
  font-weight: 600;
}
.fb-result-foot {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
  font-style: italic;
}
.forbearance-drafts { margin-top: 14px; }
.fb-drafts-title {
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.05em;
  color: var(--text-tertiary, #6B6B73);
  margin-bottom: 6px;
}
.fb-drafts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.fb-drafts-item {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: var(--guide-fs-2xs);
  color: var(--text-secondary, #4B4B53);
}
.fb-drafts-wr     { font-weight: 700; color: var(--text-primary, #1A1A1F); }
.fb-drafts-period { color: var(--text-tertiary, #6B6B73); }
.fb-drafts-cfs    { font-variant-numeric: tabular-nums; }
.fb-drafts-af     { font-variant-numeric: tabular-nums; }

/* ── Due-Diligence pack (Phase M5) ────────────────────────────────── */
.dd-pack { padding: 4px 0; }
.dd-intro {
  font-size: var(--guide-fs-sm);
  color: var(--text-secondary, #4B4B53);
  line-height: 1.55;
  margin-bottom: 14px;
}
.dd-preview {
  margin-top: 14px;
  padding: 14px;
  background: var(--bg-2, #F2EFE6);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
}
.dd-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: var(--guide-fs-xs);
  color: var(--text-secondary, #4B4B53);
  flex-wrap: wrap;
}
.dd-section {
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 8px;
}
.dd-section h4 {
  margin: 0 0 6px;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.05em;
  color: var(--mt-slate, #3B5A7A);
}
.dd-section pre {
  margin: 0;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--guide-fs-2xs);
  color: var(--text-secondary, #4B4B53);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow: auto;
}

/* ── Plan Builder wizard (Phase M6) ───────────────────────────────── */
.pb-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.pb-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: var(--bg-2, #F2EFE6);
  color: var(--text-tertiary, #6B6B73);
  font-size: var(--guide-fs-2xs);
  font-weight: 600;
  border: 1px solid var(--border-subtle, #dcd7c8);
}
.pb-step-n {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-0, #FFFEFA);
  color: var(--text-tertiary, #6B6B73);
  border-radius: 50%;
  font-weight: 800;
  border: 1px solid var(--border-subtle, #dcd7c8);
}
.pb-step--active {
  background: var(--mt-slate, #3B5A7A);
  color: var(--guide-color-text-on-accent, #fff);
  border-color: var(--mt-slate, #3B5A7A);
}
.pb-step--active .pb-step-n { background: #fff; color: var(--mt-slate, #3B5A7A); }
.pb-step--done {
  background: color-mix(in srgb, var(--guide-color-moss) 12%, var(--bg-2));
  color: #166534;
  border-color: color-mix(in srgb, var(--guide-color-moss) 35%, transparent);
}
.pb-step--done .pb-step-n { background: var(--guide-color-moss); color: var(--guide-color-text-on-accent, #fff); border-color: var(--guide-color-moss); }
.pb-step-title {
  margin: 0 0 4px;
  font-size: var(--guide-fs-lg);
  font-weight: 800;
  color: var(--text-primary, #1A1A1F);
}
.pb-step-intro {
  margin: 0 0 14px;
  font-size: var(--guide-fs-xs);
  color: var(--text-tertiary, #6B6B73);
}
.pb-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 8px;
  font-size: var(--guide-fs-xs);
  cursor: pointer;
}
.pb-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle, #dcd7c8);
}
.mar-field textarea {
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle, #dcd7c8);
  background: var(--bg-0, #FFFEFA);
  font-size: var(--guide-fs-sm);
  color: var(--text-primary, #1A1A1F);
  font-family: inherit;
  resize: vertical;
}

/* ══════════════════════════════════════════════════════════════════════
   Mitigation Engine — Pipeline panel + Inventory dashboard (ME3 / ME4)
   ══════════════════════════════════════════════════════════════════════ */

.mit-pipeline-pblock .pb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pipeline-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ai-accent, #84A65A) 18%, var(--bg-0));
  color: var(--guide-color-ink);
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.05em;
}
.pipeline-badge i { width: 12px; height: 12px; }

.pipeline {
  padding: 6px 0 4px;
}
.pipeline-intro {
  font-size: var(--guide-fs-sm);
  color: var(--text-secondary, #4B4B53);
  line-height: 1.55;
  margin-bottom: 14px;
}
.pipeline-intro strong { color: var(--text-primary, #1A1A1F); }

/* Stepper */
.pipeline-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle, #dcd7c8);
}
.pipeline-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 6px;
  border-radius: 999px;
  background: var(--bg-2, #F2EFE6);
  color: var(--text-tertiary, #6B6B73);
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  border: 1px solid var(--border-subtle, #dcd7c8);
  cursor: pointer;
  position: relative;
}
.pipeline-step:disabled { opacity: 0.45; cursor: not-allowed; }
.pipeline-step:not(:disabled):hover { transform: none; }
.pipeline-step-n {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-0, #FFFEFA);
  color: var(--text-tertiary, #6B6B73);
  border-radius: 50%;
  font-weight: 800;
  border: 1px solid var(--border-subtle, #dcd7c8);
}
.pipeline-step i { width: 14px; height: 14px; }
.pipeline-step--active {
  background: var(--mt-slate, #3B5A7A);
  color: var(--guide-color-text-on-accent, #fff);
  border-color: var(--mt-slate, #3B5A7A);
}
.pipeline-step--active .pipeline-step-n { background: var(--guide-color-on-action); color: var(--guide-color-action); }
.pipeline-step--done {
  background: color-mix(in srgb, var(--guide-color-moss) 14%, var(--bg-2));
  color: #166534;
  border-color: color-mix(in srgb, var(--guide-color-moss) 35%, transparent);
}
.pipeline-step--done .pipeline-step-n { background: var(--guide-color-moss); color: var(--guide-color-text-on-accent, #fff); border-color: var(--guide-color-moss); }

.stage-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--guide-fs-lg);
  font-weight: 800;
  color: var(--text-primary, #1A1A1F);
  margin: 0 0 4px;
}
.stage-title i { width: 18px; height: 18px; color: var(--mt-slate, #3B5A7A); }
.stage-intro {
  margin: 0 0 14px;
  font-size: var(--guide-fs-xs);
  color: var(--text-tertiary, #6B6B73);
  line-height: 1.55;
}
.stage-advanced {
  margin: 8px 0 12px;
  padding: 8px 12px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 8px;
}
.stage-advanced summary {
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.05em;
  color: var(--text-tertiary, #6B6B73);
  cursor: pointer;
  margin-bottom: 10px;
}
.pipeline-empty {
  padding: 18px;
  text-align: center;
  color: var(--text-tertiary, #6B6B73);
  font-style: italic;
}
.pipeline-empty i { width: 14px; height: 14px; vertical-align: -2px; }

.pipeline-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle, #dcd7c8);
}
.pipeline-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Months checkbox grid */
.pipeline-months {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.pipeline-month {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 6px;
  font-size: var(--guide-fs-2xs);
  cursor: pointer;
}
.pipeline-month input { margin: 0; }

/* Quantify — vector cards + bar chart */
.pipeline-vector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.pipeline-vector-card {
  padding: 12px 14px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 8px;
}
.pvc-k { font-size: var(--guide-fs-2xs); text-transform: var(--guide-label-case, uppercase); letter-spacing: 0.04em; color: var(--text-tertiary, #6B6B73); font-weight: 700; }
.pvc-v { font-size: var(--guide-fs-2xl); font-weight: 800; color: var(--text-primary, #1A1A1F); line-height: 1.2; font-variant-numeric: tabular-nums; margin: 2px 0; }
.pvc-u { font-size: var(--guide-fs-xs); font-weight: 600; color: var(--text-tertiary, #6B6B73); }
.pvc-n { font-size: var(--guide-fs-2xs); color: var(--text-tertiary, #6B6B73); }

.pipeline-bar-chart {
  padding: 14px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
}
.bar-chart-title {
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.04em;
  color: var(--text-tertiary, #6B6B73);
  margin-bottom: 10px;
}
.bar-chart {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
  height: 140px;
  align-items: end;
  margin-bottom: 8px;
}
.bar-col {
  display: flex; flex-direction: column; align-items: center;
  height: 100%; justify-content: flex-end;
}
.bar {
  width: 100%;
  background: #dcd7c8;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
  min-height: 1px;
}
.bar--peak { background: var(--guide-color-paper-2); }
.bar--lag  { background: var(--mt-slate, #3B5A7A); opacity: 0.55; }
.bar-label { font-size: var(--guide-fs-2xs); color: var(--text-tertiary, #6B6B73); margin-top: 4px; }
.bar-chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
}
.bar-chart-legend .bar { width: 12px; height: 12px; border-radius: 2px; margin-left: 8px; }

/* Match table */
.pipeline-match-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--guide-fs-2xs);
  margin-bottom: 8px;
}
.pipeline-match-table thead th {
  text-align: left;
  padding: 8px 6px;
  background: var(--bg-2, #F2EFE6);
  border-bottom: 2px solid var(--border-subtle, #dcd7c8);
  font-size: var(--guide-fs-2xs);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.04em;
  color: var(--text-tertiary, #6B6B73);
}
.pipeline-match-table tbody td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-subtle, #dcd7c8);
  vertical-align: middle;
}
.match-row { cursor: pointer; transition: background 0.12s ease; }
.match-row:hover { background: var(--bg-1, #FBF9F4); }
.match-row--picked {
  background: color-mix(in srgb, var(--guide-color-moss) 10%, var(--bg-1));
  border: 1px solid var(--guide-color-line);
}
.match-pick-mark {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  font-weight: 800;
  color: var(--text-tertiary, #6B6B73);
}
.match-row--picked .match-pick-mark { background: var(--guide-color-moss); color: var(--guide-color-text-on-accent, #fff); border-color: var(--guide-color-moss); }
.match-desc { font-weight: 600; color: var(--text-primary, #1A1A1F); }
.match-cit { font-size: var(--guide-fs-2xs); font-style: italic; color: var(--text-tertiary, #6B6B73); }
.match-sub {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-secondary, #4B4B53);
}
.match-composite {
  text-align: center;
  font-size: var(--guide-fs-md);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.match-type {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.03em;
  /* The type is the word in the pill; the five types are not graded, so they
     share one neutral chip rather than five hues. */
  color: var(--guide-color-ink-soft);
  background: var(--guide-color-paper-2);
  border: 1px solid var(--guide-color-line);
}
.month-bar {
  display: inline-grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1px;
  width: 120px;
}
.month-bar-c {
  display: block;
  height: 10px;
  background: var(--bg-2, #F2EFE6);
  border-radius: 1px;
}
.month-bar-c.on { background: var(--mt-slate, #3B5A7A); }
.month-bar-none { color: var(--text-tertiary); font-style: italic; }

/* Score — radar + readout */
.pipeline-score-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 12px;
}
.score-radar { display: flex; justify-content: center; }
.score-readout { padding-left: 6px; }
.score-composite {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.score-max { font-size: var(--guide-fs-lg); color: var(--text-tertiary, #6B6B73); font-weight: 600; }
.score-verdict {
  font-size: var(--guide-fs-2xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: var(--guide-label-case, uppercase);
  margin-bottom: 14px;
}
.score-prongs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.prong-row {
  display: grid;
  grid-template-columns: 130px 1fr 44px 38px;
  align-items: center;
  gap: 8px;
  font-size: var(--guide-fs-2xs);
}
.prong-label { color: var(--text-secondary, #4B4B53); font-weight: 600; }
.prong-bar {
  height: 8px;
  background: var(--bg-2, #F2EFE6);
  border-radius: 999px;
  overflow: hidden;
}
.prong-fill {
  height: 100%;
  background: var(--guide-color-action);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.prong-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.prong-w { text-align: right; color: var(--text-tertiary, #6B6B73); font-size: var(--guide-fs-2xs); }
.score-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle, #dcd7c8);
}

/* Package summary */
.pipeline-package-summary {
  padding: 14px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
  margin-bottom: 8px;
}
.pps-row { padding: 4px 0; font-size: var(--guide-fs-xs); }

/* Inventory dashboard */
.inv-dashboard { padding: 4px 0; }
.inv-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.inv-summary-card {
  padding: 10px 12px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 8px;
  text-align: center;
}
.inv-summary-label {
  font-size: var(--guide-fs-2xs);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.04em;
  color: var(--text-tertiary, #6B6B73);
  font-weight: 700;
}
.inv-summary-count {
  font-size: var(--guide-fs-2xl);
  font-weight: 800;
  color: var(--t-color, #6B6B73);
  line-height: 1;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}
.inv-summary-af {
  font-size: var(--guide-fs-2xs);
  color: var(--text-secondary, #4B4B53);
  font-variant-numeric: tabular-nums;
}
.inv-summary-total {
  font-size: var(--guide-fs-xs);
  color: var(--text-secondary, #4B4B53);
  text-align: center;
  margin-bottom: 12px;
  padding: 6px 10px;
  background: var(--bg-2, #F2EFE6);
  border-radius: 6px;
}
.inv-filters { margin-bottom: 10px; }
.inv-filter-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 8px;
  font-size: var(--guide-fs-xs);
}
.inv-filter-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-secondary, #4B4B53);
}
.inv-filter-row select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #dcd7c8);
  background: var(--bg-0, #FFFEFA);
  font-size: var(--guide-fs-xs);
}
.inv-table-wrap {
  max-height: 380px;
  overflow: auto;
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 8px;
}
.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--guide-fs-2xs);
}
.inv-table thead th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 8px 6px;
  background: var(--bg-2, #F2EFE6);
  border-bottom: 2px solid var(--border-subtle, #dcd7c8);
  font-size: var(--guide-fs-2xs);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.04em;
  color: var(--text-tertiary, #6B6B73);
}
.inv-table tbody td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--border-subtle, #dcd7c8);
  vertical-align: middle;
}
.inv-desc { font-weight: 600; color: var(--text-primary, #1A1A1F); }
.inv-cit { font-size: var(--guide-fs-2xs); font-style: italic; color: var(--text-tertiary, #6B6B73); }

@media (max-width: 900px) {
  .pipeline-score-grid { grid-template-columns: 1fr; }
  .score-radar { justify-content: flex-start; }
  .prong-row { grid-template-columns: 1fr; gap: 2px; }
  .pipeline-match-table { font-size: var(--guide-fs-2xs); }
  .bar-chart { height: 100px; }
}

/* ══════════════════════════════════════════════════════════════════════
   v2 — Legend popover, System map, Legend button
   ══════════════════════════════════════════════════════════════════════ */

/* Legend button in cockpit */
.mit-legend-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  color: var(--text-secondary, #4B4B53);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.mit-legend-btn:hover {
  background: var(--bg-2, #F2EFE6);
  border-color: var(--mt-slate, #3B5A7A);
}
.mit-legend-btn i { width: 16px; height: 16px; }

/* Legend popover */
.mit-legend-popover {
  position: absolute;
  z-index: var(--guide-z-max, 10000);
  width: 380px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 14px;
  box-shadow: var(--guide-shadow-overlay);
  overflow: hidden;
}
.mit-legend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-1, #FBF9F4);
  border-bottom: 1px solid var(--border-subtle, #dcd7c8);
}
.mit-legend-head h3 {
  margin: 0;
  font-size: var(--guide-fs-sm);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary, #1A1A1F);
}
.mit-legend-head h3 i { width: 14px; height: 14px; color: var(--mt-slate, #3B5A7A); }
.mit-legend-close {
  background: transparent;
  border: none;
  font-size: var(--guide-fs-xl);
  line-height: 1;
  color: var(--text-tertiary, #6B6B73);
  cursor: pointer;
  padding: 0 4px;
}
.mit-legend-close:hover { color: var(--text-primary, #1A1A1F); }
.mit-legend-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px 0;
}
.mit-legend-block {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle, #dcd7c8);
}
.mit-legend-block:last-child { border-bottom: none; }
.mit-legend-block-title {
  font-size: var(--guide-fs-2xs);
  font-weight: 800;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.05em;
  color: var(--mt-slate, #3B5A7A);
}
.mit-legend-block-sub {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
  margin-bottom: 6px;
  font-style: italic;
}
.mit-legend-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mit-legend-rows li {
  display: grid;
  grid-template-columns: 18px 80px 1fr;
  align-items: center;
  gap: 8px;
  font-size: var(--guide-fs-2xs);
}
.mit-legend-swatch {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(var(--guide-wash-rgb, 0, 0, 0), 0.08);
}
.mit-legend-label {
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
}
.mit-legend-note {
  color: var(--text-tertiary, #6B6B73);
}
.mit-legend-foot {
  padding: 8px 14px;
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
  font-style: italic;
  background: var(--bg-1, #FBF9F4);
  border-top: 1px solid var(--border-subtle, #dcd7c8);
}

/* System map */
.sys-map { padding: 4px 0; }
.sys-map-intro {
  font-size: var(--guide-fs-sm);
  color: var(--text-secondary, #4B4B53);
  line-height: 1.55;
  margin-bottom: 12px;
}
.sys-map-svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 12px;
  padding: 8px;
}
.sys-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.sys-map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--guide-fs-2xs);
}
.sys-map-swatch {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(var(--guide-wash-rgb, 0, 0, 0), 0.08);
}
.sys-map-legend-label { font-weight: 700; color: var(--text-primary, #1A1A1F); }
.sys-map-legend-sub { color: var(--text-tertiary, #6B6B73); font-style: italic; }

/* ══════════════════════════════════════════════════════════════════════
   V2 — Market Mechanics panel (VWAP, txns, comparables, share)
   ══════════════════════════════════════════════════════════════════════ */
.mm { padding: 4px 0; }
.mm-section-title {
  font-size: var(--guide-fs-2xs);
  font-weight: 800;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.05em;
  color: var(--text-tertiary, #6B6B73);
  margin-bottom: 8px;
}
.mm-section-sub { font-weight: 600; text-transform: none; letter-spacing: 0; font-style: italic; color: var(--text-tertiary, #6B6B73); }

.mm-row {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}
.mm-row-top    { grid-template-columns: 1.5fr 1fr; align-items: stretch; }
.mm-row-bottom { grid-template-columns: 1fr 1fr; align-items: start; }

.mm-vwap {
  padding: 12px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
}
.mm-vwap-svg {
  display: block;
  width: 100%;
  height: 140px;
  background: var(--bg-0, #FFFEFA);
  border-radius: 6px;
}
.mm-vwap-legend {
  margin-top: 6px;
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
}
.mm-legend-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle;
}

.mm-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  align-content: start;
}
.mm-stat-card {
  padding: 12px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
  text-align: center;
}
.mm-stat-k {
  font-size: var(--guide-fs-2xs);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.04em;
  color: var(--text-tertiary, #6B6B73);
  font-weight: 700;
}
.mm-stat-v {
  font-size: var(--guide-fs-2xl);
  font-weight: 800;
  color: var(--mt-purple, #8B5CF6);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin: 2px 0;
}
.mm-stat-n {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
}

.mm-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg-2, #F2EFE6);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: var(--guide-fs-xs);
}
.mm-controls label {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-secondary, #4B4B53);
}
.mm-controls select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #dcd7c8);
  background: var(--bg-0, #FFFEFA);
  font-size: var(--guide-fs-xs);
}
.mm-auction {
  margin-left: auto;
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mm-auction i { width: 12px; height: 12px; }

.mm-txlog, .mm-comps {
  padding: 12px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
}
.mm-tx-table { width: 100%; border-collapse: collapse; font-size: var(--guide-fs-2xs); }
.mm-tx-table thead th {
  text-align: left;
  padding: 6px;
  background: var(--bg-2, #F2EFE6);
  border-bottom: 1px solid var(--border-subtle, #dcd7c8);
  font-size: var(--guide-fs-2xs);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.04em;
  color: var(--text-tertiary, #6B6B73);
}
.mm-tx-table tbody td {
  padding: 6px;
  border-bottom: 1px solid var(--border-subtle, #dcd7c8);
  font-variant-numeric: tabular-nums;
}
.mm-tx-price { font-weight: 700; color: var(--mt-purple, #8B5CF6); }
.mm-comps-target {
  font-size: var(--guide-fs-2xs);
  color: var(--text-secondary, #4B4B53);
  margin-bottom: 8px;
  padding: 6px 10px;
  background: var(--bg-1, #FBF9F4);
  border-radius: 6px;
}
.mm-delta-up   { color: var(--guide-color-ink); font-weight: 700; }
.mm-delta-down { color: var(--guide-color-moss); font-weight: 700; }

.mm-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mm-share-out {
  font-size: var(--guide-fs-2xs);
  color: #166534;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .mm-row-top, .mm-row-bottom { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════
   V3 — Engine science visuals (uncertainty band, conjunctive, schedule)
   ══════════════════════════════════════════════════════════════════════ */

/* Make the bar chart cols position relative so band can absolute-position */
.bar-col { position: relative; }
.bar-band {
  position: absolute;
  background: color-mix(in srgb, var(--guide-color-action) 24%, transparent);
  border-radius: 3px 3px 0 0;
  z-index: 0;
}
.bar { position: relative; z-index: 1; }
.bar-band-legend {
  display: inline-block; width: 12px; height: 12px;
  background: rgba(59,90,122,0.32);
  border-radius: 2px; margin-left: 8px; vertical-align: middle;
}

/* Conjunctive view block */
.pipeline-conjunctive {
  margin-top: 14px;
  padding: 14px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
}
.conj-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}
.conj-card {
  padding: 10px 12px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 8px;
}
.conj-card-k {
  font-size: var(--guide-fs-2xs);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.04em;
  color: var(--text-tertiary, #6B6B73);
  font-weight: 700;
}
.conj-card-v {
  font-size: var(--guide-fs-2xl);
  font-weight: 800;
  color: #0EA5E9;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin: 2px 0;
}
.conj-card-n {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
}
.conj-note {
  grid-column: 1 / -1;
  padding: 8px 12px;
  background: var(--bg-2, #F2EFE6);
  border-radius: 6px;
  font-size: var(--guide-fs-2xs);
  font-style: italic;
  color: var(--text-secondary, #4B4B53);
}

/* Monthly offset schedule */
.offset-schedule {
  margin-top: 16px;
  padding: 14px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
}
.offset-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--guide-fs-2xs);
  margin-top: 8px;
}
.offset-table thead th {
  text-align: left;
  padding: 6px 8px;
  background: var(--bg-2, #F2EFE6);
  border-bottom: 1px solid var(--border-subtle, #dcd7c8);
  font-size: var(--guide-fs-2xs);
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.04em;
  color: var(--text-tertiary, #6B6B73);
}
.offset-table tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-subtle, #dcd7c8);
}
.os-status--met       { background: color-mix(in srgb, var(--guide-color-moss) 6%, transparent); }
.os-status--partial   { background: color-mix(in srgb, var(--guide-color-ochre) 6%, transparent); }
.os-status--short     { background: color-mix(in srgb, var(--guide-color-status-crit) 6%, transparent); }
.os-status-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: var(--guide-fs-2xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--guide-color-text-on-accent, #fff);
}
.os-status-pill.os-status--met     { background: var(--guide-color-moss); }
.os-status-pill.os-status--partial { background: var(--guide-color-ochre); color: var(--guide-color-text-primary, #1A1A1F); }
.os-status-pill.os-status--short   { background: var(--guide-color-status-crit); }
.os-cov {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 14px;
}
.os-cov::before {
  content: '';
  position: absolute;
  inset: 4px 0;
  background: var(--bg-2, #F2EFE6);
  border-radius: 999px;
  z-index: 0;
}
.os-cov-bar {
  position: relative;
  height: 6px;
  background: var(--guide-color-action);
  border-radius: 999px;
  z-index: 1;
}
.os-cov-label {
  position: relative;
  z-index: 2;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  color: var(--text-secondary, #4B4B53);
  font-variant-numeric: tabular-nums;
}
.os-contrib { display: flex; gap: 4px; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════════════
   V4 — Law & Policy panel (call simulator + compact + beneficial use)
   ══════════════════════════════════════════════════════════════════════ */
.lp { padding: 4px 0; }
.lp-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}
.lp-card {
  padding: 12px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
  margin-bottom: 10px;
}
.lp-right { display: flex; flex-direction: column; }
.lp-right .lp-card { margin-bottom: 10px; }
.lp-right .lp-card:last-child { margin-bottom: 0; }

.lp-call-controls {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: var(--guide-fs-xs);
}
.lp-call-controls label {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; color: var(--text-secondary, #4B4B53);
}
.lp-call-controls select, .lp-call-controls input {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #dcd7c8);
  background: var(--bg-1, #FBF9F4);
  font-size: var(--guide-fs-xs);
}

.lp-call-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.lp-stack-col {
  padding: 10px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 8px;
  min-height: 100px;
}
.lp-stack-head {
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  color: var(--col-color, #6B6B73);
  margin-bottom: 6px;
  display: flex; justify-content: space-between; align-items: center;
}
.lp-stack-count {
  background: var(--col-color, #6B6B73);
  color: var(--guide-color-text-on-accent, #fff);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: var(--guide-fs-2xs);
  font-variant-numeric: tabular-nums;
}
.lp-stack-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 4px;
}
.lp-stack-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: var(--bg-0, #FFFEFA);
  border-radius: 6px;
  font-size: var(--guide-fs-2xs);
}
.lp-stack-yr {
  font-weight: 800;
  color: var(--col-color, #6B6B73);
  font-variant-numeric: tabular-nums;
  font-size: var(--guide-fs-2xs);
}
.lp-stack-desc { color: var(--text-secondary, #4B4B53); }
.lp-stack-empty { font-style: italic; color: var(--text-tertiary, #6B6B73); font-size: var(--guide-fs-2xs); padding: 6px; }
.lp-stack-compact {
  display: inline-block;
  background: var(--guide-color-plum);
  color: var(--guide-color-text-on-accent, #fff);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  margin-left: 4px;
}
.lp-call-summary {
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg-2, #F2EFE6);
  border-radius: 6px;
  font-size: var(--guide-fs-2xs);
  color: var(--text-secondary, #4B4B53);
  text-align: center;
}

.lp-compact-card {
  padding: 8px 10px;
  background: color-mix(in srgb, var(--guide-color-plum) 7%, var(--bg-1));
  border: 1px solid color-mix(in srgb, var(--guide-color-plum) 25%, var(--border-subtle));
  border-radius: 6px;
  margin-bottom: 6px;
}
.lp-compact-card:last-child { margin-bottom: 0; }
.lp-compact-name {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--guide-fs-xs); font-weight: 700; color: #5B21B6;
}
.lp-compact-name i { width: 14px; height: 14px; }
.lp-compact-auth { font-size: var(--guide-fs-2xs); font-style: italic; color: var(--text-tertiary, #6B6B73); }
.lp-compact-note { font-size: var(--guide-fs-2xs); color: var(--text-secondary, #4B4B53); margin-top: 4px; }
.lp-compact-empty { font-size: var(--guide-fs-2xs); color: var(--text-tertiary, #6B6B73); font-style: italic; padding: 4px; }

.lp-bu-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  font-size: var(--guide-fs-xs);
}
.lp-bu-form label {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; color: var(--text-secondary, #4B4B53);
}
.lp-bu-form input {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #dcd7c8);
  background: var(--bg-1, #FBF9F4);
  font-size: var(--guide-fs-xs);
  width: 100px;
}
.lp-bu-result {
  padding: 10px 12px;
  background: color-mix(in srgb, var(--bu-color, #6B6B73) 8%, var(--bg-1));
  border: 1px solid var(--guide-color-line);
  border-radius: 6px;
}
.lp-bu-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bu-color, #6B6B73);
  color: var(--guide-color-text-on-accent, #fff);
  font-size: var(--guide-fs-2xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.lp-bu-note { font-size: var(--guide-fs-2xs); color: var(--text-secondary, #4B4B53); line-height: 1.5; }

@media (max-width: 900px) {
  .lp-row { grid-template-columns: 1fr; }
  .lp-call-grid { grid-template-columns: 1fr; }
}

/* V5 — Cross-state library
   Moved to styles/modules/state-library.css (shared across hubs).
   Linked in index.html. */

/* ══════════════════════════════════════════════════════════════════════
   V6 — Basin map + timeline ribbon
   ══════════════════════════════════════════════════════════════════════ */
.bm { padding: 4px 0; }
.bm-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.bm-map-wrap {
  padding: 12px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
}
.bm-svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--guide-color-paper-2);
  border-radius: 8px;
}
.bm-svg .bm-basin:hover rect {
  filter: brightness(1.1);
}
.bm-legend {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
}
.bm-legend-item {
  display: inline-flex; align-items: center; gap: 4px;
}
.bm-legend-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.bm-stats {
  padding: 12px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
}
.bm-basin-empty {
  padding: 18px;
  text-align: center;
  font-style: italic;
  color: var(--text-tertiary, #6B6B73);
  font-size: var(--guide-fs-xs);
}
.bm-basin-card {
  padding: 12px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 8px;
}
.bm-basin-name {
  font-size: var(--guide-fs-md);
  font-weight: 800;
  color: var(--b-color, #6B6B73);
  margin-bottom: 2px;
}
.bm-basin-meta {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
  margin-bottom: 10px;
}
.bm-basin-types {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.bm-basin-types li {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--guide-fs-2xs);
  padding: 4px 6px;
  background: var(--bg-1, #FBF9F4);
  border-radius: 4px;
}
.bm-basin-n {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary, #1A1A1F);
}
.bm-basin-filter {
  margin-top: 10px;
  width: 100%;
  font-size: var(--guide-fs-2xs);
}

.bm-timeline {
  padding: 12px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
}
.bm-timeline-svg {
  display: block;
  width: 100%;
  height: 80px;
  background: var(--guide-color-paper-2);
  border-radius: 6px;
}

@media (max-width: 900px) {
  .bm-row { grid-template-columns: 1fr; }
  .bm-basin-types { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════
   V7 — Education enhancements
   ══════════════════════════════════════════════════════════════════════ */
.edu { padding: 4px 0; }
.edu-block {
  padding: 14px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
  margin-bottom: 14px;
}
.edu-block-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--guide-fs-base);
  font-weight: 800;
  color: var(--text-primary, #1A1A1F);
  margin: 0 0 4px;
}
.edu-block-title i { width: 16px; height: 16px; color: var(--mt-slate, #3B5A7A); }
.edu-block-sub {
  font-size: var(--guide-fs-xs);
  color: var(--text-tertiary, #6B6B73);
  margin: 0 0 10px;
}

.edu-animation {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--bg-0, #FFFEFA);
}
.edu-takeaways {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.edu-takeaway {
  padding: 8px 12px;
  background: var(--bg-0, #FFFEFA);
  border-radius: 6px;
  font-size: var(--guide-fs-xs);
  color: var(--text-secondary, #4B4B53);
}

.edu-supply-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.edu-supply-card {
  padding: 12px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
}
.edu-supply-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.edu-supply-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--st-color, #6B6B73) 12%, var(--bg-0));
  color: var(--st-color, #6B6B73);
  border-radius: 8px;
  flex-shrink: 0;
}
.edu-supply-icon i { width: 18px; height: 18px; }
.edu-supply-label {
  font-size: var(--guide-fs-sm);
  font-weight: 800;
  color: var(--text-primary, #1A1A1F);
  line-height: 1.2;
}
.edu-supply-cit {
  font-size: var(--guide-fs-2xs);
  font-style: italic;
  color: var(--text-tertiary, #6B6B73);
}
.edu-supply-summary {
  font-size: var(--guide-fs-2xs);
  line-height: 1.5;
  color: var(--text-secondary, #4B4B53);
  margin: 0 0 8px;
}
.edu-supply-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 6px;
  font-size: var(--guide-fs-2xs);
  margin-bottom: 3px;
}
.edu-supply-k {
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.04em;
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
}
.edu-supply-v {
  color: var(--text-secondary, #4B4B53);
  line-height: 1.4;
}

.edu-scenario {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
}
.edu-scenario-steps {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.edu-step {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--guide-fs-2xs);
  transition: transform 0.12s ease, background 0.12s ease;
}
.edu-step:hover { transform: translateX(2px); }
.edu-step--active {
  background: color-mix(in srgb, var(--step-color, #6B6B73) 8%, var(--bg-0));
}
.edu-step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: var(--step-color, #6B6B73);
  color: var(--guide-color-text-on-accent, #fff);
  border-radius: 50%;
  font-weight: 800;
}
.edu-step-tag {
  font-weight: 600;
  /* --step-color already draws this step's 8% wash and its marker dot (above). Spending it a fourth time on the tag's ink
     identifies nothing new and cost the label 2.58:1 on the dark page. Fifth
     instance of a data-driven accent used as text in this overhaul; same
     answer every time — the accent is the mark, the token is the ink. */
  color: var(--guide-color-text-secondary);
  letter-spacing: 0.02em;
}
.edu-scenario-card {
  padding: 14px 16px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
}
.edu-scenario-title {
  font-size: var(--guide-fs-lg);
  font-weight: 800;
  color: var(--text-primary, #1A1A1F);
  margin: 0 0 6px;
}
.edu-scenario-text {
  font-size: var(--guide-fs-xs);
  line-height: 1.6;
  color: var(--text-secondary, #4B4B53);
  margin: 0;
}

@media (max-width: 720px) {
  .edu-takeaways { grid-template-columns: 1fr; }
  .edu-scenario { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════
   V8 — Marketing slot + methodology + version
   ══════════════════════════════════════════════════════════════════════ */
.pipeline-badge--info {
  background: color-mix(in srgb, var(--guide-color-plum) 18%, var(--bg-0));
  color: #3730A3;
}
.ms { padding: 4px 0; }
.ms-intro {
  font-size: var(--guide-fs-sm);
  color: var(--text-secondary, #4B4B53);
  line-height: 1.55;
  margin-bottom: 10px;
}
.ms-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 8px;
}
.ms-card {
  display: grid;
  grid-template-columns: 38px 1fr 16px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-0, #FFFEFA);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.ms-card:hover {
  border-color: var(--guide-color-action);
}
.ms-card-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--guide-color-paper-2);
  color: var(--guide-color-ink-soft);
  border-radius: 8px;
}
.ms-card-icon i { width: 18px; height: 18px; }
.ms-card-label {
  font-size: var(--guide-fs-sm);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
}
.ms-card-copy {
  font-size: var(--guide-fs-2xs);
  color: var(--text-tertiary, #6B6B73);
  line-height: 1.4;
  margin-top: 2px;
}
.ms-card-arrow { color: var(--text-tertiary, #6B6B73); }
.ms-card-arrow i { width: 14px; height: 14px; }
.ms-card:hover .ms-card-arrow { color: var(--guide-color-action); }

/* Methodology block */
.meth { padding: 4px 0; }
.meth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}
.meth-block {
  padding: 12px;
  background: var(--bg-1, #FBF9F4);
  border: 1px solid var(--border-subtle, #dcd7c8);
  border-radius: 10px;
}
.meth-list {
  margin: 0; padding-left: 16px;
  display: flex; flex-direction: column;
  gap: 4px;
}
.meth-list li {
  font-size: var(--guide-fs-2xs);
  line-height: 1.55;
  color: var(--text-secondary, #4B4B53);
}
.meth-list li strong { color: var(--text-primary, #1A1A1F); }
.meth-cite {
  font-size: var(--guide-fs-2xs);
  line-height: 1.55;
  color: var(--text-secondary, #4B4B53);
  font-style: italic;
}
.meth-version {
  font-size: var(--guide-fs-2xs);
  line-height: 1.6;
  color: var(--text-secondary, #4B4B53);
  margin-bottom: 10px;
}
.meth-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.meth-share-out {
  font-size: var(--guide-fs-2xs);
  color: #166534;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .meth-row { grid-template-columns: 1fr; }
}

/* ── Mobile: collapse cockpit to stacked layout ───────────────────── */
@media (max-width: 960px) {
  .mit-cockpit { grid-template-columns: 1fr; }
  .mit-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mit-cockpit-right { justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .mit-kpi-strip { grid-template-columns: 1fr; }
  .mit-section-head { padding: 14px 15px; gap: 12px; margin: 28px 0 14px; }
  .mit-section-head-icon { width: 42px; height: 42px; }
  .mit-section-title { font-size: var(--guide-fs-xl); }
  .mit-secnav { gap: 4px; padding: 8px; }
  .mit-secnav-chip { font-size: var(--guide-fs-2xs); padding: 5px 8px; }
}
/* ════════════════════════════════════════════════════════════════════
   MITIGATE TOOLS — Card grid with on-demand tool stage (from main)
   ════════════════════════════════════════════════════════════════════ */
.mitigate-tools-section {
  margin: 24px auto 16px;
  max-width: 1280px;
}
.mitigate-tools-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--guide-fs-base);
  font-weight: 800;
  text-transform: none;
  letter-spacing: 1px;
  color: var(--text-primary, #1A1A1F);
  margin: 0 0 14px 0;
}
.mitigate-tools-eyebrow i {
  width: 18px;
  height: 18px;
  color: var(--guide-color-ochre);
}
.mitigate-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
@media (max-width: 768px) {
  .mitigate-tools-grid { grid-template-columns: 1fr; }
}

.mit-tool-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 14px 14px;
  background: var(--bg-1, #fff);
  border: 1px solid var(--border-subtle, #e2e0d8);
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition:
    transform var(--guide-dur-base) cubic-bezier(.2,.7,.2,1),
    box-shadow var(--guide-dur-base) ease,
    border-color var(--guide-dur-base) ease,
    background var(--guide-dur-base) ease;
}
.mit-tool-card:hover {
  border-color: color-mix(in srgb, var(--mt-slate, #3B5A7A) 35%, var(--border-subtle, #e2e0d8));
  box-shadow: var(--guide-shadow-raised);
  background: color-mix(in srgb, var(--mt-slate, #3B5A7A) 3%, var(--bg-1, #fff));
}
.mit-tool-card:focus-visible {
  outline: none;
  border-color: var(--mt-slate, #3B5A7A);
  box-shadow: 0 0 0 3px rgba(59,90,122,0.22);
}
.mit-tool-card.is-selected {
  border-color: var(--mt-slate, #3B5A7A);
  background: color-mix(in srgb, var(--mt-slate, #3B5A7A) 7%, var(--bg-1, #fff));
  box-shadow: var(--guide-shadow-raised);
}
.mit-tool-card.is-selected .mit-tool-card-icon {
  background: var(--mt-slate, #3B5A7A);
  color: var(--guide-color-text-on-accent, #fff);
}
.mit-tool-card.is-selected .mit-tool-card-chevron i {
  transform: rotate(90deg);
}

/* Folded-in "quick action" cards (Diagnose / Engine shortcuts that used to be
   the standalone hoist rails): same card shape as the toolkit cards; the icon
   tile takes their own --tile-color so they read as one-tap shortcuts rather
   than panel-revealing tools. */
.mit-tool-card--quick .mit-tool-card-icon {
  background: color-mix(in srgb, var(--tile-color, #3B5A7A) 12%, var(--bg-2, #F4F1EA));
  color: var(--tile-color, #3B5A7A);
}
.mit-tool-card--quick:hover {
  border-color: color-mix(in srgb, var(--tile-color, #3B5A7A) 38%, var(--border-subtle, #e2e0d8));
  box-shadow: var(--guide-shadow-raised);
  background: color-mix(in srgb, var(--tile-color, #3B5A7A) 4%, var(--bg-1, #fff));
}
.mit-tool-card--quick:hover .mit-tool-card-icon {
  background: color-mix(in srgb, var(--tile-color, #3B5A7A) 18%, var(--bg-2, #F4F1EA));
}
.mit-tool-card--quick .mit-tool-card-chevron i {
  transform: none;
}

.mit-tool-card-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--mt-slate, #3B5A7A) 8%, var(--bg-2, #F4F1EA));
  color: var(--mt-slate, #3B5A7A);
  transition: background var(--guide-dur-base) ease, color var(--guide-dur-base) ease;
}
.mit-tool-card:hover .mit-tool-card-icon {
  background: color-mix(in srgb, var(--mt-slate, #3B5A7A) 14%, var(--bg-2, #F4F1EA));
}

.mit-tool-card-body {
  flex: 1;
  min-width: 0;
}
.mit-tool-card-body h4 {
  margin: 0 0 4px 0;
  font-size: var(--guide-fs-md);
  font-weight: 700;
  color: var(--text-primary, #1A1A1F);
  line-height: 1.25;
}
.mit-tool-card-body p {
  margin: 0;
  font-size: var(--guide-fs-xs);
  line-height: 1.4;
  color: var(--text-secondary, #5b5b62);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mit-tool-card-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--text-tertiary, #6b7280);
  opacity: 0.45;
  transition: opacity var(--guide-dur-base) ease, color var(--guide-dur-base) ease;
}
.mit-tool-card:hover .mit-tool-card-chevron,
.mit-tool-card.is-selected .mit-tool-card-chevron {
  opacity: 1;
  color: var(--mt-slate, #3B5A7A);
}
.mit-tool-card-chevron i {
  width: 16px;
  height: 16px;
  transition: transform var(--guide-dur-base) ease;
}

/* ── Tool stage (below grid) ───────────────────────────────── */
.mitigate-tools-stage {
  margin-top: 20px;
  min-height: 0;
}
.mit-tool-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 16px;
  border: 1px dashed color-mix(in srgb, var(--text-tertiary, #6b7280) 40%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-2, #F4F1EA) 50%, transparent);
  color: var(--text-tertiary, #6b7280);
  font-size: var(--guide-fs-sm);
  font-weight: 500;
}
.mit-tool-empty i {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}
.mit-tool-empty p { margin: 0; }
.mitigate-tools-stage.has-active .mit-tool-empty { display: none; }

.mit-tool-pblock {
  animation: mit-tool-fade-in 220ms cubic-bezier(.2,.7,.2,1);
}

/* ══════════════════════════════════════════════════════════════════════
   DARK THEME OVERRIDES
   All hardcoded light surfaces, borders, and status colors need explicit
   dark-mode counterparts — the base token flips handle most, but
   structural whites and brand-color text need case-by-case handling.
   ══════════════════════════════════════════════════════════════════════ */

/* Section nav — near-white sticky bar → dark glass */
[data-theme="dark"] .mit-secnav {
  background: rgba(18, 18, 24, 0.92);
  border-bottom-color: rgba(255,255,255,0.08);
}

/* Figure SVG backgrounds */
[data-theme="dark"] .mit-uc-figure > svg {
  background: var(--guide-color-bg-2, #1e1e28);
}

/* Tool cards — bg-1 fallback was #fff */
[data-theme="dark"] .mit-tool-card {
  background: var(--guide-color-bg-2, #1e1e28);
  border-color: rgba(255,255,255,0.10);
}
[data-theme="dark"] .mit-tool-card:hover {
  background: color-mix(in srgb, var(--mt-slate, #3B5A7A) 8%, var(--guide-color-bg-2, #1e1e28));
}
[data-theme="dark"] .mit-tool-card.is-selected {
  background: color-mix(in srgb, var(--mt-slate, #3B5A7A) 14%, var(--guide-color-bg-2, #1e1e28));
}

/* Step indicators: done-state text is dark green → brighten */
[data-theme="dark"] .pb-step--done,
[data-theme="dark"] .pipeline-step--done {
  background: color-mix(in srgb, #4ADE80 12%, var(--guide-color-bg-2, #1e1e28));
  color: #4ADE80;
  border-color: rgba(74,222,128,0.30);
}

/* Active step: white inner circle number stays white-on-slate — fine as-is */

/* Result / share-out green labels → brighten for dark */
[data-theme="dark"] .fb-result-title { color: #4ADE80; }
[data-theme="dark"] .mm-share-out    { color: #4ADE80; }
[data-theme="dark"] .meth-share-out  { color: #4ADE80; }

/* Pipeline info badge — dark indigo → bright indigo/violet */
[data-theme="dark"] .pipeline-badge--info {
  background: color-mix(in srgb, #818CF8 18%, var(--guide-color-bg-2, #1e1e28));
  color: #818CF8;
}

/* Marketing block accent line — indigo border → brighter */

/* Bar chart background bar — light tan → subtle dark */
[data-theme="dark"] .bar {
  background: rgba(255,255,255,0.10);
}

/* Kanban column stack count badge — uses --col-color, already colored.
   White text on accent bg is fine. No override needed for .lp-stack-count. */

/* Status pills — white text on accent background is fine as-is */

/* Layout-transparent wrapper. It exists so `role="tablist"` has a subtree of
   nothing but tabs — the legend button shares the .mit-secnav row but is not a
   section, and a tablist containing a non-tab is a critical
   aria-required-children violation. display:contents keeps the flex row laying
   the chips and the legend button out as siblings, exactly as before. */
.mit-secnav-tabs { display: contents; }

/* Mitigation criteria + reported-figures panels (src/mitigation-scorecard.js,
   src/mitigation-dashboard.js). These replaced the A-F grade circles: a
   criterion is met, not met or has no data, and the status is carried by the
   WORD in the last column — the row gets no hue, so nothing reads as a grade. */
.wb-criteria-note {
  margin: 0 0 var(--guide-sp-2);
  font-size: var(--guide-fs-xs);
  color: var(--text-secondary);
}
.wb-criteria-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--guide-sp-2);
  font-size: var(--guide-fs-xs);
}
.wb-criteria-table th,
.wb-criteria-table td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--guide-color-line);
}
.wb-criteria-table th { font-weight: 600; color: var(--text-tertiary); }
.wb-criterion-needs { color: var(--text-muted); }
.wb-criterion-status { font-weight: 700; white-space: nowrap; }
.wb-criterion[data-status="no-data"] .wb-criterion-status { font-weight: 400; color: var(--text-muted); }
