:root {
  /* Night palette (dark theme); html.light below is the default look.
     Matches the login + menu pages. */
  --bg: #0f1613;
  --panel: rgba(21, 29, 25, 0.9);
  --accent: #7cc49b;
  --accent-ink: #0f1613;          /* text/icons on an accent fill */
  --accent-stop: #d9534a;
  --find: #c8712a;                /* the Mark / "I found something" colour */
  --text: #e7ece7;
  --muted: #9aa8a0;
  /* Surface colours used across cards, sheets, toasts, inputs — themed below. */
  --surface: #172019;
  --surface-2: #111915;
  --border: #2a3530;
  --border-soft: rgba(255, 255, 255, 0.08);
  --map-bg: #172019;
  --shadow: 0 10px 28px -12px rgba(0, 0, 0, 0.55);
  /* Semantic status colours (badges, scores, timelines) + the find categories. */
  --ok-bg: rgba(108, 195, 145, 0.15); --ok-fg: #8fd3ad;
  --mid-bg: rgba(233, 180, 76, 0.15); --mid-fg: #e9b44c;
  --bad-bg: rgba(240, 138, 126, 0.15); --bad-fg: #f2a097;
  --vio-bg: rgba(157, 146, 234, 0.16); --vio-fg: #aea5ee;
  --info-fg: #8db8d6;
  --bat: #7a6ce0; --bird: #b8752f;
  --serif: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Light theme — the default; toggled from the ⚙ Map menu (class on <html>).
   The dim screen, photo viewer and modal scrims stay dark in both themes. */
html.light {
  --bg: #f5f2ea;
  --panel: rgba(255, 253, 248, 0.94);
  --accent: #2f6b4f;
  --accent-ink: #ffffff;
  --accent-stop: #b4382c;
  --find: #b8611c;
  --text: #1d2621;
  --muted: #5d6a62;
  --surface: #fffdf8;
  --surface-2: #efebe1;
  --border: #e2ddd0;
  --border-soft: rgba(29, 38, 33, 0.08);
  --map-bg: #e9e5da;
  --shadow: 0 10px 28px -12px rgba(29, 38, 33, 0.35);
  --ok-bg: rgba(47, 125, 82, 0.11); --ok-fg: #2f7d52;
  --mid-bg: rgba(185, 120, 20, 0.12); --mid-fg: #95600f;
  --bad-bg: rgba(180, 56, 44, 0.1); --bad-fg: #b4382c;
  --vio-bg: rgba(91, 75, 176, 0.1); --vio-fg: #5b4bb0;
  --info-fg: #2f5f7f;
  --bat: #5b4bb0; --bird: #c0702a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}

#map { position: absolute; inset: 0; z-index: 1; background: var(--map-bg); }

/* Live stats panel */
.panel {
  position: absolute;
  top: calc(var(--safe-top) + 10px);
  left: 10px;
  right: 10px;
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 4px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--border-soft); }
.stat .num { font-size: 1.2rem; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stat .lbl { font-size: 0.58rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; text-align: center; white-space: nowrap; }

/* Status pill */
.status {
  position: absolute;
  top: calc(var(--safe-top) + 80px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 6px 14px 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  box-shadow: var(--shadow);
  color: var(--muted);
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Coloured dot in front of the text: grey idle, green good, amber warn, red bad. */
.status::before {
  content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 7px;
  border-radius: 50%; background: currentColor; vertical-align: 1px; opacity: 0.85;
}
.status.good { color: var(--accent); }
.status.warn { color: #c98a12; }
.status.bad  { color: var(--accent-stop); }
:root:not(.light) .status.warn { color: #e9b44c; }

/* Battery pill — sits just under the GPS status pill, top-centre */
.battery {
  position: absolute;
  top: calc(var(--safe-top) + 124px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 5px 12px;
  font-size: 0.74rem;
  background: var(--panel);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}

/* Controls */
/* The bottom dock: one floating rounded bar holding every control. */
#controls {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;            /* never clip edge buttons off-screen on narrow phones */
  gap: 6px;
  padding: 6px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
#controls .ctl, #controls .map-menu-trigger { box-shadow: none; }
/* Tighten the row on small screens so all buttons (home … dim) stay visible. */
@media (max-width: 460px) {
  #controls { gap: 4px; padding: 5px; }
  #controls .ctl.ghost { width: 44px; height: 44px; font-size: 1.15rem; }
  #controls .map-menu-trigger { width: 44px; height: 44px; }
  #controls .ctl.primary { height: 44px; padding: 0 18px; font-size: 0.98rem; }
  #controls .finish-btn { height: 44px; padding: 0 15px; font-size: 0.95rem; }
  #controls .ctl.icon-only { width: 44px; height: 44px; padding: 0; font-size: 1.4rem; }
}
.ctl {
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease;
}
.ctl:active { transform: scale(0.94); }
.ctl:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ctl.primary {
  background: var(--accent);
  color: var(--accent-ink);
  height: 52px;
  padding: 0 26px;
  font-size: 1.05rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.ctl.primary .ico { width: 18px; height: 18px; }
.ctl.primary.recording { background: #e3a53a; color: #2a1a05; }   /* Pause (amber) */
.finish-btn {
  background: var(--accent-stop); color: #fff;
  height: 52px; padding: 0 22px; font-size: 1.02rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
/* While recording, Pause (primary) + Finish collapse to round glyph-only
   buttons — no word labels — so the bottom control row stays compact and
   matches the ghost icon buttons. Applied via the .icon-only class from JS. */
.ctl.icon-only {
  width: 52px; height: 52px;
  padding: 0;
  font-size: 1.5rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.ctl.ghost {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  width: 52px; height: 52px;
  font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
}
/* Mark-point button: amber FAB with a crisp pin icon (same on every phone). */
.ctl.pin {
  border-radius: 50%;
  border: none;
  background: var(--find);
  color: #fff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
}
.pin-ico { width: 52%; height: 52%; fill: #fff; display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25)); }
.pin-lbl { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; }

/* Crisp line icons inside the control buttons (replace the old emoji glyphs).
   currentColor + var(--text) means they follow the active theme automatically. */
.ctl .ico {
  width: 22px; height: 22px; display: block;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
/* The Finish "stop" icon is a solid square, not a line drawing — fill it with
   the button's white (overrides the line-icon fill:none above). */
.finish-btn .ico { fill: currentColor; stroke: none; }
.ctl .ico.fill { fill: currentColor; stroke: none; }
.finish-btn .ico:not(.fill) { fill: none; stroke: currentColor; }   /* the ✓ check is a line */
.finish-btn svg rect { fill: currentColor; }

/* Floating light/dark toggle, top-right just under the stats panel. */
.theme-toggle {
  position: absolute;
  top: calc(var(--safe-top) + 82px);
  right: 10px;
  z-index: 1100;
}
.ico-sun { display: none; }
html.light .theme-toggle .ico-moon { display: none; }
html.light .theme-toggle .ico-sun { display: block; }

/* Floating on the right edge, vertically centred. White ring keeps it readable
   over any map colour. */
.side-pin {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  width: 70px; height: 70px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 10px 24px -6px rgba(0, 0, 0, 0.55);
}
.side-pin .pin-ico { width: 44%; height: 44%; }
.side-pin:active { transform: translateY(-50%) scale(0.92); filter: brightness(0.94); }

/* Big but dim on the dark screen — large target for the dark, muted colour so
   it isn't harsh and keeps the OLED power low. */
.dim-pin {
  position: absolute;
  bottom: 16%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2600;
  width: min(150px, 42vw); height: min(150px, 42vw);
  background: radial-gradient(circle at 50% 38%, #2f3a47 0%, #1c232c 100%);
  box-shadow: 0 0 0 2px rgba(120,140,165,0.18);
}
.dim-pin .pin-ico { width: 56px; height: 56px; fill: #8aa0b8; }
.dim-pin .pin-lbl { font-size: 0.82rem; margin-top: 2px; color: #8aa0b8; }
.dim-pin:active { transform: translateX(-50%) scale(0.96); filter: brightness(0.92); }
/* Battery line on the dim screen — dim but readable */
.dim-batt { font-size: 0.82rem; color: #1f4d33; }

/* History drawer */
.drawer {
  position: absolute;
  inset: 0;
  z-index: 2000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 10px) 14px calc(var(--safe-bottom) + 10px);
  transition: transform 0.25s ease;
}
.drawer.hidden { transform: translateY(100%); pointer-events: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.drawer-head h2 { margin: 0; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
/* Two-pane data view (super user / admin): users | their walks */
.walk-panes { display: flex; flex: 1; min-height: 0; gap: 10px; }
.walk-pane { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
.walk-pane-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.walk-pane-title { font-weight: 700; font-size: 0.9rem; color: var(--text); flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Flex moves the truncation onto the label itself. */
.walk-pane-title > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Compact "VAS data summary" button above the panes — a pill, not a banner. */
/* "VAS data summary" — luxury emerald pill with a soft gradient sheen + gold edge. */
/* Data-summary + Gallery buttons: one right-aligned row, distinct colours. */
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin: 2px 2px 12px; }
.top-btn {
  appearance: none; -webkit-appearance: none; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.01em;
  border-radius: 999px; color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
  transition: transform 0.08s ease, filter 0.2s ease;
}
.top-btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.top-btn:hover { filter: brightness(1.09); }
.top-btn:active { transform: translateY(1px); }
.top-btn.hidden { display: none; }
/* VAS data → indigo (analytics); Gallery → teal (media). */
.top-btn { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: none; text-shadow: none; font-weight: 650; }
.top-btn:hover { filter: none; border-color: var(--muted); }
.tb-data svg { color: #2f5f7f; }
.tb-gallery svg { color: #9a5a1f; }
:root:not(.light) .tb-data svg { color: #8db8d6; }
:root:not(.light) .tb-gallery svg { color: #e0a86b; }
/* ---- Data-view switcher (admin/super): Walks | Test results | Placed objects --
   One full-width row of tabs under the drawer head. The two extra views replace
   the walk panes entirely rather than sitting inside them. */
.data-tabs { display: flex; gap: 2px; margin: 2px 0 12px; flex: 0 0 auto; padding: 3px; background: var(--surface-2); border-radius: 12px; }
.data-tabs.hidden { display: none; }
.data-tab {
  flex: 1; min-width: 0; font: inherit; font-size: 0.76rem; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 6px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.data-tab { border-color: transparent !important; background: transparent; border-radius: 9px; }
.data-tab.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.data-tab.on .pico { color: var(--accent); }
/* Very narrow phones: the icons alone carry the meaning. */
@media (max-width: 420px) { .data-tabs.many .data-tab span { display: none; } .data-tabs.many .data-tab { gap: 0; } }

/* ---- Test results + Placed objects: plain scrolling columns of cards. */
.seff-view, .objects-view {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;          /* don't drag the page behind the list */
  display: flex; flex-direction: column; gap: 10px;
  padding-bottom: 6px;                   /* last card clear of the account bar */
}
/* Cards keep their full height and the LIST scrolls. Without this they are flex
   items that shrink to fit the box, and since .dv-card clips its own overflow an
   expanded record would just get cut off with nothing to scroll. */
.seff-view > *, .objects-view > * { flex: 0 0 auto; }
.seff-view.hidden, .objects-view.hidden { display: none; }
.dv-empty { color: var(--muted); text-align: center; padding: 26px 10px; font-size: 0.88rem; }
/* Section heading inside either view (a surveyor, or a place). */
.dv-head {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin: 4px 2px 0;
}
/* Turbine line under a place heading — indented so the hierarchy reads. */
.dv-head-sub { margin-left: 8px; opacity: 0.85; }
.dv-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
/* An opened card stands out from its shut neighbours, so it is obvious which one
   the detail below belongs to — and that it is the one to close. */
.dv-card.open { border-color: var(--accent); }
.dv-card.open .dv-row { background: var(--surface-2); }
/* Chevron: points down when shut, flips up when open = "tap again to close". */
.dv-chev {
  width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  color: var(--muted); transition: transform 0.15s ease;
}
.dv-chev.up { transform: rotate(180deg); color: var(--accent); }
.dv-row {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  font: inherit; color: var(--text); background: none; border: 0; padding: 11px 13px; cursor: pointer;
}
.dv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dv-title { font-weight: 700; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-sub { font-size: 0.74rem; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-body { padding: 0 13px 13px; display: flex; flex-direction: column; gap: 11px; }
/* Score pill: the found/available ratio, coloured by how good it is. */
.dv-score {
  flex: 0 0 auto; font-size: 0.78rem; font-weight: 800; padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); white-space: nowrap;
}
.dv-score.good { background: var(--ok-bg); color: var(--ok-fg); }
.dv-score.mid  { background: var(--mid-bg); color: var(--mid-fg); }
.dv-score.bad  { background: var(--bad-bg); color: var(--bad-fg); }
.dv-score.none { background: var(--surface-2); color: var(--muted); }
/* Status badge on a placed object. */
.dv-badge { flex: 0 0 auto; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.03em;
  padding: 4px 9px; border-radius: 999px; text-transform: uppercase; white-space: nowrap; }
.dv-present { background: var(--ok-bg); color: var(--ok-fg); }
.dv-partial { background: var(--mid-bg); color: var(--mid-fg); }
.dv-notfound{ background: var(--vio-bg); color: var(--vio-fg); }
.dv-gone    { background: var(--bad-bg); color: var(--bad-fg); }
.dv-removed { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
/* Key/value block of the Appendix-H record. */
.dv-kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 0.79rem; }
.dv-kv .k { color: var(--muted); white-space: nowrap; }
.dv-kv .v { overflow-wrap: anywhere; }
.dv-sect { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
/* Inspection timeline / per-object result lines. The left rule is colour-coded by
   what that visit found, so an object's history can be read down the edge:
   placed → still there → scavenged → gone. */
.dv-tl { display: flex; flex-direction: column; gap: 7px; }
.dv-tl-row { font-size: 0.78rem; border-left: 2px solid var(--border); padding: 3px 0 3px 9px; }
.dv-tl-row.st-placed  { border-left-color: var(--info-fg); }
.dv-tl-row.st-present { border-left-color: var(--ok-fg); }
.dv-tl-row.st-partial { border-left-color: var(--mid-fg); }
.dv-tl-row.st-notfound{ border-left-color: var(--vio-fg); }
.dv-tl-row.st-gone    { border-left-color: var(--bad-fg); }
.dv-tl-row.st-removed { border-left-color: var(--muted); }
.dv-tl-row.st-found   { border-left-color: var(--info-fg); }
.dv-tl-row.st-open    { border-left-style: dashed; }
.dv-note { color: var(--muted); font-size: 0.74rem; margin-top: 2px; overflow-wrap: anywhere; }
/* Photos of that visit. Big enough to tell a whole carcass from a feather spot;
   tapping one opens it full size. */
.dv-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.dv-thumbs a { line-height: 0; }
.dv-thumbs img { width: 88px; height: 66px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.dv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 7px; }
.dv-box { background: var(--surface-2); border: 0; border-radius: 12px; padding: 8px 10px; }
.dv-box .l { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.dv-box .n { font-size: 0.92rem; font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; }
.dv-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dv-btn {
  font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; padding: 8px 13px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.dv-btn.danger { color: var(--accent-stop); border-color: rgba(239, 68, 68, 0.45); background: none; }

/* Left column = mode tabs (Users / Places) pinned on top of the scrolling list. */
.side-pane {
  flex: 0 0 40%; max-width: 200px; min-width: 116px; min-height: 0;
  border-right: 1px solid var(--border); padding-right: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.side-pane.hidden { display: none; }
.pane-modes { display: flex; gap: 4px; flex: 0 0 auto; }
.pane-mode {
  flex: 1; min-width: 0; font: inherit; font-size: 0.72rem; font-weight: 600; cursor: pointer;
  padding: 6px 4px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pane-mode.on { border-color: var(--accent); background: var(--surface-2); color: var(--text); }
.pane-mode { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
/* Shared line-icon look for every glyph in the data view (replaces the emoji):
   24-grid, currentColor stroke, so they follow the theme and the text colour. */
.lico, .pico {
  width: 15px; height: 15px; flex: 0 0 auto; display: inline-block; vertical-align: -2px;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.pico { width: 14px; height: 14px; }
/* Icon + label pairs inside list rows and card meta lines. */
.ui-name { display: flex; align-items: center; gap: 5px; }
.ui-name .ui-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.walk-card .meta .mi { display: inline-flex; align-items: center; gap: 3px; }
.walk-card .info .title .lico { margin-right: 5px; }
.walk-card .del { display: inline-flex; align-items: center; }
.walk-card .del .lico { width: 17px; height: 17px; }
.turbine-group .lico { width: 17px; height: 17px; }
.tc-vas .lico, .sum-section-title .lico, #turbine-title .lico { vertical-align: -3px; }
.user-pane {
  flex: 1; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 4px;
}
/* Turbine numbers listed under their (selected) place. */
.user-item.sub { margin-left: 10px; padding: 6px 9px; border-style: dashed; }
.user-item.sub .ui-name { font-size: 0.78rem; font-weight: 500; }
.user-item {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  background: var(--surface); color: var(--text); cursor: pointer;
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; font: inherit;
}
.user-item.on { border-color: var(--accent); background: var(--surface); box-shadow: inset 3px 0 0 var(--accent); }
.user-item .ui-name { font-weight: 600; font-size: 0.84rem; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-item .ui-sub { font-size: 0.7rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-empty { color: var(--muted); font-size: 0.8rem; padding: 12px 4px; text-align: center; }
.walk-list { overflow-y: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; }

.walk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.walk-card .mini { width: 72px; height: 56px; border-radius: 8px; background: var(--surface-2); flex-shrink: 0; }
.walk-card .info { flex: 1; min-width: 0; }
.walk-card .info .title { font-weight: 600; font-size: 0.95rem; }
.walk-card .info .meta { color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.walk-card .del { background: none; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; padding: 6px; }
.walk-card .dl { color: var(--muted); font-size: 1.15rem; text-decoration: none; padding: 6px; }
.walk-card .open { background: var(--surface-2); border: 1px solid var(--border); color: inherit; font: inherit; font-size: 0.8rem; font-weight: 650; border-radius: 999px; cursor: pointer; padding: 6px 14px; }
.walk-card .info { cursor: pointer; }
.walk-card.empty { justify-content: center; color: var(--muted); }

/* Super-user only: per-user group header in the routes list */
.walk-group {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding: 6px 4px 4px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
}
.walk-group:first-child { margin-top: 0; border-top: none; }
.walk-group { display: flex; align-items: center; gap: 6px; }

/* Collapsed turbine block in the places view: header + newest visit, the rest
   folded away until it's tapped open. */
.turbine-group {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
  font: inherit; cursor: pointer; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 9px 12px; margin: 12px 0 8px;
}
.turbine-group:first-child { margin-top: 0; }
.turbine-group .tg-name { font-weight: 700; font-size: 0.88rem; }
.turbine-group .tg-sub { color: var(--muted); font-size: 0.74rem; margin-left: auto; }
.turbine-group .chev { flex: 0 0 auto; transition: transform 0.15s ease; opacity: 0.7; }
.turbine-group.open { border-color: var(--accent); }
.turbine-group.open .chev { transform: rotate(90deg); }
.tg-more {
  display: block; width: 100%; font: inherit; font-size: 0.76rem; font-weight: 600;
  cursor: pointer; color: var(--accent); background: none;
  border: 1px dashed var(--border); border-radius: 10px; padding: 7px 10px; margin: -2px 0 10px;
}
.tg-more:hover { border-color: var(--accent); }

/* Survey-week chips above the walk list — the same weeks as the Location page. */
.week-strip {
  display: flex; gap: 6px; align-items: center; overflow-x: auto;
  margin: 0 0 10px; padding-bottom: 2px; -webkit-overflow-scrolling: touch; flex: 0 0 auto;
}
.week-strip.hidden { display: none; }
.wk-chip {
  flex: 0 0 auto; font: inherit; cursor: pointer; text-align: center; line-height: 1.25;
  display: flex; flex-direction: column; gap: 1px; white-space: nowrap;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px; padding: 5px 10px;
}
.wk-chip .wk-nr { font-size: 0.72rem; font-weight: 700; }
.wk-chip .wk-n { font-size: 0.68rem; color: var(--muted); }
.wk-chip.sel { border-color: var(--accent); background: var(--surface-2); }
.wk-chip.sel .wk-n { color: var(--text); }
.wk-note { flex: 0 0 auto; font-size: 0.68rem; color: var(--muted); padding-left: 2px; }

/* Per-day paragraph header inside a user's walk list. */
.walk-day {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 4px 2px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}
.walk-day:first-child { margin-top: 0; border-top: none; }

/* Super-user only: "Show user" picker above the routes list */
.walk-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 2px 10px;
}
.walk-filter label { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.walk-filter select {
  flex: 1;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.85rem;
}

/* Account row at the bottom of the drawer */
#account {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  padding: 14px 4px calc(var(--safe-bottom) + 4px);
  border-top: 1px solid var(--border); margin-top: 6px;
}
.acct-name { color: var(--text); font-size: 0.9rem; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; flex-shrink: 0; }
.acct-link {
  background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 0.88rem; text-decoration: none;
}
/* Account-row buttons — icon-only round buttons, matching the menu page's
   mobile option bar. Kept on one line at every screen width. */
.acct-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; padding: 0; flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  text-decoration: none; cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease;
}
.acct-btn:active { transform: scale(0.95); }
.acct-lbl { display: none; }                 /* icon-only — no labels */
.acct-ico {
  width: 19px; height: 19px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.acct-logout { color: var(--accent-stop); border-color: rgba(239, 68, 68, 0.4); }

/* ---- Walk detail page ---------------------------------------------------- */
.drawer.detail { z-index: 2100; }            /* above the walks list */
.drawer-head .ctl.ghost { width: 42px; height: 42px; font-size: 1.2rem; flex-shrink: 0; }
#detail-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }

/* Summary stat chips at the top of the detail page */
.detail-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 12px; }
.sum-chip {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 8px; text-align: center;
}
.sum-chip .n { font-size: 1.4rem; font-weight: 800; line-height: 1.1; }
.sum-chip .l { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.detail-meta {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 14px; font-size: 0.84rem; color: var(--text);
}
.detail-meta div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.detail-meta .k { color: var(--muted); }
.detail-meta .v { font-weight: 600; text-align: right; }

.detail-section-title { font-size: 0.82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 4px 2px 8px; }

/* Dead-bat mortality estimate panel */
.mort { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; margin-bottom: 14px; }
.mort-title { font-size: 0.84rem; font-weight: 700; margin-bottom: 6px; }
.mort-result { font-size: 1rem; margin-bottom: 9px; }
.mort-result .mort-m { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.mort-result .mort-found { font-size: 0.78rem; color: var(--muted); }
.mort-params { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 7px; }
.mort-params label { font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.mort-in {
  width: 66px; padding: 6px 8px; font: inherit; font-size: 0.85rem;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
}
.mort-in:focus { outline: none; border-color: var(--accent); }
.mort-note { font-size: 0.7rem; color: var(--muted); line-height: 1.4; }

/* Weather panel — comparison table */
.wx { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; margin-bottom: 14px; }
.wx-title { font-size: 0.84rem; font-weight: 700; margin-bottom: 8px; }
.wx-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.wx-table th { text-align: left; font-size: 0.74rem; color: var(--muted); font-weight: 700; padding: 3px 6px; border-bottom: 1px solid var(--border); }
.wx-table td { padding: 4px 6px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.wx-table tr:last-child td { border-bottom: none; }
.wx-table .wx-m { color: var(--muted); white-space: nowrap; }
.wx-note { font-size: 0.68rem; color: var(--muted); margin-top: 8px; }
.wx-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wx-refresh { font: inherit; font-size: 0.72rem; font-weight: 700; padding: 4px 10px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--surface-2, var(--surface)); color: var(--text); cursor: pointer; white-space: nowrap; }
.wx-refresh:active { transform: scale(0.96); }
.wx-refresh:disabled { opacity: 0.6; }
.wx-night td { font-variant-numeric: tabular-nums; }
.wx-night th:not(:first-child), .wx-night td:not(:first-child) { text-align: right; }
.mort-scalc { margin-top: 10px; font-size: 0.82rem; }
.mort-scalc summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.scalc { margin-top: 8px; }
.scalc-row { display: grid; grid-template-columns: 1.4fr 0.5fr 0.6fr 1fr; gap: 6px; align-items: center; padding: 3px 0; }
.scalc-head { color: var(--muted); font-weight: 700; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; }
.scalc-q { width: 100%; }
.scalc-preview { margin: 9px 0 7px; font-weight: 700; font-size: 0.85rem; }
.mort-apply {
  width: 100%; padding: 9px; border: 1px solid var(--accent); border-radius: 10px;
  background: transparent; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer;
}
.mort-apply:active { transform: scale(0.98); }

/* Formula + symbol legend */
.mort-help { margin-top: 10px; font-size: 0.82rem; }
.mort-help summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.mort-help-body { margin-top: 6px; }
.mh-formula {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; margin: 8px 0; font-size: 0.82rem; overflow-x: auto; white-space: nowrap;
}
.mort-help-body dl { margin: 6px 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; align-items: baseline; }
.mort-help-body dt { font-weight: 700; white-space: nowrap; }
.mort-help-body dd { margin: 0; color: var(--muted); }

/* One card per recorded mark */
.mark-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; margin-bottom: 10px; }
.mark-card .head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mark-card .badge { font-weight: 800; font-size: 0.95rem; }
.mark-card .cat { font-size: 0.95rem; font-weight: 700; }
.mark-card .pho { margin-left: auto; font-size: 0.78rem; color: var(--accent); cursor: pointer; }
.mark-card .rows { display: flex; flex-direction: column; gap: 2px; }
.mark-card .row { display: flex; gap: 8px; font-size: 0.82rem; }
.mark-card .row .k { color: var(--muted); flex: 0 0 44%; }
.mark-card .row .v { font-weight: 600; flex: 1; word-break: break-word; }

/* Compact mark row in the detail list — tap to open its full media/detail. */
.mark-card.compact {
  width: 100%; text-align: left; font: inherit; cursor: pointer;
  padding: 9px 12px; margin-bottom: 7px; display: block;
}
.mark-card.compact:active { transform: scale(0.995); }
.mc-row { display: flex; align-items: center; gap: 8px; }
.mc-row .badge { color: var(--muted); font-size: 0.85rem; flex-shrink: 0; }
.mc-row .cat { font-size: 0.9rem; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.mc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: italic; color: var(--text); }
.mc-photos { font-size: 0.74rem; color: var(--accent); white-space: nowrap; flex-shrink: 0; }
.mc-chev { color: var(--muted); font-size: 1.1rem; flex-shrink: 0; }
.mc-sub { font-size: 0.75rem; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Single-mark detail: photo gallery + note */
#mark-detail { z-index: 2200; }   /* above the walk detail page */
.markdetail-photos {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px; margin-top: 4px;
}
.markdetail-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: pointer; background: var(--surface); }
.markdetail-note {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; white-space: pre-wrap; font-size: 0.9rem; margin: 4px 0 12px;
}

/* Mark actions (live map) + edit/delete row in the mark detail */
.ma-coords { font-size: 0.84rem; color: var(--muted); margin: -4px 0 12px; font-variant-numeric: tabular-nums; }
.ma-buttons { display: flex; flex-direction: column; gap: 9px; margin-bottom: 6px; }

/* Mark popup (history map) — keep it inside the screen and wrap long tokens
   (ISO dates, coordinates) so text never spills off the right edge on mobile. */
.mark-popup { overflow-wrap: anywhere; word-break: break-word; }
.mark-popup .mp-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 3px; }
.mark-popup .mp-coords { font-size: 0.8rem; color: #475569; font-variant-numeric: tabular-nums; margin-bottom: 5px; overflow-wrap: anywhere; }
.mark-popup .mp-sum { font-size: 0.8rem; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 6px; }
.mark-popup .mp-btn { background: var(--accent); color: var(--accent-ink); border: none; border-radius: 8px; padding: 7px 12px; font: inherit; font-weight: 700; cursor: pointer; }
/* Cap the popup to the viewport so it can't run off-screen on small phones. */
.leaflet-popup-content { max-width: 76vw; }
.ma-buttons .ctl.wide, .sheet-actions .ctl.wide { width: 100%; height: auto; padding: 13px; font-size: 0.95rem; }
.ma-del, .markdetail-actions .ma-del { color: var(--accent-stop); }
.markdetail-actions { display: flex; gap: 10px; margin-top: 14px; }
.markdetail-actions .ctl { flex: 1; justify-content: center; height: auto; padding: 12px; font-size: 0.92rem; }

.detail-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px 0 calc(var(--safe-bottom) + 4px);
  border-top: 1px solid var(--border);
}
.detail-actions .primary { flex: 1 1 140px; justify-content: center; padding: 13px 14px; font-size: 0.95rem; }
.detail-actions .ctl.ghost { width: auto; height: auto; }
.detail-actions .dl-btn { display: inline-flex; align-items: center; }

/* Pill action buttons (PDF / Others) shown beside "View route on map". */
.act-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 16px; border-radius: 999px;
  font-size: 0.92rem; font-weight: 700; cursor: pointer;
  border: 1px solid var(--border); color: var(--text); background: var(--surface);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
  transition: transform 0.08s ease, filter 0.2s ease;
}
.act-btn:active { transform: scale(0.95); }
.act-btn { box-shadow: none; font: inherit; font-weight: 650; }
.act-pdf { color: var(--text); }

/* "Others" popout menu with the remaining export formats. */
.more-wrap { position: relative; display: inline-flex; }
.more-menu {
  position: absolute; bottom: calc(100% + 8px); right: 0;
  display: flex; flex-direction: column; min-width: 184px;
  padding: 6px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
.more-item {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px; border-radius: 10px;
  color: var(--text); font-size: 0.92rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.more-item:active { background: var(--surface-2); }
.more-item + .more-item { border-top: 1px solid var(--border-soft); }

/* Toast */
.toast {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 90px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  max-width: 90vw;
  text-align: center;
}
.hidden { display: none !important; }

/* Proximity warning — "you're near a registered carcass". Top-centre popup,
   above the dim/pocket screen so it's seen even while recording dark. Tap to dismiss. */
.carcass-alert {
  position: absolute;
  top: calc(var(--safe-top) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3500;
  width: min(94vw, 480px);
  max-width: 94vw;
  padding: 13px 18px;
  background: #b45309;                 /* amber-700 — clearly a warning, readable on any map */
  color: #fff7ed;
  border: 1.5px solid #f59e0b;
  border-radius: 14px;
  font-size: 0.92rem; font-weight: 700; line-height: 1.35;
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  animation: carcass-pop 0.18s ease-out;
}
/* In dim/pocket mode the screen is near-black — centre it and make it glow brighter. */
.carcass-alert.on-dim {
  top: 50%; transform: translate(-50%, -50%);
  background: #f59e0b; color: #1a1206;
  font-size: 1.05rem; padding: 18px 22px;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.6);
}
/* Quick info: what it is (head), the identifying detail, then what to do. */
.carcass-alert .ca-head { font-size: 1rem; }
.carcass-alert .ca-detail {
  margin-top: 4px; font-size: 0.8rem; font-weight: 600; line-height: 1.4;
  opacity: 0.92; word-break: break-word;
}
.carcass-alert .ca-foot { margin-top: 6px; font-size: 0.78rem; font-weight: 600; opacity: 0.8; }
.carcass-alert .ca-actions {
  display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; margin-top: 11px;
}
.carcass-alert .ca-actions button {
  font: inherit; font-weight: 700; font-size: 0.78rem; padding: 8px 11px;
  border-radius: 9px; cursor: pointer; border: none; color: #fff;
  flex: 1 1 auto; min-width: 110px;
}
.carcass-alert .ca-open  { background: #16a34a; }   /* green  — update what's there */
.carcass-alert .ca-gone  { background: #7c2d12; }   /* brown  — it's gone (recorded) */
.carcass-alert .ca-mute  { background: #475569; }   /* slate  — quiet for today only */
.carcass-alert .ca-close { background: #dc2626; }   /* red    — dismiss */
/* Dim/pocket mode: bigger targets, and the buttons must read on the amber glow. */
.carcass-alert.on-dim .ca-actions button { font-size: 0.85rem; padding: 11px 13px; }

/* Mark detail: "a surveyor went back and it was gone". Amber, like the warning
   it silences, so the two read as the same thread. */
.walk-card.gone-note {
  border-color: #b45309; background: rgba(180, 83, 9, 0.14); color: var(--text);
  font-size: 0.86rem; line-height: 1.45; text-align: left;
}
@keyframes carcass-pop { from { opacity: 0; } to { opacity: 1; } }

/* Pocket dim screen — almost-black so OLED pixels switch off (saves battery)
   while the Wake Lock keeps the screen technically "on" and GPS recording. */
.dim {
  position: absolute;
  inset: 0;
  z-index: 2500;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: calc(var(--safe-top) + 12vh);
  gap: 14px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.dim-stats { text-align: center; font-variant-numeric: tabular-nums; }
#dim-dist { font-size: 2.6rem; font-weight: 700; color: #1f4d33; line-height: 1; }
#dim-dist small { font-size: 1rem; font-weight: 600; margin-left: 5px; color: #143524; }
#dim-dur { font-size: 1.5rem; margin-top: 8px; color: #143524; }
/* Keep this readable — it's how the user knows to double-tap to get back. A
   short line of dim-grey text lights very few pixels, so battery cost is tiny. */
.dim-hint { font-size: 0.8rem; letter-spacing: 0.04em; color: #94a3b8; font-weight: 600; }
.dim-hint .wake { color: #e2e8f0; }

/* Waypoint number labels */
.wp-tip {
  background: #f59e0b;
  color: #1a1205;
  border: none;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 1px 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.wp-tip::before { display: none; } /* hide the little arrow */

/* Make Leaflet attribution subtle on dark UI */
.leaflet-control-attribution { font-size: 9px; opacity: 0.7; }
.leaflet-bottom { margin-bottom: 84px; }
/* Zoom buttons: match the app's surfaces instead of Leaflet's stock white. */
.leaflet-touch .leaflet-bar { border: 1px solid var(--border-soft); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.leaflet-touch .leaflet-bar a { background: var(--panel); color: var(--text); width: 40px; height: 40px; line-height: 40px; border-bottom-color: var(--border-soft); }

/* Streets/Satellite toggle — a pill matching the app's other overlays */
.map-layer-toggle {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 9px 15px;
  /* Solid surface + clear border so the pill reads over any map — a translucent
     panel blended into the light street map and was hard to see. */
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.06);
  white-space: nowrap;
  cursor: pointer;
}
.map-layer-toggle:active { transform: scale(0.96); }
/* Lift the toggle above the Media pill (left:12px, bottom ~78px) so that, when a
   saved walk is open, the two stack instead of overlapping. */
.leaflet-bottom.leaflet-left { margin-bottom: 128px; }

/* ---- Offline mode -------------------------------------------------------- */
/* Persistent banner shown while there's no connection. */
.offline-banner {
  position: absolute;
  top: calc(var(--safe-top) + 116px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  padding: 6px 16px;
  font-weight: 600;
  background: #7f1d1d;            /* dark red */
  color: #fee2e2;
  border-radius: 999px;
  font-size: 0.78rem;
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

/* Dark offline map: deepen the background and dim any cached tiles so the green
   route line and amber marks stand out instead of looking like broken tiles. */
body.offline #map { background: #05070d; }
/* Reload is locked while offline — show it as unavailable (it still taps to warn). */
body.offline #btn-reload { opacity: 0.35; }

/* ---- Mark sheet (photo + note) ------------------------------------------- */
.sheet {
  position: absolute;
  inset: 0;
  z-index: 4000;
  background: rgba(10, 14, 12, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  padding: 18px 18px calc(16px + var(--safe-bottom));
  box-shadow: 0 -12px 32px -8px rgba(0, 0, 0, 0.4);
  /* Keep the registration card inside the viewport on small screens; scroll if it
     is taller than the space available rather than spilling off the bottom. */
  max-height: calc(100dvh - 10px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sheet-card h3 { margin: 0 0 10px; font-size: 1.1rem; font-weight: 650; color: var(--text); }
.sheet-grip { width: 38px; height: 4px; border-radius: 999px; background: var(--border); margin: -6px auto 14px; }
.ctl.wide { width: 100%; justify-content: center; margin-bottom: 10px; }
/* Take photo / Gallery: two calm outlined buttons, not the round map controls. */
.photo-add-row { display: flex; gap: 10px; margin-bottom: 10px; }
.photo-add-row .ctl.ghost {
  flex: 1; width: auto; height: 48px; padding: 0 12px; gap: 8px;
  border-radius: 12px; border: 1px solid var(--border); box-shadow: none;
  background: var(--surface); color: var(--text);
  font-size: 0.95rem; font-weight: 600;
}
.photo-add-row .ctl.ghost .ui-i { width: 20px; height: 20px; margin: 0; vertical-align: 0; color: var(--accent); flex: none; }
.photo-thumbs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.photo-thumbs:empty { display: none; }
.photo-thumb {
  position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
  background: var(--surface);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb .rm {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; line-height: 18px;
  text-align: center; border-radius: 50%; background: rgba(0,0,0,0.65); color: #fff;
  font-size: 13px; border: none; cursor: pointer;
}
.mark-note {
  width: 100%; min-height: 70px; resize: vertical; box-sizing: border-box;
  background: var(--panel); color: var(--text); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 0.9rem; margin-bottom: 12px;
}
.sheet-actions { display: flex; gap: 10px; }
.sheet-actions .ctl { flex: 1; justify-content: center; }

/* Re-sighting prompt (already-registered-here) — bottom sheet, actions stacked. */
.resight-msg { color: var(--text); font-size: 0.92rem; line-height: 1.45; margin: 0 0 14px; }
.resight-actions { flex-direction: column; }
.resight-actions .ctl { flex: none; width: 100%; margin: 0; }

/* ---- Spot category chooser (inside the mark bottom-sheet) ---------------- */
.sheet-card h3.spot-head { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; margin: 0 0 4px; cursor: default; }
.spot-sub { margin: 0 0 16px; color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.spot-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.spot-choice {
  --tile-bg: rgba(29, 38, 33, 0.06); --tile-fg: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px 8px 14px;
  border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 650; font-size: 0.98rem; cursor: pointer;
  transition: transform 0.08s ease, border-color 0.2s ease;
}
.spot-choice:active { transform: scale(0.97); border-color: var(--tile-fg); }
.spot-tile {
  width: 100%; height: 72px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--tile-bg); color: var(--tile-fg);
}
.spot-ico { width: 64px; height: 32px; fill: currentColor; }
.spot-ico.line { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sc-bat   { --tile-bg: rgba(109, 79, 124, 0.09); --tile-fg: #6d4f7c; }
.sc-bird  { --tile-bg: rgba(47, 95, 127, 0.09);  --tile-fg: #2f5f7f; }
.sc-other { --tile-bg: rgba(184, 97, 28, 0.09);  --tile-fg: #9a5a1f; }
.sc-dummy { --tile-bg: rgba(47, 107, 79, 0.09);  --tile-fg: #2f6b4f; }
:root:not(.light) .spot-choice { --tile-bg: rgba(231, 236, 231, 0.07); }
:root:not(.light) .sc-bat   { --tile-fg: #c3a5d1; }
:root:not(.light) .sc-bird  { --tile-fg: #8db8d6; }
:root:not(.light) .sc-other { --tile-fg: #e0a86b; }
:root:not(.light) .sc-dummy { --tile-fg: #7cc49b; }

/* ---- Full-screen observation form ---------------------------------------- */
.obs {
  position: absolute; inset: 0; z-index: 4200;
  background: var(--bg); color: var(--text);
  display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + 8px) 0 calc(var(--safe-bottom) + 10px);
}
.obs-head { display: flex; align-items: flex-start; gap: 10px; padding: 4px 14px 8px; }
.obs-titles { flex: 1; min-width: 0; }
.obs-title { font-size: 1.2rem; font-weight: 800; }
.obs-step { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.obs-progress { display: flex; gap: 6px; padding: 0 14px 10px; max-width: 600px; width: 100%; margin: 0 auto; }
.obs-dot { height: 4px; flex: 1; border-radius: 999px; background: var(--border); }
.obs-dot.done { background: var(--accent); opacity: 0.55; }
.obs-dot.on { background: var(--accent); }
.obs-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 4px 14px 14px; max-width: 600px; width: 100%; margin: 0 auto;
  display: flex; flex-direction: column; gap: 14px;
}
.obs-field { display: flex; flex-direction: column; gap: 6px; }
.obs-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.obs-input {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 0.95rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
}
.obs-input:focus { outline: none; border-color: var(--accent); }
/* Auto-generated, non-editable field (e.g. the carcass ID code). */
.obs-input.obs-readonly {
  background: var(--surface-2); color: var(--muted);
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
textarea.obs-input { resize: vertical; min-height: 72px; }
/* Multi-tick field (e.g. Eyes): a wrapping row of selectable boxes. */
.obs-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.obs-check {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 9px 12px; font-size: 0.92rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  user-select: none;
}
.obs-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.obs-check:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
.obs-gps {
  font-variant-numeric: tabular-nums; font-size: 0.92rem; color: var(--text);
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: 12px; padding: 11px 13px;
}
.obs-foot { display: flex; gap: 10px; padding: 10px 14px 0; max-width: 600px; width: 100%; margin: 0 auto; }
.obs-foot .ctl { flex: 1; justify-content: center; padding: 14px 20px; font-size: 1rem; }

/* ---- GPS field: manual placement -------------------------------------- */
.obs-gps-tag { color: var(--accent); font-weight: 700; font-variant-numeric: normal; letter-spacing: 0; }
.obs-gps-actions { display: flex; gap: 8px; margin-top: 8px; }
.obs-gps-actions .ctl { padding: 11px 14px; font-size: 0.92rem; }
.obs-gps-actions .wide { flex: 1; justify-content: center; }

/* ---- Collapsible form header (tap to peek at the map) ----------------- */
.obs-head { cursor: pointer; user-select: none; }
.obs-headchev { font-size: 1rem; color: var(--muted); padding: 2px 2px 0; transition: transform 0.15s ease; }
.obs-collapse-hint { display: none; }
.obs.collapsed { background: transparent; pointer-events: none; }
.obs.collapsed .obs-head {
  pointer-events: auto; background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.obs.collapsed .obs-headchev { transform: rotate(180deg); }
.obs.collapsed .obs-step { display: none; }
.obs.collapsed .obs-collapse-hint { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.obs.collapsed .obs-progress,
.obs.collapsed .obs-body,
.obs.collapsed .obs-foot { display: none; }

/* ---- Place-on-map bar (form hidden, map visible) --------------------- */
.obs-place-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4300;
  padding: 12px 14px calc(var(--safe-bottom) + 12px);
  background: var(--bg); border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.35);
}
.obs-place-bar.hidden { display: none; }
.obs-place-msg { font-size: 0.85rem; color: var(--muted); text-align: center; }
.obs-place-actions { display: flex; gap: 10px; max-width: 600px; width: 100%; margin: 0 auto; }
.obs-place-actions .ctl { flex: 1; justify-content: center; padding: 14px 20px; font-size: 1rem; }

/* ---- select + free-text "Other" field ------------------------------------ */
.obs-other { margin-top: 8px; }
.obs-other.hidden { display: none !important; }

/* ---- image-select (preservation degree) ---------------------------------- */
/* "Show reference photos" toggle — photos are off by default. */
.img-phototoggle {
  align-self: stretch; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 14px;
  /* Solid deep "luxury" emerald with near-white letters — high contrast and
     readable on both the light and dark themes (not the bright neon accent). */
  background: #14633f; border: 1.5px solid #3f9e74; border-radius: 12px;
  color: #f3fbf6; font: inherit; font-size: 0.95rem; font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.img-phototoggle:active { transform: scale(0.99); }
/* While photos are open the button reads as "active" — a touch brighter. */
.img-phototoggle.open { background: #1b7d51; border-color: #4fb586; color: #ffffff; }
/* Default: a compact text list of degrees (no photos). */
.img-select { display: flex; flex-direction: column; gap: 8px; }
.img-card {
  display: flex; flex-direction: column; gap: 0;
  border: 2px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--surface); color: var(--text); cursor: pointer; text-align: left;
  font: inherit; padding: 0;
}
.img-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
/* Re-sighting: the degree recorded last time, so the surveyor can confirm/update. */
.img-card.prev { border-color: #f59e0b; border-style: dashed; }
.img-card .prev-tag { display: inline-block; margin-top: 3px; color: #f59e0b; font-weight: 700; font-size: 0.7rem; }
.img-card .thumb { display: none; }   /* hidden until "show reference photos" */
.img-card .cap { padding: 11px 12px; font-size: 0.85rem; font-weight: 600; }
.img-card .cap small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; font-size: 0.74rem; }

/* When photos are shown: 2-up image cards for visual comparison. */
.img-select.show-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.img-select.show-photos .img-card .thumb {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2);
}
.img-select.show-photos .img-card .thumb.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.72rem; text-align: center; padding: 6px;
}
.img-select.show-photos .img-card .cap { padding: 8px 10px; font-size: 0.8rem; }

/* ---- New-registration setup (bottom card, map stays tappable above) ------ */
.setup-sheet {
  position: absolute; inset: 0; z-index: 1600;
  pointer-events: none;                /* let taps reach the map above the card */
  display: flex; flex-direction: column; justify-content: flex-end;
}
.setup-sheet .sheet-card { pointer-events: auto; }   /* the card itself is interactive */
.start-hint { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 6px; }
/* "Place on map" pinpoint/target icon — distinct from the round 📍 location pin. */
.place-ico {
  width: 17px; height: 17px; display: inline-block; vertical-align: -3px; margin-right: 6px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- Collapsible registration card (tap the title to peek at the map) ---- */
.sheet-card h3 { cursor: pointer; user-select: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.start-headchev { font-size: 0.9rem; color: var(--muted); transition: transform 0.15s ease; }
.start-collapse-hint { display: none; }
/* Collapsed: shrink the card to just its title bar so the map shows through. */
.sheet-card.collapsed { padding-bottom: calc(12px + var(--safe-bottom)); }
.sheet-card.collapsed > :not(h3):not(.start-collapse-hint) { display: none; }
.sheet-card.collapsed h3 { margin-bottom: 0; }
.sheet-card.collapsed .start-headchev { transform: rotate(180deg); }
.sheet-card.collapsed .start-collapse-hint { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 6px; }
/* Auto search-visit-number boxes (this surveyor | total) in the start form. */
.visit-no-row { display: flex; gap: 8px; }
.visit-no-box {
  flex: 1; display: flex; flex-direction: row; gap: 6px; align-items: center; justify-content: space-between;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px;
}
.visit-no-box .vn-label { font-size: 0.66rem; color: var(--muted); text-align: left; line-height: 1.15; }
.visit-no-box .vn-num { font-size: 1.05rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.start-toggle {
  display: flex; align-items: center; gap: 9px; margin: 14px 0 4px;
  font-size: 0.88rem; color: var(--text); cursor: pointer;
}
.start-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Live "others walking here now" pin — a coloured person marker that pulses so a
   moving surveyor reads apart from the static turbine/mark pins. Colour is set
   inline per-surveyor (matches their route colour). */
.live-other-pin span {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  color: #fff; font-size: 0.72rem; font-weight: 700;
  border: 2px solid #fff; box-shadow: 0 0 0 0 rgba(34,197,94,0.55); animation: liveOtherPulse 2s infinite;
}
.live-other-pin span i { transform: rotate(45deg); font-style: normal; }
@keyframes liveOtherPulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  70%  { box-shadow: 0 0 0 11px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* "Previous routes at this turbine" surveyor picker in the registration sheet. */
.ghost-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.ghost-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 4px; font-size: 0.86rem; color: var(--text); cursor: pointer;
  border-radius: 8px;
}
.ghost-item:hover { background: var(--surface-2, rgba(127, 127, 127, 0.08)); }
.ghost-item input { width: 17px; height: 17px; accent-color: var(--accent); flex: 0 0 auto; }
.ghost-swatch { width: 22px; height: 4px; flex: 0 0 auto; border-radius: 2px; }
.ghost-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "Use my current location" button — full-width like before, just a bit smaller.
   Needs .ctl.ghost.loc-btn (two classes) to beat .ctl.ghost's fixed 52px size. */
.ctl.ghost.loc-btn {
  width: 100%; height: auto;
  padding: 10px 14px;
  font-size: 0.9rem; font-weight: 600;
  border-radius: 12px;
  margin: 2px 0 0;
}

/* Collapsible (advanced) field — collapsed by default, tap the summary to open. */
.obs-collapse { gap: 0; }
.obs-collapse-summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4px 0;
}
.obs-collapse-summary::-webkit-details-marker { display: none; }
.obs-chevron { color: var(--muted); font-size: 0.8rem; transition: transform 0.15s ease; }
.obs-collapse[open] .obs-chevron { transform: rotate(180deg); }
.obs-collapse-body { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

/* ---- Field label + ⓘ info icon ------------------------------------------- */
.obs-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.info-btn {
  flex: none; width: 21px; height: 21px; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  /* Quiet outlined circle — present, but never louder than the field label. */
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit; font-family: var(--serif); font-size: 0.78rem; font-weight: 700; font-style: italic; line-height: 1;
  cursor: pointer; transition: transform 0.08s ease;
}
.info-btn:active { transform: scale(0.9); }

/* ---- Rotor-diameter / single-wing segmented toggle ----------------------- */
.wing-toggle { display: flex; gap: 6px; }
.wing-mode {
  flex: 1; padding: 8px 6px; font: inherit; font-size: 0.78rem; font-weight: 600;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.wing-mode.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
/* Turbine-entry toggle: larger, taller buttons than the rotor toggle. */
.entry-toggle .wing-mode { padding: 13px 10px; font-size: 0.95rem; border-radius: 12px; }
/* Give the place / turbine pickers room so they don't crowd the action buttons
   while the detail fields are still hidden in "Select turbine" mode. */
#start-place-field, #start-preset-field { margin-bottom: 22px; }
#start-place-field .obs-input, #start-preset-field .obs-input { padding: 13px 12px; font-size: 0.95rem; }

/* Read-only turbine-parameter card (Select turbine mode). Fixed values only. */
.preset-summary .pp-grid {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); overflow: hidden;
}
.preset-summary .pp-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 14px; border-top: 1px solid var(--border);
}
.preset-summary .pp-row:first-child { border-top: none; }
.preset-summary .pp-k { color: var(--muted); font-size: 0.85rem; }
.preset-summary .pp-v { font-weight: 600; font-size: 0.95rem; text-align: right; }

/* ---- Field-info modal (description + reference image) -------------------- */
.info-modal {
  position: absolute; inset: 0; z-index: 4600;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.info-modal.hidden { display: none; }
.info-card {
  width: 100%; max-width: 460px; max-height: 84vh; overflow-y: auto;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px; padding: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.info-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.info-head h3 { margin: 0; font-size: 1.02rem; }
.info-figure {
  width: 100%; border-radius: 12px; overflow: hidden; margin-bottom: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.info-figure img { display: block; width: 100%; height: auto; }
.info-figure img.hidden { display: none; }
.info-img-ph {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 3; color: var(--muted); font-size: 0.8rem; text-align: center; padding: 12px;
}
.info-img-ph.hidden { display: none; }
.info-desc { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--text); }

/* ---- Super-user summary view --------------------------------------------- */
.summary-controls { padding: 10px 16px 4px; display: flex; flex-direction: column; gap: 10px; }
.sc-row { display: flex; gap: 10px; }
.sc-field {
  display: flex; flex-direction: column; gap: 4px; flex: 1;
  font-size: 0.72rem; font-weight: 600; color: var(--muted);
}
.sc-field input {
  font: inherit; font-size: 0.9rem; padding: 8px 10px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
}
.sc-field.sc-grow { flex: 3; }
.sc-field.sc-narrow { flex: 1; }
.sum-section-title { margin: 6px 0 8px; font-size: 0.95rem; font-weight: 700; color: var(--text); }
.sum-sub { font-size: 0.75rem; color: var(--muted); margin: -4px 0 10px; }
.turb-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  background: var(--surface); margin-bottom: 10px;
}
.turb-card.tappable { cursor: pointer; transition: border-color 0.15s ease, transform 0.08s ease; }
.turb-card.tappable:active { transform: scale(0.99); }
.turb-card.tappable:hover { border-color: var(--accent); }
.tc-chev { color: var(--muted); font-size: 0.85rem; margin-left: 6px; }
/* One turbine's visit list */
.visit-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border-soft, var(--border));
}
.visit-row:last-child { border-bottom: none; }
.visit-main { flex: 1; min-width: 0; }
.visit-date { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.visit-sub { font-size: 0.76rem; color: var(--muted); margin-top: 2px; }
.visit-counts { font-size: 0.8rem; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.visit-open {
  flex: none; font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--accent);
  border: 1px solid var(--border); border-radius: 9px; padding: 6px 10px;
}
.turb-loc {
  font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--text);
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: 10px; padding: 9px 11px; margin: 4px 0 12px;
}
.turb-card .tc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.turb-card .tc-vas { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.turb-card .tc-visits { font-size: 0.75rem; color: var(--muted); }
.turb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.turb-metric {
  text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--surface-2);
}
.turb-metric .tm-cat { font-size: 0.72rem; color: var(--muted); }
.turb-metric .tm-avg { font-size: 1.15rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.turb-metric .tm-tot { font-size: 0.72rem; color: var(--muted); }
.sum-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sum-table { border-collapse: collapse; width: 100%; font-size: 0.78rem; }
.sum-table th, .sum-table td {
  border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top;
}
.sum-table th { background: var(--surface-2); color: var(--muted); font-weight: 600; white-space: nowrap; }
.sum-table td.num { text-align: center; font-variant-numeric: tabular-nums; }
.sum-empty { color: var(--muted); font-size: 0.85rem; padding: 16px 0; text-align: center; }

/* ---- Wind-turbine marker + range rings ----------------------------------- */
.turbine-icon { background: none; border: none; }
.turbine-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid #ef4444;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
}
/* Map control button to toggle the range rings (matches the layer toggle). */
.rings-toggle {
  font: inherit; font-size: 0.82rem; font-weight: 700; padding: 9px 13px;
  border: 1.5px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.06);
  white-space: nowrap; cursor: pointer;
}
.rings-toggle.on { border-color: var(--accent); color: var(--accent); }
.rings-toggle:active { transform: scale(0.96); }

/* ---- Combined map-options menu (base map / rings / coverage) -------------- */
/* One trigger pill; tapping it pops a small panel of toggles above it. */
.map-menu { position: relative; }
.map-menu-trigger {
  width: 52px; height: 52px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-soft); border-radius: 50%;
  background: var(--surface); color: var(--text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  cursor: pointer; transition: transform 0.08s ease, background 0.2s ease;
}
.map-menu-trigger:active { transform: scale(0.94); }
.map-menu-trigger.open { color: var(--accent); }
.map-menu-trigger .mm-gear {
  width: 23px; height: 23px; display: block;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.map-menu-trigger:active { transform: scale(0.96); }
.map-menu-trigger.open { border-color: var(--accent); color: var(--accent); }
.map-menu-panel {
  position: absolute; left: -6px; bottom: calc(100% + 14px);
  display: flex; flex-direction: column; gap: 2px; min-width: 236px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.map-menu-panel.hidden { display: none; }
.map-menu-item {
  display: flex; align-items: center; gap: 11px;
  font: inherit; font-size: 0.88rem; font-weight: 600; padding: 10px 10px; text-align: left;
  border: none; border-radius: 12px;
  background: transparent; color: var(--text);
  white-space: nowrap; cursor: pointer;
}
.map-menu-item:hover { background: var(--surface-2); }
.map-menu-item:active { transform: scale(0.98); }
.mm-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.mm-txt { flex: 1; }
/* On/off switch at the end of toggle rows — follows the row's .on class. */
.mm-switch { position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--border); transition: background 0.15s ease; }
.mm-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: transform 0.15s ease; }
.map-menu-item.on .mm-switch { background: var(--accent); }
.map-menu-item.on .mm-switch::after { transform: translateX(14px); }
.map-menu-item.on .mm-ico { color: var(--accent); }

/* ---- Photo viewer -------------------------------------------------------- */
.viewer {
  position: absolute; inset: 0; z-index: 4500;
  background: rgba(0, 0, 0, 0.92);
  overflow: hidden; padding: calc(var(--safe-top) + 8px) 10px calc(var(--safe-bottom) + 16px);
  touch-action: none;          /* we handle pinch/drag ourselves */
}
/* Fixed (not absolute) so it stays pinned in the corner while you scroll a
   long image on mobile. Solid backing keeps it visible over any photo. */
.viewer-close {
  position: fixed; top: calc(var(--safe-top) + 8px); right: 12px; z-index: 3;
  background: rgba(0, 0, 0, 0.6); border-radius: 999px;
}
/* Delete this photo — top-left, stays pinned while scrolling a zoomed image. */
.viewer-del {
  position: fixed; top: calc(var(--safe-top) + 8px); left: 12px; z-index: 3;
  background: rgba(185, 28, 28, 0.82); border-radius: 999px;
}
/* Prev / next arrows for paging between a walk's photos in the full-screen viewer. */
.viewer-nav {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 48px; height: 48px; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 2rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding-bottom: 4px;
}
.viewer-nav:active { background: rgba(0, 0, 0, 0.75); }
.viewer-nav.prev { left: 10px; }
.viewer-nav.next { right: 10px; }
.viewer-nav.hidden { display: none; }
/* "3 / 8" counter, centred at the top of the viewer. */
.viewer-count {
  position: fixed; top: calc(var(--safe-top) + 14px); left: 0; right: 0; z-index: 3;
  text-align: center; color: #fff; font-size: 0.9rem; font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); pointer-events: none;
}
.viewer-count:empty { display: none; }
/* Zoom in / out controls, bottom-right, above the note caption. */
.viewer-zoom {
  position: fixed; right: 12px; bottom: calc(var(--safe-bottom) + 14px);
  z-index: 4; display: flex; gap: 8px;
}
.viewer-zoom button {
  width: 46px; height: 46px; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 1.5rem; line-height: 1;
}
/* The whole image stack is pan/zoomed as one via transform (see app.js).
   Origin top-left keeps the zoom-to-point maths simple. */
.viewer-imgs {
  display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 44px;
  transform-origin: 0 0; will-change: transform; touch-action: none;
}
/* Fit a tall/long image within the screen so the whole thing is visible;
   gestures then zoom in from there. */
.viewer-imgs img {
  max-width: 100%; max-height: 80vh; width: auto; height: auto;
  object-fit: contain; border-radius: 12px; cursor: grab;
  -webkit-user-select: none; user-select: none; -webkit-user-drag: none;
}
/* Note as a caption floating over the bottom of the image (not below it).
   pointer-events:none so tapping through it still zooms the image. */
.viewer-note {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2;
  margin: 0; padding: 32px 16px calc(var(--safe-bottom) + 14px);
  color: #fff; font-size: 0.95rem; white-space: pre-wrap; text-align: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.viewer-note:empty { display: none; }

/* A mark that carries photos gets a subtle ring so you know it's tappable. */
.wp-has-photos { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.5); border-radius: 50%; }

/* ---- Media: split view (map on top, photo panel on the bottom) ----------- */
/* Sits just above the bottom controls (the ☰ menu row) and is clearly visible. */
.media-btn {
  position: absolute;
  left: 12px;
  bottom: calc(var(--safe-bottom) + 78px);
  z-index: 1300;
  background: var(--find);
  color: #fff;
  font: inherit;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.9);
  padding: 9px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
/* The open panel has its own ✕ Close, so hide the floating button while split. */
body.media-split .media-btn { display: none; }

/* When the panel is open, the map shrinks to the top half (Leaflet is told to
   re-measure via invalidateSize() in JS, so it re-centres in the visible area). */
body.media-split #map { bottom: 50%; }

/* On a wider screen (PC / landscape): photos panel on the LEFT third, map fills
   the RIGHT two-thirds. (Mobile keeps the stacked map-top / photos-bottom layout.) */
@media (min-width: 640px) {
  body.media-split #map { top: 0; bottom: 0; left: 33.333%; right: 0; }   /* map = right 2/3 */
  .media-panel {
    top: 0; bottom: 0; left: 0; right: auto; width: 33.333%; height: auto;
    border-radius: 0;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.55);   /* shadow on the panel's right edge */
  }
  .media-strip {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px; padding: 14px;
  }
}

.media-panel {
  position: absolute; left: 0; right: 0; bottom: 0; height: 50%;
  z-index: 1100; background: var(--bg);
  display: flex; flex-direction: column;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.55);
}
.media-panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--border-soft);
}
.media-title { font-size: 0.95rem; color: var(--text); font-weight: 600; }
.media-hint { flex: 1; font-size: 0.68rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-strip {
  flex: 1; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
  align-content: start;   /* thumbnails pack to the top instead of stretching down */
  padding: 12px 12px calc(var(--safe-bottom) + 14px);
}
/* A definite height (not just aspect-ratio, which some older WebViews ignore —
   that made tiles collapse and look like they overlapped) keeps every thumbnail
   the same clear, separated size. */
.media-tile {
  position: relative; height: 150px; aspect-ratio: auto;
  border-radius: 14px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-soft); cursor: pointer;
}
.media-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile.selected { outline: 3px solid var(--accent); outline-offset: -3px; }
.media-tile .open {
  position: absolute; top: 4px; right: 4px;
  background: rgba(0, 0, 0, 0.62); color: #fff; border: none; border-radius: 7px;
  font-size: 0.85rem; line-height: 1; padding: 4px 6px; cursor: pointer;
}
.media-tile .del {
  position: absolute; top: 4px; left: 4px;
  background: rgba(185, 28, 28, 0.88); color: #fff; border: none; border-radius: 7px;
  font-size: 0.8rem; line-height: 1; padding: 4px 6px; cursor: pointer;
}
.media-tile .badge {
  position: absolute; left: 4px; bottom: 4px;
  background: rgba(15, 22, 19, 0.72); color: #fff; font-weight: 700;
  border-radius: 999px; font-size: 0.66rem; padding: 2px 7px;
}
/* "Has a note" indicator, bottom-right corner of a media thumbnail. */
.media-tile .note-badge {
  position: absolute; right: 4px; bottom: 4px;
  background: rgba(0, 0, 0, 0.62); color: #fff; border: none; cursor: pointer;
  border-radius: 7px; font-size: 0.85rem; line-height: 1; padding: 3px 5px;
}
/* Offline: tiles are now cached/prefetched, so keep the map fully visible.
   A faint dim just hints at the offline state without hiding the map. */
body.offline .leaflet-tile-pane {
  opacity: 1;
  filter: none;
  transition: opacity 0.3s ease, filter 0.3s ease;
}


/* ===========================================================================
   Searcher-efficiency check mode: the planted objects on the live map, a
   "nearest object" readout, and the sheet that opens when you tap one.
   =========================================================================== */
.trial-hud {
  position: absolute; left: 50%; transform: translateX(-50%);
  /* Sits just under the GPS/status pill, never on top of it. */
  top: calc(var(--safe-top) + 118px); z-index: 700;
  max-width: 92vw; padding: 7px 14px; border-radius: 999px;
  background: var(--panel); color: var(--text);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  font-size: 0.82rem; font-weight: 600; text-align: center;
  box-shadow: var(--shadow);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trial-hud.hidden { display: none; }
.trial-hud b { color: var(--find); }
.trial-hud .near { color: var(--accent); font-weight: 700; }
.ts-info { font-size: 0.88rem; line-height: 1.55; margin-bottom: 8px; }
.ts-info .k { color: var(--muted); }
.ts-dist { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; color: var(--find); }
/* The planted-object label on the map. */
.leaflet-tooltip.trial-tip {
  background: var(--surface) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important; border-radius: 8px; font-weight: 700;
  box-shadow: var(--shadow);
}
.leaflet-tooltip.trial-tip::before { display: none; }
.leaflet-tooltip.trial-tip.done { color: var(--muted) !important; opacity: 0.85; }

/* Trial mode tag above the dock: Placing / Searching / Daily check. */
.mode-tag {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 1000;
  bottom: calc(var(--safe-bottom) + 82px);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px 6px 10px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
  color: #fff; box-shadow: var(--shadow);
}
.mode-tag .ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mode-tag.mt-place  { background: #9a5a1f; }
.mode-tag.mt-search { background: #2f6b4f; }
.mode-tag.mt-check  { background: #2f5f7f; }
/* Buttons with a leading icon inside sheets. */
.ctl.wide { gap: 9px; }
.ctl.wide .ico { width: 19px; height: 19px; }

/* "You are on the spot — can you see it?" prompt (searcher-efficiency mode). */
.found-sheet .found-msg { font-size: 0.92rem; line-height: 1.5; margin: 4px 0 14px; }
.found-sheet .found-actions { display: flex; flex-direction: column; gap: 8px; }

/* ---- Turbine findings map (Data management → Turbine map) ---------------------
   Picker row on top, then the map with the ring breakdown beside it (stacked
   under it on phones). */
.tmap-view { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.tmap-view.hidden { display: none; }
.tf-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 0 0 auto; }
.tf-select {
  font: inherit; font-size: 0.85rem; padding: 7px 9px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); min-width: 0; max-width: 100%;
}
.tf-chips { display: flex; gap: 4px; margin-left: auto; }
.tf-chip {
  font: inherit; font-size: 0.76rem; font-weight: 700; cursor: pointer; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.tf-chip.on { border-color: var(--accent); background: var(--surface-2); color: var(--text); }
.tf-wrap { flex: 1; min-height: 0; display: flex; gap: 10px; }
.tf-map-host { flex: 1; min-width: 0; min-height: 0; position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); }
.tf-map { position: absolute; inset: 0; background: var(--map-bg); }
.tf-side {
  flex: 0 0 320px; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 10px; padding: 2px 10px 8px 2px;
}
.tf-side > * { flex: 0 0 auto; }
@media (max-width: 760px) {
  .tf-wrap { flex-direction: column; overflow-y: auto; }
  .tf-map-host { flex: 0 0 auto; height: 42vh; height: 42dvh; min-height: 240px; }
  .tf-side { flex: 0 0 auto; overflow: visible; }
  .tf-chips { margin-left: 0; }
}
.tf-side-head { font-size: 0.95rem; }
/* "Details ↓" on the map — phones only, where the details are stacked under it. */
.tf-to-side { display: none; }
@media (max-width: 760px) {
  .tf-to-side {
    display: inline-flex; align-items: center; position: absolute; z-index: 500; left: 50%; bottom: 10px;
    transform: translateX(-50%); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer;
    padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  }
}
.tf-top { background: var(--surface); border: 1px solid var(--border); box-shadow: inset 3px 0 0 var(--find); border-radius: 16px; padding: 12px 14px; }
.tf-top .dv-sect { margin: 0; }
.tf-top-band { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; color: var(--find); margin: 2px 0; }
.tf-bars { display: flex; flex-direction: column; gap: 3px; }
.tf-bar-row { display: grid; grid-template-columns: 84px 1fr 26px; gap: 7px; align-items: center; font-size: 0.74rem; }
.tf-bar-row.zero { opacity: 0.45; }
.tf-bar-lbl { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-bar-track { height: 9px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.tf-bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.tf-bar-row.top .tf-bar-fill { background: var(--find); }
.tf-bar-row.top .tf-bar-lbl, .tf-bar-row.top .tf-bar-n { color: var(--find); font-weight: 800; }
.tf-bar-n { text-align: right; font-variant-numeric: tabular-nums; }
.tf-dirs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tf-dir { font-size: 0.74rem; text-align: center; padding: 5px 0; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.tf-dir.top { border-color: var(--find); color: var(--text); font-weight: 700; }
.tf-list { display: flex; flex-direction: column; gap: 5px; }
.tf-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; cursor: pointer;
}
.tf-item.on { border-color: var(--accent); background: var(--surface-2); }
.tf-item small { font-weight: 500; color: var(--muted); }
.tf-item .dv-sub { white-space: normal; }
.tf-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; border: 2px solid #fff; }
.tf-foot { margin-top: 4px; }
.tf-ring-lbl { font-size: 10px; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; white-space: nowrap; }
.tf-popup .leaflet-popup-content { margin: 10px 12px; font-size: 12px; line-height: 1.35; }
.tf-pop-title { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.tf-pop-sect { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-top: 6px; }
.tf-pop-field { font-weight: 600; }
.tf-pop-kv { border-collapse: collapse; margin-top: 6px; }
.tf-pop-kv th { text-align: left; font-weight: 600; color: var(--muted); padding: 1px 8px 1px 0; vertical-align: top; white-space: nowrap; }
.tf-pop-kv td { padding: 1px 0; }
.tf-pop-row { font-size: 11px; }

.tf-thumbs img { width: 64px; height: 48px; }
.tf-popup .tf-thumbs img { width: 72px; height: 54px; }
.tf-top-band.tie { font-size: 0.95rem; }
.tf-item { align-items: flex-start; }
.tf-item .tf-dot { margin-top: 4px; }
.tf-plain { background: #f5ecd7 !important; }
.tf-plain .tf-ring-lbl { color: #334155; text-shadow: 0 0 3px #f5ecd7, 0 0 2px #f5ecd7; }
.tf-plain .tf-sector-lbl { color: #475569; text-shadow: 0 0 3px #f5ecd7; }
.tf-plain .tf-sector-lbl b { color: #0f172a; }
.tf-plain .tf-sector-lbl.top, .tf-plain .tf-sector-lbl.top b { color: #d97706; }
.tf-sector-lbl { font-size: 11px; font-weight: 700; color: #cbd5e1; text-align: center; line-height: 1.1;
  text-shadow: 0 0 3px #000; }
.tf-sector-lbl b { display: block; font-size: 14px; color: #fff; }
.tf-sector-lbl.top, .tf-sector-lbl.top b { color: #f0a35e; }

/* Delete a find (admin) + the restore list. */
.tf-del { margin-top: 8px; width: 100%; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  padding: 7px 8px; border-radius: 10px; border: 1px solid var(--bad-fg); background: var(--bad-bg); color: var(--bad-fg);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tf-del-one { font-size: 10px; padding: 0 4px; margin-left: 4px; cursor: pointer; border: 0; background: none; opacity: 0.7; }
.tf-del-one:hover { opacity: 1; }
.tf-trash { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.tf-trash summary { cursor: pointer; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.tf-trash-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tf-trash-row .dv-sub { white-space: normal; }

/* Band table (Turbine map → 📊 Band table). */
.tf-modes { margin-left: 0; }
.tf-table-view { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.tf-table-view > * { flex: 0 0 auto; }
.tf-table-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; justify-content: space-between; }
.tf-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.tf-table { border-collapse: collapse; width: 100%; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.tf-table th, .tf-table td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; white-space: nowrap; }
.tf-table th { font-weight: 700; vertical-align: bottom; white-space: normal; min-width: 70px; }
.tf-table th small { display: block; font-weight: 500; color: var(--muted); font-size: 0.7rem; margin-top: 2px; }
.tf-table tbody tr.has td { background: var(--surface-2); font-weight: 600; }
.tf-table tfoot td { font-weight: 800; }
.tf-s { max-width: 640px; }

/* ---- Sheets: breathing room between fields, flat buttons on the card ------ */
.sheet-card .obs-field + .obs-field,
.sheet-card .obs-field + #start-details,
.sheet-card #start-details + .obs-field { margin-top: 14px; }
.sheet-card .ctl { box-shadow: none; }
.sheet-card .ctl.ghost, .sheet-actions .ctl.ghost { width: auto; background: var(--surface); border: 1px solid var(--border); }
.sheet-actions .ctl { height: 50px; font-size: 1rem; }
.sheet-actions { margin-top: 16px; }

/* ===========================================================================
   Overview ("Your season") — the data view's front door.
   =========================================================================== */
.story-view {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 12px; padding: 0 2px 14px;
}
.story-view.hidden { display: none; }
.story-view > * { flex: none; }
.story-loading { color: var(--muted); text-align: center; padding: 40px 10px; font-size: 0.9rem; }
.story-hero { padding: 6px 4px 4px; }
.story-eyebrow { margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.story-title { margin: 6px 0 8px; font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 8vw, 2.4rem); line-height: 1.08; letter-spacing: -0.01em; }
.story-lead { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.5; max-width: 38em; }

.story-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.story-tile {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 13px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
}
.story-tile b { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; }
.story-tile > span:last-child { font-size: 0.78rem; color: var(--muted); }
.st-ico { height: 22px; display: flex; align-items: center; color: var(--muted); margin-bottom: 4px; }
.st-ico .lico { width: 20px; height: 20px; }
.st-glyph { width: 36px; height: 18px; fill: currentColor; }
.st-bat .st-ico { color: #5b4bb0; } .st-bird .st-ico { color: #c0702a; }
:root:not(.light) .st-bat .st-ico { color: #7a6ce0; } :root:not(.light) .st-bird .st-ico { color: #b8752f; }

.story-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 14px 12px; }
.story-h { margin: 0 0 10px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.story-h-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.story-count { font-size: 0.78rem; color: var(--muted); }
.story-note { margin: -4px 0 8px; font-size: 0.86rem; color: var(--text); }

/* chart */
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-left: 6px; }
.chart-wrap { position: relative; }
.story-chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.story-chart-svg .grid { stroke: var(--border); stroke-width: 1; }
.story-chart-svg .ax { fill: var(--muted); font-size: 10px; font-family: inherit; }
.story-chart-svg .hit { fill: transparent; cursor: pointer; }
.story-chart-svg .hit.on { fill: var(--text); opacity: 0.05; }
.chart-tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%); pointer-events: none;
  background: var(--text); color: var(--bg); border-radius: 10px; padding: 7px 10px;
  font-size: 0.78rem; line-height: 1.4; white-space: nowrap; box-shadow: var(--shadow);
}
.story-table { margin-top: 6px; font-size: 0.8rem; }
.story-table summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 4px 0; }
.story-table table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.story-table th, .story-table td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--border-soft); }
.story-table th { color: var(--muted); font-weight: 600; }

/* species + recent finds */
.species { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.species li { display: grid; grid-template-columns: 30px 1fr 30% 26px; align-items: center; gap: 10px; font-size: 0.88rem; }
.sp-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.sp-glyph { width: 22px; height: 11px; fill: currentColor; }
.sp-bat { background: rgba(91, 75, 176, 0.1); color: #5b4bb0; }
.sp-bird { background: rgba(192, 112, 42, 0.1); color: #c0702a; }
:root:not(.light) .sp-bat { background: rgba(122, 108, 224, 0.16); color: #9d92ea; }
:root:not(.light) .sp-bird { background: rgba(184, 117, 47, 0.16); color: #d39a5c; }
.sp-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.sp-bar span { display: block; height: 100%; border-radius: 999px; background: var(--muted); opacity: 0.55; }
.sp-n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.recent { display: flex; flex-direction: column; gap: 2px; }
.recent-row { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; font: inherit; color: var(--text);
  background: none; border: 0; border-radius: 12px; padding: 7px 4px; cursor: pointer; }
.recent-row:hover { background: var(--surface-2); }
.rr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rr-main b { font-weight: 650; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-main small { color: var(--muted); font-size: 0.76rem; }
.rr-go { color: var(--muted); }

/* photos */
.photo-strip { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scroll-snap-type: x proximity; }
.ps-tile { position: relative; flex: none; width: 112px; height: 112px; border-radius: 14px; overflow: hidden; padding: 0; border: 0;
  background: var(--surface-2); cursor: pointer; scroll-snap-align: start; }
.ps-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ps-tile span { position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 999px; font-size: 0.66rem; font-weight: 700;
  background: rgba(15, 22, 19, 0.7); color: #fff; }
.story-link { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0;
  font: inherit; font-size: 0.86rem; font-weight: 650; color: var(--accent); cursor: pointer; }

/* places + onward */
.place-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.place-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: var(--surface-2);
  font-size: 0.84rem; font-weight: 600; }
.place-chip .lico { color: var(--muted); }
.place-chip b { color: var(--muted); font-weight: 700; margin-left: 2px; }
.story-next { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 2px; }
.story-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 999px;
  font: inherit; font-size: 0.95rem; font-weight: 650; cursor: pointer; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.story-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; flex: 1; }
@media (max-width: 759px) { .story-btn { flex: 1 1 100%; } }

@media (min-width: 760px) {
  .story-view { display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 14px; }
  .story-hero, .story-tiles, .story-chart, .story-photos, .story-next { grid-column: 1 / -1; }
  .story-tiles { grid-template-columns: repeat(4, 1fr); }
  .story-title { font-size: 2.8rem; }
}

/* ===========================================================================
   Data screens — shared icons and the finishing pass on Your walks, walk
   detail, VAS data, Gallery, Test results, Placed objects and Turbine map.
   =========================================================================== */
.ui-i { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cg { display: inline-block; flex: none; fill: currentColor; vertical-align: -2px; }
.cg-bat, .cg-bird { width: 22px; height: 11px; }
.cg-other, .cg-dummy { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cg-bat { color: var(--bat); } .cg-bird { color: var(--bird); } .cg-other { color: var(--find); } .cg-dummy { color: var(--accent); }
.drawer-head .ctl.ghost .ui-i { width: 20px; height: 20px; }

/* Your walks — icon tile · title + meta · arrow */
.walk-card { gap: 12px; padding: 11px 12px; transition: border-color 0.15s ease; }
.walk-card:hover { border-color: var(--muted); }
.wc-ico { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); }
.wc-ico .ui-i { width: 20px; height: 20px; }
.wc-ico.live { background: var(--ok-bg); color: var(--ok-fg); }
.walk-card .info .title { font-weight: 650; font-size: 0.95rem; }
.walk-card .meta .ui-i, .walk-card .meta .lico { width: 13px; height: 13px; }
.live-txt { color: var(--ok-fg); font-weight: 700; }
.walk-card .open { width: 34px; height: 34px; padding: 0; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--muted); }
.walk-card .open .ui-i { width: 16px; height: 16px; }
.walk-card .del { color: var(--faint, var(--muted)); }
.walk-card .del:hover { color: var(--accent-stop); }
.walk-day { font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; border-top: 0; padding: 12px 4px 6px; }
.walk-group { color: var(--muted); border-top: 0; padding-top: 10px; }
.turbine-group { background: var(--surface); border-radius: 14px; }
.combined-actions .open, .combined-actions .more-item { display: inline-flex; align-items: center; gap: 5px; width: auto; height: auto; border-radius: 999px; padding: 5px 11px; }
.user-item { border-radius: 12px; }
.pane-mode { border-radius: 10px; }
.wk-chip { border-radius: 10px; }

/* Walk detail */
.detail-summary { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.sum-chip { border-radius: 16px; padding: 12px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sum-chip .sc-g { height: 16px; display: flex; align-items: center; }
.sum-chip .n { font-family: var(--serif); font-size: 1.8rem; font-weight: 600; }
.sum-chip .l { font-size: 0.66rem; letter-spacing: 0.06em; font-weight: 700; }
.detail-meta, .mort, .wx, .mark-card, .turb-card, .markdetail-note { border-radius: 16px; }
.detail-meta { padding: 8px 14px; }
.detail-meta div { padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.detail-meta div:last-child { border-bottom: 0; }
.detail-section-title { font-size: 0.72rem; letter-spacing: 0.07em; margin: 14px 2px 8px; }
.wx-title, .mort-title { display: flex; align-items: center; gap: 7px; }
.wx-head > span { display: inline-flex; align-items: center; gap: 7px; }
.mort { box-shadow: inset 3px 0 0 var(--bat); }
.mort-result .mort-m { font-family: var(--serif); font-size: 2rem; font-weight: 600; color: var(--bat); }
.mark-card.compact { padding: 11px 13px; }
.mc-row .cat { display: inline-flex; align-items: center; gap: 7px; }
.mc-photos { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.mc-chev { display: inline-flex; }
.mc-chev .ui-i { width: 15px; height: 15px; }
.gone-note { background: var(--bad-bg); border-color: transparent; color: var(--text); }
.markdetail-actions .ctl { display: inline-flex; align-items: center; gap: 7px; }
.detail-actions { border-top: 1px solid var(--border); gap: 8px; }
.detail-actions .ctl.primary .ui-i, .act-btn .ui-i, .ghost-pill .ui-i { width: 17px; height: 17px; }
.more-item { display: flex; align-items: center; gap: 8px; }
.ctl.ghost-pill { background: var(--surface); border: 1px solid var(--border); height: 52px; padding: 0 20px; display: inline-flex; align-items: center; gap: 7px; box-shadow: none; }

/* VAS data summary + one turbine */
.summary-controls { padding: 6px 0 4px; }
.sc-field input, .tf-select, .walk-filter select { border-radius: 12px; background: var(--surface); }
.sum-section-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin: 14px 2px 6px; }
.turb-card { padding: 14px; }
.turb-card .tc-vas { display: inline-flex; align-items: center; gap: 6px; font-size: 1rem; }
.tc-chev .ui-i { width: 14px; height: 14px; vertical-align: -2px; }
.turb-metric { border-radius: 12px; padding: 10px 4px 8px; }
.turb-metric .tm-cat { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; }
.turb-metric .tm-avg { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.visit-counts { display: inline-flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.vc { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.vc .cg-bat, .vc .cg-bird { width: 18px; height: 9px; }
.vc .cg-other, .vc .cg-dummy { width: 12px; height: 12px; }
.vc-tot { color: var(--muted); }
.visit-open { border-radius: 999px; padding: 6px 13px; }
.turb-loc { display: flex; align-items: center; gap: 7px; border-style: solid; border-color: transparent; border-radius: 12px; }
.sum-table th { font-size: 0.7rem; letter-spacing: 0.03em; }
.sum-table, .sum-table th, .sum-table td { border-color: var(--border-soft); }

/* Gallery */
.media-strip { gap: 10px; }
.media-tile { border: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.media-tile .open, .media-tile .note-badge { border-radius: 999px; background: rgba(15, 22, 19, 0.7); }
.media-tile .del { border-radius: 999px; }
.media-panel { background: var(--bg); }
.media-title { font-family: var(--serif); font-size: 1.1rem; }

/* Test results + Placed objects */
.dv-head { font-size: 0.7rem; letter-spacing: 0.07em; margin: 10px 2px 0; }
.dv-row { padding: 12px 14px; }
.dv-row:hover { background: var(--surface-2); }
.dv-title { font-weight: 650; font-size: 0.93rem; }
.dv-score, .dv-badge { font-weight: 700; }
.dv-thumbs img { border-radius: 10px; border: 0; }
.dv-sect { letter-spacing: 0.07em; }

/* Turbine map */
.tf-chip { display: inline-flex; align-items: center; gap: 6px; }
.tf-chip .ui-i { width: 15px; height: 15px; }
.tf-chip.on { background: var(--surface); border-color: var(--accent); color: var(--text); }
.tf-map-host { border-radius: 16px; }
.tf-item { border-radius: 12px; }
.tf-trash, .tf-table-wrap { border-radius: 14px; }
.tf-trash summary { display: flex; align-items: center; gap: 6px; }
.tf-pop-title { display: flex; align-items: center; gap: 6px; }

/* Sub-pages (walk detail, VAS data, Gallery, one turbine): title beside the back arrow. */
.drawer.detail .drawer-head { justify-content: flex-start; gap: 12px; }
.drawer.detail .drawer-head h2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.detail-actions .ctl.primary { white-space: nowrap; }
.dv-stats { gap: 8px; }
.dv-box { padding: 11px 12px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.dv-box .l { font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.dv-box .n { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; line-height: 1.15; margin-top: 2px; }
.dv-stats .dv-box:first-child .n { color: var(--accent); }
.dv-stats { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .dv-stats { grid-template-columns: repeat(4, 1fr); } }
/* Combined-walk card actions: Map · GPX · CSV · PDF all read as one family —
   the PDF is a <button> (it is built on the phone), the others are links. */
.combined-actions .more-item, .combined-actions button.more-item {
  appearance: none; -webkit-appearance: none; background: none; border: 0; box-shadow: none;
  font: inherit; font-size: 0.8rem; font-weight: 650; color: var(--text); text-decoration: none; cursor: pointer;
}
.combined-actions .more-item:hover { background: var(--surface-2); }

/* ===========================================================================
   Your walks — the explorer (field calendar + turbines), the story of the
   selection, and the day-by-day logbook with its walks on a timeline.
   =========================================================================== */
.explorer { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px 14px 14px; margin-bottom: 12px; }
.ex-eyebrow { margin: 0; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.ex-title { margin: 4px 0 2px; font-family: var(--serif); font-size: 1.55rem; font-weight: 600; line-height: 1.15; }
.ex-sub { margin: 0 0 12px; color: var(--muted); font-size: 0.86rem; }
.ex-cal { display: flex; gap: 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; padding-bottom: 4px; }
.cal-month { flex: none; width: 238px; scroll-snap-align: start; }
.cal-h { font-size: 0.82rem; font-weight: 650; margin-bottom: 6px; }
.cal-wd, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-wd span { font-size: 0.6rem; color: var(--faint, var(--muted)); text-align: center; font-weight: 600; }
.cd { position: relative; height: 30px; border-radius: 8px; display: grid; place-items: center; font: inherit; font-size: 0.7rem;
  color: var(--faint, var(--muted)); background: transparent; border: 0; padding: 0; font-variant-numeric: tabular-nums; }
.cd.pad { visibility: hidden; }
.cd.on { cursor: pointer; color: var(--text); font-weight: 700; }
/* One hue, light → dark, by walks that day. */
.cd.l1 { background: rgba(47, 107, 79, 0.16); }
.cd.l2 { background: rgba(47, 107, 79, 0.36); }
.cd.l3 { background: #2f6b4f; color: #fff; }
:root:not(.light) .cd.l1 { background: rgba(124, 196, 155, 0.18); }
:root:not(.light) .cd.l2 { background: rgba(124, 196, 155, 0.38); }
:root:not(.light) .cd.l3 { background: #7cc49b; color: #0f1613; }
.cd.on:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.cd.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.cd .dots { position: absolute; left: 0; right: 0; bottom: 3px; display: flex; justify-content: center; gap: 2px; }
.dot-bat, .dot-bird { display: inline-block; width: 5px; height: 5px; border-radius: 50%; box-shadow: 0 0 0 1px var(--surface); }
.dot-bat { background: var(--bat); } .dot-bird { background: var(--bird); }
.cal-key { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 0.72rem; color: var(--muted); }
.cal-key span { display: inline-flex; align-items: center; gap: 4px; }
.cal-key .k { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.cal-key .k.l1 { background: rgba(47, 107, 79, 0.16); } .cal-key .k.l2 { background: rgba(47, 107, 79, 0.36); } .cal-key .k.l3 { background: #2f6b4f; }
:root:not(.light) .cal-key .k.l1 { background: rgba(124, 196, 155, 0.18); }
:root:not(.light) .cal-key .k.l2 { background: rgba(124, 196, 155, 0.38); }
:root:not(.light) .cal-key .k.l3 { background: #7cc49b; }
.ex-sect { margin: 14px 0 7px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.ex-turbines { display: flex; gap: 7px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 3px; }
.tchip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 10px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 0.84rem; color: var(--text); background: var(--surface-2); border: 1px solid transparent; }
.tchip .lico { color: var(--muted); }
.tchip small { color: var(--muted); font-size: 0.72rem; }
.tchip .tc-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--surface); font-size: 0.72rem; font-weight: 700; }
.tchip.sel { border-color: var(--text); background: var(--surface); }
.tchip:hover { border-color: var(--accent); }
.finds { display: inline-flex; align-items: center; gap: 7px; margin-left: 7px; vertical-align: middle; }
.fd { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 0.78rem; }
.fd .cg-bat, .fd .cg-bird { width: 18px; height: 9px; }
.fd-bat { color: var(--bat); } .fd-bird { color: var(--bird); }

.explore-story { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 14px; padding: 14px 14px 14px 16px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: inset 4px 0 0 var(--accent); }
.explore-story > div { flex: 1; min-width: 0; }
.explore-story h4 { margin: 3px 0 4px; font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.explore-story p:last-child { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.45; }
.es-clear { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 0; }

/* Logbook: big date on the left, that day's walks on a timeline. */
.log-day { display: grid; grid-template-columns: 52px 1fr; gap: 10px; margin-bottom: 14px; }
.ld-date { display: flex; flex-direction: column; align-items: center; padding-top: 2px; line-height: 1.05; }
.ld-date b { font-family: var(--serif); font-size: 1.85rem; font-weight: 600; }
.ld-date span { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.ld-date small { font-size: 0.68rem; color: var(--muted); margin-top: 2px; }
.ld-body { min-width: 0; }
.ld-sum { display: flex; align-items: center; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); font-weight: 600; margin: 6px 0 8px; }
.ld-walks { position: relative; padding-left: 14px; }
.ld-walks::before { content: ''; position: absolute; left: 3px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--border); }
.ld-walks .walk-card { position: relative; margin-bottom: 8px; }
.ld-walks .walk-card::before { content: ''; position: absolute; left: -15px; top: 50%; width: 10px; height: 10px; margin-top: -5px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.ld-walks .walk-card .wc-ico { display: none; }
@media (min-width: 760px) {
  .cal-month { width: 260px; }
  .log-day { grid-template-columns: 64px 1fr; }
}

/* Admin / viewer on a phone: the Users / Places column becomes a sideways row of
   chips above the list, so the explorer and logbook get the full width. */
@media (max-width: 640px) {
  .walk-panes { flex-direction: column; gap: 8px; }
  .side-pane { flex: 0 0 auto; max-width: none; min-width: 0; border-right: 0; padding-right: 0; gap: 8px; }
  .user-pane { flex: 0 0 auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 6px; padding-bottom: 2px; }
  .user-item { flex: 0 0 auto; max-width: 190px; padding: 7px 12px; }
  .user-item.sub { margin-left: 0; }
  .user-item.on { box-shadow: inset 0 -3px 0 var(--accent); }
  .pane-modes { max-width: 260px; }
}

/* ===========================================================================
   Test results — "how good are our eyes": headline, numbers, the searchers
   board (found-rate bars with the team average marked), weeks, object types.
   =========================================================================== */
.seff-view { gap: 12px; padding: 0 2px 14px; }
.seff-view .story-hero .story-link { margin-top: 8px; }
.seff-view .story-link .ui-i { width: 15px; height: 15px; }
.story-tile b small { font-size: 0.55em; color: var(--muted); font-weight: 600; margin-left: 1px; }
.st-good b { color: var(--accent); }
.seff-board { display: flex; flex-direction: column; gap: 4px; }
.avg-key { display: inline-block; width: 2px; height: 12px; background: var(--text); margin-right: 5px; vertical-align: -2px; border-radius: 1px; }
.sb-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--text);
  background: none; border: 1px solid transparent; border-radius: 14px; padding: 9px 8px; cursor: pointer; }
.sb-row:hover { background: var(--surface-2); }
.sb-row.sel { border-color: var(--accent); background: var(--surface-2); }
.sb-av { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text); font-size: 0.78rem; font-weight: 700; border: 1px solid var(--border); }
.sb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.sb-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sb-top b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-pct { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.sb-pct.good { color: var(--ok-fg); } .sb-pct.mid { color: var(--mid-fg); } .sb-pct.bad { color: var(--bad-fg); } .sb-pct.none { color: var(--muted); }
.sb-bar { position: relative; height: 8px; border-radius: 999px; background: var(--surface-2); }
.sb-row:hover .sb-bar, .sb-row.sel .sb-bar { background: var(--border); }
.sb-fill { display: block; height: 100%; border-radius: 999px; }
.sb-fill.good { background: var(--ok-fg); } .sb-fill.mid { background: var(--mid-fg); } .sb-fill.bad { background: var(--bad-fg); } .sb-fill.none { background: var(--muted); }
.sb-avg { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 1px; }
.sb-main small { color: var(--muted); font-size: 0.76rem; }
.seff-weeks { display: flex; align-items: flex-end; gap: 6px; height: 150px; overflow-x: auto; padding-bottom: 2px; }
.sw { flex: 1 0 26px; max-width: 48px; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sw-v { font-size: 0.66rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.sw-col { flex: 1; width: 100%; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.sw-fill { display: block; width: 100%; border-radius: 6px 6px 0 0; }
.sw-fill.good { background: var(--ok-fg); } .sw-fill.mid { background: var(--mid-fg); } .sw-fill.bad { background: var(--bad-fg); }
.sw-l { font-size: 0.66rem; color: var(--muted); }
.seff-note { margin: 8px 0 0; color: var(--muted); font-size: 0.76rem; }
.kind-row { grid-template-columns: 1fr 34% 40px 34px !important; }
.kind-row small { color: var(--muted); font-size: 0.72rem; text-align: right; }
.tb-chip { gap: 6px; }
.tb-chip small { color: var(--muted); font-weight: 500; font-size: 0.72rem; }
.tb-chip .sb-pct { font-size: 1rem; margin-left: 2px; }
.seff-runs-head { margin-top: 6px; }
@media (min-width: 760px) {
  .seff-view .story-tiles { grid-template-columns: repeat(4, 1fr); }
}
.kind-row .sp-bar .sb-fill { opacity: 1; }
.legend .avg-key { width: 2px; height: 12px; border-radius: 1px; background: var(--text); margin-left: 0; }

/* ===========================================================================
   Placed objects — persistence: headline, survival curve, status mix, kinds,
   and each object's card with a life bar in its status colour.
   =========================================================================== */
.objects-view { gap: 12px; padding: 0 2px 14px; }
.surv-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.surv-area { fill: var(--accent); opacity: 0.1; }
.mix-bar { display: flex; gap: 2px; height: 14px; border-radius: 999px; overflow: hidden; }
.mx { display: block; min-width: 6px; }
.mx-present, .mix-key .mx-present { background: var(--ok-fg); }
.mx-partial, .mix-key .mx-partial { background: var(--mid-fg); }
.mx-notfound, .mix-key .mx-notfound { background: var(--vio-fg); }
.mx-gone, .mix-key .mx-gone { background: var(--bad-fg); }
.mx-removed, .mix-key .mx-removed { background: var(--muted); }
.mix-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 0.8rem; color: var(--muted); }
.mix-key span { display: inline-flex; align-items: center; gap: 6px; }
.mix-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.mix-key b { color: var(--text); }
.objects-view .dv-card { position: relative; }
.obj-life { height: 4px; margin: 0 14px 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.obj-life span { display: block; height: 100%; border-radius: 999px; background: var(--ok-fg); }
.obj-partial .obj-life span { background: var(--mid-fg); }
.obj-notfound .obj-life span { background: var(--vio-fg); }
.obj-gone .obj-life span { background: var(--bad-fg); }
.obj-removed .obj-life span { background: var(--muted); }
.objects-view .dv-card.open .obj-life { margin-bottom: 12px; }
.objects-view .dv-row { padding-bottom: 8px; }
.kind-row.dur { grid-template-columns: 1fr 30% 70px 44px !important; }
.kind-row.dur .sp-n { white-space: nowrap; }

/* Overview: tappable Bats / Birds tiles + species rows, and the finds gallery. */
.story-tile.st-go { position: relative; font: inherit; color: var(--text); text-align: left; cursor: pointer; transition: border-color 0.15s ease, transform 0.08s ease; }
.story-tile.st-go:hover { border-color: var(--muted); }
.story-tile.st-go:active { transform: scale(0.98); }
.story-tile.st-go > .ui-i { position: absolute; top: 12px; right: 12px; color: var(--muted); }
.species li.sp-go { cursor: pointer; border-radius: 10px; padding: 3px 4px; margin: -3px -4px; }
.species li.sp-go:hover { background: var(--surface-2); }
.muted-hint { color: var(--muted); }
.story-chart-svg .hit { cursor: pointer; }
.fg-back { margin: 2px 0 -4px; }
.fg-back .ui-i { width: 15px; height: 15px; }
.fg-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fg-title i { font-weight: 500; }
.fg-glyph { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; }
.fg-glyph .cg-bat, .fg-glyph .cg-bird { width: 34px; height: 17px; }
.fg-bat { background: rgba(91, 75, 176, 0.1); } .fg-bird { background: rgba(192, 112, 42, 0.1); }
:root:not(.light) .fg-bat { background: rgba(122, 108, 224, 0.16); } :root:not(.light) .fg-bird { background: rgba(184, 117, 47, 0.16); }
.fg-chips { display: flex; gap: 7px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 3px; }
.fg-chips .tchip i { font-style: italic; }
.fg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.fg-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; min-width: 0; }
.fg-pic { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; background: var(--surface-2); cursor: pointer; overflow: hidden; }
.fg-pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.fg-pic:hover img { transform: scale(1.04); }
.fg-n { position: absolute; right: 7px; bottom: 7px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  background: rgba(15, 22, 19, 0.7); color: #fff; font-size: 0.7rem; font-weight: 700; }
.fg-n .ui-i { width: 12px; height: 12px; }
.fg-nopic { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: default; color: var(--muted); font-size: 0.72rem; }
.fg-nopic .cg-bat, .fg-nopic .cg-bird { width: 44px; height: 22px; opacity: 0.7; }
.fg-info { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left; font: inherit; color: var(--text);
  background: none; border: 0; padding: 10px 12px 12px; cursor: pointer; flex: 1; }
.fg-info:hover { background: var(--surface-2); }
.fg-sp { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1rem; line-height: 1.2; }
.fg-info small { color: var(--muted); font-size: 0.74rem; }
.fg-facts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fg-facts span { font-size: 0.68rem; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.fg-id { font-size: 0.68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.fg-gone { font-size: 0.68rem; font-weight: 700; color: var(--bad-fg); }
@media (min-width: 760px) {
  .fg-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
  .story-view > .fg-back, .story-view > .fg-chips, .story-view > .fg-grid { grid-column: 1 / -1; }
}
.story-tile > span:not(.st-ico) { font-size: 0.78rem; color: var(--muted); }
.fg-chips { min-height: 42px; align-items: center; flex: none; }
.fg-chips .tchip { flex: none; }

/* Drawer header: "?" (tour) beside the close button. */
.dh-acts { display: inline-flex; align-items: center; gap: 8px; }

/* "?" for the map tour — top right, under the stats card, clear of the GPS pill. */
.track-help { position: absolute; z-index: 1000; right: 10px; top: calc(var(--safe-top) + 78px);
  width: 40px !important; height: 40px !important; }
.track-help .ico { width: 19px; height: 19px; }

/* Map menu: never wider than the screen; long (e.g. Latvian) labels wrap. */
.map-menu-panel { width: min(260px, calc(100vw - 84px)); min-width: 0; }
.map-menu-item { white-space: normal; line-height: 1.25; }

/* Phones: slightly larger text everywhere (all sizes are rem-based). */
@media (max-width: 480px) { html { font-size: 17px; } }

/* Line icons that replaced emojis: battery pill, map mark labels, small delete buttons. */
.battery { display: inline-flex; align-items: center; gap: 6px; }
.battery::before { content: ''; width: 16px; height: 16px; flex: none; background: currentColor;
  -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='1.9' stroke-linejoin='round'%3E%3Crect x='2.5' y='7' width='17' height='10' rx='2'/%3E%3Cpath d='M21.5 10.5v3' stroke-linecap='round'/%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='1.9' stroke-linejoin='round'%3E%3Crect x='2.5' y='7' width='17' height='10' rx='2'/%3E%3Cpath d='M21.5 10.5v3' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.battery.hidden { display: none; }
.wp-tip .ui-i { width: 12px; height: 12px; vertical-align: -2px; }
button.del .ui-i { width: 17px; height: 17px; vertical-align: -3px; }
