:root {
  --bg: #f6f5ef; --panel: #ffffff; --ink: #1f2a1f; --muted: #5b6658; --line: #dcdfd4;
  --accent: #2f6b3a; --accent-ink: #ffffff; --chip: #eef1e8; --chip-on: #2f6b3a;
  --ok: #e3f1e1; --ok-ink: #22562b; --warn: #fbeccd; --warn-ink: #7a4a00; --bad: #f8dcd8; --bad-ink: #8a1f14;
  --native: #dcecf5; --native-ink: #1d4e6b; --nfix: #ece3f3; --nfix-ink: #5a2f78;
  --head: #23452a; --head-ink: #f2f5ec;
  color-scheme: light;
}
/* Dark colors (2026-12-02): data-theme="auto" = "Same as my device" and dark only when the
   device is set to dark; data-theme="dark" (the default on both sites) = always dark.
   Keep the two blocks the same. */
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #141814; --panel: #1d221d; --ink: #e6ebe0; --muted: #a2ad9d; --line: #333b31;
    --accent: #7cc489; --accent-ink: #10200f; --chip: #262d25; --chip-on: #7cc489;
    --ok: #20361f; --ok-ink: #a6dca9; --warn: #3d3016; --warn-ink: #f1cf88; --bad: #43201c; --bad-ink: #f3aaa0;
    --native: #1b3240; --native-ink: #a9d4ee; --nfix: #33263f; --nfix-ink: #d6b7ee;
    --head: #1a2b1c; --head-ink: #e6ebe0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141814; --panel: #1d221d; --ink: #e6ebe0; --muted: #a2ad9d; --line: #333b31;
  --accent: #7cc489; --accent-ink: #10200f; --chip: #262d25; --chip-on: #7cc489;
  --ok: #20361f; --ok-ink: #a6dca9; --warn: #3d3016; --warn-ink: #f1cf88; --bad: #43201c; --bad-ink: #f3aaa0;
  --native: #1b3240; --native-ink: #a9d4ee; --nfix: #33263f; --nfix-ink: #d6b7ee;
  --head: #1a2b1c; --head-ink: #e6ebe0;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--head); color: var(--head-ink); padding: 20px 0 16px; margin-bottom: 16px; }
.top h1 { margin: 0; font-size: 1.8rem; letter-spacing: .01em; }
.tag { margin: 4px 0 0; opacity: .9; }

/* filters */
.filters { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 10px; }
.frow { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.frow label { display: flex; flex-direction: column; gap: 3px; font-size: .85rem; color: var(--muted); }
.frow label span { font-weight: 600; }
.search { flex: 1 1 260px; }
input[type=search], select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; min-height: 40px; }
input[type=search] { width: 100%; }
.selects label { flex: 1 1 170px; }
.selects select { width: 100%; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: .85rem; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: .9rem; border: 1px solid var(--line); background: var(--chip); color: var(--ink); border-radius: 999px; padding: 5px 12px; cursor: pointer; min-height: 34px; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed=true] { background: var(--chip-on); color: var(--accent-ink); border-color: var(--chip-on); }
.chip[aria-pressed=true]::before { content: "✓ "; }
.months .chip { min-width: 52px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.checks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.checks input { width: 18px; height: 18px; accent-color: var(--accent); }
.clear { font: inherit; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 6px; padding: 8px 14px; cursor: pointer; min-height: 40px; }
.clear:hover { border-color: var(--accent); }
.more { display: grid; gap: 10px; }
.toggle { display: none; font: inherit; font-weight: 600; border: 1px solid var(--accent); background: var(--chip); color: var(--ink); border-radius: 6px; padding: 8px 14px; cursor: pointer; min-height: 42px; }

/* results */
.count { color: var(--muted); margin: 14px 2px 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.card:hover, .card:focus-visible { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-2px); }
.card img, .nophoto { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--chip); }
.nophoto { display: grid; place-items: center; color: var(--muted); }
.cbody { padding: 10px 12px 12px; }
.cbody h2 { font-size: 1.1rem; margin: 0; }
.sci { font-style: italic; color: var(--muted); margin: 0 0 4px; font-weight: normal; }
.facts, .bloom { margin: 2px 0; font-size: .9rem; }
.bloom { color: var(--muted); }
.badges { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px; }
.b { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.b.ok { background: var(--ok); color: var(--ok-ink); }
.b.warn { background: var(--warn); color: var(--warn-ink); }
.b.bad { background: var(--bad); color: var(--bad-ink); }
.b.native { background: var(--native); color: var(--native-ink); }
.b.nfix { background: var(--nfix); color: var(--nfix-ink); }
.none { grid-column: 1/-1; padding: 30px; text-align: center; color: var(--muted); }

/* detail dialog */
dialog { width: min(1100px, calc(100vw - 24px)); max-height: calc(100vh - 24px); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px 20px; background: var(--panel); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.55); }
.dhead { position: sticky; top: 0; display: flex; justify-content: flex-end; padding: 10px 0 0; background: var(--panel); z-index: 1; }
.close { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 8px 18px; cursor: pointer; min-height: 40px; }
#d-title { margin: 0 0 10px; font-size: 1.6rem; line-height: 1.25; }
#d-title .sci { display: inline; font-size: 1.1rem; }
.dgrid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.desc { margin-top: 0; font-size: 1.02rem; }
table.info { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.info caption { text-align: left; font-weight: 700; font-size: 1.05rem; padding: 0 0 6px; }
table.info th, table.info td { border: 1px solid var(--line); padding: 7px 10px; vertical-align: top; text-align: left; }
table.info th { width: 165px; font-weight: 600; background: var(--chip); }
table.info tr:nth-child(even) td { background: color-mix(in srgb, var(--chip) 45%, transparent); }
table.info small { color: var(--muted); display: inline-block; margin-top: 2px; }
.sk { font-weight: 600; }
.est { font-size: .75rem; font-weight: 600; background: var(--warn); color: var(--warn-ink); border-radius: 999px; padding: 1px 7px; }
.mbar { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; margin: 5px 0 3px; max-width: 300px; }
.mbar span { text-align: center; font-size: .7rem; padding: 2px 0; background: var(--chip); color: var(--muted); border-radius: 3px; }
.mbar span.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
figure { margin: 0; }
figure.main img { width: 100%; border-radius: 8px; display: block; cursor: zoom-in; }
figure.main .zoomhint { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }
/* full-size photo viewer */
dialog#viewer { position: fixed; inset: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; box-sizing: border-box; margin: 0; padding: 0; border: 0; border-radius: 0; background: rgba(0,0,0,.94); color: #eee; }
dialog#viewer[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
dialog#viewer::backdrop { background: rgba(0,0,0,.9); }
#v-img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; cursor: zoom-out; touch-action: pan-y; }
.v-cap { margin: 8px 16px 0; font-size: .85rem; text-align: center; color: #ddd; max-width: 900px; }
.v-cap a { color: #bfe3c4; }
.v-bar { display: flex; gap: 14px; align-items: center; margin: 10px 0 6px; }
.v-bar span { font-size: .9rem; color: #ccc; min-width: 4.5em; text-align: center; }
.v-bar button, .v-close { font: inherit; padding: 8px 16px; border-radius: 8px; border: 1px solid #777; background: #222; color: #fff; cursor: pointer; }
.v-bar button:disabled { opacity: .35; cursor: default; }
.v-close { position: fixed; top: max(14px, env(safe-area-inset-top)); right: max(28px, env(safe-area-inset-right)); z-index: 2; }
figcaption { font-size: .75rem; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-top: 14px; }
.box h3, .gallery h3, .sources h3 { margin: 0 0 6px; font-size: 1.05rem; }
.box ul, .box ol { margin: 0; padding-left: 20px; }
.box li { margin-bottom: 5px; }
.gallery { margin-top: 20px; }
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gbtn { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; width: 100%; }
.gbtn img { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; display: block; }
.sources { margin-top: 16px; font-size: .9rem; }
.sources ul { margin: 0; padding-left: 20px; }
.foot { color: var(--muted); font-size: .85rem; margin-top: 30px; padding-bottom: 30px; border-top: 1px solid var(--line); padding-top: 12px; }

@media (max-width: 760px) {
  .top h1 { font-size: 1.45rem; }
  .dgrid { grid-template-columns: 1fr; }
  .dright { display: contents; }
  .dright figure.main { order: -1; }
  .dright .box { order: 1; }
  .toggle { display: block; width: 100%; }
  .filters:not(.open) .more { display: none; }
  dialog { padding: 0 12px 16px; }
  table.info th { width: 110px; }
  #d-title { font-size: 1.3rem; }
}

/* YouTube video cards (plant page) */
.videos h3 { margin-bottom: 8px; }
.vids { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.vid { display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; }
.vid:hover .vtitle { text-decoration: underline; }
.vthumb { position: relative; display: block; }
.vthumb img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; display: block; }
.vlen { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.8); color: #fff; font-size: .75rem; padding: 1px 5px; border-radius: 4px; }
.vplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 32px; border-radius: 8px; background: rgba(204,0,0,.88); color: #fff; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.vtitle { font-weight: 600; font-size: .92rem; line-height: 1.3; }
.vmeta { font-size: .8rem; color: var(--muted); }
.vnote { font-size: .8rem; color: var(--muted); margin-top: 8px; }

/* ---------- member features (2026-12-01): sign-in, marks, notes, photos ---------- */
:root { --have: #dff0e3; --have-ink: #1f5a2e; --want: #fdf0d2; --want-ink: #7a5200; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --have: #1f3a26; --have-ink: #a8e0b4; --want: #3d3216; --want-ink: #f1d48f; } }
:root[data-theme="dark"] { --have: #1f3a26; --have-ink: #a8e0b4; --want: #3d3216; --want-ink: #f1d48f; }
.top .wrap { position: relative; }
.hdr { position: absolute; top: -10px; right: 16px; font-size: .85rem; display: flex; gap: 18px; align-items: baseline; }
.theme-pick { color: var(--head-ink); }
.theme-pick select { font: inherit; font-size: .8rem; padding: 2px 4px; margin-left: 4px; min-height: 0; height: auto; width: auto; border-radius: 4px; }
.acct a { color: var(--head-ink); }
.acct b { font-weight: 600; }
.b.have { background: var(--have); color: var(--have-ink); }
.b.want { background: var(--want); color: var(--want-ink); }
.muted { color: var(--muted); }

/* sign-in dialog */
dialog.small { width: min(420px, calc(100vw - 24px)); padding: 18px 20px 14px; }
dialog.small h2 { margin: 0 0 10px; font-size: 1.3rem; }
.fld { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; font-size: .9rem; }
.fld span { font-weight: 600; }
.fld small, .keep { color: var(--muted); font-size: .8rem; }
.fld input, .mform input[type=text], .mynote textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; min-height: 40px; width: 100%; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.keep { margin: 0 0 8px; }
.arow { display: flex; gap: 10px; flex-wrap: wrap; }
.aswitch { margin: 12px 0 0; font-size: .9rem; }
.warnmsg { background: var(--warn); color: var(--warn-ink); border-radius: 6px; padding: 8px 10px; margin: 0 0 12px; font-weight: 600; }
.msg { margin: 6px 0; font-size: .92rem; min-height: 0; }
.msg:empty { display: none; }
.msg.err { color: var(--bad-ink); background: var(--bad); border-radius: 6px; padding: 7px 10px; }
.msg.ok { color: var(--ok-ink); background: var(--ok); border-radius: 6px; padding: 7px 10px; }
.msg.info { color: var(--muted); }
button:disabled { opacity: .6; cursor: default; }

/* plant page: marks */
.marks { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 12px; }
.mk { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 10px; cursor: pointer; background: var(--chip); font-weight: 600; font-size: .95rem; }
.mk input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.mk:has(input:checked) { background: var(--have); color: var(--have-ink); border-color: var(--have-ink); }
.mk.want:has(input:checked) { background: var(--want); color: var(--want-ink); border-color: var(--want-ink); }

/* plant page: gardeners' photos and notes */
.member { margin-top: 22px; display: grid; gap: 18px; }
.member h3 { margin: 0 0 8px; font-size: 1.05rem; }
.mph figcaption { font-size: .8rem; }
.mph figcaption b { color: var(--ink); }
.st { display: inline-block; margin-top: 3px; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--chip); color: var(--muted); }
.st.ok { background: var(--ok); color: var(--ok-ink); }
.st.warn { background: var(--warn); color: var(--warn-ink); }
.st.bad { background: var(--bad); color: var(--bad-ink); }
.lnk { font: inherit; font-size: .8rem; background: none; border: 0; padding: 2px 0; color: var(--accent); text-decoration: underline; cursor: pointer; margin-right: 10px; }
.mform, .mynote { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-top: 12px; display: grid; gap: 8px; }
.mform label, .mynote > label { font-size: .9rem; font-weight: 600; display: grid; gap: 3px; }
.vis { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; border: 0; padding: 0; margin: 0; }
.vis label { display: flex; align-items: center; gap: 6px; font-weight: normal; cursor: pointer; }
.vis input { accent-color: var(--accent); width: 18px; height: 18px; }
.mynote textarea { min-height: 110px; resize: vertical; }
.note { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; margin-bottom: 12px; }
.note .nby { margin: 0; font-size: .85rem; color: var(--muted); }
.note .nbody { margin: 2px 0 0; overflow-wrap: anywhere; }

/* admin review list */
.rv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; border-top: 1px solid var(--line); padding: 12px 0; }
.rv img { width: 160px; height: 120px; object-fit: cover; border-radius: 6px; display: block; }
.rv p { margin: 0 0 4px; font-size: .92rem; }
.rv .arow button { min-height: 36px; padding: 6px 14px; }

@media (max-width: 760px) {
  .hdr { position: static; justify-content: flex-end; flex-wrap: wrap; margin: -8px 0 6px; }
  .rv { grid-template-columns: 1fr; }
  .rv img { width: 100%; height: auto; aspect-ratio: 4/3; }
}
.rvn { grid-template-columns: 1fr; }
.rq { margin: 4px 0 6px; padding: 6px 12px; border-left: 3px solid var(--line); background: var(--chip); border-radius: 4px; overflow-wrap: anywhere; }
#r-body h3 { margin: 16px 0 4px; }
.pend { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 999px; background: #d9822b; color: #fff; font-weight: 700; text-align: center; text-decoration: none; }
.box.fall p { margin: 0; }
.box.fall .fnote { margin-top: 6px; font-size: .78rem; color: var(--muted); }

.about-link { white-space: nowrap; font-size: .9em; margin-left: 30px; }
.top .about-link { color: #9fd3a8; }   /* header is dark green in both themes */
dialog.about { width: min(640px, calc(100vw - 24px)); padding-top: 0; }
dialog.about ol { padding-left: 1.3em; }
dialog.about li { margin-bottom: .6em; }
