:root {
  color-scheme: light dark;
  --bg: #f7f5ef;
  --surface: #fffefa;
  --ink: #203d30;
  --muted: #52665b;
  --line: #d7dfd3;
  --accent: #245b43;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 120px; }
body { margin: 0; overflow-wrap: anywhere; }
header {
  position: relative;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem max(1rem, calc((100vw - 1180px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 18px #1735280a;
}
main, footer { max-width: 1240px; margin: auto; padding: 2.5rem 2rem; }
main { min-height: 60vh; }
a { color: var(--accent); text-underline-offset: .2em; }
a, button, summary { touch-action: manipulation; }
nav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
nav a { display: inline-flex; align-items: center; min-height: 44px; }
.brand { font-size: 1.2rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.header-search { display: flex; gap: .3rem; flex: 1; max-width: 330px; }
.header-search input { width: 100%; min-width: 0; }
.header-search { min-width: 0; }
.header-search button { white-space: nowrap; flex-shrink: 0; min-width: 5rem; }
button {
  font: inherit;
  border: 0;
  border-radius: .5rem;
  padding: .5rem .8rem;
  background: var(--accent);
  color: var(--surface);
  cursor: pointer;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 6vw, 4.7rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.045em;
  margin: 1.5rem 0;
  max-width: 850px;
}
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); line-height: 1.3; letter-spacing: -.02em; margin-top: 2.5rem; }
h3 { font-size: 1.2rem; line-height: 1.3; }
p { max-width: 80ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 750; color: var(--accent); }
.intro { font-size: clamp(1.2rem, 3vw, 1.6rem); max-width: 48ch; }
.filters, aside { padding: clamp(1rem, 3vw, 2rem); background: var(--surface); border: 1px solid var(--line); border-radius: 1.4rem; margin: 1.5rem 0; }
.filters { box-shadow: 0 10px 40px #243e2706; }
label { display: block; min-height: 44px; }
input, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--muted); border-radius: .5rem; min-height: 44px; padding: .5rem; }
input[type=checkbox], input[type=radio] { min-height: 22px; width: 22px; height: 22px; vertical-align: middle; accent-color: var(--accent); flex-shrink: 0; }
.search { font-weight: 700; }
.search input { display: block; width: 100%; padding: 1rem; font-size: 1.1rem; margin: .5rem 0 1rem; border: 2px solid var(--accent); border-radius: .8rem; box-shadow: 0 4px 18px #235f4509; }
.popular { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .85rem; }
.popular a, .status-tabs a { background: var(--bg); padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 2rem; text-decoration: none; min-height: 44px; }
.pet-picker h2 { margin-top: 1.5rem; }
.pet-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
fieldset { min-width: 0; margin: 0; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: .5rem; }
legend { font-weight: 700; font-size: .85rem; }
.pet-options label { font-size: .85rem; display: flex; gap: .5rem; align-items: center; }
#pet-summary { font-weight: 650; border-top: 1px solid var(--line); padding-top: 1rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; }
.filter-row > label { flex: 1 1 160px; }
.filter-row select { display: block; width: 100%; max-width: 100%; }
.plants { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 1.5rem; }
.plant-card { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; padding: 0 1rem 1rem; box-shadow: 0 4px 12px #203d3005; transition: transform .18s ease, box-shadow .18s ease; }
.plant-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px #203d3015; }
.plant-card > a:first-child { display: block; text-decoration: none; }
.plant-card img, .photo-missing { width: calc(100% + 2rem); margin-left: -1rem; aspect-ratio: 4/3; object-fit: cover; height: auto; background: var(--line); display: block; }
.photo-missing { display: grid; place-items: center; color: var(--ink); font-size: .85rem; }
.plant-card h2 { font-family: Georgia, serif; font-size: 1.4rem; line-height: 1.25; margin: 1rem 0 .2rem; }
.scientific { font-style: italic; color: var(--muted); margin-top: .2rem; }
.plant-card .scientific { font-size: .85rem; min-height: 2.7em; }
.badge { display: inline-block; font-size: .78rem; line-height: 1.5; padding: .3rem .5rem; border-radius: .5rem; font-weight: 650; margin: .2rem .2rem .2rem 0; }
.overall { display: block; margin-bottom: .6rem; font-weight: 750; }
.toxic { color: #84202b; background: #ffe6e8; }
.non-toxic { color: #185736; background: #e0f4e4; }
.caution { color: #674507; background: #fff0ca; }
.conflict { color: #64358b; background: #f3e8ff; }
.no-data { color: #47534e; background: #edf0ec; }
.card-source { display: inline-block; margin-top: .8rem; min-height: 30px; font-size: .85rem; }
.animal-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .75rem; }
.animal-links a { display: flex; flex-direction: column; align-items: start; padding: 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; text-decoration: none; font-size: .9rem; }
.animal-links a > span:last-child { color: var(--muted); font-size: .8rem; }
.animal-icon { font-size: 2rem; }
.plant-intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.plant-intro h2 { margin-top: 1rem; }
.plant-hero { max-width: 720px; }
.plant-hero img, .plant-hero .photo-missing { width: 100%; height: auto; margin: 0; aspect-ratio: 4/3; object-fit: cover; border-radius: 1rem; display: block; background: var(--line); }
.plant-hero .photo-missing { display: grid; }
.credit { font-size: .75rem; color: var(--muted); }
.verdict-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: .6rem; }
.verdict-tile { padding: .8rem; text-decoration: none; border-radius: .7rem; font-size: .8rem; }
.verdict-tile span, .verdict-tile strong { display: block; }
.verdict-tile strong { margin-top: .4rem; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
caption { text-align: left; color: var(--muted); }
td, th { padding: 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
td { width: 78%; }
.group-heading { background: var(--bg); font-size: .9rem; }
.group-heading th { padding: .6rem 1rem; }
td details { max-width: 75ch; }
details { margin: .7rem 0; }
summary { display: list-item; cursor: pointer; min-height: 44px; padding: .5rem 0; }
blockquote { border-left: 3px solid var(--accent); margin: 1rem 0; padding-left: 1rem; font-size: .95rem; }
aside { border-left: 4px solid var(--accent); }
aside h2 { margin-top: 0; }
.lookalike { border-left-color: #a96b13; }
.status-tabs, .plant-navigation { display: flex; flex-wrap: wrap; gap: .7rem; margin: 2rem 0; }
.plant-navigation { justify-content: space-between; border-top: 1px solid var(--line); padding-top: 1rem; }
.link-list { columns: 3; column-gap: 2rem; }
.link-list li { break-inside: avoid; margin-bottom: .5rem; }
.empty { border: 1px dashed var(--line); background: var(--surface); padding: 1.5rem; border-radius: .8rem; }
footer { margin-top: 3rem; border-top: 1px solid var(--line); }
footer h2 { margin-top: 0; }
dt { font-weight: 700; }
dd { margin: 0 0 1rem; }
.emergency { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
a:focus-visible, input:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #b45c00; outline-offset: 4px; }
.skip { position: absolute; top: -100px; left: 1rem; background: var(--surface); padding: 1rem; z-index: 10; }
.skip:focus { position: fixed; top: 0; }
@media (max-width: 850px) {
  header { flex-wrap: wrap; gap: .4rem 1rem; }
  .header-search { margin-left: auto; }
  header nav { width: 100%; justify-content: center; }
  .plant-intro { grid-template-columns: 1fr; }
  .plant-hero { max-width: 600px; }
  .link-list { columns: 2; }
}
@media (max-width: 650px) {
  header { padding: .6rem 1rem; }
  .header-search { max-width: none; flex-basis: 100%; order: 3; }
  header nav { width: auto; margin-left: auto; font-size: .8rem; gap: .7rem; }
  .brand { font-size: 1rem; }
  header nav a:last-child { display: none; }
  main, footer { padding: 1rem; }
  main { padding-top: 1.4rem; }
  html { scroll-padding-top: 135px; }
  h1 { font-size: 2.65rem; }
  .filters { margin: 1rem 0; }
  .pet-options { grid-template-columns: 1fr; }
  .pet-options fieldset { padding: .6rem; }
  .plants { gap: 1rem; }
  .plant-card .scientific { min-height: 0; }
  .link-list { columns: 1; }
  table { table-layout: fixed; }
  td, th { padding: .65rem .4rem; }
  td { width: 70%; }
  th { font-size: .85rem; }
  .verdict-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14251e; --surface: #1c3027; --ink: #edf3e9; --muted: #bfcec2; --line: #405749; --accent: #b1dfba; }
  .toxic { background: #501c26; color: #ffdae0; }
  .non-toxic { background: #163d29; color: #b6f0c7; }
  .caution { background: #483509; color: #ffe0a0; }
  .conflict { background: #3e2658; color: #e5c9ff; }
  .no-data { background: #35413b; color: #e0e7e1; }
  button, .emergency a { color: #14251e; }
  .plant-card { box-shadow: none; }
  a:focus-visible, input:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible { outline-color: #ffbf66; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
.pet-choices { border: 1px solid var(--line); border-radius: .7rem; padding: .3rem .8rem; }
.pet-choices > summary { font-weight: 650; }
.pet-choices[open] .pet-options { padding: .6rem 0; }
thead th:first-child { width: 22%; }
.filter-row > label { min-width: 0; }
@media (max-width: 650px) {
  thead th:first-child { width: 30%; }
}

@media (max-width: 650px) {
  .evidence-table, .evidence-table tbody, .evidence-table tr,
  .evidence-table th, .evidence-table td { display: block; width: 100%; min-width: 0; }
  .evidence-table thead { display: none; }
  .evidence-table th[scope="row"] { border-bottom: 0; padding-bottom: 0; }
  .evidence-table td { padding-top: 0; }
  .evidence-table details, .evidence-table blockquote { max-width: 100%; overflow-wrap: anywhere; }
}

.emergency-bar { position: sticky; top: 0; z-index: 8; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .5rem 1rem; color: #84202b; background: #ffe6e8; }
.emergency-bar a { flex: 1; min-height: 44px; padding: .3rem; color: #84202b; font-weight: 700; }
.emergency-bar small { display: block; font-weight: 400; }
.cat-emergency { color: #84202b; background: #ffe6e8; border: 2px solid #84202b; }
.cat-emergency a { color: #84202b; }
html { scroll-padding-top: 220px; }
button, .card-source { min-height: 44px; }
.verdict-tile { display: block; }
.evidence-table td { width: auto; }
@media (max-width: 650px) {
 .emergency-bar { font-size: .75rem; padding: .4rem; gap: .3rem; }
 .emergency-bar > strong { flex-basis: 100%; }
 .emergency-bar a { flex-basis: 45%; }
 html { scroll-padding-top: 240px; }
}
.verdict-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.verdict-grid > [data-pet-tile] { min-width: 0; }
.verdict-callouts { display: grid; grid-template-columns: minmax(0, 1fr); }
.verdict-callouts > aside { grid-column: 1 / -1; margin: .6rem 0; padding: 1rem; }
.tile-note { font-size: .78rem; margin: .4rem 0; line-height: 1.4; }
.compact-exposure { padding: 1rem; }
.compact-exposure h2 { font-size: 1rem; margin-bottom: .4rem; }
.compact-exposure p { margin: .25rem 0; font-size: .85rem; }
.filters { display: flex; flex-direction: column; gap: .75rem; }
.filters .pet-picker h2 { margin-top: 0; }
.filters > button { align-self: start; }
.evidence-table { table-layout: auto; }
.evidence-table th, .evidence-table td { width: auto; padding: .7rem; }
.evidence-table th:first-child { width: auto; min-width: 5rem; }
.evidence-table th:nth-child(2) { min-width: 7rem; }
.evidence-table th:nth-child(3) { min-width: 6rem; }
.evidence-table th:nth-child(4) { min-width: 6rem; }
.evidence-table th:nth-child(5) { min-width: 7rem; }
.evidence-table th:nth-child(6) { min-width: 6rem; }
.evidence-link { white-space: nowrap; }
.source-kind { background: var(--bg); color: var(--muted); font-weight: 500; }
.source-tag { font-weight: 600; border: 1px solid currentColor; background: transparent; color: var(--muted); }
.source-tag.abstract { color: #8a5a00; }
.source-tag.review { color: #4b4b9c; }
.accepted-name { font-size: .95rem; color: var(--muted); margin: .1rem 0 .5rem; }
.evidence-source { margin-bottom: .5rem; }
html { scroll-padding-top: 0; }
[id] { scroll-margin-top: 110px; }
@media (max-width: 699px) {
 .verdict-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .evidence-table, .evidence-table tbody, .evidence-table tr, .evidence-table th, .evidence-table td { display: block; width: 100%; min-width: 0 !important; }
 .evidence-table thead { display: none; }
 .evidence-table .evidence-row { border: 1px solid var(--line); border-radius: .8rem; margin: .75rem 0; padding: .5rem; }
 .evidence-table .evidence-row th, .evidence-table .evidence-row td { border: 0; padding: .5rem; }
 .evidence-table td::before { content: attr(data-label) ":"; display: block; font-weight: 700; font-size: .85rem; }
 .evidence-table caption { display: block; }
 .emergency-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .5rem; padding: .25rem .5rem; font-size: .68rem; line-height: 1.25; }
 .emergency-bar > strong { grid-column: 1 / -1; }
 .emergency-bar a { min-width: 0; min-height: 44px; padding: .2rem 0; }
 .emergency-bar small { font-size: .65rem; }
 [id] { scroll-margin-top: 95px; }
}

.tile-note { display: flex; gap: .3rem; }
.tile-note > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-note > a { flex-shrink: 0; }
.evidence-table th, .evidence-table td { padding: .5rem; }
.evidence-table th:first-child { min-width: 4rem; }
.evidence-table th:nth-child(2) { min-width: 6rem; }
.evidence-table th:nth-child(3) { min-width: 5rem; }
.evidence-table th:nth-child(4) { min-width: 5rem; white-space: nowrap; }
.evidence-table th:nth-child(5) { min-width: 6rem; }
.evidence-table th:nth-child(6) { min-width: 5rem; }
@media (max-width: 640px) {
  .animal-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .animal-links a { padding: .65rem; min-height: 44px; font-size: .85rem; }
  .animal-links a > span:last-child { font-size: .72rem; }
}
