/* Plant Wiki styles. Tokens first; light and dark share every rule below them. */
:root {
  --bg: #fbfaf7; --surface: #ffffff; --surface-2: #f4f2ec; --ink: #16201a; --text: #3b453e; --muted: #6b746d; --line: #e6e2d8; --line-2: #d8d3c6;
  --leaf: #2f6b47; --leaf-600: #24563a; --leaf-soft: #eaf3ec; --on-leaf: #ffffff;
  --warn: #b4432c; --warn-soft: #fbebe6; --gold: #85660f; --gold-soft: #f6efda;
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --sh-1: 0 1px 2px rgb(16 24 20 / .05); --sh-2: 0 10px 30px rgb(16 24 20 / .08);
  --wrap: 1200px; --gut: 24px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1311; --surface: #161b18; --surface-2: #1c231f; --ink: #eef2ee; --text: #cbd3cc; --muted: #8e988f; --line: #26302a; --line-2: #34403a;
    --leaf: #86c99f; --leaf-600: #a1d8b5; --leaf-soft: #1c2b22; --on-leaf: #0f1311;
    --warn: #f19a83; --warn-soft: #3a221c; --gold: #dcbc63; --gold-soft: #2f2915;
    --sh-1: 0 1px 2px rgb(0 0 0 / .3); --sh-2: 0 10px 30px rgb(0 0 0 / .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1311; --surface: #161b18; --surface-2: #1c231f; --ink: #eef2ee; --text: #cbd3cc; --muted: #8e988f; --line: #26302a; --line-2: #34403a;
  --leaf: #86c99f; --leaf-600: #a1d8b5; --leaf-soft: #1c2b22; --on-leaf: #0f1311;
  --warn: #f19a83; --warn-soft: #3a221c; --gold: #dcbc63; --gold-soft: #2f2915;
  --sh-1: 0 1px 2px rgb(0 0 0 / .3); --sh-2: 0 10px 30px rgb(0 0 0 / .35); color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Component display rules (buttons are inline-flex) must never beat the hidden attribute. */
[hidden] { display: none !important; }
/* The footer sits at the bottom of short pages. */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--ink); font-family: Fraunces, Georgia, serif; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
h1 { font-size: clamp(28px, 3.2vw, 36px); margin: 0 0 6px; }
h3 { font-size: 20px; }
a { color: var(--leaf); text-underline-offset: 3px; }
a:hover { color: var(--leaf-600); }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
::selection { background: var(--leaf-soft); }

/* Controls */
button, select, input, textarea { font: inherit; color: inherit; }
button, .btn, .upload {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink);
  font-weight: 500; font-size: 14px; line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
button:hover, .btn:hover, .upload:hover { border-color: var(--muted); }
button.primary, .btn.primary { background: var(--leaf); border-color: var(--leaf); color: var(--on-leaf); }
button.primary:hover, .btn.primary:hover { background: var(--leaf-600); border-color: var(--leaf-600); }
button:disabled { opacity: .55; cursor: default; }
select, input[type=text], input[type=search], input[type=date], textarea {
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); padding: 9px 12px; min-height: 40px;
}
textarea { width: 100%; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px var(--leaf-soft); }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.top-in { max-width: var(--wrap); margin: 0 auto; padding: 10px var(--gut); display: flex; gap: 20px; align-items: center; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 21px/1 Fraunces, Georgia, serif; letter-spacing: -.01em; white-space: nowrap; }
.brand img { border-radius: 8px; box-shadow: var(--sh-1); }
.brand em { color: var(--leaf); font-style: italic; }
.search { flex: 1; min-width: 0; max-width: 560px; position: relative; transition: opacity .2s; }
.search > .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
#q { width: 100%; padding: 9px 46px 9px 40px; border-radius: 999px; background: var(--surface); }
body.intro-visible .top .search { opacity: 0; pointer-events: none; }
.camsearch { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 32px; width: 32px; padding: 0; border: 0; border-radius: 999px; background: var(--leaf-soft); color: var(--leaf); }
.camsearch:hover { background: var(--leaf); color: var(--on-leaf); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.navlink { color: var(--text); text-decoration: none; font-weight: 500; font-size: 14px; padding: 8px 10px; border-radius: 8px; white-space: nowrap; }
.navlink:hover { background: var(--surface-2); color: var(--ink); }
.navlink.on { color: var(--leaf); background: var(--leaf-soft); }

/* ---------- Layout ---------- */
main { max-width: var(--wrap); margin: 0 auto; padding: 28px var(--gut) 72px; }
.eyebrow { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--leaf); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 14px; }
.section-title h2 { margin: 0; font-size: 24px; }

/* ---------- Home intro ---------- */
.intro { padding: 36px 0 8px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
.intro h1 { font-size: clamp(34px, 4.6vw, 54px); line-height: 1.05; margin: 0 0 14px; }
.intro h1 span { color: var(--leaf); font-style: italic; }
.lede { font-size: 17px; color: var(--text); max-width: 540px; margin: 0 0 24px; }
.bigsearch { display: flex; gap: 8px; align-items: center; padding: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--sh-2); max-width: 600px; }
.bigsearch .i { margin-left: 10px; color: var(--muted); }
.bigsearch input { flex: 1; min-width: 0; border: 0; box-shadow: none !important; background: transparent; font-size: 16px; padding: 10px 4px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 22px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.stats b { display: block; font: 600 22px/1.2 Fraunces, Georgia, serif; color: var(--ink); }
.intro-art { position: relative; aspect-ratio: 1; max-width: 440px; justify-self: end; width: 100%; border-radius: 28px; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, var(--leaf-soft), var(--surface-2)); border: 1px solid var(--line); }
.intro-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.intro-art figcaption { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 8px 12px; border-radius: 10px; font-size: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); color: var(--text); }
.intro-art figcaption b { color: var(--ink); }

/* Scenario cards */
.scenarios { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.scenario { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; white-space: normal; height: auto; min-height: 0;
  padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); line-height: 1.4; }
.scenario:hover { border-color: var(--leaf); box-shadow: var(--sh-2); }
.scenario .i { width: 22px; height: 22px; color: var(--leaf); margin-bottom: 2px; }
.scenario b { font-size: 15px; color: var(--ink); }
.scenario span { font-size: 13px; color: var(--muted); font-weight: 400; }

/* ---------- Browse ---------- */
.browse-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px 18px 16px; }
.lenses { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; margin: 0 -2px; }
.lenses button { border: 0; border-radius: 0; background: none; min-height: 44px; padding: 0 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.lenses button:hover { color: var(--ink); }
.lenses button.on { color: var(--ink); border-bottom-color: var(--leaf); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0 2px; }
.chips:has(.cgroup) { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px 24px; }
.cgroup h4 { margin: 0 0 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cgroup > div { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 30px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--surface-2); border-color: transparent; color: var(--text); }
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip small { color: var(--muted); font-weight: 400; margin-left: 2px; font-size: 12px; }
.chip.on { background: var(--leaf-soft); border-color: var(--leaf); color: var(--leaf); }
.bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 18px 0 14px; color: var(--muted); font-size: 14px; }
#count { color: var(--ink); font-weight: 600; }
.bar .active { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.bar .active button { min-height: 28px; font-size: 12px; padding: 0 10px; border-radius: 999px; background: var(--leaf-soft); border-color: transparent; color: var(--leaf); }
.bar select { min-height: 34px; padding: 4px 10px; font-size: 14px; }
.toggle { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.toggle input { accent-color: var(--leaf); width: 16px; height: 16px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; transition: box-shadow .2s, border-color .2s, transform .2s; }
.card:hover { border-color: var(--line-2); box-shadow: var(--sh-2); transform: translateY(-2px); color: inherit; }
.card .ph { aspect-ratio: 4/3; background: var(--surface-2) center/cover no-repeat; position: relative; }
.card .ph .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--line-2); }
.card .ph .noimg .i { width: 40px; height: 40px; stroke-width: 1.2; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card b { color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.3; }
.card i { color: var(--muted); font-size: 13px; }
.card .note { font-size: 13px; color: var(--muted); margin-top: 4px; }
.badge { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--leaf); box-shadow: var(--sh-1); backdrop-filter: blur(6px); }
.badge .i { width: 13px; height: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tag { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--leaf-soft); color: var(--leaf); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.gold { background: var(--gold-soft); color: var(--gold); }
#more { padding: 28px; text-align: center; color: var(--muted); }
#further h3 { font-size: 20px; margin: 36px 0 4px; }
#further .grid .ph { aspect-ratio: 5/2; }
.worldwide { margin: 32px 0; padding: 20px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.worldwide p { margin: 0 0 12px; }

/* ---------- Plant page ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--ink); }
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.hero > * { min-width: 0; }
.viewer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; position: sticky; top: 84px; box-shadow: var(--sh-1); }
.stage { aspect-ratio: 1; background: radial-gradient(circle at 50% 38%, var(--surface), var(--surface-2)); }
.stage model-viewer, .stage iframe, .stage img { width: 100%; height: 100%; border: 0; display: block; object-fit: cover; }
.stage .empty { height: 100%; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }
.mtabs { display: flex; gap: 6px; padding: 10px; overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: thin; }
.mtabs button { min-height: 44px; padding: 4px 12px 4px 4px; font-size: 13px; border-radius: 10px; }
.mtabs button img { width: 36px; height: 36px; object-fit: cover; border-radius: 7px; background: var(--surface-2); }
.mtabs button.on { border-color: var(--leaf); background: var(--leaf-soft); color: var(--leaf); }
.credit { padding: 0 14px 14px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.info h1 { font-size: clamp(30px, 3.4vw, 40px); margin: 0; }
.info .sci { font-style: italic; color: var(--muted); margin: 6px 0 4px; font-size: 17px; }
.info .aka { font-size: 14px; color: var(--muted); }
/* Cells draw their own right and bottom rules, so a half-empty last row stays clean. */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin: 22px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.fact { background: var(--surface); padding: 12px 14px; color: var(--ink); font-size: 14px; font-weight: 500; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.fact span { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 3px; }
.fact.warn { background: var(--warn-soft); color: var(--warn); }
.fact.ok { background: var(--leaf-soft); color: var(--leaf); }
.fact a.small { margin-left: 4px; font-weight: 400; }
.fact .big { display: block; font: 600 26px/1.15 Fraunces, Georgia, serif; color: var(--ink); }
.fact small { display: block; font-size: 11px; font-weight: 400; line-height: 1.35; margin-top: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
section.txt { border-top: 1px solid var(--line); padding: 22px 0 6px; }
section.txt h3 { margin: 0 0 10px; }
section.txt p { margin: 0 0 12px; white-space: pre-line; }
.photo { width: 100%; border-radius: var(--r); margin: 10px 0; }
.sources { font-size: 12px; line-height: 1.6; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.sources p { margin: 0 0 6px; }
.notice { background: var(--leaf-soft); color: var(--ink); border-radius: var(--r); padding: 12px 14px; margin: 12px 0; font-size: 14px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.progress { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--leaf) 18%, transparent); overflow: hidden; margin: 10px 0 2px; }
.progress div { height: 100%; background: var(--leaf); transition: width .4s; }
.makecta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--leaf-soft); color: var(--ink); font-size: 13px; }
.makecta button { margin-left: auto; }

/* Maps */
.map { height: 380px; border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.gview a { display: inline-block; width: auto !important; padding: 0 10px; font: 12px/30px Inter, sans-serif; color: #333 !important; background: #fff; }
.gview a + a { border-left: 1px solid #ccc; }
.countries { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 0; }
.countries .muted { font-size: 13px; margin-right: 4px; }
.leaflet-popup-content { font: 13px/1.4 Inter, sans-serif; }
.leaflet-popup-content img { width: 160px; border-radius: 8px; display: block; margin-bottom: 4px; }
.geo { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; }

/* Community */
.tip { border-left: 3px solid var(--leaf); padding: 2px 0 2px 14px; margin: 14px 0; }
.tip p { margin: 4px 0 0; }
.tip .chip, .gallery .chip, section.txt .chip { min-height: 24px; font-size: 12px; margin-left: 6px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 14px 0; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.gallery figcaption { font-size: 12px; margin-top: 4px; }

/* ---------- Dialogs ---------- */
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 24px 70px rgb(0 0 0 / .28); }
dialog::backdrop { background: rgb(10 14 12 / .5); backdrop-filter: blur(2px); }
.dlg { padding: 24px; max-height: calc(100vh - 40px); overflow-y: auto; }
.dlg h2 { margin: 0 0 6px; font-size: 24px; }
.dlg h3 { margin: 20px 0 8px; font-size: 16px; }
.dlg select { margin-bottom: 8px; }
.dlg input[type=text] { width: 100%; }
.row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.result { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); margin: 8px 0; }
.result img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.result .grow { flex: 1; min-width: 0; }
.result b { color: var(--ink); }
.result .score { font-size: 13px; color: var(--muted); }
.traits { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.trait { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.trait select, .trait input { margin: 0; color: var(--ink); }
.cam { position: relative; aspect-ratio: 4/3; border-radius: var(--r); overflow: hidden; background: #0b0e0c; margin: 14px 0; }
.cam video, .cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam img { display: none; }
.cam.snapped img { display: block; }
.cam.snapped video { display: none; }
.camhint { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: #e7ece8; font-size: 14px; }
.camctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.upload input { display: none; }
.geo input { accent-color: var(--leaf); margin-top: 3px; }

/* ---------- My plants, account, admin ---------- */
.mine-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.mine-head h1 { margin: 0; }
.mine-head p { margin: 4px 0 0; }
.addname { display: flex; gap: 8px; }
.addname input { min-width: 0; width: 260px; }
#mineMap { margin-bottom: 20px; }
#account .facts, #admin .facts { margin-top: 12px; }
.series { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.series .fact { border: 1px solid var(--line); border-radius: var(--r); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 64px; margin-top: 10px; }
.spark span { flex: 1; background: var(--leaf); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }
table.nums { width: 100%; border-collapse: collapse; font-size: 14px; }
table.nums td { padding: 7px 0; border-bottom: 1px solid var(--line); }
table.nums td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 500; }
.mailpreview { width: 100%; height: 900px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
#about { max-width: 820px; }
#about ul { padding-left: 20px; }
#about li { margin-bottom: 10px; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); margin-top: 40px; }
.foot-in { max-width: var(--wrap); margin: 0 auto; padding: 40px var(--gut) 24px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.foot-in p { margin: 12px 0 0; font-size: 14px; color: var(--muted); max-width: 360px; }
.foot-in h4 { margin: 0 0 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.foot-in nav a { display: block; color: var(--text); text-decoration: none; font-size: 14px; padding: 4px 0; }
.foot-in nav a:hover { color: var(--leaf); }
.legal { max-width: var(--wrap); margin: 0 auto; padding: 16px var(--gut) 28px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; gap: 24px; padding-top: 16px; }
  .intro-art { display: none; }
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .viewer { position: static; }
}
@media (max-width: 760px) {
  :root { --gut: 16px; }
  .top-in { flex-wrap: wrap; gap: 8px 12px; padding: 8px var(--gut); min-height: 56px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  body.intro-visible .top .search { display: none; }
  .brand { font-size: 18px; gap: 8px; }
  .brand img { width: 28px; height: 28px; }
  .nav { gap: 0; flex-wrap: nowrap; }
  .navlink { padding: 8px 7px; font-size: 13px; }
  #install { display: none; }
  #snap .label, #install .label { display: none; }
  #snap { width: 40px; padding: 0; }
  main { padding: 18px var(--gut) 56px; }
  .bigsearch { flex-wrap: wrap; }
  .bigsearch input { flex-basis: calc(100% - 40px); }
  .bigsearch button { flex: 1; }
  .browse-panel { padding: 2px 12px 12px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card .body { padding: 10px 11px 12px; }
  .scenarios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scenario { padding: 12px; }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .foot-in > :first-child { grid-column: 1 / -1; }
  .addname input { width: auto; flex: 1; }
}
/* Installed app: respect the phone's notch and home bar. */
@media (display-mode: standalone) {
  .top-in { padding-top: max(10px, env(safe-area-inset-top)); }
  main { padding-bottom: max(72px, env(safe-area-inset-bottom)); }
}

/* Home sections and rows */
.home-sec { margin-top: 8px; }
.home-sec .section-title a { font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.sec-sub { margin: -6px 0 14px; font-size: 14px; }
.grid.shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.inline-select { field-sizing: content; font: inherit; color: var(--leaf); border: 0; border-bottom: 2px dashed var(--line-2); border-radius: 0; background: transparent; padding: 0 4px; min-height: 0; cursor: pointer; max-width: 60vw; }
.inline-select:focus { box-shadow: none; border-bottom-color: var(--leaf); }
.page-head { margin: 4px 0 18px; }
.page-head p { margin: 0; }
.country-pick { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; width: 100%; }
.country-pick label { display: inline-flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.country-pick p { flex-basis: 100%; margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; min-height: 36px; font-size: 13px; background: var(--surface); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--leaf-soft); color: var(--leaf); }
@media (max-width: 760px) {
  .grid.shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.shelf > :nth-child(n+5) { display: none; }
  .home-sec .section-title { flex-wrap: wrap; }
}

/* Identify results and the "Saved" sheet */
.result-acts { display: flex; gap: 6px; }
.result-acts button { min-height: 34px; padding: 0 12px; }
.saved-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.saved-head > .i { width: 36px; height: 36px; padding: 8px; border-radius: 999px; background: var(--leaf-soft); color: var(--leaf); }
.saved-head h2 { margin: 0; }
.saved-head p { margin: 0; }
.eggs h3 { display: flex; gap: 8px; align-items: center; font-size: 16px; margin: 16px 0 8px; }
blockquote { margin: 8px 0; padding: 10px 14px; border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 0 10px 10px 0; color: var(--ink); }
blockquote footer { font-size: 12px; color: var(--muted); margin-top: 4px; }
.hide-note { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.hide-note summary { cursor: pointer; font-weight: 500; color: var(--ink); }
.hide-note .seg { margin: 10px 0 4px; }
.hide-note textarea { margin: 6px 0 8px; }

/* Plant Hunt */
.hunt { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.hunt-filters { padding-top: 0; margin-bottom: 10px; }
#huntMap .map { height: min(72vh, 720px); }
.hunt-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
.hcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.hcard h3 { margin: 0 0 6px; font-size: 18px; }
.hcard h4 { margin: 14px 0 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink); }
.steps .i { color: var(--leaf); }
.quest { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 13px; margin-bottom: 6px; }
.quest .progress { grid-column: 1 / -1; margin: 2px 0 0; }
.board { margin: 0; padding-left: 20px; font-size: 14px; }
.board li { display: flex; justify-content: space-between; padding: 3px 0; }
ul.plain { list-style: none; padding: 0; margin: 0; font-size: 13px; display: grid; gap: 6px; }
.linkish { min-height: 0; padding: 0; border: 0; background: none; color: var(--leaf); font-size: 12px; text-decoration: underline; }
.hpop { min-width: 180px; }
.hpop img { width: 200px; height: 140px; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 6px; }
.hacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hacts button { min-height: 28px; padding: 0 10px; font-size: 12px; }
.lm-icon span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: #2f6b47; color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .3); }
.lm-icon span.adopted { background: #b7791f; }
.lm-icon .i { width: 16px; height: 16px; }
.timeline { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.timeline figure { margin: 0; }
.timeline img, .timeline .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; }
.timeline figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
@media (max-width: 900px) {
  .hunt { grid-template-columns: 1fr; }
  .hunt-side { position: static; max-height: none; }
  #huntMap .map { height: 60vh; }
}

/* Near me */
.near-btn { min-height: 30px; padding: 0 12px; font-size: 13px; border-radius: 999px; }
.near-link { margin: 14px 0 0; font-size: 14px; }
.near-link a { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; text-decoration: none; }
ul.near li { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; }
ul.near li span { color: var(--muted); font-size: 12px; }
ul.near li small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.near-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.near-grid a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); font-size: 11px; line-height: 1.25; }
.near-grid img, .near-grid .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; }

/* Quick answers */
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-answer:not(:empty) { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.ask-answer p { margin: 0 0 8px; white-space: normal; }
.ask-answer blockquote { margin: 8px 0 0; }
.ask-top { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.ask-top h3 { font-size: 16px; margin: 0 0 8px; }
.web-answer:not(:empty) { margin-top: 10px; }
.web-answer .ai { border-top: 1px dashed var(--line-2); padding-top: 10px; }
.web-answer .ai p { margin: 0 0 6px; }
.web-answer .linkish { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }

/* Plans */
.plans-wrap { overflow-x: auto; }
table.plans { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
table.plans th, table.plans td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
table.plans th:first-child, table.plans td:first-child { text-align: left; color: var(--text); }
table.plans th { font-weight: 600; color: var(--ink); }
table.plans th small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
table.plans .cur { background: var(--leaf-soft); }
table.plans .i { color: var(--leaf); }
