/* ============================================================
   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, 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.
   ============================================================ */

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
img { max-width: 100%; }
svg { width: 1em; height: 1em; }

/* ---------- layout ---------- */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-icon { color: var(--accent); font-size: 1.3rem; display: inline-flex; filter: drop-shadow(0 0 8px var(--accent-bg)); }
.header-right { display: inline-flex; align-items: center; gap: 10px; }
.tz-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#main { max-width: var(--maxw); margin: 0 auto; padding: 4px 18px 40px; }

/* primary nav (hub home links its tools / hubs) */
.hub-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 18px; }
.hub-nav a {
  font-size: 0.84rem; font-weight: 600; color: var(--text);
  padding: 8px 14px; border-radius: 999px;
  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: 6px; align-items: center; font-size: 0.78rem; color: var(--muted); margin: 2px 0 12px; }
.crumbs a { color: var(--muted); }
.crumbs .sep { color: var(--faint); }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); margin: 4px 0 14px; }

/* ---------- frosted panels ---------- */
.panel, .card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--panel-shadow);
}
.card { padding: 16px; border-radius: var(--radius-sm); }
.panel + .panel, .panel + .card, .card + .card { margin-top: 18px; }
.eyebrow { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* ---------- answer-first hero / static intro ---------- */
.static-intro { margin: 4px 0 18px; }
.static-intro h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 8px; }
.static-intro .lede { font-size: 0.95rem; color: var(--muted); line-height: 1.55; margin: 0; }

/* ---------- buttons ---------- */
.btn-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  padding: 11px 16px;
  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; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-cta { color: #fff; background: var(--ignite); border-color: transparent; }
.btn-cta:hover { background: var(--ignite); filter: brightness(1.06); }
.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: 7px; min-width: 0;
  font-size: 0.78rem; padding: 5px 11px; border-radius: 999px; white-space: nowrap;
  color: var(--accent); background: var(--accent-bg);
}
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.74rem; padding: 4px 10px; border-radius: 999px;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border);
}
.filter-chip {
  font-size: 0.78rem; padding: 6px 13px; border-radius: 999px;
  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: 7px;
  font-size: 0.78rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; 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: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  font-size: 0.86rem; font-weight: 600; font-family: inherit;
  padding: 8px 16px; border-radius: 999px; 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: 14px; }
.field > label, .field-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field .hint { font-size: 0.74rem; color: var(--faint); margin-top: 5px; }
.input, input[type="text"], input[type="number"], input[type="email"], input[type="search"], select, textarea {
  width: 100%;
  font: inherit; font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  -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 12px center; background-size: 12px; padding-right: 34px;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .row { grid-template-columns: 1fr; } }

/* segmented control (sex / unit toggles) */
.seg-control { display: inline-flex; padding: 3px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.seg-control button {
  font: inherit; font-size: 0.84rem; font-weight: 600;
  padding: 7px 14px; border: 0; border-radius: 8px; cursor: pointer;
  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: 999px; 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: 18px; }
.result-figure { font-size: 2.4rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.result-figure .unit { font-size: 1rem; font-weight: 600; color: var(--muted); margin-left: 4px; }
.result-sub { font-size: 0.86rem; color: var(--muted); margin-top: 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.stat .k { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-size: 1.25rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 0.7rem; font-weight: 600; color: var(--faint); }

/* distribution / progress bars (percentile, portion split) */
.bar { position: relative; height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 8px 0; }
.bar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; 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: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.tbl th, table.tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl thead th { font-size: 0.72rem; 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: 10px; margin-top: 14px; }
.entity-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; 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: 0.92rem; font-weight: 600; }
.entity-card .sub { font-size: 0.76rem; color: var(--muted); }
.alpha-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.alpha-jump a { font-size: 0.8rem; font-weight: 600; padding: 4px 9px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }

/* ---------- notices / disclaimers ---------- */
.data-notice {
  margin: 0 0 14px; padding: 9px 12px; font-size: 0.8rem;
  color: var(--warn); background: var(--warn-bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.disclaimer { font-size: 0.76rem; color: var(--faint); line-height: 1.5; margin-top: 12px; }

/* ---------- FAQ / disclosure ---------- */
.faq { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.faq + .faq { margin-top: 8px; }
.faq > summary { cursor: pointer; padding: 13px 15px; font-size: 0.92rem; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.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 15px 15px; font-size: 0.88rem; color: var(--muted); line-height: 1.6; }

/* ---------- ad slot (reserved, no layout shift) ---------- */
.ad-slot {
  margin: 26px 0; min-height: 250px;   /* reserve ~ a responsive in-content unit's fill height → minimal CLS */
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); overflow: hidden;
}
.ad-slot::before { content: "Advertisement"; font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.ad-slot .adsbygoogle { display: block; width: 100%; }
.ad-slot[data-empty] { display: none; }   /* JS hides slots Auto-ads didn't fill, so no orphan label */

/* ---------- affiliate slots (config-driven) ---------- */
.aff { margin: 22px 0; }
.aff-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.aff-head h2 { font-size: 1rem; margin: 0; }
.aff-disclosure { font-size: 0.7rem; color: var(--faint); }
.aff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.aff-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px; 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: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.aff-card .aff-title { font-size: 0.95rem; font-weight: 600; }
.aff-card .aff-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
.aff-card .aff-go { margin-top: auto; font-size: 0.82rem; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }

/* ---------- save / email registration wall ---------- */
.wall-overlay {
  position: fixed; inset: 0; z-index: 10001;
  display: none; align-items: center; justify-content: center; padding: 18px;
  background: 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(--panel-shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 22px; position: relative;
}
.wall-card h2 { font-size: 1.15rem; margin: 0 0 6px; }
.wall-card p { font-size: 0.86rem; color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.wall-card .wall-close { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; }
.wall-form { display: flex; flex-direction: column; gap: 10px; }
.wall-msg { font-size: 0.8rem; min-height: 1.1em; }
.wall-msg.ok { color: var(--success); }
.wall-msg.err { color: var(--danger); }
.wall-fine { font-size: 0.68rem; color: var(--faint); margin-top: 10px; line-height: 1.45; }

/* ---------- footer ---------- */
.site-footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: 24px 18px 40px; font-size: 0.76rem; color: var(--faint); text-align: center;
}
.site-footer a { color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin-bottom: 10px; }

/* ---------- 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; } }
.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; }

/* ---------- two-up tool tiles (hub home) ---------- */
.tool-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 6px 0 8px; }
@media (max-width: 540px) { .tool-tiles { grid-template-columns: 1fr; } }
.tool-tile { display: flex; flex-direction: column; gap: 6px; color: inherit; }
.tool-tile:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.tool-tile h2 { font-size: 1.1rem; margin: 2px 0; }
.tool-tile p { font-size: 0.86rem; color: var(--muted); margin: 0; line-height: 1.5; }

/* cross-sell callout (accent-tinted) */
.cross { margin-top: 22px; border-color: var(--accent); background: var(--accent-bg); }
.cross h2 { font-size: 1.05rem; margin: 0 0 6px; }
.cross p { font-size: 0.9rem; color: var(--text); margin: 0; }

/* condition list (breed pages) */
.cond-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 4px 0 0; }
.cond-list li { font-size: 0.78rem; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }

/* inline checkbox label */
.seg-row { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text); font-weight: 500; cursor: pointer; }
.seg-row input { width: auto; }

/* section spacing */
#main > section, #main > .panel, #main > aside { margin-top: 20px; }
.popular h2, #main > section > h2 { margin-bottom: 6px; }
