/* Shared styles for the public calculator and guide pages (/calculators/*, /guides/*).
   Same tokens as the landing page (repo-root index.html). */
:root {
  --paper: #edf1ee;
  --paper-2: #e2e8e4;
  --surface: #f8faf8;
  --ink: #102b29;
  --ink-soft: #46605c;
  --line: #c9d4cf;
  --brand: #1d6b5b;
  --mango: #f0a92a;
  --mango-ink: #2a1c02;
  --mango-soft: #fbecd0;
  --stamp: #c23f2d;
  --shadow: 0 1px 0 rgba(16, 43, 41, .06), 0 18px 40px -18px rgba(16, 43, 41, .35);
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0c1716; --paper-2: #11201e; --surface: #142624; --ink: #e4eeea; --ink-soft: #9db3ad;
    --line: #26403c; --brand: #5cc7a8; --mango: #f4b545; --mango-soft: #3a2f17; --stamp: #ef6a55;
    --shadow: 0 1px 0 rgba(0,0,0,.4), 0 22px 50px -20px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0c1716; --paper-2: #11201e; --surface: #142624; --ink: #e4eeea; --ink-soft: #9db3ad;
  --line: #26403c; --brand: #5cc7a8; --mango: #f4b545; --mango-soft: #3a2f17; --stamp: #ef6a55;
  --shadow: 0 1px 0 rgba(0,0,0,.4), 0 22px 50px -20px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 1.02rem/1.65 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -0.02em; text-wrap: balance; }
.wrap { max-width: 1080px; margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 780px; }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.eyebrow { font: 500 .82rem/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--brand); margin: 0 0 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em; font: 600 1rem/1 var(--f-body);
  padding: .9em 1.3em; border-radius: 999px; text-decoration: none; border: 1.5px solid transparent;
}
.btn-primary { background: var(--mango); color: var(--mango-ink); box-shadow: 0 10px 24px -12px var(--mango); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-soft); }

/* ---------- header ---------- */
.nav { background: color-mix(in srgb, var(--paper) 88%, transparent); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 1.25rem/1 var(--f-display); letter-spacing: -0.03em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.nav-links { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav .btn { padding: .7em 1.1em; font-size: .95rem; }
.nav-links a.btn-primary, .nav-links a.btn-primary:hover { color: var(--mango-ink); }
@media (max-width: 760px) { .nav-links .hide-sm { display: none; } .nav-links { gap: 14px; } }

/* ---------- page head ---------- */
.crumbs { font-size: .88rem; color: var(--ink-soft); padding-top: 22px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--ink-soft); }
.page-head { padding-block: 18px 28px; }
.page-head h1 { font-size: clamp(2rem, 1.5rem + 2.4vw, 3.2rem); line-height: 1.05; margin: 0 0 14px; }
.page-head .lede { color: var(--ink-soft); font-size: clamp(1.08rem, 1rem + .4vw, 1.25rem); line-height: 1.5; max-width: 62ch; margin: 0; }
.meta { color: var(--ink-soft); font-size: .88rem; margin-top: 14px; }

/* ---------- calculator ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .calc { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(18px, 3vw, 28px); }
.card h2 { font-size: 1.25rem; margin: 0 0 16px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .field legend { font-weight: 600; font-size: .95rem; }
.field .hint { color: var(--ink-soft); font-size: .86rem; line-height: 1.45; }
.field input[type="text"], .field input[type="number"], .field select {
  font: 500 1.05rem/1.2 var(--f-mono); color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 10px; padding: .7em .8em; width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.peso-input { position: relative; }
.peso-input span { position: absolute; left: .8em; top: 50%; transform: translateY(-50%); font-family: var(--f-mono); color: var(--ink-soft); pointer-events: none; }
.peso-input input { padding-left: 1.9em !important; }
fieldset.field { border: 0; padding: 0; margin: 0 0 16px; }
.choice { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: .95rem; padding: 6px 0; }
.choice input { width: 18px; height: 18px; accent-color: var(--brand); }
.results { width: 100%; border-collapse: collapse; font-size: .95rem; }
.results th, .results td { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.results th[scope="col"] { font: 500 .78rem/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.results td.num, .results th.num { text-align: right; white-space: nowrap; }
.results .sub { display: block; color: var(--ink-soft); font-size: .82rem; }
@media (max-width: 480px) {
  .results { font-size: .86rem; }
  .results th, .results td { padding: 8px 3px; }
  .card { padding: 16px 14px; }
}
.results tfoot td, .results tfoot th { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--ink); }
.big { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; background: var(--mango-soft); border-radius: 10px; padding: 14px 16px; margin-top: 16px; }
.big span:first-child { font-weight: 600; }
.big .num { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 600; }
.fine { color: var(--ink-soft); font-size: .84rem; margin: 14px 0 0; }

/* ---------- article ---------- */
.prose { padding-block: 12px 8px; }
.prose h2 { font-size: clamp(1.45rem, 1.25rem + .8vw, 1.85rem); line-height: 1.15; margin: 44px 0 12px; }
.prose h3 { font-size: 1.2rem; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 6px; }
.prose code { font-family: var(--f-mono); font-size: .92em; background: var(--paper-2); padding: .1em .35em; border-radius: 4px; }
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table-wrap caption { text-align: left; padding: 10px 12px; font-weight: 600; }
.table-wrap th, .table-wrap td { padding: 8px 12px; border-top: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table-wrap thead th { font: 500 .76rem/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); background: var(--paper-2); }
.table-wrap td.num, .table-wrap th.num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.table-wrap.tall { max-height: 520px; overflow-y: auto; }
.table-wrap.tall thead th { position: sticky; top: 0; }
.note, .warn, .example { border-radius: 10px; padding: 14px 16px; margin: 0 0 18px; border: 1px solid var(--line); background: var(--surface); }
.note { border-left: 4px solid var(--brand); }
.warn { border-left: 4px solid var(--mango); }
.example { border-left: 4px solid var(--ink-soft); }
.note p:last-child, .warn p:last-child, .example p:last-child, .example ul:last-child, .example ol:last-child { margin-bottom: 0; }
.formula { font-family: var(--f-mono); background: var(--paper-2); border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; overflow-x: auto; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 8px 0 8px; }
.toc p { font-weight: 600; margin: 0 0 6px; }
.toc ol { margin: 0; padding-left: 1.2rem; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; color: var(--ink-soft); }

/* ---------- cards / CTA ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 0 0 24px; }
.cards a { display: grid; gap: 6px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.cards a:hover { border-color: var(--brand); }
.cards strong { font: 700 1.1rem/1.25 var(--f-display); }
.cards span { color: var(--ink-soft); font-size: .92rem; line-height: 1.5; }
.cta { background: var(--ink); color: var(--paper); border-radius: var(--r); padding: clamp(22px, 4vw, 36px); margin: 40px 0; }
.cta h2 { margin: 0 0 8px; font-size: clamp(1.4rem, 1.2rem + 1vw, 1.9rem); color: inherit; }
.cta p { margin: 0 0 18px; color: color-mix(in srgb, var(--paper) 80%, transparent); max-width: 60ch; }
.cta .btn-ghost { color: var(--paper); border-color: color-mix(in srgb, var(--paper) 35%, transparent); }
.cta .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.section-title { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.8rem); margin: 40px 0 14px; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); margin-top: 48px; padding-block: 28px 40px; color: var(--ink-soft); font-size: .9rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }
.site-foot a { color: var(--ink-soft); }
.scroll-x { overflow-x: auto; }
