/* Theme: Kundenfarbe #004077 (rgb 0,64,119 / hsl 208,100%,23%) + Abstufungen. */
:root {
  --bg: #f4f7fa;
  --card: #ffffff;
  --text: #12263a;
  --muted: #5a6e80;
  --line: #d7e1eb;
  --accent: #004077;
  --accent-dark: #00305a;
  --soft: #e6f0f9;
  --warning: #fff7ed;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #e3edf7, var(--bg) 42%);
}
a { color: var(--accent-dark); }
.page { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.page.narrow { width: min(760px, calc(100% - 32px)); }
.page.wide { width: min(1320px, calc(100% - 24px)); }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.brand { font-weight: 800; font-size: 1.05rem; }
.tag, .eyebrow { color: var(--accent-dark); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; font-size: .78rem; }
.card, .metric, .hero {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(0,48,90,.08);
  padding: 26px;
}
.hero { margin-top: 60px; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.05; margin: 10px 0 16px; }
h2 { font-size: 1.25rem; margin: 0 0 14px; }
p { line-height: 1.55; }
.muted { color: var(--muted); }
.salutation { font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.grid { display: grid; gap: 18px; margin: 18px 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.subtle { background: var(--soft); }
.address-block { font-size: 1.25rem; line-height: 1.35; margin: 16px 0; }
.meta { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 700; }
.meta.large { grid-template-columns: 110px 1fr; font-size: 1.05rem; }
.notice { background: var(--warning); border: 1px solid #fed7aa; padding: 12px 14px; border-radius: 14px; }
/* Verlorenes Wettrennen um den letzten Platz (Q3) bzw. ein Fenster, das beim
   Nachladen vollgelaufen ist (Q2): kraeftiger als ein normaler Hinweis. */
.notice.taken { background: #fdeeee; border-color: #f3c1c1; color: #7f1d1d; font-weight: 600; margin-bottom: 14px; }
.form-card { margin-top: 18px; }

/* Ansichts-Umschalter Kalender/Liste */
.view-toggle { display: flex; gap: 6px; background: var(--soft); border-radius: 999px; padding: 4px; }
.view-toggle a {
  padding: 7px 16px; border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: .9rem; color: var(--accent-dark);
}
.view-toggle a.active { background: var(--accent); color: #fff; }
/* Zwei Gruppen im Verwaltungsmenü (R15): „Betrieb" und „Einrichtung". Die
   Beschriftung sitzt in der Leiste selbst, damit die Trennung ohne Legende
   lesbar ist; jede Gruppe ist eine eigene Pillenleiste. */
.view-toggle.grouped { background: none; padding: 0; gap: 14px; flex-wrap: wrap; align-items: center; }
/* `flex-wrap: wrap` an der Gruppe selbst, nicht nur an der Leiste darum: die
   Gruppe "Betrieb" traegt fuenf Eintraege, ihre Mindestbreite lag damit bei
   rund 560 px. Auf dem Handy hat das die ganze Verwaltungsseite ueber die
   Bildbreite hinausgeschoben (der `.page`-Container richtet sich nach dem
   breitesten Kind) — sichtbar als abgeschnittene Ueberschriften auf jeder
   Admin-Seite, nicht nur im Menue. */
.nav-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
             background: var(--soft); border-radius: 999px; padding: 4px 4px 4px 12px; }
.nav-label { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
             color: var(--muted); padding-right: 4px; }

/* Listenansicht */
.slot-list { display: grid; gap: 12px; margin: 18px 0 22px; }
.slot {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
  background: #fff;
}
.slot:hover { border-color: var(--accent); }
.slot input { margin-top: 5px; transform: scale(1.2); accent-color: var(--accent); }
.slot span { display: grid; gap: 4px; }
.slot em { font-style: normal; font-size: 1.04rem; }
.slot small { color: var(--muted); }
.slot.disabled { opacity: .45; cursor: not-allowed; }

/* Kalenderansicht (Hauptansicht): Wochenraster Mo-Fr, Begehungen nur werktags */
.cal { display: grid; gap: 10px; margin: 18px 0 8px; }
.cal-week-head { display: flex; gap: 12px; align-items: baseline; font-weight: 800; font-size: .95rem; margin-top: 8px; }
.cal-week-head .muted { font-weight: 400; font-size: .85rem; }
.cal-week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cal-day { border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: #fff; min-height: 92px; }
.cal-day.empty { background: transparent; border-style: dashed; opacity: .55; }
.cal-date { font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.cal-slot {
  position: relative;
  display: grid; gap: 1px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  margin-top: 6px;
  cursor: pointer;
  background: #fff;
  font-weight: 400;
}
.cal-slot:hover { border-color: var(--accent); }
.cal-slot input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.cal-slot .cal-time { font-weight: 700; font-size: .86rem; }
.cal-slot .cal-free { color: var(--muted); font-size: .78rem; }
.cal-slot:has(input:checked) { border-color: var(--accent); background: var(--soft); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-slot:has(input:checked) .cal-free { color: var(--accent-dark); font-weight: 700; }
/* Fallback ohne :has() (alte Browser): Auswahl bleibt über Haken + Farbe sichtbar. */
.cal-slot input:checked ~ .cal-time { color: var(--accent-dark); }
.cal-slot input:checked ~ .cal-time::after { content: " ✓"; color: var(--accent); font-weight: 800; }
.cal-slot:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-slot.disabled { opacity: .45; cursor: not-allowed; }
.cal-slot.disabled input { cursor: not-allowed; }
.cal-hint { font-size: .85rem; margin: 4px 0 18px; }

.fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
label { font-weight: 700; }
input[type="tel"], textarea {
  width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  font: inherit; background: #fff;
}
/* Der Ziehgriff des Hinweisfeldes konnte das Layout sprengen (Meldung
   schoenbach 2026-08-14). Statt Handbetrieb wächst das Feld selbst mit dem
   Text (data-autogrow) und scrollt ab der Maxhöhe. box-sizing, weil die Höhe
   aus JS gesetzt wird und das Padding nicht doppelt zählen darf. */
.fields textarea {
  resize: none; box-sizing: border-box; overflow-y: auto; max-height: 11rem;
}
.privacy { font-size: .9rem; color: var(--muted); }
/* Tastaturbedienung sichtbar machen (Testbefund F4, 2026-08-13): Slots hatten
   bereits einen Fokusring, Eingabefelder und Buttons nicht. */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.slot:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
button[disabled] { opacity: .6; cursor: progress; }
.button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 13px 20px;
  background: var(--accent); color: white; text-decoration: none; font-weight: 800; cursor: pointer;
}
.button:hover { background: var(--accent-dark); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button.full { width: 100%; font-size: 1.05rem; }
.button.ghost { background: #e9f1f8; color: var(--accent-dark); }
.button.small { padding: 9px 13px; font-size: .9rem; }
.success { text-align: center; margin-top: 40px; max-width: 560px; margin-inline: auto; }
.success h1 { font-size: clamp(1.5rem, 5vw, 1.9rem); }
.check { width: 66px; height: 66px; border-radius: 50%; background: var(--accent); color: white; display: grid; place-items: center; font-size: 2.2rem; margin: 0 auto 12px; }
/* Storno ist kein Erfolg und kein Fehler — gedeckt statt grün, aber in
   derselben Form, damit die Seite als Abschluss erkennbar bleibt. */
.check.plain { background: #e9f1f8; color: var(--accent-dark); }
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-weight: 400; font-size: .85rem; }
/* Ohne diese Zeile schlägt die Klassenregel das `hidden`-Attribut (UA-Regel
   ist schwächer) und der Hinweis stünde von Anfang an da. */
.field-hint[hidden] { display: none; }
/* Die Zusammenfassung auf der Bestätigungsseite steht **untereinander**, nicht
   im zweispaltigen Raster von `.meta`: die Karte ist zentriert, das Raster hat
   aber eine feste Beschriftungsspalte am linken Rand — im iFrame über die
   volle Seitenbreite standen „Adresse" und „Zeitfenster" dadurch einsam weit
   links neben ihrem Inhalt (Bugreport Victor). */
.success .meta { display: block; text-align: center; }
.success .meta dt { font-size: .9rem; margin-top: 12px; }
.success .meta dd { margin: 2px 0 0; }
.metric strong { display: block; font-size: 2rem; }
.metric span { color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
/* Nicht an ein <td> haengen: `display: flex` nimmt die Zelle aus dem
   Zeilenlayout, sie wird niedriger als ihre Zeile und ihre Trennlinie sitzt zu
   hoch (R24). In Tabellen gehoert die Reihe in ein <div> in der Zelle. */
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
/* Admin: lange Listen scrollen im Rahmen statt auf der Seite (~20-30 Zeilen). */
.table-frame { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.table-frame table th { position: sticky; top: 0; background: #fff; z-index: 1; box-shadow: 0 1px 0 var(--line); }
.table-frame.slot-admin { padding: 0 14px; }
th a { color: inherit; text-decoration: none; }
th a:hover { color: var(--accent-dark); }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.filter-bar input[type="search"], .filter-bar select, .settings-form input[type="text"],
.settings-form input[type="number"], .settings-form input[type="date"], .settings-form input[type="file"],
.settings-form input[type="time"], .settings-form input[type="password"], .settings-form select,
.settings-form textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; background: #fff;
}
.filter-bar input[type="search"] { min-width: 220px; }
.result-count { margin-left: auto; font-size: .9rem; }
/* Statuslegende (z. B. Entwurf/gueltig/abgeloest ueber der Laeufe-Tabelle) —
   dauerhaft sichtbar statt aufklappbar: das Vokabular liest man genau einmal,
   und zwar bevor man auf „Veroeffentlichen" drueckt. */
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; margin: 4px 0 0; }
.legend-item { display: inline-flex; gap: 7px; align-items: baseline; }

/* Erklärtext hinter einem (i) statt in der Fläche (R21). Muster für die ganze
   Verwaltung, Aufruf über das Jinja-Makro in `_info.html`. Ohne JavaScript:
   <details> trägt den Zustand, `position: absolute` nimmt den Kasten aus dem
   Fluss, damit er die Kachel nicht auseinanderzieht. Nicht in Containern mit
   `overflow: auto` verwenden — dort schneidet der Rahmen ihn ab. */
.info { position: relative; display: inline-block; vertical-align: middle; margin-left: 6px; }
.info > summary {
  list-style: none; cursor: help; display: inline-grid; place-items: center;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--soft); color: var(--accent-dark);
  font-size: .78rem; font-weight: 800; font-style: italic; line-height: 1;
  user-select: none;
}
.info > summary::-webkit-details-marker { display: none; }
.info > summary:hover { background: var(--accent); color: #fff; }
.info[open] > summary { background: var(--accent); color: #fff; }
.info-body {
  position: absolute; z-index: 20; top: calc(100% + 8px); left: 0;
  width: max-content; max-width: min(340px, 78vw);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; box-shadow: 0 10px 26px rgba(0, 32, 64, .16);
  font-size: .86rem; font-weight: 400; line-height: 1.45; color: var(--text);
  white-space: normal; text-align: left;
}
.info-body > :first-child { margin-top: 0; }
.info-body > :last-child { margin-bottom: 0; }
.info-title { display: block; margin-bottom: 5px; font-size: .86rem; }
/* Nahe am rechten Rand nach links öffnen, statt aus der Kachel zu laufen. */
.info.left .info-body { left: auto; right: 0; }
/* Auf schmalen Screens wird beides aufgehoben, siehe Medienabfrage unten. */

/* Admin-Einstellungen */
.msg { background: #e8f5ee; border: 1px solid #b5e0c8; color: #14532d; padding: 11px 14px; border-radius: 12px; font-weight: 600; }
.msg.error { background: #fdeeee; border-color: #f3c1c1; color: #7f1d1d; }
.msg.warn { background: #fef6e7; border-color: #f5d9a3; color: #7c2d12; }
.settings-form { display: grid; gap: 16px; margin-top: 14px; }
/* `resize: vertical` statt frei (R17): waagerecht gezogen wuchs das Feld ueber
   seine Kachel hinaus und legte sich ueber die Nachbarkachel — die Breite
   gehoert dem Raster, die Hoehe darf der Nutzer haben. */
.settings-form textarea {
  width: 100%; max-width: 100%; resize: vertical; box-sizing: border-box;
  font-family: ui-monospace, Consolas, monospace;
}
.settings-form input[type="text"], .settings-form input[type="password"] { width: 100%; }
/* Anmeldung Feld/Zentrale: Beschriftung ueber dem Feld, Tap-Ziel 48 px.
   Bewusst eine eigene Klasse und nicht `.settings-form label` — das haette
   auch die Kontrollkaestchen im Admin auf Raster umgestellt. */
.login-form label { display: grid; gap: 6px; }
.login-form input { min-height: 48px; }
.settings-form .small { margin: 6px 0 0; font-size: .86rem; }
.settings-form .button { justify-self: start; }
/* Fenster hinzufügen: Felder nebeneinander, auf dem Handy untereinander. */
.field-row { display: flex; flex-wrap: wrap; gap: 14px; }
.field-row label { display: grid; gap: 5px; font-weight: 600; font-size: .9rem; flex: 1 1 170px; }
.field-row input, .field-row select { width: 100%; }
.upload-row { display: grid; gap: 6px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
/* Sprungmarken innerhalb einer langen Seite (R15). Klebt oben, damit sie beim
   Rollen erreichbar bleibt; `scroll-margin` am Ziel, sonst verdeckt sie die
   Überschrift, zu der sie gerade gesprungen ist. */
.subnav { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px;
          margin: 0 0 14px; padding: 8px 0;
          /* Halbdeckend, weil hinter der Seite ein Verlauf liegt: eine volle
             Fläche in --bg würde beim Rollen als Kante sichtbar. */
          background: rgba(244, 247, 250, .93); backdrop-filter: blur(6px); }
.subnav a { font-size: .86rem; font-weight: 600; color: var(--accent-dark); background: var(--soft);
            border-radius: 999px; padding: 5px 12px; text-decoration: none; }
.subnav a:hover { background: var(--accent); color: #fff; }
.card[id] { scroll-margin-top: 56px; }

/* Erklärung direkt am Spaltenkopf: eine Zeile darunter, nicht fett (R16). */
.th-note { display: block; font-weight: 400; font-size: .78rem; line-height: 1.25; margin-top: 2px;
           /* Die Spaltenköpfe stehen in Kapitälchen; ein ganzer Satz darin ist
              nicht lesbar. */
           text-transform: none; letter-spacing: 0; }
.info-box { background: var(--soft); border-radius: 12px; padding: 10px 14px; font-size: .9rem; }
.info-box summary { cursor: pointer; font-weight: 700; color: var(--accent-dark); }
.info-box ul { margin: 8px 0 4px; padding-left: 20px; }
.info-box li { margin: 3px 0; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.checkbox input { margin-top: 4px; transform: scale(1.15); accent-color: var(--accent); }
.checkbox.danger { background: var(--warning); border: 1px solid #fed7aa; border-radius: 12px; padding: 10px 14px; }
/* Bearbeiter-Kacheln zweispaltig — bei 6-8 Bearbeitern wird die Seite sonst
   unnoetig lang. align-items: start, damit unterschiedlich hohe Kacheln nicht
   auf die Hoehe der Nachbarin gestreckt werden. */
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.team-box { display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 0; background: var(--soft); }
.team-box legend { display: none; }
.team-head { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.team-head > div { flex: 1 1 240px; }
.button.ghost.danger { background: #fdeeee; color: #7f1d1d; }
/* Vor-Ort-Tage per Klick (R20). Der Kalender wird von team_calendar.js vor die
   Textliste gehängt und schreibt in dasselbe Feld; ohne Skript steht hier
   nichts und die Liste bleibt offen. Nur Mo-Fr, weil nur die verplant werden. */
.day-field { display: grid; gap: 8px; }
.label-row { display: flex; align-items: center; flex-wrap: wrap; }
.daycal { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.daycal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.daycal-title { font-weight: 700; font-size: .95rem; }
.daycal-nav {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  width: 28px; height: 28px; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--accent-dark);
}
.daycal-nav:hover { background: var(--soft); }
.daycal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 8px; }
.daycal-weekday { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 700; }
.daycal-day {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 6px 0; font: inherit; font-size: .85rem; cursor: pointer; color: var(--text);
}
.daycal-day:hover { border-color: var(--accent); }
.daycal-day.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
/* Tag mit eigenen Arbeitszeiten: ein Punkt genügt, die Zeiten stehen im Titel
   und in der Liste — ein Klick darf sie nicht unbemerkt löschen. */
.daycal-day.own { position: relative; }
.daycal-day.own::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: #fff;
}
.daycal-foot { margin: 8px 0 0; }
.daycal-tip { color: var(--muted); }
.day-list > summary { cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--accent-dark); }
.day-list > textarea { margin-top: 8px; }
.plan-preview {
  background: #0f2740; color: #dbeafe; border-radius: 14px; padding: 16px;
  overflow-x: auto; font-size: .85rem; line-height: 1.5; white-space: pre;
}
code { background: var(--soft); border-radius: 6px; padding: 1px 5px; font-size: .88em; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.status { padding: 4px 9px; border-radius: 999px; background: #eef2f2; font-weight: 700; }
.status.booked { background: #dcfce7; color: #166534; }
.status.cancelled { background: #fdeeee; color: #7f1d1d; }
/* Befund der Welle-2-Pruefung: nicht kaputt, aber zu knapp fuer eine Welle. */
.status.warn { background: var(--warning); color: #7c2d12; }
/* Slot-Nachsteuerung (/admin/slots) */
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form input[type="text"] { width: 62px; }
.day-group.closed { opacity: .82; }
.day-group .actions form { display: inline-block; }
/* Footer der Kundenseiten (Texte & Branding im Admin) */
.site-footer { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 18px 6px 8px; color: var(--muted); font-size: .88rem; }
.site-footer a { color: inherit; }
.slot-admin { display: grid; gap: 8px; }
.slot-row { display: grid; grid-template-columns: 1.5fr 1.2fr 1fr .4fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
/* flow-root: verhindert, dass Kind-Margins durch body durchkollabieren —
   sonst misst das Auto-Resize-Skript (body.scrollHeight) zu wenig und das
   iFrame schneidet unten ab. */
body.embedded { background: transparent; display: flow-root; }
body.embedded .page { width: 100%; padding: 0; }
body.embedded .card { box-shadow: none; border-radius: 16px; }

/* --- Feldansicht (Strang F) ------------------------------------------------
   Bedienung mit einer Hand, im Gehen, mit Handschuhen: Tap-Ziele >= 44 px,
   kein Statuswechsel ueber eine Zwischenseite, erledigte Stopps klappen weg. */
body.feld { background: #eef3f8; }
.feld-page { padding-top: 14px; }
.feld-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.feld-head h2 { margin: 2px 0 0; font-size: 1.15rem; }
.feld-progress { text-align: right; line-height: 1.1; }
.feld-progress strong { display: block; font-size: 2rem; color: var(--accent); }
.feld-progress span { font-size: .8rem; color: var(--muted); }
.feld-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 6px; }
.feld-switch { display: flex; gap: 6px; flex: 1 1 auto; }
.feld-switch select {
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 12px;
  font: inherit; background: #fff; min-height: 44px; max-width: 52%;
}
.feld-state { font-size: .85rem; color: var(--muted); margin: 4px 0 12px; }
.feld-state .warn { color: #92400e; font-weight: 700; }
.feld-undo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.feld-done { margin-top: 18px; }
.feld-done summary { cursor: pointer; font-weight: 700; color: var(--accent-dark); padding: 10px 0; }
.feld-foot { font-size: .82rem; margin-top: 26px; }

.stop-list { display: grid; gap: 12px; }
.stop {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 14px; box-shadow: 0 8px 20px rgba(0,48,90,.05);
}
.stop.is-done { opacity: .62; }
.stop.is-conflict { border-color: #f3c1c1; box-shadow: 0 0 0 2px #fdeeee; }
.stop.is-cancelled { border-style: dashed; }
.stop-head { display: flex; gap: 10px; align-items: flex-start; }
.stop-seq {
  flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--soft);
  color: var(--accent-dark); font-weight: 800; display: grid; place-items: center;
}
/* min-width: 0 und overflow-wrap: sonst setzt eine lange Strasse ohne
   Trennstelle die Mindestbreite der Karte und die Liste scrollt seitlich.
   Bei 390 px geprueft (Browser-Check 2026-08-15). */
.stop-what { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.stop-what strong { font-size: 1.05rem; }
.stop-when { text-align: right; flex: 0 0 auto; font-size: .95rem; }
.stop-when small { display: block; font-size: .72rem; white-space: nowrap; }
.stop-body { margin: 10px 0 0; display: grid; gap: 8px; }
.stop-links { display: flex; gap: 6px; flex-wrap: wrap; }
.stop-links .button { min-height: 44px; padding: 11px 14px; flex: 1 1 auto; }
.stop-note { margin: 0; background: var(--soft); border-radius: 12px; padding: 9px 12px; font-size: .93rem; }
.stop-foot { display: flex; gap: 10px; align-items: baseline; margin: 10px 0 0; flex-wrap: wrap; }
.stop-status { padding: 4px 10px; border-radius: 999px; background: #eef2f2; font-weight: 700; font-size: .85rem; }
.stop-status[data-status="erledigt"] { background: #dcfce7; color: #166534; }
.stop-status[data-status="unterwegs"] { background: #e0f2fe; color: #075985; }
.stop-status[data-status="nicht_angetroffen"] { background: var(--warning); color: #7c2d12; }
.stop-status[data-status="verweigert"],
.stop-status[data-status="zugang_fehlt"] { background: #fdeeee; color: #7f1d1d; }
.stop-status[data-status="verschoben"] { background: #ede9fe; color: #4c1d95; }
.stop-status[data-status="entfaellt"] { background: #e5e7eb; color: #374151; }
.stop-form { margin: 12px 0 0; }
.stop-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.stop-actions > .button { min-height: 48px; flex: 2 1 150px; }
.stop-more { flex: 1 1 130px; }
.stop-more summary {
  list-style: none; min-height: 48px; width: 100%;
  display: inline-flex; align-items: center; justify-content: center;
}
.stop-more summary::-webkit-details-marker { display: none; }
.stop-choices { display: grid; gap: 6px; margin-top: 8px; }
.stop-choices .button {
  justify-content: flex-start; text-align: left; min-height: 44px;
  flex-direction: column; align-items: flex-start; gap: 1px;
}
.stop-choices .button small { font-weight: 400; font-size: .78rem; }
.stop-undo { margin: 10px 0 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- Kommandostelle (Strang G) ------------------------------------------- */
body.zentrale { background: #f2f5f9; }
.zentrale-stand { font-size: .85rem; margin-left: auto; }
.zentrale-stand .warn { color: #92400e; font-weight: 700; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 14px; }
.unit { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: #fff; }
/* Die Ampel faerbt den Rahmen, nicht die Flaeche: die Zentrale liest die
   Kacheln den ganzen Tag, ein vollflaechig rotes Feld ermuedet und verdeckt
   die Schrift. */
.unit.ampel-knapp { border-color: #fdba74; box-shadow: inset 3px 0 0 #f59e0b; }
.unit.ampel-kritisch { border-color: #f3c1c1; box-shadow: inset 3px 0 0 #dc2626; }
.unit-head { display: flex; gap: 10px; align-items: flex-start; }
.unit-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; margin-top: 5px; }
.unit-what { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.unit-what strong { font-size: 1.05rem; }
.unit-verzug { text-align: right; flex: 0 0 auto; }
.unit-verzug small { display: block; font-size: .74rem; margin-top: 3px; }
.unit-bar { height: 8px; border-radius: 999px; background: #e6ecf3; margin: 12px 0 6px; overflow: hidden; }
.unit-bar span { display: block; height: 100%; border-radius: 999px; transition: width .4s ease; }
.unit-zahl { margin: 0; font-size: .9rem; color: var(--muted); }
.unit-zahl strong { color: var(--text); font-size: 1rem; }
.unit-meta { display: grid; grid-template-columns: 92px 1fr; gap: 4px 12px; margin: 12px 0; font-size: .9rem; }
.unit-meta dt { color: var(--muted); }
.unit-meta dd { margin: 0; overflow-wrap: anywhere; }
.unit .notice { margin: 10px 0; font-size: .88rem; }

/* Betriebsansicht, keine Landingpage: die Ueberschrift darf nicht die halbe
   Seite fuellen, die Kennzahlen darunter sind das Wichtige. */
body.zentrale h1 { font-size: 1.5rem; margin: 4px 0 8px; }
/* Kartenrahmen mit Kachelhintergrund (R27). `position: relative` + `overflow:
   hidden`, weil die Randkacheln bewusst über den Ausschnitt hinausragen; das
   Seitenverhältnis kommt aus dem Layout (inline style), damit Kachelpunkte und
   SVG-Punkte dieselbe Skalierung erfahren. */
/* Kein `max-height`: der Rahmen hält sein Seitenverhältnis (inline aus dem
   Layout), und eine Höhenbegrenzung würde genau das brechen — dann liegen
   Kacheln und Punkte auseinander. Begrenzt wird stattdessen die Breite. */
.map-frame { position: relative; overflow: hidden; border: 1px solid var(--line);
             border-radius: 14px; background: #f5f7fa; margin-top: 12px;
             max-width: 1100px; }
.map-tiles { position: absolute; inset: 0; }
.map-tiles img { position: absolute; display: block; max-width: none; }
/* Kacheln und SVG teilen die Fläche: das SVG skaliert mit dem Rahmen, die
   Kacheln sitzen in Bildpunkten — deshalb wird der Rahmen selbst skaliert
   (aspect-ratio) statt der Inhalt. */
.map-frame .tagkarte { position: relative; z-index: 1; max-height: none; height: 100%; }
.map-switch { display: flex; gap: 4px; background: var(--soft); border-radius: 999px; padding: 3px; }
.map-switch a { padding: 5px 12px; border-radius: 999px; text-decoration: none;
                font-weight: 700; font-size: .82rem; color: var(--accent-dark); }
.map-switch a.active { background: var(--accent); color: #fff; }
.map-credit { font-size: .78rem; margin: 8px 0 0; }
/* max-height statt height:auto: die Karte hat das Seitenverhaeltnis der
   Begehungsgebiete, und zwei weit auseinanderliegende Gebiete machten sie
   sonst hoeher als der Bildschirm. preserveAspectRatio des SVG passt den
   Inhalt selbst ein. */
.tagkarte { display: block; width: 100%; height: auto; max-height: 60vh; }
.mapdot { stroke-width: 2; fill: #94a3b8; }
/* R26: abgeschlossen = gefüllt, offen = Ring. Der Unterschied liegt im Strich,
   nicht in der Füllung — die trägt weiter den Zustand (`st-*` unten). Der weiße
   Saum am gefüllten Punkt hält ihn auf Satellitenbildern lesbar; `paint-order`
   legt den Strich hinter die Füllung, sonst frisst er den Kern.
   Der Ring behält den Strich in der Einheitenfarbe (Attribut am `circle`). */
.mapdot.is-filled { stroke: #ffffff; stroke-width: 2; paint-order: stroke; }
.mapdot.is-ring { stroke-width: 3.5; }
/* Punktfarben = Stopp-Zustaende. Dieselben Toene wie die Statuspillen im Feld,
   damit Zentrale und Bearbeiter dasselbe Rot meinen. */
.mapdot.st-open { fill: #ffffff; }
.mapdot.st-enroute { fill: #38bdf8; }
.mapdot.st-done { fill: #22c55e; }
.mapdot.st-miss { fill: #f59e0b; }
.mapdot.st-refused, .mapdot.st-blocked { fill: #dc2626; }
.mapdot.st-moved { fill: #8b5cf6; }
.mapdot.st-dropped { fill: #9ca3af; }
.mapdot.st-cancelled { fill: #e5e7eb; stroke-dasharray: 3 2; }
.map-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 12px; font-size: .85rem; }
.legend-item { display: inline-flex; gap: 6px; align-items: center; }
.legend-sep { flex: 1 1 100%; height: 0; }
.mapkey { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #94a3b8; display: inline-block; }
.mapkey.st-open { background: #fff; }
.mapkey.st-enroute { background: #38bdf8; }
.mapkey.st-done { background: #22c55e; }
.mapkey.st-miss { background: #f59e0b; }
.mapkey.st-refused, .mapkey.st-blocked { background: #dc2626; }
.mapkey.st-moved { background: #8b5cf6; }
.mapkey.st-dropped { background: #9ca3af; }
.mapkey.st-cancelled { background: #e5e7eb; }
.treffer .meta { margin: 12px 0; }
.treffer .small { font-size: .84rem; }
/* Notfallkontakt unter der Bestätigung: kleiner Nachsatz, kein Aufruf. */
.notfall { font-size: .9rem; margin-top: 18px; }
/* Umplanen (Betriebsfall 3): Zeilen, die nach dem Verzug aus ihrem zugesagten
   Zeitfenster fallen. Getoente Zeile statt Symbol, weil die Liste in
   Fahrtreihenfolge steht und die betroffenen Stopps deshalb einen
   zusammenhaengenden Block am Ende bilden — den sieht man als Flaeche. */
tr.row-warn td { background: #fef6e7; }
.form-actions { margin-top: 14px; }
.form-actions .small { font-size: .86rem; }

@media (max-width: 760px) {
  .page { width: min(100% - 20px, 1120px); padding-top: 16px; }
  .topbar { align-items: flex-start; gap: 10px; flex-direction: column; }
  .grid.two, .grid.three, .fields, .team-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; }
  .slot-row { grid-template-columns: 1fr; gap: 3px; }
  .card, .metric, .hero { border-radius: 18px; padding: 18px; }
  /* (i)-Kasten auf schmalen Screens (R21). Am Symbol ausgerichtet laeuft er
     hier zwangslaeufig aus dem Bild: er ist bis 340 px breit, das Symbol steht
     am Ende einer Beschriftung, und links wie rechts davon ist kein Platz mehr.
     Deshalb `position: static` am `.info` — dann ist das Formular der
     Bezugsrahmen und der Kasten spannt ueber dessen ganze Breite. `top: auto`
     laesst ihn an seiner Flussposition stehen, also unter der Beschriftung, zu
     der er gehoert. */
  .settings-form { position: relative; }
  .info { position: static; }
  .info-body, .info.left .info-body {
    top: auto; left: 0; right: 0; width: auto; max-width: none;
  }
  /* Kalender wird auf schmalen Screens zur Tages-Agenda: leere Tage raus,
     Tage untereinander, Zeitfenster nebeneinander. */
  .cal-week { grid-template-columns: 1fr; }
  .cal-day { display: flex; align-items: center; gap: 10px; min-height: 0; }
  .cal-day.empty { display: none; }
  .cal-date { margin: 0; flex: 0 0 72px; }
  .cal-slot { margin-top: 0; flex: 1; }
  /* Feldansicht auf dem Handy: nichts darf seitlich hinauslaufen, sonst
     scrollt die Liste beim Tippen im Gehen zur Seite weg. */
  .feld-page { width: min(100% - 16px, 760px); }
  .stop { padding: 12px; border-radius: 16px; }
  .stop-when { font-size: .88rem; }
  .feld-switch select { max-width: none; flex: 1 1 40%; min-width: 0; }
  .feld-logout { width: 100%; }
  .feld-logout .button { width: 100%; }
  /* Zentrale auf einem Tablet quer oder einem Handy: Kacheln untereinander,
     Beschriftung der Kennzahlen ueber den Wert statt daneben. */
  .unit-grid { grid-template-columns: 1fr; }
  .unit-meta { grid-template-columns: 1fr; gap: 2px; }
  .unit-meta dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
  .unit-meta dd { margin-bottom: 6px; }
  .zentrale-stand { margin-left: 0; }
}
