/* Site styles, Phase 2.5 design pass.
   Reference: docs/design/2026-09-28-redesign/*.css
   Layout breakpoints (only where layout changes; type/spacing are fluid):
     md 720px — toolbar one row, facts 2 cols, pedigree grid
     lg 960px — full nav, horse page two columns
     xl 1440px — wide-screen tweaks */

/* ---------- Fonts ---------- */
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/raleway-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/raleway-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Vollkorn"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url("../fonts/vollkorn-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Vollkorn"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url("../fonts/vollkorn-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Tokens ---------- */
:root {
  --teal: #003844;
  --accent: #006c67;
  --mint: #9dc5bb;
  --mint-soft: #e4efed;
  --bg: #f6f8f8;
  --surface: #ffffff;
  --surface-2: #edf1f1;
  --line: #dee5e5;
  --text: #1a202c;
  --muted: #4f6664;
  --faint: #8a9a99;
  --gold: #ffb100;
  --focus: 0 0 0 3px rgba(0, 108, 103, .25);

  --font-body: "Raleway", system-ui, sans-serif;
  --font-display: "Vollkorn", Georgia, serif;

  /* Fluid type: 360px → 1600px, then fixed. */
  --step--1: clamp(0.75rem, 0.7319rem + 0.08065vw, 0.8125rem);
  --step-0: clamp(0.9375rem, 0.9012rem + 0.1613vw, 1.062rem);
  --step-1: clamp(1.062rem, 0.9899rem + 0.3226vw, 1.312rem);
  --step-2: clamp(1.25rem, 1.105rem + 0.6452vw, 1.75rem);
  --step-3: clamp(1.625rem, 1.407rem + 0.9677vw, 2.375rem);
  --step-4: clamp(2.5rem, 1.992rem + 2.258vw, 4.25rem);
  --step-5: clamp(2.875rem, 2.403rem + 2.097vw, 4.5rem);

  /* Fluid space. */
  --space-xs: clamp(0.5rem, 0.4637rem + 0.1613vw, 0.625rem);
  --space-s: clamp(0.75rem, 0.6774rem + 0.3226vw, 1rem);
  --space-m: clamp(1rem, 0.8548rem + 0.6452vw, 1.5rem);
  --space-l: clamp(1.5rem, 1.21rem + 1.29vw, 2.5rem);
  --space-xl: clamp(2.25rem, 1.597rem + 2.903vw, 4.5rem);
  --space-2xl: clamp(3rem, 2.274rem + 3.226vw, 5.5rem);
  --gutter: clamp(1rem, 0.7097rem + 1.29vw, 2rem);
  --hero-h: clamp(25rem, 22.1rem + 12.9vw, 35rem);

  --wrap: 1280px;
  --wrap-wide: 1440px;
  --measure: 70ch;
  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 18px;
  --pill: 999px;
  --header-h: 62px;

  --rmp-1-bg: #f5e6e3; --rmp-1-fg: #ac3e2c;
  --rmp-2-bg: #e6f7f8; --rmp-2-fg: #367274;
  --rmp-3-bg: #f5e4f1; --rmp-3-fg: #a03888;
  --rmp-4-bg: #e3e8f7; --rmp-4-fg: #2e4fbc;
  --rmp-5-bg: #e6f8ed; --rmp-5-fg: #397749;
}
@media (min-width: 960px) { :root { --header-h: 72px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 64px); }
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: var(--step-0); line-height: 1.55; overflow-wrap: anywhere; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--teal); line-height: 1.15; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--wide { max-width: calc(var(--wrap-wide) + 2 * var(--gutter)); }
.page-main { padding-top: var(--space-l); padding-bottom: var(--space-2xl); }
/* Footer stays at the bottom of the window on short pages. */
body > main { flex: 1 0 auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 50; padding: 8px 14px; background: var(--surface); }
.skip:focus { left: 8px; top: 8px; }
.icon { display: inline-block; flex: none; vertical-align: middle; }
.flag { display: block; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: var(--step--1); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.eyebrow--light { color: var(--mint); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border: 0; border-radius: var(--pill); background: var(--teal); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn--mint { background: var(--mint); color: var(--teal); }
.btn--mint:hover { background: #fff; }
.btn--ghost { background: var(--surface); color: var(--teal); border: 1px solid var(--line); font-weight: 600; }
.btn--ghost:hover { border-color: var(--mint); }
.pill { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 13px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); font-size: var(--step--1); font-weight: 500; }

/* ---------- Header ---------- */
.hdr { position: sticky; top: 0; z-index: 10; background: rgba(0,56,68,.96); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid rgba(157,197,187,.18); }
.hdr-in { display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: #fff; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.19rem, 1.1rem + .4vw, 1.375rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand img { width: 34px; height: 34px; flex: none; }
.nav { display: none; align-items: center; gap: 2px; margin-left: auto; }
.nav a { display: inline-flex; align-items: center; padding: 9px 14px; border-radius: var(--pill); color: #dee5e5; text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a[aria-current=page] { color: #fff; background: rgba(157,197,187,.2); font-weight: 600; }
.nav a.nav-icon { width: 42px; height: 42px; padding: 0; justify-content: center; margin-left: 6px; border: 1px solid rgba(157,197,187,.3); }
.lang { display: none; gap: 2px; margin: 0 0 0 10px; padding-left: 14px; border-left: 1px solid rgba(157,197,187,.25); }
.lang button { padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--mint); cursor: pointer; }
.lang button[aria-current=true] { color: var(--teal); background: var(--mint); }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: auto; border: 1px solid rgba(157,197,187,.3); border-radius: 12px; background: transparent; color: #fff; cursor: pointer; }
@media (min-width: 960px) {
  .brand img { width: 40px; height: 40px; }
  .nav, .hdr .lang { display: flex; }
  .hdr .menu-btn { display: none; }
}

/* ---------- Phone menu ---------- */
.mnav { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0 var(--gutter) 28px; border: 0; background: var(--teal); color: #fff; }
.mnav[open] { display: flex; flex-direction: column; }
.mnav::backdrop { background: rgba(0,56,68,.6); }
.mnav-top { display: flex; align-items: center; justify-content: space-between; height: 62px; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); border-bottom: 1px solid rgba(157,197,187,.18); }
.mnav-top form { margin: 0; }
.mnav-links { display: flex; flex-direction: column; margin-top: 12px; }
.mnav-links a { display: flex; align-items: center; justify-content: space-between; min-height: 60px; border-bottom: 1px solid rgba(157,197,187,.15); font-size: 20px; font-weight: 600; color: #fff; text-decoration: none; }
.mnav-links a .icon { color: var(--mint); }
.mnav-links a[aria-current=page] { color: var(--mint); }
.mnav-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mnav-foot .lang { display: flex; margin: 0; padding: 0; border: 0; }

/* ---------- Hero ---------- */
.hero { position: relative; height: var(--hero-h); overflow: hidden; background: var(--teal); color: #fff; }
.hero--plain { height: auto; padding: var(--space-xl) 0 var(--space-l); }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.hero-fade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,56,68,.95) 0%, rgba(0,56,68,.6) 38%, rgba(0,56,68,0) 70%); }
.hero-in { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: var(--space-l); }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-m) var(--space-l); flex-wrap: wrap; }
.hero h1 { margin: 0; font-size: var(--step-5); line-height: 1; letter-spacing: -.01em; color: #fff; }
.lead { max-width: 34rem; margin: 14px 0 0; font-size: var(--step-1); line-height: 1.55; color: var(--surface-2); }
.stats { display: flex; gap: var(--space-l); margin: 0; }
.stat { display: flex; flex-direction: column-reverse; }
.stat dd { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: var(--step-3); line-height: 1.1; color: #fff; }
.stat dt { font-size: var(--step--1); color: var(--mint); }
@media (min-width: 1440px) { .hero { height: calc(var(--hero-h) + 4rem); } }

/* ---------- Footer ---------- */
.ftr { background: var(--teal); color: #dee5e5; }
.ftr-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-l); padding-top: var(--space-xl); padding-bottom: var(--space-l); }
.ftr-brand { display: flex; align-items: center; align-self: start; gap: 18px; font-family: var(--font-display); font-size: var(--step-3); font-weight: 700; color: #fff; }
.ftr-brand img { width: clamp(64px, 50px + 3vw, 96px); height: auto; }
.ftr h2 { margin: 0 0 14px; font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mint); }
.ftr ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ftr a:not(.btn) { color: #fff; text-decoration: none; }
.ftr a:not(.btn):hover { color: var(--mint); }
.ftr p { margin: 0; line-height: 1.8; }
.ftr .btn { margin-top: 18px; }
.ftr-bottom { padding-top: 20px; padding-bottom: 28px; border-top: 1px solid rgba(157,197,187,.25); font-size: var(--step--1); color: var(--mint); }
@media (min-width: 720px) { .ftr-grid { grid-template-columns: 2fr 1fr 1.4fr; gap: 48px; } }

/* ---------- Listing (Task 6) ---------- */

.listing, .comp-page, .info-page { padding-bottom: var(--space-2xl); }
.toolbar { display: flex; flex-direction: column; gap: 12px; padding: var(--space-m) 0 var(--space-s); }
.bar { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); color: var(--muted); }
.search:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); }
.sorts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sort { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.sel { position: relative; display: flex; }
.sel select { appearance: none; width: 100%; height: 44px; padding: 0 40px 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); font: inherit; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
.sel select:focus-visible { outline: 0; border-color: var(--accent); box-shadow: var(--focus); }
.sel .icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
/* Chips wrap onto more rows rather than scrolling; the radius is half the row height so one row still reads as a pill. */
.seg { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; max-width: 100%; min-height: 44px; margin: 0; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.seg-lbl { float: left; padding: 0 8px 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: var(--pill); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.chip input, .dd-opt input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { background: var(--surface-2); }
.chip:has(input:checked) { background: var(--teal); color: #fff; }
.chip:has(input:focus-visible), .dd-opt:has(input:focus-visible) { box-shadow: var(--focus); }
.chip-n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip:has(input:checked) .chip-n { color: var(--mint); }
.dd { position: relative; }
.dd-btn { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); font-size: 14px; font-weight: 500; cursor: pointer; list-style: none; }
.dd-btn::-webkit-details-marker { display: none; }
.dd-btn:hover { border-color: var(--mint); }
.dd-btn.on .dd-val { color: var(--accent); font-weight: 700; }
.dd-val { flex: 1; }
/* As wide as the longest breed name, so names stay on one row; never wider than the screen minus the gutters. */
.dd-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 9; width: max-content; min-width: 100%; max-width: calc(100vw - 2 * var(--gutter)); max-height: 340px; overflow-wrap: break-word; overflow: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 16px 40px rgba(0,56,68,.16); }
.dd-opt { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.dd-opt:hover { background: var(--surface-2); }
.dd-opt:has(input:checked) { background: var(--mint-soft); color: var(--teal); font-weight: 600; }
.dd-opt.off { color: var(--faint); }
.result { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 4px 0 var(--space-m); font-size: 14px; color: var(--muted); }
.result b { color: var(--teal); }
@media (min-width: 960px) {
  .chips-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--space-m); margin-bottom: var(--space-m); }
  .chips-row .result { margin: 0; margin-left: auto; white-space: nowrap; }
}
.reset { font-weight: 600; color: var(--accent); text-underline-offset: 3px; }
.group + .group, .memorial { margin-top: var(--space-xl); }
.group-h { display: flex; align-items: center; gap: 12px; margin: 0 0 var(--space-m); padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: var(--step-2); }
.group-h--breed { text-transform: capitalize; }
.group-n { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--pill); background: var(--mint-soft); font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: var(--space-l) var(--space-s); }
.memorial .hcard-media img { filter: grayscale(.85); }
.empty { padding: var(--space-2xl) 0; text-align: center; color: var(--muted); }
.more { display: flex; justify-content: center; padding-top: var(--space-l); }
.groups--clip.is-clipped .grid > :nth-child(n+9) { display: none; }

/* Card */
.hcard { display: flex; flex-direction: column; min-width: 0; }
.hcard-media { position: relative; display: block; aspect-ratio: 4 / 3; margin-bottom: 12px; border-radius: 12px; overflow: hidden; background: var(--line); }
.hcard-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.hcard:hover .hcard-media img { transform: scale(1.045); }
.shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,56,68,.6), rgba(0,56,68,0) 50%); opacity: 0; transition: opacity .3s; }
.hcard:hover .shade { opacity: 1; }
.cta { position: absolute; left: 14px; bottom: 12px; display: flex; align-items: center; gap: 6px; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.hcard:hover .cta { opacity: 1; transform: none; }
.noimg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 100%; font-size: 13px; color: var(--muted); }
.prize { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; max-width: 70%; height: 24px; padding: 0 8px; border-radius: var(--pill); background: rgba(255,255,255,.94); color: var(--teal); font-size: 11px; font-weight: 700; }
.prize-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prize-more { flex: none; color: var(--accent); }
.rmp-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: var(--pill); font-size: 14px; font-weight: 700; }
.rmp-badge--compact { position: absolute; top: 8px; right: 8px; gap: 4px; min-height: 24px; padding: 0 8px; font-size: 12px; }
.rmp--1 { background: var(--rmp-1-bg); color: var(--rmp-1-fg); }
.rmp--2 { background: var(--rmp-2-bg); color: var(--rmp-2-fg); }
.rmp--3 { background: var(--rmp-3-bg); color: var(--rmp-3-fg); }
.rmp--4 { background: var(--rmp-4-bg); color: var(--rmp-4-fg); }
.rmp--5 { background: var(--rmp-5-bg); color: var(--rmp-5-fg); }
.hcard-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hcard-title h3 { margin: 0; min-width: 0; font-size: var(--step-1); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hcard-title h3 a { color: var(--accent); text-decoration: none; }
.hcard-title h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sex { display: inline-flex; flex: none; color: var(--muted); }
.hcard-breed { margin: 3px 0 0; font-size: var(--step--1); font-weight: 500; }
.hcard-meta { margin: 2px 0 0; font-size: var(--step--1); color: var(--muted); }
.hcard-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: var(--step--1); }
.hcard-tags .muted { color: var(--muted); }
.sep { color: var(--mint); }
.hcard-home { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: var(--step--1); color: var(--muted); }

@media (min-width: 720px) {
  .bar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
  .search { flex: 1 1 260px; max-width: 420px; }
  .sorts { display: flex; gap: 20px; margin-left: auto; }
  .sort { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; font-weight: 400; }
  .sel select { width: auto; }
  .seg { display: inline-flex; }
  .dd-btn { width: auto; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--space-l) var(--space-m); }
  .prize, .rmp-badge--compact { top: 10px; height: 26px; font-size: 12px; }
  .prize { left: 10px; }
  .rmp-badge--compact { right: 10px; }
}
@media (min-width: 1440px) { .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .hcard-media img, .shade, .cta { transition: none; } }
[hidden] { display: none !important; }

/* ---------- Horse page (Tasks 7–8) ---------- */
.horse { padding-bottom: var(--space-2xl); }
.crumbs { display: flex; align-items: center; gap: 8px; padding: var(--space-s) 0; font-size: 14px; color: var(--muted); min-width: 0; }
.crumbs a { display: inline-flex; flex: none; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.crumbs span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-l); padding-bottom: var(--space-xl); }
.photo-link { display: block; }
.photo { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-m); background: var(--line); }
/* Portrait photos are shown whole in the same 3:2 stage, not cropped. */
.photo-link[data-orient="portrait"] .photo { object-fit: contain; }
.photo-link { cursor: zoom-in; }
.photo--empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.thumb { display: block; width: clamp(72px, 60px + 3vw, 108px); aspect-ratio: 3 / 2; border-radius: var(--radius-s); overflow: hidden; background: var(--line); opacity: .6; transition: opacity .15s, box-shadow .15s; }
.thumb:hover, .thumb.on { opacity: 1; }
.thumb.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb[data-orient="portrait"] img { object-fit: contain; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(2, 20, 24, .94); color: #e8f1f1; }
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: calc(100vw - 160px); }
.lb-img { display: block; max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: var(--radius-m); }
.lb-caption { font-size: 14px; color: #b9cccc; display: flex; gap: 14px; }
.lb-caption strong { color: #e8f1f1; }
.lb-btn { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid rgba(232, 241, 241, .35); background: rgba(2, 20, 24, .6); color: #e8f1f1; cursor: pointer; }
.lb-btn:hover { background: rgba(232, 241, 241, .15); }
.lb-btn:focus-visible { outline: 2px solid #e8f1f1; outline-offset: 2px; }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 16px; top: 50%; translate: 0 -50%; }
.lb-next { right: 16px; top: 50%; translate: 0 -50%; }
html.lb-open { overflow: hidden; }
@media (max-width: 640px) {
  .lb-figure { max-width: 100vw; padding: 0 12px; }
  .lb-prev, .lb-next { top: auto; bottom: 20px; translate: none; }
  .lb-prev { left: 20px; } .lb-next { right: 20px; }
  .lb-img { max-height: calc(100vh - 180px); }
}
.credit { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.notice { display: flex; gap: 10px; margin: var(--space-s) 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13px; line-height: 1.5; color: var(--muted); }
.notice .icon { margin-top: 1px; color: var(--accent); }
.studbook { width: 22px; height: 22px; object-fit: contain; }
.name { margin: 0; font-size: var(--step-4); line-height: 1; letter-spacing: -.01em; overflow-wrap: anywhere; }
.barn { margin: 8px 0 0; font-size: var(--step-1); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-s); }
.pill--accent { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 28px; margin: var(--space-m) 0 0; }
.fact { padding: 14px 0; border-top: 1px solid var(--line); min-width: 0; }
.fact dt { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fact dd { margin: 4px 0 0; font-size: var(--step-0); font-weight: 500; }
.fact dd small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--muted); }
.fact-wide { grid-column: 1 / -1; }
.disc-name { display: block; }
.lvl { margin-top: 12px; }
.lv-bar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.lv { display: block; height: 10px; border-radius: 999px; background: #e3eaea; }
.lv.lv-cap { background: #fff; box-shadow: inset 0 0 0 2px #9dc5bb; }
.lv.lv-now { background: var(--accent); }
.lv.lv-here, .lv.lv-top { position: relative; }
.lv.lv-here::after { content: ""; position: absolute; right: -1px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border: 3px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.lv.lv-top::after { content: ""; position: absolute; right: -2px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border: 2px solid #9dc5bb; border-radius: 50%; background: #fff; }
.lv-scale { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #9aabaa; }
.lv-keys { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 10px; }
.lv-keys .k { display: flex; align-items: baseline; gap: 8px; font-size: 15px; font-weight: 600; }
.lv-keys .k b { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lv-keys .k b::before { content: ""; width: 10px; height: 10px; border-radius: 50%; }
.k-now b::before { background: var(--accent); }
.k-cap b::before { background: #fff; box-shadow: inset 0 0 0 2px #9dc5bb; }
.fact a { color: var(--accent); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.fact a:hover { text-decoration: underline; text-underline-offset: 3px; }
.bdays { display: inline-block; position: relative; }
.bdays summary { display: inline; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; list-style: none; }
.bdays summary::-webkit-details-marker { display: none; }
.bdays-panel { position: absolute; z-index: 6; left: 0; top: calc(100% + 8px); width: max-content; max-width: min(280px, 80vw); padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 16px 40px rgba(0,56,68,.16); color: var(--text); }
.bdays-h { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bdays ol { margin: 0; padding: 0; list-style: none; }
.bdays li { display: flex; justify-content: space-between; gap: 24px; padding: 4px 0; font-size: 14px; }
.bdays li.is-past { color: var(--muted); }
.bdays li.is-past span::after { content: " ✓"; color: var(--accent); }
.rmp-card { display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-radius: 16px; background: var(--teal); color: #fff; }
.rmp-img { flex: none; display: block; width: 60px; height: 60px; object-fit: contain; }
@media (min-width: 720px) { .rmp-img { width: 76px; height: 76px; } }
.rmp-body { flex: 1 1 auto; min-width: 0; }
.rmp-card .rmp-badge { margin-top: 10px; }
.rmp-k { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--mint); }
.rmp-t { margin-top: 2px; font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; }
.rmp-bar { height: 6px; margin-top: 12px; border-radius: var(--pill); background: rgba(157,197,187,.25); overflow: hidden; }
.rmp-bar i { display: block; height: 100%; border-radius: var(--pill); background: var(--gold); }
.rmp-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--line); }
.rmp-row a { color: #fff; font-weight: 600; }
.rv-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.rv-banner { margin: 0 0 14px; }
.rv-card { padding: 18px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.sec .rv-card h3 { margin: 0 0 8px; }
.rv-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 64px; gap: 10px; align-items: center; padding: 11px 0; }
.rv-row + .rv-row, .rv-trait + .rv-trait { border-top: 1px solid #f0f4f4; }
.rv-label { font-size: 14px; font-weight: 600; color: var(--text); }
.rv-bar { display: block; height: 8px; border-radius: var(--pill); background: #edf1f1; overflow: hidden; }
.rv-bar i { display: block; height: 100%; border-radius: var(--pill); background: var(--teal); }
.rv-val { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.rv-val b { font-size: 16px; color: var(--text); }
.rv-trait { padding: 12px 0; }
.rv-tt { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.rv-cat { font-size: 12px; color: #9aabaa; }
.rv-num { margin-left: auto; font-size: 16px; color: var(--text); }
.rt { font-size: 13px; font-style: italic; font-weight: 600; }
.rt-ex { color: var(--accent); }
.rt-ok { color: #4b8f84; }
.rt-mid { color: #b47a00; }
.tb { display: block; height: 8px; border-radius: var(--pill); overflow: hidden; }
.tb i { display: block; height: 100%; border-radius: var(--pill); }
.tb-ex { background: #dbece8; } .tb-ex i { background: var(--accent); }
.tb-ok { background: #e6f0ee; } .tb-ok i { background: #6fa99e; }
.tb-mid { background: #fff3d6; } .tb-mid i { background: var(--gold); }
.rv-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }
.rv-more:hover { text-decoration: underline; }
@media (min-width: 720px) {
  .rv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .rv-banner { margin-bottom: 20px; }
  .rv-card { padding: 24px 26px; }
  .rv-row { grid-template-columns: 150px minmax(0, 1fr) 72px; gap: 16px; }
  .rv-label { font-size: 15px; }
}
@media (min-width: 720px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .top { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-xl); align-items: start; } }
.secnav { position: sticky; top: var(--header-h); z-index: 5; background: rgba(246,248,248,.94); backdrop-filter: blur(8px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.secnav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.secnav a { flex: none; padding: 14px 12px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.secnav a:hover { color: var(--teal); border-bottom-color: var(--mint); }
.sec { padding-top: var(--space-xl); }
.sec h2 { margin: 0 0 var(--space-m); font-size: var(--step-3); }
.sec h3 { margin: 0 0 14px; font-family: var(--font-body); font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.prose { max-width: var(--measure); font-size: var(--step-0); line-height: 1.75; }
/* Horse page text sections use the full content width. */
.horse .prose { max-width: none; }
.prose p { margin: 0 0 1em; }
.is-folded { position: relative; max-height: 18em; overflow: hidden; }
.is-folded::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7em; background: linear-gradient(to bottom, rgba(246,248,248,0), var(--bg)); }
.sec:has(.fold[open]) .is-folded { max-height: none; }
.sec:has(.fold[open]) .is-folded::after { display: none; }
.fold { margin-top: var(--space-s); }
.fold summary { list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold .fold-less, .fold[open] .fold-more { display: none; }
.fold[open] .fold-less { display: inline; }

.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--space-s); }
.tcard { padding: var(--space-m); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); min-width: 0; }
.tcard-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tcard-t { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: var(--step-3); font-weight: 600; color: var(--accent); }
.tcard--small .tcard-t { font-size: var(--step-2); }
.tcard-total { font-weight: 700; color: var(--teal); white-space: nowrap; }
.tcard-sub, .tcard-desc { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.meter { margin-top: 16px; }
.meter-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.meter-top b { color: var(--teal); text-align: right; }
.meter .track { height: 8px; margin-top: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter .track i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.tile b small { font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--muted); }
.scores { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.score { display: flex; flex-direction: column; min-width: 72px; padding: 8px 12px; border-radius: var(--radius-s); background: var(--bg); }
.score dt { font-size: 12px; color: var(--muted); }
.score dd { margin: 0; font-size: 17px; font-weight: 700; color: var(--teal); }

.ped-toggle-input { position: absolute; opacity: 0; }
.ped-toggle { margin-bottom: var(--space-s); }
.ped-toggle-input:focus-visible + .ped-toggle { box-shadow: var(--focus); }
.ped-heads { display: none; }
.ped { display: flex; flex-direction: column; }
.ped-cell { display: flex; flex-direction: column; justify-content: center; gap: 3px; margin: 0 0 8px calc((var(--g) - 1) * 16px); padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.ped-cell.is-deep { display: none; }
.ped-toggle-input:checked ~ .ped-scroll .ped-cell.is-deep { display: flex; }
.pc-role { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pc-evm { padding: 2px 8px; border-radius: var(--pill); background: var(--mint-soft); color: var(--teal); letter-spacing: .06em; }
.pc-name { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; }
.pc-name a { color: var(--accent); text-decoration: none; }
.pc-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pc-name .horse-ref-meta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pc-info { font-size: 13px; color: var(--muted); }
.pc-titles { font-size: 12px; font-weight: 600; color: var(--accent); }
.pc-unknown { color: var(--faint); }
.ped-writeup { margin-top: var(--space-m); }

.kids { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); overflow: hidden; }
.kid { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding: 14px 16px; }
.kid + .kid { border-top: 1px solid var(--line); }
.kid-img { display: flex; align-items: center; justify-content: center; width: 96px; aspect-ratio: 3 / 2; flex: none; border-radius: var(--radius-s); overflow: hidden; background: var(--line); color: var(--muted); }
.kid-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kid-main { flex: 1 1 200px; min-width: 0; }
.kid-name { font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; }
.kid-name a { color: var(--accent); text-decoration: none; }
.kid-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.kid-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 10px; vertical-align: middle; }
/* Same size and type as the title pill over a listing photo (.prize), on a light fill for the white row. */
.kid-tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--pill); background: var(--surface-2); color: var(--teal); font-family: var(--font-body); font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; }
@media (min-width: 720px) { .kid-tag { height: 26px; font-size: 12px; } }
.kid-info, .kid-other { margin-top: 2px; font-size: 14px; color: var(--muted); }
.kid-other a { color: var(--accent); font-weight: 600; text-decoration: none; }

.tab-input { position: absolute; opacity: 0; }
.tabs { display: inline-flex; gap: 2px; max-width: 100%; margin-bottom: var(--space-m); padding: 3px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); }
.tab { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: var(--pill); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.tab:hover { background: var(--surface-2); }
.tab-panel { display: none; }
#tab-levels:checked ~ .tabs [for=tab-levels], #tab-other:checked ~ .tabs [for=tab-other], #tab-vesland:checked ~ .tabs [for=tab-vesland] { background: var(--teal); color: #fff; }
#tab-levels:checked ~ #panel-levels, #tab-other:checked ~ #panel-other, #tab-vesland:checked ~ #panel-vesland { display: block; }
#tab-levels:focus-visible ~ .tabs [for=tab-levels], #tab-other:focus-visible ~ .tabs [for=tab-other], #tab-vesland:focus-visible ~ .tabs [for=tab-vesland] { box-shadow: var(--focus); }
.vrl-note { margin: 0 0 var(--space-s); padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.vrl-note p { margin: 0; }
.vrl-note .ext { margin-top: 10px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { padding: 14px 16px; border-radius: 12px; background: var(--bg); }
.tile span, .tile dt { display: block; font-size: 13px; color: var(--muted); }
.tile b, .tile dd { display: block; margin: 2px 0 0; font-family: var(--font-display); font-size: var(--step-3); font-weight: 600; line-height: 1.2; color: var(--teal); overflow-wrap: break-word; }
.tcards--split .tile b { font-size: var(--step-2); }
.ext { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }
.ext:hover { text-decoration: underline; text-underline-offset: 3px; }
.sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 0 0 var(--space-s); }
.res { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); overflow: hidden; }
.res-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 12px; padding: 14px 16px; font-size: 14px; }
.res-row > :first-child { grid-row: span 4; align-self: start; }
.res-row + .res-row, .res-more { border-top: 1px solid var(--surface-2); }
.res-head { display: none; }
.res--other .res-row > :first-child { grid-row: auto; }
.awards { display: flex; flex-wrap: wrap; gap: 20px; margin: 0; padding: 0; list-style: none; }
.award { display: flex; flex: 1 1 360px; align-items: center; gap: 24px; max-width: 560px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.award img { display: block; flex: none; width: auto; max-width: 96px; height: 141px; object-fit: contain; }
.award b { display: block; font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.25; color: var(--teal); }
.award span { display: block; margin-top: 4px; color: var(--muted); }
.other-results { margin-top: var(--space-s); }
.res-group + .res-group { margin-top: var(--space-s); }
.res-count { display: inline-flex; align-items: center; height: 30px; margin-left: 10px; padding: 0 14px; border-radius: var(--pill); background: var(--surface-2); font-size: var(--step--1); font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text); }
.place { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 30px; padding: 0 10px; border-radius: var(--pill); background: var(--surface-2); font-weight: 700; color: var(--teal); }
.place.win { background: var(--gold); }
.place-note { display: block; margin-top: 4px; font-size: 12px; }
.res-foot { margin: 12px 0 0; font-size: 13px; }
.muted { color: var(--muted); }
.res-more summary { display: flex; justify-content: center; margin: 14px auto; width: max-content; list-style: none; }
.res-more summary::-webkit-details-marker { display: none; }
.res-more[open] summary { display: none; }

@media (min-width: 720px) {
  .ped-scroll { overflow-x: auto; }
  .ped-heads, .ped { display: grid; grid-template-columns: repeat(3, minmax(200px, 1fr)); column-gap: 16px; }
  .ped-heads { margin-bottom: 12px; }
  .ped-heads span { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .ped { row-gap: 0; }
  .ped-cell { margin: 0 0 10px; }
  .ped-toggle-input:checked ~ .ped-scroll .ped { grid-template-columns: repeat(var(--ped-all), minmax(200px, 1fr)); }
  .res-head { display: grid; background: var(--bg); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .res-row { grid-template-columns: 84px 110px minmax(0, 1.3fr) minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px 20px; }
  .res--other .res-row { grid-template-columns: 110px minmax(0, 1.4fr) minmax(0, 1fr) 96px minmax(0, 1fr); }
  .res--noinfo .res-row { grid-template-columns: 110px minmax(0, 1.4fr) minmax(0, 1fr) 96px; }
  .res-row > :first-child { grid-row: auto; }
  .award { padding: 24px 28px; }
  .tcards--split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tcards--split .tile b { font-size: var(--step-3); }
}

/* ---------- Static pages and blog (Phase 3a, interim until the owner's designs) ---------- */
.draft-banner { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 var(--space-m); padding: 12px 16px; border-radius: 12px; background: #fff4d6; border: 1px solid var(--gold); font-size: 14px; }
.prose h2, .prose h3, .prose h4 { margin: 1.6em 0 .5em; line-height: 1.2; }
.prose h2 { font-size: var(--step-3); }
.prose h3 { font-size: var(--step-2); }
.prose h4 { font-family: var(--font-body); font-size: var(--step-0); font-weight: 700; }
.prose > :first-child { margin-top: 0; }
.prose a { color: var(--accent); font-weight: 600; text-underline-offset: 3px; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.4em; }
.prose img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-m); }
.prose figure { margin: 1.5em 0; }
.prose figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--mint); color: var(--muted); }
.prose hr { margin: 2em 0; border: 0; border-top: 1px solid var(--line); }
.prose .small { font-size: var(--step--1); color: var(--muted); }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 1em; font-size: 14px; }
.prose th, .prose td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: break-word; }
.prose code { padding: 1px 5px; border-radius: 4px; background: var(--surface-2); font-size: .9em; }
.prose pre { overflow-x: auto; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); }
.prose pre code { padding: 0; background: none; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--space-l) var(--space-m); }
.pcard { display: flex; flex-direction: column; min-width: 0; }
.pcard-media { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; margin-bottom: 14px; border-radius: 12px; overflow: hidden; background: var(--line); color: var(--muted); }
.pcard-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pcard-date { font-size: 13px; font-weight: 600; color: var(--muted); }
.pcard h3 { margin: 4px 0 0; font-size: var(--step-2); line-height: 1.2; }
.pcard h3 a { color: var(--accent); text-decoration: none; }
.pcard h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pcard-text { margin: 8px 0 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.pcard-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding-top: var(--space-xl); font-size: 14px; color: var(--muted); }

/* ---------- Front page (Phase 3a, design etusivu.*) ---------- */
.hero--home { height: clamp(35rem, 33rem + 5vw, 40rem); }
.hero--home.hero--plain { height: auto; padding: var(--space-2xl) 0 var(--space-xl); }
.hero--home .hero-img { object-position: 62% 20%; }
.hero--home h1 { font-size: clamp(3.5rem, 2.9rem + 2.7vw, 5.75rem); line-height: .95; letter-spacing: -.015em; }
.tagline { max-width: 30rem; margin: 20px 0 0; font-size: clamp(1.125rem, 1.05rem + .35vw, 1.375rem); line-height: 1.45; color: var(--surface-2); }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(1.5rem, 1.2rem + 1.3vw, 2.25rem); }
.ctas .btn { flex: 1 1 auto; min-height: 50px; }
.btn--outline-light { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }
.btn--outline-light:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.home { padding-bottom: var(--space-2xl); }
.hsec { padding-top: var(--space-2xl); }
.hsec h2 { margin: 0; font-size: clamp(2.125rem, 1.9rem + 1vw, 2.75rem); line-height: 1.1; }
.hsec-head { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: var(--space-m); }
.kicker { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.all { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 15px; font-weight: 600; color: var(--accent); text-decoration: none; }
.all:hover { text-decoration: underline; text-underline-offset: 3px; }
.intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-l); align-items: center; }
.intro:not(.intro--image) { max-width: 48rem; }
.intro-body { max-width: none; margin-top: 20px; font-size: clamp(1rem, .95rem + .25vw, 1.125rem); }
.intro-stats { display: flex; flex-wrap: wrap; gap: 16px clamp(1.75rem, 1.4rem + 1.5vw, 2.75rem); margin-top: var(--space-m); padding-top: 28px; border-top: 1px solid var(--line); }
.intro-stats b { display: block; font-family: var(--font-display); font-size: clamp(2rem, 1.8rem + .8vw, 2.5rem); font-weight: 600; line-height: 1; color: var(--teal); }
.intro-stats span { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
.intro .notice { margin-top: 28px; font-size: 14px; line-height: 1.55; }
.intro .notice a { color: var(--accent); font-weight: 600; }
.portrait { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 20px; }
/* Fixed columns so one or two cards keep their size. */
.events { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: var(--space-2xl); background: var(--teal); color: #fff; }
.events-media { position: relative; height: 220px; overflow: hidden; }
/* The picture fills its cell but is out of the flow, so its size never sets the height of the band. */
.events-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.events-body { padding: 40px 16px; }
.events-body .kicker { color: var(--mint); }
.events-body h2 { margin: 0; color: #fff; font-size: clamp(2.125rem, 1.9rem + 1vw, 2.75rem); line-height: 1.1; }
.hev-list { list-style: none; margin: 32px 0 0; padding: 0; }
.hev { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 20px 0; border-top: 1px solid rgba(157, 197, 187, .22); }
.hev:last-child { border-bottom: 1px solid rgba(157, 197, 187, .22); }
.hev-date { display: flex; flex: none; flex-direction: column; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 16px; background: rgba(157, 197, 187, .14); }
.hev-date b { font-family: var(--font-display); font-size: 26px; font-weight: 600; line-height: 1; }
.hev-date span { margin-top: 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mint); }
.hev-main { flex: 1 1 calc(100% - 80px); min-width: 0; }  /* on phones the tag drops below, under the title */
.hev-main h3 { margin: 0; font-size: 20px; color: #fff; }
.hev-main h3 a { color: inherit; text-decoration: none; }
.hev-main h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hev-main p { margin: 4px 0 0; font-size: 14px; color: #dee5e5; }
.hev-tag { flex: none; display: inline-flex; align-items: center; height: 28px; margin-left: 80px; padding: 0 12px; border: 1px solid rgba(157, 197, 187, .4); border-radius: var(--pill); font-size: 12px; font-weight: 600; color: var(--mint); }
.events-body .all { margin-top: 28px; color: var(--mint); }
@media (min-width: 900px) {
  .events { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .events-media { height: auto; }
  .events-body { padding: 72px 64px; }
  .hev { flex-wrap: nowrap; gap: 24px; }
  .hev-main { flex: 1; }
  .hev-date { width: 76px; height: 76px; }
  .hev-date b { font-size: 32px; }
  .hev-main h3 { font-size: 24px; }
  .hev-tag { margin-left: 0; }
}
.posts, .foals { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-l) 28px; }
.foal { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.foal-media { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--line); }
.foal-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.foal-media img.ph { object-fit: contain; object-position: 50% 100%; }
.foal:hover .foal-media img { transform: scale(1.045); }
.born { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border-radius: var(--pill); background: rgba(255,255,255,.94); font-size: 12px; font-weight: 700; color: var(--teal); }
.foal-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.foal-title h3 { margin: 0; min-width: 0; font-size: var(--step-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foal-title h3 a { color: var(--accent); text-decoration: none; }
.foal-title h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foal-meta { margin: -12px 0 0; font-size: 14px; color: var(--muted); }
.foal-meta b { font-weight: 500; color: var(--text); }
.foal-parents { margin: -8px 0 0; font-size: 14px; color: var(--muted); }
.foal-parents b { font-weight: 600; color: var(--teal); }
.posts .pcard-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 720px) {
  .posts, .foals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hsec-head { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px; }
  .ctas .btn { flex: none; }
  .hero--home .hero-fade { background: linear-gradient(to right, rgba(0,56,68,.88) 0%, rgba(0,56,68,.55) 38%, rgba(0,56,68,0) 65%); }
  .hero--home .hero-in { justify-content: center; padding-bottom: 0; }
}
@media (min-width: 960px) {
  .posts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foals { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .intro--image { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(3rem, 1rem + 3.5vw, 4.5rem); }
  .portrait { aspect-ratio: 4 / 5; }
}
@media (prefers-reduced-motion: reduce) { .foal-media img { transition: none; } }
/* ---------- For sale page (Phase 3b, design myynti.*) ---------- */
.intro-cta { margin-top: var(--space-m); }
.intro-cta:hover { background: var(--accent); }
.sale-page { padding-bottom: var(--space-2xl); }
.sale { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 40px 0; border-bottom: 1px solid var(--line); }
.sale:first-child { padding-top: 32px; }
.st-photo { position: relative; overflow: hidden; border-radius: 20px; background: var(--line); }
.st-photo img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.st-photo .noimg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; aspect-ratio: 3 / 4; font-size: 14px; color: var(--muted); }
.status { position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: var(--pill); font-size: 13px; font-weight: 700; }
.status--open { background: #fff; color: var(--accent); }
.status--reserved { background: var(--gold); color: var(--teal); }
.st-price { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 16px; padding: 18px 22px; border-radius: 16px; background: var(--teal); color: #fff; }
.st-price div > span { display: block; font-size: 13px; color: var(--mint); }
.st-price b { font-family: var(--font-display); font-size: 28px; font-weight: 600; }
.st-price .btn { width: 100%; }
.st-note { display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border: 1px solid rgba(255,177,0,.5); border-radius: var(--pill); font-size: 14px; font-weight: 600; color: var(--gold); }
.st-name { margin: 0; font-size: clamp(2.25rem, 1.9rem + 1.2vw, 3rem); line-height: 1.05; }
.st-name a { color: var(--accent); text-decoration: none; }
.st-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.st-sub { margin: 10px 0 0; font-size: 15px; color: var(--muted); }
/* Builds on the horse page's .facts / .fact; scoped so that page keeps its own grid. */
.sale .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 24px 0 0; }
.sale .fact { padding: 12px 0; }
.sale .fact dd { font-size: 15px; }
.st-rmp { display: flex; align-items: center; gap: 12px; margin-top: 20px; font-size: 13px; color: var(--muted); }
.st-desc { margin: 24px 0 0; font-family: var(--font-body); font-style: normal; font-weight: 400; font-size: 16px; line-height: 1.55; }
.st-desc { overflow-wrap: anywhere; }
.st-desc > :first-child { margin-top: 0; }
.st-desc > :last-child { margin-bottom: 0; }
.st-desc a { color: var(--accent); font-weight: 600; }
.ped-lbl { margin: 24px 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mini-ped { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.sp { display: flex; align-items: center; min-height: 38px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--teal); }
.sp a { color: var(--accent); text-decoration: none; }
.sp a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sp--g { margin-left: 16px; }
.sp--p:not(:first-child) { margin-top: 4px; }
/* .prose > :first-child would zero a top margin on the list, so the gap sits on the wrapper. */
.terms-body { max-width: none; margin-top: var(--space-m); }
.terms-body > ol { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 24px; margin: 0 0 1em; padding: 0; list-style: none; counter-reset: term; }
/* Counter in the padding, not a flex column, so text and links in an item flow as one line. */
.terms-body > ol > li { position: relative; margin: 0; padding: 18px 20px 18px 66px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); font-size: 15px; line-height: 1.6; counter-increment: term; }
.terms-body > ol > li::before { content: counter(term); position: absolute; left: 20px; top: 16px; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--mint-soft); color: var(--accent); font-size: 14px; font-weight: 700; }
.sold { margin-top: var(--space-m); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.sold-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 14px 16px; }
.sold-row + .sold-row { border-top: 1px solid var(--surface-2); }
.sold-name { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--teal); }
.sold-row .muted { grid-column: 1; grid-row: 2; font-size: 13px; color: var(--muted); }
.sold-tag { grid-column: 2; grid-row: 1; justify-self: end; display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--pill); background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sold-links { grid-column: 2; grid-row: 2; justify-self: end; display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; }
.sold-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.sold-link:hover { color: var(--teal); text-decoration: underline; }
@media (min-width: 720px) {
  .sale .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .st-price .btn { width: auto; margin-left: auto; }
  .sold-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto auto; gap: 16px; padding: 16px 22px; }
  .sold-row .muted, .sold-tag, .sold-links { grid-column: auto; grid-row: auto; }
  .sold-row .muted { font-size: 15px; }
  .sold-link { font-size: 14px; }
}
@media (min-width: 960px) {
  .sale { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; padding: 56px 0; }
  .sale:first-child { padding-top: 40px; }
  .mini-ped { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
  .sp--p { grid-column: 1; grid-row: span 2; }
  .sp--g { grid-column: 2; margin-left: 0; }
  .sp--p:not(:first-child) { margin-top: 0; }
  .terms-body > ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ---------- Breeding page (Phase 3c, design kasvatus.*) ---------- */
.breeding-page { padding-bottom: var(--space-2xl); }
#kasvatit form > [data-submit] { margin-bottom: var(--space-s); }
.hb-views { display: inline-flex; gap: 2px; margin: 0; padding: 3px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); }
.view-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 38px; border-radius: var(--pill); color: var(--muted); cursor: pointer; }
.view-btn input { position: absolute; opacity: 0; pointer-events: none; }
.view-btn:hover { background: var(--surface-2); }
.view-btn:has(input:checked) { background: var(--teal); color: #fff; }
.view-btn:has(input:focus-visible) { box-shadow: var(--focus); }
#kasvatit .bar { padding: var(--space-s) 0; border-top: 1px solid var(--line); }
#kasvatit .group-h { padding-bottom: 0; border-bottom: 0; font-size: clamp(1.5rem, 1.35rem + .6vw, 1.75rem); }
#kasvatit .hsec-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
.hb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
.hb-card { display: flex; flex-direction: column; min-width: 0; }
.hb-media { position: relative; display: block; margin-bottom: 10px; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; background: #e8eeee; }
.hb-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.hb-media img.ph, .st-photo img.ph { object-fit: contain; object-position: 50% 100%; }
.hb-card:hover .hb-media img { transform: scale(1.045); }
.hb-media .rmp-badge--compact { top: 10px; right: 10px; }
.hb-card--gone .hb-media img, .hb-row.hb-card--gone { opacity: .6; filter: saturate(.3); }
.hb-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.hb-title h4 { margin: 0; min-width: 0; font-family: var(--font-display); font-size: clamp(1.0625rem, 1rem + .35vw, 1.3125rem); font-weight: 600; line-height: 1.2; color: var(--teal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-title h4 a { color: var(--accent); text-decoration: none; }
.hb-title h4 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hb-breed { margin: 3px 0 0; font-size: 14px; font-weight: 500; }
.hb-meta { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.hb-parents { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.hb-parents b { font-weight: 600; color: var(--teal); }
.hb-ped { display: block; margin-top: 4px; font-size: 13px; }
.hb-list { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.hb-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, .9fr); gap: 4px 12px; align-items: center; padding: 12px 16px; font-size: 14px; }
.hb-row + .hb-row { border-top: 1px solid var(--surface-2); }
.hb-row--head { background: var(--bg); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hb-row .hb-col { display: none; }
.hb-row b { font-weight: 600; color: var(--teal); }
.hb-row .muted { color: var(--muted); }
.hb-row-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hb-row-name a { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--accent); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-row-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.studs { margin-top: var(--space-2xl); padding: var(--space-xl) 0; background: var(--teal); color: #fff; }
.studs-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: center; }
.studs .kicker { color: var(--mint); }
.studs h2 { margin: 0; font-size: clamp(2.125rem, 1.9rem + 1vw, 2.75rem); line-height: 1.1; color: #fff; }
.studs-body { max-width: none; margin-top: 18px; color: var(--surface-2); }
.studs-body a { color: #fff; }
.studs-contact { display: flex; flex-direction: column; gap: 6px; margin-top: 28px; padding: 20px 22px; border-radius: 16px; background: rgba(157,197,187,.12); font-size: 15px; }
.studs-contact h3 { margin: 0 0 6px; font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--mint); }
.studs-contact b { font-size: 17px; }
.studs-contact a { color: #fff; }
.studs .btn { margin-top: 28px; }
.studs-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 20px; }
.st-terms { max-width: 40rem; margin: 16px 0 0; font-size: 16px; line-height: 1.65; color: var(--muted); }
.stallion-list { margin-top: var(--space-m); }
.stallion { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 40px 0; border-top: 1px solid var(--line); }
.stallion .st-photo { display: block; }
.stallion .st-photo img { aspect-ratio: 4 / 3; }
.stallion .kicker { margin-bottom: 8px; }
.st-merits { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 24px; }
.st-merits .st-rmp { margin-top: 0; }
.st-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.st-tag { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.st-tag--strong { border-color: transparent; background: var(--mint-soft); color: var(--accent); }
.st-achv { margin: 18px 0 0; padding: 0 0 0 18px; font-size: 15px; line-height: 1.7; }
.mini-ped--info .sp { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; }
.sp-extra { font-family: var(--font-body); font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--accent); }
.sp-info { font-family: var(--font-body); font-size: 12px; font-weight: 400; line-height: 1.4; color: var(--muted); }
.sp-name .pc-evm { margin-left: 8px; font-family: var(--font-body); font-size: 11px; font-weight: 700; text-transform: uppercase; vertical-align: 1px; }
@media (min-width: 720px) {
  .hb-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 32px 24px; }
  .hb-media { margin-bottom: 14px; }
  .hb-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) 70px minmax(0, 1fr) minmax(0, 1.8fr) minmax(0, 1fr); gap: 16px; padding: 12px 20px; }
  .hb-row .hb-col { display: block; }
  .hb-row--head { padding-top: 14px; padding-bottom: 14px; }
}
@media (min-width: 960px) {
  .studs { padding: 64px 0; }
  .studs-in--image { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 72px; }
  .studs-img { aspect-ratio: 3 / 4; max-width: 400px; margin-left: auto; }
  .stallion { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
}
/* Images beside the text: class="left" / "right" on an img or figure (phones: full width). */
.prose { display: flow-root; }
.prose img.left, .prose img.right, .prose figure.left, .prose figure.right { margin: 1.5em 0; }
.prose figure.left img, .prose figure.right img { margin: 0; }
@media (min-width: 720px) {
  .prose img.left, .prose figure.left { float: left; width: min(45%, 22rem); margin: .35em 1.75em 1em 0; }
  .prose img.right, .prose figure.right { float: right; width: min(45%, 22rem); margin: .35em 0 1em 1.75em; }
}

/* ---------- Info page and rider pages (design info.*, henkilo.*) ---------- */
.sec-lead { margin: 14px 0 0; max-width: 640px; font-size: var(--step-0); line-height: 1.7; color: var(--muted); }
.fchips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.fchip { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.fchip:hover { border-color: var(--mint); color: var(--teal); }
.fchip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.fchip i { font-style: normal; font-size: 12px; font-weight: 700; color: var(--mint); }
.fchip:focus-visible { box-shadow: var(--focus); outline: 0; }
[data-chips][hidden] { display: none; }

.sites { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: var(--space-m); }
.site { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); overflow: hidden; }
.site-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.site-body { display: flex; flex: 1; flex-direction: column; padding: 22px 18px; }
.site-loc { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.site h3 { margin: 8px 0 0; font-size: clamp(1.75rem, 1.5rem + 1vw, 2rem); line-height: 1.1; }
.site-lead { margin: 8px 0 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 22px 0 0; padding: 0; }
.spec { padding: 12px; border-radius: var(--radius-m); background: var(--bg); }
.spec dt { font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.spec dd { margin: 4px 0 0; font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--teal); }
.feats { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; font-size: 15px; line-height: 1.5; }
.feats li { display: flex; gap: 10px; align-items: flex-start; }
.feats .icon { flex: none; margin-top: 1px; color: var(--accent); }
.site-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: auto; padding-top: 22px; font-size: 14px; color: var(--muted); }
.site-foot > div { flex: 1 1 200px; padding-top: 18px; border-top: 1px solid #edf1f1; }
.site-foot b { color: var(--text); font-weight: 600; }

.gal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 150px; grid-auto-flow: dense; gap: 10px; margin-top: var(--space-m); }
.shot { position: relative; display: block; border-radius: 16px; overflow: hidden; background: var(--line); cursor: zoom-in; }
.shot--big { grid-column: span 2; grid-row: span 2; }
.shot--wide { grid-column: span 2; }
.shot[hidden] { display: none; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.shot:hover img { transform: scale(1.04); }
.shot-cap { position: absolute; inset: auto 0 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 28px 12px 10px; background: linear-gradient(to top, rgba(0,56,68,.85), rgba(0,56,68,0)); color: #fff; }
.shot-cap b { display: block; font-size: 13px; font-weight: 600; }
.shot-loc { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--mint); }
.shot-cap .icon { display: none; flex: none; opacity: .8; }
.lb-caption span:empty { display: none; }

.crew { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: var(--space-m); }
.person { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); overflow: hidden; }
.person[hidden] { display: none; }
.p-img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; background: var(--line); }
.p-img--empty { display: grid; place-items: center; color: var(--faint); }
.p-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 14px 14px 16px; }
.p-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.p-body h3 { margin: 0; font-size: 1.1875rem; line-height: 1.1; }
.p-role { margin: 0; font-size: 13px; font-weight: 600; color: var(--accent); }
.p-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.disc { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--pill); background: var(--mint-soft); font-size: 12px; font-weight: 700; color: var(--accent); }
.p-short { display: none; margin: 6px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.p-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 36px; margin-top: auto; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); font-size: 13px; font-weight: 700; color: var(--teal); text-decoration: none; }
.p-body > :has(+ .p-btn) { margin-bottom: 4px; }
.p-btn:hover { border-color: var(--teal); background: var(--teal); color: #fff; }

.rider .crumbs { padding-top: 0; }
.r-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-m); }
.r-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 20%; border-radius: 20px; background: var(--line); }
.r-photo--empty { display: grid; place-items: center; color: var(--faint); }
.r-loc { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.r-info h1 { margin: 0; font-size: clamp(2.5rem, 2rem + 2.4vw, 3.75rem); line-height: 1; color: var(--teal); }
.r-role { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 14px 0 0; }
.r-role > span:not(.disc) { font-size: var(--step-1); font-weight: 600; color: var(--accent); }
.r-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: var(--space-m) 0; }
.r-facts > div { padding: 14px 0 0; border-top: 1px solid var(--line); margin-bottom: 14px; }
.r-facts dt { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.r-facts dd { margin: 4px 0 0; font-weight: 500; }
.r-info .prose { margin-bottom: var(--space-m); }

.rh { margin-top: var(--space-m); border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); overflow: hidden; }
.rh-head { display: none; }
.rh-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 2px 0; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.rh-row:first-of-type { border-top: 0; }
.rh-name { grid-area: 1 / 1 / 2 / 4; font-family: var(--font-display); font-size: 1.1875rem; font-weight: 600; color: var(--teal); text-decoration: none; }
.rh-disc { grid-area: 1 / 4; text-align: right; }
.rh-breed { grid-area: 2 / 1 / 3 / 4; }
.rh-sex { grid-area: 3 / 1; }
.rh-sex:not(:empty)::after { content: ",\00a0"; }
.rh-age { grid-area: 3 / 2; }
.rh-go { grid-area: 2 / 4 / 4 / 5; align-self: end; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; white-space: nowrap; }
.rh-go:hover, .rh-name:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 720px) {
  .fchips { display: flex; flex-wrap: wrap; width: auto; }
  .fchip { padding: 0 16px; }
  .sites { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .site-body { padding: 28px 30px 30px; }
  .spec { padding: 14px 16px; }
  .spec dt { font-size: 12px; letter-spacing: .06em; }
  .spec dd { font-size: 22px; }
  .gal { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 200px; gap: 14px; }
  .shot-cap { padding: 40px 16px 14px; }
  .shot-cap b { font-size: 15px; }
  .shot-cap .icon { display: block; }
  .crew { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .p-body { padding: 18px 20px 20px; }
  .p-body h3 { font-size: 1.5rem; }
  .p-role { font-size: 14px; }
  .p-short { display: block; }
  .p-btn { height: 40px; padding: 0 18px; font-size: 14px; }
  .r-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rh-head, .rh-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 2fr) minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, 1.4fr) 9.5rem; align-items: center; gap: 12px; padding: 12px 18px; }
  .rh-head { background: var(--bg); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .rh-name, .rh-disc, .rh-breed, .rh-sex, .rh-age, .rh-go { grid-area: auto; text-align: left; align-self: center; }
  .rh-sex::after { content: none; }
}
@media (min-width: 960px) {
  .gal { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .crew { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .r-top { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-xl); align-items: start; }
  .r-photo { aspect-ratio: 4 / 5; }
}
@media (prefers-reduced-motion: reduce) { .shot img { transition: none; } }

/* Diary (Päiväkirja): dated timeline of entries */
.dy-count { font-size: 14px; color: var(--muted); }
.dy-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.dy { position: relative; margin: 0; padding: 0; list-style: none; }
.dy-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; }
.dy-item + .dy-item, .dy-more .dy { margin-top: 18px; }
.dy-date { display: none; }
.dy-card { padding: 16px 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.dy-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; font-size: 13px; color: var(--muted); }
.dy-by { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--teal); }
.dy-by::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
.horse .dy-title { margin: 6px 0 0; font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: 0; text-transform: none; line-height: 1.2; color: var(--teal); }
.dy-text { margin: 10px 0 0; font-size: 15px; line-height: 1.75; }
.dy-more summary { margin-top: 18px; }
.dy-more[open] > .dy { margin-top: 18px; }

@media (min-width: 720px) {
  .dy-item::before, .dy-item::after { content: ""; position: absolute; left: 47px; width: 2px; background: var(--line); }
  .dy-item::before { top: 0; height: 50%; }
  .dy-item::after { top: 50%; bottom: -18px; }
  .dy-item:first-child::before, .dy-item:last-child::after { display: none; }
  .dy-item { grid-template-columns: 96px minmax(0, 1fr); gap: 24px; }
  .dy-date { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 96px; height: 96px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--teal); }
  .dy-date b { font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1; }
  .dy-date span { margin-top: 4px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .dy-date small { margin-top: 2px; font-size: 12px; color: var(--muted); }
  .dy-card { padding: 22px 26px; }
  .horse .dy-title { font-size: 24px; }
  .dy-text { font-size: 16px; }
}

/* ---------- Competitions (Phase 4b-1, design 2026-10-01-competitions) ---------- */
.comp-page .sec-row { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
.comp-page a.fchip { text-decoration: none; }
.comp-page .fchips { width: 100%; }
.evs { display: flex; flex-direction: column; gap: 14px; margin-top: var(--space-l); }
.ev { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: center; padding: 18px 16px; border: 1px solid var(--line); border-radius: var(--radius-l, 18px); background: var(--surface); }
.ev-date { display: none; flex-direction: column; align-items: center; justify-content: center; height: 136px; border-radius: 16px; background: var(--surface-2); color: var(--teal); }
.ev-date b { font-family: var(--font-display); font-size: 80px; font-weight: 600; line-height: .9; }
.ev-date span { margin-top: 6px; font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ev-date small { margin-top: 2px; font-size: 13px; color: var(--muted); }
.ev-dtext { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.ev-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ev h3 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.15; color: var(--teal); }
.jaos { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; background: var(--mint-soft); font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--accent); }
.ev-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.ev-meta li { display: inline-flex; align-items: center; gap: 6px; }
.ev-meta svg { color: var(--mint); }
.ev-cls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.cls { display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--pill); font-size: 13px; font-weight: 500; color: var(--text); }
.cls-more { border-color: transparent; background: var(--mint-soft); color: var(--accent); font-weight: 700; }
.ev-side { grid-column: 1 / -1; display: flex; align-items: center; padding-top: 14px; border-top: 1px solid var(--surface-2); }
.ev-acts { display: flex; flex: 1 1 auto; gap: 8px; }
.ev-acts .btn { flex: 1 1 0; }
.btn-sm { min-height: 40px; height: 40px; padding: 0 16px; font-size: 14px; text-decoration: none; }
.btn-line { border: 1px solid var(--line); color: var(--teal); background: var(--surface); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); }
.btn-teal { background: var(--accent); color: #fff; }
.btn-teal:hover { background: var(--teal); }
.comp-page .empty { margin-top: var(--space-l); padding: 32px; border: 1px dashed var(--line); border-radius: 18px; }

.band { margin-top: var(--space-2xl); padding: 56px 0; background: var(--teal); color: #fff; }
.band-in { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: center; }
.band .kicker { color: var(--mint); }
.band h2 { margin: 0; font-family: var(--font-display); font-size: clamp(2.125rem, 1.9rem + 1vw, 2.75rem); font-weight: 600; line-height: 1.1; color: #fff; }
.band p.body { margin: 18px 0 0; font-size: 16px; line-height: 1.75; color: var(--line); }
.band .tiles { display: grid; grid-template-columns: 1fr; gap: 10px; }
.band .tile { padding: 18px; border: 1px solid rgba(157, 197, 187, .25); border-radius: 18px; background: rgba(255, 255, 255, .04); }
.band .tile b { display: block; font-family: var(--font-display); font-size: 36px; font-weight: 600; line-height: 1; color: #fff; }
.band .tile span { display: block; margin-top: 8px; font-size: 14px; color: var(--mint); }

.arch { margin-top: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.ar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 14px 16px; font-size: 15px; }
.ar + .ar { border-top: 1px solid var(--surface-2); }
.ar-head { display: none; background: var(--bg); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ar-label { grid-column: 1; grid-row: 2; font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--teal); }
.ar .muted { color: var(--muted); }
.ar-date { grid-column: 1; grid-row: 1; font-size: 13px; }
.ar-jaos { grid-column: 2; grid-row: 1; justify-self: end; }
.ar-cls { grid-column: 1; grid-row: 3; font-size: 13px; }
.ar-n { grid-column: 1; grid-row: 4; font-size: 13px; }
.ar-more { grid-column: 2; grid-row: 2 / span 3; align-self: center; justify-self: end; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.ar-more:hover { color: var(--teal); text-decoration: underline; }
.cpager { flex-direction: column-reverse; align-items: stretch; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 0; }
.pg-info { font-size: 14px; color: var(--muted); }
.pg-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pg { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--teal); text-decoration: none; }
.pg:hover { border-color: var(--mint); }
.pg.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.pg-nav { padding: 0; }

@media (min-width: 720px) {
  .comp-page .sec-row { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
  .comp-page .fchips { width: auto; }
  .ev { grid-template-columns: 136px minmax(0, 1fr) auto; gap: 28px; padding: 24px 28px; }
  .ev-date { display: flex; }
  .ev-dtext { display: none; }
  .ev h3 { font-size: 26px; }
  .ev-side { grid-column: auto; padding-top: 0; border-top: 0; }
  .ev-acts { flex: 0 0 auto; }
  .ev-acts .btn { flex: 0 0 auto; }
  .band { padding: 80px 0; }
  .band-in { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; }
  .band p.body { font-size: 17px; }
  .band .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .band .tile { padding: 24px 26px; }
  .band .tile b { font-size: 48px; }
  .ar { grid-template-columns: 120px minmax(0, 1fr) 80px 120px 160px auto; gap: 16px; padding: 16px 22px; }
  .ar-head { display: grid; }
  .ar-label, .ar-date, .ar-jaos, .ar-cls, .ar-n, .ar-more { grid-column: auto; grid-row: auto; font-size: 15px; }
  .ar-more { font-size: 14px; align-self: center; }
  .cpager { flex-direction: row; align-items: center; gap: 16px; }
}

/* ---------- Competition page (Phase 4b-1, design 2026-10-01-competitions) ---------- */
.comp-detail { --silver: #cfd9d9; --bronze: #e3b98c; --bronze-ink: #3b2408; --warn-bg: #fff4d6; --warn-ink: #8a5a00; --hairline: #f0f4f4; padding-bottom: var(--space-2xl); }
.comp-detail .hsec { scroll-margin-top: calc(var(--header-h) + 60px); }
.comp-detail .hsec h2 { font-family: var(--font-display); color: var(--teal); }
.comp-detail .crumbs { flex-wrap: wrap; padding-top: 20px; font-size: 13px; }
.comp-detail .crumbs svg { color: var(--mint); }
.comp-detail .crumbs span:last-child { white-space: normal; }
.cd-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 16px; }
.cd-img { display: block; order: -1; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 24px; background: var(--line); }
.ctags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ctags .jaos { height: 28px; padding: 0 10px; border-radius: 7px; font-size: 13px; }
.ctag { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.cstate { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: var(--pill); font-size: 13px; font-weight: 700; }
.cstate::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cstate.open { background: var(--mint-soft); color: var(--accent); }
.cstate.done { background: var(--warn-bg); color: var(--warn-ink); }
.cd-top h1 { margin: 16px 0 0; font-size: 42px; font-weight: 600; line-height: 1; letter-spacing: -.01em; color: var(--teal); }
.comp-detail .ev-sub { margin: 10px 0 0; font-size: 17px; font-weight: 600; color: var(--accent); }
.cd-text { margin: 22px 0 0; font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
.cd-text a { color: var(--accent); font-weight: 600; }
.kf { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 28px 0 0; padding: 0; }
.kf .k { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.k-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--mint-soft); color: var(--accent); }
.kf dt { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kf dd { margin: 3px 0 0; font-size: 16px; font-weight: 600; color: var(--text); }
.kf dd span { font-weight: 500; color: var(--muted); }

.ctabs { position: sticky; top: var(--header-h); z-index: 4; margin-top: 40px; background: rgba(246, 248, 248, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.ctabs-in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ctabs a { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 4px; border-bottom: 2px solid transparent; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.ctabs a:hover { color: var(--teal); }
.ctabs a:focus-visible { box-shadow: var(--focus); }

.rules { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 24px; margin: 28px 0 0; padding: 0; list-style: none; counter-reset: rule; }
.rules li { display: flex; gap: 16px; align-items: flex-start; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); font-size: 15px; line-height: 1.6; counter-increment: rule; }
.rules li::before { content: counter(rule); flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--mint-soft); color: var(--accent); font-weight: 700; font-size: 14px; }

.lcs { margin: 28px 0 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.lc { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 8px 12px; align-items: center; padding: 16px; }
.lc + .lc { border-top: 1px solid var(--surface-2); }
.lc-main { display: contents; }
.lc-n { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; background: var(--teal); color: #fff; font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.lc-top { grid-column: 2; align-self: center; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lc-top b { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--teal); }
.hchip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--pill); background: var(--mint-soft); font-size: 13px; font-weight: 700; color: var(--accent); }
.lc p { grid-column: 1 / -1; margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.lc-cnt { grid-column: 1 / -1; display: flex; flex-direction: row-reverse; align-items: center; justify-content: flex-end; gap: 12px; font-size: 13px; color: var(--muted); }
.lc-cnt b { font-size: 16px; color: var(--text); }
.lc-cnt > span { white-space: nowrap; }
.cbar { display: block; flex: 1 1 auto; width: 100%; height: 6px; border-radius: var(--pill); background: var(--surface-2); overflow: hidden; }
.cbar i { display: block; height: 100%; border-radius: var(--pill); background: var(--accent); }

.join { margin-top: 28px; max-width: 860px; }
.form-card { padding: 20px 16px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 20px 50px rgba(0, 56, 68, .06); }
.form-card h3 { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--teal); }
.form-card .sub { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.comp-detail .fld { display: flex; flex-direction: column; gap: 7px; }
.comp-detail .fld label { font-size: 13px; font-weight: 600; color: var(--text); }
.comp-detail .inp { width: 100%; height: 46px; padding: 0 13px; border: 1px solid #cfd9d9; border-radius: 11px; background: var(--surface); font: inherit; font-size: 15px; color: var(--text); }
.comp-detail .inp:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.comp-detail .ta { height: auto; min-height: 230px; padding: 12px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.7; resize: vertical; }
.f-mail { margin-top: 22px; }
.comp-detail .join { max-width: none; }
.entry-format { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.entry-format .btn { margin-top: 12px; }
.entry-sample { margin: 14px 0 0; padding: 12px 14px; overflow-x: auto; border-radius: 12px; background: var(--bg); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.7; user-select: all; }
.f-entries { margin-top: 18px; }
.comp-detail .hint { font-size: 13px; line-height: 1.5; color: var(--muted); }
.comp-detail .errorlist { margin: 0; padding: 12px 16px; list-style: none; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--gold); font-size: 14px; line-height: 1.5; color: var(--text); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.f-foot { display: flex; flex-direction: column-reverse; align-items: stretch; justify-content: space-between; gap: 16px; margin-top: 22px; }
.f-foot small { font-size: 13px; color: var(--muted); }
.btn-send { height: 50px; width: 100%; padding: 0 24px; background: var(--accent); color: #fff; font-size: 15px; }
.btn-send:hover { background: var(--teal); }
.sent { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 12px; }
.sent-ic, .closed-ic { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 50%; background: var(--mint-soft); color: var(--accent); }
.sent h3, .closed h3 { margin: 18px 0 0; font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--teal); }
.sent p, .closed p { max-width: 440px; margin: 8px 0 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.comp-detail .btn-line { margin-top: 22px; }
.closed { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; margin-top: 28px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.closed .closed-ic { flex: none; width: 52px; height: 52px; background: var(--surface-2); color: var(--muted); }
.closed h3 { margin: 0; }
.closed p { max-width: none; margin-top: 4px; }
.closed .btn-line { margin: 0; }

.cchips { display: none; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.js-ready .cchips { display: flex; }
.cchip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.cchip:hover { border-color: var(--mint); color: var(--teal); }
.cchip:focus-visible { box-shadow: var(--focus); outline: none; }
.cchip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.cchip i { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: var(--pill); background: var(--surface-2); font-size: 12px; font-style: normal; font-weight: 700; color: var(--muted); }
.cchip.on i { background: rgba(157, 197, 187, .25); color: var(--mint); }
.panel { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); overflow: hidden; }
.panel-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 16px; border-bottom: 1px solid var(--surface-2); }
.panel-h h3 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--teal); }
.panel-h p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.panel-h .cnt { font-size: 14px; color: var(--muted); }
.cnts { display: flex; align-items: center; gap: 12px; }
.placed-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--pill); background: var(--mint-soft); font-size: 13px; font-weight: 700; color: var(--accent); }
.panel-empty { margin: 0; padding: 20px 16px; font-size: 14px; color: var(--muted); }
.panel a { color: inherit; text-decoration: underline; text-decoration-color: var(--mint); text-underline-offset: 3px; }
.panel .m { font-size: 13px; color: var(--muted); white-space: nowrap; }
.panel .num { font-variant-numeric: tabular-nums; text-align: right; }
.c-r, .c-h { min-width: 0; line-height: 1.45; }
.c-r b { font-weight: 600; color: var(--text); }
.c-h b { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--teal); }
.rr, .er { padding: 12px 16px; font-size: 14px; }
.rr + .rr, .er + .er, .rr-sep + .rr { border-top: 1px solid var(--hairline); }
.rr { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px 12px; align-items: center; }
.rr-head, .er-head { display: none; }
.rr .c-r, .rr .c-h, .er .c-r, .er .c-h { display: none; }
.rr .pl { grid-row: 1 / span 3; align-self: start; width: 32px; height: 32px; }
.rr .rr-line { grid-column: 2; line-height: 1.45; }
.rr .sc { grid-column: 2; display: inline; text-align: left; font-size: 13px; color: var(--muted); }
.rr .sc::before { content: attr(data-label) " "; }
.rr .sc:empty { display: none; }
.er { display: block; line-height: 1.5; }
.rr.placed { background: #f3f9f8; box-shadow: inset 3px 0 0 var(--accent); }
.pl { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); font-size: 14px; font-weight: 700; color: var(--muted); }
.pl.pp { background: var(--mint-soft); color: var(--accent); }
.pl.gold { background: var(--gold); color: var(--teal); }
.pl.silver { background: var(--silver); color: var(--teal); }
.pl.bronze { background: var(--bronze); color: var(--bronze-ink); }
.rr-sep { display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--bg); border-top: 1px solid var(--surface-2); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rr-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rr .pl.pl-tag { width: auto; min-width: 34px; padding: 0 10px; border-radius: var(--pill); white-space: nowrap; }
.rr-show .rr { grid-template-columns: max-content minmax(0, 1fr); }
.rr-show .pl-tag { grid-row: 1 / span 2; }
.sw-sec + .sw-sec { border-top: 1px solid var(--line); }
.sw-sec h4 { margin: 0; padding: 12px 16px 4px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sw-row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; font-size: 14px; }
.sw-row .pl { width: auto; min-width: 44px; height: 30px; padding: 0 10px; border-radius: var(--pill); }
.sw-horse b { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--teal); }
.sw-also .sw-horse { color: var(--muted); }
.sw-also .sw-horse b { color: var(--muted); font-weight: 500; }
.sw-also .sw-horse::before { content: "("; }
.sw-also .sw-horse::after { content: ")"; }
.cd-end { height: 64px; }

@media (min-width: 720px) {
  .comp-detail .crumbs { padding-top: 32px; font-size: 14px; }
  .cd-top { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 64px; align-items: start; padding-top: 28px; }
  .cd-top.noimg { grid-template-columns: minmax(0, 1fr); }
  .cd-img { order: 0; aspect-ratio: 3 / 4; }
  .cd-top h1 { font-size: clamp(2.625rem, 1.6rem + 3vw, 4.25rem); }
  .comp-detail .ev-sub { font-size: 20px; }
  .cd-text { font-size: 17px; }
  .kf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ctabs { margin-top: 56px; }
  .ctabs-in { display: flex; gap: 4px; }
  .ctabs a { height: 56px; padding: 0 16px; font-size: 15px; }
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lc { grid-template-columns: 44px minmax(0, 1fr) 180px; gap: 20px; padding: 18px 22px; }
  .lc-main { display: block; }
  .lc-n { width: 44px; height: 44px; border-radius: 12px; font-size: 22px; }
  .lc-top b { font-size: 21px; }
  .lc p { grid-column: auto; margin-top: 4px; }
  .lc-cnt { grid-column: auto; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px; }
  .form-card { padding: 32px; }
  .f-foot { flex-direction: row; align-items: center; }
  .btn-send { width: auto; }
  .closed { flex-direction: row; align-items: center; padding: 24px 28px; }
  .closed .btn-line { margin-left: auto; }
  .panel-h { padding: 22px 24px; }
  .panel-h h3 { font-size: 26px; }
  .rr, .er { padding: 13px 24px; font-size: 15px; }
  .rr { grid-template-columns: 64px minmax(0, 1.2fr) minmax(0, 1.5fr) repeat(var(--sc, 2), 80px); gap: 16px; }
  .er { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr); gap: 16px; align-items: center; }
  .rr-head, .er-head { display: grid; background: var(--bg); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .rr .c-r, .rr .c-h, .er .c-r, .er .c-h { display: block; }
  .rr .rr-line, .er .er-line { display: none; }
  .rr .pl { grid-row: auto; align-self: center; width: 34px; height: 34px; }
  .rr-show .rr { grid-template-columns: 96px minmax(0, 1.2fr) minmax(0, 1.5fr); }
  .rr .sc { grid-column: auto; display: block; text-align: right; font-size: 15px; color: var(--text); }
  .rr .sc::before { content: none; }
  .rr .sc:empty { display: block; }
  .rr-sep { padding: 10px 24px; }
  .cd-end { height: 96px; }
}

/* Contact */
.contact-page { --warn-bg: #fff4d6; padding-bottom: var(--space-2xl); }
.hero-credit { position: absolute; z-index: 1; right: var(--gutter); bottom: 10px; font-size: 11px; color: rgba(255, 255, 255, .75); }
.contact-page .contact { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); align-items: start; }
.contact-page .contact h2 { margin: 0; }
.contact-body { margin-top: 18px; }
.chans { display: flex; flex-direction: column; gap: 12px; margin-top: var(--space-m); }
.chan { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s; }
a.chan:hover { border-color: var(--mint); }
.chan-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 14px; background: var(--mint-soft); color: var(--accent); }
.chan-t { flex: 1; min-width: 0; }
.chan-t > span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.chan-t b { display: block; margin-top: 3px; font-size: 17px; font-weight: 600; color: var(--teal); overflow-wrap: anywhere; }
.chan > .icon { flex: none; color: var(--mint); }
.contact-page .notice { margin-top: var(--space-m); }
.contact-page .fgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px 16px; margin-top: 24px; }
.contact-page .fld { display: flex; flex-direction: column; gap: 7px; min-width: 0; border: 0; padding: 0; margin: 0; }
.contact-page .fld > label, .contact-page .fld > legend { padding: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.contact-page .inp { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #cfd9d9; border-radius: 12px; background: var(--surface); font: inherit; font-size: 15px; color: var(--text); }
.contact-page .inp:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.contact-page .ta { height: auto; min-height: 150px; padding: 12px 14px; line-height: 1.6; resize: vertical; }
.contact-page .errorlist { margin: 8px 0 0; padding: 10px 14px; list-style: none; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--gold); font-size: 14px; line-height: 1.5; color: var(--text); }
.contact-page .fld .errorlist { margin: 0; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; }
.topic { position: relative; display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.topic input { position: absolute; opacity: 0; pointer-events: none; }
.topic:hover { border-color: var(--mint); color: var(--teal); }
.topic:has(input:checked) { background: var(--teal); border-color: var(--teal); color: #fff; }
.topic:has(input:focus-visible) { box-shadow: var(--focus); }
.links { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: var(--space-m); }
.lnk { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s; }
.lnk:hover { border-color: var(--mint); }
.lnk b { display: block; font-size: 15px; font-weight: 600; color: var(--teal); overflow-wrap: anywhere; }
.lnk > span > span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.lnk .icon { flex: none; color: var(--mint); }
@media (min-width: 720px) {
  .contact-page .contact { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-xl); }
  .contact-page .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-page .fld.full { grid-column: 1 / -1; }
  .contact-page .form-card { padding: 36px; }
  .links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .contact-page .f-foot { flex-direction: row; align-items: center; }
  .contact-page .btn-send { width: auto; }
}
@media (min-width: 1000px) { .links { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Staff-only shortcut to the admin edit view. */
.edit-badge { position: fixed; right: 0; top: 50%; z-index: 50; display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px 10px 12px; border-radius: 12px 0 0 12px; background: var(--teal); color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; box-shadow: 0 4px 14px rgba(0, 56, 68, .25); }
.edit-badge:hover { background: var(--accent); }
.edit-badge:focus-visible { outline: none; box-shadow: var(--focus); }
@media print { .edit-badge { display: none; } }
