/*
 * Personal Financial Planning Scenario Planner
 * ------------------------------------------------------------
 * Dependency-free styles with responsive, keyboard, and print states.
 */

:root {
  --ink: #18333d;
  --ink-strong: #0e2832;
  --muted: #53676e;
  --subtle: #5f7177;
  --paper: #fffefd;
  --canvas: #f4f1ea;
  --canvas-deep: #e9e4da;
  --line: #d9dedb;
  --line-strong: #b8c5c4;
  --teal-900: #173f4f;
  --teal-800: #155564;
  --teal-700: #0c6674;
  --teal-100: #dceff0;
  --teal-050: #edf7f6;
  --gold: #d89a31;
  --gold-light: #fff0c9;
  --positive: #277154;
  --positive-bg: #e6f3ec;
  --caution: #8a5b09;
  --caution-bg: #fff2ce;
  --negative: #a43f36;
  --negative-bg: #faeae7;
  --conservative: #a54f36;
  --moderate: #087286;
  --optimistic: #4d7747;
  --focus: #ffbf47;
  --shadow: 0 18px 48px rgba(19, 52, 61, 0.09);
  --shadow-small: 0 8px 24px rgba(19, 52, 61, 0.08);
  --radius-large: 24px;
  --radius-medium: 16px;
  --radius-small: 10px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 280px;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
input,
select,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible,
[tabindex="0"]:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

a {
  color: var(--teal-700);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--teal-900);
}

h1,
h2,
h3,
p,
dl,
dd {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink-strong);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 780px;
  margin-bottom: 20px;
  color: #ffffff;
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  font-weight: 720;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.55rem, 2.5vw, 2.1rem);
}

h3 {
  margin-bottom: 8px;
  font-size: 1.18rem;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.page-shell {
  width: min(calc(100% - 40px), 1240px);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 11px 16px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink-strong);
  box-shadow: var(--shadow-small);
  font-weight: 700;
  transform: translateY(-180%);
  transition: transform 120ms ease;
}

.skip-link-secondary {
  top: 64px;
  left: 12px;
}

.skip-link:focus {
  transform: translateY(0);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 76px 0 105px;
  background:
    radial-gradient(circle at 80% 15%, rgba(104, 184, 180, 0.18), transparent 27%),
    linear-gradient(135deg, #123542 0%, #174d5c 58%, #1d5f69 100%);
}

.hero::after {
  position: absolute;
  right: -110px;
  bottom: -170px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  content: "";
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 56px;
  align-items: center;
}

.hero-intro {
  max-width: 720px;
  margin-bottom: 28px;
  color: #e5f1f1;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--teal-700);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow-light {
  color: #aee2dc;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f5fbfa;
  font-size: 0.86rem;
  font-weight: 650;
}

.hero-pills span::before {
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: #7fd4c8;
  content: "";
}

.hero-visual {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 28px 70px rgba(4, 25, 31, 0.23);
  transform: rotate(1.5deg);
}

.hero-visual svg {
  display: block;
  width: 100%;
  height: auto;
}

.hero-visual .visual-grid {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.hero-visual .visual-line {
  fill: none;
  stroke: #8be0d3;
  stroke-linecap: round;
  stroke-width: 5;
}

.hero-visual .visual-line-back {
  stroke: rgba(255, 193, 99, 0.62);
  stroke-dasharray: 7 8;
  stroke-width: 3;
}

.hero-visual circle {
  fill: #ffca72;
  stroke: var(--teal-900);
  stroke-width: 3;
}

.disclaimer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  width: min(920px, calc(100% - 20px));
  margin: -45px auto 36px;
  padding: 21px 24px;
  border: 1px solid #e9ca84;
  border-radius: var(--radius-medium);
  background: #fff9e9;
  box-shadow: var(--shadow-small);
}

.disclaimer h2 {
  margin-bottom: 4px;
  font-size: 1rem;
  letter-spacing: 0;
}

.disclaimer p {
  margin-bottom: 0;
  color: #574b35;
  font-size: 0.92rem;
}

.disclaimer-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-light);
  color: #70500e;
  font-family: Georgia, serif;
  font-weight: 800;
}

.planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 28px;
  align-items: start;
  padding-bottom: 70px;
}

.panel {
  min-width: 0;
  border: 1px solid rgba(184, 197, 196, 0.72);
  border-radius: var(--radius-large);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.input-panel,
.results-panel {
  padding: clamp(24px, 3.2vw, 40px);
}

.panel-heading {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.panel-heading p:last-child,
.results-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}

.scenario-picker {
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.scenario-picker legend {
  width: 100%;
  margin-bottom: 5px;
  color: var(--ink-strong);
  font-size: 1.18rem;
  font-weight: 750;
  letter-spacing: -0.018em;
}

.section-help {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.scenario-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.scenario-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 148px;
  padding: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.scenario-card:hover {
  border-color: var(--teal-700);
  transform: translateY(-1px);
}

.scenario-card:has(input:checked) {
  border-color: var(--teal-700);
  background: var(--teal-050);
  box-shadow: inset 0 0 0 1px var(--teal-700);
}

.scenario-card:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.scenario-card input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 9px 0 0;
  accent-color: var(--teal-700);
}

.scenario-card input:focus-visible {
  outline: 0;
}

.scenario-card-content,
.scenario-card-heading {
  display: block;
  min-width: 0;
}

.scenario-card-heading {
  margin-bottom: 7px;
}

.scenario-name {
  display: block;
  color: var(--ink-strong);
  font-size: 0.97rem;
  font-weight: 780;
}

.scenario-description,
.scenario-numbers {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.scenario-numbers {
  margin-top: 9px;
  color: var(--teal-800);
  font-weight: 720;
}

.custom-badge {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--gold-light);
  color: #6d4d0d;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.validation-summary {
  margin-top: 24px;
  padding: 17px 19px;
  border: 1px solid #d87d73;
  border-left: 5px solid var(--negative);
  border-radius: var(--radius-small);
  background: var(--negative-bg);
}

.validation-summary h3 {
  margin-bottom: 8px;
  color: #702d27;
  font-size: 1rem;
}

.validation-summary ul {
  margin: 0;
  padding-left: 20px;
}

.validation-summary li + li {
  margin-top: 3px;
}

.validation-summary a {
  color: #6d2924;
  font-size: 0.88rem;
  font-weight: 650;
}

.form-section {
  padding: 31px 0 29px;
  border-bottom: 1px solid var(--line);
}

.section-heading-row,
.section-title-row,
.results-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.section-heading-row {
  margin-bottom: 22px;
}

.section-heading-row h3,
.section-title-row h3 {
  margin-bottom: 0;
}

.step-label,
.result-kicker,
.result-assumptions .result-kicker {
  margin-bottom: 3px;
  color: var(--teal-700);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.section-marker {
  color: #d8dfdd;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 16px;
}

.field-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-group {
  min-width: 0;
}

.field-group label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-strong);
  font-size: 0.86rem;
  font-weight: 720;
  line-height: 1.35;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #aebcbb;
  border-radius: 9px;
  background: #ffffff;
  color: var(--ink-strong);
  box-shadow: inset 0 1px 2px rgba(15, 47, 56, 0.035);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:hover,
select:hover {
  border-color: #788e8e;
}

input:focus,
select:focus {
  border-color: var(--teal-700);
  box-shadow: 0 0 0 3px rgba(12, 102, 116, 0.12);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--negative);
  background: #fffafa;
}

input:disabled,
select:disabled {
  background: #eff1ef;
  color: #687477;
  cursor: not-allowed;
}

.input-with-affix {
  display: flex;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid #aebcbb;
  border-radius: 9px;
  background: #f5f7f5;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input-with-affix:focus-within {
  border-color: var(--teal-700);
  box-shadow: 0 0 0 3px var(--focus);
}

.input-with-affix:has(input[aria-invalid="true"]) {
  border-color: var(--negative);
}

.input-with-affix > span {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 11px;
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 700;
}

.input-with-affix input {
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.input-with-affix input:focus-visible {
  outline: 0;
}

.input-with-affix.suffix input {
  border-right: 1px solid var(--line);
  border-left: 0;
}

.field-hint,
.field-error {
  margin: 6px 1px 0;
  font-size: 0.74rem;
  line-height: 1.4;
}

.field-hint {
  color: var(--muted);
}

.field-error {
  min-height: 0;
  color: var(--negative);
  font-weight: 650;
}

.field-error:not(:empty) {
  min-height: 1.05rem;
}

.selected-scenario-note {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  align-items: center;
  margin: -5px 0 20px;
  padding: 11px 13px;
  border-radius: 9px;
  background: var(--teal-050);
  color: var(--muted);
  font-size: 0.82rem;
}

.selected-scenario-note strong {
  color: var(--teal-900);
}

.text-button {
  min-height: 32px;
  padding: 3px 5px;
  border: 0;
  background: transparent;
  color: var(--teal-700);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.toggle-row {
  display: flex;
  gap: 13px;
  align-items: center;
  min-height: 60px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
}

.toggle-row:has(input:checked) {
  border-color: var(--teal-700);
  background: var(--teal-050);
}

.toggle-row:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.toggle-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-control {
  position: relative;
  flex: 0 0 auto;
  width: 43px;
  height: 25px;
  border: 1px solid #77898a;
  border-radius: 999px;
  background: #dde3e1;
}

.toggle-control::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(10, 32, 38, 0.25);
  content: "";
  transition: transform 130ms ease;
}

.toggle-row input:checked + .toggle-control {
  border-color: var(--teal-700);
  background: var(--teal-700);
}

.toggle-row input:checked + .toggle-control::after {
  transform: translateX(18px);
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row strong {
  color: var(--ink-strong);
  font-size: 0.92rem;
}

.toggle-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.expense-fields {
  margin-top: 20px;
  padding: 20px;
  border-radius: 13px;
  background: #f6f8f6;
}

.optional-label {
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 500;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 29px;
}

.button {
  display: inline-flex;
  min-height: 47px;
  align-items: center;
  justify-content: center;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  grid-column: 1 / -1;
  background: var(--teal-700);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--teal-800);
}

.button-secondary {
  border-color: #9eb0af;
  background: #ffffff;
  color: var(--teal-900);
}

.button-secondary:hover {
  border-color: var(--teal-700);
  background: var(--teal-050);
}

.results-panel {
  overflow: hidden;
}

.results-heading {
  margin-bottom: 26px;
}

.live-calculation-label {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.live-calculation-label > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--positive);
}

.print-meta {
  display: none;
}

.invalid-results {
  min-height: 420px;
  padding: 80px 28px;
  text-align: center;
}

.invalid-results > div {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--negative-bg);
  color: var(--negative);
  font-size: 1.4rem;
  font-weight: 800;
}

.invalid-results p {
  max-width: 420px;
  margin: 0 auto 12px;
  color: var(--muted);
}

.result-assumptions {
  display: grid;
  grid-template-columns: minmax(130px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 15px;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafbf9;
}

.result-assumptions h3 {
  margin: 0;
}

#result-custom-label {
  margin-left: 7px;
  color: var(--caution);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0;
}

.assumption-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 0;
}

.assumption-list div {
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.assumption-list dt {
  color: var(--muted);
  font-size: 0.67rem;
}

.assumption-list dd {
  margin-bottom: 0;
  color: var(--ink-strong);
  font-size: 0.9rem;
  font-weight: 800;
}

.status-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(105px, auto);
  gap: 15px;
  align-items: center;
  margin-bottom: 15px;
  padding: 20px;
  border: 1px solid #a9d0be;
  border-radius: 16px;
  background: var(--positive-bg);
}

.status-banner[data-status="close"] {
  border-color: #e2c36e;
  background: var(--caution-bg);
}

.status-banner[data-status="potential-shortfall"] {
  border-color: #dfaca5;
  background: var(--negative-bg);
}

.status-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--positive);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
}

[data-status="close"] .status-icon {
  background: var(--caution);
}

[data-status="potential-shortfall"] .status-icon {
  background: var(--negative);
}

.status-copy h3 {
  margin-bottom: 4px;
  color: #17563d;
  font-size: 1.24rem;
}

[data-status="close"] .status-copy h3 {
  color: #684606;
}

[data-status="potential-shortfall"] .status-copy h3 {
  color: #792f29;
}

.status-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-copy p {
  margin-bottom: 0;
  color: #3f5a53;
  font-size: 0.8rem;
  line-height: 1.4;
}

[data-status="potential-shortfall"] .status-copy p,
[data-status="close"] .status-copy p {
  color: #66554d;
}

.funding-meter-wrap {
  min-width: 108px;
}

.funding-meter-wrap span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 0.69rem;
  text-align: right;
}

.funding-meter-wrap strong {
  font-size: 0.83rem;
}

progress {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 45, 54, 0.14);
}

progress::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(16, 45, 54, 0.14);
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--positive);
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--positive);
}

[data-status="close"] progress::-webkit-progress-value {
  background: var(--caution);
}

[data-status="potential-shortfall"] progress::-webkit-progress-value {
  background: var(--negative);
}

[data-status="close"] progress::-moz-progress-bar {
  background: var(--caution);
}

[data-status="potential-shortfall"] progress::-moz-progress-bar {
  background: var(--negative);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.metric-card {
  min-width: 0;
  min-height: 145px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.metric-card-featured {
  border-color: #acd3d4;
  background: var(--teal-050);
}

.metric-card p {
  min-height: 2.6em;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 680;
  line-height: 1.35;
}

.metric-card strong {
  display: block;
  overflow-wrap: anywhere;
  margin-bottom: 5px;
  color: var(--ink-strong);
  font-size: clamp(1.35rem, 3.1vw, 1.85rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

#gap-card[data-gap="surplus"] strong {
  color: var(--positive);
}

#gap-card[data-gap="gap"] strong {
  color: var(--negative);
}

.advisories {
  margin-top: 12px;
}

.advisory {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #e1c574;
  border-radius: 10px;
  background: #fff8e7;
  color: #5d4a22;
  font-size: 0.78rem;
}

.advisory + .advisory {
  margin-top: 8px;
}

.advisory strong {
  color: #684606;
}

.advisory-icon {
  font-weight: 850;
}

.chart-section,
.comparison-section {
  margin-top: 35px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.chart-unit {
  flex: 0 0 auto;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
}

.chart-summary {
  margin: 13px 0 15px;
  color: var(--muted);
  font-size: 0.86rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.chart-legend li {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
}

.legend-line {
  display: inline-block;
  width: 23px;
  height: 0;
  border-top: 3px solid;
}

.legend-line.conservative {
  border-color: var(--conservative);
  border-top-style: dashed;
}

.legend-line.moderate {
  border-color: var(--moderate);
}

.legend-line.optimistic {
  border-color: var(--optimistic);
  border-top-style: dotted;
}

.chart {
  width: 100%;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfcfa;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 280px;
}

.chart .grid-line {
  stroke: #dfe5e2;
  stroke-width: 1;
}

.chart .axis-line {
  stroke: #9baba9;
  stroke-width: 1.2;
}

.chart .axis-label {
  fill: #53676e;
  font-family: var(--font-sans);
  font-size: 11px;
}

.chart .series-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.chart .series-line.selected {
  stroke-width: 4;
}

.chart .scenario-conservative {
  stroke: var(--conservative);
  stroke-dasharray: 8 6;
}

.chart .scenario-moderate {
  stroke: var(--moderate);
}

.chart .scenario-optimistic {
  stroke: var(--optimistic);
  stroke-dasharray: 2 5;
}

.chart .end-dot {
  fill: #ffffff;
  stroke-width: 3;
}

.chart .event-line {
  stroke: #8a5b09;
  stroke-dasharray: 4 4;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.chart .event-label {
  fill: #6d4c0b;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
}

details {
  border-radius: 11px;
}

summary {
  min-height: 44px;
  cursor: pointer;
}

.projection-details,
.method-details {
  margin-top: 17px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.projection-details summary,
.method-details summary {
  padding: 13px 16px;
  color: var(--teal-900);
  font-size: 0.83rem;
  font-weight: 750;
}

.projection-details > p {
  margin: 0;
  padding: 3px 16px 12px;
  color: var(--muted);
  font-size: 0.76rem;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

caption {
  padding: 0;
  text-align: left;
}

.projection-details caption,
.comparison-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

thead th {
  background: #f0f4f2;
  color: #435960;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

tbody td,
tbody th {
  font-size: 0.76rem;
}

tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: 0;
}

tbody tr.event-row {
  background: #fff8e6;
}

.comparison-section .section-help {
  margin: 8px 0 16px;
}

.comparison-section .table-scroll {
  border: 1px solid var(--line);
  border-radius: 12px;
}

.comparison-table {
  min-width: 690px;
}

.comparison-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f0f4f2;
}

.comparison-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
  color: var(--ink-strong);
  text-align: left;
}

.comparison-table tr.selected-row th,
.comparison-table tr.selected-row td {
  background: var(--teal-050);
}

.comparison-table .scenario-row-label {
  display: block;
  font-size: 0.79rem;
}

.comparison-table .selected-row-label,
.comparison-table .custom-row-label {
  display: block;
  margin-top: 2px;
  color: var(--teal-700);
  font-size: 0.61rem;
  font-weight: 750;
  text-transform: uppercase;
}

.outlook-label {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 750;
}

.outlook-label.on-track {
  background: var(--positive-bg);
  color: #1f6348;
}

.outlook-label.close {
  background: var(--caution-bg);
  color: #704b08;
}

.outlook-label.potential-shortfall {
  background: var(--negative-bg);
  color: #87342d;
}

.method-details {
  margin-top: 30px;
  background: #f8faf8;
}

.method-content {
  padding: 3px 18px 18px;
  color: var(--muted);
  font-size: 0.81rem;
}

.method-content h3 {
  font-size: 0.95rem;
}

.method-content ol {
  padding-left: 20px;
}

.method-content li + li {
  margin-top: 5px;
}

.method-content p:last-child {
  margin-bottom: 0;
}

.privacy-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  margin-top: 25px;
  padding: 15px 17px;
  border-radius: 11px;
  background: var(--teal-900);
  color: #e7f2f2;
  font-size: 0.75rem;
}

.privacy-note strong {
  color: #ffffff;
}

.site-footer {
  padding: 32px 0;
  border-top: 1px solid #d2d6d1;
  background: #e8e4dc;
}

.footer-content {
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.footer-content p {
  margin-bottom: 0;
  color: #4f6268;
  font-size: 0.76rem;
}

.footer-content p:last-child {
  max-width: 640px;
  text-align: right;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1080px) {
  .hero-content {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 34px;
  }

  .planner-layout {
    grid-template-columns: 1fr;
  }

  .scenario-card {
    min-height: 125px;
  }

  .field-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(calc(100% - 28px), 1240px);
  }

  .hero {
    padding: 58px 0 92px;
  }

  .hero-content {
    display: block;
  }

  .hero-visual {
    display: none;
  }

  .disclaimer {
    width: 100%;
    margin-bottom: 24px;
  }

  .input-panel,
  .results-panel {
    padding: 25px 20px;
  }

  .scenario-options,
  .field-grid,
  .field-grid-three {
    grid-template-columns: 1fr;
  }

  .scenario-card {
    min-height: 0;
  }

  .scenario-card-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: center;
  }

  .custom-badge {
    margin-top: 0;
  }

  .result-assumptions {
    grid-template-columns: 1fr;
  }

  .assumption-list div:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .status-banner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .funding-meter-wrap {
    grid-column: 1 / -1;
  }

  .funding-meter-wrap span {
    text-align: left;
  }

  .metric-card {
    min-height: 138px;
  }

  .chart {
    min-height: 240px;
  }

  .chart svg {
    min-height: 240px;
  }

  .footer-content {
    display: block;
  }

  .footer-content p:last-child {
    margin-top: 8px;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .page-shell {
    width: min(calc(100% - 20px), 1240px);
  }

  .hero {
    padding-top: 48px;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 2.75rem);
  }

  .hero-pills span {
    font-size: 0.75rem;
  }

  .disclaimer {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .input-panel,
  .results-panel {
    padding: 22px 16px;
    border-radius: 18px;
  }

  .planner-layout {
    gap: 18px;
  }

  .section-marker,
  .live-calculation-label {
    display: none;
  }

  .form-actions,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .button-primary {
    grid-column: auto;
  }

  .metric-card {
    min-height: 0;
  }

  .metric-card p {
    min-height: 0;
  }

  .assumption-list {
    gap: 6px;
  }

  .assumption-list div {
    padding-left: 7px;
  }

  .status-banner {
    padding: 16px;
  }

  .status-icon {
    width: 36px;
    height: 36px;
  }

  .section-title-row {
    display: block;
  }

  .chart-unit {
    display: block;
    margin-top: 3px;
  }

  .privacy-note {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  @page {
    size: portrait;
    margin: 14mm;
  }

  :root {
    --ink: #111111;
    --ink-strong: #000000;
    --muted: #333333;
    --line: #bbbbbb;
  }

  body {
    background: #ffffff;
    color: #111111;
    font-size: 10pt;
  }

  .page-shell {
    width: 100%;
  }

  .skip-link,
  .hero-visual,
  .hero-pills,
  .input-panel,
  .live-calculation-label,
  .projection-details summary,
  .method-details summary,
  .site-footer {
    display: none !important;
  }

  .hero {
    padding: 0 0 10mm;
    background: #ffffff;
  }

  .hero h1 {
    max-width: none;
    margin-bottom: 3mm;
    color: #000000;
    font-size: 24pt;
  }

  .hero .eyebrow {
    color: #333333;
  }

  .hero-intro {
    max-width: none;
    margin: 0;
    color: #222222;
    font-size: 11pt;
  }

  .disclaimer {
    width: 100%;
    margin: 0 0 8mm;
    padding: 4mm;
    border: 1px solid #777777;
    box-shadow: none;
  }

  .planner-layout {
    display: block;
    padding: 0;
  }

  .panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .results-panel {
    padding: 0;
    overflow: visible;
  }

  .results-heading {
    margin-bottom: 5mm;
  }

  .print-meta {
    display: block;
    margin-bottom: 4mm;
    color: #333333;
    font-size: 8.5pt;
  }

  .result-assumptions,
  .status-banner,
  .metric-card,
  .chart,
  .comparison-section .table-scroll,
  .projection-details,
  .method-details,
  .privacy-note {
    border: 1px solid #999999;
    background: #ffffff !important;
    box-shadow: none;
  }

  .result-assumptions,
  .status-banner,
  .metric-card,
  .advisory {
    break-inside: avoid;
  }

  .status-icon {
    border: 1px solid #333333;
    background: #ffffff !important;
    color: #000000;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-card {
    min-height: 0;
  }

  .chart-section,
  .comparison-section {
    margin-top: 8mm;
    padding-top: 6mm;
    break-before: auto;
  }

  .chart {
    min-height: 0;
  }

  .chart svg {
    min-height: 0;
  }

  .projection-details > :not(summary),
  .method-details > :not(summary) {
    display: block !important;
  }

  .projection-details,
  .method-details {
    break-before: page;
  }

  .table-scroll {
    overflow: visible;
  }

  table {
    font-size: 7pt;
  }

  th,
  td {
    padding: 4px 5px;
    white-space: normal;
  }

  thead {
    display: table-header-group;
  }

  tr {
    break-inside: avoid;
  }

  .comparison-table {
    min-width: 0;
  }

  .comparison-table th:first-child,
  .comparison-table tbody th {
    position: static;
  }

  .privacy-note {
    display: block;
    color: #111111;
  }

  .privacy-note strong {
    color: #000000;
  }
}
