/* Dailycaltor. Design tokens first, then base, layout and components. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --paper: #f2f5f3;
  --surface: #ffffff;
  --field: #f8faf9;
  --ink: #13241f;
  --muted: #56665f;
  --line: #d6dfda;
  --line-strong: #b9c7c0;
  --pine: #0e5a48;
  --pine-deep: #0a3f33;
  --pine-soft: #e0eee8;
  --on-pine: #ffffff;
  --marigold: #f0b429;
  --marigold-soft: #fdf1d3;
  --on-marigold: #2b1f00;
  --sage: #7fa99b;
  --danger: #a4251a;
  --danger-soft: #fbe9e7;
  --hero-bg: #0e5a48;
  --hero-ink: #ffffff;
  --hero-muted: #c5ded4;
  --footer-bg: #0b2b23;
  --footer-ink: #d7e6df;
  --shadow: 0 1px 0 rgba(19, 36, 31, 0.04), 0 12px 32px -18px rgba(19, 36, 31, 0.28);

  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --wrap: 1180px;
  --gutter: clamp(1rem, 4vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1613;
    --surface: #14201c;
    --field: #0f1a17;
    --ink: #e4ede9;
    --muted: #9fb0a9;
    --line: #26352f;
    --line-strong: #3a4d45;
    --pine: #4cc49f;
    --pine-deep: #0a211b;
    --pine-soft: #17302a;
    --on-pine: #06231b;
    --marigold: #f5c04a;
    --marigold-soft: #3a2f14;
    --on-marigold: #221800;
    --sage: #5e8c7d;
    --danger: #ff9b8f;
    --danger-soft: #3a1a17;
    --hero-bg: #0f2a23;
    --hero-ink: #eef6f2;
    --hero-muted: #a8c6ba;
    --footer-bg: #0a120f;
    --footer-ink: #b8c9c2;
    --shadow: 0 12px 32px -18px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1613;
  --surface: #14201c;
  --field: #0f1a17;
  --ink: #e4ede9;
  --muted: #9fb0a9;
  --line: #26352f;
  --line-strong: #3a4d45;
  --pine: #4cc49f;
  --pine-deep: #0a211b;
  --pine-soft: #17302a;
  --on-pine: #06231b;
  --marigold: #f5c04a;
  --marigold-soft: #3a2f14;
  --on-marigold: #221800;
  --sage: #5e8c7d;
  --danger: #ff9b8f;
  --danger-soft: #3a1a17;
  --hero-bg: #0f2a23;
  --hero-ink: #eef6f2;
  --hero-muted: #a8c6ba;
  --footer-bg: #0a120f;
  --footer-ink: #b8c9c2;
  --shadow: 0 12px 32px -18px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.calc-name, .post-card-title, .guide-title, .tape-rows dt, .lang-list a { overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.5rem); font-weight: 750; letter-spacing: -0.03em; line-height: 1.02; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--pine); outline-offset: 2px; border-radius: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--marigold); color: var(--on-marigold);
  padding: 0.6rem 1rem; border-radius: var(--r-s); font-weight: 600;
}
.skip:focus { top: 1rem; }

/* ------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.logo {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-weight: 750; font-size: 1.25rem;
  letter-spacing: -0.02em; color: var(--ink); text-decoration: none;
}
.logo-mark { flex: none; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 0.5rem 0.8rem; border-radius: var(--r-s);
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.975rem;
}
.site-nav a:hover { background: var(--pine-soft); }
.site-nav .nav-all { color: var(--pine); font-weight: 600; }
.header-actions { display: flex; gap: 0.25rem; }
.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px;
  border: 1px solid transparent; border-radius: 50%;
  background: transparent; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { background: var(--pine-soft); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}
.nav-toggle { display: none; }

@media (max-width: 859px) {
  .header-inner { gap: 0.5rem; }
  .site-nav { margin-left: 0; order: 3; flex-basis: 100%; }
  .site-nav ul { flex-wrap: wrap; padding-bottom: 0.75rem; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .js .site-nav.is-open ul { flex-direction: column; }
  .js .site-nav.is-open a { padding: 0.8rem 0.5rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .header-inner { flex-wrap: wrap; }
  .header-actions { margin-left: auto; }
  .js .nav-toggle { display: grid; }
}

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0 1.3rem; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--marigold); color: var(--on-marigold); }
.btn-primary:hover { background: color-mix(in srgb, var(--marigold) 88%, #000); }
.btn-quiet { border-color: currentColor; color: inherit; background: transparent; }
.btn-quiet:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.btn-ghost {
  min-height: 40px; padding: 0 0.9rem; margin-top: 0.5rem;
  background: transparent; color: var(--muted); border-color: var(--line);
  font-size: 0.925rem;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--line-strong); }

/* ------------------------------------------------------------ hero */
.hero {
  background: var(--hero-bg);
  color: var(--hero-ink);
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 5.5rem);
  position: relative;
  overflow: hidden;
}
.hero::before {
  /* faint ledger grid, the paper a calculator result gets written on */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(100deg, transparent 20%, #000 75%);
  -webkit-mask-image: linear-gradient(100deg, transparent 20%, #000 75%);
}
.hero-grid { position: relative; display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr); gap: 4rem; } }
.hero h1 { max-width: 15ch; }
.hero .lede { color: var(--hero-muted); font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.hero :focus-visible { outline-color: var(--marigold); }
.hero-tool { animation: tape-in 0.7s cubic-bezier(.2,.7,.2,1) both 0.15s; }
.hero-tool .panel { border-radius: var(--r-l) var(--r-l) 0 0; border-bottom: 0; color: var(--ink); }
.hero-tool .tape { border-radius: 0; }
.hero-tool-title { font-family: var(--font-display); font-weight: 650; font-size: 1.1rem; margin-bottom: 1rem; }
@keyframes tape-in { from { opacity: 0; transform: translateY(18px) rotate(1.5deg); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ sections */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0 1rem; }
.section-lede { color: var(--muted); margin-top: -0.25rem; }
.page { padding-top: 1.25rem; padding-bottom: 3rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; padding: 0; margin: 0 0 1.5rem; font-size: 0.9rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 0.35rem; color: var(--line-strong); }
.crumbs a { color: var(--muted); }
.page-head { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: center; margin-bottom: 1.75rem; }
.page-head h1 { margin: 0; }
.page-head .lede { grid-column: 1 / -1; margin: 0.85rem 0 0; color: var(--muted); font-size: 1.15rem; max-width: 60ch; }
.page-head-plain { display: block; }
.page-icon {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px;
  background: var(--pine); color: var(--on-pine);
}
.page-icon svg { width: 28px; height: 28px; }

/* ------------------------------------------------------------ calculator lists */
.calc-groups { display: grid; gap: 2rem 3rem; margin-top: 1.75rem; }
@media (min-width: 760px) { .calc-groups { grid-template-columns: 1fr 1fr; } }
.calc-group h3 { font-size: 1rem; color: var(--muted); font-weight: 600; letter-spacing: 0; padding-bottom: 0.6rem; border-bottom: 2px solid var(--ink); margin-bottom: 0.25rem; }
.calc-list { list-style: none; margin: 0; padding: 0; }
.calc-list li + li { border-top: 1px solid var(--line); }
.calc-row {
  display: flex; gap: 1rem; align-items: center;
  padding: 0.9rem 0.5rem; margin: 0 -0.5rem; border-radius: var(--r-m);
  text-decoration: none; color: var(--ink);
}
.calc-row:hover { background: var(--surface); }
.calc-row:hover .calc-icon { background: var(--pine); color: var(--on-pine); }
.calc-icon {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--pine-soft); color: var(--pine); transition: background-color .15s, color .15s;
}
.calc-text { display: grid; gap: 0.1rem; min-width: 0; }
.calc-name { font-weight: 650; font-size: 1.05rem; }
.calc-desc { color: var(--muted); font-size: 0.925rem; line-height: 1.4; }
.calc-list-grid { display: grid; gap: 0 2rem; margin-top: 1.5rem; }
@media (min-width: 760px) { .calc-list-grid { grid-template-columns: 1fr 1fr; } .calc-list-grid li + li { border-top: 0; } .calc-list-grid li { border-bottom: 1px solid var(--line); } }

/* ------------------------------------------------------------ tool layout */
.tool-section { margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.tool { display: grid; gap: 1rem; align-items: start; }
.tool-wide { margin-top: 1.5rem; }
@media (min-width: 900px) {
  .tool { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 1.5rem; }
  .tool > .tape { position: sticky; top: 88px; }
}
.tool-wide:empty { display: none; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: clamp(1.1rem, 3vw, 1.6rem); box-shadow: var(--shadow);
}
.row-2 { display: grid; gap: 0 1rem; }
@media (min-width: 520px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.field { margin: 0 0 1.1rem; min-width: 0; }
fieldset.field { border: 0; padding: 0; }
.field > label, .field legend { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.4rem; padding: 0; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0.35rem 0 0; line-height: 1.4; }
.control {
  position: relative; display: flex; align-items: stretch;
  background: var(--field); border: 1.5px solid var(--line-strong); border-radius: var(--r-m);
  transition: border-color .15s, box-shadow .15s;
}
.control:focus-within { border-color: var(--pine); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pine) 22%, transparent); }
.control input, .control select {
  flex: 1; min-width: 0; width: 100%; min-height: 50px; padding: 0 0.9rem;
  background: transparent; border: 0; outline: 0;
  font-size: 1.15rem; font-weight: 500; font-variant-numeric: tabular-nums;
}
.control select { appearance: none; -webkit-appearance: none; font-size: 1rem; padding-right: 2.5rem; cursor: pointer; }
.control select option { background: var(--surface); color: var(--ink); }
.control-select::after {
  content: ""; position: absolute; right: 1rem; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.affix { display: flex; align-items: center; padding: 0 0.9rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.affix:first-child { padding-right: 0; }
.affix:last-child { padding-left: 0; }
.field-currency { max-width: 260px; }
.field-currency .control select { min-height: 42px; font-size: 0.95rem; }
textarea {
  width: 100%; min-height: 260px; resize: vertical; padding: 0.9rem 1rem;
  background: var(--field); border: 1.5px solid var(--line-strong); border-radius: var(--r-m);
  font-size: 1.05rem; line-height: 1.6;
}
textarea:focus { outline: 0; border-color: var(--pine); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pine) 22%, transparent); }

/* segmented control */
.seg-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.25rem; padding: 0.25rem; background: var(--field); border: 1.5px solid var(--line-strong); border-radius: var(--r-m); }
.seg-opts label { position: relative; cursor: pointer; }
.seg-opts input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opts span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 42px; padding: 0.3rem 0.6rem; border-radius: 9px; font-weight: 550; font-size: 0.95rem;
  transition: background-color .15s, color .15s;
}
.seg-opts input:checked + span { background: var(--pine); color: var(--on-pine); }
.seg-opts input:focus-visible + span { outline: 3px solid var(--pine); outline-offset: 2px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: -0.5rem 0 1.1rem; }
.chip {
  min-height: 36px; padding: 0 0.85rem; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1.5px solid var(--line-strong); font-weight: 550; font-size: 0.9rem;
}
.chip:hover { border-color: var(--pine); }
.chip[aria-pressed="true"] { background: var(--pine-soft); border-color: var(--pine); color: var(--pine); }

.check { display: flex; gap: 0.65rem; align-items: flex-start; margin: 0 0 1rem; cursor: pointer; font-size: 0.975rem; }
.check input { width: 20px; height: 20px; margin: 0.15rem 0 0; accent-color: var(--pine); flex: none; }

details.more { border-top: 1px dashed var(--line-strong); margin: 0.25rem 0 0.5rem; padding-top: 0.75rem; }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--pine); margin-bottom: 0.9rem; list-style-position: inside; }

/* ------------------------------------------------------------ result tape (signature element) */
.tape {
  position: relative;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l) var(--r-l) 0 0;
  padding: 1.4rem clamp(1.1rem, 3vw, 1.6rem) 2rem;
  box-shadow: var(--shadow);
  border-top: 6px solid var(--marigold);
  /* torn receipt edge */
  -webkit-mask: radial-gradient(9px at 50% 100%, #0000 98%, #000) 50% 100% / 18px 100% repeat-x;
          mask: radial-gradient(9px at 50% 100%, #0000 98%, #000) 50% 100% / 18px 100% repeat-x;
}
.tape-compact { padding: 1rem 1.25rem 1.6rem; border-radius: 0; border-top-width: 4px; box-shadow: none; }
.copy-btn {
  float: right; margin: -0.3rem -0.4rem 0 0.5rem;
  min-height: 34px; padding: 0 0.8rem; border-radius: 999px; cursor: pointer;
  background: var(--pine-soft); color: var(--pine); border: 0; font-weight: 600; font-size: 0.85rem;
}
.copy-btn:hover { background: var(--pine); color: var(--on-pine); }
.tape-total { display: grid; gap: 0.1rem; padding-bottom: 1rem; }
.tape-total-label { color: var(--muted); font-weight: 550; font-size: 0.95rem; }
.tape-total output {
  font-family: var(--font-display); font-weight: 750; letter-spacing: -0.02em;
  font-size: clamp(2rem, 1.5rem + 2.2vw, 2.9rem); line-height: 1.05;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.tape-compact .tape-total { padding-bottom: 0.25rem; }
.tape-compact .tape-total output { font-size: clamp(1.7rem, 1.4rem + 1.2vw, 2.2rem); }
.tape-total output.is-updated { animation: tick 0.45s ease-out; }
@keyframes tick { 0% { color: var(--pine); } 100% { color: inherit; } }
.tape-rows { margin: 0; border-top: 2px dashed var(--line-strong); padding-top: 0.5rem; }
.tape-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.55rem 0; }
.tape-rows > div + div { border-top: 1px dotted var(--line); }
.tape-rows dt { color: var(--muted); font-size: 0.95rem; }
.tape-rows dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.tape-error {
  margin: 0 0 1rem; padding: 0.7rem 0.9rem; border-radius: var(--r-s);
  background: var(--danger-soft); color: var(--danger); font-weight: 550; font-size: 0.95rem;
}
.tape-note { margin: 1rem 0 0; color: var(--muted); font-size: 0.85rem; line-height: 1.45; }

/* salary / mortgage split bar */
.split:empty { display: none; }
.split { margin-top: 1rem; }
.split-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--line); }
.split-bar span { display: block; height: 100%; }
.split-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0.6rem 0 0; padding: 0; list-style: none; font-size: 0.85rem; color: var(--muted); }
.split-legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.split-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.c-net { background: var(--pine); }
.c-tax { background: var(--marigold); }
.c-social { background: var(--sage); }
.c-other { background: var(--line-strong); }

/* keywords */
.keywords:empty { display: none; }
.keywords { margin-top: 1rem; }
.keywords h3 { font-size: 0.95rem; color: var(--muted); font-weight: 600; margin: 0 0 0.5rem; }
.keywords ol { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.keywords li { background: var(--pine-soft); color: var(--ink); padding: 0.25rem 0.7rem; border-radius: 999px; font-size: 0.9rem; }
.keywords li b { color: var(--pine); font-weight: 650; margin-left: 0.3rem; }

/* growth chart and schedules */
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: clamp(1rem, 3vw, 1.6rem); box-shadow: var(--shadow); }
.chart-card h2 { font-size: 1.2rem; }
.chart { width: 100%; height: auto; display: block; margin: 0.5rem 0; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar-a { fill: var(--sage); }
.chart .bar-b { fill: var(--pine); }
.schedule { margin-top: 0.5rem; }
.schedule > summary { cursor: pointer; font-weight: 600; color: var(--pine); padding: 0.4rem 0; }

/* minis */
.minis { display: grid; gap: 1.25rem; grid-column: 1 / -1; }
@media (min-width: 760px) { .minis { grid-template-columns: 1fr 1fr; } }
.mini { display: flex; flex-direction: column; }
.mini .panel { border-radius: var(--r-l) var(--r-l) 0 0; border-bottom: 0; box-shadow: none; flex: 1; }
.mini .tape { border-left: 1px solid var(--line); border-right: 1px solid var(--line); padding-left: clamp(1.1rem, 3vw, 1.6rem); padding-right: clamp(1.1rem, 3vw, 1.6rem); }
.mini-title { font-size: 1.1rem; margin-bottom: 1rem; }
.mini .tape-rows { margin-top: 0.5rem; }
.panel-wide textarea { min-height: 300px; }

/* ------------------------------------------------------------ article */
.article-layout { display: grid; gap: 3rem; }
.article-layout > *, .prose, .tool > *, .minis > * { min-width: 0; }
@media (min-width: 1000px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 4rem; align-items: start; }
  .related { position: sticky; top: 88px; }
}
.home-layout { padding-top: 2.5rem; padding-bottom: 3rem; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 2.4rem; }
.prose > h2:first-child, .prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--pine); font-weight: 650; }
.prose-solo { margin-bottom: 2rem; }
.formula {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--marigold);
  border-radius: var(--r-m); padding: 1.1rem 1.25rem; margin: 0 0 1.4rem;
  font-size: 1.02rem; overflow-x: auto;
}
.formula p { margin: 0; }
.formula p + p { margin-top: 0.75rem; }
.table-wrap { overflow-x: auto; margin: 0 0 1.4rem; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.975rem; }
th, td { text-align: left; padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { font-weight: 650; background: var(--pine-soft); }
td:last-child, th:last-child { text-align: right; }
.table-left td:last-child, .table-left th:last-child { text-align: left; }
.link-list { columns: 2 16rem; column-gap: 2rem; }
.link-list li { break-inside: avoid; }

.faqs { margin-top: 2.6rem; }
.faq { border-bottom: 1px solid var(--line); }
.faq:first-of-type { border-top: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { margin: 0; font-family: var(--font-body); font-size: 1.05rem; font-weight: 600; letter-spacing: 0; }
.faq summary::after {
  content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background:
    linear-gradient(var(--pine), var(--pine)) center / 10px 2px no-repeat,
    linear-gradient(var(--pine), var(--pine)) center / 2px 10px no-repeat,
    var(--pine-soft);
  transition: transform .2s;
}
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { margin: -0.25rem 0 1.1rem; color: var(--muted); }
.updated { margin-top: 2rem; color: var(--muted); font-size: 0.9rem; }

.related h2 { font-size: 1.15rem; padding-bottom: 0.6rem; border-bottom: 2px solid var(--ink); margin-bottom: 0.25rem; }
.related .btn { margin-top: 1rem; min-height: 42px; font-size: 0.95rem; }

/* ------------------------------------------------------------ footer */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); padding: 3.5rem 0 2rem; margin-top: 2rem; }
.site-footer a { color: var(--footer-ink); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .logo { color: #fff; margin-bottom: 0.75rem; }
.site-footer .logo-mark rect:first-child { fill: #1a7a62; }
.foot-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.foot-brand { grid-column: 1 / -1; max-width: 34rem; }
@media (min-width: 1000px) { .foot-grid { grid-template-columns: 1.6fr repeat(5, 1fr); } .foot-brand { grid-column: auto; } }
.foot-brand p { font-size: 0.95rem; opacity: 0.85; }
.foot-title { font-family: var(--font-body); font-size: 0.95rem; font-weight: 650; color: #fff; letter-spacing: 0; margin-bottom: 0.75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; font-size: 0.95rem; }
.foot-legal { border-top: 1px solid rgba(255,255,255,.12); margin: 2.5rem 0 0; padding-top: 1.5rem; font-size: 0.85rem; opacity: 0.75; }

/* mobile result dock */
.result-dock {
  position: fixed; left: 0.75rem; right: 0.75rem; bottom: 0.75rem; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 1rem; border-radius: 14px; border: 0; cursor: pointer; text-align: left;
  background: var(--ink); color: var(--paper);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.45);
  transform: translateY(0); transition: transform .25s ease, opacity .25s ease;
}
.result-dock[hidden] { display: flex; transform: translateY(140%); opacity: 0; pointer-events: none; }
.result-dock span { font-size: 0.85rem; opacity: 0.8; }
.result-dock strong { font-family: var(--font-display); font-size: 1.3rem; font-weight: 750; border-bottom: 3px solid var(--marigold); }
@media (min-width: 900px) { .result-dock { display: none !important; } }

/* ------------------------------------------------------------ motion + print */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .related, .copy-btn, .btn, .chips, .crumbs { display: none !important; }
  .tape { -webkit-mask: none; mask: none; box-shadow: none; }
  .result-dock { display: none !important; }
  body { background: #fff; }
}

/* ------------------------------------------------------------ language menu */
.lang-menu { position: relative; }
.lang-btn {
  list-style: none; display: inline-flex; align-items: center; gap: 0.35rem;
  height: 42px; padding: 0 0.7rem; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: 0.85rem; color: var(--ink);
}
.lang-btn::-webkit-details-marker { display: none; }
.lang-btn:hover, .lang-menu[open] .lang-btn { background: var(--pine-soft); }
.lang-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 170px; margin: 0; padding: 0.35rem; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: 0 16px 40px -16px rgba(0,0,0,.35);
}
.lang-list a { display: block; padding: 0.6rem 0.8rem; border-radius: var(--r-s); color: var(--ink); text-decoration: none; font-weight: 500; }
.lang-list a:hover { background: var(--pine-soft); }
.lang-list a[aria-current] { color: var(--pine); font-weight: 650; }
.lang-list a[aria-current]::after { content: " ✓"; }
.foot-langs { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.9rem; }
.foot-langs-inline a { margin-right: 0.25rem; }

/* ------------------------------------------------------------ ad slots (reserve space to avoid layout shift) */
.ad-slot { margin: 0 0 2.5rem; min-height: 280px; display: flex; justify-content: center; align-items: center; }
.ad-slot ins { width: 100%; }
.ad-in-article { margin: 2rem 0; min-height: 250px; }

/* Devanagari needs a little more room */
:lang(hi) body, html[lang="hi"] body { line-height: 1.7; }
html[lang="hi"] h1, html[lang="hi"] h2, html[lang="hi"] h3 { line-height: 1.3; letter-spacing: 0; }
html[lang="hi"] .tape-total output, html[lang="hi"] .calc-name { letter-spacing: 0; }

/* ------------------------------------------------------------ blog */
.post-cards { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 760px) { .post-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.related .post-cards { grid-template-columns: 1fr; gap: 0.75rem; margin-top: 0.75rem; }
.post-card {
  display: grid; gap: 0.5rem; height: 100%; padding: 1.25rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s;
}
.post-card:hover { border-color: var(--pine); transform: translateY(-2px); }
.post-card .calc-icon { width: 40px; height: 40px; }
.post-card-title { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; line-height: 1.2; letter-spacing: -0.01em; }
.post-card-desc { color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
.post-card-meta { color: var(--pine); font-weight: 600; font-size: 0.85rem; margin-top: auto; }
.related .post-card { padding: 0.9rem 1rem; }
.related .post-card .calc-icon, .related .post-card-desc { display: none; }
.related .post-card-title { font-size: 1rem; }

.post-head { max-width: 46rem; margin-bottom: 2rem; }
.post-head h1 { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.2rem); }
.post-head .lede { color: var(--muted); font-size: 1.2rem; margin-top: 1rem; }
.post-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; color: var(--muted); font-size: 0.9rem; margin: 0; }
.post-meta span:first-child { color: var(--ink); font-weight: 600; }

.takeaways, .toc {
  border-radius: var(--r-l); padding: 1.2rem 1.4rem; margin: 0 0 1.5rem;
}
.takeaways { background: var(--marigold-soft); border: 1px solid color-mix(in srgb, var(--marigold) 45%, transparent); }
.takeaways ul { margin: 0; padding-left: 1.2rem; }
.takeaways li { margin: 0.35rem 0; }
.takeaways li::marker { color: var(--ink); }
.toc { background: var(--surface); border: 1px solid var(--line); }
.toc ol { margin: 0; padding-left: 1.3rem; columns: 2 15rem; column-gap: 2rem; }
.toc li { break-inside: avoid; margin: 0.25rem 0; }
.box-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin: 0 0 0.5rem; }

.chart-figure {
  margin: 1.5rem 0 2rem; padding: clamp(1rem, 3vw, 1.4rem);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
}
.chart-figure figcaption { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; list-style: none; margin: 0.6rem 0 0.25rem; padding: 0; font-size: 0.85rem; color: var(--muted); }
.chart-legend li { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; }
.chart-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.blog-chart { width: 100%; min-width: 500px; height: auto; display: block; }
.blog-chart .grid { stroke: var(--line); stroke-width: 1; }
.blog-chart .tick { fill: var(--muted); font-size: 14px; font-family: var(--font-body); }
.blog-chart .val { fill: var(--ink); font-size: 13px; font-weight: 600; font-family: var(--font-body); }
.blog-chart .line { stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.s1 { background: var(--pine); fill: var(--pine); stroke: var(--pine); }
.s2 { background: var(--marigold); fill: var(--marigold); stroke: var(--marigold); }
.s3 { background: var(--sage); fill: var(--sage); stroke: var(--sage); }
.s4 { background: var(--line-strong); fill: var(--line-strong); stroke: var(--line-strong); }
.blog-chart polyline.line { fill: none; }
.blog-chart polyline.s4 { stroke-dasharray: 6 5; }
.chart-note { color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0 0; }
.chart-data { margin-top: 0.5rem; }
.chart-data > summary { cursor: pointer; color: var(--pine); font-weight: 600; font-size: 0.9rem; }
.chart-data .table-wrap { margin: 0.75rem 0 0; }
.chart-data th[scope="row"] { background: none; font-weight: 600; }

.cta-box {
  display: flex; gap: 1rem; align-items: flex-start; margin: 2.5rem 0 1rem; padding: 1.4rem;
  background: var(--hero-bg); color: var(--hero-ink); border-radius: var(--r-l);
}
.cta-box .page-icon { flex: none; width: 48px; height: 48px; background: var(--marigold); color: var(--on-marigold); }
.cta-box p { color: var(--hero-muted); margin: 0 0 0.9rem; }
.cta-box .box-title { color: var(--hero-ink); margin-bottom: 0.25rem; }
.cta-box :focus-visible { outline-color: var(--marigold); }

.guide-card {
  display: grid; gap: 0.25rem; margin: 0 0 1.75rem; padding: 1rem 1.1rem;
  border-radius: var(--r-m); text-decoration: none;
  background: var(--marigold-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--marigold) 45%, transparent);
}
.guide-card:hover { border-color: var(--marigold); }
.guide-kicker { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.guide-title { font-family: var(--font-display); font-weight: 700; line-height: 1.25; }
.guide-card-calc { background: var(--pine-soft); border-color: color-mix(in srgb, var(--pine) 35%, transparent); }

/* ------------------------------------------------------------ time card grid + new tools */
.grid-days { border: 0; background: transparent; margin-bottom: 1.1rem; }
.grid-days table { font-size: 0.95rem; }
.grid-days th, .grid-days td { padding: 0.3rem 0.35rem; border-bottom: 1px solid var(--line); text-align: left; }
.grid-days thead th { background: transparent; font-size: 0.85rem; color: var(--muted); font-weight: 600; padding-bottom: 0.4rem; }
.grid-days th[scope="row"] { white-space: nowrap; font-weight: 600; background: transparent; }
.grid-days input {
  width: 100%; min-width: 88px; min-height: 40px; padding: 0 0.5rem;
  background: var(--field); border: 1.5px solid var(--line-strong); border-radius: var(--r-s);
  font-size: 0.95rem; font-variant-numeric: tabular-nums;
}
.grid-days input:focus { outline: 0; border-color: var(--pine); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pine) 22%, transparent); }
.tool-days:empty { display: none; }
.tool-days { margin-top: 1.5rem; }
.copy-link { margin-left: 0.4rem; background: transparent; color: var(--muted); border: 1px solid var(--line); }
.copy-link:hover { background: var(--pine-soft); color: var(--pine); }
.link-hubs { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.link-hubs li + li { border-top: 1px solid var(--line); }
.link-hubs a { display: block; padding: 0.7rem 0; color: var(--ink); text-decoration: none; font-weight: 550; }
.link-hubs a:hover { color: var(--pine); }
input[type="date"], input[type="time"] { font-variant-numeric: tabular-nums; }
.control input[type="date"], .control input[type="time"] { min-height: 50px; padding: 0 0.9rem; background: transparent; border: 0; width: 100%; font-size: 1.05rem; }
.control input[type="date"]:focus, .control input[type="time"]:focus { outline: 0; }
.page > .calc-list-grid { margin-bottom: clamp(2rem, 5vw, 3rem); }
