:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #17212b;
  --muted: #5e6b78;
  --line: #d8e0e7;
  --soft: #f5f8fa;
  --soft-blue: #eef6f8;
  --teal: #0d766e;
  --teal-dark: #075e58;
  --green: #1f7a4d;
  --green-soft: #e9f6ef;
  --amber: #a35f00;
  --amber-soft: #fff5df;
  --blue-ink: #18344a;
  --shadow: 0 16px 40px rgba(23, 33, 43, 0.1);
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.55;
}

a { color: var(--teal-dark); text-decoration-thickness: 2px; text-underline-offset: 3px; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner, .section, .hero, .footer-inner, .ad-slot-sponsor, .ad-slot-leaderboard {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--teal);
  color: white;
  font-size: 13px;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.nav a { color: var(--ink); font-size: 16px; font-weight: 700; text-decoration: none; }
.nav a:hover { color: var(--teal-dark); }

.button, button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  padding: 13px 18px;
  background: var(--teal);
  color: white;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button.secondary {
  background: white;
  color: var(--teal-dark);
  border: 2px solid var(--teal);
}

button:hover, .button:hover { background: var(--teal-dark); color: white; }
.button.secondary:hover { background: var(--soft); color: var(--teal-dark); }

input, select {
  width: 100%;
  min-height: 54px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: white;
  color: var(--ink);
}

input:focus, select:focus, button:focus, a:focus {
  outline: 3px solid rgba(13, 118, 110, 0.28);
  outline-offset: 2px;
}

.ad-slot {
  border: 1px dashed #aebbc6;
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  padding: 14px 16px;
  font-size: 15px;
}

.ad-slot span {
  display: block;
  color: #687684;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.ad-slot p { margin: 0; color: var(--muted); }
.ad-slot strong { color: var(--blue-ink); }
.ad-slot-sponsor, .ad-slot-leaderboard { margin-top: 18px; display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; align-items: center; }
.ad-slot-sponsor p, .ad-slot-leaderboard p { grid-column: 2; }
.ad-slot-inline { margin: 8px 0 0; }
.ad-slot-bottom { margin-top: 20px; }
.ad-slot-rail { min-height: 240px; display: grid; align-content: center; }

/* Version 2: Guided Financial Planner */
.layout-guided-planner {
  background: linear-gradient(180deg, #ffffff 0%, #f6fbfb 52%, #ffffff 100%);
}

.planner-hero {
  padding: 44px 0 40px;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(460px, 1.18fr);
  gap: 38px;
  align-items: start;
}

.hero-copy h1, .article-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p, .article-hero p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 22px;
}

.planner-progress {
  display: grid;
  gap: 12px;
  margin: 26px 0;
  border-left: 3px solid #c9dfe2;
  padding-left: 18px;
}

.planner-progress div {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
}

.planner-progress span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.trust-list {
  padding: 0;
  margin: 30px 0 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.trust-list li { padding-left: 30px; position: relative; color: var(--muted); }
.trust-list li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); position: absolute; left: 3px; top: 10px; }

.calculator-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.planner-panel { border-top: 6px solid var(--teal); }
.panel-header { padding: 24px 26px; border-bottom: 1px solid var(--line); background: var(--soft-blue); }
.panel-header h2 { margin: 0 0 6px; font-size: 30px; }
.panel-header p { margin: 0; color: var(--muted); }
.step-label { margin: 0 0 4px !important; color: var(--teal-dark) !important; font-weight: 800; font-size: 15px !important; }

.calculator-form { padding: 26px; display: grid; gap: 22px; }
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; }
label, legend { font-weight: 800; color: var(--ink); }
.hint { color: var(--muted); font-size: 15px; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 12px; }
.field-note {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.advanced-events {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px 16px;
}
.advanced-events summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}
.advanced-events fieldset {
  margin-top: 14px;
}
.event-row { display: grid; grid-template-columns: 28px 1fr minmax(120px, 180px); gap: 12px; align-items: center; }
.event-row input[type="checkbox"] { min-height: 24px; width: 24px; }
.event-row label { font-weight: 700; }

.results { margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--green-soft); padding: 20px; }
.results.warning { background: var(--amber-soft); }
.results h3 { margin: 0 0 12px; font-size: 25px; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.result-wide { grid-column: 1 / -1; }
.result-item { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.result-label { color: var(--muted); font-size: 14px; font-weight: 800; text-transform: uppercase; }
.result-value { display: block; margin-top: 4px; font-size: 24px; font-weight: 800; }
.result-explainer {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 16px;
}
.result-explainer h4 {
  margin: 0 0 6px;
  font-size: 19px;
}
.result-explainer p {
  margin: 0;
  color: var(--ink);
}
.disclaimer { color: var(--muted); font-size: 15px; margin: 14px 0 0; }
.print-summary {
  display: none;
}

.print-summary h4 {
  margin: 18px 0 10px;
  font-size: 20px;
}

.print-summary dl {
  margin: 0;
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
}

.print-summary dl div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.print-summary dl div:last-child {
  border-bottom: 0;
}

.print-summary dt,
.print-summary dd {
  margin: 0;
  padding: 10px 12px;
}

.print-summary dt {
  font-weight: 800;
  background: var(--soft);
}
.source-note {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
  font-size: 15px;
}
.source-note h3 {
  margin: 0 0 6px;
  font-size: 18px;
}
.source-note p {
  margin: 0 0 8px;
  color: var(--muted);
}
.source-note ul {
  margin: 0;
  padding-left: 20px;
}
.source-note li {
  margin-bottom: 4px;
}

.section { padding: 52px 0; }
.planner-next { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: 30px; align-items: start; }
.section h2 { margin: 0 0 14px; font-size: 38px; line-height: 1.1; }
.section p { color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; background: white; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--soft); font-size: 16px; }
tr:last-child td { border-bottom: 0; }

/* Version 1: Calm Civic Utility */
.layout-civic-utility { background: #ffffff; }
.civic-hero { width: min(980px, calc(100% - 40px)); padding: 44px 0 20px; }
.civic-hero h1 { font-size: clamp(38px, 4vw, 56px); }
.civic-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto 56px; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: start; }
.civic-article { width: auto; padding: 0; }
.utility-rail { display: grid; gap: 18px; position: sticky; top: 96px; }
.rail-box { border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: var(--soft); }
.rail-box p { color: var(--muted); margin: 8px 0 12px; }

/* Version 3: Editorial Medicare Guide */
.layout-editorial-guide { background: linear-gradient(90deg, #ffffff 0%, #ffffff 72%, #f5f8fa 72%, #f5f8fa 100%); }
.editorial-hero { width: min(1060px, calc(100% - 40px)); padding: 52px 0 24px; }
.editorial-hero h1 { font-size: clamp(42px, 5vw, 64px); max-width: 880px; }
.editorial-shell { width: min(1060px, calc(100% - 40px)); margin: 0 auto 60px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 46px; align-items: start; }
.article { width: min(880px, calc(100% - 40px)); margin: 0 auto; padding: 0 0 56px; }
.editorial-article { width: auto; padding: 0; font-size: 19px; }
.article h2 { font-size: 32px; margin-top: 38px; line-height: 1.15; }
.article li { margin-bottom: 10px; }
.callout { border-left: 5px solid var(--teal); background: var(--soft); padding: 18px 20px; border-radius: 0 8px 8px 0; }
.editorial-rail { display: grid; gap: 18px; position: sticky; top: 96px; }
.related-guides { border: 1px solid var(--line); border-radius: 8px; background: white; padding: 18px; display: grid; gap: 12px; }
.related-guides h2 { margin: 0 0 4px; font-size: 24px; }
.related-guides a { font-weight: 800; }

.site-footer { border-top: 1px solid var(--line); background: var(--soft); }
.footer-inner { padding: 28px 0; color: var(--muted); font-size: 15px; }

@media (max-width: 980px) {
  .site-header { position: static; }
  .header-inner { align-items: flex-start; flex-direction: column; padding: 18px 0; }
  .planner-hero, .planner-next, .civic-shell, .editorial-shell { grid-template-columns: 1fr; }
  .utility-rail, .editorial-rail { position: static; }
  .layout-editorial-guide { background: #ffffff; }
  .field-grid, .result-grid { grid-template-columns: 1fr; }
  .result-wide { grid-column: auto; }
  .ad-slot-sponsor, .ad-slot-leaderboard { grid-template-columns: 1fr; }
  .ad-slot-sponsor p, .ad-slot-leaderboard p { grid-column: auto; }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .header-inner, .section, .hero, .footer-inner, .article, .article-hero, .civic-shell, .editorial-shell, .ad-slot-sponsor, .ad-slot-leaderboard { width: min(100% - 28px, 1180px); }
  .hero-copy h1, .article-hero h1 { font-size: 38px; }
  .hero-copy p, .article-hero p { font-size: 19px; }
  .event-row { grid-template-columns: 28px 1fr; }
  .event-row input[type="number"] { grid-column: 2; }
}

@media print {
  .site-header, .ad-slot, button, .site-footer { display: none; }
  .hero, .planner-hero { display: block; padding: 0; }
  .calculator-panel { box-shadow: none; }
}

.scenario-links {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 30px;
  align-items: start;
}

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

.scenario-link-grid a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 16px 18px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(23, 33, 43, 0.05);
}

.scenario-link-grid a:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list dt {
  font-weight: 800;
  color: var(--ink);
}

.faq-list dd {
  margin: 0 0 10px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .scenario-links, .scenario-link-grid { grid-template-columns: 1fr; }
}
