/* Layout: Bestimmungsbuch neben Karte. Links ein schmales „Feldbuch“-Panel, rechts die Karte.
   Am Handy: Karte oben, Panel darunter. */
:root {
  --bg: #eef0ea;
  --surface: #fbfcf8;
  --ink: #1d251f;
  --muted: #586459;
  --line: #d3d9cf;
  --accent: #2e5b3b;        /* Moos: Bedienelemente */
  --accent-ink: #ffffff;
  --accent-soft: #dfe9df;
  --focus: #b86e00;

  /* Eignung: rot (schlecht) → gelb → grün (gut). Grüntöne leicht ins Blaugrün verschoben,
     damit sie sich bei Rot-Grün-Sehschwäche von Gelb und Rot abheben (geprüft mit validate_palette) */
  --s1: #c0392b; --s2: #ec8b33; --s3: #f4d35e; --s4: #5fb58a; --s5: #1d7a55;
  --on-s1: #ffffff; --on-s2: #1d1404; --on-s3: #1d1404; --on-s4: #0d1f15; --on-s5: #ffffff;

  --good: #2f7a3e; --warn: #9a6a00; --serious: #c2410c; --critical: #b3122a; --neutral: #586459;
  --seg-line: color-mix(in srgb, var(--muted) 40%, transparent); /* Trennlinien der Seitenleiste */
  --seg-bar: color-mix(in srgb, var(--muted) 16%, transparent);
  --seg-line-solid: color-mix(in srgb, var(--muted) 40%, var(--surface)); /* gleiche Farbe, aber deckend */  /* Kopfbalken der Segmente */
  --sheet-peek: 64px;          /* Höhe des eingeklappten Menüs am Handy */
  --pin: #d7192a;            /* Suchmittelpunkt und Suchkreis, in beiden Modi gleich */
  --water: #2f80c8; --water-line: #1d5d96; --sand: #e3c98f; --silt: #b49a74; --clay: #85634a;
  --tile-filter: none;

  --font-display: 'Spectral', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Atkinson Hyperlegible Next', 'Segoe UI', system-ui, sans-serif;
  --font-data: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --step--1: 0.8125rem; --step-0: 0.9375rem; --step-1: 1.125rem; --step-2: 1.5rem; --step-3: 2.125rem;
  --radius: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121612; --surface: #1a201b; --ink: #e6ebe4; --muted: #9daa9f; --line: #2f3a31;
    --accent: #8fc49a; --accent-ink: #0f1a12; --accent-soft: #23332696; --focus: #f0b34a;
    --s1: #c93b34; --s2: #ef8a3a; --s3: #f2d968; --s4: #6fd09c; --s5: #24875c;
    --on-s1: #ffffff; --on-s2: #1d1404; --on-s3: #1d1404; --on-s4: #0d1f15; --on-s5: #ffffff;
    --good: #7fcf8c; --warn: #e8c060; --serious: #f2915b; --critical: #ff7b8a; --neutral: #9daa9f;
  --water: #5aa9ec; --water-line: #9ccdf5; --sand: #c9ad6e; --silt: #96805f; --clay: #a07a5c;
    --water: #5aa9ec; --water-line: #9ccdf5; --sand: #c9ad6e; --silt: #96805f; --clay: #a07a5c;
    --tile-filter: brightness(0.62) contrast(1.15) saturate(0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121612; --surface: #1a201b; --ink: #e6ebe4; --muted: #9daa9f; --line: #2f3a31;
  --accent: #8fc49a; --accent-ink: #0f1a12; --accent-soft: #23332696; --focus: #f0b34a;
  --s1: #c93b34; --s2: #ef8a3a; --s3: #f2d968; --s4: #6fd09c; --s5: #24875c;
  --on-s1: #ffffff; --on-s2: #1d1404; --on-s3: #1d1404; --on-s4: #0d1f15; --on-s5: #ffffff;
  --good: #7fcf8c; --warn: #e8c060; --serious: #f2915b; --critical: #ff7b8a; --neutral: #9daa9f;
  --tile-filter: brightness(0.62) contrast(1.15) saturate(0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 var(--step-0)/1.5 var(--font-body);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num, output { font-family: var(--font-data); font-variant-numeric: tabular-nums; }

/* hidden-Attribut immer respektieren, auch bei Elementen mit eigener display-Regel (z. B. .find-form, .block) */
[hidden] { display: none !important; }

.app { display: grid; grid-template-columns: minmax(320px, 400px) 1fr; height: 100%; }
.panel {
  background: var(--surface); border-right: 1px solid var(--line);
  overflow-y: auto; padding: 20px 20px 28px;
  display: flex; flex-direction: column; gap: 22px;
}
/* Abschnitte nie stauchen: sonst schrumpft z. B. der Statustext beim Scrollen und überlappt das Pilz-Wetter */
.panel > * { flex-shrink: 0; }
.map-wrap { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: var(--bg); }
/* Ladebalken oben über der Karte; der Glanz läuft, damit man auch bei langsamen Quellen sieht, dass etwas passiert */
.loadbar { position: absolute; top: 0; left: 0; right: 0; height: 4px; z-index: 1000; background: rgb(0 0 0 / 0.12); overflow: hidden; pointer-events: none; }
.loadbar i { position: relative; display: block; height: 100%; width: 6%; background: var(--pin); transition: width 0.3s ease-out; overflow: hidden; }
.loadbar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.6), transparent); animation: loadbar-shine 1.1s linear infinite; }
@keyframes loadbar-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .loadbar i::after { animation: none; } }
/* Ergebnisse einer überholten Suche: abgeblendet und nicht anklickbar, bis die neue da ist */
/* Segmente der Seitenleiste: feine Trennlinie, Kopfzeile als Balken im selben Farbton (heller, damit die Schrift lesbar bleibt),
   Dreieck rechts zum Ein-/Ausklappen */
.seg { border-top: 1px solid var(--seg-line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.seg-head { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  background: var(--seg-bar); border-radius: var(--radius); padding: 6px 8px 6px 10px; }
.seg-head h2 { flex: 1; }
.seg-toggle { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin: -4px -6px -4px 0;
  padding: 0; border: 0; border-radius: var(--radius); background: none; color: var(--muted); cursor: pointer; }
.seg-toggle svg { width: 12px; height: 12px; fill: currentColor; transition: transform 0.15s; }
.seg-head:hover .seg-toggle { color: var(--ink); }
.seg.collapsed .seg-toggle svg { transform: rotate(-90deg); }
.seg.collapsed .seg-body { display: none; }
.results { display: flex; flex-direction: column; gap: 22px; }
#results.stale { opacity: 0.35; pointer-events: none; transition: opacity 0.15s; }
.leaflet-tile-pane { filter: var(--tile-filter); }

/* Griff des ausziehbaren Menüs: nur am Handy */
.sheet-top, .sheet-handle { display: none; }

/* Handy: Karte als Vollbild, Seitenleiste als Blatt von unten (eingeklappt / halb / fast ganz).
   Die Höhe setzt js/app.js (setSheet), hier stehen nur Lage und Aussehen. */
@media (max-width: 760px) {
  html, body { height: 100%; overflow: hidden; }
  .app { display: block; height: 100%; }
  .map-wrap { position: fixed; inset: 0; }
  .panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
    height: var(--sheet-peek); max-height: 92dvh;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px));
    border-right: 0; border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 18px rgb(0 0 0 / 0.28);
    overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
    touch-action: pan-y; /* seitliches Wischen gehört dem Reiterwechsel, nicht dem Browser-Zurück */
    transition: height 0.25s ease-out;
  }
  .panel.dragging { transition: none; }
  .panel[data-sheet="peek"] { overflow-y: hidden; }
  .brand { display: none; }
  /* Griff, Info-Symbol und Reiter bilden einen deckenden Block, der oben klebt; darunter scrollt der Inhalt */
  .sheet-top { display: flex; flex-wrap: wrap; align-items: stretch; position: sticky; top: 0; z-index: 3; margin: 0 -16px;
    background: var(--surface); border-bottom: 1px solid var(--seg-line-solid); }
  /* Spalten: Titel | Status (so breit wie nötig, sonst gekürzt) | Rest, in dessen Mitte das Info-Symbol sitzt */
  .sheet-handle {
    display: grid; grid-template-columns: auto minmax(0, max-content) minmax(48px, 1fr); grid-template-rows: auto auto; align-items: center; gap: 2px 10px;
    flex: 1 1 100%; min-width: 0; min-height: var(--sheet-peek); padding: 8px 0 10px 16px; color: var(--ink);
    text-align: left; cursor: grab; touch-action: none;
  }
  .sheet-handle:focus-visible { outline-offset: -3px; }
  .sheet-info-cell { display: flex; justify-content: center; margin-left: -10px; } /* Spaltenabstand ausgleichen: Symbol genau mittig in der Lücke */
  .sheet-info { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
    border: 0; background: none; color: var(--muted); cursor: pointer; }
  .sheet-info[aria-expanded="true"] { color: var(--accent); }
  .sheet-info svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .sheet-info svg .fill { fill: currentColor; stroke: none; }
  /* Sprechblase mit den Hinweisen, Spitze zeigt auf das Info-Symbol */
  .sheet-info-pop { position: fixed; right: 10px; z-index: 1200; width: min(340px, calc(100vw - 20px)); padding: 14px 16px 6px;
    background: var(--surface); color: var(--ink); border: 1px solid var(--seg-line); border-radius: 12px; box-shadow: 0 4px 18px rgb(0 0 0 / 0.35); }
  .sheet-info-pop::after { content: ''; position: absolute; right: var(--tail-right, 20px); bottom: -8px; width: 14px; height: 14px; background: var(--surface);
    border-right: 1px solid var(--seg-line); border-bottom: 1px solid var(--seg-line); transform: rotate(45deg); }
  .sheet-info-pop .fine { border-top: 0; padding-top: 0; }
  .sheet-grip { grid-column: 1 / -1; justify-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--seg-line); }
  .sheet-title { font: 600 var(--step-1)/1.1 var(--font-display); }
  .sheet-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--step--1); color: var(--muted); }
  /* Leaflet-Bedienelemente unten (Quellenangabe) über dem eingeklappten Blatt halten */
  .leaflet-bottom { bottom: var(--sheet-peek); }
  .leaflet-control-attribution { font-size: 9px; line-height: 1.3; max-width: 100vw; }
}

/* Typografie */
.brand h1 {
  font: 600 var(--step-3)/1.05 var(--font-display); margin: 0; letter-spacing: -0.01em;
}
.tagline { margin: 4px 0 0; color: var(--muted); }
.label {
  font: 700 var(--step--1)/1.2 var(--font-body); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 0;
}
.hint { color: var(--muted); font-size: var(--step--1); margin: 0; }
.block { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 120px; min-width: 0; }

/* Formulare */
input[type="search"], input[type="text"], input[type="date"], select, textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; width: 100%; min-width: 0;
}
textarea { resize: vertical; }
label { font-size: var(--step--1); color: var(--muted); }
.search { display: flex; gap: 8px; }
.btn {
  font: 600 var(--step-0)/1 var(--font-body); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 14px; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-ghost { background: transparent; }
.btn-small { padding: 6px 10px; font-size: var(--step--1); }
.btn-wide { width: 100%; padding: 13px; font-size: var(--step-1); }
.file-btn { display: inline-flex; align-items: center; color: var(--ink); }

.place-results { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.place-results button {
  display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 8px 10px; font: inherit; font-size: var(--step--1); color: var(--ink); cursor: pointer;
}
.place-results li:last-child button { border-bottom: 0; }
.place-results button:hover { background: var(--accent-soft); }

.radius { display: grid; grid-template-columns: auto 1fr 3.6em; gap: 10px; align-items: center; color: var(--ink); font-size: var(--step-0); }
.radius input { accent-color: var(--accent); }
.radius output { text-align: right; }

/* Artenliste */
.species-list { display: flex; flex-wrap: wrap; gap: 6px; }
.species-list .break { flex-basis: 100%; height: 0; } /* „Alle Arten“ steht allein in der ersten Zeile */
.chip {
  font: 500 var(--step--1)/1.2 var(--font-body); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; cursor: pointer;
}
.chip[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip .off { color: var(--muted); font-size: 0.85em; }
.chip[aria-selected="true"] .off { color: inherit; opacity: 0.8; }

.status { font-size: var(--step--1); color: var(--muted); min-height: 1.2em; }
.status.error { color: var(--critical); }
.status ul { margin: 6px 0 0; padding-left: 18px; }

/* Prognose */
.forecast { overscroll-behavior-x: contain; 
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(34px, 1fr); gap: 4px; align-items: start;
  overflow-x: auto; padding-bottom: 4px;
}
.fc-day.trend .fc-bar { opacity: 0.55; outline: 1.5px dashed var(--muted); outline-offset: -1.5px; }
.fc-day.trend .fc-lbl { font-style: italic; }
.fc-day {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px; background: none; border: 0; padding: 0;
  cursor: pointer; font: inherit; color: var(--ink);
}
.fc-bar-track { height: 64px; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.fc-bar { width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; }
.fc-val { font: 500 var(--step--1)/1 var(--font-data); text-align: center; }
.fc-lbl { font-size: 0.72rem; color: var(--muted); text-align: center; line-height: 1.1; min-height: 2.2em; }
.fc-day[aria-pressed="true"] .fc-lbl { color: var(--ink); font-weight: 700; }
.fc-day[aria-pressed="true"] .fc-bar-track { border-bottom: 2px solid var(--ink); }


.toggle { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); }
.toggle input { accent-color: var(--accent); margin-top: 3px; }
.toggle-boxed { border: 0.5px dashed color-mix(in srgb, var(--muted) 55%, transparent); border-radius: var(--radius); padding: 8px 10px; cursor: pointer; }

/* Beste Stellen */
.spots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.spot {
  display: grid; grid-template-columns: 3em 1fr auto; gap: 10px; align-items: center; width: 100%;
  background: none; border: 0; border-radius: var(--radius); padding: 7px 4px; cursor: pointer;
  font: inherit; color: var(--ink); text-align: left;
}
.spot:hover { background: var(--accent-soft); }
.spot-score { font: 500 var(--step-1)/1 var(--font-data); text-align: center; border-radius: 4px; padding: 6px 0; }
.spot-name { font: 500 italic var(--step-0)/1.25 var(--font-display); }
.spot-meta { font-size: var(--step--1); color: var(--muted); }
.spot-dist { font: 400 var(--step--1)/1 var(--font-data); color: var(--muted); }

.legend { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; }
.legend-title { grid-row: span 2; font-size: var(--step--1); color: var(--muted); }
.legend-ramp { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; height: 14px; }
.legend-ramp button { padding: 0; border: 0; border-radius: 0; cursor: pointer; transition: opacity 0.15s; }
.legend-ramp button:nth-child(1) { background: var(--s1); border-radius: 3px 0 0 3px; }
.legend-ramp button:nth-child(2) { background: var(--s2); }
.legend-ramp button:nth-child(3) { background: var(--s3); }
.legend-ramp button:nth-child(4) { background: var(--s4); }
.legend-ramp button:nth-child(5) { background: var(--s5); border-radius: 0 3px 3px 0; }
.legend-ramp button:hover { opacity: 0.8; }
/* Filter aktiv: gewählte Stufe umrandet, die anderen blass */
.legend-ramp.filtering button { opacity: 0.3; }
.legend-ramp.filtering button[aria-pressed="true"] { opacity: 1; outline: 2px solid var(--ink); outline-offset: 1px; position: relative; z-index: 1; }
.legend-hint { grid-column: 1 / -1; margin: 2px 0 0; font-style: italic; }
.spots-filter { text-transform: none; letter-spacing: 0; color: var(--ink); }

.sources summary { cursor: pointer; font-size: var(--step--1); color: var(--muted); }
.sources ul { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: var(--step--1); }
.src-ok::before { content: "✓ "; color: var(--good); font-weight: 700; }
.src-fail::before { content: "✗ "; color: var(--critical); font-weight: 700; }

/* Steckbrief */
.profile h3 { font: 600 var(--step-2)/1.1 var(--font-display); margin: 0; }
.profile .latin { font: italic 500 var(--step-0)/1.2 var(--font-display); color: var(--muted); margin: 2px 0 0; }
.profile dl { display: grid; grid-template-columns: 7.5em 1fr; gap: 6px 12px; margin: 0; font-size: var(--step--1); }
.profile dt { color: var(--muted); }
.profile dd { margin: 0; min-width: 0; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; }
.months span { display: flex; flex-direction: column; align-items: center; font: 400 0.65rem/1 var(--font-data); color: var(--muted); gap: 3px; }
.months i { display: block; width: 100%; height: 14px; border-radius: 2px; background: var(--line); }
.badge {
  display: inline-block; font: 700 0.7rem/1 var(--font-body); text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 6px; border-radius: 3px; border: 1px solid currentColor; white-space: nowrap;
}
.badge.d-tödlich { color: var(--critical); }
.badge.d-giftig { color: var(--serious); }
.badge.d-ungenießbar, .badge.d-unbekömmlich { color: var(--warn); }
.badge.d-harmlos { color: var(--good); }
.badge.d-schonen, .badge.d-geschützt { color: var(--neutral); }
.lookalikes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lookalikes li { border-left: 3px solid var(--line); padding-left: 10px; }
.lookalikes .la-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.lookalikes .la-name { font-weight: 700; }
.lookalikes .la-latin { font: italic var(--step--1) var(--font-display); color: var(--muted); }
.lookalikes p { margin: 4px 0 0; font-size: var(--step--1); }
.lookalikes li.lethal { border-left-color: var(--critical); }

/* Fundtagebuch */
.find-form { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.find-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.find-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: var(--step--1);
  border-radius: var(--radius); transition: background 0.15s; }
.find-list li[data-edit] { cursor: pointer; }
.find-list li[data-edit]:hover { background: var(--accent-soft); }
/* gerade bearbeiteter Eintrag: ganze Zeile im Akzentgrün */
.find-list li.editing, .find-list li.editing:hover { background: var(--accent); color: var(--accent-ink); }
.find-list li.editing .f-title, .find-list li.editing .f-meta { color: var(--accent-ink); }
.find-list li.editing .trash-btn { color: var(--accent-ink); border-color: currentColor; }
.find-list .f-title { font-weight: 700; cursor: pointer; background: none; border: 0; padding: 0; color: var(--ink); font: inherit; text-align: left; }
.find-list .f-meta { color: var(--muted); grid-column: 1; }
.find-list .f-actions { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 4px; align-items: center; }
.find-empty { color: var(--muted); font-size: var(--step--1); }

.fine { border-top: 1px solid var(--line); padding-top: 14px; font-size: var(--step--1); color: var(--muted); }
.fine p { margin: 0 0 8px; }

/* Karte: Popups & Tooltip im Stil der App */
.leaflet-container { font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
.leaflet-popup-content { margin: 14px 16px; min-width: 240px; max-width: 300px; font-size: var(--step--1); line-height: 1.45; }
.leaflet-popup-content h4 { font: 600 var(--step-1)/1.2 var(--font-display); margin: 0 0 6px; }
.leaflet-popup-content table { border-collapse: collapse; width: 100%; }
.leaflet-popup-content td { padding: 3px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.leaflet-popup-content td:first-child { color: var(--muted); padding-right: 10px; white-space: nowrap; }
.leaflet-popup-content .score { display: inline-block; min-width: 2em; padding: 1px 6px; border-radius: 999px; text-align: center; font-size: var(--step-0); vertical-align: 2px; }
.leaflet-popup-content .facts td { vertical-align: middle; padding-top: 5px; padding-bottom: 5px; }
.leaflet-popup-content .facts .sub { color: var(--muted); font-size: 0.75rem; line-height: 1.3; margin-top: 2px; }
.leaflet-popup-content .facts .frost { color: var(--water); font-weight: 600; }
/* Ampelpunkt: Gelb braucht einen Rand, sonst verschwindet er auf hellem Grund */
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.25); }
.dot-good { background: var(--s4); }
.dot-mid { background: var(--s3); }
.dot-bad { background: var(--s1); }
.dot-none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--neutral); }
.leaflet-popup-content .pbar { display: inline-block; width: 70px; height: 7px; border-radius: 4px; background: var(--line); vertical-align: middle; margin-right: 6px; overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 4px; }
.lvl-good { background: var(--s4); } .lvl-mid { background: var(--s3); } .lvl-bad { background: var(--s1); }
.drops { display: inline-flex; gap: 1px; vertical-align: middle; }
.drops svg { width: 19px; height: 19px; }
.drop-water { fill: var(--water); }
.drop-outline { fill: none; stroke: var(--water-line); stroke-width: 1.6; stroke-linejoin: round; }
.drop-shine { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; opacity: 0.75; }
.phscale { position: relative; display: inline-block; width: 70px; height: 8px; margin-right: 6px; vertical-align: middle; border-radius: 4px;
  background: linear-gradient(90deg, #d9473a, #f0a03c 25%, #8fc06a 55%, #4a8fc8 80%, #5b5fc0); opacity: 0.9; }
.phscale .ph-ideal { position: absolute; top: -2px; bottom: -2px; border: 1.5px solid var(--ink); border-radius: 3px; }
.phscale .ph-mark { position: absolute; top: -4px; width: 3px; height: 16px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; box-shadow: 0 0 0 1px var(--surface); }
.soilbar { display: inline-flex; width: 70px; height: 8px; margin-right: 6px; vertical-align: middle; border-radius: 4px; overflow: hidden; }
.soilbar .sand { background: var(--sand); } .soilbar .silt { background: var(--silt); } .soilbar .clay { background: var(--clay); }
.mstrip { display: inline-grid; grid-template-columns: repeat(12, 9px); gap: 1px; vertical-align: middle; }
.mstrip i { height: 12px; border-radius: 2px; }
.mstrip i.cur { outline: 2px solid var(--ink); outline-offset: 0; }
.leaflet-popup-content .warnbox { margin: 8px 0 0; padding: 6px 8px; border: 1px solid var(--critical); color: var(--critical); border-radius: 4px; }
.leaflet-popup-content .coord-links { margin: 6px 0 8px; font-size: var(--step--1); color: var(--muted); }
.leaflet-popup-content .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.leaflet-bar a, .leaflet-control-layers { background: var(--surface); color: var(--ink); border-color: var(--line); }
.leaflet-control-layers-expanded { color: var(--ink); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--accent); }

.center-pin { cursor: grab; filter: drop-shadow(0 2px 2px rgb(0 0 0 / 0.35)); }
.center-pin svg { display: block; width: 100%; height: 100%; }
.center-pin .pin-body { fill: var(--pin); stroke: #ffffff; stroke-width: 2; } /* kräftiges Rot mit weißem Rand, damit er sich auch auf roten Kacheln abhebt */
.center-pin .pin-eye { fill: #000000; }
.leaflet-tooltip.drag-hint { background: var(--ink); color: var(--surface); border: 0; border-radius: var(--radius); padding: 4px 8px;
  font: 600 var(--step--1)/1.3 var(--font-body); box-shadow: 0 2px 6px rgb(0 0 0 / 0.3); }
.leaflet-tooltip-top.drag-hint::before { border-top-color: var(--ink); }
.center-pin.leaflet-drag-target, .center-pin:active { cursor: grabbing; }
/* angehobene Nadel beim Ziehen */
.leaflet-dragging .center-pin { filter: drop-shadow(0 6px 4px rgb(0 0 0 / 0.35)); }
/* Pilz-Symbol (Fundtagebuch): Farben fest, damit es auf heller und dunkler Karte gleich aussieht */
.mush-cap { fill: #d32f2f; stroke: #4a1010; stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.mush-stem { fill: #f1e6cc; stroke: #4a1010; stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.mush-shine { fill: none; stroke: #ff9e94; stroke-width: 1.3; stroke-linecap: round; }
.find-mushroom svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 1px 1.5px rgb(0 0 0 / 0.5)); }
.amount-pick { display: flex; gap: 6px; }
.amount-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 38px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.amount-btn svg { width: 28px; height: 28px; }
.amount-icons svg { width: 20px; height: 20px; }
.amount-btn:hover { border-color: var(--accent); }
.amount-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.amount-icons { display: inline-flex; vertical-align: -3px; }
.field-label { font-size: var(--step--1); color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Datumsfeld im Fundtagebuch: Text (TT.MM.JJJJ) plus Kalender-Knopf; das native Feld liegt unsichtbar darunter */
.date-field { position: relative; display: flex; gap: 4px; }
.date-field input[type="text"] { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.date-pick { flex: none; width: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }
.date-pick:hover { border-color: var(--accent); }
.date-pick svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
#find-date-native { position: absolute; right: 0; bottom: 0; width: 38px; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* Fund-Popup: Notiz links, Mülltonne rechts daneben */
.find-pop-row { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; }
.find-pop-row .trash-btn { flex: none; }
.find-pop-note { flex: 1; margin: 0; min-width: 0; }
.icon-btn, .trash-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: none; color: var(--muted); cursor: pointer; }
.trash-btn:hover { color: var(--critical); border-color: var(--critical); }
.icon-btn svg, .trash-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#find-where { font-style: italic; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn.trash-btn:hover { color: var(--critical); border-color: var(--critical); }

/* „Mein Standort“ im Rot des Suchmittelpunkts */
#locate-btn { background: var(--pin); border-color: var(--pin); color: #fff; }
#locate-btn:hover { filter: brightness(1.08); }

/* Fadenkreuz auf der Karte: nur am Handy, rechts neben den Zoom-Knöpfen, so hoch wie das Suchfeld */
.locate-control { display: none; }
.search-btn svg { display: none; }
.map-search { display: none; }
.sheet-tabs, .tab-empty, .steckbrief-empty, .pin-radius { display: none; }
@keyframes tab-in-left { from { transform: translateX(40px); opacity: 0.3; } }
@keyframes tab-in-right { from { transform: translateX(-40px); opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .panel[data-slide] .seg { animation: none !important; } }
@media (max-width: 760px) {
  .leaflet-left .locate-control { display: block; clear: none; margin-left: 8px; }
  .leaflet-touch .locate-control a, .locate-control a { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--ink); }
  .locate-control a:hover, .locate-control a:focus { background: var(--surface); color: var(--ink); }
  .locate-control svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .locate-control svg .dot { fill: currentColor; stroke: none; }

  /* Suchfeld oben auf der Karte, Lupe im Feld rechts, Vorschläge darunter */
  .map-search { display: block; position: absolute; z-index: 1000; }
  .map-search .search { position: relative; display: block; }
  .map-search input[type="search"] { height: 48px; padding-right: 46px; background: var(--surface); border: 2px solid rgb(0 0 0 / 0.2); border-radius: 4px; box-shadow: 0 1px 5px rgb(0 0 0 / 0.25); }
  .map-search .search-btn { position: absolute; top: 2px; right: 2px; bottom: 2px; width: 42px; padding: 0; border: 0; background: none; color: var(--muted);
    display: flex; align-items: center; justify-content: center; }
  .map-search .search-btn-text { display: none; }
  .map-search .search-btn svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  .map-search .place-results { margin-top: 6px; background: var(--surface); box-shadow: 0 2px 8px rgb(0 0 0 / 0.3); max-height: 50vh; overflow-y: auto; }

  /* Menü als Reiter: oben Symbole, darunter nur das Segment des gewählten Reiters */
  .sheet-tabs { display: flex; flex-basis: 100%; background: var(--surface); border-top: 1px solid var(--seg-line-solid); }
  .sheet-tabs button { flex: 1; height: 50px; display: flex; align-items: center; justify-content: center; padding: 0;
    border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); cursor: pointer; }
  .sheet-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
  .sheet-tabs svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .sheet-tabs svg .fill { fill: currentColor; stroke: none; }
  .panel .seg { display: none; border-top: 0; padding-top: 0; }
  .panel[data-tab="art"] .seg[data-seg="art"], .panel[data-tab="steckbrief"] #profile-seg,
  .panel[data-tab="wetter"] .seg[data-seg="wetter"], .panel[data-tab="fundorte"] .seg[data-seg="fundorte"],
  .panel[data-tab="funde"] .seg[data-seg="funde"] { display: flex; }
  .panel .seg > .seg-head { display: none; }
  .panel .seg.collapsed .seg-body { display: flex; } /* Reiter zeigen ihr Segment immer ganz */
  .panel[data-tab="steckbrief"] #profile-seg[hidden] + .steckbrief-empty { display: block; }
  /* Reiterwechsel per Wischen: Inhalt gleitet aus der Wischrichtung herein */
  .panel[data-slide="left"] .seg { animation: tab-in-left 0.22s ease-out; }
  .panel[data-slide="right"] .seg { animation: tab-in-right 0.22s ease-out; }
  #analyze-btn, #status { display: none; }
  .panel[data-tab="wetter"] #results[hidden] + .tab-empty, .panel[data-tab="fundorte"] #results[hidden] + .tab-empty { display: block; }

  /* Umkreis-Regler unter dem Pin */
  .pin-radius { display: flex; align-items: center; gap: 10px; position: absolute; z-index: 1000; width: 240px; padding: 8px 12px;
    background: var(--surface); color: var(--ink); border-radius: 999px; box-shadow: 0 2px 8px rgb(0 0 0 / 0.35); }
  .pin-radius input { flex: 1; min-width: 0; accent-color: var(--pin); }
  .pin-radius output { min-width: 3.4em; text-align: right; font-size: var(--step--1); }
}
