/* Bird Nutrition Calculator - shared stylesheet
   Concept: a naturalist's field-guide plate. Warm paper, ink text, kingfisher teal,
   robin-breast rust. System fonts only (no external requests). */

:root {
  color-scheme: light dark;
  --bg: #FAF5EA;
  --surface: #FFFDF7;
  --surface-2: #F1EAD8;
  --text: #25211B;
  --muted: #5B5347;
  --border: #D8CDB4;
  --rule: #B9AC8F;
  --primary: #0B6E6E;
  --primary-hover: #085A5A;
  --on-primary: #FFFFFF;
  --accent: #A84A14;
  --accent-soft: #F6E3D2;
  --success: #2E6B3A;
  --success-soft: #E3F0E3;
  --error: #B3261E;
  --error-soft: #FBE6E3;
  --warn: #7A4F00;
  --warn-soft: #F8EBC8;
  --focus: #A84A14;
  --c-pellet: #0B6E6E;
  --c-seed: #C98A12;
  --c-veg: #3F7F3B;
  --c-fruit: #B4482F;
  --c-nuts: #7A5236;
  --c-protein: #556A86;
  --shadow: 0 1px 2px rgba(37, 33, 27, 0.08), 0 6px 18px rgba(37, 33, 27, 0.06);

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-0: clamp(1.0625rem, 1.03rem + 0.15vw, 1.1875rem);
  --step-1: clamp(1.25rem, 1.18rem + 0.35vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.35rem + 0.75vw, 2rem);
  --step-3: clamp(1.9rem, 1.55rem + 1.7vw, 3rem);
  --step-4: clamp(2.3rem, 1.75rem + 2.8vw, 3.9rem);

  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem; --s9: 6rem;
  --r1: 6px; --r2: 10px; --r3: 16px;
  --header-h: 4rem;
  --maxw: 70rem;
  --prose: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140F;
    --surface: #1F1C15;
    --surface-2: #29251C;
    --text: #F2ECDE;
    --muted: #BDB39F;
    --border: #3C372B;
    --rule: #58513F;
    --primary: #5FC9C2;
    --primary-hover: #86DAD4;
    --on-primary: #08201F;
    --accent: #F0A36B;
    --accent-soft: #3A2616;
    --success: #8FD29A;
    --success-soft: #1D3022;
    --error: #FF9C93;
    --error-soft: #3B1E1B;
    --warn: #F2C96B;
    --warn-soft: #382C0E;
    --focus: #F0A36B;
    --c-pellet: #5FC9C2;
    --c-seed: #E4B04A;
    --c-veg: #7CBF76;
    --c-fruit: #E58A72;
    --c-nuts: #C49A78;
    --c-protein: #8FA6C6;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px rgba(0, 0, 0, 0.3);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0 0 var(--s4); letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p { margin: 0 0 var(--s4); }
a { color: var(--primary); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--primary-hover); }
ul, ol { padding-left: 1.25rem; margin: 0 0 var(--s4); }
li { margin-bottom: var(--s2); }
strong { font-weight: 650; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

.skip-link {
  position: absolute; left: var(--s4); top: -4rem; z-index: 100;
  background: var(--primary); color: var(--on-primary); padding: var(--s3) var(--s4);
  border-radius: var(--r2); font-weight: 650; text-decoration: none;
}
.skip-link:focus { top: var(--s3); color: var(--on-primary); }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 640px) { .container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .container { padding-inline: 2rem; } }
.section { padding-block: var(--s8); }
.section--tight { padding-block: var(--s7); }
.section--alt { background: var(--surface-2); border-block: 1px solid var(--border); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { font-family: var(--font-body); font-size: var(--step--1); letter-spacing: 0.12em; text-transform: uppercase; font-weight: 650; color: var(--accent); margin: 0 0 var(--s3); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 38rem; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.2em; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--border); }
.site-header__row { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: var(--s4); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; line-height: 1.1; }
.brand:hover { color: var(--text); }
.brand__mark { width: 2.4rem; height: 2.4rem; flex: none; }
.brand__text span { display: block; font-family: var(--font-body); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 2px; }
.logo-bg { fill: var(--primary); }
.logo-body { fill: var(--bg); }
.logo-beak { fill: #F0A36B; }
.logo-eye { fill: var(--primary); }
.logo-line { stroke: var(--primary); }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-width: 2.9rem; min-height: 2.9rem; padding: 0 0.75rem;
  background: var(--surface); color: var(--text); border: 1.5px solid var(--border); border-radius: var(--r2);
  font: inherit; font-weight: 600; cursor: pointer;
}
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: inline; }

.nav {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: var(--s3) 1rem var(--s5);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.nav.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.nav li { margin: 0; }
.nav a { display: flex; align-items: center; min-height: 3rem; padding: 0 var(--s3); border-radius: var(--r2); text-decoration: none; color: var(--text); font-weight: 600; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); background: var(--surface-2); }
.nav a.nav__cta { background: var(--primary); color: var(--on-primary); justify-content: center; margin-top: var(--s2); }
.nav a.nav__cta:hover, .nav a.nav__cta[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.nav a.nav__cta:hover { background: var(--primary-hover); }

@media (min-width: 52rem) {
  .nav-toggle { display: none; }
  .nav { position: static; opacity: 1; visibility: visible; transform: none; border: 0; padding: 0; background: none; transition: none; }
  .nav ul { display: flex; align-items: center; gap: var(--s2); }
  .nav a { min-height: 2.75rem; padding: 0 var(--s4); }
  .nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent); background: none; border-radius: var(--r1); }
  .nav a.nav__cta { margin: 0 0 0 var(--s2); }
  .nav a.nav__cta[aria-current="page"] { background: var(--primary); color: var(--on-primary); border-radius: var(--r2); box-shadow: inset 0 -3px 0 var(--accent); }
}
.no-js .nav { position: static; opacity: 1; visibility: visible; transform: none; border: 0; padding: 0 0 var(--s3); }
.no-js .nav-toggle { display: none; }
.no-js .site-header__row { flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0 1.25rem; border-radius: var(--r2);
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--primary); background: var(--primary); color: var(--on-primary);
  transition: transform 0.12s ease, background-color 0.15s ease;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--secondary { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.btn--secondary:hover { background: var(--surface-2); color: var(--primary-hover); border-color: var(--primary-hover); }
.btn--ghost { background: none; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--rule); }
.btn--sm { min-height: 2.75rem; padding: 0 1rem; font-size: var(--step--1); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s3); }

/* ---------- Breadcrumb / page head ---------- */
.breadcrumb { font-size: var(--step--1); color: var(--muted); padding-top: var(--s5); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0; padding: 0; }
.breadcrumb li { margin: 0; display: flex; gap: var(--s2); align-items: center; }
.breadcrumb li + li::before { content: "/"; color: var(--rule); }
.breadcrumb a { color: var(--muted); }
.page-head { padding-block: var(--s5) var(--s6); border-bottom: 1px solid var(--border); }
.page-head h1 { font-size: var(--step-3); margin-bottom: var(--s3); }
.page-head p { color: var(--muted); max-width: 42rem; margin: 0; font-size: var(--step-1); line-height: 1.45; }
.page-head .meta-line { font-size: var(--step--1); line-height: 1.5; color: var(--muted); margin-top: var(--s3); }

/* ---------- Hero ---------- */
.hero { padding-block: var(--s7) var(--s8); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background-image: repeating-linear-gradient(115deg, var(--border) 0, var(--border) 1px, rgba(0,0,0,0) 1px, rgba(0,0,0,0) 22px);
  -webkit-mask-image: linear-gradient(to left, #000, rgba(0,0,0,0) 65%);
  mask-image: linear-gradient(to left, #000, rgba(0,0,0,0) 65%);
}
.hero__grid { position: relative; display: grid; gap: var(--s7); align-items: center; }
@media (min-width: 62rem) { .hero__grid { grid-template-columns: 1.05fr 0.95fr; gap: var(--s8); } }
.hero h1 { margin-bottom: var(--s4); }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero__points { list-style: none; padding: 0; margin: var(--s5) 0 0; display: grid; gap: var(--s2); color: var(--muted); font-size: var(--step--1); }
.hero__points li { display: flex; gap: var(--s2); align-items: center; margin: 0; }
.hero__points .icon { color: var(--success); }

/* ---------- Plate (signature element) ---------- */
.plate {
  position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r2);
  padding: var(--s5); box-shadow: inset 0 0 0 5px var(--surface), inset 0 0 0 6px var(--border), var(--shadow);
}
.plate__label { display: flex; justify-content: space-between; gap: var(--s3); font-family: var(--font-display); font-style: italic; color: var(--muted); font-size: var(--step--1); margin-bottom: var(--s3); }
.fig { font-family: var(--font-display); font-style: italic; color: var(--accent); font-size: var(--step--1); margin: 0 0 var(--s1); font-weight: 600; }
.headline-num { font-family: var(--font-display); font-size: var(--step-4); line-height: 1; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; }
.headline-num small { font-size: 0.4em; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 0.3em; font-family: var(--font-body); }
.plate hr { border: 0; border-top: 1px solid var(--border); margin: var(--s4) 0; }
.plate__row { display: grid; gap: var(--s4); }
@media (min-width: 30rem) { .plate__row--2 { grid-template-columns: 1fr 1fr; } }
.stat { margin: 0; }
.stat dt { font-size: var(--step--1); color: var(--muted); }
.stat dd { margin: 0; font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }

/* diet bar: patterned so colour is never the only signal */
.bar { display: flex; height: 2.75rem; border: 1.5px solid var(--text); border-radius: var(--r1); overflow: hidden; }
.bar__seg { height: 100%; min-width: 0; border-right: 1.5px solid var(--text); position: relative; }
.bar__seg:last-of-type { border-right: 0; }
.bar__seg span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bar__seg span b { background: var(--surface); padding: 0 0.3rem; border-radius: 3px; line-height: 1.3; }
.pat-pellet { background-color: var(--c-pellet); }
.pat-seed { background-color: var(--surface); background-image: repeating-linear-gradient(45deg, var(--c-seed) 0, var(--c-seed) 3px, rgba(0,0,0,0) 3px, rgba(0,0,0,0) 7px); }
.pat-veg { background-color: var(--surface); background-image: radial-gradient(var(--c-veg) 28%, rgba(0,0,0,0) 32%); background-size: 8px 8px; }
.pat-fruit { background-color: var(--surface); background-image: repeating-linear-gradient(0deg, var(--c-fruit) 0, var(--c-fruit) 2px, rgba(0,0,0,0) 2px, rgba(0,0,0,0) 6px), repeating-linear-gradient(90deg, var(--c-fruit) 0, var(--c-fruit) 2px, rgba(0,0,0,0) 2px, rgba(0,0,0,0) 6px); }
.pat-nuts { background-color: var(--surface); background-image: repeating-linear-gradient(0deg, var(--c-nuts) 0, var(--c-nuts) 3px, rgba(0,0,0,0) 3px, rgba(0,0,0,0) 6px); }
.pat-protein { background-color: var(--surface); background-image: repeating-linear-gradient(90deg, var(--c-protein) 0, var(--c-protein) 3px, rgba(0,0,0,0) 3px, rgba(0,0,0,0) 6px); }
.legend { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s2); font-size: var(--step--1); }
.legend li { display: grid; grid-template-columns: 1.25rem 1fr auto; gap: var(--s3); align-items: center; margin: 0; }
.legend .sw { width: 1.25rem; height: 1.25rem; border: 1.5px solid var(--text); border-radius: 3px; }
.legend .range { font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---------- Ledger (benefits), steps, bands ---------- */
.ledger { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.ledger li { display: grid; gap: var(--s2) var(--s5); padding: var(--s5) 0; border-bottom: 1px solid var(--border); margin: 0; }
@media (min-width: 46rem) { .ledger li { grid-template-columns: 4.5rem 14rem 1fr; align-items: start; } }
.ledger .icon-wrap { width: 3rem; height: 3rem; display: grid; place-items: center; border: 1.5px solid var(--rule); border-radius: 50%; color: var(--primary); }
.ledger .icon-wrap .icon { width: 1.5rem; height: 1.5rem; }
.ledger h3 { font-size: var(--step-1); margin: 0; }
.ledger p { margin: 0; color: var(--muted); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s6); counter-reset: step; }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s7); } }
.steps li { margin: 0; counter-increment: step; position: relative; padding-top: var(--s5); border-top: 3px double var(--rule); }
.steps li::before { content: counter(step); font-family: var(--font-display); font-style: italic; font-size: var(--step-4); line-height: 1; color: var(--accent); display: block; margin-bottom: var(--s3); }
.steps h3 { font-size: var(--step-1); margin-bottom: var(--s2); }
.steps p { margin: 0; color: var(--muted); }

.split { display: grid; gap: var(--s6); }
@media (min-width: 52rem) { .split { grid-template-columns: 1fr 1.4fr; gap: var(--s8); } }
.usecases { display: grid; gap: var(--s5); margin: 0; }
.usecases div { padding-left: var(--s4); border-left: 3px solid var(--accent); }
.usecases dt { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); }
.usecases dd { margin: var(--s1) 0 0; color: var(--muted); }

.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); }
@media (min-width: 46rem) { .checks { grid-template-columns: 1fr 1fr; gap: var(--s5) var(--s7); } }
.checks li { display: grid; grid-template-columns: 1.75rem 1fr; gap: var(--s3); margin: 0; }
.checks .icon { color: var(--success); width: 1.5rem; height: 1.5rem; margin-top: 0.1rem; }
.checks strong { display: block; }
.checks span { color: var(--muted); }

.cta-band { background: var(--primary); color: var(--on-primary); text-align: center; }
.cta-band h2 { color: var(--on-primary); }
.cta-band p { color: var(--on-primary); max-width: 36rem; margin-inline: auto; margin-bottom: var(--s5); }
.cta-band .btn { background: var(--on-primary); color: var(--primary); border-color: var(--on-primary); }
.cta-band .btn:hover { background: var(--surface-2); color: var(--primary-hover); }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--rule); max-width: var(--prose); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding: var(--s4) 0; min-height: 3.25rem; font-weight: 650; font-size: var(--step-0); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform 0.2s ease; color: var(--primary); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details > div { padding: 0 0 var(--s4); color: var(--muted); }
.faq details > div p:last-of-type { margin-bottom: 0; }

/* ---------- Prose pages ---------- */
.prose { max-width: var(--prose); }
.prose h2 { font-size: var(--step-2); margin-top: var(--s7); }
.prose h3 { font-size: var(--step-1); margin-top: var(--s6); }
.prose > :first-of-type { margin-top: 0; }
.callout { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: var(--s4) var(--s5); border-radius: 0 var(--r2) var(--r2) 0; margin: var(--s5) 0; }
.callout p:last-of-type { margin-bottom: 0; }
.callout--ok { border-left-color: var(--success); background: var(--success-soft); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 var(--s5); border: 1px solid var(--border); border-radius: var(--r2); background: var(--surface); }
.table-wrap:focus-visible { outline-offset: 0; }
table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
caption { text-align: left; padding: var(--s3) var(--s4); font-weight: 650; color: var(--muted); }
th, td { text-align: left; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--surface-2); font-weight: 650; white-space: nowrap; }
tbody tr:last-of-type td, tbody tr:last-of-type th { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tbody th { font-weight: 650; }

/* ---------- Forms ---------- */
.field { margin-bottom: var(--s4); }
.field label, .field .label { display: block; font-weight: 650; margin-bottom: var(--s1); }
.field .opt { font-weight: 400; color: var(--muted); }
.help { display: block; font-size: var(--step--1); color: var(--muted); margin-top: var(--s1); }
.input, select.input, textarea.input {
  width: 100%; min-height: 3rem; padding: 0.6rem 0.8rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--rule); border-radius: var(--r2);
}
textarea.input { min-height: 9rem; resize: vertical; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.6rem center; background-size: 1.4rem; }
.input:hover { border-color: var(--muted); }
.input[aria-invalid="true"] { border-color: var(--error); background: var(--error-soft); }
.error-text { display: none; color: var(--error); font-size: var(--step--1); font-weight: 600; margin-top: var(--s1); }
.error-text.is-shown { display: flex; gap: var(--s2); align-items: flex-start; }
.error-text .icon { margin-top: 0.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 7.5rem; gap: var(--s3); align-items: start; }
.fieldset-lite { border: 0; margin: 0; padding: 0; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
details.adv { margin-bottom: var(--s4); border: 1px solid var(--border); border-radius: var(--r2); background: var(--surface); }
details.adv summary { cursor: pointer; padding: var(--s3) var(--s4); font-weight: 650; min-height: 3rem; display: flex; align-items: center; }
details.adv > div { padding: 0 var(--s4) var(--s2); }

.alert { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r2); border: 1.5px solid var(--border); margin-bottom: var(--s4); font-size: var(--step--1); }
.alert .icon { margin-top: 0.15rem; }
.alert--error { background: var(--error-soft); border-color: var(--error); color: var(--text); }
.alert--error .icon { color: var(--error); }
.alert--ok { background: var(--success-soft); border-color: var(--success); }
.alert--ok .icon { color: var(--success); }
.alert--warn { background: var(--warn-soft); border-color: var(--warn); }
.alert--warn .icon { color: var(--warn); }
.alert--info { background: var(--surface-2); }
.alert--info .icon { color: var(--primary); }
.alert p { margin: 0; }
.alert ul { margin: var(--s1) 0 0; padding-left: 1.1rem; }
.alert li { margin-bottom: var(--s1); }

/* ---------- Tool layout ---------- */
.tool-grid { display: grid; gap: var(--s6); align-items: start; }
@media (min-width: 62rem) { .tool-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } .tool-grid .result-col { position: sticky; top: calc(var(--header-h) + 1rem); } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r3); padding: var(--s5); }
@media (min-width: 640px) { .panel { padding: var(--s6); } }
.panel h2 { font-size: var(--step-2); }
.result-box { min-height: 26rem; }
.result-empty { display: grid; place-items: center; text-align: center; min-height: 22rem; color: var(--muted); padding: var(--s5); }
.result-empty .icon { width: 2.5rem; height: 2.5rem; color: var(--rule); margin: 0 auto var(--s3); display: block; }
.result-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); }
.status-line { min-height: 1.5rem; font-size: var(--step--1); color: var(--success); font-weight: 600; margin-top: var(--s3); }
.notes { list-style: none; padding: 0; margin: var(--s4) 0 0; display: grid; gap: var(--s2); }
.notes li { display: grid; grid-template-columns: 1.5rem 1fr; gap: var(--s2); font-size: var(--step--1); margin: 0; }
.notes .icon { margin-top: 0.15rem; }
.notes .is-check .icon { color: var(--warn); }
.notes .is-info .icon { color: var(--primary); }
.tag { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1.5px solid currentColor; white-space: nowrap; }
.tag--within { color: var(--success); }
.tag--above, .tag--below { color: var(--warn); }
.tag--none { color: var(--muted); }
.tag .icon { width: 1em; height: 1em; }

.log-form { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 40rem) { .log-form { grid-template-columns: 1.3fr 1fr auto; align-items: end; } .log-form .field { margin-bottom: 0; } }
.iconbtn { min-width: 2.75rem; min-height: 2.75rem; display: inline-grid; place-items: center; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--r2); cursor: pointer; }
.iconbtn:hover { background: var(--surface-2); }

.species-list { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.species-list details { border-bottom: 1px solid var(--border); }
.species-list summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: 1fr auto; gap: var(--s3); align-items: center; padding: var(--s3) 0; min-height: 3.25rem; font-weight: 650; }
.species-list summary::-webkit-details-marker { display: none; }
.species-list summary .muted { font-weight: 400; font-size: var(--step--1); }
.species-list details > div { padding-bottom: var(--s4); color: var(--muted); }
.species-list details > div p:last-of-type { margin-bottom: 0; }

.two-col { display: grid; gap: var(--s5); }
@media (min-width: 46rem) { .two-col { grid-template-columns: 1fr 1fr; gap: var(--s6); } }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: var(--s2) 0; border-bottom: 1px solid var(--border); margin: 0; }
.list-plain li:last-of-type { border-bottom: 0; }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r2); padding: var(--s4); font-size: var(--step--1); overflow-x: auto; margin: 0 0 var(--s4); white-space: pre-wrap; }
.example { border: 1px solid var(--border); border-radius: var(--r2); padding: var(--s4) var(--s5); background: var(--surface); margin-bottom: var(--s4); }
.example h3 { font-size: var(--step-1); margin-bottom: var(--s2); }
.example p { margin-bottom: var(--s2); }
.example p:last-of-type { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: var(--s8); background: var(--surface-2); border-top: 1px solid var(--border); padding-block: var(--s7) var(--s5); }
.footer__grid { display: grid; gap: var(--s6); }
@media (min-width: 46rem) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; gap: var(--s7); } }
.footer__grid h2 { font-family: var(--font-body); font-size: var(--step--1); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s3); }
.footer__grid ul { list-style: none; padding: 0; margin: 0; }
.footer__grid li { margin: 0; }
.footer__grid a { display: inline-block; padding: var(--s2) 0; color: var(--text); }
.footer__brand p { color: var(--muted); max-width: 24rem; margin-top: var(--s3); font-size: var(--step--1); }
.footer__bottom { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--border); font-size: var(--step--1); color: var(--muted); }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .skip-link, .breadcrumb, .no-print, .tool-form-col, .result-actions, .page-head p, .section--alt, .faq-section, .cta-band { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .plate { box-shadow: none; border: 1px solid #000; break-inside: avoid; }
  .panel { border: 0; padding: 0; }
  .tool-grid { display: block; }
  .print-only { display: block !important; }
  a { color: #000; }
}
.print-only { display: none; }
