/*
  Akquise-Karte Helden-Haft – web/stil.css

  Alle Farben als Variablen auf :root, Dunkelmodus über prefers-color-scheme.
  Systemschrift, keine externen Schriften. Mobil ab 360 px Breite ohne horizontales Scrollen.

  Die Bubbles auf der Karte sind SVG-Pfade von Leaflet. karte.js setzt ihnen Klassen
  (bubble-klasse-a, bubble-status-belegt, …), die hier eingefärbt werden. Damit folgt die
  Karte automatisch dem Hell/Dunkel-Schema, ohne dass JavaScript Farben kennen muss.
*/

/* ---------------------------------------------------------------------------
   1. Farben und Maße
   --------------------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  /* Flächen und Text */
  --grund: #f2f4f3;
  --flaeche: #ffffff;
  --flaeche-2: #e6eae8;
  --linie: #cdd3d0;
  --text: #1a1f1d;
  --text-2: #4b5551;
  --text-3: #76817c;
  --akzent: #0d5257;
  --akzent-text: #ffffff;
  --fokus: #2a7de1;
  --warnung-text: #8a3b00;
  --warnung-grund: #fff0e0;
  --schatten: 0 2px 10px rgba(0, 0, 0, 0.18);
  --radius: 8px;

  /* Klassen (Standardfärbung in der Ansicht „Alle“): A kräftig, B mittel, C blass, D grau */
  --klasse-a: #c2185b;
  --klasse-b: #ef6c00;
  --klasse-c: #d9b44a;
  --klasse-d: #8d948f;

  /* Status einer Ausgabe (Jahresansicht) */
  --status-belegt: #2e7d32;
  --status-angekuendigt: #1565c0;
  --status-vorausgesagt: #b8860b;
  --status-abgesagt: #d9534f;
  --status-keine: #8d948f;

  /* 150-km-Kreis und Bamberg-Punkt */
  --kreis: #0d5257;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #121716;
    --flaeche: #1b2220;
    --flaeche-2: #232c29;
    --linie: #34403c;
    --text: #e7ecea;
    --text-2: #aab5b0;
    --text-3: #7f8a85;
    --akzent: #5fc3c6;
    --akzent-text: #0a1f1e;
    --fokus: #6fb0ff;
    --warnung-text: #ffc98a;
    --warnung-grund: #3a2a14;
    --schatten: 0 2px 12px rgba(0, 0, 0, 0.5);

    --klasse-a: #ff5c9a;
    --klasse-b: #ff9a3c;
    --klasse-c: #e3c66a;
    --klasse-d: #8f9994;

    --status-belegt: #5fd068;
    --status-angekuendigt: #6fa8ff;
    --status-vorausgesagt: #e0b43c;
    --status-abgesagt: #ff7b76;
    --status-keine: #8f9994;

    --kreis: #5fc3c6;
  }
}

/* ---------------------------------------------------------------------------
   2. Grundgerüst: Kopf oben, Karte füllt, Fuß unten
   --------------------------------------------------------------------------- */

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;                 /* auf dem Handy ohne die Adressleiste rechnen */
  overflow: hidden;               /* kein Scrollen der Seite, nur innerhalb der Fenster */
  background: var(--grund);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; }

a { color: var(--akzent); }

/* ---------------------------------------------------------------------------
   3. Kopfleiste
   --------------------------------------------------------------------------- */

.kopf {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
}

.kopf-zeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
}

h1 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
}

.untertitel {
  font-weight: normal;
  font-size: 0.9rem;
  color: var(--text-2);
}

.zaehler {
  margin: 0 0 0 auto;
  font-size: 0.9rem;
  color: var(--text-2);
}

.gruppe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.gruppe-titel {
  margin-right: 4px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* Knöpfe für Jahr und Klasse: groß genug für den Daumen */
.knopf {
  min-height: 36px;
  padding: 4px 11px;
  border: 1px solid var(--linie);
  border-radius: 999px;
  background: var(--flaeche);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.knopf:hover { border-color: var(--text-3); }

.knopf[aria-pressed="true"] {
  background: var(--akzent);
  border-color: var(--akzent);
  color: var(--akzent-text);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 9px;
}

.suche {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 180px;
}

.suche input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--flaeche);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

/* ---------------------------------------------------------------------------
   4. Karte und Detailfenster
   --------------------------------------------------------------------------- */

.inhalt {
  position: relative;
  flex: 1;
  min-height: 0;                  /* damit das Flex-Kind schrumpfen darf */
  display: flex;
}

#karte {
  flex: 1;
  min-width: 0;
  background: var(--flaeche-2);
}

/* Seitenleiste rechts (breite Bildschirme) */
.detail {
  position: relative;
  z-index: 1100;                  /* über den Leaflet-Bedienelementen */
  width: min(420px, 42vw);
  overflow-y: auto;
  background: var(--flaeche);
  border-left: 1px solid var(--linie);
}

.detail[hidden] { display: none; }

.detail-leiste {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding: 6px 8px 0;
  background: var(--flaeche);
}

.schliessen {
  width: 36px;
  height: 36px;
  border: 1px solid var(--linie);
  border-radius: 50%;
  background: var(--flaeche);
  color: var(--text);
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.schliessen:hover { border-color: var(--text-3); }

.detail-inhalt { padding: 0 16px 24px; }

.detail h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  line-height: 1.3;
}

.detail-ort { margin: 0; color: var(--text-2); }

.detail-meta {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--text-2);
}

.abschnitt h3 {
  margin: 20px 0 6px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.abschnitt h4 {
  margin: 10px 0 2px;
  font-size: 0.95rem;
}

/* Schlüssel/Wert-Paare (Bewertung, Träger, Akquisestand) */
.paare {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 3px 12px;
  margin: 0;
}

.paare dt { color: var(--text-2); }
.paare dd { margin: 0; overflow-wrap: anywhere; }

.liste {
  margin: 0;
  padding-left: 1.2em;
}

.liste li { margin: 3px 0; overflow-wrap: anywhere; }

.leer, .notiz { margin: 0; }
.leer { color: var(--text-3); }

.quelle { overflow-wrap: anywhere; }

.warnung {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--warnung-grund);
  color: var(--warnung-text);
  font-size: 0.85rem;
}

/* Segment-Kürzel neben dem Bandnamen (A, B, V) */
.segment {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 4px;
  border: 1px solid var(--linie);
  border-radius: 4px;
  font-size: 0.75rem;
  text-align: center;
  color: var(--text-2);
}

/* Statuswort einer Ausgabe, farbig wie die Bubble */
.status { font-weight: 600; }
.status-belegt { color: var(--status-belegt); }
.status-angekuendigt { color: var(--status-angekuendigt); }
.status-vorausgesagt { color: var(--status-vorausgesagt); }
.status-abgesagt { color: var(--status-abgesagt); }

/* ---------------------------------------------------------------------------
   5. Farbpunkte (Legende, Chips, Detail) und Bubbles (SVG auf der Karte)
   --------------------------------------------------------------------------- */

.punkt {
  display: inline-block;
  flex: none;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: currentColor;
  background: color-mix(in srgb, currentColor 55%, transparent);
  vertical-align: -1px;
}

.punkt-klasse-a { color: var(--klasse-a); }
.punkt-klasse-b { color: var(--klasse-b); }
.punkt-klasse-c { color: var(--klasse-c); }
.punkt-klasse-d { color: var(--klasse-d); }
.punkt-status-belegt { color: var(--status-belegt); }
.punkt-status-angekuendigt { color: var(--status-angekuendigt); }
.punkt-status-vorausgesagt { color: var(--status-vorausgesagt); }
.punkt-status-abgesagt { color: var(--status-abgesagt); opacity: 0.7; }
.punkt-keine { color: var(--status-keine); width: 8px; height: 8px; opacity: 0.5; }
.punkt-gestrichelt { border-style: dashed; }

/* Die Bubbles: CSS gewinnt gegen die Attribute, die Leaflet setzt */
.bubble {
  stroke-width: 2px;
  stroke-opacity: 0.95;
  fill-opacity: 0.55;
}

.bubble:hover { stroke-width: 3px; }

.bubble-klasse-a { stroke: var(--klasse-a); fill: var(--klasse-a); }
.bubble-klasse-b { stroke: var(--klasse-b); fill: var(--klasse-b); }
.bubble-klasse-c { stroke: var(--klasse-c); fill: var(--klasse-c); fill-opacity: 0.4; }
.bubble-klasse-d { stroke: var(--klasse-d); fill: var(--klasse-d); fill-opacity: 0.35; }

.bubble-status-belegt { stroke: var(--status-belegt); fill: var(--status-belegt); }
.bubble-status-angekuendigt { stroke: var(--status-angekuendigt); fill: var(--status-angekuendigt); }
.bubble-status-vorausgesagt { stroke: var(--status-vorausgesagt); fill: var(--status-vorausgesagt); fill-opacity: 0.4; }
.bubble-status-abgesagt { stroke: var(--status-abgesagt); fill: var(--status-abgesagt); fill-opacity: 0.25; stroke-opacity: 0.7; }
.bubble-status-unbekannt { stroke: var(--status-keine); fill: var(--status-keine); }

/* keine Ausgabe im gewählten Jahr: klein, grau, halbtransparent */
.bubble-keine { stroke: var(--status-keine); fill: var(--status-keine); fill-opacity: 0.25; stroke-opacity: 0.5; }

.bubble-gestrichelt { stroke-dasharray: 4 3; }

/* die im Detailfenster gezeigte Veranstaltung */
.bubble-gewaehlt { stroke-width: 4px; stroke-opacity: 1; }

/* 150-km-Kreis, dünn und dezent, sowie Bamberg selbst */
.radius-kreis { stroke: var(--kreis); stroke-opacity: 0.6; stroke-width: 1px; stroke-dasharray: 6 6; fill: none; }
.bamberg-punkt { stroke: var(--flaeche); stroke-width: 2px; fill: var(--kreis); fill-opacity: 1; }

/* ---------------------------------------------------------------------------
   6. Legende (Leaflet-Control unten links)
   --------------------------------------------------------------------------- */

.legende {
  max-width: 220px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--flaeche);
  color: var(--text);
  box-shadow: var(--schatten);
  font-size: 0.8rem;
  line-height: 1.4;
}

.legende summary {
  cursor: pointer;
  font-weight: 600;
}

.legende-inhalt { margin-top: 4px; }

.legende-zeile {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 2px 0;
}

.legende-hinweis {
  margin: 6px 0 0;
  color: var(--text-2);
}

/* ---------------------------------------------------------------------------
   7. Fußzeile, Hinweiskasten, Fehlermeldung
   --------------------------------------------------------------------------- */

.fuss {
  flex: none;
  padding: 6px 12px;
  background: var(--flaeche);
  border-top: 1px solid var(--linie);
  font-size: 0.8rem;
  color: var(--text-2);
}

.hinweis {
  margin-bottom: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--warnung-grund);
  color: var(--warnung-text);
}

.hinweis[hidden] { display: none; }

.hinweis summary { cursor: pointer; font-weight: 600; }

.hinweis .liste {
  max-height: 25vh;
  overflow-y: auto;
  margin-top: 4px;
}

.stand { margin: 0; }

.fehler {
  max-width: 560px;
  margin: 40px auto;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--flaeche);
  box-shadow: var(--schatten);
}

.fehler h2 { margin: 0 0 8px; font-size: 1.1rem; }
.fehler p { margin: 0; }

.fehler-noscript {
  margin: 0;
  padding: 10px 12px;
  background: var(--warnung-grund);
  color: var(--warnung-text);
}

/* ---------------------------------------------------------------------------
   8. Leaflet an das Farbschema anpassen
   --------------------------------------------------------------------------- */

.leaflet-container {
  background: var(--flaeche-2);
  font: inherit;
}

.leaflet-container a { color: var(--akzent); }

.leaflet-bar a,
.leaflet-bar a:hover,
.leaflet-bar a:focus {
  background: var(--flaeche);
  color: var(--text);
  border-bottom-color: var(--linie);
}

.leaflet-bar a.leaflet-disabled {
  background: var(--flaeche-2);
  color: var(--text-3);
}

.leaflet-control-attribution {
  background: var(--flaeche);
  background: color-mix(in srgb, var(--flaeche) 85%, transparent);
  color: var(--text-2);
}

.leaflet-tooltip {
  background: var(--flaeche);
  color: var(--text);
  border-color: var(--linie);
  box-shadow: var(--schatten);
}

.leaflet-tooltip-top:before { border-top-color: var(--flaeche); }
.leaflet-tooltip-bottom:before { border-bottom-color: var(--flaeche); }
.leaflet-tooltip-left:before { border-left-color: var(--flaeche); }
.leaflet-tooltip-right:before { border-right-color: var(--flaeche); }

@media (prefers-color-scheme: dark) {
  /* Kacheln im Dunkelmodus etwas abdunkeln, aber nicht invertieren: Ortsnamen bleiben lesbar */
  .leaflet-tile-pane { filter: brightness(0.78) saturate(0.85); }
}

/* ---------------------------------------------------------------------------
   9. Schmale Bildschirme: Detailfenster wird zum Bodensheet
   --------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
  .kopf { padding: 6px 10px; }
  h1 { font-size: 1rem; }
  .untertitel { display: block; font-size: 0.8rem; }
  .zaehler { margin-left: 0; font-size: 0.85rem; }

  .knopf { min-height: 40px; padding: 4px 10px; }
  .suche { flex-basis: 100%; }

  .detail {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 62%;
    border-left: 0;
    border-top: 1px solid var(--linie);
    border-radius: 14px 14px 0 0;
    box-shadow: var(--schatten);
  }

  .detail-leiste { padding-top: 8px; }
  .detail-inhalt { padding: 0 14px 20px; }
  .fuss { padding: 5px 10px; font-size: 0.75rem; }
}

/* ---------------------------------------------------------------------------
   10. Phase 4, Kopfleiste: Seitenlink, weitere Filter, Auswahlliste, Schalter
   --------------------------------------------------------------------------- */

.kopf-links {
  display: flex;
  gap: 12px;
  font-size: 0.9rem;
}

.kopf-links a {
  padding: 4px 0;
  font-weight: 600;
  text-decoration: none;
}

.kopf-links a:hover { text-decoration: underline; }

/* Einklappbarer Kasten mit weiteren Filtern (karte.js öffnet ihn auf breiten Bildschirmen) */
.weitere-filter { margin: 0; }

.weitere-filter > summary {
  width: max-content;
  padding: 2px 0;
  font-size: 0.8rem;
  color: var(--text-2);
  cursor: pointer;
}

.weitere-filter[open] > summary { margin-bottom: 4px; }

/* Beschriftung + Dropdown */
.feld {
  display: flex;
  align-items: center;
  gap: 4px;
}

.feld select,
.auswahl > summary {
  min-height: 36px;
  max-width: 230px;
  padding: 4px 10px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--flaeche);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

/* Mehrfachauswahl (Typ): ein <details>, dessen Liste über der Karte aufklappt */
.auswahl { position: relative; }

.auswahl > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  list-style: none;
  cursor: pointer;
}

.auswahl > summary::-webkit-details-marker { display: none; }

.auswahl > summary::after {
  content: "▾";
  font-size: 0.8em;
  color: var(--text-3);
}

.auswahl-liste {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1200;
  min-width: 230px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--flaeche);
  box-shadow: var(--schatten);
}

.auswahl-schnell {
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--text-2);
}

.auswahl-eintrag {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  white-space: nowrap;
  cursor: pointer;
}

/* Häkchen-Schalter („außerhalb des Radius zeigen“, „unzugeordnete Beobachtungen“) */
.schalter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  font-size: 0.9rem;
  cursor: pointer;
}

.schalter input,
.auswahl-eintrag input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--akzent);
}

/* Knopf, der aussieht wie ein Link (Sprünge innerhalb der Seite, „mehr“, „zurücknehmen“) */
.knopf-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--akzent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.knopf-link.stark { font-weight: 600; }

/* Link, der aussieht wie ein Knopf (GitHub-Formulare, Sprung in den Assistenten) */
a.knopf {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

a.knopf:hover { border-color: var(--text-3); }

.knopf-zeile {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.knopf.klein {
  min-height: 30px;
  padding: 2px 10px;
  font-size: 0.8rem;
}

.knopf-leise { color: var(--text-2); }

.klein { font-size: 0.85rem; }

/* Vertrauen des Automaten in einen Vorschlag, als Marke */
.vertrauen {
  display: inline-block;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--klasse-d);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}

.vertrauen-hoch { background: var(--status-belegt); }
.vertrauen-mittel { background: var(--status-vorausgesagt); }
.vertrauen-niedrig { background: var(--klasse-d); }

.vertrauen-unklar,
.vertrauen-keiner {
  border: 1px solid var(--linie);
  background: var(--flaeche-2);
  color: var(--text-2);
}

/* Detailfenster: Beobachtung und neue Abschnitte */
.detail-art {
  margin: 0 0 2px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.vorschlag-zeile { margin: 0; }

.begruendung {
  margin: 4px 0 0;
  color: var(--text-2);
}

.kandidaten .grund { color: var(--text-2); }

.detail .knopf-zeile { margin-bottom: 6px; }

.leer.klein { color: var(--text-3); }

/* Unzugeordnete Beobachtungen auf der Karte: klein, grau, hohl */
.beob {
  stroke: var(--text-2);
  stroke-width: 1.5px;
  stroke-opacity: 0.9;
  fill: var(--flaeche);
  fill-opacity: 0.6;
}

.beob:hover { stroke-width: 3px; }

.beob-gewaehlt {
  stroke: var(--text);
  stroke-width: 3px;
  fill-opacity: 0.9;
}

.punkt-beobachtung {
  width: 10px;
  height: 10px;
  color: var(--text-2);
  background: transparent;
}

/* Kandidaten auf der Karte des Assistenten, Farbe nach Vertrauen */
.bubble-kandidat-hoch { stroke: var(--status-belegt); fill: var(--status-belegt); }
.bubble-kandidat-mittel { stroke: var(--status-vorausgesagt); fill: var(--status-vorausgesagt); }
.bubble-kandidat-niedrig,
.bubble-kandidat-unbekannt { stroke: var(--klasse-d); fill: var(--klasse-d); }

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--flaeche);
  color: var(--text);
  box-shadow: var(--schatten);
}

.leaflet-popup-content {
  margin: 10px 14px;
  line-height: 1.4;
}

.leaflet-container a.leaflet-popup-close-button { color: var(--text-2); }

/* ---------------------------------------------------------------------------
   11. Zuordnungsassistent (zuordnung.html)
   --------------------------------------------------------------------------- */

.eingrenzung {
  margin: 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--warnung-grund);
  color: var(--warnung-text);
  font-size: 0.9rem;
}

.eingrenzung[hidden] { display: none; }

/* Liste links, rechts Karte oben und Ausgabe unten */
.assistent {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  grid-template-areas: "liste seite";
}

.listen-spalte {
  grid-area: liste;
  overflow-y: auto;
  padding: 10px 12px 24px;
}

/* Rechte Spalte: die Karte behält eine Mindesthöhe, der Ausgabe-Kasten schrumpft und scrollt */
.seiten-spalte {
  grid-area: seite;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.kasten {
  padding: 8px 12px;
  background: var(--flaeche);
  border-left: 1px solid var(--linie);
}

.karten-kasten {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 190px;
}

.ausgabe-kasten {
  flex: 0 1 auto;
  min-height: 44px;
  overflow-y: auto;
  border-top: 1px solid var(--linie);
}

.kasten-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.kasten h2,
.ausgabe-kasten summary {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.ausgabe-kasten summary {
  padding: 4px 0;
  font-weight: 600;
  cursor: pointer;
}

.assistent-karte {
  flex: 1;
  min-height: 120px;
  border-radius: 6px;
  background: var(--flaeche-2);
}

.assistent-karte[hidden] { display: none; }

#karte-schalter { display: none; } /* nur auf schmalen Bildschirmen */

#karte-hinweis { margin: 6px 0 0; }

.erklaerung {
  margin: 6px 0;
  color: var(--text-2);
}

.erklaerung code { font-size: 0.9em; }

#ausgabe {
  width: 100%;
  min-height: 120px;
  padding: 8px;
  border: 1px solid var(--linie);
  border-radius: 6px;
  background: var(--grund);
  color: var(--text);
  font: 12px/1.4 ui-monospace, Consolas, "Courier New", monospace;
  white-space: pre;
  overflow: auto;
  resize: vertical;
}

.ausgabe-kasten .knopf-zeile { margin-top: 8px; }

.hinweis-text {
  margin: 6px 0 0;
  color: var(--warnung-text);
}

.status-text {
  margin: 4px 0 0;
  color: var(--text-2);
}

/* Die Zeilen der Liste */
.zeilen {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zeile {
  padding: 10px 12px;
  border: 1px solid var(--linie);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--flaeche);
}

.zeile:focus { outline: none; }

.zeile-aktiv {
  border-left-color: var(--akzent);
  box-shadow: var(--schatten);
}

.zeile-entschieden {
  border-left-color: var(--status-belegt);
  background: color-mix(in srgb, var(--status-belegt) 6%, var(--flaeche));
}

.zeile-gemeldet { opacity: 0.75; }

.zeile-hervorgehoben { animation: hervorheben 2.5s ease-out; }

@keyframes hervorheben {
  from { outline: 3px solid var(--fokus); outline-offset: 2px; }
  to { outline: 3px solid transparent; outline-offset: 2px; }
}

.zeile-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 4px;
}

.zeile-datum {
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

.zeile-titel { font-size: 1.02rem; }

.zeile-fest,
.zeile-ort { color: var(--text-2); }

.zeile-kopf .vertrauen { margin-left: auto; }

.zeile-text {
  margin: 4px 0;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.zeile-meta {
  margin: 2px 0;
  color: var(--text-3);
  overflow-wrap: anywhere;
}

.zeile-vorschlag { margin: 6px 0 0; }

.entscheidung {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--linie);
}

.entscheidung-knoepfe .knopf { font-size: 0.85rem; }

.kandidat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* der Kandidat, den der Automat vorgeschlagen hat */
.kandidat-vorschlag { border-color: var(--akzent); }

.neu-feld { margin-top: 8px; }

.neu-feld[hidden] { display: none; }

.neu-feld label,
.begruendung-feld {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 8px;
}

.neu-feld input,
.begruendung-feld input {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid var(--linie);
  border-radius: 6px;
  background: var(--flaeche);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.neu-hinweis {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 6px 0 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--warnung-grund);
  color: var(--warnung-text);
}

.neu-hinweis[hidden] { display: none; }

.entscheidung-stand {
  margin: 6px 0 0;
  color: var(--text-2);
}

.entscheidung-stand[hidden] { display: none; }

.marke-gemeldet {
  font-weight: 600;
  color: var(--status-angekuendigt);
}

.leer.gross {
  padding: 24px;
  font-size: 1rem;
  text-align: center;
}

/* ---------------------------------------------------------------------------
   12. Assistent auf schmalen Bildschirmen: Karte oben (klebt), dann Ausgabe, dann Liste
   --------------------------------------------------------------------------- */

@media (max-width: 899.98px) {
  body.seite-zuordnung {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: auto;              /* die ganze Seite scrollt, nicht die Liste allein */
  }

  .assistent { display: block; }

  /* Die rechte Spalte löst sich auf: Karte und Ausgabe stehen direkt in <main>,
     damit die Karte beim Scrollen der ganzen Seite oben kleben kann */
  .seiten-spalte { display: contents; }

  .kasten {
    border-left: 0;
    border-bottom: 1px solid var(--linie);
  }

  .karten-kasten { min-height: 0; }

  .ausgabe-kasten { min-height: 0; }

  .karten-kasten {
    position: sticky;
    top: 0;
    z-index: 1100;
  }

  /* #karte, damit die Regel „#karte { flex: 1 }“ aus Abschnitt 4 hier nicht gewinnt:
     mit flex: 1 hätte die Karte in einem Kasten ohne feste Höhe die Höhe null */
  #karte.assistent-karte {
    flex: none;
    height: 200px;
    min-height: 0;
  }

  #karte-schalter { display: inline-flex; }

  .ausgabe-kasten {
    max-height: none;
    border-top: 0;
  }

  .listen-spalte {
    overflow: visible;
    padding: 10px 10px 24px;
  }

  .zeile-kopf .vertrauen { margin-left: 0; }
}
