/* ===========================================================================
   NEON Ground Beetle Tracker — styles.css
   Desert Data Labs DESERT-NIGHT house style. The app DEFAULTS to LIGHT
   ("desert-day"), but the prominent info boxes (hero command band, stat
   value-boxes) wear the dark desert-night scheme in BOTH modes — the
   "light page, dark hero" look (see the premium block at the bottom).
   Var names kept for low churn; --forest is the primary (teal), --cardinal
   the accent (coral). Mirrors the NEON Small Mammal Tracker.
   =========================================================================== */
:root {                                   /* light "desert-day" (DEFAULT) — Carabid Iridescence */
  --navy: #16261c; --forest: #1f8a5a; --forest2: #3f9a52; --green: #3f9a52;
  --cardinal: #c47a2c; --gold: #c79a1c; --gold-ink: #8a6a10; --sky: #2f93a0;
  --ink: #16261c; --muted: #5a6a5e;
  --bg: #eef4ef; --paper: #ffffff; --line: #d3e2d6;
  --shadow: rgba(31, 138, 90, 0.10);
}
body {
  background:
    radial-gradient(1100px 520px at 8% -8%, rgba(31,138,90,0.05), transparent 60%),
    radial-gradient(900px 460px at 102% 2%, rgba(196,122,44,0.04), transparent 55%),
    linear-gradient(180deg, #eef4ef 0%, #e6efe8 100%);
  background-attachment: fixed;
  color: var(--ink);
}

/* ---- sidebar / control deck ---- */
.control-deck { background: var(--bg); border-right: 1px solid var(--line); }
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.brand-mark { font-size: 30px; line-height: 1; }
.brand-title { font-weight: 800; font-size: 17px; color: var(--forest); }
.brand-sub { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }
.demo-hint { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.deck-hr { border-color: var(--line); margin: 16px 0; }
.deck-foot { font-size: 11px; color: var(--muted); line-height: 1.7; }
.deck-foot code { color: var(--forest); background: var(--bg); padding: 1px 5px; border-radius: 5px; }
.deck-foot a { color: var(--muted); text-decoration: none; }
.deck-foot a:hover { color: var(--forest); }
.site-bio { display: flex; gap: 8px; align-items: flex-start; background: var(--bg); border: 1px solid var(--line);
  border-left: 3px solid var(--forest); border-radius: 8px; padding: 8px 10px; margin: -4px 0 12px;
  font-size: 12px; color: #3a4654; line-height: 1.45; }
.site-bio .bi { color: var(--forest); margin-top: 2px; flex: none; }

.env-source { display: flex; gap: 7px; align-items: flex-start; font-size: 11px; line-height: 1.4;
  border-radius: 8px; padding: 7px 9px; margin-top: 8px; }
.env-source .bi { margin-top: 1px; flex: none; }
.env-source code { background: rgba(0,0,0,.06); padding: 0 4px; border-radius: 4px; }
.env-demo { background: #fff8e6; border: 1px solid #f3e0a6; color: #6b5a13; }
.env-demo .bi { color: var(--gold); }
.env-real { background: #eef6f0; border: 1px solid #cfe6d6; color: #245c39; }
.env-real .bi { color: var(--green); }

/* ---- hero ---- */
.app-hero { padding: 22px 4px 6px; }
.app-title { font-weight: 800; color: var(--forest); font-size: 30px; margin: 0; }
.title-tag { font-size: 12px; background: var(--gold); color: #3a2f00; border-radius: 6px;
  padding: 2px 7px; margin-left: 8px; vertical-align: middle; font-weight: 700; }
.app-subtitle { color: var(--muted); max-width: 760px; margin-top: 6px; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 18px; }
.hero-stat { background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--forest);
  border-radius: 10px; padding: 12px 16px; min-width: 120px; flex: 1; }
.hs-v { font-size: 24px; font-weight: 800; color: var(--navy); }
.hs-l { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }

/* ---- splash ---- */
.splash { text-align: center; padding: 50px 20px; color: var(--muted); }
.splash-icon { font-size: 54px; }
.splash h3 { color: var(--forest); margin-top: 8px; }
.splash-sub { font-size: 13px; }
/* national picker map on the splash (the flagship front door) */
.splash-picker { margin: 6px 0 18px; }
.splash-map-hint { display: flex; gap: 8px; align-items: center; justify-content: center;
  font-size: 13.5px; color: var(--muted); margin: 0 0 10px; }
.splash-map-hint > .bi { color: var(--forest); }
.map-picker-wrap { width: 100%; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 16px rgba(19,99,43,.10); }
.map-picker-wrap .leaflet-container { background: var(--paper); }

/* picker map legend — size = richness, colour = catch (matches the leaflet dots) */
.picker-legend { display: flex; gap: 26px; flex-wrap: wrap; justify-content: center;
  margin: 10px 0 2px; font-size: 12px; color: var(--muted); }
.picker-legend .pl-h { font-weight: 600; color: var(--ink); margin-bottom: 4px; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .03em; }
.pl-size { display: flex; align-items: center; gap: 7px; }
.pl-dot { display: inline-block; border-radius: 50%; background: #2f9e55;
  border: 1.4px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.pl-d1 { width: 8px; height: 8px; } .pl-d2 { width: 13px; height: 13px; } .pl-d3 { width: 19px; height: 19px; }
.pl-lab { margin-left: 6px; }
.pl-ramp { width: 150px; height: 11px; border-radius: 6px;
  background: linear-gradient(90deg, #d6f3e4, #36d98a, #1f8a5a); }
.pl-ramp-labs { display: flex; justify-content: space-between; margin-top: 3px; }

/* ---- "Browse all 46 sites" — closed-by-default text fallback to the map ---- */
.picker-list { margin: 14px auto 0; max-width: 920px; text-align: left; }
/* kill the native disclosure triangle so our chevron is the only marker */
.picker-list > summary { list-style: none; }
.picker-list > summary::-webkit-details-marker { display: none; }
/* the summary, styled as a centered pill/button */
.picker-list-summary {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: max-content; min-height: 40px; margin: 0 auto;
  padding: 8px 18px; cursor: pointer; user-select: none;
  font-weight: 700; font-size: 13.5px; color: var(--forest);
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  transition: color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.picker-list-summary:hover {
  color: var(--forest2); border-color: var(--forest);
  box-shadow: 0 6px 18px -10px var(--shadow); }
.picker-list > summary:focus-visible { outline: none; }
.picker-list > summary:focus-visible .picker-list-summary {
  border-color: var(--forest); box-shadow: 0 0 0 3px var(--shadow); }
.pls-label { display: inline-flex; align-items: center; gap: 7px; }
.pls-chevron { display: inline-flex; transition: transform .2s ease; color: var(--forest); opacity: .85; }
.picker-list[open] .pls-chevron { transform: rotate(180deg); }
/* the expanded body: scrolls rather than pushing the page */
.picker-list-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 18px;
  margin-top: 12px; padding: 10px 12px;
  max-height: 340px; overflow-y: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.picker-list-link { display: block; padding: 6px 9px; border-radius: 8px; color: var(--ink); font-size: 13px; text-decoration: none; }
.picker-list-link:hover { background: var(--bg); color: var(--forest); }
.picker-list-link b { color: var(--forest); }
.pll-meta { color: var(--muted); font-size: 11.5px; }
@media (max-width: 900px) { .picker-list-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .picker-list-grid { grid-template-columns: 1fr; } }

/* ---- leaflet hover tooltip card ---- */
.pm-pop { min-width: 190px; }
.pm-pop-t { font-weight: 800; color: var(--ink); font-size: 13.5px; }
.pm-pop-s { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.pm-pop-n { font-size: 12px; color: var(--ink); margin-top: 5px; }
.pm-pop-sp { font-size: 12px; color: var(--forest); margin-top: 2px; }
.pm-pop-hint { font-size: 11px; font-weight: 700; color: var(--sky); margin-top: 6px;
  text-transform: uppercase; letter-spacing: .4px; }

/* ---- site-choice popup (tap a dot -> Explore | About) ----------------- */
.pm-pop-card .leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 12px 36px rgba(19,99,43,.24); }
.pm-pop-card .leaflet-popup-content { margin: 12px 14px; }
.site-pop { min-width: 210px; }
.site-pop .sp-code { color: var(--muted); font-weight: 700; }
.site-pop .sp-years { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.sp-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 11px; }
.sp-btn { display: block; width: 100%; min-height: 44px; border-radius: 10px; font-weight: 700;
  font-size: 13.5px; cursor: pointer; border: 1.5px solid transparent; padding: 8px 12px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.sp-btn:hover { transform: translateY(-1px); }
.sp-go { background: var(--forest); color: #fff; box-shadow: 0 6px 16px -8px var(--forest); }
.sp-go:hover { background: var(--forest2); color: #fff; }
.sp-info { background: #fff; color: var(--forest); border-color: var(--line); }
.sp-info:hover { background: var(--bg); border-color: var(--forest); }

/* ---- Search the network ---------------------------------------------- */
.search-modeswitch { margin: 2px 2px 12px; }
.search-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-bottom: 6px; }
.search-controls .form-group { margin-bottom: 0; }
.search-count { font-size: 14px; color: var(--ink); margin: 6px 2px 12px; }
.search-empty { font-size: 14px; color: var(--muted); background: var(--bg);
  border: 1px dashed var(--line); border-radius: 10px; padding: 16px 18px; margin: 6px 2px 12px; }
.search-caption { font-size: 12px; color: var(--muted); margin: 12px 2px 2px; max-width: 760px; }
.intro-inline, .search-count .intro-inline { color: var(--cardinal); font-weight: 700; }
/* compact, inline Go button for DT result rows (override the full-width .sp-btn) */
.search-go { display: inline-block; width: auto; min-height: 0; padding: 5px 12px;
  font-size: 12.5px; white-space: nowrap; }

/* ---- "About this site" modal (instant, from SITE_INDEX) --------------- */
.site-info .si-sec { padding: 10px 0; border-top: 1px solid var(--line); }
.site-info .si-sec:first-child { border-top: 0; padding-top: 2px; }
.si-h { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted); margin-bottom: 5px; }
.si-row { font-size: 14px; color: var(--ink); }
.si-bio { color: var(--green); font-weight: 600; margin-top: 2px; }
.si-coords { font-size: 12px; color: var(--muted); margin-top: 3px; }
.si-code { color: var(--muted); font-weight: 700; }
.si-stats { display: flex; gap: 10px; margin: 4px 0 8px; }
.si-stat { flex: 1; background: var(--bg); border-radius: 10px; padding: 9px 8px; text-align: center; }
.si-stat-n { font-weight: 800; font-size: 18px; color: var(--forest); }
.si-stat-l { font-size: 11px; color: var(--muted); }
.si-star i { color: var(--forest); }

/* ---- cards / tabs ---- */
.section-title { color: var(--forest); margin: 22px 0 12px; }
.with-info .ch-title { font-weight: 700; }
.info-dot { color: var(--muted); cursor: pointer; margin-left: 6px; }
.tab-intro { background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; color: #3a4654; margin-bottom: 14px; }
.tab-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px; padding: 6px 2px 10px; }
.tab-head-text h4 { color: var(--forest); margin: 0; }
.tab-head-text p { color: var(--muted); font-size: 13px; margin: 4px 0 12px; max-width: 640px; }
.map-controls { display: flex; gap: 10px; align-items: flex-end; }

/* data-quality (taxon resolution) note */
.qa-note { display: flex; gap: 9px; align-items: flex-start; border-radius: 10px;
  padding: 11px 14px; margin: 0 0 14px; font-size: 13px; line-height: 1.5; border: 1px solid; }
.qa-note .bi { margin-top: 2px; flex: none; font-size: 16px; }
.qa-clean { background: #eef6f0; border-color: #cfe6d6; color: #21503a; }
.qa-clean .bi { color: var(--forest); }
.qa-flag { background: #f7f3e6; border-color: #ece0bd; color: #5f5320; }
.qa-flag .bi { color: #b07d00; }
.qa-cite { color: var(--muted); font-style: italic; }

/* inter-annual trend verdict banner */
.trend-verdict { display: flex; gap: 9px; align-items: flex-start; border-radius: 10px;
  padding: 11px 14px; margin: 0 0 14px; font-size: 14px; line-height: 1.5; border: 1px solid; }
.trend-verdict .bi { margin-top: 2px; flex: none; font-size: 18px; }
.trend-up   { background: #eef6f0; border-color: #cfe6d6; color: #21503a; }
.trend-up .bi   { color: var(--forest); }
.trend-down { background: #fbeef0; border-color: #f0cdd4; color: #7a1020; }
.trend-down .bi { color: #b3122b; }
.trend-flat { background: #f7f3e6; border-color: #ece0bd; color: #6a5a1f; }
.trend-flat .bi { color: var(--gold); }
.season-toggle { margin-bottom: 4px; }
.hill-note { font-size: 13px; color: #3a4654; margin-top: 8px; }

/* ---- meet the beetles ---- */
.meet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.meet-card { display: flex; gap: 10px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; }
.meet-ico { font-size: 26px; flex: none; }
.meet-body { min-width: 0; }   /* let long binomials wrap instead of overflowing the flex card */
.meet-name { font-weight: 700; font-style: italic; color: var(--navy); overflow-wrap: anywhere; }
.meet-stat { font-size: 11px; color: var(--muted); margin: 2px 0 4px; }
.meet-blurb { font-size: 12.5px; color: #3a4654; line-height: 1.4; }

/* ---- introduced (non-native) species marker — small clickable pill ---- */
.intro-badge { display: inline-flex; align-items: center; gap: 3px; cursor: pointer;
  margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px;
  font-weight: 600; font-style: normal; white-space: nowrap; vertical-align: middle;
  background: #f7f3e6; border: 1px solid #ece0bd; color: #6b5320; }
.intro-badge .bi { font-size: 11px; color: #b07d00; }
[data-bs-theme="dark"] .intro-badge { background: rgba(255,210,74,.14);
  border-color: rgba(255,210,74,.32); color: #ffd24a; }
[data-bs-theme="dark"] .intro-badge .bi { color: #ffd24a; }

/* ---- about ---- */
.about { max-width: 820px; }
.about h3 { color: var(--forest); }
.about h4 { color: var(--navy); margin-top: 18px; }
.about-note { background: #fff8e6; border: 1px solid #f3e0a6; color: #6b5a13;
  border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-top: 14px; }
.about-note .bi { color: var(--gold); }

/* ---- footer ---- */
.ddl-footer { margin-top: 30px; padding: 20px 4px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; }
.ddl-footer a { color: var(--forest); }

/* ---- mobile / small screens (field use on a phone) ---- */
@media (max-width: 768px) {
  .app-hero { padding: 14px 2px 4px; }
  .app-title { font-size: 23px; line-height: 1.15; }
  .app-subtitle { font-size: 14px; }
  /* hero stats: a 2-up grid instead of a 5-wide ribbon that collapses to slivers */
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero-stat { min-width: 0; padding: 10px 12px; }
  .hs-v { font-size: 21px; }
  /* one card / chart per row */
  .meet-grid { grid-template-columns: 1fr; }
  /* the map height is set inline (540px) — shrink it for thumbs */
  #map, .leaflet-container { height: 360px !important; }
  /* tables scroll instead of crushing 7 columns into one char each */
  .dataTables_wrapper, .dataTables_scroll { overflow-x: auto; }
  /* the species range picker is fixed at 280px — let it fill the width */
  .map-controls, .map-controls .shiny-input-container,
  .map-controls .selectize-control { width: 100% !important; }
  .tab-head { gap: 8px; }
}

/* per-tab verdict banner — neutral info variant (reuses .trend-verdict base) */
.trend-info { background: #eef4f9; border-color: #cfe0ee; color: #1f4a6b; }
.trend-info .bi { color: var(--sky); }

/* compare-site control */
.compare-pick { margin-top: 2px; }

/* first-visit welcome modal */
.welcome { text-align: center; padding: 6px 6px 2px; }
.welcome-bug { font-size: 46px; line-height: 1; }
.welcome h3 { color: var(--forest); margin: 8px 0 10px; }
.welcome p { color: #36493c; max-width: 46ch; margin: 0 auto 14px; }
.welcome-list { text-align: left; display: inline-block; color: #36493c; margin: 0 0 18px; line-height: 1.7; }
.welcome-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* boot / cold-start overlay — visible immediately, hidden by JS once Shiny is idle */
.boot-overlay { position: fixed; inset: 0; z-index: 99999; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; background: var(--bg);
  transition: opacity .5s ease; }
.boot-overlay.is-hidden { opacity: 0; pointer-events: none; }
.boot-overlay .boot-bug { font-size: 60px; animation: bootpulse 1.1s ease-in-out infinite; }
.boot-overlay .boot-msg { color: var(--forest); font-weight: 700; font-size: 18px; }
.boot-overlay .boot-sub { color: var(--muted); font-size: 13px; margin-top: -4px; }
@keyframes bootpulse { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.16); opacity: 1; } }

/* ===========================================================================
   DARK MODE — bslib flips data-bs-theme="dark" via the top-bar toggle. We
   redefine the house-style CSS vars (so every var()-based rule adapts) and
   override the rules that hardcode light hexes (banners, badges, notes).
   =========================================================================== */
[data-bs-theme="dark"] {                  /* CARABID-NIGHT — iridescent green/copper/gold on dark sky */
  --navy: #b6e6cd; --forest: #36d98a; --forest2: #6ef0b0; --green: #6ef0b0;
  --cardinal: #d98a3c; --gold: #ffd24a; --gold-ink: #ffd24a; --sky: #2f93a0;
  --ink: #e9f6ee; --muted: #9fc0ad;
  --bg: #07100b; --paper: #12241a; --line: rgba(255,255,255,0.12);
  --shadow: rgba(0,0,0,0.5);
}
[data-bs-theme="dark"] body {
  background:
    radial-gradient(1100px 520px at 8% -8%, rgba(54,217,138,0.12), transparent 60%),
    radial-gradient(900px 460px at 102% 2%, rgba(217,138,60,0.10), transparent 55%),
    radial-gradient(900px 600px at 50% 120%, rgba(255,210,74,0.06), transparent 60%),
    linear-gradient(180deg, #07100b 0%, #050a07 100%);
  color: var(--ink);
}
[data-bs-theme="dark"] .control-deck { background: #0c1810; border-right-color: var(--line); }
[data-bs-theme="dark"] .deck-foot code { background: rgba(54,217,138,0.16); color: var(--forest); }
[data-bs-theme="dark"] .site-bio { background: rgba(54,217,138,0.08); color: #cfe6da; }
[data-bs-theme="dark"] .tab-intro { background: rgba(54,217,138,0.08); color: #cfe6da; }
[data-bs-theme="dark"] .hill-note,
[data-bs-theme="dark"] .meet-blurb,
[data-bs-theme="dark"] .tab-head-text p { color: #b8c7dd; }
[data-bs-theme="dark"] .title-tag { background: var(--gold); color: #2a2200; }
/* colored verdict / QA / source / about banners — dark tints, light text */
[data-bs-theme="dark"] .trend-up, [data-bs-theme="dark"] .qa-clean, [data-bs-theme="dark"] .env-real {
  background: rgba(95,181,106,0.14); border-color: rgba(95,181,106,0.32); color: #a9e3bf; }
[data-bs-theme="dark"] .trend-up .bi, [data-bs-theme="dark"] .qa-clean .bi, [data-bs-theme="dark"] .env-real .bi { color: var(--green); }
[data-bs-theme="dark"] .trend-down {
  background: rgba(251,138,126,0.14); border-color: rgba(251,138,126,0.34); color: #ff9aa6; }
[data-bs-theme="dark"] .trend-down .bi { color: #ff7a8a; }
[data-bs-theme="dark"] .trend-flat, [data-bs-theme="dark"] .qa-flag,
[data-bs-theme="dark"] .env-demo, [data-bs-theme="dark"] .about-note {
  background: rgba(255,210,74,0.13); border-color: rgba(255,210,74,0.32); color: #ffd24a; }
[data-bs-theme="dark"] .trend-flat .bi, [data-bs-theme="dark"] .qa-flag .bi,
[data-bs-theme="dark"] .env-demo .bi, [data-bs-theme="dark"] .about-note .bi { color: var(--gold); }
[data-bs-theme="dark"] .trend-info {
  background: rgba(67,184,232,0.13); border-color: rgba(67,184,232,0.32); color: #aed0ee; }
[data-bs-theme="dark"] .trend-info .bi { color: var(--sky); }
[data-bs-theme="dark"] .welcome p, [data-bs-theme="dark"] .welcome-list { color: #c7d6e8; }
/* keep the boot overlay on the dark bg so first paint matches the theme */
[data-bs-theme="dark"] .boot-overlay { background: var(--bg); }

/* ---- environmental-overlay picker bar (Seasonality tab) ---- */
.env-pop-bar { border: 1px solid var(--line); border-left: 4px solid var(--forest); border-radius: 12px;
  padding: 12px 16px; margin: 0 0 14px; background: linear-gradient(180deg, var(--bg) 0%, var(--paper) 100%); }
.env-pop-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.env-pop-sel { flex: 2 1 320px; min-width: 220px; }
.env-pop-lag { flex: 1 1 220px; min-width: 190px; }
.env-pop-bar .form-group, .env-pop-bar .shiny-input-container { margin-bottom: 0; }
.env-lag-hint { font-size: 10.5px; color: var(--muted); line-height: 1.35; margin: -6px 0 4px; }
@media (max-width: 560px) { .env-pop-row { gap: 6px; } }
[data-bs-theme="dark"] .env-pop-bar { background: linear-gradient(180deg, #12241a 0%, var(--paper) 100%); }

/* ---- demoted "best-of-52" dredge block + its honest framing (BE4) ---- */
.env-dredge { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line);
  transition: opacity .25s ease, filter .25s ease; }
.env-dredge-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.env-dredge-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.env-dredge-eyebrow .bi { font-size: 12px; }
.env-dredge-sub { font-size: 11.5px; line-height: 1.4; color: var(--muted); margin: 0 0 8px;
  display: flex; align-items: flex-start; gap: 6px; }
.env-dredge-sub .bi { margin-top: 1px; flex: 0 0 auto; }
.env-dredge-sub-muted { color: #9a6b12; }
[data-bs-theme="dark"] .env-dredge-sub-muted { color: #d9b455; }
/* not-significant -> mute the whole block so a big grey r can't read as a result */
.env-dredge-muted { opacity: .52; filter: grayscale(.55); }
.env-dredge-muted:hover, .env-dredge-muted:focus-within { opacity: 1; filter: none; }

/* ---- collapsed advanced overlay control ---- */
.env-overlay-details { margin: 0 0 14px; }
.env-overlay-details > summary { cursor: pointer; list-style: none; user-select: none;
  font-size: 12px; font-weight: 700; color: var(--muted); padding: 7px 4px;
  display: inline-flex; align-items: center; gap: 6px; }
.env-overlay-details > summary::-webkit-details-marker { display: none; }
.env-overlay-details > summary:hover { color: var(--forest); }
.env-overlay-details > summary .bi { font-size: 13px; }
.env-overlay-details[open] > summary { margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) {
  .env-dredge { transition: none; }
}

/* ---- env-tracking "answer" banner (.ec) — same design as the mammal app ---- */
@keyframes ecReveal { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.ec { position: relative; margin: 0 0 14px; padding: 12px 16px 11px 18px;
  border: 1px solid var(--line); border-left: 4px solid var(--ec-rail, var(--muted));
  border-radius: 9px; background: linear-gradient(180deg, var(--bg) 0%, var(--paper) 100%);
  box-shadow: 0 1px 2px rgba(19, 99, 43, .05); animation: ecReveal .3s ease; }
.ec.rail-strong { --ec-rail: #3f9a52; }
.ec.rail-mod    { --ec-rail: #d6a31c; }
.ec.rail-weak   { --ec-rail: var(--muted); }
.ec-eyebrow { display: flex; align-items: center; gap: 6px; margin-bottom: 7px;
  font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.ec-eyebrow .bi { font-size: 12px; color: var(--ec-rail); }
.ec-demo { margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: #9a6b12; background: rgba(201, 163, 0, .12); border: 1px solid rgba(201, 163, 0, .32);
  border-radius: 20px; padding: 1px 8px; }
.ec-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ec-hero-text { flex: 1 1 auto; min-width: 0; font-size: 15px; line-height: 1.35; font-weight: 500; color: var(--ink); }
.ec-strength { font-weight: 800; color: var(--ec-rail); }
.ec.rail-weak .ec-strength { color: var(--ink); }
.ec-driver { font-weight: 800; color: var(--ink);
  border-bottom: 2px solid var(--ec-driver-hue, var(--ec-rail)); padding-bottom: 1px; }
.ec-rvalue { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 25px; font-weight: 700; line-height: 1; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.ec-rvalue .bi { font-size: 18px; }
.ec-rvalue.ec-sgn-pos { color: #3f9a52; }
.ec-rvalue.ec-sgn-neg { color: var(--cardinal); }
.ec-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.ec-meta { display: inline-flex; align-items: center; gap: 4px; line-height: 1.4; }
.ec-meta .bi { font-size: 12px; opacity: .85; }
.ec-meta b { color: var(--ink); font-weight: 800; }
.ec-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .4; }
.ec-dir { margin-left: auto; }
.ec-dir.ec-sgn-pos b { color: #3f9a52; }
.ec-dir.ec-sgn-neg b { color: var(--cardinal); }

/* Seasonal-climate (the cascade read) card — sits under the env ranking, reuses .ec chrome */
.ec-seasonal-note { margin-top: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.ec-seasonal-note b { color: var(--ink); font-weight: 800; }
.ec-seasonal-caveat { margin-top: 7px; font-size: 11.5px; color: var(--muted); line-height: 1.5; opacity: .92; }
.ec-seasonal-caveat .bi { font-size: 12px; margin-right: 3px; opacity: .85; }
.ec-seasonal-note a, .ec-seasonal-caveat a { color: var(--ec-rail); font-weight: 700; text-decoration: underline; }

[data-bs-theme="dark"] .ec { background: linear-gradient(180deg, #12241a 0%, var(--paper) 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
[data-bs-theme="dark"] .ec.rail-strong { --ec-rail: #6ef0b0; }
[data-bs-theme="dark"] .ec.rail-mod    { --ec-rail: #e8c552; }
[data-bs-theme="dark"] .ec-rvalue.ec-sgn-pos, [data-bs-theme="dark"] .ec-dir.ec-sgn-pos b { color: #6ef0b0; }
[data-bs-theme="dark"] .ec-rvalue.ec-sgn-neg, [data-bs-theme="dark"] .ec-dir.ec-sgn-neg b { color: #ff7a8a; }
[data-bs-theme="dark"] .ec-demo { color: #e8c552; background: rgba(232, 197, 82, .12); border-color: rgba(232, 197, 82, .32); }
@media (max-width: 560px) {
  .ec-hero { flex-direction: column; align-items: flex-start; gap: 5px; }
  .ec-hero-text { font-size: 14px; } .ec-rvalue { font-size: 28px; } .ec-dir { margin-left: 0; flex-basis: 100%; }
}

/* ---- DataTables dark-mode overrides ----
   DT renders its own chrome that doesn't pick up bslib dark vars; these
   force key surfaces to match the dark theme so the table isn't blindingly
   white on a dark page.                                                     */
[data-bs-theme="dark"] table.dataTable,
[data-bs-theme="dark"] table.dataTable thead th,
[data-bs-theme="dark"] table.dataTable tbody td {
  background-color: var(--paper) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
[data-bs-theme="dark"] table.dataTable tbody tr.odd td { background-color: rgba(54,217,138,0.04) !important; }
[data-bs-theme="dark"] table.dataTable tbody tr:hover td { background-color: rgba(54,217,138,0.12) !important; }
[data-bs-theme="dark"] .dataTables_wrapper,
[data-bs-theme="dark"] .dataTables_info,
[data-bs-theme="dark"] .dataTables_length,
[data-bs-theme="dark"] .dataTables_filter { color: var(--muted) !important; }
[data-bs-theme="dark"] .dataTables_wrapper input,
[data-bs-theme="dark"] .dataTables_wrapper select {
  background: var(--paper); color: var(--ink); border-color: var(--line); }
[data-bs-theme="dark"] .paginate_button { color: var(--muted) !important; }
[data-bs-theme="dark"] .paginate_button:hover {
  background: rgba(54,217,138,0.16) !important; color: var(--ink) !important; border-color: transparent !important; }
[data-bs-theme="dark"] .paginate_button.current,
[data-bs-theme="dark"] .paginate_button.current:hover {
  background: var(--forest) !important; color: #fff !important; border-color: transparent !important; }

/* ====================================================================== *
 *  QC review flags — clickable "verify, not wrong" cards + inspector.     *
 *  Standard suite classes (.qc-flag-<level>), beetle-themed surfaces.     *
 * ====================================================================== */
.qc-review { margin-top: 4px; }
.qc-section-h { font-weight: 800; font-size: 12.5px; color: var(--forest);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.qcf-sub { font-weight: 500; font-size: 12px; color: var(--muted); text-transform: none; letter-spacing: 0; }
.qc-flags { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 2px; }
.qc-flag { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  border-left: 4px solid var(--line); border-radius: 10px; background: var(--bg); }
.qc-flag > .bi { flex: 0 0 auto; margin-top: 2px; font-size: 15px; }
.qc-flag-high { border-left-color: #d94f7a; background: #fdecf1; color: #7a1d3a; }
.qc-flag-warn { border-left-color: var(--gold); background: #fff6e0; color: #6b5300; }
.qc-flag-info { border-left-color: var(--sky); background: #eef5f6; color: #1d4a51; }
.qc-flag-ok   { border-left-color: var(--green); background: #e8f5ec; color: #1a5e2e; }
.qc-flag-click { cursor: pointer; transition: transform .1s ease, box-shadow .1s ease; }
.qc-flag-click:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(19,99,43,.12); }
.qc-flag-click:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.qcf-body { flex: 1 1 auto; min-width: 0; }
.qcf-title { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.qcf-n { font-size: 11px; font-weight: 800; color: #fff; background: rgba(0,0,0,.45);
  border-radius: 999px; padding: 1px 8px; }
.qcf-detail { font-size: 12px; line-height: 1.42; margin-top: 3px; opacity: .94; }
.qcf-go { flex: 0 0 auto; opacity: .5; align-self: center; }
.qcf-hint { font-size: 11.5px; color: var(--muted); margin: 8px 2px 0;
  display: flex; align-items: center; gap: 5px; }
.qc-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 2px; align-items: center; }
.qc-inspector { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--paper); padding: 12px 14px; }
.qci-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 8px; flex-wrap: wrap; }
.qci-dl { margin-left: auto; }
.qc-cap-scroll { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.qc-cap-note { font-size: 12px; color: var(--muted); margin-top: 6px; }
.inspect-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.inspect-tbl th { text-align: left; color: var(--muted); font-weight: 700; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .3px; padding: 6px 9px; position: sticky; top: 0; background: var(--paper); }
.inspect-tbl td { padding: 5px 9px; border-top: 1px solid var(--line); white-space: nowrap; }
.inspect-tbl tbody tr:hover { background: rgba(31,138,90,.05); }
[data-bs-theme="dark"] .qc-flag { background: var(--paper); }
[data-bs-theme="dark"] .qc-flag-high { background: #3a1626; color: #f3acc4; }
[data-bs-theme="dark"] .qc-flag-warn { background: #352c12; color: #ecd28a; }
[data-bs-theme="dark"] .qc-flag-info { background: #16302f; color: #9fd5cf; }
[data-bs-theme="dark"] .qc-flag-ok   { background: #1d3216; color: #b8e89a; }
[data-bs-theme="dark"] .qc-inspector { background: rgba(255,255,255,0.03); }
[data-bs-theme="dark"] .inspect-tbl th { background: #12241a; }

/* in-app sibling links — "Part of the NEON suite" */
.suite-block { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.suite-h { display: flex; align-items: center; gap: 8px; color: var(--forest); font-weight: 800; }
.suite-lead { font-size: 13px; color: var(--muted); margin: 2px 0 12px; max-width: 640px; }
.suite-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.suite-card { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  text-decoration: none; color: var(--ink); transition: transform .1s ease, box-shadow .1s ease, border-color .1s ease; }
.suite-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(19,99,43,.12);
  border-color: var(--forest); }
.suite-emoji { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.suite-name { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.suite-name .bi { font-size: 11px; opacity: .55; }
.suite-blurb { font-size: 12px; color: var(--muted); line-height: 1.38; margin-top: 2px; }
.ref-list li { font-size: 12.5px; }
[data-bs-theme="dark"] .suite-card { background: var(--paper); }

/* ====================================================================== *
 *  PREMIUM DESERT-NIGHT layer — command-band hero, starfield, sheen, and  *
 *  DARK "info-box" stat surfaces on the LIGHT page (the cascade look).    *
 *  Every animation is prefers-reduced-motion gated at the bottom.        *
 * ====================================================================== */
@keyframes gbtStars { to { background-position: 0 220px, 0 220px, 0 220px, 0 220px; } }
@keyframes gbtSheen { 0% { left:-65%; opacity:0; } 12% { opacity:.85; } 100% { left:135%; opacity:0; } }
@keyframes gbtFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* the hero becomes a dark navy/teal COMMAND BAND with a drifting starfield + nebula,
   in BOTH light and dark modes (the "light page, dark hero" look) */
.app-hero {
  position: relative; overflow: hidden;
  padding: 24px 26px 22px; margin: 6px 0 6px; border-radius: 16px;
  background: radial-gradient(125% 150% at 16% -12%, #133a26 0%, #0c1810 46%, #07100b 100%) !important;
  box-shadow: 0 18px 46px rgba(3,8,20,.45), inset 0 0 0 1px rgba(54,217,138,.20);
}
.app-hero > * { position: relative; z-index: 1; }
.app-hero::before {           /* drifting starfield */
  content:""; position:absolute; inset:0; z-index:0; pointer-events:none; opacity:.55;
  background-repeat: repeat; background-size: 210px 220px,210px 220px,210px 220px,210px 220px;
  background-image:
    radial-gradient(1.4px 1.4px at 30px 40px, rgba(255,255,255,.6), transparent),
    radial-gradient(1.2px 1.2px at 150px 90px, rgba(150,255,210,.5), transparent),
    radial-gradient(1.5px 1.5px at 90px 175px, rgba(217,138,60,.4), transparent),
    radial-gradient(1.1px 1.1px at 175px 28px, rgba(110,240,176,.5), transparent);
  animation: gbtStars 120s linear infinite;
}
.app-hero::after {            /* green/copper/gold nebula */
  content:""; position:absolute; inset:0; z-index:0; pointer-events:none; opacity:.6;
  background:
    radial-gradient(48px 48px at 10% 26%, rgba(54,217,138,.18), transparent 70%),
    radial-gradient(66px 66px at 86% 16%, rgba(217,138,60,.14), transparent 70%),
    radial-gradient(54px 54px at 64% 94%, rgba(255,210,74,.12), transparent 70%);
}
.app-hero .app-title { color: #ffd24a !important; }
.app-hero .app-subtitle { color: #cfe6da !important; }
.app-hero .title-tag { background: rgba(255,210,74,.16); color: #ffd24a;
  border: 1px solid rgba(255,210,74,.5); }

/* effect #6 — floating brand mark (gated below) */
.brand-mark { display: inline-block; animation: gbtFloat 6s ease-in-out infinite; }

/* effect #7 — DARK twilight-glass site band in BOTH modes (light page, dark band) */
.site-bio {
  background: linear-gradient(180deg, #12241a 0%, #07100b 100%) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-left: none !important; border-top: 3px solid var(--forest) !important;
  color: #e9f6ee !important; box-shadow: 0 10px 26px -12px rgba(3,8,20,.5) !important;
}
.site-bio .bi { color: var(--forest) !important; }

/* ---- DARK navy-glass STAT value-boxes on the LIGHT page (both modes) ---- */
.hero-stat {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, #12241a 0%, #07100b 100%) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-top: 3px solid var(--forest) !important;
  box-shadow: 0 12px 28px -12px rgba(3,8,20,.6) !important;
  transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .28s ease, border-color .2s ease;
}
.hero-stat .hs-v { color: #ffffff !important; }
.hero-stat .hs-l { color: #9fc0ad !important; }
.hero-stat::before {
  content:""; position:absolute; top:0; left:-65%; width:55%; height:100%; z-index:4;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-18deg); pointer-events:none; opacity:0;
}
.hero-stat:hover::before { animation: gbtSheen .85s ease; }
.hero-stat:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(0,0,0,.5), 0 0 0 1px rgba(54,217,138,.35) !important;
}

@media (prefers-reduced-motion: reduce) {
  .app-hero::before, .hero-stat::before, .brand-mark { animation: none !important; }
  .hero-stat:hover { transform: none; }
}

/* ============ in-app mascot — loader · splash guide · celebration ============ */
.mascot { display:block; width:100%; height:auto; overflow:visible; }
.mascot-ear-l, .mascot-ear-r { transform-box:fill-box; transform-origin:50% 88%; }
.mascot-eyes { transform-box:fill-box; transform-origin:center; }
@keyframes mascotBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes mascotEarL { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-9deg); } }
@keyframes mascotEarR { 0%,100% { transform: rotate(0); } 50% { transform: rotate(9deg); } }
@keyframes mascotBlink { 0%,92%,100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
/* loader: the beetle bobs + wiggles its antennae + blinks while data loads */
.load-spin.mascot-spin { font-size:0; width:92px; height:auto; margin:0 auto 6px; animation:none; }
.mascot-spin .mascot { animation: mascotBob 1.5s ease-in-out infinite; }
.mascot-spin .mascot-ear-l { animation: mascotEarL 1.5s ease-in-out infinite; }
.mascot-spin .mascot-ear-r { animation: mascotEarR 1.5s ease-in-out infinite; }
.mascot-spin .mascot-eyes { animation: mascotBlink 3.4s ease-in-out infinite; }
/* splash guide: a friendly nudge in the corner while no site is loaded */
.splash-guide { position:fixed; right:18px; bottom:16px; z-index:30; display:flex; align-items:flex-end; gap:6px; pointer-events:none; }
.splash-guide .sg-mascot { width:74px; flex:none; }
.splash-guide .sg-mascot .mascot { animation: mascotBob 2.6s ease-in-out infinite; }
.splash-guide .sg-mascot .mascot-ear-l { animation: mascotEarL 2.6s ease-in-out infinite; }
.splash-guide .sg-mascot .mascot-ear-r { animation: mascotEarR 2.6s ease-in-out infinite; }
.splash-guide .sg-mascot .mascot-eyes { animation: mascotBlink 4.2s ease-in-out infinite; }
.splash-guide .sg-bubble { margin-bottom:34px; background:var(--paper); border:1px solid var(--line); color:var(--forest);
  font-size:12.5px; font-weight:700; padding:6px 11px; border-radius:12px 12px 2px 12px;
  box-shadow:0 8px 20px -8px var(--shadow); white-space:nowrap; }
.splash-guide.wave .sg-mascot { transform-box:fill-box; transform-origin:50% 90%; animation: mascotWave 1s ease 3; }
@keyframes mascotWave { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
/* celebration: a beetle hops up + fades on a legendary/epic find */
.mascot-cheer { position:fixed; left:50%; bottom:7%; width:118px; z-index:5000; pointer-events:none;
  transform:translateX(-50%); animation: mascotCheerPop 1.7s ease forwards; }
@keyframes mascotCheerPop {
  0% { opacity:0; transform:translate(-50%,42px) scale(.6); }
  20% { opacity:1; transform:translate(-50%,-12px) scale(1.06); }
  45% { transform:translate(-50%,-34px) scale(1); }
  72% { transform:translate(-50%,-24px) scale(1); }
  100% { opacity:0; transform:translate(-50%,-66px) scale(.9); }
}
@media (max-width:640px) { .splash-guide { display:none; } }
@media (prefers-reduced-motion: reduce) {
  .mascot-spin .mascot, .mascot-spin .mascot-ear-l, .mascot-spin .mascot-ear-r, .mascot-spin .mascot-eyes,
  .splash-guide .sg-mascot .mascot, .splash-guide .sg-mascot .mascot-ear-l, .splash-guide .sg-mascot .mascot-ear-r,
  .splash-guide .sg-mascot .mascot-eyes, .splash-guide.wave .sg-mascot { animation:none !important; }
  .mascot-cheer { display:none; }
  .qc-flag-click, .suite-card { transition: none !important; }
  .qc-flag-click:hover, .suite-card:hover { transform: none !important; }
}

/* ===========================================================================
   v2 FLOW — sidebar removed. Slim top bar (theme + help), a landing select
   panel beside the picker map, and a loaded-view hero band with change-site +
   report. All built on the theme tokens so they flip light/dark for free.
   =========================================================================== */

/* ---- persistent top bar (theme toggle + How-it-works) ---- */
.top-bar { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 8px 4px 4px; margin-bottom: 2px;
  position: sticky; top: 0; z-index: 1000; background: var(--bg);
  border-bottom: 1px solid var(--line); }
.top-bar-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top-bar-brand .tb-mark { font-size: 22px; line-height: 1; }
.top-bar-brand .tb-title { font-weight: 800; color: var(--forest); font-size: 15px;
  letter-spacing: .2px; white-space: nowrap; }
.top-bar-actions { display: flex; align-items: center; gap: 10px; }
.top-bar-actions .tb-help { min-height: 44px; border-radius: 10px; font-weight: 600; }
.tb-theme { display: flex; align-items: center; gap: 6px; }
.tb-theme .tb-theme-lab { color: var(--muted); font-size: 15px; }

/* ---- landing select panel (relocated sidebar controls) ---- */
.select-panel { background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px 16px; margin-top: 14px;
  box-shadow: 0 4px 18px var(--shadow); }
.select-panel .sp-head { font-weight: 700; color: var(--forest); font-size: 14px;
  margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.sp-row { display: flex; flex-wrap: wrap; gap: 14px; }
.sp-field { flex: 1 1 180px; min-width: 160px; }
.sp-field-date { flex: 1 1 240px; }
.sp-field .form-label, .sp-field label { font-weight: 600; color: var(--ink); }
.sp-field .form-control, .sp-field .selectize-input,
.sp-field .form-select { min-height: 44px; font-size: 16px; } /* 16px dodges iOS zoom */
.sp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.sp-load { flex: 1 1 220px; min-height: 48px; font-weight: 700; }
.sp-surprise { flex: 0 1 auto; min-height: 48px; }
.select-panel .compare-pick { margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--line); }
.select-panel .compare-pick .form-control,
.select-panel .compare-pick .form-select { min-height: 44px; font-size: 16px; }

/* ---- loaded-view hero band (site context + change-site + report) ---- */
.hero-site { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  background: var(--paper); border: 1px solid var(--line);
  border-left: 4px solid var(--forest); border-radius: 12px;
  padding: 10px 14px; margin: 6px 0 14px; box-shadow: 0 3px 14px var(--shadow); }
.hero-site > .bi { color: var(--forest); font-size: 18px; }
.hero-site-label { font-weight: 800; color: var(--forest); font-size: 16px; }
.hero-site-range { color: var(--muted); font-size: 13px; }
.hero-site .demo-pill { background: var(--gold); color: #3a2f00; font-weight: 700;
  font-size: 11px; border-radius: 6px; padding: 2px 7px; }
.hero-change, .hero-report { display: inline-flex; align-items: center; gap: 5px;
  min-height: 44px; padding: 6px 12px; border-radius: 10px; font-weight: 600;
  font-size: 14px; text-decoration: none; cursor: pointer; }
.hero-change { color: #fff; background: var(--forest);
  border: 1px solid var(--forest); margin-left: auto; }
.hero-change:hover { filter: brightness(1.06); color: #fff; }
.hero-report { color: var(--forest); background: transparent;
  border: 1px solid var(--line); }
.hero-report:hover { color: var(--forest); border-color: var(--forest);
  background: rgba(31,138,90,0.06); }
[data-bs-theme="dark"] .hero-report:hover { background: rgba(54,217,138,0.10); }

/* ---- mobile: stack the panel + top bar, full-width primary actions ---- */
@media (max-width: 640px) {
  .top-bar { padding-top: 6px; }
  .top-bar-brand .tb-title { font-size: 13px; }
  .sp-row { flex-direction: column; gap: 10px; }
  .sp-field, .sp-field-date { flex: 1 1 100%; min-width: 0; }
  .sp-actions { flex-direction: column; }
  .sp-load, .sp-surprise { flex: 1 1 100%; width: 100%; }
  .hero-change { margin-left: 0; }
  .hero-change, .hero-report { flex: 1 1 100%; justify-content: center; }
}

/* ===========================================================================
   PIN CARDS — tap-to-pin info cards, gold leader lines, per-chart export
   toolbars (driven by www/pincards.js). Ported from the flagship Small Mammal
   Tracker via the Plant Diversity / Veg Structure suite ports, recolored to the
   beetle accents: gold (--gold) leader line, carabid-green (--green) toolbar.
   =========================================================================== */

/* the chart box is the positioning context for pins + the leader-line layer */
.smt-pinnable { position: relative; }
svg.smt-pin-lines {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: visible; z-index: 5;
}

/* the pinned info card (dark, gold-edged, draggable, scalable) */
.smt-pin {
  position: absolute; z-index: 6; max-width: 250px;
  background: rgba(22, 38, 28, 0.97); color: #fff;
  border: 2px solid var(--gold); border-radius: 10px;
  padding: 9px 12px 12px; font-size: 12.5px; line-height: 1.42;
  box-shadow: 0 12px 32px rgba(16, 30, 20, 0.40);
  cursor: grab; transform-origin: top left; touch-action: none;
}
.smt-pin:active { cursor: grabbing; }
.smt-pin b { color: #fff; }
.smt-pin i, .smt-pin em { color: #cfe0d3; font-style: italic; }
.smt-pin-stats { color: #b6c7ba; font-size: 11.5px; }
.smt-pin .smt-open {
  display: inline-block; margin-top: 7px; padding: 2px 9px;
  color: #16261c; background: var(--gold); border-radius: 6px;
  font-weight: 600; font-size: 11.5px; cursor: pointer;
}
.smt-pin .smt-open:hover { background: #d8ab2a; }
.smt-pin-close {
  position: absolute; top: 1px; right: 6px; background: none; border: none;
  color: #cfe0d3; font-size: 17px; line-height: 1; cursor: pointer; padding: 0;
}
.smt-pin-close:hover { color: #fff; }
.smt-pin-resize {
  position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px;
  cursor: nwse-resize; touch-action: none; opacity: 0.5;
  background: linear-gradient(135deg, transparent 50%, var(--gold) 50%);
  border-radius: 0 0 8px 0;
}
.smt-pin-resize:hover { opacity: 1; }
@keyframes smtPulse {
  0%, 100% { box-shadow: 0 12px 32px rgba(16, 30, 20, 0.40); }
  50% { box-shadow: 0 0 0 4px var(--gold), 0 12px 32px rgba(16, 30, 20, 0.5); }
}
.smt-pin.smt-pulse { animation: smtPulse 0.5s ease 2; }

/* per-chart export toolbar (Download with pins · Clear pins) */
.smt-toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 10px;
}
.smt-snap-btn, .smt-clear-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 8px; padding: 5px 12px; font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.smt-snap-btn { background: var(--green); color: #fff; border: none; }
.smt-snap-btn:hover { background: var(--forest); }
.smt-clear-btn { background: transparent; color: var(--green); border: 1px solid var(--line); }
.smt-clear-btn:hover { background: var(--bg); }
.smt-toolbar-hint { color: var(--muted); font-size: 12px; margin-left: auto; }

[data-bs-theme="dark"] .smt-clear-btn { border-color: rgba(255,255,255,.16); }

/* member-reveal modals (a clicked taxon / community's records) reuse the QC
   inspector table styles already in this sheet; this is just the intro copy. */
.reveal-intro { font-size: 13.5px; color: var(--ink); margin: 2px 0 12px; line-height: 1.5; }
.reveal-intro b { color: var(--forest); }
.reveal-cta { font-size: 13px; color: var(--muted); margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .smt-pin.smt-pulse { animation: none !important; }
}
