/* ============================================================================
   Signage-Plattform — Designsystem (konsolidiert, September 2026)

   EIN Regelwerk statt vieler nachträglich angehängter Schichten. Jede Klasse
   ist genau einmal definiert; frühere Anhänge, die Basisregeln umkehrten, sind
   in die Basisregeln eingearbeitet.

   Maße (systemweit)
   - Eingabefelder / Selects        42 px  (--feld-hoehe)
   - Knöpfe                         42 px  (--knopf-hoehe = Feldhöhe; in Listenzeilen .knopf-klein 32 px), .aktion-icon 36 px
   - Beschriftung → Feld             8 px
   - zwischen Formularelementen     16 px
   - Karten: Innenabstand 24 px, Abstand zwischen Karten 24 px (Raster 16–24 px)
   - Fieldset: eigener Block, 16 px Abstand nach oben, Titel innen

   Reihenfolge
   1 Schriften & Tokens   2 Reset & Typografie   3 Layout (App, Seitenleiste, Topbar, Inhalt)
   4 Komponenten (Knöpfe, Felder, Formulare, Fieldsets, Karten, Listen, Tabellen, Abzeichen,
     Chips, Aufklapper, Meldungen)   5 Dashboard & Diagramme   6 Modulspezifisch
   (Signage, Gestalter, Dienstplan, Tickets, Immobilien, Dienstleister, Lager, Hilfe-Panel,
   Login, Pakete)   7 Responsiv   8 Nachträge (Stand September 2026)

   Regeln fürs Ergänzen
   - Eine Klasse gehört an GENAU EINE Stelle. Wer ein Maß ändern will, ändert die vorhandene
     Regel — niemals eine zweite Definition ans Dateiende hängen. Das war die Ursache für
     „Text klebt am Rand“ und ungleiche Knopfhöhen (bis zu sechs Definitionen je Klasse).
   - Maße kommen aus Tokens (--feld-hoehe, --knopf-hoehe, --knopf-klein-hoehe, --icon-knopf-hoehe,
     --karte-innen, --formular-abstand, --beschriftung-abstand, --abschluss-abstand), nie als Zahl.
   - Mobile Abweichungen einer Komponente stehen HINTER ihrer Grundregel, sonst gewinnt bei
     gleicher Spezifität die spätere Grundregel und die Mobilregel bleibt wirkungslos.
   - Nach jeder Änderung alle vier Messläufe (siehe docs/ui-richtlinien.md), alle auf 0.

   Grundsätze
   - Kanonische Feld-/Aufklapper-Regeln haben Spezifität 0 (:where), damit Komponenten sie
     ohne !important überschreiben.
   - !important nur, wo es nicht anders geht: [hidden] { display: none } (das Attribut muss jede
     Display-Regel schlagen) und .dia-stab-leer (Balkendiagramm, Höhe per Inline-Style gesetzt).
   - Farb-Tokens (--signal, --primaer, --fokus-ring, --flaeche-aktiv) werden von
     kern/layout.php (plattform_farbe_style) per Inline-Style überschrieben.
   ========================================================================== */

/* ===== 1 Schriften ======================================================= */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 500; font-display: swap; src: url('fonts/jetbrains-500.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 600; font-display: swap; src: url('fonts/jetbrains-600.woff2') format('woff2'); }
/* Slide-Schriften des Gestalters (GESTALTUNG_SCHRIFTEN) */
@font-face { font-family: 'Instrument Sans'; font-weight: 400; font-display: swap; src: url('fonts/instrument-400.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 600; font-display: swap; src: url('fonts/instrument-600.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-weight: 700; font-display: swap; src: url('fonts/instrument-700.woff2') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-weight: 600; font-display: swap; src: url('fonts/hanken-600.woff2') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-weight: 700; font-display: swap; src: url('fonts/hanken-700.woff2') format('woff2'); }
@font-face { font-family: 'Playfair Display'; font-weight: 700; font-display: swap; src: url('fonts/playfair-700.woff2') format('woff2'); }

/* ===== 1 Tokens ========================================================== */
:root {
  /* Flächen */
  --hintergrund: #fafafa;
  --flaeche: #ffffff;
  --flaeche-leiste: #ffffff;
  --flaeche-aktiv: #eff6ff;
  --flaeche-still: #f3f4f6;
  --container: #f9fafb;
  /* Linien */
  --rand: #e5e7eb;
  --rand-weich: #f3f4f6;
  --rand-stark: #d1d5db;
  /* Text */
  --text: #111827;
  --text-2: #374151;
  --text-schwach: #6b7280;
  --text-still: #9ca3af;
  /* Signale (werden per Plattform-Farbe überschrieben) */
  --signal: #2563eb;
  --signal-flaeche: #eff6ff;
  --signal-rand: #bfdbfe;
  --akzent: #2563eb;
  --akzent-flaeche: #eff6ff;
  --primaer: #2563eb;
  --primaer-dunkel: #1d4ed8;
  --primaer-hell: var(--primaer-dunkel); /* Altname (Hover) */
  --fokus: var(--primaer);
  --fokus-ring: rgba(37, 99, 235, .15);
  --gefahr: #ef4444;
  --gruen: #10b981;
  --gelb: #f59e0b;
  --info: #3b82f6;
  /* Typografie */
  --schrift: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --schrift-titel: var(--schrift);
  --schrift-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Form */
  --radius: 8px;
  --radius-karte: 12px;
  --schatten: 0 1px 3px rgba(0, 0, 0, .05);
  /* Maße */
  --feld-hoehe: 42px;
  --knopf-hoehe: 42px;
  --knopf-klein-hoehe: 32px;
  --icon-knopf-hoehe: 36px;
  --karte-innen: 24px;
  --karte-abstand: 24px;
  --formular-abstand: 16px;
  --beschriftung-abstand: 8px;
  --abschluss-abstand: 20px; /* bewusst größerer Abstand vor einer abschließenden Knopfzeile */
  --inhalt-innen: 24px;
  --leiste-breite: 256px;
  --leiste-schmal: 64px;
}

/* ===== 2 Reset & Typografie ============================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--schrift); font-size: 15px; line-height: 1.5; background: var(--hintergrund); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--text); text-decoration: none; font-weight: 600; }
a:hover { color: var(--signal); }
h1 { font-family: var(--schrift-titel); font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
h2 { font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--text); }
h3 { font-size: 15px; font-weight: 600; line-height: 1.3; }
h2[id] { scroll-margin-top: 80px; }
p { margin: 0; }
button { font-family: inherit; }
img, svg { max-width: 100%; }
code, .mono { font-family: var(--schrift-mono); font-size: .95em; }
code { background: var(--flaeche-still); border: 1px solid var(--rand); border-radius: 6px; padding: 2px 7px; }
.klein { color: var(--text-schwach); font-size: 13px; line-height: 1.55; }
.untertitel { color: var(--text-2); font-size: 14px; margin: 0 0 16px; }
.text-rot { color: #dc2626; }
.text-gruen { color: #15803d; }
/* Inline-Icons in Textzusammenhängen nie größer als der Text */
.klein svg, .liste-zeile svg, .liste-titel svg, summary svg, td svg, th svg, p svg, label svg,
.einstellung-aktion svg, .aufklapp-pfeil svg, .dl-kontakt svg { width: 15px; height: 15px; vertical-align: -3px; stroke: currentColor; flex-shrink: 0; }

/* ===== 3 Layout: App-Gerüst ============================================= */
.app { display: flex; min-height: 100vh; }
.hauptbereich { flex: 1; min-width: 0; }

/* --- Seitenleiste: hell, 256 px, einklappbar (body.leiste-schmal) --- */
.seitenleiste { width: var(--leiste-breite); flex-shrink: 0; background: var(--flaeche-leiste); border-right: 1px solid var(--rand);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; transition: width .15s; }
.marke { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px 20px 16px; border-bottom: 1px solid var(--rand);
  color: var(--text); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.marke:hover { color: var(--text); }
.marke-badge { width: 28px; height: 28px; border-radius: var(--radius); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--primaer); color: #fff; font-size: 13px; font-weight: 700; }
.marke .marke-badge { width: 40px; height: 40px; border-radius: 12px; font-size: 18px; font-weight: 800; box-shadow: 0 6px 16px rgba(37, 99, 235, .25); }
.marke-logo { max-height: 48px; max-width: 200px; object-fit: contain; }
.marke-text { display: flex; flex-direction: column; gap: 2px; }
.marke-text b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; color: var(--text); }
.marke-text small { font-size: 12px; color: var(--text-schwach); font-weight: 500; }
.bereich-hinweis { margin: 14px 16px 0; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--signal); }

.seiten-nav { padding: 12px 8px; display: flex; flex-direction: column; gap: 1px; flex: 1; overflow-y: auto; }
.nav-gruppe { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-still); padding: 14px 8px 8px; }
.seiten-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-weight: 400; font-size: 14px; }
/* Unterpunkte (z. B. Bereiche einer Einstellungsseite): zweite Ebene — deutlich eingerückt,
   etwas kleiner, mit kleinem Icon. Der gerade offene Bereich wird per Skript markiert. */
.seiten-nav a.nav-sub, .seiten-nav details.nav-klapp > a.nav-sub { padding-left: 38px; font-size: 13px; color: var(--text-schwach); }
.seiten-nav a.nav-sub svg { width: 14px; height: 14px; }
.seiten-nav a.nav-sub.aktiv { color: var(--signal); }
body.leiste-schmal .seiten-nav a.nav-sub { display: none; }
.seiten-nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
.seiten-nav a:hover { background: var(--flaeche-still); color: var(--text); }
.seiten-nav a.aktiv { background: var(--flaeche-aktiv); color: var(--signal); font-weight: 600; }
.seiten-nav a.aktiv svg { opacity: 1; color: var(--signal); }
.nav-neu { margin-left: auto; font-size: 11px; font-weight: 700; color: #fff; background: #dc2626; border-radius: 999px; padding: 2px 8px; white-space: nowrap; line-height: 1.4; }
/* Abzeichen „neu seit dem letzten Besuch“ (Grundsatz 6): kein Auftrag — neutral blau statt rot. Immer zusammen mit .nav-neu
   setzen: class="nav-neu nav-neu-info" — Lage, Größe und Ausblenden in der schmalen Leiste kommen von .nav-neu. Rot (.nav-neu
   allein) bleibt nur, was zu erledigen ist: fällig, überfällig, offene Fragen an mich, ungelesene Antworten.
   Farbe aus der Kontrastfarbe (--signal), damit sie mit der Betreiber-Einstellung mitgeht; auch auf dem aktiven Eintrag lesbar. */
.nav-neu-info { color: color-mix(in srgb, var(--signal) 75%, #000); background: color-mix(in srgb, var(--signal) 15%, #fff); font-weight: 600; }
.seiten-nav details.nav-klapp > summary .nav-neu { margin-left: auto; }
.nav-zahl { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--text-schwach); background: var(--flaeche-still); border-radius: 999px; padding: 1px 8px; }
.seiten-nav a.aktiv .nav-zahl { background: #dbeafe; color: var(--signal); }
/* Aufklappbare Modul-Gruppen: keine Box, drehender Pfeil; nur das aktive Modul ist offen und farbig */
.seiten-nav details.nav-klapp { border: 0; border-radius: 10px; background: none; margin: 6px 0 0; }
/* Modul-Überschriften sind echte Navigationszeilen: gleiche Schriftgröße wie die Einträge, halbfett, keine Kapitälchen */
.seiten-nav details.nav-klapp > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; border: 0; border-radius: 8px; background: none; padding: 9px 12px 9px 10px;
  font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-2); line-height: 1.3; }
.seiten-nav details.nav-klapp > summary::-webkit-details-marker { display: none; }
.seiten-nav details.nav-klapp > summary::before { content: ''; width: 10px; height: 10px; flex-shrink: 0; transition: transform .15s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; }
.seiten-nav details.nav-klapp[open] > summary::before { transform: rotate(90deg); }
.seiten-nav details.nav-klapp > summary:hover { color: var(--text); background: var(--flaeche-still); }
.seiten-nav details.nav-klapp:not([open]) > summary { color: var(--text-schwach); }
.seiten-nav details.nav-klapp > a { margin: 0; padding: 8px 12px 8px 20px; font-size: 14px; }
.seiten-nav details.nav-klapp-aktiv > summary { color: var(--signal); font-weight: 600; }
/* Modul mit nur einem Eintrag (Dienstleister, Verträge …) als direkter Link — sieht aus wie eine zugeklappte Modul-Überschrift:
   gleiche Schrift und Farbe, Text auf derselben Linie (Platzhalter statt Pfeil, weil nichts aufklappt), kein Symbol.
   In der schmalen Leiste (nur Symbole) zeigt er sein Symbol wie jeder andere Eintrag (Regeln dort). */
.seiten-nav a.nav-modul-link { margin-top: 6px; gap: 8px; padding: 9px 12px 9px 10px; font-weight: 600; color: var(--text-schwach); line-height: 1.3; }
.seiten-nav a.nav-modul-link::before { content: ''; width: 10px; height: 10px; flex-shrink: 0; }
.seiten-nav a.nav-modul-link svg { display: none; }
.seiten-nav a.nav-modul-link:hover { color: var(--text); }
.seiten-nav a.nav-modul-link.aktiv { background: none; color: var(--signal); }
body.leiste-schmal .seiten-nav a.nav-modul-link { margin-top: 0; }
body.leiste-schmal .seiten-nav a.nav-modul-link::before { display: none; }
body.leiste-schmal .seiten-nav a.nav-modul-link svg { display: revert; }

.seitenleiste-fuss { border-top: 1px solid var(--rand); padding: 12px; }
.support-knopf { display: flex; align-items: center; gap: 9px; background: transparent; color: var(--text-2); border: 1px solid var(--rand-stark);
  border-radius: var(--radius); padding: 8px 10px; font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.support-knopf:hover { background: var(--flaeche-still); color: var(--text); }
.support-knopf svg { width: 16px; height: 16px; }
.fuss-link { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: var(--radius); color: var(--text-2); font-weight: 400; font-size: 14px; }
.fuss-link svg { width: 16px; height: 16px; opacity: .7; }
.fuss-link:hover, .fuss-link.aktiv { background: var(--flaeche-still); color: var(--text); }
.leiste-knopf { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; margin-top: 6px; border: 0; border-radius: var(--radius); background: none;
  color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.leiste-knopf:hover { background: var(--flaeche-still); color: var(--text); }
.leiste-knopf svg { width: 16px; height: 16px; opacity: .7; transition: transform .15s; }
.benutzer-chip { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--rand); }
.benutzer-chip .avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; background: var(--signal); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.benutzer-chip .name { font-weight: 600; font-size: 13px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.benutzer-chip .klein { font-size: 12px; }
/* Eingeklappte Leiste: nur Symbole, Titel als Hinweis (title) */
body.leiste-schmal .seitenleiste { width: var(--leiste-schmal); }
body.leiste-schmal .marke { align-items: center; padding: 16px 0; }
body.leiste-schmal .marke-text, body.leiste-schmal .marke-logo, body.leiste-schmal .seiten-nav a span, body.leiste-schmal .fuss-link span, body.leiste-schmal .support-knopf span,
body.leiste-schmal .nav-gruppe, body.leiste-schmal .nav-zahl, body.leiste-schmal .nav-neu, body.leiste-schmal .benutzer-chip > div, body.leiste-schmal .leiste-knopf span { display: none; }
body.leiste-schmal .marke .marke-badge { display: inline-flex; width: 34px; height: 34px; font-size: 15px; }
body.leiste-schmal .seiten-nav details.nav-klapp { display: contents; }
/* Modul-Titel (summary): ohne ihn ließe sich eine zugeklappte Gruppe nicht öffnen. Wo der Browser ::details-content kennt, stehen
   die Symbole aller Gruppen immer da und der Titel entfällt (wie bei 861–1100 px). Ältere Browser (Safari vor 18.4, Firefox vor 143)
   behalten den Titel als kleine, umbrechende Beschriftung zum Aufklappen — das Ausblenden steht deshalb nur in @supports.
   Nur ab 861 px: darunter ist die Leiste eine Schublade mit Titeln. */
@media (min-width: 861px) {
  body.leiste-schmal .seiten-nav details.nav-klapp > summary { justify-content: center; gap: 0; padding: 6px 2px; font-size: 10px; line-height: 1.2; text-align: center; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
  body.leiste-schmal .seiten-nav details.nav-klapp > summary::before { display: none; }
  @supports selector(::details-content) {
    body.leiste-schmal .seiten-nav details.nav-klapp > summary { display: none; }
    body.leiste-schmal .seiten-nav details.nav-klapp::details-content { content-visibility: visible; display: contents; }
  }
}
body.leiste-schmal .seiten-nav a, body.leiste-schmal .fuss-link, body.leiste-schmal .support-knopf, body.leiste-schmal .benutzer-chip, body.leiste-schmal .leiste-knopf { justify-content: center; padding-left: 0; padding-right: 0; }
body.leiste-schmal .leiste-knopf svg { transform: rotate(180deg); }
/* Name der Symbole: kern/layout.php setzt in der schmalen Leiste (eingeklappt oder 861–1100 px) title aus data-titel — Hinweis beim
   Darüberfahren und Name für Vorleser. Ein CSS-Hinweis per ::after ging nicht: .seiten-nav scrollt (overflow-y: auto) und schnitt ihn ab. */

/* --- Topbar: 56 px, Pfad links, Suche + Hilfe + Avatar rechts --- */
.topbar { display: flex; align-items: center; gap: 16px; height: 56px; padding: 0 var(--inhalt-innen); background: #fff; border-bottom: 1px solid var(--rand); position: sticky; top: 0; z-index: 20; }
.topbar-pfad { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-schwach); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-suche { position: relative; margin-left: auto; }
.topbar-suche svg { display: none; }
.topbar-suche input { height: 36px; width: 220px; margin: 0; padding: 0 12px; border-radius: var(--radius); background: var(--container); border: 1px solid var(--rand-stark); font-size: 13.5px; }
.topbar-rechts { display: flex; align-items: center; gap: 8px; }
/* Paket Z3: ohne Suchfeld (Dienstleister) rückt Hilfe/Avatar trotzdem nach rechts — sonst schiebt .topbar-suche sie dorthin */
.topbar-pfad + .topbar-rechts { margin-left: auto; }
.topbar-icon { width: 32px; height: 32px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--text-2); border: 1px solid var(--rand-stark); background: #fff; }
.topbar-icon:hover { background: var(--flaeche-still); color: var(--text); }
.topbar-icon svg { width: 16px; height: 16px; }
.topbar-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--signal); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.hilfe-knopf { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px solid var(--rand); border-radius: 999px; background: #fff; color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.hilfe-knopf svg { width: 16px; height: 16px; stroke: var(--signal); }
.hilfe-knopf:hover, .hilfe-knopf[aria-expanded="true"] { background: var(--flaeche-aktiv); border-color: var(--signal); color: var(--signal); }

/* --- Inhalt: volle Breite, Seitenkopf randlos über die ganze Breite --- */
.inhalt { max-width: none; margin: 0; padding: var(--inhalt-innen) var(--inhalt-innen) 48px; }
.seiten-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: calc(-1 * var(--inhalt-innen)) calc(-1 * var(--inhalt-innen)) var(--inhalt-innen); padding: 20px var(--inhalt-innen) 16px; background: #fff; border-bottom: 1px solid var(--rand); }
.seiten-kopf > div:first-child { flex: 1 1 360px; min-width: 0; }
.seiten-kopf h1 { margin-bottom: 3px; }
.seiten-kopf .untertitel { margin: 0; }
.seiten-kopf-aktionen { flex-shrink: 0; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
/* Aktionen, die nur zu einem Bereichs-Reiter gehören: bereichs_reiter() blendet sie passend ein */
.seiten-kopf-aktionen [data-bereich-aktion] { display: inline-flex; gap: 10px; align-items: center; }
.seiten-kopf-aktionen [data-bereich-aktion][hidden] { display: none; }
.zurueck { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 6px; color: var(--text-2); font-size: 13px; font-weight: 400; }
.zurueck svg { width: 14px; height: 14px; }
.zurueck:hover { color: var(--signal); }
/* Mandanten-Ansicht (Impersonation) */
.impersonation-balken { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; background: var(--text); color: #fff; padding: 8px 16px;
  font-size: 13px; font-weight: 500; position: sticky; top: 0; z-index: 30; }
.impersonation-balken .knopf { background: #fff; color: var(--text); border-color: #fff; box-shadow: none; }
/* Zwei Spalten: Hauptinhalt + schmale Seitenspalte */
.spalten { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: var(--karte-abstand); align-items: start; }
.spalten > .karte, .spalte-seite { min-width: 0; }
.spalten-ticket { grid-template-columns: minmax(0, 1fr) 360px; }
/* Linke Ticket-Spalte (ein schlichtes div): darf schmaler werden als ihr breitestes Auswahlfeld — am Handy (1fr) schob sonst
   eine lange Option („nur Testsanitär Testsanitär — Dienstleister“) die ganze Seite auf ~460 px */
.spalten-ticket > div { min-width: 0; }

/* ===== 4 Komponenten: Knöpfe ============================================ */
/* EIN Maß: 40 px. Varianten unterscheiden sich nur farblich. .knopf-klein 32 px, .aktion-icon 36 px. */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--knopf-hoehe); padding: 0 18px; margin: 0;
  border: 1px solid var(--primaer); border-radius: var(--radius); background: var(--primaer); color: #fff;
  font-family: var(--schrift); font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .18); transition: background .15s, border-color .15s; }
.knopf:hover { background: var(--primaer-dunkel); border-color: var(--primaer-dunkel); color: #fff; }
.knopf:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.knopf:disabled { opacity: .55; cursor: not-allowed; }
.knopf svg, .knopf-neu svg { width: 16px; height: 16px; stroke: currentColor; flex-shrink: 0; }
.knopf-neutral { background: #fff; color: var(--text-2); border-color: var(--rand-stark); font-weight: 500; box-shadow: none; }
.knopf-neutral:hover { background: var(--flaeche-still); border-color: var(--rand-stark); color: var(--text); }
.knopf-gefahr { background: #fff; color: var(--gefahr); border-color: #fecaca; font-weight: 500; box-shadow: none; }
.knopf-gefahr:hover { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }
.knopf-klein { height: var(--knopf-klein-hoehe); padding: 0 12px; font-size: 13px; gap: 6px; box-shadow: none; }
.knopf-klein svg { width: 14px; height: 14px; }
/* Symbol-Knöpfe am Zeilenende */
.aktion-icon { width: var(--icon-knopf-hoehe); height: var(--icon-knopf-hoehe); border-radius: 9px; border: 1px solid var(--rand); background: #fff; color: var(--text-schwach);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; margin: 0; flex-shrink: 0; transition: background .12s, color .12s, border-color .12s; }
.aktion-icon svg { width: 17px; height: 17px; }
.aktion-icon:hover { background: var(--flaeche-aktiv); color: var(--signal); border-color: var(--signal); }
.aktion-icon.gefahr:hover { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }
/* Segmentierte Auswahl (Ausrichtung, Format) */
.segment { display: inline-flex; border-radius: var(--radius); overflow: hidden; }
.segment > * { height: 36px; padding: 0 12px; display: inline-flex; align-items: center; border: 1px solid var(--rand-stark); border-left: 0; background: #fff; color: var(--text-2);
  font: 600 13px var(--schrift); cursor: pointer; }
.segment > *:first-child { border-left: 1px solid var(--rand-stark); border-radius: var(--radius) 0 0 var(--radius); }
.segment > *:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.segment > .aktiv { background: var(--signal); border-color: var(--signal); color: #fff; }
/* Ansichts-Umschalter (ansicht_umschalter(), kern/layout.php; ui-richtlinien Abschnitt 2): dieselbe Sache anders dargestellt —
   Tag · Woche · Monat · Jahr. Links in Knopfhöhe (auf einer Linie mit ‹ › Heute im Kartenkopf), aktive Ansicht gefüllt. */
.segment.ansicht-umschalter > a { height: var(--knopf-hoehe); padding: 0 16px; font-size: 14px; text-decoration: none; justify-content: center; }
.segment.ansicht-umschalter > a:not(.aktiv):hover { background: var(--flaeche-aktiv); color: var(--signal); }
@media (max-width: 767px) {
  /* Handy: über die volle Breite, gleich breite Teile (Tippziel 42 px hoch) — nie seitlich wischen */
  .segment.ansicht-umschalter { display: flex; width: 100%; }
  .segment.ansicht-umschalter > a { flex: 1 1 0; min-width: 0; padding: 0 4px; }
}

/* ===== 4 Komponenten: Felder ============================================ */
label { display: block; font-weight: 600; font-size: 13px; color: var(--text-2); line-height: 1.4; }
label > input, label > select, label > textarea, label > .dp-farben { margin-top: var(--beschriftung-abstand); font-weight: 400; }
label > input, label > select, label > textarea { display: block; width: 100%; }
/* Pflichtfeld-Stern rechts oben in der Beschriftung */
label:has(> [required]) { position: relative; }
label:has(> [required])::before { content: '*'; position: absolute; right: 0; top: 0; color: var(--gefahr); font-weight: 700; font-size: 14px; line-height: 1.3; }
/* Optionsfelder (Ja/Nein, Auswahl als Punkte): Pflicht ist die Gruppe — der Stern steht als Text an ihrer legend
   (kern/felder.php felder_html), nicht noch einmal neben jeder Option */
label.kontrollkaestchen:has(> [type=radio][required])::before { content: none; }
/* Feldhilfe: eigene Zeile zwischen Beschriftung und Feld */
.feld-hilfe { display: block; font-weight: 400; font-size: 12px; color: var(--text-schwach); line-height: 1.4; margin: 2px 0 0; }
/* EIN Feldstil für alle Eingabetypen — Spezifität 0 (:where), damit Komponenten ohne !important gewinnen */
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=hidden]):not([type=submit]):not([type=button]):not([type=color]), select, textarea) {
  height: var(--feld-hoehe); padding: 0 12px; font-family: var(--schrift); font-size: 15px; line-height: 1.2; color: var(--text); background: #fff;
  border: 1px solid var(--rand-stark); border-radius: var(--radius); -webkit-appearance: none; appearance: none; box-shadow: none; min-width: 0; }
:where(textarea) { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.45; resize: vertical; width: 100%; max-width: none; }
:where(select) { padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; }
:where(select[multiple], select[size]) { height: auto; min-height: var(--feld-hoehe); padding: 6px 12px; background-image: none; }
:where(input[type=time], input[type=date], input[type=datetime-local], input[type=number]) { font-variant-numeric: tabular-nums; }
:where(input[type=file]) { display: block; width: 100%; min-height: var(--feld-hoehe); padding: 9px 11px; font-family: var(--schrift); font-size: 14px; color: var(--text); background: #fff;
  border: 1px solid var(--rand-stark); border-radius: var(--radius); }
:where(input[type=color]) { height: var(--feld-hoehe); width: 60px; padding: 4px; background: #fff; border: 1px solid var(--rand-stark); border-radius: var(--radius); cursor: pointer; }
input[type=color].farbfeld { width: 56px; height: var(--knopf-hoehe); padding: 4px; border: 1px solid var(--rand); border-radius: var(--radius); background: #fff; cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--text-still); }
:where(input, select, textarea):focus { outline: none; border-color: var(--fokus); box-shadow: 0 0 0 3px var(--fokus-ring); }
:where(input, select, textarea):disabled { background: var(--container); color: var(--text-2); cursor: not-allowed; }
/* Schreibgeschützt (readonly, z. B. eine Website-Anfrage im CRM): sieht aus wie gesperrt, nicht wie ein Eingabefeld — und trägt
   keinen Pflicht-Stern (was man nicht ändern kann, muss man nicht ausfüllen) */
:where(input[readonly], textarea[readonly]) { background: var(--container); color: var(--text-schwach); cursor: default; }
label:has(> :is(input, textarea)[readonly][required])::before, label:has(> :is(input, select, textarea)[required]:disabled)::before { content: none; }
/* Feldbreiten: wirken nur als Breite, nie als Höhe (in Spalten-Flex würde flex-basis zur Höhe) */
.feld-kurz { width: 130px; max-width: 100%; flex: 0 1 130px; }
.feld-mittel { width: 260px; max-width: 100%; flex: 0 1 260px; }
.feld-breit { flex: 1 1 320px; min-width: 240px; }
label > .feld-kurz, label > .feld-mittel { flex: none; width: 100%; height: var(--feld-hoehe); }
/* Datums-/Zeitfelder: Text vertikal mittig (Safari setzt ihn sonst nach oben) */
input[type=date], input[type=time], input[type=datetime-local], input[type=month] { display: inline-flex; align-items: center; -webkit-appearance: none; appearance: none; line-height: normal; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value, input[type=datetime-local]::-webkit-date-and-time-value { text-align: left; min-height: 1.3em; line-height: 1.3; }
input::-webkit-datetime-edit { padding: 0; line-height: normal; }
label > .feld-kurz { max-width: 130px; }
label > .feld-mittel { max-width: 260px; }
/* Kontrollkästchen & Schalter */
.kontrollkaestchen { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; line-height: 1.4; color: var(--text); min-height: 22px; }
.kontrollkaestchen > input[type=checkbox], .kontrollkaestchen > input[type=radio] { margin: 0; flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--signal); }
.kontrollkaestchen + .kontrollkaestchen { margin-top: 8px; }
.kontrollkaestchen.recht-zeile, .recht-zeile { align-items: flex-start; }
.recht-zeile > input[type=checkbox] { margin-top: 2px; }
.recht-zeile > span { display: flex; flex-direction: column; gap: 2px; }
.recht-zeile small { font-weight: 400; font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
input[type=checkbox].schalter { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; border-radius: 999px; background: var(--rand-stark); position: relative; cursor: pointer;
  border: 0; margin: 0; flex-shrink: 0; transition: background .15s; }
input[type=checkbox].schalter::before { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
input[type=checkbox].schalter:checked { background: var(--signal); }
input[type=checkbox].schalter:checked::before { left: 21px; }
/* Wochentage-Auswahl */
.tage-auswahl { display: flex; gap: 4px; margin: var(--beschriftung-abstand) 0 0; flex-wrap: wrap; }
.tag-kaestchen { display: inline-block; margin: 0; position: relative; }
.tag-kaestchen input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.tag-kaestchen span { display: flex; width: 38px; height: 30px; align-items: center; justify-content: center; border: 1px solid var(--rand-stark); border-radius: var(--radius);
  font-weight: 600; font-size: 12px; cursor: pointer; background: #fff; color: var(--text-2); }
.tag-kaestchen input:checked + span { background: var(--signal); border-color: var(--signal); color: #fff; }

/* ===== 4 Komponenten: Formulare ========================================= */
/* Rhythmus: 16 px zwischen sichtbaren Kindern eines Formulars (Spezifität 0; hidden-Felder und Skripte zählen nicht) */
:where(form:not(.inline-formular):not(.aktionen-zeile)) > :where(:not([type=hidden]):not(script):not([hidden])) ~ :where(:not([type=hidden]):not(script):not([hidden])) { margin-top: var(--formular-abstand); }
/* Formular-Raster: Grid, Felder unten ausgerichtet — Beschriftungen mit Feldhilfe wachsen nach oben */
.zeilen-formular { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--formular-abstand) 20px; align-items: end; }
.zeilen-formular > label { margin: 0; min-width: 0; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; align-content: flex-end; gap: var(--beschriftung-abstand) 6px; }
.zeilen-formular > label > input, .zeilen-formular > label > select, .zeilen-formular > label > textarea, .zeilen-formular > label > .feld-hilfe, .zeilen-formular > label > .dp-farben, .zeilen-formular > label > .tage-auswahl, .zeilen-formular > label > .schalter-zeile { flex: 0 0 100%; width: 100%; }
.zeilen-formular > label > .feld-hilfe-knopf { margin-left: 0; }
.zeilen-formular > label > input, .zeilen-formular > label > select, .zeilen-formular > label > textarea, .zeilen-formular > label > .dp-farben, .zeilen-formular > label > .tage-auswahl { margin-top: 0; }
.zeilen-formular > label > .feld-hilfe { margin: -4px 0 0; }
.zeilen-formular > label > .feld-kurz, .zeilen-formular > label > .feld-mittel { width: 100%; max-width: 100%; }
.zeilen-formular > label:has(> textarea) { grid-column: 1 / -1; }
.zeilen-formular > label.kontrollkaestchen { flex-wrap: nowrap; align-items: center; align-content: center; justify-content: flex-start; gap: 10px; min-height: var(--feld-hoehe); align-self: end; }
.zeilen-formular > label.kontrollkaestchen > input { flex: none; width: auto; }
.zeilen-formular > .knopf, .zeilen-formular > button, .zeilen-formular > .aktion-icon { justify-self: start; align-self: end; }
.zeilen-formular > .aktion-icon { margin-bottom: 3px; }
.zeilen-formular + .zeilen-formular { margin-top: var(--formular-abstand); }
.zeilen-formular + p.klein, .zeilen-formular + .klein { margin-top: 12px; }
label + label, label + .zeilen-formular, .zeilen-formular + label, .kontrollkaestchen + label, label + .kontrollkaestchen { margin-top: var(--formular-abstand); }
/* Knöpfe nie direkt am Feld: nach Beschriftung, Feld, Formularzeile oder Fieldset immer 16 px Luft.
   Versteckte Felder (csrf_feld(), <input type="hidden" name="id">) direkt vor dem Knopf geben ihm nur dann 16 px, wenn
   davor ein SICHTBARES Feld steht (gestapeltes Formular: „Name“, csrf, „Speichern“). Steht nur Verstecktes davor („Löschen“-
   Formular im Seitenkopf oder in den Zeilen-Aktionen), bleibt der Knopf auf der Linie der Knöpfe daneben (ui-richtlinien 3a).
   Die Formular-Rhythmus-Regel oben kann das nicht leisten: Spezifität 0, sie verliert gegen „.knopf { margin: 0 }“. */
label + .knopf, label + button, label + .aktionen-zeile, label + .inline-formular, input:where(:not([type=hidden])) + .knopf, input:where(:not([type=hidden])) + button, select + .knopf, select + button, textarea + .knopf, textarea + button,
:where(label, input:not([type=hidden]), select, textarea, fieldset, .zeilen-formular, .kontrollkaestchen, .eigene-felder, .matrix-felder) ~ input:where([type=hidden]) + .knopf,
:where(label, input:not([type=hidden]), select, textarea, fieldset, .zeilen-formular, .kontrollkaestchen, .eigene-felder, .matrix-felder) ~ input:where([type=hidden]) + button,
.zeilen-formular + .knopf, .zeilen-formular + button, .zeilen-formular + .aktionen-zeile, .zeilen-formular + .inline-formular, fieldset + .knopf, fieldset + button, fieldset + .aktionen-zeile,
.eigene-felder + .aktionen-zeile, .kontrollkaestchen + .knopf, .kontrollkaestchen + button, .kontrollkaestchen + .aktionen-zeile, .ank-bildschirme + .aktionen-zeile, .matrix-felder + .aktionen-zeile, p + .aktionen-zeile, .klein + .knopf { margin-top: var(--formular-abstand); }
/* Knopf, Knopfzeile oder Haken als Zelle im Formular-Raster: den Abstand gibt das Raster (row-gap 16 px). Die Regeln für
   gestapelte Formulare darüber („label + .knopf“, „label + .kontrollkaestchen“, „.kontrollkaestchen + .kontrollkaestchen“)
   legten beim Umbruch in eine eigene Rasterzeile noch 8–16 px drauf — am Handy 32 statt 16 px über „Speichern“ bzw. dem Haken.
   EINE Regel für alle Bereiche (früher je Bereich geflickt: Tickets/Dienstleister, Immobilien, CRM, Arbeitsaufträge/Maschinen).
   Muss hinter den Regeln oben stehen (gleiche Spezifität wie „.kontrollkaestchen + .knopf“). Prüfung: mess.js, Spalte „linie“,
   „Luft Feld → Knopf im Raster > 20 px“. */
.zeilen-formular > :is(.aktionen-zeile, .knopf, button, .kontrollkaestchen) { margin-top: 0; }
/* Aktionszeilen: Knöpfe und Felder gleich hoch (42) und an der Unterkante ausgerichtet — auch wenn ein Feld eine Beschriftung darüber hat */
.aktionen-zeile, .inline-formular, .karten-fuss { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.aktionen-zeile .knopf, .inline-formular .knopf, .zeilen-formular .knopf, .aktionen-zeile .aktion-icon, .inline-formular .aktion-icon { height: var(--feld-hoehe); }
.aktionen-zeile .knopf-klein, .inline-formular .knopf-klein { padding: 0 14px; font-size: 14px; }
.aktionen-zeile .aktion-icon, .inline-formular .aktion-icon { width: var(--feld-hoehe); }
/* Formular aus nur einem Knopf (versteckte Felder + Knopf) — „Löschen“ aus zeilen_aktionen(), „Aufheben“ neben dem Link
   „Ausbuchen“, „✓ Erledigt“: Das Formular ist nur die Hülle, der Knopf behält seine eigene Größe wie seine Nachbarn in der
   Zeile (.knopf-klein 32, .aktion-icon 36, am Handy je 40). Vorher 42 (Feldhöhe) — neben einem 32er-Link bzw. 36er-Symbol
   ungleich hoch. Die Feldhöhe gilt weiter, wo das Formular ein sichtbares Feld hat oder in einer Aktions-/Feldzeile steht.
   Gleiche Gewichtung wie die Regeln oben (eine Klasse + :where), damit spätere Bereichsregeln (z. B. .aa-pos-aktionen) gewinnen. */
.inline-formular:where(:not(.aktionen-zeile):not(:has(input:not([type=hidden]), select, textarea, label)):not(:is(.aktionen-zeile, .zeilen-formular) .inline-formular)) .knopf-klein { height: var(--knopf-klein-hoehe); padding: 0 12px; font-size: 13px; }
.inline-formular:where(:not(.aktionen-zeile):not(:has(input:not([type=hidden]), select, textarea, label)):not(:is(.aktionen-zeile, .zeilen-formular) .inline-formular)) .aktion-icon { width: var(--icon-knopf-hoehe); height: var(--icon-knopf-hoehe); }
.inline-formular { display: inline-flex; }
.aktionen-zeile > *, .inline-formular > *, .karten-fuss > * { margin: 0; }
/* Knopflinie: In einer Zeile hat ein Knopf nie Außenabstand oben — den Abstand gibt das gap. Die Formularregeln oben
   („input/select/.klein + .knopf“) schlugen „> * { margin: 0 }“ und schoben ihn 8–16 px aus der Linie (früher je Seite mit
   margin-top: 0 geflickt). Ausnahme: nach einer Beschriftung (label) — bricht die Zeile um, bleibt der Knopf 16 px unter dem Feld. */
:is(.aktionen-zeile, .inline-formular, .karten-fuss, .seiten-kopf-aktionen, .zeilen-aktionen) > :not(label) + :is(.knopf, button, .aktion-icon) { margin-top: 0; }
/* Felder + Knopfgruppe auf einer Linie (ui-richtlinien 3a), gleiche Logik wie „Filtern/Zurücksetzen“ (.such-form-linie):
   <div class="felder-linie"><div class="zeilen-formular">…Beschriftungen…</div><div class="aktionen-zeile">…Knöpfe…</div></div>
   Die Knöpfe bleiben EINE Gruppe (nie „Speichern“ oben, „Abbrechen“ unten) und stehen rechts neben dem Raster, unten bündig
   mit der letzten Feldzeile (Mitte = Mitte der Eingabefelder). Als letzte Zelle IM Raster brach die Gruppe in einer
   220–227 px schmalen Spalte auseinander. Erst wenn neben einer Feldspalte (220 px) kein Platz ist, rutscht die Gruppe
   darunter; am Handy dann über die volle Breite. Den Abstand gibt das gap, kein margin-top. Genutzt in portal/lager/. */
.felder-linie { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--formular-abstand) 20px; }
.felder-linie > .zeilen-formular { flex: 1 1 220px; min-width: 0; margin: 0; }
.felder-linie > .aktionen-zeile { flex: 0 0 auto; flex-wrap: nowrap; margin: 0; }
@media (max-width: 767px) { .felder-linie > .zeilen-formular { flex-basis: 100%; } .felder-linie > .aktionen-zeile { flex: 1 1 100%; } .felder-linie > .aktionen-zeile > :is(.knopf, button) { flex: 1 1 auto; } }
.aktionen-zeile > :where(input, select), .inline-formular > :where(input, select), .aktionen-zeile > label > :where(input, select) { width: auto; min-width: 180px; height: var(--feld-hoehe); }
.aktionen-zeile > input[type=search], .aktionen-zeile > input[type=text]:not(.feld-kurz):not(.feld-mittel) { flex: 1 1 220px; max-width: 560px; }
.aktionen-zeile > .feld-kurz, .inline-formular > .feld-kurz { min-width: 0; width: 130px; }
.aktionen-zeile > .feld-mittel, .inline-formular > .feld-mittel { min-width: 0; width: 260px; }
.aktionen-zeile > label { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; align-content: flex-end; gap: var(--beschriftung-abstand) 6px; }
.aktionen-zeile > label > input, .aktionen-zeile > label > select, .aktionen-zeile > label > .feld-hilfe { flex: 0 0 100%; }
.aktionen-zeile > label > :where(input, select) { margin-top: 0; }
.aktionen-zeile input[type=checkbox], .inline-formular input[type=checkbox], .aktionen-zeile input[type=radio], .inline-formular input[type=radio] { width: 18px; min-width: 0; height: 18px; }
.aktionen-zeile .kontrollkaestchen, .inline-formular .kontrollkaestchen { display: inline-flex; align-items: center; margin: 0; gap: 8px; white-space: nowrap; }
.karten-fuss { justify-content: flex-end; margin-top: var(--abschluss-abstand); padding-top: 16px; border-top: 1px solid var(--rand); }
.karte-kopfzeile + .aktionen-zeile { margin-top: 12px; }
/* (früher 20 px — hob den 16-px-Rhythmus von oben wieder auf; gilt jetzt nur noch für die
   abschließende Knopfzeile einer Karte, siehe .karten-fuss und .formular-karte) */
.formular-karte { max-width: none; }
/* Formularfuß mit Trennlinie — nicht, wenn das Formular selbst ein Raster ist (form.zeilen-formular): dort ist die Knopfzeile
   eine Zelle neben bzw. unter dem Feld (Adressbuch „Mieter“: Einheit · „Weiter zum Mieter“). Der Fuß zog sonst eine Linie
   quer durch die Zelle und gab am Handy 36 px + Linie + 20 px über dem Knopf. */
.formular-karte > form:not(.zeilen-formular) > .aktionen-zeile:last-child { margin-top: var(--abschluss-abstand); padding-top: var(--abschluss-abstand); border-top: 1px solid var(--rand); }
/* Zeilen-Aktionen rechts in Listen und Tabellen */
.zeilen-aktionen { display: flex; gap: 8px; align-items: center; margin-left: auto; flex-shrink: 0; }
.zeilen-icons { gap: 6px; }
.tabelle .zeilen-icons { justify-content: flex-end; }
/* ===== 4 Komponenten: Zeilen-Menü „⋯“ und Zeilenklick (Grundsatz 4) ===============================
   Baustein zeilen_menue()/zeilen_aktionen() und zeile_ziel_attr() in kern/layout.php, Verhalten assets/menue.js. Der Knopf ist
   ein .aktion-icon (36 px, Handy 40 px); das Menü schwebt über der Seite und schiebt nichts. Ohne Skript hängt es absolut unter
   dem Knopf, mit Skript liegt es fest (.menue-schwebend, Lage aus menue.js) — so schneidet es kein scrollender Tabellenrahmen ab.
   Einträge: .menue-punkt (Link, Knopf, Knopf im Formular, summary eines Felds), rot .menue-gefahr, Trennlinie .menue-trenner,
   Feld im Menü .menue-feld (details > summary + form).
   Höhe im Stapel: alle schwebenden Menüs (auch .aa-pdf-menue, .aa-feld-panel der Auftragsseite) z-index 88 — über dem Support-Knopf
   (80) und dem Support-Chat (85), unter Hilfe-Schleier (90) und Dialogen. Mit 45 lag der Knopf unten rechts über dem untersten
   Eintrag; ein Klick darauf öffnete den Chat statt der Aktion (Gegenprüfung 08.10.). */
.zeilen-menue, .zeilen-menue[open] { position: relative; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.zeilen-menue > summary { list-style: none; }
.zeilen-menue > summary::-webkit-details-marker { display: none; }
.zeilen-menue > summary::before { content: none; }
.zeilen-menue > summary svg { width: 18px; height: 18px; }
.zeilen-menue > summary svg circle { fill: currentColor; }
.zeilen-menue[open] > summary { border-color: var(--signal-rand); border-radius: 9px; background: var(--flaeche-aktiv); color: var(--signal); }
.zeilen-menue > .menue-liste { position: absolute; right: 0; top: calc(100% + 6px); z-index: 88; display: flex; flex-direction: column; gap: 2px;
  width: max-content; min-width: 220px; max-width: min(340px, calc(100vw - 16px)); margin: 0; padding: 6px; box-sizing: border-box; overflow-y: auto;
  border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche); box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  text-align: left; white-space: normal; font-size: 14px; font-weight: 400; line-height: 1.3; color: var(--text); cursor: default; }
.zeilen-menue > .menue-liste.menue-schwebend { position: fixed; right: auto; }
.zeilen-menue > .menue-liste:has(> .menue-feld[open]) { width: min(380px, calc(100vw - 16px)); max-width: none; }
.menue-liste > form { margin: 0; }
.menue-punkt { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; width: 100%; min-height: var(--knopf-hoehe); margin: 0;
  padding: 6px 10px; box-sizing: border-box; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.3;
  color: var(--text); text-align: left; text-decoration: none; white-space: normal; cursor: pointer; }
.menue-punkt:hover, .menue-punkt:focus-visible { background: var(--flaeche-still); color: var(--text); text-decoration: none; }
.menue-punkt:focus-visible { outline: 2px solid var(--signal); outline-offset: -2px; }
.menue-punkt.menue-gefahr, .menue-punkt.menue-gefahr:hover { color: var(--gefahr); }
.menue-punkt.menue-gefahr:hover, .menue-punkt.menue-gefahr:focus-visible { background: #fef2f2; }
.menue-hinweis { font-size: 12.5px; font-weight: 400; line-height: 1.35; color: var(--text-schwach); }
.menue-trenner { flex: none; height: 1px; margin: 4px 6px; background: var(--rand); }
/* Eintrag, der ein kleines Formular aufklappt (Rolle ändern, Ab Datum ausplanen …) — klappt IM Menü auf */
.menue-liste > .menue-feld, .menue-liste > .menue-feld[open] { margin: 0; padding: 0; border: 0; border-radius: 8px; background: none; }
.menue-feld > summary.menue-punkt { list-style: none; }
.menue-feld > summary::-webkit-details-marker { display: none; }
.menue-feld > summary::before { content: none; }
.menue-feld[open] > summary.menue-punkt { border-bottom: 0; border-radius: 8px; background: var(--flaeche-still); }
.menue-feld > form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 10px; margin: 0; padding: 8px 10px 10px; }   /* Zeilenabstand 12: Mindestabstand Feld → Knopf (mess.js „abstand“) */
.menue-feld > form > * { margin: 0; }
.menue-feld > form > :is(label, input:not([type=hidden]), select, textarea, .auswahl-feld) { flex: 1 1 150px; min-width: 0; }
.menue-feld > form > label > :is(input, select, textarea) { width: 100%; }
.menue-feld > form > .knopf { flex: none; }
.menue-feld > form > .kontrollkaestchen { flex-basis: 100%; }
.menue-feld > form > :is(p, .meldung) { flex-basis: 100%; }   /* Erklärsatz bzw. Warnung über bzw. zwischen den Feldern (Lager → Bewegungen: Stornieren) */
/* Zwei Felder (Profil „Ändern“: Name, Notiz) bzw. ein Haken vor dem Knopf: der Knopf steht darunter — dann über die volle Breite
   (Knopflinie, ui-richtlinien 3a); ein einzelnes Feld behält den Knopf rechts daneben */
.menue-feld > form:has(> label ~ label) > .knopf, .menue-feld > form > :is(.kontrollkaestchen, .meldung) + .knopf { flex: 1 1 100%; justify-content: center; }
/* Ausgegraute Zeilen (.inaktiv): blass werden Inhalt und „⋯“, nicht das offene Menü. opacity an der ganzen Zeile machte das Menü
   durchscheinend und sperrte es in den Stapelkontext der Zeile — die nächste Karte lag darüber, ein Klick auf „In den Papierkorb“
   traf deren Filter-Chip (Formulare, 08.10.2026). Handy-Karten (.tabelle.tk tr.inaktiv): „Mobil: Fundament“. */
.liste-zeile.inaktiv:has(> .zeilen-aktionen.nur-menue) { opacity: 1; }
.liste-zeile.inaktiv:has(> .zeilen-aktionen.nur-menue) > :not(.zeilen-aktionen.nur-menue),
.liste-zeile.inaktiv > .zeilen-aktionen.nur-menue > .zeilen-menue > summary { opacity: .55; }
/* Zeilenklick ([data-zeile-ziel]; .zeilenklick setzt assets/menue.js an <html> — ohne Skript kein Zeiger, der nichts tut).
   Tabellenzeilen haben ihren Hover schon (.tabelle tbody tr:hover); Listenzeilen bekommen dieselbe Fläche, 10 px über den
   Rand hinaus (Schatten statt Rand/Abstand — nichts verschiebt sich). */
.zeilenklick [data-zeile-ziel] { cursor: pointer; }
.zeilenklick [data-zeile-ziel] .menue-liste { cursor: default; }
@media (hover: hover) {   /* am Handy bliebe die Fläche nach dem Tippen stehen */
  .zeilenklick .liste-zeile[data-zeile-ziel]:not(.hervorgehoben):hover { background: var(--container); box-shadow: -10px 0 0 var(--container), 10px 0 0 var(--container); }
}
/* Knöpfe in Tabellenzellen ohne Abstand — aber nur die Zellen-Knöpfe selbst, nicht Formulare in
   aufgeklappten Zeilen (dort gelten die normalen Formularabstände). */
td > .knopf, th > .knopf, td > form > .knopf, td > .zeilen-aktionen .knopf, td > .aktionen-zeile .knopf,
td > .inline-formular .knopf, th > .inline-formular .knopf { margin: 0; vertical-align: middle; }

/* ===== 4 Komponenten: Feldgruppen (fieldset) ============================= */
/* Eigener Block mit 16 px Abstand nach oben, Titel innen (keine schwebende Legende), Häkchen zentriert */
fieldset { background: var(--container); border: 1px solid var(--rand); border-radius: 12px; padding: 18px 22px 20px; margin: var(--formular-abstand) 0 0; width: 100%; min-width: 0; }
fieldset:first-child, form > :where(input[type=hidden], script) + fieldset { margin-top: 0; }
fieldset + fieldset { margin-top: var(--formular-abstand); }
fieldset > legend { float: left; width: 100%; margin: 0 0 14px; padding: 0; font-size: 14px; font-weight: 600; color: var(--text); background: none; border: 0; border-radius: 0; }
fieldset > legend + * { clear: both; }
fieldset > * + * { margin-top: 14px; }
fieldset > .kontrollkaestchen + .kontrollkaestchen { margin-top: 10px; }
fieldset .kontrollkaestchen > input[type=checkbox], fieldset .kontrollkaestchen > input[type=radio] { margin-top: 0; }
fieldset > .zeilen-formular:first-child, fieldset > legend + .zeilen-formular { margin-top: 0; }
fieldset > .aktionen-zeile { margin-top: 14px; }
/* Schnellanlage im Aufklapper (kern/schnellanlage.php, CRM „+ Neue Person anlegen“): das fieldset klammert nur die Felder (an/aus mit
   dem Aufklapper) — kein eigener Rahmen, die Felder stehen wie zuvor direkt im Aufklapper */
fieldset.schnell-felder { background: none; border: 0; border-radius: 0; padding: 0; width: auto; }   /* width auto: mit dem Seitenrand des Aufklappers nie breiter als er */
/* Optionen in Reihe (Bildschirme, Empfänger) */
.ank-bildschirme { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 12px 16px; background: #fff; border: 1px solid var(--rand); border-radius: 10px; margin-top: var(--beschriftung-abstand); }
.ank-bildschirme .kontrollkaestchen { margin: 0; min-width: 0; overflow-wrap: anywhere; }   /* lange Namen ohne Leerzeichen (Lager → Zugriff) brechen statt quer zu schieben */
.formular-karte form > fieldset + .zeilen-formular, .formular-karte form > fieldset + label, .formular-karte form > fieldset + .kontrollkaestchen { margin-top: 20px; }

/* ===== 4 Komponenten: Karten ============================================ */
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius-karte); box-shadow: var(--schatten); padding: var(--karte-innen); margin-bottom: var(--karte-abstand); min-width: 0; }
.karte > h2, .karte > .karte-kopfzeile { margin: calc(-1 * var(--karte-innen)) calc(-1 * var(--karte-innen)) 20px; padding: 18px var(--karte-innen) 16px; border-bottom: 1px solid var(--rand); }
/* Sektionsüberschriften in Signalfarbe, damit Karten auf einen Blick unterscheidbar sind */
.karte > h2 { font-size: 16px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--signal); }
.karte-kopfzeile { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.karte-kopfzeile h2 { margin: 0; padding: 0; border: 0; font-size: 16px; font-weight: 700; color: var(--signal); }
.dash-modul-titel h2 { color: var(--signal); }
.karte h3 { color: var(--text-2); }
.karte-kopfzeile strong { font-size: 16px; }
.karte-kopfzeile > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-width: 0; }
.karte-kopfzeile > div:first-child > .klein { flex-basis: 100%; }
.karte-kopfzeile > form, .karte-kopfzeile > .knopf, .karte-kopfzeile > .aktionen-zeile { flex-shrink: 0; margin: 0; }
/* Vertikaler Rhythmus in der Karte: 16 px zwischen Kindern; nach dem Kartentitel keiner (der hat seinen Abstand) */
.karte > * + * { margin-top: var(--formular-abstand); }
.karte > h2 + *, .karte > .karte-kopfzeile + * { margin-top: 0; }
.karte > h3 { margin-bottom: 4px; }
.karte.inaktiv { opacity: .55; }
.karte-gefahr { border-color: #fecaca; }
.karte > .stat-karten { margin-bottom: 0; }

/* ===== 4 Komponenten: Listenzeilen ====================================== */
.liste-zeile { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--rand-weich); flex-wrap: wrap; min-height: 56px; }
.liste-zeile:first-child, h2 + .liste-zeile, h3 + .liste-zeile, .karte-kopfzeile + .liste-zeile, .modul-gruppe-titel + .liste-zeile, .klein + .liste-zeile, .filter-chips + .liste-zeile { border-top: 0; }
.liste-zeile + .liste-zeile { margin-top: 0; }
.karte > h2 + .liste-zeile, .karte > .karte-kopfzeile + .liste-zeile { padding-top: 0; }
.karte > .liste-zeile:last-child { padding-bottom: 0; }
.liste-zeile.inaktiv { opacity: .55; }
.liste-haupt { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.liste-titel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; font-size: 15px; color: var(--text); }
.liste-titel a { color: inherit; }
.liste-titel a:hover { color: var(--signal); }
.liste-haupt > .klein { display: flex; gap: 6px 14px; flex-wrap: wrap; }
.liste-werte { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.liste-werte b { display: block; font-size: 14px; color: var(--text); font-weight: 600; }
.liste-zeile > .inline-formular, .liste-zeile > .aktionen-zeile { margin: 0; }
/* Hervorgehobene Zeile mit Luft nach oben (z. B. Mieter im Objekt) */
/* Hervorgehobene Zeile ist ein Block IN der Karte, nicht über deren Rand hinaus — sonst stößt
   die abgerundete blaue Fläche direkt an den Kartenrahmen. */
.liste-zeile.hervorgehoben { background: var(--flaeche-aktiv); margin: 12px 0 0; padding: 16px 18px; border: 1px solid var(--rand); border-radius: 10px; }
.karte > h2 + .liste-zeile.hervorgehoben { margin-top: var(--formular-abstand); }
/* Einstellungs-Zeilen (Icon · Text · Steuerelement) */
.einstellung-zeile { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--rand-weich); flex-wrap: wrap; }
.einstellungen-liste > .einstellung-zeile:first-child, .einstellungen-liste > .einstellung-aufklapp:first-child .einstellung-zeile, h2 + .einstellung-zeile, .karte-kopfzeile + .einstellung-zeile { border-top: 0; }
.einstellung-zeile + .einstellung-zeile, .einstellungen-liste > * + * { margin-top: 0; }
.einstellung-icon { width: 32px; height: 32px; border-radius: var(--radius); flex-shrink: 0; background: var(--flaeche-still); color: var(--text-2); border: 1px solid var(--rand); display: flex; align-items: center; justify-content: center; }
.einstellung-icon svg { width: 16px; height: 16px; }
.einstellung-text { flex: 1; min-width: 200px; }
.einstellung-text .titel { font-weight: 600; font-size: 14px; }
.einstellung-aktion { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.einstellung-aktion input, .einstellung-aktion select { margin: 0; width: 240px; }
.einstellung-aktion input[type=number] { width: 90px; }
.einstellung-aktion input[type=checkbox] { width: auto; }
.einstellung-aktion input[type=checkbox].schalter { width: 40px; }
.einstellung-logo { max-height: 40px; max-width: 160px; vertical-align: middle; margin-right: 12px; }
/* Aktivitäten */
.aktivitaet-zeile { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--rand-weich); }
.aktivitaet-zeile:first-child, h2 + .aktivitaet-zeile, .karte-kopfzeile + .aktivitaet-zeile { border-top: 0; }
.aktivitaet-zeile + .aktivitaet-zeile { margin-top: 0; }
.aktivitaet-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--flaeche-aktiv); color: var(--signal); flex-shrink: 0; }
.aktivitaet-icon svg { width: 16px; height: 16px; }
.aktivitaet-icon.rot { background: #fef2f2; color: var(--gefahr); }
.aktivitaet-zeit { font-size: 12px; color: var(--text-still); min-width: 42px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.aktivitaet-text { min-width: 0; }
.aktivitaet-text .titel { font-weight: 600; font-size: 14.5px; color: var(--text); }
.aktivitaet-punkt { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; flex-shrink: 0; background: var(--info); }
.aktivitaet-punkt.gruen { background: var(--gruen); }
.aktivitaet-punkt.rot { background: var(--gefahr); }
.aktivitaet-punkt.grau { background: var(--text-still); }
/* Definitionsliste (Stammdaten) */
.daten-liste { display: grid; grid-template-columns: 150px 1fr; gap: 6px 16px; margin: 0; font-size: 14px; flex: 1; min-width: 260px; }
.daten-liste dt { color: var(--text-schwach); }
.daten-liste dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ===== 4 Komponenten: Tabellen ========================================== */
.tabelle-umbruch { overflow-x: auto; max-width: 100%; }
.karte > .tabelle-umbruch { margin-left: calc(-1 * var(--karte-innen)); margin-right: calc(-1 * var(--karte-innen)); }
.karte > .tabelle-umbruch:last-child { margin-bottom: calc(-1 * var(--karte-innen)); padding-bottom: 6px; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tabelle th, .tabelle td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--rand-weich); vertical-align: middle; line-height: 1.4; }
.tabelle th:first-child, .tabelle td:first-child { padding-left: var(--karte-innen); }
.tabelle th:last-child, .tabelle td:last-child { padding-right: var(--karte-innen); }
.tabelle th { font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-schwach); padding-top: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--rand); white-space: nowrap; }
.tabelle td.zahl, .tabelle th.zahl, .tabelle td.rechts, .tabelle th.rechts { text-align: right; font-variant-numeric: tabular-nums; }
.tabelle td.zeit { color: var(--text-2); font-variant-numeric: tabular-nums; }
.tabelle tbody tr:hover td { background: var(--container); }
.tabelle tr.warnt td { background: #fef2f2; }
.tabelle tr.hervorgehoben td { background: #fffbeb; }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle td .inline-formular, .tabelle td .zeilen-aktionen { margin: 0; }
.tabelle td .knopf-klein, .tabelle td .aktion-icon { vertical-align: middle; }
.tabelle.kompakt td, .tabelle.kompakt th { padding: 6px 10px; }
.karte > .tabelle { width: calc(100% + 2 * var(--karte-innen)); margin-left: calc(-1 * var(--karte-innen)); margin-right: calc(-1 * var(--karte-innen)); }
/* Bildschirm-Einstellungen als Akkordeon-Zeile unter der Tabellenzeile */
.tabelle tr.akkordeon-zeile td { padding: 0; border-top: 0; }
/* Einstellungen je Bildschirm: zu sehen nur nach Klick auf das Einstellungs-Symbol der Zeile —
   zugeklappt verschwindet die Zeile komplett, die Tabelle bleibt ruhig. */
.bildschirm-akkordeon:not([open]) { display: none; }
.tabelle tr.akkordeon-zeile:hover td { background: transparent; }

/* ===== 4 Komponenten: Meldungen, Abzeichen, Chips, Balken =============== */
.meldung { padding: 12px 16px; border-radius: 10px; margin-bottom: var(--formular-abstand); font-size: 14px; border: 1px solid; }
.meldung-erfolg { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.meldung-fehler { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.meldung-warnung { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.meldung-info, .meldung-hinweis { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.abzeichen { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  vertical-align: middle; background: #f3f4f6; color: #4b5563; line-height: 1.4; }
.abzeichen-gruen { background: #ecfdf5; color: #047857; }
.abzeichen-rot { background: #fef2f2; color: #b91c1c; }
.abzeichen-gelb { background: #fffbeb; color: #b45309; }
.abzeichen-blau { background: #eff6ff; color: #1d4ed8; }
.abzeichen-grau { background: #f3f4f6; color: #4b5563; }
.abzeichen svg { width: 13px; height: 13px; vertical-align: 0; }
.abzeichen-link { display: inline-flex; color: inherit; font-weight: inherit; max-width: 100%; }
/* Lange verlinkte Abzeichen (z. B. „Planung · Maler, Steinteppich, …“ im Kopf der Personenseite) brechen um statt seitlich
   überzustehen (390 px) */
.abzeichen-link > .abzeichen { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.abzeichen-link:hover .abzeichen { box-shadow: 0 0 0 2px var(--fokus-ring); }
/* Filter- und Kategorie-Pillen (Links, Spans, Buttons) */
.filter-leiste, .kategorie-leiste, .filter-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.kategorie-leiste { margin-bottom: 14px; }
.filter-leiste a, .filter-leiste span, .filter-pille, .kategorie-leiste a, .chip, .filter-leiste button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px;
  border: 1px solid var(--rand); border-radius: 999px; background: #fff; color: var(--text-2); font: 500 13px var(--schrift); cursor: pointer; white-space: nowrap; }
.filter-leiste .aktiv, .filter-pille.aktiv, .kategorie-leiste a.aktiv, .chip.aktiv, .filter-leiste button.aktiv { background: var(--signal); border-color: var(--signal); color: #fff; }
.chip:hover:not(.aktiv), .filter-leiste a:hover:not(.aktiv) { border-color: var(--rand-stark); color: var(--text); }
/* Chips als <label> (Mehrfachauswahl per Häkchen): die Formularregel „label + label“ gäbe jedem weiteren Chip 16 px nach oben — die Namen ständen dann versetzt */
label.chip { margin: 0; }
.chip-trenner { width: 1px; height: 22px; background: var(--rand); margin: 0 6px; }
/* nowrap: .filter-leiste bringt flex-wrap: wrap mit — in einer Spalte rechnete der Browser das Feldraster dann so hoch,
   als stünden alle Felder untereinander, und setzte sie unten in eine Zeile (großer leerer Block im Filter, Lager → Artikel) */
form.filter-leiste { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 12px; }
form.filter-leiste > .filter-chips, form.filter-leiste > .aktionen-zeile { margin: 0; }
.filter-chips + .aktionen-zeile, .filter-chips + form { margin-top: 12px; }
/* Speicher-Balken mit Ampel */
.balken { height: 6px; background: var(--rand); border-radius: 999px; overflow: hidden; max-width: 420px; margin-bottom: 6px; }
.balken-fuellung { height: 100%; border-radius: 999px; }
.ampel-gruen { background: var(--gruen); }
.ampel-gelb { background: var(--gelb); }
.ampel-rot { background: var(--gefahr); }

/* ===== 4 Komponenten: Aufklapper (details) =============================== */
/* Kanonisch (Spezifität 0): Box, drehender Pfeil, Inhalt 16 px innen.
   Ausnahmen: .nav-klapp (Seitenleiste), .anlegen-akkordeon (Kartenkopf), .einstellung-aufklapp,
   .bildschirm-akkordeon, .dp-inline-details, .dp-rot-anwenden, .komm-zeile */
:where(details) { border: 1px solid var(--rand); border-radius: 10px; background: #fff; }
:where(details > summary) { list-style: none; display: flex; align-items: center; gap: 9px; padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--text-2); border-radius: 10px; }
:where(details > summary)::-webkit-details-marker { display: none; }
:where(details > summary)::before { content: ''; width: 13px; height: 13px; flex-shrink: 0; transition: transform .15s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; }
:where(details[open] > summary)::before { transform: rotate(90deg); }
:where(details > summary):hover { background: var(--flaeche-still); color: var(--text); }
:where(details[open] > summary) { border-bottom: 1px solid var(--rand); border-radius: 10px 10px 0 0; }
:where(details > :not(summary)) { padding: 0 16px; }
:where(details > summary + :not(summary)) { padding-top: 16px; }
:where(details > :not(summary):last-child) { padding-bottom: 16px; }
:where(details > :not(summary) + :not(summary)) { margin-top: 12px; }
details + details { margin-top: 10px; }
/* Karten-Kopf-Aufklapper: sieht aus wie der Kartentitel, randlos */
.karte > .anlegen-akkordeon { margin: calc(-1 * var(--karte-innen)) calc(-1 * var(--karte-innen)) 0; border: 0; border-radius: 0; background: none; }
.karte > .anlegen-akkordeon:not(:last-child) { margin-bottom: 8px; }
.karte > .anlegen-akkordeon + * { margin-top: var(--formular-abstand); }
.anlegen-akkordeon > summary { display: flex; align-items: center; gap: 10px; padding: 18px var(--karte-innen) 16px; font-size: 16px; font-weight: 600; color: var(--text); border-radius: 0; background: none; }
.anlegen-akkordeon > summary::before { stroke: var(--text-schwach); }
.anlegen-akkordeon > summary:hover { background: var(--container); }
.anlegen-akkordeon[open] > summary { border-bottom: 1px solid var(--rand); }
.anlegen-akkordeon > :not(summary) { padding: 0; margin: 0 var(--karte-innen); }
.anlegen-akkordeon > :not(summary) + :not(summary) { margin-top: var(--formular-abstand); }
.anlegen-akkordeon > summary + :not(summary) { padding-top: 0; margin-top: 20px; }
.anlegen-akkordeon > :not(summary):last-child { padding-bottom: 0; }
.anlegen-akkordeon > .liste-zeile + .liste-zeile { margin-top: 0; }
.anlegen-akkordeon > .modul-gruppe-titel { margin: 24px var(--karte-innen) 8px; }
.anlegen-akkordeon > .tabelle-umbruch, .anlegen-akkordeon > .tabelle { margin-left: 0; margin-right: 0; }
/* Mehrere Aufklapper in einer Karte folgen ohne Lücke aufeinander (Trennlinie); der letzte schließt mit der Karte ab */
.karte > .anlegen-akkordeon + .anlegen-akkordeon { margin-top: 0; border-top: 1px solid var(--rand); }
.karte > .anlegen-akkordeon:last-child { margin-bottom: calc(-1 * var(--karte-innen)); }
.karte > .anlegen-akkordeon:last-child[open] { padding-bottom: var(--karte-innen); }
/* Verschachtelte Aufklapper innerhalb eines Karten-Kopf-Aufklappers: wieder als Box */
.anlegen-akkordeon .anlegen-akkordeon { border: 1px solid var(--rand); border-radius: 10px; margin: 10px var(--karte-innen); }
.anlegen-akkordeon .anlegen-akkordeon > summary { padding: 12px 16px; font-size: 14.5px; }
.anlegen-akkordeon .anlegen-akkordeon > :not(summary) { margin: 0 16px; }
.modul-akkordeon > summary svg { width: 20px; height: 20px; stroke: var(--signal); }
.modul-akkordeon-rechts { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; }
.modul-gruppe-titel { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.paket-zeile > summary, .dp-person-zeile > summary { flex-wrap: wrap; gap: 10px; }
.paket-zeile > form.inline-formular { margin-top: 10px; }
/* Dienstleister: jeder Auftrag ein Aufklapper — Betreff und Stand in der Zeile, rechts Termin/Kosten/Datum */
.auftrag-akkordeon > summary { flex-wrap: wrap; }
.auftrag-akkordeon .auftrag-meta { margin-left: auto; display: inline-flex; gap: 12px; font-size: 12.5px; font-weight: 400; color: var(--text-2); white-space: nowrap; }
.auftrag-text { white-space: pre-line; font-size: 14px; line-height: 1.55; }
/* Historien als eingeklappter Aufklapper am Kartenende */
.karte > .historie-akkordeon:last-child { margin-bottom: calc(-1 * var(--karte-innen)); }
.historie-akkordeon > .aktivitaet-zeile:last-child, .historie-akkordeon > .tabelle:last-child, .historie-akkordeon > p:last-child { margin-bottom: 0; padding-bottom: var(--karte-innen); }
.historie-akkordeon > .aktivitaet-zeile + .aktivitaet-zeile { margin-top: 0; }
/* Einstellungs-Zeilen als Aufklapper (Mail-Matrix, Hilfe): keine Box, Pfeil rechts */
.einstellung-aufklapp { border: 0; border-radius: 0; background: none; }
.einstellung-aufklapp > summary { display: block; padding: 0; border: 0; border-radius: 0; background: none; font: inherit; color: inherit; }
.einstellung-aufklapp > summary::before { content: none; }
.einstellung-aufklapp > summary:hover { background: none; }
.einstellung-aufklapp > :not(summary) { padding: 0; margin: 0; }
.einstellung-aufklapp > .aufklapp-inhalt { padding: 4px 0 14px 46px; }
.einstellung-aufklapp + .einstellung-aufklapp { margin-top: 0; }
.aufklapp-pfeil { color: var(--text-still); transition: transform .15s; }
.aufklapp-pfeil svg { width: 16px; height: 16px; }
.einstellung-aufklapp[open] .aufklapp-pfeil { transform: rotate(90deg); }
.hilfe-text ol, .hilfe-text ul { padding-left: 22px; }
.hilfe-text > * + * { margin-top: 10px; }
/* Kommunikations-Zeile: Listenzeile als Aufklapper, Inhalt darunter */
.komm-zeile:first-of-type, h2 + .komm-zeile { border-top: 0; }
.komm-zeile + .komm-zeile { margin-top: 0; }
.komm-zeile > summary { display: flex; flex-direction: column; gap: 4px; padding: 0 0 0 22px; border: 0; border-radius: 0; background: none; font: inherit; color: inherit; position: relative; }
.komm-zeile > summary::before { position: absolute; left: 0; top: 4px; }
.komm-zeile[open] > summary { border-bottom: 0; }
.komm-zeile > summary:hover { background: none; }
.komm-inhalt { margin: 12px 0 0 22px; padding: 12px 14px; background: var(--container); border: 1px solid var(--rand); border-radius: 10px; font-size: 14px; line-height: 1.55; white-space: pre-line; }

/* ===== 4b Bereichs-Reiter: eine lange Seite wird zu mehreren kurzen ====== */
.bereich-reiter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 var(--formular-abstand); }
.bereich-reiter .chip { height: 38px; padding: 0 18px; font-size: 14px; font-weight: 600; border-radius: 999px; cursor: pointer; }
.bereich-reiter .chip-zahl { margin-left: 8px; }
.bereich-reiter .chip.aktiv .chip-zahl { background: rgba(255, 255, 255, .25); color: #fff; }
/* 'ton' => 'rot'|'gelb' an einem Bereich: die Zahl trägt die Farben von .abzeichen-rot/-gelb (auch am aktiven Reiter) */
.bereich-reiter .chip .chip-zahl.zahl-rot { background: #fef2f2; color: #b91c1c; }
.bereich-reiter .chip .chip-zahl.zahl-gelb { background: #fffbeb; color: #b45309; }
/* Leiste der Einstellungsseiten (bereichs_reiter(…, false)) gibt es nur auf dem Handy — Regel im Abschnitt „Mobil: Fundament“ */
.bereich-reiter.bereich-reiter-mobil { display: none; }
/* Handy: kein Querscrollen mehr — die Pillen brechen um (Grundregel flex-wrap); ab fünf Bereichen
   ersetzt eine Auswahlliste die Leiste (assets/leiste.js reiterWahl, Abschnitt „Mobil: Fundament“) */

/* ===== 4d CRM: Thema wählen (Chips als Optionsfelder), Eintragszeilen =========== */
.filter-chips.thema-wahl { align-items: center; }
.thema-wahl .chip { position: relative; cursor: pointer; height: 38px; line-height: 1; box-sizing: border-box; padding: 0 16px; font-weight: 600; margin: 0; }
.thema-wahl .chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.thema-wahl .chip:focus-within { outline: 2px solid var(--signal); outline-offset: 2px; }
.crm-eintrag-zeile .liste-titel a { font-weight: 500; }
/* Einheitliche Reihenfolge in Verlaufs-Zeilen: Meta (Art, Datum, Personen) OBEN, Text darunter */
.eintrag-meta { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.eintrag-text a { font-weight: 500; color: var(--text); }

/* ===== 4e Immobilien: Zähler nach Objekt/Mieter, Verlauf eingeklappt, Bild im Überblick ===== */
.zaehler-gruppen { margin-bottom: 12px; }
.zaehler-gruppen .chip { cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-objektbild-klein { max-width: 420px; margin-bottom: var(--formular-abstand); }
.im-objektbild-klein img { max-height: 200px; width: auto; border-radius: 12px; }
.ticket-filter { margin-bottom: 12px; }
.ticket-filter .chip { cursor: pointer; }

/* ===== 4c Filterleiste: Statuspillen links, „Filter“ rechts, Felder klappen auf ============= */
.such-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.such-kopf-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
.such-kopf-links .filter-chips { margin: 0; }
.such-kopf-rechts { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.filter-knopf { gap: 8px; }
.filter-knopf.aktiv { border-color: var(--signal); color: var(--signal); }
.filter-zahl { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--signal); color: #fff; font-size: 11.5px; font-weight: 600; }
.such-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rand); }
/* Felder als Raster mit Beschriftung darüber — alle gleich hoch, alle bündig */
.such-felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--formular-abstand) 16px; align-items: end; }
.such-felder > label { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; align-content: flex-end; gap: var(--beschriftung-abstand) 6px; min-width: 0; margin: 0; }
.such-felder > label > input, .such-felder > label > select, .such-felder > label > .feld-hilfe { flex: 0 0 100%; margin-top: 0; }
.such-felder > label > input, .such-felder > label > select { width: 100%; max-width: none; min-width: 0; height: var(--feld-hoehe); }
.such-felder > label.kontrollkaestchen { flex-wrap: nowrap; align-content: center; gap: 10px; min-height: var(--feld-hoehe); }
.such-felder > label.kontrollkaestchen > input { flex: none; width: auto; }
.such-felder > label > input[type="search"] { flex: none; }
.such-felder > .klein { align-self: center; }
.such-aktionen { margin-top: var(--formular-abstand); }
/* Knopflinie (ui-richtlinien 3a): „Filtern“/„Zurücksetzen“ stehen rechts neben den Feldern, unten bündig mit der letzten
   Feldzeile (Mitte = Mitte der Eingabefelder) — nicht mehr in eigener Zeile darunter, wo daneben Platz frei blieb.
   assets/leiste.js setzt .such-form-linie nur, wenn das Formular außer Feldern und Knöpfen nichts enthält.
   Handy: Felder volle Breite, Knöpfe darunter über die volle Breite. */
.such-panel .such-form.such-form-linie { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: var(--formular-abstand) 16px; }
.such-form-linie > .such-felder { flex: 1 1 420px; min-width: 0; }
.such-form-linie > .such-aktionen { flex: 0 0 auto; flex-wrap: nowrap; margin-top: 0; }
@media (max-width: 767px) { .such-form-linie > .such-felder { flex-basis: 100%; } .such-form-linie > .such-aktionen { flex: 1 1 100%; } }
.such-panel .such-gemerkt { border-top: 0; padding-top: 0; }
/* Suchbegriffe als eigene Chips in der Kopfzeile — jeder einzeln entfernbar */
.q-chips { margin: 0; }
.q-chip { display: inline-flex; align-items: center; gap: 6px; }
.q-chip button { border: 0; background: none; color: inherit; font: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; opacity: .75; }
.q-chip button:hover { opacity: 1; }
@media (max-width: 767px) { .such-felder { grid-template-columns: 1fr; } .such-kopf-rechts { width: 100%; } .such-kopf-rechts .filter-knopf { width: 100%; justify-content: center; } }

/* ===== 4c-alt Suchleiste ohne Skript ============= */

.such-karte { margin-bottom: var(--formular-abstand); }
.such-karte[data-leiste] { background: none; border: 0; box-shadow: none; padding: 0; margin-bottom: var(--karte-abstand); }
.such-karte[data-leiste] .such-panel { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius-karte); box-shadow: var(--schatten); padding: var(--karte-innen); margin-top: 12px; }
/* Manche Seiten tragen beide Klassen am selben <form> (Zeile ohne eigenen Wrapper) — dann gilt Zeile. */
.such-form:not(.such-zeile) { display: flex; flex-direction: column; gap: 12px; }
.such-zeile { display: flex; flex-direction: row; gap: 12px; align-items: center; flex-wrap: wrap; }
/* Das Suchfeld nimmt die ganze restliche Zeile — Filter und Knöpfe stehen daneben, nicht darunter */
.such-zeile > input[type="search"], .such-zeile > label:has(> input[type="search"]) { flex: 1 1 260px; min-width: 0; max-width: none; }
.such-zeile > input[type="search"] { height: var(--feld-hoehe); }
.such-zeile > label:has(> input[type="search"]) > input[type="search"] { width: 100%; max-width: none; }
.such-zeile > select, .such-zeile > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { height: var(--feld-hoehe); flex: 0 1 auto; }
.such-zeile > label:not(.kontrollkaestchen) { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.such-gemerkt { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rand); }
.such-gemerkt > .klein { color: var(--text-schwach); margin-right: 2px; }
.such-chip { display: inline-flex; align-items: center; height: 32px; padding: 0 4px 0 13px; gap: 2px; border: 1px solid var(--rand); border-radius: 999px; background: var(--flaeche-still); font-size: 13px; }
.such-chip a { color: var(--text-2); text-decoration: none; }
.such-chip.aktiv { background: var(--signal); border-color: var(--signal); }
.such-chip.aktiv a { color: #fff; }
.such-chip form { display: inline-flex; }
.such-chip button { background: none; border: 0; padding: 0 8px; height: 30px; line-height: 1; font-size: 16px; color: var(--text-still); cursor: pointer; border-radius: 999px; }
.such-chip.aktiv button { color: #fff; }
.such-chip button:hover { color: var(--gefahr); }

/* Kopfbereich einer Listenseite: Suche links, Kennzahlen rechts daneben — statt beides
   untereinander über die volle Breite. Unter 1100 px wieder gestapelt. */
.kopf-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--formular-abstand); align-items: start; }
@media (min-width: 1100px) {
  .kopf-raster { grid-template-columns: minmax(320px, 5fr) minmax(0, 7fr); }
  .kopf-raster > * { margin-bottom: 0; }
  .kopf-raster .stat-karten { margin-bottom: 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
/* Zwei Karten nebeneinander (Überblick: „Was ansteht“ und „Module“) */
.paar-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--formular-abstand); align-items: start; margin-bottom: var(--karte-abstand); }
/* Ein Bereich (bereichs_reiter) hält denselben Abstand wie eine Karte zum nächsten */
section[data-bereich] { margin-bottom: var(--karte-abstand); }
@media (min-width: 1000px) { .paar-raster { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } .paar-raster > .karte { margin-bottom: 0; } }

/* ===== 5 Dashboard: Kennzahlen ========================================== */
/* Kacheln füllen immer die volle Breite (auto-fit), nie Leerraum rechts */
/* Kennzahl-Kacheln liegen quer: Symbol links, Bezeichnung und Zahl rechts daneben. Hochkant mit
   großem Kreis und 30-px-Zahl nahmen sie auf jeder Seite ein Viertel der Höhe ein. */
.stat-karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0 0 var(--karte-abstand); }
.stat-karte { position: relative; background: #fff; border: 1px solid var(--rand); border-radius: 12px; box-shadow: var(--schatten); padding: 12px 14px; min-width: 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon label" "icon wert" "zusatz zusatz"; column-gap: 12px; align-content: center;
  color: inherit; font-weight: 400; transition: box-shadow .15s, transform .15s; }
a.stat-karte:hover { color: inherit; text-decoration: none; box-shadow: 0 6px 16px rgba(0, 0, 0, .07); transform: translateY(-1px); }
.stat-icon { grid-area: icon; align-self: center; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--flaeche-aktiv); color: var(--signal); flex-shrink: 0; }
.stat-icon svg { width: 17px; height: 17px; }
/* Nur noch ein Warnzeichen bei Gelb/Rot — Pfeil und Strich waren reine Zierde */
.stat-hinweis { position: absolute; top: 10px; right: 10px; color: var(--text-still); display: inline-flex; }
.stat-hinweis svg { width: 15px; height: 15px; }
.stat-label { grid-area: label; align-self: end; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-schwach); line-height: 1.25; max-width: 100%; }
.stat-wert { grid-area: wert; align-self: start; margin-top: 2px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; color: var(--text); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat-wert small { font-size: 12px; font-weight: 400; color: var(--text-schwach); }
.stat-wert.gruen { color: #047857; }
.stat-wert.gelb { color: #b45309; }
.stat-wert.rot { color: #b91c1c; }
.stat-zusatz { grid-area: zusatz; margin-top: 6px; font-size: 12.5px; color: var(--text-2); line-height: 1.35; max-width: 100%; min-width: 0; display: block; overflow: hidden; text-overflow: ellipsis; }
.stat-zusatz:empty { display: none; }
.stat-zusatz .klein { font-size: 12.5px; color: var(--text-2); }
.stat-zusatz .abzeichen { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 1.5; vertical-align: middle; }
/* Farbtöne: die ganze Kachel nimmt die Bedeutung an (grün = gut/Einnahme, gelb = Achtung, rot = Handlungsbedarf, blau = Information) */
/* Ruhige Kacheln: die Fläche bleibt weiß, nur Icon und Zahl tragen die Bedeutung —
   getönte Flächen machten jede Übersicht zum Flickenteppich. */
.stat-karte.ton-gruen .stat-icon { background: #dcfce7; color: #15803d; }
.stat-karte.ton-gelb .stat-icon { background: #fef3c7; color: #b45309; }
.stat-karte.ton-gelb .stat-hinweis { color: #b45309; }
.stat-karte.ton-rot .stat-icon { background: #fee2e2; color: #b91c1c; }
.stat-karte.ton-rot .stat-hinweis { color: #b91c1c; }
/* Dienstplan heute (Übersicht) */
.dienst-heute { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.dienst-heute-eintrag { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--rand); border-radius: 10px; background: #fff; }
.dienst-heute-eintrag b { font-family: var(--schrift-mono); font-size: 12px; background: #eff6ff; color: var(--signal); border-radius: 6px; padding: 4px 6px; white-space: nowrap; }
.dienst-heute-eintrag span { display: flex; flex-direction: column; font-weight: 600; font-size: 14px; min-width: 0; white-space: normal; }
.dienst-heute-eintrag small { font-weight: 400; color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dienst-heute-eintrag.wichtig { border-color: #fde68a; background: #fffbeb; }

/* ===== 5 Dashboard: eine Sektion je Modul, 6-Spalten-Raster ============== */
.dash-reiter { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 var(--karte-abstand); padding: 6px; background: #fff; border: 1px solid var(--rand); border-radius: 14px; box-shadow: var(--schatten);
  position: sticky; top: 64px; z-index: 5; }
.dash-reiter-knopf { display: inline-flex; align-items: center; gap: 8px; height: var(--knopf-hoehe); padding: 0 16px; border: 0; border-radius: 10px; background: none; color: var(--text-schwach);
  font: inherit; font-weight: 600; cursor: pointer; }
.dash-reiter-knopf svg { width: 16px; height: 16px; }
.dash-reiter-knopf:hover { background: var(--flaeche-still); color: var(--text); }
.dash-reiter-knopf.aktiv { background: var(--signal); color: #fff; }
.dash-modul { margin: 0 0 36px; }
.dash-modul-kopf { display: flex; align-items: center; gap: 14px; margin: 0 0 var(--formular-abstand); flex-wrap: wrap; }
.dash-modul-kopf h2 { margin: 0; font-size: 20px; }
.dash-modul-titel { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 200px; }
.dash-modul-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--flaeche-aktiv); color: var(--signal); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-modul-icon svg { width: 20px; height: 20px; }
.dash-modul-icon.klein { width: 28px; height: 28px; border-radius: 8px; }
.dash-modul-icon.klein svg { width: 15px; height: 15px; }
.dash-kacheln { margin-bottom: var(--formular-abstand); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.dash-raster { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--formular-abstand); align-items: start; }
.dash-raster > .karte { margin: 0; min-width: 0; }
.dash-b-voll { grid-column: span 6; }
.dash-b-zweidrittel { grid-column: span 4; }
.dash-b-halb { grid-column: span 3; }
.dash-b-drittel { grid-column: span 2; }
.dash-block .karte-kopfzeile { margin-bottom: 12px; }
.dash-block .karte-kopfzeile h2 { font-size: 15px; }
.dash-zeile { padding: 10px 0; min-height: 0; }
.dash-zeile .liste-titel { font-size: 14px; }
.dash-wert { font-weight: 600; white-space: nowrap; }
.dash-fuss { margin: 12px 0 0; }
/* Material am Ticket: Zeilen im Aufklapper behalten ihren Abstand zur Trennlinie (der Aufklapper setzt sonst padding: 0) */
.anlegen-akkordeon > .liste-zeile.ticket-mat-zeile { padding: 10px 0; }
.dash-aktionen { justify-content: flex-start; }
/* Der Reiter zeigt immer genau einen Bereich; im Modulkopf wäre „Details“ deshalb ein Knopf
   auf die Seite, auf der man schon steht. Im Überblick führt derselbe Knopf zum Modul-Reiter. */
.dash-modul-kopf .dash-details { display: none; }
.dash-schnellstart { margin: 0 0 var(--formular-abstand); }
/* Übersicht anpassen: Schublade rechts, ausgeblendete Module */
.dash-anpassen-knopf { margin-left: auto; }
.dash-anpassen { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 60; display: flex; justify-content: flex-end; }
.dash-anpassen-innen { width: min(420px, 100%); height: 100%; overflow: auto; background: var(--flaeche); padding: var(--karte-innen); box-shadow: -8px 0 24px rgba(0, 0, 0, .12); display: flex; flex-direction: column; gap: 16px; }
.dash-anpassen-innen > .karte-kopfzeile { margin: 0; padding: 0 0 12px; }
.dash-anpassen-liste { display: flex; flex-direction: column; gap: 10px; }
.dash-anpassen-eintrag { padding: 10px 12px; border: 1px solid var(--rand); border-radius: 10px; background: var(--container); }
.dash-ausgeblendet { display: none !important; }
/* Diagramm-Kopf: große Kennzahl links, Vergleichswerte rechts */
.dia-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 18px; }
.dia-haupt { display: flex; flex-direction: column; gap: 4px; }
.dia-haupt b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--text); }
.dia-werte { display: flex; gap: 10px; flex-wrap: wrap; }
.dia-wert { background: var(--container); border-radius: 12px; padding: 12px 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 130px; }
.dia-wert span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-schwach); }
.dia-wert span i { width: 8px; height: 8px; border-radius: 50%; }
.dia-wert b { font-size: 20px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
/* Balkendiagramm (SVG), Ring, Verteilung, waagerechte Balken */
.balken-diagramm { width: 100%; max-width: none; height: auto; display: block; margin: 0; font-family: var(--schrift); }
.ring-block { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ring-block .ring { width: 140px; height: 140px; flex-shrink: 0; }
.ring-figur { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.ring-text { font-size: 12px; color: var(--text-schwach); white-space: nowrap; }
.diagramm-legende { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 160px; }
.diagramm-legende li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.diagramm-legende i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.diagramm-legende span { flex: 1; min-width: 0; color: var(--text-schwach); }
.diagramm-legende b { font-variant-numeric: tabular-nums; }
.verteilung-balken { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #eef2f7; margin: 6px 0 14px; }
.verteilung-balken span { display: block; height: 100%; }
.hbalken { display: flex; flex-direction: column; gap: 10px; }
.hbalken-zeile { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.hbalken-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbalken-spur { height: 10px; border-radius: 5px; background: #eef2f7; overflow: hidden; }
.hbalken-wert { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--signal), #60a5fa); min-width: 4px; }
.hbalken-zahl { white-space: nowrap; }
/* Persönliche Seitenanordnung: Karten am Titel ziehen */
.layout-griff { cursor: grab; position: relative; }
.layout-griff::after { content: '⋮⋮'; position: absolute; right: var(--karte-innen); top: 50%; transform: translateY(-50%); font-size: 14px; letter-spacing: -2px; color: #d1d5db; opacity: 0; transition: opacity .15s; }
.karte-kopfzeile.layout-griff::after { right: auto; left: 4px; }
.layout-griff:hover::after { opacity: 1; }
.karte.layout-ziehen { opacity: .45; }
.karte.layout-ziel { outline: 2px dashed var(--signal); outline-offset: 4px; }
body.layout-aktiv .spalten > div:empty, body.layout-aktiv .spalten > .spalte-seite:empty { min-height: 120px; border: 2px dashed var(--rand-stark); border-radius: 12px; }
.layout-hinweis { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 12px; background: #111827; color: #fff; padding: 10px 12px 10px 16px; border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .25); font-size: 13.5px; }
.layout-hinweis .knopf { height: 32px; padding: 0 12px; font-size: 13px; background: #fff; }

/* ===== 6 Login / Auth-Bühne (Anmelden, Registrieren, Passwort, Installation) ===== */
body.schlicht { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 32px 16px; background: #0b1220;
  background-image: radial-gradient(900px 500px at 15% 0%, rgba(37, 99, 235, .25), transparent 60%), radial-gradient(700px 400px at 100% 100%, rgba(13, 148, 136, .18), transparent 60%); }
.schlicht-marke { display: none; }
.schlicht-box { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius-karte); padding: 32px 30px 26px; width: 100%; max-width: 420px; }
.schlicht-box .knopf { width: 100%; }
.schlicht-links { margin-top: 12px; font-size: 13px; display: flex; justify-content: space-between; }
.schlicht-links a { color: var(--text-2); font-weight: 400; }
.schlicht-links a:hover { color: var(--signal); }
.schlicht-fuss { margin: 18px -30px -26px; padding: 12px 30px; background: var(--container); border-top: 1px solid var(--rand); border-radius: 0 0 var(--radius-karte) var(--radius-karte); font-size: 12px; color: var(--text-schwach); }
.auth-buehne { display: grid; grid-template-columns: 420px minmax(0, 1fr); width: 100%; max-width: 1080px; min-height: 620px; background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .06); }
.auth-seite { background: linear-gradient(160deg, #111827 0%, #0f172a 60%, #111827 100%); color: #e5e7eb; padding: 56px 48px; display: flex; flex-direction: column; gap: 32px; position: relative; }
.auth-seite::after { content: ''; position: absolute; inset: auto -60px -80px auto; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(37, 99, 235, .35), transparent 70%); pointer-events: none; }
.auth-marke .marke-badge { width: 72px; height: 72px; font-size: 34px; border-radius: 20px; background: var(--signal); color: #fff; font-weight: 800; box-shadow: 0 12px 30px rgba(37, 99, 235, .45); }
.auth-logo { max-height: 72px; max-width: 240px; object-fit: contain; }
.auth-name { font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: #fff; margin-top: 22px; line-height: 1.1; }
.auth-untertitel { color: #9ca3af; font-size: 16px; margin-top: 4px; }
.auth-strich { display: block; width: 88px; height: 4px; border-radius: 2px; background: var(--signal); margin-top: 18px; }
.auth-produkte { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-produkte li { display: flex; align-items: center; gap: 14px; font-size: 16px; color: #e5e7eb; }
.auth-produkte li svg { width: 24px; height: 24px; stroke: #60a5fa; flex-shrink: 0; }
.auth-produkte li span { display: flex; flex-direction: column; line-height: 1.2; }
.auth-produkte li small { font-size: 12px; color: #9ca3af; }
.auth-claim { margin-top: auto; font-size: 13px; color: #9ca3af; line-height: 1.5; }
.auth-formular.schlicht-box { border: 0; border-radius: 0; box-shadow: none; padding: 64px 72px; max-width: none; width: auto; display: flex; flex-direction: column; justify-content: center; background: #fff; }
.auth-formular h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 0 0 8px; }
.auth-hinweis { color: var(--text-2); font-size: 16px; margin: 0 0 28px; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-form > * { margin-top: 0; }
.auth-feld { display: block; font-size: 15px; font-weight: 500; color: var(--text); }
.auth-feld > span { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 500; color: var(--text); }
.auth-eingabe { display: flex; align-items: stretch; height: 56px; margin-top: 0; border: 1px solid var(--rand); border-radius: 12px; overflow: hidden; background: #fff; transition: box-shadow .15s, border-color .15s; }
.auth-eingabe:focus-within { border-color: var(--signal); box-shadow: 0 0 0 4px var(--fokus-ring); }
.auth-eingabe > i { display: flex; align-items: center; justify-content: center; width: 64px; background: #f9fafb; border-right: 1px solid var(--rand); flex-shrink: 0; }
.auth-eingabe > i svg { width: 20px; height: 20px; stroke: #6b7280; }
.auth-eingabe input { flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0 18px; font-size: 17px; border: 0; border-radius: 0; box-shadow: none; background: #fff; }
/* Auswahl im Anmelde-Layout (Registrierung: Bundesland) — wie das Eingabefeld, der Pfeil der Grundregel bleibt (nur background-color) */
.auth-eingabe select { flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0 36px 0 18px; font-size: 17px; border: 0; border-radius: 0; box-shadow: none; background-color: #fff; }
.auth-eingabe input:focus, .auth-eingabe select:focus { outline: none; border-color: transparent; box-shadow: none; }
.captcha-hilfe { display: block; font-size: 12.5px; font-weight: 400; color: var(--text-schwach); margin-top: 2px; }
.captcha-rechnen > b { display: flex; align-items: center; padding: 0 18px; background: var(--flaeche-aktiv); color: var(--signal); font-size: 20px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; border-right: 1px solid var(--rand); font-variant-numeric: tabular-nums; }
.captcha-zeile { display: flex; gap: 0; align-items: stretch; flex-wrap: nowrap; margin: 0; }
.captcha-bild { display: flex; align-items: center; background: #f9fafb; border-right: 1px solid var(--rand); flex-shrink: 0; }
.captcha-bild img { display: block; height: 54px; width: auto; border: 0; border-radius: 0; }
.captcha-zeile input { text-transform: uppercase; letter-spacing: 4px; font-weight: 600; font-family: 'JetBrains Mono', Menlo, Consolas, monospace; min-width: 90px; }
.captcha-zeile input::placeholder { letter-spacing: 0; font-weight: 400; font-family: inherit; text-transform: none; }
.captcha-neu { display: flex; align-items: center; justify-content: center; border: 0; border-right: 1px solid var(--rand); background: #fff; width: 48px; cursor: pointer; color: var(--text-2); flex-shrink: 0; transition: color .15s, background .15s; }
.captcha-neu svg { width: 18px; height: 18px; transition: transform .3s; }
.captcha-neu:hover { color: var(--signal); background: var(--flaeche-aktiv); }
.captcha-neu:hover svg { transform: rotate(180deg); }
@media (max-width: 600px) { .captcha-bild img { height: 54px; } .auth-eingabe.captcha-zeile > i { display: none; } }
.knopf.auth-knopf { width: 100%; height: 56px; font-size: 18px; border-radius: 12px; margin-top: 6px; gap: 10px; box-shadow: 0 10px 24px rgba(37, 99, 235, .35); }
.knopf.auth-knopf svg { width: 20px; height: 20px; stroke: #fff; }
.auth-formular .schlicht-links { justify-content: center; gap: 24px; margin-top: 22px; font-size: 15px; flex-wrap: wrap; }
.auth-formular .schlicht-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.auth-formular .schlicht-links a svg { width: 16px; height: 16px; stroke: currentColor; }
/* Fuß „Bereits ein Konto? Anmelden“ (registrieren.php): in der Anmelde-Bühne eine Zeile wie die Links der Anmeldung — das graue Band
   der schlichten Box rechnete mit 30 px Innenabstand und ragte bei 390 px 6 px über die Karte, am Desktop schwebte es darin */
.auth-formular .schlicht-fuss { margin: 22px 0 0; padding: 0; background: none; border: 0; border-radius: 0; text-align: center; font-size: 15px; color: var(--text-2); }
.auth-formular .meldung { margin-bottom: 18px; }
.auth-formular .feld input, .auth-formular label > input { width: 100%; height: 52px; font-size: 16px; border-radius: 12px; }
.auth-fuss { margin-top: 22px; color: #9ca3af; font-size: 14px; text-align: center; }
.auth-fuss a { color: #d1d5db; text-decoration: underline; font-weight: 400; }
/* Konto-Profil-Auswahl (Registrierung, Personen) */
.profil-wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.profil-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--rand); border-radius: 10px; cursor: pointer; margin: 0; background: #fff; }
.profil-option:has(input:checked), .profil-option.aktiv { border-color: var(--signal); background: var(--flaeche-aktiv); box-shadow: 0 0 0 3px var(--fokus-ring); }
.profil-option > input[type=radio], .profil-option > input[type=checkbox] { width: 18px; height: 18px; flex: 0 0 18px; margin: 2px 0 0; accent-color: var(--signal); }
.profil-option > span { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; }
.profil-option b { font-size: 14px; }
.profil-option small { font-size: 12.5px; color: var(--text-schwach); font-weight: 400; line-height: 1.35; }
/* Zugangsprofil (Paket Z4): Modul-Haken unter der Profilwahl, eingeklappter Wechsel der Art, „Sie dürfen“ unter Mein Konto */
.profil-module { margin-top: 14px; }
.profil-module-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.profil-schnellwahl { display: inline-flex; align-items: center; gap: 8px; }
.profil-schnellwahl > .knopf { margin-top: 0; } /* sonst schiebt „.klein + .knopf“ den Knopf unter die Mittellinie der Beschriftung */
.profil-module .dl-kategorien-wahl { margin-top: 8px; }
details.profil-andere { margin-top: 10px; border: 1px solid var(--rand); border-radius: 10px; }
.konto-darf-titel { margin: 12px 0 4px; font-weight: 600; font-size: 14px; }
.konto-darf { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.konto-darf li { overflow-wrap: anywhere; }
/* Logos (Organisation, Plattform) */
.org-logo { max-height: 72px; max-width: 220px; object-fit: contain; background: #fff; border: 1px solid var(--rand); border-radius: 10px; padding: 8px; }
.logo-zeile { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.logo-zeile > div { flex: 1; min-width: 260px; }

/* ===== 6 Signage: Bildschirme, Koppelcode ================================= */
.code-boxen { display: flex; gap: 6px; margin: 8px 0; }
.code-boxen span { flex: 1; aspect-ratio: .82; display: flex; align-items: center; justify-content: center; border: 1px solid var(--rand-stark); border-radius: var(--radius); background: var(--container);
  font-family: var(--schrift-mono); font-size: 22px; font-weight: 700; }
.player-adresse { font-family: var(--schrift-mono); font-size: 12.5px; background: var(--flaeche-still); border: 1px solid var(--rand); border-radius: var(--radius); padding: 8px 10px; word-break: break-all; }
.bildschirm-akkordeon { max-width: none; margin: 8px 16px 14px; border: 1px solid var(--rand); border-radius: 12px; background: #fff; }
.bildschirm-akkordeon > summary { padding: 14px 20px; font-weight: 600; }
.bildschirm-akkordeon > :not(summary) { padding: 0 20px; margin: 0; }
.bildschirm-akkordeon > form { padding: 20px 20px 22px; }
.bildschirm-akkordeon > .liste-zeile { padding: 14px 20px; border-top: 1px solid var(--rand-weich); }
.bildschirm-akkordeon > .akkordeon-abschnitt { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-still); padding: 14px 20px 6px; border-top: 1px solid var(--rand); }
.bildschirm-akkordeon > .akkordeon-fuss { border-top: 1px solid var(--rand); padding: 14px 20px 16px; margin-top: 10px; }
/* Bildschirm anlegen und Einstellungen (ein Formular: signage_bildschirm_felder, module/signage/formulare.php): Ausrichtung unter
   der Beschriftung (Segmentknöpfe 36 px wie überall, am Handy Feldhöhe); Wetter-Suche (Feld, „Suchen“, Stand) in einer Zeile */
.sig-bildschirm-form .zeilen-formular > label > .segment { flex: 0 0 100%; }
.sig-bildschirm-form .aktionen-zeile { flex-wrap: nowrap; }
.sig-bildschirm-form .aktionen-zeile input[type=text] { flex: 1; min-width: 180px; }

/* ===== 6 Signage: Slides (Liste, Felder, Vorschau, Medien-Picker) ======== */
.slide-zeile { display: flex; gap: 16px; align-items: flex-start; }
.slide-zeile .slide-vorschau { width: 152px; flex-shrink: 0; border: 1px solid var(--rand); }
.slide-zeile .slide-vorschau.hochkant { width: 95px; }
.slide-info { flex: 1; min-width: 0; }
.slide-info > * + * { margin-top: 12px; }
.slide-karte-drag { cursor: grab; }
.slide-karte-drag.zieht { opacity: .45; cursor: grabbing; }
.typ-felder > * + *, .widget-option + .widget-option { margin-top: var(--formular-abstand); }
.typ-felder { margin-top: var(--formular-abstand); }
.medien-picker { max-width: 640px; }
.medien-picker-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; max-height: 280px; overflow-y: auto; padding: 8px; background: #fff; border: 1px solid var(--rand-stark); border-radius: var(--radius); }
.medien-wahl { position: relative; cursor: pointer; display: block; margin: 0; font-weight: 400; }
.medien-wahl input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.medien-wahl img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-radius: 6px; border: 2px solid transparent; background: #12161f; }
.medien-wahl input:checked + img { border-color: var(--signal); box-shadow: 0 0 0 2px var(--fokus-ring); }
.medien-wahl input:checked ~ .klein { color: var(--signal); font-weight: 600; }
.medien-wahl .klein { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.medien-wahl:hover img { border-color: var(--rand-stark); }
.medien-picker .filter-leiste { margin-bottom: 8px; }
/* Slide-Vorschau: TV-Optik, bleibt dunkel (spiegelt player.php) */
.slide-vorschau { container-type: size; aspect-ratio: 16 / 9; width: 100%; position: relative; overflow: hidden; background: #0b0f14; color: #e8edf2; border-radius: 0; font-family: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.slide-vorschau.hochkant { aspect-ratio: 9 / 16; }
.slide-vorschau .v-bild { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.slide-vorschau .v-mitte { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4cqh; text-align: center; padding: 6cqh; }
.slide-vorschau .v-titel { font-size: 11cqh; font-weight: 700; line-height: 1.15; }
.slide-vorschau .v-dringend .v-titel { color: #ff5252; }
.slide-vorschau .v-text { font-size: 6.5cqh; color: #c8d3de; line-height: 1.3; white-space: pre-wrap; overflow: hidden; max-height: 40cqh; }
.slide-vorschau .v-uhr { font-size: 22cqh; font-weight: 700; font-variant-numeric: tabular-nums; }
.slide-vorschau .v-raster { position: absolute; inset: 0; display: grid; gap: 3cqh; padding: 4cqh; }
.slide-vorschau .v-raster-1 { grid-template-columns: 1fr; }
.slide-vorschau .v-raster-2 { grid-template-columns: 1fr 1fr; }
.slide-vorschau .v-raster-3 { grid-template-columns: 1fr 1fr 1fr; }
.slide-vorschau .v-raster-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.slide-vorschau .v-kachel { background: #121a23; border: 1px solid #1f2a36; border-radius: 2cqh; display: flex; align-items: center; justify-content: center; font-size: 9cqh; font-weight: 700; }
.slide-vorschau .v-rss { position: absolute; inset: 0; padding: 6cqh 8cqh; }
.slide-vorschau .v-rss-kopf { font-size: 9cqh; font-weight: 700; margin-bottom: 5cqh; }
.slide-vorschau .v-rss-zeile { height: 6cqh; margin-bottom: 4cqh; border-radius: 1cqh; background: #1f2a36; }
.slide-vorschau .v-rss-zeile:nth-child(3) { width: 80%; }
.slide-vorschau .v-rss-zeile:nth-child(4) { width: 62%; }
.slide-vorschau .v-wboard { position: absolute; inset: 0; display: flex; background: linear-gradient(160deg, #2b74bd, #0b2a52); }
.slide-vorschau .v-wb-links { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 8cqh; gap: 2cqh; }
.slide-vorschau .v-wb-tag { font-size: 8cqh; }
.slide-vorschau .v-wb-temp { font-size: 26cqh; font-weight: 200; line-height: 1; }
.slide-vorschau .v-wb-rechts { width: 38%; background: rgba(8, 14, 22, .55); display: flex; flex-direction: column; gap: 4cqh; padding: 6cqh; justify-content: center; }
.slide-vorschau .v-wb-box { background: rgba(255, 255, 255, .12); border-radius: 2cqh; padding: 4cqh; text-align: center; font-size: 8cqh; font-weight: 700; }
.slide-vorschau .v-wb-box.v-wb-klein { font-size: 5cqh; font-weight: 400; }
.slide-vorschau .v-wb-tage { display: flex; gap: 2cqh; }
.slide-vorschau .v-wb-tage span { flex: 1; background: rgba(255, 255, 255, .12); border-radius: 2cqh; text-align: center; font-size: 4.5cqh; padding: 2.5cqh 0; }

/* ===== 6 Signage: Gestalter (.gestalter*) ================================ */
.gestalter { display: grid; grid-template-columns: 92px minmax(0, 1fr) 344px; gap: 0; align-items: stretch; margin: 0 calc(-1 * var(--inhalt-innen)); border-top: 1px solid var(--rand); min-height: 560px; }
.gestalter-werkzeuge { border-right: 1px solid var(--rand); background: var(--flaeche-leiste); display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 10px; }
.werkzeug { width: 64px; height: 60px; border: 1px solid var(--rand-stark); border-radius: 10px; background: #fff; color: var(--text-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-size: 19px; }
.werkzeug:hover { background: var(--flaeche-still); color: var(--text); }
.werkzeug:active { transform: scale(.94); }
.werkzeug.aktiv { background: var(--signal); border-color: var(--signal); color: #fff; }
.werkzeug .label { font-size: 9px; font-weight: 600; letter-spacing: .06em; }
.werkzeug:focus-visible, .zoom-knopf:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.gestalter-mitte { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; padding: 18px; overflow: auto; background: #e5e7eb; min-width: 0; }
.gestalter-canvas { width: 100%; max-width: none; margin: 0 auto; flex-shrink: 0; border: 1px solid #d1d5db; box-shadow: 0 14px 40px rgba(17, 24, 39, .22); user-select: none; touch-action: none; }
.gestalter-canvas.hochkant { aspect-ratio: 9 / 16; max-width: none; margin: 0 auto; }
.gestalter-canvas.mit-raster::after { content: ''; position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background-image: linear-gradient(to right, rgba(255, 255, 255, .12) 1px, transparent 1px), linear-gradient(to bottom, rgba(255, 255, 255, .12) 1px, transparent 1px); background-size: 5% 5%; }
.g-el { position: absolute; cursor: move; }
.g-el.g-aktiv { outline: 2px dashed var(--signal); outline-offset: 1px; }
.g-griff { position: absolute; right: -8px; bottom: -8px; width: 16px; height: 16px; background: var(--signal); border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; }
.g-guide-v { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--signal); pointer-events: none; z-index: 6; }
.g-guide-h { position: absolute; left: 0; right: 0; height: 1px; background: var(--signal); pointer-events: none; z-index: 6; }
.zoom-leiste { display: flex; align-items: center; gap: 8px; margin: 0 auto 14px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 6px; padding: 6px 8px; }
.zoom-leiste .zoom-knopf { width: 34px; height: 34px; border: 1px solid var(--rand-stark); border-radius: 6px; background: var(--flaeche); cursor: pointer; font-size: 17px; line-height: 1; color: var(--text); display: flex; align-items: center; justify-content: center; }
.zoom-leiste .zoom-knopf:hover { background: var(--flaeche-still); }
.zoom-leiste .zoom-knopf.aktiv { background: var(--signal); color: #fff; border-color: var(--signal); }
.zoom-leiste .zoom-wert { font-size: 12.5px; font-weight: 600; min-width: 52px; text-align: center; color: var(--text); font-variant-numeric: tabular-nums; }
.gestalter-rechts { border-left: 1px solid var(--rand); background: var(--flaeche); display: flex; flex-direction: column; overflow-y: auto; min-width: 0; }
.gestalter-rechts label { font-size: 13px; margin: 0; }
.gestalter-rechts input[type=color] { height: 38px; }
.inspektor-kopf { padding: 12px 16px; border-bottom: 1px solid var(--rand); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.inspektor-typ { margin-left: auto; font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--flaeche-aktiv); color: var(--signal); letter-spacing: 0; }
.inspektor-block { padding: 15px 16px; display: flex; flex-direction: column; gap: 13px; border-bottom: 1px solid var(--rand); }
.inspektor-bildwahl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; max-height: 240px; overflow: auto; padding-right: 2px; }
.ebenen-liste { margin: 0; border: 0; border-bottom: 1px solid var(--rand); border-radius: 0; }
.ebene-zeile { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-bottom: 1px solid var(--flaeche-still); background: #fff; }
.ebene-zeile.aktiv { background: var(--flaeche-aktiv); }
.ebene-nr { font-size: 11px; color: var(--text-still); width: 16px; font-variant-numeric: tabular-nums; }
.ebene-name { flex: 1; min-width: 0; cursor: pointer; font-size: 13.5px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ebene-typ { font-size: 9.5px; color: var(--text-still); text-transform: uppercase; letter-spacing: .04em; }
.ebene-knopf { border: 0; background: none; cursor: pointer; font-size: 11px; padding: 3px 4px; border-radius: 4px; color: var(--text-schwach); }
.ebene-knopf:hover { background: var(--flaeche-still); color: var(--text); }
.kontextmenu { position: fixed; z-index: 100; display: flex; flex-direction: column; min-width: 180px; background: #fff; border: 1px solid var(--rand-stark); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(17, 24, 39, .16); padding: 4px; }
.kontextmenu button { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 4px; font: 400 14px var(--schrift); color: var(--text); cursor: pointer; }
.kontextmenu button:hover { background: var(--flaeche-still); }
.kontextmenu button:last-child { color: var(--gefahr); }
.kontextmenu kbd { font-family: var(--schrift-mono); font-size: 10px; color: var(--text-still); }
@keyframes g-fade { from { opacity: 0; } }
@keyframes g-links { from { opacity: 0; margin-left: -6%; } }
@keyframes g-rechts { from { opacity: 0; margin-left: 6%; } }
@keyframes g-unten { from { opacity: 0; margin-top: 5%; } }
@keyframes g-zoom { from { opacity: 0; scale: .55; } }
@keyframes g-puls { 50% { opacity: .45; } }

/* ===== 6 Signage: Vorlagen-Galerie, Medien, Social ======================= */
.vorlagen-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--formular-abstand); }
.vorlage-karte { border: 1px solid var(--rand); border-radius: var(--radius-karte); overflow: hidden; background: var(--flaeche); display: flex; flex-direction: column; box-shadow: var(--schatten); transition: box-shadow .16s ease, translate .16s ease; min-width: 0; }
.vorlage-karte:hover { box-shadow: 0 10px 24px rgba(17, 24, 39, .10); translate: 0 -2px; }
.vorlage-bild { position: relative; padding: 0; border-bottom: 1px solid var(--rand); cursor: zoom-in; }
.vorlage-bild .slide-vorschau { border-radius: 0; box-shadow: none; }
.vorlage-anzahl { position: absolute; right: 8px; bottom: 8px; background: rgba(17, 24, 39, .8); color: #fff; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 4px; }
.vorlage-inhalt { padding: 12px 14px; flex: 1; }
.vorlage-inhalt .titel { font-weight: 600; font-size: 13.5px; }
.vorlage-fuss { padding: 12px 14px; border-top: 1px solid var(--rand); display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.vorlage-fuss .inline-formular { display: flex; flex-wrap: wrap; width: 100%; gap: 8px; }
.vorlage-fuss .inline-formular select { flex: 1 1 100%; width: 100%; min-width: 0; }
.vorlage-fuss .inline-formular .knopf { margin-left: auto; }
.farb-swatches { display: flex; gap: 5px; align-items: center; padding: 0 14px 10px; }
.farb-swatch { position: relative; margin: 0; }
.farb-swatch span { display: block; width: 18px; height: 18px; border-radius: 4px; cursor: pointer; border: 1px solid var(--rand-stark); }
.farb-swatch input:checked + span { box-shadow: 0 0 0 2px var(--signal); }
.farb-swatch input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.vorlage-bild .slide-vorschau.vorschau-hochkant { display: none; }
.vorlagen-raster.hochkant-modus .vorschau-quer { display: none; }
.vorlagen-raster.hochkant-modus .vorlage-bild, .vorlage-bild.hochkant-format { background: #0b0c0e; padding: 12px 0; }
.vorlagen-raster.hochkant-modus .vorschau-hochkant, .vorlage-bild.hochkant-format .slide-vorschau { display: block; width: 46%; margin: 0 auto; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.vorschau-modal { position: fixed; inset: 0; z-index: 300; background: rgba(17, 24, 39, .78); display: flex; align-items: center; justify-content: center; padding: 4vh 4vw; }
.vorschau-modal .modal-inhalt { width: min(1100px, 92vw); position: relative; }
.vorschau-modal .modal-inhalt.hochkant-format { width: min(44vh, 92vw); }
.vorschau-modal .modal-titel { color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.vorschau-modal .modal-schliessen { border: 1px solid rgba(255, 255, 255, .35); background: none; color: #fff; border-radius: 6px; width: 30px; height: 30px; cursor: pointer; font-size: 15px; line-height: 1; }
.vorschau-modal .modal-schliessen:hover { background: rgba(255, 255, 255, .12); }
.vorschau-modal .slide-vorschau { width: 100%; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); border-radius: 6px; }
.vorschau-modal .modal-hinweis { color: rgba(255, 255, 255, .55); font-size: 12px; text-align: center; margin-top: 10px; }
.medien-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--formular-abstand); }
.medien-karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius-karte); overflow: hidden; box-shadow: var(--schatten); transition: box-shadow .16s ease; min-width: 0; }
.medien-karte:hover { box-shadow: 0 6px 16px rgba(17, 24, 39, .08); }
.medien-karte img { width: 100%; height: 108px; object-fit: cover; display: block; background: #111827; border-bottom: 1px solid var(--rand); }
.medien-info { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.medien-info .inline-formular { margin-top: 4px; }
.social-vorschau { width: min(420px, 100%); aspect-ratio: 16 / 9; border-radius: 6px; background: #121a23; border: 1px solid #1f2a36; color: #e8edf2; position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px; text-align: center; padding: 14px; overflow: hidden; margin-bottom: 6px; font-family: Inter, -apple-system, "Segoe UI", sans-serif; }
.social-vorschau .sv-logo svg { width: 34px; height: 34px; display: block; }
.social-vorschau .sv-titel { font-size: 15px; font-weight: 700; }
.social-vorschau .sv-zahl { font-size: 32px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.social-vorschau .sv-label { font-size: 11px; color: #9fb0c0; }
.social-vorschau .sv-text { font-size: 12px; }
.social-vorschau .sv-handle { font-size: 11px; color: #6b7c8d; }
.social-vorschau .sv-qr { width: 52px; height: 52px; border-radius: 4px; background: #fff; padding: 3px; position: absolute; right: 12px; bottom: 12px; }
.social-vorschau.thema-hell { background: #f6f5f2; border-color: #dcd8d0; color: #17181a; }
.social-vorschau.thema-hell .sv-label { color: #6b6862; }
.social-vorschau.thema-hell .sv-handle { color: #8a877f; }
.social-vorschau.thema-marke.netz-facebook { background: #1877f2; border-color: #1877f2; color: #fff; }
.social-vorschau.thema-marke.netz-instagram { border-color: #c837ab; color: #fff; background: linear-gradient(135deg, #7b35c9, #c837ab 45%, #f15245 80%, #fed373); }
.social-vorschau.thema-marke .sv-label, .social-vorschau.thema-marke .sv-handle, .social-vorschau.thema-marke .sv-text { color: rgba(255, 255, 255, .85); }
.meta-verbinden-zeile { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }
.knopf.meta-verbinden { background: #1877f2; border-color: #1877f2; color: #fff; }
.knopf.meta-verbinden:hover { background: #1465cf; border-color: #1465cf; }
.knopf.meta-verbinden .meta-logo { display: inline-flex; width: 17px; height: 17px; border-radius: 3px; overflow: hidden; }
.knopf.meta-verbinden .meta-logo svg { width: 100%; height: 100%; }

/* ===== 6 Pakete: Preistabelle und Paket-Karten (.paket-*) ================ */
.preistabelle-umbruch { overflow-x: auto; }
.preistabelle { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.preistabelle th, .preistabelle td { padding: 12px 16px; border-bottom: 1px solid var(--rand); text-align: center; vertical-align: middle; }
.preistabelle th:first-child, .preistabelle td:first-child { text-align: left; font-weight: 500; color: var(--text-2); width: 220px; }
.preistabelle thead th { border-bottom: 2px solid var(--rand); vertical-align: top; padding: 18px 16px; }
.preistabelle th.kombi { background: var(--flaeche-aktiv); }
.preistabelle .paket-art { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-schwach); margin-bottom: 4px; }
.preistabelle th.kombi .paket-art { color: var(--signal); }
.preistabelle .paket-name { font-size: 17px; font-weight: 700; color: var(--text); }
.preistabelle .paket-preis { font-size: 26px; font-weight: 800; color: var(--signal); margin-top: 6px; letter-spacing: -.02em; }
.preistabelle .paket-preis small { font-size: 13px; font-weight: 500; color: var(--text-2); }
.preistabelle .paket-text { font-size: 12.5px; color: var(--text-2); font-weight: 400; margin-top: 6px; }
.preistabelle .paket-text b { color: #15803d; }
.preistabelle .ja { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: #d1fae5; color: #047857; align-items: center; justify-content: center; }
.preistabelle .ja svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2.5; fill: none; }
.preistabelle .nein { color: #d1d5db; font-size: 18px; }
.preistabelle td.hervor { font-weight: 700; color: var(--text); }
.preistabelle tbody tr:hover td { background: #f9fafb; }
.preistabelle tr.gruppe td { background: #f3f4f6; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); padding: 8px 16px; text-align: left; }
.preistabelle .inaktiv-spalte { opacity: .5; }
.preistabelle td:first-child svg { width: 16px; height: 16px; stroke: var(--text-2); vertical-align: -3px; margin-right: 4px; }
.paket-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 4px 0 14px; }
.paket-karte { border: 1px solid var(--rand); border-radius: 12px; padding: 16px 18px; background: #fff; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.paket-karte.inaktiv { opacity: .6; }
/* Deaktiviertes Paket mit „⋯“ im Kartenfuß: blass wird der Inhalt, nicht das offene Menü (opacity an der Karte machte es
   durchscheinend und legte die nächste Karte darüber — wie bei .liste-zeile.inaktiv oben) */
.paket-karte.inaktiv:has(.zeilen-menue) { opacity: 1; }
.paket-karte.inaktiv:has(.zeilen-menue) > :not(.paket-karte-fuss), .paket-karte.inaktiv > .paket-karte-fuss > :not(.zeilen-aktionen),
.paket-karte.inaktiv .zeilen-menue > summary { opacity: .6; }
.paket-karte-kopf { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.paket-karte-name { font-weight: 700; font-size: 16px; }
.paket-karte-name > a { font-weight: inherit; }   /* Name ist der Link zum Bearbeiten (Klick auf die Karte, Grundsatz 4) */
.paket-karte-preis { text-align: right; white-space: nowrap; }
.paket-karte-preis b { font-size: 20px; color: var(--signal); }
.paket-karte-preis small { display: block; color: var(--text-schwach); font-size: 12px; }
.paket-karte-module { display: flex; flex-wrap: wrap; gap: 6px; }
.paket-karte-limits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.paket-karte-limits li { display: flex; justify-content: space-between; gap: 10px; border-top: 1px dashed var(--rand); padding-top: 4px; }
.paket-karte-limits li span { color: var(--text-schwach); }
.paket-karte-fuss { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 6px; gap: 8px; flex-wrap: wrap; }

/* ===== 6 Dienstplan (.dp-*) ============================================= */
.dp-tabs { margin-bottom: 14px; }
.dp-karte { overflow: visible; }
.dp-kopf { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 0 0 14px; }
.dp-monatnav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dp-monatnav strong { font-size: 20px; min-width: 190px; text-align: center; letter-spacing: -.01em; }
.dp-monatnav .knopf { padding: 0 14px; }
.dp-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dp-leer { text-align: center; padding: 40px 20px; color: var(--text-2); }
.dp-leer svg { width: 40px; height: 40px; stroke: #9ca3af; margin-bottom: 8px; }
.dp-leer p { max-width: 520px; margin: 0 auto; }
/* Stempel-Leiste */
.dp-stempel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; background: var(--container); border: 1px solid var(--rand); border-radius: 10px; }
.dp-stempel-titel { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin-right: 4px; }
.dp-chip { --f: #e5e7eb; display: inline-flex; align-items: center; gap: 8px; height: var(--knopf-hoehe); padding: 0 12px 0 6px; border: 2px solid transparent; border-radius: 999px; background: #fff; cursor: pointer;
  font-family: var(--schrift); font-size: 13px; color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); transition: transform .1s, border-color .1s; }
.dp-chip b { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; padding: 0 6px; border-radius: 999px; background: var(--f); font-weight: 800; font-size: 13px; color: #111827; }
.dp-chip:hover { transform: translateY(-1px); border-color: var(--rand-stark); }
.dp-chip.aktiv { border-color: var(--signal); box-shadow: 0 0 0 3px var(--fokus-ring); }
.dp-chip.dp-radierer b { background: #fee2e2; }
.dp-chip.dp-kein b { background: #f3f4f6; color: var(--text-schwach); }
.dp-bem-toggle { margin-left: auto; font-size: 13px; }
/* Raster */
.dp-scroll { overflow-x: auto; border: 1px solid var(--rand); border-radius: 10px; }
.dp-raster { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
.dp-raster th, .dp-raster td { border-right: 1px solid var(--rand); border-bottom: 1px solid var(--rand); padding: 0; text-align: center; white-space: nowrap; }
.dp-raster th.dp-name, .dp-raster td.dp-name { text-align: left; padding: 0 10px; min-width: 170px; position: sticky; left: 0; background: #fff; z-index: 2; font-weight: 600; }
.dp-raster th.dp-name span { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.dp-raster th.dp-name em { font-style: normal; font-size: 10px; background: var(--signal); color: #fff; border-radius: 999px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.dp-raster .dp-kz { min-width: 34px; font-weight: 500; color: var(--text-2); position: sticky; left: 190px; background: #fff; z-index: 2; }
.dp-raster thead th { background: #f9fafb; font-weight: 600; color: var(--text-2); font-size: 11px; }
.dp-raster thead th.dp-name, .dp-raster thead th.dp-kz { background: #f9fafb; }
.dp-wochentage th { height: 38px; line-height: 1.1; padding: 4px 0; min-width: 30px; }
.dp-wochentage th b { display: block; font-size: 13px; color: var(--text); }
/* Wie ein Kalender: Samstag grau, Sonntag rot, Feiertag rot hinterlegt, heute markiert */
.dp-raster th.we { background: #eef1f5; color: #4b5563; }
.dp-raster td.we { background: #f3f5f8; }
.dp-raster th.so { background: #fdecec; color: #b91c1c; }
.dp-raster th.so b { color: #b91c1c; }
.dp-raster td.so { background: #fbf1f1; }
.dp-raster th.feiertag { background: #fee2e2; color: #b91c1c; }
.dp-raster th.feiertag b { color: #b91c1c; }
.dp-raster th.feiertag small { display: block; font-size: 9px; font-weight: 600; letter-spacing: .04em; line-height: 1; margin-top: 2px; }
.dp-raster td.feiertag { background: #fdf2f2; }
.dp-raster th.heute { box-shadow: inset 0 -3px 0 var(--signal); }
.dp-raster td.heute { box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .35); }
.dp-ereignisse th { height: 24px; font-size: 11px; }
.dp-ereignisse th.dp-ev { --f: #fde68a; background: var(--f); color: #111827; font-weight: 700; cursor: pointer; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.dp-ereignisse th.dp-ev-leer { cursor: pointer; }
.dp-ereignisse th.dp-ev-leer:hover { background: #eff6ff; }
.dp-stat-kopf { background: #f9fafb; }
/* Pinnwand „Sonstiges“: Hinweis der Planung und Hinweise aus dem Team */
.dp-notiz-planung { border-left: 3px solid var(--signal); padding-left: 12px; margin: 0 0 16px; }
.dp-notizen { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.dp-notiz { border: 1px solid var(--rand); border-radius: 8px; padding: 12px; background: var(--container); }
.dp-notiz p { margin: 6px 0 0; }
.dp-notiz-kopf { display: flex; align-items: center; gap: 10px; }
.dp-notiz-kopf .klein { color: var(--text-2); }
.dp-notiz-kopf .dp-notiz-weg { margin-left: auto; }

.dp-mini { border: 1px solid var(--rand-stark); background: #fff; border-radius: 6px; width: 22px; height: 22px; font-size: 13px; cursor: pointer; margin-left: 6px; vertical-align: middle; color: var(--text-2); }
.dp-mini:hover { border-color: var(--signal); color: var(--signal); }
.dp-einzeln { display: inline; }
.dp-zelle { --f: transparent; height: 32px; min-width: 30px; background: var(--f); font-weight: 700; font-size: 12.5px; color: #111827; cursor: pointer; user-select: none; }
.dp-zelle:hover { box-shadow: inset 0 0 0 2px var(--signal); }
.dp-raster.stempel-aktiv .dp-zelle { cursor: crosshair; }
.dp-zelle.lade { opacity: .5; }
/* Seit dem letzten Besuch geänderte Zellen: kleine Ecke oben rechts */
.dp-zelle[data-neu="1"] { position: relative; }
.dp-zelle[data-neu="1"]::after { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 9px 9px 0; border-color: transparent var(--signal) transparent transparent; }
.dp-seit-besuch { padding: 12px 16px; }
.dp-seit-besuch > summary { cursor: pointer; list-style: none; }
.dp-seit-besuch > summary::-webkit-details-marker { display: none; }
.dp-seit-besuch > summary::after { content: " ▾"; color: var(--text-schwach); }
.dp-seit-besuch[open] > summary::after { content: " ▴"; }
.dp-seit-besuch-leer { margin: 0 0 12px; }
.dp-aenderungen { margin: 10px 0 0; padding-left: 18px; font-size: 13.5px; display: grid; gap: 4px; }
.dp-aenderungen .klein { margin-right: 6px; }
#dpLive .knopf { margin-left: 10px; vertical-align: middle; }
.dp-zelle.dp-doppel { box-shadow: inset 0 0 0 2px #ef4444; }
.dp-zelle.dp-doppel::after { content: '!'; position: relative; color: #ef4444; font-size: 9px; vertical-align: super; margin-left: 1px; }
.dp-zelle.dp-wunsch { outline: 2px dashed #f59e0b; outline-offset: -2px; }
.dp-bereit .dp-zelle { height: 18px; font-size: 10px; font-weight: 600; color: #374151; }
.dp-bereit .dp-zelle:not([style*="--f"]) { background: repeating-linear-gradient(45deg, transparent 0 4px, #f3f4f6 4px 5px); }
.dp-raster .dp-eigene th.dp-name, .dp-raster .dp-eigene .dp-kz { background: #eff6ff; }
.dp-eigene th.dp-name { color: var(--signal); }
.dp-eigene .dp-zelle:not([style*="--f"]) { background: #f5f9ff; }
.dp-stat { min-width: 54px; font-family: var(--schrift-mono); font-size: 12px; font-weight: 600; }
.dp-stat.negativ, .dp-diff.negativ { color: #dc2626; }
.dp-bem, .dp-zusatz { display: none; }
.dp-bem.sichtbar, .dp-raster.bem-alle .dp-bem, .dp-zusatz.sichtbar, .dp-raster.bem-alle .dp-zusatz { display: table-row; }
.dp-bem td, .dp-bem th { height: 24px; background: #fffbeb; }
.dp-raster th.dp-bem-label, .dp-raster td.dp-bem-label { font-size: 10px; color: var(--text-2); font-weight: 500; }
.dp-bem td[colspan] { text-align: left; padding: 0 8px; }
.dp-bem-eingabe { width: 100%; height: 22px; border: 0; border-radius: 0; background: transparent; font-size: 12px; padding: 0; margin: 0; box-shadow: none; }
.dp-bem-eingabe:focus { box-shadow: none; outline: 1px solid var(--signal); }
.dp-zusatz th, .dp-zusatz td { height: 22px; background: #fffdf5; }
.dp-zusatz .dp-zelle { --f: transparent; font-size: 10px; font-weight: 700; color: #111827; }
.dp-zusatz .dp-zelle:not([style*="--f"]) { background: repeating-linear-gradient(-45deg, transparent 0 4px, #fdf3d0 4px 5px); }
.dp-zusatz-info { font-size: 10px; color: var(--text-schwach); text-align: left; padding: 0 6px; }
.dp-zusatz .dp-bem-label small { font-weight: 400; color: #9ca3af; }
.dp-besetzung th, .dp-besetzung td { height: 28px; background: #f9fafb; font-weight: 700; }
.dp-besetzung th.dp-name small { font-weight: 500; color: var(--text-2); }
.dp-besetzung td.dp-unter { background: #fee2e2; color: #b91c1c; }
/* Legende, Historie, Popover, Dialog */
.dp-legende { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0 4px; font-size: 12.5px; color: var(--text-2); }
.dp-legende-eintrag { display: inline-flex; align-items: center; gap: 6px; }
.dp-legende-eintrag i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .1); }
.dp-legende-eintrag b { color: var(--text); }
.dp-legende-eintrag small { color: #9ca3af; }
.dp-legende-eintrag.inaktiv { opacity: .45; }
.dp-legende-eigene { border-top: 1px dashed var(--rand); margin-top: 10px; padding-top: 10px; }
.dp-feiertag-legende i { background: #fee2e2; border-color: #fca5a5; }
.dp-punkt { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; border: 1px solid rgba(0, 0, 0, .1); vertical-align: -1px; }
.dp-historie { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.dp-historie li { padding: 8px 0; border-bottom: 1px solid var(--rand); }
.dp-popover { position: absolute; z-index: 50; background: #fff; border: 1px solid var(--rand); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .15); padding: 8px; width: 270px; max-height: 340px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px; }
.dp-popover button { --f: #e5e7eb; display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 6px 8px; border-radius: 8px; cursor: pointer; text-align: left;
  font-family: var(--schrift); font-size: 13px; color: var(--text); }
.dp-popover button:hover { background: #f3f4f6; }
.dp-popover button b { min-width: 34px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--f); font-weight: 800; }
.dp-popover button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-popover .dp-pop-leer { color: #b91c1c; font-weight: 600; }
.dp-pop-neu { border-top: 1px solid var(--rand); margin-top: 6px; padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.dp-pop-neu-titel { font-size: 12px; font-weight: 700; color: var(--text-schwach); text-transform: uppercase; letter-spacing: .05em; }
.dp-pop-neu input { font-size: 13px; }
.dp-pop-farben { display: flex; gap: 6px; }
.dp-pop-farbe { width: 24px; height: 24px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.dp-pop-farbe.aktiv { border-color: var(--signal); }
.dp-pop-neu .knopf.dp-pop-speichern { width: 100%; justify-content: center; font-size: 13px; }
.dp-dialog { border: 0; border-radius: 14px; padding: 24px; width: min(520px, 92vw); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.dp-dialog::backdrop { background: rgba(17, 24, 39, .5); }
.dp-dialog h3 { margin: 0 0 14px; font-size: 18px; }
.dp-dialog form > label { display: block; margin-top: 14px; }
.dp-dialog .aktionen-zeile { margin-top: 20px; }
/* Farbwahl, Inline-Details, Rotationen */
.dp-farben { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--beschriftung-abstand); }
.dp-farben label { display: block; position: relative; cursor: pointer; margin: 0; }
.dp-farben input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.dp-farben i { display: block; width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.dp-farben input:checked + i { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(37, 99, 235, .2); }
.dp-inline-details { border: 0; border-radius: 0; background: none; }
/* summary.knopf behält sein Knopfmaß und seinen Rahmen (Knopflinie): nur schlichte Aufklapper verlieren Innenabstand und Rahmen */
.dp-inline-details > summary:not(.knopf) { list-style: none; display: inline-flex; padding: 0; border: 0; background: none; }
.dp-inline-details > summary::before { content: none; }
.dp-inline-details > :not(summary) { padding: 0; }
.dp-inline-details[open] { display: block; min-width: min(520px, 100%); }
.dp-inline-details form { margin-top: 12px; }
.dp-rotation td, .dp-rotation th { text-align: center; }
.dp-rotation td.we, .dp-rotation th.we { background: #f9fafb; }
.dp-rotation { width: 100%; table-layout: fixed; }
.dp-rotation th:first-child { width: 110px; text-align: right; padding-right: 12px; }
.dp-rot-select { --f: #fff; background-color: var(--f); min-width: 0; width: 100%; }
.dp-person-reihe { display: inline-flex; min-width: 28px; height: 24px; align-items: center; justify-content: center; border-radius: 6px; background: #f3f4f6; font-family: var(--schrift-mono); font-size: 12px; color: var(--text-2); }
.dp-rot-vorschau { display: flex; gap: 4px; flex-wrap: wrap; }
.dp-rot-tag { --f: #f3f4f6; display: inline-flex; flex-direction: column; align-items: center; min-width: 34px; padding: 3px 4px; border-radius: 6px; background: var(--f); line-height: 1.1; }
.dp-rot-tag small { font-size: 9px; color: var(--text-2); text-transform: uppercase; }
.dp-rot-tag b { font-size: 12px; }
.dp-rot-tag.we { box-shadow: inset 0 0 0 1px var(--rand); }
.dp-rot-anwenden { position: relative; display: inline-block; border: 0; border-radius: 0; background: none; }
.dp-rot-anwenden > summary:not(.knopf) { list-style: none; display: inline-flex; padding: 0; border: 0; background: none; } /* „Rotation anwenden ▾“, „Stornieren“ (summary.knopf) bleiben Knöpfe */
.dp-rot-anwenden > summary::before { content: none; }
.dp-rot-anwenden > summary::-webkit-details-marker { display: none; }
.dp-rot-anwenden-panel { position: absolute; top: calc(100% + 8px); right: 0; left: auto; z-index: 30; width: 420px; max-width: calc(100vw - 48px); padding: 16px; margin: 0; background: #fff; border: 1px solid var(--rand); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .12); display: flex; flex-direction: column; gap: 10px; }
.dp-rot-anwenden-panel .kontrollkaestchen { margin: 0; }
.dp-rot-anwenden-panel .dp-rot-alle { padding-bottom: 8px; border-bottom: 1px solid var(--rand); }
.dp-rot-anwenden-panel .aktionen-zeile { margin-top: 4px; }
.dp-rot-umfang { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid var(--rand); }
.dp-rot-umfang .kontrollkaestchen { margin: 0; }
.dp-rot-person { display: grid; grid-template-columns: 1fr 180px; align-items: center; gap: 10px; }
.dp-rot-person .kontrollkaestchen { margin: 0; }
.dp-rot-person select { margin: 0; }

/* ===== 6 Dienstleister (.dl-*) ========================================== */
.dl-kontakt { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.dl-kontakt a { color: var(--text-2); }
.dl-kontakt .dl-notfall { color: #b91c1c; font-weight: 600; }
.dl-sterne { color: #f59e0b; letter-spacing: 1px; }
.dl-kontakt-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 24px; }
.dl-feld span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin-bottom: 3px; }
.dl-feld b { font-weight: 500; font-size: 14.5px; }
.dl-kategorien-wahl { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 12px; }
.dl-kategorien-wahl .kontrollkaestchen { margin: 0; }
.dl-status-form { margin-top: 8px; }
/* Anhänge einer Beauftragung (Organisation und „Meine Aufträge“): Datei-Chips wie im Ticket, Symbol in Textgröße */
.dl-anhaenge { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dl-anhaenge > .ticket-datei { max-width: 100%; }
.dl-anhaenge svg { width: 16px; height: 16px; flex-shrink: 0; }
.dl-filter .filter-leiste { margin-bottom: 12px; }
.dl-kontaktblock { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 10px 0; }
.dl-kontaktblock > div { background: #f9fafb; border: 1px solid var(--rand); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.dl-erneut-form { margin-top: 8px; flex-wrap: wrap; }
.dl-erneut-form input[type=email] { min-width: 220px; }
.dl-auftragstext { white-space: pre-line; font-size: 14.5px; line-height: 1.5; margin: 8px 0; }
.dl-antwort-form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--rand); }
.dl-rueckmeldung { font-size: 13px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.dl-ziel { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 2px dashed var(--rand); border-radius: 10px; margin-top: 10px; transition: border-color .15s, background .15s; }
.dl-ziel-text { min-width: 0; }
.dl-ziel-aktionen { display: flex; gap: 6px; flex-shrink: 0; }
.dl-ziel-angefragt { border-style: solid; background: #f9fafb; }
body.dl-ziel-aktiv .dl-ziel { border-color: #93c5fd; background: #f8fbff; }
.dl-ziel.ueber { border-color: var(--signal); background: #eff6ff; border-style: solid; }
/* Knopflinie (ui-richtlinien 3a), Tickets & Dienstleister:
   - Abrechnung (Meine Aufträge): drei Felder und die Knöpfe in EINER Rasterzeile — Spalten ab 170 px, die Knopfgruppe
     über zwei Spalten, damit „Als abgerechnet vermerken“ und „Zurücksetzen“ nebeneinander bleiben (Handy: einspaltig).
   - Ticket › Bearbeitung: „Zuweisen“ in der Zeile der Auswahl; die Auswahl nimmt den Rest der schmalen Seitenspalte.
   - Statuskette (Ticket-Einstellungen): Spalten ab 280 px — „Status speichern“ und „Abbrechen“ (zusammen 270 px) passen
     so immer nebeneinander in die Knopfzelle; bei 220 px standen sie bei 1400 px Fensterbreite untereinander. */
@media (min-width: 768px) {
  .dl-abrechnung .zeilen-formular { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .dl-abrechnung .zeilen-formular > .aktionen-zeile { grid-column: span 2; }
  .ticket-status-formular > .zeilen-formular { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
.ticket-zuweisen-form > label { flex: 1 1 160px; min-width: 0; }
.ticket-zuweisen-form > label > select { min-width: 0; }
/* Knöpfe/Haken als Zelle im Formular-Raster (Statuskette, Zugang anlegen, Abrechnung): zentrale Regel im Abschnitt Formulare */

/* ===== 6 Tickets (.ticket-*) ============================================ */
.ticket-kopf { background: #fff; border: 1px solid var(--rand); border-radius: 12px; padding: 18px var(--karte-innen); margin-bottom: var(--karte-abstand); display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: center; box-shadow: var(--schatten); }
.ticket-kopf[draggable=true] { cursor: grab; }
.ticket-kopf.ziehen { opacity: .6; }
.ticket-kopf-status { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.ticket-meta > div > span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-schwach); }
.ticket-meta > div > b { font-weight: 600; font-size: 14px; }
.ticket-eintrag { border: 1px solid var(--rand); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.ticket-eintrag + .ticket-eintrag { margin-top: 0; }
.ticket-eintrag.ticket-organisation { background: #eff6ff; border-color: #bfdbfe; }
.ticket-eintrag.ticket-intern { background: #fffbeb; border-color: #fde68a; }
.ticket-eintrag.ticket-dienstleister { background: #ecfdf5; border-color: #a7f3d0; }
.ticket-eintrag.ticket-ersteller { background: var(--container); }
.ticket-eintrag-kopf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ticket-text { font-size: 14.5px; line-height: 1.55; white-space: pre-line; }
.ticket-anhaenge { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ticket-bild { display: block; width: 120px; height: 90px; border-radius: 8px; overflow: hidden; border: 1px solid var(--rand); background: #f3f4f6; }
.ticket-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ticket-datei { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--rand); border-radius: 8px; background: #fff; font-size: 13px; color: var(--text); }
.ticket-datei small { color: var(--text-schwach); }
.ticket-antwort-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--rand); }
.ticket-zeile.ungelesen .liste-titel a { font-weight: 700; }
.ticket-zeile.prio-dringend { box-shadow: inset 4px 0 0 #ef4444; padding-left: 12px; }
.ticket-zeile.prio-hoch { box-shadow: inset 4px 0 0 #f59e0b; padding-left: 12px; }
@media (hover: hover) {   /* Zeilenklick-Hover (Grundsatz 4) ersetzt den Schatten — der Prioritäts-Balken bleibt, die Fläche reicht nur nach rechts */
  .zeilenklick .liste-zeile.ticket-zeile.prio-dringend[data-zeile-ziel]:hover { box-shadow: inset 4px 0 0 #ef4444, 10px 0 0 var(--container); }
  .zeilenklick .liste-zeile.ticket-zeile.prio-hoch[data-zeile-ziel]:hover { box-shadow: inset 4px 0 0 #f59e0b, 10px 0 0 var(--container); }
}
.ticket-auftrag { padding: 10px 0; border-bottom: 1px solid var(--rand); }
.ticket-kontakt { padding: 10px 0; border-bottom: 1px solid var(--rand); }
.ticket-kontakt:last-child { border-bottom: 0; }
.ticket-kontakt-titel { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-schwach); margin-bottom: 4px; }
#wlForm { margin-top: 14px; padding: 16px; border: 1px solid #bfdbfe; border-radius: 10px; background: #eff6ff; }

/* ===== 6 Immobilien (.im-*) ============================================= */
.im-mieter { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-top: 6px; }
.im-mieter.inaktiv { opacity: .55; }
/* Beendetes Mietverhältnis mit „⋯“: blass werden Angaben und Knopf, nicht das offene Menü (wie .liste-zeile.inaktiv) */
.im-mieter.inaktiv:has(> .zeilen-aktionen.nur-menue) { opacity: 1; }
.im-mieter.inaktiv:has(> .zeilen-aktionen.nur-menue) > .im-mieter-info, .im-mieter.inaktiv > .zeilen-aktionen.nur-menue > .zeilen-menue > summary { opacity: .55; }
.im-objektbild { margin-bottom: var(--karte-abstand); border-radius: 12px; overflow: hidden; max-height: 320px; border: 1px solid var(--rand); box-shadow: var(--schatten); }
.im-objektbild img { width: 100%; height: 320px; object-fit: cover; display: block; }
.im-bild-klein { width: 72px; height: 54px; border-radius: 8px; overflow: hidden; background: #f3f4f6; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--rand); }
.im-bild-klein img { width: 100%; height: 100%; object-fit: cover; }
.im-bild-klein svg { width: 24px; height: 24px; stroke: #9ca3af; }
.im-bild-wahl { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.im-bild-wahl .zeilen-formular { flex: 1 1 320px; }
.im-bild-vorschau { width: 200px; height: 140px; object-fit: cover; border-radius: 10px; border: 1px solid var(--rand); }
/* Knopf als letzte Zelle im Formular-Raster („Wechsel eintragen“ neben „Notiz“): zentrale Regel im Abschnitt Formulare */

/* ===== 6 Lager (.lager-*, Scan) ========================================= */
.lager-mini { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; margin-right: 12px; background: var(--flaeche-still); }
.lager-mini.leer { display: inline-flex; align-items: center; justify-content: center; color: var(--text-schwach); }
.lager-mini.leer svg { width: 20px; height: 20px; }
.lager-bild { max-width: 220px; max-height: 160px; border-radius: 10px; border: 1px solid var(--rand); object-fit: contain; background: #fff; }
.lager-stammdaten { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.lager-artikelinfo { margin-top: 12px; padding: 12px 14px; background: var(--flaeche-aktiv); border-radius: 10px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lager-etikett { display: inline-flex; gap: 12px; align-items: center; border: 1px dashed var(--rand); border-radius: 8px; padding: 10px; background: #fff; }
.lager-etikett-qr svg { width: 96px; height: 96px; display: block; }
.lager-etikett-text { display: flex; flex-direction: column; gap: 2px; }
.lager-etikett-text b { font-size: 14px; }
.lager-etikett-text span { font-size: 12px; color: var(--text-schwach); }
.lager-etikett-text code { font-size: 12px; }
/* Bestellung bearbeiten: gebuchte Position — Artikel schreibgeschützt so breit wie das Suchfeld der anderen Zeilen */
.lager-pos input.pos-fest { display: block; width: 100%; }
/* Scan-Modus: bewusst schmal (760 px) und große Bedienelemente für Touch */
.scan-karte { max-width: 760px; }
.scan-modi { display: flex; gap: 8px; margin-bottom: 16px; }
.scan-modus { flex: 1; height: 48px; border: 1px solid var(--rand); border-radius: 12px; background: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.scan-modus.aktiv { background: var(--signal); color: #fff; border-color: var(--signal); }
.scan-schritt { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--rand); }
.scan-schritt > * + * { margin-top: 12px; }
.scan-label { font-weight: 600; margin-bottom: 0; }
.scan-label + * { margin-top: var(--beschriftung-abstand); }
.scan-schritt input[type=text], .scan-schritt select { height: 48px; font-size: 16px; width: 100%; }
.scan-schritt .aktionen-zeile input[type=text] { flex: 1; }
.scan-schritt .aktionen-zeile > .knopf { height: 48px; } /* Kamera-Knopf so hoch wie das große Scan-Feld — eine Linie */
.scan-info { margin-top: 8px; font-size: 14px; min-height: 20px; }
/* Mengenwähler „− Menge +“ ist eine Zeile wie .aktionen-zeile: Kinder ohne Außenabstand, alle 52 px hoch, Knöpfe fest
   52 px breit — auf jeder Breite. Galt das nur am Handy, schob „input + .knopf“ (16 px Luft unter einem Feld) das Plus
   am Desktop 8 px unter die Mittellinie (ui-richtlinien 3a). */
.scan-menge { display: flex; gap: 8px; align-items: center; }
.scan-menge input { text-align: center; font-size: 22px; font-weight: 700; height: 52px; }
.scan-menge .knopf { width: 52px; height: 52px; font-size: 22px; padding: 0; }
.scan-menge > .knopf { flex: 0 0 52px; margin: 0; }
.scan-menge > input[type=text] { flex: 1 1 auto; min-width: 0; height: 52px; margin: 0; }
.scan-buchen { width: 100%; height: auto; min-height: 56px; font-size: 18px; white-space: normal; line-height: 1.25; padding-top: 8px; padding-bottom: 8px; text-align: center; } /* langer Text („Fertig — zurück zu Auftrag A-2026-0023“) bricht um statt über den Rand */
#kamera { width: 100%; border-radius: 12px; margin-top: 12px; }
#grundZeile { display: flex; gap: 10px; flex-wrap: wrap; }
#grundZeile > * { flex: 1; min-width: 200px; }

/* ===== 6 Regeln & Automatisierungen ====================================== */
.regel-aktion { padding: 16px 18px; background: #fff; border: 1px solid var(--rand); border-radius: 10px; }
.regel-aktion + .regel-aktion { margin-top: 12px; }
.regel-aktion > * + * { margin-top: var(--formular-abstand); }
.regel-aktion > .akt-mail > * + * { margin-top: var(--formular-abstand); }
.bed-zeile + .bed-zeile { margin-top: 12px; }

/* ===== 6 Hilfe-Panel (fährt rechts heraus; bewusst schmal) =============== */
.hilfe-schleier { position: fixed; inset: 0; background: rgba(17, 24, 39, .25); z-index: 90; }
.hilfe-panel { position: fixed; top: 0; right: 0; height: 100vh; width: min(420px, 92vw); background: #fff; box-shadow: -8px 0 30px rgba(0, 0, 0, .12); z-index: 95; transform: translateX(105%);
  transition: transform .22s ease; display: flex; flex-direction: column; }
.hilfe-panel.offen { transform: translateX(0); }
.hilfe-panel-kopf { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--rand); }
.hilfe-panel-kopf h2 { margin: 0; font-size: 17px; }
.hilfe-panel-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--flaeche-aktiv); color: var(--signal); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hilfe-panel-icon svg { width: 18px; height: 18px; }
.hilfe-panel-zu { margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 8px; background: var(--flaeche-still); font-size: 20px; line-height: 1; cursor: pointer; color: var(--text-schwach); flex-shrink: 0; }
.hilfe-panel-zu:hover { color: var(--text); }
.hilfe-panel-inhalt { padding: 20px 24px; overflow: auto; flex: 1; font-size: 14px; line-height: 1.55; }
.hilfe-panel-inhalt p, .hilfe-panel-inhalt ul, .hilfe-panel-inhalt ol { margin: 0 0 12px; }
.hilfe-panel-inhalt li + li { margin-top: 6px; }
.hilfe-panel-inhalt h3 { font-size: 14px; margin: 18px 0 6px; }
.hilfe-panel-inhalt h3:first-child { margin-top: 0; }
.hilfe-panel-fuss { padding: 16px 24px; border-top: 1px solid var(--rand); display: flex; justify-content: center; }

/* ===== 6 Neue Bausteine: Zeitstrahl, Konfiguration, eigene Felder, Heute-Karte ===== */
.zeitstrahl-eintrag:first-child { border-top: 0; padding-top: 0; }
.zeitstrahl-icon svg { width: 16px; height: 16px; }
.zeitstrahl-text > .klein { display: flex; gap: 6px 14px; flex-wrap: wrap; }
.heute-karte { border-color: var(--signal-rand); }
.konfig-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.konfig-kachel { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--rand); border-radius: 10px; background: #fff; color: inherit; font-weight: 400; min-width: 0; transition: box-shadow .15s, border-color .15s; }
.konfig-kachel:hover { color: inherit; border-color: var(--signal-rand); box-shadow: 0 4px 12px rgba(0, 0, 0, .06); }
.konfig-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--flaeche-aktiv); color: var(--signal); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.konfig-icon svg { width: 18px; height: 18px; }
.konfig-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.konfig-text strong { font-size: 14.5px; }
.eigene-felder { display: flex; flex-direction: column; gap: var(--formular-abstand); }
.eigene-felder > * { margin: 0; }
.felder-titel { margin-top: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--rand); }
/* Eigene Felder beim Anlegen (felder_anlegen_html): Pflichtangaben als Gruppe, die übrigen im Aufklapper „Weitere Angaben“ —
   16 px Luft auch außerhalb des Formular-Rhythmus (z. B. im Block „neuer Mieter“), die Feldnamen im Kopf brechen um */
* + .felder-anlegen-weitere { margin-top: var(--formular-abstand); }
.felder-anlegen-weitere > summary .klein { font-weight: 400; min-width: 0; overflow-wrap: anywhere; }
/* Aufklapper im Personen-Baustein (person_felder_html, kern/personen.php: „Anschrift & Geburtsdatum“, „Dienstliche Angaben“):
   die Feldzeile mit 16 px Luft unter dem Kopf wie bei .ticket-weitere — Polster am Raster zählte nicht als Abstand */
.person-klapp > summary + * { padding-top: 0; margin-top: var(--formular-abstand); }
/* Raster ohne Einzel-Rest: Feldgruppen im Personen-Baustein (person_felder_html, Kurzform person_zugang_felder_html) und die
   Karten der Zugangsprofile (personen_profil_karten_html). Vorher brach das Raster bei 1440 px in 4 + 1 um („Funktion“ und
   „Mobil geschäftlich“ standen allein, die Karte „Inhaber“ ebenso). Das Element trägt --pz-n (so viele Spalten, solange jede
   mindestens --pz-min breit ist; Namens- und Kontaktzeile gleich viele, damit die Spalten untereinander stehen), sonst --pz-k
   Spalten (mindestens --pz-min-k breit: 6 → 3 + 3, 5 → 3 + 2, 4 → 2 + 2, bis 3 alle nebeneinander), sonst eine. Einspaltig wird
   es, sobald --pz-kb Spalten nicht mehr passen (Vorgabe --pz-k; die Namenszeile mit 4 Feldern trägt 3 wie die Kontaktzeile
   darunter — so werden beide bei derselben Breite einspaltig). In der k-Form stehen 4 über 5 Feldern als 2 + 2 über 3 + 2 nicht
   bündig: eine gemeinsame Spaltenzahl ließe ein Feld allein (3 + 1 bzw. 2 + 2 + 1).
   Ohne Container-Abfrage gerechnet: Mindestbreite einer Spalte = max(Breite bei n, min(Breite bei k, Sperre n), min(100 %,
   Sperre kb)); eine Sperre wird ≤ 0, sobald ihre Spaltenzahl passt. --pz-luecke = Spaltenabstand. Feldzeilen bis 860 px
   einspaltig (Mobilteil „.zeilen-formular { 1fr }“ steht weiter unten und gewinnt, :where hält die Spezifität gleich).
   Andere Bausteine nutzen dasselbe mit class="zeilen-formular raster-voll" und style="--pz-n:…;--pz-k:…" (person_zeile_attr). */
.zeilen-formular:where(.person-zeile, .raster-voll), .profil-wahl:where(.raster-voll) {
  --pz-n: 5; --pz-k: 3; --pz-kb: var(--pz-k); --pz-min: 144px; --pz-min-k: 140px; --pz-luecke: 20px;
  column-gap: var(--pz-luecke);
  grid-template-columns: repeat(auto-fill, minmax(max(
      (100% - (var(--pz-n) - 1) * var(--pz-luecke)) / var(--pz-n) - 1px,
      min((100% - (var(--pz-k) - 1) * var(--pz-luecke)) / var(--pz-k) - 1px,
          (var(--pz-n) * var(--pz-min) + (var(--pz-n) - 1) * var(--pz-luecke) - 100%) * 1000),
      min(100%, (var(--pz-kb) * var(--pz-min-k) + (var(--pz-kb) - 1) * var(--pz-luecke) - 100%) * 1000)), 1fr));
}
.profil-wahl:where(.raster-voll) { --pz-min: 220px; --pz-min-k: 220px; --pz-luecke: 10px; }
/* Dasselbe für „Rechnung & Webseite“ im Baustein der Organisation (kern/organisation_felder.php) */
.org-rechnung > summary + * { padding-top: 0; margin-top: var(--formular-abstand); }
.tabelle-scroll { overflow-x: auto; max-width: 100%; }
.zeilen-aktionen-zelle { text-align: right; white-space: nowrap; }
.zeilen-aktionen-zelle .zeilen-aktionen { justify-content: flex-end; }

/* ===== 6 CRM: Kanban, Statuskette, Reiter, Dubletten (.kanban*, .status-*, .dublette*) ===== */
.filter-formular .filter-zeile { align-items: flex-end; margin-top: 16px; }
.filter-formular .filter-zeile > label { flex: 1 1 160px; }
.filter-formular .filter-aktionen { margin: 0; align-self: flex-end; }
.filter-formular + .anlegen-akkordeon { margin-top: 16px; }
.dash-raster + .karte { margin-top: var(--karte-abstand); }
.scan-schritt .aktionen-zeile + .aktionen-zeile { margin-top: 12px; }
.chip-zahl { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--flaeche-still); color: var(--text-schwach); }
.chip.aktiv .chip-zahl { background: rgba(255, 255, 255, .25); color: #fff; }
.chip svg { width: 14px; height: 14px; margin-right: 4px; }
.knopf-text { display: inline-flex; align-items: center; justify-content: center; min-width: var(--knopf-klein-hoehe); height: var(--knopf-klein-hoehe); padding: 0 6px; border: 0; background: none; color: var(--text-schwach); cursor: pointer; border-radius: 6px; font: inherit; }
.knopf-text:hover { background: var(--flaeche-still); color: var(--text); }
.aktionen-spalte { flex-direction: column; align-items: stretch; }
.aktionen-spalte .knopf { justify-content: flex-start; }
.fliesstext { white-space: pre-line; line-height: 1.55; }
.firma-logo { max-height: 64px; max-width: 200px; display: block; margin: 0 0 16px; }
.zuweisen-formular { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: 10px; max-width: 100%; vertical-align: middle; }
.zuweisen-formular select { max-width: 100%; }
.zuweisen-formular select { margin: 0; height: var(--knopf-klein-hoehe); }
.komm-details > summary { cursor: pointer; padding: 4px 0; }
.inline-details { position: relative; }
.inline-details > summary { list-style: none; cursor: pointer; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] > form { position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; background: #fff; border: 1px solid var(--rand); border-radius: 10px; padding: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .1); min-width: 420px; }

/* Statuskette im Vorgang: ein Schritt je Status, aktueller hervorgehoben */
.status-kette { display: flex; flex-wrap: wrap; gap: 8px; }
.status-schritt { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--rand-stark); background: #fff; color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.status-schritt:hover { border-color: var(--signal); color: var(--signal); }
span.status-schritt { cursor: default; }
.status-schritt.aktiv { color: #fff; border-color: transparent; font-weight: 600; }
.status-schritt.aktiv.farbe-blau { background: #2563eb; } .status-schritt.aktiv.farbe-gruen { background: #16a34a; } .status-schritt.aktiv.farbe-gelb { background: #d97706; } .status-schritt.aktiv.farbe-rot { background: #dc2626; } .status-schritt.aktiv.farbe-grau { background: #6b7280; }
.status-schritt.art-gewonnen:not(.aktiv) { border-color: #a7f3d0; color: #065f46; }
.status-schritt.art-verloren:not(.aktiv) { border-color: var(--rand); color: var(--text-schwach); }

/* Blättern: „1 2 3 … 9 10“ unter Listen, Einträge je Seite */
.blaettern { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rand-weich); }
.blaettern-seiten { display: flex; align-items: center; gap: 4px; }
.blaettern-knopf { display: inline-flex; align-items: center; justify-content: center; min-width: var(--knopf-klein-hoehe); height: var(--knopf-klein-hoehe); padding: 0 8px; border: 1px solid var(--rand); border-radius: 8px; background: #fff; color: var(--text-2); font-size: 13.5px; font-weight: 500; text-decoration: none; }
a.blaettern-knopf:hover { border-color: var(--signal); color: var(--signal); text-decoration: none; }
.blaettern-knopf.aktiv { background: var(--signal); border-color: var(--signal); color: #fff; font-weight: 600; }
.blaettern-knopf.aus { opacity: .4; }
.blaettern-punkte { padding: 0 4px; color: var(--text-still); }
.blaettern-je { display: flex; gap: 6px; align-items: center; }
.blaettern-je a, .blaettern-je .aktiv { padding: 2px 6px; border-radius: 6px; }
.blaettern-je .aktiv { background: var(--flaeche-aktiv); color: var(--signal); font-weight: 600; }

/* Kalender (Wiedervorlagen & Termine): Monatsraster, Einträge farbig nach Art */
.kal-kopf { flex-wrap: wrap; gap: 12px; }
.kal-kopf h2 { margin: 0 6px; min-width: 180px; text-align: center; }
.kal-legende { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; }
.kal-punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: #9ca3af; }
.kal-punkt.farbe-blau, .kal-eintrag.farbe-blau { background: #dbeafe; color: #1e3a8a; } .kal-punkt.farbe-blau { background: #2563eb; }
.kal-punkt.farbe-gelb { background: #d97706; } .kal-eintrag.farbe-gelb { background: #fef3c7; color: #78350f; }
.kal-punkt.farbe-rot { background: #dc2626; } .kal-eintrag.farbe-rot { background: #fee2e2; color: #7f1d1d; }
.kal-punkt.farbe-gruen { background: #16a34a; } .kal-eintrag.farbe-gruen { background: #dcfce7; color: #14532d; }
.kal-eintrag.farbe-grau { background: var(--flaeche-still); color: var(--text-2); }
.kal-raster { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.kal-wt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-schwach); padding: 4px 6px; }
.kal-tag { min-height: 112px; border: 1px solid var(--rand); border-radius: 10px; padding: 8px; background: #fff; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kal-tag.leer { border-color: transparent; background: none; }
.kal-tag.we { background: var(--container); }
.kal-tag.feiertag { background: #fff7ed; }
.kal-tag.heute { border-color: var(--signal); box-shadow: inset 0 0 0 1px var(--signal); }
.kal-tag-kopf { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.kal-nr { font-weight: 700; font-size: 13px; }
.kal-tag.heute .kal-nr { color: var(--signal); }
.kal-feiertag { font-size: 11px; color: #9a3412; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kal-plus { margin-left: auto; width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-still); text-decoration: none; font-weight: 600; opacity: 0; transition: opacity .15s; }
.kal-tag:hover .kal-plus { opacity: 1; }
.kal-plus:hover { background: var(--flaeche-aktiv); color: var(--signal); text-decoration: none; }
.kal-eintrag { display: block; font-size: 12px; line-height: 1.3; padding: 3px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.kal-eintrag:hover { text-decoration: none; filter: brightness(.95); }
.kal-eintrag.erledigt { opacity: .5; text-decoration: line-through; }
.kal-eintrag.ueber { box-shadow: inset 3px 0 0 #dc2626; }
@media (max-width: 900px) { .kal-raster { gap: 3px; } .kal-tag { min-height: 70px; padding: 4px; } .kal-eintrag { font-size: 11px; padding: 2px 4px; } .kal-feiertag { display: none; } }

/* Mail-Matrix: eine Zeile je Mail-Art mit Feldern und aufgelöster Empfängerzeile */
.matrix-gruppe { margin: 24px 0 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-schwach); }
.matrix-gruppe:first-of-type { margin-top: 8px; }
.matrix-zeile { border: 1px solid var(--rand); border-radius: 12px; padding: 16px 18px; margin-top: 12px; background: var(--container); }
.matrix-zeile.inaktiv { opacity: .6; }
.matrix-kopf .matrix-aktiv { margin: 0; }
.matrix-kopf > .klein { margin: 4px 0 0 28px; }
.matrix-gruppen { margin: 12px 0 0; padding: 10px 14px; }
.matrix-direkt { border: 1px dashed var(--rand-stark); border-radius: 12px; padding: 12px 18px; margin-top: 12px; background: #fff; }
.matrix-direkt-titel { margin-bottom: 6px; }
.matrix-direkt-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 0; border-top: 1px solid var(--rand-weich); font-size: 14px; }
.matrix-direkt-zeile:first-of-type { border-top: 0; }
.matrix-direkt-zeile .abzeichen svg { width: 12px; height: 12px; vertical-align: -1px; }
.matrix-gruppen .kontrollkaestchen { margin: 0; }
.matrix-felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 20px; align-items: end; margin-top: 14px; }
.matrix-felder > label { margin: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--beschriftung-abstand); min-width: 0; }
.matrix-felder > label > .feld-hilfe { margin: -4px 0 0; }
.matrix-felder > label > input, .matrix-felder > label > details { margin-top: 0; }
.matrix-felder > label.kontrollkaestchen { flex-direction: row; align-items: center; min-height: var(--feld-hoehe); gap: 10px; }
.matrix-ma { position: relative; }
.matrix-ma > summary { list-style: none; display: flex; align-items: center; height: var(--feld-hoehe); padding: 0 12px; border: 1px solid var(--rand-stark); border-radius: var(--radius); background: #fff; cursor: pointer; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.matrix-ma > summary::-webkit-details-marker { display: none; }
.matrix-ma > summary::after { content: "▾"; margin-left: auto; padding-left: 8px; color: var(--text-schwach); }
.matrix-ma[open] > summary { border-color: var(--signal); }
.matrix-ma-liste { position: absolute; left: 0; right: 0; top: calc(var(--feld-hoehe) + 4px); z-index: 6; background: #fff; border: 1px solid var(--rand); border-radius: 10px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .1); display: grid; gap: 6px; max-height: 260px; overflow: auto; }
.matrix-ma-liste .kontrollkaestchen { margin: 0; white-space: nowrap; }
.matrix-ergebnis { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--rand); display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.matrix-ergebnis svg { width: 14px; height: 14px; color: var(--signal); flex-shrink: 0; }
.testmail-zeile { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rand-weich); }

/* Ticket: Statuskette in der Seitenspalte, Video-Anhänge */
.status-kette-klein { margin-bottom: 16px; }
.status-kette-klein .status-schritt { height: 32px; padding: 0 12px; font-size: 13px; }
.ticket-video { max-width: 100%; width: 320px; border-radius: 10px; border: 1px solid var(--rand); background: #000; }

/* Reiter (Notiz / Telefonat / E-Mail) */
.reiter-leiste { display: flex; gap: 4px; border-bottom: 1px solid var(--rand); margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.reiter-leiste > * { flex: 0 0 auto; }
.reiter svg, .reiter-leiste a svg { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -3px; margin-right: 6px; }
.reiter { height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-schwach); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; margin-bottom: -1px; }
.reiter:hover { color: var(--text); }
.reiter.aktiv { color: var(--signal); border-bottom-color: var(--signal); font-weight: 600; }

/* Kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 12px; align-items: flex-start; }
.kanban-spalte { flex: 0 0 280px; background: var(--container); border: 1px solid var(--rand); border-radius: 12px; padding: 12px; min-height: 160px; display: flex; flex-direction: column; gap: 10px; }
.kanban-spalte.ziel { border-color: var(--signal); background: var(--flaeche-aktiv); }
.kanban-spalte.art-gewonnen { background: #f0fdf4; } .kanban-spalte.art-verloren { background: #f9fafb; opacity: .9; }
.kanban-kopf { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px; font-size: 14px; }
.kanban-kopf strong { flex: 1; font-weight: 600; }
.kanban-punkt { width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; flex-shrink: 0; }
.kanban-punkt.farbe-blau { background: #2563eb; } .kanban-punkt.farbe-gruen { background: #16a34a; } .kanban-punkt.farbe-gelb { background: #d97706; } .kanban-punkt.farbe-rot { background: #dc2626; }
.kanban-zahl { font-size: 12px; font-weight: 600; color: var(--text-schwach); background: #fff; border: 1px solid var(--rand); border-radius: 999px; padding: 1px 8px; }
.kanban-summe { white-space: nowrap; }
.kanban-karten { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kanban-karte { background: #fff; border: 1px solid var(--rand); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; position: relative; box-shadow: var(--schatten); }
.kanban-karte[draggable="true"] { cursor: grab; }
.kanban-karte.zieht { opacity: .5; }
.kanban-karte.prio-hoch { border-left: 3px solid #d97706; } .kanban-karte.prio-dringend { border-left: 3px solid #dc2626; } .kanban-karte.prio-niedrig { border-left: 3px solid var(--rand-stark); }
.kanban-titel { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.35; }
.kanban-titel:hover { color: var(--signal); }
.kanban-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.kanban-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.kanban-fuss .abzeichen svg { width: 11px; height: 11px; vertical-align: -1px; }
.kanban-wert { font-weight: 600; font-variant-numeric: tabular-nums; }
.kanban-person { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; background: var(--flaeche-aktiv); color: var(--signal); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.kanban-pfeile { display: flex; justify-content: space-between; margin-top: 2px; }
.kanban-pfeile .knopf-text { font-size: 12px; }
.kanban-leer { padding: 14px; text-align: center; border: 1px dashed var(--rand-stark); border-radius: 8px; }

/* Einstellungen: Auswahllisten in Spalten */
.listen-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.listen-spalte h3 { margin: 0 0 8px; }
.listen-neu .aktionen-zeile { margin-top: 12px; }
.listen-neu input { flex: 1; margin: 0; }

/* Dubletten: zwei Datensätze nebeneinander, links behalten wählen */
.dublette { border: 1px solid var(--rand); border-radius: 12px; padding: 18px 20px; margin-top: 16px; }
.dublette-kopf { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.dublette-paar { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; } /* Knöpfe darunter in .aktionen-zeile (Knopflinie) */
.dublette-karte { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--rand); border-radius: 10px; background: var(--container); cursor: pointer; margin: 0; }
.dublette-karte:has(input:checked) { border-color: var(--signal); background: var(--flaeche-aktiv); }
.dublette-karte input { margin: 0 6px 0 0; }
.dublette-wahl { display: flex; align-items: center; } /* Optionsfeld und „behalten“ in einer Zeile */
.dublette > .aktionen-zeile { margin-top: 12px; }

/* Öffentliches Formular */
.honig { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }
.oeffentliches-formular .kontrollkaestchen { margin-top: 16px; }
body.schlicht.einbetten { padding: 0; min-height: 0; background: transparent; justify-content: flex-start; }
.einbett-box { max-width: 720px; margin: 0 auto; border: 0; }
.einbett-box .knopf { width: auto; }

/* ===== Sichtbarkeit: das hidden-Attribut schlägt jede Display-Regel ======= */
/* Einziges !important der Datei: Felder/Blöcke werden per Skript mit hidden ein- und ausgeblendet;
   ohne !important würden Regeln wie .zeilen-formular > label { display:flex } gewinnen. */
[hidden] { display: none !important; }

/* ===== 7 Responsiv ======================================================= */
@media (max-width: 1100px) {
  .spalten, .spalten-ticket { grid-template-columns: 1fr; }
  .dash-b-drittel, .dash-b-halb, .dash-b-zweidrittel { grid-column: span 6; }
}
@media (max-width: 1020px) {
  .gestalter { grid-template-columns: 1fr; }
}
/* Schmale Desktops: Seitenleiste nur mit Symbolen */
@media (max-width: 1100px) and (min-width: 861px) {
  .seitenleiste { width: var(--leiste-schmal); }
  .marke { align-items: center; padding: 16px 0; }
  .marke-text, .marke-logo, .seiten-nav a span, .fuss-link span, .support-knopf span, .leiste-knopf span,
  .nav-gruppe, .nav-zahl, .nav-neu, .bereich-hinweis, .benutzer-chip > div { display: none; }
  .marke .marke-badge { width: 34px; height: 34px; font-size: 15px; }
  .seiten-nav details.nav-klapp { display: contents; }
  /* Modul-Titel (summary), Selektor wie die Grundregel „.seiten-nav details.nav-klapp > summary { display:flex }“ — mit
     „.seiten-nav .nav-klapp > summary“ verlor das Ausblenden und die Titel liefen abgeschnitten über („Ticke“, „Sign“).
     Ohne Titel ließe sich eine zugeklappte Gruppe nicht öffnen: Wo der Browser ::details-content kennt, stehen ihre Einträge
     immer als Symbole da (sonst blendet er den Inhalt geschlossener <details> aus) und erst dann entfällt der Titel — beides in
     @supports. Ältere Browser (Safari vor 18.4, Firefox vor 143) behalten den Titel als kleine, umbrechende Beschriftung zum Aufklappen. */
  .seiten-nav details.nav-klapp > summary { justify-content: center; gap: 0; padding: 6px 2px; font-size: 10px; line-height: 1.2; text-align: center; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
  .seiten-nav details.nav-klapp > summary::before { display: none; }
  @supports selector(::details-content) {
    .seiten-nav details.nav-klapp > summary { display: none; }
    .seiten-nav details.nav-klapp::details-content { content-visibility: visible; display: contents; }
  }
  /* Einträge der Modul-Gruppen und Unterpunkte (eigene Einrückung) stehen mittig wie alle anderen Symbole */
  .marke, .seiten-nav a, .seiten-nav details.nav-klapp > a, .seiten-nav details.nav-klapp > a.nav-sub, .fuss-link, .support-knopf, .benutzer-chip, .leiste-knopf { justify-content: center; padding-left: 0; padding-right: 0; }
  /* Paket Z3: Unterpunkte eines direkten Modul-Links (Dienstleister › Kategorien) stehen nicht in <details> — ebenfalls mittig */
  .seiten-nav > a.nav-sub { justify-content: center; padding-left: 0; padding-right: 0; }
  /* Direkter Modul-Link (Dienstleister, Verträge): in der schmalen Leiste wie alle Einträge nur das Symbol */
  .seiten-nav a.nav-modul-link { margin-top: 0; }
  .seiten-nav a.nav-modul-link::before { display: none; }
  .seiten-nav a.nav-modul-link svg { display: revert; }
}
@media (max-width: 900px) {
  .stat-karten { grid-template-columns: 1fr 1fr; }
  .auth-buehne { grid-template-columns: 1fr; min-height: 0; }
  .auth-seite { padding: 32px 28px; gap: 20px; }
  .auth-name { font-size: 26px; margin-top: 12px; }
  .auth-produkte, .auth-claim { display: none; }
  .auth-formular.schlicht-box { padding: 32px 24px; }
  .dash-reiter { position: static; }
  .dash-reiter-knopf span { display: none; }
  .dash-reiter-knopf { padding: 0 12px; }
}
/* Übersicht 768–900 px (Tablet): Reiter mit Kurztext UNTER dem Symbol (kleinere Schrift, eine Zeile; zu Langes endet mit „…“,
   der volle Name steht im Tooltip) statt nur Symbol — zwölf Symbole ohne Namen waren nicht auseinanderzuhalten. Gleich breite
   Zellen (mind. 92 px, sonst wurden „Dienstplan“ und „Dienstleister“ beide zu „Diens…“); passen nicht alle in eine Zeile,
   bricht die Leiste in eine zweite um. „Anpassen“ steht immer in der letzten Spalte (rechts). Darunter (Handy) ersetzt eine
   Auswahlliste mit den Namen die Leiste (assets/kern-mobil.js), darüber steht der Name neben dem Symbol. */
@media (min-width: 768px) and (max-width: 900px) {
  .dash-reiter { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .dash-reiter-knopf { min-width: 0; flex-direction: column; justify-content: center; gap: 3px; padding: 0 4px; }
  .dash-reiter-knopf span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; line-height: 1.2; }
  .dash-reiter-knopf.dash-anpassen-knopf { grid-column: -2 / -1; margin-left: 0; }
}
/* ---------- Mobil & Tablet (≤ 860 px): Seitenleiste als Schublade, alles einspaltig, Tabellen scrollen ----------
   Regel: jede Seite muss auf 390 px Breite ohne waagerechtes Scrollen bedienbar sein (node docs/test-harness/mess.js --mobil). */
.nav-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--rand); border-radius: var(--radius); background: #fff; color: var(--text); align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding: 0; }
.nav-toggle svg { width: 22px; height: 22px; }
.nav-schleier { display: none; }
@media (max-width: 860px) {
  /* Touch-Ziele mindestens 40 px — als Token, damit jede Komponente automatisch mitzieht */
  :root { --inhalt-innen: 14px; --karte-innen: 16px; --knopf-klein-hoehe: 40px; --icon-knopf-hoehe: 40px; }
  .app { flex-direction: column; }
  .nav-toggle { display: inline-flex; }
  .seitenleiste, body.leiste-schmal .seitenleiste { position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); height: 100vh; z-index: 70; transform: translateX(-105%); transition: transform .2s ease; overflow-y: auto; box-shadow: none; border-right: 1px solid var(--rand); }
  body.nav-offen .seitenleiste { transform: none; box-shadow: 0 0 40px rgba(15, 23, 42, .25); }
  body.nav-offen .nav-schleier { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 60; }
  body.nav-offen { overflow: hidden; }
  body.leiste-schmal .marke-text, body.leiste-schmal .seiten-nav a span, body.leiste-schmal .nav-gruppe, body.leiste-schmal .fuss-link span, body.leiste-schmal .support-knopf span, body.leiste-schmal .benutzer-chip > div, body.leiste-schmal .seiten-nav .nav-klapp > summary { display: revert; }
  .leiste-knopf { display: none; }
  .topbar { gap: 10px; padding: 0 var(--inhalt-innen); }
  .topbar-pfad { display: none; }
  .topbar-suche { margin-left: auto; flex: 1 1 auto; max-width: 320px; }
  /* Kopfleiste im Sollmaß: Suchfeld 42 px wie jedes Feld, Hilfe 40 × 40 wie das Menü-Symbol daneben */
  .topbar-suche input { width: 100%; height: var(--feld-hoehe); }
  .hilfe-knopf span { display: none; }
  .hilfe-knopf { width: 40px; height: 40px; padding: 0; justify-content: center; flex-shrink: 0; }
  .inhalt { padding-bottom: 40px; }
  .seiten-kopf { padding: 14px var(--inhalt-innen) 12px; }
  .seiten-kopf h1 { font-size: 22px; }
  .seiten-kopf-aktionen { width: 100%; justify-content: flex-start; }
  .seiten-kopf-aktionen .knopf { flex: 1 1 auto; }
  .dp-monatnav strong { min-width: 0; }
  .zeilen-formular, .dp-rot-person, .spalten, .spalten-ticket, .et-manager { grid-template-columns: 1fr; }
  .zeilen-formular > label > .feld-kurz, .zeilen-formular > label > .feld-mittel { max-width: none; }
  /* Tabellen, Reiter und Chip-Leisten: Tablet (768–860 px) siehe Block direkt hinter diesem, Handy (≤ 767 px)
     im Abschnitt „Mobil: Fundament“ am Dateiende — dort scrollt nichts mehr seitlich */
  .aktion-icon { width: var(--icon-knopf-hoehe); height: var(--icon-knopf-hoehe); }
  .aktion-icon.aktion-icon-klein { width: var(--icon-knopf-hoehe); height: var(--icon-knopf-hoehe); }
  .liste-zeile { flex-wrap: wrap; }
  .liste-zeile .zeilen-aktionen { width: 100%; justify-content: flex-end; }
  .liste-zeile .zeilen-aktionen.nur-menue { width: auto; }   /* nur „⋯“: bleibt am Zeilenende (Handy: oben rechts, „Mobil: Fundament“) */
  .hilfe-panel, .dp-popover { max-width: 100vw; }
  .layout-hinweis { left: 10px; right: 10px; }
  .karte-kopfzeile > .aktionen-zeile, .karte-kopfzeile > .inline-formular, .karte-kopfzeile > form { flex: 1 1 100%; min-width: 0; max-width: 100%; }
  .inline-formular > *, .aktionen-zeile > *, .filter-leiste > * { max-width: 100%; min-width: 0; }
  .inline-formular > :where(input, select), .aktionen-zeile > :where(input, select) { min-width: 0; flex: 1 1 140px; }
  .inline-formular > input[type=file], .aktionen-zeile > input[type=file], label > input[type=file] { width: 100%; flex: 1 1 100%; }
  .filter-leiste .filter-chips { flex: 1 1 100%; }
  .modul-akkordeon > summary { flex-wrap: wrap; }
  .modul-akkordeon-rechts { margin-left: 0; flex: 1 1 100%; flex-wrap: wrap; }
  .einstellung-zeile > * { min-width: 0; max-width: 100%; }
  .einstellung-text { flex: 1 1 100%; min-width: 0; }
  .einstellung-zeile > :not(.einstellung-icon):not(.einstellung-text):not(.schalter):not([type=color]):not(.kontrollkaestchen):not(.knopf):not(button) { flex: 1 1 100%; }
  .einstellung-zeile > .schalter { width: 40px; flex: 0 0 40px; margin-left: auto; }
  .einstellung-zeile > input[type=color], .einstellung-zeile > .knopf, .einstellung-zeile > button { flex: 0 0 auto; margin-left: auto; }
  .inhalt > * { max-width: 100%; }
  /* Ausnahme: der Seitenkopf läuft mit negativem Rand randlos über die ganze Breite — mit der Deckelung oben
     blieb er 2 × --inhalt-innen zu schmal (rechts ein grauer Streifen, Trennlinie zu kurz) */
  .inhalt > .seiten-kopf { max-width: none; }
  /* Seitenleiste als Schublade: jeder Eintrag ein volles Touch-Ziel (Desktop-Leiste bleibt kompakt) */
  .seiten-nav a, .seiten-nav details.nav-klapp > a, .seiten-nav details.nav-klapp > summary, .fuss-link, .support-knopf { min-height: 40px; }
}
/* Tablet (768–860 px): breite Tabellen und Leisten scrollen wie bisher in ihrem Container — auf dem Handy nicht mehr */
@media (min-width: 768px) and (max-width: 860px) {
  .karte > .tabelle, .karte > form > .tabelle, .tabelle-umbruch { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .karte > .tabelle > tbody, .karte > .tabelle > thead { display: table; width: 100%; min-width: 560px; }
  .reiter-leiste { overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
  .reiter-leiste > * { flex-shrink: 0; }
  .filter-chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: thin; }
  .filter-chips .chip { flex-shrink: 0; }
  /* Auswahl-Chips (Zuständige, Eintragsart, Firma/Person …) müssen alle sichtbar sein — umbrechen statt scrollen;
     als Scroller im Fieldset zogen 34 Namen die ganze Seite auf 3600 px Breite */
  .filter-chips.chip-auswahl, .filter-chips.thema-wahl { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
  .filter-chips.chip-auswahl .chip, .filter-chips.thema-wahl .chip { flex-shrink: 1; }
  .tabelle-scroll { display: block; overflow-x: auto; }
  .tabelle-scroll > .tabelle { min-width: 560px; }
}
@media (max-width: 600px) {
  .feld-breit { min-width: 0; }
  .aktionen-zeile > :where(input, select), .inline-formular > :where(input, select) { min-width: 0; flex: 1 1 140px; }
  .aktionen-zeile > .knopf, .aktionen-zeile > button.knopf, .formular-karte .aktionen-zeile > .knopf { flex: 1 1 auto; text-align: center; }
  .filter-aktionen .knopf { flex: 1 1 auto; }
  input, select, textarea { font-size: 16px; } /* verhindert Auto-Zoom auf iOS */
  .karte { border-radius: 10px; }
  .zeilen-aktionen.zeilen-icons { gap: 6px; }
}

/* ---------- Etikettenmanager ---------- */
.et-manager { display: grid; grid-template-columns: minmax(340px, 480px) minmax(0, 1fr); gap: var(--formular-abstand); align-items: start; }
.et-seite { display: flex; flex-direction: column; gap: var(--formular-abstand); min-width: 0; }
.et-vorschau { min-width: 0; position: sticky; top: 16px; }
.et-buehne { overflow: hidden; background: var(--container); border: 1px solid var(--rand); border-radius: 10px; padding: 4px; margin-top: var(--formular-abstand); }
.et-skala { margin: 0; }
.et-skala .et-blatt { margin-bottom: 6mm; }
.et-skala .et-blatt:last-child { margin-bottom: 0; }
.et-anzahl { width: 90px; flex: 0 0 90px; text-align: center; }
.et-manager .liste-zeile { align-items: center; gap: 16px; }
@media (max-width: 1100px) { .et-manager { grid-template-columns: 1fr; } .et-vorschau { position: static; } }
/* Feld-Breite in Flex-Spalten (Label) nie als Höhe wirken lassen */
label > .feld-breit { flex: none; width: 100%; }
/* Verwaltung → Mandant → Add-on buchen: Auswahl, Menge und „Buchen“ in einer Zeile (Knopflinie, ui-richtlinien 3a) */
.addon-zeile { grid-template-columns: minmax(280px, 2fr) minmax(130px, 200px) auto; }
.aktion-icon.aktion-icon-primaer { background: var(--primaer); border-color: var(--primaer); color: #fff; }
.aktion-icon.aktion-icon-primaer svg { stroke: #fff; }
.text-gefahr { color: var(--gefahr); font-weight: 600; }

/* ---------- Support-Chat (schwebender Knopf + Panel) ---------- */
.support-fab { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: inline-flex; align-items: center; gap: 9px; height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: var(--primaer); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 10px 26px rgba(15, 23, 42, .28); transition: transform .15s, box-shadow .15s; }
.support-fab:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(15, 23, 42, .32); }
.support-fab svg { width: 20px; height: 20px; stroke: #fff; }
.support-fab-zahl { position: absolute; top: -6px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--gefahr); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.support-panel { position: fixed; right: 20px; bottom: 84px; z-index: 85; width: min(400px, calc(100vw - 40px)); height: min(600px, calc(100vh - 110px)); background: #fff; border: 1px solid var(--rand); border-radius: 16px; box-shadow: 0 24px 60px rgba(15, 23, 42, .28); display: flex; flex-direction: column; overflow: hidden; }
.support-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px; background: var(--primaer); color: #fff; }
.support-kopf strong { font-size: 16px; }
.support-kopf .klein { color: rgba(255, 255, 255, .85); margin-top: 2px; }
.support-zu { border: 0; background: rgba(255, 255, 255, .18); color: #fff; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; flex-shrink: 0; }
.support-zu:hover { background: rgba(255, 255, 255, .3); }
.support-inhalt { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.support-neu-knopf { width: 100%; }
.sup-liste { display: flex; flex-direction: column; gap: 8px; }
.sup-eintrag { display: flex; flex-direction: column; gap: 4px; text-align: left; width: 100%; padding: 12px 14px; border: 1px solid var(--rand); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; color: var(--text); }
.sup-eintrag:hover { border-color: var(--signal); background: var(--flaeche-aktiv); }
.sup-eintrag.sup-ungelesen { border-color: var(--signal); }
.sup-eintrag-titel { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.sup-punkt { width: 9px; height: 9px; border-radius: 50%; background: var(--gefahr); display: inline-block; }
.sup-zurueck { align-self: flex-start; color: var(--signal); font-weight: 600; }
.sup-betreff { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sup-verlauf { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.sup-verlauf-seite { max-height: 60vh; padding: 12px; background: var(--container); border: 1px solid var(--rand); border-radius: 12px; margin-bottom: var(--formular-abstand); }
.sup-nachricht { display: flex; flex-direction: column; max-width: 88%; }
.sup-nachricht.sup-ich { align-self: flex-end; align-items: flex-end; }
.sup-nachricht.sup-andere { align-self: flex-start; align-items: flex-start; }
.sup-blase { padding: 10px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.sup-ich .sup-blase { background: var(--primaer); color: #fff; border-bottom-right-radius: 4px; }
.sup-andere .sup-blase { background: #fff; border: 1px solid var(--rand); border-bottom-left-radius: 4px; }
.support-inhalt .sup-andere .sup-blase { background: var(--container); }
.sup-meta { font-size: 11.5px; color: var(--text-schwach); margin-top: 3px; padding: 0 4px; }
.sup-antwort { display: flex; flex-direction: column; gap: 10px; }
.sup-antwort textarea { margin: 0; }
.sup-form label + label { margin-top: var(--formular-abstand); }
.sup-fehler { color: var(--gefahr); }
.sup-leer { text-align: center; padding: 20px 0; }
.liste-zeile.ungelesen .liste-titel a { font-weight: 700; }
@media (max-width: 600px) {
  .support-fab { right: 14px; bottom: 14px; height: 48px; padding: 0 16px 0 14px; }
  .support-fab span { display: none; }
  .support-panel { right: 0; bottom: 0; width: 100vw; height: 100vh; border-radius: 0; border: 0; }
  body.support-offen { overflow: hidden; }
}
.marke-text.marke-nur-logo small { margin-top: 2px; }
.protokoll-text { white-space: pre-wrap; word-break: break-word; font-size: 12.5px; line-height: 1.5; background: var(--container); border: 1px solid var(--rand); border-radius: 10px; padding: 12px 14px; max-height: 420px; overflow: auto; margin: 0 0 var(--formular-abstand); }
.zeitstrahl-felder { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 6px 0 4px; font-size: 13.5px; }
.zeitstrahl-felder dt { color: var(--text-schwach); font-weight: 500; }
.zeitstrahl-felder dd { margin: 0; color: var(--text); }
.auth-form .auth-haken { font-size: 13.5px; font-weight: 400; line-height: 1.45; align-items: flex-start; }
.auth-form .auth-haken input { margin-top: 3px; }
hr.trenner { border: 0; border-top: 1px solid var(--rand); margin: var(--formular-abstand) 0; }
/* Einstellungen: Reiter je Thema; WYSIWYG-Editor für Mail-Vorlagen */
.einstellungen-reiter { flex-wrap: wrap; margin-bottom: var(--formular-abstand); }
.einstellungen-reiter .reiter { text-decoration: none; display: inline-flex; align-items: center; }
.wysiwyg { border: 1px solid var(--rand-stark); border-radius: var(--radius); background: #fff; margin-top: var(--beschriftung-abstand); }
.wysiwyg:focus-within { border-color: var(--signal); box-shadow: 0 0 0 3px var(--fokus-ring); }
.wysiwyg-leiste { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--rand); background: var(--container); border-radius: var(--radius) var(--radius) 0 0; align-items: center; }
.wysiwyg-knopf { height: 30px; min-width: 32px; padding: 0 8px; border: 1px solid var(--rand); border-radius: 6px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); }
.wysiwyg-knopf:hover, .wysiwyg-knopf.aktiv { border-color: var(--signal); color: var(--signal); }
.wysiwyg-platzhalter { height: 30px; font-size: 13px; margin: 0 0 0 auto; width: auto; min-width: 180px; }
.wysiwyg-flaeche { min-height: 220px; padding: 12px 14px; outline: none; font-size: 14.5px; line-height: 1.55; }
.wysiwyg-flaeche p { margin: 0 0 10px; } .wysiwyg-flaeche h1, .wysiwyg-flaeche h2, .wysiwyg-flaeche h3 { margin: 12px 0 8px; font-size: 18px; }
.wysiwyg-flaeche ul, .wysiwyg-flaeche ol { margin: 0 0 10px 22px; } .wysiwyg-flaeche a { color: var(--signal); }
.wysiwyg-quelle { display: block; width: 100%; margin: 0; border: 0; border-radius: 0 0 var(--radius) var(--radius); font-family: Menlo, Consolas, monospace; font-size: 13px; min-height: 220px; }
.sup-bild { display: block; margin-top: 8px; } .sup-bild img { max-width: 100%; max-height: 260px; border-radius: 8px; border: 1px solid var(--rand); display: block; background: #fff; }
.sup-ich .sup-bild img { border-color: rgba(255, 255, 255, .5); }
.sup-datei { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, .25); font-size: 13px; text-decoration: none; color: inherit; border: 1px solid rgba(0, 0, 0, .08); }
.sup-datei svg { width: 14px; height: 14px; }
.sup-datei-feld { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 400; color: var(--text-schwach); margin: 0; }
.sup-datei-feld input { width: auto; margin: 0; font-size: 12.5px; }
/* Balkendiagramm als HTML (feste Höhe, keine Skalierung) */
.dia { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 0 8px; padding: 6px 0 0; }
.dia.dia-breit { grid-template-columns: 84px 1fr; }
.dia-y { position: relative; height: 200px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: 12px; color: var(--text-schwach); font-variant-numeric: tabular-nums; transform: translateY(-7px); padding-bottom: 0; }
.dia-plot { position: relative; height: 200px; border-bottom: 1px solid var(--rand-stark); }
.dia-linie { position: absolute; left: 0; right: 0; height: 1px; background: var(--rand-weich); }
.dia-balken { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-around; gap: 6px; padding: 0 4px; }
.dia-spalte { position: relative; flex: 1 1 0; max-width: 56px; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.dia-stab { width: 62%; max-width: 30px; min-width: 6px; background: var(--primaer); border-radius: 5px 5px 2px 2px; transition: opacity .15s; }
.dia-stab-aktuell { background: var(--primaer-dunkel, #1d4ed8); }
.dia-stab-leer { height: 2px !important; background: var(--rand); border-radius: 1px; }
.dia-spalte:hover .dia-stab { opacity: .8; }
.dia-label { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--text-schwach); white-space: nowrap; }
.dia-label-aus { display: none; }
.dia-einheit { grid-column: 2; font-size: 11px; letter-spacing: .04em; color: var(--text-schwach); margin-top: 30px; }
@media (max-width: 600px) { .dia-y, .dia-plot { height: 150px; } .dia-label { font-size: 11px; } .dia-spalte:nth-child(even) .dia-label { display: none; } }
/* Handy: lange Beschriftungen („Kaltwasser · OG Zählertest“) überlappten sich und ragten über den Rand — die Seite war bei 390 px
   411 px breit (Zählerübersicht). Jede sichtbare Beschriftung höchstens so breit wie ihr Platz (zwei Spalten, jede zweite ist
   ausgeblendet), sonst „…“ (der volle Name steht im title der Spalte); die letzte schließt rechts bündig mit dem Diagramm ab. */
@media (max-width: 600px) {
  .dia-label { max-width: calc(200% + 6px); overflow: hidden; text-overflow: ellipsis; }
  .dia-spalte:last-child .dia-label { left: auto; right: 0; max-width: calc(150% + 6px); transform: none; text-align: right; }
}
/* Support-Panel: Verlauf bekommt den Platz, Antwortbereich kompakt */
.support-inhalt { overflow: hidden; }
.support-inhalt > .sup-liste, .support-inhalt > .sup-form { overflow-y: auto; }
.support-inhalt .sup-verlauf { flex: 1 1 auto; min-height: 120px; overflow-y: auto; }
.support-inhalt .sup-antwort { flex: 0 0 auto; gap: 8px; }
.support-inhalt .sup-antwort textarea { min-height: 0; padding: 8px 12px; font-size: 14px; }
.sup-zeile { align-items: center; gap: 8px; flex-wrap: nowrap; }
.sup-zeile .knopf { flex: 0 0 auto; }
.sup-anhang { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; font-size: 12.5px; color: var(--text-schwach); cursor: pointer; min-width: 0; flex: 1 1 auto; }
.sup-anhang-knopf { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid var(--rand-stark); border-radius: var(--radius); background: #fff; font-size: 18px; flex-shrink: 0; }
.sup-anhang:hover .sup-anhang-knopf { border-color: var(--signal); }
.sup-anhang-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-inhalt .sup-bild img { max-height: 160px; }
.support-inhalt .sup-nachricht { max-width: 92%; }
.sup-datei-feld { display: none; }
.support-inhalt .aktionen-zeile { margin-top: 0; }
@media (max-width: 600px) { .sup-zeile .knopf { flex: 0 0 auto; } }
.aktionen-zeile > label.sup-anhang { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; }
.support-knopf .nav-neu { margin-left: auto; }
.aktion-icon.aktion-icon-klein { width: 26px; height: 26px; border-radius: 6px; }
.aktion-icon.aktion-icon-klein svg { width: 13px; height: 13px; }
/* Aufklapper „+ … anlegen“: mit Abstand und Trennlinie, wenn darüber schon Inhalt steht */
.karte > * + .anlegen-akkordeon { margin-top: var(--formular-abstand); border-top: 1px solid var(--rand-weich); }
.karte > h2 + .anlegen-akkordeon, .karte > .karte-kopfzeile + .anlegen-akkordeon { margin-top: 4px; border-top: 0; }
/* CRM: Themen-Blöcke im Verlauf, luftigere Kommunikation */
.thema-block { border: 1px solid var(--rand); border-radius: 12px; padding: 0; margin-top: var(--formular-abstand); background: #fff; }
.thema-block > summary::-webkit-details-marker { display: none; }
.thema-block > summary:hover { background: var(--container); }
.thema-block[open] > summary { border-bottom: 1px solid var(--rand); border-radius: 12px 12px 0 0; }
.thema-titel svg { width: 16px; height: 16px; stroke: var(--signal); }
.thema-titel b { font-weight: 700; }
.thema-inhalt .zeitstrahl { margin-top: 4px; }
.thema-erledigt > summary { opacity: .75; }
.thema-ohne { padding: 0; }
.thema-wv > svg { width: 16px; height: 16px; stroke: #b45309; flex-shrink: 0; }
.thema-wv-ueber { border-color: #fecaca; background: #fef2f2; } .thema-wv-ueber > svg { stroke: var(--gefahr); }
.zeitstrahl-eintrag + .zeitstrahl-eintrag { border-top: 1px solid var(--rand-weich); }
.komm-zeile > summary { gap: 6px; align-items: flex-start; text-align: left; }
.komm-zeile .liste-titel, .komm-zeile > summary > .klein { justify-content: flex-start; width: 100%; }
.komm-inhalt { margin-top: 14px; padding: 14px 16px; }
.zeitstrahl-von { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.zeitstrahl-von i { width: 20px; height: 20px; border-radius: 50%; background: var(--primaer); color: #fff; font-style: normal; font-weight: 700; font-size: 10.5px; display: inline-flex; align-items: center; justify-content: center; }
.zeitstrahl-von b { font-weight: 600; }
.komm-von b { font-weight: 600; color: var(--text); }

/* Marke in der Seitenleiste: Bildlogo mittig, Text darunter zentriert */
.seitenleiste .marke { align-items: center; text-align: center; }
.seitenleiste .marke .marke-logo { margin: 0 auto; display: block; }
.seitenleiste .marke .marke-text { align-items: center; }
/* Favicon: im Tab und in der eingeklappten Seitenleiste statt Badge */
.marke-favicon { display: none; }
body.leiste-schmal .marke-favicon { display: block; width: 34px; height: 34px; object-fit: contain; border-radius: 8px; }
body.leiste-schmal .marke:has(.marke-favicon) .marke-badge { display: none; }
.einstellung-favicon { width: 32px; height: 32px; object-fit: contain; vertical-align: middle; border-radius: 6px; border: 1px solid var(--rand); background: #fff; margin-right: 6px; }
body.leiste-schmal .seitenleiste .marke .marke-logo, body.leiste-schmal .seitenleiste .marke .marke-text { display: none; }
/* Paketwahl (kern/module.php paket_wahl_html: Neuer Mandant, „+ Paket buchen“, Buchung im Portal) — Gruppen zum Aufklappen, je Karte
   ruhig: Haken · Name … Preis in einer Zeile, darunter Module und Beschreibung (Patrick 08.10.2026: vorher eine Wand aus Karten) */
.tarif-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
/* align-content: start — eine Karte neben einer höheren Nachbarin wird gestreckt; die Zusatzhöhe bleibt unten statt als Leerzeile
   zwischen Name und Beschreibung */
.tarif-karte { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 2px; align-items: baseline; align-content: start; padding: 10px 12px; border: 1px solid var(--rand); border-radius: 10px; cursor: pointer; font-weight: 400; margin: 0; background: #fff; }
.tarif-karte:has(input:checked) { border-color: var(--signal); background: var(--flaeche-aktiv); }
.tarif-karte > input { width: auto; margin: 0; align-self: center; }
.tarif-karte > .klein { grid-column: 2 / -1; }
/* Ein langes Einzelwort („Hausverwaltung“) bricht in seiner Spalte um, statt über den Preis zu laufen */
.tarif-name { font-weight: 600; font-size: 14.5px; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.tarif-preis { font-size: 14.5px; font-weight: 600; white-space: nowrap; } .tarif-preis small { font-size: 12px; font-weight: 500; color: var(--text-schwach); }
.paket-wahl-zahl { color: var(--signal); } .paket-wahl-zahl:empty { display: none; }
/* Gruppenkopf: am Handy rutscht „14 · je ein Modul · ab 9,90 €“ unter den Namen, statt ihn zu zerteilen („Signage-/Größen“) */
.paket-wahl-gruppe > summary { flex-wrap: wrap; row-gap: 2px; }
.paket-wahl-gruppe > summary .klein { flex: 0 1 auto; min-width: 0; }
/* Mandant → Add-ons: Menge je Zeile mit „Speichern“ daneben */
.inline-formular.addon-menge { gap: 8px; align-items: center; }
/* Rechtstexte */
.rechtstext { max-width: 720px; font-size: 14.5px; line-height: 1.6; white-space: normal; }
.rechtstext h1, .rechtstext h2, .rechtstext h3 { margin: 18px 0 8px; }
.rechtstext-feld { font-size: 13.5px; font-family: Menlo, Consolas, monospace; }
/* Vorgangsseite: links Eintrag + Themen/Verlauf, rechts Details; Kommunikation als Karten; Chat-Knopfzeile */
.spalten.crm-detail { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); }
.spalten.crm-detail > .spalte-haupt, .spalten.crm-detail > .spalte-seite { min-width: 0; display: flex; flex-direction: column; gap: var(--karte-abstand); }
.spalten.crm-detail .karte { margin: 0; }
@media (max-width: 1100px) { .spalten.crm-detail { grid-template-columns: 1fr; } }
/* Lange Wörter ohne Leerzeichen (Namen, Adressen, Betreffs aus Daten) brechen um — ein 60-Zeichen-Name machte die Seite am Handy
   576 statt 390 px breit (Prüfstand, 08.10.2026) */
.komm-zeile .liste-titel { font-size: 14.5px; overflow-wrap: anywhere; }
.komm-inhalt { margin-left: 0; }
.thema-wv > summary::-webkit-details-marker { display: none; }
.thema-wv-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid #fde68a; display: flex; flex-direction: column; gap: 10px; }
.thema-wv-form textarea { background: #fff; }
.eintrag-wv { border: 1px dashed var(--rand-stark); border-radius: 10px; padding: 0; }
.eintrag-wv > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; color: var(--signal); list-style: none; }
.eintrag-wv > summary::-webkit-details-marker { display: none; }
.eintrag-wv > summary::before { content: none; }
.eintrag-wv[open] > summary { border-bottom: 1px dashed var(--rand-stark); }
.eintrag-wv > .zeilen-formular, .eintrag-wv > p { margin: 12px 14px; }
.sup-zeile .sup-anhang { flex: 0 1 auto; max-width: 42%; }
.sup-zeile { justify-content: flex-start; }
/* Hinweis „Persönliche Anordnung“ links unten, damit der Support-Knopf rechts frei bleibt */
.layout-hinweis { right: auto; left: calc(var(--leiste-breite) + 24px); bottom: 20px; }
body.leiste-schmal .layout-hinweis { left: calc(var(--leiste-schmal) + 24px); }
@media (max-width: 860px) { .layout-hinweis { left: 12px; right: 84px; bottom: 76px; } }
/* Verlauf kompakt: Karte je Eintrag, Kopfzeile Autor · Zeit · Art, Titel, kurzer Text, Mails aufklappbar */
.zeitstrahl-eintrag.ist-komm { background: #fbfcff; }
.zeitstrahl-kopf .abzeichen { font-size: 11px; padding: 1px 7px; }
.zeitstrahl-zeit { font-variant-numeric: tabular-nums; }
.zeitstrahl-mehr > summary, .zeitstrahl-eintrag .komm-details > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.zeitstrahl-mehr > summary::-webkit-details-marker, .zeitstrahl-eintrag .komm-details > summary::-webkit-details-marker { display: none; }
.zeitstrahl-mehr > summary .klein, .zeitstrahl-eintrag .komm-details > summary .klein { color: var(--signal); }
.zeitstrahl-mehr[open] > summary .zeitstrahl-inhalt { display: none; }
.zeitstrahl-eintrag .komm-details { margin: 0; } .zeitstrahl-eintrag .komm-inhalt { margin: 8px 0 0; padding: 10px 12px; font-size: 13.5px; }
.zeitstrahl-eintrag .komm-details[open] > summary .zeitstrahl-vorschau { display: none; }
.zeitstrahl-felder { font-size: 13px; margin: 2px 0; }
/* Themen kompakter */
.thema-wv-text .klein { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.thema-wv-text b { font-size: 14px; }
/* (Höhe kommt aus .knopf-klein / --knopf-klein-hoehe) */
/* Thema-Wahl im Eintragsformular */
.thema-wahl-block { background: var(--flaeche-aktiv); border: 1px solid var(--rand); border-radius: 12px; padding: 14px 16px; margin-bottom: var(--formular-abstand); }
.thema-wahl-kopf { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.thema-wahl-kopf b { font-size: 15px; color: var(--signal); }
.thema-wahl-block .zeilen-formular { margin-top: var(--formular-abstand); }
/* Verlauf & Kommunikation luftiger: Thema-Kopf links, Knöpfe rechts alle gleich hoch (32 px) und mittig; Mail-Vorschau linksbündig mit Pfeil */
.thema-block > summary::before { align-self: center; }
.thema-titel .klein { font-weight: 400; }
.thema-aktionen .knopf, .thema-aktionen .inline-formular .knopf, .thema-aktionen .knopf-klein, .thema-aktionen .inline-formular .knopf-klein { height: var(--knopf-klein-hoehe); line-height: calc(var(--knopf-klein-hoehe) - 2px); padding: 0 12px; font-size: 13px; font-weight: 500; margin: 0; display: inline-flex; align-items: center; }
.thema-aktionen .inline-formular { display: inline-flex; align-items: center; margin: 0; gap: 0; }
.thema-wv > summary:hover { background: none; }
.thema-wv > summary::before { align-self: center; }
.thema-wv > summary > .knopf { height: var(--knopf-klein-hoehe); line-height: calc(var(--knopf-klein-hoehe) - 2px); padding: 0 12px; font-size: 13px; font-weight: 500; margin: 0; margin-left: auto; display: inline-flex; align-items: center; flex-shrink: 0; }
.thema-wv-text .klein { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.thema-wv-text b { font-size: 14.5px; }
.zeitstrahl-mehr > summary, .zeitstrahl-eintrag .komm-details > summary { flex-direction: row; flex-wrap: wrap; align-items: flex-start; justify-content: flex-start; gap: 4px 10px; padding: 10px 12px; font-weight: 400; color: var(--text-2); background: var(--flaeche-still); border-radius: 8px; text-align: left; }
.zeitstrahl-mehr > summary:hover, .zeitstrahl-eintrag .komm-details > summary:hover { background: var(--container); color: var(--text-2); }
.zeitstrahl-mehr > summary::before, .zeitstrahl-eintrag .komm-details > summary::before { margin-top: 4px; }
.zeitstrahl-mehr > summary .zeitstrahl-inhalt, .zeitstrahl-eintrag .komm-details > summary .zeitstrahl-vorschau { flex: 1 1 320px; min-width: 0; }
.zeitstrahl-mehr > summary .klein, .zeitstrahl-eintrag .komm-details > summary .klein { flex: 0 0 auto; white-space: nowrap; align-self: center; font-weight: 500; }
.zeitstrahl-eintrag .komm-details[open] > summary { border-radius: 8px 8px 0 0; }
.zeitstrahl-eintrag .komm-inhalt { margin: 0; border-radius: 0 0 8px 8px; padding: 12px 14px; }
@media (max-width: 860px) {
  /* Maße für Themen und Verlauf stehen am Dateiende hinter dem Sammelblock */
  .thema-aktionen .inline-formular { flex: 0 0 auto; }
  .thema-wv > summary > .knopf { margin-left: 0; width: 100%; justify-content: center; }
  .zeitstrahl-mehr > summary .klein, .zeitstrahl-eintrag .komm-details > summary .klein { white-space: normal; }
}
/* Einstellungen: lange Texte (AGB, Datenschutz, Impressum …) in voller Breite unter der Beschriftung statt als schmales Feld rechts */
.einstellung-zeile-breit { flex-direction: column; align-items: stretch; gap: var(--beschriftung-abstand); }
.einstellung-zeile-breit .einstellung-aktion { margin-left: 0; width: 100%; }
.einstellung-zeile-breit .einstellung-aktion textarea { width: 100%; max-width: 100%; margin: 0; }
.einstellung-aktion textarea { width: 100%; }
.einstellung-aktion input[type=text].feld-mittel { width: 320px; }
/* Mail-Matrix: kleiner Editor immer sichtbar, Textfassung als schlichter Aufklapper */
.wysiwyg-minimal .wysiwyg-flaeche { min-height: 170px; font-size: 14.5px; }
.wysiwyg-minimal .wysiwyg-leiste { gap: 6px; padding: 8px 10px; }
.wysiwyg-knopf { font-weight: 500; white-space: nowrap; }
.wysiwyg-knopf b, .wysiwyg-knopf i, .wysiwyg-knopf u { font-weight: 700; }
.wysiwyg-still { color: var(--text-schwach); font-weight: 400; }
.einstellung-aufklapp-schlicht { margin-top: var(--formular-abstand); border: 1px dashed var(--rand-stark); border-radius: 10px; }
.einstellung-aufklapp-schlicht > summary { padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.einstellung-aufklapp-schlicht[open] > summary { border-bottom: 1px dashed var(--rand-stark); border-radius: 10px 10px 0 0; }
.einstellung-aufklapp-schlicht > textarea { margin: 12px 14px; width: calc(100% - 28px); }
/* Verlauf: auch der erste Eintrag je Thema hat oben Innenabstand; Symbol und Kopfzeile auf einer Höhe; Umbrüche nicht doppelt */
.zeitstrahl-eintrag > .zeitstrahl-icon { margin-top: 0; align-self: flex-start; }
.zeitstrahl-eintrag > .zeitstrahl-text > .zeitstrahl-kopf { min-height: 28px; align-items: center; }
@media (max-width: 860px) { .zeitstrahl-eintrag, .zeitstrahl-eintrag:first-child { padding: 12px; } }

/* Aufklapp-Panel an Zeilenenden öffnet nach links, damit es nicht aus dem Fenster läuft */
.dp-rot-anwenden-panel { text-align: left; }
@media (max-width: 860px) { .dp-rot-anwenden-panel { right: auto; left: 0; width: min(420px, calc(100vw - 32px)); } }
/* Abgeschlossener Auftrag: Hinweis statt Statusfelder, nur noch Notiz möglich */
.dl-abgeschlossen { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin: 0 0 var(--formular-abstand); background: var(--flaeche-still); border: 1px solid var(--rand); border-radius: 10px; font-size: 14.5px; color: var(--text-2); }
.dl-abgeschlossen svg { width: 18px; height: 18px; stroke: var(--gruen, #15803d); flex-shrink: 0; margin-top: 2px; }
/* Dubletten mobil: die beiden Karten und die Aktionen untereinander statt drei Spalten nebeneinander */
@media (max-width: 860px) {
  .dublette { padding: 14px 16px; }
  .dublette-paar { grid-template-columns: 1fr; gap: 10px; }
}
/* Lange Feldhilfen hinter einem Fragezeichen: die Feldzeile bleibt auf ihrer natürlichen Höhe */
.feld-hilfe-knopf { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 6px; padding: 0; vertical-align: -3px; border: 1px solid var(--rand-stark); border-radius: 50%; background: #fff; color: var(--text-schwach); font-weight: 400; font-size: 13.3333px; line-height: normal; cursor: pointer; }
/* Schrift: die frühere Kurzschreibweise „font: 600 12px/1 inherit“ war ungültig (inherit geht nur allein) und wurde verworfen —
   sichtbar waren die Knopf-Vorgaben des Browsers (normal, 13,33 px, Zeilenhöhe normal). Genau die stehen jetzt ausdrücklich da;
   die Schriftart kommt aus „button { font-family: inherit }“. */
.feld-hilfe-knopf:hover, .feld-hilfe-knopf.offen { border-color: var(--signal); color: var(--signal); }
.feld-hilfe-knopf:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.feld-hilfe-knopf + .feld-hilfe { margin-top: 6px; padding: 8px 10px; background: var(--flaeche-still); border-radius: 8px; font-size: 12.5px; }
/* Mobil bleibt das Fragezeichen klein, damit die Beschriftungszeile ihre Höhe behält; die Tippfläche
   wird über ein unsichtbares Feld darum auf 40 px vergrößert. */
.feld-hilfe-knopf { position: relative; }
/* Größe bleibt auch mobil bei 20 px, damit die Beschriftungszeile ihre Höhe behält —
   die Tippfläche wird unsichtbar auf 40 px erweitert. */
.feld-hilfe-knopf::after { content: ''; position: absolute; inset: -10px; }
/* Rechte je Modul: die Kästchenliste mehrspaltig statt als endlose Kolonne.
   ACHTUNG: .rechte-gruppe ist die allgemeine Fieldset-Klasse und steckt in vielen Formularen —
   deshalb NUR die Kästchenliste selbst umstellen, nicht das Fieldset. */
.rechte-kaestchen { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 24px; align-items: start; }
/* Im Raster gibt der Zeilenabstand (gap) die Luft — „.kontrollkaestchen + .kontrollkaestchen“ schob sonst das 2. und 3. Kästchen
   der ersten Zeile 8 px tiefer als das erste (Linie versetzt) */
.rechte-kaestchen > .kontrollkaestchen + .kontrollkaestchen { margin-top: 0; }
@media (max-width: 860px) { .rechte-kaestchen { grid-template-columns: 1fr; } }
/* Kleine Icon-Knöpfe brauchen mobil ein volles Touch-Ziel (steht bewusst am Dateiende, damit es die
   Grundregel weiter oben schlägt) */
@media (max-width: 860px) {
  .aktion-icon.aktion-icon-klein { width: var(--icon-knopf-hoehe); height: var(--icon-knopf-hoehe); }
  .aktion-icon.aktion-icon-klein svg { width: 17px; height: 17px; }
}
/* Farbfelder im Gestalter-Inspektor: schmal, aber auf Feldhöhe wie jedes andere Feld daneben */
.inspektor-farbe { min-width: 52px; width: 52px; height: var(--feld-hoehe); padding: 3px; }

/* =========================================================================================
   Verlauf & Themen (CRM-Vorgang, Kommunikation) — EINE Definition je Selektor.
   Vorher standen diese Klassen bis zu sechsmal in der Datei und haben sich gegenseitig
   überschrieben; das war die Ursache für „Text klebt am Rand“ und ungleiche Knopfhöhen.
   Werte entsprechen exakt dem vorherigen Endergebnis (am Harness gemessen).
   ========================================================================================= */
.zeitstrahl { display: flex; flex-direction: column; gap: 10px; }
.zeitstrahl-eintrag { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--rand); border-radius: 10px; background: #fff; }
.zeitstrahl-eintrag.ist-komm { background: #fbfcff; }
.zeitstrahl-icon { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--flaeche-aktiv); color: var(--signal); flex-shrink: 0; }
.zeitstrahl-icon svg { width: 14px; height: 14px; }
.zeitstrahl-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.zeitstrahl-kopf { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; color: var(--text-schwach); }
.zeitstrahl-titel { font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.35; }
.zeitstrahl-inhalt { font-size: 13.5px; line-height: 1.5; color: var(--text-2); white-space: normal; }
.zeitstrahl-vorschau { font-size: 13.5px; line-height: 1.5; color: var(--text-2); white-space: normal; }

.thema-block > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; padding: 14px 18px; cursor: pointer; border-radius: 12px; font-weight: 600; font-size: 14.5px; color: var(--text-2); }
.thema-titel { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; font-size: 14px; flex: 1 1 260px; min-width: 0; justify-content: flex-start; }
.thema-aktionen { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.thema-inhalt { padding: 16px 18px 18px; }
.thema-ohne > .thema-titel { padding: 14px 18px; border-bottom: 1px solid var(--rand); }
.thema-wv { display: block; padding: 12px 14px; margin-bottom: 12px; border: 1px solid #fde68a; background: #fffbeb; border-radius: 10px; }
.thema-wv > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 0; cursor: pointer; font-weight: 400; color: inherit; background: none; border-radius: 10px; }
.thema-wv > summary:hover { background: none; }
.thema-wv-text { flex: 1; min-width: 0; }

.komm-zeile { display: block; padding: 14px 16px; margin-bottom: 10px; border: 1px solid var(--rand); border-radius: 10px; background: #fff; }

/* Mobil-Abweichungen für Verlauf & Themen — MUSS hinter dem Sammelblock stehen, sonst gewinnt
   dort die Grundregel (gleiche Spezifität, spätere Regel schlägt die frühere). */
@media (max-width: 860px) {
  .thema-block > summary { padding: 12px 14px; }
  .thema-inhalt { padding: 12px 14px 14px; }
  .thema-ohne > .thema-titel { padding: 12px 14px; }
  .thema-aktionen { margin-left: 0; width: 100%; }
  .thema-wv { padding: 10px 12px; margin-bottom: 10px; }
  .thema-wv > summary { flex-wrap: wrap; }
  .zeitstrahl-eintrag { padding: 12px; }
}
/* Mobil: Eingabefelder mit weniger als 16 px Schrift lösen in Safari auf dem iPhone einen
   Auto-Zoom aus, aus dem der Benutzer nicht mehr herausfindet. Deshalb überall mindestens 16 px. */
@media (max-width: 860px) {
  .topbar-suche input, .dp-bem-eingabe, .sup-eingabe textarea, .sup-eingabe input,
  .hilfe-panel input, .hilfe-panel select, .scan-schritt input, .scan-schritt select,
  input, select, textarea { font-size: 16px; }
}
/* Schublade und Panels: dvh statt vh, sonst liegt der untere Rand unter der Browserleiste des Handys */
@supports (height: 100dvh) {
  @media (max-width: 860px) {
    .seitenleiste, body.leiste-schmal .seitenleiste { height: 100dvh; }
    .hilfe-panel { height: 100dvh; }
    .support-panel { height: min(600px, calc(100dvh - 110px)); }
  }
}
/* Kalender: das „+“ war nur beim Überfahren sichtbar, blieb aber antippbar. Auf Touch-Geräten
   und bei Tastaturbedienung ist es jetzt dauerhaft zu sehen. */
.kal-plus:focus-visible { opacity: 1; outline: 2px solid var(--signal); outline-offset: 1px; }
@media (hover: none) { .kal-plus { opacity: .55; } }
@media (max-width: 860px) { .kal-plus { opacity: .55; width: var(--icon-knopf-hoehe); height: var(--icon-knopf-hoehe); } }
/* Auftrag beim Dienstleister: wen anrufen, wo ist es, wer zahlt — als drei kompakte Karten */
.dl-kontakte { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: var(--formular-abstand) 0 0; }
.dl-kontakt-karte { border: 1px solid var(--rand); border-radius: 10px; padding: 12px 14px; background: var(--flaeche-still); }
.dl-kontakt-kopf { display: flex; align-items: flex-start; gap: 9px; }
.dl-kontakt-kopf svg { width: 16px; height: 16px; stroke: var(--signal); flex-shrink: 0; margin-top: 3px; }
.dl-kontakt-kopf .klein { display: block; color: var(--text-still); }
.dl-kontakt-kopf b { font-size: 14.5px; line-height: 1.3; }
.dl-kontakt-liste { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 10px 0 0; font-size: 13.5px; }
.dl-kontakt-liste dt { color: var(--text-still); }
.dl-kontakt-liste dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* Abrechnung je Auftrag: kompakter Aufklapper unter der Rückmeldung */
.dl-abrechnung { margin-top: var(--formular-abstand); border: 1px dashed var(--rand-stark); border-radius: 10px; }
.dl-abrechnung > summary { padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--text-2); gap: 8px; }
.dl-abrechnung > summary svg { width: 15px; height: 15px; stroke: var(--text-schwach); }
.dl-abrechnung[open] > summary { border-bottom: 1px dashed var(--rand-stark); }
.dl-abrechnung > form { padding: 14px; }
/* Tabelle innerhalb einer Listenzeile (z. B. Zählerstände am Objekt) braucht Abstand nach oben */
.liste-haupt > .tabelle-umbruch { margin-top: var(--formular-abstand); }
.liste-haupt > .tabelle-umbruch + form { margin-top: var(--formular-abstand); }
.zaehler-tabelle { font-size: 13.5px; }
.zaehler-tabelle th { white-space: nowrap; }
/* Dienstplan: Zeile der Person hervorheben, damit man beim Klicken die Spur nicht verliert */
.dp-raster tbody tr.dp-person-aktiv > td,
.dp-raster tbody tr.dp-person-aktiv > th { background-image: linear-gradient(var(--flaeche-aktiv), var(--flaeche-aktiv)); }
.dp-raster tbody tr.dp-person-aktiv > .dp-name { box-shadow: inset 3px 0 0 var(--signal); font-weight: 700; }
.dp-raster tbody tr:hover > .dp-name { color: var(--signal); }
.dp-pop-stunden { width: 100%; }
/* Beteiligte am Ticket-Verlauf */
.ticket-beteiligte { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--formular-abstand); }
.ticket-beteiligter { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--rand); border-radius: 999px; background: var(--flaeche-still); font-size: 13.5px; }
.ticket-beteiligter b { font-weight: 600; }
.ticket-beteiligter .inline-formular { margin: 0; }
/* Tarif und Abschlag je Zähler: kompakter Aufklapper in der Zählerzeile */
.zaehler-tarif { margin-top: var(--formular-abstand); border: 1px dashed var(--rand-stark); border-radius: 10px; max-width: 100%; min-width: 0; }
.zaehler-tarif > summary { padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--text-2); gap: 8px; flex-wrap: wrap; }
.zaehler-tarif > summary svg { width: 15px; height: 15px; stroke: var(--text-schwach); }
.zaehler-tarif[open] > summary { border-bottom: 1px dashed var(--rand-stark); }
.zaehler-tarif-inhalt { padding: 14px; display: flex; flex-direction: column; gap: var(--formular-abstand); min-width: 0; }
.zaehler-tarif-inhalt form { margin: 0; }
/* Der Tarif-Aufklapper darf mobil nicht breiter werden als die Zählerzeile */
@media (max-width: 860px) { .zaehler-tarif-inhalt { padding: 12px; } }
/* Mailmatrix: kurze Ansage über den Empfänger-Haken */
.matrix-hinweis { margin: var(--formular-abstand) 0 6px; color: var(--text-schwach); }
/* Empfänger-Vorschau: je Mail-Art eine Zeile mit Abzeichen, aufklappbar mit den konkreten Adressen */
.mail-vorschau { border: 1px solid var(--rand); border-radius: 10px; overflow: hidden; margin-top: var(--formular-abstand); }
.mail-vorschau-zeile + .mail-vorschau-zeile { border-top: 1px solid var(--rand); }
.mail-vorschau-zeile > summary { padding: 11px 14px; gap: 8px; flex-wrap: wrap; font-weight: 400; font-size: 14.5px; color: var(--text); border-radius: 0; }
.mail-vorschau-zeile[open] > summary { background: var(--flaeche-aktiv); }
.mail-vorschau-titel { font-weight: 600; margin-right: 4px; }
.mail-vorschau-inhalt { padding: 12px 14px 14px 36px; background: var(--flaeche-still); }
.mail-vorschau-eintrag { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 4px 16px; font-size: 13.5px; padding: 5px 0; }
.mail-vorschau-eintrag + .mail-vorschau-eintrag { border-top: 1px solid var(--rand-weich); }
.mail-vorschau-eintrag b { color: var(--text-2); font-weight: 600; }
.mail-vorschau-eintrag span { overflow-wrap: anywhere; }
@media (max-width: 860px) { .mail-vorschau-eintrag { grid-template-columns: 1fr; } .mail-vorschau-inhalt { padding-left: 14px; } }

/* Auftragsverlauf (Dienstleister): nur anhängen, nie ändern — als Aufklapper mit Zeilen je Ereignis */
.dl-verlauf { margin-top: 12px; }
.dl-verlauf > summary { cursor: pointer; font-size: 13.5px; color: var(--text-2); padding: 6px 0; display: flex; align-items: center; gap: 8px; }
.dl-verlauf > summary svg { width: 15px; height: 15px; stroke: var(--text-schwach); }
.dl-verlauf-liste { margin-top: 8px; border: 1px solid var(--rand); border-radius: 10px; }
.dl-verlauf-zeile { padding: 10px 14px; }
.dl-verlauf-zeile + .dl-verlauf-zeile { border-top: 1px solid var(--rand); }
.dl-verlauf-zeile > .klein { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.dl-verlauf-text { margin-top: 4px; font-size: 13.5px; white-space: pre-wrap; }

/* Zähler-Panel „Verbrauch & Kosten“ (zaehler-detail.php, assets/zaehler.js): Zeitraum-Chips, Kennzahlen,
   Balkenpaar je Monat (Zeitraum + Vorjahr), Nachzahlung/Guthaben farbig, Legende */
.zaehler-kosten { margin: 10px 0 12px; padding: 14px 16px; border: 1px solid var(--rand); border-radius: 12px; background: var(--container); }
.zk-eigen { margin-top: 12px; max-width: 440px; }
.zk-zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.zk-zahl { padding: 10px 12px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 10px; min-width: 0; }
.zk-wert { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.zk-diagramm { display: flex; align-items: flex-end; gap: 6px; height: 150px; margin-top: 14px; padding-top: 18px; box-sizing: border-box; }
.zk-monat { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; position: relative; }
.zk-balken { width: 100%; max-width: 44px; height: 0; border-radius: 6px 6px 0 0; background: var(--signal); transition: height .7s cubic-bezier(.2, .7, .2, 1); }
.zk-balken.leer { background: var(--rand); }
.zk-monat-label { margin-top: 6px; font-size: 11.5px; color: var(--text-schwach); white-space: nowrap; max-width: 100%; overflow: hidden; }
.zk-monat-wert { position: absolute; top: -18px; font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.zk-hinweis { margin-top: 10px; }
.zk-paar { display: flex; align-items: flex-end; gap: 3px; width: 100%; height: 100%; justify-content: center; }
.zk-paar .zk-balken { width: 100%; max-width: 30px; }
.zk-balken.zk-vorjahr { background: var(--signal-rand); }
.zk-balken.zk-vorjahr.leer { background: var(--rand); }
.zk-differenz.zk-nachzahlung .zk-wert { color: #b91c1c; } /* gleiche Töne wie .abzeichen-rot / .abzeichen-gruen */
.zk-differenz.zk-guthaben .zk-wert { color: #047857; }
.zk-legende { margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.zk-legende-balken { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--signal); }
.zk-legende-balken.zk-legende-vorjahr { background: var(--signal-rand); }
.tarif-modus { margin: 0 0 12px; }
@media (max-width: 767px) {
  .zk-wert { font-size: 20px; } .zk-diagramm { height: 120px; } .zk-monat-wert { display: none; }
  .zk-zahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } /* zwei Kacheln je Zeile statt sieben untereinander */
}
.auftrag-akkordeon > .auftrag-inhalt { padding: 12px 16px 16px; } /* gleicher Innenabstand wie die Kopfzeile — nichts klebt am Rahmen */
.auftrag-akkordeon > .auftrag-inhalt > * + * { margin-top: 10px; }

/* Handy: die Anmelde-/Rechtstext-Box darf nie breiter werden als die Spalte — eine lange Überschrift („Datenschutzerklärung“)
   drückte die Box sonst über den Rand; Auftrags-Meta im Dienstleister-Portal bricht um statt zu überlaufen */
@media (max-width: 767px) {
  .auth-buehne { grid-template-columns: minmax(0, 1fr); }
  .auth-buehne > * { min-width: 0; }
  .auth-formular h1, .schlicht-box h1 { overflow-wrap: anywhere; font-size: 24px; }
  .auftrag-akkordeon > summary { flex-wrap: wrap; }
  .auftrag-akkordeon .auftrag-meta { margin-left: 0; flex: 1 1 100%; white-space: normal; flex-wrap: wrap; gap: 4px 12px; }
}

/* Hilfe-Suche: auf der Hilfeseite oben, im Hilfe-Panel jeder Seite unter dem Kopf */
.hilfe-suche > input[type="search"] { flex: 1 1 260px; min-width: 0; }
.hilfe-panel-suche { display: flex; align-items: center; gap: 8px; padding: 12px 24px; border-bottom: 1px solid var(--rand); }
.hilfe-panel-suche > input[type="search"] { flex: 1 1 auto; min-width: 0; margin: 0; }
.hilfe-panel-suche > button, .hilfe-suche > button { margin-top: 0; flex: 0 0 auto; } /* die Regel „input + button = Abstand oben“ gilt hier nicht: Knopf auf Höhe des Felds */
.hilfe-treffer mark { background: #fde68a; color: inherit; padding: 0 2px; border-radius: 3px; }
/* Fließtext mit <mark>: „.liste-haupt > .klein“ ist sonst Flex — jede Markierung stand in einer eigenen Zeile */
.hilfe-ausschnitt, .liste-haupt > .hilfe-ausschnitt { display: block; margin-top: 4px; line-height: 1.5; }
/* Hilfe nach Rolle: der graue Hinweis „nur mit „…“ oder „…““ (sieht nur der Betreiber) bricht um — mit nowrap ragte er bei
   390 px über das Hilfe-Panel hinaus, und das Panel ließ sich seitlich wischen (Paket hilfe-texte-2) */
.hilfe-text .abzeichen, .hilfe-panel-inhalt .abzeichen { white-space: normal; max-width: 100%; }
/* Hilfe-Themen: Symbol, Thema und Pfeil bis 860 px in einer Zeile — zwischen 768 und 860 px setzte die Tablet-Regel
   „.einstellung-text { flex: 1 1 100% }“ jedes Thema auf drei Zeilen (Symbol / Titel / Pfeil). Raster statt Flex, weil
   „.einstellung-zeile > :not(…) { flex: 1 1 100% }“ die höhere Spezifität hat. (Vorher nur ≤ 767 px, Abschnitt Mobil: Kern-Portal.) */
@media (max-width: 860px) {
  .hilfe-thema > summary > .einstellung-zeile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 12px; }
}
/* Hilfe-Druckansicht (hilfe.php?druck=1, Schulungsunterlage je Rolle): nur Kopf und Themen — Navigation, Kopfleiste,
   Hilfe-Panel, Support-Chat, Knöpfe und Pfeile fallen weg, die Themen stehen aufgeklappt untereinander */
@media print {
  body[data-seite$="hilfe.php"] :is(.seitenleiste, .topbar, .nav-schleier, .support-fab, .support-panel, .hilfe-panel, .hilfe-schleier, .aufklapp-pfeil),
  body[data-seite$="hilfe.php"] .hilfe-druck-kopf .aktionen-zeile { display: none; }
  body[data-seite$="hilfe.php"] .app { display: block; min-height: 0; }
  body[data-seite$="hilfe.php"], body[data-seite$="hilfe.php"] .inhalt { background: none; }
  body[data-seite$="hilfe.php"] .karte { box-shadow: none; }
  body[data-seite$="hilfe.php"] .hilfe-thema > summary { break-after: avoid; }
}


/* Dashboard: offene Tickets gleich unter der Begrüßung */
.dash-tickets { margin: 14px 0 6px; }
.dash-tickets > .karte-kopfzeile h3 { margin: 0; font-size: 15px; }
.dash-tickets .liste-zeile.ungelesen .liste-titel a { font-weight: 700; }
.hilfe-treffer-text { margin-top: 10px; }
.hilfe-treffer-text .hilfe-text { margin-top: 10px; }
.feld-hinweis { display: flex; flex-direction: column; gap: 4px; }

/* ---------- Arbeitsaufträge: Fortschritt, Positionen zum Abhaken (handytauglich), Fotos, Plantafel ---------- */
.aa-fortschritt { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.aa-fortschritt-balken { flex: 1; height: 8px; border-radius: 999px; background: var(--rand-weich); overflow: hidden; }
.aa-fortschritt-balken span { display: block; height: 100%; background: var(--gruen); border-radius: 999px; transition: width .3s; }
.aa-pos-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; }
.aa-fotos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.aa-fotos a { position: relative; display: block; }
.aa-fotos img { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rand); display: block; }
.aa-fotos .aa-foto-art { position: absolute; left: 4px; bottom: 4px; font-size: 10px; padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; }
.aa-datei-eingabe { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.aa-pos-zeile { display: grid; grid-template-columns: 28px minmax(180px, 2fr) 90px 90px minmax(120px, 1fr) 36px; gap: 8px; align-items: start; padding: 10px 0; border-top: 1px solid var(--rand-weich); }
.aa-pos-zeile textarea { min-height: 38px; }
.aa-pos-zeile > * { min-width: 0; }
.aa-pos-zeile input, .aa-pos-zeile select, .aa-pos-zeile textarea { width: 100%; max-width: 100%; box-sizing: border-box; } /* select: Einheit (einheit_auswahl_html) bleibt in ihrer Spalte */
.aa-pos-zeile .aa-griff { padding-top: 10px; color: var(--text-still); text-align: center; font-weight: 600; }
.aa-plantafel { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--karte-abstand); }
.aa-plantafel .karte { margin: 0; }
.aa-tafel-auftrag { padding: 10px 0; border-top: 1px solid var(--rand-weich); }
.aa-tafel-auftrag:first-of-type { border-top: 0; }
/* Plantafel: Klick auf die Karte öffnet den Auftrag (data-zeile-ziel, assets/menue.js) — dieselbe Hover-Fläche wie Listenzeilen */
@media (hover: hover) {
  .zeilenklick .aa-tafel-auftrag[data-zeile-ziel]:hover { background: var(--container); box-shadow: -10px 0 0 var(--container), 10px 0 0 var(--container); }
}
@media (max-width: 767px) {
  /* Raster der Zeile am Handy: EINE Stelle, Abschnitt „Mobil: Arbeitsaufträge“ (hier stand eine zweite, überschriebene Fassung) */
  .aa-pos-zeile .aa-griff { display: none; }
}
.aa-foto-rahmen { position: relative; }
.aa-foto-weg { position: absolute; top: -6px; right: -6px; z-index: 1; }
.aa-foto-weg button { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--rand); background: var(--flaeche); color: var(--gefahr); font-weight: 700; line-height: 1; cursor: pointer; padding: 0; }
/* Aufklapper der Arbeitsaufträge (Notiz, Zurücknehmen, Stornieren): nur der Knopf, aufgeklappt das Formular darunter */
.aa-klapp, .aa-klapp[open] { border: 0; border-radius: 0; background: none; padding: 0; box-shadow: none; }
.aa-klapp > summary, .aa-klapp[open] > summary { list-style: none; border-bottom-width: 1px; border-radius: var(--radius); }
.aa-klapp > summary::before, .aa-klapp > summary::after { content: none; }
.aa-klapp > :not(summary) { padding: 0; }
.aa-klapp[open] { flex-basis: 100%; }
.aa-klapp form { margin-top: 10px; display: grid; gap: 8px; }
.karte-kopfzeile + .aa-tafel-auftrag { border-top: 0; }
/* Adressbuch-Import: Schrittleiste (keine Links) und Protokoll */
.import-schritte { margin-bottom: var(--karte-abstand); }
.import-schritte .chip { cursor: default; }
.import-protokoll { white-space: pre-wrap; max-height: 360px; overflow: auto; margin: 0; font-family: var(--schrift-mono); }
[data-liste] > .aa-pos-zeile { padding-left: 10px; padding-right: 10px; border-radius: 8px; }
[data-liste] > .aa-pos-zeile:nth-child(even) { background: var(--flaeche-still); }
.person-art-wahl { color: inherit; text-decoration: none; } .person-art-wahl:hover { background: var(--flaeche-still); } .person-art-wahl .liste-haupt { display: flex; flex-direction: column; gap: 2px; }
.karte > .filter-chips:first-child { margin-bottom: 14px; }
/* Pillen allein in der Karte (Lager → Buchen: Ausbuchen/Einbuchen/…): kein Abstand nach unten — er kam zum Innenabstand dazu (unten 14 px mehr als oben) */
.karte > .filter-chips:only-child { margin-bottom: 0; }
.aa-datei-eingabe + label.knopf { margin-top: 0; } /* Foto-Knopf ist ein Label — ohne den Abstand normaler Formularfelder, auf einer Höhe mit „Notiz“ */
.adressbuch-reiter { margin-bottom: var(--karte-abstand); }
/* Aufklappbare Formulare (Notiz, Haken zurücknehmen, Stornieren, Firma zuordnen): als Akkordeon unter dem Knopf statt
   schwebend — das Fenster hing sonst rechts neben einer fremden Position und ließ sich nicht schließen */
.aa-klapp[open] > form { position: static; min-width: 0; width: 100%; margin-top: 10px; padding: 12px; border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche); box-shadow: none; }
.aa-klapp[open] > summary { background: var(--flaeche-aktiv); border-color: var(--signal-rand); color: var(--signal); }
.aa-klapp form .aktionen-zeile, .aa-klapp form { align-items: center; }
.aa-klapp form > .knopf, .aa-klapp form > button { justify-self: start; }
.kategorie-wahl { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 4px; clear: both; width: 100%; }
.kategorie-wahl .kontrollkaestchen { margin: 0; }
/* Firmen-Kategorien (Adressbuch → Einstellungen): abgeschaltete stehen an der Firma weiter, grau; Meldung von „+ Kategorie“ */
.kategorie-aus { color: var(--text-schwach); }
.kategorie-meldung.fehler { color: var(--gefahr); }
.vt-tarif { margin: 4px 0 12px; }
.vt-tarif > summary { cursor: pointer; font-weight: 500; }
/* Speicher oben in der Seitenleiste */
.speicher-leiste { display: block; margin: 0 16px 10px; padding: 8px 10px; border: 1px solid var(--rand-weich); border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 12px; }
.speicher-leiste:hover { border-color: var(--signal-rand); text-decoration: none; }
.speicher-leiste-text { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.speicher-leiste-text span:first-child { font-weight: 600; }
.speicher-leiste .balken { margin: 0; max-width: none; height: 5px; }
/* Arbeitsauftrag-Formular: Abstand zwischen Titel und „Details“ */
.aa-pos-zeile input[type="text"] + textarea { margin-top: 8px; }
/* Eingeklappte Seitenleiste (nur Symbole): kein Platz für den Speicher-Balken */
body.leiste-schmal .speicher-leiste { display: none; }
@media (max-width: 1100px) and (min-width: 861px) { .speicher-leiste { display: none; } }
@media (max-width: 860px) { body.leiste-schmal .speicher-leiste { display: block; } }
.sup-abschnitt { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-schwach); margin: 14px 0 6px; }
.sup-form select { width: 100%; }

/* =========================================================================================
   === Mobil: Fundament ===
   Handy (≤ 767 px): nichts wird seitlich gewischt. Tabellen werden Karten, die Filterleiste
   wird zu einer Zeile mit Akkordeon, Kennzahlen klappen auf Listenseiten zu „Überblick“
   zusammen, Reiter brechen um bzw. werden ab fünf Stück zur Auswahlliste.
   Die Markierungen (data-label, .tk, .tk-*) setzt assets/leiste.js — Regeln für Bereiche:
   docs/ui-richtlinien.md, Abschnitt „Mobil-Muster“. Desktop (≥ 768 px) bleibt unverändert.
   ========================================================================================= */
/* Bedienelemente, die es nur auf dem Handy gibt */
.reiter-wahl, .ueberblick-knopf, .such-mobil, .such-status { display: none; }
@media (max-width: 767px) {
  /* --- Tabellen als Karten: eine Karte je Zeile, „Beschriftung  Wert“ ---------------------- */
  .tabelle-umbruch:has(> .tabelle.tk), .tabelle-scroll:has(> .tabelle.tk) { overflow: visible; }
  .karte > .tabelle-umbruch:has(> .tabelle.tk) { margin-left: 0; margin-right: 0; }
  .karte > .tabelle-umbruch:last-child:has(> .tabelle.tk) { margin-bottom: 0; padding-bottom: 0; }
  .tabelle.tk, .karte > .tabelle.tk, .karte > form > .tabelle.tk { display: block; width: 100%; min-width: 0; margin-left: 0; margin-right: 0; overflow: visible; font-size: 14px; }
  .tabelle.tk > thead, .tabelle.tk tr.tk-kopf { display: none; }
  .tabelle.tk > tbody, .tabelle.tk > tfoot, .karte > .tabelle.tk > tbody { display: flex; flex-direction: column; gap: 10px; width: 100%; min-width: 0; }
  .tabelle.tk > tfoot { margin-top: 10px; }
  .tabelle.tk tr { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px 14px; border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche); }
  .tabelle.tk tbody tr > :is(td, th), .tabelle.tk tfoot tr > :is(td, th) { display: block; position: relative; min-width: 0; padding: 0 0 0 calc(38% + 10px); border: 0; background: transparent;
    font-size: 14px; font-weight: 400; color: var(--text); white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
  /* Spaltenausrichtung des Desktops (auch inline style="text-align:right") gilt in der Karte nicht — sonst
     springen die Werte einer Karte zwischen links und rechts. !important nur deshalb. */
  .tabelle.tk tr > :is(td, th) { text-align: left !important; }
  .tabelle.tk tr > [data-label]::before { content: attr(data-label); position: absolute; left: 0; top: 0; width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: var(--schrift); font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-schwach); line-height: 19.6px; }
  .tabelle.tk tr > :is(td, th):not([data-label]) { padding-left: 0; }
  /* Lange Beschriftung oder Eingabefeld: Beschriftung darüber, Wert volle Breite */
  .tabelle.tk tr > :is(.tk-oben, .tk-feld) { padding-left: 0; }
  .tabelle.tk tr > :is(.tk-oben, .tk-feld)::before { position: static; display: block; width: auto; white-space: normal; margin-bottom: 2px; }
  .tabelle.tk tr > .tk-feld::before { margin-bottom: var(--beschriftung-abstand); font-weight: 600; font-size: 13px; color: var(--text-2); }
  .tabelle.tk .tk-feld :where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea) { width: 100%; max-width: none; }
  /* Titel: erste inhaltliche Zelle (oder .karte-titel), ohne Beschriftung, ganz oben */
  .tabelle.tk tr > .tk-titel { order: -1; padding-left: 0; font-size: 15px; font-weight: 600; }
  .tabelle.tk tr > .tk-titel::before { content: none; }
  .tabelle.tk tr.tk-mit-auswahl > .tk-titel { padding-right: 34px; }
  /* Auswahl-Häkchen oben rechts */
  .tabelle.tk tr > .tk-auswahl { position: absolute; top: 12px; right: 14px; padding: 0; width: auto; }
  .tabelle.tk tr > .tk-auswahl::before { content: none; }
  /* Aktionen als Fußzeile der Karte */
  .tabelle.tk tr > .tk-aktionen { order: 99; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 4px; padding: 10px 0 0; border-top: 1px solid var(--rand-weich); }
  .tabelle.tk tr > .tk-aktionen::before { content: none; }
  .tabelle.tk .tk-aktionen .zeilen-aktionen { justify-content: flex-end; flex-wrap: wrap; }
  /* Leere Zellen und Spalten mit .mobil-aus fallen weg */
  .tabelle.tk tr > :is(.tk-leer, .mobil-aus), .tabelle .mobil-aus { display: none; }
  .tabelle.tk .abzeichen { white-space: normal; max-width: 100%; }
  /* Zeilen mit einer Zelle über alle Spalten: Zwischenüberschrift bzw. freier Inhalt (Hinweis, Aufklapper) */
  .tabelle.tk tr.tk-abschnitt, .tabelle.tk tr.tk-voll { padding: 0; border: 0; border-radius: 0; background: none; }
  .tabelle.tk tr.tk-abschnitt > :is(td, th) { padding: 8px 2px 0; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-schwach); }
  .tabelle.tk tr.tk-voll > :is(td, th) { padding: 0; }
  /* Summen- und Fußzeilen */
  .tabelle.tk > tfoot tr, .tabelle.tk tr.tk-summe { background: var(--flaeche-still); }
  .tabelle.tk > tfoot tr > :is(td, th), .tabelle.tk tr.tk-summe > :is(td, th) { font-weight: 600; }
  /* Zustandsfarben liegen auf der ganzen Karte, nicht auf einzelnen Zellen */
  .tabelle.tk tr.warnt { background: #fef2f2; border-color: #fecaca; }
  .tabelle.tk tr.hervorgehoben { background: #fffbeb; border-color: #fde68a; }
  .tabelle.tk tr.inaktiv { opacity: .6; }
  /* … mit „⋯“: blass werden die Zellen, nicht das offene Menü (sonst durchscheinend und unter der nächsten Karte, „Zeilen-Menü“) */
  .tabelle.tk tr.inaktiv:has(.zeilen-menue) { opacity: 1; }
  .tabelle.tk tr.inaktiv:has(.zeilen-menue) > :not(:has(.zeilen-menue)), .tabelle.tk tr.inaktiv .zeilen-menue > summary { opacity: .6; }
  /* Zeilen-Menü „⋯“ (Grundsatz 4): steht oben rechts in der Karte (Zelle nur mit dem Menü → .tk-menue, assets/leiste.js) bzw.
     oben rechts in der Listenzeile; Tippen auf die Karte öffnet den Eintrag ([data-zeile-ziel], assets/menue.js) */
  .tabelle.tk tr > .tk-menue { position: absolute; top: 6px; right: 6px; display: block; width: auto; padding: 0; }
  .tabelle.tk tr > .tk-menue::before { content: none; }
  .tabelle.tk tr:has(> .tk-menue) > .tk-titel { padding-right: 40px; }
  .tabelle.tk tr:has(> .tk-menue).tk-mit-auswahl > .tk-auswahl { right: 54px; }
  .tabelle.tk tr:has(> .tk-menue).tk-mit-auswahl > .tk-titel { padding-right: 76px; }
  .zeilenklick .tabelle.tk tr[data-zeile-ziel]:active { background: var(--container); }
  .liste-zeile:has(> .zeilen-aktionen.nur-menue) { position: relative; padding-right: 46px; }
  .liste-zeile > .zeilen-aktionen.nur-menue { position: absolute; top: 6px; right: 0; width: auto; margin: 0; }
  .liste-zeile.hervorgehoben > .zeilen-aktionen.nur-menue { top: 8px; right: 8px; }
  .karte > :is(h2, .karte-kopfzeile) + .liste-zeile > .zeilen-aktionen.nur-menue { top: -8px; }
  /* Tabellen, die Tabelle bleiben (.tabelle-schmal, ohne Kopfzeile): schmaler, Kopf bricht um — wischen dürfen auch sie nicht */
  .tabelle:not(.tk) th { white-space: normal; }
  .tabelle:not(.tk) :is(th, td) { padding: 10px 8px; overflow-wrap: anywhere; }
  .tabelle:not(.tk) :is(th, td):first-child { padding-left: var(--karte-innen); }
  .tabelle:not(.tk) :is(th, td):last-child { padding-right: var(--karte-innen); }

  /* --- Filterleiste als Akkordeon: Suchfeld + „Filter“ in einer Zeile, darunter der aktive Stand --- */
  .such-kopf.mit-suche { flex-wrap: wrap; gap: 8px 10px; }
  .such-kopf .such-mobil { order: 1; display: flex; position: relative; flex: 1 1 0; min-width: 0; }
  .such-mobil input { width: 100%; padding-left: 36px; }
  .such-mobil svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-schwach); pointer-events: none; }
  .such-kopf.mit-suche .such-kopf-rechts { order: 2; width: auto; }
  .such-kopf.mit-suche .such-kopf-rechts .filter-knopf { width: auto; padding: 0 14px; }
  .such-kopf .such-status { order: 3; display: block; flex: 1 1 100%; font-size: 13px; color: var(--text-schwach); line-height: 1.4; }
  .such-status b { color: var(--text); font-weight: 600; }
  .such-kopf-links { order: 4; flex-basis: 100%; }
  .such-kopf-links:empty { display: none; }
  .such-panel > .filter-chips { margin: 0; flex-wrap: wrap; }
  .such-panel > .filter-chips + .such-form { margin-top: var(--formular-abstand); }
  .such-felder > .such-q, .such-felder.nur-suche { display: none; }
  .such-felder.nur-suche + .such-aktionen { margin-top: 0; }

  /* --- Knopflinie (ui-richtlinien 3a): ein Knopf im Formularraster steht am Handy in eigener Zeile unter dem Feld —
     dann über die volle Breite wie in .aktionen-zeile (am Desktop bleibt er links neben/unter den Feldern) --- */
  .zeilen-formular > :is(.knopf, button):not(.aktion-icon) { justify-self: stretch; }

  /* --- Kennzahl-Kacheln kompakt: zwei je Zeile; auf Listenseiten hinter „Überblick“ --- */
  .stat-karten { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat-karte { padding: 10px 12px; column-gap: 10px; }
  .stat-icon { width: 28px; height: 28px; border-radius: 8px; }
  .stat-icon svg { width: 15px; height: 15px; }
  .stat-hinweis { top: 8px; right: 8px; }
  .stat-label { font-size: 10px; letter-spacing: .04em; }
  .stat-wert { font-size: 17px; }
  .stat-zusatz { margin-top: 4px; font-size: 12px; }
  .stat-zusatz .klein { font-size: 12px; }
  .stat-karten.ueberblick-zu { display: none; }
  .ueberblick-knopf { display: flex; align-items: center; gap: 10px; width: 100%; height: var(--knopf-hoehe); margin: 0 0 12px; padding: 0 14px; border: 1px solid var(--rand); border-radius: 10px;
    background: var(--flaeche); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; box-shadow: var(--schatten); }
  .ueberblick-knopf > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-schwach); transition: transform .15s; }
  .ueberblick-knopf[aria-expanded="true"] > svg { transform: rotate(90deg); }
  .ueberblick-titel { font-weight: 600; flex-shrink: 0; }
  .ueberblick-kurz { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-schwach); }

  /* --- Reiter: umbrechen statt scrollen; ab fünf Reitern Auswahlliste (assets/leiste.js reiterWahl) --- */
  .reiter-leiste { flex-wrap: wrap; overflow: visible; white-space: normal; }
  .reiter-leiste > * { flex-shrink: 1; }
  .reiter-leiste.hat-reiter-wahl, .bereich-reiter.hat-reiter-wahl { display: none; }
  .reiter-wahl { display: block; width: 100%; margin: 0 0 var(--formular-abstand); font-weight: 600; }
  /* Einstellungsseiten (bereichs_reiter(…, false)): am Desktop führen die Unterpunkte der Seitenleiste, hier liegt sie
     hinter ☰ — deshalb steht die Leiste auf dem Handy über dem Inhalt (ab fünf Bereichen die Auswahlliste, siehe oben) */
  .bereich-reiter.bereich-reiter-mobil:not(.hat-reiter-wahl) { display: flex; }

  /* --- Tippziele mindestens 40 px: Pillen, gemerkte Suchen, Suchbegriff-Chips, Feldhilfe ---------------
     Nur antippbare Pillen (a, button, label) — reine Anzeige-Chips (span) bleiben kompakt. min-height schlägt
     auch feste Höhen aus Bereichsregeln (z. B. .bereich-reiter .chip mit 38 px). */
  :is(a, button, label).chip, .filter-leiste :is(a, button), .kategorie-leiste a, :is(a, button).filter-pille { min-height: 40px; }
  .chip.q-chip { min-height: 40px; padding-right: 0; gap: 2px; }
  /* Das „×“ deckt die volle Chiphöhe ab: der Chip ist 40 px inkl. 1-px-Rand, gestreckt wären es nur 38 — der negative Rand
     legt die Tippfläche über den Rand (40 × 40), der Chip selbst bleibt 40 px hoch */
  .q-chip button { align-self: stretch; min-width: 40px; min-height: 40px; margin: -1px 0; padding: 0; font-size: 20px; opacity: 1; }
  /* Gemerkte Suche: Name und „×“ sind zwei getrennte Tippflächen mit Trennstrich, das „×“ 40 × 40 */
  .such-chip { height: auto; min-height: 40px; padding: 0 0 0 14px; gap: 0; }
  .such-chip a { display: inline-flex; align-items: center; align-self: stretch; padding-right: 12px; }
  .such-chip form { align-self: stretch; flex: 0 0 auto; }
  .such-chip button { width: 40px; height: 40px; padding: 0; font-size: 22px; border-left: 1px solid var(--rand); border-radius: 0 999px 999px 0; }
  .such-chip.aktiv button { border-left-color: rgba(255, 255, 255, .4); }
  /* Feldhilfe „?“: sichtbar 24 px, Tippfläche (::after) 40 × 40 — gemessen ab der Innenkante des 1-px-Rands, daher -9 px;
     die negativen Ränder halten die Beschriftungszeile auf ihrer Höhe */
  .feld-hilfe-knopf { width: 24px; height: 24px; margin-top: -3px; margin-bottom: -3px; font-size: 13px; }
  .feld-hilfe-knopf::after { inset: -9px; }

  /* --- Lange Wörter („Zugang/Wareneingang/Rückgabe“) und Namen in Auswahl-Aufklappern brechen um, statt seitlich zu scrollen --- */
  .hilfe-panel-inhalt, .hilfe-text { overflow-wrap: anywhere; }
  .matrix-ma-liste { overflow-x: hidden; }
  .matrix-ma-liste .kontrollkaestchen { white-space: normal; }

  /* --- Kanban (CRM): Spalten untereinander statt nebeneinander --- */
  .kanban { flex-direction: column; overflow: visible; padding: 0; align-items: stretch; }
  .kanban-spalte { flex: 0 0 auto; width: 100%; min-height: 0; }

  /* --- Matrix-Ansichten: bleiben vorerst wie sie sind (eigener Container mit Querscroll), bis der Bereich
     eine eigene Handy-Ansicht baut — mess.js meldet sie unter „wischen“:
     Dienstplan-Raster .dp-scroll/.dp-raster und Rotation .dp-rotation (Bereich Dienstplan),
     Preistabelle .preistabelle-umbruch (Verwaltung), jede Tabelle mit .tabelle-matrix. */
}

/* === Mobil: Kern-Portal === */
/* portal/*.php (ohne Unterordner), hilfe.php, Dashboard. Bausteine aus assets/kern-mobil.js:
   [data-mobil-wahl] an einer Pillenleiste → Auswahlliste ab fünf Pillen, [data-mobil-klapp] → details.mobil-klapp.
   Seiten-Regeln über body[data-seite="…"], damit nichts in andere Bereiche durchschlägt. */
/* Kalender (portal/wiedervorlagen.php): Wochentag am Tag und Einträge ab dem sechsten gibt es nur in der Handy-Liste —
   am Desktop bleibt es beim Raster mit „+ n weitere“ */
.kal-wtag, .kal-eintrag.kal-extra { display: none; }
/* Feiertag im Kalender: im Raster auf 14 Zeichen gekürzt, in der Handy-Tagesliste der volle Name (dort gibt es keinen Tooltip) */
.kal-ft-lang { display: none; }
/* Übersicht: Auswahlliste statt der Symbol-Reiter gibt es nur auf dem Handy (assets/kern-mobil.js, dashReiter) */
.dash-reiter-mobil { display: none; }
/* Übersicht → „Guten Morgen“: eigene Wiedervorlagen unter der Ticketliste mit eigener Überschrift wie „Offene Tickets“ */
.dash-wv-kopf { margin: 14px 0 0; }
.dash-wv-kopf h3 { margin: 0; font-size: 15px; }
.dash-wv-kopf + .liste-zeile { border-top: 0; }
/* Personenseite → Rechte je Modul: „abweichend vom Profil“ als kleines Abzeichen — der Eltern-span ist eine Spalte
   (Titel, Abzeichen, Erklärung untereinander) und streckte es sonst als gelben Balken über die ganze Zeile */
.recht-zeile > span > .abzeichen { align-self: flex-start; }
/* Hilfe-Panel: zugeklappt (nach rechts aus dem Bild geschoben) ohne Schatten — der Schatten fiel sonst als
   grauer Verlauf über den rechten Rand jeder Seite */
.hilfe-panel { transition: transform .22s ease, box-shadow .22s ease; }
.hilfe-panel:not(.offen) { box-shadow: none; }
/* Support-Anfrage (portal/support.php?id=…): Antwortfeld 8 px unter der Beschriftung — .sup-antwort textarea { margin: 0 }
   gilt für den Chat; wie verwaltung/support.php im Abschnitt „Verwaltung“ */
body[data-seite$="portal/support.php"] .sup-antwort > label > textarea { margin-top: var(--beschriftung-abstand); }
/* Import, Schritt „Prüfen“: der Hinweis neben „Jetzt importieren“ steht mittig zu den Knöpfen, nicht an deren Unterkante */
body[data-seite$="portal/adressbuch-import.php"] .aktionen-zeile > span.klein { align-self: center; }
/* Adressbuch-Liste (Desktop/Tablet): Reichen die Ansichts-Pillen (bis zu acht Reiter) nicht in eine Zeile, brechen sie links
   um und „Filter“ bleibt rechts auf der Linie der ERSTEN Pillenzeile — vorher rutschte „Filter“ ab etwa 1400 px Fensterbreite
   allein und linksbündig in eine eigene Zeile unter die Pillen. Der Innenabstand oben ist der halbe Höhenunterschied
   Knopf (42) − Pille (32): so liegen die Mitten der ersten Pillenzeile und von „Filter“ übereinander, ob eine Zeile oder zwei. */
@media (min-width: 768px) {
  body[data-seite$="portal/adressbuch.php"] .such-kopf { flex-wrap: nowrap; align-items: flex-start; }
  body[data-seite$="portal/adressbuch.php"] .such-kopf-links { flex: 1 1 0; padding-top: calc((var(--knopf-hoehe) - 32px) / 2); } /* 32 px = .chip */
}
@media (max-width: 767px) {
  /* --- Viele Pillen → Auswahlliste (wie Reiter ab fünf); die Pillen bzw. ihre Karte fallen weg --- */
  .hat-mobil-wahl { display: none; }
  .mobil-pillen-wahl { margin: 0 0 12px; }
  /* Bis vier Ansichten bleiben Pillen über Suchfeld und „Filter“ (assets/leiste.js, [data-mobil-wahl]) — gleicher Abstand
     wie die Auswahlliste ab fünf */
  .such-karte > .filter-chips[data-mobil-wahl] { margin: 0 0 12px; }
  /* --- Aufklapper nur auf dem Handy: eine Zeile „Filter  Stand“, Inhalt darunter --- */
  details.mobil-klapp { margin: 0 0 12px; border: 0; border-radius: 0; background: none; }
  details.mobil-klapp > summary::before { content: none; } /* eigener Pfeil (svg) wie beim „Überblick“ */
  details.mobil-klapp > summary { list-style: none; display: flex; align-items: center; gap: 10px; height: var(--knopf-hoehe); padding: 0 14px; border: 1px solid var(--rand); border-radius: 10px;
    background: var(--flaeche); color: var(--text); font-size: 14px; cursor: pointer; box-shadow: var(--schatten); }
  details.mobil-klapp > summary::-webkit-details-marker { display: none; }
  details.mobil-klapp > summary > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-schwach); transition: transform .15s; }
  details.mobil-klapp[open] > summary { margin-bottom: 12px; }
  details.mobil-klapp[open] > summary > svg { transform: rotate(90deg); }
  .mobil-klapp-titel { font-weight: 600; flex-shrink: 0; }
  .mobil-klapp-kurz { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-schwach); }
  details.mobil-klapp > .karte { margin-bottom: 0; }
  details.mobil-klapp > .karte > h2:first-child { display: none; } /* „Filter“ steht schon in der Zeile darüber */
  details.mobil-klapp > .karte > .filter-chips:first-child { margin-bottom: 0; }

  /* --- Tabellen-Karten: Zelle, die nur einen Knopf trägt, aber ein Wert ist (Aktiv JA/NEIN) --- */
  .tabelle.tk tr > td.mobil-wert.tk-aktionen { order: 0; display: block; margin-top: 0; padding: 0 0 0 calc(38% + 10px); border-top: 0; }
  .tabelle.tk tr > td.mobil-wert.tk-aktionen::before { content: attr(data-label); }
  /* Langer Wert (Liste von Mail-Arten …): Beschriftung darüber, Wert volle Breite */
  .tabelle.tk tr > td.mobil-oben { padding-left: 0; }
  .tabelle.tk tr > td.mobil-oben::before { position: static; display: block; width: auto; white-space: normal; margin-bottom: 2px; }
  /* Listenzeilen: „Öffnen“-Auge, wenn der Titel schon verlinkt ist */
  .liste-zeile .zeilen-aktionen > .mobil-aus, .liste-zeile > .mobil-aus { display: none; }

  /* --- Kennzahl-Kacheln der Kern-Seiten: Beschriftung läuft nicht unter das Warnzeichen oben rechts --- */
  body:is([data-seite$="portal/index.php"], [data-seite$="portal/wiedervorlagen.php"], [data-seite$="portal/kommunikation.php"],
    [data-seite$="portal/aktivitaeten.php"], [data-seite$="portal/adressbuch-import.php"]) .stat-karte:has(> .stat-hinweis) .stat-label { padding-right: 16px; }
  /* --- Übersicht (Dashboard): Häkchen „Erledigt“ rechts neben der Wiedervorlage statt in eigener Zeile --- */
  .heute-karte > .dash-zeile { flex-wrap: nowrap; align-items: flex-start; gap: 10px; }
  .heute-karte > .dash-zeile > .liste-haupt { flex: 1 1 auto; }
  .heute-karte > .dash-zeile > .inline-formular { flex: 0 0 auto; }
  body[data-seite$="portal/index.php"] .hbalken-zeile, .org-auslastung .hbalken-zeile { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  body[data-seite$="portal/index.php"] .hbalken-spur, .org-auslastung .hbalken-spur { grid-column: 1 / -1; grid-row: 2; }
  body[data-seite$="portal/index.php"] .hbalken-label, .org-auslastung .hbalken-label { white-space: normal; }

  /* --- Regeln: der Papierkorb einer Bedingung bzw. Aktion steht rechts neben dem letzten Feld (Wert / Aktion), mittig zum
     Eingabefeld — nicht allein und linksbündig in einer eigenen Zeile darunter (Knopflinie) --- */
  body[data-seite$="portal/regeln.php"] :is(.bed-zeile, .regel-aktion > .zeilen-formular:first-child) { grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; }
  body[data-seite$="portal/regeln.php"] .bed-zeile > label { grid-column: 1 / -1; }
  body[data-seite$="portal/regeln.php"] .bed-zeile > label:last-of-type { grid-column: 1; }
  body[data-seite$="portal/regeln.php"] :is(.bed-zeile, .regel-aktion > .zeilen-formular:first-child) > .aktion-icon { margin-bottom: calc((var(--feld-hoehe) - var(--icon-knopf-hoehe)) / 2); }
  /* untereinander gestapelt: eine feine Linie trennt die Bedingungen (Feld · Vergleich · Wert) voneinander */
  body[data-seite$="portal/regeln.php"] .bed-zeile + .bed-zeile { padding-top: var(--formular-abstand); border-top: 1px solid var(--rand-weich); }
  /* --- Benachrichtigungen: „Speichern“ der Mail-Matrix bleibt rechts neben dem Kartentitel (der Titel bricht um) — sonst
     rutschte er schmal und linksbündig unter den Titel --- */
  body[data-seite$="portal/benachrichtigungen.php"] #matrix > .karte-kopfzeile { flex-wrap: nowrap; }
  body[data-seite$="portal/benachrichtigungen.php"] #matrix > .karte-kopfzeile > h2 { min-width: 0; }

  /* --- Wiedervorlagen: Stand-Auswahl volle Breite unter dem Eintrag, „⋯“ oben rechts („Mobil: Fundament“; Kalender steht im Menü) --- */
  .liste-zeile.wv-zeile { gap: 10px 8px; }
  .wv-zeile > .liste-haupt { flex: 1 1 100%; }
  .wv-zeile > .inline-formular { flex: 1 1 0; min-width: 0; }
  .wv-zeile > .inline-formular > select { width: 100%; max-width: none; min-width: 0; }
  /* Kalender: statt Monatsraster (sieben Spalten à 40 px) eine Tagesliste — nur Tage mit Einträgen und heute */
  .kal-raster { display: flex; flex-direction: column; gap: 8px; }
  .kal-raster > .kal-wt, .kal-raster > .kal-tag.leer, .kal-raster > .kal-tag:not(.heute):not(:has(.kal-eintrag)) { display: none; }
  .kal-raster > .kal-tag { min-height: 0; padding: 10px 12px; gap: 6px; }
  .kal-tag-kopf { gap: 8px; }
  .kal-wtag { display: inline; min-width: 22px; font-size: 13px; font-weight: 600; color: var(--text-schwach); }
  .kal-nr { font-size: 15px; }
  .kal-raster .kal-feiertag { display: inline; font-size: 12px; }
  .kal-raster .kal-plus { opacity: 1; border: 1px solid var(--rand); background: var(--flaeche); }
  .kal-raster .kal-eintrag { white-space: normal; font-size: 14px; line-height: 1.35; padding: 8px 10px; }
  .kal-raster .kal-eintrag.kal-extra { display: block; }
  .kal-raster .kal-weitere { display: none; }
  .kal-tag.heute:not(:has(.kal-eintrag))::after { content: 'Heute steht nichts an.'; font-size: 13px; color: var(--text-schwach); }

  /* --- Papierkorb: Symbol links neben dem Titel, „⋯“ (Wiederherstellen, Endgültig löschen) oben rechts --- */
  .liste-zeile.papierkorb-zeile { flex-wrap: wrap; align-items: flex-start; gap: 10px 12px; }
  .papierkorb-zeile > .liste-haupt { flex: 1 1 0; }

  /* --- Organisation: Preis unter dem Tarif statt daneben (der Text stand in einer 150 px schmalen Spalte) --- */
  .org-tarif > .liste-zeile { flex-direction: column; align-items: stretch; gap: 4px; }
  .org-tarif > .liste-zeile > div { flex: none !important; } /* hebt das Inline-„flex:1“ des Desktops auf */
  .org-tarif > .karten-fuss { flex-wrap: wrap; gap: 8px; }

  /* --- Konfiguration: Schnellzugriff zweispaltig und kompakt (nur Titel), Einstellungen stehen schneller oben --- */
  body[data-seite$="portal/konfiguration.php"] .konfig-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body[data-seite$="portal/konfiguration.php"] .konfig-kachel { align-items: center; min-height: 48px; padding: 8px 10px; }
  /* Ohne Symbol: „Benachrichtigungen“ passt sonst nicht in die halbe Breite und würde getrennt */
  body[data-seite$="portal/konfiguration.php"] .konfig-icon { display: none; }
  body[data-seite$="portal/konfiguration.php"] .konfig-text strong { font-size: 13px; line-height: 1.3; hyphens: auto; overflow-wrap: anywhere; }
  body[data-seite$="portal/konfiguration.php"] .konfig-text .klein { display: none; }

  /* --- Formulare der Kern-Seiten: Fieldsets mit 14 px statt 22 px Rand — Karte + Fieldset ließen den Feldern sonst nur 286 px --- */
  body:is([data-seite$="portal/profil.php"], [data-seite$="portal/regeln.php"], [data-seite$="portal/organisation.php"], [data-seite$="portal/formulare.php"],
    [data-seite$="portal/adressbuch.php"], [data-seite$="portal/benutzer.php"], [data-seite$="portal/wiedervorlagen.php"], [data-seite$="portal/kommunikation.php"],
    [data-seite$="portal/benachrichtigungen.php"], [data-seite$="portal/freischaltung.php"], [data-seite$="portal/adressbuch-import.php"], [data-seite$="portal/support.php"]) fieldset { padding: 14px 14px 16px; }
  /* Neue Person: Erklärung zum Portal-Zugang unter dem Haken statt als dritte schmale Spalte */
  .kontrollkaestchen.zugang-haken { flex-wrap: wrap; row-gap: 2px; }
  .kontrollkaestchen.zugang-haken > .klein { flex: 1 1 100%; padding-left: 28px; }
  /* Paketwahl: eine Karte je Zeile (Haken · Name … Preis bleibt eine Zeile, Module und Beschreibung darunter) */
  .tarif-raster { grid-template-columns: minmax(0, 1fr); }
  /* „/ Monat“ unter den Betrag: die Preisspalte wird schmaler, Namen wie „Hausverwaltung“ passen ganz daneben */
  .tarif-preis { text-align: right; } .tarif-preis small { display: block; }
  label.tarif-karte:has(> [required])::before { content: none; } /* Pflicht-Stern je Karte — „Tarif“ ist als Ganzes Pflicht */
  /* Regel: Aktionskasten im Fieldset schmaler gerahmt, Mitarbeiter-Auswahl volle Breite */
  .regel-aktion { padding: 12px; }
  .akt-ma { width: 100%; }
  /* Kommunikation: Betreff zuerst, dann Stand/Kanal/Datum; die erste Karte behält ihren oberen Rand */
  body[data-seite$="portal/kommunikation.php"] .komm-zeile > summary > .liste-titel { order: -1; }
  body[data-seite$="portal/kommunikation.php"] .karte > h2 + .komm-zeile { border-top: 1px solid var(--rand); padding-top: 14px; }

  /* --- Hilfe: Symbol, Thema und Pfeil in einer Zeile steht bis 860 px oben bei „Hilfe-Themen“ --- */
  .hilfe-thema > .aufklapp-inhalt { padding-left: 0; } /* Text in voller Breite statt 46 px eingerückt */

  /* --- Übersicht: statt der Reiterleiste (768–900 px Kurzname unter dem Symbol, darüber Name daneben) eine Auswahlliste mit den Namen, daneben der Stift „Anpassen“ --- */
  .dash-reiter.hat-dash-wahl { display: none; }
  .dash-reiter-mobil { display: flex; gap: 8px; margin: 0 0 var(--karte-abstand); }
  .dash-reiter-mobil > .reiter-wahl { flex: 1 1 auto; min-width: 0; margin: 0; }
  .dash-reiter-mobil > .dash-anpassen-mobil { flex: 0 0 var(--knopf-hoehe); width: var(--knopf-hoehe); height: var(--knopf-hoehe); margin: 0; padding: 0; justify-content: center; } /* „select + button“ gäbe 16 px Abstand oben */
  .dash-anpassen-mobil > svg { width: 18px; height: 18px; }

  /* --- Support-Chat bildschirmfüllend: die dvh-Regel für ≤ 860 px setzte ihn auf 600 px Höhe, oben blieben 244 px Seite ungedimmt stehen --- */
  .support-panel { inset: 0; width: 100%; height: 100vh; height: 100dvh; border: 0; border-radius: 0; }
  body.support-offen { overflow: hidden; }
  /* Schließen-× von Support-Chat und Hilfe-Panel: 40 px statt 32 px (Fingerbreite) */
  .support-zu, .hilfe-panel-zu { width: 40px; height: 40px; }

  /* (Ein-Knopf-Formulare hinter versteckten Feldern: früher hier je Seite margin-top: 0 — jetzt zentral, Formulare → „Knopflinie“) */
  /* Kopf-Aktionen als Formular („Ausblenden“, „Erledigt“, „Papierkorb leeren“): volle Breite wie die übrigen Kopf-Knöpfe */
  body:is([data-seite$="portal/papierkorb.php"], [data-seite$="portal/support.php"]) .seiten-kopf-aktionen > .inline-formular { flex: 1 1 auto; }
  body:is([data-seite$="portal/papierkorb.php"], [data-seite$="portal/support.php"]) .seiten-kopf-aktionen > .inline-formular > .knopf { width: 100%; }

  /* --- Benachrichtigungen: „Testmail an“ so breit wie der Knopf darunter und wie alle übrigen Felder --- */
  .testmail-zeile { row-gap: var(--formular-abstand); }
  .testmail-zeile > label { flex: 1 1 100%; }
  .testmail-zeile label > .feld-mittel { max-width: none; }
  .testmail-zeile > label + .knopf { margin-top: 0; } /* Abstand kommt aus row-gap — sonst 26 statt 16 px unter dem Feld */

  /* --- Tabellen-Karten in Aufklappern am Kartenende (Anmeldungen, Protokolle, Eingaben): mit Innenabstand wie der Verlauf,
     sonst lagen die Kartenränder direkt auf dem Rand der äußeren Karte --- */
  body:is([data-seite$="portal/adressbuch.php"], [data-seite$="portal/benutzer.php"], [data-seite$="portal/formulare.php"], [data-seite$="portal/regeln.php"],
    [data-seite$="portal/konfiguration.php"]) .anlegen-akkordeon > :is(.tabelle-umbruch:has(> .tabelle.tk), .tabelle.tk) { margin-left: var(--karte-innen); margin-right: var(--karte-innen); width: auto; }

  /* --- Kalender-Tagesliste: Feiertag mit vollem Namen, bricht bei Bedarf um --- */
  .kal-raster .kal-feiertag { white-space: normal; overflow: visible; }
  .kal-raster .kal-ft-kurz { display: none; }
  .kal-raster .kal-ft-lang { display: inline; }
}

/* === Mobil: Verwaltung === */
/* Support-Anfrage: Antwortfeld 8 px unter der Feldhilfe (.sup-antwort textarea { margin: 0 } gilt für den Chat) */
body[data-seite="verwaltung/support.php"] .sup-antwort > label > textarea { margin-top: var(--beschriftung-abstand); }
/* Mandant → Testzugang: „Tage“ über dem Feld (Mindestbreite 180 hielt das kurze Feld neben der Beschriftung) */
/* Ebenso „Endgültig löschen“: als Flex-Zeile war die Beschriftung so breit wie Text + Feld nebeneinander, der Knopf
   brach deshalb unter das Feld, obwohl daneben Platz war (Knopflinie, ui-richtlinien 3a) */
.mandant-testphase > label, .mandant-loeschen > label { display: block; }
.mandant-testphase > label > input, .mandant-loeschen > label > input { display: block; margin-top: var(--beschriftung-abstand); }
.mandant-loeschen > label > input { width: 260px; }
@media (max-width: 767px) {
  /* Reiter als Auswahlliste (Mandant, Einstellungen): die gleichnamige Kartenüberschrift entfällt — sonst stand derselbe
     Name zwei- bis dreimal untereinander (Seitentitel, Auswahl, Karte) und kostete rund 100 px vor dem ersten Feld */
  body[data-seite^="verwaltung/"]:has(.reiter-wahl) .vw-reiter-titel { display: none; }
  /* Mandantenliste (Karten, assets/leiste.js): Status direkt unter dem Namen statt ganz unten */
  .mandanten-tabelle.tk tr > td.mandant-status { order: -1; padding-left: 0; }
  .mandanten-tabelle.tk tr > td.mandant-status::before { content: none; }
  /* Beträge in der normalen Schrift (Monospace wirkte in der Karte wie Code); „Paket … + Add-ons …“ bricht nur zwischen den Teilen um */
  .mandanten-tabelle.tk td.mono, body[data-seite="verwaltung/mandant.php"] .tabelle.tk td.mono,
  body[data-seite="verwaltung/mandant.php"] .karte-kopfzeile > .mono { font-family: var(--schrift); font-variant-numeric: tabular-nums; }
  .mandanten-tabelle.tk .vw-nobr { white-space: nowrap; }
  /* Mandant → Module: Status oben rechts neben dem Namen, Auswahl + „Setzen“ ohne eigene Beschriftung (aria-label am Feld) */
  .mandant-module.tk tr > td.mandant-modul-status { position: absolute; top: 12px; right: 14px; padding: 0; }
  .mandant-module.tk tr > td.mandant-modul-status::before, .mandant-module.tk tr > td.mandant-modul-setzen::before { content: none; }
  .mandant-module.tk tbody tr > .tk-titel { padding-right: 104px; }
  /* Logbuch: Zeit rechts neben der Aktion statt in einer eigenen Zeile */
  .logbuch-tabelle.tk tr > td.logbuch-zeit { position: absolute; top: 12px; right: 14px; padding: 0; line-height: 22px; }
  .logbuch-tabelle.tk tr > td.logbuch-zeit::before { content: none; }
  .logbuch-tabelle.tk tbody tr > .tk-titel { padding-right: 116px; }
  /* Einstellungen: lange Adressen in der Feldhilfe (Cron-Aufruf mit Token) brechen um statt über den Kartenrand zu laufen;
     „Speichern“ im Kartenfuß volle Breite wie in .aktionen-zeile */
  body[data-seite="verwaltung/einstellungen.php"] .einstellung-text .klein { overflow-wrap: anywhere; }
  body[data-seite^="verwaltung/"] .karten-fuss > .knopf { flex: 1 1 auto; }
  /* Mail-Versand → Testnachricht: Feld und „Senden“ sind eine .aktionen-zeile (einstellung_zeile(…, true)) — der Knopf
     behält seine Breite neben dem Feld statt die Zeile mitzufüllen */
  body[data-seite="verwaltung/einstellungen.php"] .einstellung-aktion.aktionen-zeile > .knopf { flex: 0 0 auto; }
  /* Ohne Kartenüberschrift beginnt die erste Einstellung direkt am Innenabstand der Karte (sonst 28 px Leerraum) */
  body[data-seite="verwaltung/einstellungen.php"]:has(.reiter-wahl) .karte > .vw-reiter-titel + form > .einstellungen-liste > .einstellung-zeile:first-child { padding-top: 0; }
  /* Zeitplan-Protokoll: Abstand zwischen den Einträgen (der Aufklapper nimmt seinen Kindern sonst jeden Innenabstand) */
  body[data-seite="verwaltung/einstellungen.php"] .historie-akkordeon > .dash-zeile { padding-bottom: 10px; }
  body[data-seite="verwaltung/einstellungen.php"] .historie-akkordeon > .dash-zeile + .dash-zeile { padding-top: 10px; }
  body[data-seite="verwaltung/einstellungen.php"] .historie-akkordeon > .dash-zeile:last-child { padding-bottom: var(--karte-innen); }
  /* Zweite Zeile unter dem Kartentitel („seit …“, „… je Einheit“) in normaler Stärke, nicht fett wie der Titel */
  body[data-seite^="verwaltung/"] .tabelle.tk tr > .tk-titel .klein { font-weight: 400; }
  /* Team: ohne Personen-Symbol (Platz für Name und E-Mail); „⋯“ steht oben rechts (Mobil: Fundament) */
  .team-zeile > .einstellung-icon { display: none; }
  /* Absenden-Knopf am Ende einer Formularzeile (Team, Sicherheit, Mandant → Benutzer anlegen): volle Breite wie in .aktionen-zeile */
  body[data-seite^="verwaltung/"] .zeilen-formular > .knopf { width: 100%; }
  /* Kopf-Aktionen als Formular (Mandanten-Ansicht, Status der Support-Anfrage): volle Breite wie die übrigen Kopf-Knöpfe */
  body[data-seite^="verwaltung/"] .seiten-kopf-aktionen > .inline-formular { flex: 1 1 auto; }
  body[data-seite^="verwaltung/"] .seiten-kopf-aktionen > .inline-formular > .knopf { width: 100%; }
  /* Mandant → Module: Auswahl und „Setzen“ in einer Zeile */
  .mandant-module.tk .tk-feld > .inline-formular { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; width: 100%; }
  .mandant-module.tk .tk-feld > .inline-formular > select { flex: 1 1 auto; width: auto; min-width: 0; max-width: none; }
  .mandant-module.tk .tk-feld > .inline-formular > .knopf { flex: 0 0 auto; }
  /* Mandant → Add-ons: Menge und „Speichern“ je Zeile in einer Linie (das Feld nimmt den Rest der Breite) */
  .tabelle.tk .tk-feld > .inline-formular.addon-menge { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; width: 100%; }
  .tabelle.tk .tk-feld > .inline-formular.addon-menge > input { flex: 1 1 auto; width: auto; min-width: 0; }
  .tabelle.tk .tk-feld > .inline-formular.addon-menge > .knopf { flex: 0 0 auto; }
  /* Mandant → Add-on buchen: Felder untereinander (die Desktop-Spalten waren breiter als das Handy) */
  .zeilen-formular.addon-zeile { grid-template-columns: minmax(0, 1fr); }
  .addon-zeile select { min-width: 0; max-width: 100%; }
  /* Mandant → Sperren & Löschen: Beschriftung über dem Feld, Feld und Knöpfe volle Breite */
  .mandant-testphase > label, .mandant-loeschen > label { display: block; flex: 1 1 100%; }
  .mandant-testphase > label > input, .mandant-loeschen > label > input { display: block; width: 100%; max-width: none; min-width: 0; margin-top: var(--beschriftung-abstand); }
  body[data-seite="verwaltung/mandant.php"] #gefahr .aktionen-zeile > .knopf { flex: 1 1 auto; }
  /* Übersicht: „Neueste Mandanten“ ohne Symbol, damit der Name Platz hat; Warnzeichen der Kacheln nicht über der Beschriftung */
  body[data-seite="verwaltung/index.php"] .dash-raster .liste-zeile { flex-wrap: nowrap; gap: 10px; }
  body[data-seite="verwaltung/index.php"] .dash-raster .liste-zeile > .einstellung-icon { display: none; }
  body[data-seite="verwaltung/index.php"] .dash-raster .liste-zeile > div { min-width: 0; }
  body[data-seite^="verwaltung/"] .stat-karte:has(> .stat-hinweis) .stat-label { padding-right: 16px; }
  /* Einstellungen: Zeilen ohne Symbol, Felder volle Breite; Schalter und Farbfeld rechts neben dem Titel */
  body[data-seite="verwaltung/einstellungen.php"] .einstellung-zeile > .einstellung-icon { display: none; }
  body[data-seite="verwaltung/einstellungen.php"] .einstellung-aktion { margin-left: 0; }
  body[data-seite="verwaltung/einstellungen.php"] .einstellung-aktion > :is(input:not([type=checkbox]):not([type=radio]):not([type=color]), select) { flex: 1 1 140px; width: auto; min-width: 0; max-width: none; }
  body[data-seite="verwaltung/einstellungen.php"] .einstellung-zeile:has(> .einstellung-aktion > :is(.schalter, .farbfeld):only-child) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 14px; }
  body[data-seite="verwaltung/einstellungen.php"] .einstellung-zeile:has(> .einstellung-aktion > :is(.schalter, .farbfeld):only-child) > .einstellung-aktion { margin-left: 0; }
  /* Mail-Matrix: Pfeil rechts neben dem Betreff (vorher drehte er sich als volle Zeile mitten über den Text), Inhalt ohne Einzug */
  body[data-seite="verwaltung/einstellungen.php"] .einstellung-aufklapp > summary > .einstellung-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; }
  body[data-seite="verwaltung/einstellungen.php"] .einstellung-aufklapp > .aufklapp-inhalt { padding-left: 0; }
  /* Konfiguration: Schnellzugriff zweispaltig und kompakt (nur Titel) */
  body[data-seite="verwaltung/konfiguration.php"] .konfig-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body[data-seite="verwaltung/konfiguration.php"] .konfig-kachel { align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px; }
  body[data-seite="verwaltung/konfiguration.php"] .konfig-icon { width: 30px; height: 30px; border-radius: 8px; }
  body[data-seite="verwaltung/konfiguration.php"] .konfig-icon svg { width: 16px; height: 16px; }
  body[data-seite="verwaltung/konfiguration.php"] .konfig-text strong { font-size: 13.5px; line-height: 1.3; }
  body[data-seite="verwaltung/konfiguration.php"] .konfig-text .klein { display: none; }
}

/* === Mobil: Tickets & Dienstleister === */
/* Ticket (portal/tickets/ticket.php): das Formular der Karte „Bearbeitung“ steckt in details.ticket-mehr — am Desktop
   ohne Kasten und ohne Kopfzeile und immer offen (Skript in der Seite), am Handy startet es zu.
   Dienstleister-Detail: Telefon und E-Mail sind Links in Textfarbe; „Alle Angaben“ gibt es nur am Handy.
   .dl-detail-stapel / .dl-portal-stapel ordnen am Handy die Karten um (das Wesentliche zuerst). */
.dl-feld b a { color: inherit; font-weight: inherit; }
.dl-kontakt-mehr { display: none; }
/* Ticket einreichen: Bilder/Dokumente stehen in „Anliegen“ direkt unter der Beschreibung, über die ganze Breite */
.ticket-anliegen > .zeilen-formular > .ticket-datei-feld { grid-column: 1 / -1; }
/* … und am Desktop der Betreff breit (zwei Drittel), die Kategorie daneben — im Raster mit vier gleichen Spalten bekam der
   Betreff nur ein Viertel (Platzhalter abgeschnitten), rechts neben der Kategorie blieben zwei Spalten leer. Am Handy eine Spalte. */
@media (min-width: 768px) { .ticket-anliegen > .zeilen-formular { grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); } }
/* Paket Z6 (Externen-Sicht & schlankes Meldeformular) ------------------------------------------------------------
   „Schaden / Anliegen melden“ (Personen): Fotos über die ganze Breite unter der Beschreibung.
   „Ticket einreichen“ (Mitarbeiter): Seltenes in details.ticket-weitere, Datum und Uhrzeit des Vorfalls nebeneinander.
   Ticket: die Statuskette ist ein Formular mit dem Hinweis-Feld am Ende — Knöpfe und Feld mittig auf einer Linie;
   „Weitere Angaben“ im Kopf (details.ticket-kopf-mehr) über die ganze Breite unter den sechs sichtbaren Angaben. */
.ticket-melden-form > .zeilen-formular > .ticket-datei-feld { grid-column: 1 / -1; }
.ticket-neu-form > :is(fieldset, .zeilen-formular) + details.ticket-weitere { margin-top: var(--formular-abstand); }
.ticket-weitere > summary .klein { font-weight: 400; }
/* „Weitere Angaben“ selbst bricht nie um; die Liste dahinter (mit eigenen Feldern lang) rutscht, wenn es eng wird, unter den
   Titel — vorher drückte sie ihn in zwei Zeilen („Weitere / Angaben“), am Handy schon ohne eigene Felder */
:is(.ticket-weitere, .felder-anlegen-weitere) > summary { flex-wrap: wrap; row-gap: 2px; }
:is(.ticket-weitere, .felder-anlegen-weitere) > summary .klein { flex: 1 1 220px; min-width: 0; }
.ticket-weitere > summary + * { padding-top: 0; margin-top: 16px; }
.ticket-weitere > .zeilen-formular + .zeilen-formular { margin-top: var(--formular-abstand); }
.ticket-status-form { align-items: center; }
.ticket-status-form > *, .ticket-status-abschluss > * { margin: 0; }
.ticket-status-abschluss { display: flex; flex: 1 1 340px; align-items: center; gap: 8px; min-width: 0; }
.ticket-status-abschluss > .ticket-status-hinweis { flex: 1 1 120px; width: auto; min-width: 0; height: var(--feld-hoehe); }
.ticket-kopf > .ticket-kopf-mehr { flex: 1 1 100%; }
/* Z6: „Handwerker Muster GmbH: Termin am …“ (Mieter, Eigentümer) nennt die Firma — lange Namen brechen um statt über den Rand */
.abzeichen.ticket-handwerker { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
/* Lange Bezüge („Maschine / Fahrzeug: …“, „Beauftragung: Ticket #19: …“) im Ticketkopf und im Zeitstrahl brechen um,
   ebenso lange Adressen im Meldungstext und „an … — vollständig anzeigen“ — sonst ließ sich die Seite bei 390 px seitlich wischen.
   .abzeichen-bezug (bezug_html) gilt überall, wo ein Bezug steht — Kommunikation, Wiedervorlagen, Listen der Module;
   die Auftragstexte der Dienstleister-Seiten (Organisation und „Meine Aufträge“) samt Rückmeldung, Hinweisen und Verlauf ebenso */
/* .abzeichen-umbruch: lange Hinweise wie „kein Portal-Zugang — bitte neu zuordnen“ (CRM-Thema, Firma) brechen um statt zu wischen */
:is(.ticket-meta, .zeitstrahl-kopf) .abzeichen, .abzeichen.abzeichen-bezug, .abzeichen.abzeichen-umbruch { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
.ticket-text, .komm-inhalt, .zeitstrahl-inhalt, .zeitstrahl-vorschau { overflow-wrap: anywhere; }
.auftrag-text, .dl-auftragstext, .dl-rueckmeldung, .dl-verlauf-text, .auftrag-inhalt > p.klein, .dl-eigene-hinweise { overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .zeitstrahl-mehr > summary .klein, .zeitstrahl-eintrag .komm-details > summary .klein { flex-shrink: 1; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
}
/* Kontaktkarten im Dienstleister-Portal: der Rahmen je Angabe (.dl-ke) zählt am Desktop nicht — Beschriftung links, Wert rechts */
.dl-kontakt-liste > .dl-ke { display: contents; }
.ticket-antwort-form { scroll-margin-top: 72px; }
@media (min-width: 768px) {
  .ticket-mehr { border: 0; border-radius: 0; background: none; }
  .ticket-mehr > summary { display: none; }
  .ticket-mehr > :not(summary) { padding: 0; margin: 0; }
  /* Nur am Handy: Bereichs-Reiter (dort ist die Seitenleiste eine Schublade), Feldbeschriftungen der Auftragszeile,
     „Antworten“-Sprung im Ticket-Kopf. Bleibt im Seitenkopf nur so etwas übrig, fällt die ganze Knopfzeile weg. */
  .tdl-nur-mobil { display: none !important; }
  .seiten-kopf-aktionen:has(> .tdl-nur-mobil):not(:has(> :not(.tdl-nur-mobil))) { display: none; }
}
@media (max-width: 767px) {
  /* Ticket einreichen: Beschreibung und Fotos direkt hinter Betreff und Kategorie; Gruppenrahmen schmaler, damit die Felder breiter werden */
  .ticket-anliegen > .zeilen-formular > label:nth-child(n+3):not(.ticket-beschreibung-feld):not(.ticket-datei-feld) { order: 2; }
  .ticket-anliegen > .zeilen-formular > :is(.ticket-beschreibung-feld, .ticket-datei-feld) { order: 1; }
  /* Z6: Datum und Uhrzeit des Vorfalls auch am Handy nebeneinander (wie im Wiedervorlage-Formular am Desktop) */
  .zeilen-formular.ticket-datum-zeit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  /* Ticket-Kopf: „Alle Tickets“ doppelt den Rückweg „‹ Tickets“ — weg; stattdessen „Antworten“ (springt ans Ende des Verlaufs) */
  .seiten-kopf-aktionen > .ticket-alle-doppelt { display: none; }
  .seiten-kopf-aktionen:has(> .ticket-alle-doppelt):not(:has(> :not(.ticket-alle-doppelt))) { display: none; }
  /* Statuskette in „Bearbeitung“: Tippfläche 40 px wie jeder Knopf am Handy */
  .status-kette-klein .status-schritt { height: 40px; padding: 0 14px; font-size: 14px; }
  :is(.ticket-neu-form, .dl-formular, .ticket-mehr) fieldset { padding: 14px 14px 16px; }
  /* Ticket-Kopf: Angaben in zwei Spalten statt Flattersatz; Termin mit „Kalender“ über die ganze Breite */
  .ticket-kopf { padding: 14px var(--karte-innen); gap: 12px; }
  .ticket-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; width: 100%; }
  .ticket-meta > div { min-width: 0; overflow-wrap: anywhere; }
  .ticket-meta > div:has(.knopf) { grid-column: 1 / -1; }
  .ticket-meta > div > b { font-size: 13.5px; }
  /* Bearbeitung: oben die Statuskette, die Felder hinter „Angaben bearbeiten“ */
  .ticket-mehr > summary { flex-wrap: wrap; row-gap: 2px; }
  .ticket-mehr > summary .klein { flex: 1 1 100%; padding-left: 22px; font-weight: 400; }
  /* Verlauf: Einträge schmaler gepolstert, Bilder als Raster mit drei Spalten; Dateien und Videos über die ganze Breite */
  .ticket-eintrag { padding: 12px 14px; }
  .ticket-anhaenge { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .ticket-anhaenge > .ticket-bild { width: auto; height: auto; aspect-ratio: 4 / 3; }
  .ticket-anhaenge > :not(.ticket-bild) { grid-column: 1 / -1; min-width: 0; }
  .ticket-video { width: 100%; }
  .ticket-datei { overflow-wrap: anywhere; }
  /* „… löschen“ je Anhang: mehrere Knöpfe je Zeile statt jeder in einer eigenen */
  .anlegen-akkordeon > .ticket-anhang-loeschen { margin-top: 8px; margin-right: 0; }
  .ticket-anhang-loeschen > .knopf { padding: 0 12px; }
  /* Wiedervorlagen am Ticket, Kategorien (Ticket-Einstellungen, Dienstleister, Adressbuch → Einstellungen): ✓ bzw. Stift und
     Papierkorb rechts neben dem Eintrag statt in einer eigenen Reihe */
  .liste-zeile:is(.ticket-wv-zeile, .ticket-kat-zeile, .dl-kat-zeile, .ab-kat-zeile) { flex-wrap: nowrap; align-items: flex-start; gap: 10px; }
  :is(.ticket-wv-zeile, .ticket-kat-zeile, .dl-kat-zeile, .ab-kat-zeile) > .liste-haupt { flex: 1 1 auto; }
  :is(.ticket-wv-zeile, .ticket-kat-zeile, .dl-kat-zeile, .ab-kat-zeile) > :is(.inline-formular, .zeilen-aktionen) { flex: 0 0 auto; width: auto; }
  /* Dienstleister im Ticket: Knopf unter den Namen, wenn es eng wird; je Auftrag Luft bis zur Trennlinie */
  .dl-ziel { flex-wrap: wrap; }
  .dl-ziel-text { flex: 1 1 200px; }
  .dl-ziel-aktionen { margin-left: auto; }
  .dl-erneut-form input[type=email] { min-width: 0; }
  .anlegen-akkordeon > .ticket-auftrag { padding: 0 0 16px; } /* der Aufklapper setzt seinen Kindern sonst padding: 0 — der Knopf saß auf der Linie */
  .ticket-auftrag > .dl-erneut-form { margin-top: 12px; }
  /* Material (Lager) am Ticket: „Ausbuchen“ rechts neben seiner Position statt allein in einer Zeile an der Trennlinie */
  .liste-zeile.ticket-mat-zeile { flex-wrap: nowrap; align-items: center; gap: 10px; padding: 10px 0; }
  .ticket-mat-zeile > .liste-haupt { flex: 1 1 auto; min-width: 0; }
  .ticket-mat-zeile > :is(.zeilen-aktionen, .dash-wert) { flex: 0 0 auto; width: auto; margin-left: auto; }
  /* Reservierung mit zwei Knöpfen (Ausbuchen, Freigeben): daneben blieben dem Text 140 px — er behält die ganze Breite,
     die Knöpfe stehen darunter rechts */
  .liste-zeile.ticket-mat-zeile:has(> .zeilen-aktionen > :nth-child(2)) { flex-wrap: wrap; }
  .ticket-mat-zeile:has(> .zeilen-aktionen > :nth-child(2)) > .zeilen-aktionen { width: 100%; justify-content: flex-end; }

  /* Dienstleister-Liste: Aufträge und Stundensatz unter dem Namen; „⋯“ oben rechts („Mobil: Fundament“) */
  .dl-zeile > .liste-haupt { flex: 1 1 100%; }
  .dl-zeile > .liste-werte { flex: 1 1 auto; flex-direction: column; gap: 2px; }
  .dl-zeile > .liste-werte b { display: inline; margin-right: 4px; }
  .liste-zeile.dl-zeile { column-gap: 10px; }
  /* Dienstleister-Detail: Kontakt und Aufträge zuerst, Zugang, Material und Verläufe danach */
  .dl-detail-stapel, .dl-portal-stapel { display: flex; flex-direction: column; }
  .dl-detail-stapel > * { order: 2; }
  .dl-detail-stapel > .dl-kontakt-karte-detail { order: 0; }
  .dl-detail-stapel > .dl-auftraege-karte { order: 1; }
  /* Kontakt: zwei Spalten, lange Angaben über die ganze Breite; Konditionen & Co. hinter „Alle Angaben“ */
  .dl-kontakt-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
  .dl-feld { min-width: 0; overflow-wrap: anywhere; }
  .dl-feld-breit { grid-column: 1 / -1; }
  .dl-feld span { font-size: 11px; }
  .dl-feld b a { color: var(--signal); }
  .dl-kontakt-raster.dl-kontakt-zu > .dl-feld-mehr { display: none; }
  .dl-kontakt-mehr { display: flex; justify-content: center; width: 100%; margin-top: var(--formular-abstand); }
  /* Aufträge (Dienstleister-Detail, Meine Aufträge): jeder Auftrag ein Streifen über die ganze Kartenbreite mit Trennlinie
     statt Kasten im Kasten — Text, Kontakte und Formulare bekommen so die volle Kartenbreite */
  .dl-auftraege-karte > .auftrag-akkordeon { margin: 0 calc(-1 * var(--karte-innen)); border-width: 1px 0 0; border-radius: 0; }
  .dl-auftraege-karte > .auftrag-akkordeon + .auftrag-akkordeon { margin-top: 0; }
  .dl-auftraege-karte > h2 + .auftrag-akkordeon { margin-top: -20px; border-top: 0; } /* die Titelzeile hat schon ihre Linie */
  /* Auftragsverlauf im Auftrag: ein Rahmen (der Aufklapper) statt zwei — die Liste darin ohne eigenen Kasten */
  .dl-auftraege-karte .dl-verlauf > .dl-verlauf-liste { margin-top: 0; border: 0; border-radius: 0; }
  .dl-auftraege-karte .dl-verlauf-liste > .dl-verlauf-zeile { padding: 10px 0; }
  .dl-auftraege-karte > .auftrag-akkordeon:last-child { margin-bottom: calc(-1 * var(--karte-innen)); }
  .dl-auftraege-karte > .auftrag-akkordeon > summary { padding: 12px var(--karte-innen); border-radius: 0; }
  .dl-auftraege-karte > .auftrag-akkordeon > :not(summary) { padding-left: var(--karte-innen); padding-right: var(--karte-innen); }
  .dl-auftraege-karte > .auftrag-akkordeon > :is(.dl-rueckmeldung, .dl-verlauf) { margin-left: var(--karte-innen); margin-right: var(--karte-innen); padding-left: 10px; padding-right: 10px; }
  .dl-auftraege-karte > .auftrag-akkordeon > .dl-verlauf { padding-left: 0; padding-right: 0; }
  /* Auftrag aufgeklappt (Verwaltung): „Aktualisieren“ ist ein Raster mit Beschriftungen (.felder-linie) wie überall — am Handy
     untereinander, der Knopf über die volle Breite (Regeln der .felder-linie) */
  .dl-form-beschr > .klein { font-weight: 400; }
  /* „Erneut senden“: Adresse und Knopf in einer Zeile (Z6 — Knopf zum Feld nie darunter); das Feld nimmt den Rest der Breite,
     eine Beschriftung (.dl-form-beschr) steht darüber */
  .dl-erneut-form { display: flex; flex-wrap: wrap; width: 100%; gap: 10px; align-items: center; }
  .dl-erneut-form > .dl-form-beschr { flex: 1 1 100%; margin-bottom: -2px; }
  .inline-formular.dl-erneut-form > input { flex: 1 1 0; width: auto; min-width: 0; }
  .dl-erneut-form > .knopf { flex: 0 0 auto; padding: 0 14px; }

  /* Meine Aufträge (Dienstleister-Portal): Auftragsliste oben, Auftraggeber darunter */
  .dl-portal-stapel > .dl-auftraggeber-karte { order: 2; }
  /* Aufgeklappter Auftrag: erst was zu tun ist (Text, Hinweise), dann die Kontakte, dann Ticket-Verlauf, Rückmeldung, Abrechnung */
  .auftrag-inhalt > :is(.dl-auftragstext, p.klein, .dl-anhaenge) { order: 1; }
  .auftrag-inhalt > .dl-kontakte { order: 2; }
  .auftrag-inhalt > :is(.aktionen-zeile, div.klein:not(:first-child)) { order: 3; }
  .auftrag-inhalt > .dl-verlauf { order: 4; }
  .auftrag-inhalt > .dl-antwort-form { order: 5; }
  .auftrag-inhalt > .dl-abrechnung { order: 6; }
  .auftrag-inhalt > .aktionen-zeile > .knopf { max-width: 100%; overflow: hidden; padding: 0 10px; }
  .auftrag-inhalt > .aktionen-zeile > .knopf > svg { display: none; }
  /* Kontaktkarten: zwei Spalten, Beschriftung über dem Wert (wie der Kontakt auf der Dienstleister-Seite) — „Telefon
     geschäftlich“ brach in der schmalen Beschriftungsspalte um; E-Mail, Adresse und lange Werte über die ganze Breite */
  .dl-kontakt-karte { padding: 10px 12px 12px; }
  .dl-kontakt-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
  .dl-kontakt-liste > .dl-ke { display: block; min-width: 0; }
  .dl-kontakt-liste > .dl-ke-breit { grid-column: 1 / -1; }
  .dl-ke > dt { font-size: 11.5px; line-height: 1.35; }
  .dl-ke > dd { font-size: 14px; line-height: 1.4; }
  .dl-auftraggeber.tk .tk-titel .klein { font-weight: 400; font-size: 13px; }
}

/* === Mobil: Immobilien === */
/* Nur fürs Handy: Zähler-Gruppenwahl als Liste (objekt.php), Ansicht-Zeile über dem Zeitraum (zaehler.php).
   Mieterzeile (objekt.php): am Desktop sind die Angaben durchlässig (display: contents) und ihr „⋯“ steht am Zeilenende
   (.zeilen-aktionen: margin-left auto); Kündigen, Beenden, Bearbeiten und Entfernen liegen im Menü (Grundsatz 4). */
.zaehler-gruppe-wahl, .im-zeitraum-kopf { display: none; }
.im-mieter-info { display: contents; }
@media (min-width: 768px) {   /* mit „⋯“ (Verwalter) bleiben die Angaben eine umbrechende Gruppe — das „⋯“ rutscht nie allein in eine Zeile */
  .im-mieter:has(> .zeilen-aktionen) { flex-wrap: nowrap; }
  .im-mieter:has(> .zeilen-aktionen) > .im-mieter-info { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; }
}
.im-zeitraum-karte > form { padding: 0; } /* <details> als Karte: die Aufklapper-Innenabstände gelten hier nicht */
/* Zähler-Panel: ein Tipp auf einen Monat zeigt seinen Wert unter den Balken (assets/zaehler.js) — Zeigen gibt es am Handy nicht */
.zk-monat { cursor: pointer; }
.zk-monat.gewaehlt .zk-monat-label { color: var(--text); font-weight: 700; }
.zk-auswahl { margin-top: 8px; color: var(--text); font-weight: 600; }
@media (max-width: 767px) {
  /* Objektliste: Foto klein neben dem Titel, darunter die Werte („34 Einheiten · 30 vermietet …“); „⋯“ oben rechts
     („Mobil: Fundament“), Tippen auf die Karte öffnet das Objekt */
  .im-objekt-zeile { gap: 10px 12px; align-items: flex-start; }
  .im-objekt-zeile > .im-bild-klein { width: 56px; height: 42px; }
  .im-objekt-zeile > .liste-haupt { flex: 1 1 calc(100% - 68px); min-width: 0; } /* 56 px Foto + 12 px Abstand: Werte in die nächste Zeile */
  .im-objekt-zeile > .liste-werte { flex: 1 1 0; min-width: 0; align-self: center; }
  :is(.im-objekt-zeile, .im-einheit-zeile, .zaehler-zeile) > .liste-werte { gap: 2px 14px; }
  :is(.im-objekt-zeile, .im-einheit-zeile, .zaehler-zeile) > .liste-werte b { display: inline; margin-right: 4px; }
  /* Aktive Kündigungen: unter die Objektliste (die Blöcke haben nur margin-bottom — als Spalte bleiben die Abstände
     gleich) */
  .inhalt:has(> .im-kuendigungen) { display: flex; flex-direction: column; }
  .inhalt > .im-kuendigungen { order: 1; }
  /* Objektseite: Kopf-Knöpfe des Bereichs nebeneinander, Foto im Überblick flacher */
  body[data-seite$="portal/immobilien/objekt.php"] .seiten-kopf-aktionen > span:not([hidden]) { display: contents; }
  .im-objektbild-klein img { max-height: 140px; }
  /* Mieter einer Einheit: eigener Block mit Linie links; sein „⋯“ oben rechts im Block, in derselben Spalte wie das „⋯“ der
     Einheit (der Block reicht dafür in deren 46 px Rand — „Mobil: Fundament“ setzt nur direkte Kinder der Zeile) */
  .liste-haupt > .im-mieter { display: block; margin-top: 8px; padding: 6px 0 6px 12px; border-left: 2px solid var(--rand); }
  .im-einheit-zeile:has(> .zeilen-aktionen.nur-menue) .liste-haupt > .im-mieter { margin-right: -46px; }
  .liste-haupt > .im-mieter:has(> .zeilen-aktionen.nur-menue) { position: relative; min-height: 52px; padding-right: 46px; }
  .im-mieter > .zeilen-aktionen.nur-menue { position: absolute; top: 6px; right: 0; width: auto; margin: 0; }
  .im-mieter-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
  /* Zähler: Gruppenwahl als beschriftete Auswahlliste („Zähler anzeigen für“) statt langer Pillen */
  .zaehler-gruppen, .zaehler-gruppe-titel { display: none; }
  label.zaehler-gruppe-wahl { display: block; margin-bottom: var(--formular-abstand); }
  .zaehler-gruppe-wahl > select { font-weight: 600; }
  .zaehler-zeile > .liste-werte { flex: 1 1 auto; }
  /* Zählerseite: „Stand erfassen“ vor das Panel (Ablesen ist am Telefon die Hauptsache) — die Blöcke haben nur
     margin-bottom, als Spalte bleiben die Abstände gleich. Erklärsätze in den Kartenköpfen stehen in der Kurzhilfe;
     ohne Werte kein leerer Diagrammkasten. */
  .inhalt:has(> .im-stand-karte) { display: flex; flex-direction: column; }
  .inhalt > .im-panel-karte, .inhalt > .im-panel-karte ~ :not(.im-stand-karte) { order: 1; }
  .im-kopf-hinweis { display: none; }
  /* Verlauf der Ablesungen (bis 60): kompakte Karte — Datum links, Stand rechts in der Titelzeile, darunter
     „Verbrauch …“, „Erfasst von …“, Notiz mit der Beschriftung davor statt in einer eigenen Spalte */
  table.zaehler-tabelle.tk tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 14px; }
  table.zaehler-tabelle.tk tbody tr > td { grid-column: 1 / -1; padding-left: 0; }
  table.zaehler-tabelle.tk tbody tr > td.tk-titel { grid-column: 1; grid-row: 1; }
  table.zaehler-tabelle.tk tbody tr > td:nth-child(2) { grid-column: 2; grid-row: 1; justify-self: end; }
  table.zaehler-tabelle.tk tbody tr > td:nth-child(2)::before { content: none; }
  table.zaehler-tabelle.tk tbody tr > td[data-label]::before { position: static; display: inline; width: auto; margin-right: 6px; }
  .zaehler-kosten { padding: 12px; }
  .zk-zahl { padding: 8px 10px; }
  .zk-diagramm { gap: 2px; }
  .zk-diagramm.zk-leer { display: none; }
  /* Tarif / Abschlag: Zusammenfassung neben dem €-Zeichen statt allein in der nächsten Zeile */
  .zaehler-tarif > summary { flex-wrap: nowrap; align-items: flex-start; }
  .zaehler-tarif > summary > span { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
  /* Verbrauch & Zählerstände: Zeitraum (<details>, am Handy zu) hinter der Zeile „Jahr 2026 · alle Objekte“ + „Zeitraum“ */
  .im-zeitraum-karte > .im-zeitraum-kopf { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; border-radius: 0; background: none; font-weight: 400; }
  .im-zeitraum-karte > .im-zeitraum-kopf::before { content: none; }
  .im-zeitraum-karte[open] > .im-zeitraum-kopf { margin-bottom: var(--formular-abstand); }
  .im-zeitraum-stand { flex: 1 1 0; min-width: 0; font-size: 13px; line-height: 1.4; color: var(--text-schwach); overflow-wrap: anywhere; }
  .im-zeitraum-stand b { color: var(--text); font-weight: 600; }
  .im-zeitraum-kopf > .filter-knopf { flex: 0 0 auto; padding: 0 14px; }
  .im-mobil-aus { display: none; }
  /* Tickets am Objekt: Offen / Erledigt / Alle in einer Zeile (drei gleich breite Pillen), die Einheitenwahl volle Breite
     darunter — der Trennstrich hing sonst allein am Zeilenende. */
  .filter-chips.ticket-filter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .ticket-filter > .chip { justify-content: center; min-width: 0; padding: 0 8px; }
  .ticket-filter > .chip-trenner { display: none; }
  .ticket-filter > select { grid-column: 1 / -1; width: 100%; max-width: none; min-width: 0; }
  /* Lager & Material am Objekt: Materialkosten rechts neben dem Artikel statt in einer eigenen Zeile */
  body[data-seite$="portal/immobilien/objekt.php"] #lager .liste-zeile.dash-zeile { flex-wrap: nowrap; align-items: flex-start; gap: 10px; }
  body[data-seite$="portal/immobilien/objekt.php"] #lager .dash-zeile > .liste-haupt { flex: 1 1 auto; min-width: 0; }
  body[data-seite$="portal/immobilien/objekt.php"] #lager .dash-zeile > .dash-wert { flex: 0 0 auto; }
  /* Objekt-Historie: Zeitpunkt über dem Eintrag statt in einer 106 px breiten Spalte daneben (der Text hatte nur 210 px),
     mit Luft zwischen den Einträgen (das Akkordeon nimmt den Zeilen sonst den Innenabstand) */
  body[data-seite$="portal/immobilien/objekt.php"] #historie .historie-akkordeon > .aktivitaet-zeile { flex-direction: column; align-items: flex-start; gap: 2px; padding-top: 10px; }
  body[data-seite$="portal/immobilien/objekt.php"] #historie .historie-akkordeon > .aktivitaet-zeile:not(:last-child) { padding-bottom: 10px; }
  /* Termine: die fünf Ansichten (Offen … Alle) teilen sich eine Zeile statt „Alle“ allein in der zweiten. */
  body[data-seite$="portal/immobilien/termine.php"] .karte-kopfzeile > .filter-leiste { flex: 1 1 100%; width: 100%; gap: 4px; }
  body[data-seite$="portal/immobilien/termine.php"] .karte-kopfzeile > .filter-leiste > a { flex: 1 1 auto; justify-content: center; padding: 0 8px; }
  /* Formulare (Objekt, Einheit, Mieter, Zähler, Termin, Dokument): Gruppenrahmen 14 statt 22 px — Karte und Fieldset
     ließen den Feldern sonst nur 282 von 390 px */
  body[data-seite*="portal/immobilien/"] fieldset { padding: 14px 14px 16px; }
  /* Objekt anlegen/bearbeiten: „Objekt“ (Bezeichnung, Adresse) vor dem Foto. Die Fieldsets haben nur margin-top —
     in der Spalte fallen keine Ränder zusammen; die Abstände werden für die neue Reihenfolge gesetzt. */
  .im-objekt-form { display: flex; flex-direction: column; }
  .im-objekt-form > .im-fs-objekt { order: -1; margin-top: 0; }
  .im-objekt-form > .im-fs-foto { margin-top: var(--formular-abstand); }
}

/* === Mobil: CRM & Adressbuch === */
/* Nur auf dem Handy: z. B. die Sortier-Auswahl über der Firmenliste (am Desktop sortieren die Spaltenköpfe) */
@media (min-width: 768px) { .crm-nur-mobil { display: none !important; } }
/* „+ Neue Firma/Person anlegen“ unter der Auswahl (Thema/Eintrag, Schritt „Für wen?“): der Block [data-wer] hebt die
   Fieldset-Regel „* + * = 14 px“ auf — der Aufklapper klebte ohne Luft am Auswahlfeld */
body[data-seite^="portal/crm/"] [data-wer] > .zeilen-formular + .anlegen-akkordeon { margin-top: 14px; }
/* Knopflinie (ui-richtlinien 3a), Bereich CRM:
   - Aufklapper IM Formular („+ Neue Firma/Person anlegen“, „+ Ansprechpartner anlegen“, „Wiedervorlage dazu anlegen“,
     Import-Vorschau) sind ein Kasten — .anlegen-akkordeon nimmt dem letzten Kind den Innenabstand unten (gedacht für
     den Kartenkopf), der Knopf „Firma anlegen“ saß dadurch auf der unteren Kante.
   - Die (noch leere) Meldung neben „Firma anlegen“ (#nfMeldung, #npMeldung, #apMeldung) nimmt keinen Platz weg.
   - „Firma: Muster GmbH  [Ändern]“: Text mittig zum Knopf statt an seiner Unterkante. */
body[data-seite^="portal/crm/"] form details.anlegen-akkordeon[open] { padding-bottom: var(--formular-abstand); }
body[data-seite^="portal/crm/"] .aktionen-zeile > .klein:empty { display: none; }
.aktionen-zeile.crm-kontext { align-items: center; }
/* Import: Datei + „Hochladen & Spalten zuordnen“ in einer Zeile — der Knopf in seiner Breite, das Dateifeld nimmt den
   Rest, aber nie weniger als 260 px (schmaler schneidet der Browser „Datei auswählen · Keine ausgewählt“ bzw. den
   Dateinamen ab). Reicht die Karte dafür nicht (halbes Kartenraster, Fenster ~1180–1450 px), bricht der Knopf als
   Ganzes unter das Dateifeld. Flex statt Raster: im Raster bekäme der Knopf eine Spalte von 1fr und ragte über den
   Kartenrand (bei 1400 px 12 px); eine feste Zweispalten-Regel ließ das Dateifeld auf 113–223 px schrumpfen. */
@media (min-width: 768px) {
  .zeilen-formular.crm-datei-zeile { display: flex; flex-wrap: wrap; align-items: flex-end; }
  .zeilen-formular.crm-datei-zeile > label { flex: 1 1 260px; }
  .zeilen-formular.crm-datei-zeile > .knopf { flex: 0 0 auto; }
}
/* Knöpfe als Zelle einer Formularzeile (Import „Hochladen“, „Zuordnen“, Tags, „Rolle ändern“): zentrale Regel im Abschnitt Formulare */
@media (max-width: 767px) {
  /* Knopflinie: „Löschen“ als eigenes Formular in einer Aktionszeile (Firma, Thema, Eintrag, alter Vorgang, Dublette
     „Kein Duplikat“) — am Handy über die volle Breite wie die Knöpfe daneben, nicht schmal unter „Bearbeiten“ */
  body[data-seite^="portal/crm/"] .aktionen-zeile > .inline-formular { flex: 1 1 auto; }
  body[data-seite^="portal/crm/"] .aktionen-zeile > .inline-formular > .knopf { flex: 1 1 auto; justify-content: center; }
  .crm-eintrag-zeile .eintrag-meta { gap: 4px 10px; }
  /* Sortierung über der Firmenliste: volle Breite unter der Überschrift */
  .karte-kopfzeile > .crm-sortierung { flex: 1 1 100%; }
  .crm-sortierung select { width: 100%; }
  /* Kopf-Knöpfe gleich breit: passen sie in eine Zeile, stehen sie nebeneinander; sonst zwei je Zeile und der letzte
     über die volle Breite. Die Gruppen je Reiter (span[data-bereich-aktion]) lösen sich dafür auf — vorher standen
     „+ Eintrag“ und „+ Thema“ schmal und ungleich, „Person bearbeiten“ allein und ungestreckt darunter. Auch ein
     Ein-Knopf-Formular („Wieder öffnen“, „Jetzt prüfen“) löst sich auf: als Flex-Element ohne Innenabstand bekam es
     sonst 38 px weniger als „Bearbeiten“ daneben (flex-basis 0 zählt den Innenabstand des Knopfs mit). */
  body[data-seite^="portal/crm/"] .seiten-kopf-aktionen > :is(span[data-bereich-aktion]:not([hidden]), .inline-formular) { display: contents; }
  body[data-seite^="portal/crm/"] .seiten-kopf-aktionen .knopf { flex: 1 1 0; }
  /* Daten-Listen (Kontaktdaten, Stammdaten, eigene Felder): Beschriftung so breit wie nötig, höchstens 120 px —
     mit festen 150 px blieben den Werten 162 px: Adresse und Telefon brachen um, Tags standen einzeln untereinander */
  body[data-seite^="portal/crm/"] .daten-liste { grid-template-columns: fit-content(120px) minmax(0, 1fr); gap: 6px 12px; min-width: 0; }
  /* Formulare (Eintrag, Thema, Person): die Schritte („1. Thema“, „2. Eintragsart“ …) als flache Abschnitte mit
     Trennlinie statt Kasten im Kasten — Karte 16 px + Fieldset 22 px ließen die Felder erst bei x = 54 beginnen */
  body[data-seite^="portal/crm/"] .formular-karte > form > fieldset { padding: 0; border: 0; border-radius: 0; background: none; }
  body[data-seite^="portal/crm/"] .formular-karte > form > :is(fieldset, div, label, details, p) ~ fieldset { padding-top: var(--formular-abstand); border-top: 1px solid var(--rand-weich); }
  body[data-seite^="portal/crm/"] .formular-karte fieldset fieldset { padding: 14px; }
}

/* === Mobil: Lager === */
/* portal/lager/* (etikett.php ausgenommen — Druckbogen). Bausteine:
   .lager-raster  Tabellen-Karte als Raster: Titel oben, Zahlen nebeneinander (3 Spalten, .lager-raster-2: zwei),
                  Zellen mit .lager-breit über die ganze Breite; .lager-pos = Positionen der Bestellanforderung
   .lager-ansicht-chips / .lager-ansicht-wahl  lange Pillenleiste → Auswahlliste (lager_ansicht_wahl())
   .lager-modi    Buchungsarten als gleich breite Knöpfe
   .lager-baum    Einrückung der Lagerorte/Kategorien über --tiefe (Desktop wie bisher 24 px + 22 px je Ebene)
   .lager-klapp   Karte mit data-lager-klapp="zu|auf" wird auf dem Handy ein Aufklapper (lager_mobil_klapp_js():
                  Artikel-, Bestell- und Lieferantenseite); .lager-zu = zugeklappt, nur die Kopfzeile steht
   .lager-nur-mobil  gibt es nur auf dem Handy (Bereichspillen der Einstellungen, Schnellstart der Übersicht)
   .lager-mobil-ordnen / .lager-mobil-oben  Bestellung: Lieferant aus der Seitenspalte nach oben
   Listen-Regeln gelten über body[data-seite*="portal/lager/"] nur hier. */
.liste-zeile.lager-baum { padding-left: calc(24px + var(--tiefe, 0) * 22px); }
.lager-ansicht-wahl { display: none; }
@media (min-width: 768px) { .lager-nur-mobil { display: none !important; } }
/* Sprungmarken auf Karten (#varianten, #serien, #reservierungen nach dem Speichern): Abstand zur festen Kopfleiste
   (56 px) wie bei h2[id] — sonst verdeckte sie die Kartenüberschrift */
body[data-seite*="portal/lager/"] .karte[id] { scroll-margin-top: 80px; }
/* Aufklapp-Kopf entsteht nur auf dem Handy; wird das Fenster breiter, wirkt er wie die Überschrift vorher */
.lager-klapp-knopf { all: unset; cursor: pointer; }
.lager-klapp-knopf > svg, .lager-klapp-kurz { display: none; }
@media (max-width: 767px) {
  /* --- Listenzeilen ------------------------------------------------------------------------- */
  /* Artikelbild klein neben dem Namen statt in einer eigenen Zeile */
  .liste-zeile > .lager-mini { width: 40px; height: 40px; margin-right: 0; align-self: flex-start; }
  .liste-zeile > .lager-mini + .liste-haupt { flex: 1 1 calc(100% - 54px); } /* Bild 40 + Abstand 14: Bestand und Knöpfe in der Zeile darunter */
  /* Bestand/Wert und Knöpfe teilen sich eine Zeile — passt es nicht, rutschen die Knöpfe rechtsbündig darunter */
  body[data-seite*="portal/lager/"] .liste-zeile > .liste-werte + .zeilen-aktionen { width: auto; margin-left: auto; }
  /* Werte als „12 Stk Bestand“ in einer Zeile statt Zahl über Beschriftung */
  body[data-seite*="portal/lager/"] .liste-zeile > .liste-werte { gap: 2px 14px; }
  body[data-seite*="portal/lager/"] .liste-zeile > .liste-werte b { display: inline; margin-right: 4px; }
  /* Zeilen-Aktionen: nur noch „⋯“ (Grundsatz 4) — oben rechts in der Zeile, „Mobil: Fundament“. Die Regeln für ausgeblendete
     „Öffnen“-Augen und für Zeilen mit höchstens zwei Symbolen sind mit der Umstellung am 08.10.2026 entfallen. */
  /* Verleih: „Wieder öffnen“ rechts unter der Zeile, das Formular klappt darunter auf, so breit wie die Zeile (am Desktop schwebt
     es 420 px breit — auf dem Handy ragte es aus dem Bild). „Stornieren“ einer Bewegung steht seit 08.10.2026 im „⋯“-Menü. */
  body[data-seite*="portal/lager/"] .liste-zeile > .dp-rot-anwenden { flex: 1 1 100%; text-align: right; }
  body[data-seite*="portal/lager/"] .liste-zeile > .dp-rot-anwenden > summary.knopf { height: var(--knopf-klein-hoehe); padding: 0 14px; border: 1px solid var(--rand-stark); border-radius: var(--radius); background: #fff; }
  body[data-seite*="portal/lager/"] .liste-zeile > .dp-rot-anwenden > .dp-rot-anwenden-panel { position: static; width: auto; max-width: none; margin-top: 10px; text-align: left; }
  /* Lagerorte und Kategorien: schmalere Einrückung je Ebene, oberste Ebene ohne */
  .liste-zeile.lager-baum { padding-left: calc(var(--tiefe, 0) * 14px); }

  /* --- Pillenleisten -------------------------------------------------------------------------- */
  /* Einkauf (7 Ansichten), Bestellvorschlag (Lieferanten): Auswahlliste statt mehrerer Zeilen Pillen */
  .lager-ansicht-chips > .chip { display: none; }
  .lager-ansicht-chips > .lager-ansicht-wahl { display: block; width: 100%; font-weight: 600; }
  .karte > .lager-ansicht-chips:only-child { margin-bottom: 0; }
  /* Buchen: sechs Buchungsarten als gleich breite Knöpfe in drei Spalten statt drei Zeilen Pillen */
  .filter-chips.lager-modi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .lager-modi > .chip { justify-content: center; height: auto; min-height: 40px; padding: 4px 6px; border-radius: 10px; white-space: normal; text-align: center; line-height: 1.25; }

  /* --- Tabellen-Karten als Raster (.lager-raster) ------------------------------------------- */
  .tabelle.tk.lager-raster tbody tr:not(.tk-kopf, .tk-abschnitt, .tk-voll) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; align-items: start; }
  .tabelle.tk.lager-raster.lager-raster-2 tbody tr:not(.tk-kopf, .tk-abschnitt, .tk-voll) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabelle.tk.lager-raster tr > :is(td, th):not(.lager-breit) { padding-left: 0; }
  .tabelle.tk.lager-raster tr > [data-label]:not(.tk-feld, .lager-breit)::before { position: static; display: block; width: auto; white-space: normal; margin-bottom: 2px; }
  .tabelle.tk.lager-raster tr > :is(.tk-titel, .lager-breit, .tk-aktionen) { grid-column: 1 / -1; }
  /* Bestellanforderung: Artikel oben, Menge | Preis, Bemerkung | Entfernen */
  .tabelle.tk.lager-pos tbody tr:not(.tk-kopf, .tk-abschnitt, .tk-voll) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .tabelle.tk.lager-pos tr > .lager-pos-menge { grid-column: 1; }
  .tabelle.tk.lager-pos tr > .lager-pos-menge.lager-breit { grid-column: 1 / -1; }
  .tabelle.tk.lager-pos tr > .lager-pos-preis { grid-column: 2 / -1; }
  .tabelle.tk.lager-pos tr > .lager-pos-bem { grid-column: 1 / 3; }
  .tabelle.tk.lager-pos tr > .lager-pos-weg { grid-column: 3; align-self: end; order: 0; margin: 0; padding: 0; border-top: 0; }

  /* --- Formulare ---------------------------------------------------------------------------- */
  /* Kurze Zahlenfelder paarweise nebeneinander (Preise, Bestandsgrenzen, Lieferzeit …); alles andere volle Breite */
  body[data-seite*="portal/lager/"] .zeilen-formular { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  body[data-seite*="portal/lager/"] .zeilen-formular > * { grid-column: 1 / -1; }
  body[data-seite*="portal/lager/"] .zeilen-formular > label:is(:has(> .feld-kurz), .lager-halb):is(:has(+ label > .feld-kurz), :has(+ label.lager-halb), label:has(> .feld-kurz) + label, label.lager-halb + label) { grid-column: auto; }
  body[data-seite*="portal/lager/"] .seiten-kopf-aktionen > .inline-formular { flex: 1 1 auto; }
  body[data-seite*="portal/lager/"] .seiten-kopf-aktionen > .inline-formular > .knopf { width: 100%; }
  /* Kennzahlen einer Detailseite (Artikel: fünf Kacheln): die letzte allein stehende über die ganze Breite */
  body[data-seite*="portal/lager/"] .stat-karten > .stat-karte:last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* Scannen: Minus, Menge, Plus in einer Linie — steht jetzt für alle Breiten oben bei „Scan-Modus“ (.scan-menge) */
  /* Buchen: Artikelangaben als Fließtext, die Bestände je Lagerort als Abzeichen darunter */
  .lager-artikelinfo { display: block; line-height: 1.6; }
  .lager-artikelinfo > .abzeichen { margin: 6px 6px 0 0; }

  /* --- Aufklapp-Karten (lager_mobil_klapp_js): Kopfzeile 56 px, ganze Breite tippbar, Pfeil wie „Überblick“ --- */
  .karte.lager-klapp > :is(.karte-kopfzeile, h2) { padding-top: 7px; padding-bottom: 7px; }
  .karte.lager-klapp > .karte-kopfzeile { cursor: pointer; }
  .karte.lager-klapp > .karte-kopfzeile > h2 { flex: 1 1 auto; min-width: 0; }
  .lager-klapp-knopf { display: flex; align-items: center; gap: 10px; width: 100%; height: 42px; box-sizing: border-box; }
  .lager-klapp-knopf:focus-visible { outline: 2px solid var(--primaer); outline-offset: 2px; border-radius: 6px; }
  .lager-klapp-knopf > svg { display: block; width: 16px; height: 16px; flex-shrink: 0; color: var(--text-schwach); transform: rotate(90deg); transition: transform .15s; }
  .karte.lager-zu .lager-klapp-knopf > svg { transform: none; }
  .lager-klapp-titel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .karte.lager-zu > :not(.karte-kopfzeile, h2) { display: none; }
  .karte.lager-zu > :is(.karte-kopfzeile, h2) { margin-bottom: calc(-1 * var(--karte-innen)); border-bottom: 0; }
  .karte.lager-zu > .karte-kopfzeile > :is(a, form, button, .knopf, .aktionen-zeile) { display: none; } /* „Umlagern“, „Alle“ … erst aufgeklappt */
  /* Kurzzeile unter dem Titel, nur zugeklappt (Lieferant: Ansprechpartner · Telefon · Ort) */
  .karte.lager-zu .lager-klapp-kurz { display: block; flex: 1 1 100%; min-width: 0; margin: -10px 0 4px; padding-left: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-schwach); }

  /* --- Einstellungen: Lager · Kategorien · Einheiten als drei gleich breite Pillen in einer Zeile --- */
  .bereich-reiter.lager-bereiche { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .bereich-reiter.lager-bereiche > .chip { justify-content: center; min-width: 0; padding: 0 8px; }

  /* --- Übersicht: Schnellstart oben (Scannen zuerst, volle Breite), Kopfknöpfe und Schnellstart-Karte unten entfallen --- */
  .lager-schnellstart { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 var(--karte-abstand); }
  .lager-schnellstart > .knopf { min-width: 0; margin: 0; padding: 0 10px; justify-content: center; }
  .lager-schnellstart > .knopf:first-child, .lager-schnellstart > .knopf:nth-child(even):last-child { grid-column: 1 / -1; }
  body[data-seite$="portal/lager/index.php"]:has(.lager-schnellstart) .seiten-kopf-aktionen { display: none; }
  body[data-seite$="portal/lager/index.php"] .dash-raster > .dash-block:has(.dash-aktionen) { display: none; }
  /* Engpässe, Bewegungen, Bestellungen: „Öffnen“ rechts neben dem Eintrag statt in einer eigenen Zeile darunter */
  body[data-seite$="portal/lager/index.php"] .dash-block .liste-zeile.dash-zeile:has(> .zeilen-aktionen) { flex-wrap: nowrap; align-items: center; gap: 12px; }
  body[data-seite$="portal/lager/index.php"] .dash-block .liste-zeile.dash-zeile > .liste-haupt { flex: 1 1 0; min-width: 0; }
  body[data-seite$="portal/lager/index.php"] .dash-block .liste-zeile.dash-zeile > .zeilen-aktionen { flex: 0 0 auto; width: auto; }
  /* Kachel mit Warnzeichen (Kritische Bestände): Platz rechts, sonst lag ⚠ über dem letzten Buchstaben */
  body[data-seite*="portal/lager/"] .stat-karte:has(> .stat-hinweis) .stat-label { padding-right: 16px; }
  /* Der runde Support-Knopf (48 px, 14 px vom Rand) deckte den letzten Knopf der Seite ab */
  body[data-seite*="portal/lager/"]:has(.support-fab) .inhalt { padding-bottom: 80px; }

  /* --- Bestellung: Lieferant aus der Seitenspalte gleich unter die Kacheln (stand mit Beispieldaten bei 9.000 px) --- */
  .spalten.lager-mobil-ordnen { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .spalten.lager-mobil-ordnen > div { display: contents; }
  .spalten.lager-mobil-ordnen .lager-mobil-oben { order: -1; }

  /* --- Artikel-Formular: Feldgruppen schmaler gerahmt; Bestandsgrenzen je Lager ohne eigenen Kartenrahmen
         (Karte > Feldgruppe > Karte ließ den Feldern 116 px), kurze Beschriftungen — der Lagername steht darüber --- */
  body[data-seite*="portal/lager/"] .formular-karte fieldset { padding: 14px 14px 16px; }
  .tabelle.tk.lager-grenzen > tbody { gap: 0; }
  .tabelle.tk.lager-grenzen::before { content: "Mindest- und Meldebestand je Lager"; display: block; margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
  .tabelle.tk.lager-grenzen tbody tr:not(.tk-kopf, .tk-abschnitt, .tk-voll) { padding: 12px 0; border: 0; border-top: 1px solid var(--rand-weich); border-radius: 0; background: none; }
  .tabelle.tk.lager-grenzen tbody tr.tk-kopf + tr { border-top: 0; padding-top: 4px; }
  .tabelle.tk.lager-grenzen tbody tr:last-child { padding-bottom: 0; }
  .tabelle.tk.lager-grenzen tr > td.tk-feld:nth-child(2)::before { content: "Mindestbestand"; }
  .tabelle.tk.lager-grenzen tr > td.tk-feld:nth-child(3)::before { content: "Meldebestand"; }
}

/* === Mobil: Signage === */
/* Bausteine aus module/signage/mobil.php — auf dem Desktop unsichtbar bzw. wirkungslos */
.sig-wahl, .gestalter-handy-hinweis { display: none; }
/* Klapp-Karte (Medien „Bilder hochladen“, Slides „Slide hinzufügen“): Desktop ohne Kopfzeile, ohne Rahmen, immer offen */
.sig-klapp { border: 0; border-radius: 0; background: none; }
.sig-klapp > summary { display: none; }
.sig-klapp > :not(summary) { padding: 0; }
.sig-klapp > * + * { margin-top: var(--formular-abstand); }
.sig-klapp > summary + * { margin-top: 0; }
/* Vorlagen → Eigene → Ordner: dieselben Abstände wie vorher inline */
.vorlagen-ordner-chips { padding: 14px 20px 0; }
.vorlagen-ordner-form { padding: 12px 20px 16px; }
/* Fußzeile einer eigenen Vorlage hat zwei Zeilen — 12 px Luft statt 8 (mess.js „abstand“, auch Desktop) */
.vorlage-fuss { row-gap: 12px; }
/* Rückgängig/Wiederholen (Pfeil-Symbol statt ↶ ↷): so breit wie vorher mit dem Zeichen */
.knopf.sig-undo { width: 37px; padding-left: 0; padding-right: 0; }
/* Knopflinie (ui-richtlinien 3a): Designer, rechte Spalte (344 px) — „Als Vorlage speichern“ rechts neben „Anzeigedauer“;
   die Beschriftung bricht zweizeilig um, statt den Knopf unter das Feld zu schieben */
.sig-dauer-zeile { flex-wrap: nowrap; }
/* „Anzeigedauer“: kurzes Zahlenfeld (90 px, früher inline). Mit „Als Vorlage speichern“ daneben füllt es die Breite bis zum
   Knopf — die Zeile endet an der Spaltenkante wie die Felder darüber (input.… schlägt min-width 180 px aus .aktionen-zeile) */
input.sig-dauer-feld { min-width: 90px; width: 90px; }
.sig-dauer-zeile > label { flex: 1 1 0; }
/* Beschriftungen, die nur das Handy braucht (dort gibt es keinen Tooltip): Bildschirm-Aktionen, „Ordner“ vor der Auswahl */
.sig-ordner-text, .sig-handy-text { display: none; }
/* Sprungziel nach „Koppelcode erzeugen“ (bildschirme.php#koppeln): unter der klebenden Kopfleiste (56 px) plus etwas Luft */
#koppeln { scroll-margin-top: 72px; }
/* Inhalt der Klapp-Karte „Koppeln“: dieselben Abstände wie direkt in der Karte (.karte > * + *); die Code-Kästchen behalten ihre 8 px */
.sig-klapp-inhalt > * + *:not(.code-boxen) { margin-top: var(--formular-abstand); }
/* Zeitplan eines Slides (ein Aufklapper für „Slide hinzufügen“ und „Bearbeiten“, slides.php slide_zeitplan_und_dauer): dieselben
   Abstände wie vorher im Fieldset — Datum, Wochentage, tägliche Zeiten und Beispiel je 16 px auseinander */
.sig-zeitplan > div > * + * { margin-top: var(--formular-abstand); }
@media (max-width: 767px) {
  /* Doppelte Bedienelemente, die auf dem Desktop bequem sind, auf dem Handy aber zweimal untereinander stünden */
  .sig-nur-desktop { display: none; }
  /* Segmentknöpfe (Format, Ausrichtung) in Feldhöhe: Tippziel ≥ 40 px und bündig mit der Auswahlliste daneben */
  .segment.sig-segment > * { height: var(--feld-hoehe); }

  /* --- Chip-Leisten mit vielen Einträgen (Ordner, Kategorien) → Auswahlliste, nie seitlich wischen --- */
  .sig-wahl { display: block; width: 100%; min-width: 0; margin: 0 0 12px; }
  .karte > .sig-wahl, .medien-picker > .sig-wahl { margin-bottom: 0; }
  .medien-picker > .sig-wahl + * { margin-top: 8px; }
  .filter-leiste.sig-chips { display: none; }
  .kategorie-leiste.sig-chips { gap: 8px; }
  .kategorie-leiste.sig-chips > a, .kategorie-leiste.sig-chips > .sig-luecke { display: none; }
  .kategorie-leiste.sig-chips > .sig-wahl { flex: 1 1 150px; width: auto; margin: 0; }

  /* --- Klapp-Karte: auf dem Handy zu (signage_klapp_skript()), die Kopfzeile ersetzt den Kartentitel --- */
  .karte:has(> .sig-klapp) > h2 { display: none; }
  .sig-klapp > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 52px; margin: calc(-1 * var(--karte-innen)); padding: 12px var(--karte-innen);
    border: 0; border-radius: 10px; font-size: 16px; font-weight: 700; color: var(--signal); }
  .sig-klapp[open] > summary { margin-bottom: var(--formular-abstand); border-bottom: 1px solid var(--rand); border-radius: 10px 10px 0 0; }
  .sig-klapp-info { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--text-schwach); }

  /* --- Bildschirme: „Koppeln“ steht über der Liste — zugeklappt, offen solange ein Code gilt (Code sofort sichtbar) --- */
  .sig-bildschirm-spalten > .spalte-seite { order: -1; }
  .sig-bildschirm-spalten > .spalte-seite > .karte:last-child { margin-bottom: 0; } /* sonst 24 px Rand + 24 px Rasterabstand */
  /* Bildschirm-Karte: „⋯“ oben rechts (Slides · Einstellungen · Vorschau · Papierkorb), Tippen auf die Karte öffnet die Slides —
     die Reihe beschrifteter Symbol-Knöpfe am Kartenfuß ist mit Grundsatz 4 entfallen */
  /* „offline“ auf der roten Karte: Abzeichen und Karte hatten dieselbe Farbe — der Text wirkte eingerückt statt als Abzeichen */
  body[data-seite^="portal/signage/"] .tabelle.tk tr.warnt .abzeichen-rot { background: #fff; box-shadow: inset 0 0 0 1px #fecaca; }

  /* --- Bildschirme: Einstellungen unter der Karte ohne Doppel-Einzug; Wetter-Suche und Geräte brechen um --- */
  .tabelle.tk .bildschirm-akkordeon { margin: 0; }
  .bildschirm-akkordeon > summary { padding: 12px 16px; }
  .bildschirm-akkordeon > :not(summary) { padding: 0 16px; }
  .bildschirm-akkordeon > form { padding: 16px; }
  .bildschirm-akkordeon > .liste-zeile { padding: 12px 16px; gap: 10px; }
  .bildschirm-akkordeon > .akkordeon-abschnitt { padding: 12px 16px 6px; }
  .bildschirm-akkordeon > .akkordeon-fuss { padding: 12px 16px; }
  .sig-bildschirm-form .zeilen-formular > label > .segment { flex: 1 1 100%; }
  .sig-bildschirm-form .zeilen-formular > label > .segment > button { flex: 1 1 0; justify-content: center; }
  .sig-bildschirm-form .aktionen-zeile { flex-wrap: wrap; }
  .sig-bildschirm-form .aktionen-zeile > input[type=text]:not(.feld-kurz):not(.feld-mittel) { flex: 1 1 100px; min-width: 0; }
  .sig-bildschirm-form .aktionen-zeile > .klein { flex: 1 1 100%; }
  .bildschirm-akkordeon .liste-zeile > .inline-formular { flex: 1 1 100%; flex-wrap: nowrap; justify-content: flex-end; }
  .bildschirm-akkordeon .liste-zeile > .inline-formular > input { flex: 1 1 auto; min-width: 0; }
  /* Knopflinie (ui-richtlinien 3a): „Entkoppeln“ (Formular ohne sichtbares Feld) steht unter Name + „Name speichern“ —
     dann über die volle Breite statt rechts eingerückt */
  .bildschirm-akkordeon .liste-zeile > .inline-formular:not(:has(> input:not([type=hidden]))) > .knopf { flex: 1 1 auto; }

  /* --- Slides: Vorschau klein neben dem Titel, Knöpfe und „Bearbeiten“ in voller Breite darunter --- */
  .slide-zeile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; align-items: start; }
  .slide-zeile > .slide-info, .slide-info > .karte-kopfzeile { display: contents; }
  .slide-zeile > .slide-vorschau { grid-column: 1; grid-row: 1; width: 116px; }
  .slide-zeile > .slide-vorschau.hochkant { width: 56px; }
  .slide-info > .karte-kopfzeile > :first-child { grid-column: 2; grid-row: 1; min-width: 0; }
  .slide-info > .karte-kopfzeile > .aktionen-zeile, .slide-info > details { grid-column: 1 / -1; margin: 0; }
  .slide-info .tage-auswahl { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .slide-info .tag-kaestchen span { width: auto; height: 36px; }

  /* --- Medien: ein Bild je Zeile — Vorschau links, Name/Größe/„Löschen“ rechts daneben, darunter „Ordner“ über die
     volle Breite (in der halben Kartenbreite waren Ordnernamen abgeschnitten und die Auswahl unbeschriftet) --- */
  .medien-raster { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .medien-karte { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: start; gap: 4px 12px; padding: 10px; }
  .medien-karte > img { grid-column: 1; grid-row: 1 / span 3; width: 112px; height: 63px; border: 1px solid var(--rand); border-radius: 6px; }
  .medien-info { display: contents; }
  .medien-info > .klein { grid-column: 2; min-width: 0; overflow-wrap: anywhere; }
  .medien-info > form:not(.inline-formular) { grid-column: 2; grid-row: 3; margin-top: 4px; }
  .medien-info > .inline-formular { grid-column: 1 / -1; grid-row: 4; display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; width: 100%; margin-top: 8px; }
  .medien-info .inline-formular > select { flex: 1 1 auto; width: auto; min-width: 0; }
  .sig-ordner-text { display: inline; flex: none; font-size: 13px; font-weight: 600; color: var(--text-2); }

  /* --- Vorlagen → Eigene: Ordner-Karte ohne Doppel-Einzug; Fußzeile: „Ordner“ mit Auswahl in voller Breite,
     darunter „Bearbeiten“ links und „Löschen“ rechts --- */
  .vorlagen-ordner-form { padding: 0; }
  /* Knopflinie (ui-richtlinien 3a): die Knöpfe füllen die Zeile wie in .aktionen-zeile — „Diesen Ordner löschen“ bricht
     unter Feld und „Ordner anlegen“ um und steht dann über die volle Breite */
  .vorlagen-ordner-form > .knopf { flex: 1 1 auto; }
  .vorlage-fuss .aktionen-zeile { flex-wrap: wrap; gap: 12px 8px; }
  .vorlage-fuss .aktionen-zeile > .knopf { flex: 0 0 auto; }
  .vorlage-fuss .aktionen-zeile > .inline-formular { flex: 0 0 auto; width: auto; margin-left: auto; }
  .vorlage-fuss .aktionen-zeile > .inline-formular:has(select) { order: -1; flex: 1 1 100%; flex-wrap: nowrap; align-items: center; gap: 10px; min-width: 0; margin-left: 0; }
  .vorlage-fuss .aktionen-zeile > .inline-formular:has(select) > select { flex: 1 1 auto; width: auto; }

  /* --- Designer: Werkzeuge als Raster über der Fläche, Fläche passt in die Bildschirmbreite (kein Zoom über 100 %) --- */
  body:has(.gestalter) .seiten-kopf .untertitel { display: none; }
  .gestalter, .inhalt > .gestalter { min-height: 0; max-width: none; } /* volle Bildschirmbreite (randlos wie am Desktop) */
  .gestalter-werkzeuge { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px var(--inhalt-innen); border-right: 0; border-bottom: 1px solid var(--rand); }
  .werkzeug { width: 100%; height: 52px; }
  .gestalter-mitte { align-items: stretch; padding: 12px var(--inhalt-innen) 16px; overflow: hidden; }
  .gestalter-handy-hinweis { display: block; margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
  .zoom-leiste { margin: 0 auto; }
  .zoom-leiste .zoom-knopf { width: 40px; height: 40px; }
  .zoom-leiste .zoom-knopf:disabled { opacity: .4; cursor: default; }
  .g-griff { width: 24px; height: 24px; right: -12px; bottom: -12px; }
  .gestalter-rechts { border-left: 0; }
  .inspektor-kopf, .inspektor-block { padding-left: var(--inhalt-innen); padding-right: var(--inhalt-innen); }
  .ebene-zeile { min-height: 48px; padding: 4px var(--inhalt-innen); }
  .ebene-knopf { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  .gestalter-rechts .zeilen-formular { grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); column-gap: 10px; }
  /* Farbfelder („Von“, „Nach“, „Farbe“) in Feldhöhe wie „Winkel“ daneben — sonst 38 px und die Beschriftungen versetzt */
  .gestalter-rechts input[type=color].inspektor-farbe { height: var(--feld-hoehe); }
  /* „Anzeigedauer“ über die volle Breite wie alle Felder am Handy (ui-richtlinien 1, Formulare) — in allen drei Modi gleich */
  input.sig-dauer-feld { width: 100%; }
  /* Rückgängig/Wiederholen im Seitenkopf: Pfeil-Symbol in lesbarer Größe */
  .seiten-kopf-aktionen .knopf.sig-undo svg { width: 20px; height: 20px; }
  /* Eigenschaften: Segmente (Ausrichtung, Ausrichten-Pfeile) über die volle Breite, Pfeile in lesbarer Größe */
  .gestalter-rechts .segment.sig-segment { display: flex; width: 100%; }
  .gestalter-rechts .segment.sig-segment > * { flex: 1 1 0; justify-content: center; padding: 0 4px; }
  .gestalter-rechts .segment.sig-segment > [onclick^="ausrichten"] { font-size: 18px; }
  /* Ebene nach hinten/vorn, Duplizieren, Löschen: zwei gleich breite Spalten, Pfeile mit Text */
  .sig-ebene-aktionen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sig-ebene-aktionen > .knopf { width: 100%; }
  .sig-ebene-aktionen .sig-handy-text { display: inline; margin-left: 6px; }
}

/* === Mobil: Dienstplan === */
/* Monatsplan auf dem Handy (portal/dienstplan/_mobil.php): „Tagesansicht“ (ein Tag, je Person eine Karte mit
   Dienst, Bereitschaft, Zusatz, Ist/Soll) und „Monat je Person“ (Kalender Mo–So) statt des Monatsrasters.
   Die Klasse .dp-m-an setzt erst das Skript — ohne Skript bleibt das Raster. Desktop/Tablet unverändert. */
.dp-mobil, .dp-bereich-wahl, .knopf.dp-m-legende-knopf, .bereich-reiter.dp-abschnitte { display: none; }
/* Plan-Einstellungen: auf dem Desktop stehen alle vier „+ …“-Knöpfe im Kopf (die Hülle span[data-dp-aktion] ist
   „unsichtbar“); auf dem Handy nur der des offenen Abschnitts (Abschnitt ohne hidden, gesetzt von bereichs_reiter()). */
body[data-seite$="portal/dienstplan/einstellungen.php"] .seiten-kopf-aktionen > [data-dp-aktion] { display: contents; }
@media (max-width: 767px) {
  body[data-seite$="portal/dienstplan/einstellungen.php"]:has(#bereiche[hidden]) .seiten-kopf-aktionen > [data-dp-aktion="bereiche"],
  body[data-seite$="portal/dienstplan/einstellungen.php"]:has(#dienstarten[hidden]) .seiten-kopf-aktionen > [data-dp-aktion="dienstarten"],
  body[data-seite$="portal/dienstplan/einstellungen.php"]:has(#rotationen[hidden]) .seiten-kopf-aktionen > [data-dp-aktion="rotationen"],
  body[data-seite$="portal/dienstplan/einstellungen.php"] .seiten-kopf-aktionen > [data-dp-aktion="personen"] { display: none; }
  /* Plan-Personen: „Person in diesen Bereich“ in der Karte legt mit vorgewähltem Bereich an — der Kopf bleibt dann leer */
  body[data-seite$="portal/dienstplan/einstellungen.php"]:has(#personen:not([hidden])):has(#bereiche[hidden]) .seiten-kopf-aktionen { display: none; }
  /* Plan-Einstellungen: Abschnitts-Leiste (Bereiche · Dienstarten · Rotationen & Feiertage · Plan-Personen) als 2 × 2 —
     die Unterpunkte der Seitenleiste liegen auf dem Handy hinter ☰ */
  .bereich-reiter.dp-abschnitte { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .bereich-reiter.dp-abschnitte .chip { justify-content: center; min-width: 0; height: auto; padding: 4px 10px; white-space: normal; text-align: center; line-height: 1.2; }
  /* Rotationen: Vorschau Mo–So in einer Zeile (vorher 5 + 2 umgebrochen); lange Codes werden gekürzt, voll im Formular */
  .liste-haupt > .dp-rot-vorschau { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; max-width: 280px; }
  .dp-rot-tag { min-width: 0; padding: 3px 1px; overflow: hidden; }
  .dp-rot-tag b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Bereich: ab fünf Bereichen Auswahlliste statt Pillen */
  .filter-leiste.dp-tabs-viele:has(+ .dp-bereich-wahl.bereit) { display: none; }
  .dp-bereich-wahl.bereit { display: block; width: 100%; margin: 0 0 14px; font-weight: 600; }
  /* Aufklapper „Monat & Plan“ oben in der Karte: _mobil.php verschiebt Kopfknöpfe (PDF, Gesamt-PDF, Plan-Einstellungen),
     Monatsleiste, Status, „Übermitteln“, „Rotation anwenden“, Hinweise und „Änderungen seit …“ hinein. Der Kopf zeigt
     Monat und Stand; das Wesentliche (Personen bzw. Kalender) beginnt so im ersten Bildschirm. */
  .dp-m-werkzeug { margin: 0 0 14px; }
  .dp-m-werkzeug > summary { flex-wrap: wrap; gap: 4px 9px; min-height: var(--feld-hoehe); padding: 8px 14px; color: var(--text); }
  .dp-m-werkzeug-titel { font-size: 15px; font-weight: 700; }
  .dp-m-werkzeug-status { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-left: auto; }
  .dp-m-werkzeug-status .abzeichen { white-space: normal; }
  .dp-m-werkzeug-panel { display: flex; flex-direction: column; gap: 12px; }
  .dp-m-werkzeug-panel > * { margin: 0; }
  .dp-m-werkzeug-panel .dp-kopf { padding: 0; gap: 12px; }
  .dp-m-werkzeug-panel .seiten-kopf-aktionen { gap: 8px; }
  .dp-m-werkzeug-panel .dp-seit-besuch-leer { margin: 0; }
  .dp-karte.dp-m-ist-tag .dp-monat-heute { display: none; } /* Tagesansicht hat ihr eigenes „Heute“ */
  /* Untertitel spricht vom Stempel-Modus bzw. der „eigenen Zeile“ — beides gibt es in der Handy-Ansicht nicht */
  body[data-seite$="portal/dienstplan/index.php"] .seiten-kopf .untertitel { display: none; }
  /* Monatsleiste (im Aufklapper): ‹ Monat › Heute in einer Zeile, Status und „Übermitteln“ darunter */
  .dp-monatnav { width: 100%; gap: 8px; }
  .dp-monatnav strong { flex: 1 1 auto; font-size: 17px; }
  .dp-monatnav .klein { flex: 1 1 100%; }
  .dp-status { width: 100%; }
  .dp-status .inline-formular { flex: 1 1 140px; }
  .dp-status .inline-formular .knopf { width: 100%; }
  /* Legende: auf dem Handy hinter einem Knopf (die Karten zeigen Code, Bezeichnung und Zeiten ohnehin) */
  .dp-karte.dp-m-an .knopf.dp-m-legende-knopf { display: flex; width: 100%; justify-content: space-between; margin-top: 16px; }
  .dp-m-legende-knopf::after { content: "▾"; color: var(--text-schwach); }
  .dp-m-legende-knopf[aria-expanded="true"]::after { content: "▴"; }
  .dp-karte.dp-m-an:not(.dp-legende-offen) .dp-legende { display: none; }
  .dp-legende { flex-direction: column; gap: 6px; padding: 0; }
  .dp-karte.dp-m-an .dp-m-legende-knopf + .dp-legende { margin-top: 12px; }
  .dp-legende-eintrag { display: block; }
  .dp-legende-eintrag i { display: inline-block; margin-right: 6px; vertical-align: -2px; }
  .dp-legende-eigene .dp-stempel-weg { margin-left: 6px; vertical-align: middle; }
  /* Raster und Stempel-Leiste weichen der Handy-Ansicht; „Rotation anwenden“ und der Hinweis ohne Dienstarten bleiben */
  .dp-karte.dp-m-an .dp-scroll { display: none; }
  .dp-karte.dp-m-an .dp-mobil { display: block; margin-top: 4px; }
  .dp-karte.dp-m-an .dp-stempel { padding: 0; border: 0; background: none; margin-bottom: 12px; }
  .dp-karte.dp-m-an .dp-stempel > :not(.dp-rot-anwenden):not(.dp-stempel-hinweis) { display: none; }
  .dp-karte.dp-m-an .dp-stempel:not(:has(.dp-rot-anwenden, .dp-stempel-hinweis)) { display: none; }
  .dp-karte.dp-m-an .dp-rot-anwenden { display: block; width: 100%; }
  .dp-karte.dp-m-an .dp-rot-anwenden > summary { display: flex; width: 100%; height: var(--knopf-hoehe); padding: 0 14px; border: 1px solid var(--rand-stark); border-radius: var(--radius); background: #fff; }
  .dp-seit-besuch > summary { display: block; padding: 0; }
  .dp-seit-besuch > summary::before { display: inline-block; margin-right: 6px; vertical-align: -1px; }
  .dp-seit-besuch:not([open]) > summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .dp-karte.dp-m-an .dp-rot-anwenden-panel { position: static; width: auto; max-width: none; margin-top: 8px; box-shadow: none; }
  .dp-seit-besuch { padding: 10px 12px; font-size: 13.5px; }
  .dp-pop-neu input { font-size: 16px; }
  /* Umschalter Tagesansicht / Monat je Person */
  .dp-m-ansicht { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
  .dp-m-ansicht .knopf { padding: 0 8px; min-width: 0; }
  .dp-m-ansicht .knopf[aria-pressed="true"] { background: var(--signal); border-color: var(--signal); color: #fff; font-weight: 600; }
  /* Tag wählen: ‹ Auswahl › Heute */
  .dp-m-tagnav { display: flex; align-items: center; gap: 8px; }
  .dp-m-tagnav > .knopf, .dp-m-tagnav > select { margin: 0; }
  .dp-m-tagnav .knopf { flex: 0 0 auto; min-width: 42px; padding: 0 12px; font-size: 15px; }
  .dp-m-tagnav select { flex: 1 1 auto; width: auto; min-width: 0; font-weight: 600; }
  /* Tageskopf: Datum (rechts „+ Ereignis“), Feiertag/Besetzung, Ereignisse */
  .dp-m-taginfo { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
  .dp-m-datumzeile { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .dp-m-datum { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 700; color: var(--text); }
  .dp-m-datumzeile .knopf { flex: 0 0 auto; margin: 0; padding: 0 12px; }
  .dp-m-tagabz { display: flex; flex-wrap: wrap; gap: 6px 8px; }
  .dp-m-taginfo .abzeichen { white-space: normal; }
  /* Ereignis: Streifen in der Ereignisfarbe links, leicht getönt, Text bricht um; Verwalter: ganzer Block tippbar, Stift rechts */
  .dp-m-ereignisse { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .dp-m-ev { --f: #fde68a; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: var(--knopf-hoehe); padding: 8px 12px;
    border: 1px solid var(--rand); border-left: 5px solid var(--f); border-radius: 8px; background: color-mix(in srgb, var(--f) 18%, #fff);
    font-size: 14px; line-height: 1.35; color: var(--text); }
  .dp-m-ev.tippbar { padding: 4px 4px 4px 12px; cursor: pointer; }
  .dp-m-ev-text { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
  .dp-m-ev-spanne { flex: 0 0 auto; font-size: 12px; color: var(--text-schwach); font-variant-numeric: tabular-nums; }
  .dp-m-ev-stift { flex: 0 0 auto; }
  /* Personenkarten */
  .dp-m-liste { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
  .dp-m-karte { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px 14px; border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche); }
  .dp-m-karte.dp-m-eigene { border-color: var(--signal-rand); background: var(--signal-flaeche); }
  .dp-m-karte.dp-m-markiert { border-color: var(--signal); box-shadow: 0 0 0 3px var(--fokus-ring); }
  .dp-m-karte.lade { opacity: .6; }
  .dp-m-kopf { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .dp-m-name { min-width: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
  .dp-m-kopf em { flex-shrink: 0; font-style: normal; font-size: 11px; font-weight: 600; background: var(--signal); color: #fff; border-radius: 999px; padding: 1px 7px; }
  .dp-m-kz { margin-left: auto; flex-shrink: 0; font-family: var(--schrift-mono); font-size: 12px; color: var(--text-schwach); }
  .dp-m-zeile { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: start; gap: 8px; min-height: 28px; }
  .dp-m-lbl { padding-top: 4px; font-size: 12.5px; color: var(--text-schwach); }
  .dp-m-zeile:has(.dp-m-wert-wahl, .dp-m-zbtn) { align-items: center; }
  .dp-m-zeile:has(.dp-m-wert-wahl, .dp-m-zbtn) > .dp-m-lbl { padding-top: 0; }
  .dp-m-wert { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: 14px; }
  .dp-m-leer { color: var(--text-still); }
  .dp-m-code { --f: #e5e7eb; display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 26px; padding: 0 7px; border-radius: 6px; background: var(--f);
    font-size: 13px; font-weight: 800; color: #111827; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
  .dp-m-code.wunsch { outline: 2px dashed #f59e0b; outline-offset: 1px; }
  .dp-m-code.doppel { box-shadow: inset 0 0 0 2px #ef4444; }
  .dp-m-bez { min-width: 0; overflow-wrap: anywhere; }
  .dp-m-zeit { font-size: 12.5px; color: var(--text-schwach); font-variant-numeric: tabular-nums; }
  .dp-m-hinweis { flex: 1 1 100%; font-size: 12px; line-height: 1.35; color: var(--text-schwach); }
  .dp-m-hinweis.warn { color: #b91c1c; font-weight: 600; }
  .dp-m-hinweis.neu { color: var(--signal); }
  .dp-m-wahl { --f: #fff; width: 100%; background-color: var(--f); font-weight: 600; }
  .dp-m-zusatz-werte { flex-wrap: wrap; }
  .dp-m-zbtn { --f: #fff; flex: 0 1 auto; min-width: 52px; padding: 0 12px; background: var(--f); color: #111827; font-weight: 700; }
  .dp-m-zbtn.leer { color: var(--text-schwach); font-weight: 500; border-style: dashed; }
  .dp-m-stat { display: flex; flex-wrap: wrap; gap: 2px 14px; padding-top: 8px; border-top: 1px solid var(--rand-weich); font-size: 12.5px; color: var(--text-schwach); }
  .dp-m-stat b { font-family: var(--schrift-mono); font-weight: 600; color: var(--text); }
  .dp-m-stat b.negativ, .dp-m-kennz .negativ b { color: #dc2626; }
  /* Monat je Person: Kennzahlen, Kalender Mo–So, Bemerkungen */
  .dp-m-personwahl { display: block; width: 100%; margin: 0 0 12px; font-weight: 600; }
  .dp-m-kennz { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .dp-m-kennz > div { min-width: 0; padding: 6px 10px; border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche); }
  .dp-m-kennz span { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-schwach); }
  .dp-m-kennz b { display: block; font-family: var(--schrift-mono); font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
  .dp-m-kal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 14px; }
  .dp-m-kal-kopf { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-schwach); }
  .dp-m-kal-kopf.we { color: #b91c1c; }
  .dp-m-kt { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 42px; min-width: 0; padding: 0 2px 5px; margin: 0;
    border: 1px solid var(--rand); border-radius: 8px; background: #fff; color: var(--text); font: inherit; cursor: pointer; }
  .dp-m-kt small { position: absolute; top: 3px; left: 4px; font-size: 10px; line-height: 1; color: var(--text-schwach); }
  .dp-m-kt b { --f: transparent; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 4px; border-radius: 4px; background: var(--f);
    font-size: 12px; font-weight: 800; line-height: 1.25; color: #111827; }
  .dp-m-kt b.frei { color: var(--text-still); font-weight: 400; }
  .dp-m-kt i { position: absolute; top: 3px; right: 3px; max-width: 55%; overflow: hidden; font-style: normal; font-size: 9px; font-weight: 700; line-height: 1; color: var(--text-2); }
  .dp-m-kt.we { background: #f3f5f8; }
  .dp-m-kt.ft { background: #fdf2f2; border-color: #fecaca; }
  .dp-m-kt.ft small { color: #b91c1c; font-weight: 700; }
  .dp-m-kt.heute { border-color: var(--signal); border-width: 2px; }
  .dp-m-kt.gewaehlt { box-shadow: 0 0 0 2px var(--fokus-ring); }
  .dp-m-kt.wunsch b { outline: 1.5px dashed #f59e0b; }
  .dp-m-kt.doppel b { box-shadow: inset 0 0 0 1.5px #ef4444; }
  .dp-m-kt.zusatz::after { content: ""; position: absolute; left: 4px; bottom: 4px; width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; }
  .dp-m-kt.neu::before { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 8px 8px 0; border-color: transparent var(--signal) transparent transparent; border-top-right-radius: 7px; }
  .dp-m-kal-hilfe { margin: 10px 0 0; }
  .dp-m-bems { display: flex; flex-direction: column; gap: var(--formular-abstand); margin-top: 16px; }
  .dp-m-bems:empty { display: none; }
  .dp-m-bems > * { margin: 0; }
  .dp-m-bem-titel { margin: 0; font-size: 14px; }
  .dp-m-bems p { margin: 0; }
  .dp-m-bem-text { padding: 8px 12px; border-left: 3px solid #f59e0b; background: #fffbeb; border-radius: 0 6px 6px 0; font-size: 14px; overflow-wrap: anywhere; }
  .dp-m-einzeln .knopf { width: 100%; }
  .dp-m-toast { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 80; margin: 0; box-shadow: 0 10px 30px rgba(15, 23, 42, .2); }
  .dp-m-toast[hidden] { display: none; }
  /* Plan-Einstellungen: Stift/Papierkorb neben dem Titel statt in einer eigenen Zeile — halbiert die Zeilenhöhe */
  .liste-zeile.dp-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 12px; }
  .liste-zeile.dp-zeile > .liste-haupt { grid-column: 1; grid-row: 1; }
  .liste-zeile.dp-zeile > .zeilen-aktionen { grid-column: 2; grid-row: 1; width: auto; margin-left: 0; }
  .liste-zeile.dp-zeile > .liste-werte { grid-column: 1 / -1; grid-row: 2; }
  /* Plan-Einstellungen → Rotation: Wochenraster quer (Tag | Dienst | Bereitschaft) statt sieben Spalten nebeneinander */
  .tabelle-umbruch:has(> .dp-rotation) { overflow: visible; }
  .tabelle.dp-rotation { display: block; width: 100%; table-layout: auto; }
  .tabelle.dp-rotation > tbody { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px; }
  .tabelle.dp-rotation tr { display: contents; }
  .formular-karte .tabelle.dp-rotation tr > :is(th, td) { display: block; width: auto; padding: 0; border: 0; background: none; text-align: left; white-space: normal; }
  .tabelle.dp-rotation tr:nth-child(1) > * { grid-column: 1; }
  .tabelle.dp-rotation tr:nth-child(2) > * { grid-column: 2; }
  .tabelle.dp-rotation tr:nth-child(3) > * { grid-column: 3; }
  .tabelle.dp-rotation tr > :nth-child(1) { grid-row: 1; }
  .tabelle.dp-rotation tr > :nth-child(2) { grid-row: 2; }
  .tabelle.dp-rotation tr > :nth-child(3) { grid-row: 3; }
  .tabelle.dp-rotation tr > :nth-child(4) { grid-row: 4; }
  .tabelle.dp-rotation tr > :nth-child(5) { grid-row: 5; }
  .tabelle.dp-rotation tr > :nth-child(6) { grid-row: 6; }
  .tabelle.dp-rotation tr > :nth-child(7) { grid-row: 7; }
  .tabelle.dp-rotation tr > :nth-child(8) { grid-row: 8; }
  .formular-karte .tabelle.dp-rotation tr > th.we { color: #b91c1c; }
}

/* === Mobil: Verträge & Wiedervorlagen === */
/* --- Verträge (portal/vertraege/index.php) --- */
/* Tarif-Aufklapper im Vertragsformular: Abstand des Inhalts zur Kopfzeile als Außen- statt Innenabstand (wie
   .anlegen-akkordeon) — als Innenabstand „klebte“ das Feldraster laut mess.js mit 0 px an der Kopfzeile.
   Gilt auch am Desktop und sieht dort gleich aus (16 px). */
.vt-tarif > summary + :not(summary) { padding-top: 0; margin-top: 16px; }
@media (max-width: 767px) {
  /* Formular: Fieldsets und Tarif-Aufklapper mit schmalerem Innenrand, damit die Felder die Breite bekommen
     (Karte + Fieldset + Aufklapper stapelten sonst 54 px Rand je Seite) */
  .vt-formular fieldset { padding: 14px 14px 16px; }
  .vt-formular .vt-tarif { margin: 16px 0 12px; }
  .vt-formular .vt-tarif > summary { padding: 12px; }
  .vt-formular .vt-tarif > :not(summary) { padding-left: 12px; padding-right: 12px; }
  /* Vertragsliste als Karten: „Kündigen bis“ steht direkt unter dem Vertragsnamen — die Frist ist das Wesentliche */
  .tabelle.tk.vt-liste tr > .vt-frist { order: -1; }
}

/* === Mobil: Arbeitsaufträge === */
/* --- Auftragsblatt im Auftrag (portal/arbeitsauftraege/auftrag.php, module/arbeitsauftraege/blatt_ansicht.php,
   assets/blatt-auftrag.js; Klassen .bl-*): Formular „Was wird gemacht?“ mit Abschnitt-Chips und Feldern der zwölf Feldarten,
   Werkstatt-Karten mit Vorgaben als Chips, Tabellen als Karten je Zeile, Werkstatt-Angaben, Abschlusszeilen. Desktop und Handy
   beisammen; am Handy wird nichts gewischt (Tabellenzeilen werden Karten, Chips brechen um, lange Optionen umbrechen). --- */
/* Optionen und Abschnitte als Kästchen-Chips: Häkchen sichtbar, Text bricht um */
.bl-wahl, .bl-optionen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bl-wahl > *, .bl-optionen > * { margin: 0; }
.bl-opt { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; max-width: 100%; padding: 6px 14px 6px 12px; box-sizing: border-box; border: 1px solid var(--rand-stark);
  border-radius: 999px; background: #fff; color: var(--text); font-size: 14px; font-weight: 500; line-height: 1.25; cursor: pointer; overflow-wrap: anywhere; }
.bl-opt > input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--signal); }
.bl-opt:has(> input:checked) { border-color: var(--signal); background: var(--flaeche-aktiv); color: var(--signal); }
.bl-opt:focus-within { outline: 2px solid var(--fokus-ring); outline-offset: 1px; }
.bl-opt-keine { color: var(--text-schwach); }
.bl-opt-stoerung { border-color: #fca5a5; }
.bl-opt-mit-text { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.bl-opt-mit-text > input[type=text] { width: 170px; min-width: 0; flex: 1 1 120px; }
.bl-wahl-chip { font-weight: 600; }   /* 40 px wie jede Auswahl (.bl-opt) — vorher 44 */
.bl-wahl-chip.fest { cursor: default; border-style: dashed; background: var(--flaeche-still); color: var(--text-2); }
.bl-gruppe-titel { margin-bottom: 8px; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text-2); }
.bl-gruppe > .feld-hilfe { margin: -4px 0 8px; }
.bl-gruppe-titel.bl-untertitel { margin-top: 14px; }
.bl-pflicht { margin-left: 3px; color: var(--gefahr); font-weight: 700; }   /* Stern direkt hinter der Beschriftung (aa_pflicht) */
.bl-gruppe > .zeilen-formular { margin-top: 12px; }
.bl-gruppe > .bl-optionen + .zeilen-formular { margin-top: 12px; }
.bl-maschine > .zeilen-formular:first-child { margin-top: 0; }
/* Abschnitte im Formular: Fieldset je Abschnitt (gesperrt und versteckt, solange nicht gewählt; Aufbau im Abschnitt
   „Arbeitsaufträge: Formular“ weiter unten) */
.bl-abschnitt.bl-ziel { box-shadow: 0 0 0 3px var(--fokus-ring); }
/* Tabellen und Dateilisten im Formular: Desktop eine Reihe je Zeile mit Spaltenkopf, Handy eine Karte je Zeile */
.bl-tabelle, .aaf-form { --zeile-symbol: calc(var(--feld-hoehe) - 2px); --zeile-symbole: calc(3 * var(--zeile-symbol) + 12px); }   /* Zeilen-Symbole 40 px, drei mit Abstand */
/* Spaltenköpfe = Beschriftung; je Zeile rechts ＋ ⧉ Papierkorb (.bl-zeile-knoepfe, aa_zeilen_knoepfe), mittig zum 42-px-Feld. Die
   Zeilennummer steht nur am Handy. Ohne Skript steht je Tabelle eine leere Zeile mehr da (<noscript>). */
.bl-tab-kopf, .bl-tab-zeile { display: grid; grid-template-columns: repeat(var(--bl-spalten, 1), minmax(0, 1fr)) var(--zeile-symbole); gap: 8px 10px; align-items: center; }
.bl-tab-kopf { margin-bottom: var(--beschriftung-abstand); font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text-2); }
.bl-tab-zeilen > .bl-tab-zeile + .bl-tab-zeile, .bl-tab-zeilen > noscript > .bl-tab-zeile { margin-top: 8px; }
.bl-tab-zeile > label { margin: 0; min-width: 0; }
.bl-tab-zeile > label > :is(input, select) { margin-top: 0; }   /* select: Einheit (einheit_auswahl_html) in Positionszeilen */
.bl-tab-label, .bl-tab-nr { display: none; }
.bl-zeile-knoepfe { display: flex; justify-content: flex-end; gap: 6px; }
.bl-zeile-knoepfe > .aktion-icon { width: var(--zeile-symbol); height: var(--zeile-symbol); }
/* Liste, Plantafel, Dashboard: Abschnitte als kleine Chips, „als Nächstes“ */
.bl-liste-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.bl-als-naechstes { margin-top: 4px; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.bl-als-naechstes b { font-weight: 600; color: var(--text); }
@media (max-width: 767px) {
  .bl-opt-mit-text { flex-wrap: wrap; }
  .bl-opt-mit-text > input[type=text] { width: auto; flex: 1 1 140px; }
  /* Tabellen: je Zeile eine Karte ohne Rahmen (Trennlinie) — Nummer links oben, ＋ ⧉ Papierkorb rechts oben, erstes Feld über die
     volle Breite, die übrigen zu zweit; Dateilisten bleiben einzeilig (Nummer | Feld | Symbole) */
  .bl-tab-kopf { display: none; }
  .bl-tab-zeile { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
  .bl-tab-zeilen > .bl-tab-zeile + .bl-tab-zeile, .bl-tab-zeilen > noscript > .bl-tab-zeile { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rand); }
  .bl-tab-zeile > .bl-tab-nr { display: flex; align-items: center; grid-row: 1; grid-column: 1; font-size: 13px; font-weight: 700; color: var(--text-schwach); }
  .bl-tab-zeile > .bl-zeile-knoepfe { grid-row: 1; grid-column: 2; }
  .bl-tab-zeile > label:first-of-type { grid-column: 1 / -1; }
  .bl-tab-zeile .bl-tab-label { display: block; margin-bottom: var(--beschriftung-abstand); font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text-2); }
  .bl-tab-zeile.bl-datei-zeile .bl-tab-label { display: none; }   /* eine Spalte: die Beschriftung steht schon über der Liste */
  /* Vier Spalten (z. B. Artikel | Farbe | Größe | Stück): die drei nach dem ersten Feld nebeneinander; eine Zahlenspalte am Ende
     schmal (data-zahl-ende, aa_blatt_tabelle_html) */
  .bl-tabelle[data-spalten="4"] .bl-tab-zeile { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bl-tabelle[data-spalten="4"][data-zahl-ende] .bl-tab-zeile { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 64px; }
  .bl-tabelle[data-spalten="4"] .bl-tab-zeile > .bl-zeile-knoepfe { grid-column: 2 / -1; }
}
/* PDF-Auswahl im Seitenkopf eines Auftrags mit Blatt: Laufzettel, mit Anhang, leerer Laufzettel, Liste */
.aa-pdf-wahl, .aa-pdf-wahl[open] { position: relative; border: 0; border-radius: 0; background: none; }
.aa-pdf-wahl > summary { list-style: none; }
.aa-pdf-wahl > summary::before { content: none; }
.aa-pdf-wahl > summary::-webkit-details-marker { display: none; }
.aa-pdf-wahl[open] > summary { border-bottom-width: 1px; border-radius: var(--radius); border-color: var(--signal-rand); background: var(--flaeche-aktiv); color: var(--signal); }
.aa-pdf-pfeil { font-size: 11px; }
.aa-pdf-wahl > .aa-pdf-menue { position: absolute; right: 0; top: calc(100% + 6px); z-index: 88; display: flex; flex-direction: column; gap: 2px; width: 330px; max-width: calc(100vw - 32px);
  margin: 0; padding: 6px; box-sizing: border-box; border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.aa-pdf-menue > a { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 44px; padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; }
.aa-pdf-menue > a:hover, .aa-pdf-menue > a:focus-visible { background: var(--flaeche-still); text-decoration: none; }
.aa-pdf-menue > a > span { font-size: 12.5px; font-weight: 400; line-height: 1.35; color: var(--text-schwach); }
@media (max-width: 767px) {
  .seiten-kopf-aktionen > .aa-pdf-wahl { flex: 1 1 auto; }
  .aa-pdf-wahl > summary { width: 100%; justify-content: center; }
  .aa-pdf-wahl > .aa-pdf-menue { left: 0; right: auto; }
}
/* EINE Menü-Bauart für Auftragsseite und Formular: „Drucken ▾“, „⋯“ (Kopf, Schritt, Materialzeile) und „+ Abschnitt“ im Formular —
   Gruppentitel (.aa-menue-gruppe), Trenner (.aa-menue-trenner), Links, Knöpfe (direkt oder in einem Formular) als Menüzeilen */
.aa-pdf-menue > .aa-menue-gruppe { padding: 8px 10px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-schwach); }
.aa-pdf-menue > form { margin: 0; }
.aa-pdf-menue > button, .aa-pdf-menue > form > button { display: flex; align-items: center; width: 100%; height: var(--feld-hoehe); margin: 0; padding: 6px 10px; border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text); text-align: left; cursor: pointer; }
.aa-pdf-menue > button:hover, .aa-pdf-menue > button:focus-visible, .aa-pdf-menue > form > button:hover, .aa-pdf-menue > form > button:focus-visible { background: var(--flaeche-still); }
.aa-pdf-wahl + .aa-pdf-wahl { margin-top: 0; }   /* „Drucken“ und „⋯ Mehr“ nebeneinander: ohne den Abstand „details + details“ */
/* Positionszeilen im Formular (Aufträge ohne Abschnitte, Endkontrolle): ↑ und Entfernen nebeneinander in Feldhöhe, auf einer
   Linie mit den Eingabefeldern — vorher stand das Text-↑ 3 px höher als das Papierkorb-Symbol */
.aa-pos-zeile > .zeilen-icons { display: flex; align-items: center; gap: 6px; min-height: var(--feld-hoehe); }   /* Symbol-Knöpfe bleiben Symbolgröße, mittig zur Feldhöhe */
@media (min-width: 768px) {
  .aa-pos-zeile { grid-template-columns: 28px minmax(180px, 2fr) 90px 90px minmax(120px, 1fr) auto; }
}
/* Knöpfe als Zelle im Formular-Raster („Speichern“ im Aufklapper): zentrale Regel im Abschnitt Formulare */
@media (max-width: 767px) {
  /* Positions- und Prüfpunktzeilen im Formular: ↑ und Entfernen rechts neben der Bezeichnung, mittig zum Feld — vorher standen
     sie allein in einer Zeile darunter (bei Prüfpunkten nach drei leeren Zellen) */
  .aa-pos-zeile { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .aa-pos-zeile > :nth-child(2) { grid-column: 1 / 3; grid-row: 1; }
  .aa-pos-zeile > .zeilen-icons { grid-column: 3; grid-row: 1; align-self: start; }
  .aa-pos-zeile > :nth-child(4) { grid-column: 2 / -1; }
  .aa-pos-zeile > :nth-child(5) { grid-column: 1 / -1; }
  .aa-pos-zeile > div:empty { display: none; }
}
@media (max-width: 767px) {
  .seiten-kopf-aktionen > .aa-pdf-wahl:last-child > .aa-pdf-menue { left: auto; right: 0; }
  /* Stornieren / Wieder öffnen (Verwalten): Knöpfe unter dem Feld über die volle Breite */
  .aa-klapp > form > .knopf { justify-self: stretch; justify-content: center; }
}
/* === Arbeitsaufträge: Formular (Neu/Bearbeiten) — Entwurf von Patrick freigegeben am 08.10.2026 ===
   portal/arbeitsauftraege/auftrag.php (?neu=1 / ?bearbeiten=), Bausteine module/arbeitsauftraege/blatt_ansicht.php (Raster, Chips,
   Tabellen — auch in den Werkstatt-Angaben der Auftragsseite), kern/kunde.php (Kundenwahl), Verhalten assets/blatt-auftrag.js und
   assets/kunde.js. Klassen: .aaf-* (Formular), .bl-raster/.bl-zelle/.bl-spN (Raster aus drei Spalten, Handy eine), .bl-klapp
   („› Weitere Angaben“, „› Details und Dateien“ — Pfeil davor, ohne Kasten), .bl-zeile-knoepfe (＋ ⧉ Papierkorb, Tabellen-Regeln
   oben im Abschnitt „Mobil: Arbeitsaufträge“), .kunde-* (Kern-Baustein). Zwei Höhen: alles zum Antippen 40 px (Chips, Zeilen-
   Symbole, „+ …“, Aufklapper), Felder 42 px (Token). Desktop und Handy beisammen; am Handy wird nichts gewischt. */
.aaf-form > .karte { margin: 0 0 var(--karte-abstand); }
.inhalt:has(> .aaf-form) { padding-bottom: 0; }
.aaf-form textarea { min-height: 0; }
/* Pflicht-Stern steht hinter dem Wort (aa_pflicht) — der Stern der Grundregel am rechten Ende entfällt hier */
:is(.aaf-form, .bl-raster) label:has(> [required])::before { content: none; }
/* Raster aus drei gleich breiten Spalten, Beschriftungen oben bündig; Zellen 1–3 Spalten (aa_blatt_raster) */
.bl-raster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--formular-abstand) 20px; align-items: start; }
.bl-raster > * { min-width: 0; margin: 0; }
.bl-raster > .bl-sp1 { grid-column: span 1; }
.bl-raster > .bl-sp2 { grid-column: span 2; }
.bl-raster > .bl-sp3 { grid-column: 1 / -1; }
.bl-zelle > :is(label, .bl-gruppe) { margin: 0; }
.bl-zelle > label + label { margin-top: var(--formular-abstand); }
.bl-zelle > .bl-gruppe > .bl-gruppe-titel { margin-bottom: var(--beschriftung-abstand); }
.bl-zelle > .bl-gruppe > .bl-optionen + .zeilen-formular { margin-top: 12px; }
.bl-zelle > .bl-gruppe > .bl-maschine-hinweis, .bl-zelle > label + .bl-maschine-hinweis { margin-top: 6px; }
.bl-opt-mit-text > input[type=text] { height: var(--feld-hoehe); }
/* Karten „Was wird gemacht?“ und „Endkontrolle“: Titel wie eine Feldbeschriftung; Abschnitte als nummerierte Karten in der
   Reihenfolge der Vorlage, Abschnitte ohne Büro-Felder als ruhige Zeile */
.aaf-karten-titel { margin-bottom: 0; }
.aaf-schritte { display: flex; flex-direction: column; gap: 12px; }
.karte > .aaf-schritte { margin-top: 20px; }
.aaf-schritte > * { margin: 0; }
fieldset.aaf-schritt, .aaf-schritt { padding: 16px 20px; border: 1px solid var(--rand); border-radius: 12px; background: var(--container); }
.aaf-schritt > * + * { margin-top: 14px; }
.aaf-schritt > .aaf-kopf { margin-top: 0; }
.aaf-kopf { display: flex; align-items: center; gap: 10px; min-height: 28px; }
.aaf-kopf > .aaf-titel { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .01em; color: var(--text); overflow-wrap: anywhere; }
.aaf-kopf > .aktion-icon { width: var(--zeile-symbol); height: var(--zeile-symbol); margin: -6px 0 -6px auto; }
.aaf-kopf > .aaf-erledigt { margin-left: auto; }
.aaf-kopf > .aaf-erledigt + .aktion-icon { margin-left: 0; }
.aaf-nr { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid var(--rand-stark); border-radius: 50%;
  background: #fff; font-size: 12px; font-weight: 700; color: var(--text-schwach); }
.aaf-erledigt { font-size: 13px; font-weight: 600; color: #047857; }
.aaf-zeile { display: flex; align-items: center; gap: 10px; min-height: var(--zeile-symbol); padding: 0 21px; font-size: 14px; color: var(--text-2); }
.aaf-zeile > b { font-weight: 600; color: var(--text); }
.aaf-zeile > :is(.aaf-erledigt, .aktion-icon) { margin-left: auto; }
.aaf-zeile.ist-erledigt { min-height: 56px; padding: 0 20px; border: 1px solid var(--rand); border-radius: 12px; background: #fff; }
.aaf-menge { display: flex; gap: 8px; }
.aaf-menge > label { margin: 0; min-width: 0; }
.aaf-menge > label:first-child { flex: 0 0 90px; }
.aaf-menge > label:last-child { flex: 1 1 auto; }
.aa-geraet { display: grid; gap: 8px; }
.aaf-geraet-zelle > .bl-gruppe-titel { margin-bottom: var(--beschriftung-abstand); }
/* Positionen (Aufträge ohne Abschnitte) und Prüfpunkte: Tabellenzeilen mit festem Raster; „› Details und Dateien“ darunter */
.aaf-pos-kopf, .aaf-pos-zeile { grid-template-columns: minmax(0, 2fr) minmax(0, 90px) minmax(0, 160px) minmax(0, 1fr) var(--zeile-symbole); }   /* Einheit 160: „andere: Stück“ (alter Freitext) ganz lesbar */
.aaf-kon-zeile { grid-template-columns: minmax(0, 1fr) var(--zeile-symbole); }
/* Felder oben bündig (die Zelle „Gerät / Maschine“ wird mit „andere …“ zweizeilig), Symbole mittig zur ersten Feldzeile */
.aaf-pos-zeile { align-items: start; }
.aaf-pos-zeile > .bl-zeile-knoepfe { margin-top: calc((var(--feld-hoehe) - var(--zeile-symbol)) / 2); }
.aaf-pos-zeile > :is(.bl-klapp, .aaf-pos-erledigt) { grid-column: 1 / -1; }
.aaf-pos-zeile > .bl-klapp > .bl-raster { margin-top: 0; }
.bl-tab-zeilen > .aaf-pos-zeile + .aaf-pos-zeile { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rand-weich); }   /* Positionen mit Aufklapper: Trennlinie */
.aaf-pos-mehr-fuss { margin-top: 12px; }
.aaf-pos-mehr-fuss svg { width: 14px; height: 14px; }
.aaf-kon-vorlage { margin-bottom: var(--formular-abstand); }
/* Aufklappen: Pfeil davor (wie überall), dunkle Schrift, ohne Kasten, 40 px Tippfläche */
.bl-klapp, .bl-klapp[open] { border: 0; border-radius: 0; background: none; }
.bl-klapp > summary, .bl-klapp[open] > summary { display: inline-flex; min-height: var(--zeile-symbol); padding: 0 8px 0 0; gap: 8px; border: 0; border-radius: var(--radius); background: none;
  font-size: 14px; font-weight: 600; color: var(--text-2); }
.bl-klapp > summary:hover { background: none; color: var(--text); }
.bl-klapp > :not(summary) { padding: 0; }
.bl-klapp > summary + :not(summary) { padding-top: 8px; }
.bl-klapp > :not(summary):last-child { padding-bottom: 0; }
.karte > .bl-klapp { margin-top: 10px; }
/* „+ <Ding>“ = hinzufügen (blaue Schrift, 40 px): + Abschnitt, + Druckdatei, + Bild */
.aaf-plus { display: inline-flex; align-items: center; gap: 6px; height: var(--zeile-symbol); margin: 0; padding: 0 10px 0 6px; border: 0; border-radius: var(--radius); background: none;
  font: 600 14px var(--schrift); color: var(--signal); white-space: nowrap; cursor: pointer; }
.aaf-plus:hover { background: var(--flaeche-aktiv); color: var(--signal); }
/* „+ Abschnitt“: schwebende Liste in der Bauart der Auftragsseite (details.aa-pdf-wahl > .aa-pdf-menue, Regeln oben im Abschnitt
   „Mobil: Arbeitsaufträge“) — schiebt nichts nach unten; öffnet nach rechts, weil „+ Abschnitt“ am Anfang einer Chip-Zeile stehen kann */
.aaf-menue > .aa-pdf-menue { left: 0; right: auto; width: 290px; }
/* Grund fürs Entfernen eines geschützten Abschnitts (Verwalter): EIN gelbes Feld direkt unter den Chips */
.aaf-grund { padding: 10px 12px; border: 1px solid #fcd34d; border-radius: 10px; background: #fffbeb; }
.aaf-grund > label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; }
.aaf-grund > label > span { font-size: 14px; font-weight: 600; color: #92400e; }
.aaf-grund > label > input { flex: 1 1 260px; min-width: 0; margin: 0; }
/* Das „?“ (20 px) macht eine Beschriftung nicht höher als die Nachbarn ohne „?“ — sonst stand z. B. „+ Datei“ unter „Dateien ?“
   4 px tiefer als „Priorität“ daneben */
@media (min-width: 768px) { .aaf-form :is(label, .bl-gruppe-titel) > .feld-hilfe-knopf { margin-top: -4px; margin-bottom: -4px; } }
/* Dateien: „+ Druckdatei“ / „+ Bild“ auf der Linie der Felder (die Dateiwahl selbst ist mit Skript unsichtbar), Liste darunter */
.aaf-dateien-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: var(--feld-hoehe); }
.aaf-datei-knopf { position: relative; }
.aaf-form:not(.aaf-js) .aaf-datei-knopf { height: auto; flex-wrap: wrap; white-space: normal; }
.aaf-dateiliste { margin: 0; padding: 0; list-style: none; }
.aaf-dateiliste:empty { display: none; }
.aaf-dateiliste > li { display: flex; align-items: center; gap: 8px; min-height: var(--zeile-symbol); font-size: 14px; color: var(--text); }
.aaf-datei-name { min-width: 0; overflow-wrap: anywhere; }
.aaf-dateiliste small { font-size: 12.5px; color: var(--text-schwach); white-space: nowrap; }
.aaf-dateiliste .aktion-icon { flex: none; width: var(--zeile-symbol); height: var(--zeile-symbol); margin-left: auto; border-color: transparent; }
.aaf-dateiliste > li:has(input:checked) .aaf-datei-name { color: var(--text-schwach); text-decoration: line-through; }
.aaf-dateiliste > li:has(input:checked) .aaf-datei-weg { border-color: #fca5a5; color: var(--gefahr); }
/* Auftragsvorlage im Seitenkopf: Beschriftung und Auswahl auf einer Linie (Bearbeiten: nur der Name) */
.aaf-vorlage-wahl { display: flex; align-items: center; gap: 10px; margin: 0; }
.aaf-vorlage-wahl > * { margin: 0; }
.aaf-vorlage-wahl > label { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.aaf-vorlage-wahl > select, .aaf-vorlage-wahl > .auswahl-feld { width: 300px; }
.aaf-vorlage-anzeige { display: flex; align-items: center; gap: 10px; min-height: var(--feld-hoehe); font-size: 14px; color: var(--text); }
.aaf-vorlage-anzeige > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
/* Feste Leiste unten: Speichern | Abbrechen auf einer Linie, bleibt beim Scrollen am unteren Rand */
.aaf-leiste { position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 10px; margin: 0 calc(-1 * var(--inhalt-innen));
  padding: 12px var(--inhalt-innen) calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rand); background: var(--flaeche); box-shadow: 0 -6px 16px rgba(15, 23, 42, .06); }
.aaf-leiste > .knopf { margin: 0; }
body:has(.aaf-leiste) .support-fab { bottom: calc(var(--knopf-hoehe) + 44px); }   /* über der Leiste, nicht auf „Abbrechen“ */
/* … und ganz unten Platz für ihn über der Leiste — sonst läge er auf ⧉/Papierkorb der letzten Zeile (wie das Lager: 80 px) */
body:has(.support-fab) .aaf-form > .aaf-leiste { margin-top: 80px; }
/* Kunde wählen (Kern-Baustein kern/kunde.php): Umschalter Firma | Privatperson und EIN Suchfeld auf einer Linie; ohne Skript blendet
   CSS das nicht gewählte Feld aus (der Server nimmt ohnehin nur das gewählte) */
.kunde-titel { margin-bottom: var(--beschriftung-abstand); font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text-2); }
.kunde-zeile { display: flex; align-items: center; gap: 12px; }
.kunde-zeile > .kunde-feld { flex: 1 1 auto; min-width: 0; margin: 0; }
.kunde-zeile > .kunde-feld > :is(select, .auswahl-feld) { margin-top: 0; }
.segment.kunde-art { flex: none; }
.segment.kunde-art > label { position: relative; height: var(--feld-hoehe); margin: 0; padding: 0 16px; justify-content: center; font-size: 14px; }
.segment.kunde-art > label > input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.segment.kunde-art > label:has(> input:checked) { border-color: var(--signal); background: var(--signal); color: #fff; }
.segment.kunde-art > label:not(:has(> input:checked)):hover { background: var(--flaeche-aktiv); color: var(--signal); }
.segment.kunde-art > label:focus-within { outline: 2px solid var(--signal); outline-offset: -2px; }
.kunde-wahl:has(input[name="kunde_wahl"][value="firma"]:checked) [data-kunde="person"], .kunde-wahl:has(input[name="kunde_wahl"][value="person"]:checked) [data-kunde="firma"],
.kunde-wahl:has(input[name="kunde_wahl"][value="firma"]:checked) + .kunde-neben [data-kunde="person"], .kunde-wahl:has(input[name="kunde_wahl"][value="person"]:checked) + .kunde-neben [data-kunde="firma"] { display: none; }
.kunde-wahl .auswahl-feld.hat-wert > .auswahl-eingabe { border-color: var(--signal-rand); background-color: var(--flaeche-aktiv); font-weight: 600; }
.kunde-neben > label { margin: 0; }
@media (max-width: 767px) {
  .bl-raster { grid-template-columns: minmax(0, 1fr); }
  .bl-raster > :is(.bl-sp1, .bl-sp2, .bl-sp3) { grid-column: 1; }
  /* Chips als Raster mit zwei gleich breiten Spalten (kein Flatterrand); ein Wort breiter als die halbe Zeile → über beide
     (bl-opt-breit, assets/blatt-auftrag.js misst); ein gewähltes „Sonstiges …“ mit seinem Textfeld über beide */
  .aaf-form :is(.bl-optionen, .bl-wahl) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
  .aaf-form :is(.bl-optionen, .bl-wahl) > :is(.bl-opt, .bl-opt-mit-text) { width: 100%; min-width: 0; }
  .aaf-form .bl-opt { padding-right: 10px; padding-left: 10px; line-height: 1.3; overflow-wrap: normal; }
  .aaf-form :is(.bl-optionen, .bl-wahl) > .bl-opt-breit { grid-column: 1 / -1; }
  .aaf-form .bl-optionen.bl-kurz { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* kurze Auswahlen (EPS · PDF · TIF, 1:1 · 1:10 · 1:…) zu dritt */
  .aaf-form .bl-opt-mit-text:has(> .bl-opt > input:checked) { grid-column: 1 / -1; }
  .aaf-form .bl-opt-mit-text > .bl-opt { flex: 1 1 auto; }
  .aaf-form .bl-opt-mit-text:has(> .bl-opt > input:checked) > .bl-opt { flex: 0 0 calc(50% - 4px); }
  .aaf-form .bl-opt-mit-text > input[type=text] { flex: 1 1 0; width: auto; }
  .aaf-menue { grid-column: 1 / -1; }
  .aaf-menue > summary { width: auto; justify-content: flex-start; }   /* „+ Abschnitt“ bleibt ein Link links, nicht wie „Drucken ▾“ ein Knopf über die volle Breite */
  .aaf-menue > .aa-pdf-menue { right: 0; width: auto; max-width: none; }
  /* Abschnitte ohne eigenen Kasten: Trennlinie, Nummer und Titel genügen */
  .karte > .aaf-schritte { margin-top: 16px; }
  fieldset.aaf-schritt, .aaf-schritt { padding: 12px 0 0; border: 0; border-top: 1px solid var(--rand); border-radius: 0; background: none; }
  .aaf-zeile, .aaf-zeile.ist-erledigt { flex-wrap: wrap; min-height: var(--feld-hoehe); padding: 12px 0 0; border: 0; border-top: 1px solid var(--rand); border-radius: 0; background: none; }
  .aaf-pos-zeile, .aaf-kon-zeile { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aaf-kopf { flex-wrap: wrap; }
  .aaf-kopf > .aaf-titel { overflow-wrap: break-word; }
  .aaf-kopf > .aaf-erledigt, .aaf-zeile > .aaf-erledigt { order: 3; flex-basis: 100%; margin-left: 34px; }   /* „✓ Name · Zeit“ in eigener Zeile unter dem Titel */
  .aaf-pos-zeile > .aaf-geraet-zelle { grid-column: 1 / -1; }
  .aaf-pos-zeile > :is(.bl-tab-nr, .bl-zeile-knoepfe) { align-self: center; margin-top: 0; }
  .aaf-geraet-zelle .bl-tab-label { display: block; margin-bottom: var(--beschriftung-abstand); font-size: 13px; font-weight: 600; color: var(--text-2); }
  .aaf-grund > label > input { flex-basis: 100%; }
  .aaf-vorlage-wahl { flex-wrap: wrap; gap: var(--beschriftung-abstand) 10px; width: 100%; }
  .aaf-vorlage-wahl > :is(select, .auswahl-feld) { flex: 1 1 100%; width: 100%; }
  .aaf-leiste > .knopf { flex: 1 1 0; }
  .kunde-zeile { flex-wrap: wrap; gap: 8px; }
  .segment.kunde-art { display: flex; width: 100%; }
  .segment.kunde-art > label { flex: 1 1 0; min-width: 0; padding: 0 8px; }
  .kunde-zeile > .kunde-feld { flex: 1 1 100%; }
}

/* --- Vorlagen-Editor für Auftragsblätter (portal/arbeitsauftraege/vorlagen.php, assets/blatt-editor.js; Klassen .be-*):
   Abschnitte als Akkordeon-Karten in Arbeitsfolge, Felder darin als kleinere Akkordeons, Palette „+ Feld hinzufügen“,
   Prüfpunkte, Vorschau des Papierblatts. Desktop- und Handy-Regeln stehen hier beisammen. --- */
.be-bereich > * + * { margin-top: var(--formular-abstand); }
.be-fehler ul { margin: 6px 0 0; padding-left: 20px; }
.be-liste-abschnitte { overflow-wrap: anywhere; }
/* Vorlagenliste: Zeilen-Aktionen seit 08.10.2026 im „⋯“-Menü (zeilen_menue(), Block „Zeilen-Menü“) — keine eigenen Regeln mehr */
/* Abschnitt-Karte */
.be-abschnitte > .be-abschnitt + .be-abschnitt { margin-top: 10px; }
.be-abschnitt { background: var(--flaeche); border-radius: var(--radius-karte); box-shadow: var(--schatten); }
.be-abschnitt > summary { gap: 10px; min-height: 58px; padding: 8px 12px 8px 14px; border-radius: var(--radius-karte); }
.be-abschnitt[open] > summary { border-radius: var(--radius-karte) var(--radius-karte) 0 0; background: var(--flaeche-aktiv); }
.be-nr { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--flaeche-still); color: var(--text-2); font-size: 12px; font-weight: 700; }
.be-abschnitt[data-abschluss="zeile"] > summary .be-nr { background: #ecfdf5; color: #047857; }
.be-abschnitt[data-abschluss="info"] > summary .be-nr { background: #fffbeb; color: #b45309; }
.be-abschnitt-text, .be-feld-text { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.be-titel-anzeige { font-size: 15px; color: var(--text); overflow-wrap: anywhere; }
.be-meta { flex-basis: 100%; font-weight: 400; }
.be-knoepfe { flex: none; display: inline-flex; gap: 6px; margin-left: auto; }
.be-abschnitt-inhalt > * + *, .be-feld-inhalt > * + *, .be-mehr-inhalt > * + * { margin-top: var(--formular-abstand); }
.be-abschnitt-inhalt > .be-abschluss-hilfe { margin-top: 8px; }
/* Raster für Einstellungen: bleibt bei wenigen Feldern schmal (auto-fill), Beschriftungen unten bündig */
.be-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--formular-abstand) 20px; align-items: end; }
.be-raster > label { margin: 0; min-width: 0; }
.be-raster > label.kontrollkaestchen { min-height: var(--feld-hoehe); }
.be-raster > .be-voll { grid-column: 1 / -1; }
.be-raster > .be-doppelt { grid-column: span 2; } /* lange Titel („OKI-TEXTIL / SUBLIMATION“, „PRODUKTFERTIGUNGSBLATT“); am Handy einspaltig, s. u. */
.be-schalter { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.be-schalter > .kontrollkaestchen { margin: 0; }
.be-unterkopf { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-schwach); }
.be-abschnitt-inhalt > .be-unterkopf + .be-felder, .be-kopf > .be-unterkopf + .be-felder { margin-top: 8px; }
.be-felder:empty::before { content: 'Keine Felder — der Abschnitt hat dann nur seinen Abschluss.'; display: block; font-size: 13px; color: var(--text-schwach); }
.be-kopf > .be-felder:empty::before { content: 'Keine weiteren Felder im Kopf.'; }
.be-felder > .be-feld + .be-feld { margin-top: 8px; }
/* Feld-Karte */
.be-feld { background: var(--flaeche); }
.be-feld > summary { gap: 8px; padding: 6px 8px 6px 12px; min-height: 52px; font-weight: 500; }
.be-feld[open] > summary { background: var(--flaeche-still); }
.be-feld-typ { flex: none; padding: 1px 7px; border: 1px solid var(--signal-rand); border-radius: 6px; background: var(--flaeche-aktiv); color: var(--signal); font-size: 11.5px; font-weight: 600; line-height: 1.5; }
.be-feld-name { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.be-feld-marken { display: inline-flex; gap: 4px; }
.be-feld-marken:empty, .be-feld-info:empty { display: none; }
.be-feld-info { flex-basis: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.be-fuss { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 12px; border-top: 1px solid var(--rand-weich); }
/* „+ Feld hinzufügen“: die feste Palette, je Feldart Name und Beispiel */
.be-palette, .be-palette[open] { border: 0; border-radius: 0; background: none; }
.be-palette > summary { display: inline-flex; height: var(--knopf-hoehe); padding: 0 16px; border: 1px dashed var(--signal-rand); border-radius: var(--radius); background: var(--flaeche); color: var(--signal); font-size: 14px; }
.be-palette > summary::before { content: none; }
.be-palette > summary:hover, .be-palette[open] > summary { border-bottom: 1px dashed var(--signal-rand); border-radius: var(--radius); background: var(--flaeche-aktiv); color: var(--signal); }
.be-palette > .be-typen { margin: 0; padding: 12px 0 0; }
.be-typen { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.be-typ { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 10px 12px; border: 1px solid var(--rand); border-radius: var(--radius);
  background: var(--flaeche); font: inherit; text-align: left; cursor: pointer; }
.be-typ strong { font-size: 14px; color: var(--text); }
.be-typ span { font-size: 12px; line-height: 1.35; color: var(--text-schwach); overflow-wrap: anywhere; }
.be-typ:hover, .be-typ:focus-visible { border-color: var(--signal); background: var(--flaeche-aktiv); }
/* Endkontrolle: Prüfpunkte */
.be-punkte > .be-punkt + .be-punkt { margin-top: 8px; }
.be-punkt { display: flex; align-items: center; gap: 8px; }
.be-punkt > input { flex: 1 1 auto; width: auto; min-width: 0; }
.be-punkte:empty::before { content: 'Keine Prüfpunkte.'; display: block; font-size: 13px; color: var(--text-schwach); }
/* Vorschau des Papierblatts: grauer Titelbalken, Kästen mit grauem Kopf, Kästchen, Linien, Tabellenraster — breit im Fluss
   über 3 Spalten (Lage per Skript), schmal untereinander */
.be-vorschau { min-height: 80px; }
.be-papier { padding: 14px; border: 1px solid var(--rand-stark); border-radius: 6px; background: #fff; color: #4b5563; font-size: 12px; line-height: 1.35; }
.be-p-balken { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 8px 12px; background: #8a8a8a; color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .03em; overflow-wrap: anywhere; }
.be-p-nrfeld { font-size: 12px; font-weight: 500; letter-spacing: 0; }
.be-p-kopf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 4px; margin: 8px 0 14px; }
.be-p-zelle { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 38px; padding: 3px 6px 6px; border: 1.5px solid #8a8a8a; }
.be-p-zelle.be-p-breit { grid-column: 1 / -1; }
.be-p-zlabel { font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.be-p-raster { position: relative; }
.be-p-raster:not(.be-p-fluss) > * + * { margin-top: 10px; }
.be-p-raster.be-p-fluss > .be-p-kasten, .be-p-raster.be-p-fluss > .be-p-fuss { position: absolute; }
.be-p-kasten { min-width: 0; border: 2px solid #8a8a8a; background: #fff; }
.be-p-kasten-kopf { padding: 4px 8px; background: #8a8a8a; color: #fff; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.be-p-inhalt { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.be-p-label { flex: none; font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.be-p-reihe { display: flex; align-items: flex-start; gap: 8px; }
.be-p-reihe > .be-p-optionen { flex: 1 1 auto; min-width: 0; }
/* Kästchen in Spalten; mindestens zwei Spalten (45 %), damit eine lange Option mit Textfeld („Laminat Spezial: ___“) über
   zwei Spalten nie aus dem Kasten ragt */
.be-p-optionen { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(92px, 45%), 1fr)); align-items: start; gap: 4px 10px; }
.be-p-optionen.be-p-eins { grid-template-columns: minmax(0, 1fr); }
.be-p-opt { display: flex; align-items: flex-start; gap: 5px; min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.be-p-opt.be-p-lang { grid-column: span 2; }
.be-p-mit > span { flex: none; max-width: 80%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.be-p-k { flex: none; align-self: flex-start; width: 11px; height: 11px; margin-top: 2px; border: 1.5px solid #6b7280; }
.be-p-linie { display: block; flex: 1 1 24px; min-width: 16px; height: 14px; border-bottom: 1px solid #9ca3af; }
.be-p-voll { width: 100%; height: 16px; }
.be-p-zeile, .be-p-fusszeile { display: flex; align-items: flex-end; gap: 6px; min-width: 0; }
.be-p-zeile > span, .be-p-fusszeile > span { flex: 0 1 auto; max-width: 70%; overflow-wrap: anywhere; }
.be-p-unten { margin-top: 6px; }
.be-p-nr { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1.5px solid #6b7280; font-size: 10px; }
.be-p-tabelle { display: grid; border-top: 1px solid #8a8a8a; border-left: 1px solid #8a8a8a; }
.be-p-tabelle > span { min-width: 0; min-height: 18px; padding: 1px 4px; border-right: 1px solid #8a8a8a; border-bottom: 1px solid #8a8a8a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.be-p-tabelle > .be-p-th { background: #8a8a8a; color: #fff; font-size: 11px; font-weight: 600; border-right-color: #fff; }
.be-p-fuss { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.be-p-fusszeile { gap: 8px; font-size: 13px; font-weight: 600; }
/* Paket blatt-entschlacken (10/2026): „Erweitert“ und „Laufzettel“ als kleine Aufklapper in Abschnitt und Feld (Seltenes und alles
   fürs Papier zugeklappt), Haken des Bausteins in einer Reihe, Endkontroll-Block im Abschnitt bzw. in der Ablage */
.be-mehr { border-color: var(--rand-weich); border-radius: var(--radius); }
.be-mehr > summary { padding: 8px 12px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.be-mehr > .be-mehr-inhalt { padding: 12px; }
.be-mehr + .be-mehr { margin-top: 8px; }
.be-schalter-gruppe:not([hidden]) { display: contents; }
.be-abschnitt[data-abschluss="info"] .be-nur-arbeit { display: none; }
.be-endkontrolle > * + * { margin-top: var(--formular-abstand); }
.be-ek-platz:empty { display: none; }
.be-ek-ablage-platz > .be-endkontrolle { margin-top: 0; }
@media (max-width: 767px) {
  /* Handy: Karten mit schmalerem Innenrand, damit Felder in Abschnitt + Feld noch die Breite haben; Einstellungen einspaltig */
  .be-abschnitt > summary { gap: 8px; padding: 6px 8px 6px 10px; }
  /* Langes Wort im Titel („WEITERVERARBEITUNG“): nie mitten im Wort trennen — passt es nicht neben ↑ ↓ Papierkorb, rücken die
     Knöpfe in die Zeile darunter (der Titel ist so breit wie sein längstes Wort, höchstens die ganze Zeile) */
  .be-abschnitt > summary { flex-wrap: wrap; }
  .be-abschnitt > summary > .be-abschnitt-text { width: min-content; max-width: 100%; }
  .be-abschnitt > summary .be-titel-anzeige { overflow-wrap: break-word; }
  .be-abschnitt > .be-abschnitt-inhalt { padding: 12px; }
  .be-feld > summary { padding: 6px 8px; }
  .be-feld > .be-feld-inhalt { padding: 12px; }
  .be-raster { grid-template-columns: minmax(0, 1fr); }
  .be-raster > .be-doppelt { grid-column: auto; }
  .be-typen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .be-fuss > .knopf { flex: 1 1 auto; }
  .be-papier { padding: 10px; }
}

/* === Arbeitsaufträge: Ansicht === */
/* Auftragsseite (portal/arbeitsauftraege/auftrag.php?id=…; Bausteine module/arbeitsauftraege/auftrag_ansicht.php, Verhalten
   assets/blattansicht.js; Klassen .aa-*). Entwurf 08.10.2026: Kopf mit Kunde/Telefon und Fortschritt, gelber Hinweis in einer Zeile,
   Reiter, je Schritt EINE Zeile (Stand-Kreis nur Anzeige, Name, Chips, Stand rechts), aufgeklappt Vorgaben als ruhige Liste und EINE
   Knopfreihe; Seltenes als schwebendes Menü (Bauart „Drucken ▾“: .aa-pdf-wahl), Felder am Knopf schweben unter der Reihe —
   nichts schiebt die Seite. Maße aus den Tokens (Knopf --knopf-hoehe, Feld --feld-hoehe). Desktop und Handy beisammen. */
.aa-sym { flex: none; width: 16px; height: 16px; }
.aa-still { color: var(--text-schwach); font-size: 13.5px; }
.aa-link { font-size: 14px; font-weight: 500; color: var(--signal); }
/* Pflicht-Stern: derselbe wie im Formular (.bl-pflicht, Abschnitt „Mobil: Arbeitsaufträge“) */
/* Kopf: Zeile 1 Kunde · Ansprechpartner (Telefon) · Frist · für …; Zeile 2 Stand · Frage an dich · Details ▾ */
.aa-kopf-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 4px 0 0; font-size: 14px; line-height: 22px; color: var(--text-2); }
.aa-kopf-zeile + .aa-kopf-zeile { margin-top: 6px; }
/* Trennpunkt im Abstand zwischen zwei Angaben; bricht die Zeile um, liegt der Punkt am Zeilenanfang links außerhalb und wird
   abgeschnitten (clip-path nur links) — keine neue Zeile beginnt mit „·“ */
.aa-kopf-zeile { column-gap: 19px; margin-left: -3px; padding-left: 3px; clip-path: inset(-8px -8px -8px 0); }
.aa-k { position: relative; display: inline; min-width: 0; }
.aa-k + .aa-k::before { content: '·'; position: absolute; left: -12px; color: var(--text-still); }
.aa-kopf-zeile b { font-weight: 600; color: var(--text); }
.aa-kunde { color: inherit; text-decoration: none; }
.aa-kunde:hover b { color: var(--signal); }
.aa-tel { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--signal); white-space: nowrap; }
.aa-tel .aa-sym { width: 14px; height: 14px; }
.aa-fortschritt-kopf { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.aa-balken { display: inline-block; width: 120px; height: 8px; overflow: hidden; border-radius: 999px; background: var(--rand); }
.aa-balken > i { display: block; height: 100%; border-radius: 999px; background: var(--gruen); }
.aa-kopf-stand .abzeichen { white-space: normal; }
.aa-frage-link:hover { text-decoration: none; box-shadow: 0 0 0 2px #fecaca; }
.seiten-kopf > .aa-kopf-details { flex: 1 1 100%; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 20px; margin: 4px 0 0; padding: 12px 14px;
  border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche); font-size: 14px; }
.aa-kopf-details dt { color: var(--text-schwach); }
.aa-kopf-details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* Kopf-Knöpfe: Bearbeiten · Drucken ▾ · ⋯ (40 × 40-Quadrat in Knopfhöhe); Menüs schweben rechtsbündig */
.aa-pdf-wahl > summary.aa-punkte, .knopf.aa-punkte { width: var(--knopf-hoehe); min-width: var(--knopf-hoehe); padding: 0; justify-content: center; }
.aa-punkte .aa-sym { width: 20px; height: 20px; }
.aa-menue-trenner { height: 1px; margin: 4px 6px; background: var(--rand); }
.aa-pdf-menue > form > button.aa-gefahr { color: var(--gefahr); }
/* Eintrag im Menü, der ein kleines Feld aufklappt (Grund, Datum, Maschine, Notiz) — im schwebenden Menü, schiebt nichts */
.aa-pdf-menue > .aa-menue-feld, .aa-pdf-menue > .aa-menue-feld[open] { margin: 0; border: 0; border-radius: 8px; background: none; }
.aa-menue-feld > summary { min-height: 40px; padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.aa-menue-feld > summary::before { content: none; }
.aa-menue-feld > summary:hover, .aa-menue-feld[open] > summary { border-bottom: 0; border-radius: 8px; background: var(--flaeche-still); }
.aa-menue-feld > form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; padding: 8px 10px 10px; }
.aa-menue-feld > form > * { margin: 0; }
.aa-menue-feld > form > :is(input:not([type=hidden]), select, textarea, .auswahl-feld) { flex: 1 1 140px; width: auto; min-width: 0; }
.aa-menue-feld > form > .knopf { flex: none; }
.aa-menue-feld > form > .kontrollkaestchen { flex-basis: 100%; }
/* Zwei Felder und mehr (Maschine wechseln, vom Laufzettel nachtragen, Abrechnung): im schmalen Menü je Feld eine Zeile, der Knopf
   darunter über die volle Breite — sonst rutschte er unter die Felder und die Auswahl schnitt Namen ab */
.aa-menue-feld > form:has(> :is(input:not([type=hidden]):not([hidden]), select) ~ :is(input:not([type=hidden]):not([hidden]), select)) > :is(input:not([type=hidden]), select, textarea, .auswahl-feld, .knopf) { flex: 1 1 100%; }
.aa-menue-feld > form:has(> :is(input:not([type=hidden]):not([hidden]), select) ~ :is(input:not([type=hidden]):not([hidden]), select)) > .knopf { justify-content: center; }
/* Gelber Hinweis: eine Zeile, ohne Überschrift (Zeilenumbrüche aus dem Text bleiben) */
.aa-hinweis { display: flex; align-items: flex-start; gap: 10px; }
.aa-hinweis > .aa-sym { width: 18px; height: 18px; margin-top: 1px; }
.aa-hinweis > span { min-width: 0; white-space: pre-line; overflow-wrap: anywhere; }
/* Liste der Arbeitsschritte: eine Zeile je Schritt (details), nur der nächste offene aufgeklappt */
.aa-liste { margin-bottom: var(--karte-abstand); border: 1px solid var(--rand); border-radius: var(--radius-karte); background: var(--flaeche); box-shadow: var(--schatten); }
.aa-liste > .aa-schritt + .aa-schritt { border-top: 1px solid var(--rand-weich); }
.aa-schritt, .aa-schritt[open] { margin: 0; border: 0; border-radius: 0; background: none; }
.aa-schritt > summary { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 14px; align-items: center; column-gap: 14px; min-height: 56px;
  padding: 10px var(--karte-innen); border-radius: 0; font-size: 15px; font-weight: 400; color: var(--text); }
.aa-schritt > summary::before { content: none; }
.aa-schritt > summary::after { content: ''; width: 14px; height: 28px; transition: transform .15s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/14px no-repeat; }
.aa-schritt[open] > summary::after { transform: rotate(180deg); }
.aa-schritt > summary:hover { background: var(--container); color: var(--text); }
.aa-schritt[open] > summary { border-bottom: 0; border-radius: 0; }
.aa-liste > .aa-schritt:first-child > summary { border-radius: var(--radius-karte) var(--radius-karte) 0 0; }
.aa-liste > .aa-schritt:last-child:not([open]) > summary { border-radius: 0 0 var(--radius-karte) var(--radius-karte); }
.aa-schritt.naechster { box-shadow: inset 3px 0 0 var(--signal); }
.aa-stand { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; box-sizing: border-box; border: 2px solid var(--rand-stark); border-radius: 50%; background: #fff; color: #fff; }
.aa-stand.an { border-color: var(--gruen); background: var(--gruen); }
.aa-stand .aa-sym { width: 16px; height: 16px; stroke-width: 3; }
.aa-schritt-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.aa-schritt-titel { font-weight: 600; line-height: 28px; overflow-wrap: anywhere; }
.aa-schritt.erledigt .aa-schritt-titel { font-weight: 500; color: var(--text-schwach); }
.aa-schritt-stand { justify-self: end; display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 6px; font-size: 13px; line-height: 28px; color: var(--text-schwach); text-align: right; }
.aa-schritt-stand .abzeichen { line-height: 1.4; }
/* EINE Chip-Art für Vorgaben, so hoch wie ein Abzeichen; aufgeklappt stehen die Vorgaben in der Liste — die Chips entfallen */
.aa-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.aa-chip { display: inline-block; max-width: 100%; height: 22px; padding: 0 9px; box-sizing: border-box; overflow: hidden; border-radius: 999px; background: var(--flaeche-still);
  font-size: 12.5px; font-weight: 500; line-height: 22px; color: var(--text-2); white-space: nowrap; text-overflow: ellipsis; }
.aa-chip-gelb { background: #fffbeb; color: #b45309; }
.aa-chip-rot { background: #fef2f2; color: #b91c1c; }
.aa-schritt[open] .aa-chips { display: none; }
.aa-gruppe { padding: 18px var(--karte-innen) 6px; border-top: 1px solid var(--rand); font-size: 13px; font-weight: 600; color: var(--text-schwach); }
.aa-leer { margin: 0; padding: 18px var(--karte-innen); }
/* Aufgeklappt: Vorgaben, Dateien, Fotos, Notizen, Fragen, Knopfreihe */
.aa-schritt > .aa-schritt-inhalt { padding: 0 var(--karte-innen) 20px calc(var(--karte-innen) + 42px); }
.aa-schritt-inhalt > * { margin: 0; }
.aa-schritt-inhalt > * + * { margin-top: 14px; }
.aa-haupt { font-size: 14px; font-weight: 600; }
.aa-haupt + .aa-vorgaben { margin-top: 8px; }
.aa-vorgaben { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: baseline; gap: 6px 20px; font-size: 14px; line-height: 1.45; }
.aa-vorgaben dt { color: var(--text-schwach); }
.aa-vorgaben dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.aa-vorgaben dt:has(+ dd > .aa-maschine-inline) { align-self: center; }
.aa-zeile { display: block; }
.aa-mehrzeilig { white-space: pre-line; }
.aa-dateien { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.aa-datei-link, .aa-ablage { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.aa-datei-link { font-weight: 600; }
.aa-datei-link > .aa-still { white-space: nowrap; }   /* „11 KB“ nie zweizeilig */
.aa-ablage { color: var(--text-2); }
.aa-ablage > [data-aa-kopieren], .aa-vorgaben [data-aa-kopieren] { flex: none; white-space: nowrap; }
.aa-ablage svg { flex: none; width: 15px; height: 15px; }
.aa-stoerung { display: flex; align-items: flex-start; gap: 8px; }
.aa-stoerung > svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
/* Maschine wählen (offen gelassen: direkt in der Liste) bzw. wechseln (im Menü ⋯): Auswahl und Knopf auf einer Linie */
.aa-maschine-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.aa-maschine-form > :is(select, input:not([type=hidden])) { flex: 1 1 160px; width: auto; min-width: 0; margin: 0; }
.aa-maschine-form.aa-maschine-inline > select { flex: 0 1 260px; }
.aa-maschine-inline > select:invalid, .aa-maschine-inline > select:has(> option[value=""]:checked) { border-color: #fcd34d; }
.aa-maschine-form > .knopf { flex: none; margin: 0; }
/* Pflicht-Maschine offen gelassen und ✓ gedrückt: rot, bis gewählt (assets/blattansicht.js) */
.aa-maschine-inline > select.aa-fehlt, .aa-maschine-inline > select.aa-fehlt:has(> option[value=""]:checked) { border-color: var(--gefahr); box-shadow: 0 0 0 3px #fecaca; }
/* Notizen und Fragen: kompakt, Name und Zeit klein dahinter; offen gelb, an mich rot (mit Antwortfeld), beantwortet grün */
.aa-notiz-zeile, .aa-frage { padding: 8px 12px; border-left: 3px solid var(--rand-stark); border-radius: 6px; background: var(--flaeche-still); font-size: 14px; line-height: 1.45; }
.aa-frage-offen { border-left-color: var(--gelb); background: #fffbeb; }
.aa-frage-an-mich { border-left-color: #dc2626; background: #fef2f2; }
.aa-frage-beantwortet { border-left-color: var(--gruen); }
.aa-q { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 0 10px; align-items: baseline; }
.aa-q + .aa-q { margin-top: 3px; }
.aa-q-art { font-size: 12.5px; font-weight: 600; color: var(--text-schwach); }
.aa-text { min-width: 0; overflow-wrap: anywhere; }
.aa-wer { margin-left: 4px; font-size: 12.5px; color: var(--text-schwach); }
.aa-antwort-form { display: flex; align-items: center; gap: 12px; margin: 10px 0 0; }
.aa-antwort-form > input:not([type=hidden]) { flex: 1 1 auto; width: auto; min-width: 0; margin: 0; }
.aa-antwort-form > .knopf { flex: none; margin: 0; }
.aa-fragen-zu, .aa-fragen-zu[open] { border: 0; border-radius: 0; background: none; }
.aa-fragen-zu > summary { display: inline-flex; padding: 0; border-radius: 0; font-size: 13.5px; font-weight: 500; color: #047857; background: none; }
.aa-fragen-zu > summary::before { content: none; }
.aa-fragen-zu > summary:hover { background: none; color: #065f46; }
.aa-fragen-zu[open] > summary { border: 0; border-radius: 0; }
.aa-fragen-zu > .aa-frage { margin-top: 8px; padding: 8px 12px; }
/* EINE Knopfreihe: ✓ · Foto · Frage · Notiz · Material entnehmen · ⋯ — Felder am Knopf schweben darunter */
.aa-knoepfe { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aa-knoepfe > * { flex: none; margin: 0; }
.aa-knoepfe > details + details { margin-top: 0; }
.aa-knoepfe .knopf { padding: 0 14px; }
.aa-knoepfe .knopf.aa-punkte { padding: 0; }
.aa-knoepfe .knopf .aa-sym { width: 16px; height: 16px; }
.aa-haken-knopf .aa-sym { stroke-width: 3; }
.aa-knoepfe > .aa-mehr > .aa-pdf-menue { left: 0; right: auto; width: 380px; }
.aa-foto-form { margin: 0; }
.aa-feld-knopf, .aa-feld-knopf[open] { position: static; border: 0; border-radius: 0; background: none; }
.aa-feld-knopf > summary { list-style: none; }
.aa-feld-knopf > summary::before { content: none; }
.aa-feld-knopf > summary::-webkit-details-marker { display: none; }
.aa-feld-knopf[open] > summary { border-color: var(--signal-rand); background: var(--flaeche-aktiv); color: var(--signal); }
.aa-feld-knopf > .aa-feld-panel { position: absolute; left: 0; top: calc(100% + 6px); z-index: 88; width: min(560px, 100%); margin: 0; padding: 12px; box-sizing: border-box;
  border: 1px solid var(--rand); border-radius: 10px; background: var(--flaeche); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.aa-feld-knopf[data-aa-material] > .aa-feld-panel, .aa-feld-knopf[data-aa-material-heim] > .aa-feld-panel { width: min(640px, 100%); }
.aa-feld-panel > * + * { margin-top: 10px; }
/* Kurze Werkstatt-Angaben (Verbrauch m², Datum …): Felder und „Speichern“ auf einer Linie — das Raster nimmt nur den Platz neben
   dem Knopf, je Feld eine Spalte (am Handy rutscht der Knopf darunter, Regel der .felder-linie) */
.aa-feld-panel .felder-linie > .bl-raster { flex: 1 1 220px; min-width: 0; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.aa-feld-titel { font-size: 13px; font-weight: 600; color: var(--text-2); }
.aa-feld-form { display: flex; align-items: center; gap: 12px; margin: 0; }
.aa-feld-form > textarea { flex: 1 1 auto; width: auto; min-width: 0; height: auto; min-height: var(--feld-hoehe); max-height: 220px; margin: 0; padding-top: 9px; padding-bottom: 9px; resize: none; field-sizing: content; }
.aa-feld-form > .knopf { flex: none; margin: 0; }
/* Abstand nur zwischen sichtbaren Teilen — die versteckten Felder vorn (csrf, aktion …) zählen nicht */
:is(.aa-werkstatt-form, .aa-material-form) > :not(input[type=hidden]) + :not(input[type=hidden]) { margin-top: 12px; }
.aa-material-form > .aa-link { display: inline-flex; align-items: center; gap: 6px; }
.aa-material-form > .aa-link svg { width: 15px; height: 15px; }
@media (min-width: 768px) { .aa-material-zeile { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
/* Reiter „Notizen & Fotos“, „Material“, „Verlauf“ */
.aa-reiter-karte > * + * { margin-top: 12px; }
.aa-mat-zeile { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--rand-weich); font-size: 14px; }
.aa-reiter-karte > .aa-mat-zeile + .aa-mat-zeile { margin-top: 0; }
.aa-mat-zeile.aa-mat-zurueck { color: var(--text-schwach); }
.aa-mat-menge { flex: none; width: 76px; font-weight: 600; }
.aa-mat-text { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.aa-mat-text > .aa-wer { display: block; margin: 0; }
.aa-mat-zeile > .aa-mehr > .aa-pdf-menue { right: 0; left: auto; width: 260px; }
.aa-mat-zeile > .aa-reserviert-buchen { flex: none; margin: 0; }
.aa-reserviert-buchen > input:not([type=hidden]) { width: 90px; margin: 0; }
.aa-verlauf-zeile { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 16px; padding: 10px 0; border-bottom: 1px solid var(--rand-weich); font-size: 14px; }
.aa-reiter-karte > .aa-verlauf-zeile + .aa-verlauf-zeile { margin-top: 0; }
.aa-verlauf-zeile > div { min-width: 0; overflow-wrap: anywhere; }
.aa-verlauf-text { color: var(--text-2); }
.aa-verlauf-zeile > .aa-wer { margin: 0; white-space: nowrap; }
@media (max-width: 767px) {
  /* Kopf: Knöpfe auf einer Linie, gleich breit, ⋯ quadratisch; Menüs so breit wie die Knopfreihe, nie über den Rand */
  body[data-seite$="portal/arbeitsauftraege/auftrag.php"] .seiten-kopf-aktionen { position: relative; flex-wrap: wrap; gap: 8px; }
  body[data-seite$="portal/arbeitsauftraege/auftrag.php"] .seiten-kopf-aktionen > * { flex: 1 1 140px; min-width: 0; }
  body[data-seite$="portal/arbeitsauftraege/auftrag.php"] .seiten-kopf-aktionen > .aa-mehr { flex: 0 0 var(--knopf-hoehe); }
  body[data-seite$="portal/arbeitsauftraege/auftrag.php"] .seiten-kopf-aktionen > * > .knopf, body[data-seite$="portal/arbeitsauftraege/auftrag.php"] .seiten-kopf-aktionen > .knopf { width: 100%; padding: 0 10px; }
  body[data-seite$="portal/arbeitsauftraege/auftrag.php"] .seiten-kopf-aktionen > .aa-pdf-wahl { position: static; }
  body[data-seite$="portal/arbeitsauftraege/auftrag.php"] .seiten-kopf-aktionen > .aa-pdf-wahl > .aa-pdf-menue { left: 0; right: 0; width: auto; max-width: none; }
  .aa-balken { width: 96px; }
  .aa-kopf-zeile { gap: 2px 14px; }
  .aa-k + .aa-k::before { content: none; }
  .seiten-kopf > .aa-kopf-details { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .aa-kopf-details dd + dt { margin-top: 8px; }
  /* Reiter 2 × 2, gleich breit */
  .aa-reiter > .bereich-reiter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .aa-reiter > .bereich-reiter > .chip { justify-content: center; min-width: 0; padding: 0 8px; }
  /* Zeile: Kreis und Pfeil auf der Namenszeile, Stand darunter */
  .aa-schritt > summary { grid-template-columns: 28px minmax(0, 1fr) 14px; align-items: start; row-gap: 2px; column-gap: 12px; padding: 12px var(--karte-innen); }
  .aa-schritt > summary > .aa-stand { grid-column: 1; grid-row: 1; }
  .aa-schritt > summary > .aa-schritt-kopf { grid-column: 2; grid-row: 1; flex-direction: column; align-items: flex-start; }
  .aa-schritt > summary > .aa-schritt-stand { grid-column: 2; grid-row: 2; justify-self: start; justify-content: flex-start; text-align: left; line-height: 20px; }
  .aa-schritt > summary > .aa-schritt-stand:empty { display: none; }
  .aa-schritt > summary::after { grid-column: 3; grid-row: 1; }
  .aa-schritt > .aa-schritt-inhalt { padding-left: var(--karte-innen); }
  .aa-vorgaben { gap: 4px 14px; }
  /* Dateien (Name, Größe, Ablage-Pfad): Beschriftung darüber, die Liste über die volle Breite — sonst brach der Dateiname am
     Bindestrich und der Pfad lief über acht Zeilen */
  .aa-vorgaben > dt:has(+ dd > .aa-dateien), .aa-vorgaben > dd:has(> .aa-dateien) { grid-column: 1 / -1; }
  .aa-vorgaben > dt:has(+ dd > .aa-dateien) { margin-top: 4px; }
  .aa-q { grid-template-columns: minmax(0, 1fr); }
  .aa-wer { display: block; margin-left: 0; }
  /* Knopfreihe: zwei gleich breite je Zeile, ⋯ bleibt quadratisch rechts in der letzten Zeile; stünde ⋯ allein (bzw. ohne ⋯
     ein Knopf allein), nimmt der erste Knopf die ganze erste Zeile */
  .aa-knoepfe > * { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .aa-knoepfe > .aa-mehr { flex: 0 0 var(--knopf-hoehe); }
  .aa-knoepfe:has(> .aa-mehr:nth-child(odd)) > :first-child, .aa-knoepfe:not(:has(> .aa-mehr)):has(> :last-child:nth-child(odd)) > :first-child { flex-basis: 100%; }
  .aa-knoepfe > * > .knopf, .aa-knoepfe > .knopf { width: 100%; min-width: 0; padding: 0 8px; gap: 6px; }
  .aa-knoepfe > .aa-pdf-wahl { position: static; }
  .aa-knoepfe > .aa-pdf-wahl > .aa-pdf-menue, .aa-mat-zeile > .aa-mehr > .aa-pdf-menue { left: 0; right: 0; width: auto; max-width: none; }
  .aa-mat-zeile { position: relative; flex-wrap: wrap; }
  .aa-mat-zeile > .aa-mehr { position: static; }
  .aa-mat-zeile > .aa-reserviert-buchen { flex: 1 1 100%; }
  .aa-reserviert-buchen > input:not([type=hidden]) { flex: 1 1 auto; width: auto; }
  .aa-feld-knopf > .aa-feld-panel { right: 0; width: auto; }
  /* Felder im Menü: rutscht der Knopf unter die Felder, steht er über die volle Breite */
  .aa-menue-feld > form > .knopf { flex: 1 1 auto; }
  .aa-verlauf-zeile > .aa-wer { white-space: normal; }
}

/* === Maschinen & Fahrzeuge === */
/* portal/maschinen/*.php (Klassen .masch-*, Etikett .me-*): Liste mit Mini-Bild und Status, Maschinenseite mit Status-Karte
   (Störung rot markiert, betroffene Abschnitte), Formulare, Profile, Vorschläge, Etikett-Vorschau. Desktop und Handy beisammen;
   am Handy wird nichts gewischt (Liste wird Karten, Etikett-Vorschau wird verkleinert). */
.masch-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.masch-name > div { min-width: 0; overflow-wrap: anywhere; }
.masch-mini { flex: none; width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--rand); background: var(--flaeche-still); }
.masch-mini.leer { display: inline-flex; align-items: center; justify-content: center; color: var(--text-still); }
.masch-mini.leer svg { width: 18px; height: 18px; }
.masch-liste-text { overflow-wrap: anywhere; }
/* Roter Hauptknopf „Störung melden“ — gleiche Höhe wie jeder Knopf, nur die Farbe signalisiert */
.knopf.masch-knopf-stoerung { background: #dc2626; border-color: #dc2626; color: #fff; }
.knopf.masch-knopf-stoerung:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
/* Status-Karte über den Reitern: Farbe nur als Kante links, die Fläche bleibt weiß */
.masch-status { box-shadow: inset 4px 0 0 var(--gruen), var(--schatten); }
.masch-status-stoerung { border-color: #fecaca; box-shadow: inset 4px 0 0 #dc2626, var(--schatten); }
.masch-status-ausser_betrieb { box-shadow: inset 4px 0 0 var(--text-still), var(--schatten); }
.masch-status-kopf { display: flex; align-items: flex-start; gap: 16px; }
.masch-status-bild { flex: none; }
.masch-status-bild img { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--rand); }
.masch-status-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.masch-status-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.masch-status-zeile .abzeichen { font-size: 13px; padding: 4px 12px; }
.masch-status-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.masch-betroffen { margin-top: var(--formular-abstand); border-color: #fecaca; }
.masch-betroffen > summary { color: #b91c1c; }
.masch-betroffen > .liste-zeile { padding-top: 10px; padding-bottom: 10px; min-height: 0; }
/* Übersicht: nur die Daten — das Foto steht einmal im Status-Kopf */
.masch-uebersicht { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 24px; }
.masch-bild-klein img { display: block; max-height: 120px; width: auto; max-width: 100%; border-radius: 10px; border: 1px solid var(--rand); }
/* Profile und Einsätze: „Ändern“/„Umbenennen“ stehen seit 08.10.2026 als Feld im „⋯“-Menü (zeilen_menue(), 'feld') — der
   Stift-Aufklapper .masch-klapp ist entfallen */
.masch-profil-neu { margin-top: var(--formular-abstand); padding-top: var(--formular-abstand); border-top: 1px solid var(--rand-weich); }
.masch-einsatz-wahl .chip { cursor: pointer; }
.masch-einsatz-wahl .chip > input { width: 16px; height: 16px; margin: 0; accent-color: var(--signal); }
.masch-einsatz-wahl .chip:has(> input:checked) { border-color: var(--signal); background: var(--flaeche-aktiv); color: var(--signal); }
.masch-verlauf-text { margin-top: 4px; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.masch-verlauf-zeile .titel { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.masch-verlauf-zeile > .aktivitaet-text { flex: 1 1 auto; }
/* Verweise als Abzeichen („Ticket: #12 Störung: Mimaki UJV“) dürfen umbrechen — sonst ragen sie am Handy aus der Karte */
:is(.masch-verlauf-zeile, .masch-status, .masch-meldung) .abzeichen { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
/* Ausstattung vorschlagen: Einträge als Häkchen-Raster */
.masch-vorschlag { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 24px; }
.masch-vorschlag > .kontrollkaestchen + .kontrollkaestchen { margin-top: 0; }
.masch-vorschlag > .kontrollkaestchen.inaktiv { opacity: .55; }
.masch-vorschlag + .aktionen-zeile { margin-top: var(--formular-abstand); }
/* Etikett-Vorschau: Bogen in Originalgröße, per Skript auf die Breite verkleinert (gedruckt wird 1:1) */
.masch-etikett-vorschau { overflow: hidden; }
.masch-etikett-vorschau .me-bogen { box-shadow: 0 1px 4px rgba(0, 0, 0, .18); margin-bottom: var(--formular-abstand); }
/* Vorlagen umstellen: je Name eine Zeile — links Name und Fundorte, rechts die Auswahl, darunter der Hinweis */
.masch-umstellen-zeile { align-items: flex-start; gap: 12px 20px; }
.masch-umstellen-zeile > .liste-haupt { flex: 1 1 320px; min-width: 0; }
.masch-umstellen-zeile .klein > span { overflow-wrap: anywhere; }
.masch-umstellen-wahl { flex: 0 1 300px; min-width: 0; }
.masch-umstellen-hinweis { flex: 1 1 100%; margin: 0; }
.masch-umstellen-zeile.erledigt > .liste-haupt { opacity: .7; }
.masch-umstellen-offen { color: #b45309; font-weight: 600; }
.masch-umstellen + .meldung { margin-top: var(--formular-abstand); }
@media (max-width: 767px) {
  .masch-umstellen-wahl { flex-basis: 100%; }
  .masch-status-kopf { flex-wrap: wrap; gap: 12px; }
  .masch-status-bild img { width: 72px; height: 72px; }
  .masch-vorschlag { grid-template-columns: minmax(0, 1fr); }
  /* Paket blatt-entschlacken: Knopf unter dem Feld (Einsatz/Profil anlegen und umbenennen) über die volle Breite */
  .masch-profil-neu .zeilen-formular > .knopf { width: 100%; justify-self: stretch; justify-content: center; }
  /* Werkstatt am Handy: „Störung melden“ über die ganze Breite, gut zu treffen */
  .seiten-kopf-aktionen > .masch-knopf-stoerung { flex: 1 1 100%; }
}

/* === Abwesenheiten & Arbeitszeit (Kern) === */
/* Liste portal/abwesenheiten.php: Vergangenes grau (Auskunft, Grundsatz 6) — die Art steht als graues Abzeichen, nie rot */
.abw-liste tr.abw-vorbei > td:not(.zeilen-aktionen-zelle) { opacity: .55; }
/* Formular: Schnellwahl bei „Krank“ (nur heute · bis morgen · bis Freitag) als Pillen unter Von/Bis */
.abw-schnell { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.abw-schnell > .klein { font-weight: 600; }
.abw-weitere > summary .klein { font-weight: 400; }
.abw-weitere > summary + * { padding-top: 0; margin-top: 16px; }
.abw-weitere > .zeilen-formular + .kontrollkaestchen { margin-top: var(--formular-abstand); }
/* Arbeitszeit: Wochenraster je Tag (Haken = Arbeitstag, Beginn, Ende, Pause von–bis) */
.az-raster td { vertical-align: middle; }
.az-raster input[type=time] { width: 100%; min-width: 108px; }
.az-raster .kontrollkaestchen { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14.5px; color: var(--text); }
.az-wahl + .az-raster-rahmen, .az-raster-rahmen + .zeilen-formular { margin-top: var(--formular-abstand); }
/* Vorschau „Folgen“ unter „Gilt ab“ (Haken 'arbeitszeit_folgen', z. B. „Projektplanung: betrifft 3 Einplanungen …“) */
.az-folgen:not(:empty) { margin-top: var(--formular-abstand); }
.az-folgen .meldung { margin-bottom: 0; overflow-wrap: anywhere; }
.az-folgen-meldung > ul { margin: 6px 0; padding-left: 18px; }
.az-folgen-leer { margin: 0; color: var(--text-schwach); }

/* === Mobil: Abwesenheiten & Arbeitszeit === */
@media (max-width: 767px) {
  /* Wochenraster als Karte je Tag (Tabelle → Karten, assets/leiste.js): Uhrzeitfelder ohne Mindestbreite, volle Kartenbreite */
  .az-raster input[type=time] { min-width: 0; }
  /* je Tag: Beginn | Ende und Pause von | Pause bis nebeneinander — die Woche passt so in halb so viel Höhe */
  .az-raster.tk tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
  .az-raster.tk tr > .tk-titel { grid-column: 1 / -1; }
  .abw-schnell > .chip { flex: 1 1 auto; justify-content: center; }
}

/* === Verfügbarkeit (Kern): Meldungskasten und Markierungen === */
/* portal/_verfuegbarkeit_meldungen.php + verfuegbarkeit_meldungen_html() (kern/verfuegbarkeit.php), für alle Module gleich.
   Drei Klassen, nie nur über die Farbe — immer mit Zeichen und Text (Grundsatz 6): hart = rot mit „!“ (nicht speicherbar, kein
   Knopf), Rückfrage = gelb mit Warndreieck (Ohne diese Tage · Trotzdem · Abbrechen auf einer Linie), Hinweis = grau mit „i“.
   Farben nur innerhalb dieses Abschnitts als Tokens (--vfb-*), dieselben Töne wie .meldung-fehler/-warnung. */
.vfb-kasten { --vfb-rot: #b91c1c; --vfb-rot-flaeche: #fef2f2; --vfb-rot-rand: #fecaca; --vfb-gelb: #b45309; --vfb-gelb-text: #92400e;
  --vfb-gelb-flaeche: #fffbeb; --vfb-gelb-rand: #fde68a;
  margin-bottom: var(--karte-abstand); padding: 16px 20px; border: 1px solid var(--rand); border-left-width: 4px; border-radius: var(--radius-karte);
  background: var(--flaeche); box-shadow: var(--schatten); }
.vfb-kasten-hart { border-color: var(--vfb-rot-rand); border-left-color: var(--vfb-rot); }
.vfb-kasten-rueckfrage { border-color: var(--vfb-gelb-rand); border-left-color: var(--gelb); }
.vfb-kasten-hinweis { border-left-color: var(--rand-stark); }
.vfb-titel { margin: 0 0 12px; font-size: 16px; font-weight: 700; color: var(--text); }
.vfb-kasten-hart > .vfb-titel { color: var(--vfb-rot); }
.vfb-gruppen { display: flex; flex-direction: column; gap: 14px; }
.vfb-person-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 6px; font-size: 14px; color: var(--text); }
.vfb-link { font-size: 13.5px; font-weight: 500; color: var(--signal); }
.vfb-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.vfb-zeile { display: flex; align-items: flex-start; gap: 10px; padding: 7px 10px; border-radius: var(--radius); font-size: 14px; line-height: 1.45; }
.vfb-zeile.vfb-hart { background: var(--vfb-rot-flaeche); color: var(--vfb-rot); }
.vfb-zeile.vfb-rueckfrage { background: var(--vfb-gelb-flaeche); color: var(--vfb-gelb-text); }
.vfb-zeile.vfb-hinweis { background: var(--flaeche-still); color: var(--text-2); }
.vfb-zeile.vfb-neu { box-shadow: inset 3px 0 0 currentColor; font-weight: 600; }
.vfb-zeichen { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  font: 700 12px/1 var(--schrift); }
.vfb-hart > .vfb-zeichen { background: var(--vfb-rot); color: #fff; }
.vfb-rueckfrage > .vfb-zeichen { color: var(--vfb-gelb); }
.vfb-rueckfrage > .vfb-zeichen svg { width: 18px; height: 18px; }
.vfb-hinweis > .vfb-zeichen { background: var(--text-still); color: #fff; font-family: Georgia, serif; font-style: italic; }
.vfb-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.vfb-text a { color: inherit; text-decoration: underline; }
/* nur für Vorlesegeräte: „Nicht speicherbar:“, „Rückfrage:“, „Hinweis:“ vor jeder Zeile */
.vfb-vorlesen { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.vfb-satz { margin: 12px 0 0; color: var(--text-schwach); }
.vfb-titel + .vfb-satz { margin: -6px 0 12px; }
.vfb-kasten > .vfb-knoepfe { margin-top: var(--formular-abstand); align-items: center; }
.knopf.vfb-trotzdem { border-color: var(--vfb-gelb-rand); color: var(--vfb-gelb-text); }
.knopf.vfb-trotzdem:hover { background: var(--vfb-gelb-flaeche); border-color: var(--gelb); color: var(--vfb-gelb-text); }
/* Markierung eines geplanten Tages (verfuegbarkeit_zustand → klasse): rot „!“ = handeln (ungeklärt, offen, heute bis +14 Tage),
   gelb schraffiert mit Warndreieck = bewusst bestätigt bzw. ungeklärt erst später, grau = Auskunft (abwesend, vergangen) */
.vfb-marke { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.5;
  white-space: nowrap; background: var(--flaeche-still); color: var(--text-2); }
.vfb-marke svg { width: 12px; height: 12px; }
.vfb-marke-rot { background: #fef2f2; color: #b91c1c; }
.vfb-marke-gelb { color: #92400e; background: repeating-linear-gradient(135deg, #fffbeb 0 6px, #fde68a 6px 8px); }
.vfb-marke-grau { background: var(--flaeche-still); color: var(--text-schwach); }

/* === Mobil: Verfügbarkeit === */
@media (max-width: 767px) {
  .vfb-kasten { padding: 14px 16px; }
  /* drei Knöpfe passen nicht nebeneinander: untereinander über die volle Breite, „Ohne diese Tage“ zuerst */
  .vfb-kasten > .vfb-knoepfe > :is(.knopf, button) { flex: 1 1 100%; justify-content: center; }
}

/* === Projektplanung === */
/* portal/projektplanung/*.php (Klassen .ppl-*): Kalenderfarbe als --f (nur Töne aus PROJEKTPLANUNG_FARBEN, ohne Rot und Gelb),
   Markierungen in drei Klassen wie die Verfügbarkeit (rot „!“ handeln, gelb ⚠ bestätigt bzw. ungeklärt später, grau Auskunft) —
   nie nur über die Farbe, immer mit Zeichen oder Text. „+ Projekt“ zweispaltig (Felder | Wer ist frei?), am Handy untereinander. */
.ppl-punkt-farbe { flex: none; display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--f, var(--signal)); box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.ppl-kalender-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; overflow-wrap: anywhere; }
.ppl-kalender-reihe { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
:is(.ppl-kalenderwahl, .ppl-farbwahl, .ppl-tage-wahl .filter-chips) .chip { cursor: pointer; gap: 8px; }
:is(.ppl-kalenderwahl, .ppl-farbwahl, .ppl-tage-wahl .filter-chips) .chip > input { width: 16px; height: 16px; margin: 0; accent-color: var(--signal); }
:is(.ppl-kalenderwahl, .ppl-farbwahl, .ppl-tage-wahl .filter-chips) .chip:has(> input:checked) { border-color: var(--signal); background: var(--flaeche-aktiv); color: var(--signal); }
.ppl-farbwahl .chip .klein { font-weight: 400; }
/* lange Kalendernamen: die Pille wird nie breiter als die Karte (am Handy sonst seitlich wischen) */
:is(.ppl-kalenderwahl, .ppl-farbwahl) .chip { max-width: 100%; min-width: 0; flex-shrink: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ppl-kuerzel { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 6px;
  background: var(--flaeche-still); border: 1px solid var(--rand); font: 600 11.5px/1 var(--schrift-mono); color: var(--text-2); white-space: nowrap; }
.ppl-kuerzel-reihe { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.ppl-kuerzel-mehr { background: none; }
.ppl-titel-zelle { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.ppl-titel-zelle > .ppl-punkt-farbe { margin-top: 5px; }
.ppl-titel-zelle > div { min-width: 0; overflow-wrap: anywhere; }
.ppl-besetzung { font-weight: 600; margin-right: 6px; }
.ppl-liste td .vfb-marke + .vfb-marke { margin-left: 4px; }
tr.ppl-zeile-vorbei > td:not(.zeilen-aktionen-zelle) { opacity: .6; }
.ppl-weitere { margin-top: var(--formular-abstand); }
.ppl-weitere > summary .klein { font-weight: 400; }
.ppl-weitere > summary + * { padding-top: 0; margin-top: 16px; }
.ppl-weitere > .zeilen-formular + .zeilen-formular, .ppl-weitere > fieldset + .felder-linie, .ppl-weitere > .felder-linie + .zeilen-formular,
.ppl-weitere > .zeilen-formular + label, .ppl-weitere > .zeilen-formular + fieldset { margin-top: var(--formular-abstand); }
.ppl-tage-wahl .filter-chips { margin: 0; }
/* Projekt: Titel und Kunde je eine ganze Zeile (der Kern-Baustein kern/kunde.php — Umschalter + EIN Suchfeld — braucht die Breite);
   darunter bei „+ neue Person“ der Block „Neue Person im Adressbuch“ (kern/kunde_person.php), dann Zeitraum und Personen */
.ppl-titel-kunde { grid-template-columns: minmax(0, 1fr); }
.ppl-titel-kunde + .kunde-person-neu, .ppl-titel-kunde ~ .zeilen-formular { margin-top: var(--formular-abstand); }
/* „+ Projekt“ / Einplanen: links die Felder, rechts „Wer ist frei?“ mit dem Knopf */
.ppl-planen { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--karte-abstand); align-items: start; margin-bottom: var(--karte-abstand); }
.ppl-planen > .karte { margin: 0; }
@media (min-width: 1100px) { .ppl-planen { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.ppl-kandidaten-karte > .aktionen-zeile { margin-top: var(--formular-abstand); }
.ppl-kand-kopf { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.ppl-kand-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ppl-kand { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--rand-weich); }
.ppl-kand:last-child { border-bottom: 0; }
.ppl-kand.gewaehlt .ppl-kand-name { color: var(--signal); }
.ppl-kand-wahl { display: inline-flex; align-items: center; gap: 8px; flex: 1 1 200px; min-width: 0; margin: 0; cursor: pointer; font-size: 14.5px; color: var(--text); }
.ppl-kand-wahl > input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--signal); }
.ppl-kand-name { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.ppl-punkte { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.ppl-punkt { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 28px; padding: 2px 3px; border-radius: 6px;
  font: 700 12px/1.15 var(--schrift); background: var(--flaeche-still); color: var(--text-schwach); }
.ppl-punkt-tag { font-weight: 500; font-size: 10px; color: var(--text-schwach); }
.ppl-punkt-frei { background: #ecfdf5; color: #047857; }
.ppl-punkt-ueberstunden, .ppl-punkt-doppelt { background: #fffbeb; color: #92400e; }
.ppl-punkt-abwesend, .ppl-punkt-gesperrt { background: var(--flaeche-still); color: var(--text-schwach); }
.ppl-punkt-kein_arbeitstag { background: none; color: var(--text-still); }
.ppl-kand-frei { white-space: nowrap; }
.ppl-kand-text { flex: 1 1 100%; color: var(--text-schwach); overflow-wrap: anywhere; }
/* „erst ab <Tag>“ (teilweise Freie, frei am Ende des Zeitraums): Haken und Tag rechts in der Zeile des Namens, mittig zum Feld; Punkte
 * darunter. Passt der ganze Name nicht daneben, bricht „erst ab“ rechtsbündig in eine eigene Zeile darunter — der Name wird nie gequetscht
 * (Basis auto = ganzer Name). Handy: immer eigene Zeile (Mobil-Abschnitt Projektplanung). */
.ppl-kand-kopfzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; flex: 1 1 100%; min-width: 0; }
.ppl-kand-kopfzeile > .ppl-kand-wahl { flex: 1 1 auto; }
.ppl-kand-ab { display: inline-flex; align-items: center; gap: 6px; flex: none; margin: 0 0 0 auto; font-weight: 400; font-size: 14px; line-height: 1.3; color: var(--text); white-space: nowrap; }
.ppl-kand-ab > label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; font-size: 14px; color: var(--text); cursor: pointer; }
.ppl-kand-ab input[type=checkbox] { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--signal); }
.ppl-kand-ab > select { width: auto; flex: none; padding: 0 30px 0 10px; font-size: 14px; background-position: right 8px center; }
/* Meldungen der Live-Prüfung unter der Zeile (dieselben Zeilen wie im Meldungskasten, ohne den Kasten — Farben wie dort) */
:is(.ppl-kand-meldung, .ppl-pruefung) { --vfb-rot: #b91c1c; --vfb-rot-flaeche: #fef2f2; --vfb-gelb: #b45309; --vfb-gelb-text: #92400e; --vfb-gelb-flaeche: #fffbeb; }
.ppl-kand-meldung { flex: 1 1 100%; }
.ppl-kand-meldung .vfb-gruppen { gap: 6px; }
.ppl-kand-gruppe { margin-top: 12px; }
.ppl-kand-gruppe > summary { font-size: 14px; }
/* Die Liste in der Gruppe behält die 16 px Innenabstand des Aufklappers (.ppl-kand-liste setzt sonst 0 — Zeilen klebten am Rand) */
.ppl-kand-gruppe > .ppl-kand-liste { padding: 0 16px 8px; }
.ppl-kand-gruppe > summary + .ppl-kand-liste { padding-top: 8px; }
.ppl-kand-leer { color: var(--text-schwach); }
.ppl-pruefung:not(:empty) { margin-top: 12px; }
/* Besetzung: je Person die Projekttage als Chips, umbrechend (kein Raster zum Wischen) */
.ppl-besetzung-zeile, .ppl-offen-zeile { align-items: flex-start; }
.ppl-besetzung-zeile .liste-titel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ppl-tage { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.ppl-tag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap;
  background: var(--flaeche-still); color: var(--text-2); border: 1px solid transparent; }
.ppl-tag-ok { background: color-mix(in srgb, var(--f, var(--signal)) 12%, #fff); border-color: color-mix(in srgb, var(--f, var(--signal)) 40%, #fff); color: var(--text); }
.ppl-tag-gelb { color: #92400e; background: repeating-linear-gradient(135deg, #fffbeb 0 6px, #fde68a 6px 8px); border-color: #fde68a; }
.ppl-tag-rot { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.ppl-tag-grau { background: var(--flaeche-still); color: var(--text-schwach); }
.ppl-tag-vorbei { opacity: .65; }
a.ppl-ersatz { text-decoration: none; }
a.ppl-ersatz:hover { text-decoration: underline; }
.ppl-summe { margin-top: var(--formular-abstand); }
.ppl-historie { margin: 8px 0 0; padding-left: 20px; }
.ppl-historie > li + li { margin-top: 4px; }
.ppl-ausgeplant { margin-top: var(--formular-abstand); }
/* „⋯ Mehr“ im Seitenkopf der Projektseite (projektplanung_mehr_menue): Kopf-Menü in der Bauart des Zeilen-Menüs („Zeilen-Menü“
   oben, assets/menue.js) — nur der Text-Knopf behält beim Aufklappen seine Rundung. Die Zeilen nutzen zeilen_menue(). */
.zeilen-menue.kopf-menue[open] > summary.knopf { border-radius: var(--radius); }
.ppl-doppelt-neu { margin-top: var(--formular-abstand); }
/* Planansicht (index.php; Patrick 08.10.2026: „zu viele Infos, zu viel Platz verschwendet“ → „Plan breit, Frei hinten“). Kartenkopf
   in EINER Zeile: ‹ Titel › Heute · Statuszeile · Umschalter (768–1279 px: Statuszeile in eigener Zeile darunter). Körper: Plan |
   „Noch frei“ (236 px; bis 1099 px darunter). Der Plan zeigt nur Belegtes: niedrige Tageskopfzeile ohne Kästen (heute blau
   unterstrichen), feine Tageslinien, je Kalender eine Trennzeile „● Maler“, Balken einzeilig mit der Stammbesetzung (Vornamen) und
   darunter nur die Abweichungen in ihrer Tagesspalte (grid-column, dicht gepackt). Vergangenes heller. Kein Querscrollen: alle
   Spalten minmax(0, 1fr), Chips kürzen mit „…“. Am Handy ersetzen Projektkarten mit Mini-Woche das Raster (Abschnitt Mobil). */
.ppl-wochen-nav { align-items: center; }
.ppl-wochen-nav h2 { margin: 0 6px; text-align: center; }
/* Tageskopf des Mitarbeiter-Wochenplans (th.ppl-wt in mitarbeiter.php; die Planansicht hat die niedrige Zeile .ppl-tk) */
.ppl-wt { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 6px 10px; border: 1px solid var(--rand); border-radius: var(--radius); background: var(--flaeche-still);
  font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.ppl-wt.heute { border-color: var(--signal); box-shadow: inset 0 0 0 1px var(--signal); background: var(--flaeche); color: var(--text); }
.ppl-wt.feiertag, .ppl-wt.vorbei { color: var(--text-schwach); }
.ppl-wt .klein { font-size: 11.5px; font-weight: 400; color: var(--text-schwach); }
/* Kartenkopf: Navigation · Statuszeile · Umschalter */
.ppl-plan-ansicht > .ppl-plan-kopf { gap: 10px 16px; }
.ppl-plan-ansicht > .ppl-plan-kopf > .ppl-wochen-nav { flex: none; }
.ppl-plan-ansicht > .ppl-plan-kopf > .ansicht-umschalter { margin-left: auto; }
/* Statuszeile statt der Kacheln: ruhig grün, wenn nichts zu tun ist; sonst flache Abzeichen-Links (filtern wie früher die Kacheln) */
.ppl-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; margin: 0; font-size: 13.5px; }
.ppl-status-ok { color: var(--ppl-gruen-text); font-weight: 600; white-space: nowrap; }
.ppl-status-marke { font-size: 12.5px; letter-spacing: 0; text-decoration: none; }
a.ppl-status-marke:hover { text-decoration: underline; }
@media (min-width: 768px) and (max-width: 1279px) {
  .ppl-plan-ansicht > .ppl-plan-kopf > .ppl-status { order: 3; flex: 1 1 100%; }
}
.ppl-deaktiviert { margin: -8px 0 12px; color: var(--text-schwach); }
/* Körper: Plan | Noch frei (eine ganz vergangene Einheit hat keine Spalte: .ppl-koerper-voll) */
.ppl-koerper { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 0 24px; align-items: start; }
.ppl-koerper.ppl-koerper-voll { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1099px) {
  .ppl-koerper { grid-template-columns: minmax(0, 1fr); }
}
.ppl-leer { margin: 0; padding: 2px 0; font-size: 14px; color: var(--text-schwach); }
/* Woche: Tageskopf (eine niedrige Zeile), Fläche mit feinen Tageslinien; getönte Spalten für heute und Feiertage */
.ppl-woche { --spalten: 5; min-width: 0; }
.ppl-tageskopf, .ppl-band-raster { display: grid; grid-template-columns: repeat(var(--spalten), minmax(0, 1fr)); gap: 6px; }
.ppl-tageskopf { border-bottom: 1px solid var(--rand); }
.ppl-tk { min-width: 0; padding: 0 8px 6px; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ppl-tk.heute { color: var(--signal); box-shadow: inset 0 -2px 0 var(--signal); }
.ppl-tk.vorbei, .ppl-tk.feiertag { color: var(--text-still); font-weight: 500; }
.ppl-tk .klein { font-size: 12px; font-weight: 400; }
.ppl-flaeche { position: relative; padding-bottom: 2px;
  background-image: linear-gradient(to right, var(--rand-weich) 1px, transparent 1px);
  background-size: calc((100% + 6px) / var(--spalten)) 100%; background-position: -3.5px 0; }
.ppl-spalte-ton { position: absolute; top: 0; bottom: 0; left: calc(var(--i) * (100% + 6px) / var(--spalten)); width: calc((100% + 6px) / var(--spalten) - 6px); pointer-events: none; }
.ppl-spalte-ton.heute { background: color-mix(in srgb, var(--signal) 6%, transparent); }
.ppl-spalte-ton.feiertag { background: color-mix(in srgb, var(--text-still) 14%, transparent); }
.ppl-band { position: relative; }
/* Kalender: schmale Trennzeile über die ganze Breite, ohne Zahlen */
.ppl-band-kopf { display: flex; align-items: center; margin: 10px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--text-schwach); }
.ppl-band-kopf::after { content: ''; flex: 1 1 auto; height: 1px; background: var(--rand-weich); }
.ppl-band-name { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; padding-right: 8px; background: var(--flaeche); overflow-wrap: anywhere; }
.ppl-band-name .ppl-punkt-farbe { width: 10px; height: 10px; }
.ppl-band-name .abzeichen { font-size: 11px; padding: 1px 7px; }
.ppl-band-raster { row-gap: 6px; }
/* Balken: Titel · Ort und die Stammbesetzung EINMAL; darunter je Tag nur, was abweicht */
.ppl-balken { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 6px; cursor: pointer;
  background: color-mix(in srgb, var(--f, var(--signal)) 10%, var(--flaeche)); box-shadow: inset 3px 0 0 var(--f, var(--signal)); }
.ppl-balken:hover { background: color-mix(in srgb, var(--f, var(--signal)) 16%, var(--flaeche)); }
.ppl-balken.vorbei { opacity: .55; }
.ppl-balken.teils-vorbei { background: linear-gradient(to right, color-mix(in srgb, var(--f, var(--signal)) 4%, var(--flaeche)) 0 calc(var(--vorbei) / var(--breite) * 100% - 3px),
  color-mix(in srgb, var(--f, var(--signal)) 10%, var(--flaeche)) 0); }
.ppl-balken-vorher { border-top-left-radius: 0; border-bottom-left-radius: 0; box-shadow: none; }
.ppl-balken-nachher { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ppl-balken-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 32px; padding: 4px 10px 4px 13px; }
.ppl-balken-titel { flex: 0 1 auto; min-width: 0; max-width: 100%; font-size: 13.5px; font-weight: 600; color: var(--text); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ppl-balken-titel:hover { text-decoration: underline; }
.ppl-ort { font-weight: 400; color: var(--text-schwach); }
.ppl-leute { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.ppl-balken-abgesagt { background: var(--flaeche-still); box-shadow: inset 3px 0 0 var(--rand-stark); }
.ppl-balken-abgesagt .ppl-balken-titel, .ppl-balken-abgesagt .ppl-karte-titel { color: var(--text-schwach); text-decoration: line-through; }
/* Vorname einer Person (Balken, Tag, Handy, Projektliste): Pille, der volle Name im Tooltip */
.ppl-name { display: inline-flex; align-items: center; max-width: 100%; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12.5px; font-weight: 500; line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--flaeche); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--f, var(--text-still)) 40%, var(--flaeche)); }
/* Abweichungen: Raster wie die Tage des Balkens (gleiche Spalten und Abstände wie der Tageskopf, dicht gepackt). Ein Chip FÜLLT die
   Spalten seiner Tage — „! 1 offen“ Mo–Mi steht als Streifen unter Mo bis Mi, nicht als Angabe nur für Montag; langer Text bricht
   um, statt mitten im Wort abgeschnitten zu werden (wer fehlt und warum, steht am Ende). */
.ppl-abweichungen { display: grid; grid-template-columns: repeat(var(--breite, 1), minmax(0, 1fr)); grid-auto-flow: row dense; align-items: start; gap: 4px 6px; padding: 0 0 6px; }
.ppl-abweichungen > * { justify-self: stretch; min-width: 0; margin: 0 4px 0 7px; }
.ppl-abweichungen > .ppl-abw { display: block; padding: 2px 8px; border-radius: 6px; line-height: 1.35; }
/* „⚠ trotzdem eingeplant“ ist entschieden — in der Planansicht ruhig gelb statt gestreift (Woche, Handy-Karten, Tag) */
:is(.ppl-abweichungen, .ppl-karte-abw, .ppl-leute, .ppl-ml-liste > li) > .vfb-marke-gelb { background: var(--ppl-gelb-flaeche); box-shadow: inset 0 0 0 1px var(--ppl-gelb-rand); }
/* wer nur an einem Teil der Tage dabei ist: ein schmaler Streifen in Kalenderfarbe mit dem Vornamen über genau diese Tage */
.ppl-abweichungen > .ppl-name { display: block; height: 20px; padding: 0 8px; border: 0; border-radius: 4px; line-height: 20px; font-size: 12px;
  background: color-mix(in srgb, var(--f, var(--signal)) 22%, var(--flaeche)); }
.ppl-abw { max-width: 100%; white-space: normal; overflow-wrap: anywhere; font-size: 12px; text-decoration: none; }
a.ppl-abw:hover { text-decoration: underline; }
/* Spalte „Noch frei“: Name · Zeit in Worten · Wochenstreifen — eine Zeile je Person */
.ppl-nf { align-self: stretch; min-width: 0; padding-left: 20px; border-left: 1px solid var(--rand); }
.ppl-nf-kopf { display: flex; flex-wrap: wrap; align-items: center; margin: 0 0 6px; }
.ppl-nf-kopf > .feld-hilfe { flex: 1 1 100%; }
.ppl-nf-titel { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-schwach); }
.ppl-nf-titel + .feld-hilfe-knopf { letter-spacing: 0; }
.ppl-nf-abwesend { margin-top: 14px; }
.ppl-nf-gruppe + .ppl-nf-gruppe { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--rand-weich); }
.ppl-nf-kal { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-bottom: 2px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.ppl-nf-kal > span { display: inline-flex; align-items: center; gap: 6px; }
.ppl-nf-kal .ppl-punkt-farbe { width: 9px; height: 9px; }
.ppl-nf-liste { list-style: none; margin: 0; padding: 0; }
/* Zeile: links Name und Zeit (.ppl-nf-wer — reicht der Platz neben einem langen Namen nicht, rückt die Zeit als Ganzes in die nächste
   Zeile, statt „ganze / Woche“ zu brechen), rechts der Streifen */
.ppl-nf-liste > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding: 5px 0; font-size: 13.5px; }
.ppl-nf-liste > li + li { border-top: 1px solid var(--rand-weich); }
.ppl-nf-wer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; min-width: 0; }
.ppl-nf-wer > :is(a, .ppl-nf-name) { min-width: 0; font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.ppl-nf-wer > a:hover { color: var(--signal); text-decoration: underline; }
.ppl-nf-wann { flex: 0 1 auto; min-width: 0; margin-left: auto; text-align: right; font-size: 13px; color: var(--text-2); }
.ppl-streifen { display: inline-grid; grid-template-columns: repeat(var(--n, 5), 10px); gap: 2px; }
.ppl-streifen > i { height: 10px; border-radius: 2px; background: var(--flaeche); box-shadow: inset 0 0 0 1px var(--rand); }
.ppl-streifen > i.frei { background: var(--ppl-gruen); box-shadow: none; }
.ppl-streifen > i.teil { background: linear-gradient(to top, var(--ppl-gruen) 0 50%, var(--flaeche) 50%); box-shadow: inset 0 0 0 1px var(--ppl-gruen); }
.ppl-streifen > i.vorbei { background: var(--flaeche-still); box-shadow: none; }
.ppl-nf-mehr { margin-top: 2px; }
.ppl-nf-mehr > summary { cursor: pointer; padding: 4px 0; font-size: 13px; color: var(--signal); }
.ppl-nf-niemand { margin: 2px 0 0; font-size: 13.5px; color: var(--text-schwach); }
.ppl-nf-summe { margin: 8px 0 0; padding-top: 6px; border-top: 1px solid var(--rand-weich); font-size: 12.5px; color: var(--text-schwach); }
@media (min-width: 768px) and (max-width: 1099px) {
  .ppl-nf { margin-top: 16px; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--rand); }
}
/* Handy-Woche (Projektkarten mit Mini-Woche) nur am Handy — Abschnitt „Mobil: Projektplanung“ */
.ppl-hw { display: none; }
/* Kacheln „Wo bin ich morgen?“ (meine.php) und Karten am Handy */
.ppl-tk-karte { padding: 10px 12px; border-radius: var(--radius); background: color-mix(in srgb, var(--f, var(--signal)) 9%, #fff); box-shadow: inset 4px 0 0 var(--f, var(--signal));
  overflow-wrap: anywhere; }
.ppl-tk-titel { font-weight: 600; color: var(--text); }
.ppl-tk-karte .ppl-tage { margin-top: 6px; }
.ppl-meine { padding: 10px 12px; border: 1px solid var(--signal-rand); border-radius: var(--radius); background: var(--signal-flaeche); }
.ppl-meine > ul { margin: 6px 0 0; padding-left: 18px; }
/* „Wo bin ich morgen?“ (Etappe 2, meine.php): Heute, Morgen (bzw. nächster Arbeitstag), „Danach“ — Dashboard-Block und Handy-Tagesliste */
.ppl-morgen { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ppl-morgen-titel { font-size: 15px; color: var(--text); }
.ppl-morgen-tag { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.ppl-morgen-tag + .ppl-morgen-tag { padding-top: 10px; border-top: 1px solid var(--rand-weich); }
.ppl-morgen-wann { flex: 0 0 96px; display: flex; flex-direction: column; gap: 2px; }
.ppl-morgen-was { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; overflow-wrap: anywhere; }
.ppl-morgen-was > .ppl-tk-karte { align-self: stretch; }
.ppl-morgen-weitere { margin: 0; overflow-wrap: anywhere; }
/* „Ersten freien Termin finden“ unter Zeitraum und Personen (Etappe 2, freier_termin.php) */
.ppl-freier-termin { margin-top: var(--formular-abstand); }
.ppl-ft:empty { display: none; }
.ppl-ft-ergebnis { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--signal-rand); border-radius: var(--radius); background: var(--signal-flaeche); overflow-wrap: anywhere; }
.ppl-ft-ergebnis.ppl-ft-keiner { border-color: var(--rand); background: var(--flaeche-still); }
.ppl-ft-haupt { margin: 0; font-weight: 600; color: var(--text); }
.ppl-ft-neben { margin: 4px 0 0; color: var(--text-2); }
.ppl-ft-ergebnis > .aktionen-zeile { margin-top: 10px; }
/* Mitarbeiter → Wochenplan: Raster Person × Tag (Zellen umbrechend, Titel mit „…“), am Handy je Person eine Karte */
.ppl-wp { table-layout: fixed; }
.ppl-wp th:first-child { width: 210px; }
.ppl-wp .ppl-wp-summe { width: 140px; }
.ppl-wp th.ppl-wt { display: table-cell; border: 0; border-bottom: 1px solid var(--rand); border-radius: 0; background: none; padding-left: 8px; padding-right: 8px; white-space: normal; }
.ppl-wp th.ppl-wt.heute { box-shadow: inset 0 -2px 0 var(--signal); color: var(--text); }
.ppl-wp th.ppl-wt .klein { display: block; }
.ppl-wp th[scope=row] { font-size: 14px; font-weight: 500; color: var(--text); white-space: normal; border-bottom: 1px solid var(--rand-weich); vertical-align: top; }
.ppl-wp tbody tr:last-child > th { border-bottom: 0; }
.ppl-wp-person { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; overflow-wrap: anywhere; }
.ppl-wp-punkte { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ppl-wp td.ppl-wp-zelle { padding: 8px; vertical-align: top; }
.ppl-wp td.ppl-wp-zelle.heute { background: var(--signal-flaeche); }
.ppl-wp td.ppl-wp-zelle.vorbei > * { opacity: .7; }
.ppl-wp-zelle > *, .ppl-wp-inhalt > * { margin: 0 4px 4px 0; }
.ppl-wp-eintrag { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: top; text-decoration: none; }
a.ppl-wp-eintrag:hover { text-decoration: underline; }
.ppl-wp-frei { color: #047857; }
.ppl-wp-leer { color: var(--text-still); }
.ppl-wp td.ppl-wp-summe { font-size: 13px; vertical-align: top; }
tr.ppl-wp-eigen > th { box-shadow: inset 3px 0 0 var(--signal); }
.ppl-wp-mobil { display: none; }
.ppl-wp-karte { margin: 0; }
.ppl-wp-karte + .ppl-wp-karte { margin-top: 8px; }
.ppl-wp-karte > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ppl-wp-tage { list-style: none; margin: 0; padding: 4px 16px 8px; display: flex; flex-direction: column; gap: 0; }
.ppl-wp-tage > li { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rand-weich); }
.ppl-wp-tage > li:last-child { border-bottom: 0; }
.ppl-wp-tage > li.heute > .ppl-wp-tag { color: var(--signal); font-weight: 700; }
.ppl-wp-tag { flex: 0 0 76px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.ppl-wp-inhalt { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
/* Planansicht Etappe 2 (portal/projektplanung/_ansichten.php): Ansichts-Umschalter im Kartenkopf rechts neben ‹ Titel › Heute */
/* Farben der Ansichten nur über Tokens (Konzept: „nur mit Tokens“): global --flaeche, --signal, --gelb, --text-2; was es global
   nicht gibt, steht einmal hier als --ppl-* (dieselben Töne wie .abzeichen-gruen/-rot und .vfb-marke-gelb) */
.ppl-plan { --ppl-gruen: #16a34a; --ppl-gruen-text: #047857; --ppl-gruen-flaeche: #ecfdf5; --ppl-gruen-rand: #a7f3d0; --ppl-rot-text: #b91c1c; --ppl-rot-flaeche: #fef2f2;
  --ppl-rot-rand: #fecaca; --ppl-gelb-text: #92400e; --ppl-gelb-flaeche: #fffbeb; --ppl-gelb-rand: #fde68a; }
.ppl-plan-kopf > .ansicht-umschalter { flex: none; }
/* Tag: dasselbe Raster Plan | „Noch frei heute“; je Projekt EINE Zeile im Balkenstil (Namen, dahinter die Abweichungen) */
.ppl-tg-hinweis { margin: -8px 0 12px; color: var(--text-schwach); }
.ppl-tagesplan { min-width: 0; }
.ppl-tagesplan > .ppl-band:first-child > .ppl-band-kopf { margin-top: 0; }
.ppl-tag-liste { display: flex; flex-direction: column; gap: 6px; }
.ppl-tg-zeile.vorbei { opacity: .75; }
.ppl-tg-abgesagt { background: var(--flaeche-still); box-shadow: inset 4px 0 0 var(--rand-stark); }
.ppl-tg-abgesagt > .ppl-ml-text > a { color: var(--text-schwach); text-decoration: line-through; }
/* Monat: je Woche ein Raster KW | Mo–So | Noch frei; Zeile 1 Tagesnummern, darunter die Bahnen (--bahnen) und eine Randzeile —
   eine leere Woche hat keine Bahnen (.leer). Die Tagesfelder liegen über alle Zeilen (Hintergrund, heute umrahmt), Balken und
   Nummern darüber. Spalten minmax(0, 1fr). */
.ppl-monat { display: flex; flex-direction: column; border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden; }
.ppl-monat-kopf, .ppl-monat-woche { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)) 200px; }
.ppl-monat-ohne-frei :is(.ppl-monat-kopf, .ppl-monat-woche) { grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
.ppl-monat-kopf { background: var(--flaeche-still); border-bottom: 1px solid var(--rand); font-size: 12px; font-weight: 600; color: var(--text-schwach); }
.ppl-monat-kopf > span { padding: 6px 8px; }
.ppl-monat-kopf-frei { display: flex; flex-wrap: wrap; align-items: center; }
.ppl-monat-kopf-frei > .feld-hilfe { flex: 1 1 100%; font-weight: 400; }
.ppl-monat-woche { --bahnen: 1; grid-template-rows: auto repeat(var(--bahnen), minmax(24px, auto)) 6px; row-gap: 3px; border-bottom: 1px solid var(--rand); }
.ppl-monat-woche.leer { grid-template-rows: auto 6px; }
.ppl-monat-woche:last-child { border-bottom: 0; }
.ppl-monat-kw { grid-column: 1; grid-row: 1 / -1; display: flex; justify-content: center; padding: 8px 4px; border-right: 1px solid var(--rand-weich); background: var(--flaeche-still);
  font-size: 12.5px; font-weight: 600; color: var(--text-2); text-decoration: none; }
.ppl-monat-kw:hover { color: var(--signal); text-decoration: underline; }
.ppl-monat-kw.heute { color: var(--signal); box-shadow: inset 3px 0 0 var(--signal); }
.ppl-monat-feld { grid-row: 1 / -1; border-right: 1px solid var(--rand-weich); }
.ppl-monat-feld.wochenende, .ppl-monat-feld.feiertag { background: var(--flaeche-still); }
.ppl-monat-feld.aussen { background: repeating-linear-gradient(135deg, var(--flaeche-still) 0 6px, var(--flaeche) 6px 12px); }
.ppl-monat-feld.heute { box-shadow: inset 0 0 0 2px var(--signal); }
.ppl-monat-nr { grid-row: 1; z-index: 1; display: flex; align-items: baseline; gap: 6px; min-width: 0; padding: 4px 8px 2px; font-size: 13px; color: var(--text); text-decoration: none;
  white-space: nowrap; overflow: hidden; }
.ppl-monat-nr.aussen { color: var(--text-still); }
.ppl-monat-nr.heute > b { padding: 0 6px; border-radius: 999px; background: var(--signal); color: var(--flaeche); }
.ppl-monat-nr:hover > b { text-decoration: underline; }
.ppl-monat-feiertag { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--text-schwach); }
/* Balken „Titel · Artur, Max“ (Text kürzt mit „…“), am Ende das Zeichen „! 1 offen“ / „1 offen“ / „⚠“ */
.ppl-monat-balken { z-index: 1; display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0 3px; padding: 3px 6px 3px 10px; border-radius: 6px; font-size: 12.5px;
  font-weight: 600; line-height: 18px; color: var(--text); text-decoration: none;
  background: color-mix(in srgb, var(--f, var(--signal)) 16%, var(--flaeche)); box-shadow: inset 4px 0 0 var(--f, var(--signal)); }
.ppl-monat-balken:hover { background: color-mix(in srgb, var(--f, var(--signal)) 26%, var(--flaeche)); }
.ppl-monat-balken.ppl-balken-vorher { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; box-shadow: none; }
.ppl-monat-balken.ppl-balken-nachher { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ppl-monat-balken.vorbei { opacity: .5; }
.ppl-mb-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppl-mb-zeichen { flex: none; margin-left: auto; padding: 0 6px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 16px; white-space: nowrap; }
.ppl-mbz-rot { background: var(--ppl-rot-flaeche); color: var(--ppl-rot-text); box-shadow: inset 0 0 0 1px var(--ppl-rot-rand); }
.ppl-mbz-gelb { background: var(--ppl-gelb-flaeche); color: var(--ppl-gelb-text); box-shadow: inset 0 0 0 1px var(--ppl-gelb-rand); }
.ppl-mbz-grau { background: var(--flaeche); color: var(--text-schwach); box-shadow: inset 0 0 0 1px var(--rand); }
.ppl-mb-grau { background: var(--flaeche-still); box-shadow: inset 4px 0 0 var(--rand-stark); color: var(--text-schwach); text-decoration: line-through; }
.ppl-monat-weitere { grid-column: 2 / span 7; z-index: 1; align-self: center; padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--signal); }
.ppl-monat-frei { grid-column: 9; grid-row: 1 / -1; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 6px 10px; border-left: 1px solid var(--rand-weich);
  font-size: 12px; color: var(--text-2); }
/* Name kürzt mit „…“ (voller Name im Tooltip), die Zeit bleibt ganz stehen */
.ppl-monat-frei-zeile { display: flex; gap: 4px; min-width: 0; white-space: nowrap; }
.ppl-monat-frei-zeile > :is(b, a) { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--text); text-decoration: none; }
.ppl-monat-frei-wann { flex: none; }
.ppl-monat-frei-zeile > a:hover { color: var(--signal); text-decoration: underline; }
.ppl-monat-frei-mehr { font-weight: 600; color: var(--signal); text-decoration: none; }
.ppl-monat-frei-mehr:hover { text-decoration: underline; }
.ppl-monat-liste { display: none; }
.ppl-ml-woche { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--rand-weich); }
.ppl-ml-woche.heute .ppl-ml-kopf > a { color: var(--signal); }
.ppl-ml-woche.vorbei { display: block; }
.ppl-ml-woche.vorbei > summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-weight: 500; color: var(--text-schwach); }
.ppl-ml-woche.vorbei[open] > summary { margin-bottom: 6px; }
.ppl-ml-kopf { margin: 0; font-size: 15px; }
.ppl-ml-frei { margin: 0; overflow-wrap: anywhere; }
.ppl-ml-frei > a { font-weight: 600; color: var(--signal); }
.ppl-ml-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ppl-ml-liste > li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--f, var(--signal)) 9%, var(--flaeche)); box-shadow: inset 4px 0 0 var(--f, var(--signal)); }
.ppl-ml-liste > li.vorbei { opacity: .6; }
.ppl-ml-liste > li > .ppl-punkt-farbe { margin-top: 5px; }
.ppl-ml-liste > li > .vfb-marke { flex: none; }
.ppl-ml-text { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.ppl-ml-text > a { font-weight: 600; color: var(--text); }
/* Jahr: je Quartal ein Raster KW × Kalender + „Noch frei“. Zellen tragen --r/--c (Zeile/Spalte); am Handy werden sie vertauscht (KW
   als Zeilen) — ein Markup, kein Querscrollen. Zelle: Füllung von unten in der Kalenderfarbe, so hoch wie die Belegung (--fuell);
   gelb ab 90 %, „⚠“ über 100 %, roter Punkt „!“ = handeln, vergangen grau ohne Zeichen. Keine Prozentzahl (Tooltip nennt alles). */
.ppl-jahr { display: flex; flex-direction: column; gap: 14px; }
.ppl-jahr-titel { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--text-2); }
details.ppl-jahr-quartal > summary.ppl-jahr-titel { margin: 0; cursor: pointer; font-weight: 500; color: var(--text-schwach); }
details.ppl-jahr-quartal[open] > summary.ppl-jahr-titel { margin-bottom: 8px; }
.ppl-jahr-raster { --wochen: 13; --reihen: 2; display: grid; grid-template-columns: minmax(96px, 150px) repeat(var(--wochen), minmax(0, 1fr)); gap: 3px; }
.ppl-jahr-raster > * { grid-row: var(--r); grid-column: var(--c); min-width: 0; }
.ppl-jahr-kw { display: flex; align-items: flex-end; justify-content: center; padding: 2px 0; font-size: 11.5px; font-weight: 600; color: var(--text-schwach); text-decoration: none;
  white-space: nowrap; overflow: hidden; }
.ppl-jahr-kw:hover { color: var(--signal); text-decoration: underline; }
.ppl-jahr-kw.heute { color: var(--signal); box-shadow: inset 0 -2px 0 var(--signal); }
.ppl-jahr-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; padding-right: 6px; font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; }
.ppl-jahr-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppl-jahr-name .abzeichen { font-size: 10.5px; padding: 0 6px; }
.ppl-jahr-name > .feld-hilfe { flex: 1 1 100%; font-weight: 400; }
.ppl-jahr-nf-name { color: var(--text-2); }
.ppl-jahr-nf-name > .ppl-jahr-name-text { display: flex; flex-direction: column; line-height: 1.2; }
.ppl-jahr-nf-name .klein { font-size: 10.5px; font-weight: 400; color: var(--text-schwach); }
.ppl-jahr-zelle { --fuell-farbe: color-mix(in srgb, var(--f, var(--signal)) 72%, var(--flaeche)); position: relative; display: flex; align-items: center; justify-content: center;
  height: 30px; border-radius: 5px; text-decoration: none; border: 1px solid color-mix(in srgb, var(--f, var(--signal)) 30%, var(--flaeche));
  background: linear-gradient(to top, var(--fuell-farbe) 0 var(--fuell, 0%), var(--flaeche) var(--fuell, 0%)); }
.ppl-jahr-zelle:hover { outline: 2px solid var(--signal); outline-offset: 1px; }
.ppl-jz-gelb { --fuell-farbe: var(--gelb); border-color: var(--gelb); }
.ppl-jz-leer { background: var(--flaeche-still); border-color: var(--rand-weich); }
.ppl-jahr-zelle.vorbei { --fuell-farbe: color-mix(in srgb, var(--text-still) 45%, var(--flaeche)); border-color: var(--rand-weich); }
.ppl-jahr-ueber { position: relative; font-size: 12px; font-weight: 700; color: var(--ppl-gelb-text); text-shadow: 0 0 2px var(--flaeche); }
.ppl-jahr-rot { position: absolute; top: -6px; right: -5px; display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%;
  background: var(--ppl-rot-text); color: var(--flaeche); font-size: 10px; font-weight: 800; line-height: 1; box-shadow: 0 0 0 2px var(--flaeche); }
.ppl-jahr-nf { position: relative; display: flex; align-items: center; justify-content: center; height: 30px; border-radius: 5px; font-size: 12.5px; font-weight: 700;
  color: var(--ppl-gruen-text); text-decoration: none; }
a.ppl-jahr-nf:hover { outline: 2px solid var(--signal); outline-offset: 1px; }
.ppl-jahr-rot-handy { display: none; }
/* Aufklapper der Planansicht ohne Kasten — eine Textzeile mit Pfeil (vergangene Quartale, vergangene Wochen am Handy, „+ n weitere“) */
:is(details.ppl-jahr-quartal, details.ppl-ml-woche, details.ppl-nf-mehr) { margin-top: 0; border: 0; border-radius: 0; background: none; }
:is(details.ppl-jahr-quartal, details.ppl-ml-woche, details.ppl-nf-mehr) > summary { padding: 4px 0; border: 0; border-radius: 0; background: none; font-size: 13.5px; font-weight: 500; }
:is(details.ppl-jahr-quartal, details.ppl-ml-woche, details.ppl-nf-mehr) > summary:hover { background: none; color: var(--signal); }
:is(details.ppl-jahr-quartal, details.ppl-ml-woche, details.ppl-nf-mehr) > summary::before { width: 10px; height: 10px; }
:is(details.ppl-jahr-quartal, details.ppl-ml-woche, details.ppl-nf-mehr) > :not(summary) { padding: 0; }
details.ppl-nf-mehr > summary { color: var(--signal); }
/* Druck (A4 quer, Knopf „Drucken“ im Seitenkopf der Planansicht, ohne PDF-Bibliothek): nur Seitentitel und Plankarte (Plan,
   Spalte „Noch frei“, Statuszeile als Text), Farben werden mitgedruckt; Bänder, Wochenzeilen, Karten und Quartale brechen nicht
   mitten durch. Benannte Seite (page: ppl-quer), damit andere Druckseiten (z. B. die Hilfe) hochkant bleiben; ältere Browser drucken
   hochkant. Chrome wertet Breiten-Abfragen beim Drucken gegen die Vorgabe-Papierbreite aus (≈ 756 px, also „Handy“, nachgemessen mit
   --print-to-pdf) — deshalb stellen die Regeln unten die Desktop-Darstellung ausdrücklich her (body:has(.ppl-plan) schlägt die
   Handy-Regeln des Abschnitts Mobil). */
@page ppl-quer { size: A4 landscape; margin: 10mm; }
@media print {
  body:has(.ppl-plan) :is(.seitenleiste, .topbar, .nav-schleier, .support-fab, .support-panel, .hilfe-panel, .hilfe-schleier, .impersonation-balken, .such-karte, .stat-karten,
    .ueberblick-knopf, .seiten-kopf-aktionen, .ansicht-umschalter, .ppl-wochen-nav > .knopf, .ppl-hw, .ppl-monat-liste, .feld-hilfe-knopf, .feld-hilfe),
  body:has(.ppl-plan) .inhalt > .meldung { display: none; }
  body:has(.ppl-plan) .ppl-plan-ansicht .ppl-woche { display: block; }
  body:has(.ppl-plan) .ppl-monat { display: flex; }
  body:has(.ppl-plan) :is(.ppl-titel-jahr, .ppl-titel-kw) { display: inline; }
  body:has(.ppl-plan) .ppl-koerper { grid-template-columns: minmax(0, 1fr) 236px; }
  body:has(.ppl-plan) .ppl-koerper.ppl-koerper-voll { grid-template-columns: minmax(0, 1fr); }
  body:has(.ppl-plan) .ppl-nf { margin: 0; padding: 0 0 0 14px; border-top: 0; border-left: 1px solid var(--rand); }
  /* „Noch frei“ auf Papier: alle Personen (assets/projektplanung.js klappt „+ n weitere“ vor dem Druck auf), dafür dicht — ohne die
     40-px-Zeilen des Handys, ohne den Aufklapper */
  body:has(.ppl-plan) .ppl-nf-liste > li { padding: 0; font-size: 11.5px; line-height: 1.3; }
  body:has(.ppl-plan) .ppl-streifen > i { height: 8px; }
  body:has(.ppl-plan) .ppl-nf-wer > :is(a, .ppl-nf-name) { display: inline; min-height: 0; }
  body:has(.ppl-plan) .ppl-nf-wann { font-size: 11px; }
  body:has(.ppl-plan) .ppl-nf-mehr > summary { display: none; }
  body:has(.ppl-plan) .ppl-plan-ansicht > .ppl-plan-kopf > .ppl-wochen-nav { flex: none; }
  body:has(.ppl-plan) .ppl-plan-ansicht > .ppl-plan-kopf > .ppl-status { order: 0; flex: 1 1 auto; }
  body:has(.ppl-plan) .ppl-status-marke { min-height: 0; padding: 0; background: none; font-size: 12px; }
  /* Mitarbeiter → Wochenplan (Karte .ppl-plan): ohne Reiterleiste, das Raster statt der Handy-Karten */
  body:has(.ppl-plan) :is(.bereich-reiter, .reiter-leiste, .reiter-wahl, .ppl-wp-mobil) { display: none; }
  body:has(.ppl-plan) .ppl-wp-raster { display: block; }
  body:has(.ppl-plan) .ppl-wp th:first-child { width: 170px; }
  body:has(.ppl-plan) .ppl-wochen-nav h2 { order: 0; flex: 0 1 auto; margin: 0; }
  body:has(.ppl-plan) .ppl-jahr-raster { grid-template-columns: minmax(96px, 150px) repeat(var(--wochen), minmax(0, 1fr)); }
  body:has(.ppl-plan) .ppl-jahr-raster > *, body:has(.ppl-plan) .ppl-jahr-viele :is(.ppl-jahr-nf-name, .ppl-jahr-nf) { grid-row: var(--r); grid-column: var(--c); }
  body:has(.ppl-plan) .ppl-jahr-viele :is(.ppl-jahr-name, .ppl-jahr-zelle) { display: flex; }
  body:has(.ppl-plan) .ppl-jahr-name { flex-direction: row; justify-content: flex-start; padding: 0 6px 0 0; font-size: 12px; text-align: left; }
  body:has(.ppl-plan) .ppl-jahr-name-text { display: block; }
  body:has(.ppl-plan) .ppl-jahr-nf-name > .ppl-jahr-name-text { display: flex; flex-direction: column; }
  body:has(.ppl-plan) .ppl-jahr-kw { align-items: flex-end; justify-content: center; padding: 2px 0; box-shadow: none; }
  body:has(.ppl-plan) :is(.ppl-jahr-zelle, .ppl-jahr-nf) { height: 24px; font-size: 10.5px; }
  body:has(.ppl-plan) .ppl-jahr-rot-handy { display: none; }
  body:has(.ppl-plan) .app { display: block; min-height: 0; }
  body:has(.ppl-plan) .inhalt { page: ppl-quer; padding: 0; background: none; }
  body:has(.ppl-plan) .seiten-kopf { margin: 0 0 6px; padding: 0; border: 0; background: none; }
  body:has(.ppl-plan) .ppl-plan { margin: 0; padding: 0; border: 0; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body:has(.ppl-plan) .ppl-plan-kopf { margin: 0 0 8px; padding: 0 0 6px; }
  :is(.ppl-band, .ppl-monat-woche, .ppl-jahr-quartal, .ppl-tg-zeile, .ppl-balken) { break-inside: avoid; }
  .ppl-band-kopf, .ppl-jahr-titel { break-after: avoid; }
}

/* === Mobil: Projektplanung === */
@media (max-width: 767px) {
  .ppl-kand-wahl, .ppl-kand-kopfzeile > .ppl-kand-wahl { flex-basis: 100%; }
  .ppl-kandidaten-karte > .aktionen-zeile > .knopf { flex: 1 1 100%; justify-content: center; }
  .tk .ppl-titel-zelle > .ppl-punkt-farbe { margin-top: 6px; }
  /* Wochenplan der Mitarbeiter: Karte je Person statt Raster */
  .ppl-wp-raster { display: none; }
  .ppl-wp-mobil { display: block; }
  .ppl-wochen-nav h2 { order: -1; flex: 1 1 100%; margin: 0; font-size: 17px; text-align: left; }
  .ppl-wochen-nav > .knopf { justify-content: center; }
  /* Planansicht, Kartenkopf: ‹ KW 42 · 12.–18.10. › Heute in EINER Zeile (ohne Jahr), darunter der Umschalter (42 px, volle
     Breite), darunter die Statuszeile (Marken mindestens 40 px hoch, umbrechend) */
  .ppl-plan-ansicht > .ppl-plan-kopf > .ppl-wochen-nav { flex: 1 1 100%; flex-wrap: nowrap; gap: 6px; }
  .ppl-plan-ansicht .ppl-wochen-nav h2 { order: 0; flex: 1 1 auto; min-width: 0; margin: 0; font-size: 16px; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
  .ppl-plan-ansicht .ppl-wochen-nav > .knopf { flex: none; min-width: 42px; padding: 0 10px; }
  .ppl-titel-jahr, .ppl-titel-kw { display: none; }
  .ppl-plan-ansicht .ppl-wochen-nav h2 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ppl-plan-ansicht > .ppl-plan-kopf > .ansicht-umschalter { margin-left: 0; }
  .ppl-plan-ansicht > .ppl-plan-kopf > .ppl-status { order: 3; flex: 1 1 100%; }
  .ppl-status-marke { min-height: 40px; padding: 0 12px; font-size: 13px; white-space: normal; }
  /* Planansicht Woche: Projektkarten je Kalender statt des Rasters — Titel · Ort, Mini-Woche (je Tag ein Feld: Kalenderfarbe =
     Projekttag, rot = handeln, gelb = trotzdem, hell = vorbei; heute mit blauem Strich), Tage in Worten, Stammbesetzung, darunter
     die Abweichungen mit Tag („Di: ⚠ Artur doppelt“); „Noch frei“ unter den Karten */
  .ppl-plan-ansicht .ppl-woche { display: none; }
  .ppl-hw { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .ppl-hw > .ppl-band-kopf { margin: 6px 0 0; }
  .ppl-hw > .ppl-band-kopf:first-child, .ppl-hw > .ppl-meine + .ppl-band-kopf { margin-top: 0; }
  .ppl-karte { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 8px 12px 8px 14px; border-radius: 8px; cursor: pointer;
    background: color-mix(in srgb, var(--f, var(--signal)) 10%, var(--flaeche)); box-shadow: inset 3px 0 0 var(--f, var(--signal)); }
  .ppl-karte.vorbei { opacity: .6; }
  .ppl-karte-titel { font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
  .ppl-karte-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; font-size: 13.5px; color: var(--text-2); }
  .ppl-mini { display: inline-grid; grid-template-columns: repeat(var(--n, 5), 11px); gap: 3px; padding-bottom: 4px; }
  .ppl-mini > i { position: relative; height: 8px; border-radius: 2px; background: var(--rand); }
  .ppl-mini > i.an { background: var(--f, var(--signal)); }
  .ppl-mini > i.vorbei { background: color-mix(in srgb, var(--f, var(--signal)) 35%, var(--flaeche)); }
  .ppl-mini > i.rot { background: var(--ppl-rot-text); }
  .ppl-mini > i.gelb { background: var(--gelb); }
  .ppl-mini > i.heute::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; border-radius: 1px; background: var(--signal); }
  .ppl-karte-abw { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
  .ppl-karte-abw > .ppl-abw { white-space: normal; font-size: 12.5px; }
  /* rote Links mindestens 40 px hoch (Grundsatz Handy): Abweichungen, „! 1 offen“ im Kopf der Karte, Namen unter „Noch frei“ */
  :is(.ppl-karte-abw, .ppl-karte-zeile) > a.ppl-abw { min-height: 40px; padding: 0 12px; }
  .ppl-nf-liste > li { padding: 0; }
  .ppl-nf-wer { align-items: center; }
  .ppl-nf-wer > a { display: inline-flex; align-items: center; min-height: 40px; }
  .ppl-nf-wer > .ppl-nf-name { display: inline-flex; align-items: center; min-height: 32px; }
  .ppl-nf-mehr > summary, .ppl-ml-frei > a { display: inline-flex; align-items: center; min-height: 40px; }
  .ppl-abw-zeile { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; font-size: 12.5px; color: var(--text-2); }
  /* Tag am Handy: dieselben Zeilen als Karten (Titel bricht um); „Noch frei“ unter dem Plan */
  .ppl-tg-zeile .ppl-balken-titel { white-space: normal; overflow-wrap: anywhere; }
  .ppl-tg-zeile .ppl-leute a.ppl-abw { min-height: 40px; padding: 0 12px; white-space: normal; }
  .ppl-nf { margin-top: 16px; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--rand); }
  /* „Wo bin ich morgen?“: Tag über dem Inhalt; „Ersten freien Termin finden“ und „Übernehmen“ über die volle Breite */
  .ppl-morgen-tag { flex-direction: column; gap: 6px; }
  .ppl-morgen-wann { flex: none; flex-direction: row; align-items: baseline; gap: 8px; }
  .ppl-morgen-was { align-self: stretch; }
  :is(.ppl-freier-termin, .ppl-ft-ergebnis) > .aktionen-zeile > .knopf { flex: 1 1 100%; justify-content: center; }
  /* Etappe 2: Umschalter in eigener Zeile über die volle Breite; Monat als Liste je KW; Jahr gedreht (KW als Zeilen, Kalender als
     Spalten — --r/--c vertauscht, Spaltenzahl = Kalender + Alle); Tag bleibt die Liste */
  .ppl-plan-kopf > .ansicht-umschalter { flex: 1 1 100%; }
  /* Drucken (A4 quer) ist am Handy ohne Nutzen */
  .seiten-kopf-aktionen :is(.ppl-drucken, [data-bereich-aktion]:has(> .ppl-drucken:only-child)) { display: none; }
  .ppl-monat { display: none; }
  .ppl-monat-liste { display: flex; flex-direction: column; gap: 12px; }
  .ppl-jahr-raster { grid-template-columns: 52px repeat(var(--reihen), minmax(0, 1fr)); }
  .ppl-jahr-raster > * { grid-row: var(--c); grid-column: var(--r); }
  .ppl-jahr-name { flex-direction: column; flex-wrap: nowrap; justify-content: flex-end; gap: 2px; padding: 0 0 4px; font-size: 11.5px; text-align: center; }
  .ppl-jahr-name-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .ppl-jahr-nf-name > .ppl-jahr-name-text { display: flex; }
  .ppl-jahr-name > .feld-hilfe { text-align: left; }
  .ppl-jahr-kw { align-items: center; justify-content: flex-start; padding: 0 0 0 4px; }
  .ppl-jahr-kw.heute { box-shadow: inset 3px 0 0 var(--signal); padding-left: 7px; }
  :is(.ppl-jahr-zelle, .ppl-jahr-nf) { height: 40px; font-size: 13px; }
  /* mehr als 4 Kalender: am Handy nur „Noch frei“ und ein roter „!“, wenn irgendein Kalender handeln muss (einzelne Kalender über
     die Auswahl im Filter) */
  .ppl-jahr-viele .ppl-jahr-raster { grid-template-columns: 52px minmax(0, 1fr); }
  .ppl-jahr-viele :is(.ppl-jahr-name:not(.ppl-jahr-nf-name), .ppl-jahr-zelle) { display: none; }
  .ppl-jahr-viele :is(.ppl-jahr-nf-name, .ppl-jahr-nf) { grid-column: 2; }
  .ppl-jahr-viele .ppl-jahr-rot-handy { position: static; display: inline-flex; margin-left: 8px; }
}

/* === Such-Auswahl (assets/auswahl.js) === */
/* Auswahllisten ab 15 Einträgen und Fernsuchfelder (data-quelle, auswahl_quelle_html): Textfeld mit Trefferliste, das Select
   bleibt optisch versteckt im Formular und trägt den Wert. Liste am Desktop schwebend unter dem Feld (volle Feldbreite), in
   Bereichen mit eigenem Scrollen (.im-fluss, z. B. Tabellen mit Querscroll) und am Handy im Fluss direkt darunter.
   Trefferzeilen ≥ 44 px, langer Text bricht um (kein Querwischen). Farben nur über die Variablen.
   .nur-vorleser: für Vorleser und Formular da, auf dem Bildschirm unsichtbar. !important wie bei [hidden] — die Klasse muss
   jede Komponentenregel schlagen, die einem Select Breite, Rand oder Position gibt (.zeilen-formular > label > select …),
   sonst ragte das versteckte Select am Handy über den Rand. */
.nur-vorleser { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; max-width: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
.auswahl-feld { position: relative; min-width: 0; }
/* Handy: beim Fokus rollt das Feld nach oben (auswahl.js) — unter der klebenden Kopfleiste (56 px) bleibt die Beschriftung sichtbar */
.auswahl-feld > .auswahl-eingabe { scroll-margin-top: 88px; }
label > .auswahl-feld { display: block; width: 100%; margin-top: var(--beschriftung-abstand); font-weight: 400; }
/* Flex-Labels: Abstand gibt das gap; volle Breite auch mit .feld-kurz/.feld-mittel (die das Select mitgibt) — wie dort das Select */
:is(.zeilen-formular, .such-felder, .aktionen-zeile) > label > .auswahl-feld { flex: 0 0 100%; width: 100%; max-width: 100%; margin-top: 0; }
.matrix-felder > label > .auswahl-feld { margin-top: 0; }
:is(.aktionen-zeile, .inline-formular, .such-zeile, .filter-zeile) > .auswahl-feld { flex: 1 1 220px; }
.auswahl-feld > .auswahl-eingabe { display: block; width: 100%; padding-right: 40px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; }
.auswahl-feld.hat-wert > .auswahl-eingabe { background-image: none; }
.auswahl-leeren { position: absolute; top: 0; right: 0; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: var(--feld-hoehe); margin: 0; padding: 0;
  border: 0; border-radius: 0 var(--radius) var(--radius) 0; background: none; color: var(--text-schwach); font-size: 14px; line-height: 1; cursor: pointer; }
.auswahl-leeren:hover, .auswahl-leeren:focus-visible { color: var(--text); background: var(--flaeche-still); }
.auswahl-liste { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 15; max-height: min(360px, 60vh); overflow-y: auto; overscroll-behavior: contain; padding: 4px 0;
  background: var(--flaeche); border: 1px solid var(--rand-stark); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(15, 23, 42, .14); text-align: left; }
.auswahl-feld.im-fluss > .auswahl-liste { position: static; margin-top: 4px; box-shadow: none; }
.auswahl-gruppe { padding: 10px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-schwach); }
/* Trennlinie vor Einträgen ohne Gruppe nach einer Gruppe bzw. zwischen leerer Wahl, „oben“ und „+ neu“ (auswahl.js zeichnen) */
.auswahl-trenner { height: 0; margin: 4px 0; border-top: 1px solid var(--rand-weich); }
.auswahl-treffer { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; min-height: 44px; padding: 8px 12px; font-size: 14.5px; font-weight: 400; line-height: 1.35; color: var(--text); cursor: pointer; overflow-wrap: anywhere; }
.auswahl-titel { flex: 1 1 12em; min-width: 0; }
.auswahl-info { flex: 0 1 auto; margin-left: auto; font-size: 12.5px; color: var(--text-schwach); }
.auswahl-treffer:hover { background: var(--flaeche-still); }
.auswahl-treffer.aktiv { background: var(--flaeche-aktiv); color: var(--signal); }
.auswahl-treffer.gewaehlt { font-weight: 600; }
.auswahl-treffer.gewaehlt > .auswahl-titel::after { content: ' ✓'; color: var(--signal); }
.auswahl-treffer[aria-disabled="true"] { color: var(--text-still); cursor: default; background: none; }
.auswahl-treffer.auswahl-neu { color: var(--signal); font-weight: 600; }
.auswahl-hinweis { padding: 10px 12px; font-size: 13px; font-weight: 400; color: var(--text-schwach); }
.auswahl-neu-hinweis { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--signal); }
/* Vorbelegte Zuordnung als feste Zeile („Für Ticket #12 … ✕“, bezug_suchfeld_html) — ✕ öffnet die Suche */
.auswahl-fest { display: flex; align-items: center; gap: 8px; min-height: var(--feld-hoehe); padding: 3px 3px 3px 12px; border: 1px solid var(--signal-rand); border-radius: var(--radius);
  background: var(--flaeche-aktiv); font-size: 14.5px; font-weight: 600; color: var(--text); }
.auswahl-fest > span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.auswahl-fest-weg { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: var(--radius);
  background: none; color: var(--text-schwach); font-size: 14px; cursor: pointer; }
.auswahl-fest-weg:hover, .auswahl-fest-weg:focus-visible { color: var(--text); background: var(--flaeche); }
/* Pflicht-Stern auch, wenn das Pflichtfeld im Rahmen steckt (Fernsuche) — wie label:has(> [required]) */
label:has(> .auswahl-feld > .auswahl-eingabe[required]) { position: relative; }
label:has(> .auswahl-feld > .auswahl-eingabe[required])::before { content: '*'; position: absolute; right: 0; top: 0; color: var(--gefahr); font-weight: 700; font-size: 14px; line-height: 1.3; }
@media (max-width: 767px) {
  /* Handy: Liste im Fluss direkt unter dem Feld (Tastatur verdeckt sonst die schwebende Liste), Schrift 16 px, ✕ 44 px breit */
  .auswahl-feld > .auswahl-liste { position: static; margin-top: 4px; max-height: 50vh; box-shadow: none; }
  :is(.aktionen-zeile, .inline-formular) > .auswahl-feld { flex: 1 1 140px; min-width: 0; }   /* wie dort ein Select: Knopf bleibt daneben */
  /* Offene Liste in einer Zeile mit Knopf (Scan-Seite: „Code oder Name“ + „Kamera“): Der Knopf bleibt oben neben dem Feld statt an
     das Listenende zu rutschen, und die Liste nimmt unter beiden die volle Zeilenbreite (100cqw der Zeile; das Feld steht als
     erstes links, so endet sie genau am rechten Rand) — vorher stand sie in halber Breite und jeder Treffer brach dreimal um */
  :is(.aktionen-zeile, .inline-formular):has(> .auswahl-feld:first-child > .auswahl-liste:not([hidden])) { container-type: inline-size; width: 100%; }
  :is(.aktionen-zeile, .inline-formular):has(> .auswahl-feld > .auswahl-liste:not([hidden])) > :is(.knopf, button, .aktion-icon) { align-self: flex-start; }
  :is(.aktionen-zeile, .inline-formular) > .auswahl-feld:first-child > .auswahl-liste { width: 100cqw; max-width: none; }
  .auswahl-treffer { font-size: 16px; }
  .auswahl-leeren { width: 44px; }
  .auswahl-fest-weg { width: 40px; height: 40px; }
}

/* === Bestand wählen (Lager: Herkunft beim Ausbuchen, Umbuchen, Reservieren) === */
/* Markup aus lager_platz_karten_html() (module/lager/lager.php): <div class="platz-wahl"> mit je Platz
   <label class="platz-karte"><input type="radio" name="platz" …><span class="platz-karte-titel">Lager · Lagerort</span>
   <span class="platz-karte-menge">12 m</span><span class="platz-karte-hinweis">ältester Bestand · 3 m reserviert</span></label>.
   .platz-karte.inaktiv = nicht wählbar; nur ein Platz: feste Zeile <div class="platz-einzeln"> (gleiche Kinder, ohne Radio).
   Karten ≥ 44 px, am Handy eine Spalte, Text bricht um. */
.platz-wahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px; margin-top: var(--beschriftung-abstand); }
.platz-karte { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-width: 0; min-height: 44px; margin: 0; padding: 10px 12px;
  border: 1px solid var(--rand-stark); border-radius: var(--radius); background: var(--flaeche); font-size: 14.5px; font-weight: 400; line-height: 1.35; color: var(--text); cursor: pointer; }
.platz-karte > input[type=radio] { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--signal); }
label.platz-karte:has(> [required])::before { content: none; }   /* Pflicht ist die Gruppe, kein Stern je Karte */
.platz-karte-titel { flex: 1 1 10em; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.platz-karte-menge { flex: none; margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.platz-karte-hinweis { flex: 1 1 100%; padding-left: 28px; font-size: 12.5px; color: var(--text-schwach); overflow-wrap: anywhere; }
.platz-karte:hover { border-color: var(--signal-rand); }
.platz-karte:has(> input:checked) { border-color: var(--signal); background: var(--flaeche-aktiv); box-shadow: 0 0 0 3px var(--fokus-ring); }
.platz-karte:has(> input:focus-visible) { outline: 2px solid var(--fokus); outline-offset: 2px; }
.platz-karte.inaktiv { opacity: .55; cursor: not-allowed; background: var(--container); }
.platz-einzeln { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-height: 44px; margin-top: var(--beschriftung-abstand); padding: 10px 12px;
  border: 1px solid var(--rand); border-radius: var(--radius); background: var(--container); font-size: 14.5px; line-height: 1.35; color: var(--text); }
.platz-einzeln > .platz-karte-hinweis { padding-left: 0; }
/* Hülle <details class="platz-aendern"> aus lager_platz_karten_html() ohne eigene Box: Bei genau einem Platz ist die Zeile
   .platz-einzeln (summary) der Aufklapper „Aus: … — ändern“, bei mehreren ist sie verborgen und die Karten stehen offen. */
details.platz-aendern { border: 0; border-radius: 0; background: none; }
details.platz-aendern > summary.platz-einzeln { font-weight: 400; color: var(--text); }
details.platz-aendern > summary.platz-einzeln::before { content: none; }
details.platz-aendern[open] > summary.platz-einzeln { border: 1px solid var(--rand); border-radius: var(--radius); }
details.platz-aendern > .platz-wahl { padding: 0; }
.platz-aendern-link { color: var(--signal); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* === Wahlknöpfe (Scan-Seite: Einbuchen · Ausbuchen · Umbuchen …) === */
/* <div class="wahl-knoepfe" role="group" aria-label="…"> mit Knöpfen (.knopf.knopf-neutral, aria-pressed="true" = gewählt) oder
   <label><input type="radio" name="…"> Ausbuchen</label>. Am Handy zwei je Zeile, 56 px hoch, ohne Querwischen. */
.wahl-knoepfe { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.wahl-knoepfe > :is(.knopf, button, label) { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: var(--knopf-hoehe); margin: 0; padding: 8px 14px;
  text-align: center; white-space: normal; overflow-wrap: anywhere; }
.wahl-knoepfe > label { border: 1px solid var(--rand-stark); border-radius: var(--radius); background: var(--flaeche); font-size: 14.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.wahl-knoepfe > label > input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.wahl-knoepfe > label:has(> [required])::before { content: none; }
.wahl-knoepfe > :is(.knopf, button)[aria-pressed="true"], .wahl-knoepfe > label:has(> input:checked) { border-color: var(--signal); background: var(--flaeche-aktiv); color: var(--signal); }
.wahl-knoepfe > label:has(> input:focus-visible) { outline: 2px solid var(--fokus); outline-offset: 2px; }
/* Inventur: Variantenwahl bzw. Trefferliste unter dem Scanfeld (portal/lager/inventur.php) — der Knopf wächst mit dem Text,
   Nummer bzw. Bestand stehen als zweite Zeile darunter; am Desktop breitere Spalten */
.inventur-wahl .wahl-knoepfe > .knopf { height: auto; flex-wrap: wrap; row-gap: 2px; line-height: 1.25; }
.inventur-wahl .wahl-knoepfe > .knopf > .klein { flex-basis: 100%; }
@media (min-width: 768px) { .inventur-wahl .wahl-knoepfe { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
@media (max-width: 767px) { .inventur-wahl .wahl-knoepfe.inventur-treffer { grid-template-columns: 1fr; } }   /* lange Treffer: einer je Zeile */

/* === Klebende Absendeleiste (Handy) === */
/* <div class="aktionen-zeile leiste-klebend">: am Handy bleibt „Buchen“ unten am Bildschirmrand stehen, solange das Formular zu
   sehen ist (sticky innerhalb seines Blocks) — kein Wischen zum Knopf. Am Desktop eine normale Knopfzeile. */
@media (max-width: 767px) {
  .wahl-knoepfe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wahl-knoepfe > :is(.knopf, button, label) { min-height: 56px; font-size: 16px; }
  .leiste-klebend { position: sticky; bottom: 0; z-index: 10; padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--flaeche);
    border-top: 1px solid var(--rand); box-shadow: 0 -6px 16px rgba(15, 23, 42, .06); }
  .leiste-klebend > :is(.knopf, button) { flex: 1 1 auto; justify-content: center; }
}

/* === Aufklappbare Unterzeilen (Artikelliste: Varianten mit Bestand je Variante und je Lager) === */
/* <details class="unterzeilen"><summary>3 Varianten</summary><div class="unterzeile"><span class="unterzeile-titel">Rot, 50 m</span>
   <span class="unterzeile-wert">12 m</span><span class="unterzeile-info">Halle A 8 m · Werkstattwagen 4 m</span></div>…</details>
   in einer Tabellenzelle oder Karte, ohne Skript. Tabellen mit eigener Zeile je Variante: <tr class="unterzeile"> (eingerückt, grau). */
details.unterzeilen { margin-top: 6px; border: 0; border-radius: 0; background: none; }
.unterzeilen > summary { display: inline-flex; min-height: 32px; padding: 4px 6px 4px 0; border: 0; font-size: 13px; color: var(--signal); }
.unterzeilen[open] > summary { border-bottom: 0; }
.unterzeilen > summary:hover { background: none; color: var(--primaer-dunkel); }
.unterzeilen > :not(summary) { padding: 0; margin: 0; }
:is(div, a).unterzeile { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 6px 0 6px 14px; border-top: 1px solid var(--rand-weich); font-size: 13.5px; color: var(--text); }
.unterzeile-titel { flex: 1 1 10em; min-width: 0; overflow-wrap: anywhere; }
.unterzeile-wert { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.unterzeile-info { flex: 1 1 100%; font-size: 12.5px; color: var(--text-schwach); overflow-wrap: anywhere; }
tr.unterzeile > td { background: var(--container); font-size: 13.5px; }
tr.unterzeile > td:first-child { padding-left: 28px; }
@media (max-width: 767px) { .unterzeilen > summary { min-height: 40px; } }
/* Lager-Artikel: Unterzeile als Link (ganze Zeile tippbar, öffnet die Variante), „⋯“ → Hier entnehmen in der Zeile eines
   Lagerorts (zeilen_menue() ohne Hülle), Suchtreffer bzw. gewählte Variante markiert (.lager-markiert an Unter- oder Listenzeile) */
a.unterzeile { padding-right: 8px; text-decoration: none; }
a.unterzeile:hover { background: var(--container); }
.unterzeile > .zeilen-menue { flex: none; align-self: center; }
/* Bestand je Variante (Artikel → Überblick): Gibt es „hier entnehmen“, hält eine Zeile ohne den Knopf (z. B. Minusbestand) seinen
   Platz frei — die Mengen stehen bündig untereinander (vorher sprangen sie um die Knopfbreite); Ort, Menge und Knopf mittig auf
   einer Linie (vorher Text oben, Knopf 8 px tiefer). „Bestand · verfügbar“ je Variante gleich breit, also überall an derselben Stelle. */
#bestaende:has(.unterzeile > .zeilen-menue) .unterzeile { align-items: center; }
#bestaende:has(.unterzeile > .zeilen-menue) .unterzeile:not(:has(> .zeilen-menue))::after { content: ''; flex: none; order: 1; width: var(--icon-knopf-hoehe); height: var(--icon-knopf-hoehe); }
.unterzeile > .unterzeile-info { order: 2; }
@media (min-width: 768px) { .lager-var-zeile > .liste-werte > div { min-width: 6.5em; } }
:is(.unterzeile, .liste-zeile).lager-markiert { background: var(--flaeche-aktiv); box-shadow: inset 3px 0 0 var(--signal); }
.liste-zeile.lager-markiert { padding-left: 14px; padding-right: 8px; }

/* === Lager: Buchen (portal/lager/buchen.php) === */
/* Feldgruppe .buchen-feld: Überschrift (.buchen-titel bzw. <label for>) wie eine Beschriftung, 8 px darunter das Feld (Karten
   „Woher?“, Ziel, Menge mit −/+). Bei genau einem Platz ist die Zeile „Aus: … — ändern“ selbst die Überschrift. */
.buchen-feld > .buchen-titel { display: block; font-weight: 600; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.buchen-feld > :is(.buchen-titel, label:first-child) + :is(.scan-menge, .buchen-leer, .buchen-zielkarten) { margin-top: var(--beschriftung-abstand); }
.buchen-herkunft:has(> .platz-auswahl summary.platz-einzeln:not([hidden])) > .buchen-titel { display: none; }
.buchen-herkunft:has(> .platz-auswahl summary.platz-einzeln:not([hidden])) > .platz-auswahl > details > summary.platz-einzeln { margin-top: 0; }
.buchen-feld > .buchen-anders, .buchen-feld > .buchen-liegt, .buchen-feld > .platz-hinweis { margin-top: 12px; }
.buchen-feld > .buchen-korrektur-hinweis { margin-top: 8px; min-height: 1.4em; }
.buchen-korrektur-hinweis.buchen-warnung, .buchen-code-hinweis { color: #92400e; }
.buchen-jetzt { font-weight: 400; color: var(--text-schwach); }
.buchen-leer { margin: 0; }
/* Fester Artikel bzw. feste Variante (Reservierung, Rückgabe): die Zeile unter der Beschriftung, nicht daneben */
.zeilen-formular > label > .auswahl-fest { flex: 0 0 100%; min-width: 0; }
.platz-auswahl .platz-leer a { font-weight: 600; }
/* „liegt bereits in“: antippbare Chips setzen das Ziel beim Einbuchen */
.buchen-liegt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.buchen-liegt > .chip { margin: 0; }
.buchen-liegt > .chip[hidden] { display: none; }
/* Menge mit −/+: am Desktop nicht über die ganze Kartenbreite (das Feld stand sonst 1.000 px breit zwischen den Knöpfen) */
.buchen-feld > .scan-menge { max-width: 380px; }
/* „alles (5 Rl)“ beim Umlagern: Text statt Symbol — nicht die 52-px-Breite der −/+-Knöpfe */
.scan-menge > .knopf.buchen-alles { flex: 0 0 auto; width: auto; padding: 0 14px; font-size: 14px; }
/* Reservierte Ware: gelber Kasten mit Haken „trotzdem nehmen“ */
.buchen-konflikt > .kontrollkaestchen { margin-top: 10px; font-weight: 600; color: inherit; }
/* „Mehr“ im Formular: Kasten mit Abstand unten; die Kurzliste rechts neben „Mehr“ in grau */
.formular-karte form > details.buchen-mehr[open] { padding-bottom: var(--karte-innen); }
.buchen-mehr > summary { flex-wrap: wrap; gap: 4px 10px; }
.buchen-mehr-was { font-size: 13px; font-weight: 400; color: var(--text-schwach); }
.buchen-kurz { display: none; }
@media (max-width: 767px) {
  /* Klebende Leiste in EINER Zeile: „Ausbuchen“ | „& nächster Artikel“ (Kurztext). „Abbrechen“ entfällt dort — derselbe Weg
     steht oben als Rückweg im Seitenkopf (‹ Lager bzw. ‹ Ticket …); drei Knöpfe brauchten am Handy drei Zeilen */
  .buchen-formular > .leiste-klebend { flex-wrap: nowrap; }
  .buchen-formular > .leiste-klebend > :is(.knopf, button) { flex: 1 1 0; min-width: 0; padding: 0 10px; }
  .buchen-formular > .leiste-klebend > a.knopf { display: none; }
  .buchen-lang { display: none; }
  .buchen-kurz { display: inline; }
  .scan-menge > .knopf.buchen-alles { padding: 0 10px; }
  /* Support-Knopf über der klebenden Leiste statt auf „& nächster Artikel“ — nur solange sie unten klebt (Klasse setzt das
     Seitenskript); steht die Leiste am Formularende, reicht der Abstand unter dem Inhalt („Mobil: Lager“) */
  body.buchen-leiste-klebt .support-fab { bottom: 84px; }
}

/* === Lager: Einbuchen kennt offene Bestellungen (portal/lager/buchen.php, Paket P10) === */
/* Blauer Kasten „Offen bestellt: B-00012 bei … – 10 Rl offen, Termin 08.10.“ mit Knopf „Diese Lieferung zu B-00012 buchen“
   rechts daneben (Handy: darunter, volle Breite); Haken „ohne Bestellung“ / „Mehrlieferung bestätigt“ darunter */
.buchen-bestellt { display: grid; gap: 10px; }
.buchen-bestellt[hidden], .buchen-bestellt-zeile[hidden] { display: none; }
.buchen-bestellt-zeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.buchen-bestellt-text { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.buchen-bestellt-text > .kontrollkaestchen { display: flex; margin-top: 6px; color: inherit; }
.buchen-bestellt > .kontrollkaestchen { color: inherit; font-weight: 600; }
.buchen-bestellt-zeile > .knopf { flex: 0 0 auto; }
.buchen-feld + .buchen-bestellt, .buchen-bestellt + .buchen-mehr { margin-top: var(--formular-abstand); }
.buchen-preis-warnung { margin: 0; color: #92400e; }
/* Einkauf → Wareneingang: unter dem Preis je Position der Haken „als neuen Einkaufspreis übernehmen“ (nur bei Abweichung)
   und die Tippfehler-Warnung — linksbündig unter dem Feld; am Handy nimmt die Preiszelle dann die ganze Kartenbreite */
.we-preis-zelle > .kontrollkaestchen { margin-top: 6px; text-align: left; }
.we-preis-zelle > .we-preis-warn { display: block; margin-top: 4px; text-align: left; color: #92400e; }
.we-preis-zelle > .we-preis-warn[hidden] { display: none; }
/* Bestellung (einkauf.php?zeige=): die Status-Kachel ist Text („teilweise geliefert“, „bestellt / versendet“) — sie bricht
   um, statt am Handy mit „teilweise g…“ abgeschnitten zu werden; die Zahlen-Kacheln bleiben einzeilig */
.lager-bestell-kacheln > .stat-karte:first-child .stat-wert { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .buchen-bestellt-zeile > .knopf { flex: 1 1 100%; justify-content: center; white-space: normal; height: auto; min-height: var(--knopf-klein-hoehe); }
  .tabelle.tk.lager-raster tr > td.we-preis-zelle:has(> .we-preis-neu:not([hidden]), > .we-preis-warn:not([hidden])) { grid-column: 1 / -1; }
}

/* === Lager: Verleih (portal/lager/bewegungen.php → Reiter „Verleih“, Paket P11) === */
/* Rückgabe bzw. „Rest als verbraucht“: das Formular steht unter der Zeile, um die es geht (Zeile .hervorgehoben), so breit
   wie die Zeile — Felder im Raster, Knöpfe auf einer Linie */
.liste-zeile > .verleih-formular { flex: 1 1 100%; min-width: 0; display: grid; gap: var(--formular-abstand); margin: 0; }
.verleih-formular > :is(p, .zeilen-formular, .wahl-knoepfe, .aktionen-zeile) { margin: 0; }

/* === Lager: Werkstatt-Entnahme (portal/lager/scan.php mit Zuordnung, Paket D9a) === */
/* Feste Zuordnung („Für Arbeitsauftrag A-… ✕“, bezug_suchfeld_html): das ✕ des verdeckten Suchfelds (assets/auswahl.js,
   sichtbar, weil die Zuordnung gewählt ist) lag als zweites ✕ über der Zeile. Nach ✕ an der Zeile ist sie weg — dann gilt
   wieder das ✕ des Suchfelds. */
.auswahl-feld:has(> .auswahl-fest) > .auswahl-leeren { display: none; }
