/* ============================================================
   Utility Engine — shared components  (components.css)
   ------------------------------------------------------------
   Token-driven UI built on sky.css. Generic, answer-first
   building blocks every hub reuses: header/footer chrome,
   frosted panels, hero + figure, buttons, chips, status pills,
   tab switcher (for two-tool hubs), forms + result readouts
   (calculators), comparison tables (insurance / stats), entity
   grids (programmatic index pages), ad slots, affiliate cards,
   the save/email wall modal, breadcrumbs, skeletons, a11y
   helpers. Shipped at /_ue/components.css.

   HOUSE RULE: every size in this file comes from a sky.css
   token — type from --step-*, rhythm from --space-*, depth from
   --shadow-*, corners from --radius*. If you find yourself
   typing a raw px or rem here, the scale is missing a step; add
   the step in sky.css rather than starting a second system.
   ============================================================ */

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Heading hierarchy is set once, from the scale. Individual components tune a
   heading DOWN (a card title is not a page title) but nothing hand-picks a rem. */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; text-wrap: balance; }
h1 { font-size: var(--step-4); line-height: 1.08; letter-spacing: -0.025em; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); }

img { max-width: 100%; height: auto; }
svg { width: 1em; height: 1em; }
small { font-size: var(--step--1); }

/* ---------- layout ---------- */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-4) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-0);
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-icon { color: var(--accent); font-size: var(--step-1); display: inline-flex; filter: drop-shadow(0 0 8px var(--accent-bg)); }
/* SVG brand mark (config.mark) — scales with the brand type, inherits the accent. */
.brand-mark { line-height: 0; }
.brand-mark svg { width: 1.35em; height: 1.35em; fill: currentColor; }
/* Raster / external brand mark (config.logo) — height-locked, ratio preserved. */
.brand-logo { display: block; height: 1.6em; width: auto; filter: none; }
.header-right { display: inline-flex; align-items: center; gap: var(--space-3); }
.tz-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--step--1);
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#main { max-width: var(--maxw); margin: 0 auto; padding: var(--space-1) var(--space-4) var(--space-7); }

/* primary nav (hub home links its tools / hubs) */
.hub-nav { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-5); }
.hub-nav a {
  font-size: var(--step--1); font-weight: 600; color: var(--text);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface);
}
.hub-nav a:hover { border-color: var(--border-strong); text-decoration: none; background: var(--surface-2); }
.hub-nav a[aria-current="page"] { color: var(--accent); border-color: transparent; background: var(--accent-bg); }

/* ---------- breadcrumbs ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-size: var(--step--2); color: var(--muted); margin: 0 0 var(--space-3); }
.crumbs a { color: var(--muted); }
.crumbs .sep { color: var(--faint); }
.back-link { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--step--1); color: var(--muted); margin: var(--space-1) 0 var(--space-4); }

/* ---------- frosted panels ---------- */
.panel, .card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--panel-shadow);
}
.card { padding: var(--space-4); border-radius: var(--radius-sm); box-shadow: var(--shadow-1); }
.panel + .panel, .panel + .card, .card + .card { margin-top: var(--space-5); }
.eyebrow { font-size: var(--step--2); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* ---------- answer-first hero / static intro ----------
   The H1 is the loudest thing on the page, full stop. It was 1.5rem (24px)
   sitting directly above a 250px ad frame, which read as a banner page with a
   caption — the single most-cited reason sites refused this system. It is now
   --step-4 (33–43px) with a --step-1 lede, and the block owns enough vertical
   rhythm that the answer, not the ad, is what a visitor lands on. */
.static-intro, .hero { margin: 0 0 var(--space-6); }
.static-intro > :first-child, .hero-copy > :first-child { margin-top: 0; }
.static-intro h1, .hero-title {
  font-size: var(--step-4);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}
.static-intro .lede, .hero .lede {
  font-size: var(--step-1);
  font-weight: 400;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
  max-width: 62ch;
  text-wrap: pretty;
}
.static-intro .eyebrow, .hero .eyebrow { display: block; margin: 0 0 var(--space-2); }

/* hero() builder: copy column + optional media column, stacking on narrow. */
.hero { display: grid; gap: var(--space-5); align-items: center; }
.hero-copy { min-width: 0; }
.hero-media { min-width: 0; }
.hero-media img, .hero-media svg, .hero-media picture { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.hero-actions { margin-top: var(--space-5); }
.hero-meta { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-4); font-size: var(--step--1); color: var(--muted); }
.hero-has-media { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .hero-has-media { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-6); }
  .hero-media-first .hero-media { order: -1; }
}
.hero-center { text-align: center; justify-items: center; }
.hero-center .lede { margin-inline: auto; }
.hero-center .btn-row, .hero-center .hero-meta { justify-content: center; }

/* ---------- responsive figure (figure() / picture() builders) ----------
   The img always carries width+height so the box is reserved before the bytes
   land — zero layout shift, which is why these helpers exist at all. */
.ue-figure { margin: var(--space-5) 0; }
.ue-figure > img, .ue-figure > picture > img, .ue-media > img, .ue-media > picture > img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.ue-figure svg, .ue-media svg { width: 100%; height: auto; }
.ue-figure figcaption {
  margin-top: var(--space-2);
  font-size: var(--step--1);
  color: var(--muted);
  line-height: 1.5;
}
.ue-figure figcaption .credit { color: var(--faint); }
.ue-figure-wide { margin-inline: calc(var(--space-4) * -1); }
@media (min-width: 720px) { .ue-figure-wide { margin-inline: calc(var(--space-6) * -1); } }

/* ---------- buttons ---------- */
.btn-row { display: flex; gap: var(--space-3); margin-top: var(--space-4); flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--step--1);
  font-weight: 600;
  font-family: inherit;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease, filter 0.12s ease, transform 0.05s ease, border-color 0.12s ease;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: scale(0.985); }
.btn-primary { color: var(--on-accent, #fff); background: var(--accent); border-color: transparent; box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-cta { color: #fff; background: var(--ignite); border-color: transparent; box-shadow: var(--shadow-1); }
.btn-cta:hover { background: var(--ignite); filter: brightness(1.06); }
.btn-lg { font-size: var(--step-0); padding: var(--space-4) var(--space-5); border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: default; pointer-events: none; }

/* ---------- chips, tags, status ---------- */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0;
  font-size: var(--step--1); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); white-space: nowrap;
  color: var(--accent); background: var(--accent-bg);
}
.tag {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--step--2); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill);
  color: var(--muted); background: var(--surface); border: 1px solid var(--border);
}
.filter-chip {
  font-size: var(--step--1); padding: var(--space-2) var(--space-3); border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  cursor: pointer; font-family: inherit;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.filter-chip:hover { color: var(--text); border-color: var(--border-strong); }
.filter-chip[aria-pressed="true"] { color: var(--accent); border-color: transparent; background: var(--accent-bg); }

.status {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--step--1); font-weight: 600; padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); white-space: nowrap;
}
.status::before { content: ""; width: 0.45em; height: 0.45em; border-radius: 50%; background: currentColor; flex: none; }
.status.s-go { color: var(--success); background: var(--success-bg); }
.status.s-warn { color: var(--warn); background: var(--warn-bg); }
.status.s-info { color: var(--accent); background: var(--accent-bg); }
.status.s-danger { color: var(--danger); background: var(--danger-bg); }
.status.s-muted { color: var(--muted); background: var(--surface-2); }

/* ---------- tab switcher (two-tool hubs) ---------- */
.tabs { display: inline-flex; gap: var(--space-1); padding: var(--space-1); border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); margin-bottom: var(--space-4); }
.tab {
  font-size: var(--step--1); font-weight: 600; font-family: inherit;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill); border: 0; cursor: pointer;
  background: transparent; color: var(--muted);
  transition: color 0.12s, background 0.12s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--on-accent, #fff); background: var(--accent); }
.tabpanel[hidden] { display: none; }

/* ---------- forms (calculators / lookups) ---------- */
.field { margin-bottom: var(--space-4); }
.field > label, .field-label { display: block; font-size: var(--step--1); font-weight: 600; color: var(--muted); margin-bottom: var(--space-2); }
.field .hint { font-size: var(--step--2); color: var(--faint); margin-top: var(--space-1); }
.input, input[type="text"], input[type="number"], input[type="email"], input[type="search"], select, textarea {
  width: 100%;
  font: inherit; font-size: var(--step-0);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  -webkit-appearance: none; appearance: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%238b93ad' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--space-3) center; background-size: 12px; padding-right: var(--space-6);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 460px) { .row { grid-template-columns: 1fr; } }

/* segmented control (sex / unit toggles) */
.seg-control { display: inline-flex; padding: var(--space-1); border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.seg-control button {
  font: inherit; font-size: var(--step--1); font-weight: 600;
  padding: var(--space-2) var(--space-4); border: 0; cursor: pointer;
  border-radius: calc(var(--radius-sm) - var(--space-1));
  background: transparent; color: var(--muted);
}
.seg-control button[aria-pressed="true"] { color: var(--on-accent, #fff); background: var(--accent); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: var(--radius-pill); background: var(--surface-2); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 2px solid var(--bg); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 2px solid var(--bg); }

/* ---------- result readouts ---------- */
.result { margin-top: var(--space-5); }
.result-figure { font-family: var(--font-display); font-size: var(--step-5); font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.result-figure .unit { font-size: var(--step-0); font-weight: 600; letter-spacing: 0; color: var(--muted); margin-left: var(--space-1); }
.result-sub { font-size: var(--step--1); color: var(--muted); margin-top: var(--space-2); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); }
.stat .k { font-size: var(--step--2); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-family: var(--font-display); font-size: var(--step-1); font-weight: 700; margin-top: var(--space-1); font-variant-numeric: tabular-nums; }
.stat .v small { font-size: var(--step--2); font-weight: 600; color: var(--faint); }

/* distribution / progress bars (percentile, portion split) */
.bar { position: relative; height: 12px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; margin: var(--space-2) 0; }
.bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: var(--radius-pill); background: var(--accent); }
.bar-pin { position: absolute; top: -4px; width: 3px; height: 20px; border-radius: 2px; background: var(--text); transform: translateX(-50%); }

/* ---------- comparison / stat tables ---------- */
.table-wrap { overflow-x: auto; margin-top: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
table.tbl th, table.tbl td { padding: var(--space-3); text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl thead th { font-size: var(--step--2); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); background: var(--surface); position: sticky; top: 0; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--surface); }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .best { color: var(--success); font-weight: 700; }

/* ---------- entity grid (programmatic index pages: breeds, players...) ---------- */
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
.entity-card {
  display: flex; flex-direction: column; gap: var(--space-1);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: inherit;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
.entity-card:hover { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; transform: translateY(-1px); }
.entity-card .name { font-size: var(--step--1); font-weight: 600; }
.entity-card .sub { font-size: var(--step--2); color: var(--muted); }
.alpha-jump { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0; }
.alpha-jump a { font-size: var(--step--1); font-weight: 600; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); color: var(--muted); }

/* ---------- notices / disclaimers ---------- */
.data-notice {
  margin: 0 0 var(--space-4); padding: var(--space-2) var(--space-3); font-size: var(--step--1);
  color: var(--warn); background: var(--warn-bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.disclaimer { font-size: var(--step--2); color: var(--faint); line-height: 1.5; margin-top: var(--space-3); }

/* ---------- FAQ / disclosure ---------- */
.faq { margin-top: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.faq + .faq { margin-top: var(--space-2); }
.faq > summary { cursor: pointer; padding: var(--space-3) var(--space-4); font-size: var(--step-0); font-weight: 600; list-style: none; display: flex; align-items: center; gap: var(--space-2); }
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform 0.2s ease; }
.faq[open] > summary::after { transform: rotate(180deg); }
.faq .faq-body { padding: 0 var(--space-4) var(--space-4); font-size: var(--step--1); color: var(--muted); line-height: 1.6; }

/* ---------- ad slot (zero-reserve until filled) ----------
   An ad that may never fill must cost the reader nothing. The resting state is
   therefore 0 tall: no min-height, no margin, no padding, no border, no label —
   so first paint has no empty gap and nothing already painted can be shoved
   down later. ad-refresh.js owns the <ins> data-ad-status observer and flips
   [data-filled] the moment AdSense reports a real fill; only then does the slot
   claim its spacing and hairline label. It still wears NO panel chrome: an ad
   frame must never out-shout the content it sits next to — see the
   .static-intro note above. (This used to reserve 250px unconditionally and
   collapse afterwards, which held an empty box on every page and reflowed.) */
.ad-slot {
  display: block; min-height: 0;
  margin: 0; padding: 0; border: 0;
  background: transparent; overflow: hidden;
}
.ad-slot::before { content: none; }
.ad-slot .adsbygoogle { display: block; width: 100%; }
.ad-slot[data-filled] {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  margin: var(--space-6) 0; padding: var(--space-2);
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
}
.ad-slot[data-filled]::before { content: "Advertisement"; font-size: calc(var(--step--2) * 0.86); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); opacity: 0.7; }
/* Never let the first ad crowd the answer it follows. */
.static-intro + .ad-slot[data-filled], .hero + .ad-slot[data-filled] { margin-top: var(--space-7); }
.ad-slot[data-empty] { display: none; }   /* JS hides slots Auto-ads didn't fill, so no orphan label */

/* ---------- affiliate slots (config-driven) ---------- */
.aff { margin: var(--space-6) 0; }
.aff-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.aff-head h2 { font-size: var(--step-1); margin: 0; }
.aff-disclosure { font-size: var(--step--2); color: var(--faint); }
.aff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3); }
.aff-card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4); border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: inherit;
  transition: border-color 0.12s, transform 0.05s, background 0.12s;
}
.aff-card:hover { border-color: var(--accent); background: var(--surface-2); text-decoration: none; transform: translateY(-1px); }
.aff-card .aff-kicker { font-size: var(--step--2); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.aff-card .aff-title { font-family: var(--font-display); font-size: var(--step-0); font-weight: 600; }
.aff-card .aff-desc { font-size: var(--step--1); color: var(--muted); line-height: 1.45; }
.aff-card .aff-go { margin-top: auto; font-size: var(--step--1); font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: var(--space-1); }

/* ---------- save / email registration wall ---------- */
.wall-overlay {
  position: fixed; inset: 0; z-index: 10001;
  display: none; align-items: center; justify-content: center; padding: var(--space-5);
  background: var(--scrim, rgba(4, 4, 14, 0.55)); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.wall-overlay[data-open] { display: flex; }
.wall-card {
  width: 100%; max-width: 380px;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-3); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: var(--space-5); position: relative;
}
.wall-card h2 { font-size: var(--step-1); margin: 0 0 var(--space-2); }
.wall-card p { font-size: var(--step--1); color: var(--muted); margin: 0 0 var(--space-4); line-height: 1.5; }
.wall-card .wall-close { position: absolute; top: var(--space-3); right: var(--space-3); width: 1.75rem; height: 1.75rem; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font-size: var(--step-0); line-height: 1; }
.wall-form { display: flex; flex-direction: column; gap: var(--space-3); }
.wall-msg { font-size: var(--step--1); min-height: 1.1em; }
.wall-msg.ok { color: var(--success); }
.wall-msg.err { color: var(--danger); }
.wall-fine { font-size: var(--step--2); color: var(--faint); margin-top: var(--space-3); line-height: 1.45; }

/* Restore notice — shown when a ?restore=<id> link lands and no site code
   claims the payload (see deliverRestore() in save-wall.js). Without it the
   email's "Reopen it on any device" link is indistinguishable from a dead one. */
.wall-restore {
  display: flex; align-items: center; gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2, var(--surface));
  font-size: var(--step--1);
}
.wall-restore p { margin: 0; flex: 1; }
.wall-restore-x {
  flex: none; background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 1.15rem; line-height: 1; padding: 4px 6px;
}
.wall-restore-x:hover { color: var(--text); }

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-7); font-size: var(--step--2); color: var(--faint); text-align: center;
}
.site-footer a { color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); justify-content: center; margin-bottom: var(--space-3); }

/* ---------- skeleton + a11y ---------- */
.sk { background: var(--surface-2); border-radius: 6px; animation: shimmer 1.3s infinite; }
@keyframes shimmer { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* Reserved-height mount target (see lib/skeleton.mjs + S.skeleton()).
   A client-mounted container must never be an empty div that the tool later
   fills, shoving everything below it down the page. .sk-host holds --sk-h from
   first paint; the shimmer bars inside are decoration on top of that reserve.
   UE.mounted(el) clears data-ue-skeleton and releases the floor once the real
   content is in, so a short result doesn't leave a hole. */
.sk-host { display: block; min-height: var(--sk-h, 240px); }
.sk-host[data-ue-skeleton] { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-1) 0; }
.sk-host[data-ue-skeleton] .sk { height: var(--sk-line, 1rem); width: 100%; flex: none; }
.sk-host[data-ue-skeleton] .sk-fill { flex: 1 1 auto; height: auto; min-height: var(--sk-line, 1rem); }
.sk-host[data-ue-skeleton] .sk-short { width: 55%; }
.sk-host[data-ue-mounted] { min-height: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link { position: absolute; left: var(--space-2); top: calc(var(--space-8) * -1); z-index: 10002; padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); background: var(--panel); border: 1px solid var(--border-strong); color: var(--text); font-size: var(--step--1); font-weight: 600; }
.skip-link:focus { top: var(--space-2); text-decoration: none; }

/* ---------- two-up tool tiles (hub home) ---------- */
.tool-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin: var(--space-2) 0; }
@media (max-width: 540px) { .tool-tiles { grid-template-columns: 1fr; } }
.tool-tile { display: flex; flex-direction: column; gap: var(--space-2); color: inherit; }
.tool-tile:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.tool-tile h2 { font-size: var(--step-1); margin: var(--space-1) 0; }
.tool-tile p { font-size: var(--step--1); color: var(--muted); margin: 0; line-height: 1.5; }

/* cross-sell callout (accent-tinted) */
.cross { margin-top: var(--space-6); border-color: var(--accent); background: var(--accent-bg); }
.cross h2 { font-size: var(--step-1); margin: 0 0 var(--space-2); }
.cross p { font-size: var(--step--1); color: var(--text); margin: 0; }

/* condition list (breed pages) */
.cond-list { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: var(--space-1) 0 0; }
.cond-list li { font-size: var(--step--1); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); color: var(--muted); }

/* inline checkbox label */
.seg-row { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--step--1); color: var(--text); font-weight: 500; cursor: pointer; }
.seg-row input { width: auto; }

/* section spacing */
#main > section, #main > .panel, #main > aside { margin-top: var(--space-5); }
.popular h2, #main > section > h2 { margin-bottom: var(--space-2); }
