/* nnpets.com — tool stylesheet.
   No frameworks, no web fonts, no external requests. Fast by construction. */

:root {
  --ink:        #16202b;
  --ink-2:      #46545f;
  --ink-3:      #65727d;  /* 4.93:1 on white, 4.67:1 on --bg-2 — WCAG AA for normal text.
                              The previous #6d7b86 measured 4.35:1 / 4.12:1 and failed AA at 11.5-14px. */
  --line:       #dfe4e8;
  --line-2:     #eef1f4;
  --bg:         #ffffff;
  --bg-2:       #f7f9fa;
  --accent:     #1c6b5b;
  --accent-2:   #17594c;
  --accent-bg:  #eef6f4;
  --warn-bg:    #fff8ec;
  --warn-line:  #f0d9ae;
  /* ── Spacing scale ────────────────────────────────────────
     Every padding / margin / gap in this file uses one of these. The rule is
     2px granularity up to 16px, then 4px. No invented values: if you need a
     number that is not here, the layout is wrong, not the scale. */
  --sp-1:   1px;        /*  1px — hairline minimum for tight fits */
  --sp-2:   0.125rem;   /*  2px */
  --sp-4:   0.25rem;    /*  4px */
  --sp-6:   0.375rem;   /*  6px */
  --sp-8:   0.5rem;     /*  8px */
  --sp-10:  0.625rem;   /* 10px */
  --sp-12:  0.75rem;    /* 12px */
  --sp-14:  0.875rem;   /* 14px */
  --sp-16:  1rem;       /* 16px */
  --sp-20:  1.25rem;    /* 20px */
  --sp-24:  1.5rem;     /* 24px */
  --sp-28:  1.75rem;    /* 28px */
  --sp-32:  2rem;       /* 32px */
  --sp-40:  2.5rem;     /* 40px */
  --sp-48:  3rem;       /* 48px */
  --sp-56:  3.5rem;     /* 56px */
  --sp-64:  4rem;       /* 64px */

  --radius:     10px;
  --shadow:     0 1px 2px rgba(22,32,43,.05), 0 4px 14px rgba(22,32,43,.05);
  --maxw:       1000px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-20); }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
/* Brand on the left, navigation on the right, one row. */
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-16); flex-wrap: wrap;
  padding-top: var(--sp-16); padding-bottom: var(--sp-16);
}

.brand { display: flex; align-items: center; text-decoration: none; color: inherit; }
/* Wordmark. Sized to its text rather than a fixed tile, since it now carries
   the site name instead of a two-letter monogram. */
.brand-mark {
  display: inline-flex; align-items: center;
  padding: var(--sp-8) var(--sp-12);
  border-radius: 10px;
  background: var(--accent); color: #fff;
  font-weight: 700; font-size: 1.0625rem; letter-spacing: -.4px; line-height: 1;
}

.site-nav { display: flex; flex-wrap: wrap; gap: var(--sp-16); font-size: 0.875rem; }
.site-nav a {
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
  /* WCAG 2.5.5: 44px minimum touch target. Without this the header links are
     ~20px tall on a phone. */
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 var(--sp-12);
  border-radius: 8px;
}
.site-nav a:hover { background: var(--bg-2); }

/* Four text links cannot share a row with the wordmark on a phone, so the nav
   wraps to its own line. Tighten the horizontal rhythm there — the 44px touch
   target is height, and stays. */
@media (max-width: 619px) {
  .site-nav { gap: var(--sp-8); font-size: 0.8125rem; }
  .site-nav a { padding: 0 var(--sp-8); }
}

/* ── Breadcrumbs ────────────────────────────────────────── */
.crumbs { margin: var(--sp-20) 0 0; font-size: 0.8125rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-6); margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: var(--sp-6); color: var(--ink-3); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink-3); }

/* ── Headings ───────────────────────────────────────────── */
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); line-height: 1.15; letter-spacing: -.8px; margin: var(--sp-14) 0 var(--sp-12); }
/* No measure here on purpose: this is a 2–3 line introduction that sits
   directly above a full-width notice box and the full-width calculator. A
   capped column left half the page empty for no reading benefit. */
.lede { font-size: 1.0625rem; color: var(--ink-2); margin: 0 0 var(--sp-28); }

/* ── Layout ─────────────────────────────────────────────── */
.layout { display: grid; gap: var(--sp-20); align-items: start; }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(320px, 25rem) 1fr; }
  .calculator { position: sticky; top: var(--sp-20); }
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-20);
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 0.8125rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .7px; color: var(--ink-3);
  margin: 0 0 var(--sp-14);
}

/* ── Form ───────────────────────────────────────────────── */
.field { margin-bottom: var(--sp-20); }
.field label, .field legend {
  display: block; font-weight: 600; font-size: 0.875rem; margin-bottom: var(--sp-6);
}
.field legend { padding: 0; }
.opt { font-weight: 400; color: var(--ink-3); }
fieldset.field { border: 0; padding: 0; margin: 0 0 var(--sp-16); }

.input-row { display: flex; gap: var(--sp-8); }
.input-row + .input-row { margin-top: var(--sp-8); }

input[type="number"], select {
  font: inherit; font-size: 1rem;
  padding: var(--sp-10) var(--sp-12);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-width: 0;
  width: 100%;
}
input[type="number"] { flex: 1 1 auto; }
.input-row select { flex: 0 0 auto; width: auto; }
.unit-static {
  display: flex; align-items: center; padding: 0 var(--sp-12);
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-2); color: var(--ink-3); font-size: 0.875rem; white-space: nowrap;
}
input:focus, select:focus, button:focus-visible {
  outline: 3px solid rgba(28,107,91,.28);
  outline-offset: 1px;
  border-color: var(--accent);
}

.hint { font-size: 0.8125rem; color: var(--ink-3); margin: var(--sp-6) 0 0; line-height: 1.5; }

button.primary {
  font: inherit; font-weight: 600; font-size: 1rem;
  width: 100%; padding: var(--sp-12) var(--sp-16); cursor: pointer;
  color: #fff; background: var(--accent);
  border: 0; border-radius: 8px;
}
button.primary:hover { background: var(--accent-2); }
button.primary:active { transform: translateY(1px); }

.form-error {
  margin: var(--sp-12) 0 0; padding: var(--sp-10) var(--sp-12);
  background: var(--warn-bg); border: 1px solid var(--warn-line);
  border-radius: 8px; font-size: 0.875rem; color: #7a4b00;
}

/* ── Results ────────────────────────────────────────────── */
.results { display: grid; gap: var(--sp-16); }
@media (min-width: 620px) and (max-width: 899px) {
  .results { grid-template-columns: 1fr 1fr; }
}

.result .big {
  font-size: clamp(1.625rem, 4vw, 2.125rem); font-weight: 700;
  letter-spacing: -.7px; line-height: 1.1; margin: 0 0 var(--sp-6);
  color: var(--accent);
}
.result .big-muted { color: var(--ink-3) !important; font-size: clamp(1.25rem, 3vw, 1.625rem) !important; }
.result .big .unit { font-size: 1rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.result .sub { margin: 0 0 var(--sp-10); color: var(--ink-2); font-size: 0.9375rem; }
.result .note { margin: 0; font-size: 0.875rem; color: var(--ink-3); line-height: 1.55; }

.note.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  padding: var(--sp-10) var(--sp-12);
  color: #6b4400;
}

.method { margin-top: var(--sp-14); border-top: 1px solid var(--line-2); padding-top: var(--sp-12); }
.method summary {
  cursor: pointer; font-size: 0.8125rem; font-weight: 600; color: var(--accent);
}
.method summary:hover { text-decoration: underline; }
.method p { margin: var(--sp-10) 0 0; font-size: 0.8125rem; color: var(--ink-2); line-height: 1.6; }
.method .src { color: var(--ink-3); }
.method code {
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 5px; padding: var(--sp-1) var(--sp-4);
  font-size: 0.78125rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ── Prose ──────────────────────────────────────────────── */
/* The prose column is deliberately UNCONSTRAINED — do not "fix" this by adding
   a max-width.
   A measured column (45–75 characters) is the typographic ideal, but this
   layout's container width is set by the two-column calculator grid, so a
   measured column left roughly 40% of the page empty. Two-column flow was tried
   and read worse. If you ever reintroduce a measure here, widen `.wrap` to match
   it, or the gap comes straight back.
   The cost of full width is long lines (~120 characters at 960px/16px), so the
   leading is raised below to help the eye track from one line to the next. */
.prose { margin: var(--sp-56) 0 0; }
.prose p { line-height: 1.75; }


/* ═══════════════════════════════════════════════════════════════════════
   The blocks below were lost to an over-broad range deletion during the
   option-B typography change, and reconstructed from the tokens defined at
   the top of this file. Keep them grouped by role, not by accident.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Tool grid (homepage) ───────────────────────────────── */
.tool-grid {
  display: grid; gap: var(--sp-20); margin: var(--sp-28) 0 var(--sp-8);
  /* min() prevents a hard overflow at 320px: full-bleed content is 280px there. */
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}
.tool-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--sp-24);
  box-shadow: var(--shadow);
}
.tool-card:hover { border-color: var(--accent); }
.tool-card h2 { margin: 0 0 var(--sp-10); font-size: 1.1875rem; letter-spacing: -.3px; color: var(--accent); }
.tool-card p { margin: 0 0 var(--sp-10); color: var(--ink-2); font-size: 0.9375rem; line-height: 1.6; }
.tool-meta { font-size: 0.84375rem; color: var(--ink-3); }
.tool-go { display: inline-block; margin-top: var(--sp-4); font-size: 0.875rem; font-weight: 600; color: var(--accent); }

/* ── Emergency banner ───────────────────────────────────── */
.emergency {
  margin: var(--sp-20) 0 var(--sp-24);
  padding: var(--sp-20);
  background: #fdf1f1;
  border: 1px solid #e8c4c4;
  border-left: var(--sp-4) solid #b3261e;
  border-radius: var(--radius);
}
.emergency-title { margin: 0 0 var(--sp-8); font-size: 1.0625rem; letter-spacing: -.2px; color: #8c1d18; }
.emergency p { margin: 0; font-size: 0.9375rem; line-height: 1.6; color: #5d2a26; }
.emergency a { color: #8c1d18; font-weight: 600; }

/* ── Live-calculation note (replaces the submit button) ─── */
.auto-note {
  margin: var(--sp-8) 0 0;
  font-size: 0.8125rem; color: var(--ink-3); text-align: center;
}

/* ── Notice box (honest caveats, not alarms) ────────────── */
.notice {
  margin: var(--sp-20) 0 var(--sp-24);
  padding: var(--sp-16) var(--sp-20);
  background: var(--accent-bg);
  border: 1px solid #cfe4df; border-left: var(--sp-4) solid var(--accent);
  border-radius: 8px; font-size: 0.9375rem; line-height: 1.65; color: #14453c;
}

/* ── Action guidance on results ─────────────────────────── */
.action {
  margin-top: var(--sp-14); padding: var(--sp-12) var(--sp-16);
  background: var(--accent-bg);
  border: 1px solid #cfe4df; border-left: var(--sp-4) solid var(--accent);
  border-radius: 8px; font-size: 0.90625rem; line-height: 1.6; color: #14453c;
}
.action-warn { background: var(--warn-bg); border-color: var(--warn-line); border-left-color: #c98a00; color: #6b4400; }
.action-urgent {
  background: #fdf1f1; border-color: #e8c4c4; border-left-color: #b3261e;
  color: #8c1d18; font-weight: 500;
}

/* ── Threshold reference list ───────────────────────────── */
.thresholds { list-style: none; margin: 0 0 var(--sp-12); padding: 0; }
.thresholds li {
  display: flex; gap: var(--sp-12); align-items: baseline;
  padding: var(--sp-8) var(--sp-10); border-radius: 7px;
  font-size: 0.875rem; color: var(--ink-2); line-height: 1.5;
}
.thresholds li + li { margin-top: var(--sp-2); }
.thresholds li strong { flex: 0 0 104px; font-variant-numeric: tabular-nums; color: var(--ink); }
.thresholds li.active { background: var(--warn-bg); }
.thresholds li.active strong { color: #8c5a00; }
.band-flag {
  display: inline-block; margin-left: var(--sp-8);
  padding: var(--sp-1) var(--sp-8);
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
  color: #6b4400; background: #f6e3bd;
  border: 1px solid #e0c48a; border-radius: 999px;
  white-space: nowrap;
}

/* ── Data table ─────────────────────────────────────────── */
table.data { width: 100%; border-collapse: collapse; margin: var(--sp-20) 0; font-size: 0.875rem; }
table.data caption {
  text-align: left; font-size: 0.8125rem; color: var(--ink-3);
  padding-bottom: var(--sp-8); caption-side: top;
}
table.data th, table.data td {
  text-align: left; padding: var(--sp-8) var(--sp-12);
  border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums;
}
table.data thead th {
  border-bottom: 1px solid var(--line);
  font-size: 0.78125rem; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3);
}
table.data tbody tr:last-child td { border-bottom: 0; }

/* ── Plain lists in prose ───────────────────────────────── */
ul.plain, ol.plain { margin: 0 0 var(--sp-16); padding-left: var(--sp-24); }
ul.plain li, ol.plain li { margin-bottom: var(--sp-8); color: var(--ink-2); font-size: 0.9375rem; line-height: 1.6; }
ol.plain li { font-size: 0.875rem; }

/* ── Screen-reader-only status line ─────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* ── Boot-failure notice ────────────────────────────────── */
/* Visible by default so it survives a module that never loads. Each client
   module adds .js-ready to <html> once it has initialised successfully. */
.js-needed { padding: var(--sp-20) 0 0; }
html.js-ready .js-needed { display: none; }

/* ── Match results (breed quiz) ─────────────────────────── */
.card.match { margin-bottom: var(--sp-16); }
.match-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-14);
  margin-bottom: var(--sp-10);
}
.match-head h3 { margin: 0; font-size: 1.25rem; letter-spacing: -.3px; display: flex; align-items: baseline; gap: var(--sp-10); }
.rank {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: 0.8125rem; font-weight: 700; color: var(--ink-3);
}
.match-pct { flex: 0 0 auto; font-size: 0.9375rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.match-note { margin: 0 0 var(--sp-14); font-size: 0.9375rem; color: var(--ink-2); line-height: 1.6; }
.stats {
  display: grid; gap: var(--sp-1); margin: 0 0 var(--sp-14);
  grid-template-columns: repeat(auto-fit, minmax(min(132px, 100%), 1fr));
  background: var(--line-2); border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden;
}
.stat { background: var(--bg); padding: var(--sp-8) var(--sp-12); margin: 0; }
.stat dt { font-size: 0.71875rem; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); }
.stat dd { margin: var(--sp-2) 0 0; font-size: 0.90625rem; font-weight: 600; color: var(--ink); }
.why { margin: 0 0 var(--sp-12); padding-left: var(--sp-20); }
.why li { font-size: 0.90625rem; color: var(--ink-2); margin-bottom: var(--sp-4); line-height: 1.5; }
.match-src { margin: var(--sp-12) 0 0; font-size: 0.8125rem; color: var(--ink-3); }

/* ── Quiz (breed match) ─────────────────────────────────── */
.quiz {
  margin: 0 0 var(--sp-8); padding: var(--sp-24);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.quiz-q { border: 0; margin: 0 0 var(--sp-28); padding: 0 0 var(--sp-24); border-bottom: 1px solid var(--line-2); }
.quiz-q:last-of-type { border-bottom: 0; padding-bottom: var(--sp-6); }
.quiz-q legend {
  display: flex; gap: var(--sp-12); align-items: baseline;
  font-size: 1.0625rem; font-weight: 650; letter-spacing: -.2px;
  padding: 0; margin-bottom: var(--sp-6);
}
.q-num {
  flex: 0 0 24px; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 0.8125rem; font-weight: 700;
}
.quiz-q .hint { margin: 0 0 var(--sp-12) var(--sp-32); }
.quiz-opt {
  display: flex; gap: var(--sp-10); align-items: flex-start;
  margin-left: var(--sp-32); padding: var(--sp-8) var(--sp-12);
  border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer; font-size: 0.9375rem; line-height: 1.5;
}
.quiz-opt + .quiz-opt { margin-top: var(--sp-8); }
.quiz-opt:hover { border-color: var(--accent); background: var(--accent-bg); }
.quiz-opt input { margin: var(--sp-2) 0 0; accent-color: var(--accent); flex: 0 0 auto; }
.quiz-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); font-weight: 500; }
.quiz-actions { display: flex; gap: var(--sp-10); flex-wrap: wrap; margin-top: var(--sp-8); }
.quiz-actions .primary { width: auto; flex: 1 1 220px; }
button.secondary {
  font: inherit; font-size: 0.9375rem; padding: var(--sp-12) var(--sp-20); cursor: pointer;
  color: var(--ink-2); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 8px;
}
button.secondary:hover { border-color: var(--ink-3); color: var(--ink); }

/* ── Prose headings and inline elements ─────────────────── */
.prose h2 {
  font-size: clamp(1.3125rem, 3vw, 1.625rem); letter-spacing: -.4px;
  margin: var(--sp-40) 0 var(--sp-12); padding-top: var(--sp-24); border-top: 1px solid var(--line);
}
.prose h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h3 { font-size: 1.0625rem; margin: var(--sp-24) 0 var(--sp-8); letter-spacing: -.2px; }
.prose code {
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 5px; padding: var(--sp-1) var(--sp-4); font-size: 0.84375rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink);
}
.prose a, .disclaimer a, .match-src a, .tool-card a {
  color: var(--accent);
  /* Underlined, not just coloured: WCAG 1.4.1 forbids colour as the only way to
     distinguish a link from the text around it. */
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose ol { margin: 0 0 var(--sp-16); padding-left: var(--sp-24); }
.prose ol li { margin-bottom: var(--sp-10); font-size: 0.875rem; color: var(--ink-2); line-height: 1.6; }

/* ── Callout and disclaimer ─────────────────────────────── */
.callout {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line); border-left-width: var(--sp-4);
  border-radius: 8px; padding: var(--sp-14) var(--sp-16);
  color: #6b4400;
}
.disclaimer {
  margin-top: var(--sp-24); padding: var(--sp-14) var(--sp-16);
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; font-size: 0.875rem; color: var(--ink-2);
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  margin-top: var(--sp-64); padding: var(--sp-28) 0 var(--sp-40);
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 0.875rem; color: var(--ink-2);
}
.site-footer p { margin: 0 0 var(--sp-4); }
.muted { color: var(--ink-3); font-size: 0.8125rem; }

/* ── Result emphasis states ─────────────────────────────── */
.big-muted { color: var(--ink-3); font-size: clamp(1.25rem, 3vw, 1.625rem); }

/* ── Collapsible dataset ────────────────────────────────── */
/* The reference table is 480+ words of data. It stays in the HTML (crawlers
   read it) but is collapsed by default so it does not dominate the page. */
.dataset { margin: var(--sp-16) 0 var(--sp-24); }
.dataset > summary {
  cursor: pointer; font-size: 0.9375rem; font-weight: 600; color: var(--accent);
  padding: var(--sp-10) 0;
}
.dataset > summary:hover { text-decoration: underline; }
.dataset[open] > summary { margin-bottom: var(--sp-4); }

/* ── Scrollable data tables ─────────────────────────────── */
.table-scroll:focus-visible { outline: 3px solid rgba(28,107,91,.28); outline-offset: 2px; }
.table-scroll { overflow-x: auto;
  scrollbar-width: thin; margin: var(--sp-20) 0; border: 1px solid var(--line); border-radius: 8px; }
.table-scroll table.data { margin: 0; }
.table-scroll th[scope="row"] { font-weight: 600; color: var(--ink); white-space: nowrap; }
.table-scroll table.data th, .table-scroll table.data td { padding: var(--sp-8) var(--sp-12); white-space: nowrap; }
