/* ───────────── Tokens ───────────── */
:root {
  --bg: #f6f3ea;
  --surface: #fffdf8;
  --surface-2: #f0ece0;
  --ink: #1d2820;
  --muted: #5a665d;
  --line: #e2dccd;
  --green: #2f6b45;
  --green-ink: #fbf7ea;
  --green-soft: #e2ede0;
  --wattle: #e2ad17;
  --wattle-soft: #fbefc6;
  --wattle-ink: #5d4500;
  --clay: #b9583a;
  --clay-soft: #f8e3da;
  --danger: #a93c2b;
  --shadow: 0 1px 2px rgb(40 50 30 / .06), 0 6px 20px rgb(40 50 30 / .07);
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111612; --surface: #182019; --surface-2: #1f2920; --ink: #e8eee6; --muted: #a2ada4; --line: #2b362d;
    --green: #86c497; --green-ink: #0f1a12; --green-soft: #1f3324; --wattle: #f0c64a; --wattle-soft: #3a3016; --wattle-ink: #f6dc8c;
    --clay: #e3906f; --clay-soft: #3c241b; --danger: #ef8a78; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111612; --surface: #182019; --surface-2: #1f2920; --ink: #e8eee6; --muted: #a2ada4; --line: #2b362d;
  --green: #86c497; --green-ink: #0f1a12; --green-soft: #1f3324; --wattle: #f0c64a; --wattle-soft: #3a3016; --wattle-ink: #f6dc8c;
  --clay: #e3906f; --clay-soft: #3c241b; --danger: #ef8a78; --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
  color-scheme: dark;
}

/* ───────────── Base ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--font-body);
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--green); text-underline-offset: 2px; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--wattle); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { flex-shrink: 0; }
svg[viewBox="0 0 24 24"] { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em; }

/* ───────────── Header ───────────── */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; }
.brand-mark circle { fill: var(--green); }
.brand-mark path { fill: none; stroke: var(--green-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -.01em; }
.brand-name em { font-style: italic; color: var(--green); }
.site-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.site-nav a { padding: 7px 11px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .93rem; }
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav a.active { color: var(--ink); background: var(--green-soft); }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 2px; border-radius: 999px; background: var(--clay); color: #fff; font-size: .72rem; font-weight: 600; }
.nav-count[hidden] { display: none; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .moon-shape { display: none; }
:root[data-theme="dark"] .theme-toggle .sun-shape { display: none; }
:root[data-theme="dark"] .theme-toggle .moon-shape { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun-shape { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon-shape { display: block; }
}
@media (max-width: 640px) {
  .header-inner { position: relative; }
  .site-nav { width: 100%; justify-content: space-between; flex-wrap: nowrap; gap: 0; }
  .site-nav a { padding: 6px 8px; font-size: .86rem; white-space: nowrap; }
  .theme-toggle { position: absolute; right: 16px; top: 13px; }
}

/* ───────────── Hero / location ───────────── */
.hero { padding: 40px 0 28px; }
.hero-grid { display: grid; gap: 28px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.1fr 1fr; gap: 48px; } }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 600; color: var(--clay); margin-bottom: 10px; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); margin-bottom: 14px; }
.hero h1 em { color: var(--green); }
.hero .lede { font-size: 1.08rem; color: var(--muted); max-width: 46ch; }

.location-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.location-card h2 { font-size: 1.25rem; margin-bottom: 4px; }
.location-card > p { color: var(--muted); font-size: .94rem; }
.loc-search { position: relative; margin-top: 12px; }
.input-wrap { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; }
.input-wrap:focus-within { border-color: var(--green); }
.input-wrap svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.input-wrap input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 12px 0; outline: none; font-size: 1rem; }
.suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 320px; overflow-y: auto; }
.suggestions li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--green-soft); }
.suggestions .sub { color: var(--muted); font-size: .85rem; }
.suggestions .empty { color: var(--muted); cursor: default; }
.loc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.zone-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); align-items: center; }
.zone-quick span { font-size: .85rem; color: var(--muted); margin-right: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--green); color: var(--green-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-small { padding: 6px 12px; font-size: .84rem; }
.btn-link { background: none; border: 0; padding: 0; color: var(--green); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.my-location { display: grid; gap: 14px; }
.my-location .place { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.my-location .place h2 { font-size: 1.5rem; margin: 0; }
.my-location .place .sub { color: var(--muted); font-size: .92rem; }
.zone-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 8px; border-radius: 999px; font-weight: 600; font-size: .85rem; background: var(--surface-2); }
.zone-pill svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.zone-pill i { width: 10px; height: 10px; border-radius: 50%; background: var(--z, var(--green)); }
.facts-row { display: flex; flex-wrap: wrap; gap: 8px; }
.season-box { background: var(--wattle-soft); color: var(--wattle-ink); border-radius: 12px; padding: 12px 14px; font-size: .93rem; }
.season-box strong { font-family: var(--font-display); font-size: 1.05rem; }
.season-box p { margin: 4px 0 0; }

/* ───────────── Browse layout ───────────── */
.browse { padding-bottom: 60px; }
.browse-grid { display: grid; gap: 24px; }
@media (min-width: 960px) { .browse-grid { grid-template-columns: 270px 1fr; gap: 32px; } }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .input-wrap { flex: 1 1 260px; background: var(--surface); }
.toolbar select { padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); }
.filters-toggle { display: inline-flex; }
@media (min-width: 960px) { .filters-toggle { display: none; } }
.result-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; color: var(--muted); font-size: .92rem; }
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.active-chips button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: var(--green-soft); color: var(--ink); border-radius: 999px; padding: 4px 10px; font-size: .82rem; cursor: pointer; }
.active-chips button::after { content: "×"; font-size: 1rem; line-height: 1; color: var(--muted); }

/* Filters panel */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px 18px; align-self: start; }
@media (min-width: 960px) { .filters { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; } }
@media (max-width: 959px) {
  .filters { position: fixed; inset: 0 0 0 auto; width: min(360px, 92vw); z-index: 50; border-radius: 0; transform: translateX(100%); transition: transform .25s ease; overflow-y: auto; padding-top: 12px; }
  .filters.open { transform: none; box-shadow: -10px 0 40px rgb(0 0 0 / .2); }
}
.filters-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 4px; }
.filters-head h2 { font-size: 1.1rem; margin: 0; }
.filters-close { display: none; }
@media (max-width: 959px) { .filters-close { display: inline-grid; } }
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 45; }
.f-group { border-top: 1px solid var(--line); padding: 14px 0 4px; }
.f-group:first-of-type { border-top: 0; }
.f-group h3 { font-family: var(--font-body); font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; cursor: pointer; font-size: .86rem; font-weight: 500; }
.chip:hover { border-color: var(--green); }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.chip .n { font-size: .74rem; opacity: .7; }
.chip:disabled { opacity: .4; cursor: default; }
.chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; cursor: pointer; font-size: .93rem; }
.toggle input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; flex-shrink: 0; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.toggle input:checked { background: var(--green); }
.toggle input:checked::after { transform: translateX(16px); }
.toggle small { display: block; color: var(--muted); font-size: .78rem; }
.zone-select { width: 100%; padding: 9px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); }

/* ───────────── Cards ───────────── */
.plant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; flex: 1; }
.card-link::after { content: ""; position: absolute; inset: 0; }
.card-img { aspect-ratio: 4 / 3; background: var(--surface-2); position: relative; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.img-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); }
.img-fallback svg { width: 42px; height: 42px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.badges { position: absolute; left: 10px; top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--surface); color: var(--ink); }
.badge-native { background: var(--wattle); color: #2c2100; }
.badge-now { background: var(--green); color: var(--green-ink); }
.badge-warn { background: var(--clay-soft); color: var(--clay); }
.badge-indoor { background: var(--surface-2); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-body h3 { font-size: 1.18rem; margin: 0; }
.botanical { font-style: italic; color: var(--muted); font-size: .88rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 10px; color: var(--muted); font-size: .82rem; }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-meta svg, .fact svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.save-btn { position: absolute; right: 10px; top: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--surface); cursor: pointer; box-shadow: 0 1px 4px rgb(0 0 0 / .15); color: var(--muted); }
.save-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.save-btn[aria-pressed="true"] { color: var(--clay); }
.save-btn[aria-pressed="true"] svg { fill: currentColor; }
.save-btn:hover { color: var(--clay); }
.card.unsuited .card-img img { filter: grayscale(.6); opacity: .8; }

.empty-state { text-align: center; padding: 60px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.notice svg { width: 18px; height: 18px; fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; margin-right: 4px; }
.empty-state svg { width: 48px; height: 48px; fill: none; stroke: var(--muted); stroke-width: 1.5; margin: 0 auto 12px; }
.notice { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--green-soft); margin-bottom: 16px; font-size: .92rem; }

/* ───────────── Plant detail ───────────── */
.detail { padding: 24px 0 64px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; font-size: .92rem; margin-bottom: 18px; }
.back-link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.detail-top { display: grid; gap: 28px; }
@media (min-width: 900px) { .detail-top { grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; } }
.detail-figure { margin: 0; }
.detail-figure .frame { border-radius: 20px; overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 3; }
.detail-figure img { width: 100%; height: 100%; object-fit: cover; }
.detail-figure figcaption { font-size: .78rem; color: var(--muted); margin-top: 8px; }
.detail-figure figcaption a { color: inherit; }
.detail h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: 4px; }
.detail .botanical { font-size: 1.05rem; }
.detail .summary { font-size: 1.1rem; margin: 16px 0; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.detail-badges .badge { background: var(--surface-2); padding: 5px 11px; font-size: .8rem; }
.detail-badges .badge-native { background: var(--wattle); }
.detail-badges .badge-now { background: var(--green); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.detail-actions .btn[aria-pressed="true"] svg { fill: currentColor; }

.local-panel { margin-top: 22px; border-radius: var(--radius); padding: 16px 18px; border: 1px solid var(--line); background: var(--surface); }
.local-panel h2 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.local-panel h2 svg { width: 18px; height: 18px; fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.local-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .94rem; }
.local-panel li { display: flex; gap: 8px; align-items: flex-start; }
.local-panel li::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-top: .5em; }
.local-panel li.warn::before { background: var(--clay); }
.local-panel li.bad::before { background: var(--danger); }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 36px 0; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.fact dt { display: flex; align-items: center; gap: 6px; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.fact dd { margin: 0; font-weight: 500; }
.fact dd small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 2px; }

.care h2 { font-size: 1.6rem; margin-bottom: 16px; }
.care-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.care-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.care-item h3 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.care-item h3 span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--green-soft); color: var(--green); }
.care-item h3 svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.care-item p { margin: 0; color: var(--ink); }
.callout { display: flex; gap: 12px; margin-top: 18px; padding: 16px 18px; border-radius: var(--radius); background: var(--wattle-soft); color: var(--wattle-ink); }
.callout.weed { background: var(--clay-soft); color: var(--clay); }
.callout svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.callout p { margin: 0; }
.related { margin-top: 48px; }
.related h2 { font-size: 1.4rem; }

/* ───────────── Zones & about ───────────── */
.page { padding: 36px 0 64px; }
.page-head { max-width: 760px; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.page-head p { color: var(--muted); font-size: 1.05rem; }
.zone-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.zone-card { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--z); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.zone-card h2 { font-size: 1.35rem; margin: 0; }
.zone-card .ex { font-size: .86rem; color: var(--muted); }
.zone-card p { margin: 0; }
.zone-card .btn { align-self: flex-start; margin-top: auto; }
.zone-card.current { box-shadow: 0 0 0 2px var(--z); }
.prose { max-width: 720px; }
.prose h2 { font-size: 1.4rem; margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: .9rem; z-index: 60; box-shadow: var(--shadow); }

/* ───────────── Footer ───────────── */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; font-size: .9rem; }
.footer-inner p { margin: 0 0 6px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
