:root {
  color-scheme: light;
  --canvas: #f7f7fd;
  --surface: #ffffff;
  --surface-soft: #f2f1f9;
  --ink: #231f3b;
  --ink-soft: #706d86;
  --ink-faint: #9692aa;
  --line: #e7e5f0;
  --violet: #705cf6;
  --violet-dark: #4d3dcc;
  --cyan: #13b7d4;
  --coral: #ff705f;
  --pink: #ef4c9f;
  --amber: #eea127;
  --lime: #b9ee64;
  --shadow-soft: 0 18px 52px rgba(55, 43, 125, .09);
  --shadow-lift: 0 26px 70px rgba(55, 43, 125, .16);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 11px;
  --accent: var(--violet);
  --accent-dark: var(--violet-dark);
  --accent-soft: #efedff;
  --accent-fade: #dad5ff;
  --accent-contrast: #ffffff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% -4%, rgba(30, 208, 231, .16), transparent 25rem),
    radial-gradient(circle at 95% 4%, rgba(247, 80, 162, .11), transparent 24rem),
    radial-gradient(circle at 57% 102%, rgba(112, 92, 246, .10), transparent 30rem),
    var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  letter-spacing: -.008em;
}

button,
input,
select,
summary { font: inherit; }

button,
summary,
input[type="range"] { cursor: pointer; }

button { color: inherit; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: 3px;
}

a { color: inherit; }

[hidden] { display: none !important; }

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app-shell {
  width: min(1460px, calc(100% - 52px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 50px;
  margin-bottom: 50px;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: .96rem;
  font-weight: 760;
  letter-spacing: -.025em;
}

.brand-symbol {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: white;
  border-radius: 12px;
  background: linear-gradient(135deg, #6d59f5 5%, #a551eb 50%, #f4509f 100%);
  box-shadow: 0 8px 21px rgba(112, 92, 246, .24);
}

.brand-symbol svg { width: 19px; height: 19px; }

.view-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(112, 92, 246, .10);
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 8px 24px rgba(69,55,139,.06);
}

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 14px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: .78rem;
  font-weight: 720;
}

.view-tab:hover { color: var(--violet-dark); }

.view-tab.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 4px 14px rgba(58,43,138,.10);
}

.plan-count {
  display: grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  padding: 0 5px;
  color: #413590;
  border-radius: 999px;
  background: #e8e4ff;
  font-size: .67rem;
}

.plan-shortcut {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  min-height: 38px;
  padding: 8px 13px;
  color: #4c4380;
  border: 1px solid #e3e0f2;
  border-radius: 12px;
  background: rgba(255,255,255,.78);
  font-size: .74rem;
  font-weight: 680;
}

.plan-shortcut svg { width: 17px; height: 17px; color: var(--violet); }

.overline {
  display: block;
  color: var(--accent, var(--violet));
  font-size: .68rem;
  font-weight: 820;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: center;
  gap: 60px;
  max-width: 1240px;
  min-height: 300px;
  margin: 0 auto 62px;
}

.landing-hero h1,
.plan-hero h1 {
  margin: 11px 0 18px;
  max-width: 980px;
  font-size: clamp(3.15rem, 5.7vw, 6.5rem);
  font-weight: 690;
  letter-spacing: -.075em;
  line-height: .94;
}

.landing-hero h1 span {
  color: transparent;
  background: linear-gradient(92deg, #6b56ef, #d84fc1 52%, #fa6c75);
  background-clip: text;
  -webkit-background-clip: text;
}

.landing-hero p,
.plan-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.03rem;
}

.hero-orbit {
  position: relative;
  width: 220px;
  height: 220px;
  justify-self: end;
  border: 1px solid rgba(112,92,246,.17);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.86) 0 35%, rgba(255,255,255,.15) 36% 100%);
  box-shadow: inset 0 0 0 35px rgba(255,255,255,.20);
}

.hero-orbit::before {
  content: "";
  position: absolute;
  inset: 38px;
  border: 1px dashed rgba(112,92,246,.18);
  border-radius: 50%;
}

.orbit-core {
  position: absolute;
  inset: 50%;
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  color: white;
  border-radius: 25px;
  background: linear-gradient(145deg, #755ff6, #b04fe4 55%, #f4519e);
  box-shadow: 0 20px 42px rgba(111,72,220,.28);
  transform: translate(-50%, -50%) rotate(-5deg);
}

.orbit-core svg { width: 34px; height: 34px; }

.orbit-dot {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 5px solid white;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(53,40,114,.15);
}

.orbit-one { top: 16px; left: 66px; background: var(--cyan); }
.orbit-two { top: 74px; right: 4px; width: 24px; height: 24px; background: var(--coral); }
.orbit-three { right: 48px; bottom: 12px; background: var(--amber); }
.orbit-four { left: 5px; bottom: 62px; width: 22px; height: 22px; background: var(--pink); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin: 0 0 23px;
}

.section-heading h2,
.composition-strip h2,
.panel-heading h2 {
  margin: 5px 0 0;
  font-size: clamp(1.45rem, 2vw, 2rem);
  letter-spacing: -.045em;
}

.section-heading p {
  max-width: 420px;
  margin: 0;
  color: var(--ink-soft);
  font-size: .85rem;
  text-align: right;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.module-card {
  --accent: #705cf6;
  --accent-dark: #4d3dcc;
  --accent-soft: #efedff;
  position: relative;
  display: flex;
  min-height: 310px;
  padding: 23px 21px 20px;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, white 0 58%, var(--accent-soft) 100%);
  box-shadow: var(--shadow-soft);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.module-card::after {
  content: "";
  position: absolute;
  right: -62px;
  bottom: -78px;
  width: 170px;
  height: 170px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 50%;
}

.module-card:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow: 0 24px 65px color-mix(in srgb, var(--accent) 16%, transparent);
  transform: translateY(-4px);
}

.module-card[data-module="plan"] {
  color: white;
  border: 0;
  background:
    radial-gradient(circle at 92% 8%, rgba(80,225,247,.35), transparent 10rem),
    radial-gradient(circle at 5% 96%, rgba(247,77,159,.22), transparent 12rem),
    linear-gradient(145deg, #6856e8, #493fc5 58%, #344bc0);
}

.module-card[data-module="plan"]::after { border-color: rgba(255,255,255,.18); }
.module-card[data-module="plan"] .module-card-kicker,
.module-card[data-module="plan"] p { color: rgba(255,255,255,.76); }
.module-card[data-module="plan"] .module-card-icon { color: #4539ae; background: var(--lime); }
.module-card[data-module="plan"] .card-link { color: white; }
.module-card[data-module="plan"] .card-link svg { color: var(--lime); }

.module-card-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 25px;
}

.module-card-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--accent-dark);
  border-radius: 15px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}

.module-card-icon svg { width: 23px; height: 23px; }

.link-toggle {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding: 5px 8px;
  color: var(--ink-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 17%, var(--line));
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  font-size: .65rem;
  font-weight: 760;
}

.link-toggle svg { width: 13px; height: 13px; }

.link-toggle.connected {
  color: var(--accent-dark);
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  background: var(--accent-soft);
}

.module-card-body { position: relative; z-index: 1; }

.module-card-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--accent-dark);
  font-size: .65rem;
  font-weight: 790;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.module-card h3 {
  margin: 0 0 9px;
  font-size: 1.23rem;
  letter-spacing: -.038em;
  line-height: 1.08;
}

.module-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .77rem;
  line-height: 1.45;
}

.card-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding: 18px 0 0;
  color: var(--accent-dark);
  border: 0;
  background: transparent;
  font-size: .72rem;
  font-weight: 790;
  text-align: left;
}

.card-link svg { width: 16px; height: 16px; transition: transform .18s ease; }
.module-card:hover .card-link svg { transform: translateX(3px); }

.composition-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-top: 18px;
  padding: 25px 28px;
  border: 1px solid #e4e0f3;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.72);
  box-shadow: 0 18px 50px rgba(57,44,122,.07);
}

.composition-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: #5543d0;
  border-radius: 16px;
  background: linear-gradient(145deg, #e8fbff, #eeeaff);
}

.composition-icon svg { width: 25px; height: 25px; }
.composition-strip h2 { font-size: 1.12rem; }
.composition-strip p { margin: 4px 0 0; color: var(--ink-soft); font-size: .77rem; }

.primary-button,
.secondary-button,
.back-button,
.inline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 10px 15px;
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 760;
}

.primary-button {
  color: white;
  border: 0;
  background: var(--accent, var(--violet));
  box-shadow: 0 10px 25px color-mix(in srgb, var(--accent, var(--violet)) 25%, transparent);
}

.primary-button:hover { filter: brightness(.97); transform: translateY(-1px); }
.primary-button svg { width: 16px; height: 16px; }

.secondary-button,
.back-button,
.inline-button {
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: white;
}

.secondary-button:hover,
.back-button:hover,
.inline-button:hover { color: var(--accent-dark); border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); }

.back-button {
  margin: -12px 0 24px;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
}

.full-button { width: 100%; }

/* Module workspace */
.module-shell[data-theme="budget"] { --accent: #9eea35; --accent-dark: #315f12; --accent-soft: #f1ffd9; --accent-fade: #dcff9d; --accent-contrast: #183706; }
.module-shell[data-theme="investing"] { --accent: #705cf6; --accent-dark: #4d3dcc; --accent-soft: #efedff; --accent-fade: #d8d2ff; }
.module-shell[data-theme="safety"] { --accent: #10b7d5; --accent-dark: #087d9b; --accent-soft: #e5faff; --accent-fade: #c0f3fb; }
.module-shell[data-theme="debt"] { --accent: #ff705f; --accent-dark: #c4453b; --accent-soft: #fff0ed; --accent-fade: #ffd5cf; }
.module-shell[data-theme="goal"] { --accent: #ef4c9f; --accent-dark: #b92872; --accent-soft: #ffeaf5; --accent-fade: #ffcce5; }
.module-shell[data-theme="events"] { --accent: #eea127; --accent-dark: #a86806; --accent-soft: #fff5df; --accent-fade: #ffe3a7; }

.module-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
  margin-bottom: 24px;
}

.module-identity {
  display: flex;
  align-items: center;
  gap: 17px;
}

.module-large-icon {
  display: grid;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  place-items: center;
  color: var(--accent-dark);
  border-radius: 20px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}

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

.module-intro h1 {
  margin: 4px 0 5px;
  font-size: clamp(2rem, 3.4vw, 3.4rem);
  letter-spacing: -.06em;
  line-height: 1;
}

.module-intro p { max-width: 760px; margin: 0; color: var(--ink-soft); font-size: .88rem; }
.module-intro .funding-control-note {
  max-width: 720px;
  margin-top: 8px;
  padding: 8px 10px;
  color: var(--accent-dark);
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: .69rem;
}
.funding-control-note strong { font-weight: 800; }

.connect-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 9px 14px;
  color: var(--accent-dark);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 13px;
  background: var(--accent-soft);
  font-size: .73rem;
  font-weight: 780;
}

.connect-button svg { width: 16px; height: 16px; }
.connect-button.connected { color: white; background: var(--accent); border-color: var(--accent); }

.module-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.input-panel,
.module-result-panel,
.plan-builder,
.plan-results {
  border-radius: var(--radius-xl);
  background: white;
  box-shadow: var(--shadow-soft);
}

.input-panel {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--line));
}

.panel-heading { padding: 24px 24px 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 1.15rem; }
.panel-heading p { margin: 5px 0 0; color: var(--ink-soft); font-size: .74rem; }

.form-section { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }

.form-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  font-size: .8rem;
  font-weight: 780;
}

.form-section-title span:last-child:not(:first-child) { color: var(--ink-faint); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.field-grid .wide { grid-column: 1 / -1; }

.field {
  display: block;
  color: var(--ink-soft);
  font-size: .7rem;
  font-weight: 690;
}

.input-wrap {
  position: relative;
  display: block;
  margin-top: 6px;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--ink);
  border: 1px solid #dedbea;
  border-radius: 11px;
  background: #fbfaff;
  font-size: .87rem;
  font-weight: 650;
}

.field select { appearance: auto; }
.field input:focus,
.field select:focus { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 12%, transparent); }

.input-wrap.prefix input { padding-left: 26px; }
.input-wrap.suffix input { padding-right: 31px; }
.input-prefix,
.input-suffix {
  position: absolute;
  top: 50%;
  z-index: 1;
  color: var(--ink-faint);
  font-size: .72rem;
  font-weight: 700;
  transform: translateY(-50%);
  pointer-events: none;
}
.input-prefix { left: 11px; }
.input-suffix { right: 11px; }

.choice-label { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: .66rem; font-weight: 720; }

.segmented {
  display: grid;
  grid-template-columns: repeat(var(--segments, 2), minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid #e2dfec;
  border-radius: 12px;
  background: #f1eff8;
}

.segment {
  min-height: 36px;
  padding: 7px 5px;
  color: var(--ink-soft);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: .67rem;
  font-weight: 760;
}

.segment:hover { color: var(--accent-dark); }
.segment.active { color: var(--accent-dark); background: white; box-shadow: 0 3px 10px rgba(57,43,130,.10); }

.choice-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.choice-button {
  min-height: 54px;
  padding: 9px 10px;
  color: var(--ink-soft);
  border: 1px solid #e0ddec;
  border-radius: 12px;
  background: #fbfaff;
  text-align: left;
}
.choice-button strong { display: block; color: var(--ink); font-size: .72rem; }
.choice-button span { display: block; margin-top: 2px; font-size: .62rem; }
.choice-button.active { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 10%, transparent); }
.choice-button.active strong { color: var(--accent-dark); }

.range-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.range-row span { color: var(--ink-soft); font-size: .68rem; font-weight: 700; }
.range-row strong { color: var(--accent-dark); font-size: .86rem; }
.form-range { width: 100%; accent-color: var(--accent); }
.range-ends { display: flex; justify-content: space-between; color: var(--ink-faint); font-size: .61rem; }

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink-soft);
  font-size: .69rem;
  line-height: 1.35;
}
.form-check input { flex: 0 0 auto; margin-top: 2px; accent-color: var(--accent); }

.form-note {
  margin: 10px 0 0;
  padding: 9px 10px;
  color: var(--ink-soft);
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: .64rem;
  line-height: 1.4;
}

.assumptions { border-bottom: 1px solid var(--line); }
.assumptions summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 24px;
  color: var(--ink-soft);
  list-style: none;
  font-size: .71rem;
  font-weight: 740;
}
.assumptions summary::-webkit-details-marker { display: none; }
.assumptions summary::after { content: "+"; color: var(--accent); font-size: 1rem; }
.assumptions[open] summary::after { content: "−"; }
.assumption-body { padding: 0 24px 20px; }

.module-result-panel {
  position: relative;
  min-height: 650px;
  padding: 30px 31px 27px;
  overflow: hidden;
  color: white;
  border: 0;
  background:
    radial-gradient(circle at 96% 0%, color-mix(in srgb, var(--accent-fade) 55%, transparent), transparent 25rem),
    radial-gradient(circle at 2% 98%, rgba(255,255,255,.10), transparent 25rem),
    linear-gradient(145deg, var(--accent) 0%, var(--accent-dark) 66%, color-mix(in srgb, var(--accent-dark) 82%, #20206a) 100%);
  box-shadow: 0 28px 74px color-mix(in srgb, var(--accent) 25%, transparent);
}

.module-result-panel::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: 130px;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  pointer-events: none;
}

.module-result-panel > * { position: relative; z-index: 1; }

.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.result-heading .overline { color: color-mix(in srgb, var(--accent-soft) 70%, white); }
.result-heading h2 { margin: 5px 0 3px; color: white; font-size: 1.12rem; letter-spacing: -.03em; }
.result-heading p { margin: 0; color: rgba(255,255,255,.76); font-size: .7rem; }

.simulation-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  color: var(--accent-dark);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 90%, white);
  font-size: .63rem;
  font-weight: 790;
  white-space: nowrap;
}
.simulation-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.hero-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 26px;
  min-height: 178px;
  padding: 25px 0 21px;
}

.hero-result-label { color: rgba(255,255,255,.76); font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.hero-result-value { display: block; margin-top: 5px; color: white; font-size: clamp(3.3rem, 6vw, 5.7rem); font-weight: 620; letter-spacing: -.075em; line-height: .95; }
.hero-result-sub { display: block; margin-top: 9px; color: rgba(255,255,255,.76); font-size: .69rem; }

.probability-ring {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--lime) calc(var(--value, 0) * 1%), rgba(255,255,255,.18) 0);
  transform: rotate(-90deg);
}
.probability-ring-inner {
  display: grid;
  width: 87px;
  height: 87px;
  place-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-dark) 86%, #28215f);
  text-align: center;
  transform: rotate(90deg);
}
.probability-ring strong { color: white; font-size: 1.35rem; line-height: 1; }
.probability-ring span { margin-top: 4px; color: rgba(255,255,255,.72); font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; }

.result-metrics {
  display: grid;
  grid-template-columns: repeat(var(--metric-count, 3), minmax(0, 1fr));
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,.12);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.result-metric { padding: 0 17px; border-left: 1px solid rgba(255,255,255,.11); }
.result-metric:first-child { padding-left: 0; border-left: 0; }
.result-metric:last-child { padding-right: 0; }
.result-metric span { display: block; color: rgba(255,255,255,.72); font-size: .61rem; letter-spacing: .07em; text-transform: uppercase; }
.result-metric strong { display: block; margin-top: 5px; color: white; font-size: 1.15rem; font-weight: 620; letter-spacing: -.025em; }
.result-metric small { display: block; margin-top: 3px; color: rgba(255,255,255,.67); font-size: .61rem; }

.chart-block { margin-top: 20px; }
.chart-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 4px; }
.chart-title strong { color: white; font-size: .72rem; }
.chart-legend { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.72); font-size: .61rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 10px; height: 3px; border-radius: 999px; background: var(--lime); }
.chart-legend .range i { height: 7px; background: rgba(133,232,255,.36); }
.chart-host { width: 100%; min-height: 250px; }
.chart-host svg { display: block; width: 100%; height: auto; overflow: visible; }

.insight-card {
  margin-top: 16px;
  padding: 16px 17px;
  color: #2c2750;
  border-radius: 14px;
  background: linear-gradient(120deg, #efffcf, #dfffe5);
  box-shadow: 0 13px 31px rgba(38,28,120,.13);
}
.insight-card span { color: #5a4bc2; font-size: .6rem; font-weight: 820; letter-spacing: .12em; text-transform: uppercase; }
.insight-card h3 { margin: 5px 0 4px; font-size: 1.02rem; letter-spacing: -.03em; line-height: 1.18; }
.insight-card p { margin: 0; color: #625d79; font-size: .68rem; }

.meter-block { margin: 25px 0 21px; }
.meter-labels { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 7px; color: rgba(255,255,255,.76); font-size: .64rem; }
.meter-track { height: 11px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.17); }
.meter-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #90eeff, var(--lime)); transition: width .25s ease; }

.comparison-bars { display: grid; gap: 13px; margin-top: 22px; }
.comparison-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 90px; align-items: center; gap: 10px; }
.comparison-row > span { color: rgba(255,255,255,.75); font-size: .66rem; }
.comparison-row > strong { color: white; font-size: .76rem; text-align: right; }
.comparison-row > strong small { display: block; margin-top: 2px; color: rgba(255,255,255,.62); font-size: .55rem; font-weight: 500; }
.comparison-track { height: 10px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.16); }
.comparison-fill { height: 100%; border-radius: inherit; background: var(--lime); }
.comparison-row.secondary .comparison-fill { background: #8ceaff; }

.module-learning {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.learning-card {
  padding: 17px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--line));
  border-radius: 16px;
  background: rgba(255,255,255,.80);
}
.learning-card .overline { font-size: .58rem; }
.learning-card h3 { margin: 5px 0 5px; font-size: .84rem; letter-spacing: -.02em; }
.learning-card p { margin: 0; color: var(--ink-soft); font-size: .66rem; line-height: 1.48; }
.learning-card details { margin-top: 9px; }
.learning-card summary { color: var(--accent-dark); font-size: .63rem; font-weight: 760; }
.learning-card details p { margin-top: 7px; }
.learning-card a { color: var(--accent-dark); font-weight: 700; }

/* Life plan */
.plan-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin: 0 0 26px;
}
.plan-hero h1 { margin-bottom: 11px; font-size: clamp(2.8rem, 4.8vw, 5.5rem); }
.plan-status { flex: 0 0 auto; padding-bottom: 8px; color: var(--ink-soft); font-size: .75rem; }

.plan-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); align-items: start; gap: 16px; }
.plan-builder { overflow: hidden; border: 1px solid #e4e1ef; }
.plan-module-list { display: grid; gap: 1px; padding: 10px 15px 15px; }
.plan-module-row {
  --row-accent: var(--violet);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 7px;
  border-bottom: 1px solid #efedf5;
}
.plan-module-row:last-child { border-bottom: 0; }
.plan-row-icon { display: grid; width: 34px; height: 34px; place-items: center; color: var(--row-accent); border-radius: 10px; background: color-mix(in srgb, var(--row-accent) 10%, white); }
.plan-row-icon svg { width: 18px; height: 18px; }
.plan-row-open { min-width: 0; padding: 5px 0; border: 0; background: transparent; text-align: left; }
.plan-row-open:hover strong { color: var(--row-accent); }
.plan-module-row strong { display: block; font-size: .72rem; }
.plan-module-row span { display: block; margin-top: 2px; color: var(--ink-faint); font-size: .61rem; }
.mini-switch { position: relative; width: 38px; height: 23px; }
.mini-switch input { position: absolute; opacity: 0; }
.mini-switch i { position: absolute; inset: 0; border-radius: 999px; background: #ddd9e8; transition: .18s; }
.mini-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(39,31,86,.18); transition: .18s; }
.mini-switch input:checked + i { background: var(--row-accent); }
.mini-switch input:checked + i::after { transform: translateX(15px); }
.plan-builder > .full-button { width: calc(100% - 30px); margin: 0 15px 17px; }

.plan-results {
  min-height: 675px;
  padding: 30px 31px 27px;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 94% 0%, rgba(58,219,240,.34), transparent 24rem),
    radial-gradient(circle at 2% 100%, rgba(242,75,159,.19), transparent 27rem),
    linear-gradient(145deg, #6b59ec 0%, #4c43cc 54%, #344bbd 100%);
  box-shadow: 0 28px 75px rgba(70,54,190,.25);
}
.plan-results .overline { color: var(--lime); }

.plan-empty {
  display: grid;
  min-height: 610px;
  place-content: center;
  text-align: center;
}
.plan-empty-icon { display: grid; width: 66px; height: 66px; margin: 0 auto 17px; place-items: center; color: #5145c4; border-radius: 21px; background: var(--lime); }
.plan-empty-icon svg { width: 32px; height: 32px; }
.plan-empty h2 { margin: 0 0 7px; color: white; font-size: 1.4rem; }
.plan-empty p { max-width: 420px; margin: 0 auto 17px; color: rgba(255,255,255,.74); font-size: .76rem; }

.plan-result-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.plan-result-top h2 { margin: 5px 0 3px; color: white; font-size: 1.12rem; }
.plan-result-top p { margin: 0; color: rgba(255,255,255,.74); font-size: .68rem; }
.plan-summary { display: grid; grid-template-columns: minmax(0, 1fr) 160px; align-items: center; gap: 26px; min-height: 195px; padding: 24px 0 20px; }
.plan-summary-value { display: block; margin: 4px 0 8px; color: white; font-size: clamp(3.5rem, 6vw, 6rem); font-weight: 610; letter-spacing: -.075em; line-height: .95; }
.plan-summary-label { color: rgba(255,255,255,.74); font-size: .67rem; text-transform: uppercase; letter-spacing: .08em; }
.plan-delta { color: #d8ffa0; font-size: .68rem; }

.plan-health {
  display: grid;
  width: 144px;
  height: 144px;
  place-content: center;
  border: 13px solid rgba(255,255,255,.14);
  border-top-color: var(--lime);
  border-right-color: #7decff;
  border-radius: 50%;
  text-align: center;
  transform: rotate(-8deg);
}
.plan-health > * { transform: rotate(8deg); }
.plan-health strong { color: white; font-size: 1.55rem; letter-spacing: -.04em; }
.plan-health span { color: rgba(255,255,255,.70); font-size: .58rem; text-transform: uppercase; letter-spacing: .08em; }

.timeline-events { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 2px; }
.timeline-event { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; color: rgba(255,255,255,.83); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.08); font-size: .61rem; }
.timeline-event i { width: 7px; height: 7px; border-radius: 50%; background: var(--event-color, var(--lime)); }

.plan-insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
.plan-insight { padding: 13px 14px; border-radius: 13px; background: rgba(255,255,255,.10); }
.plan-insight span { display: block; color: rgba(255,255,255,.66); font-size: .58rem; letter-spacing: .07em; text-transform: uppercase; }
.plan-insight strong { display: block; margin-top: 5px; color: white; font-size: .85rem; font-weight: 620; }
.plan-insight small { display: block; margin-top: 3px; color: rgba(255,255,255,.65); font-size: .58rem; }

.plan-guidance { margin-top: 15px; padding: 15px 16px; color: #2e2953; border-radius: 14px; background: linear-gradient(120deg, #edffc6, #dbffe3); }
.plan-guidance span { color: #5c4bc4; font-size: .58rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.plan-guidance h3 { margin: 4px 0 4px; font-size: .94rem; }
.plan-guidance p { margin: 0; color: #625c7a; font-size: .65rem; }

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 23px;
  padding: 0 4px;
  color: var(--ink-faint);
  font-size: .64rem;
}
footer div { display: inline-flex; align-items: center; gap: 6px; }
footer svg { width: 15px; height: 15px; }
footer button { padding: 4px; color: var(--ink-faint); border: 0; background: transparent; font-size: .62rem; text-decoration: underline; }

@media (max-width: 1280px) {
  .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .module-card { min-height: 255px; }
}

@media (max-width: 980px) {
  .app-shell { width: min(100% - 30px, 820px); }
  .topbar { margin-bottom: 37px; }
  .landing-hero { grid-template-columns: minmax(0, 1fr) 180px; min-height: 250px; gap: 30px; }
  .hero-orbit { width: 170px; height: 170px; }
  .orbit-core { width: 62px; height: 62px; border-radius: 21px; }
  .module-workspace,
  .plan-layout { grid-template-columns: 1fr; }
  .input-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .input-panel > .panel-heading { grid-column: 1 / -1; }
  .input-panel > .assumptions { grid-column: 1 / -1; }
  .form-section { border-right: 1px solid var(--line); }
  .module-result-panel { min-height: 620px; }
  .plan-builder { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
  .plan-builder .panel-heading { border-right: 1px solid var(--line); border-bottom: 0; }
  .plan-module-list { grid-template-columns: 1fr 1fr; }
  .plan-builder > .full-button { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .app-shell { width: min(100% - 20px, 620px); padding-top: 14px; }
  .topbar { grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 36px; }
  .view-tabs { display: none; }
  .plan-shortcut span { display: none; }
  .plan-shortcut { width: 39px; padding: 0; justify-content: center; }
  .landing-hero { display: block; min-height: auto; margin-bottom: 48px; }
  .landing-hero h1 { font-size: clamp(2.75rem, 13vw, 4.4rem); }
  .landing-hero p { font-size: .9rem; }
  .hero-orbit { display: none; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .section-heading p { text-align: left; }
  .module-grid { grid-template-columns: 1fr 1fr; }
  .module-card { min-height: 260px; }
  .composition-strip { grid-template-columns: auto minmax(0, 1fr); padding: 20px; }
  .composition-strip .primary-button { grid-column: 1 / -1; }
  .module-intro { align-items: flex-start; grid-template-columns: 1fr; gap: 15px; }
  .module-identity { align-items: flex-start; }
  .module-intro h1 { font-size: 2.15rem; }
  .module-workspace { display: block; }
  .input-panel { display: block; margin-bottom: 13px; }
  .form-section { border-right: 0; }
  .module-result-panel { min-height: 0; padding: 24px 20px; border-radius: 23px; }
  .hero-result { grid-template-columns: minmax(0, 1fr) auto; }
  .hero-result-value { font-size: clamp(2.8rem, 14vw, 4.2rem); }
  .module-learning { grid-template-columns: 1fr; }
  .plan-hero { align-items: flex-start; flex-direction: column; gap: 10px; }
  .plan-hero h1 { font-size: 3rem; }
  .plan-status { padding: 0; }
  .plan-builder { display: block; }
  .plan-builder .panel-heading { border-right: 0; border-bottom: 1px solid var(--line); }
  .plan-module-list { grid-template-columns: 1fr; }
  .plan-results { padding: 24px 20px; border-radius: 23px; }
  .plan-summary { grid-template-columns: minmax(0, 1fr) 120px; }
  .plan-health { width: 112px; height: 112px; border-width: 10px; }
  .plan-insights { grid-template-columns: 1fr 1fr; }
  footer { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (max-width: 470px) {
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 230px; }
  .module-card-top { margin-bottom: 18px; }
  .composition-icon { display: none; }
  .composition-strip { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .wide { grid-column: auto; }
  .choice-stack { grid-template-columns: 1fr; }
  .module-large-icon { width: 52px; height: 52px; border-radius: 17px; }
  .module-large-icon svg { width: 26px; height: 26px; }
  .result-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .hero-result { grid-template-columns: 1fr; gap: 16px; }
  .probability-ring { width: 92px; height: 92px; }
  .probability-ring-inner { width: 70px; height: 70px; }
  .result-metrics { grid-template-columns: 1fr 1fr; row-gap: 15px; }
  .result-metric { padding: 0 10px; }
  .result-metric:nth-child(3) { padding: 13px 0 0; grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.11); border-left: 0; }
  .chart-title { align-items: flex-start; flex-direction: column; }
  .comparison-row { grid-template-columns: 82px minmax(0, 1fr); }
  .comparison-row > strong { grid-column: 2; text-align: left; }
  .plan-summary { grid-template-columns: 1fr; }
  .plan-insights { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Compact module control deck */
.app-shell {
  width: min(1440px, calc(100% - 44px));
  padding-top: 16px;
}

.topbar {
  display: flex;
  min-height: 42px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  justify-content: space-between;
  border-bottom: 1px solid rgba(112, 92, 246, .11);
}

.topbar-note {
  margin: 0;
  color: var(--ink-faint);
  font-size: .76rem;
  font-weight: 680;
}

.control-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 14px;
}

.control-heading h1 {
  margin: 0 0 3px;
  font-size: clamp(1.75rem, 2.5vw, 2.45rem);
  letter-spacing: -.055em;
  line-height: 1;
}

.control-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .82rem;
}

.active-summary {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 12px;
  color: var(--violet-dark);
  border: 1px solid #dfdbf4;
  border-radius: 12px;
  background: rgba(255, 255, 255, .82);
}

.active-summary strong { font-size: 1.15rem; line-height: 1; }
.active-summary span { color: var(--ink-soft); font-size: .7rem; font-weight: 730; text-transform: uppercase; letter-spacing: .08em; }

.module-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.module-card {
  aspect-ratio: 2.55 / 1;
  min-height: 0;
  padding: 15px;
  border-radius: 18px;
  box-shadow: 0 13px 34px rgba(55, 43, 125, .08);
}

.module-card.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 15px 38px color-mix(in srgb, var(--accent) 14%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent);
}

.module-card:hover { transform: translateY(-2px); }

.module-card-top {
  margin-bottom: 11px;
  align-items: center;
}

.module-card-icon {
  width: 41px;
  height: 41px;
  border-radius: 13px;
}

.module-card-icon svg { width: 21px; height: 21px; }

.module-switch {
  position: relative;
  z-index: 4;
  width: 42px;
  height: 25px;
}

.mini-switch i { pointer-events: none; }
.module-switch i::after { width: 19px; height: 19px; }
.module-switch input:checked + i,
.module-state .mini-switch input:checked + i { background: var(--accent); }
.module-switch input:checked + i::after { transform: translateX(17px); }

.module-open {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  flex: 1;
  padding: 0;
  flex-direction: column;
  align-items: flex-start;
  color: inherit;
  border: 0;
  background: transparent;
  text-align: left;
}

.module-research-link {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 25px;
  padding: 4px 7px;
  color: var(--accent-dark);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, white 88%, var(--accent-soft));
  box-shadow: 0 4px 12px rgba(45,36,96,.07);
  font-size: .58rem;
  font-weight: 790;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.module-research-link svg { width: 12px; height: 12px; }
.module-research-link:hover,
.module-research-link:focus-visible {
  border-color: var(--accent);
  background: white;
  outline: 0;
  transform: translateY(-2px);
}
.module-card:not([data-module="plan"]) .module-open-label { padding-right: 78px; }

.module-card-kicker {
  margin-bottom: 4px;
  font-size: .61rem;
}

.module-card-title {
  display: block;
  margin-bottom: 6px;
  font-size: 1.14rem;
  letter-spacing: -.035em;
  line-height: 1.05;
}

.module-card-question {
  display: block;
  color: var(--ink-soft);
  font-size: .75rem;
  line-height: 1.32;
}

.module-open-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 8px;
  color: var(--accent-dark);
  font-size: .68rem;
  font-weight: 790;
}

.module-open-label svg { width: 14px; height: 14px; transition: transform .18s ease; }
.module-card:hover .module-open-label svg { transform: translateX(2px); }

.combine-count {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, .78);
  font-size: .66rem;
  font-weight: 760;
}

.module-card[data-module="plan"] .module-card-title,
.module-card[data-module="plan"] .module-open-label { color: white; }
.module-card[data-module="plan"] .module-card-question { color: rgba(255, 255, 255, .76); }
.module-card[data-module="plan"] .module-open-label svg { color: var(--lime); }

.connected-plan-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  min-height: 82px;
  aspect-ratio: auto;
  align-items: center;
  gap: 15px;
  padding: 13px 16px;
}

.connected-plan-card > .module-card-icon { flex: 0 0 auto; }
.connected-plan-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 28px;
}
.connected-plan-copy { display: block; min-width: 0; }
.connected-plan-copy .module-card-kicker { margin-bottom: 1px; }
.connected-plan-copy .module-card-title { display: inline; margin: 0 9px 0 0; }
.connected-plan-copy .module-card-question { display: inline; }
.connected-plan-open .module-open-label { margin: 0; padding: 0 0 0 24px; border-left: 1px solid rgba(255,255,255,.22); white-space: nowrap; }

.result-stage {
  scroll-margin-top: 12px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(112, 92, 246, .12);
}

.result-empty {
  display: grid;
  min-height: 360px;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.result-empty .module-large-icon { color: var(--violet-dark); background: #efedff; }
.result-empty h2 { margin: 14px 0 5px; font-size: 1.45rem; letter-spacing: -.04em; }
.result-empty p { margin: 0; color: var(--ink-soft); font-size: .8rem; }

.module-intro {
  align-items: center;
  margin-bottom: 18px;
}

.module-intro h1 { font-size: clamp(1.8rem, 2.5vw, 2.65rem); }

.module-state {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px 9px 13px;
  color: var(--accent-dark);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 13px;
  background: var(--accent-soft);
  font-size: .72rem;
  font-weight: 780;
  cursor: pointer;
}

.module-state > .mini-switch { flex: 0 0 auto; }

.combined-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 15px;
}

.combined-heading :is(h1, h2) {
  margin: 4px 0 0;
  font-size: clamp(1.6rem, 2.4vw, 2.35rem);
  letter-spacing: -.05em;
}

.plan-results {
  min-height: 0;
  padding: 24px;
}

.combined-heading { align-items: center; margin-bottom: 12px; }
.combined-heading :is(h1, h2) { font-size: clamp(1.45rem, 2vw, 2rem); }
.plan-status { max-width: 48%; padding: 0; text-align: right; }

.plan-dashboard {
  display: grid;
  grid-template-columns: minmax(300px, .72fr) minmax(0, 1.78fr);
  align-items: stretch;
  gap: 14px;
  margin-top: 17px;
}

.plan-kpi-panel,
.plan-chart-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 17px;
  background: rgba(255,255,255,.075);
}

.plan-primary-kpi {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.plan-primary-kpi .plan-summary-value {
  margin: 5px 0 0;
  font-size: clamp(2.5rem, 3.6vw, 3.5rem);
  line-height: .96;
}

.compact-ring { width: 78px; height: 78px; }
.compact-ring .probability-ring-inner { width: 60px; height: 60px; }
.compact-ring strong { font-size: 1rem; }
.compact-ring span { max-width: 52px; margin-inline: auto; font-size: .43rem; line-height: 1.2; }

.plan-kpi-note {
  min-height: 32px;
  margin: 11px 0 7px;
  color: #d8ffa0;
  font-size: .66rem;
  line-height: 1.4;
}

.plan-key-metrics { display: grid; }
.plan-key-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,.11);
  transition: padding .16s ease, background .16s ease;
}
.plan-key-metric:hover,
.plan-key-metric:focus-visible { padding-inline: 8px; background: rgba(255,255,255,.07); outline: 0; }
.plan-key-metric span { color: rgba(255,255,255,.72); font-size: .62rem; letter-spacing: .045em; text-transform: uppercase; }
.plan-key-metric strong { color: white; font-size: .9rem; font-weight: 680; text-align: right; }

.plan-chart-panel { padding-bottom: 10px; }
.plan-chart-panel .chart-title { margin-bottom: 0; }
.plan-chart-panel .chart-title strong { font-size: .76rem; }
.plan-chart-panel .chart-legend { font-size: .63rem; }
.chart-interaction-hint { margin: 4px 0 2px; color: rgba(255,255,255,.65); font-size: .6rem; }
.compact-events { margin: 8px 0 0; }
.compact-events .timeline-event { padding: 5px 8px; font-size: .58rem; }
.compact-chart { min-height: 0; margin-top: 2px; }
.compact-chart svg { width: 100%; height: auto; }

.interactive-fan-chart .fan-median { pointer-events: none; }
.interactive-fan-chart .fan-range,
.interactive-fan-chart .chart-hover-zone,
.interactive-fan-chart .chart-event-marker { cursor: help; }
.interactive-fan-chart .chart-hover-line,
.interactive-fan-chart .chart-hover-point { opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.interactive-fan-chart .chart-hover-zone:hover .chart-hover-line,
.interactive-fan-chart .chart-hover-zone:hover .chart-hover-point,
.interactive-fan-chart .chart-hover-zone:focus .chart-hover-line,
.interactive-fan-chart .chart-hover-zone:focus .chart-hover-point { opacity: 1; }
.interactive-fan-chart .chart-event-marker line,
.interactive-fan-chart .chart-event-marker text { transition: opacity .14s ease, filter .14s ease; }
.interactive-fan-chart .chart-event-marker:hover line,
.interactive-fan-chart .chart-event-marker:hover text,
.interactive-fan-chart .chart-event-marker:focus line,
.interactive-fan-chart .chart-event-marker:focus text { opacity: 1; filter: drop-shadow(0 0 4px rgba(255,255,255,.45)); }

[data-tip]:focus-visible { outline: 2px solid #d8ffa0; outline-offset: 3px; }

.hover-tooltip {
  position: fixed;
  z-index: 9999;
  width: max-content;
  max-width: min(300px, calc(100vw - 24px));
  padding: 9px 11px;
  color: #312b57;
  border: 1px solid rgba(83,65,190,.16);
  border-radius: 10px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 12px 35px rgba(31,24,82,.24);
  font-size: .67rem;
  font-weight: 620;
  line-height: 1.42;
  pointer-events: none;
}
.hover-tooltip[hidden] { display: none; }

.plan-comparison-details { margin-top: 13px; }
.plan-comparison-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 13px;
  color: white;
  list-style: none;
  cursor: pointer;
  background: rgba(255,255,255,.075);
}
.plan-comparison-details > summary::-webkit-details-marker { display: none; }
.plan-comparison-details > summary span { display: grid; gap: 2px; }
.plan-comparison-details > summary strong { font-size: .68rem; }
.plan-comparison-details > summary small { color: rgba(255,255,255,.61); font-size: .56rem; }
.plan-comparison-details > summary em { color: #d8ffa0; font-size: .6rem; font-style: normal; font-weight: 760; }
.plan-comparison-details > summary em::after { content: " +"; }
.plan-comparison-details[open] > summary em::after { content: " −"; }
.pattern-table { border-top: 1px solid rgba(255,255,255,.12); }

.timeline-event,
.plan-insight,
.simulation-badge,
.probability-ring,
.plan-primary-kpi { transition: transform .16s ease, background .16s ease; }
.timeline-event:hover,
.plan-insight:hover,
.simulation-badge:hover,
.compact-ring:hover { transform: translateY(-2px); }

@media (max-width: 960px) {
  .plan-dashboard { grid-template-columns: 1fr; }
  .plan-key-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
  .plan-key-metric { display: block; min-height: 60px; padding: 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; }
  .plan-key-metric strong { display: block; margin-top: 5px; text-align: left; }
}

@media (max-width: 700px) {
  .plan-results { padding: 18px 14px; }
  .plan-result-top { align-items: flex-start; flex-direction: column; gap: 9px; }
  .combined-heading { align-items: flex-start; }
  .plan-status { max-width: none; text-align: left; }
  .plan-primary-kpi .plan-summary-value { font-size: 2.65rem; }
  .plan-key-metrics { grid-template-columns: 1fr; }
  .plan-key-metric { display: grid; min-height: 44px; }
  .plan-chart-panel { overflow: hidden; }
  .compact-chart { overflow-x: auto; padding-bottom: 5px; }
  .compact-chart svg { min-width: 620px; }
  .plan-comparison-details > summary { align-items: flex-start; }
}

/* Income & spending */
.module-shell[data-theme="budget"] .module-workspace { grid-template-columns: minmax(330px, 410px) minmax(0, 1fr); }
.module-shell[data-theme="budget"] .module-result-panel {
  min-height: 760px;
  padding: 28px 30px;
  color: #203715;
  border: 1px solid #d5eab5;
  background:
    radial-gradient(circle at 98% 0%, rgba(158, 234, 53, .13), transparent 25rem),
    linear-gradient(150deg, #ffffff 0%, #fbfff5 100%);
  box-shadow: 0 24px 64px rgba(49, 95, 18, .11);
}
.module-shell[data-theme="budget"] .module-result-panel::after { display: none; }
.module-shell[data-theme="budget"] .simulation-badge { color: #315f12; background: #f1ffd9; }
.module-shell[data-theme="budget"] .simulation-badge::before { background: #72bd13; }
.module-shell[data-theme="budget"] .overline { color: #4f930e; }
.budget-field-grid { margin-top: 12px; }
.budget-behavior .assumption-body { padding-top: 4px; }

.phase-editor { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.phase-editor .form-section-title { align-items: center; margin-bottom: 4px; }
.phase-editor .form-section-title button {
  padding: 5px 8px;
  color: var(--accent-dark);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 8px;
  background: var(--accent-soft);
  font-size: .63rem;
  font-weight: 780;
}
.phase-help,
.phase-empty { margin: 0 0 10px; color: var(--ink-soft); font-size: .63rem; }
.phase-row {
  display: grid;
  grid-template-columns: 1.2fr .95fr .68fr .68fr auto;
  align-items: end;
  gap: 6px;
  margin-top: 8px;
}
.phase-row label { color: var(--ink-soft); font-size: .59rem; font-weight: 690; }
.phase-row input {
  width: 100%;
  min-height: 35px;
  margin-top: 4px;
  padding: 6px 7px;
  color: var(--ink);
  border: 1px solid #dedbea;
  border-radius: 8px;
  background: #fbfaff;
  font-size: .7rem;
}
.phase-input { position: relative; display: block; }
.phase-input span { position: absolute; top: 50%; left: 7px; transform: translateY(-35%); color: var(--ink-faint); font-size: .64rem; }
.phase-input input { padding-left: 18px; }
.phase-row > button { min-height: 35px; padding: 6px 7px; color: #9f3d34; border: 1px solid #f3cdc7; border-radius: 8px; background: #fff4f1; font-size: .6rem; }

.budget-result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.budget-result-heading h2 { margin: 4px 0 3px; color: #203715; font-size: 1.12rem; letter-spacing: -.03em; }
.budget-result-heading p { max-width: 600px; margin: 0; color: #64705e; font-size: .69rem; }
.budget-hero-result { display: flex; align-items: baseline; gap: 15px; padding: 18px 0 16px; }
.budget-hero-result strong { color: #315f12; font-size: clamp(2.3rem, 4vw, 4.25rem); font-weight: 660; letter-spacing: -.065em; line-height: .95; }
.budget-hero-result strong small { font-size: .9rem; letter-spacing: -.01em; }
.budget-hero-result > span { color: #68755f; font-size: .68rem; font-weight: 700; }

.budget-metrics {
  display: grid;
  grid-template-columns: .8fr .8fr 1.4fr 1fr 1fr;
  padding: 13px 0;
  border-top: 1px solid #dce8ce;
  border-bottom: 1px solid #dce8ce;
}
.budget-metrics > div { min-width: 0; padding: 0 11px; border-left: 1px solid #e4ecd9; }
.budget-metrics > div:first-child { padding-left: 0; border-left: 0; }
.budget-metrics span { display: block; color: #718067; font-size: .57rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.budget-metrics strong { display: block; margin-top: 4px; color: #315f12; font-size: 1.02rem; }
.budget-metrics small { display: block; margin-top: 2px; color: #829078; font-size: .54rem; line-height: 1.25; }

.budget-visual-block { padding-top: 17px; }
.budget-section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 9px; }
.budget-section-title span { display: block; color: #203715; font-size: .73rem; font-weight: 820; }
.budget-section-title small { display: block; margin-top: 2px; color: #74806d; font-size: .59rem; }
.cashflow-allocation-bar,
.future-allocation-bar { display: flex; width: 100%; height: 13px; overflow: hidden; border-radius: 999px; background: #edf1e7; }
.cashflow-allocation-bar i,
.future-allocation-bar i { display: block; min-width: 0; height: 100%; background: var(--bar-color); border-right: 2px solid white; }
.cashflow-allocation-bar i:last-child,
.future-allocation-bar i:last-child { border-right: 0; }
.cashflow-legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 8px; }
.cashflow-legend span { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 6px; color: #74806d; font-size: .58rem; }
.cashflow-legend span i { width: 7px; height: 7px; border-radius: 50%; background: var(--bar-color); }
.cashflow-legend strong { grid-column: 2; color: #3d5030; font-size: .66rem; }
.budget-chart-legend { display: flex; gap: 13px; color: #74806d; font-size: .58rem; }
.budget-chart-legend span::before { content: ""; display: inline-block; width: 11px; height: 2px; margin-right: 5px; vertical-align: middle; background: currentColor; }
.budget-chart-legend .income { color: #315f12; }
.budget-chart-legend .spending { color: #10a9c4; }
.budget-chart-legend .capacity { color: #705cf6; }
.budget-chart { min-height: 170px; }
.budget-chart svg { display: block; width: 100%; height: auto; }

.budget-tradeoff {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(145px, .8fr) minmax(145px, .8fr) minmax(180px, 1fr);
  align-items: end;
  gap: 10px;
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid #dceabf;
  border-radius: 14px;
  background: #f7ffe9;
}
.budget-tradeoff h3 { margin: 4px 0 0; color: #203715; font-size: .78rem; }
.budget-tradeoff label { color: #64705e; font-size: .58rem; font-weight: 710; }
.budget-tradeoff input { width: 100%; min-height: 35px; margin-top: 5px; padding: 6px 8px; color: #203715; border: 1px solid #cfdfb2; border-radius: 8px; background: white; font-size: .72rem; }
.budget-tradeoff label small { display: block; margin-top: 3px; color: #849078; font-size: .52rem; line-height: 1.2; }
.tradeoff-result span,
.tradeoff-result small { display: block; color: #718067; font-size: .55rem; }
.tradeoff-result strong { display: block; margin: 4px 0 2px; color: #315f12; font-size: 1rem; }

.budget-allocation { margin-top: 13px; padding-top: 15px; border-top: 1px solid #dce8ce; }
.capacity-warning { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 10px 0; padding: 10px 12px; color: #753126; border: 1px solid #fac5bb; border-radius: 11px; background: #fff2ef; }
.capacity-warning strong { font-size: .69rem; }
.capacity-warning span { max-width: 430px; color: #8d5b52; font-size: .57rem; }
.allocation-requests { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.allocation-request,
.allocation-unassigned { min-width: 0; padding: 8px; border: 1px solid #e1e8d8; border-radius: 10px; background: white; }
.allocation-request > span:first-child { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 5px; color: #46573a; font-size: .58rem; font-weight: 760; }
.allocation-request > span:first-child i { width: 7px; height: 7px; border-radius: 50%; background: var(--allocation-color); }
.allocation-request small { grid-column: 2; color: #7a8870; font-size: .5rem; font-weight: 600; }
.allocation-input { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; margin-top: 6px; padding: 0 6px; border: 1px solid #dfe6d8; border-radius: 7px; background: #fbfff7; }
.allocation-input b,
.allocation-input em { color: #87927e; font-size: .55rem; font-style: normal; }
.allocation-input input { width: 100%; min-width: 0; height: 30px; padding: 4px; color: #263a1b; border: 0; outline: 0; background: transparent; font-size: .69rem; font-weight: 710; }
.allocation-request.is-disabled { opacity: .52; }
.allocation-unassigned span { display: block; color: #64705e; font-size: .58rem; font-weight: 760; }
.allocation-unassigned strong { display: block; margin-top: 13px; color: #315f12; font-size: .75rem; }
.allocation-actions { display: flex; align-items: end; gap: 8px; margin-top: 9px; }
.allocation-actions button,
.allocation-actions select { min-height: 34px; padding: 6px 9px; color: #315f12; border: 1px solid #cfe2ad; border-radius: 8px; background: #f7ffe9; font-size: .59rem; font-weight: 760; }
.allocation-actions button[aria-pressed="true"] { color: white; border-color: #558d1d; background: #558d1d; }
.allocation-actions label { display: grid; gap: 3px; color: #718067; font-size: .52rem; }
.allocation-actions button:last-child { margin-left: auto; }

.budget-plan-comparison { margin-top: 19px; overflow: hidden; border: 1px solid rgba(255,255,255,.17); border-radius: 14px; }
.pattern-heading,
.pattern-row { display: grid; grid-template-columns: 1.15fr 1fr 1fr .55fr; align-items: center; gap: 11px; padding: 9px 12px; }
.pattern-heading { color: rgba(255,255,255,.65); background: rgba(255,255,255,.09); font-size: .56rem; text-transform: uppercase; letter-spacing: .06em; }
.pattern-heading strong { color: white; font-size: .59rem; }
.pattern-row { border-top: 1px solid rgba(255,255,255,.11); color: rgba(255,255,255,.72); font-size: .61rem; }
.pattern-row strong { color: white; font-size: .68rem; }
.pattern-row em { color: #c9ff64; font-size: .64rem; font-style: normal; font-weight: 770; }
.plan-summary-value small { margin-left: 7px; font-size: 1rem; letter-spacing: 0; }

@media (max-width: 1180px) {
  .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .module-card { aspect-ratio: 1.35 / 1; }
  .connected-plan-card { aspect-ratio: auto; }
  .module-shell[data-theme="budget"] .module-workspace { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
  .budget-metrics { grid-template-columns: repeat(3, 1fr); row-gap: 12px; }
  .budget-metrics > div:nth-child(4) { padding-left: 0; border-left: 0; }
  .budget-tradeoff { grid-template-columns: 1fr 1fr; }
  .allocation-requests { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .app-shell { width: min(100% - 20px, 620px); padding-top: 12px; }
  .topbar { display: flex; margin-bottom: 14px; }
  .topbar-note { display: none; }
  .control-heading { align-items: flex-start; gap: 14px; }
  .control-heading h1 { font-size: 1.7rem; }
  .control-heading p { max-width: 280px; font-size: .76rem; }
  .active-summary { padding: 7px 10px; }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .module-card { aspect-ratio: 1 / 1; padding: 13px; }
  .connected-plan-card { min-height: 112px; aspect-ratio: auto; }
  .connected-plan-open { grid-template-columns: 1fr auto; gap: 12px; }
  .connected-plan-open .combine-count { display: none; }
  .connected-plan-open .module-open-label { padding-left: 12px; }
  .connected-plan-copy .module-card-title,
  .connected-plan-copy .module-card-question { display: block; }
  .module-card-title { font-size: 1rem; }
  .module-card-question { font-size: .69rem; }
  .module-open-label { font-size: .63rem; }
  .result-stage { margin-top: 17px; padding-top: 17px; }
  .combined-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .module-shell[data-theme="budget"] .module-result-panel { padding: 22px 17px; }
  .budget-result-heading { flex-direction: column; gap: 8px; }
  .budget-hero-result { align-items: flex-start; flex-direction: column; gap: 6px; }
  .budget-metrics { grid-template-columns: 1fr 1fr; }
  .budget-metrics > div { padding: 8px 9px; border-left: 0; }
  .budget-chart-legend { flex-wrap: wrap; }
  .budget-tradeoff { grid-template-columns: 1fr; }
  .cashflow-legend { grid-template-columns: 1fr 1fr; }
  .allocation-requests { grid-template-columns: 1fr 1fr; }
  .allocation-actions { align-items: stretch; flex-direction: column; }
  .allocation-actions button:last-child { margin-left: 0; }
  .phase-row { grid-template-columns: 1fr 1fr; }
  .pattern-heading,
  .pattern-row { grid-template-columns: 1fr 1fr 1fr; }
  .pattern-heading > :last-child,
  .pattern-row > :last-child { display: none; }
}

@media (max-width: 420px) {
  .module-grid { grid-template-columns: 1fr 1fr; }
  .module-card { min-height: 174px; aspect-ratio: auto; }
  .connected-plan-card { min-height: 118px; }
}

/* Detailed cash-flow baseline */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.simple-budget-hidden { display: none; }
.budget-detail-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #d9e9bf;
  border-radius: 14px;
  background: #f7ffe9;
}
.budget-detail-callout strong { display: block; color: #315f12; font-size: .74rem; }
.budget-detail-callout p { margin: 4px 0 0; color: #6c7963; font-size: .61rem; line-height: 1.45; }
.budget-detail-callout button,
.budget-detail-heading button,
.budget-detail-group .form-section-title button,
.history-box button {
  flex: 0 0 auto;
  min-height: 33px;
  padding: 6px 9px;
  color: #315f12;
  border: 1px solid #cfe2ad;
  border-radius: 9px;
  background: white;
  font-size: .59rem;
  font-weight: 780;
}
.budget-detail-system { margin-top: 13px; }
.budget-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 14px; }
.budget-detail-heading h3 { margin: 3px 0; color: var(--ink); font-size: .92rem; }
.budget-detail-heading p { margin: 0; color: var(--ink-soft); font-size: .61rem; line-height: 1.45; }
.budget-detail-group { margin-top: 13px; }
.budget-detail-card { margin-top: 9px; padding: 12px; border: 1px solid #e0e7d5; border-radius: 13px; background: #fbfff6; }
.budget-detail-card-top { display: grid; grid-template-columns: 32px 1fr auto; align-items: end; gap: 8px; }
.budget-detail-card-top .module-card-icon { width: 30px; height: 30px; margin: 0 0 2px; }
.budget-detail-card-top label { color: var(--ink-soft); font-size: .59rem; font-weight: 720; }
.budget-detail-card-top input { width: 100%; min-height: 34px; margin-top: 4px; padding: 6px 8px; color: var(--ink); border: 1px solid #d9dfd1; border-radius: 8px; background: white; font-size: .7rem; }
.budget-detail-card-top button { min-height: 34px; padding: 6px 7px; color: #9f3d34; border: 1px solid #efd1cb; border-radius: 8px; background: #fff6f3; font-size: .56rem; }
.budget-detail-card-top button:disabled { opacity: .4; }
.budget-detail-advanced { margin-top: 10px; border-top: 1px solid #e0e7d5; }
.budget-detail-advanced summary { padding: 10px 0 2px; color: #48652f; font-size: .61rem; font-weight: 780; cursor: pointer; }
.budget-detail-advanced > p,
.history-box p { margin: 5px 0 9px; color: var(--ink-soft); font-size: .57rem; line-height: 1.45; }
.month-pattern,
.history-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
.month-pattern label,
.history-grid label { display: grid; gap: 3px; color: var(--ink-faint); font-size: .51rem; text-align: center; }
.month-pattern input,
.history-grid input { width: 100%; min-width: 0; padding: 5px 2px; color: var(--ink); border: 1px solid #dcdfe6; border-radius: 6px; background: white; font-size: .58rem; text-align: center; }
.history-box { margin-top: 10px; padding: 10px; border-radius: 10px; background: #f4f2ff; }
.history-box > strong { color: #4d3dcc; font-size: .62rem; }
.history-box > div:last-child { display: flex; flex-wrap: wrap; gap: 6px; }

/* Life-events workspace */
.module-shell[data-theme="events"] .module-workspace { grid-template-columns: minmax(390px, 500px) minmax(0, 1fr); }
.module-shell[data-theme="events"] .input-panel { position: relative; padding-bottom: 72px; }
.module-shell[data-theme="events"] .module-result-panel {
  min-height: 680px;
  background:
    radial-gradient(circle at 100% 0%, rgba(238, 161, 39, .22), transparent 27rem),
    linear-gradient(150deg, #342570 0%, #24245f 58%, #183d5c 100%);
}
.event-library { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.event-library-top { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.event-library-top h3 { margin: 3px 0 0; color: var(--ink); font-size: .88rem; }
.event-library-top input { width: 142px; min-height: 34px; padding: 7px 10px; color: var(--ink); border: 1px solid #ddd9e9; border-radius: 9px; background: #fbfaff; font-size: .65rem; }
.event-preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.event-preset { display: flex; min-height: 150px; padding: 11px; flex-direction: column; border: 1px solid #e2deea; border-radius: 12px; background: #fff; }
.event-preset[hidden] { display: none; }
.event-preset > span { color: var(--accent-dark); font-size: .52rem; font-weight: 820; letter-spacing: .08em; text-transform: uppercase; }
.event-preset > strong { margin-top: 4px; color: var(--ink); font-size: .7rem; line-height: 1.25; }
.event-preset p { margin: 5px 0 10px; color: var(--ink-soft); font-size: .56rem; line-height: 1.42; }
.event-preset > div { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.event-preset button,
.reference-use-button {
  min-height: 30px;
  padding: 5px 7px;
  color: var(--accent-dark);
  border: 1px solid #ead7b6;
  border-radius: 8px;
  background: var(--accent-soft);
  font-size: .54rem;
  font-weight: 780;
}
.event-preset .reference-button { color: #4d3dcc; border-color: #ddd6ff; background: #f4f1ff; }
.event-list-empty,
.event-editor-empty { margin-top: 13px; padding: 18px; color: var(--ink-soft); border: 1px dashed #d9d4e5; border-radius: 13px; text-align: center; }
.event-list-empty > span { display: inline-grid; width: 36px; height: 36px; place-items: center; color: var(--accent-dark); border-radius: 10px; background: var(--accent-soft); }
.event-list-empty svg { width: 20px; height: 20px; }
.event-list-empty strong,
.event-editor-empty strong { display: block; margin-top: 7px; color: var(--ink); font-size: .7rem; }
.event-list-empty p,
.event-editor-empty p { margin: 4px 0 0; font-size: .59rem; line-height: 1.45; }
.event-timeline { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.event-timeline-track { position: relative; height: 8px; margin: 5px 1px 12px; overflow: hidden; border-radius: 999px; background: #f0edf5; }
.event-timeline-track i { position: absolute; inset: 3px 0; background: #d8d1e5; }
.event-timeline-track span { position: absolute; top: 1px; height: 6px; border-radius: 999px; background: var(--accent); }
.event-item-list { display: grid; gap: 7px; }
.event-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid #e3dfeb; border-radius: 11px; background: white; }
.event-item.is-selected { border-color: #e1ad58; box-shadow: 0 0 0 2px rgba(238,161,39,.12); }
.event-item.is-disabled { box-shadow: inset 3px 0 0 var(--line); }
.event-item-main { display: grid; min-width: 0; padding: 0; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 8px; color: var(--ink); border: 0; background: none; text-align: left; }
.event-item-icon { display: grid; width: 30px; height: 30px; place-items: center; color: var(--accent-dark); border-radius: 8px; background: var(--accent-soft); }
.event-item-icon svg { width: 17px; height: 17px; }
.event-item-main strong,
.event-item-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-item-main strong { font-size: .65rem; }
.event-item-main small { margin-top: 2px; color: var(--ink-faint); font-size: .53rem; }
.event-item-actions { display: flex; gap: 3px; }
.event-item-actions button { padding: 4px 5px; color: var(--ink-faint); border: 0; background: transparent; font-size: .5rem; text-decoration: underline; }
.event-editor { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.event-editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.event-editor-heading h3 { margin: 3px 0 0; color: var(--ink); font-size: .92rem; }
.event-editor-heading button { padding: 6px 9px; color: var(--accent-dark); border: 1px solid #ead7b6; border-radius: 8px; background: var(--accent-soft); font-size: .57rem; font-weight: 780; }
.event-step { display: block; margin-top: 13px; padding-top: 13px; border-top: 1px solid #ece8f1; }
.event-step > div > strong { display: block; margin: 4px 0 7px; color: var(--ink); font-size: .67rem; }
.event-sentence { margin: 14px 0 0; padding: 12px 13px; color: #644600; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: #fff8e9; font-size: .61rem; line-height: 1.55; }
.event-source { margin-top: 9px; padding: 9px 10px; border: 1px solid #ded8eb; border-radius: 9px; background: #f8f6fc; }
.event-source summary { color: #4d3dcc; font-size: .58rem; font-weight: 780; cursor: pointer; }
.event-source p { margin: 6px 0; color: var(--ink-soft); font-size: .56rem; line-height: 1.45; }
.event-source a { color: #4d3dcc; font-size: .56rem; font-weight: 740; }
.reference-use-button { margin-top: 8px; }
.sticky-add-event { position: absolute; right: 18px; bottom: 20px; min-height: 36px; padding: 7px 12px; color: #fff; border: 0; border-radius: 10px; background: var(--accent-dark); font-size: .62rem; font-weight: 800; box-shadow: 0 8px 20px rgba(118,73,0,.18); }

.event-result-status { min-height: 16px; margin-top: 5px; color: #ffe19e; font-size: .58rem; }
.event-hero-result { padding-top: 12px; }
.event-result-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.event-view-tabs { display: inline-flex; gap: 4px; margin-top: 17px; padding: 4px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; background: rgba(255,255,255,.07); }
.event-view-tabs button { padding: 7px 10px; color: rgba(255,255,255,.67); border: 0; border-radius: 7px; background: transparent; font-size: .59rem; font-weight: 740; }
.event-view-tabs button[aria-pressed="true"] { color: #322159; background: #fff2cf; }
.event-chart-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 13px; }
.event-chart-heading strong { color: white; font-size: .71rem; }
.event-chart-heading span { max-width: 270px; color: rgba(255,255,255,.58); font-size: .54rem; text-align: right; }
.event-chart-host { margin-top: 8px; padding: 10px 8px 3px; border: 1px solid rgba(255,255,255,.11); border-radius: 12px; background: rgba(13,15,55,.20); }
.life-event-chart { display: block; width: 100%; height: auto; }
.life-event-chart g line,
.life-event-chart .zero { stroke: rgba(255,255,255,.14); }
.life-event-chart g text,
.life-event-chart > text { fill: rgba(255,255,255,.62); font-size: 11px; }
.life-event-chart .zero { stroke-width: 1.2; stroke-dasharray: 5 5; }
.life-event-chart .event-band { fill: #7decff; fill-opacity: .16; }
.life-event-chart .event-primary-line { fill: none; stroke: #c7ff56; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.life-event-chart .event-baseline-line { fill: none; stroke: rgba(255,255,255,.56); stroke-width: 2; stroke-dasharray: 6 5; }
.event-contribution-list { display: grid; gap: 10px; padding: 5px; }
.event-contribution-list > div { display: grid; grid-template-columns: minmax(135px, .9fr) minmax(160px, 1.5fr); align-items: center; gap: 12px; }
.event-contribution-list span strong,
.event-contribution-list span small { display: block; }
.event-contribution-list span strong { color: white; font-size: .62rem; }
.event-contribution-list span small { margin-top: 2px; color: rgba(255,255,255,.58); font-size: .52rem; }
.event-contribution-list i { display: block; height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.1); }
.event-contribution-list b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffd275, #ff8d71); }
.event-why-card { margin-top: 13px; }
.event-assumptions { margin-top: 12px; border-top: 1px solid rgba(255,255,255,.14); }
.event-assumptions summary { padding: 11px 0 4px; color: rgba(255,255,255,.74); font-size: .59rem; font-weight: 760; cursor: pointer; }
.event-assumptions p { margin: 6px 0; color: rgba(255,255,255,.62); font-size: .56rem; line-height: 1.45; }
.event-loading,
.event-error { display: flex; min-height: 190px; align-items: center; justify-content: center; flex-direction: column; gap: 7px; color: rgba(255,255,255,.7); text-align: center; }
.event-loading > span { width: 25px; height: 25px; border: 3px solid rgba(255,255,255,.2); border-top-color: #c7ff56; border-radius: 50%; animation: event-spin .7s linear infinite; }
.event-loading strong,
.event-error strong { color: white; font-size: .75rem; }
.event-loading p,
.event-error p { max-width: 420px; margin: 0; font-size: .6rem; line-height: 1.5; }
.event-error svg { width: 28px; height: 28px; color: #ffd275; }
@keyframes event-spin { to { transform: rotate(360deg); } }

.event-plan-breakdown { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.event-plan-breakdown > div { padding: 11px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; background: rgba(255,255,255,.07); }
.event-plan-breakdown span,
.event-plan-breakdown small { display: block; color: rgba(255,255,255,.58); font-size: .53rem; }
.event-plan-breakdown strong { display: block; margin: 4px 0 2px; color: white; font-size: .78rem; }

footer .privacy-controls { display: inline-flex; align-items: center; gap: 5px; }
footer .privacy-controls button { padding: 6px 8px; border: 1px solid #ddd9e9; border-radius: 8px; background: rgba(255,255,255,.7); text-decoration: none; }
footer .privacy-controls button[aria-pressed="true"] { color: #315f12; border-color: #cfe2ad; background: #f1ffd9; }

@media (max-width: 1180px) {
  .module-shell[data-theme="events"] .module-workspace { grid-template-columns: minmax(350px, 430px) minmax(0, 1fr); }
}

@media (max-width: 980px) {
  .module-shell[data-theme="events"] .module-workspace { grid-template-columns: 1fr; }
  .module-shell[data-theme="events"] .input-panel { display: block; }
  .budget-detail-callout,
  .budget-detail-system { grid-column: 1 / -1; }
  .budget-detail-system { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .budget-detail-heading { grid-column: 1 / -1; }
  .budget-detail-group { margin-top: 0; }
  .event-preset-grid { grid-template-columns: repeat(3, 1fr); }
  footer { align-items: flex-start; flex-direction: column; gap: 9px; }
}

@media (max-width: 700px) {
  .budget-detail-system { display: block; }
  .budget-detail-callout,
  .budget-detail-heading { align-items: flex-start; flex-direction: column; }
  .event-library-top { align-items: stretch; flex-direction: column; }
  .event-library-top input { width: 100%; }
  .event-preset-grid { grid-template-columns: 1fr 1fr; }
  .event-item { grid-template-columns: 1fr; }
  .event-item-actions { padding-left: 38px; }
  .event-result-metrics { grid-template-columns: 1fr 1fr; }
  .event-chart-host { overflow-x: auto; }
  .life-event-chart { min-width: 650px; }
  .event-plan-breakdown { grid-template-columns: 1fr; }
  footer .privacy-controls { align-items: stretch; flex-direction: column; }
}

@media (max-width: 430px) {
  .event-result-metrics { grid-template-columns: 1fr; }
  .month-pattern,
  .history-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 2026 light canvas system: vivid modules without a trading-dashboard mood */
.module-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.module-card[data-module="plan"] {
  color: var(--ink);
  border: 1px solid #d9dcff;
  background:
    radial-gradient(circle at 92% 8%, rgba(95, 217, 238, .32), transparent 16rem),
    radial-gradient(circle at 5% 96%, rgba(239, 76, 159, .13), transparent 18rem),
    linear-gradient(145deg, #f1f2ff, #edfaff 58%, #f9efff);
  box-shadow: 0 18px 44px rgba(83, 98, 246, .12);
}
.module-card[data-module="plan"]::after { border-color: rgba(83, 98, 246, .14); }
.module-card[data-module="plan"] .module-card-kicker,
.module-card[data-module="plan"] p,
.module-card[data-module="plan"] .module-card-question,
.module-card[data-module="plan"] .combine-count { color: var(--ink-soft); }
.module-card[data-module="plan"] .module-card-icon { color: #3544d1; background: white; }
.module-card[data-module="plan"] .module-card-title { color: var(--ink); }
.module-card[data-module="plan"] .module-open-label { color: #3544d1; }
.module-card[data-module="plan"] .module-open-label svg { color: #ef4c9f; }
.connected-plan-open .module-open-label { border-color: rgba(83, 98, 246, .16); }
.module-shell[data-theme="home"] {
  --accent: #5362f6;
  --accent-dark: #3544d1;
  --accent-soft: #eef0ff;
  --accent-fade: #cfd5ff;
  --accent-contrast: #202a8d;
}

.module-result-panel,
.plan-results,
.module-shell[data-theme="events"] .module-result-panel {
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--accent, #5362f6) 14%, #e7e4ef);
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent-soft, #eef0ff) 76%, transparent), transparent 31rem),
    linear-gradient(155deg, #ffffff 0%, #fbfaff 62%, #f6f7ff 100%);
  box-shadow: 0 24px 64px rgba(62, 49, 128, .12);
}

.module-result-panel::after {
  border-color: color-mix(in srgb, var(--accent, #5362f6) 13%, transparent);
}

.result-heading h2,
.hero-result-value,
.result-metric strong,
.chart-title strong,
.comparison-row > strong,
.plan-result-top h2,
.plan-summary-value,
.plan-empty h2,
.plan-key-metric strong,
.plan-insight strong,
.event-chart-heading strong,
.event-contribution-list span strong,
.event-loading strong,
.event-error strong,
.event-plan-breakdown strong { color: var(--ink); }

.result-heading p,
.hero-result-label,
.hero-result-sub,
.result-metric span,
.result-metric small,
.chart-legend,
.meter-labels,
.comparison-row > span,
.comparison-row > strong small,
.plan-result-top p,
.plan-summary-label,
.plan-empty p,
.chart-interaction-hint,
.plan-key-metric span,
.timeline-event,
.plan-insight span,
.plan-insight small,
.event-result-status,
.event-chart-heading span,
.event-contribution-list span small,
.event-assumptions summary,
.event-assumptions p,
.event-loading,
.event-error,
.event-plan-breakdown span,
.event-plan-breakdown small { color: var(--ink-soft); }

.result-heading .overline,
.plan-results .overline { color: var(--accent-dark, #3544d1); }

.probability-ring {
  background: conic-gradient(var(--accent, #5362f6) calc(var(--value, 0) * 1%), #ebe9f3 0);
}
.probability-ring-inner { background: white; box-shadow: inset 0 0 0 1px #e8e5f0; }
.probability-ring strong { color: var(--ink); }
.probability-ring span { color: var(--ink-soft); }
.result-metrics { border-color: #e7e4ef; }
.result-metric { border-color: #e7e4ef; }
.chart-legend i { background: #5362f6; }
.chart-legend .range i { background: rgba(95, 217, 238, .34); }
.meter-track,
.comparison-track { background: #ebe9f3; }
.meter-fill { background: linear-gradient(90deg, #5fd9ee, #5362f6); }
.comparison-fill { background: #5362f6; }
.comparison-row.secondary .comparison-fill { background: #22b6d3; }

.plan-results { --accent: #5362f6; --accent-dark: #3544d1; --accent-soft: #eef0ff; }
.plan-kpi-panel,
.plan-chart-panel {
  border-color: #e6e3ee;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 10px 30px rgba(57, 45, 117, .06);
}
.plan-kpi-note,
.plan-delta { color: #3544d1; }
.plan-key-metric { border-color: #e8e5f0; }
.plan-key-metric:hover,
.plan-key-metric:focus-visible { background: #f5f6ff; }
.timeline-event { border-color: #e3e0ec; background: white; }
.plan-insights { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.plan-insight { border: 1px solid #e6e3ee; background: #faf9fd; }
.event-plan-breakdown > div { border-color: #e4e1ec; background: #faf9fd; }
.plan-comparison-details,
.budget-plan-comparison { border-color: #e2dfeb; }
.plan-comparison-details > summary { color: var(--ink); background: #f7f6fb; }
.plan-comparison-details > summary small { color: var(--ink-soft); }
.plan-comparison-details > summary em { color: #3544d1; }
.pattern-table { border-color: #e3e0eb; }
.pattern-heading { color: var(--ink-soft); background: #f2f1f7; }
.pattern-heading strong,
.pattern-row strong { color: var(--ink); }
.pattern-row { color: var(--ink-soft); border-color: #e9e6ef; }
.pattern-row em { color: #3544d1; }
[data-tip]:focus-visible { outline-color: #5362f6; }
.interactive-fan-chart .chart-event-marker:hover line,
.interactive-fan-chart .chart-event-marker:hover text,
.interactive-fan-chart .chart-event-marker:focus line,
.interactive-fan-chart .chart-event-marker:focus text { filter: drop-shadow(0 0 4px rgba(83, 98, 246, .20)); }

.module-shell[data-theme="events"] .simulation-badge { color: #9a5b00; background: #fff4dc; }
.module-shell[data-theme="events"] .event-view-tabs { border-color: #e3dfeb; background: #f5f3f9; }
.module-shell[data-theme="events"] .event-view-tabs button { color: var(--ink-soft); }
.module-shell[data-theme="events"] .event-view-tabs button[aria-pressed="true"] { color: #7d4a00; background: #fff0c9; }
.event-chart-host { border-color: #e4e0eb; background: #faf9fd; }
.life-event-chart g line,
.life-event-chart .zero { stroke: #dedbe7; }
.life-event-chart g text,
.life-event-chart > text { fill: #716c84; }
.life-event-chart .event-band { fill: #68d9eb; fill-opacity: .18; }
.life-event-chart .event-primary-line { stroke: #ee8d25; }
.life-event-chart .event-baseline-line { stroke: #8a8499; }
.event-contribution-list i { background: #ebe8f0; }
.event-assumptions { border-color: #e3e0ea; }
.event-loading > span { border-color: #e2dfea; border-top-color: #ee9a27; }

/* Home: card canvas on the left, life timeline on the right. */
.module-shell[data-theme="home"] .module-workspace {
  grid-template-columns: minmax(350px, 430px) minmax(0, 1fr);
}
.module-shell[data-theme="home"] .module-result-panel {
  min-height: 690px;
  padding: 24px;
}
.module-shell[data-theme="home"] .module-result-panel::after { display: none; }
.home-board-result { display: grid; gap: 14px; }
.home-result-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.home-result-top h2 { margin: 4px 0; color: var(--ink); font-size: 1.18rem; letter-spacing: -.03em; }
.home-result-top p { max-width: 570px; margin: 0; color: var(--ink-soft); font-size: .67rem; line-height: 1.45; }
.home-primary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.home-primary-metrics > div {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #e2e3f2;
  border-radius: 13px;
  background: linear-gradient(145deg, #fff, #f5f6ff);
}
.home-primary-metrics strong { display: block; color: #2f3dcc; font-size: clamp(1.12rem, 2vw, 1.5rem); letter-spacing: -.045em; }
.home-primary-metrics span { display: block; margin-top: 4px; color: var(--ink-soft); font-size: .55rem; font-weight: 720; text-transform: uppercase; letter-spacing: .055em; }
.home-upfront-callout { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #ffd7e9; border-radius: 12px; background: #fff2f8; }
.home-upfront-callout > span { display: grid; width: 30px; height: 30px; place-items: center; color: #b92872; border-radius: 9px; background: white; }
.home-upfront-callout svg { width: 17px; height: 17px; }
.home-upfront-callout strong,
.home-upfront-callout small { display: block; }
.home-upfront-callout strong { color: #8e245f; font-size: .65rem; }
.home-upfront-callout small { margin-top: 2px; color: #855b72; font-size: .53rem; line-height: 1.4; }
.home-result-tabs { display: inline-flex; width: fit-content; gap: 3px; padding: 3px; border: 1px solid #e1dfeb; border-radius: 10px; background: #f3f2f7; }
.home-result-tabs button { padding: 7px 10px; color: var(--ink-soft); border: 0; border-radius: 7px; background: transparent; font-size: .6rem; font-weight: 760; }
.home-result-tabs button[aria-pressed="true"] { color: #2f3dcc; background: white; box-shadow: 0 3px 10px rgba(54, 48, 103, .10); }
.home-life-board { padding: 15px; border: 1px solid #e4e2ed; border-radius: 16px; background: rgba(255, 255, 255, .84); }
.home-timeline-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.home-timeline-heading h3 { margin: 3px 0 0; color: var(--ink); font-size: .82rem; }
.home-timeline-heading p { margin: 4px 0 0; color: var(--ink-soft); font-size: .57rem; }
.home-chart-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; color: var(--ink-soft); font-size: .56rem; }
.home-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.home-chart-legend i { width: 10px; height: 3px; border-radius: 99px; background: #5362f6; }
.home-chart-legend .net-equity i { background: #21b8d3; }
.home-chart-legend .cash i { background: #ef4c9f; }
.home-chart-host { width: 100%; overflow-x: auto; }
.home-line-chart { display: block; width: 100%; min-width: 570px; height: auto; }
.home-line-chart g line { stroke: #e4e2eb; }
.home-line-chart g text,
.home-line-chart .home-year-label { fill: #777188; font-size: 11px; }
.home-series { fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.home-series.equity { stroke: #5362f6; }
.home-series.net-equity { stroke: #21b8d3; stroke-dasharray: 6 5; }
.home-series.cash { stroke: #ef4c9f; }
.home-comparison-board .home-series.cash { stroke-dasharray: 9 6; }
.home-end-dot { stroke: white; stroke-width: 3; }
.home-end-dot.equity { fill: #5362f6; }
.home-end-dot.net-equity { fill: #21b8d3; }
.home-end-dot.cash { fill: #ef4c9f; }
.home-chart-marker line { stroke: #eea127; stroke-width: 1.25; stroke-dasharray: 4 5; }
.home-chart-marker circle { fill: #ffbe45; stroke: white; stroke-width: 2; }
.home-chart-marker text { fill: #8b5800 !important; font-size: 10px !important; font-weight: 760; }
.home-event-lane { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 7px; padding-top: 11px; border-top: 1px solid #ece9f1; }
.home-event-lane > span { color: var(--ink); font-size: .58rem; font-weight: 780; }
.home-event-lane > div { display: flex; min-width: 0; flex-wrap: wrap; gap: 5px; }
.home-event-lane em { color: var(--ink-faint); font-size: .54rem; font-style: normal; }
.home-event-lane button { padding: 5px 7px; color: #6d4908; border: 1px solid #f0d7a8; border-radius: 8px; background: #fff7e8; font-size: .52rem; font-weight: 730; }
.home-event-lane > div button { color: var(--ink-soft); border-color: #e3e0e9; background: #faf9fc; }
.home-event-lane button i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: #eea127; }
.home-horizon-strip,
.home-compare-outcome { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.home-horizon-strip > div,
.home-compare-outcome > div { padding: 10px; border-radius: 10px; background: #f5f6ff; }
.home-horizon-strip span,
.home-compare-outcome span,
.home-compare-outcome small { display: block; color: var(--ink-soft); font-size: .52rem; }
.home-horizon-strip strong,
.home-compare-outcome strong { display: block; margin-top: 4px; color: var(--ink); font-size: .78rem; }
.home-compare-outcome small { margin-top: 2px; }
.home-compare-outcome .owner-ahead { background: #effbe4; }
.home-compare-outcome .renter-ahead { background: #fff0f7; }
.home-boundary-note { margin: 9px 0 0; color: var(--ink-faint); font-size: .53rem; line-height: 1.45; }
.home-linked-output { display: grid; grid-template-columns: auto 1fr 1fr 1fr; align-items: center; gap: 7px; }
.home-output-title { color: var(--ink-soft); font-size: .56rem; font-weight: 780; text-transform: uppercase; letter-spacing: .06em; }
.home-linked-output > div:not(.home-output-title) { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 8px; border: 1px solid #e6e3ed; border-radius: 11px; background: white; }
.home-output-icon { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; }
.home-output-icon svg { width: 15px; height: 15px; }
.home-output-icon.budget { color: #477e12; background: #f1ffd9; }
.home-output-icon.debt { color: #bd483d; background: #fff0ed; }
.home-output-icon.events { color: #9a5d00; background: #fff5df; }
.home-linked-output strong,
.home-linked-output small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-linked-output strong { color: var(--ink); font-size: .58rem; }
.home-linked-output small { margin-top: 2px; color: var(--ink-faint); font-size: .49rem; }
.home-linked-output button { padding: 5px 6px; color: #3544d1; border: 1px solid #d9dcff; border-radius: 7px; background: #f1f2ff; font-size: .5rem; font-weight: 760; }
.home-budget-signal { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0; padding: 10px 12px; border-radius: 11px; background: #effbe8; }
.home-budget-signal strong { color: #376f18; font-size: .62rem; }
.home-budget-signal span { color: #618050; font-size: .53rem; }
.home-budget-signal.is-tight { background: #fff1ee; }
.home-budget-signal.is-tight strong { color: #b23f34; }
.home-budget-signal.is-tight span { color: #91635e; }
.home-error { padding: 20px; border: 1px solid #f4bdb7; border-radius: 14px; background: #fff2ef; }
.home-error strong { color: #aa3e35; }
.home-error p { color: #805b57; }

@media (max-width: 1180px) {
  .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .module-shell[data-theme="home"] .module-workspace { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); }
  .home-linked-output { grid-template-columns: 1fr 1fr 1fr; }
  .home-output-title { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .module-shell[data-theme="home"] .module-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-shell[data-theme="home"] .module-result-panel { padding: 18px 14px; }
  .home-result-top,
  .home-timeline-heading,
  .home-budget-signal { align-items: flex-start; flex-direction: column; }
  .home-primary-metrics,
  .home-horizon-strip,
  .home-compare-outcome { grid-template-columns: 1fr; }
  .home-chart-legend { justify-content: flex-start; }
  .home-event-lane { grid-template-columns: 1fr 1fr; }
  .home-event-lane > div { grid-column: 1 / -1; grid-row: 2; }
  .home-linked-output { grid-template-columns: 1fr; }
  .home-output-title { grid-column: auto; }
  .plan-key-metrics { grid-template-columns: 1fr; }
}

@media (max-width: 470px) {
  .result-metric:nth-child(3) { border-top-color: #e7e4ef; }
}

/* Clear-language navigation and module entry points */
.brand-copy { display: grid; gap: 0; text-align: left; }
.brand-copy strong { color: var(--ink); font-size: .92rem; font-weight: 790; line-height: 1.05; }
.brand-copy small { margin-top: 3px; color: var(--ink-faint); font-size: .54rem; font-weight: 680; letter-spacing: .025em; }
.course-shortcut,
.module-learn-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #4d3dcc;
  border: 1px solid #ddd9f3;
  border-radius: 11px;
  background: rgba(255,255,255,.84);
  font-size: .69rem;
  font-weight: 760;
  text-decoration: none;
}
.course-shortcut { justify-self: end; min-height: 38px; padding: 8px 11px; }
.course-shortcut svg { width: 15px; height: 15px; }
.course-shortcut:hover,
.module-learn-shortcut:hover { border-color: #705cf6; background: white; }
.control-heading > div:first-child { max-width: 850px; }
.module-card { min-height: 250px; padding-bottom: 46px; }
.module-open { justify-content: flex-start; }
.module-card-title { margin-top: 2px; font-size: 1.18rem; }
.module-card-question { max-width: 24ch; font-size: .78rem; line-height: 1.42; }
.module-research-link { right: auto; bottom: 14px; left: 17px; }
.module-card-plan-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-faint); font-size: .58rem; font-weight: 720; cursor: pointer; }
.module-card.is-active .module-card-plan-toggle { color: var(--accent-dark); }
.module-card-plan-toggle .module-switch { flex: 0 0 auto; }
.connected-plan-card { min-height: 94px; padding-bottom: 13px; }
.connected-plan-open { grid-template-columns: minmax(0, 1fr) auto; }
.module-header-actions { display: flex; align-items: center; gap: 8px; }
.module-learn-shortcut { min-height: 39px; padding: 8px 10px; color: var(--accent-dark); border-color: color-mix(in srgb, var(--accent) 24%, var(--line)); }
.module-learn-shortcut svg { width: 15px; height: 15px; }

@media (max-width: 700px) {
  .course-shortcut { margin-left: auto; }
  .course-shortcut svg { display: none; }
  .module-header-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .module-learn-shortcut,
  .module-state { justify-content: space-between; }
  .module-card { min-height: 218px; aspect-ratio: auto; }
}

@media (max-width: 470px) {
  .brand-copy small { display: none; }
  .course-shortcut { padding-inline: 9px; font-size: .63rem; }
}
