@import url("https://fonts.googleapis.com/css2?family=Vollkorn:wght@500;600;700&family=Alegreya+Sans:wght@400;500;700&display=swap");

:root {
  --navy: #182841;
  --ivory: #f4efe6;
  --paper: #fbf8f2;
  --gold: #c9962b;
  --gold-light: #e2b553;
  --ink: #182841;
  --muted: #6b6f78;
  --fg: 244 239 230;          /* text/lines on panels (ivory); navy in light mode */
  --line: rgba(24, 40, 65, 0.12);
  --serif: "Vollkorn", Georgia, serif;
  --sans: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --pad: clamp(16px, 3vw, 40px);
  --max: 1160px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; scrollbar-width: none; }
::-webkit-scrollbar { display: none; }

body {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ivory);
  color: var(--ink);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Header bar */
.nav {
  flex: none;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px var(--pad);
  background: rgba(24, 40, 65, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ivory);
}
.brand { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand img { height: 46px; width: auto; flex: none; align-self: center; margin-right: 4px; }
.brand b { font: 600 38px/1 var(--serif); letter-spacing: 0.005em; }
.brand small {
  font: 600 15px/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.links { display: flex; gap: 2px; }
.links a {
  font: 500 14px/1 var(--sans);
  padding: 10px 14px;
  border-radius: 6px;
  color: rgb(var(--fg) / 0.72);
  transition: color 0.2s, background 0.2s;
}
.links a:hover { color: var(--ivory); }
.links a[aria-current] { color: var(--ivory); background: rgb(var(--fg) / 0.09); }

.btn {
  display: inline-flex;
  align-items: center;
  font: 600 14px/1 var(--sans);
  padding: 12px 20px;
  border-radius: 6px;
  background: var(--gold);
  color: var(--navy);
  white-space: nowrap;
  transition: background 0.2s;
}
.btn:hover { background: var(--gold-light); }

/* Page frame */
.page {
  flex: 1;
  min-height: 0;
  width: min(var(--max), calc(100% - 2 * var(--pad)));
  margin: 0 auto;
  padding: clamp(16px, 3.2vh, 32px) 0;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2.2vh, 20px);
}
.title { display: flex; align-items: baseline; gap: 14px; flex: none; }
.title h1 { font: 600 26px/1.1 var(--serif); color: var(--navy); }
.title span { font-size: 14px; color: var(--muted); }

/* Facts list */
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 7px 22px; font-size: 14px; }
dl.facts dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
dl.facts dd { font-weight: 500; }

/* Home */
.home { background: var(--navy) url("img/9822.jpg") center 35% / cover no-repeat; }

/* Dogs */
.dogs { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); }
.dog {
  display: flex; flex-direction: column; gap: 16px; min-height: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 10px 18px;
}
.dog .photo { position: relative; flex: 1; min-height: 0; border-radius: 6px; overflow: hidden; }
.dog .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dog dl { padding: 0 8px; }
.tag {
  position: absolute; left: 10px; bottom: 10px;
  background: var(--navy); color: var(--ivory);
  font: 600 16px/1 var(--serif);
  padding: 8px 14px; border-radius: 6px;
}

/* Split pages (Puppies, Contact) */
.split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(14px, 2vw, 24px); }
.panel {
  background: var(--navy);
  color: var(--ivory);
  border-radius: 10px;
  padding: clamp(24px, 4vw, 56px);
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  min-height: 0;
}
.panel h1 { font: 600 28px/1.1 var(--serif); margin-bottom: 12px; }
.panel p { color: rgb(var(--fg) / 0.72); margin-bottom: 26px; max-width: 42ch; }
.panel dl { margin-bottom: 30px; font-size: 15px; gap: 10px 28px; }
.panel dl dt { color: var(--gold-light); }
.panel dd a { border-bottom: 1px solid var(--gold-light); }
.shot { min-height: 0; border-radius: 10px; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Gallery */
.gallery { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gallery button { border: 0; padding: 0; min-height: 0; overflow: hidden; cursor: zoom-in; border-radius: 6px; background: var(--line); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.gallery button:hover img { transform: scale(1.04); }
.lightbox {
  position: fixed; inset: 0; z-index: 10; display: none;
  align-items: center; justify-content: center;
  background: rgba(16, 27, 45, 0.96); cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); object-fit: contain; }
.lightbox .arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border: 0; border-radius: 6px;
  background: rgb(var(--fg) / 0.1); color: var(--ivory);
  font: 400 26px/1 var(--sans); cursor: pointer;
}
.lightbox .arrow:hover { background: rgb(var(--fg) / 0.2); }
.lightbox .prev { left: 16px; }
.lightbox .next { right: 16px; }

@media (max-width: 760px) {
  .nav { flex-wrap: wrap; gap: 6px 8px; padding: 10px var(--pad) 8px; }
  .brand b { font-size: 26px; }
  .brand img { height: 36px; }
  .brand small { display: none; }
  .nav .btn { padding: 9px 14px; font-size: 13px; }
  .links { order: 3; width: 100%; justify-content: space-between; }
  .links a { padding: 8px 10px; font-size: 13px; }

  .title h1 { font-size: 22px; }

  .dogs { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .dog { flex-direction: row; padding: 8px; gap: 14px; align-items: center; }
  .dog .photo { flex: 0 0 44%; height: 100%; }
  .tag { font-size: 13px; padding: 6px 10px; left: 6px; bottom: 6px; }
  .dog dl { padding: 0; font-size: 12px; gap: 3px 12px; }
  .dog dl dt { font-size: 9px; }

  .split { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
  .split.contact { grid-template-rows: minmax(0, 1fr) auto; }
  .panel { padding: 20px 22px; }
  .panel h1 { font-size: 22px; margin-bottom: 6px; }
  .panel p { margin-bottom: 14px; font-size: 14px; }
  .panel dl { margin-bottom: 16px; font-size: 13px; gap: 6px 20px; }

  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 6px; }
}

/* Bar at the bottom */
.nav { order: 2; }

/* Registry / health logos */
.marks {
  display: flex; align-items: center; gap: 16px;
  margin-right: auto;
  padding-left: 24px;
  border-left: 1px solid rgb(var(--fg) / 0.2);
}
.marks img { height: 48px; width: auto; display: block; opacity: 0.9; }
@media (max-width: 760px) {
  .marks { gap: 8px; padding-left: 12px; }
  .marks img { height: 30px; }
}
@media (max-width: 440px) {
  .brand img { height: 32px; }
  .brand b { font-size: 21px; }
  .marks { gap: 6px; padding-left: 8px; }
  .marks img { height: 24px; }
}
/* Juicy logo hovers */
.marks a {
  position: relative;
  display: block;
  border-radius: 50%;
  outline: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.7, 0.5, 1), opacity 0.25s;
}
.marks a img {
  transition: filter 0.3s, opacity 0.25s;
}
.marks:hover a { opacity: 0.45; }
.marks a:hover, .marks a:focus-visible {
  opacity: 1;
  transform: translateY(-5px) scale(1.16) rotate(-4deg);
}
.marks a:hover img, .marks a:focus-visible img {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(226, 181, 83, 0.75)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}
.marks a:active {
  transform: translateY(-2px) scale(1.04);
  transition-duration: 0.08s;
}
.marks a::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  transform: translate(-50%, 6px) rotate(4deg) scale(0.92);
  padding: 7px 11px;
  border-radius: 6px;
  background: var(--ivory);
  color: var(--navy);
  font: 600 12px/1 var(--sans);
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.3s cubic-bezier(0.34, 1.6, 0.5, 1);
}
.marks a:hover::after, .marks a:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0) rotate(4deg) scale(0.86);
}
@media (hover: none) { .marks a::after { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .marks a, .marks a::after { transition: opacity 0.2s; }
  .marks a:hover, .marks a:focus-visible { transform: none; }
}

/* Dogs: eight cards, 4 over 4 */
.dogs { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 18px); }
.dog { grid-column: span 3; gap: 10px; padding: 8px 8px 12px; }
.dog .photo.empty { background: var(--navy); display: grid; place-items: center; }
.dog .photo.empty img { width: 34%; height: auto; opacity: 0.35; }
.dog .photo img { object-position: 50% 38%; }
.dog dl.facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; padding: 0 6px; font-size: 13px; }
.dog dl.facts div { min-width: 0; }
.dog dl.facts dt { padding: 0; font-size: 10px; }
.dog dl.facts dd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .dogs { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .dog { grid-column: span 1; flex-direction: column; align-items: stretch; padding: 0; border: 0; }
  .dog .photo { flex: 1; height: auto; }
  .dog dl.facts { display: none; }
}

/* Home-page photo behind every page */
body { background: linear-gradient(rgba(16, 27, 45, 0.5), rgba(16, 27, 45, 0) 22%), var(--navy) url("img/9822.jpg") center 35% / cover no-repeat; }
.title h1 { color: var(--ivory); text-shadow: 0 1px 12px rgba(16, 27, 45, 0.55); }
.title span { color: rgb(var(--fg) / 0.85); text-shadow: 0 1px 10px rgba(16, 27, 45, 0.6); }
.dog { box-shadow: 0 10px 30px rgba(16, 27, 45, 0.25); border-color: transparent; }
.panel, .shot { box-shadow: 0 10px 30px rgba(16, 27, 45, 0.25); }

/* Custom cursor: picture fallback, replaced by the animated one in tap.js */
html { cursor: url("img/cursor.png") 2 2, auto; cursor: image-set(url("img/cursor.png") 1x, url("img/cursor@2x.png") 2x) 2 2, auto; }
a, button, .btn, label, summary, [role="button"] { cursor: url("img/cursor-link.png") 2 2, pointer; cursor: image-set(url("img/cursor-link.png") 1x, url("img/cursor-link@2x.png") 2x) 2 2, pointer; }
input, textarea { cursor: text; }
html.cc, html.cc * { cursor: none !important; }
html.cc input, html.cc textarea { cursor: text !important; }
.cursor { position: fixed; left: 0; top: 0; z-index: 9999; width: 32px; height: 32px; margin: -2.5px 0 0 -2.5px; pointer-events: none; will-change: transform; }
.cursor.off { opacity: 0; }
.cursor img { display: block; width: 32px; height: 32px; transform-origin: 2.5px 2.5px; }
.cursor.tap img { animation: tap 0.3s cubic-bezier(0.25, 0.8, 0.35, 1); }
@keyframes tap { 0% { transform: none; } 30% { transform: translate(-1.2px, -1.7px) scale(0.9); } 100% { transform: none; } }

/* Section changes: bar and background stay put, content glides in */
.nav { view-transition-name: nav; }
.page { view-transition-name: page; }
.cursor { view-transition-name: cursor; }
::view-transition-group(nav), ::view-transition-group(cursor) { animation: none; }
::view-transition-old(nav), ::view-transition-old(cursor) { display: none; }
::view-transition-new(nav), ::view-transition-new(cursor) { animation: none; }
::view-transition-old(root) { animation: 0.25s ease both fadeOut; }
::view-transition-new(root) { animation: 0.25s ease both fadeIn; }
::view-transition-group(page) { animation: none; }
::view-transition-old(page) { animation: 0.16s ease-in both pageOut; }
::view-transition-new(page) { animation: 0.34s cubic-bezier(0.2, 0.7, 0.3, 1) 0.08s both pageIn; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pageOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }

/* Fireflies over the background photo, behind everything else */
.fireflies { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; view-transition-name: fireflies; }
::view-transition-group(fireflies), ::view-transition-new(fireflies) { animation: none; }
::view-transition-old(fireflies) { display: none; }

/* Section-change fallback used by app.js when the browser has no view transitions */
html.fade-in .page { animation: 0.34s cubic-bezier(0.2, 0.7, 0.3, 1) both pageIn; }
html.fade-out .page { animation: 0.17s ease-in both pageOut; }

/* Sun-ray shader over the background photo, under the fireflies */
.rays { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; mix-blend-mode: screen; view-transition-name: rays; }
::view-transition-group(rays), ::view-transition-new(rays) { animation: none; }
::view-transition-old(rays) { display: none; }

/* One-page sections; images queued by app.js fade in as they arrive */
.view[hidden] { display: none !important; }
img.lazy { opacity: 0; transition: opacity 0.4s ease; }
img.lazy.loaded { opacity: 1; }

/* Logo: ivory like the registry logos; fades into its colours on first hover and stays (app.js) */
.brand { align-items: center; }
.brand .mark { display: block; flex: none; height: 46px; width: auto; aspect-ratio: 980 / 1000; margin-right: 4px; overflow: visible; }
.brand .mark path { fill: #f4efe6; fill-opacity: 0.9; transition: fill 0.9s ease, fill-opacity 0.9s ease; }
.brand.filled .mark .c-red { fill: #9a4528; fill-opacity: 1; }
.brand.filled .mark .c-gold { fill: #e6c66f; fill-opacity: 1; }
/* Words centred on the art: trim the type to its capitals so the centring is optical, not line-box */
.brand .words { display: flex; align-items: baseline; gap: 10px; }
.brand .words b, .brand .words small { text-box: trim-both cap alphabetic; }
@media (max-width: 760px) { .brand .mark { height: 36px; } }
@media (max-width: 440px) { .brand .mark { height: 32px; } }
.brand .words b { color: var(--gold-light); }
.brand .words small { color: var(--ivory); }

/* Registry logo fly-out (app.js) */
.fly-dim { position: fixed; inset: 0; z-index: 50; background: radial-gradient(circle at 50% 50%, rgba(16, 27, 45, 0.55), rgba(16, 27, 45, 0.82)); }
.fly-logo { position: fixed; z-index: 51; transform-origin: 0 0; object-fit: contain; will-change: transform; }
/* Logo art sits halfway between the screen edge and the words: same space on both sides */
.brand { gap: 0; }
.brand .mark { margin-right: var(--pad); }

/* Dog profiles (app.js): photo on the left, details on the right, over the card grid */
.view[data-view="dogs"] { position: relative; }
.dog[data-dog] { transition: transform 0.25s cubic-bezier(0.34, 1.5, 0.5, 1), box-shadow 0.25s; }
.dog[data-dog]:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(16, 27, 45, 0.32); }
.dog[data-dog]:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
.profile { position: absolute; left: 0; right: 0; display: flex; justify-content: center; gap: clamp(12px, 1.6vw, 20px); min-height: 0; }
.profile[hidden] { display: none; }
.p-stage { height: 100%; aspect-ratio: 1; flex: none; max-width: 58%; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(16, 27, 45, 0.3); background: var(--navy); }
.p-main { width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; display: block; }
.p-info { position: relative; flex: 0 1 460px; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(12px, 2vh, 20px);
  background: var(--navy); color: var(--ivory); border-radius: 10px; padding: clamp(20px, 3vw, 44px); box-shadow: 0 10px 30px rgba(16, 27, 45, 0.3); }
.p-name { font: 600 clamp(28px, 3.2vw, 40px)/1 var(--serif); color: var(--gold-light); }
.p-text { color: rgb(var(--fg) / 0.72); max-width: 42ch; }
.p-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.p-facts div { min-width: 0; }
.p-facts dt { color: var(--gold-light); padding: 0; }
.p-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.p-thumb { width: clamp(44px, 4.4vw, 60px); aspect-ratio: 1; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: none; opacity: 0.6; transition: opacity 0.2s, border-color 0.2s; }
.p-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-thumb:hover { opacity: 0.9; }
.p-thumb.on { opacity: 1; border-color: var(--gold-light); }
.p-nav { display: flex; gap: 8px; margin-top: auto; }
.p-nav button, .p-close { background: rgb(var(--fg) / 0.08); color: var(--ivory); border: 0; border-radius: 6px; font: 500 14px/1 var(--sans); padding: 10px 14px; transition: background 0.2s; }
.p-nav button:hover, .p-close:hover { background: rgb(var(--fg) / 0.16); }
.p-close { position: absolute; top: 12px; right: 12px; font-size: 22px; padding: 6px 11px 8px; }
.p-fly { position: fixed; z-index: 40; object-fit: cover; object-position: 50% 38%; border-radius: 8px; transform-origin: 0 0; pointer-events: none; will-change: transform; }
@media (max-width: 760px) {
  .profile { flex-direction: column; align-items: center; }
  .p-stage { height: auto; width: min(100%, 44vh); max-width: none; }
  .p-info { flex: 1 1 auto; width: 100%; padding: 16px; gap: 10px; justify-content: flex-start; }
  .p-text { display: none; }
  .p-facts { gap: 6px 16px; font-size: 13px; }
}

/* Same space on both sides of the divider line as between the logo art and the words */
@media (min-width: 761px) {
  .marks { margin-left: calc(var(--pad) - 24px); padding-left: var(--pad); }
}
/* Name stacked: Border Collies under Solid Gold */
.brand .words { flex-direction: column; align-items: flex-start; gap: 9px; }
.brand .words small { font-size: 13px; letter-spacing: 0.22em; }
/* Profile photo always square: sized from the profile box itself (container units), info panel matches its height */
.profile { container-type: size; align-items: center; }
.p-stage { height: auto; width: min(58cqw, 100cqh); max-width: none; aspect-ratio: 1; }
.p-info { height: min(58cqw, 100cqh); }
@media (max-width: 760px) {
  .profile { align-items: center; }
  .p-stage { width: min(100cqw, 46cqh); }
  .p-info { height: auto; flex: 1 1 auto; }
}
/* Half-screen windows (about 761–1100px wide): tighten the bar so everything fits */
@media (min-width: 761px) and (max-width: 1100px) {
  .nav { gap: 18px; }
  .marks { gap: 12px; margin-left: calc(var(--pad) - 18px); }
  .marks img { height: 40px; }
  .links a { padding: 10px 10px; }
  .brand b { font-size: 34px; }
}
@media (min-width: 761px) and (max-width: 980px) {
  .nav { gap: 14px; }
  .marks { gap: 8px; margin-left: calc(var(--pad) - 14px); }
  .marks img { height: 34px; }
  .links a { padding: 9px 8px; }
  .brand b { font-size: 28px; }
  .brand .mark { height: 40px; }
  .nav .btn { padding: 10px 14px; }
}

/* Card name sits in the facts (where Sex was); the photo tag only shows on phones, where facts are hidden */
.dog .photo .tag { display: none; }
.dog dl.facts .nm { align-self: center; }
.dog dl.facts .nm dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.dog dl.facts .nm dd { font: 600 19px/1.1 var(--serif); color: var(--navy); }
@media (max-width: 760px) { .dog .photo .tag { display: block; } }

/* Registered name under the call name, and full-width health rows in the profile */
.p-reg { margin-top: calc(-1 * clamp(6px, 1.2vh, 12px)); font: italic 400 15px/1.3 var(--serif); color: rgb(var(--fg) / 0.78); }
.p-facts .wide { grid-column: 1 / -1; }
.facts abbr { text-decoration: none; border-bottom: 1px dotted currentColor; }

/* Details panel: at least as tall as the photo, taller when the text needs it (never past the profile box) */
.p-info { height: auto; min-height: min(58cqw, 100cqh); max-height: 100cqh; }
@media (max-width: 760px) { .p-info { min-height: 0; max-height: none; } }

/* Pedigree. On wide screens: square photo on the left at full height; on the right the details box (laid out wide)
   with the four-generation pedigree under it. Elsewhere the pedigree is hidden and Sire/Dam stay in the details. */
.p-ped { display: none; }
.p-wrap, .p-top, .p-left, .p-bottom { display: contents; }
.p-shows { display: none; }
@media (min-width: 1400px) {
  .profile { left: calc(50% - (100vw - 2 * var(--pad)) / 2); right: auto; width: calc(100vw - 2 * var(--pad)); }
}
@container (min-width: 1500px) and (min-height: 600px) {
  .p-wrap { display: flex; flex-direction: column; gap: 20px; width: min(100%, 1660px); height: 100cqh; min-width: 0; }
  /* Show record: lives in the empty right side of the details box, so no other box changes size or moves */
  .p-bottom { display: flex; gap: 20px; flex: 1 1 auto; min-height: 0; }
  .p-shows:not([hidden]) { display: flex; flex-direction: column; flex: none; width: var(--top-h, 300px); min-height: 0;
    background: var(--navy); color: var(--ivory); border-radius: 10px; padding: 18px 22px 12px; box-shadow: 0 10px 30px rgba(16, 27, 45, 0.3); }
  .p-bottom > .p-ped { flex: 1 1 auto; min-width: 0; }

  .profile.has-shows .p-facts .f-show { display: none; }
  .p-top { display: flex; gap: 20px; flex: 0 0 57%; min-height: 0; }
  .profile .p-info { align-content: center; }
  .p-stage { flex: none; width: var(--top-h, 300px); height: var(--top-h, 300px); aspect-ratio: 1; }
  .profile .p-info { flex: 1 1 auto; min-width: 0; height: auto; min-height: 0; max-height: none; padding: 22px 32px; gap: 6px 22px;
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-content: center;
    grid-template-areas: "name reg thumbs" "text text thumbs" "facts facts facts"; grid-template-rows: auto auto auto; }
  .profile .p-name { grid-area: name; font-size: 42px; padding-right: 0; }
  .profile .p-reg { grid-area: reg; margin-top: 0; align-self: end; padding-bottom: 5px; font-size: 17px; }
  .profile .p-text { grid-area: text; display: block; font-size: 15.5px; max-width: 80ch; }
  .profile .p-thumbs { grid-area: thumbs; align-self: center; margin: 0 48px 0 0; }
  .profile .p-thumb { width: 54px; }
  .profile .p-facts { grid-area: facts; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.15fr); gap: 6px 36px;
    align-content: start; padding-right: 0; margin-top: 12px; grid-auto-flow: row dense; font-size: 15.5px; }
  .profile .p-facts dt { font-size: 11.5px; }
  .profile .p-facts table { font-size: 14px; }
  .p-facts .par { display: none; }
  .profile .p-facts > div { grid-column: 1; }
  .profile .p-facts > .par { display: none; }
  .p-facts > div:not(.f-ofa):not(.f-cg):not(.f-show):not(.par):not(.fc) { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: baseline; gap: 12px;
    padding-bottom: 6px; border-bottom: 1px solid rgb(var(--fg) / 0.1); }
  .p-facts > div:not(.f-ofa):not(.f-cg):not(.f-show) dt { margin: 0; }
  .p-facts .f-cg { margin-top: 8px; }
  .profile .p-facts > .f-cg { order: 1; }
  .profile .p-facts > .f-dna, .profile .p-facts > .f-dna.wide { grid-column: 1; order: 2; margin-top: 6px; }
  .profile .p-facts > .f-chic { grid-column: 2; grid-row: 1; grid-template-columns: auto minmax(0, 1fr); }
  .profile .p-facts > .f-dna { grid-template-columns: auto minmax(0, 1fr); }
  .profile .p-facts > .f-ofa { grid-column: 2; grid-row: 2 / span 4; }
  .profile .p-facts > .f-show { grid-column: 3; grid-row: 1 / span 5; }
  .p-facts:not(:has(.f-ofa)) > .f-show { grid-column: 2 / span 2; }
  .p-facts td { padding-top: 3px; padding-bottom: 3px; }
  .p-ped { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
    background: var(--navy); color: var(--ivory); border-radius: 10px; padding: 6px 14px; box-shadow: 0 10px 30px rgba(16, 27, 45, 0.3); }
  .pg { padding: 0 10px; }
  .pg i { margin-top: 0; line-height: 1.15; }
  .pg b { line-height: 1.15; }
  .pg.g1 b { font-size: 16px; }
  .pg.g2 b { font-size: 14px; }
  .pg.g4 b { font-size: 12.5px; line-height: 1.1; }
  .pg.g3 span { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
  .p-ped h3 { position: absolute; top: 12px; left: 22px; font-size: 19px; }
}
.p-ped h3 { font: 600 24px/1 var(--serif); color: var(--gold-light); padding-left: 6px; }
.pg-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 0.82fr 0.98fr 1.15fr 1.25fr; grid-template-rows: repeat(16, minmax(0, 1fr)); }
.pg { display: flex; align-items: center; min-height: 0; overflow: hidden; padding: 1px 12px; border-left: 1px solid rgba(232, 197, 106, 0.22); border-top: 1px solid rgb(var(--fg) / 0.08); }
.pg.g1 { border-left: 0; }
.pg.first { border-top: 0; }
.pg span { display: block; min-width: 0; overflow-wrap: break-word; }
.pg b { display: block; font: 600 14px/1.2 var(--sans); color: var(--ivory); }
.pg.g1 b { font: 600 17px/1.2 var(--serif); }
.pg.g2 b { font: 600 15px/1.2 var(--serif); }
.pg small { display: block; font: 600 10px/1.25 var(--sans); letter-spacing: 0.04em; color: var(--gold-light); }
.pg i { display: block; margin-top: 3px; font: 400 11px/1.25 var(--sans); color: rgb(var(--fg) / 0.55); }
.pg.g4 b { font-size: 12px; }
.pg.g5 { padding: 0 8px; }
.pg.g5 span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg.g5 small, .pg.g5 b { display: inline; font-size: 11px; line-height: 1.1; }
.pg.g5 small { font-size: 9.5px; margin-right: 4px; }
.pg.g5 b { font-weight: 500; color: rgb(var(--fg) / 0.85); }
.pg.g5 small + b + small { margin: 0 0 0 4px; }
.pg.lorem b { color: rgb(var(--fg) / 0.45); }

/* Profile tables: OFA results and colour genetics */
.p-facts table { width: 100%; border-collapse: collapse; margin-top: 4px; font: 500 13px/1.3 var(--sans); }
.p-facts td, .p-facts th { padding: 4px 8px 4px 0; text-align: left; vertical-align: top; border-bottom: 1px solid rgb(var(--fg) / 0.1); }
.p-facts tr:last-child td { border-bottom: 0; }
.t-ofa td:first-child { color: rgb(var(--fg) / 0.7); white-space: nowrap; }
.t-ofa td:last-child { color: rgb(var(--fg) / 0.55); font-size: 11.5px; white-space: nowrap; padding-right: 0; }
.t-cg { table-layout: auto; }
.t-cg td, .t-cg th { padding-right: 10px; }
.t-cg th { font: 600 11px/1 var(--sans); letter-spacing: 0.08em; color: var(--gold-light); padding-bottom: 5px; }
.t-cg td { white-space: nowrap; }
/* Fifth-column rules (unused while the chart shows four generations) */
.pg.g5 span { line-height: 1.15; }
.pg.g4 b { font-size: 13px; line-height: 1.15; }

/* Details panel on shorter profiles: tighter spacing so long records (tables) still fit without scrolling */
@container (max-height: 860px) {
  .p-info { gap: 10px; padding-top: 24px; padding-bottom: 24px; }
  .p-name { font-size: 34px; }
  .p-facts { gap: 8px 20px; }
  .p-thumb { width: 46px; }
}
@container (max-height: 780px) {
  .p-text { display: none; }
}
@container (max-height: 640px) {
  .p-info { gap: 7px; padding-top: 18px; padding-bottom: 18px; }
  .p-reg { font-size: 14px; }
  .p-facts { gap: 5px 18px; }
  .p-facts td { padding-top: 2px; padding-bottom: 2px; }
  .p-thumb { width: 40px; }
}
@container (max-height: 560px) {
  .p-name { font-size: 30px; }
  .p-info { gap: 5px; }
  .p-facts dd, .p-facts table { font-size: 12.5px; }
}
@container (max-height: 560px) {
  .p-thumb { width: 36px; }
  .p-nav button { padding: 8px 12px; }
}

/* Profile Previous/Next: arrows at the screen edges, level with the photo (moved to <body> by app.js) */
body > .p-nav { position: fixed; inset: 0; pointer-events: none; z-index: 40; opacity: 0; transition: opacity 0.3s ease; margin: 0; display: block; }
body > .p-nav[hidden] { display: none; }
body > .p-nav.on { opacity: 1; }
body > .p-nav button { pointer-events: auto; position: absolute; top: var(--ay, 40%); transform: translateY(-50%); width: 56px; height: 96px; padding: 0;
  display: grid; place-items: center; background: none; border-radius: 8px; color: var(--ivory); transition: color 0.2s, background 0.2s; }
body > .p-nav .p-prev { left: var(--ax, 8px); }
body > .p-nav .p-next { right: var(--ax, 8px); }
body > .p-nav button, body > .p-nav button:hover { background: none; }
body > .p-nav svg { transition: transform 0.35s cubic-bezier(0.34, 1.8, 0.5, 1), filter 0.25s ease; }
body > .p-nav button:hover, body > .p-nav button:focus-visible { color: var(--gold-light); }
body > .p-nav .p-prev:hover svg, body > .p-nav .p-prev:focus-visible svg { transform: translateX(-6px) scale(1.22); }
body > .p-nav .p-next:hover svg, body > .p-nav .p-next:focus-visible svg { transform: translateX(6px) scale(1.22); }
body > .p-nav button:hover svg, body > .p-nav button:focus-visible svg { filter: drop-shadow(0 0 8px rgba(226, 181, 83, 0.75)) drop-shadow(0 1px 6px rgba(16, 27, 45, 0.7)); }
body > .p-nav button:active svg { transform: scale(0.85); transition-duration: 0.08s; }
body > .p-nav .p-prev.kick svg { animation: kickL 0.45s cubic-bezier(0.34, 1.6, 0.5, 1); }
body > .p-nav .p-next.kick svg { animation: kickR 0.45s cubic-bezier(0.34, 1.6, 0.5, 1); }
@keyframes kickL { 0% { transform: scale(0.8); color: var(--gold-light); } 40% { transform: translateX(-14px) scale(1.3); color: var(--gold-light); } 100% { transform: none; } }
@keyframes kickR { 0% { transform: scale(0.8); color: var(--gold-light); } 40% { transform: translateX(14px) scale(1.3); color: var(--gold-light); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { body > .p-nav svg { transition: none; animation: none !important; } }
body > .p-nav svg { width: 24px; height: 48px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 6px rgba(16, 27, 45, 0.7)); }
@media (max-width: 760px) {
  body > .p-nav button { width: 40px; height: 64px; }
  body > .p-nav svg { filter: drop-shadow(0 0 3px rgba(16, 27, 45, 0.95)) drop-shadow(0 1px 8px rgba(16, 27, 45, 0.8)); }
  body > .p-nav svg { width: 16px; height: 32px; }
}

/* Photo protection: no dragging, selecting or long-press saving of images (right-click and shortcuts are blocked in app.js) */
img { -webkit-user-drag: none; user-drag: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body { -webkit-touch-callout: none; }

/* Show record: one line per show with its ribbons in AKC colours (hover for class and award names) */
.t-show { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); column-gap: 26px; margin-top: 2px; font-size: 13.5px; }
.sr { display: grid; grid-template-columns: 76px 48px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 3px 0; border-bottom: 1px solid rgb(var(--fg) / 0.1); }
.rbs { display: flex; gap: 3px; }
.rbs i { display: block; width: 22px; height: 13px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28); }
.sr-code { color: rgb(var(--fg) / 0.6); font-size: 0.9em; white-space: nowrap; }
.sr-show { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-date { color: rgb(var(--fg) / 0.55); font-size: 0.9em; white-space: nowrap; }
.t-show.lorem .sr-show, .t-show.lorem .sr-date, .t-show.lorem .sr-code { color: rgb(var(--fg) / 0.45); }
.rb-blue { background: #1f4fbf; }
.rb-red { background: #c4262e; }
.rb-yellow { background: #f2c230; }
.rb-white { background: #f7f5ef; }
.rb-purple { background: #6c2c91; }
.rb-pw { background: linear-gradient(90deg, #6c2c91 50%, #f7f5ef 50%); }
.rb-bw { background: linear-gradient(90deg, #1f4fbf 50%, #f7f5ef 50%); }
.rb-pg { background: linear-gradient(90deg, #6c2c91 50%, #d8a92e 50%); }
.rb-rw { background: linear-gradient(90deg, #c4262e 50%, #f7f5ef 50%); }
.rb-lbw { background: linear-gradient(90deg, #8ec6f2 50%, #f7f5ef 50%); }
.rb-rwb { background: linear-gradient(90deg, #c4262e 33.33%, #f7f5ef 33.33% 66.67%, #1f4fbf 66.67%); }

/* Award whose ribbon colour isn't confirmed yet: outlined swatch */
.rb-unk { background: transparent; box-shadow: inset 0 0 0 1px rgb(var(--fg) / 0.55) !important; }
/* Nine dogs: 5 over 4, second row centred */
.dogs { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.dog { grid-column: span 2; }
.dogs > .dog:nth-child(6) { grid-column: 2 / span 2; }
@media (max-width: 760px) {
  .dogs { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(0, 1fr)); }
  .dog, .dogs > .dog:nth-child(6) { grid-column: span 1; }
}

/* Profile facts in two groups (app.js): flat list on narrow layouts, two stacked columns on wide ones */
.p-facts .fc { display: contents; }
@container (min-width: 1500px) and (min-height: 600px) {
  .profile .p-facts { display: grid; grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr); gap: 0 40px; }
  .profile .p-facts > .fc { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 0; border: 0; grid-row: 1; }
  .profile .p-facts > .fc1 { grid-column: 1; }
  .profile .p-facts > .fc2 { grid-column: 2; }
  .profile .p-facts .fc > div:not(.f-ofa):not(.f-cg):not(.f-show):not(.par) { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: baseline; gap: 12px;
    padding-bottom: 6px; border-bottom: 1px solid rgb(var(--fg) / 0.1); }
  .profile .p-facts .fc > .f-chic { grid-template-columns: 52px minmax(0, 1fr); }
  .profile .p-facts .fc > div { grid-column: auto; grid-row: auto; order: 0; margin-top: 0; }
  .profile .p-facts .fc > .par { display: none; }
  .profile .p-facts .fc2 > div + div { margin-top: 8px; }
  .profile .p-facts > .fc2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: start; gap: 8px 36px; }
  .profile .p-facts .fc2 > .f-chic { grid-column: 1; }
  .profile .p-facts .fc2 > .f-ofa { grid-column: 1; }
  .profile .p-facts .fc2 > .f-show { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; }
  .profile .p-facts .fc2:has(.t-show .sr:nth-child(6)) > .f-show { grid-column: 1 / -1; grid-row: auto; }
  .profile .p-facts .fc2:not(:has(.f-ofa)) > .f-show { grid-column: 1 / -1; grid-row: auto; }
}
/* Ribbons stand upright like real ribbons. Two-colour ribbons split left/right by default; add class "tb" to split top/bottom */
.rbs { align-items: center; }
.rbs i { width: 12px; height: 21px; border-radius: 2px 2px 1px 1px; }
.sr { grid-template-columns: 48px 52px minmax(0, 1fr) auto; padding: 1px 0; }
.rbs i.tb.rb-pw { background: linear-gradient(180deg, #6c2c91 50%, #f7f5ef 50%); }
.rbs i.tb.rb-bw { background: linear-gradient(180deg, #1f4fbf 50%, #f7f5ef 50%); }
.rbs i.tb.rb-pg { background: linear-gradient(180deg, #6c2c91 50%, #d8a92e 50%); }
.rbs i.tb.rb-rw { background: linear-gradient(180deg, #c4262e 50%, #f7f5ef 50%); }
.rbs i.tb.rb-lbw { background: linear-gradient(180deg, #8ec6f2 50%, #f7f5ef 50%); }
.rbs i.tb.rb-rwb { background: linear-gradient(180deg, #c4262e 33.33%, #f7f5ef 33.33% 66.67%, #1f4fbf 66.67%); }

/* Show record box (wide layout): one show per row, ribbons on the left; pager only when the list does not fit */
.p-shows h3 { font: 600 19px/1 var(--serif); color: var(--gold-light); margin-bottom: 8px; }
.ps-list { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.ps-list .sr { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "rb show code" "rb date code"; column-gap: 10px; row-gap: 0;
  padding: 6px 0; font-size: 14px; flex: none; }
.ps-list .rbs { grid-area: rb; }
.ps-list .rbs i { width: 12px; height: 28px; }
.ps-list .sr-show { grid-area: show; }
.ps-list .sr-date { grid-area: date; font-size: 12.5px; }
.ps-list .sr-code { grid-area: code; align-self: center; font-size: 12.5px; }
.ps-pager { display: none; align-items: center; justify-content: center; gap: 14px; padding-top: 10px; border-top: 1px solid rgb(var(--fg) / 0.1); }
.p-shows.paged .ps-pager { display: flex; }
.ps-pager button { background: rgb(var(--fg) / 0.08); color: var(--ivory); border: 0; border-radius: 6px; font: 500 18px/1 var(--sans); padding: 5px 13px 7px; }
.ps-pager button:hover { background: rgb(var(--fg) / 0.16); }
.ps-page { font: 500 13px/1 var(--sans); color: rgb(var(--fg) / 0.7); min-width: 44px; text-align: center; }
/* AKC 4-6 Month Beginner Puppy ribbons (Sanctioned Regulations, Section 4) */
.rb-orange { background: #ec7a1c; }
.rb-lavender { background: #b49ad8; }
.rb-rose { background: #e2668e; }
.rb-brown { background: #7a4a26; }
.rb-lgreen { background: #9bd38a; }
.rb-gray { background: #9a9ea3; }
.rb-pkg { background: linear-gradient(90deg, #f29ac0 50%, #4fae5a 50%); }
.rbs i.tb.rb-pkg { background: linear-gradient(180deg, #f29ac0 50%, #4fae5a 50%); }

/* Dog cards: name only (born, registry and health stay in the markup for the profile) */
.dog dl.facts > div:not(.nm) { display: none; }
.dog dl.facts { grid-template-columns: minmax(0, 1fr); }
.dog dl.facts .nm dd { font-size: 21px; }

/* Link to a dog's Optimal Selection report (opens the PDF in a new tab) */
.doc-link { color: var(--gold-light); text-decoration: underline; text-decoration-color: rgba(226, 181, 83, 0.45); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.doc-link:hover, .doc-link:focus-visible { text-decoration-color: var(--gold-light); }

/* Show record box: one line per show (ribbons, club, date, result) so more fit per page */
.ps-list .sr { grid-template-columns: 34px minmax(0, 1fr) auto auto; grid-template-areas: "rb show date code"; column-gap: 10px; padding: 5px 0; font-size: 13.5px; align-items: center; }
.ps-list .rbs i { width: 10px; height: 16px; }
.ps-list .sr-date { font-size: 12px; }
.ps-list .sr-code { font-size: 12px; min-width: 40px; text-align: right; }

/* Page title hidden while a dog profile is open */
.view:has(> .profile:not([hidden])) > .title { visibility: hidden; }

/* Photo thumbnails removed: photos cross-fade instead */
.p-thumbs { display: none !important; }

/* Arrows: no browser focus box (keyboard focus shows as the gold glow instead) */
body > .p-nav button { outline: none; -webkit-tap-highlight-color: transparent; }

/* Photo strip: centre of the bottom bar while a profile is open; the photo on show sits in the middle slot */
.nav .p-strip { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) translateY(6px); display: grid; grid-template-columns: repeat(5, auto);
  align-items: center; gap: 8px; opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease; }
.nav .p-strip[hidden] { display: none; }
.nav .p-strip.on { opacity: 1; transform: translate(-50%, -50%); }
.ps-slot { width: 46px; height: 46px; padding: 0; border: 2px solid transparent; border-radius: 7px; overflow: hidden; background: rgb(var(--fg) / 0.06);
  opacity: 0.55; outline: none; -webkit-tap-highlight-color: transparent; transition: opacity 0.2s, transform 0.25s cubic-bezier(0.34, 1.6, 0.5, 1), border-color 0.2s; }
.ps-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ps-slot:hover, .ps-slot:focus-visible { opacity: 0.95; transform: scale(1.08); }
.ps-slot.on { width: 56px; height: 56px; opacity: 1; border-color: var(--gold-light); }
.ps-slot.empty { visibility: hidden; pointer-events: none; }
@media (min-width: 761px) and (max-width: 1450px) {
  .nav.strip-open .marks { opacity: 0; visibility: hidden; }
}
@media (max-width: 760px) {
  .nav .p-strip, .nav .p-strip.on { position: static; transform: none; order: 2; width: 100%; justify-content: center; }
  .ps-slot { width: 38px; height: 38px; } .ps-slot.on { width: 46px; height: 46px; }
}
.nav .marks { transition: opacity 0.3s ease, visibility 0.3s; }

/* Dogs grid: 15 dogs as three rows of five (phones: three columns) */
.dogs { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); }
.dog, .dogs > .dog:nth-child(6) { grid-column: auto; }
@media (max-width: 760px) {
  .dogs { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(0, 1fr)); }
}

/* Tabbed pages (Puppies, About): photo + one navy panel; tabs show one pane at a time so nothing scrolls */
.tabbed { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr); gap: clamp(14px, 2vw, 24px); }
.tpanel { min-height: 0; display: flex; flex-direction: column; background: var(--navy); color: var(--ivory); border-radius: 10px;
  padding: clamp(20px, 3.2vh, 36px) clamp(22px, 2.8vw, 44px); box-shadow: 0 10px 30px rgba(16, 27, 45, 0.25); }
.t-head { display: flex; align-items: baseline; gap: 10px 30px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid rgb(var(--fg) / 0.12); flex: none; }
.t-head h1 { font: 600 30px/1.1 var(--serif); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.tabs button { background: none; border: 0; color: rgb(var(--fg) / 0.6); font: 500 15.5px/1 var(--sans); padding: 6px 0; position: relative; outline: none; cursor: pointer; transition: color 0.2s; }
.tabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--gold-light); transform: scaleX(0); transition: transform 0.3s cubic-bezier(0.34, 1.5, 0.5, 1); }
.tabs button:hover, .tabs button:focus-visible { color: var(--ivory); }
.tabs button[aria-selected="true"] { color: var(--gold-light); }
.tabs button[aria-selected="true"]::after { transform: none; }
.t-body { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.pane { position: absolute; inset: 0; display: none; flex-direction: column; justify-content: center; align-items: flex-start; gap: clamp(12px, 2.4vh, 22px); padding-top: 12px; }
.pane.on { display: flex; }
.pane p { color: rgb(var(--fg) / 0.78); max-width: 70ch; }
.pane .lead { font-size: 17px; color: var(--ivory); max-width: 64ch; }
.pane h2 { font: 600 19px/1.2 var(--serif); color: var(--gold-light); margin-bottom: 4px; }
.pane a:not(.btn) { color: var(--gold-light); border-bottom: 1px solid rgba(226, 181, 83, 0.45); }
.pane dl.facts dt { color: var(--gold-light); }
.t-link { background: none; border: 0; color: var(--gold-light); font: 500 15px/1 var(--sans); padding: 4px 0; cursor: pointer; outline: none; }
.t-link:hover, .t-link:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
/* Litters */
.litters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: 100%; }
.litter { background: rgb(var(--fg) / 0.05); border: 1px solid rgb(var(--fg) / 0.1); border-radius: 8px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.litter h2 { margin: 0; font-size: 21px; color: var(--ivory); }
.litter dl.facts { gap: 5px 16px; }
.litter .t-link { margin-top: auto; }
.badge { font: 700 11px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; background: var(--gold); color: var(--navy); padding: 6px 9px; border-radius: 4px; }
.badge.soft { background: rgb(var(--fg) / 0.1); color: var(--ivory); }
/* How it works */
.steps-list { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; width: 100%; }
.steps-list li { counter-increment: s; display: flex; flex-direction: column; gap: 6px; position: relative; }
.steps-list li::before { content: counter(s); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--navy); font: 700 16px/1 var(--serif); margin-bottom: 4px; }
.steps-list li:not(:last-child)::after { content: ""; position: absolute; top: 17px; left: 44px; right: -8px; height: 1px; background: rgba(226, 181, 83, 0.35); }
.steps-list b { font: 600 18px/1.2 var(--serif); }
.steps-list span { color: rgb(var(--fg) / 0.75); font-size: 14.5px; }
.facts.price { grid-template-columns: repeat(3, auto auto); gap: 6px 14px; align-items: baseline; }
.facts.price dd { font: 600 20px/1 var(--serif); margin-right: 24px; }
/* What's included */
.incl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; width: 100%; }
.incl > div { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 8px; background: rgb(var(--fg) / 0.05); border-top: 2px solid var(--gold); }
.incl b { font: 600 17px/1.2 var(--serif); }
.incl span { color: rgb(var(--fg) / 0.75); font-size: 14px; }
/* FAQ */
/* Apply */
form.apply { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.a-progress { display: flex; gap: 8px; }
.a-progress span { flex: 1; font: 700 11px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: rgb(var(--fg) / 0.45); padding-top: 9px; border-top: 3px solid rgb(var(--fg) / 0.15); transition: color 0.3s, border-color 0.3s; }
.a-progress span.on { color: var(--gold-light); border-color: var(--gold-light); }
.a-progress span.done { color: rgb(var(--fg) / 0.8); border-color: var(--gold); }
.a-step { border: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.a-step[hidden] { display: none; }
.a-step label, .a-checks { display: flex; flex-direction: column; gap: 6px; font: 700 11px/1.2 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: rgb(var(--fg) / 0.65); }
.a-step .wide { grid-column: 1 / -1; }
.a-step input:not([type=checkbox]), .a-step select, .a-step textarea { font: 400 15px/1.3 var(--sans); color: var(--ivory); background: rgb(var(--fg) / 0.07); border: 1px solid rgb(var(--fg) / 0.16);
  border-radius: 6px; padding: 9px 11px; outline: none; text-transform: none; letter-spacing: 0; transition: border-color 0.2s, background 0.2s; width: 100%; resize: none; }
.a-step select option { color: var(--ink); }
.a-step input:focus, .a-step select:focus, .a-step textarea:focus { border-color: var(--gold-light); background: rgb(var(--fg) / 0.1); }
.a-step label.bad input, .a-step label.bad select, .a-step label.bad textarea { border-color: #e0766a; }
.a-checks { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.a-checks > span { width: 100%; }
.a-checks label { flex-direction: row; align-items: center; gap: 8px; font: 400 15px/1 var(--sans); letter-spacing: 0; text-transform: none; color: var(--ivory); cursor: pointer; }
.a-checks input { accent-color: var(--gold-light); width: 16px; height: 16px; }
.a-nav { display: flex; align-items: center; gap: 18px; }
.a-nav .a-note { margin-left: auto; font-size: 13px; color: rgb(var(--fg) / 0.55); }
.a-nav .btn { border: 0; cursor: pointer; font-family: var(--sans); }
/* Health / breed / raising columns */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2.6vh, 26px) 40px; width: 100%; }
.cols p { font-size: 15px; }
/* Shorter windows: tighten */
@media (max-height: 820px) {
  .pane .lead { font-size: 16px; }
  .steps-list span, .incl span, .cols p, .pane p { font-size: 14px; }
  .a-step { gap: 10px 16px; }
  .a-step input:not([type=checkbox]), .a-step select, .a-step textarea { padding: 7px 10px; }
}
/* Medium widths: drop the photo, then fewer columns */
@media (max-width: 1250px) {
  .tabbed { grid-template-columns: minmax(0, 1fr); }
  .tabbed > .shot { display: none; }
}
@media (max-width: 900px) {
  .litters { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .litter { padding: 12px 14px; gap: 6px; flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 14px; }
  .litter dl.facts, .litter p { width: 100%; }
  .steps-list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .steps-list li { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; padding-left: 40px; }
  .steps-list li::before { position: absolute; left: 0; top: 0; width: 28px; height: 28px; font-size: 14px; margin: 0; }
  .steps-list li::after { display: none; }
  .steps-list span { width: 100%; }
  .incl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .a-step { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tpanel { padding: 16px 16px 14px; }
  .t-head { gap: 6px 14px; padding-bottom: 10px; }
  .t-head h1 { font-size: 22px; }
  .tabs { gap: 2px 14px; }
  .tabs button { font-size: 14px; }
  .pane { gap: 10px; padding-top: 10px; justify-content: flex-start; }
  .pane .lead { font-size: 14.5px; }
  .pane p, .steps-list span, .incl span, .cols p { font-size: 13px; line-height: 1.4; }
  .pane h2, .incl b, .steps-list b { font-size: 15px; }
  .incl > div { padding: 9px 10px; gap: 3px; }
  .cols { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .facts.price { grid-template-columns: auto 1fr; }
  .a-step { gap: 8px 10px; }
  .a-step input:not([type=checkbox]), .a-step select, .a-step textarea { font-size: 14px; padding: 6px 8px; }
  .a-nav .a-note { display: none; }
}

/* Lean puppy pages */
.litters.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; }
.facts.info { grid-template-columns: auto 1fr; gap: 12px 30px; font-size: 16px; }
.facts.info dt { padding-top: 4px; }
@media (max-width: 900px) { .litters.two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .facts.info { gap: 8px 16px; font-size: 14px; } }
.terms p { font-size: 15px; }

/* Dogs: Current / In the past, one group at a time (two rows of five, short rows centred by app.js) */
.dogs { grid-template-columns: repeat(10, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.dog { grid-column: span 2; }
.dog[hidden] { display: none; }
.dog-groups-unused { display: flex; gap: 18px; align-self: baseline; margin-left: 6px; }
.dog-groups button { background: none; border: 0; padding: 4px 0; font: 500 15px/1 var(--sans); color: rgb(var(--fg) / 0.7);
  text-shadow: 0 1px 10px rgba(16, 27, 45, 0.6); position: relative; cursor: pointer; outline: none; transition: color 0.2s; }
.dog-groups button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; background: var(--gold-light);
  transform: scaleX(0); transition: transform 0.3s cubic-bezier(0.34, 1.5, 0.5, 1); }
.dog-groups button:hover, .dog-groups button:focus-visible { color: var(--ivory); }
.dog-groups button[aria-selected="true"] { color: var(--gold-light); }
.dog-groups button[aria-selected="true"]::after { transform: none; }
@media (max-width: 760px) {
  .dogs { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .dog, .dogs > .dog { grid-column: auto !important; }
}

/* Dogs: square cards in evenly filled, centred rows (size and row width set by app.js) */
.dogs { display: flex !important; flex-wrap: wrap; justify-content: center; align-content: center; gap: clamp(10px, 1.4vw, 18px);
  flex: 1; min-height: 0; margin: 0 auto; max-width: 100%; }
.dogs > .dog { flex: none; width: var(--card, 220px); height: var(--card, 220px); grid-column: auto !important; }
.dogs > .dog[hidden] { display: none; }
@media (max-width: 760px) { .dogs { gap: 8px; } }

/* Dog cards: photo only, no white frame; name on a tag over the photo */
.dogs > .dog { background: none; border: 0; padding: 0; gap: 0; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(16, 27, 45, 0.3); }
.dogs > .dog .photo { flex: 1; border-radius: 10px; }
.dogs > .dog dl.facts { display: none; }
.dogs > .dog .photo .tag { display: block; left: 12px; bottom: 12px; font-size: 18px; padding: 8px 14px; }
@media (max-width: 760px) { .dogs > .dog .photo .tag { left: 8px; bottom: 8px; font-size: 14px; padding: 6px 10px; } }

/* Members gate: "waiting for approval" */
.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(16, 27, 45, 0.55); backdrop-filter: blur(3px); padding: 16px; }
.gate[hidden] { display: none; }
.gate-box { background: var(--navy); color: var(--ivory); border-radius: 10px; padding: 28px 30px 22px; max-width: 420px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4); }
.gate-box h2 { font: 600 22px/1.2 var(--serif); color: var(--gold-light); margin-bottom: 10px; }
.gate-box p { color: rgb(var(--fg) / 0.8); margin-bottom: 20px; }
.gate-actions { display: flex; justify-content: flex-end; align-items: center; gap: 18px; }
.gate-actions .btn { border: 0; cursor: pointer; font-family: var(--sans); }

/* Members page (admins) */
.tpanel.members { flex: 1; min-height: 0; width: 100%; }
.members .m-note { margin-left: auto; font-size: 14px; color: var(--gold-light); }
.m-body { position: relative; flex: 1; min-height: 0; overflow: hidden; padding-top: 6px; }
.m-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 150px 210px; align-items: center; gap: 16px; height: 62px; border-bottom: 1px solid rgb(var(--fg) / 0.1); transition: opacity 0.2s; }
.m-row.busy { opacity: 0.4; pointer-events: none; }
.m-who { min-width: 0; display: flex; flex-direction: column; }
.m-who b { font-weight: 500; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-who span, .m-date { font-size: 13.5px; color: rgb(var(--fg) / 0.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-status { justify-self: start; font: 700 11px/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; padding: 6px 9px; border-radius: 4px; background: rgb(var(--fg) / 0.1); }
.m-status.wait { background: var(--gold); color: var(--navy); }
.m-status.ok { background: rgba(120, 190, 130, 0.25); color: #bfe6c4; }
.m-status.admin { background: rgba(226, 181, 83, 0.2); color: var(--gold-light); }
.m-status.muted { color: rgb(var(--fg) / 0.55); }
.m-actions { display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.m-actions .btn { border: 0; cursor: pointer; font-family: var(--sans); padding: 8px 16px; }
.m-del { color: rgb(var(--fg) / 0.6); }
.m-del.sure { color: #f08a7e; }
.m-msg { padding: 24px 0; color: rgb(var(--fg) / 0.7); }
.m-pager { display: flex; justify-content: center; align-items: center; gap: 14px; padding-top: 10px; }
.m-pager button { background: rgb(var(--fg) / 0.08); color: var(--ivory); border: 0; border-radius: 6px; font: 500 18px/1 var(--sans); padding: 5px 13px 7px; cursor: pointer; }
.m-page { font-size: 13px; color: rgb(var(--fg) / 0.7); }
@media (max-width: 760px) {
  .m-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; height: auto; padding: 8px 0; gap: 4px 10px; }
  .m-date { display: none; }
  .m-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .m-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.m-pager[hidden] { display: none; }
.nav .links a { white-space: nowrap; }
@media (min-width: 761px) and (max-width: 1420px) { body:not([data-only]) .nav .marks { display: none; } }

/* Setup mode: only Home in the bar (remove data-only from <body> to relaunch) */
body[data-only] .nav .links a:not(.nav-members), body[data-only] .nav > .btn:not(.nav-login) { display: none !important; }

/* Log in / Log out: outlined so Contact stays the main button */
.nav-login { border: 1.5px solid rgba(226, 181, 83, 0.7); background: transparent; color: var(--gold-light); cursor: pointer; margin-left: 10px; }
.nav-login:hover, .nav-login:focus-visible { background: rgba(226, 181, 83, 0.14); outline: none; }
.nav-login[hidden] { display: none; }
body[data-only] .nav > .nav-login:not([hidden]) { display: inline-flex !important; }

/* Log in / Sign up dialog */
.auth { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 16px; background: rgba(16, 27, 45, 0.6); backdrop-filter: blur(3px); }
.auth[hidden], .auth-form[hidden], .auth-tabs[hidden], .auth-x[hidden] { display: none; }
.auth-box { position: relative; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: hidden; background: var(--navy); color: var(--ivory);
  border-radius: 10px; padding: 26px 28px 22px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); display: flex; flex-direction: column; gap: 14px; }
.auth-box h2 { font: 600 24px/1.1 var(--serif); color: var(--gold-light); }
.auth-x { position: absolute; top: 12px; right: 14px; background: none; border: 0; color: rgb(var(--fg) / 0.7); font: 400 26px/1 var(--sans); cursor: pointer; padding: 4px 8px; }
.auth-x:hover { color: var(--ivory); }
.auth-tabs { margin-top: -4px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.a-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.a-grid .wide { grid-column: 1 / -1; }
.a-grid label { display: flex; flex-direction: column; gap: 5px; font: 700 10.5px/1.2 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: rgb(var(--fg) / 0.65); }
.a-grid input, .a-grid select { font: 400 15px/1.3 var(--sans); color: var(--ivory); background: rgb(var(--fg) / 0.07); border: 1px solid rgb(var(--fg) / 0.16);
  border-radius: 6px; padding: 8px 10px; outline: none; width: 100%; text-transform: none; letter-spacing: 0; transition: border-color 0.2s, background 0.2s; }
.a-grid select option { color: var(--ink); }
.a-grid input:focus, .a-grid select:focus { border-color: var(--gold-light); background: rgb(var(--fg) / 0.1); }
.a-grid label.bad input, .a-grid label.bad select { border-color: #e0766a; }
.auth-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.auth-foot .btn { border: 0; cursor: pointer; font-family: var(--sans); margin-left: auto; }
.auth-note, .auth-lead { font-size: 13.5px; color: rgb(var(--fg) / 0.7); }
.auth-msg { font-size: 14px; color: #f0a196; min-height: 0; }
.auth-msg:empty { display: none; }
.auth-msg.ok { color: rgb(var(--fg) / 0.85); }
@media (max-width: 520px) {
  .auth-box { padding: 20px 16px 16px; gap: 10px; }
  .a-grid { gap: 7px 10px; }
  .a-grid input, .a-grid select { font-size: 14px; padding: 6px 8px; }
  .auth-note { display: none; }
}
@media (max-height: 760px) { .a-grid { gap: 6px 12px; } .a-grid input, .a-grid select { padding: 6px 9px; } .auth-box { gap: 10px; padding-top: 20px; } }

/* Members: name opens the sign-up details */
.m-who { background: none; border: 0; padding: 0; text-align: left; color: inherit; cursor: pointer; font: inherit; }
.m-who:hover b, .m-who:focus-visible b { color: var(--gold-light); }
.m-who:focus-visible { outline: none; }
.m-info .gate-box { max-width: 480px; width: 100%; }
.m-info dl.facts { grid-template-columns: auto 1fr; gap: 8px 18px; margin-bottom: 20px; font-size: 15px; }
.m-info dl.facts dt { color: var(--gold-light); }
.m-info dl.facts i { color: rgb(var(--fg) / 0.5); }

.a-grid textarea { font: 400 15px/1.35 var(--sans); color: var(--ivory); background: rgb(var(--fg) / 0.07); border: 1px solid rgb(var(--fg) / 0.16);
  border-radius: 6px; padding: 8px 10px; outline: none; width: 100%; resize: none; text-transform: none; letter-spacing: 0; transition: border-color 0.2s, background 0.2s; }
.a-grid textarea:focus { border-color: var(--gold-light); background: rgb(var(--fg) / 0.1); }
.a-grid label.bad textarea { border-color: #e0766a; }
.m-info dl.facts dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.a-grid .opt { text-transform: none; letter-spacing: 0; font-weight: 400; color: rgb(var(--fg) / 0.5); }
.a-grid input::placeholder, .a-grid textarea::placeholder { color: rgb(var(--fg) / 0.4); }
/* Short windows: compact sign-up form */
@media (max-height: 720px) {
  .auth-box { padding: 14px 22px 14px; gap: 8px; }
  .auth-box h2 { font-size: 20px; }
  .auth-form { gap: 10px; }
  .a-grid { gap: 4px 12px; }
  .a-grid label { gap: 3px; font-size: 10px; }
  .a-grid input, .a-grid select, .a-grid textarea { padding: 5px 9px; font-size: 14px; }
  .a-grid textarea { height: 46px; }
  .auth-note { display: none; }
  .auth-foot .btn { padding: 9px 16px; }
}
.auth-box { overflow-y: auto; scrollbar-width: none; }

/* Dialog header: "Log in  Sign up" is the switch itself, centred */
.auth-head { display: flex; justify-content: center; align-items: baseline; gap: 28px; text-align: center; margin: 0 28px; }
.auth-head[hidden] { display: none; }
.auth-tabs button { background: none; border: 0; padding: 0 0 6px; font: 600 24px/1.1 var(--serif); color: rgb(var(--fg) / 0.4); cursor: pointer;
  position: relative; outline: none; transition: color 0.2s; }
.auth-tabs button:hover, .auth-tabs button:focus-visible { color: rgb(var(--fg) / 0.75); }
.auth-tabs button[aria-selected="true"] { color: var(--gold-light); cursor: default; }
.auth-tabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--gold-light); transform: scaleX(0); transition: transform 0.3s cubic-bezier(0.34, 1.5, 0.5, 1); }
.auth-tabs button[aria-selected="true"]::after { transform: none; }
.auth-tabs { margin-top: 0; }
h2.auth-head { display: block; }
@media (max-height: 720px) { .auth-tabs button { font-size: 21px; } }
@media (max-height: 660px) and (min-width: 521px) { .a-grid label.wide:has([name=street]), .a-grid label.wide:has([name=street2]) { grid-column: auto; } }

/* Setup mode: Home is the only page, so no Home link */
/* ...except Members, for admins */
body[data-only] .nav .links:not(:has(.nav-members:not([hidden]))) { display: none !important; }

/* Log in / Sign up switch: no underline; the active word is larger and gold */
.auth-tabs button::after { display: none; }
.auth-tabs button { padding: 0; transform-origin: 50% 70%; transition: color 0.25s, font-size 0.25s; }
.auth-tabs button[aria-selected="true"] { font-size: 28px; }
@media (max-height: 720px) { .auth-tabs button[aria-selected="true"] { font-size: 24px; } }

/* ---------- Admin panel ---------- */
.admin .t-head { flex-wrap: wrap; }
.adm-sec { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.adm-sec[hidden] { display: none; }
.adm-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0 2px; flex: none; }
.adm-bar .btn { border: 0; cursor: pointer; font-family: var(--sans); padding: 9px 16px; }
.adm-hint { font-size: 14px; color: rgb(var(--fg) / 0.6); }
.m-filters button { font-size: 14px; }
.lit-msg { padding: 24px 0; color: rgb(var(--fg) / 0.7); }
.lit-msg[hidden] { display: none; }
.dog-tiles { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 12px; padding-top: 12px; align-content: start; }
.dog-tile { position: relative; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: rgb(var(--fg) / 0.06); aspect-ratio: 1; transition: transform 0.2s; }
.dog-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dog-tile span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; background: linear-gradient(transparent, rgba(16, 27, 45, 0.92)); display: flex; flex-direction: column; text-align: left; }
.dog-tile b { font: 600 14px/1.1 var(--serif); color: var(--ivory); }
.dog-tile i { font: 500 11px/1.3 var(--sans); font-style: normal; color: var(--gold-light); }
.dog-tile.is-hidden img { opacity: 0.35; filter: grayscale(1); }
.dog-tile:hover, .dog-tile:focus-visible { transform: translateY(-2px); outline: none; }
@media (max-width: 900px) { .dog-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .dog-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }
/* editor dialogs */
.adm-dlg .auth-box { width: min(620px, 100%); }
.adm-dlg h2.auth-head { font: 600 24px/1.1 var(--serif); color: var(--gold-light); text-align: center; }
.a-grid label.chk { flex-direction: row; align-items: center; gap: 8px; align-self: end; padding-bottom: 8px; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ivory); cursor: pointer; }
.a-grid label.chk input { width: 16px; height: 16px; accent-color: var(--gold-light); }
.pup-head { display: flex; justify-content: space-between; align-items: baseline; font: 700 10.5px/1.2 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: rgb(var(--fg) / 0.65); }
.pup-head .t-link { font-size: 13px; letter-spacing: 0; text-transform: none; }
.pup-list { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; scrollbar-width: none; }
.pup-row { display: grid; grid-template-columns: 1.2fr 0.8fr 1fr 0.9fr auto; gap: 6px; }
.pup-row input, .pup-row select { font: 400 14px/1.3 var(--sans); color: var(--ivory); background: rgb(var(--fg) / 0.07); border: 1px solid rgb(var(--fg) / 0.16); border-radius: 6px; padding: 6px 8px; outline: none; min-width: 0; }
.pup-row select option { color: var(--ink); }
.pup-x, .ph-x { background: none; border: 0; color: rgb(var(--fg) / 0.6); font: 400 20px/1 var(--sans); cursor: pointer; padding: 0 6px; }
.pup-x:hover, .ph-x:hover { color: #f0a196; }
.lit-del { color: rgb(var(--fg) / 0.6); }
.lit-del.sure { color: #f08a7e; }
.ph-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 18px; }
.ph-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ph-label { font: 700 10.5px/1.2 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: rgb(var(--fg) / 0.65); }
.ph-cardimg img { width: 130px; height: 130px; object-fit: cover; border-radius: 8px; display: block; }
.ph-up { cursor: pointer; font-size: 13px; }
.ph-prof { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ph-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: rgb(var(--fg) / 0.06); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-x { position: absolute; top: 2px; right: 2px; background: rgba(16, 27, 45, 0.75); border-radius: 50%; width: 22px; height: 22px; padding: 0; font-size: 16px; display: grid; place-items: center; color: var(--ivory); }
.ph-x.sure { background: #c4262e; }
.ph-pager { display: flex; align-items: center; gap: 10px; font-size: 12px; color: rgb(var(--fg) / 0.7); }
.ph-pager[hidden] { display: none; }
.ph-pager button { background: rgb(var(--fg) / 0.08); color: var(--ivory); border: 0; border-radius: 5px; padding: 2px 9px 4px; cursor: pointer; font-size: 15px; }
@media (max-width: 520px) {
  .ph-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ph-card { flex-direction: row; align-items: center; }
  .ph-cardimg img { width: 64px; height: 64px; }
  .ph-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pup-row { grid-template-columns: 1fr 1fr auto; }
  .pup-row [name=name] { grid-column: 1 / -1; }
}
/* Puppies page litter cards from the admin panel */
.lit-notes { font-size: 14px; color: rgb(var(--fg) / 0.75); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pane .lit-pg { align-self: center; }
.dog-tiles { grid-auto-rows: auto; }

/* Puppies: Excellence Program (all five levels side by side when there's room, otherwise one at a time) */

/* ---------- Light mode (toggle in the bar): ivory panels and bar, navy text and icons ---------- */
html.light {
  --navy: #f4efe6; --ivory: #182841; --fg: 24 40 65;
  --gold-light: #9c6f16;      /* darker gold so gold text reads on ivory */
}
html.light .btn { color: #182841; }
html.light .btn:hover { background: #d9a83c; }
html.light .brand .mark path { fill: #182841; }
html.light .brand.filled .mark .c-red { fill: #9a4528; }
html.light .brand.filled .mark .c-gold { fill: #c9962b; }
html.light .marks img, html.light .fly-logo { filter: brightness(0) invert(11%) sepia(46%) saturate(1336%) hue-rotate(194deg) brightness(93%) contrast(92%); }
html.light .m-status.ok { background: rgba(60, 140, 75, 0.15); color: #2f6b3a; }
html.light .m-status.wait { color: #182841; }
html.light .auth-msg, html.light .pup-x:hover, html.light .ph-x:hover { color: #b3392b; }
html.light .auth-msg.ok { color: rgb(var(--fg) / 0.85); }
html.light .m-del.sure, html.light .lit-del.sure { color: #b3392b; }
html.light .badge { color: #182841; }
html.light .a-step select option, html.light .a-grid select option, html.light .pup-row select option { color: #182841; background: #f4efe6; }
html.light .nav { box-shadow: 0 -6px 24px rgba(16, 27, 45, 0.18); }
/* Theme button */
.theme-btn { display: grid; place-items: center; width: 40px; height: 40px; margin-left: 10px; padding: 0; border: 0; border-radius: 8px; background: none;
  color: var(--ivory); cursor: pointer; outline: none; transition: background 0.2s, transform 0.3s cubic-bezier(0.34, 1.6, 0.5, 1); }
.theme-btn:hover, .theme-btn:focus-visible { background: rgb(var(--fg) / 0.1); }
.theme-btn:active { transform: scale(0.88); }
.theme-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .sun, html.light .theme-btn .moon { display: none; }
html.light .theme-btn .sun { display: block; }
@media (max-width: 760px) { .theme-btn { width: 34px; height: 34px; margin-left: 6px; } .theme-btn svg { width: 19px; height: 19px; } }
html.light .nav { background: rgba(244, 239, 230, 0.92); }
.nav .links { transition: opacity 0.3s ease, visibility 0.3s; }
.nav.strip-crowd .links { opacity: 0; visibility: hidden; }
.nav.strip-crowd-marks .marks { opacity: 0; visibility: hidden; }

/* No underlines on buttons: the selected tab is shown by its gold colour; text buttons brighten on hover */
.tabs button::after, .dog-groups button::after, .auth-tabs button::after { display: none; }
.t-link:hover, .t-link:focus-visible { text-decoration: none; filter: brightness(1.2); }
html.light .t-link:hover, html.light .t-link:focus-visible { filter: brightness(0.8); }
/* Theme switch: crossfade */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.45s; animation-timing-function: ease; }
html.theming, html.theming *, html.theming *::before, html.theming *::after {
  transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease, fill 0.45s ease, filter 0.45s ease, box-shadow 0.45s ease !important; }

.prose { columns: 2; column-gap: 40px; width: 100%; }
.prose p { font-size: 15px; margin: 0 0 12px; break-inside: avoid-column; }
@media (max-width: 1100px), (max-height: 760px) { .prose p { font-size: 14px; } }
@media (max-width: 760px) { .prose { columns: 1; } .prose p { font-size: 13px; line-height: 1.4; margin-bottom: 8px; } }
/* Tabbed pages: every pane shares one cell, so the box is as tall as the tallest tab */
.tabbed > .tpanel { align-self: center; max-height: 100%; }
.tabbed .t-body { flex: 0 1 auto; display: grid; }
.tabbed .pane { position: static; grid-area: 1 / 1; display: flex; visibility: hidden; padding-top: 18px; }
.tabbed .pane.on { visibility: visible; }
