/* es.css: gemeinsames Aussehen aller internen Tools von Emundts & Stoffels.
   Regeln und Beispiele: kanzlei-wissen/gestaltung.md. Eingebunden wird die Datei absolut:
     <script src="/static/js/thema.js?v=1"></script>
     <link rel="stylesheet" href="/static/css/es.css?v=1">
   Das Thema (hell/dunkel) setzt thema.js als data-theme am html-Element.
   Nach Aenderungen die ?v=-Nummer in allen Verweisen erhoehen. */

@font-face {
  /* Outfit, SIL Open Font License (static/fonts/OFL-Outfit.txt). Liegt hier, kein Abruf bei Dritten. */
  font-family: "Outfit"; src: url("/static/fonts/outfit.woff2?v=1") format("woff2");
  font-weight: 100 900; font-display: swap;
}

/* ---------- Farben und Schrift ---------- */
:root {
  --gold: #CFB997; --gold-dark: #8a7550;
  /* Blaugrau der Kanzlei (Charcoal wie auf der Website) fuer Zweitaktionen und Gewaehltes
     (Entscheidung Max 2026-11-23, Entwurf A Variante 1) */
  --blau: #36454F; --blau-hover: #2b3840; --blau-hell: #e6eaed; --auf-blau: #ffffff;
  --blau-rand: #36454F;   /* Rand und Farbe von Gewaehltem (Filter, Kaestchen, Schalter) */
  --knopfrand: #b9c2c6;   /* Rand nicht gewaehlter Filter und Kaestchen */
  --leiste-hover: #E9EDEE; --leiste-aktiv: #E2E7E8;
  --bg: #FBFCFC;          /* Seitengrund, fast weiss */
  --leiste: #F1F4F4;      /* Seitenleiste, neutrales helles Grau (kein Beige) */
  --kachel: #F1F4F4;      /* getoente Flaechen, Felder, Suchfeld */
  --aktiv: #E2E7E8;       /* gewaehlter Eintrag, Tabellenkopf */
  --hover: #E9EDEE;
  --kontrast: #1f2a31;    /* die eine dunkle Flaeche (.gross.dunkel) */
  --auf-kontrast: #ffffff;
  --text: #1f2a31; --text-2: #66727a; --line: #e3e7e8; --danger: #b42318;
  --schrift: "Outfit", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --rand: clamp(20px, 5vw, 64px);
  /* Alles ist eckig: Knoepfe, Filter, Marken, Felder. Kreise nur fuer Kuerzel, runde Symbolknoepfe,
     Schalter und den Haken im dunklen Kreis. Keine Pillen (Entscheidung Max 2026-11-11). */
  --ecke: 2px;
}
:root[data-theme="dark"] {
  /* Nacht in Kanzlei-Blaugrau (Entscheidung Max 2026-11-23): Grund sehr dunkles Blaugrau, Leiste #36454F */
  --bg: #1b242a; --leiste: #36454F; --leiste-hover: #3f505b; --leiste-aktiv: #4a5d69;
  --kachel: #243038; --aktiv: #2a3740; --hover: #223038;
  --kontrast: #edeae3; --auf-kontrast: #1f2a31;
  --text: #edeae3; --text-2: #a3b0b8; --line: #33424c; --gold-dark: #CFB997; --danger: #f97066;
  --blau: #5b7182; --blau-hover: #6a8295; --blau-hell: #2e3d47; --blau-rand: #8ea3b2; --auf-blau: #ffffff; --knopfrand: #5a6c78;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--schrift); font-size: 14px; line-height: 1.4;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.icon { width: 18px; height: 18px; fill: none; flex-shrink: 0; }
.icon-sm { width: 13px; height: 13px; fill: none; flex-shrink: 0; color: var(--text-2); }

h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
h2 { margin: 32px 0 14px; font-size: 20px; font-weight: 700; }
h2.klein { margin: clamp(32px, 6vh, 52px) 0 6px; font-size: 16px; }
.lage { margin: 8px 0 0; color: var(--text-2); min-height: 1.4em; }
.hilfe { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.fehler { color: var(--danger); }

/* ---------- Rahmen: Seitenleiste links, Inhalt rechts ---------- */
body.mit-leiste { display: grid; grid-template-columns: 288px minmax(0, 1fr); }
main { padding: clamp(28px, 8vh, 76px) var(--rand) 80px; }
/* Breite des Inhalts: Lesespalte (Standard), Liste oder volle Arbeitsflaeche */
.breite { max-width: 720px; margin: 0 auto; }
.breite.liste { max-width: 980px; }
.breite.voll { max-width: none; }

.leiste { background: var(--leiste); height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; }
.marke { display: flex; align-items: center; padding: 20px 24px 18px; }
.marke img { height: 44px; }
.logo-hell { display: none; }
.logo-dunkel { mix-blend-mode: multiply; }
[data-theme="dark"] .logo-dunkel { display: none; }
[data-theme="dark"] .logo-hell { display: block; }
.menue { display: none; margin-left: auto; border: 0; border-radius: var(--ecke); padding: 8px 16px; background: var(--aktiv); }
.suche { display: flex; align-items: center; gap: 10px; margin: 0 16px 12px; padding: 0 12px; border-radius: var(--ecke); background: var(--bg); color: var(--text-2); }
.suche .icon { width: 16px; height: 16px; }
.suche input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 8px 0; color: var(--text); }
.suche:focus-within { box-shadow: 0 0 0 2px var(--gold); }
.leiste nav { flex: 1; overflow-y: auto; padding-bottom: 12px; }
.ueber { margin: 0; padding: 14px 24px 8px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.hinweis { margin: 0; padding: 4px 24px 8px; color: var(--text-2); font-size: 13px; }

/* Eintrag der Seitenleiste: 40 px hoch, Markierung ueber die volle Breite, keine runden Ecken */
.zeile { position: relative; display: flex; }
.zeile > a, summary { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 24px; }
.zeile > a:hover, .zeile:focus-within > a, summary:hover { background: var(--hover); }
.zeile.aktiv > a { background: var(--aktiv); }
.leiste .zeile > a:hover, .leiste .zeile:focus-within > a, .leiste summary:hover { background: var(--leiste-hover); }
.leiste .zeile.aktiv > a { background: var(--leiste-aktiv); }
.zeile > a:focus-visible, summary:focus-visible { outline-offset: -2px; }
.zeile .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gruppe .zeile > a { min-height: 36px; padding-left: 62px; }
/* In Gruppen steht ein Kennzeichen (BETA) links im Einzug, damit der Name die volle Breite behaelt. */
.gruppe .zeile .badge { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; width: 7px; height: 7px; margin-left: auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s; flex-shrink: 0; }
summary:has(.n)::after { margin-left: 10px; }
details[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }

.badge { font-size: 10px; font-weight: 600; letter-spacing: .04em; color: var(--gold-dark); border: 1px solid var(--gold); border-radius: var(--ecke); padding: 0 4px; line-height: 1.5; flex-shrink: 0; }
/* Zahl offener Punkte */
/* Zwei Zahlenarten (Entscheidung Max 2026-11-11):
   .n     Handlungsbedarf, etwas wartet auf den Nutzer: dunkles, eckiges Kaestchen.
   .menge reine Anzahl (Filter, Spaltenkoepfe, Treffer "34 von 34"): graue Zahl ohne Form. */
.n {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--ecke); flex-shrink: 0; margin-left: auto;
  background: var(--gold); color: #1f2a31; font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
}
/* Aufgeklappte Gruppe: die Kaestchen stehen an den Eintraegen, die Summe ist dann nur grau. */
details[open] > summary .n { background: none; color: var(--text-2); font-weight: 400; }
.menge { color: var(--text-2); font-weight: 400; font-variant-numeric: tabular-nums; }
.chip .menge { margin-left: 6px; }
.chip[aria-pressed="true"] .menge { color: var(--text-2); opacity: 1; }

/* Unten in der Leiste: wer angemeldet ist, darunter Glocke, hell/dunkel, abmelden */
.ich { padding: 12px 16px 14px 24px; border-top: 1px solid var(--line); }
.ich .wer { display: flex; align-items: center; gap: 12px; }
.kreis, .avatar { border-radius: 50%; background: var(--gold); color: #1f2a31; display: grid; place-items: center; font-weight: 600; flex-shrink: 0; }
.kreis { width: 36px; height: 36px; font-size: 13px; }
.avatar { width: 34px; height: 34px; font-size: 12px; }
.ich .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ich .knoepfe { display: flex; align-items: center; gap: 4px; margin: 8px 0 0 -8px; }
.ich [data-es-glocke] { display: inline-flex; margin: 0 2px 0 9px; }
.rund { width: 34px; height: 34px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; color: var(--text-2); }
.rund:hover { background: var(--hover); color: var(--text); }
/* Nur am Handy sichtbar: Wege, die sonst in der eingeklappten Leiste verschwinden. */
.nur-mobil { display: none; }

/* ---------- Knoepfe ---------- */
.pille { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--ecke); padding: 10px 22px; background: var(--blau); color: var(--auf-blau); font-size: 15px; white-space: nowrap; text-decoration: none; }
.pille:hover { background: var(--blau-hover); }
/* Nebenaktion (Abbrechen, Nicht eintragen): Text ohne Flaeche, beim Ueberfahren getoent */
.pille.neben { background: none; color: var(--text); padding-left: 10px; padding-right: 10px; }
.pille.neben:hover { background: var(--hover); }
.pille.haupt { background: var(--gold); color: #1f2a31; }
.pille.haupt:hover { filter: brightness(1.05); background: var(--gold); }
.pille.gefahr { background: var(--bg); box-shadow: inset 0 0 0 1px var(--danger); color: var(--danger); }
.pille.gefahr:hover { background: var(--danger); color: #fff; }
.pille[disabled] { opacity: .55; cursor: default; }
.klein-knopf { border: 0; background: none; padding: 0; color: var(--text-2); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.klein-knopf:hover { color: var(--text); }
.zurueck { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; border: 0; background: none; padding: 0; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.zurueck::before { content: ""; width: 8px; height: 8px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.kopfzeile { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* Kopf eines Eintrags (Entscheidung Max 2026-11-23, Entwurf B mit Gruende-Flaeche aus A): runder Zurueck-Knopf links,
   Titel mit grauer Zeile (Art, Stand), rechts die Knopfreihe; darunter optional .gruende */
.eintragkopf { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.eintragkopf > .titel { flex: 1 1 260px; min-width: 0; }
.eintragkopf h1 { margin: 0; }
.eintragkopf .lage { display: block; margin-top: 2px; color: var(--text-2); font-size: 14px; }
.eintragkopf > .knopfreihe { margin-left: auto; }
@media (max-width: 860px) { .eintragkopf h1 { font-size: 22px; } }
.zurueck-rund { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--text);
  display: inline-grid; place-items: center; flex-shrink: 0; text-decoration: none; }
.zurueck-rund:hover { background: var(--hover); }
.gruende { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; background: var(--kachel); padding: 14px 18px; }
.gruende > .icon { color: var(--danger); margin-top: 3px; }
.gruende strong { display: block; }
.gruende .grund { color: var(--danger); }
.textknopf { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; color: var(--text-2);
  font-size: 14px; text-decoration: none; white-space: nowrap; }
.textknopf:hover { color: var(--text); }
.pille .icon { width: 18px; height: 18px; }
/* Mehrfachauswahl als Kaestchen mit sichtbarem Haken (Hinweis Max 2026-11-23: dunkel gefuellte Kaestchen liessen
   offen, ob sie an oder aus sind); gewaehlt mit dunklem Rand und fett */
.wahlreihe { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
label.wahl { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: var(--ecke);
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--knopfrand); font-size: 14px; cursor: pointer; }
label.wahl input { width: 16px; height: 16px; margin: 0; accent-color: var(--blau-rand); cursor: inherit; }
label.wahl:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--blau-rand); font-weight: 600; }
label.wahl:has(input:disabled) { color: var(--text-2); cursor: default; }
label.wahl:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
/* Knopf rechts in einer Ueberschriftenzeile (Vorschau, Abschnitt) */
.kopfzeile > h2 + .pille.klein:last-child { margin-left: auto; }
/* Kleiner Knopf, vor allem in Tabellenzeilen */
.pille.klein { padding: 6px 16px; font-size: 14px; }
/* Mehrere Knoepfe nebeneinander (unter einem Abschnitt, ueber einer Liste) */
.knopfreihe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
/* Aktionen in einer Tabellenzeile: rechtsbuendig untereinander, Hauptaktion zuerst als kleiner
   Knopf, Nebenwege (Link, Herkunft) als Textknopf darunter, ein Zustand als Nebentext darunter. */
.aktionsfeld { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.aktionsfeld .zustand { color: var(--text-2); font-size: 13px; }
.kopfzeile h1 { margin-right: auto; }

/* ---------- Flaechen und Listen ---------- */
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: clamp(28px, 6vh, 52px); }
.zwei.einzeln { grid-template-columns: 1fr; }
.gross { position: relative; min-height: 190px; padding: 28px 32px; display: flex; flex-direction: column; background: var(--kachel); }
.gross.dunkel { background: var(--kontrast); color: var(--auf-kontrast); }
.gross::after { content: ""; position: absolute; right: 30px; bottom: 34px; width: 9px; height: 9px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); opacity: .45; }
a.gross:hover::after { opacity: 1; }
a.gross:hover strong { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.gross strong { margin-top: auto; padding-right: 28px; font-size: 25px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.marke-klein { align-self: flex-start; padding: 3px 10px; border-radius: var(--ecke); background: var(--gold); color: #1f2a31; font-size: 13px; }
.marke-klein.eng { padding: 1px 8px; font-size: 12px; margin-left: 8px; vertical-align: 1px; }
.ruhe { min-height: 190px; margin-top: clamp(28px, 6vh, 52px); padding: 28px 32px; background: var(--kachel); display: flex; align-items: flex-end; }
.ruhe strong { font-size: 25px; font-weight: 600; color: var(--text-2); }
.reihe { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
a.reihe:hover .was { text-decoration: underline; }
.reihe b { min-width: 22px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.reihe .was { min-width: 0; overflow-wrap: anywhere; }
.reihe .ziel { margin-left: auto; color: var(--text-2); white-space: nowrap; }
.reihe .icon { color: var(--text-2); }

/* ---------- Suche, Filter, Tabelle ---------- */
.suchfeld { display: flex; align-items: center; gap: 10px; margin-top: 28px; padding: 0 14px; background: var(--kachel); color: var(--text-2); }
.suchfeld input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 11px 0; font-size: 15px; color: var(--text); }
.suchfeld:focus-within { box-shadow: inset 0 -2px 0 var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.chip { border: 0; border-radius: var(--ecke); padding: 6px 14px; background: none; box-shadow: inset 0 0 0 1px var(--knopfrand); }
.chip:hover { background: var(--hover); }
.chip[aria-pressed="true"] { background: var(--blau-hell); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--blau-rand); font-weight: 600; }
.tabelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 600; padding: 12px 16px; background: var(--aktiv); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
/* Spaltenarten: Zahlen samt Kopf rechtsbuendig, kurze Angaben ohne Umbruch, Text mit Mindestbreite */
th.zahl, td.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.eng, td.eng { white-space: nowrap; }
td.breit { min-width: 12em; }
th.aktionen, td.aktionen { text-align: right; }
table.klickbar tbody tr, tbody tr.klickbar { cursor: pointer; }
/* Jede Tabellenzeile wird beim Ueberfahren leicht grau, damit man in breiten Zeilen nicht verrutscht (Wunsch Max
   2026-11-23); Ausnahme per Klasse .ohne-hover an der Tabelle */
table:not(.ohne-hover) > tbody > tr:hover, table.klickbar tbody tr:focus-within, tbody tr.klickbar:focus-within { background: var(--hover); }
/* Spaltenfilter unter dem Tabellenkopf wie in DATEV (static/js/spaltenfilter.js) */
tr.filterzeile th { padding-top: 0; padding-bottom: 8px; font-weight: 400; vertical-align: top; }
tr.filterzeile input, tr.filterzeile select { width: 100%; min-width: 70px; height: 32px; padding: 4px 8px; font: inherit;
  font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--ecke); }
tr.filterzeile th.aktiv input, tr.filterzeile th.aktiv select { border-color: var(--gold); }
tr.filterzeile .klein-knopf { white-space: nowrap; font-size: 13px; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person button { border: 0; background: none; padding: 0; text-align: left; font-weight: 500; }
.person .mail { display: block; color: var(--text-2); font-size: 13px; }

/* ---------- Reiter und Formulare ---------- */
/* Reiter als Karteikarten (Entscheidung Max 2026-11-23 aus drei Entwuerfen): getoente Kaestchen, der gewaehlte hell
   mit Gold oben und ohne Linie zum Inhalt. Die Linie unten ist ein Schatten des Containers, so verdeckt der gewaehlte
   Reiter sie auch bei seitlichem Scrollen. Optional .reiter-inhalt um den Inhalt fuer den Rahmen. */
.reiter { display: flex; gap: 4px; margin-top: 18px; box-shadow: inset 0 -1px 0 var(--line); overflow-x: auto; }
.reiter button, .reiter a { border: 1px solid transparent; border-bottom: 0; background: var(--kachel); color: var(--text-2);
  padding: 10px 20px; font-size: 15px; white-space: nowrap; text-decoration: none; border-radius: var(--ecke) var(--ecke) 0 0; }
.reiter button:hover, .reiter a:hover { background: var(--hover); color: var(--text); }
.reiter [aria-selected="true"], .reiter [aria-current="page"] { background: var(--bg); color: var(--text); font-weight: 700;
  border-color: var(--line); box-shadow: inset 0 3px 0 var(--gold); }
.reiter-inhalt { border: 1px solid var(--line); border-top: 0; padding: 4px 20px 20px; }
@media (max-width: 860px) { .reiter button, .reiter a { padding: 10px 14px; } .reiter-inhalt { padding: 4px 12px 12px; } }
.feld-gruppe { max-width: 520px; }
.feld { display: block; margin-bottom: 18px; }
/* Ueberschrift eines Felds kraeftiger als der Inhalt (Hinweis Max 2026-11-23) */
.feld > span, .feld > label > span { display: block; margin-bottom: 6px; color: var(--text); font-size: 15px; font-weight: 600; }
.feld input:not([type="checkbox"]):not([type="radio"]), .feld textarea, select {
  width: 100%; border: 0; border-top: 2px solid var(--text-2); border-radius: 0; background: var(--kachel);
  padding: 10px 12px; font-size: 15px; color: var(--text);
}
.feld input:focus-visible, .feld textarea:focus-visible, select:focus-visible { outline: none; border-top-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
/* Schalter: echtes Kontrollkaestchen, als Schieber gezeichnet */
.schalter { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.schalter input { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; border-radius: 11px; background: var(--aktiv); position: relative; margin: 0; flex-shrink: 0; cursor: pointer; transition: background-color .15s; }
.schalter input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); box-shadow: 0 0 0 1px var(--text-2); transition: transform .15s; }
.schalter input:checked { background: var(--blau-rand); }
.schalter input:checked::after { transform: translateX(18px); box-shadow: none; }
.leiste-unten { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- Gefuehrte Tour (static/js/tour.js, gestaltung.md „Tour durch das Tool“) ----------
   Seite grau, das erklaerte Element bleibt hell: ein Ausschnitt mit grauem Rand ueber die ganze Seite und
   goldenem Rahmen, Karte darunter; ohne Element mittig, am Handy unten fest. Einzige Ausnahme von „keine Schatten“. */
.tour-loch { position: fixed; z-index: 999; pointer-events: none; border-radius: var(--ecke);
  box-shadow: 0 0 0 3px var(--gold), 0 0 0 200vmax rgba(31, 42, 49, .55); transition: top .2s, left .2s, width .2s, height .2s; }
.tour-loch.ohne-ziel { top: 50% !important; left: 50% !important; width: 0 !important; height: 0 !important; box-shadow: 0 0 0 200vmax rgba(31, 42, 49, .55); }
.tour-karte { position: fixed; z-index: 1000; width: min(400px, calc(100vw - 24px)); background: var(--bg); color: var(--text);
  border-top: 4px solid var(--gold); padding: 14px 20px 0; }
.tour-karte.mitte { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.tour-karte .tour-oben { display: flex; justify-content: space-between; align-items: center; }
.tour-karte .tour-stand { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tour-karte .tour-schliessen { font-size: 22px; line-height: 1; }
.tour-karte .tour-titel { margin: 6px 0; }
.tour-karte .tour-text { margin: 0 0 16px; font-size: 15px; line-height: 1.5; }
.tour-karte .tour-fuss { display: flex; align-items: center; gap: 12px; margin: 0 -20px; padding: 12px 20px; background: var(--kachel); }
.tour-karte .tour-balken { flex: 1; height: 6px; background: var(--aktiv); border-radius: 3px; overflow: hidden; }
.tour-karte .tour-balken i { display: block; height: 100%; width: 0; background: var(--blau-rand); transition: width .2s; }
.tour-karte .tour-zurueck { background: var(--bg); }
.tour-karte.unten-fest { left: 12px !important; right: 12px; bottom: 12px; top: auto !important; width: auto; }
@media (prefers-reduced-motion: reduce) { .tour-loch, .tour-karte .tour-balken i { transition: none; } }

/* ---------- Rueckfrage und Meldung ---------- */
dialog { border: 0; padding: 28px 32px; max-width: 420px; background: var(--bg); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
dialog h2 { margin: 0 0 8px; }
dialog p { margin: 0 0 22px; color: var(--text-2); }
dialog .knoepfe { display: flex; gap: 10px; }
#toast, .toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #1f2a31; color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s;
}
#toast.show, .toast.show { opacity: 1; }

/* ---------- Laufender Vorgang (Ladesymbol) ---------- */
/* Fuer Vorgaenge ohne messbaren Fortschritt (Pruefung, Abgleich, Abruf): drehendes Symbol links, Text fett, rechts die
   bisherige Dauer aus data-dauer. Klasse an ein Element mit reinem Text haengen, die Dauer setzt window.esLadend()
   aus thema.js (ab drei Sekunden). Passt in .meldung, auf getoente Flaechen und frei in den Inhalt. */
.ladend { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.ladend::before {
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--text); animation: es-dreh .8s linear infinite;
}
.ladend::after { content: attr(data-dauer); margin-left: auto; font-weight: 400; color: var(--text-2); font-variant-numeric: tabular-nums; }
@keyframes es-dreh { to { transform: rotate(360deg); } }

/* ---------- Rechtsklick-Menue (Kontextmenue) ---------- */
/* Eigenes Menue an Eintraegen, die man auch nebeneinander braucht ("In neuem Fenster oeffnen").
   Umschalt + Rechtsklick laesst das Menue des Browsers durch. Vorlage: tools-auth/static/js/start.js. */
.kontextmenue {
  position: fixed; z-index: 1000; min-width: 230px; padding: 6px 0;
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--ecke);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}
.kontextmenue .titel { margin: 0; padding: 6px 14px 8px; color: var(--text-2); font-size: 13px; border-bottom: 1px solid var(--line); }
.kontextmenue .punkt {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 14px;
  border: 0; background: none; color: inherit; font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.kontextmenue .punkt .icon { width: 16px; height: 16px; color: var(--text-2); }
.kontextmenue .punkt:not(:has(.icon)) { padding-left: 40px; }
.kontextmenue .punkt:hover, .kontextmenue .punkt:focus-visible { background: var(--hover); outline: none; }
.kontextmenue .titel + .punkt { margin-top: 4px; }

@media (prefers-reduced-motion: reduce) {
  summary::after, .schalter input, .schalter input::after { transition: none; }
  .ladend::before { animation: none; border-color: var(--text); border-right-color: var(--line); }
}
@media (max-width: 860px) {
  body.mit-leiste { display: block; }
  .leiste { position: static; height: auto; }
  .menue { display: block; }
  .leiste nav, .leiste .suche { display: none; }
  .leiste.offen nav { display: block; max-height: 60vh; }
  .leiste.offen .suche { display: flex; }
  .ich { display: flex; align-items: center; padding: 10px 16px 10px 24px; }
  .ich .wer { flex: 1; min-width: 0; }
  .ich .knoepfe { margin: 0; }
  .zwei { grid-template-columns: 1fr; }
  /* Handy: Felder ab 16 px, sonst zoomt iOS hinein; Tippflaechen ab 44 px. */
  .feld input:not([type="checkbox"]):not([type="radio"]), .feld textarea, select, .suchfeld input, .suche input { font-size: 16px; }
  tr.filterzeile input, tr.filterzeile select { font-size: 16px; height: 44px; }
  .zeile > a, summary, .gruppe .zeile > a { min-height: 44px; }
  .pille, .chip { min-height: 44px; }
  .rund { width: 44px; height: 44px; }
  .nur-mobil { display: grid; }
}
