/* =====================================================================
   BreedBoard — design system
   Palette taken from the reference layouts: espresso frame, cream paper,
   tan section, olive team block, sage stripes and brown pill buttons.
   ===================================================================== */
:root {
  --espresso: #34251c;
  --espresso-2: #2a1e17;
  --cream: #f2ede3;
  --paper: #faf7f1;
  --tan: #ab9272;
  --tan-2: #9d8465;
  --tan-soft: #d9ccb8;
  --brown: #6d4b2f;
  --brown-2: #5a3d25;
  --olive: #3e5135;
  --olive-2: #33442b;
  --sage: #b3b7a1;
  --sage-soft: #dcdfd0;
  --ink: #2d231c;
  --muted: #7b6b5a;
  --line: #e3dacb;
  --white: #fffdf9;
  --good: #4f6b3e;
  --warn: #b7862c;
  --bad: #a3452f;
  --blue: #5a7390;
  --serif: "Newsreader", "Georgia", serif;
  --sans: "Raleway", "Segoe UI", system-ui, sans-serif;
  --script: "Allura", cursive;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(52, 37, 28, .06), 0 12px 32px -12px rgba(52, 37, 28, .22);
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brown); text-decoration: none; }
a:hover { color: var(--brown-2); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 300; line-height: 1.12; margin: 0 0 .5em; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.15rem; font-weight: 400; }
p { margin: 0 0 1em; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.serif { font-family: var(--serif); }
.eyebrow { font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.center { text-align: center; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: .5rem } .mt-2 { margin-top: 1rem } .mt-3 { margin-top: 1.5rem } .mt-4 { margin-top: 2.5rem }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: .5rem } .mb-2 { margin-bottom: 1rem } .mb-3 { margin-bottom: 1.5rem }
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- header */
.announce {
  background: var(--espresso); color: var(--tan-soft); text-align: center;
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; padding: 8px 40px; position: relative;
}
.announce a { color: var(--cream); border-bottom: 1px solid rgba(255,255,255,.3); }
.announce button { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--tan-soft); cursor: pointer; font-size: 1rem; }
.site-header { background: var(--cream); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 70px; }
.nav { display: flex; gap: 28px; align-items: center; }
.nav.right { justify-content: flex-end; }
.nav a, .nav button.linkish {
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--ink);
  background: none; border: 0; cursor: pointer; font-family: var(--sans); padding: 0;
}
.nav a:hover, .nav a.active { color: var(--brown); }
.logo { font-family: var(--serif); font-size: 1.9rem; letter-spacing: .08em; color: var(--ink); font-weight: 400; white-space: nowrap; }
.logo { display: inline-flex; align-items: center; justify-content: center; }
.logo-mark { display: inline-block; width: 1.6em; height: 1.6em; margin: -.35em .02em -.25em; color: var(--brown); flex: none; }
.logo-mark svg { width: 100%; height: 100%; stroke-width: 2.4; }
.menu-toggle { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--ink); }
.mobile-nav { display: none; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--brown); color: var(--cream); border: 1px solid var(--brown);
  border-radius: 999px; padding: 9px 22px; font: 600 .68rem/1 var(--sans);
  letter-spacing: .18em; text-transform: uppercase; cursor: pointer; transition: .2s ease;
}
.btn:hover { background: var(--brown-2); color: var(--white); transform: translateY(-1px); }
.btn.light { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.btn.light:hover { background: var(--white); }
.btn.outline { background: transparent; color: var(--brown); border-color: var(--brown); }
.btn.outline:hover { background: var(--brown); color: var(--cream); }
.btn.olive { background: var(--olive); border-color: var(--olive); }
.btn.olive:hover { background: var(--olive-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { background: transparent; color: var(--bad); border-color: rgba(163,69,47,.4); }
.btn.danger:hover { background: var(--bad); color: #fff; }
.btn.lg { padding: 14px 30px; font-size: .74rem; }
.btn.sm { padding: 7px 14px; font-size: .62rem; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; min-height: 640px; color: var(--cream); display: grid; place-items: center; overflow: hidden; }
.hero .bg { position: absolute; inset: 0; background-size: cover; background-position: center 60%; transform: scale(1.04); }
.hero .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(42,30,23,.35) 0%, rgba(42,30,23,.55) 55%, rgba(42,30,23,.75) 100%); }
.hero .inner { position: relative; text-align: center; max-width: 780px; padding: 90px 24px 170px; }
.hero h1 { color: var(--cream); font-size: clamp(2rem, 4.2vw, 3.2rem); }
.hero p { color: rgba(242,237,227,.88); max-width: 560px; margin: 0 auto 1.6em; font-size: .95rem; }
.hero .eyebrow { color: var(--cream); margin-bottom: 1.2em; }
.fence { position: absolute; left: 0; right: 0; bottom: 38px; width: 100%; height: 90px; opacity: .9; }
.marquee { position: absolute; left: 0; right: 0; bottom: 0; background: var(--sage); overflow: hidden; height: 40px; display: flex; align-items: center; }
.marquee .track { display: flex; gap: 48px; white-space: nowrap; animation: scroll 40s linear infinite; font-family: var(--serif); font-size: 1.35rem; color: var(--espresso); }
.marquee .track span::after { content: "✦"; margin-left: 48px; font-size: .8rem; color: var(--brown); vertical-align: middle; }
@keyframes scroll { from { transform: translateX(0) } to { transform: translateX(-50%) } }

/* ---------------------------------------------------------------- sections */
section.block { padding: 96px 0; position: relative; }
.bg-cream { background: var(--cream); }
.bg-paper { background: var(--paper); }
.bg-tan { background: var(--tan); }
.bg-olive { background: var(--olive); color: var(--cream); }
.bg-olive h2, .bg-olive h3, .bg-olive h4 { color: var(--cream); }
.bg-olive .muted { color: rgba(242,237,227,.72); }
.bg-espresso { background: var(--espresso); color: var(--cream); }
.bg-espresso h2, .bg-espresso h3 { color: var(--cream); }
.stripes { background: repeating-linear-gradient(90deg, var(--sage-soft) 0 26px, var(--paper) 26px 52px); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split.flush { gap: 0; }
.lead { font-size: 1.02rem; color: var(--muted); max-width: 520px; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head p { color: inherit; opacity: .85; font-size: .9rem; }
.ornament { width: 72px; height: 72px; margin: 0 auto 10px; color: var(--ink); }
.bg-olive .ornament, .bg-espresso .ornament { color: var(--cream); }

.photo-frame { position: relative; }
.photo-frame img { border-radius: 4px; box-shadow: var(--shadow); aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.stamp { position: absolute; width: 124px; height: 124px; right: -38px; top: -46px; animation: spin 28s linear infinite; }
.stamp.left { left: -40px; right: auto; top: auto; bottom: -40px; }
@keyframes spin { to { transform: rotate(360deg) } }

.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.cards-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.assist-card { text-align: center; color: var(--ink); }
.assist-card .img { overflow: hidden; border-radius: 3px; aspect-ratio: 4/5; box-shadow: 0 18px 40px -22px rgba(0,0,0,.5); }
.assist-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.assist-card:hover img { transform: scale(1.05); }
.assist-card h3 { margin: 20px 0 6px; font-size: 1.6rem; }
.assist-card p { font-size: .86rem; color: rgba(45,35,28,.78); max-width: 290px; margin: 0 auto; }

.what-box { background: var(--paper); border-radius: 26px; padding: 56px 48px; text-align: center; max-width: 470px; margin: 70px auto; position: relative; box-shadow: var(--shadow); }
.what-box p { font-size: .88rem; color: var(--muted); }

.team-stack { background: var(--paper); border-radius: 26px; padding: 12px; display: grid; gap: 10px; color: var(--ink); box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
.team-card { display: grid; grid-template-columns: 124px 1fr; gap: 16px; align-items: center; background: var(--cream); border-radius: 18px; padding: 10px; transition: .25s; }
.team-card:hover { transform: translateX(-6px); background: var(--white); }
.team-card img { border-radius: 12px; aspect-ratio: 4/3; object-fit: cover; }
.team-card .eyebrow { font-size: .6rem; }
.team-card h4, .bg-olive .team-card h4 { font-size: 2rem; font-weight: 300; margin: 0; color: var(--ink); }
.team-card .eyebrow { color: var(--muted); }

.steps { counter-reset: s; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; position: relative; }
.step::before { counter-increment: s; content: "0" counter(s); font-family: var(--serif); font-size: 2.4rem; color: var(--tan); display: block; line-height: 1; margin-bottom: 12px; }
.step h4 { margin-bottom: 6px; }
.step p { font-size: .85rem; color: var(--muted); margin: 0; }

.ribbon { background: #a9b6d8; overflow: hidden; padding: 12px 0; }
.ribbon .track { display: flex; gap: 60px; white-space: nowrap; animation: scroll 50s linear infinite; font-family: var(--script); font-size: 2.2rem; color: #6e2a1c; }

.site-footer { background: var(--espresso); color: var(--tan-soft); padding: 64px 0 28px; font-size: .86rem; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.site-footer h5 { font-family: var(--sans); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--cream); margin: 0 0 14px; }
.site-footer a { color: var(--tan-soft); display: block; margin-bottom: 6px; }
.site-footer a:hover { color: var(--cream); }
.site-footer .logo { color: var(--cream); }
.site-footer .legal { border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 22px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: .75rem; }

/* ---------------------------------------------------------------- app layout */
.page-head { background: var(--espresso); color: var(--cream); padding: 46px 0 40px; position: relative; overflow: hidden; }
.page-head h1 { color: var(--cream); font-size: clamp(1.9rem, 3.6vw, 2.8rem); margin-bottom: .2em; }
.page-head .eyebrow { color: var(--tan-soft); }
.page-head p { color: rgba(242,237,227,.8); margin: 0; }
.page-head .deco { position: absolute; right: 4%; bottom: -10px; width: 180px; opacity: .18; color: var(--cream); }
.crumbs { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--tan-soft); margin-bottom: 14px; }
.crumbs a { color: var(--tan-soft); }
.crumbs a:hover { color: var(--cream); }
.page-body { padding: 40px 0 90px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 26px; }
.tabs a { color: var(--tan-soft); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 7px 16px; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.tabs a:hover { color: var(--cream); border-color: rgba(255,255,255,.35); }
.tabs a.active { background: var(--cream); color: var(--ink); border-color: var(--cream); }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.card + .card { margin-top: 22px; }
.card h3 { font-size: 1.45rem; margin-bottom: .3em; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head p { margin: 0; font-size: .86rem; color: var(--muted); }
.card.tan { background: var(--tan); border-color: var(--tan-2); color: var(--ink); }
.card.olive { background: var(--olive); border-color: var(--olive-2); color: var(--cream); }
.card.olive h3, .card.olive h4 { color: var(--cream); }
.card.olive .muted { color: rgba(242,237,227,.72); }
.card.cream { background: var(--paper); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 > .card + .card, .grid-3 > .card + .card, .grid-4 > .card + .card { margin-top: 0; }
.span-2 { grid-column: span 2; }

.section-title { display: flex; align-items: baseline; gap: 14px; margin: 44px 0 18px; }
.section-title .no { font-family: var(--serif); font-size: 2.4rem; color: var(--tan); line-height: 1; }
.section-title h2 { font-size: 1.9rem; margin: 0; }
.section-title p { margin: 0 0 0 auto; font-size: .82rem; color: var(--muted); max-width: 420px; text-align: right; }

.stat { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.stat .label { font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.stat .value { font-family: var(--serif); font-size: 2.05rem; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .value small { font-family: var(--sans); font-size: .78rem; color: var(--muted); margin-left: 4px; }
.stat .sub { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.stat.dark { background: var(--espresso); border-color: var(--espresso); color: var(--cream); }
.stat.dark .label, .stat.dark .sub { color: var(--tan-soft); }
.stat.olive { background: var(--olive); border-color: var(--olive); color: var(--cream); }
.stat.olive .label, .stat.olive .sub { color: rgba(242,237,227,.72); }
.stat.tan { background: var(--tan); border-color: var(--tan); }
.stat.tan .label, .stat.tan .sub { color: rgba(45,35,28,.75); }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }

.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 11px; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; background: var(--sage-soft); color: var(--olive-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.low, .badge.excellent, .badge.strong { background: #e1e8d6; color: #3d5a2b; }
.badge.good, .badge.moderate-good { background: #e7ecdc; color: #55713f; }
.badge.moderate, .badge.fair, .badge.flat { background: #f4e7c8; color: #8a6116; }
.badge.high, .badge.poor, .badge.negative { background: #f3d9cf; color: #9a3a22; }
.badge.very-high { background: #9a3a22; color: #fff; }
.badge.baseline { background: #e5e1d8; color: var(--muted); }
.badge.M { background: #dfe6ef; color: #3f5a7a; }
.badge.F { background: #f2dfe0; color: #8a4250; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
table.data { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.data th { text-align: left; font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--paper); white-space: nowrap; }
table.data td { padding: 10px 14px; border-bottom: 1px solid #efe8dc; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #fbf8f2; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .sel td { background: #f4f6ee; }
table.formula { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.formula td { padding: 8px 0; border-bottom: 1px dashed var(--line); }
table.formula td:last-child { text-align: right; font-family: var(--serif); font-size: 1.05rem; font-variant-numeric: tabular-nums; }

.formula-box { background: var(--paper); border: 1px dashed var(--tan); border-radius: 12px; padding: 12px 16px; font-family: "Cambria Math", var(--serif); font-size: 1.02rem; color: var(--ink); margin: 10px 0; }
.formula-box .note { display: block; font-family: var(--sans); font-size: .76rem; color: var(--muted); margin-top: 4px; }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 22px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
label.lbl { display: block; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.input, select.input, textarea.input {
  width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; font: 400 .92rem var(--sans); color: var(--ink); transition: .15s;
}
.input:focus { outline: none; border-color: var(--tan); background: var(--white); box-shadow: 0 0 0 4px rgba(171,146,114,.18); }
.help { font-size: .76rem; color: var(--muted); margin-top: 5px; }
.error-text { font-size: .78rem; color: var(--bad); margin-top: 5px; }
.check { display: flex; gap: 8px; align-items: center; font-size: .88rem; }

.choice-grid { display: grid; gap: 16px; }
.choice-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.choice-grid.c4 { grid-template-columns: repeat(4, 1fr); }
.choice-grid.c2 { grid-template-columns: repeat(2, 1fr); }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .face { display: block; border: 1.5px solid var(--line); border-radius: 18px; background: var(--white); overflow: hidden; transition: .2s; height: 100%; }
.choice .face img { aspect-ratio: 16/11; object-fit: cover; width: 100%; filter: saturate(.9); }
.choice .face .txt { padding: 14px 16px 16px; }
.choice .face h4 { margin: 0 0 3px; font-size: 1.3rem; }
.choice .face p { margin: 0; font-size: .8rem; color: var(--muted); }
.choice:hover .face { border-color: var(--tan); transform: translateY(-2px); }
.choice input:checked + .face { border-color: var(--brown); box-shadow: 0 0 0 3px rgba(109,75,47,.18), var(--shadow); }
.choice input:checked + .face::after { content: "✓"; position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--brown); color: #fff; display: grid; place-items: center; font-size: .85rem; }
.choice.compact .face { padding: 16px 18px; }

.wizard-steps { display: flex; gap: 0; margin: 0 0 30px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); padding: 5px; overflow-x: auto; }
.wizard-steps button { flex: 1; border: 0; background: none; padding: 10px 14px; border-radius: 999px; font: 700 .64rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); cursor: pointer; white-space: nowrap; }
.wizard-steps button span { font-family: var(--serif); font-size: .95rem; margin-right: 6px; letter-spacing: 0; }
.wizard-steps button.active { background: var(--espresso); color: var(--cream); }
.wizard-steps button.done { color: var(--olive); }
.wizard-pane { display: none; animation: fade .35s ease; }
.wizard-pane.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 28px; }

.alert { border-radius: 14px; padding: 14px 18px; margin-bottom: 20px; font-size: .88rem; border: 1px solid; display: flex; gap: 12px; align-items: flex-start; }
.alert.success { background: #eef2e6; border-color: #cdd8bd; color: #3d5a2b; }
.alert.error { background: #f8e8e2; border-color: #ebc6b8; color: #8f3521; }
.alert.info { background: #f1ece2; border-color: var(--line); color: var(--ink); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

.disclaimer { background: #fbf3e2; border: 1px solid #ecd9b0; border-left: 5px solid var(--warn); border-radius: 14px; padding: 18px 22px; font-size: .86rem; }
.disclaimer h4 { font-family: var(--sans); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; margin-bottom: 8px; color: #8a6116; }
.disclaimer ul { margin: 4px 0 8px; padding-left: 20px; }
.disclaimer .cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

/* score ring */
.ring { --v: 50; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--olive) calc(var(--v) * 1%), var(--sage-soft) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 11px; background: var(--white); border-radius: 50%; }
.ring span { position: relative; font-family: var(--serif); font-size: 2.2rem; line-height: 1; text-align: center; }
.ring span small { display: block; font-family: var(--sans); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

.bar-meter { height: 8px; background: var(--sage-soft); border-radius: 999px; overflow: hidden; }
.bar-meter span { display: block; height: 100%; background: var(--olive); border-radius: 999px; }

.gen-timeline { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.gen-node { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 16px 14px; text-align: center; position: relative; transition: .2s; color: var(--ink); }
.gen-node:hover { border-color: var(--tan); transform: translateY(-2px); color: var(--ink); }
.gen-node .g { font-family: var(--serif); font-size: 1.9rem; line-height: 1; }
.gen-node .l { font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-top: 6px; }
.gen-node.done { background: var(--olive); border-color: var(--olive); color: var(--cream); }
.gen-node.done .l { color: rgba(242,237,227,.75); }
.gen-node.next { border: 1.5px dashed var(--brown); background: var(--paper); }
.gen-node.locked { opacity: .45; }

.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.chart-box.lg { height: 340px; }

.tree { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: center; font-size: .78rem; }
.tree .col { display: grid; gap: 8px; height: 100%; align-content: space-around; }
.tree .n { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-align: center; }
.tree .n.m { border-left: 3px solid #5a7390; }
.tree .n.f { border-left: 3px solid #a35d6b; }
.tree .n.self { background: var(--espresso); color: var(--cream); border: 0; font-weight: 600; }
.tree .n.empty { color: #b9ab98; border-style: dashed; }

.punnett { border-collapse: collapse; margin: 6px auto; }
.punnett td, .punnett th { width: 58px; height: 46px; text-align: center; border: 1px solid var(--line); font-family: var(--serif); font-size: 1.15rem; }
.punnett th { background: var(--paper); font-weight: 400; color: var(--brown); }
.punnett td { background: var(--white); }
.punnett td.t { background: #e7ecdc; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.gallery figure { margin: 0; position: relative; border-radius: 14px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); }
.gallery img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.gallery figcaption { padding: 8px 10px; font-size: .74rem; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.gallery form { position: absolute; top: 8px; right: 8px; }
.gallery .x { background: rgba(42,30,23,.7); color: #fff; border: 0; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; }

.dropzone { border: 1.5px dashed var(--tan); border-radius: 16px; padding: 22px; text-align: center; background: var(--paper); cursor: pointer; transition: .2s; display: block; }
.dropzone:hover, .dropzone.drag { background: #f3ede1; border-color: var(--brown); }
.dropzone input { display: none; }
.dropzone .icon { font-size: 1.6rem; color: var(--tan-2); }
.dropzone .fname { font-size: .8rem; color: var(--olive); font-weight: 600; margin-top: 6px; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 7px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); font-size: .8rem; color: var(--ink); }
.pagination .active { background: var(--espresso); color: var(--cream); border-color: var(--espresso); }
.pagination .disabled { opacity: .4; }

.empty-state { text-align: center; padding: 70px 20px; }
.empty-state svg { width: 110px; margin: 0 auto 16px; color: var(--tan); }

.project-card { display: grid; grid-template-columns: 160px 1fr; background: var(--white); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; transition: .2s; color: var(--ink); }
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.project-card img { height: 100%; object-fit: cover; }
.project-card .body { padding: 20px 22px; }
.project-card h3 { font-size: 1.55rem; margin-bottom: 4px; }
.progress-dots { display: flex; gap: 5px; margin-top: 10px; }
.progress-dots i { width: 22px; height: 6px; border-radius: 999px; background: var(--sage-soft); }
.progress-dots i.on { background: var(--olive); }

.auth-shell { min-height: calc(100vh - 110px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-shell .side { background-size: cover; background-position: center; position: relative; }
.auth-shell .side::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(42,30,23,.7), rgba(42,30,23,.1)); }
.auth-shell .side .quote { position: absolute; left: 44px; right: 44px; bottom: 44px; color: var(--cream); z-index: 1; font-family: var(--serif); font-size: 1.7rem; font-weight: 300; line-height: 1.25; }
.auth-shell .form-side { display: grid; place-items: center; padding: 50px 24px; background: var(--paper); }
.auth-card { width: 100%; max-width: 400px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: .88rem; }
.kv dt { color: var(--muted); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; padding-top: 3px; }
.kv dd { margin: 0; }

.reason-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.reason-list li { padding: 10px 14px 10px 38px; background: var(--paper); border-radius: 12px; position: relative; font-size: .86rem; }
.reason-list li::before { content: "→"; position: absolute; left: 14px; color: var(--brown); }

.number-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; }
.number-input button { width: 46px; height: 52px; border: 0; background: none; font-size: 1.3rem; cursor: pointer; color: var(--brown); }
.number-input button:hover { background: #efe7da; }
.number-input input { flex: 1; border: 0; background: none; text-align: center; font-family: var(--serif); font-size: 1.8rem; width: 60px; color: var(--ink); }
.number-input input:focus { outline: none; }
.number-input.locked { opacity: .7; }

.loading-overlay { position: fixed; inset: 0; background: rgba(42,30,23,.82); z-index: 200; display: none; place-items: center; color: var(--cream); text-align: center; }
.loading-overlay.show { display: grid; }
.loading-overlay .spinner { width: 70px; height: 70px; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--cream); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 18px; }
.loading-overlay p { font-family: var(--serif); font-size: 1.5rem; }

.team-photo { width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.person { text-align: center; }
.person .avatar { width: 140px; height: 140px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: var(--tan); font-family: var(--serif); font-size: 3rem; color: var(--cream); border: 6px solid var(--paper); box-shadow: var(--shadow); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .cards-4, .steps, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .gen-timeline { grid-template-columns: repeat(4, 1fr); }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .disclaimer .cols { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .site-header .bar { grid-template-columns: auto 1fr auto; }
  .nav { display: none; }
  .menu-toggle { display: block; }
  .logo { font-size: 1.5rem; text-align: center; }
  .mobile-nav.open { display: grid; gap: 14px; padding: 18px 24px 24px; border-top: 1px solid var(--line); }
  .mobile-nav a, .mobile-nav button { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--ink); background: none; border: 0; text-align: left; padding: 0; font-family: var(--sans); }
  .split, .grid-2, .grid-3, .cards-3, .form-grid, .form-grid.three, .auth-shell { grid-template-columns: 1fr; }
  .choice-grid.c3, .choice-grid.c4 { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: auto; }
  section.block { padding: 64px 0; }
  .stamp { right: 6px; top: -40px; width: 96px; height: 96px; }
  .auth-shell .side { min-height: 220px; }
  .project-card { grid-template-columns: 1fr; }
  .project-card img { height: 160px; }
  .section-title { flex-wrap: wrap; }
  .section-title p { margin: 0; text-align: left; }
  .tree { grid-template-columns: repeat(2, 1fr); }
  .tree .col:nth-child(n+3) { display: none; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .cards-4, .steps, .grid-4, .choice-grid.c3, .choice-grid.c4, .choice-grid.c2 { grid-template-columns: 1fr; }
  .gen-timeline { grid-template-columns: repeat(3, 1fr); }
  .site-footer .cols { grid-template-columns: 1fr; }
  .what-box { padding: 40px 24px; margin: 40px 16px; }
  .card { padding: 20px; }
}
@media print {
  .site-header, .announce, .site-footer, .ribbon, .btn, .tabs, form { display: none !important; }
  .page-head { background: none; color: var(--ink); padding: 10px 0; }
  .page-head h1 { color: var(--ink); }
  .card { break-inside: avoid; }
}

/* refinements */
body { overflow-x: clip; }
.choice .face .txt { display: block; }
.choice .face h4, .choice .face p { display: block; }
.site-footer .logo-mark { color: var(--tan); }
@media (max-width: 820px) { .page-head .deco { display: none; } }

/* ---------------------------------------------------------------- breeding dashboard */
.dash { display: grid; grid-template-columns: 360px 1fr; gap: 22px; align-items: start; }
.dash-side { display: grid; gap: 16px; position: sticky; top: 90px; }
.dash-side .card + .card { margin-top: 0; }
.dash-main { min-width: 0; }
.slider-row { margin-top: 18px; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--sage-soft); margin: 12px 0 8px; outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--brown); border: 3px solid var(--white); box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer; }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--brown); border: 3px solid var(--white); cursor: pointer; }
.range:disabled { opacity: .5; }
.range.goal { background: linear-gradient(90deg, var(--olive), var(--sage-soft) 50%, var(--brown)); }
.mini-num { width: 78px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 5px 8px; font: 400 1.15rem var(--serif); text-align: right; color: var(--ink); }
.risk-card { transition: background .3s, border-color .3s; }
.risk-card[data-level="low"] { background: #eef2e6; border-color: #cdd8bd; }
.risk-card[data-level="moderate"] { background: #fbf1da; border-color: #ecd9b0; }
.risk-card[data-level="high"] { background: #f8e3dc; border-color: #e7b9a9; }
.risk-value { font-family: var(--serif); font-size: 2.6rem; line-height: 1; margin: 12px 0 10px; }
.risk-value small { font-family: var(--sans); font-size: .72rem; color: var(--muted); margin-left: 6px; }
.risk-meter { position: relative; height: 10px; border-radius: 999px; background: linear-gradient(90deg, #cfdcbf 0 30%, #f0dcaa 30% 50%, #edc0b0 50%); overflow: hidden; }
.risk-meter span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--espresso); opacity: .75; border-radius: 999px; transition: width .2s; }
.risk-meter i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--white); }
.avg-row { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.avg-row strong { font-family: var(--serif); font-size: 1.35rem; font-weight: 400; text-align: right; }
.avg-row > span:last-child { grid-column: 1 / -1; }
.avg-row:last-child { border-bottom: 0; }
.legend-pills { display: flex; gap: 12px; font-size: .74rem; color: var(--muted); flex-wrap: wrap; }
.legend-pills i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.breed-btn { width: 100%; padding: 18px; font-size: .8rem; }

.tour { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 120; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.tour[hidden] { display: none; }
.tour-card { pointer-events: auto; display: flex; gap: 18px; max-width: 620px; width: 100%; background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 20px 22px; box-shadow: 0 30px 70px -20px rgba(42,30,23,.55); animation: fade .3s ease; }
.mascot { flex: 0 0 86px; height: 86px; border-radius: 50%; background: var(--tan); color: var(--espresso); padding: 12px; border: 4px solid var(--paper); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-3deg); } }
body.touring::after { content: ""; position: fixed; inset: 0; background: rgba(42,30,23,.45); z-index: 90; pointer-events: none; }
.tour-focus { position: relative; z-index: 100; box-shadow: 0 0 0 4px var(--tan), 0 20px 50px -10px rgba(0,0,0,.5) !important; }
.dash-side .tour-focus { position: relative; }

.alert-critical { background: var(--espresso); color: var(--cream); border-radius: 20px; padding: 26px 28px; display: flex; gap: 20px; align-items: center; margin-bottom: 22px; }
.alert-critical h3 { color: var(--cream); margin: 0 0 4px; }
.alert-critical .icon { font-size: 2.6rem; }
.victory { background: var(--olive); color: var(--cream); border-radius: 26px; padding: 40px; text-align: center; position: relative; overflow: hidden; margin-bottom: 26px; }
.victory h2 { color: var(--cream); }
.victory .score { font-family: var(--serif); font-size: 4.2rem; line-height: 1; }
.victory .mascot { margin: 0 auto 14px; width: 96px; height: 96px; }
.lb-rank { font-family: var(--serif); font-size: 1.5rem; color: var(--tan); width: 50px; }
.lb-rank.top { color: var(--brown); }
@media (max-width: 1000px) {
  .dash { grid-template-columns: 1fr; }
  .dash-side { position: static; }
}
.avg-row .badge { justify-self: start; }

/* ---------------------------------------------------------------- mobile */
/* grid/flex children may shrink below their content (tables, charts, long values) */
.grid-2 > *, .grid-3 > *, .grid-4 > *, .split > *, .cards-3 > *, .cards-4 > *, .steps > *,
.dash > *, .form-grid > *, .choice-grid > *, .kv > * { min-width: 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.kv dd { overflow-wrap: anywhere; }
input[type=file].input { min-width: 0; max-width: 100%; }

@media (max-width: 820px) {
  .announce { padding: 8px 40px 8px 16px; letter-spacing: .12em; line-height: 1.5; }
  .site-header .bar { height: 60px; }
  .menu-toggle { width: 44px; height: 44px; margin-left: -10px; }
  .mobile-nav.open { gap: 0; padding: 6px 24px 14px; max-height: calc(100vh - 60px); overflow-y: auto; }
  .mobile-nav a, .mobile-nav button { display: block; width: 100%; padding: 13px 0; border-bottom: 1px solid var(--line); }
  .mobile-nav form:last-child button, .mobile-nav > a:last-child { border-bottom: 0; }

  /* 16px stops iOS zooming into form fields */
  .input, select.input, textarea.input, .mini-num { font-size: 16px; }
  .btn { padding: 12px 22px; }
  .btn.sm { padding: 10px 16px; }
  .pagination a, .pagination span { padding: 10px 15px; }
  .site-footer a { padding: 4px 0; }

  .hero { min-height: 560px; }
  .hero .inner { padding: 64px 20px 150px; }
  .stamp.left { left: 6px; bottom: -30px; }
  .page-head { padding: 32px 0 28px; }
  .page-body { padding: 28px 0 64px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin-right: -24px; padding-right: 24px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; padding: 10px 16px; }
  .section-title { margin: 32px 0 14px; gap: 6px 12px; }
  .section-title .no { font-size: 2rem; }
  .section-title h2 { font-size: 1.6rem; }
  .section-head { margin-bottom: 32px; }
  .auth-shell { min-height: 0; }
  .auth-shell .side .quote { left: 24px; right: 24px; bottom: 24px; font-size: 1.3rem; }
  .auth-shell .form-side { padding: 36px 20px 48px; }
  .alert-critical { flex-direction: column; align-items: flex-start; padding: 22px; gap: 12px; }
  .victory { padding: 28px 20px; }
  .victory .score { font-size: 3.2rem; }
  .team-card { grid-template-columns: 96px 1fr; }
  .team-card h4, .bg-olive .team-card h4 { font-size: 1.6rem; }
  .wizard-nav { gap: 10px; flex-wrap: wrap; }
  .tour { bottom: 12px; }
  .tour-card { gap: 12px; padding: 16px; }
  .tour-card .mascot { flex-basis: 56px; height: 56px; padding: 8px; border-width: 3px; }
  .chart-box.lg { height: 280px; }
}
@media (max-width: 520px) {
  .tabs { margin-right: -16px; padding-right: 16px; }
  .logo { font-size: 1.35rem; }
  h2 { font-size: 1.7rem; }
  .section-head h2 { font-size: 1.8rem; }
  section.block { padding: 52px 0; }
  .stat .value { font-size: 1.75rem; }
  .risk-value { font-size: 2.2rem; }
  .ring { width: 112px; height: 112px; }
  .ring span { font-size: 1.9rem; }
  .punnett td, .punnett th { width: 46px; height: 40px; }
  .gen-node { padding: 12px 8px; }
  .gen-node .g { font-size: 1.5rem; }
  .project-card .body { padding: 16px 18px; }
  .chart-box { height: 240px; }
  .chart-box.lg { height: 260px; }
  .person .avatar { width: 112px; height: 112px; font-size: 2.4rem; }
  .auth-shell .side { min-height: 180px; }
  .wizard-nav .btn { flex: 1; }
  .choice .face img { aspect-ratio: 16/7; }
}

/* tabs on light cards (parent picker) */
.tabs.light a { color: var(--muted); border-color: var(--line); }
.tabs.light a:hover { color: var(--ink); border-color: var(--tan); }
.tabs.light a.active { background: var(--espresso); color: var(--cream); border-color: var(--espresso); }
#pickTable td:first-child, #pickTable th:first-child { width: 36px; }
details summary { cursor: pointer; }

/* two goal cards (meat, dairy) */
.cards-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; max-width: 820px; margin: 0 auto; }
.cards-2 > * { min-width: 0; }
@media (max-width: 820px) { .cards-2 { grid-template-columns: 1fr; max-width: 460px; } }
