/* Plant Library. Calm and quiet: moss green on a warm grey-white, serif for names, light theme only.
   Tokens first; the rest is plain component CSS. Phone first, wide screens added at the bottom. */
:root {
  --bg: #f3f2ec;
  --surface: #fbfaf6;
  --sunk: #eae8df;
  --ink: #232a22;
  --ink2: #565e52;          /* secondary text, 5.6:1 on --bg */
  --line: #dad8cc;
  --line2: #c3c0b1;
  --green: #2d5b44;         /* actions; white text on it is 7.9:1 */
  --green-ink: #244a38;
  --green-soft: #e1eadf;
  --earth: #7b4d22;         /* "to verify": earth, never green */
  --earth-soft: #f1e3cf;
  --danger: #9a352a;
  --danger-soft: #f5e2de;
  --r: 10px; --r-sm: 6px;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --gut: 16px;
  --tabh: 58px;             /* phone tab bar (Library / Inspiration / Network) */
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
[x-cloak] { display: none !important; }
body:has(dialog[open]), body:has(.side.open) { overflow: hidden; }
::selection { background: var(--green-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, p { margin: 0; }
[tabindex="-1"]:focus { outline: none; } /* headings are focused after navigation for screen readers; not interactive */
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.005em; }
a { color: var(--green-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--ink2); }
.small { font-size: .875rem; }
.latin { font-family: var(--serif); color: var(--ink2); font-weight: 400; }

/* names: Latin parts italic, 'Cultivar' upright, × upright */
.sci { font-family: var(--serif); }
.sci i { font-style: italic; }
.sci .cv, .sci .hx { font-style: normal; }

.ic { width: 20px; height: 20px; flex: none; }
.ic.big { width: 40px; height: 40px; color: var(--line2); }

/* ---------- buttons and inputs ---------- */
.btn, .menu button, .menuitem {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  font-weight: 500; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, transform .11s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: default; transform: none; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-quiet { color: var(--danger); border-color: transparent; background: transparent; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--green-ink); }
.btn.small { min-height: 44px; padding: 0 14px; font-size: .9rem; }
.btn.icon { width: 44px; padding: 0; flex: none; }
.btn.fillw { width: 100%; }
.btn:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
@media (any-hover: hover) {
  .btn:hover:not(:disabled) { background: var(--sunk); }
  .btn.primary:hover:not(:disabled) { background: var(--green-ink); }
  .btn.danger:hover:not(:disabled) { background: #7f2a21; }
  .btn.danger-quiet:hover:not(:disabled) { background: var(--danger-soft); }
}
.link { background: none; border: 0; padding: 8px 4px; color: var(--green-ink); text-decoration: underline; cursor: pointer; min-height: 44px; }

input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line2); border-radius: var(--r-sm);
  background: #fff; font-size: 1rem; transition: border-color .15s;
}
textarea { resize: vertical; line-height: 1.5; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-right: 2px; cursor: pointer; background: var(--ink2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") center / contain no-repeat; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
input[aria-invalid=true], select[aria-invalid=true] { border-color: var(--danger); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--green); margin: 0; flex: none; }
.field { display: grid; gap: 6px; margin-bottom: 16px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > div > label, fieldset > legend, .field label > span:first-child { font-size: .9rem; font-weight: 600; color: var(--ink); }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
legend { padding: 0; margin-bottom: 6px; }
.hint { font-size: .85rem; color: var(--ink2); margin-top: 4px; }
.preview { margin-top: 6px; font-size: 1.15rem; padding: 6px 12px; background: var(--green-soft); border-radius: var(--r-sm); }
.err { color: var(--danger); font-size: .9rem; margin-top: 4px; }
.req { font-weight: 400; color: var(--ink2); }
.check { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 8px 0; cursor: pointer; }
.check input { margin-top: 2px; }

.banner { padding: 12px 14px; border-radius: var(--r-sm); margin: 0 0 16px; font-size: .95rem; }
.banner.err { background: var(--danger-soft); color: #6f241b; border: 1px solid #e3bfb8; }
.banner.warn { background: var(--earth-soft); color: #5d3a17; border: 1px solid #e0cba9; }
.banner .btn { margin-top: 10px; }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; background: var(--earth-soft); color: var(--earth); font-size: .85rem; font-weight: 600; white-space: nowrap; border: 1px solid #e0cba9; }

/* ---------- boot, login ---------- */
.boot, .status { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 48px 16px; color: var(--ink2); }
.loadingdot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gut); }
.logincard { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px 28px; display: grid; gap: 4px; }
.logincard h1 { font-size: 1.9rem; margin-top: 8px; }
.logincard .muted { margin-bottom: 18px; }
/* the sign-in button has always had this spacing (it used to come from a clashing class name); kept exactly as it was */
.logincard .btn { margin-top: 28px; padding-top: 18px; }
.brandmark { width: 34px; height: 34px; color: var(--green); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; padding: 0 var(--gut); background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 600; font-size: 1.3rem; }
.brand .ic { color: var(--green); width: 26px; height: 26px; }
.topactions { display: flex; gap: 8px; align-items: center; }
.menuwrap { position: relative; }
.menu { position: absolute; right: 0; top: 50px; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px; display: grid; box-shadow: 0 8px 24px rgb(35 42 34 / .12); z-index: 30; }
.menu button, .menuitem { justify-content: flex-start; border: 0; background: transparent; min-height: 46px; }
.menuitem { position: relative; }
.menuitem:has(input:focus-visible) { outline: 2px solid var(--green); }
@media (any-hover: hover) { .menu button:hover, .menuitem:hover { background: var(--sunk); } }

/* ---------- layout ---------- */
.layout { max-width: 1280px; margin: 0 auto; padding: 16px var(--gut) calc(var(--tabh) + 28px + env(safe-area-inset-bottom)); }
.layout.hasbar { padding-bottom: calc(var(--tabh) + 112px + env(safe-area-inset-bottom)); }
.layout.isform { padding-bottom: 112px; }
.view { animation: enter .22s var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: 0 0 4px -6px; padding-right: 10px; color: var(--ink2); text-decoration: none; font-weight: 500; }

/* sidebar = bottom sheet on phones */
.scrim { position: fixed; inset: 0; background: rgb(35 42 34 / .38); z-index: 40; }
.side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-height: 84dvh; overflow: auto; background: var(--surface); border-radius: 16px 16px 0 0; padding: 0 var(--gut) calc(var(--gut) + env(safe-area-inset-bottom)); transform: translateY(104%); visibility: hidden; transition: transform .28s var(--ease), visibility 0s .28s; box-shadow: 0 -10px 30px rgb(35 42 34 / .15); }
.side.open { transform: none; visibility: visible; transition: transform .28s var(--ease); }
.sheethead { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--surface); padding: 10px 0 6px; }
.sheethead h2 { font-size: 1.3rem; }
.sheetfoot { position: sticky; bottom: 0; margin: 8px calc(-1 * var(--gut)) calc(-1 * (var(--gut) + env(safe-area-inset-bottom))); padding: 10px var(--gut) calc(var(--gut) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.panel { display: none; }
.panel.shown { display: block; }
.panelt { display: none; font-size: 1.05rem; margin-bottom: 12px; }
.range { display: flex; align-items: center; gap: 8px; border: 0; padding: 0; margin: 0; flex-wrap: wrap; }
.range legend { width: 100%; font-size: .9rem; font-weight: 600; }
.range label { flex: 1; min-width: 0; }
.side .field label > span:first-child { display: block; margin-bottom: 6px; }

.grouplist { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.grouplist li { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.switch { position: relative; flex: 1; display: flex; align-items: center; gap: 10px; min-height: 52px; cursor: pointer; min-width: 0; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 44px; margin: 0; }
.track { width: 38px; height: 22px; border-radius: 99px; background: var(--line2); position: relative; flex: none; transition: background-color .18s; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--green); outline-offset: 2px; }
.gname { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.switch { flex: none; width: 46px; min-height: 44px; }
.glink { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 52px; color: var(--ink); text-decoration: none; }
.glink:hover .gname { text-decoration: underline; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .18); display: inline-block; }

/* ---------- list ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.search { position: relative; flex: 1 1 260px; display: block; }
.search .ic { position: absolute; left: 12px; top: 12px; color: var(--ink2); pointer-events: none; }
.search input { padding-left: 40px; }
.search.small input { min-height: 40px; }
.search.small .ic { top: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; background: transparent; cursor: pointer; color: var(--ink2); font-weight: 500; transition: background-color .15s, color .15s; }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button[aria-pressed=true] { background: var(--green); color: #fff; }
.count { color: var(--ink2); font-size: .9rem; margin-bottom: 12px; display: flex; align-items: center; gap: 12px; min-height: 28px; }
.count .link { padding: 0 4px; min-height: 44px; margin: -8px 0; font-size: .9rem; }

.emptystate { text-align: center; padding: 56px 16px; display: grid; justify-items: center; gap: 10px; }
.emptystate h1, .emptystate h2 { font-size: 1.35rem; }
.emptystate p { color: var(--ink2); max-width: 36ch; }

.family { margin-bottom: 28px; }
.famhead { font-size: 1.25rem; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 6px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.famhead .latin { font-size: 1rem; }
.famhead .small { margin-left: auto; font-family: var(--sans); font-weight: 400; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: 1fr; }
.card { position: relative; display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: border-color .15s, box-shadow .2s var(--ease), transform .2s var(--ease); }
.card { align-content: start; }
.card .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; z-index: 1; }
.cardlink { display: grid; grid-template-columns: 1fr; text-decoration: none; color: inherit; min-height: 92px; }
/* phone: the thumbnail is pinned to the full card height (the tag row sits below the link, so it cannot be a grid cell) */
.thumb { position: absolute; left: 0; top: 0; bottom: 0; width: 92px; display: grid; place-items: center; background: var(--sunk); color: var(--line2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ic { width: 30px; height: 30px; }
.cbody { padding: 12px 14px 8px 106px; display: grid; gap: 2px; align-content: start; min-width: 0; }
.cbody .sci { font-size: 1.1rem; line-height: 1.25; overflow-wrap: anywhere; }
.dutch { color: var(--ink); font-size: .95rem; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; color: var(--ink2); font-size: .85rem; margin-top: 2px; }
.cardtags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 12px 106px; margin-top: -4px; align-items: center; }
.mark { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; min-height: 32px; border: 1px solid var(--line2); border-radius: 16px; font-size: .85rem; background: #fff; max-width: 100%; color: var(--ink); text-decoration: none; }
.mark > span:last-child { overflow-wrap: anywhere; }
.mark .dot, .mark i { flex: none; }
.vflag { display: inline-flex; color: var(--earth); }
.vflag .ic { width: 16px; height: 16px; }
.mark .dot { width: 10px; height: 10px; }
@media (any-hover: hover) { .card:hover { border-color: var(--line2); box-shadow: 0 6px 18px rgb(35 42 34 / .08); transform: translateY(-2px); } }

/* table: scrolls inside its own box; first column stays put */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; vertical-align: top; }
thead th { font-size: .8rem; font-weight: 600; color: var(--ink2); background: var(--sunk); white-space: nowrap; position: sticky; top: 0; }
td, tbody th { border-top: 1px solid var(--line); }
.famstick { position: sticky; left: 16px; width: max-content; max-width: calc(100vw - 64px); }
.famrow th { background: var(--bg); font-family: var(--serif); font-size: 1rem; padding-top: 14px; color: var(--ink); }
.datarow { cursor: pointer; }
.namecell { position: sticky; left: 0; background: var(--surface); min-width: 190px; max-width: 240px; padding-left: 16px; z-index: 1; }
thead th:first-child { position: sticky; left: 0; z-index: 2; padding-left: 16px; }
.namecell .stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; }
.namecell { padding-right: 34px; }
.namecell a.sci { text-decoration: none; color: var(--ink); font-size: 1rem; display: flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.namecell .vflag { position: absolute; right: 10px; top: 24px; }
.namecell .link { padding: 0 0 8px; min-height: 0; font-size: .85rem; }
.marks { display: flex; flex-wrap: wrap; gap: 4px; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.wide, th.wide { display: none; }
@media (any-hover: hover) { .datarow:hover td { background: var(--green-soft); } }

/* ---------- detail ---------- */
.dhead { padding-bottom: 8px; display: grid; gap: 6px; }
.dhead h1 { font-size: 2rem; line-height: 1.15; font-weight: 500; overflow-wrap: anywhere; }
.names { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 1.1rem; }
.famline { color: var(--ink2); }
.verify { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 6px; padding: 10px 12px; background: var(--earth-soft); border-radius: var(--r-sm); }
.verify .muted { color: #5d3a17; flex: 1 1 100px; }
@media (max-width: 559px) { .verify { flex-wrap: nowrap; gap: 10px; padding: 8px 10px; } .verify .badge { display: none; } .verify .btn { white-space: nowrap; flex: none; } .actions { margin-top: 6px; } .dsec { margin-top: 22px; padding-top: 14px; } }
.actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.dsec { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.dsec h2, .sech { font-size: 1.25rem; }
.blockhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
dl.dl { margin: 14px 0 0; display: grid; gap: 0; }
.frow { display: grid; grid-template-columns: 1fr; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 2px; }
.frow dt { font-size: .85rem; color: var(--ink2); }
.frow dd { margin: 0; }
.notes { white-space: pre-wrap; max-width: 68ch; margin-top: 12px; line-height: 1.65; }
.dsec > .muted { margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 99px; background: var(--surface); cursor: pointer; font-size: .92rem; transition: background-color .15s, border-color .15s, transform .11s var(--ease); }
.chip:active { transform: scale(.96); }
.chip .tick { width: 14px; height: 14px; display: none; }
.chip[aria-pressed=true] { background: var(--green-soft); border-color: var(--green); color: var(--green-ink); }
.chip[aria-pressed=true] .tick { display: block; }
span.chip { cursor: default; min-height: 30px; font-size: .88rem; }
@media (max-width: 559px) { button.chip { min-height: 44px; padding: 0 14px; } .addtag .btn { min-width: 72px; } }
span.chip.on { background: var(--green-soft); border-color: transparent; color: var(--green-ink); }
.chip.group { min-height: 44px; }
.gchip { display: inline-flex; gap: 2px; align-items: center; }
.chip.go { width: 44px; min-height: 44px; padding: 0; justify-content: center; color: var(--green-ink); text-decoration: none; }
.dot.lg { width: 20px; height: 20px; }
.gtitle { display: flex; align-items: center; gap: 12px; }
.gadd { margin-top: 10px; max-width: 520px; }
.glink .small { font-size: .875rem; }
.chip:disabled { opacity: .6; }
.tagset .chips { margin-bottom: 8px; }
.addtag { display: flex; gap: 8px; }
.addtag input { flex: 1; min-width: 0; }
.maplink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 4px; }

.pgrid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
.ptile { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--sunk); cursor: pointer; }
.ptile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pinned { position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: rgb(251 250 246 / .92); color: var(--ink); }
.cap { margin-top: 4px; color: var(--ink2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.uploads { margin-bottom: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.uploads ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: .92rem; }
.uploads li.error { color: var(--danger); }
progress { width: 100%; height: 8px; accent-color: var(--green); }

/* ---------- form ---------- */
.formview h1 { font-size: 1.8rem; margin-bottom: 16px; }
.formgrid { display: grid; gap: 0 20px; max-width: 760px; }
.field > div { display: grid; gap: 6px; }
.newfam { display: grid; gap: 6px; margin-top: 8px; padding: 12px; background: var(--green-soft); border-radius: var(--r-sm); }
.formbar { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); margin-top: 8px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.formbar .btn.primary { flex: 1; }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgb(35 42 34 / .45); }
.dlg { width: min(640px, 100%); max-height: min(92dvh, 900px); border-radius: 16px; box-shadow: 0 20px 60px rgb(35 42 34 / .3); }
.dlg.small { width: min(440px, calc(100% - 32px)); }
.dlg.photo { width: min(760px, 100%); }
.dlg[open] { animation: pop .2s var(--ease); }
.dlg[open]::backdrop { animation: fade .2s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
.dlgbody { padding: 22px 20px 18px; position: relative; }
.dlgbody h2 { font-size: 1.4rem; margin-bottom: 8px; }
.dlgbody h3 { font-size: 1rem; margin: 14px 0 6px; font-family: var(--sans); }
.dlgactions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.dlgactions.spread { justify-content: space-between; }
.dlgactions .row { display: flex; gap: 10px; margin-left: auto; }
.closex { position: absolute; right: 8px; top: 8px; background: rgb(251 250 246 / .9); z-index: 2; }
.stage { position: relative; margin: -22px -20px 16px; background: #1f251e; }
.bigimg { display: block; width: 100%; height: 50dvh; object-fit: contain; }
.stage .nav { position: absolute; top: 50%; margin-top: -22px; border-radius: 50%; background: rgb(251 250 246 / .92); }
.stage .prev { left: 8px; } .stage .next { right: 8px; }
.pcount { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); padding: 2px 10px; border-radius: 99px; background: rgb(35 42 34 / .75); color: #fff; }
.dlgdanger { margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--line); }
.btn.flush { padding-left: 0; justify-content: flex-start; }
.stats { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0; margin: 12px 0; }
.stats li { padding: 10px 12px; background: var(--sunk); border-radius: var(--r-sm); color: var(--ink2); }
.stats strong { display: block; font-size: 1.6rem; font-family: var(--serif); color: var(--ink); line-height: 1.1; }
.stats li.bad { background: var(--danger-soft); } .stats li.bad strong { color: var(--danger); }
.plist { list-style: none; padding: 0; margin: 0; max-height: 180px; overflow: auto; display: grid; gap: 6px; font-size: .92rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.field > .swatches { display: flex; }
.swatch { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.swatch input[type=radio] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.swatch i { width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .2); transition: transform .15s var(--ease); }
.swatch input:checked + i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); transform: scale(.92); }
.swatch input:focus-visible + i { outline: 2px solid var(--green); outline-offset: 4px; }
.swatch.custom input { opacity: 1; position: static; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line2); border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
.swatch.custom input::-webkit-color-swatch-wrapper { padding: 0; }
.swatch.custom input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.swatch.custom input::-moz-color-swatch { border: 0; border-radius: 50%; }
.swatch.custom:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
.picklist { list-style: none; margin: 8px 0 0; padding: 0; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.picklist li { padding: 0 12px; border-bottom: 1px solid var(--line); }
.picklist li:last-child { border: 0; }
.picklist .check { padding: 6px 0; }

.toasts { position: fixed; left: 50%; bottom: calc(88px + var(--tabh) + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-sm); font-size: .95rem; animation: pop .22s var(--ease); box-shadow: 0 8px 24px rgb(35 42 34 / .25); }
.toast.err { background: var(--danger); }

/* ---------- phone bottom bar ---------- */
.bottombar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabh) + env(safe-area-inset-bottom)); z-index: 30; display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 8px; padding: 8px var(--gut); background: var(--surface); border-top: 1px solid var(--line); }
.bottombar.one { grid-template-columns: 1fr; }
.bottombar button, .bottombar a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; border: 1px solid var(--line2); border-radius: var(--r-sm); background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 500; cursor: pointer; }
.bottombar a.primary { background: var(--green); border-color: var(--green); color: #fff; }
.bottombar button, .bottombar a { position: relative; white-space: nowrap; }
.bottombar .count { position: absolute; top: -11px; right: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--green); color: #fff; font-size: .85rem; display: inline-grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }

/* ---------- wider screens ---------- */
@media (min-width: 560px) {
  :root { --gut: 24px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
  .card .cardlink { min-height: 0; }
  .thumb { position: static; width: auto; aspect-ratio: 16 / 10; }
  .thumb:not(:has(img)) { aspect-ratio: 3 / 1; }
  .thumb .ic { width: 36px; height: 36px; }
  .cbody { padding: 14px 16px 6px; }
  .card.marked .cbody { padding-left: 20px; }
  .cardtags { padding: 4px 16px 14px; margin-top: 0; }
  .card.marked .cardtags { padding-left: 20px; }
  .card .stripe { width: 5px; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .formgrid { grid-template-columns: 1fr 1fr; }
  .field.full { grid-column: 1 / -1; }
  .frow { grid-template-columns: 170px 1fr; gap: 16px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .dlg { margin: auto; }
}
@media (min-width: 900px) {
  :root { --gut: 32px; }
  .layout.single { grid-template-columns: minmax(0, 860px); justify-content: center; }
  .layout.single.wide { grid-template-columns: minmax(0, 1120px); }
  .layout, .layout.hasbar, .layout.isform { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 40px; padding-bottom: 64px; align-items: start; }
  .scrim, .sheethead, .bottombar, .sheetfoot { display: none !important; }
  .side { position: sticky; top: 84px; transform: none; visibility: visible; max-height: calc(100dvh - 100px); background: transparent; box-shadow: none; padding: 0 4px 0 0; z-index: 1; border-radius: 0; }
  .panel { display: block; margin-bottom: 28px; }
  .panelt { display: block; }
  td.wide, th.wide { display: table-cell; }
  .toasts { bottom: 24px; }
  .pagehead.row { align-items: center; }
  .dhead h1 { font-size: 2.4rem; }
  .view.detail { max-width: 860px; }
  .formbar { position: static; background: none; }
  .formbar .btn.primary { flex: none; }
}
@media (max-width: 899px) { .hide-phone { display: none !important; } }
@media (max-width: 380px) { .hide-narrow { display: none; } .bottombar { gap: 6px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; transform: none !important; }
  .view, .dlg[open], .toast { animation: fade .15s ease; }
  .loadingdot { animation: none; }
  .side { transition: opacity .15s, visibility 0s .15s; opacity: 0; }
  .side.open { opacity: 1; transition: opacity .15s; }
}

/* late fixes */
.field > .addtag { display: flex; }
.plist + p, .dlgbody p.small:last-of-type { margin-top: 8px; }
.dlgbody p + p { margin-top: 10px; }
.dlgbody .stats + p { margin-top: 0; }
@media (min-width: 760px) {
  .dlg.photo { width: min(980px, calc(100% - 32px)); }
  .dlg.photo .dlgbody { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; padding: 20px; }
  .dlg.photo .stage { margin: 0; border-radius: var(--r); overflow: hidden; }
  .dlg.photo .bigimg { height: auto; max-height: 72dvh; }
  .dlg.photo .closex { right: 12px; top: 12px; }
  .dlg.photo form { padding-top: 28px; }
}

/* ---------- main navigation: phone = tab bar at the bottom; wide = links in the header ---------- */
.mainnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; display: grid; grid-template-columns: repeat(3, 1fr); height: calc(var(--tabh) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line2); }
.mainnav.hidebar { display: none; }
.mainnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; color: var(--ink2); text-decoration: none; font-size: .8rem; font-weight: 500; border-top: 3px solid transparent; margin-top: -1px; transition: background-color .15s, color .15s; }
.mainnav a[aria-current=page] { color: var(--green-ink); font-weight: 700; border-top-color: var(--green); background: var(--green-soft); }
.mainnav a:active { background: var(--sunk); }
@media (any-hover: hover) { .mainnav a:hover { background: var(--sunk); color: var(--ink); } }

/* ---------- page headings (Inspiration, Network) ---------- */
.pagehead { margin-bottom: 14px; }
.pagehead.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pagetitle { font-size: 1.8rem; line-height: 1.15; }
.lead { margin-top: 4px; max-width: 60ch; }
.sech { margin: 0 0 12px; }
.listhead { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.netview .check { margin: 4px 0; }
.dsec > .notes { margin-top: 10px; }

/* ---------- inspiration wall + hero ---------- */
.wall { list-style: none; margin: 0; padding: 0; column-width: 220px; column-gap: 14px; }
.wall li { break-inside: avoid; margin-bottom: 14px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .2s var(--ease), transform .2s var(--ease); }
.tile img { display: block; width: 100%; height: auto; min-height: 90px; background: var(--sunk); }
.tcap { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 4px solid var(--line2); min-height: 44px; }
.tname { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--serif); font-weight: 600; line-height: 1.25; }
@media (any-hover: hover) { .tile:hover { border-color: var(--line2); box-shadow: 0 6px 18px rgb(35 42 34 / .1); transform: translateY(-2px); } }
.nopic { margin-top: 8px; }
.hero { margin: 0 0 14px; background: var(--sunk); border: 1px solid var(--line); border-bottom: 5px solid var(--line2); border-radius: var(--r-sm); overflow: hidden; }
.hero img { display: block; width: 100%; height: auto; max-height: 62dvh; object-fit: contain; margin: 0 auto; }

/* ---------- connections ---------- */
.lsw { width: 40px; height: 6px; flex: none; overflow: visible; }
.lgroup { margin-top: 14px; }
.lhead { display: flex; align-items: center; gap: 10px; font-family: var(--sans); font-size: .95rem; font-weight: 600; margin-bottom: 2px; }
.llist { list-style: none; margin: 0; padding: 0; }
.llist li { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 4px 0; min-height: 48px; }
.lmain { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 6px 0; }
.llist a.sci { color: var(--ink); font-size: 1.02rem; overflow-wrap: anywhere; }
.lnote { color: var(--ink2); flex-basis: 100%; }
.llist.flat li { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 0; }
.ltype { display: inline-flex; align-items: center; gap: 8px; color: var(--ink2); }
.llist.compact li { min-height: 44px; flex-wrap: wrap; gap: 4px 10px; }
.llist.compact .link { padding: 0; min-height: 44px; text-align: left; text-decoration: none; color: var(--ink); font-size: 1rem; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.legchip { min-height: 44px; padding: 0 12px; gap: 8px; }
.legchip[aria-pressed=false] { background: transparent; color: var(--ink2); border-style: dashed; }
.legchip[aria-pressed=false] .lsw { opacity: .45; }
.netgroups { margin: 8px 0 4px; }
.netgroups legend { font-size: .9rem; font-weight: 600; margin-bottom: 6px; }
.netnone { padding: 24px 0; text-align: center; }
.typeopts { display: grid; gap: 0; }
.typeopt { align-items: center; padding: 4px 0; }
.lkfrom { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.lkfrom .sci { color: var(--ink); font-size: 1.1rem; }

.netbox { margin: 8px calc(-1 * var(--gut)) 0; padding: 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 120px; }
.netbox svg { display: block; width: 100%; max-width: 100%; height: auto; margin: 0 auto; overflow: visible; }
@media (min-width: 560px) { .netbox { margin: 8px 0 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; } }
.ed { stroke-width: 2.4; stroke-linecap: round; fill: none; transition: opacity .15s; }
.ed.dim { opacity: .18; }
.nd { cursor: pointer; outline: none; transition: opacity .15s; }
.nd .hit { fill: transparent; }
.nd .dot { fill: var(--green-soft); stroke: var(--ink); stroke-width: 1.6; transition: fill .15s; }
.nd .ring { fill: none; stroke-width: 3; }
.nd text { fill: var(--ink); font-family: var(--serif); font-size: 12.5px; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.nd.dim { opacity: .3; }
.nd.sel .dot { fill: var(--green); stroke-width: 2.4; }
.nd.sel text { font-weight: 700; font-size: 13.5px; }
.nd:focus-visible .hit { stroke: var(--green); stroke-width: 2.5; fill: var(--green-soft); fill-opacity: .6; }
@media (any-hover: hover) { .nd:hover .dot { fill: var(--green); } }
.netpanel { position: sticky; bottom: calc(var(--tabh) + 8px + env(safe-area-inset-bottom)); z-index: 5; margin: 10px 0 0; padding: 12px 14px 14px; background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: 0 8px 24px rgb(35 42 34 / .14); max-height: 46dvh; overflow: auto; display: grid; gap: 6px; animation: enter .2s var(--ease); }
.netpanel > div { display: grid; gap: 6px; }
.npbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.npbar h3 { font-size: 1.2rem; font-weight: 500; overflow-wrap: anywhere; }
.netpanel .btn.primary { justify-self: start; }
.gtag { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; }
@media (min-width: 900px) { .netpanel { bottom: 16px; } }

/* ---------- group dialog: picture and notes ---------- */
.gdfields { display: flex; flex-direction: column; }
.gdfields.pf .gpic { order: -1; }
.picprev { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; margin-bottom: 8px; }
.picprev img { display: block; width: 100%; max-height: 220px; object-fit: contain; }
.picbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.picbtns .btn.danger-quiet { padding-left: 8px; }

@media (min-width: 900px) {
  .mainnav { position: static; display: flex; gap: 4px; margin-right: auto; margin-left: 20px; height: 100%; padding: 0; background: none; border: 0; z-index: auto; }
  .mainnav.hidebar { display: flex; }
  .mainnav a { flex-direction: row; gap: 8px; height: 100%; padding: 0 14px; font-size: 1rem; border-top: 0; margin-top: 0; border-bottom: 3px solid transparent; background: none; }
  .mainnav a[aria-current=page] { border-bottom-color: var(--green); background: none; }
  .wall { column-width: 260px; column-gap: 20px; }
  .wall li { margin-bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) { .netpanel { animation: fade .15s ease; } .ed, .nd { transition: none; } }

.npbar h3 { flex: 1; min-width: 0; }
.npbar .btn.small { min-height: 44px; }
.netpanel { max-height: 36dvh; padding: 10px 12px 12px; }
.llist.compact li { min-height: 40px; }
.llist.compact .link { min-height: 40px; }
.legchip { line-height: 1.15; text-align: left; }
.legchip .tick { display: none !important; }
.legchip .lsw { width: 32px; }
@media (max-width: 559px) { .legend { display: grid; grid-template-columns: 1fr 1fr; } .legchip { padding: 4px 10px; gap: 6px; font-size: .88rem; justify-content: flex-start; } }

.netgroups summary { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: .9rem; font-weight: 600; }
.netgroups[open] summary { margin-bottom: 4px; }
.netgroups .chip.group { text-align: left; max-width: 100%; height: auto; padding-top: 6px; padding-bottom: 6px; }
.netgroups .chip.group > span:not(.dot) { overflow-wrap: anywhere; }
.netgroups summary { list-style: none; }
.netgroups summary::-webkit-details-marker { display: none; }
.netgroups summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink2); border-bottom: 2px solid var(--ink2); transform: rotate(-45deg); transition: transform .15s var(--ease); margin: 0 4px 0 2px; }
.netgroups[open] summary::before { transform: rotate(45deg); }
.bottombar button.primary { background: var(--green); border-color: var(--green); color: #fff; }
.dsec[aria-labelledby=h-gnotes] { margin-bottom: 28px; }
.wall { column-width: 150px; column-gap: 12px; }
.wall li { margin-bottom: 12px; }
.tcap { flex-wrap: wrap; gap: 4px 8px; }
@media (min-width: 560px) { .wall { column-width: 220px; column-gap: 14px; } .wall li { margin-bottom: 14px; } }
@media (min-width: 900px) { .wall { column-width: 260px; column-gap: 20px; } .wall li { margin-bottom: 20px; } }
.tcap { display: grid; grid-template-columns: 12px 1fr; align-items: baseline; gap: 2px 8px; }
.tcap .dot { align-self: center; }
.tname { overflow-wrap: break-word; }
.tcap > .small { grid-column: 2; }
.llist.flat li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.llist.flat .lnote { flex-basis: auto; }
.view + .view.netview { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- language switch (login screen and the "..." menu) ---------- */
.menusep { height: 1px; margin: 4px 6px; background: var(--line); }
.langopt .ic, .langsw .ic { visibility: hidden; }
.langopt[aria-pressed=true] { font-weight: 700; }
.langopt[aria-pressed=true] .ic, .langsw [aria-pressed=true] .ic { visibility: visible; }
.langsw { display: flex; justify-content: center; gap: 4px; margin-top: 14px; }
.langsw .link { display: inline-flex; align-items: center; gap: 4px; padding: 8px 10px; text-decoration: none; }
.langsw .link .ic { width: 16px; height: 16px; }
.langsw [aria-pressed=true] { font-weight: 700; text-decoration: underline; }
.show-narrow { display: none; }
@media (max-width: 380px) { .show-narrow { display: inline; } }
.addtag .btn { white-space: nowrap; }

/* ---------- review fixes 2026-11-20 ---------- */
/* species page: the verify banner wraps instead of pushing its button past the edge (any language, 360 px) */
@media (max-width: 559px) { .verify { flex-wrap: wrap; } .verify .btn { max-width: 100%; white-space: normal; padding: 0 12px; } }
/* network: wider halo so lines never cut through a label; 13.6 px labels */
.nd text { font-size: 13.6px; stroke-width: 6px; }
.nd.sel text { font-size: 14.4px; }
.netpanel { max-height: 33dvh; }
.lpair { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.llist.compact li { row-gap: 0; min-height: 44px; }
.llist.compact .link { min-height: 44px; padding: 10px 0; line-height: 24px; }
/* species links in connection lists: a 44 px tap area (inline-block keeps the spaces around x in the name) */
.llist a.sci { display: inline-block; padding: 10px 0; line-height: 24px; }
.lmain { padding: 0; align-items: center; }
.llist.flat li { align-items: center; }
@media (max-width: 559px) {
  .llist.flat li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 4px 0 8px; }
  .llist.flat .lnote { flex-basis: auto; }
}
/* table: a flex link drops the spaces between the italic parts and the x; block keeps them */
.namecell a.sci { display: block; padding: 10px 0; line-height: 24px; min-height: 44px; }
/* portrait hero: capped on phones, a tap opens the full picture */
.herobtn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
@media (max-width: 559px) { .hero img { aspect-ratio: 4 / 3; max-height: none; object-fit: cover; } }
.herodlg { width: min(980px, 100%); }
.herodlg .dlgbody { padding: 0; }
.herodlg .stage { margin: 0; }
.herodlg .bigimg { height: auto; max-height: 88dvh; }
/* dialogs: the action row stays at the bottom while the content scrolls above it */
.dlgactions { position: sticky; bottom: 0; z-index: 3; margin: 18px -20px -18px; padding: 10px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
/* tap targets on phones */
@media (max-width: 899px) { .mark { min-height: 44px; } }
.chip.go { flex: none; }
.swatch.custom .plus { position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; padding: 2px; border-radius: 50%; background: var(--surface); color: var(--ink); pointer-events: none; }
/* filters sheet: air above the sticky footer */
.side .panel > .btn.quiet:last-child { margin-bottom: 12px; }
.sheetfoot { margin-top: 16px; }
/* desktop sidebar: sticky under the header, with its own ordinary scrollbar when taller than the window (see the 2026-11-20 round 3 block) */
/* group page add-species row: the select shrinks, the button keeps its size and stays inside the page gutter */
.addtag select { flex: 1; min-width: 0; width: auto; }
.addtag .btn { flex: none; }
/* the header grid must not grow to the longest option of the add-species select (it pushed the button and the view switch past the edge) */
.dhead { grid-template-columns: minmax(0, 1fr); }

/* ---------- list: flat A-Z, filter sections, active chips (2026-11-20) ---------- */
.famtag { color: var(--ink2); font-size: .85rem; }
.listbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 16px; }
.listbar .count { margin-bottom: 0; }
.switch.famsw { width: auto; flex: none; gap: 10px; min-height: 44px; font-size: .9rem; color: var(--ink); }
.actions .famsw { align-self: center; }
.activechips { list-style: none; margin: 0 0 6px; padding: 0; gap: 8px; }
.achip { background: var(--green-soft); border-color: var(--green); color: var(--green-ink); max-width: 100%; text-align: left; }
.achip span { overflow-wrap: anywhere; }
.achip .ic { width: 14px; height: 14px; }
@media (max-width: 559px) { .achip { padding: 0 12px; } }
.helper { margin-bottom: 10px; max-width: 60ch; }
.clearall { margin: 0 0 4px -16px; }
.fsec { border-top: 1px solid var(--line); }
.fsec:last-of-type { border-bottom: 1px solid var(--line); }
.fsec summary { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; font-size: .95rem; font-weight: 600; list-style: none; }
.fsec summary::-webkit-details-marker { display: none; }
.fsec summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink2); border-bottom: 2px solid var(--ink2); transform: rotate(-45deg); transition: transform .15s var(--ease); margin: 0 4px 0 2px; flex: none; }
.fsec[open] summary::before { transform: rotate(45deg); }
.fcount { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--green); color: #fff; font-size: .8rem; font-weight: 600; }
.fbody { padding: 0 0 14px; }
.fbody > p { margin-bottom: 8px; }
.fbody .range { flex-wrap: nowrap; }
@media (max-width: 899px) { .fsec .chip { min-height: 44px; } }
.panel:has(.fsec) { margin-bottom: 20px; }
@media (min-width: 900px) { .clearall { margin-left: -12px; } }
@media (prefers-reduced-motion: reduce) { .fsec summary::before { transition: none; } }
/* the pinned footer reaches the sheet's real bottom edge, so nothing scrolls past underneath it */
.sheetfoot { bottom: calc(-1 * (var(--gut) + env(safe-area-inset-bottom))); z-index: 2; }

/* ---------- review round 3 (2026-11-20) ---------- */
/* active chips on phones: ONE 44 px row that swipes sideways; a fade at the right edge while more chips are off-screen */
@media (max-width: 899px) {
  .activechips { display: flex; flex-wrap: nowrap; height: 44px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; }
  .activechips::-webkit-scrollbar { display: none; }
  .activechips[data-more] { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  .activechips li { flex: none; }
  .achip { min-height: 44px; white-space: nowrap; max-width: calc(100vw - 2 * var(--gut) - 24px); }
  .achip span { overflow: hidden; text-overflow: ellipsis; }
  .achip:focus-visible { outline-offset: -3px; }
}
/* sheets: the heading sits above the scrolling content; a hairline appears once content is scrolled beneath it */
.sheethead { z-index: 3; margin: 0 calc(-1 * var(--gut)); padding: 10px var(--gut) 6px; }
.side.scrolled .sheethead { border-bottom: 1px solid var(--line); }
/* filter sheet footer: clear (secondary) beside show (primary), one row */
.sheetfoot { display: flex; gap: 8px; align-items: stretch; }
.sheetfoot .btn { padding: 0 12px; line-height: 1.2; text-align: center; }
.sheetfoot .btn.primary { flex: 1 1 0; min-width: 0; }
.sheetfoot .clearfoot { flex: none; }
.togglechips { margin: 4px 0 10px; }
/* the clear button also sits in the sheet footer on phones */
@media (max-width: 899px) { .clearall { display: none; } }
/* a collapsible planting-group panel: on phones the sheet already has its heading, so the summary is hidden and the panel stays open */
.fsec.hl .fbody .grouplist { margin-top: 4px; }
@media (max-width: 899px) { .fsec.hl { border: 0; } .fsec.hl > summary { display: none; } }
/* desktop sidebar: sticky under the header, own vertical scroll (a normal, always-visible scrollbar) when taller than the window */
@media (min-width: 900px) {
  .side { position: sticky; top: 76px; max-height: calc(100dvh - 92px); overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--ink2) var(--sunk); padding: 0 12px 16px 0; }
  .panel { margin-bottom: 20px; }
}
/* highlight feedback line under the result count: plain text buttons, not chips */
.countcol { min-width: 0; }
.hlline { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; column-gap: 4px; color: var(--ink2); }
.hlline li { display: flex; align-items: center; }
.hloff { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 0; border: 0; background: none; color: var(--ink); font-size: .875rem; cursor: pointer; border-radius: var(--r-sm); text-align: left; }
.hloff span { overflow-wrap: anywhere; }
.hloff .ic { width: 14px; height: 14px; color: var(--ink2); }
@media (any-hover: hover) { .hloff:hover span { text-decoration: underline; } }
/* table on phones: the family is a quiet second line in the name cell, not a column */
.namefam { display: block; margin: -4px 0 8px; }
@media (max-width: 559px) { .famcol { display: none; } }
@media (min-width: 560px) { .namefam { display: none !important; } }
/* custom colour swatch: neutral with a + until a custom colour is the chosen one */
.swatch.custom input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.swatch.custom i { background: var(--sunk); box-shadow: none; border: 2px dashed var(--ink2); }
.swatch.custom.sel i { border: 0; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .2), 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); transform: scale(.92); }
.swatch.custom:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 50%; }
/* network panel: the header stays, the connection list scrolls inside; every row has the same two-line layout (type, then species) */
.netpanel { display: flex; flex-direction: column; overflow: hidden; }
.netpanel > div { display: flex; flex-direction: column; min-height: 0; gap: 6px; }
.netpanel .llist.compact { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.netpanel .llist.compact li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-content: center; padding: 4px 0; min-height: 66px; }
.netpanel .lpair { white-space: normal; font-size: .85rem; color: var(--ink2); }
.netpanel .llist.compact .link { padding: 0; min-height: 44px; display: flex; align-items: center; overflow-wrap: anywhere; }
.netpanel > div > p.small { flex: none; }
/* verified checkbox: label, then a separate quiet hint line */
.check .hint { display: block; margin: 0; font-weight: 400; }
.sheetfoot .btn.primary:disabled { opacity: 1; background: var(--sunk); border-color: var(--line2); color: var(--ink2); } /* readable when there is nothing to show */

/* ---------- review round 4 (2026-11-20) ---------- */
/* highlighted groups on phones: ONE 44 px row that swipes sideways, like the active filter chips (four groups used to take four rows) */
@media (max-width: 899px) {
  .countcol { max-width: 100%; }
  .hlline { flex-wrap: nowrap; height: 44px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; }
  .hlline::-webkit-scrollbar { display: none; }
  .hlline[data-more] { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  .hlline li { flex: none; }
  .hloff span { white-space: nowrap; }
  .hloff:focus-visible { outline-offset: -3px; }
}
/* desktop sidebar: a fade at the bottom edge while there is more below (some systems hide scrollbars until used); a little more room for long group names */
@media (min-width: 900px) {
  .side { padding: 0 4px 0 0; }
  .side::after { content: ""; display: block; position: sticky; bottom: 0; height: 28px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
  .side .glink { gap: 6px; }
}
/* network panel: the name is ordinary inline text again; as a flex box it lost the spaces around the hybrid sign */
.netpanel .llist.compact .link { display: block; padding: 10px 0; }
/* table: the name link brings its own 10 px padding, so the cell adds none on top and the name lines up with the other columns */
.namecell { padding-top: 0; }
.namecell .vflag { top: 14px; }
/* sheet footer: two-line button text (Dutch "no species") gets room */
.sheetfoot .btn { padding: 6px 12px; }
