:root {
  --bg: #0b1419;
  --surface: #111e24;
  --surface-2: #182830;
  --surface-3: #20343d;
  --field-bg: #0e1a20;
  --header-bg: rgba(11, 20, 25, .94);
  --text: #edf6f5;
  --muted: #9eb2b6;
  --gold: #4fc3b7;
  --gold-soft: #92e1d8;
  --line: rgba(79, 195, 183, .28);
  --line-soft: rgba(194, 222, 221, .13);
  --success: #5fcf84;
  --danger: #ed747b;
  --accent-contrast: #071311;
  --max: 1240px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f7f6;
  --surface: #ffffff;
  --surface-2: #e8f0ef;
  --surface-3: #dce8e6;
  --field-bg: #ffffff;
  --header-bg: rgba(243, 247, 246, .95);
  --text: #17262b;
  --muted: #60747a;
  --gold: #176f6a;
  --gold-soft: #235f63;
  --line: rgba(23, 111, 106, .28);
  --line-soft: rgba(23, 38, 43, .12);
  --success: #267648;
  --danger: #a93642;
  --accent-contrast: #ffffff;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% 18%, rgba(79,195,183,.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
::selection { background: var(--gold); color: #0a0b0a; }

:focus-visible {
  outline: 3px solid var(--gold-soft);
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: 12px;
  transform: translateY(-180%);
  padding: 10px 14px;
  border: 1px solid var(--gold);
  background: #070908;
  color: var(--gold-soft);
  font-weight: 800;
}
.skip-link:focus-visible { transform: translateY(0); }
.skip-link:focus:not(:focus-visible) { transform: translateY(-180%); }
main:focus { outline: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(18px);
}
.header-inner {
  max-width: var(--max);
  min-height: 76px;
  margin: auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
}
.brand { min-width: 150px; font-family: var(--serif); letter-spacing: .13em; line-height: 1; }
.brand-small { display: block; color: var(--gold); font-size: .62rem; margin-bottom: 4px; }
.brand strong { font-size: 1rem; font-weight: 600; }
.main-nav { display: flex; justify-content: center; gap: 24px; color: #d7d2c5; font-size: .83rem; }
.main-nav a, .footer-links a { transition: color .15s ease; }
.main-nav a:hover, .footer-links a:hover { color: var(--gold); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-search input {
  width: 235px;
  height: 38px;
  border: 1px solid var(--line-soft);
  background: #111412;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}
.header-search input:focus { border-color: var(--gold); }
.account-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  padding: 0 13px;
  color: var(--gold-soft);
  font-size: .78rem;
  white-space: nowrap;
}

.site-footer {
  max-width: var(--max);
  margin: 80px auto 0;
  padding: 32px 24px 48px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 30px;
  color: var(--muted);
  font-size: .85rem;
}
.site-footer strong { color: var(--text); font-family: var(--serif); }
.site-footer p { margin: 5px 0 0; }
.footer-links { display: flex; gap: 20px; }

.hero {
  min-height: min(720px, calc(100vh - 76px));
  max-width: var(--max);
  margin: auto;
  padding: 118px 24px 46px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  align-items: center;
  gap: 56px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 14% 0 8% 42%;
  background:
    linear-gradient(120deg, transparent 25%, rgba(210,173,87,.06)),
    repeating-linear-gradient(90deg, transparent 0 72px, rgba(255,255,255,.025) 72px 73px);
  border-left: 1px solid var(--line-soft);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; max-width: 830px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .19em;
  font-size: .7rem;
  font-weight: 800;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; }
.hero h1 {
  margin: 0;
  font-size: clamp(3.6rem, 8.5vw, 7.5rem);
  line-height: .83;
  letter-spacing: -.045em;
}
.hero-copy > p:not(.eyebrow) { max-width: 670px; margin: 24px 0; color: #c2bdb0; font-size: 1rem; }
.hero-search {
  display: grid;
  grid-template-columns: 1fr auto;
  max-width: 770px;
  border: 1px solid var(--line);
  background: #fff;
  margin-top: 30px;
}
.hero-search input {
  min-width: 0;
  height: 52px;
  border: 0;
  padding: 0 16px;
  background: #fff;
  color: #141613;
  outline: 0;
}
.hero-search button {
  min-width: 128px;
  border: 0;
  background: var(--gold);
  color: #080a08;
  font-weight: 800;
}
.compact-search { max-width: 680px; margin: 0 0 30px; }

.hero-stats {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  max-width: 770px;
  border: 1px solid var(--line-soft);
}
.hero-stats article { padding: 16px 18px; border-right: 1px solid var(--line-soft); }
.hero-stats article:last-child { border-right: 0; }
.hero-stats strong { display: block; font-family: var(--serif); font-size: 1.65rem; color: var(--gold-soft); }
.hero-stats span { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.hero-mark {
  position: relative;
  z-index: 1;
  min-height: 380px;
  display: grid;
  place-items: center;
  align-content: center;
  justify-items: center;
  text-align: center;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 42%, rgba(210,173,87,.18), transparent 42%),
    linear-gradient(145deg, #151916, #090b0a);
  box-shadow: 0 26px 70px rgba(0,0,0,.42);
}
.hero-mark span { font-family: var(--serif); font-size: clamp(5rem, 11vw, 9rem); color: rgba(239,213,141,.2); letter-spacing: -.06em; }
.hero-mark small {
  display: block;
  width: 100%;
  max-width: none;
  color: var(--gold);
  letter-spacing: .2em;
  font-size: .6rem;
  text-align: center;
}

.page-shell { max-width: var(--max); margin: auto; padding: 56px 24px; }
.page-heading { max-width: 850px; margin-bottom: 28px; }
.page-heading h1, .dog-profile h1, .pedigree-toolbar h1, .kennel-hero h1, .dashboard-hero h1, .auth-card h1 {
  margin: 0 0 12px;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: .95;
}
.page-heading > p:last-child, .kennel-hero p { color: var(--muted); }
.section-heading, .panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.section-heading h2, .panel-heading h2 { margin: 0; font-size: 1.8rem; }
.panel-heading span, .section-heading > span { color: var(--muted); font-size: .78rem; }
.section-spacer { margin-top: 48px; }

.action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.action-card {
  min-height: 150px;
  padding: 24px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: border-color .15s ease, transform .15s ease;
}
.action-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.action-icon { color: var(--gold); font-size: 1.45rem; margin-bottom: 24px; }
.action-card strong { font-family: var(--serif); font-size: 1.25rem; }
.action-card small { color: var(--muted); margin-top: 3px; }

.dog-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.dog-card-grid.compact { grid-template-columns: repeat(4, minmax(180px,1fr)); }
.dog-card {
  min-width: 0;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  transition: border-color .15s ease, transform .15s ease;
}
.dog-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.dog-card-media { position: relative; aspect-ratio: 1.25; overflow: hidden; background: var(--surface-2); }
.dog-card-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
.dog-card-body { padding: 14px 15px 17px; }
.dog-card-body h3 { margin: 0 0 6px; font-size: 1.15rem; color: var(--gold-soft); }
.dog-card-body p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.media-placeholder {
  width: 100%; height: 100%; min-height: 110px;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 2rem;
  color: rgba(210,173,87,.34);
  background: radial-gradient(circle, rgba(210,173,87,.08), transparent 60%), #101310;
}
.media-placeholder.large { min-height: 460px; font-size: 5rem; }
.verification-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(69,184,107,.32);
  background: rgba(69,184,107,.13);
  color: #92d7a7;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.dog-card-media .verification-pill { position: absolute; left: 10px; top: 10px; }

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  padding: 0 16px;
  font-weight: 800;
  font-size: .78rem;
}
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--accent-contrast); }
.btn-outline { background: transparent; color: var(--gold-soft); }
.text-link { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 3px; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

.filter-panel {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(130px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
}
.filter-panel label, .mating-form label, .auth-card label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.filter-panel input, .filter-panel select, .mating-form select, .mating-form input, .auth-card input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-soft);
  background: var(--field-bg);
  color: var(--text);
  padding: 0 12px;
  outline: 0;
}
.filter-panel input:focus, .filter-panel select:focus, .mating-form select:focus, .mating-form input:focus, .auth-card input:focus { border-color: var(--gold); }
.result-summary { display: flex; gap: 8px; margin: 24px 0 10px; color: var(--muted); font-size: .82rem; }
.result-summary strong { color: var(--text); }
.search-results { display: grid; gap: 8px; }
.search-result-card {
  display: grid;
  grid-template-columns: 98px 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 112px;
  padding: 8px 16px 8px 8px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
}
.search-result-card:hover { border-color: var(--gold); }
.search-result-media { width: 98px; height: 96px; overflow: hidden; }
.search-result-media img { width: 100%; height: 100%; object-fit: cover; }
.search-result-main h2 { margin: 0; font-size: 1.3rem; }
.search-result-main p { margin: 4px 0; font-size: .78rem; color: #cac5b8; }
.result-title-row { display: flex; gap: 10px; align-items: center; }
.sex-mark { color: var(--gold); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.registration-line { color: var(--gold-soft) !important; font-size: .72rem !important; letter-spacing: .04em; }

.dog-profile-hero {
  display: grid;
  grid-template-columns: minmax(300px, .88fr) minmax(0, 1.12fr);
  gap: 28px;
  align-items: stretch;
}
.profile-photo { min-height: 470px; border: 1px solid var(--line-soft); background: var(--surface); overflow: hidden; }
.profile-photo img { width: 100%; height: 100%; max-height: 620px; object-fit: cover; object-position: center 24%; }
.profile-intro { padding: 22px 4px 18px; }
.profile-title-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.profile-title-row h1 { margin-right: auto; }
.profile-facts, .compact-facts {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 9px 18px;
  margin: 24px 0 0;
}
.profile-facts dt, .compact-facts dt { color: var(--muted); }
.profile-facts dd, .compact-facts dd { margin: 0; }
.profile-facts dd { min-width: 0; overflow-wrap: anywhere; }
.profile-tabs {
  margin: 22px 0;
  padding: 0 8px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  display: flex;
  gap: 2px;
  overflow-x: auto;
}
.profile-tabs a { padding: 13px 15px; white-space: nowrap; font-size: .76rem; color: var(--muted); border-bottom: 2px solid transparent; }
.profile-tabs a:hover { color: var(--gold-soft); border-bottom-color: var(--gold); }
.profile-section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.panel { padding: 22px; border: 1px solid var(--line-soft); background: var(--surface); }
.profile-bio { margin-bottom: 12px; }
.profile-bio p { color: #c8c3b7; }
.parent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.parent-grid > div { padding: 18px; border: 1px solid var(--line-soft); background: #0a0c0b; }
.parent-grid span { display: block; color: var(--gold); font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 7px; }
.parent-link { font-family: var(--serif); font-size: 1.15rem; text-decoration: underline; text-underline-offset: 3px; }
.relationship-list, .source-list, .repeated-list { display: grid; }
.relationship-list a, .source-list > div, .repeated-list a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.relationship-list a:last-child, .source-list > div:last-child, .repeated-list a:last-child { border-bottom: 0; }
.relationship-list span, .source-list span, .repeated-list span { color: var(--muted); font-size: .75rem; text-align: right; }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 620px; }
.data-table th, .data-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: .78rem; }
.data-table th { color: var(--gold); font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; }
.data-table td { color: #d4d0c5; }

.kennel-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.kennel-card { min-height: 230px; padding: 24px; border: 1px solid var(--line-soft); background: var(--surface); }
.kennel-card:hover { border-color: var(--gold); }
.kennel-card-top { display: flex; justify-content: space-between; gap: 10px; }
.kennel-card h2 { margin: 32px 0 8px; font-size: 1.7rem; }
.kennel-card p, .kennel-description { color: var(--muted); }
.mini-stats { display: flex; gap: 22px; margin-top: 20px; color: var(--muted); font-size: .75rem; }
.mini-stats strong { color: var(--gold-soft); font-family: var(--serif); font-size: 1.2rem; }
.kennel-hero { min-height: 240px; display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 38px; border: 1px solid var(--line); background: linear-gradient(115deg, #111612, #080a09); }
.kennel-description { max-width: 900px; margin: 28px 0 38px; }
.litter-list { display: grid; border-top: 1px solid var(--line-soft); }
.litter-row { display: grid; grid-template-columns: 1fr 180px 1.4fr; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line-soft); font-size: .8rem; }
.litter-row span { color: var(--muted); }

.pedigree-page { overflow: hidden; }
.pedigree-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 28px; padding-bottom: 26px; }
.pedigree-toolbar p { color: var(--muted); }
.generation-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.generation-switch a { padding: 8px 10px; border: 1px solid var(--line-soft); color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
.generation-switch a.active, .generation-switch a:hover { border-color: var(--gold); color: var(--gold-soft); }
.pedigree-scroll { width: 100%; overflow: auto; padding: 0 max(24px, calc((100vw - var(--max))/2)); scrollbar-color: var(--gold) #121412; }
.pedigree-board { display: flex; gap: 28px; min-width: max-content; align-items: stretch; padding: 10px 0 30px; }
.pedigree-column { width: 210px; display: flex; flex-direction: column; }
.pedigree-column h2 { min-height: 26px; margin: 0 0 10px; color: var(--muted); font-size: .72rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: .12em; }
.pedigree-nodes { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.pedigree-node { min-height: 72px; padding: 12px; border: 1px solid var(--line-soft); background: var(--surface); display: flex; flex-direction: column; justify-content: center; }
.pedigree-node:hover { border-color: var(--gold); }
.pedigree-node.repeated { border-color: rgba(210,173,87,.75); box-shadow: inset 3px 0 0 var(--gold); }
.pedigree-node.missing { opacity: .45; border-style: dashed; }
.pedigree-node strong { font-family: var(--serif); font-size: .95rem; }
.pedigree-node span, .pedigree-node small { color: var(--muted); font-size: .65rem; margin-top: 4px; }
.pedigree-node small { color: var(--gold); }
.analysis-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.analysis-card { min-height: 165px; padding: 24px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; justify-content: flex-end; }
.analysis-number { display: block; color: var(--gold-soft); font-family: var(--serif); font-size: 2.8rem; line-height: 1; }
.analysis-card > span { color: var(--muted); font-size: .75rem; margin-top: 7px; }
.action-analysis h2 { margin: 0 0 15px; }
.pedigree-index-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pedigree-index-card { padding: 22px; border: 1px solid var(--line-soft); background: var(--surface); }
.pedigree-index-card:hover { border-color: var(--gold); }
.pedigree-index-card h2 { margin: 18px 0 7px; }
.pedigree-index-card p { color: var(--muted); font-size: .78rem; }

.mating-form {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: end;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
}
.mating-plus { align-self: center; color: var(--gold); font-family: var(--serif); font-size: 1.8rem; }
.mating-results { margin-top: 26px; }
.pairing-summary { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-bottom: 12px; }
.pairing-summary article { padding: 24px; border: 1px solid var(--line-soft); background: var(--surface); }
.pairing-summary span:not(.mating-plus) { display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; }
.pairing-summary strong { font-family: var(--serif); font-size: 1.4rem; }

.dashboard-shell { max-width: 1500px; margin: auto; display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 76px); }
.dashboard-sidebar { padding: 28px 18px; border-right: 1px solid var(--line-soft); background: #0a0c0b; }
.sidebar-name { display: block; margin-bottom: 24px; font-family: var(--serif); font-size: 1.35rem; }
.dashboard-sidebar nav { display: grid; gap: 3px; }
.dashboard-sidebar nav > a, .sidebar-logout { padding: 10px 12px; color: var(--muted); border-left: 2px solid transparent; font-size: .8rem; }
.dashboard-sidebar nav > a:hover, .dashboard-sidebar nav > a.active { color: var(--gold-soft); border-left-color: var(--gold); background: rgba(210,173,87,.06); }
.sidebar-logout { width: 100%; margin-top: 18px; text-align: left; background: transparent; border-top: 1px solid var(--line-soft); border-right: 0; border-bottom: 0; }
.dashboard-main { padding: 28px; min-width: 0; }
.dashboard-hero {
  min-height: 205px;
  padding: 30px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 78% 50%, rgba(210,173,87,.12), transparent 35%),
    linear-gradient(120deg, #141815, #090b0a);
  display: flex; justify-content: space-between; gap: 28px; align-items: end;
}
.dashboard-hero p { color: var(--muted); }
.dashboard-stats { display: grid; grid-template-columns: repeat(3, 100px); border: 1px solid var(--line-soft); }
.dashboard-stats article { padding: 14px; text-align: center; border-right: 1px solid var(--line-soft); }
.dashboard-stats article:last-child { border-right: 0; }
.dashboard-stats strong { display: block; font-family: var(--serif); color: var(--gold-soft); font-size: 1.8rem; }
.dashboard-stats span { color: var(--muted); font-size: .62rem; text-transform: uppercase; }
.dashboard-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 12px; margin-top: 12px; }
.dashboard-panel { min-width: 0; padding: 20px; border: 1px solid var(--line-soft); background: var(--surface); }
.dashboard-wide { grid-column: 1 / -1; }
.activity-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.activity-row span { color: var(--muted); font-size: .75rem; }

.auth-shell { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(430px, 100%); padding: 34px; border: 1px solid var(--line); background: var(--surface); }
.auth-card h1 { font-size: 3rem; }
.auth-card form { display: grid; gap: 10px; }
.auth-card .btn { margin-top: 10px; }
.form-error, .notice.error { color: #f0a3a8; border: 1px solid rgba(213,91,99,.35); background: rgba(213,91,99,.1); padding: 12px; }
.notice { margin-bottom: 18px; }

.empty-state { padding: 28px; border: 1px dashed var(--line); color: var(--muted); background: rgba(255,255,255,.015); }
.empty-state strong { color: var(--text); }
.muted { color: var(--muted); }
.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; }

@media (max-width: 1080px) {
  .header-inner { grid-template-columns: auto 1fr; }
  .header-actions { display: none; }
  .main-nav { justify-content: flex-end; }
  .dog-card-grid, .action-grid { grid-template-columns: repeat(2, 1fr); }
  .kennel-grid, .pedigree-index-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-panel { grid-template-columns: 2fr 1fr 1fr; }
  .filter-panel .btn { min-height: 42px; }
  .dashboard-shell { grid-template-columns: 180px 1fr; }
}

@media (max-width: 760px) {
  .header-inner { min-height: auto; padding: 15px 16px; grid-template-columns: 1fr; gap: 12px; }
  .brand { text-align: center; }
  .main-nav { justify-content: flex-start; overflow-x: auto; gap: 16px; padding-bottom: 2px; }
  .main-nav a { white-space: nowrap; }
  .hero { grid-template-columns: 1fr; padding: 82px 18px 34px; min-height: auto; }
  .hero::before { inset: 50% 0 0 0; }
  .hero h1 { font-size: clamp(3.25rem, 17vw, 5rem); }
  .hero-mark { min-height: 220px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stats article:nth-child(2) { border-right: 0; }
  .hero-stats article:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .page-shell { padding: 38px 16px; }
  .home-actions { padding-top: 24px; }
  .action-grid, .dog-card-grid, .dog-card-grid.compact, .kennel-grid, .pedigree-index-grid, .analysis-grid { grid-template-columns: 1fr; }
  .filter-panel { grid-template-columns: 1fr; }
  .search-result-card { grid-template-columns: 78px 1fr; padding-right: 10px; }
  .search-result-media { width: 78px; height: 84px; }
  .search-result-card > .verification-pill { grid-column: 2; }
  .dog-profile-hero { grid-template-columns: 1fr; }
  .profile-photo { min-height: 360px; }
  .profile-section-grid, .parent-grid { grid-template-columns: 1fr; }
  .profile-facts, .compact-facts { grid-template-columns: 120px 1fr; }
  .kennel-hero { padding: 24px; align-items: flex-start; flex-direction: column; }
  .litter-row { grid-template-columns: 1fr; gap: 4px; }
  .pedigree-toolbar { align-items: flex-start; flex-direction: column; }
  .pedigree-scroll { padding-left: 16px; padding-right: 16px; }
  .pedigree-column { width: 180px; }
  .mating-form { grid-template-columns: 1fr; }
  .mating-plus { justify-self: center; }
  .pairing-summary { grid-template-columns: 1fr; }
  .dashboard-shell { grid-template-columns: 1fr; }
  .dashboard-sidebar { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .dashboard-sidebar nav { grid-template-columns: repeat(2, 1fr); }
  .dashboard-main { padding: 16px; }
  .dashboard-hero { align-items: flex-start; flex-direction: column; }
  .dashboard-stats { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-wide { grid-column: auto; }
  .site-footer { margin-top: 46px; padding: 26px 16px 40px; flex-direction: column; }
}

@media (max-width: 440px) {
  .hero-search { grid-template-columns: 1fr; background: transparent; border: 0; gap: 8px; }
  .hero-search input, .hero-search button { width: 100%; min-height: 50px; }
  .dashboard-sidebar nav { grid-template-columns: 1fr; }
  .profile-facts { grid-template-columns: minmax(88px, 108px) minmax(0, 1fr); column-gap: 12px; row-gap: 10px; }
  .compact-facts { grid-template-columns: 1fr; }
}

.flash-stack {
  position: fixed;
  right: 18px;
  top: 92px;
  z-index: 90;
  width: min(420px, calc(100vw - 36px));
  display: grid;
  gap: 8px;
}
.flash {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(14,17,16,.98);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  font-size: .8rem;
}
.flash.success { border-color: rgba(69,184,107,.45); }
.flash.error { border-color: rgba(213,91,99,.5); }

.member-form-shell { max-width: 980px; }
.member-form {
  padding: 22px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-field { min-width: 0; }
.form-field.form-wide { grid-column: 1 / -1; }
.form-field label,
.merge-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.form-field input,
.form-field select,
.form-field textarea,
.merge-form select,
.review-actions textarea {
  width: 100%;
  border: 1px solid var(--line-soft);
  background: var(--field-bg);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}
.form-field input,
.form-field select { min-height: 44px; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.merge-form select:focus,
.review-actions textarea:focus { border-color: var(--gold); }
.form-field small { display: block; color: var(--muted); margin-top: 5px; font-size: .7rem; }
.field-error { display: block; margin-top: 5px; color: #f0a3a8; font-size: .72rem; }

.section-spacer-tight { margin: 0 0 20px; }
.submission-list,
.notification-list,
.moderation-list { display: grid; gap: 10px; }
.submission-card,
.notification-card,
.moderation-card,
.document-card {
  border: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 20px;
}
.submission-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
}
.submission-card h2,
.document-card h2,
.moderation-card h2 { margin: 3px 0 8px; font-size: 1.35rem; }
.submission-card p,
.document-card p,
.notification-card p,
.moderation-card p { margin: 4px 0; color: var(--muted); font-size: .78rem; }
.submission-state {
  align-self: start;
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.submission-state.approved { color: #92d7a7; border-color: rgba(69,184,107,.35); }
.submission-state.rejected { color: #f0a3a8; border-color: rgba(213,91,99,.4); }
.submission-state.pending { color: var(--gold-soft); border-color: var(--line); }
.resolution-note { grid-column: 1 / -1; }

.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}
.document-card { min-height: 180px; display: flex; flex-direction: column; justify-content: flex-end; }
.notification-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.notification-card.unread { border-left: 3px solid var(--gold); }
.notification-card small { color: var(--muted); }

.moderation-merge { margin-bottom: 18px; }
.merge-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.moderation-card { display: grid; gap: 12px; }
.payload-preview {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line-soft);
  background: #090b0a;
  color: #c9c4b8;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .72rem;
}
.review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.review-actions form { display: grid; gap: 8px; }
.moderator-note {
  padding-left: 10px;
  border-left: 2px solid var(--gold);
}
.card-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.card-actions span {
  color: var(--muted);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

@media (max-width: 760px) {
  .form-grid,
  .document-grid,
  .merge-form,
  .review-actions { grid-template-columns: 1fr; }
  .form-field.form-wide { grid-column: auto; }
  .submission-card { grid-template-columns: 1fr; }
  .notification-card { align-items: flex-start; flex-direction: column; }
  .flash-stack { top: 126px; }
}


.moderation-verify { margin-bottom: 18px; }
.verification-form {
  display: grid;
  grid-template-columns: 1.2fr .9fr .9fr 1fr;
  gap: 12px;
  align-items: end;
}
.verification-form > div { min-width: 0; }
.verification-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.verification-form input,
.verification-form select,
.verification-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-soft);
  background: var(--field-bg);
  color: var(--text);
  padding: 9px 10px;
}
.verification-form small { display: block; margin-top: 4px; color: var(--muted); font-size: .66rem; }
@media (max-width: 900px) {
  .verification-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .verification-form { grid-template-columns: 1fr; }
}

.moderation-suggestions { margin-bottom: 18px; }

@media (max-width: 760px) {
  .source-list > div {
    align-items: flex-start;
    flex-direction: column;
  }
  .source-list > div span,
  .source-list > div .text-link {
    text-align: left;
  }
}

.workspace-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
}
.pedigree-workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
.pedigree-workspace-card,
.member-litter-card {
  border: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 22px;
}
.workspace-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.pedigree-workspace-card h2,
.member-litter-card h2 {
  margin: 20px 0 8px;
  font-size: 1.55rem;
}
.pedigree-workspace-card > p,
.member-litter-card > p {
  color: var(--muted);
  font-size: .78rem;
}
.record-visibility {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line-soft);
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.record-visibility.public {
  color: #92d7a7;
  border-color: rgba(69,184,107,.35);
  background: rgba(69,184,107,.09);
}
.record-visibility.private {
  color: var(--gold-soft);
  border-color: var(--line);
  background: rgba(210,173,87,.06);
}
.pedigree-completeness {
  margin: 20px 0 4px;
  padding: 13px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pedigree-completeness span {
  color: var(--muted);
  font-size: .72rem;
}
.pedigree-completeness strong {
  color: var(--gold-soft);
  font-family: var(--serif);
  font-size: 1.25rem;
}
.private-node {
  border-style: dashed;
  background: #0b0e0c;
}
.member-litter-list {
  display: grid;
  gap: 10px;
}
.member-litter-card {
  display: grid;
  grid-template-columns: minmax(180px,.8fr) minmax(280px,1.3fr) auto;
  align-items: center;
  gap: 24px;
}
.litter-parent-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.litter-parent-pair span {
  padding: 12px;
  border: 1px solid var(--line-soft);
  background: #0a0c0b;
}
.litter-parent-pair small {
  display: block;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .6rem;
  margin-bottom: 4px;
}
.litter-parent-pair strong {
  font-family: var(--serif);
  font-size: .92rem;
}
.document-filters {
  display: grid;
  grid-template-columns: 220px 220px auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 22px;
}
.document-filters label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.document-filters select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-soft);
  background: var(--field-bg);
  color: var(--text);
  padding: 0 10px;
}
@media (max-width: 900px) {
  .member-litter-card {
    grid-template-columns: 1fr;
    align-items: start;
  }
}
@media (max-width: 760px) {
  .pedigree-workspace-grid,
  .document-filters {
    grid-template-columns: 1fr;
  }
  .litter-parent-pair {
    grid-template-columns: 1fr;
  }
}

.moderation-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}
.moderation-filters {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
}
.moderation-filters label,
.duplicate-search-form label,
.bulk-bar label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.moderation-filters input,
.moderation-filters select,
.duplicate-search-form input,
.bulk-bar select,
.bulk-bar textarea,
.dispute-actions textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-soft);
  background: var(--field-bg);
  color: var(--text);
  padding: 9px 10px;
}
.moderation-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line-soft);
  margin-bottom: 18px;
}
.moderation-summary article {
  padding: 16px 18px;
  border-right: 1px solid var(--line-soft);
}
.moderation-summary article:last-child { border-right: 0; }
.moderation-summary strong {
  display: block;
  color: var(--gold-soft);
  font-family: var(--serif);
  font-size: 1.7rem;
}
.moderation-summary span {
  color: var(--muted);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.duplicate-search-panel { margin-bottom: 18px; }
.duplicate-search-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.duplicate-results-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
.duplicate-results-heading span {
  color: var(--muted);
  font-size: .72rem;
}
.duplicate-result-list { display: grid; gap: 8px; }
.duplicate-result-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line-soft);
  background: #0a0c0b;
}
.duplicate-result-card.selectable:hover { border-color: var(--gold); }
.duplicate-result-card.compact { grid-template-columns: 1fr; }
.duplicate-result-card h3 {
  margin: 5px 0 4px;
  font-size: 1.12rem;
}
.duplicate-result-card p,
.duplicate-record-meta {
  margin: 0;
  color: var(--muted);
  font-size: .7rem;
}
.duplicate-record-meta {
  display: grid;
  gap: 3px;
  text-align: right;
}
.confidence-pill,
.priority-pill,
.assignment-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid var(--line-soft);
  font-size: .6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.confidence-high {
  color: #92d7a7;
  border-color: rgba(69,184,107,.35);
}
.confidence-medium,
.priority-30,
.priority-40 {
  color: var(--gold-soft);
  border-color: var(--line);
}
.confidence-low,
.assignment-pill {
  color: var(--muted);
}
.priority-40 {
  border-color: rgba(213,91,99,.52);
  color: #f0a3a8;
}
.priority-10 { color: #8f958f; }
.priority-20 { color: #d2cec3; }
.assignment-pill.unassigned { opacity: .7; }
.moderation-details {
  margin-top: 16px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}
.moderation-details summary {
  cursor: pointer;
  color: var(--gold-soft);
  font-size: .78rem;
  margin-bottom: 10px;
}
.dispute-queue { margin-bottom: 18px; }
.dispute-list { display: grid; gap: 10px; }
.dispute-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  background: #0a0c0b;
}
.dispute-card h2,
.dispute-card h3 { margin: 4px 0 7px; }
.dispute-card p { color: #c7c2b6; }
.dispute-card small { color: var(--muted); }
.dispute-card-main { display: grid; align-content: start; gap: 5px; }
.dispute-actions { display: grid; gap: 8px; }
.dispute-actions form { display: grid; gap: 6px; }
.member-dispute-card {
  grid-template-columns: minmax(0,1fr) auto;
}
.dispute-status-block {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 8px;
  max-width: 320px;
}
.dispute-status-block p {
  margin: 0;
  text-align: right;
  font-size: .75rem;
}
.submission-state.open,
.submission-state.reviewing {
  color: var(--gold-soft);
  border-color: var(--line);
}
.submission-state.resolved {
  color: #92d7a7;
  border-color: rgba(69,184,107,.35);
}
.submission-state.dismissed {
  color: #b3aea1;
}
.bulk-bar {
  position: static;
  display: grid;
  grid-template-columns: minmax(180px,.8fr) minmax(240px,1.2fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(10,12,11,.97);
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
}
.bulk-bar small {
  color: var(--muted);
  align-self: center;
  max-width: 180px;
}
.moderation-card {
  position: relative;
  grid-template-columns: auto 1fr;
}
.moderation-card.aging { border-color: rgba(210,173,87,.42); }
.moderation-select {
  padding-top: 3px;
}
.moderation-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}
.moderation-card-content { min-width: 0; }
.moderation-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.queue-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
  justify-content: flex-end;
}
.review-diff {
  border: 1px solid var(--line-soft);
  background: #090b0a;
}
.review-diff-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.review-diff-heading span {
  color: var(--muted);
  font-size: .68rem;
}
.review-diff-row {
  display: grid;
  grid-template-columns: 150px minmax(0,1fr) auto minmax(0,1fr);
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: .74rem;
}
.review-diff-row:last-child { border-bottom: 0; }
.diff-before { color: #b1ada2; }
.diff-after { color: var(--gold-soft); }
.diff-arrow { color: var(--gold); }
.audit-filters {
  grid-template-columns: minmax(260px,2fr) 1fr 1fr auto;
}
.audit-list { display: grid; gap: 8px; }
.audit-card {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
}
.audit-time {
  color: var(--gold-soft);
  font-family: var(--serif);
}
.audit-time small {
  display: block;
  color: var(--muted);
  font-family: var(--sans);
  margin-top: 3px;
}
.audit-main h2 {
  margin: 4px 0 5px;
  font-size: 1.15rem;
}
.audit-main p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .74rem;
}
.audit-summary {
  margin: 0;
  padding: 9px;
  max-height: 180px;
  overflow: auto;
  background: #090b0a;
  border: 1px solid var(--line-soft);
  color: #c5c0b5;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .68rem;
}

@media (max-width: 980px) {
  .moderation-filters {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  .bulk-bar {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 760px) {
  .moderation-heading,
  .duplicate-results-heading,
  .moderation-meta {
    align-items: flex-start;
    flex-direction: column;
  }
  .moderation-filters,
  .moderation-summary,
  .duplicate-search-form,
  .bulk-bar,
  .dispute-card,
  .member-dispute-card,
  .audit-filters {
    grid-template-columns: 1fr;
  }
  .moderation-summary article {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .moderation-summary article:last-child { border-bottom: 0; }
  .duplicate-result-card {
    grid-template-columns: 1fr;
  }
  .duplicate-record-meta {
    text-align: left;
  }
  .bulk-bar {
    position: static;
  }
  .review-diff-row {
    grid-template-columns: 1fr;
  }
  .diff-arrow { display: none; }
  .queue-badges { justify-content: flex-start; }
  .dispute-status-block {
    justify-items: start;
    max-width: none;
  }
  .dispute-status-block p { text-align: left; }
  .audit-card {
    grid-template-columns: 1fr;
  }
}


/* Advanced pedigree analysis */
.analysis-heading-row { display:flex; align-items:end; justify-content:space-between; gap:24px; margin-bottom:16px; }
.analysis-heading-row h2 { margin-bottom:6px; }
.analysis-heading-row .button-row { margin-top:0; }
.analysis-grid-four { grid-template-columns:repeat(4,minmax(0,1fr)); }
.analysis-detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px; }
.panel-heading { display:flex; justify-content:space-between; align-items:end; gap:20px; margin-bottom:16px; }
.panel-heading > span { max-width:360px; color:var(--muted); font-size:.72rem; text-align:right; }
.contribution-list, .linebreeding-list { display:grid; }
.contribution-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(150px,.5fr); gap:18px; align-items:center; padding:12px 0; border-bottom:1px solid var(--line-soft); }
.contribution-row:last-child, .linebreeding-row:last-child { border-bottom:0; }
.contribution-copy > a, .linebreeding-title > a { text-decoration:underline; text-underline-offset:3px; }
.contribution-copy > span, .linebreeding-title > span { display:block; margin-top:4px; color:var(--muted); font-size:.7rem; }
.contribution-value { text-align:right; }
.contribution-value > strong { color:var(--gold-soft); font-family:var(--serif); font-size:1.12rem; }
.contribution-bar { height:5px; margin-top:7px; overflow:hidden; background:rgba(255,255,255,.06); }
.contribution-bar > span { display:block; height:100%; background:var(--gold); }
.linebreeding-row { padding:14px 0; border-bottom:1px solid var(--line-soft); }
.linebreeding-title { display:flex; justify-content:space-between; gap:16px; align-items:baseline; }
.linebreeding-title > span { text-align:right; }
.linebreeding-paths { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-top:10px; }
.linebreeding-paths > div { padding:9px 10px; border:1px solid var(--line-soft); background:#0a0c0b; }
.linebreeding-paths strong, .linebreeding-paths span { display:block; }
.linebreeding-paths strong { font-size:.72rem; }
.linebreeding-paths span { margin-top:3px; color:var(--muted); font-size:.64rem; }
.generation-coverage-strip { display:grid; grid-template-columns:repeat(auto-fit,minmax(92px,1fr)); gap:6px; margin-top:12px; }
.generation-coverage-strip > div { padding:10px; border:1px solid var(--line-soft); background:var(--surface); }
.generation-coverage-strip strong, .generation-coverage-strip span { display:block; }
.generation-coverage-strip strong { color:var(--gold-soft); font-family:var(--serif); }
.generation-coverage-strip span { margin-top:3px; color:var(--muted); font-size:.64rem; }

@media (max-width:1080px) {
  .analysis-grid-four { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .analysis-detail-grid { grid-template-columns:1fr; }
}
@media (max-width:760px) {
  .advanced-analysis { padding-top:24px; }
  .analysis-heading-row, .panel-heading, .linebreeding-title { align-items:flex-start; flex-direction:column; }
  .analysis-heading-row .button-row { width:100%; }
  .analysis-heading-row .btn { flex:1; }
  .analysis-grid-four { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .analysis-mobile-summary .analysis-card { min-height:132px; padding:18px; }
  .analysis-mobile-summary .analysis-number { font-size:2.15rem; }
  .panel-heading > span, .linebreeding-title > span { max-width:none; text-align:left; }
  .contribution-row { grid-template-columns:1fr; gap:8px; }
  .contribution-value { text-align:left; }
  .linebreeding-paths { grid-template-columns:1fr; }
}
@media (max-width:440px) { .analysis-grid-four { grid-template-columns:1fr; } }
@media print {
  @page { size:landscape; margin:10mm; }
  body { background:#fff; color:#111; }
  .site-header, .site-footer, .no-print, .flash-stack { display:none !important; }
  main, .pedigree-page { overflow:visible !important; }
  .page-shell { max-width:none; padding:12px 0; }
  .pedigree-scroll { overflow:visible; padding:0; }
  .pedigree-board { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); min-width:0; gap:10px; }
  .pedigree-column { width:auto; break-inside:avoid; }
  .pedigree-node, .analysis-card, .panel, .generation-coverage-strip > div { background:#fff; color:#111; border-color:#aaa; box-shadow:none; }
  .analysis-detail-grid { grid-template-columns:1fr; }
  a { color:#111; text-decoration:none; }
}


/* Header brand mark: approved Cane Corso artwork, intentionally unframed. */
.brand {
  min-width: 190px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  letter-spacing: .08em;
  line-height: 1;
}
.brand-mark {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 5px 12px rgba(0,0,0,.32));
}
.brand-copy { display: block; min-width: 0; }
.brand-small {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .08em;
}
.brand strong {
  display: block;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: .08em;
}
.brand:hover .brand-mark { opacity: .94; }

@media (max-width: 1080px) {
  .brand { min-width: 178px; gap: 9px; }
  .brand-mark { width: 52px; height: 52px; flex-basis: 52px; }
}
@media (max-width: 760px) {
  .brand { width: fit-content; min-width: 0; margin: 0 auto; justify-content: center; text-align: left; }
  .brand-mark { width: 50px; height: 50px; flex-basis: 50px; }
  .brand-small { font-size: .62rem; }
  .brand strong { font-size: .96rem; }
}


/* Accessibility and motion safety */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* Mobile composition: purpose-built phone layout rather than compressed desktop UI. */
.mobile-nav,
.dashboard-mobile-nav { display: none; }

@media (max-width: 760px) {
  .site-header { backdrop-filter: blur(14px); }
  .header-inner {
    position: relative;
    min-height: 64px;
    padding: 8px 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }
  .brand {
    width: fit-content;
    min-width: 0;
    margin: 0;
    justify-content: flex-start;
    text-align: left;
  }
  .brand-mark { width: 48px; height: 48px; flex-basis: 48px; }
  .brand-small { margin-bottom: 3px; font-size: .58rem; }
  .brand strong { font-size: .9rem; }
  .main-nav,
  .header-actions { display: none; }

  .mobile-nav { display: block; position: static; }
  .mobile-nav > summary {
    min-width: 78px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--gold-soft);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    font-size: .76rem;
    font-weight: 800;
    list-style: none;
    cursor: pointer;
  }
  .mobile-nav > summary::-webkit-details-marker { display: none; }
  .mobile-nav[open] > summary { border-color: var(--gold); background: var(--surface-2); }
  .mobile-nav-panel {
    position: absolute;
    z-index: 70;
    left: 0;
    right: 0;
    top: 100%;
    padding: 14px;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line);
    background: var(--header-bg);
    box-shadow: 0 20px 40px rgba(0,0,0,.38);
  }
  .mobile-nav-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-bottom: 12px;
    border: 1px solid var(--line-soft);
    background: #0a0c0b;
  }
  .mobile-nav-search input {
    min-width: 0;
    min-height: 46px;
    border: 0;
    padding: 0 12px;
    background: transparent;
    color: var(--text);
    outline: 0;
  }
  .mobile-nav-search button {
    min-width: 82px;
    min-height: 46px;
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--gold);
    color: #080a08;
    font-weight: 800;
  }
  .mobile-nav-panel nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .mobile-nav-panel nav a,
  .mobile-account-actions a {
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line-soft);
    display: flex;
    align-items: center;
    font-size: .8rem;
  }
  .mobile-nav-panel nav a { background: var(--surface); }
  .mobile-account-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 7px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
  }
  .mobile-account-actions a { color: var(--gold-soft); }
  .mobile-account-actions .mobile-account-primary {
    border-color: var(--gold);
    background: rgba(210,173,87,.1);
  }

  .hero {
    padding: 66px 16px 28px;
    gap: 26px;
  }
  .hero h1 { font-size: clamp(2.9rem, 15vw, 4.4rem); }
  .hero-copy > p:not(.eyebrow) { margin: 18px 0; font-size: .95rem; }
  .hero-search { margin-top: 22px; }
  .hero-stats { margin-top: 22px; }
  .hero-stats article { padding: 13px 14px; }
  .hero-stats strong { font-size: 1.45rem; }
  .hero-mark {
    min-height: 132px;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 18px;
  }
  .hero-mark span { font-size: clamp(3.6rem, 18vw, 5rem); }
  .hero-mark small {
    max-width: 100%;
    line-height: 1.35;
    text-align: center;
  }
  .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-card { min-height: 122px; padding: 17px; }
  .action-icon { margin-bottom: 14px; }
  .action-card strong { font-size: 1.08rem; }
  .action-card small { font-size: .7rem; }

  .page-shell { padding: 30px 16px; }
  .page-heading { margin-bottom: 22px; }
  .page-heading h1,
  .dog-profile h1,
  .pedigree-toolbar h1,
  .kennel-hero h1,
  .dashboard-hero h1,
  .auth-card h1 {
    font-size: clamp(2.25rem, 11vw, 3.35rem);
  }

  .filter-panel { padding: 12px; gap: 9px; }
  .filter-panel input,
  .filter-panel select,
  .filter-panel .btn { min-height: 46px; }

  .search-results { gap: 7px; }
  .search-result-card {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    min-height: 98px;
    padding: 7px 9px 7px 7px;
  }
  .search-result-media { width: 82px; height: 84px; }
  .search-result-main { min-width: 0; }
  .result-title-row { gap: 7px; align-items: baseline; flex-wrap: wrap; }
  .search-result-main h2 { font-size: 1.08rem; line-height: 1.08; }
  .search-result-main p { margin: 3px 0; font-size: .73rem; line-height: 1.3; }
  .registration-line { font-size: .68rem !important; }
  .search-result-card > .verification-pill {
    grid-column: 2;
    min-height: 20px;
    padding: 2px 7px;
    font-size: .57rem;
  }

  .pedigree-toolbar { gap: 16px; padding-bottom: 18px; }
  .pedigree-toolbar p { margin-bottom: 0; }
  .generation-switch { width: 100%; gap: 5px; }
  .generation-switch a {
    flex: 1 1 0;
    min-height: 44px;
    padding: 8px 6px;
    display: grid;
    place-items: center;
    text-align: center;
  }
  .pedigree-scroll {
    overflow: visible;
    padding: 0 16px;
  }
  .pedigree-board {
    width: 100%;
    min-width: 0;
    display: grid;
    gap: 16px;
    padding: 2px 0 20px;
  }
  .pedigree-column {
    width: 100%;
    min-width: 0;
    display: block;
    padding-left: 12px;
    border-left: 2px solid rgba(210,173,87,.24);
  }
  .pedigree-column h2 {
    min-height: 0;
    margin: 0 0 8px;
    color: var(--gold);
    font-size: .68rem;
  }
  .pedigree-nodes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 7px;
  }
  .pedigree-column:first-child .pedigree-nodes { grid-template-columns: 1fr; }
  .pedigree-node {
    min-width: 0;
    min-height: 72px;
    padding: 11px;
  }
  .pedigree-node strong {
    font-size: .9rem;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }
  .pedigree-node span,
  .pedigree-node small { font-size: .63rem; line-height: 1.3; }

  .pedigree-index-grid { gap: 8px; }
  .pedigree-index-card { padding: 17px; }
  .pedigree-index-card h2 { margin: 10px 0 5px; font-size: 1.25rem; }
  .pedigree-index-card p { margin: 5px 0 10px; font-size: .75rem; }

  .dashboard-shell { display: block; min-height: 0; }
  .dashboard-sidebar {
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    background: #0a0c0b;
  }
  .dashboard-sidebar-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }
  .dashboard-sidebar-intro .eyebrow { margin: 0; }
  .sidebar-name {
    margin: 0;
    max-width: 55vw;
    font-family: var(--sans);
    font-size: .8rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dashboard-desktop-nav { display: none !important; }
  .dashboard-mobile-nav { display: block; margin-top: 9px; }
  .dashboard-mobile-nav > summary {
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--gold-soft);
    font-size: .78rem;
    font-weight: 800;
    list-style: none;
    cursor: pointer;
  }
  .dashboard-mobile-nav > summary::-webkit-details-marker { display: none; }
  .dashboard-mobile-nav nav {
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 5px;
    padding-top: 7px;
  }
  .dashboard-sidebar .dashboard-mobile-nav nav > a,
  .dashboard-sidebar .dashboard-mobile-nav .sidebar-logout {
    min-height: 44px;
    padding: 9px 10px;
    border: 1px solid var(--line-soft);
    border-left: 1px solid var(--line-soft);
    background: var(--surface);
    display: flex;
    align-items: center;
  }
  .dashboard-sidebar .dashboard-mobile-nav form { margin: 0; }
  .dashboard-sidebar .dashboard-mobile-nav .sidebar-logout {
    margin: 0;
    color: #f0a3a8;
  }
  .dashboard-main { padding: 14px 16px 24px; }
  .dashboard-hero {
    min-height: 0;
    padding: 20px;
    gap: 18px;
  }
  .dashboard-hero p { margin-bottom: 0; }
  .dashboard-stats article { padding: 11px 7px; }
  .dashboard-stats strong { font-size: 1.45rem; }
  .dashboard-panel { padding: 16px; }
  .panel-heading { gap: 8px; }
  .panel-heading h2 { font-size: 1.45rem; }

  .dog-card-grid.compact .dog-card {
    display: grid;
    grid-template-columns: 112px minmax(0,1fr);
    min-height: 112px;
  }
  .dog-card-grid.compact .dog-card-media {
    height: 100%;
    min-height: 112px;
    aspect-ratio: auto;
  }
  .dog-card-grid.compact .dog-card-body {
    min-width: 0;
    padding: 12px;
  }
  .dog-card-grid.compact .dog-card-body h3 { font-size: 1.05rem; }
  .dog-card-grid.compact .verification-pill {
    left: 6px;
    top: 6px;
    font-size: .54rem;
  }
  .card-actions { gap: 4px; margin-top: 7px; }
  .card-actions span { font-size: .56rem; }

  .site-footer { gap: 18px; }
  .footer-links { flex-wrap: wrap; }
}

@media (max-width: 440px) {
  .mobile-nav-panel nav,
  .mobile-account-actions,
  .dashboard-mobile-nav nav { grid-template-columns: 1fr 1fr; }
  .pedigree-nodes { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .action-grid { gap: 8px; }
  .action-card { padding: 15px; }
  .action-card small { display: none; }
  .dog-card-grid.compact .dog-card { grid-template-columns: 102px minmax(0,1fr); }
}


@media (max-width: 760px) {
  .generation-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  .generation-switch a { width: 100%; }

  .featured-dog-grid .dog-card {
    display: grid;
    grid-template-columns: 108px minmax(0,1fr);
    min-height: 112px;
  }
  .featured-dog-grid .dog-card-media {
    height: 100%;
    min-height: 112px;
    aspect-ratio: auto;
  }
  .featured-dog-grid .dog-card-body {
    min-width: 0;
    padding: 12px;
    align-self: center;
  }
  .featured-dog-grid .dog-card-body h3 {
    font-size: 1.04rem;
    line-height: 1.14;
  }
  .featured-dog-grid .dog-card-body p { font-size: .7rem; }
  .featured-dog-grid .verification-pill {
    left: 6px;
    top: 6px;
    font-size: .54rem;
  }
}


/* Distinct Cane Corso Ancestry colour system and user-selectable theme. */
.theme-toggle {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--gold-soft);
  padding: 0 12px;
  font: inherit;
  font-size: .76rem;
  font-weight: 750;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--gold); }
.mobile-theme-toggle {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
}
.mating-help { margin: 10px 0 0; max-width: 820px; font-size: .78rem; }
.field-help { display: block; margin-top: -4px; color: var(--muted); font-size: .72rem; }

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 78% 18%, rgba(23,111,106,.07), transparent 28rem),
    var(--bg);
}
html[data-theme="light"] .skip-link,
html[data-theme="light"] .header-search input,
html[data-theme="light"] .mobile-nav-search,
html[data-theme="light"] .parent-grid > div,
html[data-theme="light"] .dashboard-sidebar,
html[data-theme="light"] .private-node,
html[data-theme="light"] .litter-parent-pair span,
html[data-theme="light"] .duplicate-result-card,
html[data-theme="light"] .dispute-card,
html[data-theme="light"] .review-diff,
html[data-theme="light"] .audit-summary,
html[data-theme="light"] .linebreeding-paths > div {
  background: var(--surface-2);
  color: var(--text);
}
html[data-theme="light"] .kennel-hero {
  background: linear-gradient(115deg, var(--surface), var(--surface-2));
}
html[data-theme="light"] .profile-bio p,
html[data-theme="light"] .hero-copy > p:not(.eyebrow) {
  color: var(--muted);
}
html[data-theme="light"] .mobile-nav-panel {
  background: rgba(243, 247, 246, .99);
}
html[data-theme="light"] .media-placeholder {
  color: rgba(23,111,106,.48);
  background: radial-gradient(circle, rgba(23,111,106,.09), transparent 60%), var(--surface-2);
}


/* Quick mobile/search usability pass. */
.hero-stats.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pedigree-relationship { display: none; }

.dog-autocomplete-host {
  position: relative;
}
.dog-suggestions {
  position: absolute;
  z-index: 120;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: min(380px, 52vh);
  overflow-y: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(0,0,0,.28);
}
.dog-suggestions[hidden] { display: none; }
.dog-suggestion {
  width: 100%;
  min-height: 54px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  cursor: pointer;
}
.dog-suggestion:last-child { border-bottom: 0; }
.dog-suggestion:hover,
.dog-suggestion:focus-visible {
  background: var(--surface-2);
}
.dog-suggestion strong {
  font-size: .82rem;
  line-height: 1.2;
}
.dog-suggestion span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.25;
}
.header-search .dog-suggestions { min-width: 300px; }
.mobile-nav-search .dog-suggestions { top: 100%; }

@media (max-width: 760px) {
  .hero-stats.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hero-stats.three article {
    border-right: 1px solid var(--line-soft);
    border-bottom: 0;
  }
  .hero-stats.three article:last-child { border-right: 0; }

  .pedigree-nodes,
  .pedigree-column:first-child .pedigree-nodes {
    grid-template-columns: 1fr;
  }
  .pedigree-column {
    padding-left: 0;
    border-left: 0;
  }
  .pedigree-column h2 {
    padding: 0 0 7px 10px;
    border-left: 3px solid var(--gold);
  }
  .pedigree-node {
    min-height: 82px;
    padding: 12px 13px;
  }
  .pedigree-relationship {
    display: block;
    margin-bottom: 5px;
    color: var(--gold);
    font-size: .58rem !important;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .dog-suggestions {
    max-height: 42vh;
  }
  .header-search .dog-suggestions { min-width: 0; }
}


/* Premium editorial identity — owner-selected Cane Corso photo */
:root {
  --bg: #111214;
  --surface: #18191d;
  --surface-2: #202127;
  --surface-3: #2a2c33;
  --field-bg: #141519;
  --header-bg: rgba(17, 18, 20, .90);
  --text: #f6f2ed;
  --muted: #aaa39d;
  --gold: #9d314a;
  --gold-soft: #d69aa7;
  --line: rgba(157, 49, 74, .38);
  --line-soft: rgba(246, 242, 237, .11);
  --success: #5eb985;
  --danger: #e06f78;
  --accent-contrast: #ffffff;
  --serif: Baskerville, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f0eb;
  --surface: #fffdfa;
  --surface-2: #eee7e0;
  --surface-3: #e3d9d1;
  --field-bg: #fffdfa;
  --header-bg: rgba(244, 240, 235, .92);
  --text: #251f23;
  --muted: #6e6567;
  --gold: #7f2339;
  --gold-soft: #a64b61;
  --line: rgba(127, 35, 57, .28);
  --line-soft: rgba(37, 31, 35, .12);
  --success: #317656;
  --danger: #ac3f4c;
  --accent-contrast: #ffffff;
}

body {
  background:
    radial-gradient(circle at 82% 8%, rgba(157,49,74,.10), transparent 31rem),
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 24rem),
    var(--bg);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 82% 8%, rgba(127,35,57,.08), transparent 31rem),
    linear-gradient(180deg, rgba(255,255,255,.65), transparent 28rem),
    var(--bg);
}

.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 10px 34px rgba(0,0,0,.12);
  backdrop-filter: blur(22px) saturate(1.2);
}

.header-inner { min-height: 82px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 194px;
  letter-spacing: .045em;
}

.brand-mark {
  width: 60px;
  height: 50px;
  flex: 0 0 60px;
  object-fit: cover;
  object-position: 50% 31%;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #e9e3df;
  box-shadow: 0 10px 28px rgba(0,0,0,.24);
  filter: none;
}

.brand-small {
  color: var(--gold-soft);
  font-family: var(--sans);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.brand strong {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: .035em;
}

.main-nav {
  gap: 22px;
  color: var(--muted);
  font-size: .82rem;
}

.main-nav a {
  position: relative;
  padding: 11px 0;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 5px;
  height: 1px;
  background: var(--gold);
  transition: right .18s ease;
}

.main-nav a:hover::after { right: 0; }

.header-search input,
.mobile-nav-search,
.filter-panel input,
.filter-panel select,
.mating-form input,
.mating-form select,
.auth-card input {
  background: var(--field-bg);
  color: var(--text);
}

.header-search input {
  border-radius: 12px;
}

.account-link,
.theme-toggle,
.mobile-nav > summary {
  border-radius: 999px;
}

.account-link:hover,
.theme-toggle:hover {
  background: var(--surface-2);
}

.hero {
  min-height: min(760px, calc(100vh - 82px));
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr);
  gap: 64px;
  padding-top: 72px;
  padding-bottom: 58px;
}

.hero::before {
  inset: 0;
  border: 0;
  background: none;
}

.hero-copy { max-width: 760px; }

.eyebrow {
  color: var(--gold-soft);
  letter-spacing: .18em;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(4rem, 8.4vw, 7.6rem);
  line-height: .86;
  letter-spacing: -.055em;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.75;
}

.hero-search {
  overflow: visible;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(0,0,0,.16);
}

.hero-search input {
  height: 50px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
}

.hero-search button {
  min-width: 126px;
  border-radius: 12px;
  background: var(--gold);
  color: #fff;
  letter-spacing: .01em;
}

.hero-stats {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(0,0,0,.12);
}

.hero-stats strong { color: var(--gold-soft); }

.hero-mark {
  position: relative;
  display: block;
  min-height: 470px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 34px 90px rgba(0,0,0,.30);
}

.hero-mark > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 32%;
  transform: scale(1.02);
}

.hero-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 48%, rgba(17,18,20,.18) 67%, rgba(17,18,20,.80) 100%);
  pointer-events: none;
}

.hero-brand-plaque {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 22px;
  width: min(82%, 330px);
  transform: translateX(-50%);
  display: grid;
  gap: 3px;
  padding: 12px 18px;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 999px;
  background: rgba(15,16,18,.64);
  box-shadow: 0 12px 38px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
  text-align: center;
}

.hero-mark .hero-brand-plaque small {
  width: auto;
  max-width: none;
  color: #fff;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .17em;
  line-height: 1.2;
}

.hero-mark .hero-brand-plaque span {
  color: rgba(255,255,255,.72);
  font-family: var(--sans);
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.action-card,
.dog-card,
.search-result-card,
.panel,
.filter-panel,
.auth-card,
.kennel-hero,
.pedigree-index-card,
.mating-form {
  border-radius: 18px;
}

.action-card,
.dog-card,
.search-result-card,
.panel,
.filter-panel,
.auth-card {
  box-shadow: 0 14px 38px rgba(0,0,0,.08);
}

.action-card {
  border-color: var(--line-soft);
  background:
    linear-gradient(145deg, rgba(255,255,255,.025), transparent 55%),
    var(--surface);
}

.action-card:hover,
.dog-card:hover {
  border-color: var(--line);
  transform: translateY(-3px);
}

.action-icon,
.text-link,
.parent-grid span,
.pedigree-relationship {
  color: var(--gold-soft);
}

.btn { border-radius: 999px; }

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

.btn-outline {
  color: var(--gold-soft);
  border-color: var(--line);
}

.parent-grid > div,
.mobile-nav-search {
  background: var(--surface-2);
}

.profile-tabs {
  border-radius: 14px;
}

.dog-suggestions {
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface);
}

.dog-suggestion { background: var(--surface); }

.mobile-nav-panel {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}

html[data-theme="light"] .mobile-nav-panel {
  background: rgba(244,240,235,.98);
}

html[data-theme="light"] .hero-brand-plaque {
  background: rgba(37,31,35,.68);
}

html[data-theme="light"] .profile-bio p,
html[data-theme="light"] .hero-copy > p:not(.eyebrow) {
  color: var(--muted);
}

@media (max-width: 1080px) {
  .brand-mark {
    width: 56px;
    height: 48px;
    flex-basis: 56px;
  }

  .hero {
    gap: 36px;
    grid-template-columns: minmax(0, 1fr) minmax(300px, .76fr);
  }
}

@media (max-width: 760px) {
  .header-inner { min-height: 72px; }

  .brand {
    gap: 9px;
    margin: 0;
    text-align: left;
  }

  .brand-mark {
    width: 52px;
    height: 44px;
    flex-basis: 52px;
    border-radius: 10px;
  }

  .brand-small { font-size: .54rem; }
  .brand strong { font-size: .92rem; }

  .mobile-nav > summary {
    background: var(--surface);
    color: var(--text);
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 34px 16px 30px;
    gap: 28px;
  }

  .hero h1 {
    font-size: clamp(3.25rem, 16vw, 5.1rem);
  }

  .hero-mark {
    min-height: 330px;
    border-radius: 22px;
  }

  .hero-brand-plaque {
    bottom: 16px;
    width: min(86%, 320px);
  }

  .hero-stats,
  .hero-stats.three {
    border-radius: 14px;
  }

  .action-card,
  .dog-card,
  .search-result-card,
  .panel,
  .filter-panel,
  .auth-card,
  .kennel-hero,
  .pedigree-index-card,
  .mating-form {
    border-radius: 15px;
  }
}


/* ==========================================================================
   Professional editorial theme v14 — 2026-10-02
   Resilient branding: no raster dependency for primary identity.
   ========================================================================== */

:root {
  --bg: #f4f0e8;
  --surface: #fffdf8;
  --surface-2: #ece6da;
  --surface-3: #ded4c3;
  --field-bg: #fffdf8;
  --header-bg: rgba(247, 243, 235, .96);
  --text: #171715;
  --muted: #69645b;
  --gold: #8b6a2f;
  --gold-soft: #b08a45;
  --line: rgba(86, 67, 35, .25);
  --line-soft: rgba(35, 31, 25, .11);
  --success: #3f6f51;
  --danger: #9b4343;
  --accent-contrast: #fffdf8;
  --max: 1280px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101110;
  --surface: #171817;
  --surface-2: #20211f;
  --surface-3: #292a27;
  --field-bg: #171817;
  --header-bg: rgba(16, 17, 16, .96);
  --text: #f2eee6;
  --muted: #aaa398;
  --gold: #c7a25d;
  --gold-soft: #e3c781;
  --line: rgba(199, 162, 93, .28);
  --line-soft: rgba(242, 238, 230, .11);
  --accent-contrast: #12120f;
}

html { color-scheme: light; }
body {
  background:
    radial-gradient(circle at 85% 8%, rgba(139,106,47,.08), transparent 34rem),
    linear-gradient(180deg, rgba(255,255,255,.35), transparent 16rem),
    var(--bg);
  letter-spacing: -.005em;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(50,42,31,.018) 1px, transparent 1px);
  background-size: 100% 28px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

.site-header {
  background: var(--header-bg);
  border-bottom-color: var(--line-soft);
  box-shadow: 0 1px 0 rgba(255,255,255,.35), 0 8px 28px rgba(35,31,25,.04);
}
.header-inner {
  min-height: 82px;
}
.brand {
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  letter-spacing: 0;
}
.brand-seal {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  box-shadow: inset 0 0 0 4px var(--bg), 0 8px 24px rgba(20,20,18,.12);
}
.brand-seal span {
  display: block;
  font-family: var(--serif);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  transform: translateX(.04em);
}
.brand-copy { display: grid; gap: 2px; }
.brand-small {
  margin: 0;
  color: var(--muted);
  font-size: .57rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .18em;
}
.brand strong {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.main-nav {
  gap: 26px;
  color: var(--muted);
  font-size: .79rem;
  font-weight: 650;
}
.main-nav a { position: relative; }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: -9px;
  height: 1px;
  background: var(--gold);
  transition: right .18s ease;
}
.main-nav a:hover::after { right: 0; }

.header-search input,
.hero-search input,
input, select, textarea {
  border-radius: 8px;
}
.header-search input {
  background: var(--field-bg);
  color: var(--text);
  border-color: var(--line-soft);
}
.account-link, .theme-toggle {
  border-radius: 999px;
}

.hero {
  min-height: min(760px, calc(100vh - 82px));
  padding-top: 72px;
  padding-bottom: 58px;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, .88fr);
  gap: 68px;
}
.hero::before {
  inset: 10% 0 6% 48%;
  background:
    linear-gradient(90deg, transparent, rgba(139,106,47,.035)),
    repeating-linear-gradient(90deg, transparent 0 82px, rgba(51,43,32,.035) 82px 83px);
  border-left-color: var(--line-soft);
}
.eyebrow {
  color: var(--gold);
  font-size: .66rem;
  letter-spacing: .22em;
}
.hero h1 {
  max-width: 900px;
  color: var(--text);
  font-size: clamp(4rem, 8vw, 7.4rem);
  line-height: .86;
  letter-spacing: -.055em;
}
.hero-copy > p:not(.eyebrow) {
  max-width: 690px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.75;
}
.hero-search {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(33,29,22,.08);
}
.hero-search input {
  background: var(--surface);
  color: var(--text);
  height: 58px;
  padding-inline: 18px;
}
.hero-search button {
  min-width: 138px;
  background: var(--text);
  color: var(--bg);
  letter-spacing: .02em;
}
.hero-search button:hover { opacity: .9; }

.hero-stats {
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255,255,255,.24);
  backdrop-filter: blur(8px);
}
.hero-stats article { padding: 18px 20px; }
.hero-stats strong {
  color: var(--text);
  font-size: 1.7rem;
  font-weight: 700;
}
.hero-stats span {
  color: var(--muted);
  font-size: .64rem;
  font-weight: 750;
}

.hero-mark {
  min-height: 510px;
  padding: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 38%, rgba(199,162,93,.13), transparent 32%),
    linear-gradient(145deg, #1b1c1a, #0c0d0c);
  box-shadow: 0 30px 70px rgba(25,22,17,.18);
}
html[data-theme="dark"] .hero-mark {
  background:
    radial-gradient(circle at 50% 38%, rgba(199,162,93,.12), transparent 32%),
    linear-gradient(145deg, #20211e, #0a0b0a);
}
.hero-mark::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(227,199,129,.28);
  border-radius: 20px;
  pointer-events: none;
}
.hero-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: none;
  pointer-events: none;
}
.hero-seal {
  position: relative;
  z-index: 2;
  width: min(82%, 330px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 36px;
  border: 1px solid rgba(227,199,129,.62);
  border-radius: 50%;
  color: #f4ead6;
  text-align: center;
  box-shadow:
    inset 0 0 0 8px #151613,
    inset 0 0 0 9px rgba(227,199,129,.28);
}
.hero-seal-kicker {
  font-family: var(--sans) !important;
  font-size: .52rem !important;
  font-weight: 800;
  letter-spacing: .24em !important;
  color: #cdb681 !important;
}
.hero-seal strong {
  font-family: var(--serif);
  font-size: clamp(4rem, 7vw, 6.5rem);
  line-height: .82;
  letter-spacing: -.07em;
  font-weight: 600;
}
.hero-seal-rule {
  width: 58px !important;
  height: 1px;
  background: #cdb681;
  display: block;
}
.hero-seal small {
  color: #f4ead6;
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .18em;
}
.hero-seal em {
  color: #a99a7c;
  font-family: var(--sans);
  font-size: .47rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .14em;
}
.hero-brand-plaque {
  position: absolute;
  z-index: 3;
  left: 34px;
  right: 34px;
  bottom: 28px;
  width: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(227,199,129,.22);
  background: transparent;
}
.hero-mark .hero-brand-plaque small,
.hero-mark .hero-brand-plaque span {
  color: #cdb681;
  font-family: var(--sans);
  font-size: .52rem;
  font-weight: 750;
  letter-spacing: .12em;
}

.page-shell { padding-top: 64px; padding-bottom: 64px; }
.section-heading {
  margin-bottom: 24px;
}
.section-heading h2, .panel-heading h2 {
  font-weight: 650;
  letter-spacing: -.025em;
}
.home-actions {
  border-top: 1px solid var(--line-soft);
}

.action-grid { gap: 16px; }
.action-card {
  min-height: 176px;
  padding: 26px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(36,30,21,.045);
}
.action-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(36,30,21,.08);
}
.action-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  font-size: 1.08rem;
}
.action-card strong { font-weight: 650; }

.dog-card-grid { gap: 18px; }
.dog-card {
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(36,30,21,.05);
}
.dog-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(36,30,21,.09);
}
.dog-card-media { background: var(--surface-2); }
.dog-card-body { padding: 17px 18px 20px; }
.dog-card-body h3 {
  color: var(--text);
  font-weight: 650;
}
.media-placeholder {
  color: var(--gold);
  background: linear-gradient(145deg, var(--surface-2), var(--surface-3));
}

.panel, .analysis-card, .kennel-card, .stat-card, .auth-card {
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(36,30,21,.045);
}

.site-footer {
  margin-top: 90px;
  padding-top: 38px;
  border-top-color: var(--line-soft);
}
.site-footer strong { font-weight: 650; }

@media (max-width: 1080px) {
  .header-inner { gap: 18px; }
  .brand { min-width: 180px; }
  .hero { grid-template-columns: 1fr .72fr; gap: 38px; }
  .hero-mark { min-height: 430px; }
}

@media (max-width: 760px) {
  .header-inner {
    min-height: 70px;
    grid-template-columns: minmax(0,1fr) auto;
  }
  .brand {
    min-width: 0;
    margin: 0;
    justify-self: start;
  }
  .brand-seal { width: 42px; height: 42px; flex-basis: 42px; }
  .brand-small { font-size: .51rem; }
  .brand strong { font-size: 1rem; }
  .hero {
    min-height: auto;
    padding: 48px 16px 30px;
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .hero h1 {
    font-size: clamp(3.25rem, 16vw, 5.25rem);
    line-height: .88;
  }
  .hero-copy > p:not(.eyebrow) {
    margin: 18px 0;
    font-size: .95rem;
    line-height: 1.65;
  }
  .hero-search { grid-template-columns: 1fr; }
  .hero-search input { height: 54px; }
  .hero-search button { min-height: 50px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-mark {
    min-height: 390px;
    padding: 26px;
    border-radius: 22px;
  }
  .hero-mark::before { inset: 12px; border-radius: 16px; }
  .hero-seal {
    width: min(84%, 280px);
    padding: 30px;
  }
  .hero-seal strong { font-size: 4.6rem; }
  .hero-brand-plaque {
    left: 24px; right: 24px; bottom: 22px;
    display: grid;
    justify-items: center;
    text-align: center;
  }
  .action-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .action-card { min-height: 148px; padding: 18px; }
  .action-icon { margin-bottom: 20px; }
  .page-shell { padding: 44px 16px; }
}


/* Supplied Cane Corso logo integration v15 */
.brand-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(199,162,93,.38);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(20,20,18,.16);
}
.hero-logo-art {
  position: relative;
  z-index: 2;
  width: min(84%, 350px);
  height: auto;
  border-radius: 26px;
  filter: drop-shadow(0 22px 44px rgba(0,0,0,.32));
}
.hero-seal,
.hero-seal-kicker,
.hero-seal-rule {
  display: none !important;
}
@media (max-width: 760px) {
  .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 12px;
  }
  .hero-logo-art {
    width: min(86%, 292px);
    border-radius: 22px;
  }
}


/* Clean logo presentation v16 */
.brand-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 0 !important;
  box-shadow: none;
  background: transparent;
}
.hero-logo-art {
  position: relative;
  z-index: 2;
  width: min(92%, 430px);
  height: auto;
  object-fit: contain;
  border: 0;
  border-radius: 0 !important;
  box-shadow: none;
  filter: none;
}
.hero-mark {
  border-radius: 0 !important;
}
.hero-brand-plaque {
  display: none !important;
}
@media (max-width: 760px) {
  .brand-mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 0 !important;
  }
  .hero-logo-art {
    width: min(94%, 360px);
    border-radius: 0 !important;
  }
}


/* Final clean logo presentation v17 */
.brand-mark {
  width: 56px !important;
  height: 56px !important;
  flex: 0 0 56px !important;
  object-fit: contain !important;
  object-position: center !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  background: transparent !important;
  image-rendering: auto;
}
.hero-mark {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}
.hero-mark::before,
.hero-mark::after,
.hero-brand-plaque {
  display: none !important;
}
.hero-logo-art {
  position: relative !important;
  inset: auto !important;
  width: min(100%, 360px) !important;
  height: auto !important;
  max-width: 360px !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  object-position: center !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  image-rendering: auto;
}
@media (max-width: 760px) {
  .brand-mark {
    width: 48px !important;
    height: 48px !important;
    flex-basis: 48px !important;
  }
  .hero-logo-art {
    width: min(88vw, 320px) !important;
    max-width: 320px !important;
  }
}


/* Legacy Bellissimo-style dark gold theme restoration v18 */
:root,
html[data-theme="light"],
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070908;
  --surface: #0e1110;
  --surface-2: #151816;
  --surface-3: #1b1f1c;
  --field-bg: #090b0a;
  --header-bg: rgba(7, 9, 8, .95);
  --text: #f0ede3;
  --muted: #9e9a8d;
  --gold: #d2ad57;
  --gold-soft: #efd58d;
  --line: rgba(210, 173, 87, .22);
  --line-soft: rgba(255, 255, 255, .08);
  --success: #45b86b;
  --danger: #d55b63;
  --accent-contrast: #090a09;
  --max: 1240px;
  --serif: Georgia, "Times New Roman", serif;
}

html { color-scheme: dark; }
body,
html[data-theme="light"] body,
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 78% 18%, rgba(210,173,87,.05), transparent 28rem),
    var(--bg);
  color: var(--text);
  letter-spacing: 0;
}
body::before { display: none !important; }

.site-header {
  background: rgba(7,9,8,.95);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: none;
}
.header-inner { min-height: 76px; }

.brand {
  min-width: 150px;
  font-family: var(--serif);
  letter-spacing: .13em;
  line-height: 1;
}
.brand-copy { gap: 0; }
.brand-small {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: .62rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: .13em;
}
.brand strong {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .13em;
}

.main-nav {
  gap: 24px;
  color: #d7d2c5;
  font-size: .83rem;
  font-weight: 400;
}
.main-nav a::after { display: none; }

.header-search input,
.mobile-nav-search,
.filter-panel input,
.filter-panel select,
.mating-form input,
.mating-form select,
.auth-card input,
input,
select,
textarea {
  border-radius: 0;
}
.header-search input {
  background: #111412;
  color: var(--text);
}
.account-link,
.theme-toggle,
.mobile-nav > summary,
.btn {
  border-radius: 0;
}

.hero {
  min-height: min(720px, calc(100vh - 76px));
  padding-top: 82px;
  padding-bottom: 46px;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  gap: 56px;
}
.hero::before {
  inset: 14% 0 8% 42%;
  background:
    linear-gradient(120deg, transparent 25%, rgba(210,173,87,.06)),
    repeating-linear-gradient(90deg, transparent 0 72px, rgba(255,255,255,.025) 72px 73px);
  border-left: 1px solid var(--line-soft);
}
.eyebrow {
  color: var(--gold);
  font-size: .7rem;
  letter-spacing: .19em;
}
.hero h1 {
  font-size: clamp(3.6rem, 8.5vw, 7.5rem);
  line-height: .83;
  letter-spacing: -.045em;
}
.hero-copy > p:not(.eyebrow) {
  max-width: 670px;
  color: #c2bdb0;
  font-size: 1rem;
  line-height: 1.5;
}
.hero-search {
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
.hero-search input {
  height: 52px;
  background: #fff;
  color: #141613;
  border-radius: 0;
}
.hero-search button {
  min-width: 128px;
  background: var(--gold);
  color: #080a08;
  border-radius: 0;
}
.hero-stats {
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}
.hero-stats article { padding: 16px 18px; }
.hero-stats strong {
  color: var(--gold-soft);
  font-size: 1.65rem;
  font-weight: 600;
}
.hero-stats span {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 400;
}

.action-grid { gap: 12px; }
.action-card {
  min-height: 150px;
  padding: 24px;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}
.action-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: none;
}
.action-icon {
  width: auto;
  height: auto;
  display: block;
  margin-bottom: 24px;
  border: 0;
  border-radius: 0;
  color: var(--gold);
  font-size: 1.45rem;
}

.dog-card-grid { gap: 12px; }
.dog-card,
.search-result-card,
.panel,
.analysis-card,
.kennel-card,
.stat-card,
.auth-card,
.filter-panel,
.kennel-hero,
.pedigree-index-card,
.mating-form,
.profile-tabs,
.dog-suggestions {
  border-radius: 0;
  box-shadow: none;
}
.dog-card {
  background: var(--surface);
}
.dog-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: none;
}
.dog-card-body { padding: 14px 15px 17px; }
.dog-card-body h3 {
  color: var(--gold-soft);
  font-weight: 500;
}
.media-placeholder {
  color: rgba(210,173,87,.34);
  background: radial-gradient(circle, rgba(210,173,87,.08), transparent 60%), #101310;
}
.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #090a09;
}
.btn-outline,
.text-link { color: var(--gold-soft); }

.site-footer {
  margin-top: 80px;
  padding-top: 32px;
  border-top-color: var(--line-soft);
}
.site-footer strong { font-weight: 600; }

.mobile-nav-panel {
  background: rgba(7, 9, 8, .99);
}
html[data-theme="light"] .mobile-nav-panel,
html[data-theme="dark"] .mobile-nav-panel {
  background: rgba(7, 9, 8, .99);
}

@media (max-width: 760px) {
  .header-inner { min-height: 70px; }
  .brand { min-width: 0; }
  .hero {
    min-height: auto;
    padding: 48px 16px 30px;
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .hero h1 {
    font-size: clamp(3.25rem, 16vw, 5.25rem);
    line-height: .88;
  }
  .action-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .action-card { min-height: 148px; padding: 18px; }
}


/* Mobile home link polish v19 */
@media (max-width: 760px) {
  .section-heading > .text-link {
    flex: 0 0 auto;
    white-space: nowrap;
    align-self: end;
  }
}


/* Original scaffold visual theme restoration v23 */
:root,
html[data-theme="light"],
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090a09;
  --surface: #111312;
  --surface-2: #171916;
  --surface-3: #1d201c;
  --field-bg: #111312;
  --header-bg: #090a09;
  --text: #f1eee4;
  --muted: #aaa595;
  --gold: #c7a85b;
  --gold-soft: #dfc77d;
  --line: rgba(199, 168, 91, 0.25);
  --line-soft: rgba(199, 168, 91, 0.14);
  --success: #45b86b;
  --danger: #d55b63;
  --accent-contrast: #0b0c0b;
  --max: 1180px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html { color-scheme: dark; }
body,
html[data-theme="light"] body,
html[data-theme="dark"] body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% 42%, rgba(199,168,91,.12), transparent 38rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  letter-spacing: 0;
}
body::before { display: none !important; }

.site-header {
  position: relative;
  top: auto;
  z-index: 50;
  max-width: var(--max);
  min-height: 72px;
  margin: 0 auto;
  background: transparent;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: none;
}
.header-inner {
  max-width: none;
  min-height: 72px;
  margin: 0;
  padding: 0 24px;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
}
.brand {
  min-width: 172px;
  gap: 10px;
  font-family: var(--serif);
  letter-spacing: .12em;
  line-height: 1;
}
.brand-mark {
  width: 46px !important;
  height: 46px !important;
  flex: 0 0 46px !important;
}
.brand-copy { display: grid; gap: 2px; }
.brand-small {
  margin: 0;
  color: var(--text);
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.brand strong {
  color: var(--gold);
  font-family: var(--serif);
  font-size: .94rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.main-nav {
  justify-content: center;
  gap: 24px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 400;
}
.main-nav a::after { display: none !important; }
.main-nav a:hover,
.footer-links a:hover { color: var(--gold); }

.header-search input {
  width: 235px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 0 !important;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
}
.account-link {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 0 !important;
  padding: 0 13px;
  background: transparent;
  color: var(--gold);
  font-size: .78rem;
}

.hero {
  min-height: 560px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 24px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 0;
  overflow: visible;
  background:
    radial-gradient(circle at 78% 42%, rgba(199,168,91,.12), transparent 38%);
}
.hero::before { display: none !important; }
.hero-copy {
  max-width: 760px;
  position: relative;
  z-index: 1;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .78rem;
  font-weight: 700;
}
.hero h1 {
  margin: 12px 0 20px;
  max-width: 820px;
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 5.6rem);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.03em;
}
.hero-copy > p:not(.eyebrow) {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}
.hero-mark { display: none !important; }

.hero-search {
  display: flex;
  grid-template-columns: none;
  max-width: 760px;
  margin-top: 28px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 0 !important;
  background: #fff;
  box-shadow: none;
}
.hero-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: auto;
  min-height: 52px;
  border: 0;
  border-radius: 0 !important;
  background: #fff;
  color: #151515;
  padding: 14px 18px;
  font-size: 1rem;
}
.hero-search button {
  min-width: 128px;
  border: 0;
  border-radius: 0 !important;
  background: var(--gold);
  color: #0b0c0b;
  padding: 0 24px;
  font-weight: 800;
}

.hero-stats,
.hero-stats.three {
  max-width: 760px;
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: visible;
  border: 0;
  border-radius: 0 !important;
  background: transparent;
  backdrop-filter: none;
}
.hero-stats article {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-right: 0;
  background: var(--surface);
}
.hero-stats article:last-child { border-right: 1px solid var(--line); }
.hero-stats strong {
  display: block;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
}
.hero-stats span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.page-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 24px;
}
.page-heading h1,
.dog-profile h1,
.pedigree-toolbar h1,
.kennel-hero h1,
.dashboard-hero h1,
.auth-card h1 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -.03em;
}
.section-heading,
.panel-heading { margin-bottom: 18px; }
.section-heading h2,
.panel-heading h2 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0;
}

.home-actions {
  border-top: 0;
}
.action-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.action-card {
  min-height: 150px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 0 !important;
  background: var(--surface);
  box-shadow: none !important;
}
.action-card:hover {
  border-color: var(--gold);
  transform: none;
  box-shadow: none !important;
}
.action-icon {
  width: auto;
  height: auto;
  margin-bottom: 24px;
  display: block;
  border: 0;
  border-radius: 0;
  color: var(--gold);
  font-size: 1.35rem;
}
.action-card strong {
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 500;
}
.action-card small { color: var(--muted); }

.dog-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.dog-card,
.search-result-card,
.panel,
.analysis-card,
.kennel-card,
.stat-card,
.auth-card,
.filter-panel,
.kennel-hero,
.pedigree-index-card,
.mating-form,
.profile-tabs,
.dog-suggestions,
.dashboard-panel,
.dashboard-hero {
  border-radius: 0 !important;
  box-shadow: none !important;
}
.dog-card {
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.dog-card:hover {
  border-color: var(--gold);
  transform: none;
}
.dog-card-media { background: var(--surface-2); }
.dog-card-body { padding: 14px 15px 17px; }
.dog-card-body h3 {
  color: var(--gold);
  font-family: var(--serif);
  font-weight: 500;
}
.media-placeholder {
  color: rgba(199,168,91,.42);
  background: var(--surface-2);
}

.filter-panel,
.mating-form,
.auth-card,
.panel,
.analysis-card,
.kennel-card,
.pedigree-index-card,
.dashboard-panel {
  border: 1px solid var(--line);
  background: var(--surface);
}
input,
select,
textarea,
.btn,
.mobile-nav > summary,
.mobile-nav-search input,
.mobile-nav-search button {
  border-radius: 0 !important;
}
input,
select,
textarea {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}
.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #0b0c0b;
}
.btn-outline,
.text-link { color: var(--gold); }

.search-result-card {
  border: 1px solid var(--line);
  background: var(--surface);
}
.search-result-card:hover { border-color: var(--gold); }
.search-result-main h2,
.kennel-card h2,
.pedigree-index-card h2 {
  font-family: var(--serif);
  font-weight: 500;
}
.registration-line { color: var(--gold) !important; }
.sex-mark { color: var(--gold); }

.profile-photo {
  border: 1px solid var(--line);
  background: var(--surface);
}
.parent-grid > div {
  border: 1px solid var(--line);
  background: var(--surface);
}
.profile-tabs { background: var(--surface); border-color: var(--line); }
.profile-tabs a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.pedigree-node,
.analysis-card,
.pairing-summary article {
  border-color: var(--line);
  background: var(--surface);
}
.pedigree-node:hover { border-color: var(--gold); }
.pedigree-node.repeated {
  border-color: var(--gold);
  box-shadow: inset 3px 0 0 var(--gold) !important;
}
.generation-switch a {
  border-color: var(--line);
  color: var(--muted);
}
.generation-switch a.active,
.generation-switch a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.dashboard-sidebar {
  background: var(--surface);
  border-right-color: var(--line);
}
.dashboard-sidebar nav > a:hover,
.dashboard-sidebar nav > a.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: rgba(199,168,91,.07);
}
.dashboard-hero {
  background: var(--surface);
}

.mobile-nav-panel,
html[data-theme="light"] .mobile-nav-panel,
html[data-theme="dark"] .mobile-nav-panel {
  background: #090a09;
  border-color: var(--line);
}
.mobile-nav-panel a,
.mobile-account-actions a {
  border-color: var(--line);
}

.site-footer {
  max-width: var(--max);
  margin: 80px auto 0;
  padding: 32px 24px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}
.site-footer strong {
  color: var(--text);
  font-family: var(--serif);
  font-weight: 500;
}

@media (max-width: 1080px) {
  .header-inner { grid-template-columns: auto 1fr; }
  .header-actions { display: none; }
  .main-nav { justify-content: flex-end; }
  .dog-card-grid,
  .action-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .site-header {
    min-height: auto;
    max-width: none;
  }
  .header-inner {
    min-height: 68px;
    padding: 10px 16px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  .brand { min-width: 0; gap: 8px; }
  .brand-mark {
    width: 42px !important;
    height: 42px !important;
    flex-basis: 42px !important;
  }
  .brand-small { font-size: .5rem; }
  .brand strong { font-size: .84rem; }
  .main-nav,
  .header-actions { display: none; }
  .mobile-nav { display: block; }

  .hero {
    min-height: 500px;
    padding: 52px 16px;
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: clamp(2.7rem, 13vw, 4.7rem);
    line-height: .98;
  }
  .hero-copy > p:not(.eyebrow) {
    font-size: 1rem;
    line-height: 1.5;
  }
  .hero-search {
    flex-direction: column;
    background: transparent;
    border: 0;
    gap: 8px;
  }
  .hero-search input,
  .hero-search button { min-height: 50px; }
  .hero-stats,
  .hero-stats.three {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .hero-stats article {
    border: 1px solid var(--line);
  }

  .page-shell { padding: 48px 16px; }
  .action-grid,
  .dog-card-grid { grid-template-columns: 1fr; }
  .action-card { min-height: 132px; }
}


/* Unified bright editorial UX/UI v26 */
:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f0e8;
  --surface: #fffdf8;
  --surface-2: #ece6da;
  --surface-3: #e3dacb;
  --field-bg: #fffdf8;
  --header-bg: rgba(244,240,232,.94);
  --text: #171715;
  --muted: #69645b;
  --gold: #8b6a2f;
  --gold-soft: #a98443;
  --line: rgba(86,67,35,.22);
  --line-soft: rgba(86,67,35,.12);
  --success: #2f7a4a;
  --danger: #a93f47;
  --accent-contrast: #fffdf8;
  --max: 1240px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101110;
  --surface: #171817;
  --surface-2: #20211f;
  --surface-3: #292a27;
  --field-bg: #171817;
  --header-bg: rgba(16,17,16,.95);
  --text: #f2eee6;
  --muted: #aaa398;
  --gold: #c7a25d;
  --gold-soft: #e3c781;
  --line: rgba(199,162,93,.28);
  --line-soft: rgba(242,238,230,.11);
  --success: #53a66c;
  --danger: #dc6b72;
  --accent-contrast: #12120f;
}

html { color-scheme: light; scroll-behavior: smooth; }
body,
html[data-theme="light"] body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 84% 6%, rgba(139,106,47,.10), transparent 31rem),
    linear-gradient(180deg, rgba(255,255,255,.36), transparent 17rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  letter-spacing: -.004em;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 84% 6%, rgba(199,162,93,.08), transparent 31rem),
    var(--bg);
}
body::before { display: none !important; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold) 72%, transparent);
  outline-offset: 3px;
}
a, button, input, select, textarea, summary {
  -webkit-tap-highlight-color: transparent;
}
button, .btn, .account-link, .mobile-nav > summary,
.mobile-nav-search button {
  min-height: 44px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  width: 100%;
  max-width: none;
  min-height: 76px;
  margin: 0;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 1px 0 rgba(255,255,255,.45), 0 10px 34px rgba(49,39,22,.055);
  backdrop-filter: blur(16px);
}
.header-inner {
  width: min(100%, var(--max));
  max-width: var(--max);
  min-height: 76px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 26px;
}
.brand {
  min-width: 190px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  letter-spacing: 0;
  line-height: 1;
}
.brand-mark {
  width: 50px !important;
  height: 50px !important;
  flex: 0 0 50px !important;
  object-fit: contain !important;
  object-position: center !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  background: transparent !important;
}
.brand-copy {
  display: grid;
  gap: 2px;
}
.brand-small {
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .56rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.brand strong {
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.015em;
  text-transform: none;
}

.main-nav {
  justify-content: center;
  gap: 24px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 650;
}
.main-nav a {
  position: relative;
  padding: 8px 0;
}
.main-nav a::after {
  content: "";
  display: block !important;
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 2px;
  height: 1px;
  background: var(--gold);
  transition: right .18s ease;
}
.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--text);
}
.main-nav a:hover::after,
.main-nav a:focus-visible::after { right: 0; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.header-search {
  position: relative;
}
.header-search input {
  width: 220px;
  height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 10px !important;
  background: var(--surface);
  color: var(--text);
  padding: 0 13px;
  outline: 0;
}
.header-search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(139,106,47,.10);
}
.account-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px !important;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}
.account-link:hover { border-color: var(--gold); color: var(--gold); }

.hero {
  min-height: min(690px, calc(100vh - 76px));
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 24px 54px;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  align-items: center;
  gap: 0;
  overflow: visible;
  background: transparent;
}
.hero::before {
  content: "";
  display: block !important;
  position: absolute;
  inset: 10% 0 8% 52%;
  background:
    linear-gradient(90deg, transparent, rgba(139,106,47,.035)),
    repeating-linear-gradient(90deg, transparent 0 82px, rgba(51,43,32,.03) 82px 83px);
  border-left: 1px solid var(--line-soft);
  pointer-events: none;
}
.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 860px;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .21em;
  font-size: .67rem;
  font-weight: 800;
}
.hero h1 {
  max-width: 900px;
  margin: 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: clamp(3.5rem, 7.7vw, 7rem);
  font-weight: 600;
  line-height: .89;
  letter-spacing: -.052em;
}
.hero-copy > p:not(.eyebrow) {
  max-width: 700px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.75;
}
.hero-mark { display: none !important; }

.hero-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  max-width: 780px;
  margin-top: 30px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 12px !important;
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(58,44,23,.08);
}
.hero-search input {
  min-width: 0;
  min-height: 56px;
  height: 56px;
  border: 0;
  border-radius: 12px 0 0 12px !important;
  background: var(--surface);
  color: var(--text);
  padding: 0 17px;
  font-size: .98rem;
  outline: 0;
}
.hero-search button {
  min-width: 136px;
  min-height: 56px;
  border: 0;
  border-radius: 0 11px 11px 0 !important;
  background: var(--text);
  color: var(--accent-contrast);
  padding: 0 22px;
  font-weight: 800;
}
.hero-search button:hover { opacity: .92; }

.hero-stats,
.hero-stats.three {
  max-width: 780px;
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 12px !important;
  background: rgba(255,253,248,.60);
  backdrop-filter: blur(8px);
}
html[data-theme="dark"] .hero-stats { background: rgba(23,24,23,.74); }
.hero-stats article {
  min-width: 0;
  padding: 16px 18px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  background: transparent;
}
.hero-stats article:last-child { border-right: 0; }
.hero-stats strong {
  display: block;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.68rem;
  font-weight: 700;
}
.hero-stats span {
  color: var(--muted);
  font-size: .65rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.page-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 58px 24px;
}
.page-heading {
  max-width: 900px;
  margin-bottom: 30px;
}
.page-heading h1,
.dog-profile h1,
.pedigree-toolbar h1,
.kennel-hero h1,
.dashboard-hero h1,
.auth-card h1 {
  color: var(--text);
  font-family: var(--serif);
  font-weight: 650;
  letter-spacing: -.035em;
}
.section-heading,
.panel-heading {
  align-items: end;
  margin-bottom: 22px;
}
.section-heading h2,
.panel-heading h2 {
  color: var(--text);
  font-family: var(--serif);
  font-weight: 650;
  letter-spacing: -.025em;
}
.home-actions {
  border-top: 1px solid var(--line-soft);
}

.action-grid {
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 15px;
}
.action-card {
  min-height: 168px;
  padding: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 14px !important;
  background: var(--surface);
  box-shadow: 0 9px 28px rgba(57,45,26,.045) !important;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.action-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(57,45,26,.08) !important;
}
.action-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  font-size: 1.05rem;
}
.action-card strong {
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 650;
}
.action-card small {
  color: var(--muted);
  margin-top: 4px;
}

.dog-card-grid {
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 16px;
}
.dog-card {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 14px !important;
  background: var(--surface);
  box-shadow: 0 9px 28px rgba(57,45,26,.045) !important;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.dog-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(57,45,26,.08) !important;
}
.dog-card-media {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}
.dog-card-media img {
  transition: transform .22s ease;
}
.dog-card:hover .dog-card-media img { transform: scale(1.025); }
.dog-card-body { padding: 16px 17px 18px; }
.dog-card-body h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-family: var(--serif);
  font-weight: 650;
}
.dog-card-body p { color: var(--muted); }

.search-result-card,
.panel,
.analysis-card,
.kennel-card,
.stat-card,
.auth-card,
.filter-panel,
.kennel-hero,
.pedigree-index-card,
.mating-form,
.profile-tabs,
.dashboard-panel,
.dashboard-hero,
.pairing-summary article {
  border: 1px solid var(--line-soft);
  border-radius: 14px !important;
  background: var(--surface);
  box-shadow: 0 9px 28px rgba(57,45,26,.04) !important;
}
.search-result-card {
  min-height: 118px;
  padding: 9px 16px 9px 9px;
  transition: border-color .18s ease, transform .18s ease;
}
.search-result-card:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}
.search-result-main h2 {
  color: var(--text);
  font-family: var(--serif);
  font-weight: 650;
}
.search-result-main p { color: var(--muted); }
.registration-line,
.sex-mark { color: var(--gold) !important; }

.filter-panel {
  gap: 12px;
  padding: 16px;
}
.filter-panel input,
.filter-panel select,
.mating-form input,
.mating-form select,
.auth-card input,
input,
select,
textarea {
  min-height: 44px;
  border: 1px solid var(--line-soft);
  border-radius: 9px !important;
  background: var(--field-bg);
  color: var(--text);
  padding: 0 12px;
  outline: 0;
}
textarea { padding-top: 10px; padding-bottom: 10px; }

/* Keep native form controls legible in both themes, including Windows/Chromium menus. */
select,
select option,
select optgroup {
  background-color: var(--field-bg);
  color: var(--text);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: .9;
}
input[type="file"] {
  padding: 6px 8px;
  color: var(--text);
}
input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 10px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  border-color: var(--gold);
  background: var(--surface-3);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(139,106,47,.10);
}
.btn {
  min-height: 44px;
  border-radius: 9px !important;
}
.btn-gold {
  background: var(--text);
  border-color: var(--text);
  color: var(--accent-contrast);
}
.btn-gold:hover { opacity: .92; }
.btn-outline {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.text-link {
  color: var(--gold);
  text-underline-offset: 4px;
}

.profile-photo {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(57,45,26,.06);
}
.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-intro {
  padding: 18px 2px 18px;
}
.profile-facts dt,
.compact-facts dt { color: var(--muted); }
.parent-grid > div {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-2));
}
.parent-grid span { color: var(--gold); }
.profile-tabs {
  overflow-x: auto;
  scrollbar-width: thin;
}
.profile-tabs a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.profile-tabs a:hover,
.profile-tabs a:focus-visible {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.pedigree-scroll {
  scrollbar-color: var(--gold) var(--surface-2);
}
.pedigree-node {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(57,45,26,.035);
}
.pedigree-node:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}
.pedigree-node.repeated {
  border-color: var(--gold);
  box-shadow: inset 3px 0 0 var(--gold), 0 6px 20px rgba(57,45,26,.04) !important;
}
.generation-switch a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
}
.generation-switch a.active,
.generation-switch a:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(139,106,47,.055);
}

.data-table th {
  color: var(--gold);
}
.data-table th,
.data-table td {
  border-bottom-color: var(--line-soft);
}
.table-scroll {
  border-radius: 10px;
  scrollbar-width: thin;
}

.dashboard-shell {
  max-width: 1500px;
}
.dashboard-sidebar {
  background: color-mix(in srgb, var(--surface) 94%, var(--surface-2));
  border-right: 1px solid var(--line-soft);
}
.dashboard-sidebar nav > a,
.sidebar-logout {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-radius: 8px;
}
.dashboard-sidebar nav > a:hover,
.dashboard-sidebar nav > a.active {
  color: var(--text);
  border-left-color: var(--gold);
  background: rgba(139,106,47,.07);
}
.dashboard-hero {
  background:
    radial-gradient(circle at 78% 50%, rgba(139,106,47,.10), transparent 35%),
    var(--surface);
}

.auth-shell {
  padding: 48px 20px;
}
.auth-card {
  width: min(460px,100%);
  padding: 32px;
}

.mobile-nav > summary {
  border: 1px solid var(--line);
  border-radius: 9px !important;
  background: var(--surface);
  color: var(--text);
}
.mobile-nav-panel,
html[data-theme="light"] .mobile-nav-panel {
  background: rgba(255,253,248,.985);
  border: 1px solid var(--line-soft);
  box-shadow: 0 18px 42px rgba(44,35,20,.13);
}
html[data-theme="dark"] .mobile-nav-panel {
  background: rgba(23,24,23,.99);
}
.mobile-nav-panel a,
.mobile-account-actions a {
  min-height: 46px;
  border-color: var(--line-soft);
  color: var(--text);
}

.dog-suggestions {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px !important;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(43,33,18,.14) !important;
}
.dog-suggestion {
  min-height: 54px;
  padding: 10px 12px;
  border-bottom-color: var(--line-soft);
}
.dog-suggestion:hover,
.dog-suggestion:focus-visible {
  background: rgba(139,106,47,.07);
}

.flash-stack {
  max-width: var(--max);
  margin: 18px auto 0;
  padding: 0 24px;
}
.flash {
  border-radius: 10px;
}

.site-footer {
  max-width: var(--max);
  margin: 84px auto 0;
  padding: 34px 24px 48px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
}
.site-footer strong {
  color: var(--text);
  font-family: var(--serif);
  font-weight: 650;
}

@media (max-width: 1120px) {
  .header-inner { gap: 16px; }
  .brand { min-width: 172px; }
  .header-search input { width: 190px; }
  .main-nav { gap: 17px; }
}

@media (max-width: 980px) {
  .header-inner {
    grid-template-columns: minmax(0,1fr) auto;
  }
  .main-nav,
  .header-actions { display: none; }
  .mobile-nav { display: block; }
  .dog-card-grid,
  .action-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-panel {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 760px) {
  .site-header { min-height: 68px; }
  .header-inner {
    min-height: 68px;
    padding: 8px 14px;
    grid-template-columns: minmax(0,1fr) auto;
  }
  .brand {
    min-width: 0;
    gap: 8px;
  }
  .brand-mark {
    width: 44px !important;
    height: 44px !important;
    flex-basis: 44px !important;
  }
  .brand-small { font-size: .49rem; }
  .brand strong { font-size: .98rem; }
  .mobile-nav > summary { min-width: 84px; }

  .hero {
    min-height: auto;
    padding: 46px 16px 32px;
  }
  .hero::before {
    inset: 8% 0 12% 72%;
  }
  .hero h1 {
    font-size: clamp(3rem, 15vw, 4.85rem);
    line-height: .91;
  }
  .hero-copy > p:not(.eyebrow) {
    margin-top: 18px;
    font-size: .96rem;
    line-height: 1.65;
  }
  .hero-search {
    grid-template-columns: 1fr;
    overflow: hidden;
  }
  .hero-search input {
    border-radius: 11px 11px 0 0 !important;
  }
  .hero-search button {
    border-radius: 0 0 11px 11px !important;
  }
  .hero-stats,
  .hero-stats.three {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
  .hero-stats article {
    padding: 13px 10px;
  }
  .hero-stats strong { font-size: 1.4rem; }
  .hero-stats span {
    font-size: .56rem;
    letter-spacing: .05em;
  }

  .page-shell { padding: 44px 16px; }
  .section-heading {
    align-items: flex-end;
    gap: 12px;
  }
  .section-heading > .text-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .dog-card-grid,
  .action-grid { grid-template-columns: 1fr; }
  .action-card { min-height: 136px; }
  .dog-card { border-radius: 12px !important; }
  .dog-card-media { aspect-ratio: 1.22; }

  .filter-panel {
    grid-template-columns: 1fr;
    padding: 14px;
  }
  .search-result-card {
    grid-template-columns: 84px minmax(0,1fr);
    gap: 12px;
    padding: 8px;
  }
  .search-result-media {
    width: 84px;
    height: 84px;
  }

  .dog-profile-hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .profile-photo {
    min-height: 320px;
  }
  .profile-section-grid,
  .parent-grid,
  .analysis-grid,
  .pairing-summary {
    grid-template-columns: 1fr;
  }
  .profile-tabs {
    margin-inline: 0;
  }

  .pedigree-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .pedigree-column { width: 190px; }

  .dashboard-shell {
    display: block;
    min-height: auto;
  }
  .dashboard-sidebar { display: none; }
  .dashboard-main {
    padding: 16px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-wide { grid-column: auto; }

  .auth-shell {
    place-items: start center;
    padding-top: 48px;
    padding-bottom: 32px;
  }
  .auth-card {
    padding: 24px 18px;
  }
  .site-footer {
    margin-top: 56px;
    padding: 30px 16px 40px;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .brand-mark {
    width: 40px !important;
    height: 40px !important;
    flex-basis: 40px !important;
  }
  .brand strong { font-size: .9rem; }
  .mobile-nav > summary { min-width: 72px; }
  .hero h1 {
    font-size: clamp(2.65rem, 14vw, 4rem);
  }
  .hero-stats,
  .hero-stats.three {
    grid-template-columns: 1fr;
    gap: 8px;
    border: 0;
    background: transparent;
  }
  .hero-stats article {
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--surface);
  }
}


/* Mobile/tablet dashboard navigation fix v66 */
@media (max-width: 820px) {
  .dashboard-shell {
    display: block;
    min-height: 0;
  }
  .dashboard-sidebar {
    display: block;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    background: color-mix(in srgb, var(--surface) 94%, var(--surface-2));
  }
  .dashboard-sidebar-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .dashboard-sidebar-intro .eyebrow { margin: 0; }
  .sidebar-name {
    margin: 0;
    max-width: 54vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-family: var(--sans);
    font-size: .78rem;
  }
  .dashboard-desktop-nav { display: none !important; }
  .dashboard-mobile-nav {
    display: block;
    margin-top: 8px;
  }
  .dashboard-mobile-nav > summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 9px !important;
    background: var(--surface);
    color: var(--text);
    font-size: .78rem;
    font-weight: 800;
    list-style: none;
    cursor: pointer;
  }
  .dashboard-mobile-nav > summary::-webkit-details-marker { display: none; }
  .dashboard-mobile-nav nav {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 6px;
    padding-top: 7px;
  }
  .dashboard-sidebar .dashboard-mobile-nav nav > a,
  .dashboard-sidebar .dashboard-mobile-nav .sidebar-logout {
    min-height: 44px;
    padding: 9px 10px;
    border: 1px solid var(--line-soft);
    border-left: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    display: flex;
    align-items: center;
  }
  .dashboard-sidebar .dashboard-mobile-nav form { margin: 0; }
  .dashboard-sidebar .dashboard-mobile-nav .sidebar-logout {
    margin: 0;
    color: var(--danger);
  }
  .dashboard-main {
    width: 100%;
    min-width: 0;
    padding: 16px;
  }
  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard-stats {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dog-card-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-wide {
    grid-column: auto;
  }
  .dashboard-shell,
  .dashboard-main,
  .dashboard-grid,
  .dashboard-panel,
  .dashboard-hero,
  .dog-card-grid.compact,
  .table-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .dashboard-panel,
  .dashboard-hero {
    overflow: hidden;
  }
  .activity-row,
  .panel-heading,
  .button-row {
    min-width: 0;
  }
  .activity-row > *,
  .panel-heading > *,
  .button-row > * {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}


/* Final responsive polish v29 */
.brand-mark {
  width: 54px !important;
  height: 54px !important;
  flex: 0 0 54px !important;
  object-fit: contain !important;
  background: transparent !important;
}
.brand {
  gap: 10px;
}
.brand-small {
  letter-spacing: .16em;
}
.header-inner {
  min-height: 78px;
}
.site-header {
  min-height: 78px;
}

@media (max-width: 760px) {
  .site-header,
  .header-inner { min-height: 66px; }
  .header-inner { padding: 7px 14px; }
  .brand-mark {
    width: 46px !important;
    height: 46px !important;
    flex-basis: 46px !important;
  }
  .brand-small { font-size: .5rem; }
  .brand strong { font-size: .94rem; }

  .pedigree-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 16px 14px;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }
  .pedigree-board {
    width: max-content;
    min-width: max-content;
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 2px 0 10px;
  }
  .pedigree-column {
    width: 184px;
    min-width: 184px;
    flex: 0 0 184px;
    display: flex;
    flex-direction: column;
    padding-left: 0;
    border-left: 0;
    scroll-snap-align: start;
  }
  .pedigree-column h2 {
    position: sticky;
    left: 0;
    min-height: 28px;
    margin: 0 0 8px;
    padding: 0 2px;
    color: var(--gold);
    font-size: .66rem;
  }
  .pedigree-nodes,
  .pedigree-column:first-child .pedigree-nodes {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 8px;
  }
  .pedigree-node {
    min-height: 76px;
    padding: 11px;
  }
  .pedigree-node strong {
    font-size: .9rem;
    line-height: 1.15;
  }
  .pedigree-node span,
  .pedigree-node small {
    font-size: .64rem;
    line-height: 1.3;
  }

  .dashboard-sidebar {
    display: block;
    position: relative;
    z-index: 2;
  }
  .dashboard-mobile-nav {
    display: block !important;
  }
  .dashboard-main {
    min-width: 0;
  }
  .dashboard-panel,
  .dashboard-hero {
    overflow: hidden;
  }
}

@media (max-width: 420px) {
  .hero {
    padding-top: 38px;
  }
  .hero h1 {
    font-size: clamp(2.55rem, 13.5vw, 3.85rem);
  }
  .page-heading h1,
  .dog-profile h1,
  .pedigree-toolbar h1,
  .kennel-hero h1,
  .dashboard-hero h1,
  .auth-card h1 {
    font-size: clamp(2.05rem, 10vw, 3rem);
  }
  .section-heading h2,
  .panel-heading h2 {
    line-height: 1.08;
  }
  .footer-links {
    flex-wrap: wrap;
  }
}


/* Final mobile clarity v30 */
@media (max-width: 760px) {
  .dashboard-panel .panel-heading {
    align-items: flex-start !important;
    text-align: left;
  }
  .dashboard-panel .panel-heading h2,
  .dashboard-panel .panel-heading .text-link {
    align-self: flex-start;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .pedigree-scroll {
    width: 100%;
    overflow: visible;
    padding: 0 16px 14px;
    scroll-snap-type: none;
  }
  .pedigree-board {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 16px;
    padding: 2px 0 12px;
  }
  .pedigree-column {
    width: 100%;
    min-width: 0;
    display: block;
    padding: 0;
    border: 0;
  }
  .pedigree-column h2 {
    position: static;
    min-height: 0;
    margin: 0 0 8px;
    padding: 0 0 7px 10px;
    border-left: 3px solid var(--gold);
    color: var(--gold);
    font-size: .67rem;
  }
  .pedigree-nodes,
  .pedigree-column:first-child .pedigree-nodes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .pedigree-column:first-child .pedigree-nodes {
    grid-template-columns: 1fr;
  }
  .pedigree-node {
    min-height: 78px;
    padding: 11px 12px;
  }
  .pedigree-node strong {
    font-size: .9rem;
    line-height: 1.16;
  }
  .pedigree-node span,
  .pedigree-node small {
    font-size: .63rem;
    line-height: 1.3;
  }
}


/* ==========================================================================
   Customer visual restoration v31 — 2026-10-03
   Restores the requested dark-first identity, CCA plaque, theme switcher,
   mobile hero spacing and connected pedigree-box presentation.
   ========================================================================== */

.theme-toggle {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--gold);
  font: inherit;
  font-size: .76rem;
  font-weight: 750;
  white-space: nowrap;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--gold);
  background: var(--surface-2);
}
.mobile-theme-toggle {
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
}

.hero-title-primary,
.hero-title-secondary { display: block; }
.hero-mobile-break { display: inline; }

.hero-mark {
  position: relative;
  z-index: 1;
  min-height: 340px;
  padding: 34px 26px;
  display: grid !important;
  place-content: center;
  justify-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--gold) 17%, transparent), transparent 48%),
    var(--surface);
  box-shadow: 0 22px 58px rgba(0,0,0,.18);
  text-align: center;
}
.hero-mark span {
  display: block;
  width: auto;
  max-width: 100%;
  color: color-mix(in srgb, var(--gold) 34%, transparent);
  font-family: var(--serif);
  font-size: clamp(5.7rem, 10vw, 8.8rem);
  font-weight: 650;
  line-height: .82;
  letter-spacing: -.055em;
}
.hero-mark small {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 24px;
  padding: 0 6px;
  color: var(--gold);
  font-size: .63rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .16em;
  overflow-wrap: anywhere;
  text-align: center;
}
html[data-theme="light"] .hero-mark {
  box-shadow: 0 20px 48px rgba(62,48,23,.08);
}

/* Draw the pedigree as a branching box chart rather than a stacked list. */
.pedigree-column {
  position: relative;
}
.pedigree-column:not(:first-child)::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 48px;
  bottom: 20px;
  width: 1px;
  background: var(--line);
  pointer-events: none;
}
.pedigree-column:not(:first-child) .pedigree-node {
  position: relative;
}
.pedigree-column:not(:first-child) .pedigree-node::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  width: 11px;
  height: 1px;
  background: var(--line);
  pointer-events: none;
}

@media (max-width: 760px) {
  .hero {
    padding-top: 68px;
    gap: 32px;
  }
  .hero-mobile-break {
    display: block;
  }
  .hero h1 {
    line-height: .9;
  }
  .hero-search {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    overflow: visible;
    border: 0 !important;
    background: transparent !important;
  }
  .hero-search input,
  .hero-search button {
    width: 100%;
    min-height: 50px;
    border-radius: 0 !important;
  }
  .hero-search input {
    border: 1px solid var(--line-soft) !important;
    background: var(--field-bg) !important;
    color: var(--text) !important;
  }
  .hero-search button {
    border: 1px solid var(--gold) !important;
    background: var(--gold) !important;
    color: var(--accent-contrast) !important;
  }
  .hero-mark {
    min-height: 218px;
    margin-top: 4px;
    padding: 28px 16px;
  }
  .hero-mark span {
    font-size: clamp(5.2rem, 26vw, 7rem);
  }
  .hero-mark small {
    margin-top: 18px;
    font-size: .57rem;
    letter-spacing: .12em;
  }

  .pedigree-scroll {
    width: calc(100% + 32px) !important;
    margin-inline: -16px;
    padding: 0 16px 18px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }
  .pedigree-board {
    width: max-content !important;
    min-width: max-content !important;
    display: flex !important;
    grid-template-columns: none !important;
    align-items: stretch !important;
    gap: 18px !important;
    padding: 4px 0 12px !important;
  }
  .pedigree-column {
    width: 190px !important;
    min-width: 190px !important;
    flex: 0 0 190px !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    border: 0 !important;
    scroll-snap-align: start;
  }
  .pedigree-column h2 {
    position: static !important;
    min-height: 32px !important;
    margin: 0 0 8px !important;
    padding: 0 2px 8px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line-soft) !important;
    color: var(--gold) !important;
    font-size: .63rem !important;
    text-align: center;
  }
  .pedigree-nodes,
  .pedigree-column:first-child .pedigree-nodes {
    flex: 1 !important;
    display: flex !important;
    grid-template-columns: none !important;
    flex-direction: column !important;
    justify-content: space-around !important;
    gap: 10px !important;
  }
  .pedigree-node {
    min-height: 82px !important;
    padding: 11px 12px !important;
    border: 1px solid var(--line) !important;
    border-radius: 0 !important;
    background: var(--surface) !important;
    box-shadow: none !important;
  }
  .pedigree-node strong {
    font-size: .88rem !important;
    line-height: 1.15 !important;
  }
  .pedigree-node span,
  .pedigree-node small {
    font-size: .62rem !important;
    line-height: 1.3 !important;
  }
  .pedigree-column:not(:first-child)::before {
    left: -10px;
    top: 48px;
    bottom: 20px;
  }
  .pedigree-column:not(:first-child) .pedigree-node::before {
    left: -11px;
    width: 10px;
  }
}

@media (max-width: 420px) {
  .hero {
    padding-top: 64px;
  }
}


/* Customer visual QA v31.1 — match supplied search and pedigree references. */
.hero-search input,
html[data-theme="dark"] .hero-search input,
html[data-theme="light"] .hero-search input {
  background: #ffffff !important;
  color: #141613 !important;
  border-color: #ffffff !important;
}
.hero-search input::placeholder {
  color: #8a8b88 !important;
  opacity: 1;
}

.pedigree-board {
  gap: 18px;
}
.pedigree-column:not(:first-child)::before {
  display: none !important;
}
.pedigree-nodes,
.pedigree-column:first-child .pedigree-nodes {
  position: relative;
}
.pedigree-column:not(:first-child) .pedigree-nodes::before {
  content: "";
  position: absolute;
  left: -10px;
  width: 1px;
  background: var(--line);
  pointer-events: none;
}
.pedigree-column:nth-child(2) .pedigree-nodes::before {
  top: 25%;
  bottom: 25%;
}
.pedigree-column:nth-child(3) .pedigree-nodes::before {
  top: 12.5%;
  bottom: 12.5%;
}
.pedigree-column:nth-child(4) .pedigree-nodes::before {
  top: 6.25%;
  bottom: 6.25%;
}
.pedigree-column:nth-child(5) .pedigree-nodes::before {
  top: 3.125%;
  bottom: 3.125%;
}
.pedigree-column:nth-child(n+6) .pedigree-nodes::before {
  top: 1.5%;
  bottom: 1.5%;
}
.pedigree-column:not(:first-child) .pedigree-node::before {
  left: -10px !important;
  width: 10px !important;
}
.pedigree-column:not(:last-child) .pedigree-node {
  position: relative;
}
.pedigree-column:not(:last-child) .pedigree-node::after {
  content: "";
  position: absolute;
  right: -9px;
  top: 50%;
  width: 9px;
  height: 1px;
  background: var(--line);
  pointer-events: none;
}


/* WhatsApp owner final visual alignment v34 */
.hero-mark {
  border: 1px solid color-mix(in srgb, var(--gold) 58%, transparent) !important;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--gold) 10%, transparent),
    0 22px 58px rgba(0,0,0,.18) !important;
}
.hero-mark small {
  max-width: 100% !important;
  overflow-wrap: anywhere;
}

/* Make the pedigree read unmistakably as connected boxes, not a list. */
.pedigree-column:not(:first-child) .pedigree-nodes::before,
.pedigree-column:not(:first-child) .pedigree-node::before,
.pedigree-column:not(:last-child) .pedigree-node::after {
  background: color-mix(in srgb, var(--gold) 62%, transparent) !important;
}
.pedigree-column:not(:first-child) .pedigree-nodes::before {
  width: 2px !important;
}
.pedigree-column:not(:first-child) .pedigree-node::before,
.pedigree-column:not(:last-child) .pedigree-node::after {
  height: 2px !important;
}

@media (max-width: 760px) {
  .hero {
    padding-top: 82px;
  }
  .hero-mark {
    width: min(100%, 360px);
    justify-self: center;
    border-width: 1px !important;
  }
}

@media (max-width: 420px) {
  .hero {
    padding-top: 78px;
  }
}


/* ==========================================================================
   Customer restoration v36 — visible mobile restoration from supplied refs
   ========================================================================== */

.mobile-header-theme {
  display: none;
}

@media (max-width: 980px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
}

@media (max-width: 760px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    gap: 8px !important;
  }

  .brand-mark {
    width: 58px !important;
    height: 58px !important;
    flex-basis: 58px !important;
  }

  .mobile-header-theme {
    display: inline-flex;
    min-width: 58px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    margin: 0;
    border-radius: 8px;
    font-size: .72rem;
  }

  .hero {
    padding-top: 126px !important;
    gap: 38px !important;
  }

  .hero-stats,
  .hero-stats.three {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0 !important;
    border: 1px solid var(--line-soft) !important;
    background: var(--surface) !important;
  }

  .hero-stats article {
    min-height: 88px;
    border-right: 1px solid var(--line-soft) !important;
    border-bottom: 1px solid var(--line-soft) !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .hero-stats article:nth-child(2n) {
    border-right: 0 !important;
  }

  .hero-stats article:nth-last-child(-n + 2) {
    border-bottom: 0 !important;
  }

  /*
   * Keep the mobile pedigree as a real left-to-right family tree.
   * The first four ancestor generations remain visible as connected boxes;
   * deeper analysis still uses the selected generation depth below the chart.
   */
  .pedigree-scroll {
    width: calc(100% + 32px) !important;
    margin-inline: -16px !important;
    padding: 0 16px 14px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  .pedigree-board {
    height: 780px !important;
    min-height: 780px !important;
    width: max-content !important;
    min-width: max-content !important;
    align-items: stretch !important;
    gap: 18px !important;
    padding: 4px 0 10px !important;
  }

  .pedigree-column {
    width: 166px !important;
    min-width: 166px !important;
    flex: 0 0 166px !important;
    height: 100% !important;
  }

  .pedigree-column:nth-child(n + 6) {
    display: none !important;
  }

  .pedigree-column h2 {
    min-height: 34px !important;
    height: 34px !important;
    margin: 0 !important;
    padding: 0 4px 7px !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .pedigree-nodes,
  .pedigree-column:first-child .pedigree-nodes {
    min-height: 0 !important;
    height: calc(100% - 34px) !important;
    flex: 1 1 auto !important;
    justify-content: space-around !important;
    gap: 0 !important;
  }

  .pedigree-node {
    min-height: 0 !important;
    height: 44px !important;
    max-height: 44px !important;
    padding: 4px 7px !important;
    overflow: hidden !important;
    justify-content: center !important;
  }

  .pedigree-node strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: .69rem !important;
    line-height: 1.08 !important;
  }

  .pedigree-node > span {
    display: none !important;
  }

  .pedigree-node small {
    margin: 0 0 2px !important;
    font-size: .48rem !important;
    line-height: 1 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pedigree-node small:not(.pedigree-relationship) {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .hero {
    padding-top: 118px !important;
  }

  .hero-stats,
  .hero-stats.three {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}


/* ==========================================================================
   Owner home restoration v39 — restore original Explore cards + CCA backdrop
   ========================================================================== */

/* Original CCA plaque treatment: deep charcoal gradient with a warm gold halo. */
.hero-mark {
  border-radius: 0 !important;
  background:
    radial-gradient(circle at 50% 42%, rgba(210, 173, 87, .18), transparent 42%),
    linear-gradient(145deg, #151916, #090b0a) !important;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .42) !important;
}
.hero-mark span {
  color: rgba(239, 213, 141, .20) !important;
}
.hero-mark small {
  color: #d2ad57 !important;
}

/* Restore Trace the bloodline to the compact boxed arrangement. */
.home-actions .action-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
}
.home-actions .action-card {
  min-height: 150px !important;
  padding: 24px !important;
  border: 1px solid var(--line-soft) !important;
  border-radius: 0 !important;
  background: var(--surface) !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
}
.home-actions .action-icon {
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  margin-bottom: 24px !important;
  font-size: 1.45rem !important;
}
.home-actions .action-card strong {
  font-family: var(--serif) !important;
  font-size: 1.25rem !important;
  font-weight: 500 !important;
}
.home-actions .action-card small {
  display: block !important;
  margin-top: 3px !important;
  color: var(--muted) !important;
}

@media (max-width: 1080px) {
  .home-actions .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .home-actions {
    padding-top: 38px !important;
  }
  .home-actions .section-heading {
    margin-bottom: 18px !important;
  }
  .home-actions .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .home-actions .action-card {
    min-height: 132px !important;
    padding: 16px !important;
  }
  .home-actions .action-icon {
    margin-bottom: 18px !important;
    font-size: 1.25rem !important;
  }
  .home-actions .action-card strong {
    font-size: 1.02rem !important;
    line-height: 1.18 !important;
  }
  .home-actions .action-card small {
    font-size: .68rem !important;
  }
  .hero-mark {
    min-height: 210px !important;
    background:
      radial-gradient(circle at 50% 42%, rgba(210, 173, 87, .20), transparent 44%),
      linear-gradient(145deg, #151916, #090b0a) !important;
  }
}


/* Owner exact old-home correction v40 */
.hero-mark {
  border: 1px solid var(--line) !important;
  background:
    radial-gradient(circle at 50% 42%, rgba(210, 173, 87, .18), transparent 42%),
    linear-gradient(145deg, #151916, #090b0a) !important;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .42) !important;
}

@media (max-width: 760px) {
  .home-actions .action-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .home-actions .action-card {
    min-height: 150px !important;
    padding: 24px !important;
  }

  .home-actions .action-icon {
    margin-bottom: 24px !important;
    font-size: 1.45rem !important;
  }

  .home-actions .action-card strong {
    font-size: 1.25rem !important;
  }

  .home-actions .action-card small {
    display: block !important;
    font-size: inherit !important;
  }
}


/* ==========================================================================
   Screenshot-matched mobile home restoration v41
   ========================================================================== */
@media (max-width: 760px) {
  /* CCA exactly as the supplied old screenshot: mark left, domain right. */
  .hero-mark {
    min-height: 252px !important;
    width: 100% !important;
    padding: 28px 26px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    justify-items: stretch !important;
    column-gap: 28px !important;
    border: 1px solid var(--line) !important;
    border-radius: 0 !important;
    background:
      radial-gradient(circle at 52% 44%, rgba(210, 173, 87, .18), transparent 40%),
      linear-gradient(145deg, #151916, #090b0a) !important;
    box-shadow: 0 26px 70px rgba(0, 0, 0, .42) !important;
    text-align: left !important;
  }

  .hero-mark span {
    justify-self: start !important;
    color: rgba(239, 213, 141, .20) !important;
    font-size: clamp(5.7rem, 25vw, 7.6rem) !important;
    line-height: .8 !important;
  }

  .hero-mark small {
    justify-self: end !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #d2ad57 !important;
    font-size: .56rem !important;
    line-height: 1.2 !important;
    letter-spacing: .18em !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    text-align: right !important;
  }

  /* Trace the bloodline: exact old 2x2 boxed layout. */
  .home-actions {
    padding-top: 52px !important;
  }

  .home-actions .section-heading {
    margin-bottom: 28px !important;
  }

  .home-actions .action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .home-actions .action-card {
    min-height: 202px !important;
    padding: 26px 24px !important;
    border: 1px solid var(--line-soft) !important;
    border-radius: 0 !important;
    background: var(--surface) !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: flex-start !important;
  }

  .home-actions .action-icon {
    width: auto !important;
    height: auto !important;
    margin: 0 0 42px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--gold) !important;
    font-size: 1.38rem !important;
    line-height: 1 !important;
  }

  .home-actions .action-card strong {
    font-family: var(--serif) !important;
    font-size: clamp(1.22rem, 5vw, 1.58rem) !important;
    font-weight: 600 !important;
    line-height: 1.08 !important;
  }

  .home-actions .action-card small {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .hero-mark {
    min-height: 220px !important;
    padding-inline: 20px !important;
    column-gap: 16px !important;
  }

  .hero-mark span {
    font-size: clamp(4.8rem, 24vw, 6.2rem) !important;
  }

  .hero-mark small {
    font-size: .48rem !important;
    letter-spacing: .13em !important;
  }

  .home-actions .action-card {
    min-height: 174px !important;
    padding: 22px 18px !important;
  }

  .home-actions .action-icon {
    margin-bottom: 32px !important;
  }

  .home-actions .action-card strong {
    font-size: 1.12rem !important;
  }
}


/* ==========================================================================
   iPhone / iOS Safari compatibility v43
   Keep Android/mobile layout unchanged; compensate only for WebKit/iOS.
   ========================================================================== */
@supports (-webkit-touch-callout: none) {
  html {
    -webkit-text-size-adjust: 100%;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    min-width: 0 !important;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .site-header {
    padding-top: env(safe-area-inset-top);
  }

  .header-inner {
    padding-left: max(16px, env(safe-area-inset-left)) !important;
    padding-right: max(16px, env(safe-area-inset-right)) !important;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .auth-shell,
  .dashboard-shell {
    min-height: calc(100svh - 76px);
  }

  @media (max-width: 760px) {
    .hero,
    .page-shell,
    .site-footer {
      width: 100%;
      max-width: 100%;
      padding-left: max(16px, env(safe-area-inset-left)) !important;
      padding-right: max(16px, env(safe-area-inset-right)) !important;
    }

    .mobile-nav-panel {
      max-width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right));
    }

    .hero-mark {
      width: 100% !important;
      max-width: 100% !important;
      grid-template-columns: minmax(96px, .85fr) minmax(0, 1.15fr) !important;
      column-gap: 14px !important;
      padding-left: 18px !important;
      padding-right: 18px !important;
      overflow: hidden !important;
    }

    .hero-mark span {
      min-width: 0 !important;
      font-size: clamp(4.3rem, 21vw, 6.1rem) !important;
    }

    .hero-mark small {
      min-width: 0 !important;
      max-width: 100% !important;
      font-size: clamp(.40rem, 1.75vw, .50rem) !important;
      letter-spacing: .11em !important;
      white-space: nowrap !important;
      overflow: hidden !important;
      text-overflow: clip !important;
    }

    .home-actions .action-grid {
      width: 100% !important;
      min-width: 0 !important;
    }

    .home-actions .action-card {
      min-width: 0 !important;
      overflow: hidden !important;
    }

    .home-actions .action-card strong {
      overflow-wrap: anywhere;
    }

    .hero-search,
    .filter-panel,
    .mating-form {
      width: 100% !important;
      min-width: 0 !important;
    }

    .hero-search input,
    .hero-search button,
    .filter-panel input,
    .filter-panel select,
    .mating-form input,
    .mating-form select {
      min-width: 0 !important;
      max-width: 100% !important;
    }

    .pedigree-scroll,
    .profile-tabs,
    .table-scroll {
      -webkit-overflow-scrolling: touch;
    }

    .site-footer {
      padding-bottom: max(40px, env(safe-area-inset-bottom)) !important;
    }
  }
}


/* ==========================================================================
   Owner fixes v44 — no home guide line; iPhone mating picker reliability
   ========================================================================== */
.hero::before {
  content: none !important;
  display: none !important;
  border: 0 !important;
  background: none !important;
}

.mating-form,
.mating-select,
.dog-autocomplete-host {
  overflow: visible !important;
  min-width: 0 !important;
}

.dog-suggestions {
  z-index: 1000 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.dog-suggestion {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.brand-mark {
  object-fit: contain !important;
  object-position: center !important;
}

@supports (-webkit-touch-callout: none) {
  @media (max-width: 760px) {
    .mating-form {
      position: relative;
      overflow: visible !important;
    }

    .mating-select {
      position: relative;
      overflow: visible !important;
      z-index: 2;
    }

    .mating-select:focus-within {
      z-index: 20;
    }

    .mating-select .dog-suggestions {
      position: absolute !important;
      left: 0 !important;
      right: 0 !important;
      top: calc(100% + 4px) !important;
      max-height: min(42svh, 320px) !important;
      overscroll-behavior: contain;
    }
  }
}


/* Virtual mating results dashboard v45 */
.mating-form-expanded {
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr) minmax(135px, .45fr) auto;
}
.mating-depth { min-width: 0; }
.mating-section { margin-top: 12px; }
.mating-result-heading { margin-top: 4px; }
.mating-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; }
.mating-completeness-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.common-ancestor-list { display: grid; }
.common-ancestor-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .6fr);
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.common-ancestor-row:last-child { border-bottom: 0; }
.common-ancestor-row:hover strong { color: var(--gold-soft); }
.common-ancestor-row > div:first-child > span,
.common-generation-pair span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .72rem;
}
.common-generation-pair {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
}
.mating-contribution-table td:last-child strong { color: var(--gold-soft); }
.mating-method-note { margin: 14px 0 0; font-size: .72rem; }

.overlap-map { display: grid; gap: 10px; }
.overlap-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, .72fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 24px;
}
.overlap-row::before,
.overlap-row::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 1px;
  background: var(--line);
  pointer-events: none;
}
.overlap-row::before { left: calc(33.333% - 2px); width: 28px; }
.overlap-row::after { right: calc(33.333% - 2px); width: 28px; }
.overlap-side,
.overlap-ancestor {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  background: var(--field-bg);
}
.overlap-side { display: grid; align-content: center; gap: 4px; }
.overlap-side span,
.overlap-ancestor span,
.overlap-ancestor small {
  color: var(--muted);
  font-size: .68rem;
}
.overlap-side-right { text-align: right; }
.overlap-ancestor {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 4px;
  border-color: var(--line);
  text-align: center;
}
.overlap-ancestor:hover { border-color: var(--gold); }
.overlap-ancestor small {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.overlap-ancestor strong { font-family: var(--serif); }

.mating-coverage-strip { margin-top: 12px; }
.mating-coverage-warning {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin: 14px 0 0;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--gold) 5%, var(--surface));
}
.mating-coverage-warning strong { color: var(--gold-soft); }
.mating-coverage-warning span { color: var(--muted); }

.projected-pedigree { padding: 0; overflow: hidden; }
.projected-pedigree > summary {
  min-height: 84px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}
.projected-pedigree > summary::-webkit-details-marker { display: none; }
.projected-pedigree > summary span:first-child { display: grid; gap: 4px; }
.projected-pedigree > summary strong { font-family: var(--serif); font-size: 1.35rem; }
.projected-pedigree > summary > span:last-child { color: var(--gold); font-size: 1.35rem; }
.projected-pedigree[open] > summary { border-bottom: 1px solid var(--line-soft); }
.projected-pedigree[open] > summary > span:last-child { transform: rotate(45deg); }
.hypothetical-label {
  margin: 18px max(24px, calc((100vw - var(--max))/2)) 0;
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  color: var(--gold-soft);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-align: center;
}
.projected-pedigree-scroll { margin-top: 10px; }
.projected-pedigree-board { padding-bottom: 22px; }
.hypothetical-node {
  border-style: dashed;
  border-color: var(--line);
}
.common-ancestor-node {
  border-color: var(--gold) !important;
  box-shadow: inset 3px 0 0 var(--gold);
}
.compare-pairing-panel .button-row { margin-top: 0; }

@media (max-width: 1080px) {
  .mating-form-expanded {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }
  .mating-depth { grid-column: 1 / 2; }
  .mating-form-expanded > .btn { grid-column: 3 / 4; }
  .mating-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .mating-form-expanded,
  .mating-metrics,
  .mating-completeness-grid,
  .common-ancestor-row,
  .overlap-row,
  .mating-coverage-warning {
    grid-template-columns: 1fr !important;
  }
  .mating-depth,
  .mating-form-expanded > .btn { grid-column: auto; }
  .common-generation-pair { justify-items: start; text-align: left; }
  .overlap-row { gap: 8px; }
  .overlap-row::before,
  .overlap-row::after { display: none; }
  .overlap-side-right { text-align: left; }
  .overlap-ancestor { text-align: left; }
  .projected-pedigree > summary { min-height: 76px; padding: 16px; }
  .projected-pedigree > summary strong { font-size: 1.12rem; }
  .hypothetical-label { margin: 14px 16px 0; }
  .compare-pairing-panel .button-row { display: grid; grid-template-columns: 1fr; }
}


/* Header/logo density v64 — larger supplied Cane Corso head, less wasted top space. */
.site-header,
.header-inner {
  min-height: 74px !important;
}

.header-inner {
  padding-top: 3px !important;
  padding-bottom: 3px !important;
}

.brand {
  min-width: 202px;
  gap: 10px !important;
}

.brand-mark {
  width: 66px !important;
  height: 66px !important;
  flex: 0 0 66px !important;
  object-fit: contain !important;
  object-position: center !important;
}

.hero {
  padding-top: 58px;
}

@media (max-width: 760px) {
  .site-header,
  .header-inner {
    min-height: 64px !important;
  }

  .header-inner {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }

  .brand {
    gap: 7px !important;
  }

  .brand-mark {
    width: 60px !important;
    height: 60px !important;
    flex-basis: 60px !important;
  }

  .hero {
    padding-top: 54px !important;
    gap: 30px !important;
  }
}

@media (max-width: 420px) {
  .brand-mark {
    width: 58px !important;
    height: 58px !important;
    flex-basis: 58px !important;
  }

  .hero {
    padding-top: 64px !important;
  }
}


/* Member dashboard workflow clarity v70 */
.dashboard-hero-purposeful {
  align-items: center;
}
.dashboard-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 14px;
}
.dashboard-action-section {
  margin-top: 14px;
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 9px 28px rgba(57,45,26,.04);
}
.dashboard-action-section .panel-heading {
  margin-bottom: 16px;
}
.dashboard-action-section .panel-heading .eyebrow,
.dashboard-panel .panel-heading .eyebrow {
  margin: 0 0 4px;
}
.dashboard-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
.dashboard-action-card {
  min-width: 0;
  min-height: 208px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 86%, var(--surface-2));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}
.dashboard-action-card h3 {
  margin: 0;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.25rem;
}
.dashboard-action-card p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
}
.dashboard-action-number {
  color: var(--gold);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .16em;
}
.dashboard-action-card .btn,
.dashboard-action-card .text-link {
  margin-top: auto;
}
.dashboard-organized-grid {
  gap: 14px;
  margin-top: 14px;
}
.dashboard-dog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}
.dashboard-dog-card {
  min-width: 0;
  min-height: 214px;
  display: grid;
  grid-template-columns: 168px minmax(0,1fr);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-2));
}
.dashboard-dog-media {
  min-height: 214px;
  background: var(--surface-2);
  overflow: hidden;
}
.dashboard-dog-media img {
  width: 100%;
  height: 100%;
  min-height: 214px;
  object-fit: cover;
  object-position: center 24%;
}
.dashboard-dog-media .media-placeholder {
  width: 100%;
  height: 100%;
  min-height: 214px;
  display: grid;
  place-content: center;
  gap: 4px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
}
.dashboard-dog-media .media-placeholder span {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.5rem;
}
.dashboard-dog-media .media-placeholder small {
  font-size: .68rem;
}
.dashboard-dog-body {
  min-width: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.dashboard-dog-body h3 {
  margin: 8px 0 4px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.35rem;
}
.dashboard-dog-body > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .75rem;
}
.dashboard-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.dashboard-record-actions .btn {
  min-height: 36px;
  padding: 7px 10px;
  font-size: .7rem;
}
.dashboard-record-more {
  position: relative;
  min-width: 0;
}
.dashboard-record-more > summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: .7rem;
  font-weight: 700;
  list-style: none;
}
.dashboard-record-more > summary::-webkit-details-marker { display: none; }
.dashboard-record-more[open] > summary {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(139,106,47,.08);
}
.dashboard-record-more-menu {
  position: absolute;
  z-index: 12;
  right: 0;
  bottom: calc(100% + 6px);
  min-width: 164px;
  padding: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(24,20,14,.14);
}
.dashboard-record-more-menu a {
  display: block;
  padding: 8px 9px;
  border-radius: 7px;
  color: var(--text);
  font-size: .72rem;
}
.dashboard-record-more-menu a:hover,
.dashboard-record-more-menu a:focus-visible {
  background: var(--surface-2);
  color: var(--gold);
}
.dashboard-panel-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.dashboard-status-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  color: inherit;
}
.dashboard-status-row:last-child {
  border-bottom: 0;
}
.dashboard-status-row > div {
  min-width: 0;
}
.dashboard-status-row strong,
.dashboard-status-row span {
  display: block;
}
.dashboard-status-row strong {
  color: var(--text);
  font-size: .82rem;
}
.dashboard-status-row > div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .7rem;
}
.dashboard-status-row .submission-state {
  flex: 0 0 auto;
}
.dashboard-guidance {
  margin: 12px 0 16px;
  padding: 11px 12px;
  border-left: 3px solid var(--gold);
  background: var(--surface-2);
  color: var(--muted);
  font-size: .76rem;
}
.empty-state.compact {
  padding: 12px 0;
  border: 0;
  background: transparent;
}

@media (max-width: 1180px) {
  .dashboard-action-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  .dashboard-dog-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .dashboard-hero-purposeful {
    align-items: stretch;
  }
  .dashboard-action-section {
    padding: 16px;
  }
  .dashboard-action-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-action-card {
    min-height: 0;
  }
  .dashboard-dog-card {
    grid-template-columns: 116px minmax(0,1fr);
    min-height: 178px;
  }
  .dashboard-dog-media,
  .dashboard-dog-media img,
  .dashboard-dog-media .media-placeholder {
    min-height: 178px;
  }
  .dashboard-dog-body {
    padding: 12px;
  }
  .dashboard-record-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  .dashboard-record-actions .btn,
  .dashboard-record-more > summary {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .dashboard-record-more {
    min-width: 0;
  }
  .dashboard-record-more-menu {
    left: 0;
    right: auto;
    min-width: min(210px, calc(100vw - 48px));
  }
}
@media (max-width: 440px) {
  .dashboard-dog-card {
    grid-template-columns: 98px minmax(0,1fr);
  }
  .dashboard-record-actions {
    grid-template-columns: 1fr;
  }
}


/* Member form target + moderation attachment clarity v71 */
.member-form-target {
  display: grid;
  grid-template-columns: 150px minmax(0,1fr);
  gap: 18px;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 90%, var(--surface-2));
}
.member-form-target-media {
  min-height: 138px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--surface-2);
}
.member-form-target-media img {
  width: 100%;
  height: 100%;
  min-height: 138px;
  object-fit: cover;
  object-position: center 24%;
}
.member-form-target-media .media-placeholder {
  min-height: 138px;
  display: grid;
  place-content: center;
  gap: 3px;
  text-align: center;
  color: var(--muted);
}
.member-form-target-media .media-placeholder span {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.4rem;
}
.member-form-target-media .media-placeholder small {
  font-size: .66rem;
}
.member-form-target-copy {
  min-width: 0;
  align-self: center;
}
.member-form-target-copy h2 {
  margin: 4px 0 5px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.55rem;
}
.member-form-target-copy > p:not(.eyebrow) {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .76rem;
}
.review-attachment-preview {
  display: grid;
  grid-template-columns: minmax(180px, 320px) minmax(0,1fr);
  gap: 18px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-2);
}
.review-attachment-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface);
}
.review-attachment-preview p {
  margin: 0 0 8px;
}

@media (max-width: 620px) {
  .member-form-target {
    grid-template-columns: 92px minmax(0,1fr);
    gap: 12px;
    padding: 11px;
  }
  .member-form-target-media,
  .member-form-target-media img,
  .member-form-target-media .media-placeholder {
    min-height: 104px;
  }
  .member-form-target-copy h2 {
    font-size: 1.25rem;
  }
  .review-attachment-preview {
    grid-template-columns: 1fr;
  }
}


/* Final UX audit: progressive disclosure for secondary data and governance tools. */
.relationship-more {
  margin-top: 10px;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}
.relationship-more > summary,
.ux-disclosure > summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: 750;
  list-style: none;
}
.relationship-more > summary::-webkit-details-marker,
.ux-disclosure > summary::-webkit-details-marker {
  display: none;
}
.relationship-more > summary::after,
.ux-disclosure > summary::after {
  content: "＋";
  float: right;
  color: var(--muted);
}
.relationship-more[open] > summary::after,
.ux-disclosure[open] > summary::after {
  content: "−";
}
.relationship-more > .relationship-list,
.relationship-more > .table-scroll {
  margin-top: 10px;
}
.ux-disclosure {
  margin-top: 16px;
}
.ux-disclosure > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ux-disclosure > summary > span {
  display: grid;
  gap: 3px;
}
.ux-disclosure > summary strong {
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.15rem;
}
.ux-disclosure > summary small {
  color: var(--muted);
  font-weight: 500;
}
.ux-disclosure-body {
  margin-top: 16px;
}
.moderation-toolbox .ux-disclosure-body > .panel:first-child {
  margin-top: 0;
}
@media (max-width: 760px) {
  .ux-disclosure > summary {
    align-items: flex-start;
  }
  .relationship-more > summary,
  .ux-disclosure > summary {
    min-height: 44px;
    padding: 8px 0;
  }
}


/* Final UX audit: four homepage metrics should read as one compact set. */
.hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hero-stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* Auth navigation v76: logout is a first-class action on desktop and mobile. */
.logout-form {
  display: inline-flex;
  margin: 0;
}
.logout-button {
  cursor: pointer;
  font: inherit;
}
.mobile-logout-form {
  margin: 0;
}
.mobile-logout-form button {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.mobile-logout-form button:hover,
.mobile-logout-form button:focus-visible,
.logout-button:hover,
.logout-button:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
}
@media (max-width: 760px) {
  .mobile-logout-form {
    min-width: 0;
  }
}


/* Public density/performance polish v77. */
.result-summary {
  align-items: center;
  flex-wrap: wrap;
}
.result-clear {
  margin-left: auto;
}
.kennel-card {
  min-height: 190px;
  padding: 20px;
}
.kennel-card h2 {
  margin: 22px 0 8px;
}
.mini-stats {
  margin-top: 14px;
}
.profile-primary-actions {
  margin-top: 18px;
}
.profile-manage-actions {
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-2));
}
.profile-manage-actions > summary {
  min-height: 50px;
}
.profile-manage-actions .ux-disclosure-body {
  margin-top: 0;
  padding-bottom: 14px;
}
.profile-manage-actions .button-row {
  margin-top: 0;
}
@media (max-width: 760px) {
  .kennel-card {
    min-height: 0;
    padding: 18px;
  }
  .kennel-card h2 {
    margin-top: 16px;
    font-size: 1.5rem;
  }
  .result-clear {
    width: 100%;
    margin-left: 0;
  }
  .profile-primary-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .profile-primary-actions .btn,
  .profile-manage-actions .btn {
    width: 100%;
  }
  .profile-manage-actions {
    padding-inline: 12px;
  }
}
.profile-coi-context {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.85rem;
}
.profile-record-notes {
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.profile-record-notes > summary {
  font-size: 0.9rem;
}
.profile-record-notes-body {
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.profile-record-notes-body p { margin: 0 0 9px; }
.profile-record-notes-body strong { color: var(--text); }



/* Long-page navigation and below-the-fold rendering v77. */
.dog-profile [id] {
  scroll-margin-top: 112px;
}
.profile-tabs {
  position: sticky;
  top: 74px;
  z-index: 24;
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
}
@supports (content-visibility: auto) {
  .kennel-card,
  .search-result-card {
    content-visibility: auto;
    contain-intrinsic-size: 190px;
  }
  .search-result-card {
    contain-intrinsic-size: 112px;
  }
}
@media (max-width: 760px) {
  .dog-profile [id] {
    scroll-margin-top: 98px;
  }
  .profile-tabs {
    top: 64px;
  }
}

/* Mobile record-title containment v80. */
@media (max-width: 760px) {
  .page-heading,
  .page-heading h1,
  .profile-section-grid,
  .profile-section-grid > *,
  .parent-grid,
  .parent-grid > *,
  .compact-facts,
  .compact-facts dd {
    min-width: 0;
    max-width: 100%;
  }

  .page-heading h1,
  .parent-link,
  .parent-grid strong,
  .compact-facts dd {
    overflow-wrap: anywhere;
    word-break: normal;
  }
}

/* Photo-first record presentation v81. */
.search-result-card.no-media {
  grid-template-columns: minmax(0, 1fr);
}
.search-result-card.no-media .search-result-main {
  min-width: 0;
}
@media (max-width: 760px) {
  .search-result-card.no-media {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Natural header dog-head crop v83. */
.brand-mark {
  clip-path: inset(0 0 13% 0);
  transform: translateY(2px) scale(1.055);
  transform-origin: center 42%;
}

/* Homepage mobile breathing room v85.
   Keep the header/logo at the approved v83 position; increase only the marked
   space between the header divider and the homepage hero content. */
@media (max-width: 760px) {
  .hero {
    padding-top: 96px !important;
  }
}

@media (max-width: 420px) {
  .hero {
    padding-top: 108px !important;
  }
}


/* Approved photo fidelity: fit full dogs and prevent hard face/body cropping.
   Keep layout dimensions fixed to avoid CLS while using contain over cover. */
.dog-profile .profile-photo {
  display: grid;
  place-items: center;
  background: var(--surface-2);
}
.dog-profile .profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: contain;
  object-position: center center;
}
.dog-card .dog-card-media img,
.search-result-card .search-result-media img,
.dashboard-dog-media img,
.member-form-target-media img {
  object-fit: contain;
  object-position: center center;
}
.dog-photo-gallery {
  margin-top: 18px;
}
.dog-photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 154px), 1fr));
  gap: 12px;
}
.dog-photo-gallery-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  background: var(--surface-2);
}
.dog-photo-gallery-item img {
  display: block;
  width: 100%;
  height: 174px;
  object-fit: contain;
  object-position: center;
}
.dog-photo-gallery-item span {
  padding: 9px 10px;
  color: var(--text);
  font-size: .78rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.dog-photo-gallery-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
@media (max-width: 440px) {
  .dog-photo-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dog-photo-gallery-item img { height: 142px; }
}

/* iOS/iPadOS Safari interaction hardening v87.
   Preserve the approved header/logo positioning and existing Android layout.
   overflow:clip avoids creating an intermediate scroll container that breaks
   sticky header/tab behavior in WebKit while still containing wide records. */
@supports (-webkit-touch-callout: none) {
  @supports (overflow: clip) {
    html, body {
      overflow-x: clip !important;
    }
  }

  @media (max-width: 760px) {
    .mobile-nav-panel {
      max-height: min(72svh, 620px);
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-y: contain;
      padding-bottom: max(14px, env(safe-area-inset-bottom));
    }
    .mobile-nav-search input,
    .filter-panel input,
    .form-field input,
    .form-field textarea,
    .form-field select {
      /* iOS Safari zooms the visual viewport for controls below 16px. */
      font-size: 16px !important;
    }
    .mobile-nav-panel a,
    .mobile-nav > summary,
    .dog-suggestion,
    .form-field input[type="file"] {
      touch-action: manipulation;
    }
  }
}

/* Mobile COI controls v89: shared on Android Chrome and iOS Safari. */
.profile-coi-controls {
  align-items: center;
  margin-top: 14px;
}
.profile-coi-controls select,
.advanced-analysis form[aria-label="COI calculation generations"] select {
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--text);
}
@media (max-width: 760px) {
  .profile-facts > .profile-coi-label,
  .profile-facts > .profile-coi-value {
    grid-column: 1 / -1;
  }
  .profile-facts > .profile-coi-label { padding-top: 8px; }
  .profile-coi-controls,
  .advanced-analysis form[aria-label="COI calculation generations"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
  }
  .profile-coi-controls > *,
  .advanced-analysis form[aria-label="COI calculation generations"] > * {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  .profile-coi-controls select,
  .advanced-analysis form[aria-label="COI calculation generations"] select {
    font-size: 16px;
  }
}


/* Accessible COI selection and Virtual Mating results dashboard v90.
   Keep the button directly UNDER the generation selector on phones. */
.profile-coi-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  width: 100%;
  margin-top: 18px;
}
.profile-coi-selection {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.profile-coi-selection label {
  margin: 0;
  white-space: nowrap;
  color: var(--muted);
}
.profile-coi-selection select {
  width: 100%;
  min-width: 0;
}
.profile-coi-recalculate {
  min-height: 46px;
  min-width: 154px;
  justify-self: start;
  touch-action: manipulation;
}
.mating-outcome-anchor,
.mating-results,
.mating-metrics,
.mating-section,
.projected-pedigree {
  scroll-margin-top: 105px;
}
.mating-outcome-anchor { height: 1px; }
.mating-hypothetical-note {
  display: inline-block;
  margin: 12px 0 2px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--gold-soft);
  background: var(--field-bg);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .055em;
}
.mating-result-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 14px;
  margin-bottom: 4px;
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.mating-result-nav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  touch-action: manipulation;
}
.mating-result-nav a:hover,
.mating-result-nav a:focus-visible {
  color: var(--gold-soft);
  border-color: var(--gold);
  outline-offset: 3px;
}
.mating-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}
.mating-metric-feature {
  border-color: var(--gold) !important;
  box-shadow: inset 0 3px 0 var(--gold);
}
.mating-metric-feature .analysis-number {
  color: var(--gold-soft);
}
.mating-metrics .analysis-card { min-width: 0; }
@media (max-width: 760px) {
  .profile-coi-selection {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }
  .profile-coi-controls,
  .profile-coi-selection,
  .profile-coi-selection select,
  .profile-coi-recalculate {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .profile-coi-selection select { font-size: 16px; }
  .profile-coi-recalculate {
    justify-self: stretch;
    min-height: 48px;
    margin: 0;
    text-align: center;
  }
  .mating-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .mating-metrics .analysis-card { padding: 16px; }
  .mating-result-nav { margin-inline: -2px; }
}
@media (max-width: 430px) {
  .mating-metrics { grid-template-columns: minmax(0, 1fr) !important; }
}


/* Mobile pedigree generation navigator, 2026-11. Keeps cards legible at 4–10 generations. */
.cca-generation-picker-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.cca-generation-picker { max-width: 180px; min-height: 42px; padding: 8px 10px; color: var(--text, inherit); background: var(--surface, #fff); border: 1px solid var(--line, #999); border-radius: 10px; font: inherit; }
.cca-tree-tools button:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 760px) {
  .cca-tree-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .cca-generation-picker-label { flex: 1 1 100%; justify-content: space-between; }
  .cca-generation-picker { flex: 1; max-width: none; min-width: 0; }
  .pedigree-scroll#cca-pedigree-scroll { overflow-x: hidden !important; overflow-y: auto !important; max-height: min(70vh, 640px); scroll-snap-type: none !important; overscroll-behavior: contain; }
  #cca-pedigree-scroll .pedigree-board { display: block !important; width: 100% !important; min-width: 0 !important; height: auto !important; min-height: 0 !important; padding: 12px !important; }
  #cca-pedigree-scroll .pedigree-column:not([hidden]) { display: block !important; width: 100% !important; min-width: 0 !important; max-width: none !important; height: auto !important; padding: 0 !important; }
  #cca-pedigree-scroll .pedigree-column[hidden] { display: none !important; }
  #cca-pedigree-scroll .pedigree-column::before, #cca-pedigree-scroll .pedigree-nodes::before,
  #cca-pedigree-scroll .pedigree-node::before, #cca-pedigree-scroll .pedigree-node::after { display: none !important; }
  #cca-pedigree-scroll .pedigree-nodes { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; height: auto !important; min-height: 0 !important; width: 100% !important; padding: 0 !important; }
  #cca-pedigree-scroll .pedigree-node { display: flex !important; flex-direction: column; justify-content: center; width: 100% !important; min-width: 0 !important; max-width: none !important; height: auto !important; min-height: 76px !important; margin: 0 !important; padding: 10px !important; overflow-wrap: anywhere; }
  #cca-pedigree-scroll .pedigree-node strong { white-space: normal !important; overflow-wrap: anywhere; }
  #cca-pedigree-scroll .pedigree-column h2 { position: sticky; top: 0; z-index: 2; }
}
@media (max-width: 390px) {
  #cca-pedigree-scroll .pedigree-nodes { grid-template-columns: 1fr !important; }
}
@media print {
  #cca-pedigree-scroll .pedigree-column[hidden] { display: block !important; }
  .cca-generation-picker-label { display: none !important; }
}

/* Readable, complete print/PDF view: never crop a mobile single-generation panel. */
@media print {
  #cca-pedigree-scroll {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    width: 100% !important;
  }
  #cca-pedigree-scroll .pedigree-board {
    zoom: 1 !important;
    overflow: visible !important;
    max-height: none !important;
  }
  #cca-pedigree-scroll .pedigree-column {
    break-inside: avoid-page;
    page-break-inside: avoid;
    max-height: none !important;
  }
  #cca-pedigree-scroll .pedigree-node {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
