/* ==========================================================================
   No Paycheck Plan — shared stylesheet
   Used by index.html, faq.html, about.html.

   Each <body> carries a page class (page-calculator / page-faq / page-about)
   so the handful of rules that legitimately differ per page — content width,
   logo size, heading spacing — can be scoped here instead of duplicated.
   Everything else is shared. Edit this one file to restyle the whole site.
   ========================================================================== */

:root {
  --paper: #EDEFEA;
  --paper-raised: #F6F7F3;
  --ink: #16241F;
  --teal: #1F3B36;
  --teal-soft: #3E5A54;
  --gold: #A5822F;
  --gold-soft: #D9C48C;
  --line: #D3D2C6;
  --good: #2E6B4F;
  --good-bg: #E4EEE7;
  --bad: #9A4430;
  --bad-bg: #F3E5DF;
  --c-inv: #2F5650;
  --c-ira: #A5822F;
  --c-ss: #4C6B8A;
  --c-other: #8C5B72;
}
* { box-sizing: border-box; }
body { margin:0; background:var(--paper); color:var(--ink); font-family:'IBM Plex Sans',sans-serif; line-height:1.5; }
body.page-faq { line-height:1.6; }
body.page-about { line-height:1.65; }

/* ---------- Site nav (shared component, few page-scoped sizes) ---------- */
.sitenav { border-bottom:1px solid var(--line); background:var(--paper-raised); }
.sitenav-inner { max-width:1160px; margin:0 auto; padding:14px 24px; display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.sitenav .brand { display:flex; align-items:center; text-decoration:none; }
.sitenav .brand img { height:46px; width:auto; display:block; }
.sitenav nav { display:flex; gap:20px; align-items:center; }
.sitenav nav a { font-family:'IBM Plex Mono',monospace; font-size:14.5px; letter-spacing:0.03em; text-transform:uppercase; color:var(--teal-soft); text-decoration:none; }
.sitenav nav a:hover, .sitenav nav a[aria-current="page"] { color:var(--gold); }

/* ---------- Page wrap width (differs per page on purpose) ---------- */
.wrap { max-width:1160px; margin:0 auto; padding:44px 24px 72px; }

/* ---------- Shared header / hero ---------- */
header { margin-bottom:20px; border-bottom:1px solid var(--line); padding-bottom:24px; }
.badge { display:inline-flex; align-items:center; gap:6px; font-family:'IBM Plex Mono',monospace; font-size:13px; letter-spacing:0.08em; text-transform:uppercase; color:var(--teal-soft); border:1px solid var(--line); background:var(--paper-raised); padding:5px 10px; border-radius:3px; margin-bottom:14px; }
body.page-faq .badge, body.page-about .badge { margin-bottom:16px; }
.badge::before { content:"●"; color:var(--good); font-size:10px; }
h1 { font-family:'Fraunces',serif; font-weight:500; font-size:clamp(24px,4vw,38px); margin:0 0 8px; letter-spacing:-0.01em; }
body.page-faq h1, body.page-about h1 { font-size:clamp(26px,4vw,38px); margin:0 0 10px; }
header p { color:var(--teal-soft); font-size:16.5px; margin:0; }
.intro { color:var(--teal-soft); font-size:17px; max-width:600px; margin:0 0 36px; }
body.page-about .intro { margin:0 0 8px; }

/* ---------- Calculator page: top status bar ---------- */
.storage-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; background:var(--paper-raised); border:1px solid var(--line); border-radius:5px; padding:10px 16px; margin:0 0 24px; font-size:14.5px; color:var(--teal-soft); }
.storage-bar button { border:1px solid var(--line); background:#fff; color:var(--teal); font-size:14px; font-weight:500; padding:6px 12px; border-radius:4px; cursor:pointer; white-space:nowrap; }
.storage-bar button:hover { border-color:var(--bad); color:var(--bad); }

/* ---------- Calculator page: two-column layout ---------- */
.layout { display:grid; grid-template-columns: 1fr 380px; gap:20px; align-items:start; }
.col-left { display:flex; flex-direction:column; gap:18px; min-width:0; }
.col-right { position: sticky; top: 18px; }
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .col-right { position: static; top:auto; }
}

/* ---------- Calculator page: panels ---------- */
.panel { background:var(--paper-raised); border:1px solid var(--line); border-radius:6px; padding:20px 22px; }
.panel h2 { font-family:'Fraunces',serif; font-weight:500; font-size:17px; margin:0 0 3px; text-transform:uppercase; letter-spacing:0.05em; }
.panel .sub { font-size:14px; color:var(--teal-soft); margin:0 0 16px; }

.panel-total-row { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:16px; padding-bottom:14px; border-bottom:1px solid var(--line); }
.panel-total-row .label { font-size:15px; font-weight:500; color:var(--teal); }
.panel-total-row .value { font-family:'IBM Plex Mono',monospace; font-size:23px; color:var(--ink); }

.accordion-item { border:1px solid var(--line); border-radius:5px; background:#fff; margin-bottom:9px; overflow:hidden; }
.accordion-item:last-child { margin-bottom:0; }
.accordion-header { display:flex; justify-content:space-between; align-items:center; padding:12px 14px; cursor:pointer; user-select:none; gap:10px; }
.accordion-header .cat-name { font-size:15px; font-weight:500; color:var(--teal); display:flex; align-items:center; gap:8px; min-width:0; }
.accordion-header .cat-name .hint2 { font-weight:400; color:var(--teal-soft); font-size:13px; }
.accordion-header .chevron { display:inline-block; transition:transform 0.15s ease; color:var(--teal-soft); font-size:12px; flex-shrink:0; }
.accordion-item.open .chevron { transform:rotate(90deg); }
.accordion-header .cat-subtotal { font-family:'IBM Plex Mono',monospace; font-size:15.5px; color:var(--teal-soft); white-space:nowrap; }
.accordion-body { max-height:0; overflow:hidden; transition:max-height 0.2s ease; border-top:1px solid transparent; }
.accordion-item.open .accordion-body { max-height:700px; border-top-color:var(--line); }
.accordion-body-inner { padding:12px 14px 14px; }

.line-row { display:grid; grid-template-columns: 1fr 118px 30px; gap:8px; align-items:center; margin-bottom:8px; }
.line-row input.line-label { border:1px solid var(--line); border-radius:4px; padding:8px 10px; font-size:15px; font-family:'IBM Plex Sans',sans-serif; color:var(--ink); background:#fff; width:100%; min-width:0; }
.line-row .num-input { position:relative; }
.line-row .num-input span.prefix { position:absolute; left:9px; top:50%; transform:translateY(-50%); font-family:'IBM Plex Mono',monospace; color:var(--teal-soft); font-size:14.5px; pointer-events:none; }
.line-row input.line-amount { width:100%; padding:8px 8px 8px 20px; border:1px solid var(--line); border-radius:4px; font-family:'IBM Plex Mono',monospace; font-size:15px; color:var(--ink); background:#fff; }
.line-row .remove-btn { border:none; background:transparent; color:var(--teal-soft); font-size:20px; cursor:pointer; line-height:1; padding:8px; border-radius:4px; min-width:32px; min-height:32px; }
.line-row .remove-btn:hover { color:var(--bad); background:var(--bad-bg); }

.add-line-btn { border:1px dashed var(--line); background:transparent; color:var(--teal-soft); font-size:14.5px; padding:8px 10px; border-radius:4px; cursor:pointer; width:100%; text-align:left; margin-top:2px; }
.add-line-btn:hover { border-color:var(--gold); color:var(--gold); }

/* ---------- Calculator page: form fields ---------- */
input:focus, select:focus, input[type=range]:focus { outline:2px solid var(--gold-soft); outline-offset:1px; }

.field { margin-bottom:15px; }
.field:last-child { margin-bottom:0; }
.field label { display:flex; justify-content:space-between; align-items:baseline; font-size:14.5px; font-weight:500; margin-bottom:6px; color:var(--teal); gap:8px; }
.field label .hint { font-weight:400; color:var(--teal-soft); font-size:13px; text-align:right; }
.num-input.standalone { position:relative; }
.num-input.standalone span.prefix { position:absolute; left:12px; top:50%; transform:translateY(-50%); font-family:'IBM Plex Mono',monospace; color:var(--teal-soft); font-size:16px; pointer-events:none; }
.num-input.standalone input { width:100%; padding:10px 12px 10px 26px; border:1px solid var(--line); border-radius:4px; background:#fff; font-family:'IBM Plex Mono',monospace; font-size:16px; color:var(--ink); }
.num-input.standalone.no-prefix input { padding-left:12px; }
.field select { width:100%; padding:9px 10px; border:1px solid var(--line); border-radius:4px; background:#fff; font-family:'IBM Plex Sans',sans-serif; font-size:15px; color:var(--ink); }

.two-col { display:grid; grid-template-columns:1fr 1fr; grid-template-rows:auto auto; column-gap:12px; row-gap:6px; }
.two-col .field { display:contents; }
.two-col .field label { grid-row:1; margin-bottom:0; }
.two-col .field > .num-input.standalone { grid-row:2; }
.two-col .field:nth-child(1) label, .two-col .field:nth-child(1) > .num-input.standalone { grid-column:1; }
.two-col .field:nth-child(2) label, .two-col .field:nth-child(2) > .num-input.standalone { grid-column:2; }

.three-col { display:grid; grid-template-columns:1fr 1fr 1fr; grid-template-rows:auto auto; column-gap:12px; row-gap:6px; margin-bottom:6px; }
.three-col .field { display:contents; }
.three-col .field label { grid-row:1; margin-bottom:0; }
.three-col .field > .num-input.standalone { grid-row:2; }
.three-col .field:nth-child(1) label, .three-col .field:nth-child(1) > .num-input.standalone { grid-column:1; }
.three-col .field:nth-child(2) label, .three-col .field:nth-child(2) > .num-input.standalone { grid-column:2; }
.three-col .field:nth-child(3) label, .three-col .field:nth-child(3) > .num-input.standalone { grid-column:3; }
@media (max-width: 640px) {
  .three-col { grid-template-columns:1fr; grid-template-rows:auto; }
  .three-col .field { display:block; margin-bottom:12px; }
}

/* ---------- Calculator page: claim-age slider + stats ---------- */
.age-slider-row { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.age-slider-row .age-display { font-family:'Fraunces',serif; font-size:32px; color:var(--teal); }
.age-slider-row .age-display span { font-size:15px; font-family:'IBM Plex Sans',sans-serif; color:var(--teal-soft); }
input[type=range] { width:100%; accent-color:var(--gold); }
.scale-labels { display:flex; justify-content:space-between; font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--teal-soft); margin-top:4px; }

.stat-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:18px 0; }
.stat-card { border:1px solid var(--line); background:#fff; border-radius:5px; padding:13px 15px; min-width:0; }
.stat-card .label { font-size:12.5px; text-transform:uppercase; letter-spacing:0.04em; color:var(--teal-soft); margin-bottom:5px; }
.stat-card .value { font-family:'IBM Plex Mono',monospace; font-size:21px; color:var(--ink); }

.verdict { border-radius:5px; padding:15px 17px; margin:14px 0; font-size:15.5px; border:1px solid transparent; }
.verdict.good { background:var(--good-bg); border-color:#c7dccd; color:var(--good); }
.verdict.bad { background:var(--bad-bg); border-color:#e3c9bc; color:var(--bad); }
.verdict b { font-family:'IBM Plex Mono',monospace; font-weight:600; }

/* ---------- Calculator page: runway + distribution chart ---------- */
.runway-title { font-size:14px; font-weight:500; color:var(--teal); margin:20px 0 8px; }
svg.runway { width:100%; height:auto; display:block; }
.runway-caption { font-family:'IBM Plex Mono',monospace; font-size:13px; color:var(--teal-soft); margin-top:8px; }

.legacy-note { border:1px solid var(--line); background:var(--paper-raised); border-radius:5px; padding:13px 15px; margin-top:14px; font-size:13px; color:var(--teal); }
.legacy-note b { font-family:'IBM Plex Mono',monospace; }

svg.distchart { width:100%; height:auto; display:block; cursor:crosshair; }
.legend { display:flex; flex-wrap:wrap; gap:14px 18px; margin-top:12px; }
.legend-item { display:flex; align-items:center; gap:6px; font-size:13.5px; color:var(--teal-soft); font-family:'IBM Plex Mono',monospace; }
.legend-item .swatch { width:10px; height:10px; border-radius:2px; display:inline-block; }

.assumptions { margin-top:8px; font-family:'IBM Plex Mono',monospace; font-size:12.5px; color:var(--teal-soft); }
.assumptions summary { cursor:pointer; color:var(--teal); font-family:'IBM Plex Sans',sans-serif; font-size:14px; margin-bottom:8px; }
.assumptions ul { margin:8px 0 0; padding-left:16px; }
.assumptions li { margin-bottom:4px; }

/* ---------- About page ---------- */
section.block { margin:36px 0; }
section.block h2 { font-family:'Fraunces',serif; font-weight:500; font-size:22px; color:var(--teal); margin:0 0 10px; }
section.block p { font-size:16.5px; margin:0 0 12px; }
section.block p:last-child { margin-bottom:0; }

/* ---------- FAQ page ---------- */
.faq-item { background:var(--paper-raised); border:1px solid var(--line); border-radius:6px; padding:20px 24px; margin-bottom:14px; }
.faq-item h2 { font-family:'Fraunces',serif; font-weight:500; font-size:19px; margin:0 0 8px; color:var(--teal); }
.faq-item p { margin:0; font-size:16px; color:var(--ink); }

/* ---------- Shared CTA block (about + faq) ---------- */
.cta { text-align:center; margin:40px 0; padding:28px; border:1px dashed var(--line); border-radius:6px; }
body.page-about .cta { margin:40px 0 8px; }
.cta p { margin:0 0 14px; color:var(--teal-soft); font-size:16px; }
.cta a.btn { display:inline-block; background:var(--teal); color:#fff; text-decoration:none; padding:11px 22px; border-radius:4px; font-size:15.5px; font-weight:500; }
.cta a.btn:hover { background:var(--gold); }

/* ---------- Shared footer ---------- */
footer { margin-top:32px; padding-top:18px; border-top:1px solid var(--line); font-size:13.5px; color:var(--teal-soft); }
footer p { max-width:760px; margin:0 0 8px; }
body.page-calculator footer p { max-width:none; }
footer a { color:var(--teal); }
footer button.faq-link { color:var(--teal); font-weight:500; text-decoration:underline; cursor:pointer; background:none; border:none; padding:0; font-size:13.5px; font-family:'IBM Plex Sans',sans-serif; }
footer button.faq-link:hover { color:var(--gold); }

/* ---------- Quick FAQ modal (calculator page) ---------- */
dialog#faqModal { border:1px solid var(--line); border-radius:8px; padding:0; max-width:560px; width:90%; background:var(--paper-raised); color:var(--ink); }
dialog#faqModal::backdrop { background:rgba(22,36,31,0.45); }
.faq-inner { padding:26px 28px; max-height:80vh; overflow-y:auto; position:relative; }
.faq-inner h3 { font-family:'Fraunces',serif; font-weight:500; font-size:22px; margin:0 0 4px; }
.faq-inner .faq-close { position:absolute; top:14px; right:16px; border:none; background:transparent; font-size:22px; color:var(--teal-soft); cursor:pointer; line-height:1; }
.faq-inner dt { font-weight:600; color:var(--teal); font-size:15.5px; margin-top:16px; }
.faq-inner dd { margin:6px 0 0; font-size:15px; color:var(--ink); line-height:1.55; }
.faq-inner dt:first-of-type { margin-top:0; }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .sitenav-inner { padding:12px 16px; }
  .sitenav nav { gap:14px; }
  .sitenav .brand img { height:34px; }

  .wrap { padding:28px 14px 56px; }

  .panel { padding:16px 14px; }
  .two-col { grid-template-columns:1fr; }
  .line-row { grid-template-columns:1fr 92px 30px; gap:6px; }
  .line-row input.line-label { font-size:14px; padding:8px; }
  .line-row input.line-amount { font-size:14px; padding:8px 6px 8px 18px; }
  .stat-row { gap:8px; }
  .stat-card { padding:11px 12px; }
  .stat-card .value { font-size:19px; }
  .age-slider-row .age-display { font-size:28px; }

  .faq-item { padding:16px 18px; }
}
