/* Fungus Atlas: the Fungus 2.0 redesign (brown chrome, cream pages, safety colours) for the web */
:root {
  --primary: #663300;
  --bg: #fff3c5;
  --surface: #fffaeb;
  --border: rgba(102, 51, 0, 0.25);
  --text: #171717;
  --muted: #666666;
  --danger: #cc0000;
  --deadly: #8a0000;
  --hallucinogenic: #6a4c93; /* hallucinogenic species only (as the app): neither red nor green */
  --success: #00780c;
  --warning: #c2410c;
  --placeholder: #d3d3d3;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, Roboto, "Segoe UI", sans-serif;
}
a { color: var(--primary); }
a:hover { color: #3d1f00; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; }
.wrap { max-width: 1160px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.muted { color: var(--muted); }
.lab { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* Header and footer */
.top { background: var(--primary); color: var(--bg); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--bg); text-decoration: none; font-weight: 700; font-size: 20px; }
.brand:hover { color: var(--bg); }
.brand img { border-radius: 6px; border: 1px solid rgba(255, 243, 197, 0.5); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex-grow: 1; }
.nl { color: rgba(255, 243, 197, 0.85); text-decoration: none; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 15px; }
.nl:hover { color: var(--bg); }
.nl.on { background: var(--bg); color: var(--primary); }
.foot { background: var(--primary); color: var(--bg); font-size: 14px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 20px 48px; padding-top: 28px; padding-bottom: 28px; }
.foot-main { flex: 999 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.foot-main b { font-size: 16px; }
.foot-nav { flex: 1 1 180px; display: flex; flex-direction: column; gap: 6px; }
.foot a { color: var(--bg); text-decoration: none; }
.foot a:hover { text-decoration: underline; color: var(--bg); }

/* Buttons, chips, cards, badges */
.btn {
  min-height: 46px; padding: 0 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font: inherit; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; border: 0;
}
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn-primary { background: var(--primary); color: var(--bg); }
.btn-primary:hover { color: var(--bg); background: #4d2600; }
.btn-light { background: var(--bg); color: var(--primary); }
.btn-light:hover { color: var(--primary); background: #fff8dc; }
.btn-outline { background: none; color: var(--primary); border: 2px solid var(--primary); }
.btn-ghost-light { background: none; color: var(--bg); border: 2px solid var(--bg); }
.btn-ghost-light:hover { color: var(--bg); background: rgba(255, 243, 197, 0.12); }
.chip {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--primary); background: none; color: var(--primary);
  font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--primary); color: var(--bg); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.badge { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.badge-on { position: absolute; right: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.tag { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid rgba(102, 51, 0, 0.5); color: var(--primary); }
.link { font-weight: 700; color: var(--primary); text-decoration: none; }
.link:hover { text-decoration: underline; }
.banner {
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 10px 16px; border-radius: 6px; color: #fff;
  font-size: 15px; font-weight: 700; text-decoration: none;
}
.banner:hover { color: #fff; }
.banner svg { flex-shrink: 0; }
.banner-deadly { background: var(--deadly); }
.banner-poisonous { background: var(--danger); }
.banner-genus, .banner-uncertain, .banner-warning { background: var(--warning); }
.banner-lines { flex: 1; display: flex; flex-direction: column; }
.banner-line { display: flex; align-items: center; gap: 8px; min-height: 32px; color: #fff; text-decoration: none; }
.banner-line:hover { color: #fff; text-decoration: underline; }
.banner-note { padding: 4px 0; font-weight: 400; }
/* Wood-lover paralysis: red banner at the top of a species page */
.banner.wlp { align-items: flex-start; padding: 14px 16px; }
.banner.wlp svg { margin-top: 1px; }
.banner.wlp b { font-size: 17px; }
.banner.wlp p { margin: 2px 0 0; font-weight: 400; }
.ph { background: var(--placeholder); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.ph svg { opacity: 0.6; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 6px; border: 1px solid var(--border); font-size: 14px; }
.note svg { flex-shrink: 0; margin-top: 2px; color: var(--primary); }
.footer-note { margin: 8px 0 0; font-size: 14px; font-style: italic; text-align: center; }

/* Identify (home) */
.hero-wrap { padding-top: 32px; padding-bottom: 24px; }
.hero { background: var(--primary); color: var(--bg); border-radius: 12px; padding: 32px; display: flex; flex-wrap: wrap; gap: 32px; }
.hero-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.hero h1 { margin: 0; font-size: 44px; line-height: 1.1; }
.hero p { margin: 0; font-size: 18px; }
.drop {
  border: 2px dashed rgba(255, 243, 197, 0.6); border-radius: 12px; padding: 32px 20px; display: flex; flex-direction: column;
  align-items: center; gap: 12px; text-align: center; transition: background 0.15s;
}
.drop.over { background: rgba(255, 243, 197, 0.12); }
.drop-title { font-size: 18px; font-weight: 700; }
.drop-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.drop-hint { font-size: 13px; color: rgba(255, 243, 197, 0.85); }
.tips { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.tip { display: flex; gap: 12px; align-items: center; }
.tip img { width: 76px; height: 76px !important; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.tip div div:last-child { font-size: 14px; color: rgba(255, 243, 197, 0.85); }
.section { padding-bottom: 48px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 24px; }
.ins-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ins-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.ins-ctl .btn { gap: 6px; }
#ins-tiles { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 600px) { #ins-tiles { grid-template-columns: repeat(4, 1fr); } }
.mapteaser { display: flex; flex-wrap: wrap; overflow: hidden; text-decoration: none; color: var(--text); }
.mapteaser:hover { color: var(--text); }
.mapteaser img { flex: 1 1 240px; min-width: 0; height: 260px; object-fit: cover; object-position: 50% 64%; }
.mapteaser-text { flex: 1 1 260px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.mapteaser-text h2 { margin: 0; font-size: 22px; }
.scale { display: flex; gap: 3px; }
.scale span { height: 8px; flex: 1; border-radius: 2px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); font-weight: 700; }
.tile:hover { color: var(--text); text-decoration: underline; }
.tile .pic { position: relative; }
.tile img, .tile .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; }

/* Result */
.result { display: flex; flex-direction: column; gap: 16px; padding-top: 24px; padding-bottom: 48px; }
.result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.result-head h1 { margin: 0; font-size: 28px; }
.result-head .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.banners { display: flex; flex-direction: column; gap: 8px; }
.result-cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.topcard { flex: 999 1 560px; min-width: 0; overflow: hidden; }
.topcard .gallery { position: relative; background: var(--placeholder); }
.topcard .gallery img, .topcard .gallery .ph { width: 100%; height: 420px; object-fit: cover; display: block; }
.counter { position: absolute; right: 12px; top: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 12px; font-weight: 700; }
.gnav { position: absolute; top: calc(50% - 22px); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.45); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.gnav.prev { left: 12px; } .gnav.prev svg { transform: rotate(180deg); }
.gnav.next { right: 12px; }
.topcard-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.namerow { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.namerow h2 { margin: 0; font-size: 28px; }
.latin { font-style: italic; color: var(--muted); }
.conf { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.conf b { font-size: 16px; }
.conf span { font-size: 14px; color: var(--muted); }
.edrow { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.edrow .grow { flex: 1; }
.side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.side .card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs img, .thumbs .add { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; }
.thumbs .add { border: 2px dashed rgba(102, 51, 0, 0.45); display: flex; align-items: center; justify-content: center; color: var(--primary); background: none; cursor: pointer; }
.hint { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--warning); }
.other { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.other:hover { color: var(--text); }
.other.dim { opacity: 0.45; }
.other img, .other .ph { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.other .txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.other .lvl { font-size: 13px; font-weight: 700; }
.other .pct { font-size: 14px; color: var(--muted); }
.promo { background: var(--primary); color: var(--bg); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.promo b { font-size: 17px; }
.promo span { font-size: 14px; }
.busy { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(255, 243, 197, 0.35); border-top-color: var(--bg); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { background: rgba(204, 0, 0, 0.1); border-radius: 6px; padding: 14px 16px; color: var(--text); }

/* Map */
.page-head { display: flex; flex-direction: column; gap: 4px; }
.page-head h1 { margin: 0; font-size: 32px; }
.page-head p { margin: 0; color: var(--muted); }
.page { padding-top: 24px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.map-cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.mapbox { flex: 999 1 560px; min-width: 0; position: relative; overflow: hidden; height: 72vh; min-height: 460px; max-height: 820px; }
#map { position: absolute; inset: 0; }
.legend { position: absolute; left: 12px; bottom: 30px; padding: 8px 10px; border-radius: 6px; background: var(--surface); border: 1px solid rgba(102, 51, 0, 0.3); display: flex; flex-direction: column; gap: 4px; z-index: 2; }
.legend b { font-size: 12px; }
.legend div { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.legend i { width: 16px; height: 10px; display: inline-block; }
.areacard { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.days div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; }
.days b { font-size: 12px; }
.days span.sw { width: 100%; height: 30px; border-radius: 6px; }
.facts { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; }
.maplibregl-ctrl-attrib { font-size: 11px; }

/* Atlas */
.search { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 14px; border-radius: 6px; background: var(--surface); border: 1px solid rgba(102, 51, 0, 0.4); max-width: 640px; color: var(--primary); }
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); outline: none; }
.search:focus-within { outline: 2px solid var(--primary); outline-offset: 1px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.sp { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); }
.sp:hover { color: var(--text); border-color: var(--primary); }
.sp .pic { position: relative; }
.sp img, .sp .ph { width: 100%; aspect-ratio: 1.25; object-fit: cover; display: block; }
.sp .nm { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 1px; }
.sp .nm b { font-size: 16px; }
.sp .nm i { font-size: 14px; color: var(--muted); }

/* Species page */
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { font-weight: 700; text-decoration: none; }
.sp-top { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.sp-photos { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sp-photos .big { position: relative; }
.sp-photos .big img, .sp-photos .big .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; }
.any-ph { aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.credit { margin: 6px 0 8px; font-size: 12px; color: var(--muted); }
.credit a { color: inherit; }
.sp-thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sp-thumbs button { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 6px; overflow: hidden; aspect-ratio: 1; }
.sp-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-thumbs button[aria-current="true"] { outline: 3px solid var(--primary); outline-offset: -3px; }
.sp-info { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.sp-info h1 { margin: 0; font-size: 36px; line-height: 1.15; }
.sp-info .latin { font-size: 18px; }
.months { display: flex; gap: 3px; }
.months span { flex: 1; height: 26px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; border-radius: 3px; background: rgba(102, 51, 0, 0.12); color: var(--muted); }
.months span.on { background: var(--primary); color: var(--bg); }
.months span.now { outline: 2px solid var(--text); outline-offset: 1px; }
.sp-body { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.sp-text { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.sp-text section { padding: 20px; }
.sp-text h2 { margin: 0 0 8px; font-size: 22px; }
.sp-text p { margin: 0 0 8px; }
.sp-text p:last-child { margin-bottom: 0; }
.sp-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.sp-side .card { padding: 16px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.idcta { background: var(--primary); color: var(--bg); border-radius: 12px; padding: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.idcta div { flex: 1 1 200px; display: flex; flex-direction: column; }
.idcta b { font-size: 17px; }
.idcta span { font-size: 14px; }

/* App band */
.appband { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.appband-in { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; padding-top: 36px; padding-bottom: 36px; }
.appicon { border-radius: 12px; }
.appband-text { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.appband-stores { display: flex; flex-wrap: wrap; gap: 10px; }
.appband-text h2 { margin: 0; font-size: 24px; }
.appband-text p { margin: 0; }

@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .top-in { gap: 8px 12px; }
  .top .btn-sm { display: none; }
  .langs { margin-left: auto; }
  .nav { order: 3; width: 100%; }
  .nl { padding: 6px 12px; font-size: 14px; }
  .hero { padding: 20px 16px; gap: 24px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .drop { padding: 22px 12px; }
  .topcard .gallery img, .topcard .gallery .ph { height: 300px; }
  .namerow h2 { font-size: 24px; }
  .page-head h1 { font-size: 26px; }
  .sp-info h1 { font-size: 28px; }
  .mapbox { height: 62vh; }
}

/* Language menu */
.langs { position: relative; }
.langs summary { list-style: none; display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; cursor: pointer; color: var(--bg); font-weight: 700; font-size: 14px; border-radius: 6px; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary:hover { background: rgba(255, 243, 197, 0.12); }
.langs ul { position: absolute; right: 0; top: 44px; z-index: 20; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-width: 160px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15); }
.langs li a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--text); text-decoration: none; }
.langs li a:hover { background: rgba(102, 51, 0, 0.08); }
.langs li a[aria-current="true"] { font-weight: 700; color: var(--primary); }
.flag { width: 22px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); flex-shrink: 0; object-fit: cover; }
.langs li a { display: flex; align-items: center; gap: 10px; }

/* Beta map (/beta/map/) */
.beta-tag { display: inline-block; vertical-align: middle; font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 10px; border-radius: 999px; background: #e0a93b; color: #3d1f00; }

/* Species page: "When does it grow?" season chart (static/assets/season.js) */
.grow { display: flex; flex-direction: column; gap: 10px; }
.sp-text .grow h2 { margin: 0; }
.grow-chart { width: 100%; height: auto; display: block; overflow: visible; }
.grow-chart .grid { stroke: rgba(102, 51, 0, 0.12); stroke-width: 1; }
.grow-chart .axis { stroke: rgba(102, 51, 0, 0.45); stroke-width: 1; }
.grow-chart .area { fill: rgba(111, 168, 58, 0.35); }
.grow-chart .line { fill: none; stroke: #2e7d32; stroke-width: 2.5; stroke-linejoin: round; }
.grow-chart .now { stroke: var(--primary); stroke-width: 1.5; stroke-dasharray: 4 3; }
.grow-chart .nowt { fill: var(--primary); font-size: 11px; font-weight: 700; }
.grow-chart .mon { fill: var(--muted); font-size: 13px; font-weight: 700; }
/* Region line under the chart: quiet text, not buttons ("📍 Czechia ▾ · Use my location") */
.grow-ctl { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: center; font-size: 14px; color: var(--muted); }
.grow-pick { position: relative; display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.grow-pick svg { width: 16px; height: 16px; flex-shrink: 0; }
.grow-pick { min-height: 32px; }
.grow-pick::after { content: "▾"; }
/* the native select lies invisible over the name, so the line is as wide as the chosen region */
.grow-ctl select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font: inherit; }
.grow-pick:hover, .grow-loc:hover { color: var(--primary); }
.grow-pick:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.grow-loc { min-height: 32px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.grow-loc::before { content: "·"; display: inline-block; margin-right: 10px; text-decoration: none; }
.where { display: flex; flex-direction: column; gap: 10px; }
.where[hidden] { display: none; }
.sp-text .where h2 { margin: 0; }
.where img { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid var(--border, rgba(102, 51, 0, 0.25)); }
.where-key { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.where-key i { width: 18px; height: 12px; border-radius: 2px; }
.grow-msg { margin: 0 !important; font-size: 14px; color: var(--warning); }
@media (max-width: 600px) {
  .grow-chart .mon { font-size: 21px; }
  .grow-chart .nowt { font-size: 17px; }
}
.more summary { cursor: pointer; color: var(--primary); font-weight: 700; font-size: 14px; list-style: none; display: inline-flex; align-items: center; min-height: 32px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "▾"; margin-left: 6px; }
.more[open] summary::after { content: "▴"; }
.more .sl, .more[open] .sm { display: none; }
.more[open] .sl { display: inline; }
.more p { margin: 4px 0 0; }

/* Species page v2: edibility panel + photo badge (one colour per level), look-alike photo cards, 7/5 columns */
.lvl-deadly { --lvl: var(--deadly); --on: #fff; }
.lvl-poisonous { --lvl: var(--danger); --on: #fff; }
.lvl-hallucinogenic { --lvl: var(--hallucinogenic); --on: #fff; }
.lvl-inedible { --lvl: #5c5c5c; --on: #fff; }
.lvl-edible { --lvl: var(--success); --on: #fff; }
.lvl-unknown { --lvl: #fff; --on: var(--text); }
.sp-top, .sp-body { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.sp-photos, .sp-text { flex: 7 1 520px; min-width: 0; }
.sp-info, .sp-side { flex: 5 1 360px; min-width: 0; }
.sp-info { gap: 18px; }
.sp-name { display: flex; flex-direction: column; gap: 2px; }
.sp-photos .big img { aspect-ratio: 4 / 3; }
.sp-thumbs.folded button[data-i]:nth-child(n+5) { display: none; }
.sp-thumbs:not(.folded) .thumbs-all { display: none; }
.thumbs-all { position: relative; }
.thumbs-all span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.6); color: #fff; font-weight: 700; font-size: 18px; }
.photo-badge { position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--lvl); color: var(--on); font-weight: 800; font-size: 16px; text-transform: uppercase; letter-spacing: 0.03em; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.edpanel { background: var(--lvl); color: var(--on); border-radius: 12px; padding: 16px 18px; display: flex; gap: 16px; align-items: flex-start; }
.edpanel.lvl-unknown { border: 2px solid #5c5c5c; }
.edpanel > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.edicon { width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lvl-unknown .edicon { background: rgba(0, 0, 0, 0.06); }
.edword { font-size: 28px; line-height: 1.15; font-weight: 800; }
.edwarn { font-size: 16px; }
.edpanel p { margin: 0; font-size: 15px; }
.edpanel .more summary { color: var(--on); text-decoration: underline; }
.lacards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lacard { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: var(--text); }
.lacard:hover { color: var(--text); border-color: var(--primary); }
.lacard.danger { border: 2px solid var(--lvl); }
.laph { position: relative; display: block; }
.laph img, .laph .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: flex; }
.laph .pill { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 6px; border-radius: 999px; background: var(--lvl); color: var(--on); font-size: 13px; font-weight: 700; }
.laph .pill.lvl-unknown { border: 1px solid #5c5c5c; }
.latx { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.latx b { font-size: 15px; line-height: 1.3; }
.latx i { color: var(--muted); }
.sp-side .grow { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sp-side .grow h2 { margin: 0; font-size: 20px; }
.fcard { padding: 14px 16px; }
.fclink { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; text-decoration: none; }
.grow .fclink { padding-top: 10px; border-top: 1px solid var(--border); }
.fclink .scale { display: flex; gap: 3px; width: 80px; flex-shrink: 0; }
.fclink .scale span { height: 8px; flex: 1; border-radius: 2px; }
/* Desktop: two independent columns (photos + texts | name, edibility, look-alikes, season), so a long right side leaves no gap.
   Phone: one column in reading order photos, info, texts, season. */
.sp-grid { display: flex; gap: 28px; align-items: flex-start; }
.sp-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.sp-col:first-child { flex: 7 1 0; }
.sp-col:last-child { flex: 5 1 0; }
.sp-photos, .sp-text, .sp-info, .sp-side { flex: none; }
.sp-text, .sp-side { display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 900px) {
  .sp-grid { flex-direction: column; align-items: stretch; }
  .sp-col { display: contents; }
  .sp-photos { order: 1; } .sp-info { order: 2; } .sp-text { order: 3; } .sp-side { order: 4; }
}
/* Edibility, toned down: tinted panel with a solid icon circle, smaller photo badge */
.lvl-deadly { --ink: #8a0000; } .lvl-poisonous { --ink: #b00000; } .lvl-hallucinogenic { --ink: var(--hallucinogenic); } .lvl-inedible { --ink: #4a4a4a; } .lvl-edible { --ink: #00600a; } .lvl-unknown { --ink: #171717; }
.edpanel { background: color-mix(in srgb, var(--lvl) 12%, var(--surface)); color: var(--text); border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent); padding: 12px 14px; gap: 12px; align-items: center; }
.edpanel.lvl-unknown { border: 1px solid #5c5c5c; background: var(--surface); }
.edpanel.lvl-hallucinogenic { background: #ede5e0; } /* the app's tint */
.edicon { width: 40px; height: 40px; background: var(--ink); color: #fff; }
.lvl-unknown .edicon { background: #5c5c5c; }
.edicon svg { width: 22px; height: 22px; }
.edword { font-size: 20px; font-weight: 700; color: var(--ink); }
.edwarn { font-size: 15px; color: var(--ink); }
.edpanel .more summary { color: var(--primary); text-decoration: none; }
.photo-badge { gap: 6px; padding: 4px 10px 4px 6px; font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.photo-badge svg { width: 14px; height: 14px; }
/* Look-alikes by count: 1 = one wide card (photo left), 2 and 4 = two columns, 3 and 5 = three columns (phones: two) */
.lacards.n1 { grid-template-columns: 1fr; }
.lacards.n1 .lacard { flex-direction: row; }
.lacards.n1 .laph { width: 42%; flex-shrink: 0; }
.lacards.n1 .latx { justify-content: center; padding: 12px 16px; }
.lacards.n3, .lacards.n5 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lacards.n3 .laph img, .lacards.n3 .laph .ph, .lacards.n5 .laph img, .lacards.n5 .laph .ph { aspect-ratio: 1; }
.lacards.n3 .latx, .lacards.n5 .latx { padding: 8px 10px 10px; }
.lacards.n3 .latx b, .lacards.n5 .latx b { font-size: 14px; }
.lacards.n3 .pill, .lacards.n5 .pill { font-size: 12px; left: 6px; bottom: 6px; }
@media (max-width: 600px) { .lacards.n3, .lacards.n5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.laph .ph { background: color-mix(in srgb, var(--lvl) 14%, var(--surface)); color: var(--ink); align-items: center; justify-content: center; }
.lacard.lvl-unknown .laph .ph { background: rgba(102, 51, 0, 0.08); }

/* Species page: fullscreen gallery */
#bigimg { cursor: zoom-in; }
.lb { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.94); align-items: center; justify-content: center; touch-action: pan-y; }
.lb.open { display: flex; }
.lb img { max-width: 100vw; max-height: 100vh; max-height: 100dvh; object-fit: contain; user-select: none; }
.lb button { position: absolute; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; cursor: pointer; }
.lb button:hover, .lb button:focus-visible { background: rgba(255, 255, 255, 0.22); }
.lb-close { top: 12px; right: 12px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-nav.prev { left: 12px; } .lb-nav.prev svg { transform: rotate(180deg); }
.lb-nav.next { right: 12px; }
.lb-count { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); padding: 3px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 14px; font-weight: 700; }
html.lb-lock { overflow: hidden; }

/* Habitat block (as the app: src/containers/Habitat.js; logic static/assets/habitat-core.js) */
.hab { margin: 4px 0 14px; }
.hab-box { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.hab-head { display: block; padding: 10px 14px 8px; font-size: 17px; line-height: 22px; }
.hab-scene { display: flex; align-items: flex-end; gap: 3px; background: #e6ecc0; padding: 12px 14px 8px; }
.hab-scene.wide { padding-left: 20px; padding-right: 20px; }
.hab-col { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.hab-ics { display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.hab-scene.wide .hab-ics { gap: 10px; }
.hab-ic { display: block; flex: none; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.hab-seg { align-self: stretch; height: 8px; border-radius: 4px; }
.hab-lab { display: block; align-self: stretch; margin-top: 4px; min-height: 17px; font-size: 13px; font-weight: 700; line-height: 17px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: clip; color: var(--text); }
button.hab-lab, button.hab-note { background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; color: var(--primary); }
.hab-lab.link { text-decoration: underline; }
.hab-note { display: block; margin: 0 !important; padding: 8px 14px 10px !important; font-size: 13px; line-height: 18px; color: #6b4a2b; text-align: left; width: 100%; }
button.hab-note { color: #6b4a2b; }
button.hab-note:hover { color: var(--primary); }
.hab-more { display: flex; flex-direction: column; gap: 5px; padding: 0 14px 10px; }
.hab-mrow { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 17px; }
.hab-mname { width: 96px; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hab-mtrack { flex: 1; height: 6px; border-radius: 3px; background: rgba(102, 51, 0, 0.2); }
.hab-mfill { display: block; height: 6px; border-radius: 3px; }
.hab-mpct { width: 40px; flex: none; text-align: right; }
.hab-only { background: var(--primary); border-color: var(--primary); }
.hab-words { display: flex; flex-direction: column; gap: 3px; padding: 10px 14px 13px; color: var(--bg); }
.hab-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; line-height: 15px; }
.hab-big { color: #fff; font-size: 22px; line-height: 28px; }
.hab-excl { line-height: 19px; font-size: 15px; }
/* look-alike cards: the look-alike's own habitat when it tells the pair apart */
.hab-line { display: flex; align-items: center; gap: 7px; margin-top: 6px; color: var(--primary); font-weight: 700; font-size: 13px; line-height: 16px; }
.hab-chip { display: inline-flex; align-items: flex-end; gap: 2px; height: 30px; padding: 0 6px 3px; border-radius: 6px; background: #e6ecc0; flex: none; }
.hab-pill { align-self: flex-start; gap: 5px; padding: 4px 10px 4px 7px; border-radius: 15px; background: var(--primary); color: var(--bg); }
