:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #f1ede6;
  --ink: #1f1d1a;
  --ink-2: #5d574e;
  --ink-3: #8c857a;
  --line: #e4ded4;
  --grid: #ebe6dd;
  --accent: #c2562b;
  --accent-ink: #ffffff;
  --male: #2f6db5;
  --female: #c2457a;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 4px 16px rgba(40, 30, 10, .05);
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15140f; --surface: #1e1c17; --surface-2: #27241e; --ink: #f1ece3; --ink-2: #b8b0a3;
    --ink-3: #857d70; --line: #353128; --grid: #2a2720; --accent: #e07a4c; --male: #6ea4e6; --female: #e77fab;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-3); font-weight: 500; }

.site-header { padding: 36px 0 18px; }
.site-header h1 { font-family: var(--font-display); font-size: clamp(28px, 4.2vw, 44px); line-height: 1.1; margin: 0 0 8px; letter-spacing: -.01em; }
.lede { margin: 0; color: var(--ink-2); max-width: 680px; font-size: 16px; }

.panel, .card, .stage-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 16px; margin-bottom: 16px; }
.card { padding: 18px; margin-bottom: 16px; }
.card h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; letter-spacing: .01em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.card-head h2 { margin-bottom: 8px; }

/* search */
.add-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.search-box { position: relative; flex: 1 1 320px; }
.search-icon { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: var(--ink-3); pointer-events: none; }
#quick-search { width: 100%; padding: 11px 14px 11px 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); outline: none; }
#quick-search:focus { border-color: var(--accent); background: var(--surface); }
.quick-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 340px; overflow: auto; }
.quick-results li { padding: 8px 10px; border-radius: 7px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.quick-results li[aria-selected="true"], .quick-results li:hover { background: var(--surface-2); }
.quick-results small { color: var(--ink-3); white-space: nowrap; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets button, .btn-ghost { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 7px 12px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.presets button:hover, .btn-ghost:hover { border-color: var(--ink-3); color: var(--ink); }

/* chips */
.chips { list-style: none; margin: 14px 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 14px; }
.chip .num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.chip .name { font-weight: 550; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .mini-seg { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.chip .mini-seg button { border: 0; background: transparent; padding: 1px 7px; cursor: pointer; font-size: 13px; color: var(--ink-3); }
.chip .mini-seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.chip .x { border: 0; background: transparent; cursor: pointer; width: 24px; height: 24px; border-radius: 50%; color: var(--ink-3); font-size: 16px; line-height: 1; }
.chip .x:hover { background: var(--line); color: var(--ink); }
.chips .empty { color: var(--ink-3); font-size: 14px; padding: 6px 2px; }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.control { display: flex; flex-direction: column; gap: 6px; }
.control-label { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 7px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.human-ctl { display: flex; align-items: center; gap: 10px; height: 34px; }
.human-ctl input[type=range] { width: 130px; accent-color: var(--accent); }
.human-ctl output { font-size: 13.5px; color: var(--ink-2); min-width: 82px; font-variant-numeric: tabular-nums; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; margin-top: 6px; }
.human-ctl .switch { margin-top: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; cursor: pointer; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* stage */
.stage-card { padding: 8px 8px 4px; margin-bottom: 16px; overflow: hidden; }
.stage { width: 100%; height: clamp(320px, 52vw, 540px); }
.stage svg { display: block; width: 100%; height: 100%; }
.stage .grid-line { stroke: var(--grid); stroke-width: 1; }
.stage .grid-label { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.stage .ground { stroke: var(--ink-3); stroke-width: 1.5; }
.stage .dog .far, .stage .dog .ear { filter: brightness(.72); }
.stage .dog .eye { fill: var(--surface); opacity: .9; }
.stage .dog.female { opacity: .78; }
.stage .human { color: var(--ink-3); opacity: .45; }
.stage .dog-img.female { opacity: 1; }
.stage .dog-key { stroke-width: 3; stroke-linecap: round; }
.stage .dog-key.female { stroke-dasharray: 6 4; }
.stage .label-name { fill: var(--ink); font-size: 12.5px; font-weight: 600; }
.stage .label-sub { fill: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.stage .badge-text { fill: #fff; font-size: 11px; font-weight: 700; }
.stage .top-label { fill: var(--ink-2); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stage .range-bar { stroke: var(--ink); stroke-width: 2; }
.stage .range-halo { stroke: var(--surface); stroke-width: 5; opacity: .85; }
.stage .withers-line { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.stage .empty-msg { fill: var(--ink-3); font-size: 15px; }
.stage-note { margin: 6px 10px 6px; font-size: 12.5px; color: var(--ink-3); }

.insight { margin: 0 0 16px; font-size: 16px; color: var(--ink-2); }
.insight:empty { display: none; }
.insight strong { color: var(--ink); }
.insight .pill { display: inline-block; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }

/* bars */
.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .data-grid { grid-template-columns: 1fr; } }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 190px) 1fr; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .lbl { display: flex; align-items: center; gap: 6px; overflow: hidden; }
.bar-row .lbl span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.bar-track { position: relative; height: 22px; background: var(--surface-2); border-radius: 6px; }
.bar-range { position: absolute; top: 4px; bottom: 4px; border-radius: 4px; opacity: .35; }
.bar-avg { position: absolute; top: 1px; bottom: 1px; width: 3px; border-radius: 2px; transform: translateX(-1.5px); }
.bar-val { position: absolute; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 8px; }
.bars .empty { color: var(--ink-3); font-size: 14px; }

/* table */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.data-table td.breed { font-weight: 600; }
.data-table .sex-m { color: var(--male); font-weight: 600; }
.data-table .sex-f { color: var(--female); font-weight: 600; }
.data-table .rel { color: var(--ink-3); }
.data-table tr.group-start td { border-top: 1px solid var(--line); }
.cabin { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; vertical-align: 1px; cursor: help; }
.cabin-yes { background: color-mix(in srgb, #2f8a5a 16%, transparent); color: #2f8a5a; }
.cabin-some { background: color-mix(in srgb, #b0731a 16%, transparent); color: #b0731a; }
.cabin-no { color: var(--ink-3); font-weight: 500; padding-left: 0; }
.cabin-rule { margin: -2px 0 12px; font-size: 12.5px; color: var(--ink-3); }
.data-table td.src { color: var(--ink-3); }
.data-table td.src.warn { color: #b0731a; cursor: help; }

/* library */
.lib-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.lib-filters input, .lib-filters select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.lib-filters input { flex: 1 1 220px; }
.size-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.size-chips button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.size-chips button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.lib-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; max-height: 620px; overflow: auto; padding: 2px; }
.lib-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); text-align: left; width: 100%; }
.lib-item:hover { border-color: var(--ink-3); }
.lib-item.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.lib-item svg { width: 54px; height: 36px; flex: none; color: var(--ink-3); }
.lib-item.selected svg { color: var(--accent); }
.lib-item svg .far, .lib-item svg .ear { filter: brightness(.75); }
.lib-item svg .eye { fill: var(--surface); }
.lib-item .lib-thumb { width: 64px; height: 44px; flex: none; object-fit: contain; object-position: center bottom; }
.lib-item .meta { min-width: 0; flex: 1; }
.lib-item .nm { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-item .st { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lib-item .add { font-size: 18px; color: var(--ink-3); width: 24px; text-align: center; }
.lib-item.selected .add { color: var(--accent); }

.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq details:last-child { padding-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style-position: outside; }
.faq summary:hover { color: var(--accent); }
.faq p { margin: 8px 0 2px; color: var(--ink-2); max-width: 760px; }
.foot { color: var(--ink-3); font-size: 12.5px; padding: 8px 0 40px; max-width: 820px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 9px 16px; border-radius: 999px; font-size: 14px; z-index: 50; }

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .panel, .card { padding: 14px; }
  .bar-row { grid-template-columns: 110px 1fr; }
  .human-ctl input[type=range] { width: 100px; }
}

/* ======================================================================
   Site chrome (top bar, footer) and content pages
   ====================================================================== */
.topbar { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 30; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand svg { width: 22px; height: 22px; fill: var(--accent); }
.topnav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.topnav a { color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 550; padding: 6px 10px; border-radius: 8px; }
.topnav a:hover { color: var(--ink); background: var(--surface-2); }
.topnav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.topnav .nav-cta { background: var(--accent); color: var(--accent-ink); margin-left: 6px; }
.topnav .nav-cta:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.06); }
@media (max-width: 640px) {
  .topbar { position: static; }
  .topbar-in { padding-top: 8px; padding-bottom: 8px; }
  .topnav { width: 100%; overflow-x: auto; flex-wrap: nowrap; margin: 0 -6px; }
  .topnav a { white-space: nowrap; }
}

.site-foot { border-top: 1px solid var(--line); margin-top: 32px; padding: 28px 0 8px; background: var(--surface-2); }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.site-foot h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 8px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin: 3px 0; }
.site-foot a { color: var(--ink-2); text-decoration: none; font-size: 14px; }
.site-foot a:hover { color: var(--accent); text-decoration: underline; }
.foot-note { color: var(--ink-3); font-size: 12.5px; padding-top: 14px; padding-bottom: 24px; }
.foot-note a { font-size: inherit; }

.content { padding-top: 14px; padding-bottom: 8px; }
.content a { color: var(--accent); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; padding: 0; font-size: 13px; color: var(--ink-3); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.page-head { padding: 14px 0 18px; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(28px, 4.2vw, 42px); line-height: 1.12; margin: 0 0 8px; letter-spacing: -.01em; }
.page-head .lede a { color: var(--accent); }
.byline { color: var(--ink-3); font-size: 13px; margin: 8px 0 0; }
.sec-h { font-size: 18px; margin: 26px 0 12px; }
.card h2 { font-size: 16px; }
.card h2 + h2, .card .pill-row + h2 { margin-top: 18px; }

.scene { margin: 0; }
.scene svg { display: block; width: 100%; height: auto; max-height: 460px; }
.scene .sc-grid { stroke: var(--grid); stroke-width: 1; }
.scene .sc-axis { fill: var(--ink-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.scene .sc-ground { stroke: var(--ink-3); stroke-width: 1.5; }
.scene .sc-human { color: var(--ink-3); opacity: .45; }
.scene .sc-key { stroke-width: 3; stroke-linecap: round; }
.scene .sc-name { fill: var(--ink); font: 600 12.5px var(--font); }
.scene .sc-sub { fill: var(--ink-3); font: 11.5px var(--font); font-variant-numeric: tabular-nums; }
.scene .dg-line { stroke: var(--accent); stroke-width: 2.5; }
.scene .dg-alt { stroke: var(--male); }
.scene .dg-alt2 { stroke: var(--female); }
.scene .dg-text { fill: var(--ink); font: 600 13px var(--font); }
.scene-note { margin: 6px 4px 4px; font-size: 12.5px; color: var(--ink-3); }
.diagram { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin: 18px 0; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 4px 4px; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink) !important; text-decoration: none; font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 999px; border: 0; cursor: pointer; }
.btn:hover { filter: brightness(1.06); }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 18px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.fact-k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.fact-v { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.side .card h2 { margin-bottom: 8px; }
.prose { max-width: 760px; font-size: 16px; line-height: 1.65; }
.prose-wide { max-width: 860px; }
.prose h2 { font-family: var(--font-display); font-size: 24px; line-height: 1.2; margin: 28px 0 10px; }
.prose > h2:first-child { margin-top: 4px; }
.prose h3 { font-size: 17px; margin: 22px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose .table-scroll { margin: 14px 0; }
.prose .data-table { font-size: 14px; }
.prose .data-table td { white-space: normal; min-width: 90px; }
.table-note { font-size: 12.5px !important; color: var(--ink-3) !important; margin-top: -4px; }
.note { border-left: 3px solid var(--accent); padding: 8px 14px; background: var(--surface); border-radius: 0 10px 10px 0; color: var(--ink-2); margin: 14px 0; }
.data-table a { color: var(--accent); text-decoration: none; }
.cmp-table td:first-child { color: var(--ink-3); font-weight: 600; }
.cmp-table td, .cmp-table th { white-space: normal; }

.link-list { list-style: none; margin: 0 0 8px; padding: 0; }
.link-list li { padding: 5px 0; border-top: 1px solid var(--line); font-size: 14px; }
.link-list li:first-child { border-top: 0; }
.link-list a, .link-cols a { text-decoration: none; }
.link-list a:hover, .link-cols a:hover { text-decoration: underline; }
.side p { margin: 4px 0 0; font-size: 14px; }
.link-cols { columns: 3 220px; column-gap: 24px; list-style: none; margin: 0; padding: 0; font-size: 14px; }
.link-cols li { break-inside: avoid; padding: 4px 0; }

.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 8px; margin-bottom: 12px; }
.bcard { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink) !important; min-width: 0; }
.bcard:hover { border-color: var(--accent); }
.bcard img { width: 72px; height: 50px; object-fit: contain; object-position: center bottom; flex: none; }
.bcard-meta { display: flex; flex-direction: column; min-width: 0; }
.bcard-name { font-weight: 650; font-size: 14.5px; }
.bcard-st, .bcard-x { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.side .bcard { margin-bottom: 8px; }

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-link { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; text-decoration: none; color: var(--ink-2) !important; background: var(--surface); }
.pill-link span { color: var(--ink-3); font-size: 12px; margin-left: 2px; }
.pill-link:hover { border-color: var(--accent); color: var(--ink) !important; }
.az { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; position: sticky; top: 54px; background: var(--bg); padding: 8px 0; z-index: 5; }
.az a { min-width: 30px; text-align: center; padding: 4px 6px; border-radius: 7px; text-decoration: none; font-weight: 600; font-size: 14px; border: 1px solid var(--line); background: var(--surface); }
.az-sec { scroll-margin-top: 110px; }
@media (max-width: 640px) { .az { top: 0; } }

.rank-list { list-style: none; padding: 0 !important; margin: 18px 0; counter-reset: none; }
.rank-item { border-top: 1px solid var(--line); padding: 16px 0; margin: 0 !important; scroll-margin-top: 70px; }
.rank-head { display: flex; align-items: center; gap: 10px; }
.rank-head h3 { margin: 0; font-size: 19px; }
.rank-head a { text-decoration: none; }
.rank-n { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--ink); color: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.rank-body { display: flex; gap: 16px; align-items: flex-start; margin-top: 8px; }
.rank-body img { width: 140px; height: 96px; object-fit: contain; object-position: center bottom; flex: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.rank-body p { margin: 0 0 6px; }
.rank-st { font-size: 13.5px; color: var(--ink-3) !important; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .rank-body { flex-direction: column; } .rank-body img { width: 100%; height: 130px; } }

.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.art-card { display: block; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink) !important; box-shadow: var(--shadow); }
.art-card:hover { border-color: var(--accent); }
.art-card h2 { font-family: var(--font-display); font-size: 20px; margin: 0 0 6px; line-height: 1.2; }
.art-card p { margin: 0; color: var(--ink-2); font-size: 14px; }

.faq-block { margin: 26px 0 16px; max-width: 860px; }
.faq-block h2 { font-family: var(--font-display); font-size: 24px; margin: 0 0 6px; }
.faq-block details { border-top: 1px solid var(--line); padding: 11px 0; }
.faq-block summary { cursor: pointer; font-weight: 600; }
.faq-block summary:hover { color: var(--accent); }
.faq-block p { margin: 8px 0 2px; color: var(--ink-2); }

/* calculators */
.calc { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 760px) { .calc { grid-template-columns: 1fr; } }
.calc-form { display: flex; flex-direction: column; gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span:first-child { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.fld select, .fld input { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); width: 100%; }
.fld select:focus, .fld input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.fld .inline { display: flex; gap: 8px; align-items: center; }
.fld .inline input { width: 110px; flex: none; }
.fld .inline select { width: auto; }
.fld .unit { color: var(--ink-3); font-size: 14px; }
.fld[hidden] { display: none; }
.calc-out { background: var(--surface-2); border-radius: 12px; padding: 18px; min-height: 160px; }
.calc-out .big { font-family: var(--font-display); font-size: clamp(30px, 4vw, 42px); font-weight: 700; line-height: 1.1; margin: 2px 0 6px; }
.calc-out .big small { font-family: var(--font); font-size: 15px; color: var(--ink-3); font-weight: 500; }
.calc-out .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; margin: 0; }
.calc-out p { margin: 6px 0; color: var(--ink-2); }
.calc-out .data-table { margin-top: 10px; background: var(--surface); border-radius: 10px; }
.calc-out .data-table td { white-space: normal; }
.ok { color: #2f8a5a; font-weight: 600; }
.warn-t { color: #b0731a; font-weight: 600; }
.bad { color: var(--ink-3); font-weight: 600; }
.meter { position: relative; height: 10px; border-radius: 6px; background: var(--line); margin: 14px 0 22px; }
.meter .rng { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 6px; }
.meter .pt { position: absolute; top: -4px; width: 4px; height: 18px; background: var(--ink); border-radius: 2px; transform: translateX(-2px); }
.meter .lbl { position: absolute; top: 14px; font-size: 11.5px; color: var(--ink-3); transform: translateX(-50%); white-space: nowrap; }

/* comparison tool: export + your dog */
.stage-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin: 4px 8px 6px; }
.mydog-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); }
.mydog-form[hidden] { display: none; }
.mydog-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.mydog-form input, .mydog-form select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); }
.mydog-form input[type=number] { width: 90px; }
.mydog-form input[type=text] { width: 150px; }
.data-table td.breed a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--ink-3); }
.data-table td.breed a:hover { color: var(--accent); }
.disclaimer { max-width: 860px; margin: 18px 0; padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid #b0731a; border-radius: 0 10px 10px 0; background: var(--surface); color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.disclaimer strong { color: var(--ink); }
.prose .note strong { color: var(--ink); }
.foot-note p { margin: 0 0 8px; }
.foot-note .copyright { color: var(--ink-2); font-weight: 500; }
