/* ============================================================================
   Soppradar design system
   Field-guide aesthetic: warm near-black "forest" UI, light OpenStreetMap maps,
   three typefaces (serif content · sans UI · mono data), single amber accent.
   Replaces Pico CSS. Plain CSS, no build step.
   ========================================================================== */

:root {
  /* Background tiers — warm forest-leaning near-black. */
  --bg:        oklch(0.155 0.012 95);
  --bg-raised: oklch(0.195 0.013 90);
  --bg-card:   oklch(0.225 0.014 85);
  --bg-input:  oklch(0.205 0.013 88);
  --bg-sel:    oklch(0.28 0.018 85);

  /* Hairline strokes. */
  --line:      oklch(0.30 0.012 85 / 0.65);
  --line-soft: oklch(0.30 0.012 85 / 0.30);

  /* Text tiers. */
  --text:      oklch(0.94 0.012 85);
  --text-mute: oklch(0.72 0.010 85);
  --text-dim:  oklch(0.55 0.008 85);
  --text-faint:oklch(0.42 0.008 85);

  /* Accents. Amber = the "ping", moss = curriculum/pensum, rust = rare/danger. */
  --amber:     oklch(0.78 0.14 70);
  --amber-dim: oklch(0.55 0.10 70);
  --amber-ink: oklch(0.18 0.02 60);     /* text on amber fills */
  --moss:      oklch(0.68 0.10 140);
  --moss-dim:  oklch(0.45 0.07 140);
  --rust:      oklch(0.65 0.16 35);
  --admin:     oklch(0.78 0.10 290);

  /* Translucent fills used by chips & toggles. */
  --moss-bg:   oklch(0.40 0.07 140 / 0.18);
  --moss-bd:   oklch(0.40 0.07 140 / 0.45);
  --amber-bg:  oklch(0.55 0.10 70 / 0.18);
  --amber-bd:  oklch(0.55 0.10 70 / 0.45);
  --rust-bg:   oklch(0.50 0.16 35 / 0.15);
  --rust-bd:   oklch(0.50 0.16 35 / 0.45);
  --admin-bg:  oklch(0.55 0.12 290 / 0.20);
  --admin-bd:  oklch(0.55 0.12 290 / 0.45);

  /* Glass for map control chips (sit on a light map). */
  --glass:     oklch(0.16 0.012 95 / 0.92);

  --font-sans:  "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Instrument Serif", "GT Sectra", Georgia, serif;
  --font-mono:  "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --radius:   12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; }

em, .serif { font-family: var(--font-serif); }
em { font-style: italic; }
.mono { font-family: var(--font-mono); }

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.3px;
  line-height: 1.05;
  margin: 0;
}

[x-cloak] { display: none !important; }

::selection { background: var(--amber-bg); }

/* Inline icons (referenced from the sprite via <use>). */
.ico {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
  display: inline-block; vertical-align: middle;
}
.ico--sm { width: 14px; height: 14px; }
.ico--md { width: 22px; height: 22px; }
.ico--lg { width: 26px; height: 26px; }
.ico--xl { width: 36px; height: 36px; }
.ico--bold { stroke-width: 2; }

/* Dark form-control affordances (scrollbars, date pickers, etc.) */
:root { color-scheme: dark; }

/* --- Text utilities -------------------------------------------------------- */
.t-mute  { color: var(--text-mute); }
.t-dim   { color: var(--text-dim); }
.t-faint { color: var(--text-faint); }
.t-amber { color: var(--amber); }
.t-moss  { color: var(--moss); }
.t-rust  { color: var(--rust); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.sci { font-family: var(--font-serif); font-style: italic; color: var(--text-dim); }

/* --- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: filter .12s, background .12s, border-color .12s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }

.btn--amber { background: var(--amber); color: var(--amber-ink); font-weight: 600; }
.btn--amber:hover { filter: brightness(1.06); }
.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--ghost:hover { background: var(--bg-card); }
.btn--card { background: var(--bg-card); border-color: var(--line); color: var(--text); }
.btn--card:hover { filter: brightness(1.1); }
.btn--danger { background: transparent; border-color: var(--rust-bd); color: var(--rust); }
.btn--danger-solid { background: var(--rust); border-color: var(--rust); color: oklch(0.16 0.01 35); font-weight: 600; }
.btn--admin { background: transparent; border-color: var(--admin-bd); color: var(--admin); }
.btn--block { width: 100%; }
.btn--lg { padding: 15px 18px; font-size: 15px; }
.btn--sm { padding: 8px 12px; font-size: 12.5px; }

/* Square icon button (map controls, toolbars). */
.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { filter: brightness(1.12); }
.icon-btn--ghost { background: transparent; }

.btn svg, .icon-btn svg { display: block; }

/* Floating action button — speed-dial (mobile): tap + to choose what to create. */
.fab-wrap {
  position: fixed; right: 20px; bottom: 24px; z-index: 600;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.fab {
  width: 56px; height: 56px;
  border-radius: 999px;
  background: var(--amber);
  color: var(--amber-ink);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px oklch(0.55 0.10 70 / 0.45), 0 0 0 6px oklch(0.55 0.14 70 / 0.10);
  text-decoration: none;
}
.fab svg { width: 24px; height: 24px; transition: transform .15s; }
.fab--open svg { transform: rotate(45deg); }

.fab-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab-action { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.fab-action__label {
  background: var(--bg-card); border: 1px solid var(--line); color: var(--text);
  padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 12px oklch(0 0 0 / 0.4);
}
.fab-action__icon {
  width: 44px; height: 44px; border-radius: 999px; flex: 0 0 auto;
  background: var(--bg-raised); border: 1px solid var(--line); color: var(--amber);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px oklch(0 0 0 / 0.4);
}

/* Create menu (desktop top-bar dropdown — same two choices as the FAB). */
.create-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 700;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 32px oklch(0 0 0 / 0.5);
  padding: 6px; min-width: 190px; display: flex; flex-direction: column; gap: 2px;
}
.create-menu__item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: 14px;
}
.create-menu__item:hover { background: var(--bg-card); text-decoration: none; }
.create-menu__item svg { color: var(--amber); }

/* --- Tags / pills ---------------------------------------------------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.4px; text-transform: uppercase;
  line-height: 1.2; white-space: nowrap;
  border: 1px solid var(--line); color: var(--text-mute); background: transparent;
}
.tag--xs { font-size: 9.5px; padding: 1px 6px; }
.tag--pensum { background: var(--moss-bg);  color: var(--moss);  border-color: var(--moss-bd); }
.tag--rare   { background: var(--rust-bg);  color: var(--rust);  border-color: var(--rust-bd); }
.tag--radar  { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-bd); }
.tag--admin  { background: var(--admin-bg); color: var(--admin); border-color: var(--admin-bd); }

/* --- Chips (filters, dates, habitats) ------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--bg-input); border: 1px solid var(--line);
  color: var(--text-mute);
  font-family: var(--font-sans); font-size: 12.5px;
  cursor: pointer;
}
.chip--on    { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber); }
.chip--moss  { background: var(--moss-bg); border-color: var(--moss-bd); color: var(--moss); }

/* --- Forms ---------------------------------------------------------------- */
.field { display: block; margin: 0 0 18px; }
.field__label {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 8px;
}
.field__opt {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-faint);
  letter-spacing: .4px; text-transform: uppercase;
}
.field__req { color: var(--amber); font-family: var(--font-mono); font-size: 11px; }
.field__hint { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; display: block; }

.input, .textarea, select.input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.4;
  outline: none;
}
.input:focus, .textarea:focus, select.input:focus { border-color: var(--amber-bd); }
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }
.textarea { resize: vertical; min-height: 80px; font-family: var(--font-serif); font-size: 15px; line-height: 1.55; }
select.input { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
input[type="date"].input { cursor: pointer; }

/* Validation: highlight a required control the user tried to skip. */
.is-invalid { border-color: var(--rust) !important; }

/* Search bar with leading icon. */
.searchbar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px; height: 40px;
  background: var(--bg-input); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text-dim);
}
.searchbar:focus-within { border-color: var(--amber-bd); }
.searchbar svg { flex: 0 0 auto; color: var(--text-dim); }
.searchbar input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--font-sans); font-size: 14px;
}
.searchbar input::placeholder { color: var(--text-dim); }

/* Custom checkbox. */
.check {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 14px; color: var(--text); margin: 0;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  width: 20px; height: 20px; flex: 0 0 auto; border-radius: 6px;
  border: 1.5px solid var(--line); background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--bg);
}
.check__box svg { opacity: 0; }
.check input:checked + .check__box { background: var(--moss); border-color: var(--moss); }
.check input:checked + .check__box svg { opacity: 1; }

/* --- Tags grid / stats ----------------------------------------------------- */
.stat-grid {
  display: grid; gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--bg-raised);
}
.stat { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat__n { font-family: var(--font-serif); font-size: 28px; line-height: 1; color: var(--text); }
.stat__l { font-size: 12px; color: var(--text-mute); margin-top: 6px; font-weight: 500; }
.stat__s { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
/* Hoverable stat (native title tooltip on desktop). */
.stat--tip { cursor: help; transition: background .12s; }
@media (hover: hover) { .stat--tip:hover { background: var(--bg-card); } }

/* --- Cards / sections ------------------------------------------------------ */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.section {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px 22px;
  margin: 0 0 24px;
}
.section--admin  { border-color: var(--admin-bd); }
.section--danger { border-color: var(--rust-bd); }
.section__head {
  display: flex; align-items: baseline; gap: 12px;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.section__no { font-family: var(--font-mono); font-size: 11px; letter-spacing: .8px; color: var(--amber); }
.section--admin  .section__no { color: var(--admin); }
.section--danger .section__no { color: var(--rust); }
.section__title { font-size: 22px; }
.section__head .spacer { margin-left: auto; }

/* Label / value / action row inside a section. */
.row {
  display: grid; grid-template-columns: minmax(120px, 140px) 1fr auto;
  align-items: center; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft);
}
.row:last-child { border-bottom: none; }
.row__label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--text-dim); }
.row__value { font-size: 13.5px; }

/* Big tappable list row (profile menu). */
.list-row {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--bg-raised); border: 1px solid var(--line);
  color: var(--text); font-family: var(--font-sans); text-align: left; cursor: pointer;
}
.list-row:hover { filter: brightness(1.08); text-decoration: none; }
.list-row--admin { border-color: var(--admin-bd); }
.list-row__icon {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--line); color: var(--text-mute);
  display: flex; align-items: center; justify-content: center;
}
.list-row--admin .list-row__icon { background: var(--admin-bg); border-color: var(--admin-bd); color: var(--admin); }
.list-row__title { font-size: 14px; font-weight: 500; }
.list-row__sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* Progress bar (pensum-fremdrift). */
.progress { height: 8px; border-radius: 999px; background: var(--bg-input); border: 1px solid var(--line-soft); overflow: hidden; margin: 12px 0 8px; }
.progress__fill { height: 100%; background: linear-gradient(90deg, var(--moss), var(--amber)); }

/* --- App shell ------------------------------------------------------------- */
.app { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
.app--fixed { height: 100vh; overflow: hidden; }

.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand__name { font-family: var(--font-serif); font-style: italic; letter-spacing: -.3px; line-height: 1; font-size: 22px; }

/* Desktop top bar. */
.topbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 20px;
  background: var(--bg-raised); border-bottom: 1px solid var(--line);
}
.topbar .brand__name { font-size: 24px; }

/* Mobile nav bar: back · title · action. */
.navbar {
  flex: 0 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 10px 8px; border-bottom: 1px solid var(--line-soft);
}
.navbar__title { font-size: 15px; font-weight: 600; text-align: center; }
.navbar__link {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: none; cursor: pointer;
  color: var(--amber); font-size: 14px; font-family: var(--font-sans); padding: 6px 8px;
}
.navbar__link:hover { text-decoration: none; }
.navbar__link--start { justify-self: start; }
.navbar__link--end { justify-self: end; }

/* Avatar. */
.avatar {
  border-radius: 999px; background: oklch(0.40 0.06 60); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; flex: 0 0 auto;
}

/* Notification bell with dot. */
.bell { position: relative; display: inline-flex; color: var(--text-mute); }
.bell__dot { position: absolute; top: -2px; right: -3px; width: 7px; height: 7px; border-radius: 999px; background: var(--amber); border: 2px solid var(--bg-raised); }

/* --- Segmented control / tabs --------------------------------------------- */
.segmented {
  display: grid; gap: 2px; padding: 3px;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 10px;
}
.segmented button {
  padding: 8px 12px; border-radius: 7px; border: none; cursor: pointer;
  background: transparent; color: var(--text-dim);
  font-family: var(--font-sans); font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.segmented button[aria-selected="true"] { background: var(--bg-card); color: var(--text); font-weight: 500; }
.segmented .count { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.segmented button[aria-selected="true"] .count { color: var(--amber); }

.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button {
  flex: 1; padding: 12px 14px; background: transparent; border: none; cursor: pointer;
  color: var(--text-dim); font-family: var(--font-sans); font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tabs button[aria-selected="true"] { color: var(--text); font-weight: 500; border-bottom-color: var(--amber); }
.tabs .count { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.tabs button[aria-selected="true"] .count { color: var(--amber); }

/* --- Modals / sheets ------------------------------------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: oklch(0 0 0 / 0.62);
  display: flex; align-items: center; justify-content: center;
}
.overlay--bottom { align-items: flex-end; }
.modal {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  width: min(34rem, 95vw); max-height: 85vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 64px oklch(0 0 0 / 0.5);
}
.modal--full { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; border: none; }
.modal__head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.modal__title { font-size: 18px; font-family: var(--font-serif); }
.modal__body { padding: 14px 16px; overflow-y: auto; }

.sheet {
  background: var(--bg-raised);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  border-top-left-radius: 20px; border-top-right-radius: 20px;
  box-shadow: 0 -12px 48px oklch(0 0 0 / 0.45);
  width: 100%; max-height: 88vh;
  display: flex; flex-direction: column;
}
.sheet__handle { height: 24px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.sheet__handle::before { content: ""; width: 36px; height: 4px; border-radius: 999px; background: var(--text-dim); opacity: .5; }

/* Picker list rows. */
.picker-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.picker-list li {
  padding: 11px 10px; border-bottom: 1px solid var(--line-soft); cursor: pointer; border-radius: 6px;
}
.picker-list li:hover { background: var(--bg-card); }

/* --- Map / Leaflet --------------------------------------------------------- */
.map { width: 100%; height: 100%; }
.map--inline { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
#main-map.map-fullscreen { position: fixed !important; inset: 0 !important; z-index: 2000 !important; }

/* Map maintains the bright OSM cartography; only the controls go dark. */
.leaflet-container img { max-width: none; height: auto; }
.leaflet-marker-icon, .leaflet-marker-shadow { background: transparent !important; border: none !important; box-shadow: none !important; }

.leaflet-bar, .leaflet-control-zoom { border: none !important; box-shadow: none !important; }
/* Every control button — built-in zoom links AND our custom locate/fullscreen
   buttons (which carry .leaflet-bar themselves) — gets the same dark-glass chip. */
.leaflet-bar a, a.leaflet-bar, button.leaflet-bar {
  background: var(--glass) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  width: 34px !important; height: 34px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  line-height: 1 !important; font-size: 1.05rem !important;
  backdrop-filter: blur(6px);
  margin-bottom: 6px !important;
}
.leaflet-bar a:hover, a.leaflet-bar:hover, button.leaflet-bar:hover { filter: brightness(1.15); }
/* Attribution: keep the required OSM credit but drop the white box (transparent,
   with a light halo so it stays legible on the light map). */
.leaflet-control-attribution {
  background: transparent !important; box-shadow: none !important;
  color: oklch(0.40 0.01 85) !important;
  font-family: var(--font-sans) !important; font-size: 9.5px !important;
  text-shadow: 0 0 3px oklch(1 0 0 / 0.9), 0 0 3px oklch(1 0 0 / 0.9) !important;
  padding: 0 6px !important; margin: 0 !important;
}
.leaflet-control-attribution a { color: oklch(0.42 0.09 230) !important; background: transparent !important; }

/* Map glass chip (date stepper, info pills). */
.map-chip {
  display: inline-flex; align-items: center;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius-sm);
  backdrop-filter: blur(6px); color: var(--text); overflow: hidden;
}
.map-chip__btn {
  width: 32px; height: 32px; background: transparent; border: none; cursor: pointer;
  color: var(--amber); display: flex; align-items: center; justify-content: center;
}
.map-chip__btn--l { border-right: 1px solid var(--line); }
.map-chip__btn--r { border-left: 1px solid var(--line); }
.map-chip__range { padding: 0 10px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .3px; white-space: nowrap; }

/* --- Notify banner (who gets the alert) ----------------------------------- */
.notify {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  background: oklch(0.40 0.07 140 / 0.10); border: 1px solid oklch(0.40 0.07 140 / 0.25);
  font-size: 12px; color: var(--text-mute);
}
.notify__icon {
  width: 28px; height: 28px; flex: 0 0 auto; border-radius: 999px;
  background: var(--moss-bg); color: var(--moss);
  display: flex; align-items: center; justify-content: center;
}

/* --- Auth pages ------------------------------------------------------------ */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth__card { width: min(26rem, 100%); }
.auth__brand { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; margin-bottom: 22px; }
.auth h1 { font-size: 40px; letter-spacing: -1px; }
.auth__sub { color: var(--text-mute); font-family: var(--font-serif); font-size: 15px; margin: 6px 0 0; }
.status-ok { color: var(--moss); font-size: 13px; }
.status-err { color: var(--rust); font-size: 13px; }

/* --- Species pick button --------------------------------------------------- */
.species-pick {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--line);
  color: var(--text); font-family: var(--font-sans); text-align: left; cursor: pointer;
}
.species-pick:hover { filter: brightness(1.08); }
.species-pick__icon {
  width: 36px; height: 36px; flex: 0 0 auto; border-radius: var(--radius-sm);
  background: var(--moss-bg); border: 1px solid var(--moss-bd); color: var(--moss);
  display: flex; align-items: center; justify-content: center;
}
.species-pick__name { font-family: var(--font-serif); font-size: 19px; line-height: 1.1; }
.species-pick__sci  { font-family: var(--font-serif); font-style: italic; font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.species-pick__placeholder { color: var(--text-dim); font-size: 15px; }

/* --- Photo tiles ----------------------------------------------------------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-tile {
  aspect-ratio: 1; border-radius: 10px; position: relative; overflow: hidden;
  border: 1.5px dashed var(--line); background: var(--bg-card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: var(--amber); cursor: pointer; font-family: var(--font-sans); font-size: 11px;
}
.photo-tile span { color: var(--text); }
.photo-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-tile__remove {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  width: 22px; height: 22px; border-radius: 999px; padding: 0;
  background: oklch(0 0 0 / .6); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* --- Sticky action bar (mobile field forms) ------------------------------- */
.sticky-bar {
  position: sticky; bottom: 0; z-index: 10;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, oklch(0.155 0.012 95 / 0), var(--bg) 35%);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

/* Form title block. */
.form-title { padding: 20px 0 18px; }
.form-title h1 { font-size: 34px; letter-spacing: -1px; }
.form-title p { font-family: var(--font-serif); color: var(--text-mute); font-size: 15px; margin: 8px 0 0; }

/* Map overlay chips (absolute on a relative map wrapper). */
.map-wrap { position: relative; }
.map-overlay { position: absolute; z-index: 500; }
.map-overlay--tl { top: 10px; left: 10px; }
.map-overlay--tr { top: 10px; right: 10px; }
.map-overlay--bl { bottom: 10px; left: 10px; }
.map-overlay--br { bottom: 10px; right: 10px; }
.coord-chip {
  padding: 5px 9px; border-radius: 6px; background: var(--glass); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10.5px; color: var(--text); backdrop-filter: blur(6px);
}

/* --- Etterlysning (request) card ------------------------------------------ */
.req-card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.req-card--active { border-color: var(--amber-bd); }
.req-card__name { font-family: var(--font-serif); font-size: 17px; line-height: 1.1; }
.req-card__notes { font-family: var(--font-serif); font-size: 12.5px; color: var(--text-mute); line-height: 1.5; margin: 10px 0; }
.req-card__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-mute); font-family: var(--font-mono); }

/* Fullscreen map detail popover. */
.map-popover {
  position: fixed; bottom: 16px; left: 16px; z-index: 2100;
  width: min(22rem, calc(100vw - 32px));
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 40px oklch(0 0 0 / .5);
  display: flex; flex-direction: column; overflow: hidden;
}

/* --- Profile --------------------------------------------------------------- */
.profile-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  padding: 16px 20px 24px; border-bottom: 1px solid var(--line);
}
.profile-hero__avatar {
  width: 72px; height: 72px; border-radius: var(--radius-lg);
  background: oklch(0.40 0.06 60); border: 1px solid var(--line); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-style: italic; font-size: 36px;
}
.profile-hero__name { font-family: var(--font-serif); font-size: 30px; letter-spacing: -.6px; line-height: 1.05; }
.profile-hero__meta { font-family: var(--font-serif); font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* Accordion (details/summary) sections. */
.accordion { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); margin-bottom: 14px; overflow: hidden; }
.accordion > summary {
  cursor: pointer; list-style: none; user-select: none;
  display: flex; align-items: center; gap: 8px;
  padding: 16px; font-family: var(--font-serif); font-size: 18px;
}
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary::before {
  content: ""; width: 8px; height: 8px; flex: 0 0 auto;
  border-right: 1.5px solid var(--text-dim); border-bottom: 1.5px solid var(--text-dim);
  transform: rotate(-45deg); transition: transform .15s; margin-right: 2px;
}
.accordion[open] > summary::before { transform: rotate(45deg); }
.accordion > summary .count { color: var(--text-dim); font-family: var(--font-mono); font-size: 13px; }
.accordion__body { padding: 0 16px 16px; }

/* Generic bordered list item used in accordions. */
.item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.item + .item { margin-top: 10px; }

/* --- Home: map split-view -------------------------------------------------- */
.home { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.home__body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.home__filters { flex: 0 0 auto; border-bottom: 1px solid var(--line-soft); background: var(--bg-raised); }
.home__map { flex: 1; min-height: 240px; position: relative; }
.home__map .map { width: 100%; height: 100%; }
.home__tabs { flex: 0 0 auto; }
.home__list { flex: 0 0 42vh; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--line-soft); }

.filters__bar { display: flex; gap: 8px; align-items: center; padding: 10px 14px; }
.filters__chips { display: flex; gap: 6px; padding: 0 14px 10px; flex-wrap: wrap; }
.filters__detail { display: none; padding: 4px 14px 14px; flex-direction: column; gap: 14px; }
.filters__detail.is-open { display: flex; }

/* Sighting / request list rows. */
.srow { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer; width: 100%; text-align: left; background: transparent; color: var(--text); font: inherit; appearance: none; border: 0; border-left: 2px solid transparent; border-bottom: 1px solid var(--line-soft); }
.srow:hover { background: oklch(0.5 0.01 85 / 0.06); }
.srow--sel { background: var(--bg-sel); border-left-color: var(--amber); }
.srow__icon { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--line); color: var(--text-mute); display: flex; align-items: center; justify-content: center; }
.srow__icon--pensum { background: var(--moss-bg); border-color: var(--moss-bd); color: var(--moss); }
.srow__name { font-family: var(--font-serif); font-size: 17px; line-height: 1.1; }
.srow__dist { font-family: var(--font-mono); font-size: 11px; color: var(--amber); white-space: nowrap; }
.srow__meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11.5px; color: var(--text-mute); }

@media (min-width: 900px) {
  .home__body {
    display: grid;
    grid-template-columns: 380px 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "filters map"
      "tabs    map"
      "list    map";
  }
  .home__filters { grid-area: filters; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .home__tabs    { grid-area: tabs; border-right: 1px solid var(--line); }
  .home__list    { grid-area: list; border-top: none; border-right: 1px solid var(--line); flex: none; height: auto; }
  .home__map     { grid-area: map; }
  /* On desktop the detailed filters are always visible. */
  .filters__detail { display: flex !important; }
}

/* --- Layout helpers -------------------------------------------------------- */
.stack { display: flex; flex-direction: column; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.page-pad { padding: 18px 16px; }

/* Loading / empty helpers. */
.muted-note { color: var(--text-dim); font-size: 13px; }

/* --- Responsive: desktop enhancements ------------------------------------- */
@media (min-width: 900px) {
  .hide-desktop { display: none !important; }
}
@media (max-width: 899px) {
  .hide-mobile { display: none !important; }
}
