/* ============================================================================
   loanmoose.ca — assets/styles.css

   "Clean card publisher". A browsing-first site: a reader lands on a hub and
   scans it in seconds. Near-white warm ground, pure white cards on a single
   hairline, soft radii, restrained lift on hover, generous padding.
   Fraunces (display) / Work Sans (body + UI) / DM Mono (figures).

   The layout system here SUPERSEDES DESIGN.md §4 — there is no ruled ledger,
   no double rule, no numbered chapter and no sticky rail. The palette,
   typography and voice sections of DESIGN.md still apply.

   Contents
     01 Tokens
     02 Reset & elements
     03 Skip link
     04 Header, brand, nav
     05 Shell & page
     06 Crumbs & page head
     07 Sections
     08 Tiles
     09 Cards & prose (incl. tables)
     10 Facts strip
     11 FAQ
     12 Link lists & meta lines
     13 Buttons, CTA band, disclosure
     14 Footer
     15 Calculator forms (element-level; the calculator markup was not rewritten)
     16 Motion
     17 Print
   ========================================================================= */

/* 01 --------------------------------------------------------------- tokens */

:root {
  /* palette — sampled from the loanmoose.ca logo */
  --ink: #14231A;
  --ink-soft: #4E5C50;
  --ground: #FBFBF8;
  --surface: #FFFFFF;
  --line: #E4E7DF;
  --line-strong: #CFD5C8;
  --forest: #1B4A26;
  --forest-deep: #10301A;
  --moss: #3E8C28;
  --moss-dark: #2F6E1D;
  --lime: #A9E05F;
  --antler: #8A5A2B;
  --glacier: #2A6E8F;
  --rust: #A8401C;

  /* derived tints, used only for washes on white or on forest */
  --moss-tint: #EEF6E9;
  --forest-tint: #F3F7F0;
  --foot-ink: #E7F0E3;
  --foot-ink-soft: #B7CBAF;
  --foot-head: #A9C6A0;
  --foot-line: rgba(255, 255, 255, 0.16);
  --lift: 0 10px 22px -14px rgba(16, 48, 26, 0.55);

  /* type */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Work Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "DM Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  /* geometry */
  --shell: 1120px;
  --shell-pad: clamp(1rem, 4vw, 2rem);
  --measure: 68ch;
  --card-pad: clamp(1.15rem, 3vw, 1.75rem);
  --radius: 10px;
  --radius-sm: 8px;
  --tap: 44px;
  --gap-sec: clamp(2rem, 4.5vw, 3.25rem);
  --gap-block: clamp(1.1rem, 2.5vw, 1.6rem);
  --head-h: 4.25rem;
}

::selection { background: var(--lime); color: var(--forest-deep); }

/* 02 ------------------------------------------------------ reset & elements */

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ground);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* the header is two rows below 860px and one row above it, so anchor jumps
     (the guides hub has in-page jump links) must clear the taller mobile head */
  scroll-padding-top: 7.75rem;
}

@media (min-width: 860px) {
  html { scroll-padding-top: 5rem; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.68;
  overflow-wrap: break-word;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "opsz" 96;
  line-height: 1.18;
  letter-spacing: -0.014em;
  color: var(--forest);
  text-wrap: balance;
  overflow-wrap: break-word;
}

h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem); font-weight: 700; line-height: 1.1; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.3vw, 1.9rem); }
h3 { font-size: clamp(1.08rem, 1rem + 0.4vw, 1.25rem); }

p { margin: 0 0 1rem; max-width: var(--measure); }

a {
  color: var(--forest);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.16em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover { color: var(--moss-dark); text-decoration-color: var(--moss); }
a:visited { color: var(--forest); }

ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; max-width: var(--measure); }
li { margin: 0 0 0.35rem; }
li:last-child { margin-bottom: 0; }
ul ul, ul ol, ol ul, ol ol { margin-top: 0.35rem; margin-bottom: 0; }

b, strong { font-weight: 600; color: var(--forest); }
em, i { font-style: italic; }

code {
  padding: 0.1em 0.34em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--forest-tint);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

hr { margin: 1.75rem 0; border: 0; border-top: 1px solid var(--line); }

img { display: block; max-width: 100%; height: auto; }

header, nav, main, aside, section, article, footer, form { display: block; }

main.page { padding: clamp(1.25rem, 3vw, 2.25rem) 0 clamp(2rem, 5vw, 3.5rem); }

:focus-visible { outline: 3px solid var(--moss); outline-offset: 2px; }
.site-foot :focus-visible,
.cta :focus-visible { outline-color: var(--lime); }
.btn-primary:focus-visible { outline-color: var(--forest-deep); }

/* 03 ----------------------------------------------------------- skip link */

.skip {
  position: fixed;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 60;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--forest);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(calc(-100% - 1.5rem));
  transition: transform 0.15s ease;
}

.skip:focus,
.skip:focus-visible {
  transform: none;
  color: #fff;
  outline: 3px solid var(--lime);
  outline-offset: 2px;
}

/* 04 -------------------------------------------- header, brand, navigation */

.site-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  min-height: var(--head-h);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex: 0 0 auto;
  color: var(--forest);
  text-decoration: none;
}

/* The logo file carries the wordmark itself, so there is no separate text label. */
.brand-logo { height: 56px; width: auto; display: block; }


/* Mobile first: brand + action on one line, then a scrollable row of links.
   No hamburger — there is no JavaScript to open one. */
.site-nav {
  order: 3;
  flex: 1 0 100%;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
  padding: 0.4rem 0.15rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.nav-link {
  flex: 0 0 auto;
  padding: 0.42rem 0.6rem;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover { color: var(--forest); background: var(--forest-tint); border-bottom-color: var(--line-strong); }

.nav-link.is-active {
  color: var(--forest);
  font-weight: 600;
  border-bottom-color: var(--moss);
}

.head-cta { order: 2; margin-left: auto; flex: 0 0 auto; }

@media (min-width: 860px) {
  .head-inner { flex-wrap: nowrap; gap: 1.25rem; }
  .site-nav {
    order: 2;
    flex: 0 1 auto;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    overflow: visible;
    padding: 0;
    scrollbar-width: auto;
  }
  .head-cta { order: 3; margin-left: 0; }
}

/* 05 -------------------------------------------------------- shell & page */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-left: var(--shell-pad);
  padding-right: var(--shell-pad);
}

/* 06 -------------------------------------------------- crumbs & page head */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.45rem;
  margin: 0 0 clamp(0.9rem, 2vw, 1.2rem);
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

.crumbs a { color: var(--ink-soft); font-weight: 500; text-decoration: none; }
.crumbs a:hover { color: var(--forest); text-decoration: underline; text-decoration-color: var(--moss); }
.crumbs i { font-style: normal; color: var(--line-strong); }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 500; }

.page-head { max-width: 70ch; margin: 0 0 clamp(1.5rem, 3vw, 2rem); }

.page-title {
  margin: 0 0 0.7rem;
  font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.lede {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.25rem);
  line-height: 1.55;
}

/* 07 ----------------------------------------------------------- sections */

* + .sec { margin-top: var(--gap-sec); }
* + .cta { margin-top: var(--gap-sec); }

.sec-head { margin: 0 0 clamp(0.85rem, 2vw, 1.15rem); }

.sec-count {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--moss-tint);
  color: var(--forest);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  vertical-align: 0.15em;
  white-space: nowrap;
}

.sec-more { margin: 1rem 0 0; font-size: 1rem; font-weight: 500; }

.sec-more a {
  color: var(--forest);
  text-decoration: none;
  border-bottom: 1px solid var(--moss);
  padding-bottom: 0.08rem;
}

.sec-more a:hover { background: var(--moss-tint); color: var(--moss-dark); }

/* 08 -------------------------------------------------------------- tiles */

.tiles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(0.8rem, 1.7vw, 1.1rem);
  margin: 0;
}

@media (min-width: 640px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1080px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* The whole tile is the link. */
.tile {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: var(--card-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.tile:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--lift);
  color: var(--ink);
}

.tile:active { transform: translateY(0); box-shadow: none; }

.tile-title {
  display: block;
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.tile:hover .tile-title {
  color: var(--moss-dark);
  text-decoration: underline;
  text-decoration-color: var(--moss);
  text-decoration-thickness: 1px;
}

.tile-note {
  display: block;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.tile .tile-meta { margin-top: auto; padding-top: 0.5rem; }

/* 09 ------------------------------------------------------ cards & prose */

.panel {
  padding: var(--card-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel.prose {
  max-width: calc(var(--measure) + 4rem);
  margin: 0 0 var(--gap-block);
}

.prose { font-size: 1.0625rem; line-height: 1.7; }

.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

.prose p, .prose ul, .prose ol { max-width: var(--measure); }
.prose p { margin: 0 0 1.05rem; }
.prose ul, .prose ol { margin: 0 0 1.05rem; }
.prose li { margin-bottom: 0.4rem; }

.prose h2 {
  margin: 2rem 0 0.7rem;
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.45rem);
  letter-spacing: -0.012em;
}

.prose h3 { margin: 1.6rem 0 0.55rem; font-size: 1.12rem; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }

.prose blockquote {
  margin: 1.25rem 0;
  padding: 0.15rem 0 0.15rem 1.1rem;
  border-left: 3px solid var(--lime);
  color: var(--ink-soft);
  max-width: var(--measure);
}

.prose strong { color: var(--forest); }
.prose a { text-decoration-color: var(--line-strong); }

/* Tables inside prose: white header row, hairline row dividers, and the table
   itself scrolls sideways on a narrow screen instead of the page. */
.panel.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 0 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  line-height: 1.5;
}

.panel.prose thead { display: table-header-group; }
.panel.prose tbody { display: table-row-group; }
.panel.prose tr { display: table-row; }

.panel.prose th,
.panel.prose td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.panel.prose th:last-child,
.panel.prose td:last-child { border-right: 0; }
.panel.prose tbody tr:last-child th,
.panel.prose tbody tr:last-child td { border-bottom: 0; }

.panel.prose thead th {
  background: var(--surface);
  color: var(--forest);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.panel.prose tbody th { color: var(--ink); font-weight: 500; }
.panel.prose td { font-variant-numeric: tabular-nums; }

/* 10 ----------------------------------------------------------- facts strip */

.facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  max-width: calc(var(--measure) + 4rem);
  margin: 0 0 var(--gap-block);
  padding: 0 var(--card-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.facts-head {
  margin: 0;
  padding: 0.95rem 0 0.35rem;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fact {
  display: grid;
  gap: 0.15rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
}

.fact:last-child { padding-bottom: 0.95rem; }

/* The card's own hairline already closes the top of the strip, so the first
   row of facts carries no rule of its own — no doubled edge. */
.facts > .fact:first-child { border-top: 0; padding-top: 0.95rem; }
.facts > .facts-head + .fact { border-top: 1px solid var(--line); }

.fact-label {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.fact-value {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.fact-value a { color: var(--glacier); text-decoration-color: rgba(42, 110, 143, 0.45); }
.fact-value a:hover { color: var(--forest); text-decoration-color: var(--moss); }

.fact-note { color: var(--ink-soft); font-size: 0.82rem; line-height: 1.5; }

.muted { color: var(--ink-soft); font-weight: 400; }

/* Reference pages: longer rows, always stacked. */
.facts-rows { grid-template-columns: minmax(0, 1fr); max-width: calc(var(--measure) + 10rem); }

.facts-rows .fact { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; padding: 0.9rem 0; }
.facts-rows .fact-value { font-size: 1.05rem; }

@media (min-width: 640px) {
  .facts:not(.facts-rows) { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(1rem, 3vw, 2rem); }
  .facts:not(.facts-rows) .facts-head { grid-column: 1 / -1; }
  .facts:not(.facts-rows) .fact { padding-right: 0.5rem; }
  .facts:not(.facts-rows) .fact-value { font-size: 1.0625rem; }
  /* In two columns the top row is the first two cells. */
  .facts:not(.facts-rows) > .fact:nth-child(2) { border-top: 0; padding-top: 0.95rem; }
  .facts:not(.facts-rows):has(.facts-head) > .fact:nth-child(2) {
    border-top: 1px solid var(--line);
    padding-top: 0.8rem;
  }
}

/* 11 ----------------------------------------------------------------- FAQ */

.faq { max-width: calc(var(--measure) + 4rem); }

.qa { margin: 0; padding: 0 0 0.35rem; }

.qa-q {
  margin: 0 0 0.5rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--line);
  font-weight: 600;
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.2rem);
  line-height: 1.3;
}

.qa-a { color: var(--ink); font-size: 1rem; line-height: 1.68; }
.qa-a > :last-child { margin-bottom: 0; }
.qa-a ul, .qa-a ol { margin-top: 0.5rem; }

.qa + .qa { margin-top: 0.6rem; }
.qa:last-child { padding-bottom: 0; }

/* 12 ------------------------------------------------- link lists & meta */

.links {
  margin: 0;
  padding: 0;
  max-width: 74ch;
  list-style: none;
}

.links li {
  position: relative;
  margin: 0;
  padding: 0.32rem 0 0.32rem 1.05rem;
  line-height: 1.55;
}

.links li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.85em;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--moss);
}

.links a { font-weight: 500; }
.links .tile-meta { margin-left: 0.25rem; }

.meta-line {
  max-width: 80ch;
  margin: 0.9rem 0 0;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}

.meta-line a { color: var(--glacier); text-decoration-color: rgba(42, 110, 143, 0.45); }
.meta-line a:hover { color: var(--forest); text-decoration-color: var(--moss); }

.tile-meta {
  display: inline-block;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.07em;
  line-height: 1.5;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* 13 ------------------------------------ buttons, CTA band & disclosure */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.65rem 1.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.btn-primary {
  background: var(--moss-dark);
  border-color: var(--moss);
  color: #fff;
}

.btn-primary:visited { color: #fff; }
.btn-primary:hover { background: var(--moss-dark); border-color: var(--moss-dark); color: #fff; }
.btn-primary:active { transform: translateY(1px); background: var(--moss-dark); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--forest);
}

.btn-ghost:visited { color: var(--forest); }
.btn-ghost:hover { background: var(--forest-tint); border-color: var(--forest); color: var(--forest-deep); }
.btn-ghost:active { transform: translateY(1px); }

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.75rem;
  margin: 0 0 1rem;
  max-width: 70ch;
}

.cta-actions .tile-meta { text-transform: none; letter-spacing: 0.01em; font-size: 0.8rem; }

/* The closing band: a distinct dark card. */
.cta {
  padding: clamp(1.3rem, 3.5vw, 2.25rem);
  border: 1px solid var(--forest-deep);
  border-radius: var(--radius);
  background: var(--forest);
  color: var(--foot-ink);
}

.cta-title {
  margin: 0 0 0.5rem;
  max-width: 40ch;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.7rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.cta-note {
  margin: 0 0 1.15rem;
  max-width: 62ch;
  color: var(--foot-ink-soft);
  font-size: 1rem;
  line-height: 1.6;
}

.cta .cta-actions { margin-bottom: 0; }
.cta .btn-primary { background: var(--moss); border-color: var(--moss); color: #fff; }
.cta .btn-primary:hover { background: var(--lime); border-color: var(--lime); color: var(--forest-deep); }
.cta .tile-meta { color: var(--foot-ink-soft); }

.disclosure {
  margin: 1.25rem 0 0;
  padding: 0.1rem 0 0.1rem 0.9rem;
  border-left: 3px solid var(--antler);
  max-width: 78ch;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.6;
}

.disclosure a { color: inherit; text-decoration-color: var(--line-strong); }
.disclosure a:hover { color: var(--forest); }

.cta .disclosure { border-left-color: var(--lime); color: var(--foot-ink-soft); }
.cta .disclosure a { color: var(--foot-ink); text-decoration-color: rgba(255, 255, 255, 0.4); }
.cta .disclosure a:hover { color: #fff; }

/* 14 -------------------------------------------------------------- footer */

.site-foot {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding: clamp(1.75rem, 4vw, 3rem) 0 1.5rem;
  background: var(--forest-deep);
  color: var(--foot-ink-soft);
  font-size: 0.95rem;
}

.foot-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem 1.25rem;
  padding-bottom: clamp(1.25rem, 3vw, 2rem);
}

.foot-col { min-width: 0; }

.foot-head {
  margin: 0 0 0.65rem;
  color: var(--foot-head);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-foot .links li { padding: 0.22rem 0 0.22rem 1.05rem; line-height: 1.5; }
.site-foot .links li::before { background: var(--lime); opacity: 0.55; }

.site-foot a { color: var(--foot-ink); text-decoration: none; border-bottom: 1px solid transparent; }
.site-foot a:visited { color: var(--foot-ink); }
.site-foot a:hover { color: var(--lime); border-bottom-color: var(--lime); }

.foot-legal {
  padding-top: 1.25rem;
  border-top: 1px solid var(--foot-line);
  color: var(--foot-ink-soft);
  font-size: 0.82rem;
  line-height: 1.65;
}

.foot-legal p { max-width: 92ch; margin: 0 0 0.6rem; }
.foot-legal p:last-child { margin-bottom: 0; }
.foot-legal b { color: #fff; }

@media (min-width: 640px) {
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .foot-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 15 ------------------- calculator forms (the calculator markup still uses the
   pre-card class names, so this block styles it through elements and the
   data-tool hook only — no class selector outside the manifest). */

form[data-tool] {
  max-width: calc(var(--measure) + 4rem);
  margin: 0 0 var(--gap-block);
  padding: var(--card-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

form[data-tool] > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  margin: 0;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}

form[data-tool] > div:first-child {
  display: block;
  padding: 0 0 0.6rem;
  border-top: 0;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

form[data-tool] label {
  flex: 1 1 12rem;
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
}

form[data-tool] input,
form[data-tool] select {
  flex: 1 1 9rem;
  max-width: 20rem;
  min-height: var(--tap);
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

form[data-tool] input:hover,
form[data-tool] select:hover { border-color: var(--moss); }

form[data-tool] button {
  display: block;
  min-height: var(--tap);
  margin: 0.85rem 0 0;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--moss);
  border-radius: var(--radius-sm);
  background: var(--moss);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

form[data-tool] button:hover { background: var(--moss-dark); border-color: var(--moss-dark); }

[id^="out-"] {
  max-width: calc(var(--measure) + 4rem);
  margin: 0 0 var(--gap-block);
  padding: var(--card-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--forest-tint);
}

[id^="out-"] > div:first-child {
  margin: 0 0 0.6rem;
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

[id^="out-"] > div + div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.2rem 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
}

[id^="out-"] > div + div > span:last-child {
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

[id^="out-"] > p {
  margin: 0.85rem 0 0;
  max-width: 62ch;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
}

/* 16 --------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }
  .tile:hover { transform: none; }
  .btn:active { transform: none; }
  .skip { transition: none; }
}

/* 17 ---------------------------------------------------------------- print */

@media print {
  @page { margin: 14mm; }

  html, body { background: #fff; color: #000; font-size: 11.5pt; }

  .site-head, .site-foot, .site-nav, .head-cta, .skip,
  .crumbs, .cta, .cta-actions, .disclosure { display: none; }

  .shell { max-width: none; padding: 0; }
  main { padding: 0; }

  h1, h2, h3, .page-title, .sec-head, .qa-q, .tile-title, .fact-value { color: #000; }
  .lede, .tile-note, .fact-label, .fact-note, .meta-line, .qa-a, .prose { color: #000; }

  p, ul, ol, .prose p, .prose ul, .prose ol, .meta-line, .links { max-width: none; }

  a { color: #000; text-decoration: underline; }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-family: var(--font-mono);
    font-size: 9pt;
    word-break: break-all;
  }

  .tiles { display: block; }

  .tile, .panel, .facts, .qa {
    margin: 0 0 0.5rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid #999;
    border-radius: 0;
    box-shadow: none;
    transform: none;
    page-break-inside: avoid;
  }

  .panel.prose table { display: table; overflow: visible; border-color: #999; }
  .panel.prose th, .panel.prose td { border-color: #999; }
  .panel.prose thead th { background: #fff; }
  thead { display: table-header-group; }
  tr, .fact { page-break-inside: avoid; }
}
