/* ==========================================================================
   paydayloaning.com — "Ledger" stylesheet
   --------------------------------------------------------------------------
   An editorial consumer-finance reference, not a marketing page.

   Rules of the language:
     · hairline rules and 1px borders — no drop shadows anywhere
     · near-square corners (2px), never pills or rounded cards
     · strong typographic hierarchy: tight display headings, uppercase micro
       labels, tabular numerals for every money figure
     · one gold accent used as a marker (kicker bars, verdict rules, CTA edge)
     · indigo is structural (links, panels, the verdict slab), never decorative
     · system font stack only; no imports, no external requests, no JS

   Brand hues are fixed by the logo: indigo #1e40af, deep indigo #1b3a9e,
   gold #f59e0b, ink #0f172a, paper #f7f9fc.

   Class contract: CONTRACTS.md section 4 (renderer <-> stylesheet).
   ========================================================================== */

/* ------------------------------------------------------------------ tokens */
:root {
  /* Brand */
  --brand: #1e40af;
  --brand-deep: #1b3a9e;
  --brand-ink: #14265e;
  --brand-tint: #e9eefb;
  --accent: #f59e0b;
  --accent-ink: #8a5300;   /* gold that is legible on paper: 5.9:1 */
  --accent-tint: #fdf4e3;

  /* Neutrals */
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #5b6b82;        /* 5.0:1 on --paper */
  --paper: #f7f9fc;
  --surface: #ffffff;

  /* Text and hairlines on the dark (ink) surfaces — one token per role,
     so the verdict slab, tool readout, CTA dock and footer stay consistent. */
  --on-dark: #ffffff;
  --on-dark-strong: #eef2fb;
  --on-dark-muted: #c3cee4;
  --on-dark-faint: #9fb0d0;
  --on-dark-accent: #f3d9a4;
  --rule-on-dark: rgba(255, 255, 255, 0.18);
  --rule-on-dark-strong: rgba(255, 255, 255, 0.45);
  --rule: #dde3ec;
  --rule-strong: #bcc6d6;

  --focus: #12265f;

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  /* Space — 4px rhythm */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --wrap: 1100px;
  --gutter: 1.25rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.site {
  margin: 0;
  min-height: 100vh;
  /* Clearance for the fixed mobile CTA dock. It renders below 720px, so the space
     is reserved here for the whole range and reset in the min-width:720px block.
     7.25rem covers the tallest measured dock (132px at 280px wide, where the note
     wraps to three lines) plus the iOS safe area. */
  padding-bottom: calc(7.25rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main#main {
  flex: 1 0 auto;
  width: 100%;
  padding-block: var(--s3) var(--s7);
  scroll-margin-top: 5rem;
}

img,
svg { max-width: 100%; height: auto; }

p { margin: 0 0 var(--s4); }

ul,
ol { margin: 0 0 var(--s4); }

strong { font-weight: 700; }

small {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

::selection {
  background: var(--brand-tint);
  color: var(--ink);
}

/* One focus treatment everywhere; gold on the dark slabs. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.site-footer :focus-visible,
.cta-dock :focus-visible,
.verdict :focus-visible,
.tool-result :focus-visible {
  outline-color: var(--accent);
}

/* ------------------------------------------------------------------ layout */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --------------------------------------------------------------- skip link */
.skip {
  position: fixed;
  top: var(--s3);
  left: var(--s3);
  z-index: 200;
  transform: translateY(-300%);
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.skip:focus {
  transform: none;
  color: var(--paper);
}

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 56px;
  padding-block: 0.4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink);
  flex: 0 0 auto;
}

.brand-mark {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 2px;
}

.brand-name {
  /* Visually hidden below 560px, NOT display:none — the wordmark is the only
     accessible name for the home link once the mark (alt="") is all that shows. */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.brand-tld { color: var(--accent-ink); }

.nav {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-left: auto;
  justify-content: flex-start;
}

.nav::-webkit-scrollbar { display: none; }

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.6rem;
  border-bottom: 3px solid transparent;
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--brand);
  border-bottom-color: var(--rule-strong);
}

.nav-link.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ------------------------------------------------------------- breadcrumbs */
.breadcrumbs {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin: 0 0 var(--s3);
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--s1);
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: var(--s1);
  min-width: 0;
}

.breadcrumbs li + li::before {
  content: "\203A";
  color: var(--accent-ink);
  font-weight: 700;
}

.breadcrumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-3);
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
}

.breadcrumbs a:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumbs [aria-current="page"] {
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------- masthead */
.masthead {
  padding-bottom: var(--s4);
  border-bottom: 3px solid var(--ink);
  margin-bottom: var(--s5);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.55rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.kicker::before {
  content: "";
  flex: 0 0 auto;
  width: 22px;
  height: 3px;
  background: var(--accent);
}

.page-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.9rem, 1.35rem + 2.4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}

.lede {
  max-width: 64ch;
  margin: 0;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.6;
  color: var(--ink-2);
}

.meta-line {
  margin: var(--s3) 0 0;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.meta-line strong {
  color: var(--ink-2);
  font-weight: 700;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--s5);
}

.byline .meta-line { margin: 0; }

.byline-count {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- sections */
.section { margin-top: var(--s7); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.25rem;
  border-top: 2px solid var(--ink);
  padding-top: 0.6rem;
  margin-bottom: var(--s4);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}

.section-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  white-space: nowrap;
}

.section-link:hover { color: var(--brand-ink); }

.section-note {
  max-width: 70ch;
  margin: calc(-1 * var(--s3)) 0 var(--s4);
  font-size: 0.9375rem;
  color: var(--ink-3);
}

.section-foot {
  max-width: 72ch;
  margin: var(--s4) 0 0;
  padding-top: var(--s3);
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

/* ------------------------------------------------------- panels and columns */
.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.15rem 1.25rem;
}

.panel > :last-child { margin-bottom: 0; }

.panel-label {
  margin: 0 0 var(--s2);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}

.cols-2 {
  display: grid;
  gap: var(--s4);
  align-items: start;
}

/* The answer block: left-aligned direct answer, gold rule, no card. */
.answer {
  border-left: 5px solid var(--accent);
  background: var(--accent-tint);
  padding: 0.9rem 1.1rem;
  margin-top: var(--s5);
}

.answer-label {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.answer-text {
  margin: 0;
  max-width: 74ch;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
}

/* ------------------------------------------------------------- compare grid */
.compare {
  display: grid;
  gap: 1px;
  background: var(--rule-strong);
  border: 1px solid var(--rule-strong);
}

.compare-col {
  background: var(--surface);
  padding: var(--s4) 1.1rem;
}

.compare-col-alt { background: var(--brand-tint); }

.compare-tag {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.compare-col-alt .compare-tag { color: var(--brand-ink); }

.compare-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.compare-list li {
  padding: 0.5rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.compare-list li:first-child { border-top: 0; }

/* ------------------------------------------------------------ principles */
.principles {
  list-style: none;
  counter-reset: principle;
  display: grid;
  gap: var(--s4);
  margin: 0;
  padding: 0;
}

.principles li {
  counter-increment: principle;
  position: relative;
  padding: 0.85rem 0 0 2.9rem;
  border-top: 1px solid var(--rule);
}

.principles li::before {
  content: counter(principle, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.95rem;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------- index (rows) */
.index {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule-strong);
}

.index-row { border-bottom: 1px solid var(--rule); }

.index-link {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
  min-height: 44px;
  padding: 0.8rem 0.35rem;
  text-decoration: none;
  color: var(--ink);
}

.index-link:hover { background: var(--brand-tint); }
.index-link:hover .index-title { color: var(--brand); }

.index-num {
  padding-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}

.index-body { min-width: 0; }

.index-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.index-note {
  display: block;
  max-width: 72ch;
  margin-top: 0.2rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-3);
}

/* --------------------------------------------------------------- tile grid */
.grid {
  display: grid;
  gap: var(--s3);
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 100%;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule-strong);
  color: var(--ink);
  text-decoration: none;
}

.tile:hover {
  border-color: var(--brand);
  border-left-color: var(--accent);
  background: var(--brand-tint);
}

.tile-title {
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.tile:hover .tile-title { color: var(--brand); }

.tile-note {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-3);
}

/* -------------------------------------------------------------- link lists */
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-list li { border-bottom: 1px solid var(--rule); }
.link-list li:last-child { border-bottom: 0; }

.link-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.15rem 0;
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.link-list a:hover {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------- city list */
.city-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.city-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
  break-inside: avoid;
}

.city-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.city-list a:hover {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.city-pop {
  color: var(--ink-3);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------------------------------------------- A-Z index */
.az {
  display: grid;
  gap: var(--s5);
}

.az-letter {
  margin: 0 0 0.35rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--accent-ink);
}

.az-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.az-list a {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  min-height: 44px;
  padding: 0.4rem 0.2rem;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
}

.az-list a:hover { background: var(--brand-tint); }
.az-list a:hover .az-name { color: var(--brand); }

.az-abbr {
  flex: 0 0 auto;
  min-width: 2.2rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.az-name { font-weight: 600; }

/* ------------------------------------------------------- fact strip (above fold) */
.fact-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--rule-strong);
  border: 1px solid var(--rule-strong);
  border-top: 3px solid var(--ink);
  margin-top: var(--s5);
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.7rem 0.85rem;
  background: var(--surface);
}

.fact-label {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.fact-value {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.fact-src {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fact-src:hover { color: var(--brand); }

/* ------------------------------------------------------------ verdict slab */
.verdict {
  background: var(--brand-ink);
  color: var(--on-dark-strong);
  border-top: 5px solid var(--accent);
  padding: 1.25rem 1.25rem 1.1rem;
  margin-top: var(--s5);
}

.verdict-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.verdict-status {
  margin: 0;
  font-size: clamp(1.2rem, 1.05rem + 0.7vw, 1.55rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--on-dark);
  text-wrap: balance;
}

.verdict-note {
  margin: 0.6rem 0 0;
  max-width: 70ch;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--on-dark-muted);
}

.verdict-src-line {
  margin: 0.6rem 0 0;
  font-size: 0.8125rem;
  color: var(--on-dark-faint);
}

.verdict a { color: var(--on-dark-strong); }
.verdict a:hover { color: var(--on-dark); }

.verdict-grid {
  display: grid;
  gap: 1px;
  margin: var(--s4) 0 0;
  background: var(--rule-on-dark);
  border: 1px solid var(--rule-on-dark);
}

.verdict-cell {
  background: var(--brand-ink);
  padding: 0.8rem 0.9rem;
}

.verdict-cell dt {
  margin: 0 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-faint);
}

.verdict-cell dd {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--on-dark);
  font-variant-numeric: tabular-nums;
}

.verdict-cell dd + dd { margin-top: 0.35rem; }

.verdict-cell-src { font-size: 0.75rem; line-height: 1.4; }

.verdict-foot {
  margin: var(--s4) 0 0;
  font-size: 0.8125rem;
  color: var(--on-dark-faint);
}

/* Compact verdict band (city pages) */
.verdict-band {
  display: grid;
  gap: var(--s3);
  align-items: center;
  padding: 1rem 1.25rem;
}

.verdict-band .verdict-status {
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem);
}

.verdict-band-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--rule-on-dark-strong);
  color: var(--on-dark);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  justify-self: start;
}

.verdict-band-link:hover {
  background: var(--on-dark);
  color: var(--brand-ink);
}

/* ------------------------------------------------------------- CTA + dock */
.cta {
  display: grid;
  gap: var(--s4);
  margin-top: var(--s5);
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-left: 5px solid var(--accent);
}

.cta-kicker {
  margin: 0 0 0.3rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.cta-lede {
  margin: 0;
  max-width: 52ch;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.cta-actions {
  display: grid;
  gap: var(--s2);
}

/* One-button offer bar: used at the top of city and state pages so the sourced
   facts and the offer both fit the first viewport. */
.cta-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 0.8rem 1rem;
}

.cta-compact .cta-kicker { margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-dark);
}

.btn-primary:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: var(--on-dark);
}

.btn-ghost {
  background: transparent;
  border-color: var(--rule-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.disclosure {
  max-width: 78ch;
  margin: 0.75rem 0 var(--s5);
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-3);
}

.disclosure a { color: var(--brand); }

/* Mobile persistent CTA: always in the first viewport. */
.cta-dock {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 80;
  display: grid;
  gap: 0.35rem;
  padding: 0.5rem var(--gutter) calc(0.55rem + env(safe-area-inset-bottom));
  background: var(--ink);
  border-top: 3px solid var(--accent);
}

.cta-dock-note {
  margin: 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--on-dark-muted);
}

.cta-dock .btn { width: 100%; }

/* ------------------------------------------------------------------- FAQ */
.faq {
  margin-top: var(--s7);
  padding-top: 0.6rem;
  border-top: 2px solid var(--ink);
}

.faq h2 {
  margin: 0 0 var(--s2);
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.faq-item { border-bottom: 1px solid var(--rule); }

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: 44px;
  padding: 0.85rem 0;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--ink);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 1.5rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-ink);
}

.faq-item[open] summary { color: var(--brand-ink); }
.faq-item[open] summary::after { content: "\2212"; }

.faq-answer {
  max-width: 72ch;
  padding: 0 0 var(--s4) 1rem;
  border-left: 2px solid var(--accent);
  margin-left: 0.15rem;
  color: var(--ink-2);
  line-height: 1.65;
}

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

/* ----------------------------------------------------------------- prose */
.prose {
  max-width: 70ch;
  color: var(--ink);
}

/* A prose section keeps the full section width so its heading rule lines up with
   sibling sections; only the running text is held to a readable measure. */
.section.prose { max-width: none; }
.section.prose p,
.section.prose li { max-width: 70ch; }

.prose h2 {
  margin: var(--s6) 0 0.75rem;
  padding-top: 0.6rem;
  border-top: 2px solid var(--ink);
  font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  scroll-margin-top: 6rem;
}

/* .section-head already draws the section rule. The h2 inside it is a flex item,
   so without this reset it draws a second, text-width rule under the first. */
.prose .section-head h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose h3 {
  margin: var(--s5) 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand-ink);
}

.prose > h2:first-child,
.prose > h3:first-child { margin-top: 0; }

.prose p,
.prose li {
  line-height: 1.7;
}

.prose ul,
.prose ol { padding-left: 1.3rem; }

.prose li { margin-bottom: 0.4rem; }

.prose a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover { color: var(--brand-ink); }



/* Wide data tables scroll inside their own box so the page never scrolls
   horizontally at very narrow widths. */
.table-scroll {
  max-width: 100%;
  margin: var(--s4) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* The wrapper owns the vertical rhythm, so the table inside carries no margin. */
.table-scroll > table { margin: 0; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s4) 0;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

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

.prose thead th {
  border-bottom: 2px solid var(--ink);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.prose .data-table { margin-top: var(--s3); }

/* Document pages (policies) */
.prose.doc {
  max-width: 74ch;
  padding-top: var(--s2);
}

.prose.doc p { margin-bottom: 1.1rem; }

/* -------------------------------------------------------------- data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s3) 0 0;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.data-table th,
.data-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--rule);
}

.data-table thead th {
  border-bottom: 2px solid var(--ink);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td { border-bottom: 0; }

.data-table a { color: var(--brand); }

.data-table small {
  display: inline-block;
  margin-top: 0.2rem;
  line-height: 1.45;
  color: var(--ink-3);
}

.rule-label {
  font-weight: 700;
  color: var(--ink);
}

.rule-src { font-size: 0.875rem; }

/* Collapsed source quotes inside rules tables */
.src-note { margin-top: 0.35rem; }

.src-note summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.1rem 0;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand);
}

.src-note summary:hover { color: var(--brand-ink); }

.src-note small {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink-3);
  line-height: 1.5;
}

/* ------------------------------------------------------------------ tool */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
}

.tool.card {
  display: grid;
  margin-top: var(--s5);
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-top: 4px solid var(--ink);
}

.tool-form {
  display: grid;
  gap: var(--s4);
  margin: 0;
  padding: 1.15rem 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.field label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.field input:hover,
.field select:hover { border-color: var(--ink-3); }

.field input:focus,
.field select:focus { border-color: var(--brand); }

.field input::placeholder { color: var(--ink-3); }

.tool-form .btn { justify-self: start; }

.tool-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.15rem 1.25rem;
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid var(--rule-strong);
}

.tool-primary {
  margin: 0 0 0.35rem;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--on-dark);
  font-variant-numeric: tabular-nums;
}

.tool-note {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--on-dark-muted);
}

.tool-result .tool-note + .tool-primary { margin-top: 0.6rem; }

.tool-result .data-table { margin-top: 0.75rem; }

.tool-result .data-table th,
.tool-result .data-table td {
  border-color: var(--rule-on-dark);
  color: var(--on-dark-strong);
}

.tool-result .data-table th {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--on-dark-faint);
}

.tool-result .data-table tbody tr:last-child th,
.tool-result .data-table tbody tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------- article + rail */
.article-layout {
  display: grid;
  gap: var(--s5);
  margin-top: var(--s5);
}

/* Grid children must be shrinkable or a wide table forces the column open. */
.article-layout > * { min-width: 0; }

.rail {
  padding: var(--s4) 1.1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
}

.rail-head {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.rail-list {
  list-style: none;
  counter-reset: rail;
  margin: 0;
  padding: 0;
}

.rail-list li {
  counter-increment: rail;
  border-top: 1px solid var(--rule);
}

.rail-list li:first-child { border-top: 0; }

.rail-list a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink-2);
  text-decoration: none;
}

.rail-list a::before {
  content: counter(rail, decimal-leading-zero);
  flex: 0 0 auto;
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}

.rail-list a:hover { color: var(--brand); }

/* ------------------------------------------------------------- references */
.ref-list {
  margin: 0;
  padding-left: 1.4rem;
}

.ref-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}

.ref-list li:last-child { border-bottom: 0; }

.ref-list a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ref-pub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

/* ------------------------------------------------------------ contact card */
.contact-mail {
  margin: 0 0 var(--s3);
  font-size: 1.125rem;
  font-weight: 700;
}

.contact-mail a { color: var(--brand); overflow-wrap: anywhere; }

/* ----------------------------------------------------------------- footer */
.site-footer {
  margin-top: var(--s7);
  background: var(--ink);
  color: var(--on-dark-muted);
  border-top: 4px solid var(--accent);
}

.footer-main {
  display: grid;
  gap: var(--s6);
  padding-block: var(--s6) var(--s5);
}

.footer-brand {
  margin: 0 0 0.5rem;
  color: var(--on-dark);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.footer-note {
  max-width: 44ch;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--on-dark-muted);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s5) var(--s4);
}

.footer-head {
  margin: 0 0 0.4rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule-on-dark);
  color: var(--on-dark-accent);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--on-dark-strong);
  font-size: 0.875rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--on-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-legal {
  padding-block: var(--s4) var(--s5);
  border-top: 1px solid var(--rule-on-dark);
}

.footer-legal p {
  max-width: 100ch;
  margin: 0 0 0.6rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--on-dark-muted);
}

.footer-legal p:last-child { margin-bottom: 0; }

.footer-legal a {
  color: var(--on-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-legal-links { margin-top: 0.35rem; }

/* Structural wrappers: explicit so the class contract has no unstyled hooks. */
.az-group,
.cta-copy,
.footer-about,
.refs,
.verdict-band-main { min-width: 0; }

/* ---------------------------------------------------------- small screens */
@media (max-width: 639px) {
  /* Key/value and rule tables become stacked label/value rows: no sideways
     scrolling, and the source line stays attached to its figure. */
  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td { display: block; width: auto; }

  .data-table thead { display: none; }

  .data-table tr {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--rule-strong);
  }

  .data-table tr:last-child { border-bottom: 0; }

  .data-table th,
  .data-table td {
    border: 0;
    padding: 0.15rem 0;
    white-space: normal;
  }

  .data-table .rule-label,
  .data-table tbody th {
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
  }

  /* Comparison tables inside guide prose: let the cells wrap so the table fits
     the viewport. nowrap + overflow clipped words mid-glyph and hid the last
     column entirely, with no scroll affordance. */
  .prose table:not(.data-table) {
    display: table;
    width: 100%;
    table-layout: auto;
    font-size: 0.75rem;
    white-space: normal;
  }

  .prose table:not(.data-table) th,
  .prose table:not(.data-table) td {
    white-space: normal;
    /* break-word, not anywhere: a word breaks only if it cannot fit at all, so
       "installment" stays whole instead of rendering as "installme nt". */
    overflow-wrap: break-word;
    padding: 0.4rem 0.35rem;
  }

  .prose table:not(.data-table) thead th { letter-spacing: 0.02em; }

  /* The fold matters on phones: the summary strip and the CTA are kept
     compact so both the key facts and the offer fit the first viewport. */
  .fact-strip { margin-top: var(--s4); }

  .fact { padding: 0.6rem 0.7rem; }

  .fact-src {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .verdict { padding: 1rem 1rem 0.9rem; }

  .verdict-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--rule-on-dark);
  }

  .verdict-cell {
    padding: 0.7rem 0.6rem;
    border-bottom: 1px solid var(--rule-on-dark);
    border-right: 1px solid var(--rule-on-dark);
  }

  .verdict-cell:nth-child(2n) { border-right: 0; }
  .verdict-cell:last-child { grid-column: 1 / -1; border-right: 0; }
  .verdict-cell dd { font-size: 0.875rem; }

  .cta { gap: var(--s3); padding: 0.9rem 1rem; }
  .cta-lede { font-size: 0.9375rem; line-height: 1.5; }

}

/* ------------------------------------------------------------ breakpoints */
@media (min-width: 560px) {
  .brand-name {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip-path: none;
  }
}

@media (min-width: 640px) {
  :root { --gutter: 1.5rem; }

  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .az { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .city-columns { columns: 2; column-gap: var(--s6); }

  .tool-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-form .btn { grid-column: 1 / -1; }

  .cta-actions { grid-auto-flow: column; justify-content: start; }

  .compare { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 720px) {
  .nav { justify-content: flex-end; }
  .nav-link { padding: 0 0.75rem; }
}

/* The dock retires only when the viewport is tall enough that the in-flow CTA is
   actually above the fold. Landscape phones are >=720px wide but only ~390px tall,
   where the in-flow CTA sits at ~570px -- so the dock stays there, and the base
   body padding keeps the footer's disclosure links reachable. */
@media (min-width: 720px) and (min-height: 620px) {
  .cta-dock { display: none; }
  body.site { padding-bottom: 0; }
}

@media (min-width: 760px) {
  .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
  .verdict-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .verdict-band { grid-template-columns: minmax(0, 1fr) auto; gap: var(--s5); }
  .verdict-band-link { justify-self: end; }
  .footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

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

  .az { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .city-columns { columns: 3; }

  .index-cols .index {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--s6);
    border-top: 1px solid var(--rule-strong);
  }

  .index-cols .index-row { break-inside: avoid; }

  .tool.card { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
  .tool-form { grid-template-columns: minmax(0, 1fr); }
  .tool-result {
    border-top: 0;
    border-left: 1px solid var(--rule-strong);
  }

  .article-layout { grid-template-columns: 264px minmax(0, 1fr); gap: var(--s7); }

  .rail {
    position: sticky;
    top: 5.25rem;
    align-self: start;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
  }
}

@media (min-width: 1024px) {
  :root { --gutter: 2rem; }

  .footer-main { grid-template-columns: minmax(0, 1.15fr) minmax(0, 3fr); }
  .footer-cols { gap: var(--s5); }
  .footer-col + .footer-col {
    padding-left: var(--s4);
    border-left: 1px solid var(--rule-on-dark);
  }
}

/* -------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
