/* KennelTree published site. Palette = the Classic report theme (cream, maroon, gold).
   No external fonts or CDNs: system faces only. Light/dark follow prefers-color-scheme. */
:root {
  --paper: #F4EEE2; --surface: #FFFDF8; --surface-2: #FBF7EC; --ink: #2A2320; --ink-soft: #5A524A;
  --ink-faint: #7A6F60; --accent: #6B2327; --band: #652125; --band-text: #F4EEE2; --band-sub: #E7D9B4;
  --gold: #C8A24A; --rule: #D9CFB8; --shade: #F1EBDD; --ok: #3F6B3A; --bad: #A3262A; --carrier: #9A6A12;
  --unknown: #8A8072; --link: #6B2327; --shadow: 0 1px 2px rgba(60, 40, 20, .08), 0 4px 14px rgba(60, 40, 20, .06);
  --display: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --body: "Gill Sans", "Gill Sans MT", Seravek, "Trebuchet MS", "Segoe UI", Calibri, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191413; --surface: #241E1C; --surface-2: #2B2422; --ink: #EFE6D6; --ink-soft: #CDBFAA;
    --ink-faint: #A09280; --accent: #E0A0A3; --band: #3E1417; --band-text: #F4EEE2; --band-sub: #D9C79A;
    --gold: #D9B862; --rule: #433835; --shade: #2F2725; --ok: #8EC383; --bad: #F2898C;
    --carrier: #E0B45A; --unknown: #A39684; --link: #E8B3B5; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.5 var(--body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: normal; line-height: 1.2; color: var(--accent); }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 .25em; }
h2 { font-size: 1.45rem; margin: 2rem 0 .75rem; padding-bottom: .3rem; border-bottom: 1px solid var(--rule); }
h3 { font-size: 1.15rem; margin: 1.2rem 0 .4rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-faint); }
.small { font-size: .88rem; }

/* Header band */
.band { background: var(--band); color: var(--band-text); border-bottom: 3px solid var(--gold); }
.band .wrap { display: flex; align-items: center; gap: 14px; min-height: 72px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.band a { color: var(--band-text); text-decoration: none; }
.band .logo { width: 52px; height: 52px; object-fit: contain; border-radius: 6px; background: rgba(255,255,255,.06); }
.band .site { font-family: var(--display); font-size: 1.5rem; letter-spacing: .01em; }
.band .tag { color: var(--band-sub); font-size: .9rem; }
.band nav { margin-left: auto; display: flex; gap: 18px; font-size: .95rem; }
.band nav a { color: var(--band-sub); }
.band nav a:hover { color: var(--band-text); text-decoration: underline; }
.crumbs { font-size: .9rem; margin: 18px 0 6px; color: var(--ink-faint); }
.crumbs a { color: var(--ink-soft); }

main { padding-bottom: 48px; }
.intro { font-size: 1.08rem; max-width: 46rem; color: var(--ink-soft); }
.intro p:first-child { margin-top: 1.4rem; }

/* Search */
.search { position: relative; margin: 22px 0 6px; max-width: 34rem; }
.search input { width: 100%; font: inherit; padding: 11px 14px; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.search input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.results { list-style: none; margin: 6px 0 0; padding: 0; position: absolute; left: 0; right: 0; z-index: 5;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.results:empty { display: none; }
.results li a { display: block; padding: 9px 14px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--shade); }
.results li:first-child a { border-top: 0; }
.results li a:hover, .results li a:focus { background: var(--shade); }
.results .meta { display: block; font-size: .85rem; color: var(--ink-faint); }

/* Dog cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .12s ease; }
a.card:hover { transform: translateY(-2px); border-color: var(--gold); }
.card .ph { aspect-ratio: 4 / 3; background: var(--shade); display: grid; place-items: center; overflow: hidden; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.card .ph .none { font-family: var(--display); font-size: 2.4rem; color: var(--gold); }
.card .body { padding: 10px 13px 13px; }
.card .call { font-family: var(--display); font-size: 1.2rem; color: var(--accent); }
.card .name { font-size: .92rem; color: var(--ink); line-height: 1.3; margin-top: 2px; }
.card .meta { font-size: .82rem; color: var(--ink-faint); margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.chip { font-size: .74rem; padding: 1px 7px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.chip.cleared { color: var(--ok); } .chip.affected { color: var(--bad); } .chip.carrier { color: var(--carrier); } .chip.unknown { color: var(--unknown); }

/* Notices (planned breedings, litters) */
.notices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.notice { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--gold); border-radius: 10px; padding: 14px 16px;
  box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block; }
.notice .kind { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.notice .what { font-family: var(--display); font-size: 1.2rem; color: var(--accent); margin: 2px 0 4px; }

/* Dog page */
.hero { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 8px; }
.hero .photo { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--rule); box-shadow: var(--shadow); background: var(--shade); }
.hero .photo.empty { aspect-ratio: 4 / 3; display: grid; place-items: center; font-family: var(--display); font-size: 3rem; color: var(--gold); }
.titled { font-family: var(--display); font-size: 1.15rem; color: var(--ink); margin: 0 0 .8rem; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 18px; margin: 0; }
.facts dt { color: var(--ink-faint); font-size: .9rem; padding-top: 2px; }
.facts dd { margin: 0; }
.reg { font-variant-numeric: tabular-nums; }
.badge { display: inline-block; font-size: .75rem; padding: 0 6px; border-radius: 4px; background: var(--shade); color: var(--ink-soft); margin-left: 6px; vertical-align: 1px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .92rem; padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--accent); color: var(--accent); background: transparent; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent); color: var(--surface); }
.btn.primary { background: var(--accent); color: var(--surface); }

table.data { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
table.data th, table.data td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--shade); vertical-align: top; }
table.data th { font-weight: 600; color: var(--ink-soft); background: var(--surface-2); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
table.data tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
td.ok { color: var(--ok); } td.bad { color: var(--bad); } td.carrier { color: var(--carrier); } td.unknown { color: var(--unknown); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 10px; }
.gallery a { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--rule); aspect-ratio: 1; background: var(--shade); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { font-size: .8rem; color: var(--ink-faint); }
.litter { margin: 0 0 14px; }
.litter ul { margin: 4px 0 0; padding-left: 1.2rem; columns: 2 18rem; }

/* Tiles (planned breeding) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 12px; margin: 10px 0; }
.tile { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; }
.tile .v { font-family: var(--display); font-size: 1.7rem; color: var(--accent); }
.tile .k { font-size: .82rem; color: var(--ink-faint); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: stretch; }
.pair .x { align-self: center; font-family: var(--display); font-size: 2rem; color: var(--gold); }
.parent { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.parent .ph { aspect-ratio: 4 / 3; background: var(--shade); overflow: hidden; }
.parent .ph img { width: 100%; height: 100%; object-fit: cover; }
.parent .body { padding: 10px 14px 14px; }
.parent .role { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.verdict { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 16px; }
.verdict strong { color: var(--accent); }
.puppies { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.status { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: 1px 8px; border-radius: 999px; }
.status.available { background: var(--ok); color: var(--surface); }
.status.reserved { background: var(--carrier); color: var(--surface); }
.status.placed { background: var(--unknown); color: var(--surface); }
.contact { margin-top: 18px; padding: 12px 16px; background: var(--shade); border-radius: 10px; }

/* Pedigree viewer */
.pv { margin-top: 10px; }
.pv-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.pv-bar .seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.pv-bar button { font: inherit; font-size: .88rem; padding: 5px 11px; border: 0; background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.pv-bar .seg button + button { border-left: 1px solid var(--rule); }
.pv-bar button[aria-pressed="true"] { background: var(--accent); color: var(--surface); }
.pv-bar .lbl { font-size: .85rem; color: var(--ink-faint); margin-right: 2px; }
.pv-bar .spacer { flex: 1; }
.pv-canvas { position: relative; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface-2); overflow: hidden;
  touch-action: none; cursor: grab; height: 520px; }
.pv-canvas.dragging { cursor: grabbing; }
.pv-canvas svg { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; }
.pv-hint { font-size: .8rem; color: var(--ink-faint); margin-top: 6px; }
.pv-link { fill: none; stroke: var(--gold); stroke-width: 1.4; }
.pv-box rect { fill: var(--surface); stroke: var(--rule); stroke-width: 1; }
.pv-box.public rect { stroke: var(--gold); stroke-width: 1.6; }
.pv-box.public:hover rect { fill: var(--shade); }
.pv-box.root rect { fill: var(--band); stroke: var(--gold); }
.pv-box.unknown rect { fill: transparent; stroke-dasharray: 4 3; }
.pv-t { font-family: var(--body); color: var(--ink); line-height: 1.18; padding: 3px 7px; overflow: hidden; height: 100%;
  display: flex; flex-direction: column; justify-content: center; }
.pv-t b, .pv-t i { flex-shrink: 0; }
.pv-t b { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; }
.pv-t b.tt { color: var(--accent); }
.pv-t i { font-style: normal; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-box.root .pv-t b, .pv-box.root .pv-t i { color: var(--band-text); }
.pv-box.unknown .pv-t i { color: var(--ink-faint); }
.pv noscript ul { columns: 2 16rem; }

footer.site { border-top: 1px solid var(--rule); padding: 20px 0 32px; font-size: .85rem; color: var(--ink-faint); }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr; gap: 16px; }
  .band nav { margin-left: 0; width: 100%; gap: 14px; }
  .pair { grid-template-columns: 1fr; }
  .pair .x { justify-self: center; }
  .pv-canvas { height: 420px; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dt { padding-top: 8px; }
}

@media print {
  :root { --paper: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --shadow: none; }
  body { background: #fff; font-size: 11pt; }
  .band { background: #fff; color: #000; border-bottom: 2px solid #C8A24A; }
  .band a, .band .tag { color: #000; }
  .band nav, .search, .pv-bar, .pv-hint, .actions, .crumbs, footer.site nav { display: none !important; }
  .pv-canvas { height: auto !important; border: 0; background: #fff; overflow: visible; }
  .pv-canvas svg { height: auto; max-height: 7in; }
  .card, .parent, .notice { break-inside: avoid; box-shadow: none; }
  h2 { break-after: avoid; }
  a { color: #000; text-decoration: none; }
  @page { margin: 12mm; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
