:root {
  color-scheme: light dark;
  --bg: #f4f0e6;
  --bg-2: #ebe5d6;
  --surface: #fffdf8;
  --surface-2: #f8f4ea;
  --ink: #1d2820;
  --ink-2: #3a463d;
  --muted: #6a756b;
  --line: #e0d9c8;
  --line-2: #cfc6b1;
  --forest: #2f5d3a;
  --forest-2: #244a2e;
  --moss: #7a9a4d;
  --rust: #b0532b;
  --right: #2e7d4f;
  --right-bg: #e3f1e6;
  --wrong: #b3412e;
  --wrong-bg: #f8e4df;
  --warn-bg: #fbeed3;
  --warn-ink: #7a4b07;
  --map-empty: #e9e3d3;
  --map-stroke: #fffdf8;
  --map-usda: #2f5d3a;
  --map-inat: #a9c47f;
  --photo-bg: #1b211c;
  --shadow: 0 1px 2px rgba(40, 40, 20, 0.06), 0 8px 24px rgba(40, 40, 20, 0.07);
  --radius: 14px;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --logo-leaf: #2f5d3a;
  --logo-vein: #3e6e4a;
  --logo-state: #f4efe2;
  --c-wildflower: #b0467a;
  --c-tree: #2f5d3a;
  --c-shrub: #6c7a2b;
  --c-vine: #7b5aa6;
  --c-fern: #2c7a74;
  --c-grass: #9a6b1f;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141814;
    --bg-2: #1b201b;
    --surface: #1d231e;
    --surface-2: #232a24;
    --ink: #e9ecdf;
    --ink-2: #cdd3c4;
    --muted: #9aa597;
    --line: #313a32;
    --line-2: #3f4a40;
    --forest: #8fc29a;
    --forest-2: #a9d4b1;
    --moss: #a8c47a;
    --rust: #e08a60;
    --right: #6fcf94;
    --right-bg: #1f3a28;
    --wrong: #f0907d;
    --wrong-bg: #45241f;
    --warn-bg: #3d3018;
    --warn-ink: #f4cf85;
    --map-empty: #2b322c;
    --map-stroke: #1d231e;
    --map-usda: #7fbf8c;
    --map-inat: #3f6a47;
    --photo-bg: #0d100d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.35);
    --logo-leaf: #3d7a4b;
    --logo-vein: #4f8b5d;
    --logo-state: #f1ede0;
    --c-wildflower: #e38ab3;
    --c-tree: #8fc29a;
    --c-shrub: #c1cf6d;
    --c-vine: #b69be0;
    --c-fern: #6cc6bd;
    --c-grass: #e0b060;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--forest); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.15; }
p { margin: 0 0 0.6em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.eyebrow {
  display: block;
  margin: 0 0 2px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--moss);
}

.app { width: min(1320px, 100%); margin: 0 auto; padding: 0 20px 28px; }

/* ------------------------------------------------------------ masthead */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 65px; height: 77px; flex: none; }
.bm-stem { fill: none; stroke: var(--logo-leaf); stroke-width: 4.2; stroke-linecap: round; }
.bm-leaf { fill: var(--logo-leaf); }
.bm-veins path { fill: none; stroke: var(--logo-vein); stroke-width: 1; stroke-linecap: round; }
.bm-rib { fill: var(--logo-vein); }
.bm-state { fill: var(--logo-state); }
.brand-name { display: block; font-family: var(--serif); font-weight: 650; font-size: 1.7rem; letter-spacing: -0.01em; }
.main-tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 999px; }
.main-tabs a {
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}
.main-tabs a:hover { color: var(--ink); }
.main-tabs a.active { background: var(--surface); color: var(--forest); box-shadow: var(--shadow); }

.view { display: none; }
.view.active { display: block; animation: fade 0.18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ common bits */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.6;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-wildflower { color: var(--c-wildflower); }
.cat-tree { color: var(--c-tree); }
.cat-shrub { color: var(--c-shrub); }
.cat-vine { color: var(--c-vine); }
.cat-fern { color: var(--c-fern); }
.cat-grass { color: var(--c-grass); }
.status-native { color: var(--muted); }
.status-introduced { color: var(--rust); }
.status-invasive { color: #fff; background: var(--wrong); border-color: var(--wrong); }
.badge.toxic, .badge.food-toxic { color: #fff; background: var(--wrong); border-color: var(--wrong); }
.badge.food-edible { color: #fff; background: var(--right); border-color: var(--right); }
.badge.food-caution { color: var(--warn-ink); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn-ink) 35%, transparent); }
.badge.food-none { color: var(--muted); }

/* uses */
.uses { display: grid; gap: 14px; }
.uses .use-row h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--sans); font-size: 0.95rem; font-weight: 700; margin: 0 0 4px; }
.use-row p { margin: 0; color: var(--ink-2); }
.use-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--moss); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.evidence {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--bg-2);
  color: var(--ink-2);
}
.ev-proven, .ev-some { background: var(--right-bg); color: var(--right); }
.ev-weak { background: var(--warn-bg); color: var(--warn-ink); }
.ev-harmful { background: var(--wrong-bg); color: var(--wrong); }
.disclaimer { margin: 2px 0 0; font-size: 0.78rem; color: var(--muted); font-style: italic; }
.uses-panel .uses { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.uses-panel .disclaimer { grid-column: 1 / -1; }
.uses-details { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.uses-details summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; font-weight: 700; cursor: pointer; }
.uses-details[open] summary { border-bottom: 1px solid var(--line); }
.uses-details .uses { padding: 12px; }

.primary-btn, .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 18px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}
.primary-btn { background: var(--forest); color: var(--surface); }
.primary-btn:hover { background: var(--forest-2); }
.primary-btn.small { min-height: 34px; padding: 4px 12px; font-size: 0.88rem; }
.ghost-btn { background: transparent; border-color: var(--line-2); color: var(--ink-2); }
.ghost-btn:hover { border-color: var(--forest); color: var(--forest); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--forest) 55%, transparent); outline-offset: 2px; }

.field { display: grid; gap: 5px; font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.field select, .search input {
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
}
.field.inline { display: flex; align-items: center; gap: 8px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------ quiz */
.quiz-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings {
  position: sticky;
  top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.settings summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.settings summary::-webkit-details-marker { display: none; }
.settings summary::after { content: "▾"; color: var(--muted); margin-left: 8px; }
.settings[open] summary::after { content: "▴"; }
.settings summary > span:first-child { flex: 1; }
.pool-count { font-size: 0.78rem; font-weight: 600; color: var(--forest); background: var(--bg-2); padding: 2px 8px; border-radius: 999px; }
.settings-body { display: grid; gap: 14px; padding: 0 16px 16px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.chip-set { display: flex; flex-wrap: wrap; gap: 6px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  user-select: none;
}
.chip small { font-weight: 500; opacity: 0.7; }
.chip input:checked + span { background: var(--forest); border-color: var(--forest); color: var(--surface); }
.chip input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--forest) 55%, transparent); outline-offset: 2px; }
.toggles { display: grid; gap: 10px; }
.toggles label { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.toggles input { margin-top: 3px; accent-color: var(--forest); width: 16px; height: 16px; flex: none; }
.toggles small { display: block; font-weight: 400; color: var(--muted); font-size: 0.8rem; }

.quiz-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.scorebar {
  display: flex;
  gap: 18px;
  padding: 10px 16px;
  font-size: 0.86rem;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.scorebar b { font-size: 1rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.scorebar .muted { margin-left: auto; }
.photo-stage {
  position: relative;
  margin: 0;
  background: var(--photo-bg);
  aspect-ratio: 4 / 3;
  max-height: min(54vh, 620px);
  width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.photo-stage img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; object-position: center; transition: opacity 0.2s; }
.photo-backdrop {
  position: absolute;
  inset: -30px;
  z-index: 0;
  background: center / cover no-repeat;
  filter: blur(24px) brightness(0.5) saturate(1.15);
  transition: background-image 0.2s;
}
.photo-loading, .credit, .photo-btn { z-index: 2; }
.photo-stage.loading img { opacity: 0.25; }
.photo-loading {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  display: none;
}
.photo-stage.loading .photo-loading { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.credit {
  position: absolute;
  left: 10px;
  bottom: 8px;
  max-width: 60%;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.credit a { color: inherit; text-decoration: none; }
.credit a:hover { text-decoration: underline; }
.photo-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(20, 24, 20, 0.62);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.photo-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.photo-btn:disabled { opacity: 0.5; cursor: default; }
.photo-btn.alt-view::before { content: "other view"; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #f4cf85; margin-right: 2px; }

.question { padding: 16px 18px 4px; }
.question h3 { font-family: var(--serif); font-weight: 650; font-size: 1.55rem; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 18px; }
.choices.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 14px;
  text-align: left;
  border-radius: 12px;
  border: 1.5px solid var(--line-2);
  background: var(--surface-2);
  transition: border-color 0.12s, background 0.12s, transform 0.06s;
}
.choice:hover:not(:disabled) { border-color: var(--forest); background: var(--surface); }
.choice:active:not(:disabled) { transform: scale(0.99); }
.choice .key {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--bg-2);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.choice-text { display: grid; line-height: 1.25; }
.nm { font-weight: 650; font-size: 1rem; }
.nm-sub { font-size: 0.82rem; color: var(--muted); }
.sci { font-style: italic; }
.nm.sci { font-weight: 600; }
.choice.correct { border-color: var(--right); background: var(--right-bg); }
.choice.correct .key { background: var(--right); color: #fff; }
.choice.wrong { border-color: var(--wrong); background: var(--wrong-bg); }
.choice.wrong .key { background: var(--wrong); color: #fff; }
.choice.dim { opacity: 0.55; }
.choice:disabled { cursor: default; }
.quiz-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 2px 18px 16px; flex-wrap: wrap; }
.kbd-hint { font-size: 0.78rem; color: var(--muted); }
kbd { font: 600 0.72rem var(--sans); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface-2); }

.feedback { border-top: 1px solid var(--line); padding: 18px; display: grid; gap: 14px; background: var(--surface); }
.verdict { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; }
.verdict strong { display: block; font-size: 1.1rem; }
.verdict span { color: var(--ink-2); font-size: 0.9rem; }
.verdict-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff !important; font-weight: 800; font-size: 1rem !important; }
.verdict.right { background: var(--right-bg); }
.verdict.right .verdict-icon { background: var(--right); }
.verdict.wrong { background: var(--wrong-bg); }
.verdict.wrong .verdict-icon { background: var(--wrong); }
.picked-thumb { margin-left: auto; flex: none; width: 58px; height: 58px; border-radius: 8px; overflow: hidden; border: 2px solid var(--surface); box-shadow: var(--shadow); }
.picked-thumb img { width: 100%; height: 100%; object-fit: cover; }
.compare-tip { margin: 0; padding: 10px 14px; border-left: 4px solid var(--rust); background: var(--surface-2); border-radius: 0 10px 10px 0; font-size: 0.92rem; }
.tip-label { display: inline-block; margin-right: 6px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--rust); }
.fb-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(240px, 1fr); gap: 22px; }
.fb-info h4 { font-family: var(--serif); font-size: 1.5rem; font-weight: 650; margin-bottom: 6px; }
.fb-info h4 em { display: block; font-family: var(--sans); font-size: 0.95rem; font-weight: 500; color: var(--muted); margin-top: 3px; }
.fb-info .fam { margin: 6px 0 10px; font-size: 0.86rem; color: var(--muted); }
h5 { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 14px 0 6px; }
.fb-map h5 { margin-top: 0; }
.features { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }
.features li::marker { color: var(--moss); }
.notes { margin-top: 12px; font-size: 0.92rem; color: var(--ink-2); }
.fb-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* facts */
.facts { margin: 0; display: grid; gap: 10px; }
.facts > div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.facts.compact > div { grid-template-columns: 70px minmax(0, 1fr); }
.facts dt { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.facts dd { margin: 0; }
.bloom-bar { display: inline-grid; grid-template-columns: repeat(12, 1fr); gap: 2px; width: min(100%, 264px); vertical-align: middle; }
.bm { height: 20px; display: grid; place-items: center; font-size: 0.64rem; font-weight: 700; color: var(--muted); background: var(--bg-2); border-radius: 3px; }
.bm.on { background: var(--moss); color: #fff; }
.bm.now { box-shadow: inset 0 -3px 0 var(--rust); }
.bloom-bar.compact { width: 100%; }
.bloom-bar.compact .bm { height: 6px; border-radius: 2px; background: var(--line); }
.bloom-bar.compact .bm.on { background: var(--moss); }
.card-bloom { display: grid; gap: 3px; font-size: 0.72rem; color: var(--muted); }
.bloom-text { display: block; font-size: 0.85rem; color: var(--ink-2); margin-top: 3px; }
.swatches { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.swatch { width: 16px; height: 16px; border-radius: 50%; background: var(--sw); border: 1px solid rgba(0, 0, 0, 0.2); }

/* range map */
.range { display: grid; gap: 10px; }
.range.large { grid-template-columns: minmax(0, 560px) minmax(200px, 1fr); align-items: center; gap: 28px; }
.wv-map { width: 100%; height: auto; }
.county { fill: var(--map-empty); stroke: var(--map-stroke); stroke-width: 1.4; stroke-linejoin: round; transition: opacity 0.1s; }
.county.u { fill: var(--map-usda); }
.county.i { fill: var(--map-inat); }
.county:hover { opacity: 0.75; }
.range-summary { font-size: 0.95rem; margin: 0 0 6px; }
.legend { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; font-size: 0.8rem; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 7px; }
.key { width: 14px; height: 14px; border-radius: 3px; background: var(--map-empty); border: 1px solid var(--line-2); display: inline-block; flex: none; }
.key.u { background: var(--map-usda); border-color: transparent; }
.key.i { background: var(--map-inat); border-color: transparent; }

/* ------------------------------------------------------------ guide */
.guide-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 14px; flex-wrap: wrap; }
.guide-head h2, .profile-head h2 { font-family: var(--serif); font-weight: 650; font-size: clamp(1.8rem, 3.5vw, 2.5rem); letter-spacing: -0.01em; }
.lede { color: var(--muted); margin: 4px 0 0; max-width: 60ch; }
.search { position: relative; flex: 0 1 360px; }
.search svg { position: absolute; left: 11px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { width: 100%; padding-left: 36px; min-height: 44px; }
.cat-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: thin; }
.cat-tabs button {
  flex: none;
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.cat-tabs button small { color: var(--muted); font-weight: 500; }
.cat-tabs button[aria-selected="true"] { background: var(--forest); border-color: var(--forest); color: var(--surface); }
.cat-tabs button[aria-selected="true"] small { color: inherit; opacity: 0.75; }
.guide-filters { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 16px; }
.result-count { margin-left: auto; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.plant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.plant-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s, box-shadow 0.12s;
}
.plant-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-img { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--bg-2); overflow: hidden; }
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.card-img .rec, .card-img .toxic-dot, .card-img .edible-dot { z-index: 1; }
.rec {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(20, 24, 20, 0.7);
  color: #fff;
}
.rec.good { background: var(--right); }
.rec.bad { background: var(--wrong); }
.toxic-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f2b233;
  color: #3b2600;
  font-weight: 800;
  font-size: 0.8rem;
}
.card-body { display: grid; gap: 4px; padding: 10px 12px 12px; }
.card-name { font-weight: 700; line-height: 1.25; }
.card-sci { font-size: 0.82rem; font-style: italic; color: var(--muted); }
.card-meta { display: flex; gap: 5px; flex-wrap: wrap; margin: 3px 0 4px; }
.card-meta .badge { font-size: 0.68rem; padding: 0 7px; }
.bloom-none { font-size: 0.72rem; color: var(--muted); }

/* ------------------------------------------------------------ profile */
.crumbs { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 600; font-size: 0.92rem; }
.crumbs a { text-decoration: none; }
.pager { display: flex; gap: 14px; align-items: center; }
.pager .disabled { color: var(--line-2); }
.profile-head { margin-bottom: 16px; }
.sci-line { margin: 4px 0 10px; font-size: 1.05rem; color: var(--ink-2); }
.aka { font-size: 0.9rem; color: var(--muted); margin-left: 6px; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.gallery-main { position: relative; margin: 0; background: var(--photo-bg); border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.gallery-main img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.gallery-main figcaption { z-index: 2; }
.gallery-main figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 12px 8px;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.85);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}
.gallery-main figcaption a { color: inherit; }
.alt-tag { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: rgba(244, 207, 133, 0.25); color: #f4cf85; font-weight: 700; text-transform: uppercase; font-size: 0.64rem; letter-spacing: 0.05em; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thumb { padding: 0; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: var(--bg-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: var(--forest); }
.thumbs-label { margin: 10px 0 0; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.facts-card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.facts-card h3, .panel h3 { font-family: var(--serif); font-weight: 650; font-size: 1.2rem; margin-bottom: 12px; }
.warn { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; font-size: 0.9rem; }
.profile-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.panel.span-2 { grid-column: 1 / -1; }
.lookalikes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lookalikes li { display: flex; gap: 12px; align-items: flex-start; padding: 8px; border-radius: 10px; }
.lookalikes li.hl { background: var(--warn-bg); }
.lookalikes img, .lk-noimg { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg-2); }
.lookalikes strong { display: block; }
.lookalikes span { font-size: 0.9rem; color: var(--ink-2); }
.wiki { margin: 0 0 12px; padding: 0 0 0 14px; border-left: 3px solid var(--line-2); color: var(--ink-2); font-size: 0.93rem; }
.wiki cite { display: block; margin-top: 6px; font-style: normal; font-size: 0.78rem; color: var(--muted); }
.links { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }

/* ------------------------------------------------------------ progress */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 2px; }
.tile b { font-family: var(--serif); font-size: 2rem; font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; }
.tile b small { font-size: 1rem; color: var(--muted); }
.tile span { color: var(--muted); font-size: 0.85rem; }
.progress-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.cat-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 44px 100px; gap: 10px; align-items: center; padding: 6px 0; }
.cat-name { font-weight: 600; font-size: 0.92rem; }
.bar { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--moss); border-radius: 999px; }
.cat-pct { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-head h3 { margin: 0; }
.panel-head small { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 520px; overflow: auto; }
.review-list a { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.review-list a:hover { background: var(--surface-2); }
.review-list img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; }
.review-list span:not(.rec) { display: grid; flex: 1; }
.review-list em { font-size: 0.82rem; color: var(--muted); }
.review-list .rec { position: static; }
.reset-row { margin-top: 20px; text-align: right; }

/* ------------------------------------------------------------ lightbox */
img.zoomable { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(8, 10, 8, 0.92); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lightbox-close { position: absolute; top: 12px; right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 1.6rem; line-height: 1; }
body.no-scroll { overflow: hidden; }

/* ------------------------------------------------------------ footer */
.site-footer { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1020px) {
  .uses-panel .uses { grid-template-columns: 1fr; gap: 14px; }
  .fb-body { grid-template-columns: 1fr; }
  .fb-map .range { max-width: 460px; }
  .range.large { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { padding: 0 16px 24px; }
  .quiz-layout, .profile-grid, .profile-sections, .progress-grid { grid-template-columns: 1fr; }
  .settings { position: static; }
  .choices.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kbd-hint { display: none; }
  .masthead { padding-top: 12px; }
  .main-tabs { width: 100%; }
  .main-tabs a { flex: 1; text-align: center; padding: 8px 6px; }
  .result-count { margin-left: 0; }
}
@media (max-width: 520px) {
  .brand-name { font-size: 1.35rem; }
  .brand-mark { width: 54px; height: 64px; }
  .choices, .choices.six { grid-template-columns: 1fr; padding: 10px 14px; }
  .choice { min-height: 50px; }
  .question { padding: 14px 14px 2px; }
  .question h3 { font-size: 1.3rem; }
  .feedback { padding: 14px; }
  .scorebar { gap: 12px; }
  .plant-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 8px 10px 10px; }
  .guide-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .guide-filters .field.inline { display: grid; gap: 4px; }
  .guide-filters select { width: 100%; }
  .result-count { grid-column: 1 / -1; }
  .cat-row { grid-template-columns: 100px minmax(0, 1fr) 40px; }
  .cat-row .muted { display: none; }
  .facts > div { grid-template-columns: 88px minmax(0, 1fr); }
  .photo-stage { max-height: 50vh; }
  .credit { top: 8px; bottom: auto; max-width: 80%; }
  .photo-btn { padding: 6px 10px; }
}
