/*
 * Legacy Studio art-direction layer.
 * Font declarations moved to v2-foundation.css in V2 Phase 2.
 */

body.editorial-ui {
  --studio-paper: #f4eddf;
  --studio-card: rgba(255, 252, 245, .88);
  --studio-navy: #0a2e4d;
  --studio-rust: #c6532c;
  --studio-teal: #2d7373;
  --studio-plum: #70475d;
  --studio-ochre: #b77c25;
  --studio-line: rgba(10, 46, 77, .34);
  --studio-line-soft: rgba(10, 46, 77, .16);
  --studio-shadow: 0 1px 0 rgba(10, 46, 77, .08), 0 24px 70px rgba(59, 43, 24, .08);
  background-color: var(--studio-paper);
  background-image: url("assets/texture/paper-grain.svg");
  background-attachment: fixed;
  background-size: 240px 240px;
}

body.editorial-ui::before {
  background:
    radial-gradient(circle at 12% 0, rgba(198, 83, 44, .07), transparent 30rem),
    radial-gradient(circle at 91% 22%, rgba(45, 115, 115, .07), transparent 30rem);
  opacity: 1;
}

body.editorial-ui .app-shell {
  width: min(1520px, calc(100% - clamp(28px, 5vw, 86px)));
}

/* Header */
body.editorial-ui .site-header {
  min-height: 78px;
  margin-bottom: clamp(32px, 5vw, 74px);
  padding: 13px 2px 11px;
  border-bottom-color: var(--studio-navy);
  background: color-mix(in srgb, var(--studio-paper) 94%, transparent);
  backdrop-filter: blur(10px);
}

body.editorial-ui .site-name {
  color: var(--studio-navy);
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.6vw, 1.48rem);
  font-weight: 800;
  letter-spacing: .018em;
}

body.editorial-ui .nav-action {
  padding-inline: 5px;
  color: var(--studio-navy);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: 0;
}

body.editorial-ui .nav-action::after {
  bottom: -12px;
  height: 4px;
  background: transparent;
}

/* Landing */
body.editorial-ui .landing-view {
  width: min(1400px, 100%);
}

body.editorial-ui .decision-hero {
  position: relative;
  padding: clamp(14px, 2.4vw, 34px) 0 clamp(32px, 5vw, 68px);
  text-align: left;
}

body.editorial-ui .decision-hero::after {
  position: absolute;
  top: 10%;
  right: 2%;
  width: clamp(110px, 15vw, 210px);
  aspect-ratio: 1;
  border: 1px solid rgba(198, 83, 44, .34);
  border-radius: 50%;
  box-shadow:
    0 0 0 clamp(14px, 2.2vw, 30px) rgba(198, 83, 44, .055),
    0 0 0 clamp(34px, 4.5vw, 64px) rgba(183, 124, 37, .035);
  content: "";
  pointer-events: none;
}

body.editorial-ui .editorial-meta {
  margin-bottom: 22px;
  color: var(--studio-rust);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem;
}

body.editorial-ui .decision-hero h1 {
  max-width: 10.5ch;
  margin: 0;
  color: var(--studio-navy);
  font-size: clamp(4.2rem, 9vw, 9rem);
  line-height: .82;
  text-align: left;
  text-wrap: balance;
}

body.editorial-ui .decision-lead {
  margin-top: 28px;
  color: var(--studio-navy);
  font-size: clamp(1.05rem, 1.8vw, 1.42rem);
}

body.editorial-ui .quick-calculator-grid {
  gap: 26px;
}

body.editorial-ui .quick-calculator-grid .quick-action-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

body.editorial-ui .quick-calculator-grid .module-card {
  min-height: 280px;
  border-color: var(--accent-dark);
  border-radius: 4px;
  background:
    linear-gradient(to bottom, color-mix(in srgb, var(--accent-soft) 52%, transparent), transparent 48%),
    var(--studio-card);
  box-shadow: none;
}

body.editorial-ui .quick-calculator-grid .module-card::before {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  height: 7px;
  background: var(--accent);
  content: "";
}

body.editorial-ui .quick-calculator-grid .module-card:hover {
  border-color: var(--accent-dark);
  box-shadow: 0 16px 42px color-mix(in srgb, var(--accent) 14%, transparent);
  transform: translateY(-5px);
}

body.editorial-ui .quick-calculator-grid .module-open {
  min-height: 278px;
  padding: 32px 26px 24px;
  grid-template-columns: 1fr 26px;
  grid-template-rows: 68px 1fr;
  align-items: start;
  gap: 20px 12px;
}

body.editorial-ui .quick-calculator-grid .module-card-icon {
  width: 62px;
  height: 62px;
  grid-column: 1;
  color: var(--accent-dark);
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--paper-raised));
}

body.editorial-ui .quick-calculator-grid .module-card-body {
  grid-column: 1 / -1;
}

body.editorial-ui .quick-calculator-grid .module-card-arrow {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  color: var(--accent-dark);
}

body.editorial-ui .quick-calculator-grid .module-card-title {
  display: block;
  max-width: 8ch;
  margin-bottom: 14px;
  color: var(--accent-dark);
  font-size: clamp(1.8rem, 2.55vw, 2.65rem);
  line-height: .93;
}

body.editorial-ui .quick-calculator-grid .module-card-question {
  display: block;
  padding-top: 14px;
  color: var(--studio-navy);
  border-top: 1px solid currentColor;
  font-size: .9rem;
  line-height: 1.5;
}

body.editorial-ui .quick-calculator-grid .calculator-directory {
  padding: 8px 0 0;
  color: var(--studio-navy);
  border-top: 1px solid var(--studio-navy);
}

body.editorial-ui .quick-calculator-grid .calculator-directory summary {
  margin-left: 0;
  color: var(--studio-navy);
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: .025em;
  text-transform: uppercase;
}

body.editorial-ui .quick-calculator-grid .directory-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.editorial-ui .quick-calculator-grid .directory-card {
  min-height: 168px;
  border-color: var(--studio-line-soft);
}

body.editorial-ui .quick-calculator-grid .directory-card .module-open {
  min-height: 166px;
  padding: 24px 22px 54px;
  grid-template-columns: 54px minmax(0, 1fr) 20px;
  grid-template-rows: 1fr;
  align-items: center;
}

body.editorial-ui .quick-calculator-grid .directory-card .module-card-icon,
body.editorial-ui .quick-calculator-grid .directory-card .module-card-body,
body.editorial-ui .quick-calculator-grid .directory-card .module-card-arrow {
  grid-row: auto;
  grid-column: auto;
}

body.editorial-ui .quick-calculator-grid .directory-card .module-card-title {
  max-width: none;
  font-size: 1.55rem;
}

body.editorial-ui .quick-calculator-grid .directory-card .module-card-question {
  padding-top: 9px;
  border-top-color: var(--studio-line-soft);
  font-size: .82rem;
}

body.editorial-ui .quick-calculator-grid .connected-plan-card {
  width: 100%;
  min-height: 190px;
  margin: 0;
  padding: clamp(24px, 3.2vw, 42px);
  grid-template-columns: 84px minmax(0, 1fr) auto;
  border: 1px solid var(--studio-teal);
  border-radius: 4px;
  background:
    linear-gradient(105deg, rgba(45, 115, 115, .13), rgba(255, 252, 245, .58)),
    var(--studio-card);
  box-shadow: none;
}

body.editorial-ui .quick-calculator-grid .connected-plan-card > .module-card-icon {
  width: 76px;
  height: 76px;
  color: var(--studio-teal);
  border-radius: 3px;
}

body.editorial-ui .quick-calculator-grid .connected-plan-card strong {
  color: var(--studio-teal);
  font-size: clamp(2rem, 3.6vw, 3.5rem);
}

body.editorial-ui .quick-calculator-grid .connected-plan-card p {
  max-width: 54ch;
  color: var(--studio-navy);
  font-size: .98rem;
}

body.editorial-ui .editorial-landscape {
  min-height: clamp(400px, 48vw, 690px);
  margin-top: clamp(46px, 7vw, 100px);
  border: 1px solid var(--studio-navy);
  border-width: 1px 0;
  background: var(--studio-paper);
}

body.editorial-ui .editorial-landscape picture,
body.editorial-ui .editorial-landscape picture img {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

body.editorial-ui .editorial-landscape picture img {
  object-fit: cover;
  object-position: center;
}

body.editorial-ui .editorial-word {
  z-index: 2;
  top: clamp(30px, 7vw, 96px);
  color: var(--studio-rust);
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: clamp(8rem, 22vw, 21rem);
  mix-blend-mode: multiply;
  opacity: .93;
}

body.editorial-ui .landscape-caption {
  z-index: 3;
  right: auto;
  bottom: 18px;
  left: 24px;
  padding: 6px 10px;
  color: var(--paper-raised);
  background: rgba(10, 46, 77, .74);
  font-size: .82rem;
}

/* Calculator and plan pages */
body.editorial-ui :is(#module-view, #plan-view, #risk-view) {
  width: min(1400px, 100%);
  margin-inline: auto;
}

body.editorial-ui .module-intro {
  margin-bottom: 18px;
  padding-bottom: 26px;
  align-items: center;
  border-bottom-color: var(--studio-navy);
}

body.editorial-ui .module-identity {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 20px;
}

body.editorial-ui .module-large-icon {
  width: 70px;
  height: 70px;
  color: var(--accent-dark);
  border-radius: 3px;
  background: var(--accent-soft);
}

body.editorial-ui .module-intro h1 {
  color: var(--accent-dark);
  font-size: clamp(3.4rem, 6.2vw, 6.7rem);
}

body.editorial-ui .module-intro p {
  max-width: 72ch;
  color: var(--studio-navy);
  font-family: var(--font-editorial);
  font-size: clamp(.96rem, 1.25vw, 1.12rem);
  line-height: 1.5;
}

body.editorial-ui .module-header-actions {
  align-items: stretch;
}

body.editorial-ui .module-learn-shortcut,
body.editorial-ui .module-state {
  border-color: var(--studio-line);
  background: var(--studio-card);
}

body.editorial-ui .example-data-banner {
  margin: 0 0 22px;
  border-width: 1px;
  border-left-width: 5px;
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--studio-card));
}

body.editorial-ui .module-workspace {
  grid-template-columns: minmax(370px, 430px) minmax(0, 1fr);
  gap: 24px;
}

body.editorial-ui .module-shell[data-theme="events"] .module-workspace,
body.editorial-ui .module-shell[data-theme="home"] .module-workspace,
body.editorial-ui .module-shell[data-theme="budget"] .module-workspace {
  grid-template-columns: minmax(390px, 455px) minmax(0, 1fr);
}

body.editorial-ui :is(.input-panel, .module-result-panel, .plan-results) {
  border-color: var(--studio-line);
  border-radius: 4px;
  background: var(--studio-card);
  box-shadow: none;
}

body.editorial-ui .input-panel {
  position: sticky;
  top: 94px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  scrollbar-color: var(--accent) transparent;
}

body.editorial-ui .module-result-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 3.2vw, 46px);
  border-top: 7px solid var(--accent);
  background:
    radial-gradient(circle at 93% 2%, color-mix(in srgb, var(--accent-soft) 70%, transparent), transparent 23rem),
    var(--studio-card);
}

body.editorial-ui .panel-heading,
body.editorial-ui .form-section {
  padding: 24px;
}

body.editorial-ui .panel-heading {
  background: color-mix(in srgb, var(--accent-soft) 48%, transparent);
}

body.editorial-ui .panel-heading h2 {
  font-family: var(--font-editorial);
  font-size: 1.42rem;
}

body.editorial-ui .field input,
body.editorial-ui .field select,
body.editorial-ui .phase-row input,
body.editorial-ui .event-library-top input {
  border-radius: 3px;
  background: rgba(255, 254, 250, .95);
}

body.editorial-ui .segmented,
body.editorial-ui .dollar-mode {
  border-radius: 4px;
}

body.editorial-ui .choice-button,
body.editorial-ui .primary-button,
body.editorial-ui .secondary-button,
body.editorial-ui .inline-button,
body.editorial-ui .back-button {
  border-radius: 3px;
}

body.editorial-ui .result-heading {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--studio-line);
}

body.editorial-ui .result-heading h2,
body.editorial-ui .plan-result-top h2,
body.editorial-ui .home-result-top h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.7vw, 3.5rem);
  line-height: .94;
  text-transform: uppercase;
}

body.editorial-ui .hero-result,
body.editorial-ui .budget-hero-result {
  border-block: 0;
  background: color-mix(in srgb, var(--accent-soft) 38%, transparent);
}

body.editorial-ui .hero-result-value,
body.editorial-ui .budget-hero-result > strong,
body.editorial-ui .home-primary-metrics strong {
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.02em;
}

body.editorial-ui .result-metrics {
  border-block-color: var(--studio-line);
}

body.editorial-ui .chart-block,
body.editorial-ui .budget-visual-block,
body.editorial-ui .home-life-board {
  border-color: var(--studio-line-soft);
  background: rgba(255, 254, 250, .5);
}

body.editorial-ui .historical-context-card,
body.editorial-ui .insight-card,
body.editorial-ui .plan-guidance {
  border-radius: 3px;
  box-shadow: none;
}

body.editorial-ui .module-learning {
  margin-top: 26px;
}

body.editorial-ui .learning-card {
  border-radius: 3px;
  box-shadow: none;
}

/* Connected plan */
body.editorial-ui .combined-heading {
  margin-bottom: 32px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--studio-navy);
}

body.editorial-ui .combined-heading h1 {
  max-width: 12ch;
  color: var(--studio-navy);
  font-size: clamp(3.8rem, 7vw, 7.4rem);
}

body.editorial-ui .money-map:not(:empty) {
  padding: 0;
  gap: 15px;
  border: 0;
  background: transparent;
}

body.editorial-ui .money-map-intro {
  padding: 0 0 18px;
  border-bottom: 1px solid var(--studio-line);
}

body.editorial-ui .money-map-intro h3 {
  font-size: clamp(1.7rem, 2.8vw, 2.6rem);
}

body.editorial-ui .money-map :is(.map-group, .money-map-group) {
  min-height: 250px;
  padding: 18px;
  border: 1px solid var(--studio-line-soft);
  border-top: 7px solid var(--map-accent, var(--studio-teal));
  background: var(--studio-card);
}

body.editorial-ui .money-map :is(.map-group, .money-map-group) > h3 {
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: 1.12rem;
}

body.editorial-ui .money-map :is(.map-node, .money-map-node) {
  min-height: 86px;
  border-radius: 3px;
  background: rgba(255, 254, 250, .72);
}

body.editorial-ui .plan-results {
  margin-top: 28px;
  padding: clamp(28px, 3.5vw, 50px);
  border-top: 7px solid var(--studio-navy);
}

/* Risk scenarios */
body.editorial-ui #risk-lab-root .fm-risk-lab {
  border-radius: 4px;
  box-shadow: none;
}

body.editorial-ui #risk-lab-root .fm-risk-head {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 5vw, 70px);
  background:
    radial-gradient(circle at 90% 20%, rgba(198, 83, 44, .12), transparent 22rem),
    var(--studio-card);
}

body.editorial-ui #risk-lab-root .fm-risk-head::after {
  position: absolute;
  right: clamp(24px, 5vw, 70px);
  bottom: -48px;
  width: clamp(130px, 20vw, 250px);
  aspect-ratio: 1;
  border: 1px solid rgba(45, 115, 115, .35);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(45, 115, 115, .05), 0 0 0 54px rgba(198, 83, 44, .035);
  content: "";
}

body.editorial-ui #risk-lab-root .fm-risk-head h1 {
  max-width: 10ch;
  font-size: clamp(4rem, 8vw, 8rem);
}

body.editorial-ui #risk-lab-root .fm-risk-main {
  padding: clamp(28px, 4vw, 54px);
}

body.editorial-ui #risk-lab-root .fm-risk-scenario-art {
  position: relative;
  height: clamp(220px, 34vw, 420px);
  margin: 22px 0 28px;
  overflow: hidden;
  border: 1px solid var(--studio-navy);
  background: var(--studio-paper);
}

body.editorial-ui #risk-lab-root .fm-risk-scenario-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 68%;
}

body.editorial-ui #risk-lab-root .fm-risk-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.editorial-ui #risk-lab-root .fm-risk-options legend {
  grid-column: 1 / -1;
  font-family: var(--font-editorial);
  font-size: 1.2rem;
}

body.editorial-ui #risk-lab-root .fm-risk-option {
  min-height: 100px;
  align-content: center;
  border-radius: 3px;
  font-family: var(--font-editorial);
  font-size: 1rem;
}

/* Money Basics */
body.research-page {
  background-color: #f4eddf;
  background-image: url("assets/texture/paper-grain.svg");
  background-attachment: fixed;
  background-size: 240px 240px;
}

body.research-page .research-shell {
  width: min(1380px, calc(100% - clamp(28px, 5vw, 76px)));
}

body.research-page .research-topbar {
  min-height: 72px;
  border-bottom: 1px solid #0a2e4d;
}

body.research-page .research-hero {
  position: relative;
  overflow: hidden;
  min-height: 390px;
  border: 1px solid rgba(10, 46, 77, .34);
  border-radius: 4px;
  background:
    radial-gradient(circle at 88% 12%, rgba(198, 83, 44, .14), transparent 18rem),
    rgba(255, 252, 245, .8);
  box-shadow: none;
}

body.research-page .research-hero::after {
  position: absolute;
  z-index: 0;
  right: -10px;
  bottom: -30px;
  color: rgba(198, 83, 44, .09);
  font: 800 clamp(8rem, 19vw, 18rem)/.8 Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  content: "LEARN";
  pointer-events: none;
}

body.research-page .research-hero > * {
  position: relative;
  z-index: 1;
}

body.research-page .research-title-row h1 {
  max-width: 10ch;
  color: #0a2e4d;
  font: 800 clamp(3.2rem, 6vw, 6.4rem)/.88 Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  text-transform: uppercase;
}

body.research-page :is(.research-nav, .research-article, .evidence-standard, .research-callout, .lesson-card) {
  border-radius: 4px;
  box-shadow: none;
}

/* Responsive system */
@media (max-width: 1180px) {
  body.editorial-ui .quick-calculator-grid .quick-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.editorial-ui .quick-calculator-grid .module-card-title {
    max-width: none;
  }

  body.editorial-ui .module-workspace,
  body.editorial-ui .module-shell[data-theme="events"] .module-workspace,
  body.editorial-ui .module-shell[data-theme="home"] .module-workspace,
  body.editorial-ui .module-shell[data-theme="budget"] .module-workspace {
    grid-template-columns: 1fr;
  }

  body.editorial-ui .input-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 820px) {
  body.editorial-ui .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  body.editorial-ui .primary-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  body.editorial-ui .decision-hero::after {
    opacity: .45;
  }

  body.editorial-ui .quick-calculator-grid .directory-grid {
    grid-template-columns: 1fr;
  }

  body.editorial-ui .quick-calculator-grid .connected-plan-card {
    grid-template-columns: 64px 1fr;
  }

  body.editorial-ui .quick-calculator-grid .connected-plan-card .primary-button {
    grid-column: 1 / -1;
  }

  body.editorial-ui .editorial-landscape {
    min-height: 420px;
  }

  body.editorial-ui .editorial-word {
    font-size: clamp(7rem, 28vw, 12rem);
  }

  body.editorial-ui #risk-lab-root .fm-risk-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body.editorial-ui .app-shell,
  body.research-page .research-shell {
    width: min(100% - 24px, 100%);
  }

  body.editorial-ui .site-name {
    font-size: 1.02rem;
  }

  body.editorial-ui .nav-action {
    font-size: .8rem;
  }

  body.editorial-ui .decision-hero h1 {
    font-size: clamp(3.6rem, 20vw, 6rem);
  }

  body.editorial-ui .quick-calculator-grid .quick-action-grid {
    grid-template-columns: 1fr;
  }

  body.editorial-ui .quick-calculator-grid .module-card,
  body.editorial-ui .quick-calculator-grid .module-open {
    min-height: 220px;
  }

  body.editorial-ui .module-intro {
    grid-template-columns: 1fr;
  }

  body.editorial-ui .module-identity {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  body.editorial-ui .module-large-icon {
    width: 52px;
    height: 52px;
  }

  body.editorial-ui .module-intro h1 {
    font-size: clamp(3rem, 16vw, 5.2rem);
  }

  body.editorial-ui .module-result-panel,
  body.editorial-ui .plan-results {
    padding: 20px 16px;
  }

  body.editorial-ui .editorial-landscape {
    min-height: 360px;
  }

  body.editorial-ui .editorial-landscape picture img {
    object-position: center bottom;
  }

  body.research-page .research-hero {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.editorial-ui .quick-calculator-grid .module-card {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Visual-fidelity loop · canonical editorial system
   These rules are intentionally last. They translate the approved canvases
   into the real application rather than a detached mockup.
   -------------------------------------------------------------------------- */

body.editorial-ui,
body.research-page {
  --paper: #f4eddf;
  --paper-raised: #fbf6eb;
  --paper-deep: #e8ddca;
  --ink: #0b304f;
  --ink-soft: #334d5e;
  --ink-faint: #6d7069;
  --line: rgba(11, 48, 79, .25);
  --line-strong: #0b304f;
  --control-line: rgba(11, 48, 79, .42);
  --navy: #0b304f;
  --rust: #c9562f;
  --rust-display: #c9562f;
  --teal: #2f7678;
  --plum: #70475d;
  --ochre: #b77d27;
  --font-ui: "Studio Sans", Arial, sans-serif;
  --font-display: "Studio Condensed", "Arial Narrow", sans-serif;
  --font-editorial: "Studio Serif", Georgia, serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("assets/texture/paper-grain.svg");
  background-attachment: fixed;
  background-size: 240px 240px;
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.45;
}

body.editorial-ui::before {
  background:
    radial-gradient(circle at 9% 0, rgba(201, 86, 47, .065), transparent 31rem),
    radial-gradient(circle at 92% 23%, rgba(47, 118, 120, .06), transparent 34rem);
  opacity: 1;
}

body.editorial-ui :where(button, input, select, textarea, summary) {
  font-family: var(--font-ui);
}

body.editorial-ui :where(.overline, .editorial-meta, .fm-risk-meta, .fm-risk-kicker) {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body.editorial-ui .app-shell {
  width: min(1480px, calc(100% - clamp(34px, 5.2vw, 84px)));
  padding-bottom: 22px;
}

/* Header fidelity */
body.editorial-ui .site-header {
  min-height: 78px;
  margin-bottom: clamp(34px, 4.8vw, 70px);
  padding: 15px 2px 11px;
  border-bottom: 1.5px solid var(--navy);
  background: rgba(244, 237, 223, .94);
}

body.editorial-ui .site-name {
  color: var(--navy);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 800;
  letter-spacing: .035em;
  line-height: 1;
  text-transform: uppercase;
}

body.editorial-ui .primary-nav {
  gap: clamp(15px, 3vw, 46px);
}

body.editorial-ui .nav-action {
  min-height: 42px;
  padding: 9px 2px;
  color: var(--navy);
  font-size: .9rem;
  font-weight: 700;
}

body.editorial-ui .nav-action::after {
  bottom: -12px;
  height: 3px;
  background: transparent;
}

body.editorial-ui .nav-action:hover::after,
body.editorial-ui .nav-action:focus-visible::after,
body.editorial-ui .nav-action[data-view="modules"]::after {
  background: var(--rust);
}

/* Landing composition */
body.editorial-ui .landing-view {
  width: min(1400px, 100%);
}

body.editorial-ui .decision-hero {
  min-height: clamp(265px, 28vw, 420px);
  padding: clamp(26px, 4.5vw, 66px) 0 clamp(42px, 5.5vw, 78px);
  text-align: left;
}

body.editorial-ui .decision-hero::after {
  top: 2%;
  right: 5%;
  width: clamp(120px, 14vw, 210px);
  border-color: rgba(201, 86, 47, .28);
  box-shadow:
    0 0 0 clamp(18px, 2vw, 30px) rgba(201, 86, 47, .04),
    0 0 0 clamp(42px, 4vw, 62px) rgba(183, 125, 39, .025);
}

body.editorial-ui .editorial-meta {
  margin: 0 0 20px;
  color: var(--rust);
  font-size: .84rem;
}

body.editorial-ui .decision-hero h1 {
  max-width: 9.5ch;
  margin: 0;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: clamp(4.8rem, 8.1vw, 8rem);
  font-weight: 800;
  letter-spacing: -.018em;
  line-height: .84;
  text-align: left;
  text-transform: uppercase;
}

body.editorial-ui .decision-lead {
  margin-top: 27px;
  color: var(--navy);
  font-family: var(--font-editorial);
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

body.editorial-ui .quick-calculator-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 28px 20px;
}

body.editorial-ui .quick-calculator-grid > .quick-action-grid {
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

body.editorial-ui .quick-calculator-grid .quick-action-card {
  min-height: 320px;
  border: 1px solid var(--accent-dark);
  border-radius: 4px;
  background: rgba(251, 246, 235, .72);
  box-shadow: none;
}

body.editorial-ui .quick-calculator-grid .quick-action-card::before {
  height: 8px;
  background: var(--accent);
}

body.editorial-ui .quick-calculator-grid .quick-action-card .module-open {
  min-height: 318px;
  padding: 28px 22px 25px;
  grid-template-columns: 1fr 28px;
  grid-template-rows: 74px 1fr;
  align-items: start;
  gap: 22px 12px;
}

body.editorial-ui .quick-calculator-grid .quick-action-card .module-card-icon {
  width: 72px;
  height: 72px;
  grid-column: 1;
  color: var(--paper-raised);
  border: 0;
  border-radius: 50%;
  background-color: var(--accent);
  background-image: url("assets/texture/paper-grain.svg");
  background-blend-mode: soft-light;
}

body.editorial-ui .quick-calculator-grid .quick-action-card .module-card-icon svg {
  width: 39px;
  height: 39px;
}

body.editorial-ui .quick-calculator-grid .quick-action-card .module-card-body {
  grid-column: 1 / -1;
}

body.editorial-ui .quick-calculator-grid .quick-action-card .module-card-arrow {
  grid-row: 1;
  grid-column: 2;
  align-self: center;
  color: var(--accent-dark);
}

body.editorial-ui .quick-calculator-grid .quick-action-card .module-card-title {
  max-width: 9ch;
  margin-bottom: 17px;
  color: var(--accent-dark);
  font-family: var(--font-editorial);
  font-size: clamp(1.65rem, 2.3vw, 2.35rem);
  font-weight: 400;
  letter-spacing: -.015em;
  line-height: .98;
  text-transform: none;
}

body.editorial-ui .quick-calculator-grid .quick-action-card .module-card-question {
  min-height: 64px;
  padding-top: 15px;
  color: var(--navy);
  border-top: 1px solid var(--accent-dark);
  font-family: var(--font-editorial);
  font-size: .95rem;
  line-height: 1.45;
}

body.editorial-ui :is(.module-card[data-module="budget"], .module-shell[data-theme="budget"]) {
  --accent: #70475d !important;
  --accent-dark: #563548 !important;
  --accent-soft: #eee2e8 !important;
  --accent-fade: #d9c1ce !important;
}

body.editorial-ui :is(.module-card[data-module="home"], .module-shell[data-theme="home"]) {
  --accent: #2f7678 !important;
  --accent-dark: #235b62 !important;
  --accent-soft: #e0ece8 !important;
  --accent-fade: #bad3cc !important;
}

body.editorial-ui :is(.module-card[data-module="investing"], .module-shell[data-theme="investing"]) {
  --accent: #c9562f !important;
  --accent-dark: #9d3d22 !important;
  --accent-soft: #f2e0d4 !important;
  --accent-fade: #e3bba7 !important;
}

body.editorial-ui :is(.module-card[data-module="safety"], .module-shell[data-theme="safety"]) {
  --accent: #4d8582 !important;
  --accent-dark: #2f6667 !important;
  --accent-soft: #e0ece8 !important;
  --accent-fade: #bdd4ce !important;
}

body.editorial-ui :is(.module-card[data-module="debt"], .module-shell[data-theme="debt"]) {
  --accent: #70475d !important;
  --accent-dark: #563548 !important;
  --accent-soft: #eee2e8 !important;
  --accent-fade: #d9c1ce !important;
}

body.editorial-ui :is(.module-card[data-module="goal"], .module-shell[data-theme="goal"]),
body.editorial-ui :is(.module-card[data-module="events"], .module-shell[data-theme="events"]) {
  --accent: #b77d27 !important;
  --accent-dark: #815515 !important;
  --accent-soft: #f1e6d2 !important;
  --accent-fade: #dfc58f !important;
}

body.editorial-ui .quick-calculator-grid > .calculator-directory {
  grid-column: 1 / span 5;
  align-self: stretch;
  padding: 20px 0 0;
  border-top: 1px solid var(--navy);
  text-align: left;
}

body.editorial-ui .quick-calculator-grid .calculator-directory summary {
  width: 100%;
  margin: 0 0 8px;
  padding: 0 6px 10px;
  justify-content: space-between;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

body.editorial-ui .quick-calculator-grid .calculator-directory summary::after {
  color: var(--rust);
  content: "−";
}

body.editorial-ui .quick-calculator-grid .calculator-directory:not([open]) summary::after {
  content: "+";
}

body.editorial-ui .quick-calculator-grid .directory-grid {
  grid-template-columns: 1fr;
  gap: 0;
}

body.editorial-ui .quick-calculator-grid .directory-card {
  min-height: 92px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

body.editorial-ui .quick-calculator-grid .directory-card .module-open {
  min-height: 91px;
  padding: 14px 9px;
  grid-template-columns: 52px minmax(0, 1fr) 25px;
  grid-template-rows: 1fr;
  align-items: center;
  gap: 14px;
}

body.editorial-ui .quick-calculator-grid .directory-card .module-card-icon,
body.editorial-ui .quick-calculator-grid .directory-card .module-card-body,
body.editorial-ui .quick-calculator-grid .directory-card .module-card-arrow {
  grid-row: auto;
  grid-column: auto;
}

body.editorial-ui .quick-calculator-grid .directory-card .module-card-icon {
  width: 50px;
  height: 50px;
  color: var(--paper-raised);
  border: 0;
  background: var(--accent);
}

body.editorial-ui .quick-calculator-grid .directory-card .module-card-title {
  margin: 0 0 3px;
  color: var(--accent-dark);
  font-family: var(--font-ui);
  font-size: 1.08rem;
  font-weight: 700;
  text-transform: none;
}

body.editorial-ui .quick-calculator-grid .directory-card .module-card-question {
  padding: 0;
  border: 0;
  font-size: .82rem;
}

body.editorial-ui .quick-calculator-grid .directory-card .module-research-link {
  display: none;
}

body.editorial-ui .quick-calculator-grid > .connected-plan-card {
  width: 100%;
  min-height: 300px;
  margin: 0;
  padding: clamp(28px, 3.2vw, 46px);
  grid-column: 6 / -1;
  grid-template-columns: 130px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 22px 30px;
  border: 1px solid var(--teal);
  border-radius: 4px;
  background:
    linear-gradient(125deg, rgba(47, 118, 120, .13), rgba(251, 246, 235, .56)),
    var(--paper-raised);
}

body.editorial-ui .quick-calculator-grid .connected-plan-card > .module-card-icon {
  width: 126px;
  height: 126px;
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 50%;
  background: rgba(244, 237, 223, .58);
}

body.editorial-ui .quick-calculator-grid .connected-plan-card > .module-card-icon svg {
  width: 66px;
  height: 66px;
}

body.editorial-ui .quick-calculator-grid .connected-plan-card strong {
  max-width: 13ch;
  color: var(--teal);
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 4.6vw, 4.5rem);
  line-height: .85;
  text-transform: none;
}

body.editorial-ui .quick-calculator-grid .connected-plan-card p {
  max-width: 36ch;
  margin: 12px 0 0;
  color: var(--navy);
  font-family: var(--font-editorial);
  font-size: 1rem;
}

body.editorial-ui .quick-calculator-grid .connected-plan-card .primary-button {
  min-height: 52px;
  padding: 12px 19px;
  grid-row: 2;
  grid-column: 2;
  justify-self: start;
  color: var(--paper-raised);
  border: 1px solid var(--teal);
  background: var(--teal);
}

body.editorial-ui .editorial-landscape {
  min-height: clamp(390px, 43vw, 620px);
  margin-top: clamp(50px, 7vw, 98px);
  overflow: hidden;
  border-block: 1px solid var(--navy);
  isolation: isolate;
}

body.editorial-ui .editorial-landscape::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  background: url("assets/art/life-path-panorama.webp") center bottom / cover no-repeat;
  clip-path: inset(56% 0 0 0);
  content: "";
  pointer-events: none;
}

body.editorial-ui .editorial-landscape picture,
body.editorial-ui .editorial-landscape picture img {
  z-index: 1;
  object-position: center bottom;
}

body.editorial-ui .editorial-word {
  z-index: 2;
  top: clamp(22px, 5vw, 74px);
  color: var(--rust);
  font-family: var(--font-display);
  font-size: clamp(10rem, 23.5vw, 22rem);
  letter-spacing: -.03em;
  mix-blend-mode: multiply;
  opacity: .92;
}

body.editorial-ui .landscape-caption {
  z-index: 4;
  bottom: 18px;
  left: 20px;
  padding: 6px 9px;
  color: var(--paper-raised);
  background: rgba(11, 48, 79, .78);
  font-family: var(--font-editorial);
  font-size: .82rem;
}

/* Calculator shells */
body.editorial-ui :is(#module-view, #plan-view, #risk-view) {
  width: min(1400px, 100%);
}

body.editorial-ui .module-intro {
  min-height: 200px;
  margin-bottom: 24px;
  padding: 20px 0 34px;
  grid-template-columns: minmax(0, 1fr) minmax(230px, auto);
  align-items: center;
  border-bottom: 1px solid var(--navy);
}

body.editorial-ui .module-identity {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
}

body.editorial-ui .module-large-icon {
  width: 78px;
  height: 78px;
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 3px;
  background: rgba(251, 246, 235, .56);
}

body.editorial-ui .module-large-icon svg {
  width: 48px;
  height: 48px;
}

body.editorial-ui .module-intro h1 {
  margin: 0 0 7px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(4.2rem, 7vw, 7rem);
  font-weight: 800;
  letter-spacing: .01em;
  line-height: .82;
  text-transform: uppercase;
}

body.editorial-ui .module-intro p {
  max-width: 70ch;
  color: var(--navy);
  font-family: var(--font-editorial);
  font-size: 1rem;
  line-height: 1.42;
}

body.editorial-ui .module-header-actions {
  align-items: stretch;
  flex-direction: column;
}

body.editorial-ui :is(.module-learn-shortcut, .module-state) {
  min-height: 48px;
  padding: 10px 13px;
  border-color: var(--line);
  border-radius: 3px;
  background: rgba(251, 246, 235, .72);
}

body.editorial-ui .module-state {
  min-width: 220px;
}

body.editorial-ui .example-data-banner {
  margin: 0 0 22px;
  padding: 14px 17px;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(251, 246, 235, .5);
}

body.editorial-ui .module-workspace,
body.editorial-ui .module-shell[data-theme="events"] .module-workspace,
body.editorial-ui .module-shell[data-theme="home"] .module-workspace,
body.editorial-ui .module-shell[data-theme="budget"] .module-workspace {
  grid-template-columns: minmax(360px, .38fr) minmax(0, .62fr);
  gap: 14px;
}

body.editorial-ui :is(.input-panel, .module-result-panel, .plan-results) {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(251, 246, 235, .72);
  box-shadow: none;
}

body.editorial-ui .input-panel {
  top: 92px;
  max-height: calc(100vh - 108px);
  scrollbar-color: var(--accent) transparent;
}

body.editorial-ui .module-result-panel,
body.editorial-ui .module-shell[data-theme="budget"] .module-result-panel,
body.editorial-ui .module-shell[data-theme="events"] .module-result-panel,
body.editorial-ui .module-shell[data-theme="home"] .module-result-panel {
  min-height: 720px;
  padding: clamp(24px, 3vw, 42px);
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  background:
    radial-gradient(circle at 94% 2%, color-mix(in srgb, var(--accent-soft) 72%, transparent), transparent 24rem),
    rgba(251, 246, 235, .75);
}

body.editorial-ui :is(.panel-heading, .form-section) {
  padding: 23px 21px;
}

body.editorial-ui .panel-heading {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent-soft) 35%, transparent);
}

body.editorial-ui .panel-heading h2,
body.editorial-ui .form-section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: .045em;
  text-transform: uppercase;
}

body.editorial-ui :is(.field, .choice-label, .form-check) {
  color: var(--navy);
  font-size: .86rem;
  font-weight: 700;
}

body.editorial-ui :is(.field input, .field select, .phase-row input, .event-library-top input) {
  min-height: 47px;
  padding-block: 10px;
  color: var(--navy);
  border: 1px solid var(--control-line);
  border-radius: 3px;
  background: rgba(255, 253, 247, .86);
  font-family: var(--font-ui);
  font-size: 1rem;
}

body.editorial-ui :is(.segmented, .dollar-mode) {
  padding: 3px;
  border: 1px solid var(--control-line);
  border-radius: 3px;
  background: rgba(255, 253, 247, .62);
}

body.editorial-ui :is(.segmented button, .dollar-mode button) {
  border-radius: 2px;
}

body.editorial-ui :is(.segmented button[aria-pressed="true"], .dollar-mode button[aria-pressed="true"]) {
  color: var(--paper-raised);
  border-color: var(--accent, var(--navy));
  background: var(--accent, var(--navy));
}

body.editorial-ui :is(.choice-button, .primary-button, .secondary-button, .inline-button, .back-button) {
  min-height: 46px;
  border-radius: 2px;
  font-weight: 700;
}

body.editorial-ui .primary-button {
  background: var(--navy);
}

body.editorial-ui .result-heading {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

body.editorial-ui :is(.result-heading h2, .plan-result-top h2, .home-result-top h2) {
  color: var(--navy);
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4vw, 4rem);
  letter-spacing: .015em;
  line-height: .88;
  text-transform: uppercase;
}

body.editorial-ui :is(.hero-result, .budget-hero-result) {
  border-block: 1px solid var(--line);
  background: transparent;
}

body.editorial-ui :is(.hero-result-value, .budget-hero-result > strong, .home-primary-metrics strong) {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 7vw, 7rem);
  font-weight: 800;
  letter-spacing: .005em;
  line-height: .88;
}

body.editorial-ui :is(.result-metric strong, .plan-key-metric strong, .plan-insight strong) {
  font-family: var(--font-editorial);
}

body.editorial-ui :is(.chart-block, .budget-visual-block, .home-life-board) {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 253, 247, .42);
}

body.editorial-ui :is(.historical-context-card, .insight-card, .plan-guidance, .learning-card) {
  border-radius: 3px;
  box-shadow: none;
}

body.editorial-ui .historical-context-card {
  border-color: var(--line);
  border-left: 5px solid var(--rust);
  background: rgba(201, 86, 47, .075);
}

body.editorial-ui .module-learning {
  display: grid;
  margin-top: 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

body.editorial-ui .learning-card {
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(251, 246, 235, .56);
}

body.editorial-ui .learning-card h3 {
  color: var(--navy);
  font-family: var(--font-editorial);
  font-size: 1.2rem;
}

/* My Plan */
body.editorial-ui .combined-heading {
  min-height: 250px;
  margin-bottom: 26px;
  padding: 18px 0 38px;
  align-items: center;
  border-bottom: 1px solid var(--navy);
}

body.editorial-ui .combined-heading h1 {
  max-width: 11ch;
  color: var(--navy);
  font-family: var(--font-ui);
  font-size: clamp(4.3rem, 7vw, 7.3rem);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: .86;
  text-transform: none;
}

body.editorial-ui .plan-status {
  max-width: 26ch;
  padding: 18px 0 18px 26px;
  color: var(--navy);
  border-left: 1px solid var(--line);
  font-family: var(--font-editorial);
  font-size: 1.04rem;
  text-align: left;
}

body.editorial-ui .money-map:not(:empty) {
  padding: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.editorial-ui .money-map-intro {
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

body.editorial-ui .money-map-intro h3 {
  color: var(--navy);
  font-family: var(--font-editorial);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

body.editorial-ui .plan-quick-facts {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(251, 246, 235, .56);
}

body.editorial-ui .plan-suggestion {
  border: 1px solid rgba(201, 86, 47, .4);
  border-left: 5px solid var(--rust);
  background: rgba(201, 86, 47, .07);
}

body.editorial-ui .money-map .money-map-group {
  min-height: 285px;
  padding: 0 12px 12px;
  overflow: hidden;
  border: 1px solid var(--map-accent);
  border-top: 0;
  border-radius: 4px;
  background: rgba(251, 246, 235, .62);
}

body.editorial-ui .money-map .money-map-group > h3 {
  margin: 0 -12px 13px;
  padding: 15px 14px;
  color: var(--paper-raised);
  background-color: var(--map-accent);
  background-image: url("assets/texture/paper-grain.svg");
  background-blend-mode: soft-light;
  font-family: var(--font-display);
  font-size: 1.08rem;
  letter-spacing: .06em;
}

body.editorial-ui .money-map .money-map-node {
  min-height: 104px;
  margin-top: 9px;
  padding: 12px 10px 9px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 253, 247, .62);
}

body.editorial-ui .money-map .money-map-node.is-connected {
  border-color: var(--map-node-accent);
  box-shadow: inset 0 4px 0 var(--map-node-accent);
}

body.editorial-ui .money-map-node-icon {
  width: 38px;
  height: 38px;
  color: var(--map-node-accent);
  border: 1px solid currentColor;
  border-radius: 50%;
}

body.editorial-ui .money-map-node-icon svg {
  width: 22px;
  height: 22px;
}

body.editorial-ui .money-map-node-copy strong {
  font-family: var(--font-editorial);
  font-size: 1.02rem;
}

body.editorial-ui .money-map-node-copy small {
  font-size: .72rem;
}

body.editorial-ui .money-map-edit {
  min-width: 62px;
  min-height: 31px;
  border-radius: 2px;
}

body.editorial-ui .plan-results {
  margin-top: 28px;
  padding: clamp(26px, 3.3vw, 48px);
  border: 1px solid var(--line);
  border-top: 1px solid var(--navy);
}

body.editorial-ui .plan-result-top {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

body.editorial-ui .plan-dashboard {
  grid-template-columns: minmax(280px, .62fr) minmax(0, 1.38fr);
  gap: 0;
  border-bottom: 1px solid var(--line);
}

body.editorial-ui :is(.plan-kpi-panel, .plan-chart-panel) {
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.editorial-ui .plan-kpi-panel {
  border-right: 1px solid var(--line);
}

body.editorial-ui .plan-primary-kpi .plan-summary-value {
  color: var(--navy);
  font-family: var(--font-display);
  font-size: clamp(3.3rem, 5vw, 5.3rem);
}

body.editorial-ui .plan-insights {
  gap: 0;
  border: 1px solid var(--line);
}

body.editorial-ui .plan-insight {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

/* Risk scenario page */
body.editorial-ui #risk-view {
  width: min(1340px, 100%);
}

body.editorial-ui #risk-lab-root .fm-risk-lab {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.editorial-ui #risk-lab-root .fm-risk-head {
  min-height: 530px;
  padding: 18px 0 32px;
  overflow: visible;
  border-bottom: 1px solid var(--navy);
  background: transparent;
}

body.editorial-ui #risk-lab-root .fm-risk-head::after {
  display: none;
}

body.editorial-ui #risk-lab-root .fm-risk-hero-row {
  display: grid;
  margin-top: 44px;
  grid-template-columns: minmax(0, 1.45fr) minmax(210px, .55fr);
  align-items: center;
  gap: clamp(24px, 5vw, 80px);
}

body.editorial-ui #risk-lab-root .fm-risk-head h1 {
  max-width: 12ch;
  margin: 0 0 18px;
  color: var(--navy);
  font-family: var(--font-editorial);
  font-size: clamp(4.2rem, 7vw, 7rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: .9;
  text-transform: none;
}

body.editorial-ui #risk-lab-root .fm-risk-deck {
  max-width: 680px;
  color: var(--navy);
  font-family: var(--font-ui);
  font-size: 1.12rem;
}

body.editorial-ui #risk-lab-root .fm-risk-compass {
  display: block;
  width: min(100%, 290px);
  height: auto;
  justify-self: center;
}

body.editorial-ui #risk-lab-root .fm-risk-chapters {
  display: grid;
  margin-top: 38px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-block: 1px solid var(--line);
}

body.editorial-ui #risk-lab-root .fm-risk-chapters span {
  position: relative;
  display: flex;
  min-height: 76px;
  padding: 12px 18px;
  align-items: center;
  gap: 13px;
  border-right: 1px solid var(--line);
}

body.editorial-ui #risk-lab-root .fm-risk-chapters span:last-child {
  border-right: 0;
}

body.editorial-ui #risk-lab-root .fm-risk-chapters b {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--paper-raised);
  border-radius: 50%;
  background: var(--rust);
  font-family: var(--font-editorial);
  font-size: 1.45rem;
}

body.editorial-ui #risk-lab-root .fm-risk-chapters span:nth-child(2) b {
  background: var(--navy);
}

body.editorial-ui #risk-lab-root .fm-risk-chapters span:nth-child(3) b {
  background: var(--teal);
}

body.editorial-ui #risk-lab-root .fm-risk-chapters i {
  color: var(--navy);
  font-family: var(--font-editorial);
  font-size: 1rem;
  font-style: normal;
  font-weight: 700;
}

body.editorial-ui #risk-lab-root .fm-risk-progress-wrap {
  margin-top: 16px;
}

body.editorial-ui #risk-lab-root .fm-risk-progress-wrap progress {
  height: 3px;
  border-radius: 0;
}

body.editorial-ui #risk-lab-root .fm-risk-main {
  min-height: 580px;
  padding: clamp(32px, 4.2vw, 58px) 0 30px;
}

body.editorial-ui #risk-lab-root .fm-risk-main h3 {
  max-width: 18ch;
  color: var(--navy);
  font-family: var(--font-editorial);
  font-size: clamp(2.6rem, 4.4vw, 4.6rem);
  line-height: .94;
}

body.editorial-ui #risk-lab-root .fm-risk-scenario-art {
  height: clamp(260px, 35vw, 460px);
  margin: 25px 0 31px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

body.editorial-ui #risk-lab-root .fm-risk-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

body.editorial-ui #risk-lab-root .fm-risk-options legend {
  grid-column: 1 / -1;
  color: var(--navy);
  font-family: var(--font-editorial);
  font-size: 1.25rem;
}

body.editorial-ui #risk-lab-root .fm-risk-option {
  min-height: 112px;
  padding: 17px;
  align-content: center;
  border: 1px solid var(--control-line);
  border-radius: 3px;
  background: rgba(251, 246, 235, .65);
  font-family: var(--font-editorial);
  font-size: 1.08rem;
}

body.editorial-ui #risk-lab-root .fm-risk-actions {
  padding: 20px 0 30px;
  border-top: 1px solid var(--line);
}

body.editorial-ui #risk-lab-root .fm-risk-button {
  min-height: 48px;
  border-radius: 2px;
}

body.editorial-ui #risk-lab-root .fm-risk-results {
  gap: 0;
  border-top: 1px solid var(--line);
}

body.editorial-ui #risk-lab-root .fm-risk-result {
  padding: 27px 0;
}

body.editorial-ui #risk-lab-root .fm-risk-result-value {
  color: var(--navy);
  font-family: var(--font-editorial);
}

/* Money Basics */
body.research-page .research-shell {
  width: min(1380px, calc(100% - clamp(34px, 5.2vw, 80px)));
}

body.research-page .research-topbar {
  min-height: 78px;
  border-bottom: 1.5px solid var(--navy);
}

body.research-page .brand-copy strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: .035em;
  text-transform: uppercase;
}

body.research-page .research-hero {
  min-height: 460px;
  padding: clamp(34px, 5vw, 68px);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(251, 246, 235, .63);
}

body.research-page .research-hero::after {
  right: -12px;
  bottom: -32px;
  color: rgba(201, 86, 47, .08);
  font-family: var(--font-display);
  font-size: clamp(10rem, 22vw, 20rem);
}

body.research-page .research-title-row h1 {
  max-width: 11ch;
  color: var(--navy);
  font-family: var(--font-editorial);
  font-size: clamp(3.8rem, 6.7vw, 7rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: .9;
  text-transform: none;
}

body.research-page .evidence-standard {
  border: 1px solid var(--ochre);
  border-radius: 3px;
  background: rgba(183, 125, 39, .12);
}

body.research-page :is(.research-nav, .research-article, .research-callout, .lesson-card, .finding-card, .number-card) {
  border-radius: 3px;
  box-shadow: none;
}

body.research-page .research-nav {
  border: 1px solid var(--line);
  background: rgba(251, 246, 235, .5);
}

body.research-page .research-section-heading h2,
body.research-page .lesson-card h3,
body.research-page .finding-card h3 {
  font-family: var(--font-editorial);
}

/* Responsive fidelity */
@media (max-width: 1180px) {
  body.editorial-ui .quick-calculator-grid > .quick-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.editorial-ui .module-workspace,
  body.editorial-ui .module-shell[data-theme="events"] .module-workspace,
  body.editorial-ui .module-shell[data-theme="home"] .module-workspace,
  body.editorial-ui .module-shell[data-theme="budget"] .module-workspace {
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  }

  body.editorial-ui .input-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 900px) {
  body.editorial-ui .quick-calculator-grid > .calculator-directory,
  body.editorial-ui .quick-calculator-grid > .connected-plan-card {
    grid-column: 1 / -1;
  }

  body.editorial-ui .module-workspace,
  body.editorial-ui .module-shell[data-theme="events"] .module-workspace,
  body.editorial-ui .module-shell[data-theme="home"] .module-workspace,
  body.editorial-ui .module-shell[data-theme="budget"] .module-workspace {
    grid-template-columns: 1fr;
  }

  body.editorial-ui .money-map:not(:empty) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.editorial-ui .plan-dashboard {
    grid-template-columns: 1fr;
  }

  body.editorial-ui .plan-kpi-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  body.editorial-ui #risk-lab-root .fm-risk-head {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  body.editorial-ui,
  body.research-page {
    font-size: 16px;
  }

  body.editorial-ui .app-shell,
  body.research-page .research-shell {
    width: calc(100% - 24px);
  }

  body.editorial-ui .site-header {
    min-height: 104px;
    margin-bottom: 24px;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  body.editorial-ui .primary-nav {
    width: 100%;
    gap: 22px;
    overflow-x: auto;
  }

  body.editorial-ui .decision-hero {
    min-height: 0;
    padding: 28px 0 42px;
  }

  body.editorial-ui .decision-hero h1 {
    font-size: clamp(4rem, 20vw, 6rem);
  }

  body.editorial-ui .quick-calculator-grid > .quick-action-grid {
    grid-template-columns: 1fr;
  }

  body.editorial-ui .quick-calculator-grid .quick-action-card,
  body.editorial-ui .quick-calculator-grid .quick-action-card .module-open {
    min-height: 245px;
  }

  body.editorial-ui .quick-calculator-grid > .connected-plan-card {
    min-height: 0;
    grid-template-columns: 76px minmax(0, 1fr);
  }

  body.editorial-ui .quick-calculator-grid .connected-plan-card > .module-card-icon {
    width: 74px;
    height: 74px;
  }

  body.editorial-ui .quick-calculator-grid .connected-plan-card > .module-card-icon svg {
    width: 38px;
    height: 38px;
  }

  body.editorial-ui .quick-calculator-grid .connected-plan-card .primary-button {
    grid-column: 1 / -1;
  }

  body.editorial-ui .editorial-landscape {
    min-height: 360px;
  }

  body.editorial-ui .module-intro {
    min-height: 0;
    padding-top: 8px;
    grid-template-columns: 1fr;
  }

  body.editorial-ui .module-identity {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 13px;
  }

  body.editorial-ui .module-large-icon {
    width: 54px;
    height: 54px;
  }

  body.editorial-ui .module-large-icon svg {
    width: 31px;
    height: 31px;
  }

  body.editorial-ui .module-intro h1 {
    font-size: clamp(3.4rem, 16vw, 5rem);
  }

  body.editorial-ui .module-header-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  body.editorial-ui .module-state {
    min-width: 0;
  }

  body.editorial-ui .module-learning {
    grid-template-columns: 1fr;
  }

  body.editorial-ui .combined-heading {
    min-height: 0;
    align-items: start;
    flex-direction: column;
  }

  body.editorial-ui .combined-heading h1 {
    font-size: clamp(3.5rem, 16vw, 5.2rem);
  }

  body.editorial-ui .plan-status {
    max-width: none;
    padding: 12px 0 0;
    border: 0;
  }

  body.editorial-ui .money-map:not(:empty) {
    grid-template-columns: 1fr;
  }

  body.editorial-ui .money-map-intro {
    grid-template-columns: 1fr;
  }

  body.editorial-ui .plan-fact-grid {
    grid-template-columns: 1fr;
  }

  body.editorial-ui .plan-suggestion {
    grid-template-columns: 1fr;
  }

  body.editorial-ui #risk-lab-root .fm-risk-hero-row {
    margin-top: 28px;
    grid-template-columns: 1fr;
  }

  body.editorial-ui #risk-lab-root .fm-risk-compass {
    width: 180px;
  }

  body.editorial-ui #risk-lab-root .fm-risk-head h1 {
    font-size: clamp(3.5rem, 15vw, 5.5rem);
  }

  body.editorial-ui #risk-lab-root .fm-risk-chapters {
    grid-template-columns: 1fr;
  }

  body.editorial-ui #risk-lab-root .fm-risk-chapters span {
    min-height: 62px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  body.editorial-ui #risk-lab-root .fm-risk-options {
    grid-template-columns: 1fr;
  }

  body.research-page .research-hero {
    min-height: 0;
    padding: 26px 20px;
  }

  body.research-page .research-title-row h1 {
    font-size: clamp(3.3rem, 15vw, 5rem);
  }
}

/* Fidelity loop · final print and control polish */
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  body.editorial-ui :is(
    .decision-hero h1,
    .module-intro h1,
    .result-heading h2,
    .hero-result-value,
    .budget-hero-result > strong,
    .home-primary-metrics strong
  ) {
    background-image:
      url("assets/texture/ink-wear.svg"),
      linear-gradient(currentColor, currentColor);
    background-blend-mode: screen, normal;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

body.editorial-ui .decision-hero h1,
body.editorial-ui .combined-heading h1 {
  color: var(--navy);
}

body.editorial-ui .module-intro h1,
body.editorial-ui :is(.hero-result-value, .budget-hero-result > strong, .home-primary-metrics strong) {
  color: var(--accent);
}

body.editorial-ui .money-map-switch {
  min-width: 48px;
  justify-items: center;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

body.editorial-ui .money-map-switch input {
  position: relative;
  width: 42px;
  height: 22px;
  margin: 0;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(11, 48, 79, .16);
  cursor: pointer;
}

body.editorial-ui .money-map-switch input::before {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper-raised);
  box-shadow: 0 0 0 1px rgba(11, 48, 79, .24);
  content: "";
  transition: transform .16s ease;
}

body.editorial-ui .money-map-switch input:checked {
  border-color: var(--map-node-accent, var(--teal));
  background: var(--map-node-accent, var(--teal));
}

body.editorial-ui .money-map-switch input:checked::before {
  transform: translateX(20px);
}

body.editorial-ui #risk-lab-root .fm-risk-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.editorial-ui #risk-lab-root .fm-risk-option {
  position: relative;
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 18px 15px;
  gap: 12px;
  text-align: center;
}

body.editorial-ui #risk-lab-root .fm-risk-option::before {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  color: var(--paper-raised);
  border-radius: 50%;
  background: var(--rust);
  content: "↓";
  font-family: var(--font-editorial);
  font-size: 1.55rem;
  line-height: 1;
}

body.editorial-ui #risk-lab-root .fm-risk-option:nth-of-type(1)::before {
  background: var(--teal);
  content: "=";
}

body.editorial-ui #risk-lab-root .fm-risk-option:nth-of-type(2)::before {
  background: var(--ochre);
  content: "↘";
}

body.editorial-ui #risk-lab-root .fm-risk-option:nth-of-type(3)::before {
  background: var(--plum);
  content: "↓";
}

body.editorial-ui #risk-lab-root .fm-risk-option:nth-of-type(4)::before {
  background: var(--navy);
  content: "⇣";
}

body.editorial-ui #risk-lab-root .fm-risk-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

body.editorial-ui #risk-lab-root .fm-risk-option:has(input:checked) {
  border-color: var(--teal);
  background: rgba(47, 118, 120, .11);
  box-shadow: inset 0 -5px 0 var(--teal);
}

body.editorial-ui .historical-context-card {
  grid-template-columns: 82px minmax(145px, .55fr) minmax(0, 1.2fr) auto;
}

body.editorial-ui .historical-context-card::before {
  width: 74px;
  height: 74px;
  grid-column: 1;
  border-radius: 50%;
  background: url("assets/art/investing-wave-print-v2.webp") center / cover no-repeat;
  content: "";
}

body.editorial-ui .historical-context-card > span {
  grid-column: 2;
}

body.editorial-ui .historical-context-card > .historical-context-copy {
  grid-column: 3;
}

body.editorial-ui .historical-context-card > .historical-context-sources {
  display: grid;
  gap: 7px;
  grid-column: 4;
}

body.editorial-ui .site-footer {
  margin-top: 26px;
  padding: 20px 0 4px;
  color: var(--navy);
  border-top: 1px solid var(--navy);
  background: transparent;
  font-family: var(--font-ui);
}

body.editorial-ui .site-footer svg {
  color: var(--teal);
}

body.editorial-ui .privacy-controls button {
  min-height: 38px;
  color: var(--navy);
  border-bottom-color: var(--navy);
}

@media (max-width: 1040px) {
  body.editorial-ui #risk-lab-root .fm-risk-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.editorial-ui .historical-context-card {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  body.editorial-ui .historical-context-card::before {
    grid-row: 1 / span 2;
  }

  body.editorial-ui .historical-context-card > :is(span, .historical-context-copy, .historical-context-sources) {
    grid-column: 2;
  }
}

@media (max-width: 620px) {
  body.editorial-ui #risk-lab-root .fm-risk-options {
    grid-template-columns: 1fr;
  }

  body.editorial-ui .historical-context-card {
    grid-template-columns: 1fr;
  }

  body.editorial-ui .historical-context-card::before,
  body.editorial-ui .historical-context-card > :is(span, .historical-context-copy, .historical-context-sources) {
    grid-row: auto;
    grid-column: 1;
  }
}
