/* Quarterly Tax Plan — calm utility, paper-feel */

:root {
  /* warm paper tones */
  --paper: oklch(0.985 0.012 80);
  --paper-2: oklch(0.965 0.014 80);
  --paper-3: oklch(0.94 0.016 78);
  --line: oklch(0.86 0.018 78);
  --line-soft: oklch(0.92 0.014 78);

  /* warm ink */
  --ink: oklch(0.22 0.018 60);
  --ink-2: oklch(0.38 0.018 60);
  --ink-3: oklch(0.55 0.016 60);

  /* single warm accent */
  --ochre: oklch(0.66 0.14 62);
  --ochre-deep: oklch(0.52 0.14 58);
  --ochre-wash: oklch(0.94 0.045 78);

  /* status */
  --sage: oklch(0.58 0.07 150);
  --sage-wash: oklch(0.94 0.03 150);
  --rust: oklch(0.55 0.13 35);
  --rust-wash: oklch(0.95 0.035 40);

  --radius: 6px;
  --radius-lg: 10px;

  --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--paper); }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* paper texture using subtle horizontal rule lines */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to bottom, transparent 27px, oklch(0.86 0.018 78 / 0.18) 28px);
  background-size: 100% 28px;
  z-index: 0;
  opacity: 0.5;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.08; margin: 0; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.15; margin: 0 0 0.5rem; }
h3 { font-size: 1.25rem; line-height: 1.25; margin: 0 0 0.4rem; }
h4 { font-size: 1rem; line-height: 1.3; margin: 0 0 0.4rem; }

p { margin: 0 0 1em; }
a { color: var(--ochre-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- layout ---------- */
.shell { position: relative; z-index: 1; }
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
.calc-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
}
@media (max-width: 1024px) {
  .calc-wrap { grid-template-columns: 1fr; }
  .sidebar-col { display: none; }
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(0.985 0.012 80 / 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  border-radius: 4px;
}
.brand-name { font-family: var(--serif); font-size: 1.05rem; font-weight: 500; }
.brand-name .tld { color: var(--ink-3); font-weight: 400; }

.topnav { display: flex; gap: 22px; }
.topnav a { color: var(--ink-2); text-decoration: none; font-size: 0.9rem; }
.topnav a:hover { color: var(--ink); }
@media (max-width: 720px) { .topnav { display: none; } }

.deadline-pill {
  font-family: var(--mono);
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--ochre);
  background: var(--ochre-wash);
  color: var(--ochre-deep);
  border-radius: 999px;
  white-space: nowrap;
}
.deadline-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ochre); }

/* ---------- hero ---------- */
.hero { padding: 56px 0 16px; }
.hero h1 .accent { color: var(--ochre-deep); }
.hero .lede {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink-2);
  max-width: 640px;
  margin: 18px 0 0;
  line-height: 1.5;
}
.hero .meta {
  margin-top: 22px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
}
.hero .meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero .meta .check::before { content: "✓"; color: var(--sage); margin-right: 2px; }

/* ---------- ad slot ---------- */
.ad-slot {
  margin: 28px auto;
  display: flex; flex-direction: column;
  align-items: center;
  width: 100%;
}
.ad-slot-label { display: none; font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.ad-slot:has(ins[data-ad-status="filled"]) .ad-slot-label { display: block; }
.ad-slot ins[data-ad-status="unfilled"] { display: none; }
.ad-slot--top-banner { min-height: 90px; }
.ad-slot--pre-result { min-height: 250px; max-width: 300px; }
.ad-slot--mid-content { min-height: 90px; }
.ad-slot--sidebar { min-height: 600px; }
.ad-slot--mobile-sticky { min-height: 50px; position: fixed; bottom: 0; left: 0; right: 0; background: var(--paper-2); border-top: 1px solid var(--line); z-index: 40; padding: 6px 16px; display: none; }
@media (max-width: 720px) { .ad-slot--mobile-sticky { display: flex; } }
.ad-slot--mobile-sticky .close-sticky { position: absolute; top: 50%; transform: translateY(-50%); right: 6px; background: none; border: none; color: var(--ink-3); font-size: 1rem; cursor: pointer; padding: 4px 8px; }

.sidebar-col .ad-slot--sidebar {
  position: sticky;
  top: 88px;
}

/* ---------- calculator card ---------- */
.calc-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0;
  margin: 24px 0;
  overflow: hidden;
}
.calc-head {
  padding: 20px 28px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px;
  background: var(--paper-2);
}
.calc-head h2 { font-size: 1.15rem; margin: 0; }
.calc-head .sub { color: var(--ink-3); font-size: 0.85rem; font-family: var(--mono); }

.input-grid {
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 28px;
}
@media (max-width: 640px) {
  .input-grid { grid-template-columns: 1fr; padding: 20px; gap: 18px; }
  .calc-head { padding: 16px 20px; }
}
.input-grid .full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.field .hint { font-size: 0.78rem; color: var(--ink-3); margin-top: 2px; }

.text-in, .select-in {
  font-family: var(--mono);
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  width: 100%;
}
.text-in:focus, .select-in:focus { border-color: var(--ochre); box-shadow: 0 0 0 3px var(--ochre-wash); }
.text-in.with-prefix { padding-left: 28px; }
.input-affix { position: relative; }
.input-affix .prefix {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); color: var(--ink-3); font-size: 0.95rem;
  pointer-events: none;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  width: fit-content;
}
.seg button {
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--ink-2);
  cursor: pointer;
  border-right: 1px solid var(--line);
}
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--ink); color: var(--paper); }
.seg button:hover:not(.on) { background: var(--paper-3); }

.qtr-paid-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 520px) { .qtr-paid-row { grid-template-columns: repeat(2, 1fr); } }
.qtr-paid { display: flex; flex-direction: column; gap: 4px; }
.qtr-paid .qlabel { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-3); letter-spacing: 0.08em; }
.qtr-paid .qdate { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-2); }

/* ---------- results: calendar ---------- */
.calendar-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin: 24px 0;
  overflow: hidden;
}
.cal-head {
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper-2);
}
.cal-head .label { margin-bottom: 6px; }
.cal-head .answer {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.1;
  margin: 0;
}
.cal-head .answer .amount {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--ochre-deep);
  letter-spacing: -0.01em;
}
.cal-head .answer .by { color: var(--ink-2); }
.cal-head .answer-sub { color: var(--ink-2); margin-top: 8px; font-size: 0.95rem; }
.cal-head .answer-sub .num { color: var(--ink); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-soft);
}
@media (max-width: 720px) { .cal-grid { grid-template-columns: 1fr 1fr; } }

.qtr-cell {
  padding: 18px 18px 20px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 4px;
  background: var(--paper);
  position: relative;
}
.qtr-cell:last-child { border-right: none; }
@media (max-width: 720px) {
  .qtr-cell:nth-child(2n) { border-right: none; }
}
.qtr-cell.next { background: var(--ochre-wash); }
.qtr-cell.paid { background: var(--sage-wash); }
.qtr-cell.late { background: var(--rust-wash); }
.qtr-cell .qlabel { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; color: var(--ink-3); text-transform: uppercase; }
.qtr-cell .qdate {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.1;
  margin-top: 2px;
  color: var(--ink);
}
.qtr-cell.next .qdate { color: var(--ochre-deep); }
.qtr-cell .qcovers { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-3); margin-top: 2px; letter-spacing: 0.02em; }
.qtr-cell .qamount {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  margin-top: 12px;
  letter-spacing: -0.01em;
}
.qtr-cell.paid .qamount { color: var(--sage); }
.qtr-cell .qstatus {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 2px;
}
.qtr-cell.paid .qstatus { color: var(--sage); }
.qtr-cell.next .qstatus { color: var(--ochre-deep); }
.qtr-cell.late .qstatus { color: var(--rust); }
.qtr-cell .countdown {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ochre-deep);
  margin-top: 8px;
}

/* ---------- breakdown panels ---------- */
.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 24px 0;
}
@media (max-width: 720px) { .panels { grid-template-columns: 1fr; } }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
}
.panel h3 { font-family: var(--serif); margin: 0 0 14px; font-size: 1.05rem; }
.panel .panel-sub { color: var(--ink-3); font-size: 0.85rem; margin-bottom: 14px; }

.row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); gap: 12px; }
.row:last-child { border-bottom: none; }
.row .k { color: var(--ink-2); font-size: 0.92rem; }
.row .k small { color: var(--ink-3); font-size: 0.75rem; display: block; }
.row .v { font-family: var(--mono); font-size: 0.95rem; color: var(--ink); white-space: nowrap; }
.row.total { border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 12px; border-bottom: none; }
.row.total .k { font-weight: 600; color: var(--ink); }
.row.total .v { font-weight: 500; }

.compare-bar { margin-top: 8px; }
.compare-bar .opt {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--paper-2);
}
.compare-bar .opt.chosen {
  border-color: var(--ochre);
  background: var(--ochre-wash);
}
.compare-bar .opt .opt-k { font-size: 0.9rem; color: var(--ink); }
.compare-bar .opt .opt-k small { display: block; color: var(--ink-3); font-size: 0.75rem; margin-top: 2px; }
.compare-bar .opt .opt-v { font-family: var(--mono); font-size: 1rem; color: var(--ink); }
.compare-bar .opt.chosen .opt-v { color: var(--ochre-deep); font-weight: 500; }
.compare-bar .chosen-note {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--ink-2);
  background: var(--paper-2);
  padding: 10px 12px;
  border-radius: var(--radius);
  border-left: 3px solid var(--ochre);
}

/* state schedule */
.state-note {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--paper-2);
  border-radius: var(--radius);
  border-left: 3px solid var(--ink);
  font-size: 0.88rem;
}
.state-note .label { margin-bottom: 4px; }

/* annualized notice */
.notice {
  margin: 18px 0;
  padding: 16px 20px;
  background: var(--paper);
  border: 1px solid var(--ochre);
  border-radius: var(--radius);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.notice .ico { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; color: var(--ochre-deep); }
.notice h4 { margin: 0 0 4px; color: var(--ochre-deep); }
.notice p { margin: 0; font-size: 0.9rem; color: var(--ink-2); }

/* pay actions */
.pay-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.pay-actions a {
  font-family: var(--mono);
  font-size: 0.82rem;
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  color: var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pay-actions a:hover { background: var(--ink); color: var(--paper); }
.pay-actions a.primary { background: var(--ink); color: var(--paper); }
.pay-actions a.primary:hover { background: var(--ochre-deep); border-color: var(--ochre-deep); color: var(--paper); }
.pay-actions .arrow { font-family: var(--mono); }

/* ---------- editorial sections ---------- */
.editorial { padding: 56px 0 24px; }
.editorial h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.6vw, 2rem);
  margin: 48px 0 14px;
}
.editorial h2:first-of-type { margin-top: 0; }
.editorial h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  margin: 28px 0 8px;
  color: var(--ink);
}
.editorial .col {
  max-width: 680px;
}
.editorial p { color: var(--ink-2); }
.editorial p strong { color: var(--ink); }
.editorial ul { color: var(--ink-2); padding-left: 20px; }
.editorial li { margin: 6px 0; }

.callout {
  border-left: 3px solid var(--ochre);
  padding: 4px 18px;
  background: var(--ochre-wash);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 18px 0;
}
.callout p { color: var(--ink); }

.harbor-math {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  background: var(--paper-2);
  margin: 16px 0;
  font-family: var(--mono);
  font-size: 0.9rem;
}
.harbor-math .step { padding: 6px 0; display: flex; justify-content: space-between; gap: 12px; }
.harbor-math .step.eq { border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 12px; font-weight: 500; }
.harbor-math .step .k { color: var(--ink-2); }

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--line-soft);
  padding: 18px 0;
}
.faq details:first-of-type { border-top: 1px solid var(--line-soft); }
.faq summary {
  font-family: var(--serif);
  font-size: 1.1rem;
  cursor: pointer;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 1.4rem;
  color: var(--ink-3);
  transition: transform 200ms ease;
}
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding-top: 10px; color: var(--ink-2); max-width: 680px; }

/* ---------- footer ---------- */
footer.site-footer {
  margin-top: 60px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
.footer-col h4 {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 14px;
  font-weight: 400;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 6px 0; }
.footer-col a { color: var(--ink-2); text-decoration: none; font-size: 0.92rem; }
.footer-col a:hover { color: var(--ink); text-decoration: underline; }
.footer-tagline { color: var(--ink-2); font-size: 0.92rem; margin: 8px 0 0; max-width: 320px; }

.footer-divider { height: 1px; background: var(--line); margin: 36px 0 22px; }
.legal {
  font-size: 0.82rem;
  color: var(--ink-3);
  max-width: 880px;
  line-height: 1.55;
}
.legal strong { color: var(--ink-2); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 22px;
  font-size: 0.82rem;
  color: var(--ink-3);
}
.footer-bottom a { color: var(--ink-2); text-decoration: none; }
.footer-bottom a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- modal ---------- */
.scrim {
  position: fixed; inset: 0;
  background: oklch(0.22 0.018 60 / 0.5);
  display: grid; place-items: center;
  z-index: 100;
  padding: 24px;
}
.modal {
  background: var(--paper);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 86vh;
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -20px oklch(0.22 0.018 60 / 0.3);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h3 { margin: 0; font-size: 1.1rem; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; color: var(--ink-2);
  padding: 4px 8px; line-height: 1;
}
.modal-close:hover { color: var(--ink); }
.modal-body {
  overflow-y: auto;
  padding: 22px 28px;
}
.modal-body p, .modal-body li { color: var(--ink-2); font-size: 0.95rem; }
.modal-body h4 {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: 22px 0 8px;
}
.modal-body h4:first-child { margin-top: 0; }
.modal-foot {
  border-top: 1px solid var(--line-soft);
  padding: 14px 24px;
  display: flex; justify-content: flex-end;
}

.btn {
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 9px 18px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  cursor: pointer;
}
.btn:hover { background: var(--ochre-deep); border-color: var(--ochre-deep); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--paper-3); color: var(--ink); }

.linklike {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--ochre-deep);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px;
}
.linklike:hover { color: var(--ink); }

/* ---------- print ---------- */
@media print {
  body::before, .topbar, .ad-slot, .pay-actions, footer.site-footer, .editorial { display: none !important; }
  body { background: white; color: black; font-size: 11pt; }
  .calc-card, .calendar-card, .panel { border: 1px solid #999; break-inside: avoid; box-shadow: none; }
  .qtr-cell.next { background: #f3eee0 !important; }
  .qtr-cell.paid { background: #eef4ee !important; }
  .hero { padding-top: 0; }
}
