  :root {
    --ink: #12333f;
    --paper: #f4f6f5;
    --card: #ffffff;
    --accent: #0e7c66;
    --accent-soft: #e2efeb;
    --highlight: #c47a17;
    --highlight-soft: #f6ead6;
    --text: #22383f;
    --muted: #5d7176;
    --line: #d5dedb;
    --masthead-ink: #12333f;
    --masthead-text: #f4f6f5;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Malayalam", sans-serif;
    --mono: "SF Mono", "Cascadia Code", Consolas, Menlo, monospace;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --ink: #0d2129;
      --paper: #101d22;
      --card: #17282e;
      --accent: #3aa98f;
      --accent-soft: #1b3a35;
      --highlight: #d99a3d;
      --highlight-soft: #3a2f1a;
      --text: #d8e2e0;
      --muted: #8fa3a3;
      --line: #2a3d42;
      --masthead-ink: #0d2129;
      --masthead-text: #e8efed;
    }
  }
  :root[data-theme="light"] {
    --ink: #12333f; --paper: #f4f6f5; --card: #ffffff; --accent: #0e7c66;
    --accent-soft: #e2efeb; --highlight: #c47a17; --highlight-soft: #f6ead6;
    --text: #22383f; --muted: #5d7176; --line: #d5dedb;
    --masthead-ink: #12333f; --masthead-text: #f4f6f5;
  }
  :root[data-theme="dark"] {
    --ink: #0d2129; --paper: #101d22; --card: #17282e; --accent: #3aa98f;
    --accent-soft: #1b3a35; --highlight: #d99a3d; --highlight-soft: #3a2f1a;
    --text: #d8e2e0; --muted: #8fa3a3; --line: #2a3d42;
    --masthead-ink: #0d2129; --masthead-text: #e8efed;
  }

  * { box-sizing: border-box; }
  body {
    margin: 0; background: var(--paper); color: var(--text);
    font-family: var(--sans); line-height: 1.6; font-size: 16px;
  }
  a { color: var(--accent); text-decoration: none; }
  a:hover { text-decoration: underline; }
  a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--highlight); outline-offset: 2px;
  }
  .wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

  /* ── Masthead ─────────────────────────── */
  .topline {
    background: var(--masthead-ink); color: var(--masthead-text);
    font-size: 12.5px; letter-spacing: .06em;
  }
  .topline .wrap { display: flex; justify-content: space-between; padding-top: 6px; padding-bottom: 6px; gap: 12px; flex-wrap: wrap; }
  .topline span { opacity: .85; font-family: var(--mono); font-variant-numeric: tabular-nums; }

  .masthead { background: var(--masthead-ink); color: var(--masthead-text); border-bottom: 4px double rgba(244,246,245,.35); }
  .masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 22px; padding-bottom: 22px; flex-wrap: wrap; }
  .brand { display: flex; align-items: center; gap: 14px; }
  .seal {
    width: 52px; height: 52px; border-radius: 50%; flex: none;
    border: 2px solid var(--masthead-text); display: grid; place-items: center;
    font-family: var(--serif); font-size: 24px; font-weight: 700;
  }
  .brand h1 { font-family: var(--serif); font-size: clamp(26px, 4vw, 38px); margin: 0; letter-spacing: .01em; line-height: 1.1; }
  .brand p { margin: 2px 0 0; font-size: 13px; opacity: .8; letter-spacing: .04em; }
  .masthead-search { display: flex; gap: 0; }
  .masthead-search input {
    padding: 9px 14px; border: 1px solid rgba(244,246,245,.4); background: transparent;
    color: var(--masthead-text); border-radius: 4px 0 0 4px; min-width: 200px; font-size: 14px;
  }
  .masthead-search input::placeholder { color: rgba(244,246,245,.55); }
  .masthead-search button {
    padding: 9px 16px; border: 1px solid var(--masthead-text); background: var(--masthead-text);
    color: var(--masthead-ink); font-weight: 600; border-radius: 0 4px 4px 0; cursor: pointer; font-size: 14px;
  }

  nav.cats { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  nav.cats .wrap { display: flex; gap: 4px; overflow-x: auto; padding-top: 0; padding-bottom: 0; }
  nav.cats a {
    padding: 13px 14px; color: var(--text); font-size: 14px; font-weight: 600;
    white-space: nowrap; border-bottom: 3px solid transparent;
  }
  nav.cats a:hover { text-decoration: none; border-bottom-color: var(--accent); color: var(--accent); }
  nav.cats a.active { border-bottom-color: var(--accent); color: var(--accent); }

  /* ── Ad slots ─────────────────────────── */
  .ad {
    border: 1.5px dashed var(--line); border-radius: 6px; background: var(--card);
    display: grid; place-items: center; color: var(--muted); text-align: center;
    font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  }
  .ad small { display: block; font-family: var(--mono); margin-top: 4px; text-transform: none; letter-spacing: 0; }
  .ad.leaderboard { height: 90px; margin: 20px auto; max-width: 728px; }
  .ad.box { height: 250px; }
  .ad.infeed { height: 100px; margin: 8px 0; }

  /* ── Hero ─────────────────────────────── */
  .hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; margin: 8px 0 36px; }
  .feature {
    background: var(--card); border: 1px solid var(--line); border-radius: 8px;
    padding: 30px 32px; display: flex; flex-direction: column; gap: 12px;
  }
  .eyebrow {
    font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--highlight);
  }
  .feature h2 { font-family: var(--serif); font-size: clamp(24px, 3vw, 34px); margin: 0; line-height: 1.2; text-wrap: balance; }
  .feature p.dek { margin: 0; color: var(--muted); max-width: 60ch; }
  .meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .btn {
    display: inline-block; background: var(--accent); color: #fff; padding: 10px 20px;
    border-radius: 5px; font-weight: 600; font-size: 14px; border: none; cursor: pointer;
  }
  .btn:hover { text-decoration: none; filter: brightness(1.08); }
  .btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }

  /* Calculator */
  .calc {
    background: var(--ink); color: var(--paper); border-radius: 8px; padding: 26px 28px;
    display: flex; flex-direction: column; gap: 14px;
  }
  :root[data-theme="dark"] .calc, .calc { border: 1px solid var(--line); }
  .calc h3 { margin: 0; font-family: var(--serif); font-size: 21px; color: var(--masthead-text); }
  .calc label { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; color: var(--masthead-text); }
  .calc .row { display: flex; gap: 10px; }
  .calc input, .calc select {
    width: 100%; padding: 10px 12px; border-radius: 5px; border: 1px solid rgba(244,246,245,.35);
    background: rgba(244,246,245,.08); color: var(--masthead-text); font-size: 15px; font-family: var(--mono);
  }
  .calc select option { color: #12333f; }
  .calc-out {
    background: rgba(244,246,245,.08); border-radius: 6px; padding: 14px 16px;
    font-family: var(--mono); font-size: 14px; color: var(--masthead-text);
    display: grid; gap: 6px; font-variant-numeric: tabular-nums;
  }
  .calc-out div { display: flex; justify-content: space-between; gap: 12px; }
  .calc-out .total { border-top: 1px solid rgba(244,246,245,.3); padding-top: 8px; font-weight: 700; }
  .calc .note { font-size: 12px; opacity: .65; margin: 0; color: var(--masthead-text); }

  /* ── Live official updates ────────────── */
  .live { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--highlight); border-radius: 8px; padding: 20px 24px; margin: 0 0 8px; }
  .live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
  .live-head h2 { font-family: var(--serif); font-size: 20px; margin: 0; }
  .live-head .pulse {
    display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono);
    font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
  }
  .pulse i {
    width: 8px; height: 8px; border-radius: 50%; background: var(--highlight); display: inline-block;
  }
  @media (prefers-reduced-motion: no-preference) {
    .pulse i { animation: blink 2s ease-in-out infinite; }
    @keyframes blink { 50% { opacity: .3; } }
  }
  .live ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
  .live li { display: grid; grid-template-columns: 120px 92px 1fr; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; align-items: baseline; }
  .live li:first-child { border-top: none; }
  .live .src { font-family: var(--mono); font-size: 12px; color: var(--highlight); font-weight: 700; }
  .live .dt { font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .live li a { color: var(--text); }
  .live li a:hover { color: var(--accent); }
  @media (max-width: 560px) { .live li { grid-template-columns: 1fr; gap: 2px; } }

  /* ── Section headers ──────────────────── */
  .sect { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 40px 0 18px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
  .sect h2 { font-family: var(--serif); font-size: 24px; margin: 0; }
  .sect a { font-size: 13.5px; font-weight: 600; white-space: nowrap; }

  /* ── Desk cards ───────────────────────── */
  .desks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
  .desk {
    background: var(--card); border: 1px solid var(--line); border-radius: 8px;
    padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; color: var(--text);
  }
  .desk:hover { text-decoration: none; border-color: var(--accent); }
  .desk .tag {
    width: 40px; height: 40px; border-radius: 6px; background: var(--accent-soft); color: var(--accent);
    display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 18px;
  }
  .desk h3 { margin: 4px 0 0; font-size: 16.5px; }
  .desk p { margin: 0; font-size: 13.5px; color: var(--muted); }
  .desk .count { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-top: auto; padding-top: 6px; }

  /* ── Main grid: posts + sidebar ───────── */
  .cols { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
  .post {
    display: grid; grid-template-columns: 108px 1fr; gap: 18px; padding: 18px 0;
    border-bottom: 1px solid var(--line); align-items: start;
  }
  .thumb {
    width: 108px; height: 84px; border-radius: 6px; background: var(--accent-soft);
    display: grid; place-items: center; color: var(--accent); font-family: var(--serif);
    font-size: 26px; font-weight: 700; flex: none;
  }
  .thumb.alt { background: var(--highlight-soft); color: var(--highlight); }
  .post h3 { margin: 0 0 4px; font-size: 17.5px; line-height: 1.35; }
  .post h3 a { color: var(--text); }
  .post h3 a:hover { color: var(--accent); }
  .post p { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
  .chip {
    display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
    padding: 2px 8px; border-radius: 3px; margin-right: 8px;
  }
  .chip.hot { color: var(--highlight); background: var(--highlight-soft); }

  /* Sidebar */
  .widget { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 20px; }
  .widget h4 {
    margin: 0 0 12px; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase;
    color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px;
  }
  .widget ol { margin: 0; padding: 0 0 0 22px; display: grid; gap: 10px; font-size: 14px; }
  .widget ol a { color: var(--text); }
  .widget ol a:hover { color: var(--accent); }
  .widget ul.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
  .widget ul.links a::before { content: "→ "; color: var(--highlight); }
  .community { background: var(--accent); border: none; color: #fff; text-align: center; }
  .community h4 { color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.3); }
  .community p { font-size: 14px; margin: 0 0 14px; color: rgba(255,255,255,.92); }
  .community .btn { background: #fff; color: var(--accent); display: block; margin-bottom: 8px; }
  .community .btn:last-child { margin-bottom: 0; }

  /* ── Q&A strip ────────────────────────── */
  .qa { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 28px 32px; margin: 40px 0; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
  .qa h2 { font-family: var(--serif); margin: 0 0 6px; font-size: 24px; }
  .qa p { margin: 0; color: var(--muted); max-width: 65ch; }
  .qa .stats { display: flex; gap: 28px; margin-top: 14px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
  .qa .stats b { display: block; font-size: 22px; color: var(--accent); }
  .qa .stats span { font-size: 12px; color: var(--muted); }

  footer { background: var(--masthead-ink); color: var(--masthead-text); margin-top: 48px; }
  footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-top: 40px; padding-bottom: 24px; }
  footer h5 { margin: 0 0 12px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
  footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
  footer a { color: var(--masthead-text); opacity: .85; }
  footer .fine { grid-column: 1 / -1; border-top: 1px solid rgba(244,246,245,.2); padding-top: 16px; font-size: 12.5px; opacity: .65; }
  footer .brandline { font-family: var(--serif); font-size: 22px; margin: 0 0 8px; }
  footer p { font-size: 13.5px; opacity: .8; max-width: 40ch; }

  @media (max-width: 900px) {
    .hero, .cols, .qa { grid-template-columns: 1fr; }
    footer .wrap { grid-template-columns: 1fr 1fr; }
    .masthead-search { width: 100%; }
    .masthead-search input { flex: 1; }
  }
  @media (max-width: 560px) {
    .post { grid-template-columns: 1fr; }
    .thumb { width: 100%; height: 64px; }
    footer .wrap { grid-template-columns: 1fr; }
  }
  @media (prefers-reduced-motion: no-preference) {
    .desk, .btn { transition: border-color .15s ease, filter .15s ease; }
  }

/* ---- Content & legal pages (added for multi-page wiring) ---------------- */
.crumbs { font-size: .82rem; color: var(--muted); margin: 18px 0 4px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.page-hero { padding: 10px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.page-hero h1 { font-family: var(--serif); font-size: 2rem; line-height: 1.15; margin: 6px 0 8px; color: var(--ink); }
.page-hero p.lead { font-size: 1.05rem; color: var(--muted); max-width: 62ch; margin: 0; }
.prose { max-width: 68ch; }
.prose h2 { font-family: var(--serif); font-size: 1.4rem; margin: 30px 0 10px; color: var(--ink); }
.prose h3 { font-size: 1.08rem; margin: 22px 0 8px; color: var(--ink); }
.prose p, .prose li { line-height: 1.7; color: var(--text); }
.prose ul, .prose ol { padding-left: 20px; margin: 10px 0; }
.prose li { margin: 6px 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: .94rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { background: var(--accent-soft); }
.prose a { color: var(--accent); }
.updated-note { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.guide-list { list-style: none; padding: 0; margin: 14px 0; }
.guide-list li { border-bottom: 1px solid var(--line); }
.guide-list li:last-child { border-bottom: 0; }
.guide-list a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 2px; color: var(--ink); align-items: baseline; }
.guide-list a:hover { color: var(--accent); }
.guide-list .tag2 { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.field { display: block; margin: 12px 0; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: var(--card); color: var(--text); }
.callout { background: var(--highlight-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin: 16px 0; font-size: .92rem; }

/* ---- Live ad slots (filled by assets/ads.js) --------------------------- */
.ad-filled { border: 0 !important; padding: 0 !important; background: none !important;
  display: block; position: relative; overflow: hidden; }
.ad-filled .ad-label { display: block; font-size: .62rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); text-align: center; padding: 2px 0; }
.ad-img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.ad-marquee { overflow: hidden; white-space: nowrap; width: 100%; }
.ad-marquee > span { display: inline-block; padding-left: 100%;
  animation: ad-scroll var(--ad-speed, 12s) linear infinite; }
.ad-marquee img { vertical-align: middle; }
@keyframes ad-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .ad-marquee > span { animation: none; padding-left: 0; white-space: normal; }
}

/* ---- Calculators page --------------------------------------------------- */
.calc-jump { font-size: .9rem; color: var(--muted); margin: 10px 0 0; }
.calc-jump a { margin: 0 2px; }
.calc-block { scroll-margin-top: 16px; margin: 26px 0; }
.calc-block > h2 { font-family: var(--serif); font-size: 1.35rem; color: var(--ink); margin: 0 0 10px; }

/* ---- Homepage "Free Calculators" card (in the dark .calc hero box) ------ */
.calc-links { list-style: none; padding: 0; margin: 10px 0 16px; }
.calc-links li { border-top: 1px solid rgba(255,255,255,.14); }
.calc-links a { display: block; padding: 9px 0; color: #eef4f2; text-decoration: none; font-size: .93rem; }
.calc-links a:hover { color: #fff; text-decoration: underline; }

/* ---- Site search dropdown (assets/search.js) --------------------------- */
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(18,51,63,.22); max-height: 60vh; overflow-y: auto; }
.search-results .sr-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 13px;
  text-decoration: none; border-bottom: 1px solid var(--line); }
.search-results .sr-item:last-child { border-bottom: 0; }
.search-results .sr-item:hover, .search-results .sr-item.sr-active { background: var(--accent-soft); }
.search-results .sr-t { color: var(--ink); font-size: .92rem; font-weight: 600; line-height: 1.25; }
.search-results .sr-k { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; }
.search-results .sr-empty { padding: 14px; color: var(--muted); font-size: .9rem; }

/* ---- Footer visit counter (assets/track.js) ---------------------------- */
.visit-counter { margin-top: 12px; font-size: .82rem; color: var(--masthead-text, #9fb3ba);
  font-variant-numeric: tabular-nums; opacity: .85; }
