:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #162033;
  --muted: #6b7280;
  --line: #e8edf5;
  --brand: #0f6abf;
  --brand-2: #0ea5a8;
  --accent: #ff8c42;
  --danger: #d9485f;
  --success: #16a34a;
  --shadow: 0 18px 40px rgba(16, 33, 58, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at 0% 0%, rgba(14, 165, 168, 0.15), transparent 40%),
    radial-gradient(circle at 100% 10%, rgba(15, 106, 191, 0.14), transparent 42%),
    linear-gradient(180deg, #eef4ff 0%, #f7fbff 35%, #f7f7fb 100%);
}

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

a {
  color: inherit;
}

.page-shell {
  width: min(1280px, 94vw);
  margin: 28px auto 40px;
}

.suite-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.suite-home,
.suite-links a {
  text-decoration: none;
  color: #0a4f8c;
  font-weight: 700;
}

.suite-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: stretch;
  background: linear-gradient(135deg, #0a3565, var(--brand) 55%, var(--brand-2));
  color: #fff;
  border-radius: 24px;
  padding: 26px 28px;
  box-shadow: var(--shadow);
}

.hero-content,
.hero-side {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.eyebrow {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.hero h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Baskerville", "Georgia", serif;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.05;
}

.hero-subtitle,
.hero-proof,
.hero-trust {
  margin: 0;
}

.hero-subtitle {
  font-weight: 700;
  font-size: 1.05rem;
}

.hero-proof,
.hero-trust {
  max-width: 62ch;
}

.hero-trust {
  font-size: 0.9rem;
  opacity: 0.9;
}

.hero-cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.hero-stat-card,
.hero-mini-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
}

.hero-stat-card {
  padding: 16px;
}

.hero-stat-card p,
.hero-stat-card strong,
.hero-mini-card strong {
  margin: 0;
}

.hero-stat-label,
.mini-kicker {
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 6px;
}

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

.hero-mini-card {
  padding: 12px;
}

.btn,
.icon-btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease;
}

.btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.btn:active,
.icon-btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(15, 106, 191, 0.22);
  text-decoration: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
  text-decoration: none;
}

.btn-secondary-panel {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.trip-snapshot {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  padding: 12px;
}

.trip-snapshot-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.trip-snapshot-head h2,
.trip-snapshot-head p {
  margin: 0;
}

.offline-badge-wrap {
  display: grid;
  gap: 4px;
}

.offline-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(15, 106, 191, 0.12);
  background: rgba(15, 106, 191, 0.05);
  color: #0a4f8c;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 800;
}

.offline-badge-note,
.offline-badge-trust {
  font-size: 0.76rem;
  color: var(--muted);
  text-align: right;
}

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

.trip-snapshot-item,
.metric-card,
.subsection,
.tool-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.trip-snapshot-item {
  padding: 10px;
}

.trip-snapshot-item .label,
.metric-card .label,
.projection-highlight .label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.trip-snapshot-item .value,
.metric-card .value {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  margin-top: 3px;
}

.trip-snapshot-item .sub,
.metric-card .sub {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.page-flow {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 30px rgba(16, 33, 58, 0.04);
  padding: 14px;
}

.panel-header {
  margin-bottom: 14px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.calculator-layout,
.projection-layout,
.content-grid,
.faq-grid {
  display: grid;
  gap: 14px;
}

.calculator-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.8fr);
  align-items: start;
}

.calculator-card,
.results-card {
  display: grid;
  gap: 12px;
}

.calculator-intro {
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 106, 191, 0.1);
  background: linear-gradient(180deg, #fbfdff, #ffffff);
  padding: 12px 14px;
}

.prose-inline p {
  margin: 0;
  color: #334155;
  line-height: 1.6;
}

.mobile-summary-card {
  display: none;
  margin-bottom: 14px;
  border: 1px solid rgba(15, 106, 191, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, #f7fbff, #ffffff);
  padding: 12px;
}

.mobile-summary-value {
  margin-top: 6px;
}

.mobile-summary-value .label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.mobile-summary-value strong {
  display: block;
  margin-top: 4px;
  font-size: 1.8rem;
  font-family: "Iowan Old Style", "Baskerville", "Georgia", serif;
}

.mobile-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.mobile-summary-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.mobile-summary-item .label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.mobile-summary-item .value {
  display: block;
  margin-top: 3px;
  font-size: 0.95rem;
  font-weight: 800;
}

.subsection {
  padding: 12px;
}

.form-toolbar,
.results-head,
.section-head,
.support-panel,
.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.input-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  overflow: hidden;
}

.input-card[open] {
  box-shadow: inset 0 1px 0 rgba(15, 106, 191, 0.04);
}

.input-card summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 800;
}

.input-card summary::-webkit-details-marker {
  display: none;
}

.summary-note {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

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

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

.form-field {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #324255;
}

.form-field input {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  min-height: 44px;
}

.form-field input:focus {
  outline: 2px solid rgba(15, 106, 191, 0.16);
  border-color: rgba(15, 106, 191, 0.38);
}

.form-field small,
.muted {
  color: var(--muted);
}

.small-copy {
  font-size: 0.8rem;
}

.results-card {
  position: sticky;
  top: 18px;
}

.results-kicker,
.tool-kicker {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(15, 106, 191, 0.08);
  color: #0a4f8c;
  border: 1px solid rgba(15, 106, 191, 0.1);
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 800;
}

.results-head h2,
.section-head h3,
.tool-card h3,
.action-card h3,
.prose-card h3 {
  margin: 0;
}

.results-head h2 {
  margin-top: 6px;
  font-size: 1.2rem;
}

.strength-badge {
  align-self: center;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid transparent;
  white-space: nowrap;
}

.strength-badge[data-tone="building"] {
  background: #fff7ed;
  color: #9a4b00;
  border-color: #fed7aa;
}

.strength-badge[data-tone="stable"] {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.strength-badge[data-tone="strong"] {
  background: #ecfeff;
  color: #0f766e;
  border-color: #99f6e4;
}

.strength-badge[data-tone="very-strong"] {
  background: #ecfdf5;
  color: #166534;
  border-color: #bbf7d0;
}

.net-worth-card {
  border-radius: 16px;
  padding: 16px;
  color: #fff;
  background: linear-gradient(135deg, #0a3565, var(--brand) 55%, var(--brand-2));
}

.net-worth-card .label {
  display: block;
  font-size: 0.8rem;
  opacity: 0.86;
}

.net-worth-value {
  display: block;
  margin-top: 6px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-family: "Iowan Old Style", "Baskerville", "Georgia", serif;
  line-height: 1;
}

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

.metric-card {
  padding: 12px;
}

.lead-copy {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
}

.insight-list,
.plain-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #334155;
}

.insight-list li,
.plain-list li {
  margin-bottom: 6px;
}

.next-step-cta {
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, #fbfdff, #ffffff);
}

.next-step-cta .small-copy {
  margin: 0;
}

.next-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assumption-list {
  margin: 4px 0 0;
  padding-left: 18px;
  color: #334155;
}

.assumption-list li {
  margin-bottom: 6px;
}

.charts-grid,
.next-steps-grid,
.tool-grid {
  display: grid;
  gap: 12px;
}

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

.chart-card,
.projection-chart-card {
  overflow: hidden;
}

.chart-shell {
  display: grid;
  gap: 12px;
  min-height: 280px;
}

.donut-layout {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.donut-figure {
  position: relative;
  display: grid;
  place-items: center;
  width: min(220px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
}

.donut-figure svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.donut-center {
  position: absolute;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-size: 1.2rem;
}

.legend-list,
.bar-list,
.milestone-grid {
  display: grid;
  gap: 10px;
}

.legend-row,
.bar-row,
.milestone-card {
  display: grid;
  gap: 4px;
}

.legend-row {
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 0.86rem;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.legend-label,
.bar-label {
  color: #334155;
}

.legend-value,
.bar-value {
  font-weight: 700;
}

.bar-track {
  position: relative;
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
}

.bar-fill.assets {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.bar-fill.liabilities {
  background: linear-gradient(90deg, #f97316, #ef4444);
}

.projection-layout {
  grid-template-columns: minmax(290px, 0.9fr) minmax(0, 1.1fr);
}

.projection-highlight {
  border-radius: 16px;
  border: 1px solid rgba(15, 106, 191, 0.12);
  background: linear-gradient(180deg, #f7fbff, #ffffff);
  padding: 14px;
}

.projection-highlight strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-family: "Iowan Old Style", "Baskerville", "Georgia", serif;
}

.milestone-grid {
  margin-top: 12px;
}

.milestone-card {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px;
  background: #fff;
}

.milestone-label {
  font-size: 0.76rem;
  color: var(--muted);
}

.milestone-value {
  font-size: 1rem;
  font-weight: 800;
}

.line-chart {
  width: 100%;
  height: auto;
}

.line-chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.chart-axis-note {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.76rem;
}

.chart-axis-note span:last-child {
  text-align: right;
}

.content-grid,
.faq-grid,
.next-steps-grid,
.tool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.formula-box {
  border-radius: 14px;
  background: linear-gradient(135deg, #edf5ff, #f4fbfb);
  border: 1px solid rgba(15, 106, 191, 0.12);
  padding: 14px;
  margin-bottom: 12px;
}

.formula-label {
  display: block;
  margin-bottom: 6px;
  color: #0a4f8c;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.action-card,
.tool-card {
  text-decoration: none;
  padding: 14px;
}

.tool-card {
  background: linear-gradient(180deg, #fff, #fbfdff);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(16, 33, 58, 0.06);
  border-color: rgba(15, 106, 191, 0.22);
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #0a4f8c;
  background: rgba(15, 106, 191, 0.08);
  border: 1px solid rgba(15, 106, 191, 0.12);
}

.support-panel {
  align-items: center;
  flex-wrap: wrap;
}

.support-panel-copy h2,
.support-panel-copy p {
  margin: 0;
}

.support-panel-copy {
  flex: 1 1 320px;
  min-width: 0;
}

.support-panel-copy p {
  margin-top: 6px;
  color: var(--muted);
}

.support-panel-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.support-panel-actions .btn {
  white-space: nowrap;
}

.app-footer {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px;
  align-items: center;
}

.footer-branding {
  display: grid;
  gap: 2px;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.footer-actions a {
  color: #0a4f8c;
  text-decoration: none;
  font-weight: 700;
}

.global-fab-row {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 8px;
}

.global-support-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  border-radius: 999px;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 0.75rem;
  box-shadow: 0 8px 18px rgba(15, 106, 191, 0.16);
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.92), rgba(14, 165, 168, 0.92));
  text-decoration: none;
  opacity: 0.9;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: rgba(22, 32, 51, 0.95);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.85rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  z-index: 1200;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed #d5e2f1;
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

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

.no-print {
  display: initial;
}

[hidden] {
  display: none !important;
}

.subsection:empty,
.metric-card:empty,
.mobile-summary-item:empty,
.milestone-card:empty,
.tool-card:empty,
.action-card:empty,
.support-panel-actions:empty,
.footer-actions:empty {
  display: none !important;
}

@media (max-width: 1120px) {
  .hero,
  .calculator-layout,
  .projection-layout,
  .charts-grid,
  .content-grid,
  .faq-grid,
  .next-steps-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .results-card {
    position: static;
  }

  .mobile-summary-card {
    display: grid;
    gap: 8px;
  }
}

@media (max-width: 860px) {
  .input-grid,
  .projection-grid,
  .metric-grid,
  .trip-snapshot-grid,
  .hero-mini-grid,
  .mobile-summary-grid {
    grid-template-columns: 1fr;
  }

  .suite-nav,
  .form-toolbar,
  .results-head,
  .trip-snapshot-head,
  .support-panel,
  .app-footer {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .offline-badge-note,
  .offline-badge-trust {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100%, 96vw);
    margin-top: 16px;
  }

  .hero {
    padding: 18px;
    border-radius: 18px;
  }

  .global-fab-row {
    right: 10px;
    top: auto;
    bottom: 10px;
    display: none;
  }

  .toolbar-actions,
  .hero-cta-row,
  .next-action-buttons {
    width: 100%;
  }

  .toolbar-actions .btn,
  .hero-cta-row .btn,
  .support-panel .btn,
  .next-action-buttons .btn {
    flex: 1 1 100%;
    text-align: center;
    justify-content: center;
  }
}

@media print {
  .no-print,
  .global-fab-row,
  .app-footer {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .page-shell {
    width: 100%;
    margin: 0;
  }

  .panel,
  .trip-snapshot,
  .hero {
    box-shadow: none;
  }
}
