/* Serakis, Büro-Oberfläche (B-25): Graphit und Papierweiß der Marke, Schrift Outfit (lokal, OFL). Farbe gibt es nur
   dort, wo ein Modul gemeint ist (`data-modul`, Abschnitt „Marke Serakis“ am Ende); Hauptaktion und Fokus sind
   Graphit. Strenger als am Desktop, weil auch am Handy auf der Baustelle bedient wird: Felder und Knöpfe ab 48 px,
   Eingaben 18 px, Fließtext mindestens 7:1. Am Büro-Desktop mit Maus (ab 1024 px) gelten Dichte und AA-Kontrast
   (B-23, B-24). Alles aus eigenen Dateien (CSP: style-src 'self', img-src 'self' data:). */

@font-face {
  font-family: "Outfit";
  src: url("/fonts/Outfit-LatinExt.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Outfit";
  src: url("/fonts/Outfit-Latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Graphit-Skala der Marke (Graphit #2b2a28, Papierweiß #f7f7f5) */
  --graphit-950: #1f1e1c;
  --graphit-900: #2b2a28;
  --graphit-800: #3a3935;
  --graphit-700: #4a4945;
  --graphit-600: #5d5b56;
  --graphit-300: #bdbab3;
  --graphit-200: #dedcd6;
  --graphit-100: #ebeae6;
  --graphit-50: #f4f3f0;

  /* Hauptaktion und Fokus: Graphit. Farbe gibt es nur mit Modulbezug (siehe „Marke Serakis“ am Ende). */
  --accent: #2b2a28;
  --accent-ink: #ffffff;             /* Weiß darauf 14:1 */
  --accent-hover: #151412;
  --accent-press: #000000;
  --accent-line: #2b2a28;

  --color-primary: var(--graphit-900);   /* Hauptaktion: Weiß darauf 14:1 */
  --color-primary-hover: #151412;
  --color-primary-contrast: #ffffff;
  --color-secondary: #ffffff;
  --color-secondary-hover: var(--graphit-50);
  --color-secondary-contrast: #2b2a28;
  --color-bg: #f7f7f5;
  --color-surface: #ffffff;
  --color-text: #2b2a28;             /* 14:1 auf Weiß */
  --color-text-muted: #4d4b46;       /* 8.3:1 auf Weiß, 7.7:1 auf bg: Fließtext mindestens 7:1 (PROJECT.md § 9.6) */
  --color-border: var(--graphit-200);   /* nur Gliederung */
  --color-border-strong: #7a7872;    /* Felder und Knöpfe: 4.0:1 auf Weiß */
  --color-soft: var(--graphit-100);
  --color-focus: var(--graphit-900);
  --color-danger: #a1251b;           /* nur Fehler und Entziehen: 7.0:1 auf Weiß */
  --color-success: #2e6b3a;

  /* Navigationsleiste (Handy-Menü) */
  --leiste-bg: var(--graphit-900);
  --leiste-text: #f0efec;            /* 12:1 auf Graphit */
  --leiste-hover: var(--graphit-800);
  --leiste-border: #6b6963;
  --leiste-muted: #c4c1ba;           /* 8.2:1 auf Graphit */

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-full: 9999px;

  --font-body: "Outfit", system-ui, sans-serif;

  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;

  --touch: 3.5rem;      /* 56 px: Hauptaktion */
  --touch-min: 3rem;    /* 48 px: kleinste Klickfläche */
  --feld: 3.25rem;      /* 52 px: Eingabefelder */
  --leiste-breite: 17rem;  /* 272 px; am Büro-Desktop 232 px (T-026) */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: 1.45;
  color: var(--color-text);
  background: var(--color-bg);
  accent-color: var(--color-primary);
  caret-color: var(--color-primary);
}

::selection { background: var(--color-primary); color: var(--color-primary-contrast); }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--color-border-strong) transparent; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

h1, h2 { margin: 0; font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
/* Betriebsnamen und E-Mail-Adressen kommen von außen und können lang sein: nie breiter als der Bildschirm */
h1, h2, p, label { overflow-wrap: anywhere; }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-xl); }
p { margin: 0; max-width: 65ch; }
a { color: var(--color-text); text-underline-offset: 0.2em; }

/* ---------- Rahmen ---------- */

.sprung {
  position: absolute; left: var(--space-2); top: -4rem; z-index: 10;
  padding: var(--space-3) var(--space-4); background: var(--color-text); color: var(--color-bg);
  border-radius: var(--radius-sm);
}
.sprung:focus { top: var(--space-2); }

.kopf {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: 4rem; padding: var(--space-2) var(--space-4);
  background: var(--leiste-bg); color: var(--leiste-text);
}
.kopf :focus-visible { outline-color: #fff; }
.kopf .knopf { background: transparent; border-color: var(--leiste-border); color: inherit; }
.kopf .knopf:hover, .kopf .knopf:active { background: var(--leiste-hover); }
.kopf form { margin: 0; }

main { max-width: 64rem; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-12); }

/* ---------- Karte ---------- */

.karte {
  min-width: 0;
  display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-6);
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(21, 23, 26, 0.06);
}
.karte.schmal { max-width: 30rem; margin: var(--space-8) auto 0; }
.karte > h1 { font-size: var(--text-2xl); }

/* Markenkopf in der Karte der Gastseiten */
.karten-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); padding-bottom: var(--space-4); border-bottom: 1px solid var(--color-border); }
.karten-untertitel { color: var(--color-text-muted); font-size: var(--text-base); font-weight: 500; }

/* ---------- Formular ---------- */

.formular { display: flex; flex-direction: column; gap: var(--space-4); margin: 0; }
.feld { display: flex; flex-direction: column; gap: var(--space-2); }

label { font-size: var(--text-lg); font-weight: 500; }

input[type="email"], input[type="password"], input[type="text"], select {
  width: 100%; min-height: var(--feld); padding: 0 var(--space-3);
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  transition: border-color 150ms, box-shadow 150ms;
}
input:focus-visible, select:focus-visible { border-color: var(--color-focus); }
input:user-invalid { border-color: var(--color-danger); border-width: 2px; }

/* Zahlencode: sechs Felder, in einem Eingabefeld gezeichnet (Autofill und Einmalcode bleiben erhalten).
   Ziffern sind tabellarisch, jede Stelle bekommt dieselbe Breite, Trennlinien liegen im Hintergrund. */
input.code {
  --stelle: 2.5rem;
  min-height: 3.75rem; padding: 0 0 0 calc((var(--stelle) - 1ch) / 2); font-size: 1.75rem; font-weight: 600;
  text-align: left; font-variant-numeric: tabular-nums;
  letter-spacing: calc(var(--stelle) - 1ch);
  width: calc(var(--stelle) * 6 + 2px); max-width: 100%;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(var(--stelle) - 1px), var(--color-border) calc(var(--stelle) - 1px) var(--stelle)),
    var(--color-surface);
}

.hilfe { font-size: var(--text-base); color: var(--color-text-muted); }
.hilfe.unten { padding-top: var(--space-4); border-top: 1px solid var(--color-border); }

/* ---------- Knöpfe ---------- */

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--touch-min); padding: 0 var(--space-4);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  background: var(--color-secondary); color: var(--color-secondary-contrast);
  font-size: var(--text-lg); font-weight: 500; line-height: 1.2; text-align: center; text-decoration: none;
  transition: background-color 150ms, border-color 150ms, color 150ms;
}
.knopf:hover, .knopf:active { background: var(--color-secondary-hover); }
.knopf.hauptaktion {
  width: 100%; min-height: var(--touch); font-size: var(--text-xl);
  background: var(--accent); border-color: var(--accent-line); color: var(--accent-ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(21, 23, 26, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.knopf.hauptaktion:hover { background: var(--accent-hover); border-color: var(--accent-line); }
.knopf.hauptaktion:active { background: var(--accent-press); border-color: var(--accent-line); box-shadow: none; }
.knopf.hauptaktion.kompakt { width: auto; min-height: var(--touch-min); padding: 0 var(--space-6); font-size: var(--text-lg); }
.knopf[disabled] { opacity: 0.55; cursor: not-allowed; border-style: dashed; }

/* ---------- Meldungen: Icon plus Text, nie nur Farbe ---------- */

.meldung {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4); max-width: none;
  background: var(--color-surface); border: 1px solid currentColor; border-radius: var(--radius-sm);
  font-size: var(--text-lg); font-weight: 500;
}
.meldung .icon { margin-top: 0.125rem; }
.meldung.fehler { color: var(--color-danger); }
.meldung.hinweis { color: var(--color-text); border-color: var(--color-border-strong); }
.meldung.hinweis .icon { color: var(--color-primary); }

/* ---------- Icons: Dateien unter /assets/icons, in Textfarbe über mask ---------- */

.icon {
  display: inline-block; flex: none; width: 1.5rem; height: 1.5rem;
  background-color: currentColor;
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat;
}
.icon-alert { -webkit-mask-image: url("/assets/icons/alert.svg"); mask-image: url("/assets/icons/alert.svg"); }
.icon-check { -webkit-mask-image: url("/assets/icons/check.svg"); mask-image: url("/assets/icons/check.svg"); }
.icon-lock { -webkit-mask-image: url("/assets/icons/lock.svg"); mask-image: url("/assets/icons/lock.svg"); }
.icon-info { -webkit-mask-image: url("/assets/icons/info.svg"); mask-image: url("/assets/icons/info.svg"); }
.icon-logout { -webkit-mask-image: url("/assets/icons/logout.svg"); mask-image: url("/assets/icons/logout.svg"); }
.icon-chevron { -webkit-mask-image: url("/assets/icons/chevron.svg"); mask-image: url("/assets/icons/chevron.svg"); }
.icon-home { -webkit-mask-image: url("/assets/icons/home.svg"); mask-image: url("/assets/icons/home.svg"); }
.icon-users { -webkit-mask-image: url("/assets/icons/users.svg"); mask-image: url("/assets/icons/users.svg"); }
.icon-badge { -webkit-mask-image: url("/assets/icons/badge.svg"); mask-image: url("/assets/icons/badge.svg"); }
.icon-menu { -webkit-mask-image: url("/assets/icons/menu.svg"); mask-image: url("/assets/icons/menu.svg"); }
.icon-close { -webkit-mask-image: url("/assets/icons/close.svg"); mask-image: url("/assets/icons/close.svg"); }
.icon-plus { -webkit-mask-image: url("/assets/icons/plus.svg"); mask-image: url("/assets/icons/plus.svg"); }
.icon-building { -webkit-mask-image: url("/assets/icons/building.svg"); mask-image: url("/assets/icons/building.svg"); }
.icon-key { -webkit-mask-image: url("/assets/icons/key.svg"); mask-image: url("/assets/icons/key.svg"); }
.icon-support { -webkit-mask-image: url("/assets/icons/support.svg"); mask-image: url("/assets/icons/support.svg"); }
.icon-einstellungen { -webkit-mask-image: url("/assets/icons/einstellungen.svg"); mask-image: url("/assets/icons/einstellungen.svg"); }
.icon-download { -webkit-mask-image: url("/assets/icons/download.svg"); mask-image: url("/assets/icons/download.svg"); }
.icon-print { -webkit-mask-image: url("/assets/icons/print.svg"); mask-image: url("/assets/icons/print.svg"); }
.icon-upload { -webkit-mask-image: url("/assets/icons/upload.svg"); mask-image: url("/assets/icons/upload.svg"); }
.icon-chart { -webkit-mask-image: url("/assets/icons/chart.svg"); mask-image: url("/assets/icons/chart.svg"); }
.icon-switch { -webkit-mask-image: url("/assets/icons/switch.svg"); mask-image: url("/assets/icons/switch.svg"); }

/* ---------- Einladung: Schritte 1-2-3, QR-Code, Schlüssel ---------- */

.einladung-fuer { overflow-wrap: anywhere; }

.schritte { list-style: none; margin: 0; padding: 0; counter-reset: schritt; display: flex; flex-direction: column; }
.schritt {
  counter-increment: schritt;
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-6) 0; border-top: 1px solid var(--color-border);
}
.schritt:first-child { padding-top: var(--space-2); border-top: 0; }
.schritt:last-child { padding-bottom: var(--space-2); }
.schritt h2 { display: flex; align-items: center; gap: var(--space-3); }
.schritt h2::before {
  content: counter(schritt);
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: var(--radius-sm);
  background: var(--color-primary); color: var(--color-primary-contrast);
  font-size: var(--text-lg); font-weight: 500; font-variant-numeric: tabular-nums;
}

.qr-rahmen {
  align-self: flex-start; padding: var(--space-2);
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
}
svg.qr { display: block; width: 15rem; max-width: 100%; height: auto; }

.schluessel { max-width: none; }
.schluessel code {
  display: block; padding: var(--space-3) var(--space-4);
  background: var(--color-soft); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: var(--text-lg); font-weight: 600; letter-spacing: 0.08em; overflow-wrap: anywhere;
  user-select: all;
}

/* ---------- Betrieb wählen ---------- */

.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.zeile {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: var(--touch); padding: var(--space-2) var(--space-4);
  background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  font-size: var(--text-xl); font-weight: 500; text-decoration: none; overflow-wrap: anywhere;
  transition: background-color 150ms;
}
.zeile:hover, .zeile:active { background: var(--color-secondary-hover); }

/* ---------- Büro-Rahmen: Navigationsleiste links über die volle Höhe (Handy: Kopfzeile mit Menü) ---------- */

.rahmen {
  min-height: 100dvh; display: grid; grid-template-columns: var(--leiste-breite) minmax(0, 1fr); align-items: stretch;
  /* Der Hintergrund zieht die Leiste auch bei sehr langen Seiten und in Ganzseiten-Aufnahmen durch */
  background: linear-gradient(90deg, var(--leiste-bg) var(--leiste-breite), var(--color-bg) var(--leiste-breite));
}
.arbeitsflaeche > main { max-width: 76rem; width: 100%; margin: 0; padding: var(--space-8) var(--space-8) var(--space-12); }

.leiste { background: var(--leiste-bg); color: var(--leiste-text); }
.leiste-innen {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--space-6);
  padding: var(--space-6) var(--space-4);
}
.leiste :focus-visible { outline-color: #fff; }
.menue-knopf { display: none; }
.leiste-menue { flex: 1; display: flex; flex-direction: column; gap: var(--space-6); min-height: 0; }

/* Betrieb und Rolle: immer sichtbar, damit klar ist, wo gearbeitet wird */
.betrieb {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3);
  background: var(--leiste-hover); border-radius: var(--radius-md);
}
.betrieb-symbol {
  flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem;
  background: var(--graphit-950); color: var(--serakis-papierweiss); border-radius: var(--radius-sm);
}
.betrieb-text { display: flex; flex-direction: column; min-width: 0; }
.betrieb-name { color: #fff; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.betrieb-rolle { color: var(--leiste-muted); font-size: var(--text-sm); }

.leiste-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.leiste-nav a {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--touch-min); padding: 0 var(--space-3);
  border-radius: var(--radius-md); color: var(--leiste-text); text-decoration: none;
  font-size: var(--text-lg); font-weight: 500;
  transition: background-color 150ms;
}
.leiste-nav a:hover { background: var(--leiste-hover); }
.leiste-nav a .icon { color: var(--leiste-muted); }
.leiste-nav a[aria-current="page"] { background: var(--leiste-hover); color: #fff; font-weight: 600; }
.leiste-nav a[aria-current="page"] .icon { color: var(--serakis-papierweiss); }
.leiste-label { margin: 0 0 var(--space-2); padding: 0 var(--space-3); color: var(--leiste-muted); font-size: var(--text-sm); font-weight: 500; }
.leiste-nav.betriebe { padding-top: var(--space-4); border-top: 1px solid var(--leiste-hover); }
.leiste form { margin: auto 0 0; }
.knopf.leiste-knopf { width: 100%; justify-content: flex-start; background: transparent; border-color: var(--leiste-border); color: inherit; }
.knopf.leiste-knopf:hover, .knopf.leiste-knopf:active { background: var(--leiste-hover); }

/* ---------- Seitenkopf: Titel und Hauptaktion direkt auf der Arbeitsfläche ---------- */

.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3) var(--space-6); }
.seitenkopf-text { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.rolle { color: var(--color-text-muted); }

/* ---------- Büro-Start: Kacheln mit Symbol, Titel, Kurztext und Aktion ---------- */

.kacheln { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); gap: var(--space-4); }
.kachel {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4);
  padding: var(--space-6); background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(21, 23, 26, 0.06);
  transition: box-shadow 150ms, border-color 150ms;
}
.kachel:hover { border-color: var(--graphit-300); box-shadow: 0 6px 18px rgba(21, 23, 26, 0.1); }
.kachel-symbol {
  display: grid; place-items: center; width: 3rem; height: 3rem;
  background: var(--graphit-900); color: var(--serakis-papierweiss); border-radius: var(--radius-md);
}
.kachel-symbol .icon { width: 1.5rem; height: 1.5rem; }
.kachel p { margin: 0; color: var(--color-text-muted); }
.kachel .text { display: flex; flex-direction: column; gap: var(--space-1); }
.kachel-aktion {
  display: inline-flex; align-items: center; gap: var(--space-1); margin-top: auto;
  min-height: var(--touch-min); padding-right: var(--space-2);
  color: var(--color-text); font-weight: 600; text-decoration: none;
}
/* Die ganze Kachel ist die Tippfläche */
.kachel-aktion::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-md); }
.kachel-aktion:focus-visible { outline: none; }
.kachel-aktion:focus-visible::after { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.kachel-aktion .icon { transition: transform 150ms; }
.kachel:hover .kachel-aktion .icon { transform: translateX(3px); }

.leer { padding: var(--space-4); background: transparent; border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-text-muted); }

/* ---------- Icons, ergänzt für die Mitgliederseite ---------- */

.icon-copy { -webkit-mask-image: url("/assets/icons/copy.svg"); mask-image: url("/assets/icons/copy.svg"); }
.icon-back { -webkit-mask-image: url("/assets/icons/back.svg"); mask-image: url("/assets/icons/back.svg"); }

/* ---------- Mitglieder ---------- */

.seite { display: flex; flex-direction: column; gap: var(--space-4); }
.seite > .meldung { margin: 0; }
.zahl {
  display: inline-block; min-width: 1.75rem; padding: 0 var(--space-2); margin-left: var(--space-1);
  background: var(--color-soft); border-radius: var(--radius-sm);
  font-size: var(--text-base); font-weight: 500; text-align: center; font-variant-numeric: tabular-nums;
}

.aktionen { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.aktionen .knopf.hauptaktion { width: auto; flex: 1 1 14rem; }

/* Zwei Spalten: Listen links im Blick, Einladen als schmale Karte rechts */
.mitglieder-raster { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--space-6); align-items: start; }
.spalte-haupt, .spalte-neben { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.spalte-neben { position: sticky; top: var(--space-6); }

/* Rolle als große Auswahl: ganze Fläche tippbar, gewählte Kachel mit dicker Umrandung */
.rollenwahl { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.rollenwahl legend { padding: 0; margin-bottom: var(--space-2); font-size: var(--text-lg); font-weight: 500; }
.wahl {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--touch); padding: var(--space-2) var(--space-3);
  background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  cursor: pointer; transition: background-color 150ms, border-color 150ms;
}
.wahl:hover { background: var(--color-secondary-hover); }
.wahl input { flex: none; width: 1.5rem; height: 1.5rem; margin: 0; }
.wahl:has(input:checked) { border: 2px solid var(--color-primary); padding: calc(var(--space-2) - 1px) calc(var(--space-3) - 1px); background: var(--color-soft); }
.wahl:has(input:checked) .wahl-hilfe { color: var(--color-text); }
.wahl:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.wahl-text { display: flex; flex-direction: column; min-width: 0; }
.wahl-name { font-size: var(--text-lg); font-weight: 600; }
.wahl-hilfe { font-size: var(--text-sm); font-weight: 400; line-height: 1.3; color: var(--color-text-muted); }

/* Zeilen: Avatar, Adresse mit Angaben, Rolle, Knöpfe. Auf dem Handy bricht die Zeile um, Knöpfe stehen darunter. */
.mitglieder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mitglied { padding: var(--space-4) 0; border-top: 1px solid var(--color-border); }
.mitglied:first-child { border-top: 0; padding-top: 0; }
.mitglied:last-child { padding-bottom: 0; }
.mitglied-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.avatar {
  flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
  background: var(--graphit-100); color: var(--graphit-800); border-radius: var(--radius-full);
  font-size: var(--text-base); font-weight: 600; letter-spacing: 0.02em;
}
.mitglied-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; flex: 1 1 10rem; }
.adresse { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); font-size: var(--text-lg); font-weight: 500; overflow-wrap: anywhere; }
.meta { color: var(--color-text-muted); font-size: var(--text-base); overflow-wrap: anywhere; }
.rolle-tag {
  display: inline-flex; align-items: center; min-height: 1.5rem; margin-right: var(--space-1); padding: 0 var(--space-3);
  background: var(--graphit-100); border-radius: var(--radius-full);
  color: var(--graphit-800); font-size: var(--text-sm); font-weight: 600; white-space: nowrap;
}
.du {
  display: inline-flex; align-items: center; min-height: 1.5rem; padding: 0 var(--space-2);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  color: var(--color-text); font-size: var(--text-sm); font-weight: 500; white-space: nowrap;
}
.mitglied-kopf .aktionen { margin-left: auto; }

/* Aufklappfeld unter der Zeile: Rolle wählen, Entziehen bestätigen */
.panel {
  display: flex; flex-direction: column; gap: var(--space-3);
  margin-top: var(--space-3); padding: var(--space-4);
  background: var(--color-bg); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
}
.panel.gefahr { border-color: var(--color-danger); }
.panel p { max-width: none; }

.knopf.gefahr { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.knopf.gefahr:hover, .knopf.gefahr:active { background: #7f1d15; border-color: #7f1d15; }
.knopf.zurueckhaltend { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 0.2em; }
.knopf.zurueckhaltend:hover, .knopf.zurueckhaltend:active { background: var(--color-secondary-hover); }

/* Entzogene Zugänge: Überschrift ist der Schalter, Tippfläche über die ganze Zeile */
.umschalter {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: var(--touch-min);
  padding: 0; background: none; border: 0; text-align: left; font-size: inherit; font-weight: inherit; letter-spacing: inherit;
}
.umschalter .icon { transition: transform 150ms; }
.umschalter[aria-expanded="true"] .icon { transform: rotate(90deg); }
#entzogene[hidden] { display: none; }
#entzogene .leer { margin: 0; }

/* Einladungslink */
.link-karte { border: 2px solid var(--color-primary); }
#einladungslink { font-size: var(--text-base); font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
#link-ergebnis { color: var(--color-text); font-weight: 500; }
/* Leer nimmt die Statuszeile keinen Platz ein (bleibt aber im Dokument, damit Screenreader die Meldung vorlesen) */
#link-ergebnis:empty { height: 0; margin-top: calc(-1 * var(--space-4)); overflow: hidden; }

/* Bestätigungsdialog: echtes modales <dialog> */
.dialog {
  width: min(28rem, calc(100vw - 2 * var(--space-4))); max-height: calc(100dvh - 2 * var(--space-4)); overflow: auto;
  padding: var(--space-6); color: var(--color-text);
  background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(43, 42, 40, 0.28);
}
.dialog::backdrop { background: rgba(43, 42, 40, 0.6); }
.dialog .aktion-text { font-weight: 500; }
.dialog .knopf { width: 100%; }

/* ---------- Mitarbeiter (T-021) ---------- */

.mitglieder-raster.ohne-neben { grid-template-columns: minmax(0, 1fr); }
.listenkopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); }

/* Filter: zwei Knöpfe in einer Reihe, der gewählte ist graphit gefüllt */
.segment { display: inline-flex; background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segment button {
  min-height: var(--touch-min); padding: 0 var(--space-4);
  background: transparent; border: 0; font-size: var(--text-lg); font-weight: 500;
  transition: background-color 150ms, color 150ms;
}
.segment button + button { border-left: 1px solid var(--color-border-strong); }
.segment button:hover { background: var(--color-secondary-hover); }
.segment button[aria-pressed="true"] { background: var(--color-primary); color: var(--color-primary-contrast); font-weight: 600; }
.segment button:focus-visible { outline-offset: -4px; }
.segment button[aria-pressed="true"]:focus-visible { outline-color: #fff; }

.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-1); }
.rolle-tag { gap: var(--space-1); }
.rolle-tag .icon { width: 1rem; height: 1rem; }
.rolle-tag.aus { background: transparent; border: 1px solid var(--color-border-strong); color: var(--color-text); font-weight: 500; }
.mitglied.inaktiv .adresse { color: var(--color-text-muted); }

/* Feldfehler: Icon plus Satz direkt unter dem Feld, das Feld bekommt eine rote Umrandung */
.feld-fehler { display: flex; gap: var(--space-2); align-items: flex-start; color: var(--color-danger); font-size: var(--text-base); font-weight: 500; }
.feld-fehler .icon { width: 1.25rem; height: 1.25rem; margin-top: 0.125rem; }
input[aria-invalid="true"] { border-color: var(--color-danger); border-width: 2px; }

/* Zeilenaktionen der Mitarbeiterliste: der Umschaltknopf hat feste Breite, damit „Bearbeiten“ untereinander steht */
.zeile-aktionen { flex-wrap: nowrap; }
.zeile-aktionen .knopf { padding: 0 var(--space-3); }
.zeile-aktionen .knopf.umschalten { min-width: 8.5rem; }

/* Rückfragen und Formulare unter der Zeile: Knöpfe so breit wie ihr Text, am Handy volle Breite */
.panel .aktionen .knopf, .panel .aktionen .knopf.hauptaktion, .panel .aktionen .knopf.primaer { flex: 0 0 auto; width: auto; }
.panel .aktionen .knopf.hauptaktion, .panel .aktionen .knopf.primaer { padding: 0 var(--space-8); }

/* Einschränkende Rückfrage (Deaktivieren): graphit statt Akzent, der Akzent bleibt dem Anlegen, Speichern und Zuordnen */
.knopf.primaer {
  min-height: var(--touch); font-size: var(--text-xl); font-weight: 600;
  background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-contrast);
}
.knopf.primaer:hover, .knopf.primaer:active { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.knopf.primaer:focus-visible { outline-offset: 3px; }

/* Am Desktop steht die Karte „anlegen“ neben der Liste, der Schnellknopf im Kopf wäre doppelt */
@media (min-width: 70.01rem) {
  #anlegen-schnell { display: none; }
}

/* Auswahlfeld: eigener Pfeil mit Luft zum Rand statt des Systempfeils */
select {
  appearance: none; -webkit-appearance: none;
  padding-right: var(--space-12);
  background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1d20' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right var(--space-4) center / 1.25rem;
}

/* Mitgliederzeilen mit drei Knöpfen: die Knöpfe stehen in einer eigenen Reihe unter dem Text */
.mitglied-kopf .aktionen.unter { flex: 1 1 100%; margin-left: calc(2.75rem + var(--space-4)); }

/* Zuordnung eines Mitarbeiters in der Mitgliederverwaltung */
.bezug { color: var(--color-text); font-size: var(--text-base); }
.bezug-form { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; }
.bezug-form .feld { max-width: 28rem; }
option:disabled { color: var(--color-text-muted); }

/* ---------- Konto und Sicherheit, Wiederherstellungscodes (T-019a) ---------- */

.codes-stand { font-size: var(--text-xl); }
.codes-zahl { font-size: var(--text-3xl); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Kontoseite: ruhige Einstellungsbreite, Knöpfe nur so breit wie ihr Text (am Handy volle Breite) */
.karte.konto-karte { max-width: 44rem; }
.konto-karte .aktionen .knopf, .konto-karte .aktionen .knopf.hauptaktion { flex: 0 0 auto; width: auto; }
.ersetzen-frage { gap: var(--space-4); }
.ersetzen-frage .meldung { margin: 0; }

/* Ruhiger Hinweis auf der Startseite: Rahmen in Graphit, nur das Symbol und der Link tragen Gewicht */
.sicherheitshinweis { flex-wrap: wrap; align-items: center; }
.hinweis-text { flex: 1 1 18rem; }
.hinweis-link {
  display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--touch-min);
  font-weight: 600; text-underline-offset: 0.2em;
}

input.textcode {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}

.frist { flex-wrap: wrap; align-items: center; }
.frist #frist-text { flex: 1 1 12rem; }
.frist .knopf[hidden] { display: none; }

.karte.codes-karte { max-width: 42rem; margin: var(--space-8) auto 0; }
.codes {
  list-style: none; counter-reset: code; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2);
}
.codes li {
  counter-increment: code; display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--touch-min); padding: 0 var(--space-3);
  background: var(--color-soft); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
}
.codes li::before {
  content: counter(code); min-width: 1.5rem; color: var(--color-text-muted);
  font-size: var(--text-sm); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right;
}
.codes code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: var(--text-lg); font-weight: 600; letter-spacing: 0.04em; user-select: all; white-space: nowrap;
}
.codes-sichern[hidden] { display: none; }
.codes-sichern { display: flex; flex-direction: column; gap: var(--space-3); }
.codes-sichern h2 { font-size: var(--text-lg); }
.codes-aktionen .knopf { flex: 1 1 auto; }
/* Sicherungsaktionen: Graphit, kräftiger als Nebenknöpfe. Der Akzent bleibt für den Weg nach vorn. */
.knopf.sicherung {
  min-height: var(--touch); background: var(--color-primary); border-color: var(--color-primary);
  color: var(--color-primary-contrast); font-weight: 600;
}
.knopf.sicherung:hover, .knopf.sicherung:active { background: var(--color-primary-hover); }
.knopf.sicherung .icon { color: var(--serakis-papierweiss); }
.codes-status:empty { height: 0; margin-top: calc(-1 * var(--space-4)); overflow: hidden; }
.codes-status { font-weight: 500; color: var(--color-text); }
.unsichtbar { position: fixed; top: 0; left: -9999px; opacity: 0; }

/* „Fertig“ bleibt Nebenknopf, bis eine Sicherung ausgelöst ist (nur wo die Sicherungsknöpfe da sind) */
.codes-karte:has(.codes-sichern:not([hidden])) .knopf.fertig:not(.bereit) {
  min-height: var(--touch-min); font-size: var(--text-lg); font-weight: 500;
  background: var(--color-secondary); border-color: var(--color-border-strong); color: var(--color-secondary-contrast);
  box-shadow: none;
}

/* Erfolg: Rahmen und Symbol in Erfolgsgrün, Text bleibt Graphit (Kontrast) */
.meldung.erfolg { color: var(--color-text); border-color: var(--color-success); border-width: 2px; }
.meldung.erfolg .icon { color: var(--color-success); }

/* Ruhiger Textlink unter einem Formular */
.nebenlink {
  display: inline-flex; align-items: center; align-self: flex-start; min-height: var(--touch-min);
  color: var(--color-text); font-size: var(--text-base); font-weight: 500; text-underline-offset: 0.2em;
}

.druck-kopf { display: none; }

@media (max-width: 36rem) {
  .codes { grid-template-columns: minmax(0, 1fr); }
  .karte.codes-karte { margin-top: var(--space-2); }
}

/* Handy: Hauptaktionen der Kontoseite in voller Breite, bei 0 und bei offenen Codes gleich */
@media (max-width: 30rem) {
  .konto-karte .aktionen .knopf, .konto-karte .aktionen .knopf.hauptaktion { flex: 1 1 100%; }
}

/* Ausdruck: nur die Codes, auf weißem Papier, mit Marke, Konto und Datum, ohne Bedienelemente */
@media print {
  body { background: #fff; }
  .kopf, .sprung, .leiste, .codes-sichern, .codes-status, .codes-karte .knopf, .codes-karte .icon,
  .nur-bildschirm, .karten-kopf { display: none !important; }
  main { max-width: none; padding: 0; }
  .karte.codes-karte { max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .druck-kopf { display: block; padding-bottom: 12pt; border-bottom: 1px solid #000; }
  .druck-kopf p { max-width: none; margin: 0 0 4pt; color: #000; font-size: 11pt; }
  .druck-kopf .druck-marke { margin-bottom: 8pt; }
  .druck-kopf .druck-marke img { display: block; height: 24pt; width: auto; }
  .druck-kopf .druck-titel { font-size: 14pt; font-weight: 600; }
  .codes li { border-color: #000; background: #fff; break-inside: avoid; }
  .codes code { font-size: 14pt; }
}

@media (max-width: 70rem) {
  .mitglieder-raster { grid-template-columns: minmax(0, 1fr); }
  .spalte-neben { position: static; }
}

/* Handy und schmale Fenster: Kopfzeile mit Marke und Menüknopf, das Menü klappt darunter auf. Wächst mit jedem
   weiteren Modul mit, ohne dass die Kopfzeile bricht. */
@media (max-width: 60rem) {
  /* Die Kopfzeile klebt oben: Sprünge zu Feldern und Karten landen darunter */
  input, select, .karte, .mitglied, #anlegen { scroll-margin-top: 5rem; }
  .rahmen { display: block; background: var(--color-bg); }
  .arbeitsflaeche > main { padding: var(--space-6) var(--space-4) var(--space-8); }
  .leiste { position: sticky; top: 0; z-index: 5; }
  .leiste-innen { position: static; height: auto; overflow: visible; gap: 0; padding: 0; }
  .leiste-kopf { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; padding: 0 var(--space-3) 0 var(--space-4); }
  .menue-knopf {
    display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--touch-min); padding: 0 var(--space-3);
    background: transparent; border: 1px solid var(--leiste-border); border-radius: var(--radius-sm);
    color: var(--leiste-text); font-weight: 500;
  }
  .menue-knopf:hover { background: var(--leiste-hover); }
  .menue-knopf[aria-expanded="true"] .icon-menu { -webkit-mask-image: url("/assets/icons/close.svg"); mask-image: url("/assets/icons/close.svg"); }
  .leiste-menue { display: none; gap: var(--space-4); padding: var(--space-2) var(--space-4) var(--space-6); max-height: calc(100dvh - 4rem); overflow-y: auto; }
  .leiste-menue.offen { display: flex; }
  .leiste form { margin: 0; }
}

@media (max-width: 40rem) {
  .zeile-aktionen { flex-wrap: wrap; }
}

@media (max-width: 30rem) {
  main { padding: var(--space-4) var(--space-3) var(--space-8); }
  .karte { padding: var(--space-4); }
  .karte.schmal { margin-top: var(--space-2); }
  .kopf { padding: var(--space-2) var(--space-3); }
  h1 { font-size: var(--text-2xl); }
  .aktionen .knopf { flex: 1 1 auto; }
  .segment, .listenkopf .segment { display: flex; width: 100%; }
  .segment button { flex: 1 1 0; }
  .mitglied-kopf .aktionen, .mitglied-kopf .aktionen.unter { margin-left: 0; flex: 1 1 100%; }
  .panel .aktionen .knopf, .panel .aktionen .knopf.hauptaktion, .panel .aktionen .knopf.primaer { flex: 1 1 100%; }
  .dialog { padding: var(--space-4); }
}

/* ---------- Kunden und Einsatzorte (T-022) ---------- */

.icon-kunden { -webkit-mask-image: url("/assets/icons/kunden.svg"); mask-image: url("/assets/icons/kunden.svg"); }
.icon-pin { -webkit-mask-image: url("/assets/icons/pin.svg"); mask-image: url("/assets/icons/pin.svg"); }
.icon-search { -webkit-mask-image: url("/assets/icons/search.svg"); mask-image: url("/assets/icons/search.svg"); }

/* Nur für Screenreader sichtbar: das Feld oder die Überschrift ist am Bild schon erkennbar */
.nur-leser { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

input[type="tel"], input[type="search"], textarea {
  width: 100%; min-height: var(--feld); padding: 0 var(--space-3);
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  transition: border-color 150ms, box-shadow 150ms;
}
textarea { font: inherit; min-height: 7rem; padding: var(--space-3); line-height: 1.45; resize: vertical; }
input:focus-visible, textarea:focus-visible { border-color: var(--color-focus); }
textarea[aria-invalid="true"] { border-color: var(--color-danger); border-width: 2px; }
input::placeholder { color: var(--color-text-muted); opacity: 1; }
input[type="search"] { appearance: none; -webkit-appearance: none; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.pflicht { margin-left: var(--space-1); white-space: nowrap; padding: 0.125rem var(--space-2); background: var(--color-soft); border-radius: var(--radius-sm); color: var(--color-text); font-size: var(--text-sm); font-weight: 500; }
.zurueck { display: inline-flex; align-items: center; align-self: flex-start; gap: var(--space-1); min-height: var(--touch-min); margin-left: calc(-1 * var(--space-1)); padding: 0 var(--space-2); color: var(--color-text); font-weight: 500; text-underline-offset: 0.2em; }
.formular-karte { max-width: 44rem; }
a.knopf.zurueckhaltend { text-decoration: underline; }

/* Liste: Suche und Filter in einer Reihe, darunter die Zeilen. Jede Zeile ist ein Link auf das Detail. */
.werkzeuge { align-items: stretch; }
.suche { position: relative; flex: 1 1 18rem; margin: 0; }
.suche input { padding-left: calc(var(--space-3) + 1.5rem + var(--space-2)); }
.suche-symbol { position: absolute; left: var(--space-3); top: 0; bottom: 0; display: flex; align-items: center; color: var(--color-text-muted); pointer-events: none; }
.listentitel { display: flex; align-items: center; gap: var(--space-1); }

.kunden { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.kunde { border-top: 1px solid var(--color-border); }
.kunde:first-child { border-top: 0; }
.kunde-zeile {
  display: grid; align-items: center; gap: var(--space-1) var(--space-4);
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) 8.5rem 5.5rem 1.5rem;
  min-height: 4.5rem; padding: var(--space-3) var(--space-2); margin: 0 calc(-1 * var(--space-2));
  border-radius: var(--radius-sm); color: var(--color-text); text-decoration: none;
  transition: background-color 150ms;
}
.kunde-zeile:hover, .kunde-zeile:active { background: var(--color-bg); }
.kunde-zeile:focus-visible { outline-offset: -3px; }
.kunde-name { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.kunde-name .adresse { display: block; }
.kunde-orte { font-size: var(--text-base); font-weight: 500; font-variant-numeric: tabular-nums; }
.kunde-orte.kein { color: var(--color-text-muted); font-weight: 400; }
.kunde-pfeil { display: flex; justify-content: flex-end; color: var(--color-text-muted); }
.kunde-zeile:hover .kunde-pfeil { color: var(--color-text); }
.kunde.inaktiv .adresse, .kunde.inaktiv .kunde-orte { color: var(--color-text-muted); }

/* Leerer Zustand: sagt, was fehlt, und bietet die Erstaktion an */
.leer-zustand { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-6); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-sm); }
.leer-zustand p { color: var(--color-text); }
.leer-zustand .knopf.hauptaktion { margin-top: var(--space-2); }

/* Detail: Kunde links, Einsatzorte rechts breiter */
.kunde-raster { display: grid; grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.kunde-raster > .karte:first-child { position: sticky; top: var(--space-6); }
.kopf-tag { margin-left: var(--space-2); vertical-align: middle; }

.daten { margin: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.daten > div { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.daten dt { color: var(--color-text-muted); font-size: var(--text-base); font-weight: 500; }
.daten dd { margin: 0; overflow-wrap: anywhere; }
.daten dd.leise, .leise { color: var(--color-text-muted); font-size: var(--text-base); }
.daten .zeile-aus { display: block; }
.daten .notiz { white-space: pre-wrap; }
.kunde-daten { display: flex; flex-direction: column; gap: var(--space-6); }
.kontakt { display: inline-block; padding-block: 0.6875rem; margin-block: -0.6875rem; color: var(--color-text); font-weight: 500; text-underline-offset: 0.2em; }

/* Formulargruppen */
.gruppe { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; padding-top: var(--space-6); border-top: 1px solid var(--color-border); }
.gruppe:first-child { padding-top: 0; border-top: 0; }
.gruppe h3 { font-size: var(--text-xl); font-weight: 600; line-height: 1.15; }
.gruppe > .hilfe { margin-top: calc(-1 * var(--space-2)); }
.feld-paar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.feld-paar.plz-ort { grid-template-columns: minmax(0, 10rem) minmax(0, 1fr); }
.feld.land input { max-width: 8rem; text-transform: uppercase; }
.panel h3 { font-size: var(--text-xl); font-weight: 600; }
.panel .formular { margin-top: var(--space-1); }
.panel > .knopf { align-self: flex-start; }
.karte .panel { margin-top: 0; }

/* Einsatzorte: Zeilen wie die Mitglieder, mit Ortssymbol statt Avatar */
.ort-symbol { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; background: var(--graphit-100); color: var(--graphit-800); border-radius: var(--radius-sm); }
.ort-adresse { overflow-wrap: anywhere; }
.ort-adresse:not(.adresse) { color: var(--color-text-muted); font-size: var(--text-base); }
.ort-hinweis { margin-top: var(--space-2); padding: var(--space-2) var(--space-3); background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: var(--text-base); max-width: none; }
.ort-hinweis .notiz { white-space: pre-wrap; }
.orte .mitglied-kopf { align-items: flex-start; }
.ort-hinweis strong { font-weight: 600; }
.mitglied.inaktiv .ort-symbol { opacity: 0.7; }
.mitglied.inaktiv .ort-hinweis { color: var(--color-text-muted); }

@media (max-width: 70rem) {
  .kunde-raster { grid-template-columns: minmax(0, 1fr); }
  .kunde-raster > .karte:first-child { position: static; }
}

/* Handy und schmale Fenster: jede Zeile der Kundenliste steht gestapelt, Status und Pfeil rechts oben */
@media (max-width: 52rem) {
  .kunde-zeile { grid-template-columns: minmax(0, 1fr) auto 1.5rem; grid-template-areas: "name status pfeil" "ort orte orte"; }
  .kunde-name { grid-area: name; }
  .kunde-status { grid-area: status; }
  .kunde-pfeil { grid-area: pfeil; }
  .kunde-ort { grid-area: ort; }
  .kunde-orte { grid-area: orte; justify-self: end; }
  .kunde-ort:empty { display: none; }
}
@media (max-width: 40rem) {
  .feld-paar, .feld-paar.plz-ort { grid-template-columns: minmax(0, 1fr); }
  .leer-zustand { padding: var(--space-4); }
  .leer-zustand .knopf { width: 100%; }
  .listenkopf.werkzeuge .segment { width: 100%; }
}
@media (max-width: 30rem) {
  .aktionen .knopf.zurueckhaltend { flex: 1 1 100%; }
  .mitglied .zeile-aktionen { flex: 1 1 100%; margin-left: 0; }
  .ort-symbol { display: none; }
}

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

/* ---------- T-022, Nachbesserung nach dem Product-Owner-Durchgang ---------- */

/* Die Kundenkarte ist schmal (24 rem): Paare stehen dort immer untereinander, auch am breiten Bildschirm */
#kunde .feld-paar, #kunde .feld-paar.plz-ort { grid-template-columns: minmax(0, 1fr); }

/* Zeilenaktionen der Einsatzorte: leise Textaktionen mit voller Tippfläche, die Adresse bleibt vorn */
.orte .zeile-aktionen { gap: var(--space-1); }
.orte .zeile-aktionen .knopf { min-height: var(--touch-min); padding: 0 var(--space-3); margin-left: calc(-1 * var(--space-3)); }
.orte .zeile-aktionen .knopf + .knopf { margin-left: 0; }
.orte .zeile-aktionen .knopf.umschalten { min-width: 0; }

/* Liste ohne Statusspalte im Filter "Nur aktive" */
.kunden.ohne-status .kunde-zeile { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) 8.5rem 1.5rem; }

/* Suche leeren: Kreuz im Feld, 48 px Tippfläche */
.suche-x {
  position: absolute; right: 0; top: 0; bottom: 0; display: grid; place-items: center; width: var(--touch-min);
  background: transparent; border: 0; border-radius: var(--radius-sm); color: var(--color-text);
}
.suche-x:hover, .suche-x:active { background: var(--color-bg); }
.suche input { padding-right: var(--touch-min); }

@media (max-width: 52rem) {
  .kunden.ohne-status .kunde-zeile { grid-template-columns: minmax(0, 1fr) auto 1.5rem; grid-template-areas: "name name pfeil" "ort orte orte"; }
}

/* Erstaktionen im Leerzustand: so breit wie ihr Text, untereinander, nie gestreckt */
.leer-zustand .aktionen { flex-direction: column; align-items: flex-start; }
.leer-zustand .aktionen .knopf, .leer-zustand .aktionen .knopf.hauptaktion { flex: 0 0 auto; width: auto; max-width: 100%; padding: 0 var(--space-4); }
@media (max-width: 40rem) {
  .leer-zustand .aktionen { width: 100%; align-items: stretch; }
  .leer-zustand .aktionen .knopf, .leer-zustand .aktionen .knopf.hauptaktion { width: 100%; padding-block: var(--space-2); }
}

/* ---------- Aufträge (T-023) ---------- */

.icon-auftraege { -webkit-mask-image: url("/assets/icons/auftraege.svg"); mask-image: url("/assets/icons/auftraege.svg"); }

/* Status als Marke: Symbol oder Punkt plus Text, nie nur Farbe. Der laufende Auftrag ist graphit gefüllt mit Akzentpunkt. */
.status-marke {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: 2rem; padding: 0 var(--space-3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface);
  color: var(--color-text); font-size: var(--text-base); font-weight: 600; white-space: nowrap;
}
.status-marke .icon { width: 1rem; height: 1rem; }
.status-punkt { flex: none; width: 0.625rem; height: 0.625rem; border-radius: 50%; border: 2px solid var(--graphit-700); }
.status-in_progress { background: var(--graphit-900); border-color: var(--graphit-900); color: #fff; }
.status-in_progress .status-punkt { background: #ffffff; border-color: #ffffff; }
.status-done { background: var(--graphit-100); border-color: var(--graphit-600); }
.status-closed { background: var(--graphit-100); border-color: var(--color-border-strong); font-weight: 500; }
.status-cancelled { background: transparent; border-style: dashed; font-weight: 500; }

/* Liste: Zeile ist ein Link auf das Detail. Nummer, Titel mit Kunde, Ort, Team, Status. */
.auftrag-filter { display: flex; flex-direction: column; gap: var(--space-4); margin: 0; }
.auftrag-filter .suche { flex: none; }
.filter-felder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.liste-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-4); }
.liste-zurueck { display: inline-flex; align-items: center; min-height: var(--touch-min); color: var(--color-text); font-weight: 500; text-decoration: underline; text-underline-offset: 0.2em; }
.liste-zurueck:hover, .liste-zurueck:active { text-decoration-thickness: 2px; }

.auftraege { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.auftrag { border-top: 1px solid var(--color-border); }
.auftrag:first-child { border-top: 0; }
.auftrag-zeile {
  display: grid; align-items: center; gap: var(--space-1) var(--space-4);
  grid-template-columns: 4.5rem minmax(0, 2.2fr) minmax(0, 1.1fr) minmax(0, 1.4fr) 9.5rem 1.5rem;
  min-height: 4.5rem; padding: var(--space-3) var(--space-2); margin: 0 calc(-1 * var(--space-2));
  border-radius: var(--radius-sm); color: var(--color-text); text-decoration: none;
  transition: background-color 150ms;
}
.auftrag-zeile:hover, .auftrag-zeile:active { background: var(--color-bg); }
.auftrag-zeile:focus-visible { outline-offset: -3px; }
.auftrag-nr { font-weight: 600; font-variant-numeric: tabular-nums; }
.nr-klein { display: none; }
.auftrag-name { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.auftrag-name .adresse, .auftrag-ort, .auftrag-team { overflow-wrap: anywhere; }
.auftrag-team { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-base); }
.auftrag-team .icon { width: 1.25rem; height: 1.25rem; margin-top: 0.125rem; color: var(--color-text-muted); }
.auftrag-ort, .auftrag-team { font-size: var(--text-base); }
.auftrag-ort.kein, .auftrag-team.kein { color: var(--color-text-muted); }
.auftrag-pfeil { display: flex; justify-content: flex-end; color: var(--color-text-muted); }
.auftrag-zeile:hover .auftrag-pfeil { color: var(--color-text); }
.auftrag.beendet .adresse, .auftrag.beendet .auftrag-ort, .auftrag.beendet .auftrag-team { color: var(--color-text-muted); }

/* Detail */
.auftrag-spalte { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.auftrag-raster > .karte:first-child { position: static; }
.auftrag-raster .daten dd .rolle-tag { margin-left: var(--space-2); vertical-align: middle; }
.stand-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: var(--space-3) 0; }
.stand-grund { margin: 0 0 var(--space-4); padding: var(--space-2) var(--space-3); background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: var(--text-base); max-width: none; }
.stand-grund .notiz { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Statusschritte: waagerecht, der Vorwärtsschritt trägt den Akzent, Nebenaktionen stehen ruhig daneben */
.auftrag-schritte { margin-top: var(--space-4); flex-direction: row; flex-wrap: wrap; align-items: center; }
.auftrag-schritte .knopf, .auftrag-schritte .knopf.hauptaktion { flex: 0 1 auto; width: auto; padding: 0 var(--space-6); }
.auftrag-schritte .knopf.zurueckhaltend { padding: 0 var(--space-3); }
#status-frage { margin-top: var(--space-4); }

/* Zuweisungen: Zeilen wie die Einsatzorte, mit Mitarbeitersymbol */
.zuweisungen .mitglied-kopf { align-items: center; }
.zuweisungen .zeile-aktionen .knopf { min-height: var(--touch-min); padding: 0 var(--space-3); }
.zuweisen-block { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.zuweisen-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin: 0; }
.zuweisen-form .feld { flex: 1 1 14rem; }
.zuweisen-form .knopf { flex: 0 0 auto; }
.knopf.primaer.kompakt { width: auto; min-height: var(--touch-min); padding: 0 var(--space-6); font-size: var(--text-lg); }
.verlauf { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.verlauf h3 { font-size: var(--text-xl); font-weight: 600; margin-bottom: var(--space-2); }
.verlauf-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.verlauf-liste li { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); align-items: baseline; }
.verlauf-liste .adresse { font-weight: 500; }

/* Link vom Kunden auf seine Aufträge: volle Tippfläche */
.kunde-auftraege {
  display: flex; align-items: center; gap: var(--space-2); min-height: var(--touch); padding: 0 var(--space-3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); color: var(--color-text);
  font-weight: 600; text-decoration: none;
}
.kunde-auftraege .icon:last-child { margin-left: auto; }
.kunde-auftraege:hover, .kunde-auftraege:active { background: var(--color-bg); }
.hinweis-link-inline { color: var(--color-text); font-weight: 600; text-underline-offset: 0.2em; }
input[type="date"] { width: 100%; min-height: var(--feld); padding: 0 var(--space-3); background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); font: inherit; }
select[aria-invalid="true"], input[type="date"][aria-invalid="true"] { border-color: var(--color-danger); border-width: 2px; }
select:disabled { background-color: var(--color-bg); color: var(--color-text-muted); cursor: not-allowed; }

@media (max-width: 52rem) {
  .filter-felder { grid-template-columns: minmax(0, 1fr); }
  .auftrag-zeile {
    grid-template-columns: auto minmax(0, 1fr) auto 1.5rem;
    grid-template-areas: "nr name status pfeil" "ort ort team team";
  }
  .auftrag-nr { grid-area: nr; }
  .auftrag-name { grid-area: name; }
  .auftrag-status { grid-area: status; }
  .auftrag-pfeil { grid-area: pfeil; }
  .auftrag-ort { grid-area: ort; }
  .auftrag-team { grid-area: team; justify-self: end; text-align: right; }
}
@media (max-width: 40rem) {
  .auftrag-zeile {
    grid-template-columns: auto minmax(0, 1fr) 1.5rem;
    grid-template-areas: "name name pfeil" "status ort ort" "team team team";
    gap: var(--space-2) var(--space-3);
  }
  .auftrag-ort { text-align: left; }
  .auftrag-nr { display: none; }
  .nr-klein { display: inline; font-weight: 600; }
  .auftrag-team { justify-self: start; text-align: left; }
  .auftrag-schritte .knopf, .auftrag-schritte .knopf.hauptaktion { flex: 1 1 100%; }
  .zuweisen-form .knopf { flex: 1 1 100%; }
  #auftrag-form .aktionen .knopf, #anlegen-form .aktionen .knopf, #auftrag-form .aktionen .knopf.hauptaktion, #anlegen-form .aktionen .knopf.hauptaktion { flex: 1 1 100%; }
}

/* Beenden bleibt in der Zeile der Zuweisung, auch am Handy */
@media (max-width: 30rem) {
  .zuweisungen .mitglied .zeile-aktionen { flex: 0 0 auto; margin-left: auto; }
}

/* Die Angabenkarte ist schmal (24 rem): Feldpaare stehen dort untereinander, wie bei #kunde */
#auftrag .feld-paar { grid-template-columns: minmax(0, 1fr); }

/* Formularaktionen: der Hauptknopf in ruhiger Breite neben „Abbrechen“, am Handy vollbreit */
#auftrag-form .aktionen, #anlegen-form .aktionen { align-items: center; }
@media (min-width: 40.0625rem) {
  #auftrag-form .aktionen .knopf.hauptaktion, #anlegen-form .aktionen .knopf.hauptaktion { flex: 0 0 auto; width: auto; padding: 0 var(--space-8); }
}

/* ---------- Artikel (T-024) ---------- */

.icon-artikel { -webkit-mask-image: url("/assets/icons/artikel.svg"); mask-image: url("/assets/icons/artikel.svg"); }

input[type="date"] {
  width: 100%; min-height: var(--feld); padding: 0 var(--space-3);
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
}
input[type="date"]:focus-visible { border-color: var(--color-focus); }
select:disabled { background: var(--color-bg); color: var(--color-text-muted); }

.seitenkopf-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); flex: none; }
/* Kopf mit Aktionen: der Text nimmt den Rest und bricht um, die Aktionen bleiben rechts auf Titelhöhe */
.seitenkopf:has(> .seitenkopf-aktionen) > .seitenkopf-text { flex: 1 1 18rem; }
.knopf.kompakt-knopf { padding: 0 var(--space-4); }
.textlink { color: var(--color-text); font-weight: 500; text-underline-offset: 0.2em; }

/* Liste als Tabelle: Kopfzeile und Zeilen teilen sich die Spalten. Der Name nimmt den Rest, Hersteller und Kategorie
   stehen unter ihm. Breit: eine Zeile je Artikel. Darunter: zwei Zeilen (Name und Preis, dann Nummer, Einheit, Barcode). */
.artikel-tabelle {
  --spalten: minmax(0, 2.6fr) 5.5rem 4.5rem 7.75rem 11.5rem 5rem 1.5rem;
  display: flex; flex-direction: column;
}
.artikel-tabelle.ohne-status { --spalten: minmax(0, 2.6fr) 5.5rem 4.5rem 7.75rem 11.5rem 1.5rem; }
.artikel-tabelle.ohne-preis { --spalten: minmax(0, 2.6fr) 5.5rem 4.5rem 7.75rem 5rem 1.5rem; }
.artikel-tabelle.ohne-preis.ohne-status { --spalten: minmax(0, 2.6fr) 5.5rem 4.5rem 7.75rem 1.5rem; }

.artikel-kopfzeile {
  display: grid; grid-template-columns: var(--spalten); gap: var(--space-1) var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 2px solid var(--color-border-strong);
  color: var(--color-text-muted); font-size: var(--text-base); font-weight: 600;
}
.artikel-kopfzeile .rechts { text-align: right; }

.artikel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.artikel-eintrag { border-top: 1px solid var(--color-border); }
.artikel-eintrag:first-child { border-top: 0; }
.artikel-zeile {
  display: grid; align-items: center; gap: var(--space-1) var(--space-3); grid-template-columns: var(--spalten);
  min-height: 4.5rem; padding: var(--space-3) var(--space-2); margin: 0 calc(-1 * var(--space-2));
  border-radius: var(--radius-sm); color: var(--color-text); text-decoration: none;
  transition: background-color 150ms;
}
.artikel-zeile:hover, .artikel-zeile:active { background: var(--color-bg); }
.artikel-zeile:focus-visible { outline-offset: -3px; }
.artikel-name { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.artikel-name .adresse { display: block; }
.artikel-meta { display: contents; }
.artikel-nummer, .artikel-gtin { color: var(--color-text-muted); font-size: var(--text-base); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.artikel-einheit { font-size: var(--text-base); font-weight: 500; }
.artikel-preis { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.artikel-preis.kein { color: var(--color-text-muted); font-weight: 400; }
.artikel-pfeil { display: flex; justify-content: flex-end; color: var(--color-text-muted); }
.artikel-zeile:hover .artikel-pfeil { color: var(--color-text); }
.artikel-eintrag.inaktiv .adresse, .artikel-eintrag.inaktiv .artikel-preis { color: var(--color-text-muted); }

@media (max-width: 75rem) {
  .artikel-kopfzeile { display: none; }
  .artikel-zeile, .artikel-tabelle.ohne-status .artikel-zeile, .artikel-tabelle.ohne-preis .artikel-zeile {
    grid-template-columns: minmax(0, 1fr) auto auto 1.5rem;
    grid-template-areas: "name preis status pfeil" "meta meta meta meta";
  }
  .artikel-tabelle.ohne-status .artikel-zeile { grid-template-areas: "name preis preis pfeil" "meta meta meta meta"; }
  .artikel-name { grid-area: name; }
  .artikel-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 0 var(--space-4); }
  .artikel-preis { grid-area: preis; }
  .artikel-status { grid-area: status; }
  .artikel-pfeil { grid-area: pfeil; }
  .artikel-meta > span:empty { display: none; }
  .artikel-meta > span::before { content: attr(data-label) " "; font-weight: 400; }
}
@media (max-width: 40rem) {
  .seitenkopf-aktionen { width: 100%; }
  .seitenkopf-aktionen .knopf { flex: 1 1 auto; }
  .artikel-zeile, .artikel-tabelle.ohne-status .artikel-zeile, .artikel-tabelle.ohne-preis .artikel-zeile {
    grid-template-columns: minmax(0, 1fr) auto 1.5rem;
    grid-template-areas: "name status pfeil" "meta meta meta" "preis preis preis";
  }
  .artikel-tabelle.ohne-status .artikel-zeile { grid-template-areas: "name name pfeil" "meta meta meta" "preis preis preis"; }
  .artikel-preis { text-align: left; }
}

/* Detail: Stammdaten links, Abschnitte rechts untereinander */
.artikel-raster { grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); }
.artikel-spalte { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.artikel-spalte > .karte > .hilfe { margin-top: var(--space-1); margin-bottom: var(--space-4); }
@media (max-width: 70rem) {
  .artikel-raster { grid-template-columns: minmax(0, 1fr); }
}
#stammdaten .feld-paar { grid-template-columns: minmax(0, 1fr); }

.mitglieder.zeilen .mitglied-kopf { align-items: flex-start; }
.mitglieder.zeilen .mitglied-kopf .aktionen { margin-left: auto; }
.mitglieder.zeilen .zeile-aktionen { gap: var(--space-1); }
.mitglieder.zeilen .zeile-aktionen .knopf { min-height: var(--touch-min); padding: 0 var(--space-3); }
.mitglieder.zeilen .mitglied.inaktiv .adresse { color: var(--color-text-muted); }
.mitglieder.zeilen .notiz { white-space: pre-wrap; }
.kennung-wert { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.gesperrt-wert { margin: 0; }
.feld-label { font-size: var(--text-lg); font-weight: 500; }

.preis-anzeige { display: flex; flex-direction: column; gap: var(--space-2); }
.preis-wert { margin: 0; font-size: var(--text-2xl); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.preis-anzeige .meta { margin: 0; }
.preis-anzeige .aktionen .knopf.zurueckhaltend { margin-left: calc(-1 * var(--space-3)); padding: 0 var(--space-3); }

@media (max-width: 30rem) {
  .mitglieder.zeilen .mitglied-kopf .aktionen { flex: 1 1 100%; margin-left: calc(-1 * var(--space-3)); justify-content: flex-start; }
  .mitglieder.zeilen .zeile-aktionen .knopf.zurueckhaltend, .preis-anzeige .aktionen .knopf.zurueckhaltend { flex: 0 0 auto; }
  .artikel-spalte .panel .aktionen .knopf { flex: 1 1 100%; }
}

/* Schmale Stammdatenkarte (24 rem): Hauptaktion und „Abbrechen“ stehen nebeneinander, nicht gestreckt und umgebrochen */
@media (min-width: 70.0625rem) {
  #stammdaten .aktionen .knopf.hauptaktion, #stammdaten .panel .aktionen .knopf.primaer, #stammdaten .panel .aktionen .knopf.hauptaktion {
    flex: 0 0 auto; width: auto; padding: 0 var(--space-4);
  }
  #stammdaten .aktionen { gap: var(--space-2); }
  #stammdaten .aktionen .knopf.zurueckhaltend { flex: 0 0 auto; }
}
/* Felder im Paar stehen auf einer Linie, auch wenn ein Hilfetext länger ist */
.feld-paar { align-items: start; }

/* ---------- Büro-Desktop: kompakte Dichte (T-026, B-23) ----------
   Gilt nur ab 1024 px mit Maus. Handy, Tablet und Touch behalten die Baustellen-Maße oben (Klickflächen ab 48 px,
   Eingaben 18 px, Fließtext mindestens 7:1). Farben, Schrift und Radien bleiben (B-16). Die Stufe stellt zuerst die
   Tokens um, danach nur die festen Maße, die an den Tokens vorbeigehen. */
@media (min-width: 64rem) and (pointer: fine) {
  :root {
    --text-sm: 0.75rem;     /* 12 px: Köpfe, Labels, Hilfen in der Leiste */
    --text-base: 0.8125rem; /* 13 px: Nebentext, Angaben */
    --text-lg: 0.875rem;    /* 14 px: Fließtext, Felder, Knöpfe */
    --text-xl: 1rem;        /* 16 px: Abschnittstitel */
    --text-2xl: 1.25rem;    /* 20 px */
    --text-3xl: 1.5rem;     /* 24 px: Seitentitel */

    --touch: 2.25rem;       /* 36 px: auch die Hauptaktion */
    --touch-min: 2.25rem;
    --feld: 2.25rem;

    --space-3: 0.625rem;
    --space-4: 0.875rem;
    --space-6: 1.25rem;
    --space-8: 1.5rem;
    --space-12: 2.25rem;

    --leiste-breite: 14.5rem; /* 232 px */
  }

  body { line-height: 1.4; }
  .kopf { min-height: 3rem; }

  /* Rahmen: Inhalt nutzt die Breite bis 120 rem, Seitenabstand knapper */
  .arbeitsflaeche > main { max-width: 120rem; padding: var(--space-6) var(--space-8) var(--space-8); }
  .leiste-innen { gap: var(--space-4); padding: var(--space-4) var(--space-3); }
  .leiste-menue { gap: var(--space-4); }
  .betrieb { padding: var(--space-2) var(--space-3); gap: var(--space-2); }
  .betrieb-symbol { width: 2rem; height: 2rem; }
  .betrieb-name { font-size: var(--text-lg); }
  .leiste-nav a { gap: var(--space-2); padding: 0 var(--space-2); font-size: var(--text-lg); }
  .leiste-label { font-size: var(--text-sm); }
  .leiste-nav.betriebe { padding-top: var(--space-3); }

  /* Icons und kleine Bausteine */
  .icon { width: 1.125rem; height: 1.125rem; }
  .meldung .icon { margin-top: 0.0625rem; }
  .rolle-tag .icon, .status-marke .icon { width: 0.875rem; height: 0.875rem; }
  .feld-fehler .icon { width: 1rem; height: 1rem; margin-top: 0.0625rem; }
  .auftrag-team .icon { width: 1rem; height: 1rem; margin-top: 0.0625rem; }
  .avatar, .ort-symbol { width: 2rem; height: 2rem; }
  .rolle-tag, .du { min-height: 1.375rem; padding: 0 var(--space-2); }
  .status-marke { min-height: 1.5rem; padding: 0 var(--space-2); }
  .pflicht { padding: 0.0625rem var(--space-2); }
  .zahl { min-width: 1.5rem; }
  .schritt h2::before { width: 1.75rem; height: 1.75rem; }

  /* Seitenkopf und Karten */
  .seite { gap: var(--space-3); }
  .seitenkopf { align-items: center; gap: var(--space-2) var(--space-6); }
  .seitenkopf-text { gap: 0.125rem; }
  .karte { padding: var(--space-4); gap: var(--space-3); box-shadow: 0 1px 1px rgba(21, 23, 26, 0.05); }
  .karte.schmal { margin-top: var(--space-6); }
  .karte.codes-karte { margin-top: var(--space-6); }
  .karte > h1 { font-size: var(--text-2xl); }
  .kachel { padding: var(--space-4); gap: var(--space-3); box-shadow: none; }
  .kachel:hover { box-shadow: 0 2px 8px rgba(21, 23, 26, 0.08); }
  .kachel-symbol { width: 2.25rem; height: 2.25rem; }
  .kachel-symbol .icon { width: 1.25rem; height: 1.25rem; }
  .kacheln { grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); gap: var(--space-3); }
  .leer-zustand { padding: var(--space-4); }
  .panel { padding: var(--space-3); }
  .dialog { padding: var(--space-4); }
  .gruppe { padding-top: var(--space-4); gap: var(--space-3); }
  .daten { gap: var(--space-3); }
  .kunde-daten { gap: var(--space-4); }
  .mitglieder-raster, .kunde-raster { gap: var(--space-4); }
  .spalte-neben { top: var(--space-4); }
  .kunde-raster > .karte:first-child { top: var(--space-4); }
  .auftrag-spalte, .artikel-spalte { gap: var(--space-4); }

  /* Felder, Knöpfe, Auswahl */
  label, .feld-label, .rollenwahl legend { font-size: var(--text-base); font-weight: 500; }
  .feld { gap: 0.25rem; }
  .formular { gap: var(--space-3); }
  textarea { min-height: 5.5rem; padding: var(--space-2) var(--space-3); }
  input.code {
    --stelle: 2rem; min-height: 2.75rem; font-size: 1.375rem;
  }
  .knopf { font-size: var(--text-lg); }
  .knopf.hauptaktion, .knopf.primaer, .knopf.sicherung { font-size: var(--text-lg); }
  .knopf.hauptaktion.kompakt, .knopf.primaer.kompakt { padding: 0 var(--space-4); }
  .knopf.hauptaktion { box-shadow: 0 1px 1px rgba(21, 23, 26, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.28); }
  .aktionen { gap: var(--space-2); }
  .aktionen .knopf.hauptaktion { flex: 0 1 auto; }
  .wahl { min-height: 2.5rem; padding: var(--space-1) var(--space-3); }
  .wahl:has(input:checked) { padding: calc(var(--space-1) - 1px) calc(var(--space-3) - 1px); }
  .wahl input { width: 1.125rem; height: 1.125rem; }
  .segment button { padding: 0 var(--space-3); font-size: var(--text-lg); }
  .suche-x { width: var(--touch-min); }
  .suche input { padding-left: calc(var(--space-3) + 1.125rem + var(--space-2)); }
  .codes { gap: var(--space-2); }
  .zeile { font-size: var(--text-lg); }
  .liste { gap: var(--space-2); }
  .meldung { padding: var(--space-2) var(--space-3); }

  /* Listen: eine Zeile je Eintrag (Name, Angabe daneben), Zeilenhöhe um 40 px */
  .mitglied { padding: var(--space-3) 0; }
  .kunde-zeile, .auftrag-zeile, .artikel-zeile { min-height: 2.5rem; padding: var(--space-1) var(--space-2); gap: var(--space-1) var(--space-3); }
  .kunde-zeile { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 7rem 5rem 1.25rem; }
  .kunden.ohne-status .kunde-zeile { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 7rem 1.25rem; }
  .auftrag-zeile { grid-template-columns: 3.5rem minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.2fr) 9rem 1.25rem; }
  .artikel-tabelle { --spalten: minmax(0, 2.6fr) 5.5rem 4.5rem 7.75rem 10rem 4.5rem 1.25rem; }
  .artikel-tabelle.ohne-status { --spalten: minmax(0, 2.6fr) 5.5rem 4.5rem 7.75rem 10rem 1.25rem; }
  .artikel-tabelle.ohne-preis { --spalten: minmax(0, 2.6fr) 5.5rem 4.5rem 7.75rem 4.5rem 1.25rem; }
  .artikel-tabelle.ohne-preis.ohne-status { --spalten: minmax(0, 2.6fr) 5.5rem 4.5rem 7.75rem 1.25rem; }
  .kunde-name, .auftrag-name, .artikel-name { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); }
  .artikel-kopfzeile { padding: var(--space-1) 0; border-bottom-width: 1px; font-size: var(--text-sm); }
  .artikel-tabelle .artikel-kopfzeile { margin: 0 calc(-1 * var(--space-2)); padding-inline: var(--space-2); }
  .filter-felder { gap: var(--space-3); max-width: 64rem; }
  .auftrag-filter { gap: var(--space-3); }
  .auftrag-filter .suche, .werkzeuge .suche { max-width: 40rem; }
  .zuweisen-form .feld { max-width: 28rem; }
  .leer { max-width: none; }
  .mitglied-kopf .aktionen.unter { margin-left: calc(2rem + var(--space-4)); }
  .gruppe h3, .panel h3 { margin: 0; }
}

/* ---------- Übersicht (T-028): Suche mit Treffern je Art, Kennzahlen als Felder ---------- */

.uebersicht-suche { display: flex; flex-direction: column; gap: var(--space-3); }
.uebersicht-suche .suche { flex: none; max-width: 48rem; }
.suche-hilfe { color: var(--color-text-muted); font-size: var(--text-base); }
.treffer { display: flex; flex-direction: column; gap: var(--space-4); }
.treffer:not(:has(> *)) { display: none; }
.treffer .meldung, .treffer .leer-zustand { max-width: 48rem; }
.treffer-gruppe { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.treffer-titel {
  display: flex; align-items: center; gap: var(--space-1); margin: 0; padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--color-border-strong);
  font-size: var(--text-base); font-weight: 600; color: var(--color-text-muted);
}
.treffer-liste { list-style: none; margin: 0; padding: 0; }
.treffer-liste li { border-top: 1px solid var(--color-border); }
.treffer-liste li:first-child { border-top: 0; }
.treffer-zeile {
  display: grid; align-items: center; gap: var(--space-1) var(--space-4);
  grid-template-columns: 4.5rem minmax(0, 1fr) auto 1.5rem;
  min-height: 3.5rem; padding: var(--space-2); margin: 0 calc(-1 * var(--space-2));
  border-radius: var(--radius-sm); color: var(--color-text); text-decoration: none;
  transition: background-color 150ms;
}
.treffer-zeile:hover, .treffer-zeile:active { background: var(--color-bg); }
.treffer-zeile:focus-visible { outline-offset: -3px; }
.treffer-kennung { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--color-text); }
.treffer-kennung .icon { width: 1.25rem; height: 1.25rem; color: var(--color-text-muted); }
.treffer-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.treffer-marke { display: flex; justify-content: flex-end; }
.treffer-pfeil { display: flex; justify-content: flex-end; color: var(--color-text-muted); }
.treffer-zeile:hover .treffer-pfeil { color: var(--color-text); }
.treffer-zeile.inaktiv .adresse, .treffer-zeile.inaktiv .treffer-kennung { color: var(--color-text-muted); }
.inaktiv-marke {
  display: inline-flex; align-items: center; min-height: 1.5rem; padding: 0 var(--space-2);
  border: 1px dashed var(--color-border-strong); border-radius: var(--radius-sm);
  color: var(--color-text-muted); font-size: var(--text-base); font-weight: 500; white-space: nowrap;
}
.treffer-mehr {
  display: inline-flex; align-items: center; gap: var(--space-1); align-self: flex-start; min-height: var(--touch-min);
  color: var(--color-text); font-weight: 600; text-underline-offset: 0.2em;
}


/* ---------- Übersicht als Arbeitsübersicht (T-028, B-24) ----------
   Handy und Touch: eine Spalte, Zeilen ab 48 px. Büro-Desktop: siehe Block „Büro-Desktop-Neustart“ weiter unten. */

.zahl-wert { font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.stamm { list-style: none; margin: var(--space-2) 0 0; padding: 0; }
.stamm li + li { border-top: 1px solid var(--color-border); }
.stamm-zeile {
  display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto 1.5rem; align-items: center; gap: var(--space-3);
  min-height: 3.5rem; color: var(--color-text); text-decoration: none;
}
.stamm-zeile > .stamm-stein { grid-column: 1; }
.stamm-zeile > .zahl-name { grid-column: 2; }
.stamm-zeile > .zahl-wert { grid-column: 3; }
.stamm-zeile > .zahl-pfeil { grid-column: 4; }
.stamm-zeile .zahl-name { color: var(--color-text); font-size: var(--text-lg); }
.stamm-zeile .zahl-wert { font-size: var(--text-lg); }
.zahl-pfeil { display: flex; justify-content: flex-end; color: var(--color-text-muted); }
.stamm-zeile:hover .zahl-pfeil { color: var(--color-text); }
.treffer-kopf { display: none; }
.uebersicht .seitenkopf-aktionen .knopf { flex: 0 1 auto; }

/* Kopfleiste, Arbeitsfläche und Leistengruppen: Grundlagen für alle Größen */
.arbeitsflaeche { min-width: 0; display: flex; flex-direction: column; }
.arbeitsflaeche > main { flex: 1; }
.kopfleiste { display: none; }
.leiste-gruppe + .leiste-gruppe { margin-top: var(--space-3); }
.leiste-fuss { margin-top: auto; display: flex; flex-direction: column; gap: var(--space-1); }
.leiste-fuss form { margin: 0; }
#zahlen-fehler { align-items: center; }
#zahlen-fehler .icon { margin-top: 0; }

/* ---------- Übersicht (T-028, B-25): Bausteine für alle Größen. Handy und Touch: eine Spalte, Zeilen ab 48 px ---------- */

.zahl-name { color: var(--color-text-muted); font-size: var(--text-base); font-weight: 500; overflow-wrap: anywhere; }
.schiene, .bereich { display: none; }
.cu-raster, .cu-seite { display: grid; gap: var(--space-4); }
.cu-arbeit, .cu-stand, .cu-stamm { padding: var(--space-4); }
.cu-karten-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.cu-karten-kopf h2, .cu-stand h2, .cu-stamm h2 { font-size: var(--text-xl); }
.cu-reiter { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cu-reiter-link {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--touch-min); padding: 0 var(--space-4);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-full); color: var(--color-text); text-decoration: none;
}
.cu-reiter-link .zahl-name { color: var(--color-text); font-weight: 600; }
.cu-gruppe { border-top: 1px solid var(--color-border); }
.cu-gruppen-kopf { display: flex; align-items: center; gap: var(--space-2); min-height: var(--touch-min); cursor: pointer; list-style: none; }
.cu-gruppen-kopf::-webkit-details-marker { display: none; }
.cu-dreieck { flex: none; width: 0; height: 0; border-left: 5px solid var(--color-text-muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform 150ms; }
.cu-gruppe[open] .cu-dreieck { transform: rotate(90deg); }
.cu-gruppen-titel { display: flex; align-items: center; gap: var(--space-2); font-weight: 600; }
.cu-gruppen-symbol { display: flex; color: var(--color-text-muted); }
.cu-gruppen-titel .zahl-wert { color: var(--color-text-muted); font-size: var(--text-base); }
.signal-rot .cu-gruppen-symbol, .signal-rot .cu-gruppen-titel .zahl-wert { color: var(--color-danger); }
.cu-mehr { margin-left: auto; display: inline-flex; align-items: center; gap: var(--space-1); color: var(--color-text); font-size: var(--text-base); font-weight: 600; }
.cu-zeilen { list-style: none; margin: 0 0 var(--space-2); padding: 0; }
.cu-zeilen li + li { border-top: 1px solid var(--color-border); }
.cu-zeile {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nr status" "titel titel" "zeit zeit";
  gap: var(--space-1) var(--space-3); align-items: center; padding: var(--space-3) 0; color: var(--color-text); text-decoration: none;
}
.cu-status { grid-area: status; }
.cu-titel { grid-area: titel; display: flex; flex-direction: column; min-width: 0; }
.cu-titel-text { font-weight: 600; }
.cu-meta, .cu-team, .cu-zeit { color: var(--color-text-muted); font-size: var(--text-base); }
.cu-team, .cu-pfeil { display: none; }
.cu-nr { grid-area: nr; color: var(--color-text-muted); font-variant-numeric: tabular-nums; font-size: var(--text-base); font-weight: 600; }
.cu-zeit { grid-area: zeit; font-variant-numeric: tabular-nums; }
.cu-zeit:empty { display: none; }
.cu-zeit.spaet { color: var(--color-danger); font-weight: 600; }
.cu-leer { margin: 0 0 var(--space-3); color: var(--color-text-muted); font-size: var(--text-base); }
.cu-balken { display: flex; height: 0.75rem; margin: var(--space-3) 0; background: var(--color-soft); border-radius: var(--radius-full); overflow: hidden; }
.cu-balken-teil { height: 100%; }
.cu-balken-teil + .cu-balken-teil { border-left: 2px solid var(--color-surface); }
.cu-balken-teil.geplant, .cu-punkt.geplant { background: #8f8d86; }
.cu-balken-teil.arbeit, .cu-punkt.arbeit { background: #2b2a28; }
.cu-balken-teil.erledigt, .cu-punkt.erledigt { background: #2f9e5b; }
.w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; } .w-25 { width: 25%; }
.w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; } .w-50 { width: 50%; }
.w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; } .w-75 { width: 75%; }
.w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; }
.cu-legende { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); font-size: var(--text-base); }
.cu-legende li { display: flex; align-items: center; gap: var(--space-2); }
.cu-punkt { flex: none; width: 0.625rem; height: 0.625rem; border-radius: 3px; }
.cu-legende-wert { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.cu-stamm .stamm { margin: var(--space-1) 0 0; }

/* ---------- Büro-Desktop nach B-25: Richtung ClickUp ----------
   Nur ab 1024 px mit Maus. Durchgehende Kopfleiste mit Betrieb, Suche und Schnellaktionen; links eine dunkle
   Bereichsschiene mit Symbolen, daneben die helle Leiste mit den Unterpunkten des Bereichs; der Inhalt als ruhige
   Fläche mit weißen Karten. Graphit für Hauptaktion, Fokus und „In Arbeit“; Farbe nur mit Modulbezug (data-modul am Rahmen),
   Rot und Ocker nur als Signal. Schrift Outfit (Marke). Text mindestens 4,5:1 (WCAG AA). */
@media (min-width: 64rem) and (pointer: fine) {
  :root {
    --color-bg: #f7f7f5;              /* Papierweiß der Marke */
    --color-surface: #ffffff;
    --color-text: #2b2a28;            /* Graphit der Marke, 14.3:1 auf Weiß */
    --color-text-muted: #666460;      /* 5.9:1 auf Weiß, 5.5:1 auf dem Untergrund */
    --color-border: #e7e6e2;
    --color-border-strong: #c9c7c1;   /* Feldränder, nur Gliederung neben dem Label */
    --color-soft: #efeeea;
    --color-primary: #2b2a28; --color-primary-hover: #151412; --color-primary-contrast: #ffffff;
    --color-focus: #2b2a28;
    --color-danger: #b42318;          /* 6.0:1 auf Weiß */
    --ocker: #8a5200; --ocker-flaeche: #fff8e6;           /* 6.0:1 */
    --flaeche-weich: #f3f2ee;
    --schiene-bg: #2b2a28; --schiene-text: #c9c7c0;       /* 8.5:1 */
    --leiste-bg: #fbfbfa;
    --kopf-hoehe: 3rem;
    --schiene-breite: 4rem;
    --leiste-breite: 15rem;
    --schatten-karte: 0 1px 2px rgba(43, 42, 40, 0.05);
  }
  body { background: var(--color-bg); }
  ::selection { background: #e4e3de; color: var(--color-text); }

  /* Raster: Kopfleiste oben über die volle Breite, darunter Schiene, Leiste und Inhalt */
  .rahmen {
    display: grid; grid-template-columns: var(--schiene-breite) var(--leiste-breite) minmax(0, 1fr);
    grid-template-rows: var(--kopf-hoehe) minmax(0, 1fr); height: 100dvh; min-height: 0;
  }
  .arbeitsflaeche { display: contents; }
  .kopfleiste { grid-column: 1 / -1; grid-row: 1; position: static; }
  .schiene { grid-column: 1; grid-row: 2; }
  .rahmen > .leiste { grid-column: 2; grid-row: 2; position: static; width: auto; height: auto; min-height: 0; overflow-y: auto; }
  .arbeitsflaeche > main { grid-column: 3; grid-row: 2; overflow-y: auto; max-width: none; padding: var(--space-6) var(--space-8) var(--space-8); }

  /* Kopfleiste */
  .kopfleiste {
    display: grid; grid-template-columns: calc(var(--schiene-breite) + var(--leiste-breite)) minmax(0, 1fr) auto;
    align-items: center; gap: 0; min-height: 0; padding: 0 var(--space-4) 0 0; background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
  }
  .kontext { display: flex; align-items: center; gap: var(--space-2); max-width: none; padding: 0 var(--space-4); min-width: 0; }
  .kontext-symbol { width: 1.5rem; height: 1.5rem; background: var(--color-primary); color: #fff; border-radius: 6px; }
  .kontext-symbol .icon { width: 0.875rem; height: 0.875rem; }
  .kontext-name { font-size: 0.875rem; font-weight: 700; }
  .kontext-rolle { min-height: 1.25rem; font-size: 0.75rem; border-color: var(--color-border); }
  .kopf-suche { justify-self: center; width: 100%; max-width: 34rem; margin: 0; }
  .kopf-suche input {
    min-height: 2rem; padding-left: 2.125rem; background: var(--flaeche-weich); border: 1px solid transparent;
    border-radius: 8px; font-size: 0.8125rem;
  }
  .kopf-suche input:hover { border-color: var(--color-border); }
  .kopf-suche input:focus { background: #fff; border-color: var(--color-focus); outline: 2px solid var(--color-focus); outline-offset: 1px; }
  .kopf-suche-symbol { left: 0.75rem; }
  .kopf-suche-symbol .icon { width: 0.9375rem; height: 0.9375rem; }
  .kopf-aktionen { margin: 0; gap: var(--space-2); }
  .kopf-aktionen .knopf { min-height: 2rem; padding: 0 0.75rem; font-size: 0.8125rem; border-radius: 8px; }
  .kopf-aktionen .knopf.hauptaktion.kompakt { padding: 0 0.875rem; }

  /* Knöpfe: Hauptaktion schwarz wie in ClickUp, Nebenknöpfe weiß mit feiner Kante */
  .knopf { border-radius: 8px; font-weight: 600; }
  .knopf.hauptaktion { background: var(--color-primary); border-color: var(--color-primary); color: #fff; box-shadow: none; }
  .knopf.hauptaktion:hover { background: #000; }
  .knopf:not(.hauptaktion) { background: var(--color-surface); border-color: var(--color-border-strong); }
  .knopf:not(.hauptaktion):hover { background: var(--flaeche-weich); }

  /* Schiene: dunkel, Symbol mit kleiner Beschriftung */
  .schiene {
    display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-3) 0;
    background: var(--schiene-bg); overflow-y: auto;
  }
  .schiene-marke { display: block; width: 2rem; height: 2rem; margin-bottom: var(--space-2); border-radius: 9px; }
  .schiene-marke img { display: block; width: 2rem; height: 2rem; }
  .schiene-marke:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
  .schiene-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
  .schiene-link, .knopf.schiene-knopf {
    display: flex; flex-direction: column; align-items: center; gap: 2px; width: 3.25rem; padding: 0.375rem 0;
    border-radius: 8px; color: var(--schiene-text); font-size: 0.625rem; font-weight: 600; text-decoration: none;
  }
  .schiene-symbol { display: grid; place-items: center; width: 2.25rem; height: 1.75rem; border-radius: 0.875rem; }
  .schiene-symbol .icon { width: 1.125rem; height: 1.125rem; }
  .schiene-link:hover { color: #fff; }
  .schiene-link:hover .schiene-symbol { background: rgba(255, 255, 255, 0.08); }
  .schiene-link[aria-current="page"] { color: #fff; }
  .schiene-link[aria-current="page"] .schiene-symbol { background: var(--modul-stein-schiene); color: #2b2a28; border-radius: 0.875rem; }
  .schiene :focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
  .schiene-fuss { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .schiene-fuss form { margin: 0; }
  .knopf.schiene-knopf { min-height: 0; height: auto; background: transparent; border: 0; justify-content: center; }
  .knopf.schiene-knopf .icon { width: 1.125rem; height: 1.125rem; margin: 0.3125rem 0; }
  .knopf.schiene-knopf:hover { color: #fff; background: transparent; }

  /* Leiste: hell, Unterpunkte des Bereichs. Das Handy-Menü (Gruppen, Betrieb, Konto) braucht es hier nicht. */
  .rahmen > .leiste { background: var(--leiste-bg); color: var(--color-text); border-right: 1px solid var(--color-border); }
  .leiste-innen { padding: var(--space-4) var(--space-3); gap: 0; min-height: 100%; }
  .leiste-kopf, .betrieb, .leiste-menue > .leiste-nav:not(.betriebe), .leiste-fuss { display: none; }
  .leiste-menue { display: flex; flex-direction: column; gap: var(--space-4); }
  .bereich { display: flex; flex-direction: column; gap: var(--space-3); }
  .bereich-kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 0 var(--space-2); }
  .bereich-titel { margin: 0; display: flex; align-items: center; gap: var(--space-2); font-size: 0.9375rem; font-weight: 700; }
  .knopf.bereich-neu { min-height: 1.75rem; padding: 0 0.625rem; gap: 0.25rem; font-size: 0.75rem; background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text); }
  .knopf.bereich-neu:hover { background: var(--flaeche-weich); }
  .knopf.bereich-neu .icon { width: 0.875rem; height: 0.875rem; }
  .bereich-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
  .bereich-gruppe { padding: var(--space-2) var(--space-2) var(--space-1); color: var(--color-text-muted); font-size: 0.75rem; font-weight: 600; }
  .bereich-link {
    display: flex; align-items: center; gap: var(--space-2); min-height: 1.875rem; padding: 0 var(--space-2);
    border-radius: 6px; color: var(--color-text); font-size: 0.8125rem; font-weight: 500; text-decoration: none;
  }
  .bereich-link .icon { width: 1rem; height: 1rem; color: var(--color-text-muted); }
  .bereich-link:hover { background: var(--color-soft); }
  .bereich-link[aria-current="page"] { background: var(--modul-flaeche); color: var(--modul-text); font-weight: 600; }
  .bereich-link[aria-current="page"] .icon { color: var(--modul-text); }
  .leiste-nav.betriebe { margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--color-border); }
  .leiste-nav.betriebe .leiste-label { color: var(--color-text-muted); }
  .leiste-nav.betriebe a { color: var(--color-text); }

  /* Seitenkopf, Karten, Hinweise */
  .seitenkopf { margin-bottom: 0; }
  .seitenkopf h1 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; }
  .seitenkopf .rolle { color: var(--color-text-muted); font-size: 0.8125rem; }
  .karte { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; box-shadow: var(--schatten-karte); }
  .meldung.hinweis { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; box-shadow: none; font-size: 0.8125rem; }
  .meldung.hinweis .icon { color: var(--color-text); }

  /* Status als Pille in Großbuchstaben, Farbe nur zusätzlich zu Text und Symbol */
  .status-marke {
    min-height: 1.375rem; padding: 0 0.5rem; gap: 0.3125rem; border: 0; border-radius: 5px;
    font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  }
  .status-planned { background: #ecebe7; color: #4f4d48; }
  .status-planned .status-punkt { border-color: #8f8d86; }
  .status-in_progress { background: #2b2a28; color: #ffffff; }
  .status-in_progress .status-punkt { background: #ffffff; border-color: #ffffff; }
  .status-done { background: #e4f5eb; color: #1f6b3c; }
  .status-closed { background: #ecebe7; color: #4f4d48; }
  .status-cancelled { background: #fef3f2; color: var(--color-danger); border: 0; }

  /* Übersicht: links „Meine Arbeit“, rechts Stand und Stammdaten */
  .uebersicht { gap: var(--space-4); }
  .uebersicht.suchend .cu-raster { display: none; }
  .cu-raster { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; gap: var(--space-4); }
  .cu-arbeit { padding: var(--space-4) var(--space-5, 1.25rem) var(--space-2); }
  .cu-karten-kopf { margin-bottom: var(--space-1); padding-bottom: 0; border-bottom: 1px solid var(--color-border); align-items: flex-end; }
  .cu-karten-kopf h2 { font-size: 0.9375rem; font-weight: 700; padding-bottom: var(--space-3); }
  .cu-reiter { gap: var(--space-4); }
  .cu-reiter-link {
    min-height: 0; padding: 0 0 var(--space-3); border: 0; border-bottom: 2px solid transparent; border-radius: 0;
    margin-bottom: -1px; gap: 0.375rem;
  }
  .cu-reiter-link .zahl-name { color: var(--color-text-muted); font-size: 0.8125rem; font-weight: 600; }
  .cu-reiter-link .zahl-wert { min-width: 1.25rem; padding: 0 0.3125rem; background: var(--color-soft); border-radius: 5px; color: var(--color-text-muted); font-size: 0.6875rem; text-align: center; line-height: 1.125rem; }
  .cu-reiter-link:hover .zahl-name { color: var(--color-text); }
  .cu-reiter-link:hover { border-bottom-color: var(--color-text); }
  .cu-gruppe { border-top: 0; }
  .cu-gruppe + .cu-gruppe { border-top: 1px solid var(--color-border); }
  .cu-gruppen-kopf { min-height: 2.5rem; font-size: 0.8125rem; }
  .cu-gruppen-kopf:hover .cu-dreieck { border-left-color: var(--color-text); }
  .cu-gruppen-symbol .icon { width: 1rem; height: 1rem; }
  .cu-gruppen-titel .zahl-wert { font-size: 0.75rem; font-weight: 600; }
  .signal-gelb .cu-gruppen-symbol, .signal-gelb .cu-gruppen-titel .zahl-wert { color: var(--ocker); }
  .cu-mehr { font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted); text-decoration: none; }
  .cu-mehr:hover { color: var(--color-text); }
  .cu-mehr .icon { width: 0.875rem; height: 0.875rem; }
  .cu-zeilen { margin: 0 0 var(--space-2) 1.125rem; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; }
  .cu-zeilen li + li { border-top-color: var(--color-border); }
  .cu-zeile {
    grid-template-columns: 6.5rem 3.5rem minmax(0, 1fr) 9rem 9.5rem 1rem; grid-template-areas: "status nr titel team zeit pfeil";
    gap: var(--space-3); min-height: 2.75rem; padding: 0.375rem var(--space-3); font-size: 0.8125rem;
  }
  .cu-zeile:hover { background: var(--flaeche-weich); }
  .cu-nr, .cu-team, .cu-zeit, .cu-pfeil { display: flex; align-items: center; }
  .cu-nr { grid-area: nr; color: var(--color-text-muted); font-variant-numeric: tabular-nums; font-size: 0.75rem; }
  .cu-titel { flex-direction: row; align-items: baseline; gap: var(--space-2); overflow: hidden; }
  .cu-titel-text { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
  .cu-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; }
  .cu-team { grid-area: team; gap: 0; font-size: 0.75rem; }
  .cu-avatar {
    display: grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-right: -0.25rem; background: var(--modul-team-text);
    border: 2px solid var(--color-surface); border-radius: 50%; color: #fff; font-size: 0.625rem; font-weight: 700;
  }
  .cu-niemand { color: var(--ocker); font-weight: 600; }
  .cu-zeit { grid-area: zeit; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
  .cu-zeit.spaet { color: var(--color-danger); font-weight: 600; }
  .cu-pfeil { grid-area: pfeil; color: var(--color-text-muted); }
  .cu-pfeil .icon { width: 0.875rem; height: 0.875rem; }
  .cu-leer { margin: 0 0 var(--space-3) 1.125rem; font-size: 0.8125rem; }
  .cu-seite { gap: var(--space-4); }
  .cu-stand, .cu-stamm { padding: var(--space-4) var(--space-5, 1.25rem); }
  .cu-stand h2, .cu-stamm h2 { font-size: 0.9375rem; font-weight: 700; }
  .cu-balken { height: 0.5rem; margin: var(--space-3) 0 var(--space-4); }
  .cu-legende { font-size: 0.8125rem; gap: var(--space-2); }
  .cu-stamm .stamm li + li { border-top: 0; }
  .cu-stamm .stamm-zeile { grid-template-columns: 1.75rem minmax(0, 1fr) auto 1rem; min-height: 2.25rem; margin: 0 calc(-1 * var(--space-2)); padding: 0 var(--space-2); border-radius: 6px; }
  .cu-stamm .stamm-zeile:hover { background: var(--flaeche-weich); }
  .cu-stamm .stamm-stein { width: 1.75rem; height: 1.25rem; }
  .cu-stamm .stamm-stein .icon { width: 0.8125rem; height: 0.8125rem; }
  .cu-stamm .stamm-zeile .zahl-name { font-size: 0.8125rem; color: var(--color-text); font-weight: 500; }
  .cu-stamm .stamm-zeile .zahl-wert { font-size: 0.8125rem; }
  .cu-stamm .zahl-pfeil .icon { width: 0.875rem; height: 0.875rem; }

  /* Suche: Treffer als Karte im selben Stil */
  .uebersicht-suche { border-radius: 12px; }
  .uebersicht-suche .treffer-titel { font-size: 0.75rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
}

@media (min-width: 64rem) and (pointer: fine) and (max-width: 100rem) {
  .cu-raster { grid-template-columns: minmax(0, 1fr); }
  .cu-seite { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64rem) and (pointer: fine) and (max-width: 75rem) {
  .cu-zeile { grid-template-columns: 6.5rem 3.25rem minmax(0, 1fr) 7rem 1rem; grid-template-areas: "status nr titel team pfeil"; }
  .cu-zeit { display: none; }
}

/* ---------- Büro-Desktop: Kopfleiste und Suche (Grundlagen zur Richtung ClickUp) ---------- */
@media (min-width: 64rem) and (pointer: fine) {
  .kontext-symbol { flex: none; display: grid; place-items: center; }
  .kontext-symbol .icon { width: 1rem; height: 1rem; }
  .kontext-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kontext-rolle {
    flex: none; display: inline-flex; align-items: center; min-height: 1.375rem; padding: 0 var(--space-2);
    border: 1px solid var(--color-border); border-radius: var(--radius-full); color: var(--color-text-muted); font-weight: 500;
  }
  .kopf-suche { position: relative; }
  .kopf-suche input { width: 100%; padding-right: 2.25rem; }
  .kopf-suche input::placeholder { color: var(--color-text-muted); opacity: 1; }
  .kopf-suche-symbol { position: absolute; left: 0.75rem; top: 0; bottom: 0; display: flex; align-items: center; color: var(--color-text-muted); pointer-events: none; }
  .kopf-aktionen { display: flex; align-items: center; flex: none; }
  .nur-handy { display: none; }

  /* Suche: die Treffer ersetzen die Arbeitsübersicht, das Suchfeld steht in der Kopfleiste */
  .uebersicht:not(.suchend) .uebersicht-suche { display: none; }
  .uebersicht.suchend .cu-raster { display: none; }
  .uebersicht-suche .suche { display: none; }
  .uebersicht-suche { padding: var(--space-4) var(--space-6) var(--space-6); }
  .treffer-kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-bottom: var(--space-2); }
  .treffer-begriff { font-size: 1rem; font-weight: 600; }
  .treffer-schliessen {
    display: inline-flex; align-items: center; gap: var(--space-1); min-height: 2rem; padding: 0 var(--space-3);
    border-radius: 8px; color: var(--color-text); font-size: 0.8125rem; font-weight: 600; text-decoration: none;
  }
  .treffer-schliessen:hover { background: var(--flaeche-weich); }
  .uebersicht-suche .treffer-titel { border-bottom-color: var(--color-border); }
  .uebersicht-suche .treffer-zeile:hover { background: var(--flaeche-weich); }
  .uebersicht-suche .zahl { background: var(--flaeche-weich); }
}

/* ---------- Marke Serakis: Wortmarke, Modulfarben, Steine ----------
   Herkunft: docs/archiv/marke-mmento-office/farben/module.css (archiviert). Farbe gibt es nur dort, wo ein Modul
   gemeint ist; alles andere bleibt Graphit und Papierweiß. Die Hell-Werte gelten überall; ein Dunkelmodus ist nicht vorgesehen. */
:root {
  --serakis-graphit: #2b2a28;
  --serakis-papierweiss: #f7f7f5;

  --modul-auftraege-stein: #c1765a;     --modul-auftraege-text: #944c32;     --modul-auftraege-flaeche: #ffe8df;
  --modul-kunden-stein: #a08a4a;        --modul-kunden-text: #76611d;        --modul-kunden-flaeche: #f6eed8;
  --modul-zeiterfassung-stein: #559c88; --modul-zeiterfassung-text: #28725f; --modul-zeiterfassung-flaeche: #dbf5ec;
  --modul-material-stein: #5b95b0;      --modul-material-text: #306b85;      --modul-material-flaeche: #dbf3ff;
  --modul-team-stein: #7288d0;          --modul-team-text: #4b5ea2;          --modul-team-flaeche: #e6eeff;
  --modul-auswertung-stein: #a974bd;    --modul-auswertung-text: #7c4e8d;    --modul-auswertung-flaeche: #f7e9fc;
  --modul-rechnungen-stein: #bd6f9c;    --modul-rechnungen-text: #8e4771;    --modul-rechnungen-flaeche: #fee7f3;
}

/* Der Rahmen kennt das Modul des Bereichs (`data-modul`): daraus kommen Stein, Text und Fläche, einmal gesetzt */
.rahmen { --modul-stein: var(--serakis-graphit); --modul-stein-schiene: var(--serakis-papierweiss); --modul-text: var(--serakis-graphit); --modul-flaeche: #ecebe7; }
.rahmen[data-modul="auftraege"] { --modul-stein: var(--modul-auftraege-stein); --modul-stein-schiene: var(--modul-auftraege-stein); --modul-text: var(--modul-auftraege-text); --modul-flaeche: var(--modul-auftraege-flaeche); }
.rahmen[data-modul="kunden"] { --modul-stein: var(--modul-kunden-stein); --modul-stein-schiene: var(--modul-kunden-stein); --modul-text: var(--modul-kunden-text); --modul-flaeche: var(--modul-kunden-flaeche); }
.rahmen[data-modul="material"] { --modul-stein: var(--modul-material-stein); --modul-stein-schiene: var(--modul-material-stein); --modul-text: var(--modul-material-text); --modul-flaeche: var(--modul-material-flaeche); }
.rahmen[data-modul="team"] { --modul-stein: var(--modul-team-stein); --modul-stein-schiene: var(--modul-team-stein); --modul-text: var(--modul-team-text); --modul-flaeche: var(--modul-team-flaeche); }

.wortmarke { display: block; height: 1rem; width: auto; }
.karten-kopf { flex-wrap: wrap; }
.karten-untertitel { white-space: nowrap; }
.leiste-kopf .wortmarke { height: 1rem; }
.kopf .wortmarke { height: 1rem; }
.karten-kopf .wortmarke { height: 1.125rem; }

/* Stein: kleiner Baustein im Format der Marke (170 : 100) in der Modulfarbe */
.stein { flex: none; display: inline-block; width: 0.75rem; height: 0.4375rem; border-radius: 999px; background: var(--modul-stein); }
.stein-auftraege { background: var(--modul-auftraege-stein); }
.stein-kunden { background: var(--modul-kunden-stein); }
.stein-material { background: var(--modul-material-stein); }
.stein-serakis { background: var(--serakis-graphit); }
.cu-karten-kopf h2 { display: flex; align-items: center; gap: var(--space-2); }

.stamm-stein { flex: none; display: grid; place-items: center; width: 2.5rem; height: 1.75rem; border-radius: 999px; color: #2b2a28; background: var(--serakis-graphit); }
.stamm-stein.stein-kunden { background: var(--modul-kunden-stein); }
.stamm-stein.stein-material { background: var(--modul-material-stein); }
.stamm-stein.stein-team { background: var(--modul-team-stein); }
.stamm-stein.stein-serakis { color: var(--serakis-papierweiss); }

.kopf-suche { position: relative; }
.kopf-suche-tipp {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); display: none; min-width: 1.25rem; padding: 0 0.3125rem;
  border: 1px solid var(--color-border-strong); border-radius: 5px; background: var(--color-surface); color: var(--color-text-muted);
  font: inherit; font-size: 0.6875rem; font-weight: 600; line-height: 1.125rem; text-align: center;
}
@media (min-width: 64rem) and (pointer: fine) {
  .kopf-suche-tipp { display: block; }
  .kopf-suche:focus-within .kopf-suche-tipp { display: none; }
}

/* Treffer am Handy: Kennung, Text und Pfeil in einer Zeile, die Statusmarke darunter */
@media (max-width: 40rem) {
  .treffer-zeile { grid-template-columns: 3.5rem minmax(0, 1fr) 1.25rem; }
  .treffer-marke { grid-column: 2; justify-content: flex-start; }
  .treffer-pfeil { grid-row: 1; grid-column: 3; }
}

/* ---------- PO-Runde 1: Fehlerzeilen, Suche, leerer Betrieb, Symbolzeilen ---------- */

/* Fehlerzeilen brechen um, der Knopf steht bei Platzmangel in einer eigenen Zeile (wie #codes-hinweis) */
#zahlen-fehler, #suche-fehler { flex-wrap: wrap; align-items: center; }
#zahlen-fehler .knopf, #suche-fehler .knopf { flex: none; white-space: nowrap; }
.treffer .meldung { max-width: none; }

/* Keine Treffer: ruhiger Text in der Karte, ohne eigene Box */
.treffer-leer { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-2) 0; }
.treffer-leer p { max-width: none; }
.treffer-leer p + p { color: var(--color-text-muted); font-size: var(--text-base); }

/* Leerer Betrieb mit Schreibrecht: Karte, Text links, Aktion rechts (am Handy untereinander) */
.karte.cu-leer-karte { display: flex; flex-direction: row; text-align: left; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-6); padding: var(--space-4) 1.25rem; }
.cu-leer-text p { max-width: none; }
.cu-leer-text p + p { margin-top: 0.125rem; color: var(--color-text-muted); font-size: var(--text-base); }
.cu-leer-karte .knopf { flex: none; }

/* Treffer mit Symbol statt Nummer: schmale Kennungsspalte, kein Loch vor dem Titel */
.treffer-zeile.mit-symbol { grid-template-columns: 2rem minmax(0, 1fr) auto 1.5rem; }

/* Suchfeld in der Kopfleiste: bei Inhalt ein × statt des Hinweises „/“, das native Löschen entfällt */
.kopf-suche-x { display: none; }
@media (min-width: 64rem) and (pointer: fine) {
  .kopf-suche input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
  .kopf-suche-x {
    position: absolute; right: 0.375rem; top: 50%; transform: translateY(-50%); width: 1.5rem; height: 1.5rem; padding: 0;
    place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--color-text-muted); cursor: pointer;
  }
  .kopf-suche-x:hover { background: var(--color-soft); color: var(--color-text); }
  .kopf-suche-x .icon { width: 0.875rem; height: 0.875rem; }
  .kopf-suche input:not(:placeholder-shown) ~ .kopf-suche-x { display: grid; }
  .kopf-suche input:not(:placeholder-shown) ~ .kopf-suche-tipp { display: none; }
  .treffer-zeile.mit-symbol { grid-template-columns: 1.5rem minmax(0, 1fr) auto 1.25rem; }
  .treffer-leer { padding: var(--space-1) 0; }
}
@media (max-width: 40rem) {
  .treffer-zeile.mit-symbol { grid-template-columns: 2rem minmax(0, 1fr) 1.25rem; }
}

/* ---------- Aufträge Stufe 2 (T-029, B-25): Arbeitsliste, Anlage, Detail ----------
   Handy und Touch (Basis): Zeilen ab 48 px, Eingaben ab 18 px, Kontrast mindestens 7:1, kein Überlauf bei 390 px.
   Büro-Desktop (ab 1024 px mit Maus): ClickUp-Richtung, kompakte 36-px-Dichte (B-23), WCAG AA (B-24). */

.seitenkopf-mit-stein { display: flex; align-items: center; gap: var(--space-2); }
.karte-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.karte-kopf h2 { margin: 0; }
.formular-fuss { margin-top: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }

/* Schnellansichten in der Auftragsliste */
.auftrag-ansichten {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  margin: 0 0 var(--space-4); padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.auftrag-ansicht {
  display: inline-flex; align-items: center; min-height: var(--touch-min); padding: 0 var(--space-3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-full);
  background: var(--color-surface); color: var(--color-text);
  font-size: var(--text-base); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.auftrag-ansicht:hover { background: var(--color-bg); }
.auftrag-ansicht[aria-current="true"] {
  background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-contrast);
}
.auftrag-ansicht.signal-rot[aria-current="true"] { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }

/* Listenkopf, Spaltenkopf und Paginierung */
.liste-kopf-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
.seite-info { color: var(--color-text-muted); font-size: var(--text-base); font-variant-numeric: tabular-nums; }
.auftrag-kopfzeile { display: none; }

.auftrag-termin { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); font-size: var(--text-base); font-variant-numeric: tabular-nums; }
.auftrag-termin.kein { color: var(--color-text-muted); }
.auftrag-termin.spaet { color: var(--color-danger); font-weight: 600; }
.termin-tag {
  display: inline-flex; align-items: center; padding: 0.0625rem 0.4375rem;
  border: 1px solid var(--color-danger); border-radius: var(--radius-sm);
  color: var(--color-danger); font-size: var(--text-sm); font-weight: 700; line-height: 1.3;
}
.auftrag-avatare { display: none; }
.auftrag-team-text { min-width: 0; overflow-wrap: anywhere; }
.zuweisung-avatar {
  flex: none; display: grid; place-items: center; width: 2rem; height: 2rem;
  border-radius: 50%; background: var(--color-primary); color: #fff;
  font-size: var(--text-sm); font-weight: 700;
}

.paginierung {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border);
}
.paginierung-stand { color: var(--color-text-muted); font-size: var(--text-base); font-variant-numeric: tabular-nums; }
.paginierung-aktionen { display: flex; align-items: center; gap: var(--space-2); }
.paginierung-aktionen .knopf { min-height: var(--touch-min); padding: 0 var(--space-4); width: auto; }
.knopf.deaktiviert { opacity: 0.48; cursor: default; pointer-events: none; }

/* Auftragsdetail: Pfad, Titel mit Status, Beschreibung */
.auftrag-pfad { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1); }
.auftrag-pfad .zurueck { margin-bottom: 0; }
.auftrag-pfad-trenner { color: var(--color-text-muted); }
.auftrag-pfad-nr { color: var(--color-text-muted); font-size: var(--text-base); font-weight: 600; font-variant-numeric: tabular-nums; }
.auftrag-titel-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.auftrag-titel-zeile h1 { margin: 0; }
.auftrag-beschreibung-feld dd {
  margin-top: var(--space-1); padding: var(--space-3);
  background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
}

/* Mobile / schmale Ansicht der Auftragsliste mit Termin-Zeile */
@media (max-width: 63.9375rem) {
  .auftrag-zeile {
    grid-template-columns: minmax(0, 1fr) auto 1.25rem;
    grid-template-areas: "name status pfeil" "ort termin pfeil" "team team pfeil";
    gap: var(--space-1) var(--space-3);
  }
  .auftrag-nr { display: none; }
  .nr-klein { display: inline; font-weight: 600; }
  .auftrag-name { grid-area: name; }
  .auftrag-status { grid-area: status; justify-self: end; }
  .auftrag-ort { grid-area: ort; text-align: left; }
  .auftrag-termin { grid-area: termin; justify-self: end; }
  .auftrag-team { grid-area: team; justify-self: start; text-align: left; }
  .auftrag-pfeil { grid-area: pfeil; }
}
@media (max-width: 40rem) {
  .auftrag-zeile {
    grid-template-columns: minmax(0, 1fr) 1.25rem;
    grid-template-areas: "name pfeil" "status pfeil" "ort pfeil" "termin pfeil" "team pfeil";
    gap: var(--space-2) var(--space-2);
  }
  .auftrag-status { justify-self: start; }
  .auftrag-termin { justify-self: start; }
}

/* Büro-Desktop (ab 1024 px mit Maus): ClickUp-Arbeitsliste, ruhige Anlage und 2-Spalten-Detail */
@media (min-width: 64rem) and (pointer: fine) {
  /* Kontrast- und Hierarchie-Korrektur für .knopf.primaer / .knopf.zurueckhaltend im ClickUp-Desktop */
  .knopf.primaer { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
  .knopf.primaer:hover { background: #000; }
  .knopf.zurueckhaltend { text-decoration: none; color: var(--color-text-muted); }
  .knopf.zurueckhaltend:hover { color: var(--color-text); background: var(--flaeche-weich); }
  #auftrag-neu.knopf.hauptaktion, #zuweisen-ja.knopf.primaer {
    background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text);
  }
  #auftrag-neu.knopf.hauptaktion:hover, #zuweisen-ja.knopf.primaer:hover { background: var(--flaeche-weich); }

  .auftrag-karte { padding: var(--space-4) 1.25rem var(--space-4); }
  .auftrag-karte .leer-zustand { border: 0; background: var(--flaeche-weich); border-radius: 10px; }

  /* ClickUp-Ansicht-Reiter im Kartenkopf */
  .auftrag-ansichten {
    gap: var(--space-4); margin: 0 0 var(--space-3); padding: 0;
    border-bottom: 1px solid var(--color-border);
  }
  .auftrag-ansicht {
    min-height: 0; padding: 0 0 var(--space-2);
    border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px;
    background: transparent; color: var(--color-text-muted); font-size: 0.8125rem; font-weight: 600;
  }
  .auftrag-ansicht:hover { background: transparent; color: var(--color-text); }
  .auftrag-ansicht[aria-current="true"] {
    background: transparent; border-bottom-color: var(--color-text); color: var(--color-text);
  }
  .auftrag-ansicht.signal-rot[aria-current="true"] {
    background: transparent; border-bottom-color: var(--color-danger); color: var(--color-danger);
  }
  .auftrag-ansicht.signal-gelb[aria-current="true"] {
    background: transparent; border-bottom-color: var(--ocker); color: var(--ocker);
  }

  /* Kompakte Werkzeugleiste: Suche + 5 kompakte Filterfelder in ruhiger Zeile */
  .auftrag-filter {
    flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-3);
    margin-bottom: var(--space-3);
  }
  .auftrag-filter .suche { flex: 1 1 15rem; max-width: 24rem; }
  .auftrag-filter .filter-felder {
    flex: 2 1 36rem; max-width: none;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2);
  }
  .auftrag-filter .filter-felder label { font-size: 0.75rem; color: var(--color-text-muted); font-weight: 600; }

  .liste-kopf { padding: var(--space-1) 0 var(--space-2); }
  .listentitel { font-size: 0.9375rem; font-weight: 700; }
  .seite-info { font-size: 0.75rem; }
  .liste-zurueck { min-height: 1.75rem; font-size: 0.8125rem; color: var(--color-text-muted); text-decoration: none; }
  .liste-zurueck:hover { color: var(--color-text); text-decoration: underline; }

  /* ClickUp-Spaltenkopf + kompakte 44-px-Zeilen */
  .auftrag-karte { --auftrag-spalten: 3.75rem minmax(0, 2.2fr) minmax(0, 1fr) 9.5rem minmax(0, 1.15fr) 7.5rem 1rem; }
  .auftrag-kopfzeile {
    display: grid; grid-template-columns: var(--auftrag-spalten); align-items: center;
    gap: 0 var(--space-3); padding: var(--space-2) var(--space-2); margin: 0 calc(-1 * var(--space-2));
    border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border);
    color: var(--color-text-muted); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  }
  .auftrag-zeile {
    grid-template-columns: var(--auftrag-spalten);
    min-height: 2.75rem; padding: 0.375rem var(--space-2); gap: 0 var(--space-3);
    font-size: 0.8125rem;
  }
  .auftrag-zeile:hover { background: var(--flaeche-weich); }
  .auftrag-nr { color: var(--color-text-muted); font-size: 0.75rem; font-weight: 600; }
  .auftrag-name { flex-direction: column; align-items: flex-start; gap: 0.0625rem; }
  .auftrag-name .adresse { font-size: 0.875rem; font-weight: 600; }
  .auftrag-name .meta { font-size: 0.75rem; color: var(--color-text-muted); }
  .auftrag-ort { font-size: 0.8125rem; }
  .auftrag-termin { flex-direction: column; align-items: flex-start; gap: 0.125rem; font-size: 0.75rem; }
  .termin-tag {
    padding: 0 0.375rem; border: 0; border-radius: 4px;
    background: #fef3f2; color: var(--color-danger); font-size: 0.6875rem; font-weight: 700;
  }
  .auftrag-team { align-items: center; gap: var(--space-2); font-size: 0.75rem; }
  .auftrag-team.kein { color: var(--ocker); font-weight: 600; }
  .auftrag-avatare { display: inline-flex; align-items: center; flex: none; }
  .auftrag-avatare .cu-avatar { width: 1.375rem; height: 1.375rem; font-size: 0.625rem; }
  .auftrag-pfeil .icon { width: 0.875rem; height: 0.875rem; }

  .paginierung { margin-top: var(--space-3); padding-top: var(--space-3); }
  .paginierung-stand { font-size: 0.8125rem; }
  .paginierung-aktionen .knopf { min-height: 2rem; padding: 0 var(--space-3); font-size: 0.8125rem; }

  /* Anlage: ruhige zentrierte Formularbreite mit sauberen Paaren */
  .auftrag-neu-karte { max-width: 50rem; padding: var(--space-5, 1.25rem) var(--space-6); }
  .auftrag-neu-karte .gruppe h3, #auftrag-form .gruppe h3 {
    font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted);
  }
  .auftrag-neu-karte .feld-paar.stapel, #auftrag .feld-paar { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Auftragsdetail: links breite Angabenkarte, rechts kompakte Ablauf- & Team-Spalte */
  .auftrag-detail-kopf .auftrag-pfad { margin-bottom: 0.25rem; }
  .auftrag-pfad .zurueck { min-height: 1.5rem; font-size: 0.8125rem; color: var(--color-text-muted); }
  .auftrag-pfad .zurueck:hover { color: var(--color-text); }
  .auftrag-pfad-nr { font-size: 0.8125rem; }
  .auftrag-raster { grid-template-columns: minmax(0, 1fr) 23rem; align-items: start; gap: var(--space-5, 1.25rem); }
  .auftrag-angaben { padding: var(--space-5, 1.25rem) var(--space-6); }
  .auftrag-angaben h2, #stand h2, #zuweisungen h2 { font-size: 0.9375rem; font-weight: 700; }
  .auftrag-daten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-6); }
  .auftrag-daten dt { font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
  .auftrag-daten dd { font-size: 0.875rem; }
  .auftrag-beschreibung-feld { grid-column: 1 / -1; }
  .auftrag-beschreibung-feld dd { background: var(--flaeche-weich); border-radius: 8px; }
  .auftrag-spalte { gap: var(--space-4); }
  .auftrag-spalte > .karte { padding: var(--space-4) 1.25rem; }
  .auftrag-schritte { gap: var(--space-2); }
  .auftrag-schritte .knopf, .auftrag-schritte .knopf.hauptaktion { padding: 0 var(--space-4); font-size: 0.8125rem; }
  .zuweisung-avatar { width: 1.75rem; height: 1.75rem; background: var(--modul-team-text); font-size: 0.6875rem; }
  .zuweisungen .mitglied { padding: var(--space-2) 0; }
  .zuweisungen .zeile-aktionen .knopf { min-height: 1.875rem; padding: 0 var(--space-2); font-size: 0.75rem; }
  .zuweisen-form { gap: var(--space-2); }
  .zuweisen-form .knopf { min-height: var(--feld); padding: 0 var(--space-3); font-size: 0.8125rem; }
  .verlauf { margin-top: var(--space-4); padding-top: var(--space-3); }
  .verlauf h3 { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); }
  .verlauf-liste li { font-size: 0.8125rem; }
}

/* Zwischenbreite Desktop (1024–1360 px, inkl. 1280×720): Suche oben, 5 Filter kompakt in einer Zeile ohne Loch */
@media (min-width: 64rem) and (pointer: fine) and (max-width: 85rem) {
  .auftrag-karte { --auftrag-spalten: 3.5rem minmax(0, 2fr) minmax(0, 0.9fr) 8.25rem minmax(0, 1fr) 7rem 1rem; }
  .auftrag-filter { flex-direction: column; align-items: stretch; gap: var(--space-2); }
  .auftrag-filter .suche { flex: none; max-width: 28rem; }
  .auftrag-filter .filter-felder { flex: none; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .auftrag-raster { grid-template-columns: minmax(0, 1fr) 20rem; }
}

/* ---------- Kunden, Artikel & Lieferanten Stufe 3 (T-030, B-25) ----------
   Handy und Touch (Basis): Zeilen ab 48 px, Eingaben ab 18 px, Kontrast mindestens 7:1, kein Überlauf bei 390 px.
   Büro-Desktop (ab 1024 px mit Maus): ClickUp-/folk-/Stripe-Richtung, kompakte 36-px-Dichte (B-23), WCAG AA (B-24). */

.kunden-kopfzeile { display: none; }
.suche input { padding-right: var(--space-3); }
.suche:has(.suche-x) input { padding-right: var(--touch-min); }

@media (min-width: 64rem) and (pointer: fine) {
  a.knopf.zurueckhaltend { text-decoration: none; }
  .auftrag-pfad .zurueck { text-decoration: none; }
  .auftrag-pfad .zurueck:hover { text-decoration: underline; }
  /* Kopfaktionen im Büro: ruhige weiße Sekundärknöpfe neben der schwarzen Kopfleisten-Hauptaktion */
  .seitenkopf #kunde-neu.knopf.hauptaktion,
  .seitenkopf #artikel-neu.knopf.hauptaktion,
  .seitenkopf #lieferant-neu.knopf.hauptaktion {
    background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text);
  }
  .seitenkopf #kunde-neu.knopf.hauptaktion:hover,
  .seitenkopf #artikel-neu.knopf.hauptaktion:hover,
  .seitenkopf #lieferant-neu.knopf.hauptaktion:hover {
    background: var(--flaeche-weich);
  }
  .seitenkopf-aktionen .knopf.kompakt-knopf { min-height: var(--feld); padding: 0 var(--space-3); font-size: 0.8125rem; }

  .kunden-karte, .artikel-karte, .lieferanten-karte { padding: var(--space-4) 1.25rem var(--space-4); }

  /* Ruhiger Leerzustand im Kartenstil ohne gestrichelten Kasten */
  .kunden-karte .leer-zustand,
  .artikel-karte .leer-zustand,
  .lieferanten-karte .leer-zustand {
    border: 0; background: var(--flaeche-weich); border-radius: 10px; padding: var(--space-5, 1.25rem);
  }
  .kunden-karte .leer-zustand p,
  .artikel-karte .leer-zustand p,
  .lieferanten-karte .leer-zustand p { font-size: 0.875rem; }
  .kunden-karte .leer-zustand p + p,
  .artikel-karte .leer-zustand p + p,
  .lieferanten-karte .leer-zustand p + p { color: var(--color-text-muted); font-size: 0.8125rem; }

  /* Werkzeugleiste: Suche links, kompakter Segment-Umschalter rechts */
  .kunden-karte .listenkopf.werkzeuge,
  .artikel-karte .listenkopf.werkzeuge,
  .lieferanten-karte .listenkopf.werkzeuge {
    align-items: center; gap: var(--space-3); margin-bottom: var(--space-3);
  }
  .kunden-karte .werkzeuge .suche,
  .artikel-karte .werkzeuge .suche { flex: 1 1 18rem; max-width: 26rem; }
  .kunden-karte .werkzeuge .suche input,
  .artikel-karte .werkzeuge .suche input { border-radius: 8px; font-size: 0.8125rem; }
  .kunden-karte .werkzeuge .suche input:focus-visible,
  .artikel-karte .werkzeuge .suche input:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }

  .kunden-karte .segment,
  .artikel-karte .segment,
  .lieferanten-karte .segment {
    padding: 2px; gap: 2px; background: var(--flaeche-weich);
    border: 1px solid var(--color-border); border-radius: 8px;
  }
  .kunden-karte .segment button,
  .artikel-karte .segment button,
  .lieferanten-karte .segment button {
    min-height: var(--touch-min); padding: 0 0.75rem; border-radius: 6px;
    color: var(--color-text-muted); font-size: 0.8125rem; font-weight: 500;
  }
  .kunden-karte .segment button + button,
  .artikel-karte .segment button + button,
  .lieferanten-karte .segment button + button { border-left: 0; }
  .kunden-karte .segment button:hover,
  .artikel-karte .segment button:hover,
  .lieferanten-karte .segment button:hover { background: rgba(43, 42, 40, 0.04); color: var(--color-text); }
  .kunden-karte .segment button[aria-pressed="true"],
  .artikel-karte .segment button[aria-pressed="true"],
  .lieferanten-karte .segment button[aria-pressed="true"] {
    background: var(--color-surface); color: var(--color-text); font-weight: 600;
    box-shadow: 0 1px 2px rgba(43, 42, 40, 0.08);
  }
  .kunden-karte .segment button[aria-pressed="true"]:focus-visible,
  .artikel-karte .segment button[aria-pressed="true"]:focus-visible,
  .lieferanten-karte .segment button[aria-pressed="true"]:focus-visible {
    outline-color: var(--color-focus);
  }

  .kunden-karte .listentitel,
  .artikel-karte .listentitel,
  .lieferanten-karte .listentitel { font-size: 0.875rem; font-weight: 700; margin-bottom: var(--space-2); }
  .lieferanten-karte .listenkopf.werkzeuge .listentitel { margin-bottom: 0; }
  .kunden-karte .listentitel .zahl,
  .artikel-karte .listentitel .zahl,
  .lieferanten-karte .listentitel .zahl { background: var(--flaeche-weich); color: var(--color-text-muted); font-size: 0.75rem; }

  /* Status-Pillen in Kunden-, Artikel- und Lieferantenliste wie in ClickUp */
  .kunden-karte .rolle-tag,
  .artikel-karte .rolle-tag,
  .lieferanten-karte .rolle-tag {
    min-height: 1.375rem; margin-right: 0; padding: 0 0.5rem; gap: 0.25rem; border: 0; border-radius: 5px;
    background: #e4f5eb; color: #1f6b3c;
    font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  }
  .kunden-karte .rolle-tag .icon,
  .artikel-karte .rolle-tag .icon,
  .lieferanten-karte .rolle-tag .icon { width: 0.75rem; height: 0.75rem; }
  .kunden-karte .rolle-tag.aus,
  .artikel-karte .rolle-tag.aus,
  .lieferanten-karte .rolle-tag.aus { background: #ecebe7; color: #4f4d48; border: 0; font-weight: 700; }

  /* Kundenliste als ruhige Geschäftstabelle mit Spaltenkopf */
  .kunden-tabelle { --kunden-spalten: minmax(0, 2.2fr) minmax(0, 1.15fr) 8.5rem 5.5rem 1rem; display: flex; flex-direction: column; }
  .kunden-tabelle.ohne-status { --kunden-spalten: minmax(0, 2.2fr) minmax(0, 1.15fr) 8.5rem 1rem; }
  .kunden-kopfzeile {
    display: grid; grid-template-columns: var(--kunden-spalten); align-items: center;
    gap: 0 var(--space-3); padding: var(--space-2); margin: 0 calc(-1 * var(--space-2));
    border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border);
    color: var(--color-text-muted); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  }
  .kunden-tabelle .kunde-zeile,
  .kunden-tabelle .kunden.ohne-status .kunde-zeile {
    grid-template-columns: var(--kunden-spalten);
    min-height: 2.75rem; padding: 0.375rem var(--space-2); gap: 0 var(--space-3);
    font-size: 0.8125rem;
  }
  .kunden-tabelle .kunde-zeile:hover { background: var(--flaeche-weich); }
  .kunden-tabelle .kunde-name { flex-direction: column; align-items: flex-start; gap: 0.0625rem; }
  .kunden-tabelle .kunde-name .adresse { font-size: 0.875rem; font-weight: 600; }
  .kunden-tabelle .kunde-name .meta { font-size: 0.75rem; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
  .kunden-tabelle .kunde-ort { font-size: 0.8125rem; color: var(--color-text-muted); }
  .kunden-tabelle .kunde-orte { font-size: 0.8125rem; font-weight: 500; }
  .kunden-tabelle .kunde-pfeil .icon { width: 0.875rem; height: 0.875rem; }

  /* Artikelliste als einheitliche Geschäftstabelle */
  .artikel-karte .artikel-tabelle { --spalten: minmax(0, 2.4fr) 5.5rem 4.25rem 7.75rem 12rem 5.25rem 1rem; }
  .artikel-karte .artikel-tabelle.ohne-status { --spalten: minmax(0, 2.4fr) 5.5rem 4.25rem 7.75rem 12rem 1rem; }
  .artikel-karte .artikel-tabelle.ohne-preis { --spalten: minmax(0, 2.4fr) 5.5rem 4.25rem 7.75rem 5.25rem 1rem; }
  .artikel-karte .artikel-tabelle.ohne-preis.ohne-status { --spalten: minmax(0, 2.4fr) 5.5rem 4.25rem 7.75rem 1rem; }
  .artikel-karte .artikel-kopfzeile {
    gap: 0 var(--space-3); padding: var(--space-2); margin: 0 calc(-1 * var(--space-2));
    border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border);
    color: var(--color-text-muted); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  }
  .artikel-karte .artikel-zeile {
    min-height: 2.75rem; padding: 0.375rem var(--space-2); gap: 0 var(--space-3);
    font-size: 0.8125rem;
  }
  .artikel-karte .artikel-zeile:hover { background: var(--flaeche-weich); }
  .artikel-karte .artikel-name { flex-direction: column; align-items: flex-start; gap: 0.0625rem; }
  .artikel-karte .artikel-name .adresse { font-size: 0.875rem; font-weight: 600; }
  .artikel-karte .artikel-name .meta { font-size: 0.75rem; color: var(--color-text-muted); }
  .artikel-karte .artikel-nummer,
  .artikel-karte .artikel-gtin { font-size: 0.75rem; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
  .artikel-karte .artikel-einheit { font-size: 0.8125rem; font-weight: 500; }
  .artikel-karte .artikel-preis { font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .artikel-karte .artikel-preis.kein,
  .kunden-tabelle .kunde-orte.kein { font-weight: 400; color: var(--color-text-muted); }
  /* Einkauf steht rechtsbündig vor Status: klare Trennung, sobald die Statusspalte da ist (Alle) */
  .artikel-karte .artikel-tabelle:not(.ohne-status) .artikel-preis,
  .artikel-karte .artikel-tabelle:not(.ohne-status) .artikel-kopfzeile .rechts { padding-right: var(--space-4); }
  .artikel-karte .artikel-pfeil .icon { width: 0.875rem; height: 0.875rem; }

  /* Lieferantenliste: kompakte Zeilen, ruhige Inline-Formulare und leise Zeilenaktionen */
  .lieferanten-karte .mitglied { padding: var(--space-2) 0; }
  .lieferanten-karte .mitglied-kopf { align-items: center; gap: var(--space-2) var(--space-4); min-height: 2.5rem; }
  .lieferanten-karte .adresse { font-size: 0.875rem; font-weight: 600; }
  .lieferanten-karte .meta.notiz { font-size: 0.75rem; color: var(--color-text-muted); }
  .lieferanten-karte .zeile-aktionen { gap: var(--space-2); }
  .lieferanten-karte .zeile-aktionen .knopf { min-height: var(--touch-min); padding: 0 var(--space-3); font-size: 0.75rem; }
  .lieferanten-karte .panel {
    background: var(--flaeche-weich); border: 1px solid var(--color-border); border-radius: 10px;
    padding: var(--space-4); margin-bottom: var(--space-3); max-width: 40rem;
  }
  .lieferanten-karte .mitglied .panel { margin-bottom: 0; }
  .lieferanten-karte .panel h2 { font-size: 0.875rem; font-weight: 700; }
  .lieferanten-karte .panel p { font-size: 0.8125rem; }
  .lieferanten-karte .panel .aktionen .knopf.hauptaktion,
  .lieferanten-karte .panel .aktionen .knopf.primaer { min-height: var(--feld); padding: 0 var(--space-4); font-size: 0.8125rem; }
  .lieferanten-karte .panel .aktionen .knopf.zurueckhaltend { min-height: var(--feld); padding: 0 var(--space-3); font-size: 0.8125rem; }

  /* Anlageformulare für Kunden und Artikel: ruhige Breite und Gruppentitel wie bei Aufträgen */
  .stamm-neu-karte { max-width: 50rem; padding: var(--space-5, 1.25rem) var(--space-6); }
  .stamm-neu-karte .gruppe h3 {
    font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted);
  }
  .stamm-neu-karte .gruppe > .hilfe,
  .stamm-neu-karte .feld .hilfe { font-size: 0.75rem; }
  .stamm-neu-karte .pflicht { font-size: 0.6875rem; padding: 0.0625rem 0.375rem; }
}

/* Zwischenbreite Desktop (1024–1360 px, inkl. 1280×720): ausgewogene Spalten für Kunden und Artikel */
@media (min-width: 64rem) and (pointer: fine) and (max-width: 85rem) {
  .kunden-tabelle { --kunden-spalten: minmax(0, 2fr) minmax(0, 1fr) 7.75rem 5rem 1rem; }
  .kunden-tabelle.ohne-status { --kunden-spalten: minmax(0, 2fr) minmax(0, 1fr) 7.75rem 1rem; }
  .artikel-karte .artikel-tabelle { --spalten: minmax(0, 2fr) 5rem 3.75rem 7.25rem 11rem 4.75rem 1rem; }
  .artikel-karte .artikel-tabelle.ohne-status { --spalten: minmax(0, 2fr) 5rem 3.75rem 7.25rem 11rem 1rem; }
  .artikel-karte .artikel-tabelle.ohne-preis { --spalten: minmax(0, 2fr) 5rem 3.75rem 7.25rem 4.75rem 1rem; }
  .artikel-karte .artikel-tabelle.ohne-preis.ohne-status { --spalten: minmax(0, 2fr) 5rem 3.75rem 7.25rem 1rem; }
}

/* Artikelliste ab 1024 px mit Maus durchgehend als Tabelle: hebt das Tablet-Layout (max. 75 rem) wieder auf */
@media (min-width: 64rem) and (pointer: fine) and (max-width: 75rem) {
  .artikel-karte .artikel-kopfzeile { display: grid; }
  .artikel-karte .artikel-zeile,
  .artikel-karte .artikel-tabelle.ohne-status .artikel-zeile,
  .artikel-karte .artikel-tabelle.ohne-preis .artikel-zeile { grid-template-columns: var(--spalten); grid-template-areas: none; }
  .artikel-karte .artikel-name, .artikel-karte .artikel-meta, .artikel-karte .artikel-preis,
  .artikel-karte .artikel-status, .artikel-karte .artikel-pfeil { grid-area: auto; }
  .artikel-karte .artikel-meta { display: contents; }
  .artikel-karte .artikel-meta > span:empty { display: block; }
  .artikel-karte .artikel-meta > span::before { content: none; }
  .artikel-karte .artikel-preis { text-align: right; }
}

/* Handy: Knopf im Leerzustand mit Innenabstand oben und unten */
@media (max-width: 63.9375rem) {
  .leer-zustand .knopf, .leer-zustand .knopf.hauptaktion.kompakt { padding-block: var(--space-2); }
}

/* ---------- Detailseiten Kunde und Artikel, Stufe 4 (T-031, B-25) ----------
   Gleicher Aufbau wie das Auftragsdetail: breite Hauptspalte (Stammdaten, Listen), schmale Seitenspalte (Status, Preis).
   Handy und Touch (Basis): eine Spalte, Knöpfe ab 48 px, Eingaben ab 18 px, Kontrast mindestens 7:1.
   Büro-Desktop (ab 1024 px mit Maus): kompakte 36-px-Dichte (B-23), WCAG AA (B-24). */

.detail-haupt { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.detail-raster { grid-template-columns: minmax(0, 1fr); }
.detail-raster > .detail-haupt { position: static; }
.detail-kopf .auftrag-titel-zeile .stein { align-self: center; }
.detail-kopf .auftrag-titel-zeile h1 { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.detail-kopf .kopf-tag { margin-left: 0; }
.kopf-link { gap: var(--space-2); text-decoration: none; }
.kopf-link .icon { width: 1.125rem; height: 1.125rem; flex: none; }
.status-chip { background: #e4f5eb; color: #1f6b3c; border-color: transparent; }
@media (min-width: 70.0625rem) {
  .detail-raster { grid-template-columns: minmax(0, 1fr) 22rem; }
}

@media (min-width: 64rem) and (pointer: fine) {
  .detail-kopf { align-items: flex-end; }
  .detail-kopf .auftrag-titel-zeile { flex-wrap: nowrap; gap: var(--space-3); }
  .detail-kopf .stein { width: 0.875rem; height: 0.5rem; }
  .detail-kopf .rolle { font-size: 0.8125rem; color: var(--color-text-muted); }
  .kopf-link { background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text); }
  .kopf-link:hover { background: var(--flaeche-weich); }

  .detail-raster { gap: var(--space-5, 1.25rem); align-items: start; }
  .detail-haupt, .detail-seite { gap: var(--space-4); }
  .detail-haupt > .karte, .detail-seite > .karte { padding: var(--space-4) 1.25rem; gap: var(--space-3); }
  .detail-haupt > .karte.auftrag-angaben { padding: var(--space-5, 1.25rem) var(--space-6); }
  .detail-haupt > .karte h2, .detail-seite > .karte h2 { font-size: 0.9375rem; font-weight: 700; }
  .detail-haupt .listenkopf { margin-bottom: 0; }
  .detail-haupt .listenkopf .zahl { background: var(--flaeche-weich); color: var(--color-text-muted); font-size: 0.75rem; }
  .detail-haupt > .karte > .hilfe, .detail-seite > .karte > .hilfe { font-size: 0.8125rem; color: var(--color-text-muted); margin: 0; }
  .detail-haupt .listenkopf .knopf, .detail-haupt .karte-kopf .knopf, .detail-seite .listenkopf .knopf,
  .detail-seite .aktionen .knopf { min-height: var(--feld); padding: 0 var(--space-3); font-size: 0.8125rem; }
  .detail-haupt .listenkopf .knopf.hauptaktion { background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text); }
  .detail-haupt .listenkopf .knopf.hauptaktion:hover { background: var(--flaeche-weich); }

  /* Status-Pillen wie in den Listen (T-030) */
  .detail-kopf .rolle-tag, .detail-seite .rolle-tag, .detail-haupt .mitglied .rolle-tag {
    min-height: 1.375rem; margin-right: 0; padding: 0 0.5rem; gap: 0.25rem; border: 0; border-radius: 5px;
    font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  }
  .detail-kopf .rolle-tag .icon, .detail-seite .rolle-tag .icon { width: 0.75rem; height: 0.75rem; }
  .detail-kopf .rolle-tag.aus, .detail-seite .rolle-tag.aus, .detail-haupt .mitglied .rolle-tag.aus { background: #ecebe7; color: #4f4d48; }
  .detail-seite .stand-zeile { margin: 0; }
  .detail-seite .stand-zeile .leise { font-size: 0.8125rem; }

  /* Stammdaten: Datenraster und Rückfragen */
  .detail-haupt .auftrag-daten .kontakt { font-size: 0.875rem; }
  .detail-haupt .auftrag-daten .leise { font-size: 0.75rem; }
  #kunde-anschrift { grid-column: auto; }
  .detail-haupt .panel, .detail-seite .panel {
    background: var(--flaeche-weich); border: 1px solid var(--color-border); border-radius: 10px;
    padding: var(--space-4); max-width: 40rem;
  }
  .detail-seite .panel { max-width: none; }
  .detail-haupt .panel h3 { font-size: 0.875rem; font-weight: 700; }
  .detail-haupt .panel p, .detail-seite .panel p { font-size: 0.8125rem; }
  .detail-haupt .panel .aktionen .knopf.hauptaktion, .detail-haupt .panel .aktionen .knopf.primaer,
  .detail-seite .panel .aktionen .knopf.hauptaktion, .detail-seite .panel .aktionen .knopf.primaer { min-height: var(--feld); padding: 0 var(--space-4); font-size: 0.8125rem; }
  .detail-haupt .panel .aktionen .knopf.zurueckhaltend, .detail-seite .panel .aktionen .knopf.zurueckhaltend { min-height: var(--feld); padding: 0 var(--space-3); font-size: 0.8125rem; text-decoration: none; }
  .detail-haupt .formular-fuss .knopf.zurueckhaltend { text-decoration: none; }
  .detail-haupt .gruppe h3 {
    font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted);
  }
  .detail-haupt .formular .gruppe > .hilfe, .detail-haupt .formular .feld .hilfe { font-size: 0.75rem; }
  .detail-haupt .formular .pflicht { font-size: 0.6875rem; padding: 0.0625rem 0.375rem; }
  #artikel-form, #kunde-form, #stammdaten .feld-paar { max-width: 46rem; }
  #stammdaten .feld-paar { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* Listen im Detail (Einsatzorte, Kennungen, Packungen): kompakte Zeilen, leise Zeilenaktionen */
  .detail-haupt .mitglieder .mitglied { padding: var(--space-2) 0; }
  .detail-haupt .mitglied-kopf { align-items: center; gap: var(--space-2) var(--space-4); min-height: 2.5rem; }
  .detail-haupt .orte .mitglied-kopf { align-items: flex-start; }
  .detail-haupt .adresse { font-size: 0.875rem; font-weight: 600; }
  .detail-haupt .ort-adresse:not(.adresse), .detail-haupt .meta { font-size: 0.8125rem; color: var(--color-text-muted); }
  .detail-haupt .ort-symbol { width: 2rem; height: 2rem; border-radius: 8px; background: var(--modul-kunden-flaeche); color: var(--modul-kunden-text); }
  .detail-haupt .ort-symbol .icon { width: 1rem; height: 1rem; }
  .detail-haupt .ort-hinweis { font-size: 0.8125rem; }
  .detail-haupt .zeile-aktionen { gap: var(--space-2); }
  .detail-haupt .zeile-aktionen .knopf { min-height: var(--touch-min); padding: 0 var(--space-3); font-size: 0.75rem; text-decoration: none; }
  .detail-haupt .orte .mitglied-kopf .aktionen.unter { margin-left: auto; flex: 0 0 auto; }
  .detail-haupt .mitglieder .mitglied.inaktiv { opacity: 1; }

  /* Ruhige Leerzustände ohne gestrichelten Kasten */
  .detail-haupt .leer-zustand, .detail-seite .leer-zustand {
    border: 0; background: var(--flaeche-weich); border-radius: 10px; padding: var(--space-5, 1.25rem);
  }
  .detail-haupt .leer-zustand p, .detail-seite .leer-zustand p { font-size: 0.875rem; }
  .detail-haupt .leer-zustand p + p, .detail-seite .leer-zustand p + p { color: var(--color-text-muted); font-size: 0.8125rem; }
  .detail-haupt .leer-zustand .knopf, .detail-seite .leer-zustand .knopf { min-height: var(--feld); padding: 0 var(--space-3); font-size: 0.8125rem; }

  /* Einkaufspreis */
  .detail-seite .preis-wert { font-size: 1.375rem; }
  .detail-seite .preis-anzeige { gap: var(--space-1); }
  .detail-seite .preis-anzeige .aktionen .knopf.zurueckhaltend { margin-left: 0; }
}

/* Notiz-Hinweis und Monteurhinweis: Hinweiszeile ohne eigenen Kasten, Beschriftung mit Abstand */
.auftrag-beschreibung-feld dd.leise { padding: 0; background: none; border: 0; margin-top: var(--space-1); }
.ort-hinweis strong { margin-right: var(--space-2); }
@media (min-width: 64rem) and (pointer: fine) {
  .detail-haupt .ort-hinweis { padding: var(--space-2) var(--space-3); background: var(--flaeche-weich); border: 0; border-radius: 8px; margin-top: var(--space-1); }
}

/* Bearbeiten-Formular in der Karte: Titel der ersten Gruppe doppelt den Kartentitel, Paare stehen nebeneinander */
#kunde-form .gruppe:first-child > h3, #artikel-form .gruppe:first-child > h3 { display: none; }
@media (min-width: 64rem) and (pointer: fine) {
  #kunde .feld-paar, #stammdaten .feld-paar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #kunde .feld-paar.plz-ort { grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); }
}

/* Handy: Zeilenaktionen als zwei gleich breite Knöpfe mit Rand statt unterstrichener Textzeilen */
@media (max-width: 63.9375rem), (pointer: coarse) {
  .detail-haupt .mitglieder .mitglied-kopf .aktionen.zeile-aktionen { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: stretch; gap: var(--space-2); width: 100%; margin-left: 0; }
  .detail-haupt .mitglieder .zeile-aktionen .knopf.zurueckhaltend {
    flex: 1 1 8rem; width: auto; justify-content: center; text-decoration: none;
    border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface);
  }
}

/* Handy: Kopfaktion über die ganze Breite */
@media (max-width: 63.9375rem), (pointer: coarse) {
  .detail-kopf .seitenkopf-aktionen { width: 100%; }
  .detail-kopf .seitenkopf-aktionen .knopf { width: 100%; min-height: var(--touch-min); }
}

/* ---------- Hilfe hinter dem ?-Symbol (B-27) ----------
   Erklärungen stehen nicht als Dauertext über Abschnitten und Feldern.
   Maus: Hover und Tastaturfokus öffnen einen schwebenden Text, Escape schließt ihn.
   Touch und schmale Fenster: Tap öffnet den Text in voller Kartenbreite unter der Zeile (er verdeckt nichts), erneuter Tap
   oder ein Tap daneben schließt ihn.
   Trefferfläche: 48 px am Handy, 36 px am Büro-Desktop (der Kreis selbst bleibt klein). */
.feld-kopf, .kopf-titel, .gruppen-kopf { display: flex; align-items: center; flex-wrap: wrap; gap: 0 var(--space-1); min-width: 0; }
.feld-kopf label { min-width: 0; }
.hilfe-icon { display: contents; }
.hilfe-knopf {
  appearance: none; display: grid; place-items: center; flex: none; cursor: help;
  width: var(--touch-min); height: var(--touch-min); margin: calc((1.375rem - var(--touch-min)) / 2);
  padding: 0; background: transparent; border: 0; color: var(--color-text);
}
.hilfe-knopf > span {
  display: grid; place-items: center; width: 1.375rem; height: 1.375rem; border: 1px solid var(--color-border-strong);
  border-radius: 50%; background: var(--color-surface); font-size: 0.75rem; font-weight: 700; line-height: 1;
}
.hilfe-knopf:hover > span { background: var(--flaeche-weich, #f1f0ed); }
.hilfe-knopf:focus-visible { outline: 3px solid var(--color-focus); outline-offset: -4px; border-radius: 50%; }

/* Basis (Handy, Touch): Text als eigene Zeile in voller Breite des Kopfes */
.kopf-titel { flex: 1 1 100%; }
.hilfe-pop {
  display: none; flex: 1 1 100%; box-sizing: border-box; margin: var(--space-1) 0 var(--space-2);
  padding: var(--space-2) var(--space-3); background: #2b2a28; color: #fff; border-radius: 8px;
  font-size: var(--text-base); font-weight: 400; line-height: 1.4; letter-spacing: 0; text-transform: none; text-align: left;
}
.hilfe-icon.offen .hilfe-pop, .hilfe-icon:has(.hilfe-knopf:focus-visible) .hilfe-pop { display: block; }
@media (hover: hover) { .hilfe-icon:hover .hilfe-pop { display: block; } }
.hilfe-icon.zu .hilfe-pop { display: none !important; }
.gruppen-kopf h3 { margin: 0; }

/* Büro-Desktop mit Maus: schwebender Text am Symbol. Ein Klick pinnt nichts, so schließt Wegbewegen immer. */
@media (min-width: 64rem) and (pointer: fine) {
  .feld, .kopf-titel, .gruppen-kopf { position: relative; }
  .hilfe-icon { display: inline-flex; flex: none; align-items: center; position: relative; }
  .kopf-titel { flex: 0 1 auto; flex-wrap: nowrap; }
  .hilfe-pop {
    position: absolute; z-index: 40; flex: none; top: 100%; left: 0; width: max-content; max-width: 20rem; margin: -0.125rem 0 0;
    box-shadow: 0 6px 18px rgba(21, 23, 26, 0.22); font-size: 0.8125rem;
  }
  .hilfe-icon.offen .hilfe-pop { display: none; }
  .hilfe-icon:hover .hilfe-pop, .hilfe-icon:has(.hilfe-knopf:focus-visible) .hilfe-pop { display: block; }
  /* Seitenspalte: der Text endet am Symbol und reicht nach links, damit er im Bild bleibt */
  .detail-seite .hilfe-pop { left: auto; right: 0; }
  .gruppen-kopf h3, .kopf-titel h2 { margin: 0; }
}

.detail-haupt .mitglied > .panel { margin-top: var(--space-2); }

@media (min-width: 64rem) and (pointer: fine) {
  .detail-seite .stand-zeile .leise { color: var(--color-text); }
}

/* Paket 1 und 2 (PO-Runde 1): Seitenspalte einspaltig, Feldköpfe mit gleicher Höhe, damit Paare auf einer Linie stehen */
.feld-kopf { min-height: 1.5rem; }
.detail-seite .feld-paar { grid-template-columns: minmax(0, 1fr); }

/* Paket 3: Inaktiv-Pille in Zeilen und im Kopf wie der Status-Chip, auch am Handy (Kontrast über 7:1) */
.detail-kopf .rolle-tag.aus, .detail-haupt .mitglied .rolle-tag.aus, .detail-seite .rolle-tag.aus {
  min-height: 1.5rem; padding: 0 var(--space-2); border: 0; border-radius: 5px;
  background: #ecebe7; color: #15171a; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
}

/* Paket 3: Handy, Einkaufspreis: „Preis ändern“ in voller Breite, „Preis entfernen“ bleibt die ruhige Zweitaktion */
@media (max-width: 63.9375rem), (pointer: coarse) {
  #preis .listenkopf .knopf { width: 100%; justify-content: center; }
}

/* ---------- Team, Konto und Anmeldung, Stufe 5 (T-032, B-25, B-27) ----------
   Handy und Touch (Basis): Knöpfe ab 48 px, Eingaben ab 18 px, Kontrast mindestens 7:1, kein Überlauf bei 390 px.
   Büro-Desktop (ab 1024 px mit Maus): kompakte 36-px-Dichte (B-23), WCAG AA (B-24). */

.stein-team { background: var(--modul-team-stein); }
.titel-zeile { align-items: center; }
.titel-zeile h1 { margin: 0; }
.schluessel-label { font-size: var(--text-base); font-weight: 500; }
.codes-hinweis { font-weight: 500; }
.einstieg-fuss { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.einstieg-fuss .knopf { gap: var(--space-2); }
.einstieg .knopf .icon { flex: none; }
.betrieb-titel { color: var(--color-text); font-weight: 600; overflow-wrap: anywhere; }

/* Druck: Hilfetext der Codes steht im Ausdruck, das ?-Symbol nicht */
@media print {
  .hilfe-knopf { display: none !important; }
  .hilfe-pop { display: block !important; position: static !important; width: auto !important; max-width: none !important; padding: 0 !important; margin: 0 !important; background: none !important; color: #000 !important; box-shadow: none !important; font-size: 11pt !important; }
  .codes-karte .kopf-titel { display: block; }
  .codes-karte .kopf-titel h1 { margin-bottom: 4pt; }
}

@media (min-width: 64rem) and (pointer: fine) {
  /* Kopf und Karten wie in den Listen (T-030) */
  .team-seite .seitenkopf-mit-stein .stein { width: 0.875rem; height: 0.5rem; }
  .team-seite .seitenkopf { align-items: center; }
  .team-seite .rolle { font-size: 0.8125rem; color: var(--color-text-muted); }
  .team-seite .seitenkopf #einladen-schnell, .team-seite .seitenkopf #anlegen-schnell {
    background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text);
    min-height: var(--feld); padding: 0 var(--space-3); font-size: 0.8125rem;
  }
  .team-seite .seitenkopf #einladen-schnell:hover, .team-seite .seitenkopf #anlegen-schnell:hover { background: var(--flaeche-weich); }
  .team-seite .mitglieder-raster { gap: var(--space-5, 1.25rem); grid-template-columns: minmax(0, 1fr) 21rem; }
  .team-seite .spalte-haupt, .team-seite .spalte-neben { gap: var(--space-4); }
  .team-seite .karte { padding: var(--space-4) 1.25rem; gap: var(--space-3); box-shadow: 0 1px 1px rgba(21, 23, 26, 0.05); }
  .team-seite .karte h2 { font-size: 0.9375rem; font-weight: 700; }
  .team-seite .zahl { background: var(--flaeche-weich); color: var(--color-text-muted); font-size: 0.75rem; }
  .team-seite .leer { padding: var(--space-4) var(--space-5, 1.25rem); background: var(--flaeche-weich); border-radius: 10px; font-size: 0.875rem; max-width: none; }

  /* Zeilen */
  .team-seite .mitglied { padding: var(--space-2) 0; }
  .team-seite .mitglied-kopf { align-items: center; gap: var(--space-2) var(--space-4); min-height: 2.5rem; }
  .team-seite .avatar { width: 2rem; height: 2rem; font-size: 0.6875rem; }
  .team-seite .adresse { font-size: 0.875rem; font-weight: 600; }
  .team-seite .meta { font-size: 0.8125rem; color: var(--color-text-muted); }
  .team-seite .mitglied.inaktiv .adresse { color: var(--color-text-muted); }
  .team-seite .du { min-height: 1.25rem; padding: 0 0.375rem; border: 0; border-radius: 5px; background: var(--modul-team-flaeche); color: var(--modul-team-text); font-size: 0.6875rem; font-weight: 700; }
  .team-seite .rolle-tag {
    min-height: 1.375rem; margin-right: 0; padding: 0 0.5rem; gap: 0.25rem; border: 0; border-radius: 5px;
    background: #ecebe7; color: #15171a; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  }
  .team-seite .rolle-tag .icon { width: 0.75rem; height: 0.75rem; }
  .team-seite .rolle-tag:has(.icon-check) { background: #e4f5eb; color: #1f6b3c; }
  .team-seite .aktionen.unter, .team-seite .mitglied-kopf .aktionen { gap: var(--space-2); margin-top: 0; }
  .team-seite .mitglied-kopf .aktionen .knopf, .team-seite .zeile-aktionen .knopf {
    min-height: var(--touch-min); padding: 0 var(--space-3); font-size: 0.75rem;
  }
  .team-seite .zeile-aktionen .knopf.umschalten { min-width: 0; }
  .team-seite .mitglied-kopf .aktionen.unter { flex: 1 1 100%; margin-left: calc(2rem + var(--space-4)); }

  /* Umschalter Nur aktive / Alle */
  .team-seite .segment { padding: 2px; gap: 2px; background: var(--flaeche-weich); border: 1px solid var(--color-border); border-radius: 8px; }
  .team-seite .segment button {
    min-height: var(--touch-min); padding: 0 0.75rem; border-radius: 6px; background: transparent;
    color: var(--color-text-muted); font-size: 0.8125rem; font-weight: 500;
  }
  .team-seite .segment button + button { border-left: 0; }
  .team-seite .segment button:hover { background: rgba(43, 42, 40, 0.04); color: var(--color-text); }
  .team-seite .segment button[aria-pressed="true"] { background: var(--color-surface); color: var(--color-text); font-weight: 600; box-shadow: 0 1px 2px rgba(43, 42, 40, 0.08); }

  /* Panels, Formulare, Rückfragen */
  .team-seite .panel { background: var(--flaeche-weich); border: 1px solid var(--color-border); border-radius: 10px; padding: var(--space-4); max-width: 40rem; margin-top: var(--space-2); }
  .team-seite .panel.gefahr { border-color: var(--color-danger); }
  .team-seite .panel p { font-size: 0.8125rem; max-width: none; }
  .team-seite .panel .aktionen .knopf, .team-seite .karte .aktionen .knopf { min-height: var(--feld); padding: 0 var(--space-3); font-size: 0.8125rem; }
  .team-seite .panel .aktionen .knopf.hauptaktion, .team-seite .panel .aktionen .knopf.primaer, .team-seite .panel .aktionen .knopf.gefahr { padding: 0 var(--space-4); }
  .team-seite .panel .aktionen .knopf.zurueckhaltend { text-decoration: none; }
  .team-seite .formular .knopf.hauptaktion, .team-seite .bezug-form .knopf.hauptaktion { min-height: var(--feld); font-size: 0.8125rem; }
  .team-seite .feld label, .team-seite .rollenwahl legend { font-size: 0.8125rem; }
  .team-seite .feld input, .team-seite .feld select { font-size: 0.875rem; }
  .team-seite .feld-fehler, .team-seite .feld .hilfe { font-size: 0.75rem; }

  /* Einladen: Rollenwahl kompakt */
  .team-seite .rollenwahl { gap: var(--space-1); }
  .team-seite .wahl { padding: var(--space-2) var(--space-3); border-radius: 8px; min-height: 0; }
  .team-seite .wahl:has(input:checked) { padding: calc(var(--space-2) - 1px) calc(var(--space-3) - 1px); }
  .team-seite .wahl input { width: 1.125rem; height: 1.125rem; }
  .team-seite .wahl-name { font-size: 0.875rem; }
  .team-seite .wahl-hilfe { font-size: 0.75rem; }

  /* Einladungslink: ruhige Karte, Warnung bleibt sichtbar */
  .team-seite .link-karte { border: 1px solid var(--color-border-strong); border-left: 4px solid var(--modul-team-stein); }
  .team-seite .link-karte p { font-size: 0.8125rem; max-width: none; }
  .team-seite .umschalter { font-size: 0.9375rem; font-weight: 700; }

  /* Step-up-Dialog */
  .dialog { width: 26rem; max-width: calc(100vw - 2rem); padding: var(--space-5, 1.25rem); border-radius: 12px; }
  .dialog h2 { font-size: 1rem; font-weight: 700; }
  .dialog p { font-size: 0.8125rem; }
  .dialog .knopf { min-height: var(--feld); font-size: 0.8125rem; }

  /* Konto */
  .team-seite .karte.konto-karte { max-width: 44rem; }
  .team-seite .codes-zahl { font-size: 1.75rem; }
  .team-seite .codes-stand { font-size: 0.9375rem; }
  .team-seite .meldung { font-size: 0.8125rem; padding: var(--space-2) var(--space-3); border-radius: 8px; }

  /* Gastseiten: ruhige Einstiegskarte */
  .karte.schmal.einstieg { max-width: 26rem; margin-top: var(--space-8); padding: var(--space-5, 1.25rem) var(--space-6); gap: var(--space-4); }
  .karte.einstieg.breit { max-width: 34rem; }
  .einstieg h1 { font-size: 1.25rem; font-weight: 700; }
  .einstieg h2 { font-size: 0.9375rem; font-weight: 700; }
  .einstieg p, .einstieg label { font-size: 0.875rem; }
  .einstieg .feld label { font-size: 0.8125rem; }
  .einstieg .feld input { font-size: 0.875rem; }
  .einstieg .hilfe { font-size: 0.75rem; }
  .einstieg .meldung { font-size: 0.8125rem; padding: var(--space-2) var(--space-3); border-radius: 8px; }
  .einstieg .knopf { min-height: var(--feld); font-size: 0.8125rem; }
  .einstieg .knopf.hauptaktion { width: 100%; }
  .einstieg-fuss { gap: var(--space-2); padding-top: var(--space-3); }
  .einstieg-fuss .hilfe { color: var(--color-text-muted); }
  .einstieg .schluessel-label { font-size: 0.75rem; color: var(--color-text-muted); }
  .einstieg svg.qr { width: 11rem; }
  .einstieg .schluessel code { font-size: 0.875rem; }
  .einstieg .codes code { font-size: 0.9375rem; }
  .einstieg .codes-aktionen .knopf { min-height: var(--feld); }
  .liste.betriebe .zeile { min-height: 2.75rem; padding: 0 var(--space-3); font-size: 0.875rem; border-radius: 8px; }
  .karte.codes-karte.einstieg { margin-top: var(--space-8); }
}

@media (min-width: 64rem) and (pointer: fine) {
  .team-seite .mitglied .aktionen .knopf { min-height: var(--touch-min); padding: 0 var(--space-3); font-size: 0.75rem; }
}

/* Warnhinweise (Symbol „Achtung“) heben sich von Infohinweisen ab */
.team-seite .meldung.hinweis:has(.icon-alert), .einstieg .meldung.hinweis:has(.icon-alert) { background: #fff6e3; border-color: #d9a441; }
.team-seite .meldung.hinweis:has(.icon-alert) .icon, .einstieg .meldung.hinweis:has(.icon-alert) .icon { color: #8a5a00; }

/* „Abbrechen, zurück zur Anmeldung“ als ruhiger Knopf in der Einstiegskarte */
.einstieg .nebenlink {
  display: flex; align-self: stretch; align-items: center; justify-content: center; min-height: var(--touch-min); padding: 0 var(--space-4);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface);
  color: var(--color-text); font-size: var(--text-lg); font-weight: 600; text-decoration: none;
}
.einstieg .nebenlink:hover { background: var(--flaeche-weich); }
@media (min-width: 64rem) and (pointer: fine) { .einstieg .nebenlink { font-size: 0.8125rem; } }


/* ---------- Nachbesserung PO-Runde 1 (T-032) ---------- */

/* Paket 2: Kopfleiste der Seiten ohne Shell bleibt am Desktop dunkel (Wortmarke und „Abmelden“ sind hell, ≥ 7:1) */
.kopf {
  --leiste-bg: #2b2a28; --leiste-text: #f0efec; --leiste-hover: #3d3b37; --leiste-border: #8f8c85;
  background: var(--leiste-bg); color: var(--leiste-text);
}

/* Paket 3: Gefahr-Knöpfe bleiben rot mit weißer Schrift, auch bei Hover (die Desktop-Regel für leise Knöpfe überstimmte sie) */
.knopf.gefahr, .knopf.gefahr:not(.hauptaktion) { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.knopf.gefahr:hover, .knopf.gefahr:active, .knopf.gefahr:not(.hauptaktion):hover { background: #7f1d15; border-color: #7f1d15; color: #fff; }
.panel.gefahr { margin-top: var(--space-2); }

/* Paket 4: ?-Text in der rechten Spalte endet am Symbol und reicht nach links; Schnellknopf „Mitglied einladen“ entfällt,
   sobald die Einladekarte daneben steht (wie „Mitarbeiter anlegen“) */
@media (min-width: 64rem) and (pointer: fine) {
  .spalte-neben .hilfe-pop { left: auto; right: 0; }
}
@media (min-width: 70.01rem) {
  #einladen-schnell { display: none; }
}
.kopf .knopf:not(.hauptaktion) { background: transparent; border-color: var(--leiste-border); color: var(--leiste-text); }
.kopf .knopf:not(.hauptaktion):hover { background: var(--leiste-hover); }

/* Sicherungsknöpfe der Codes bleiben dunkel mit heller Schrift (die Desktop-Regel für leise Knöpfe machte sie weiß auf weiß) */
.knopf.sicherung, .knopf.sicherung:not(.hauptaktion) { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-contrast); }
.knopf.sicherung:hover, .knopf.sicherung:active, .knopf.sicherung:not(.hauptaktion):hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: var(--color-primary-contrast); }

/* ---------- Versandstand der Einladungen (T-018, B-25, B-27) ----------
   Link-Karte: ruhige Statuszeile mit Symbol. Liste: kleine Pille je offener Einladung wie die Status-Pillen aus T-030/T-031.
   Nie nur Farbe: Symbol und Text stehen immer dabei. */
.link-frist { font-weight: 500; }
.meldung.versand .icon { flex: none; }
.meldung.versand { color: var(--color-text); }
.meldung.versand-sent { background: #eef8f1; border-color: #2e6b3a; }
.meldung.versand-sent .icon { color: #1f6b3c; }
.meldung.versand-failed, .meldung.versand-disabled { background: #fff6e3; border-color: #d9a441; }
.meldung.versand-failed .icon, .meldung.versand-disabled .icon { color: #8a5a00; }
.meldung.versand-gone { background: var(--flaeche-weich); border-color: var(--color-border-strong); }

.versand-pille {
  display: inline-flex; align-items: center; gap: 0.25rem; min-height: 1.5rem; padding: 0 var(--space-2);
  border-radius: 5px; font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap;
}
.versand-pille .icon { width: 0.875rem; height: 0.875rem; }
.versand-pille .status-punkt { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }
.versand-sent { background: #e4f5eb; color: #1f6b3c; }
.versand-failed { background: #fdeceb; color: #9b1c13; }
.versand-pending { background: #ecebe7; color: #15171a; }
span.versand-pille.versand-sent, span.versand-pille.versand-failed, span.versand-pille.versand-pending { border: 0; }

@media (min-width: 64rem) and (pointer: fine) {
  .team-seite .link-karte .meldung.versand { font-size: 0.8125rem; padding: var(--space-2) var(--space-3); border-radius: 8px; }
  .team-seite .link-frist { font-size: 0.8125rem; }
  .versand-pille { min-height: 1.375rem; padding: 0 0.5rem; font-size: 0.6875rem; }
  .versand-pille .icon { width: 0.75rem; height: 0.75rem; }
}
.versand-pille { margin: 0 var(--space-1); }

/* ---------- Passwort vergessen (T-019b) ---------- */

/* Link „Passwort vergessen?“ steht im Bild rechts neben dem Label, im Quelltext hinter dem Feld (Tab: Passwort, Link, Code) */
.feld-mit-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-3); row-gap: var(--space-2); align-items: center; }
.feld-mit-link > label { grid-column: 1; grid-row: 1; }
.feld-mit-link > input { grid-column: 1 / -1; grid-row: 2; }
.feld-link {
  grid-column: 2; grid-row: 1; display: inline-flex; align-items: center; justify-content: flex-end;
  min-height: var(--touch-min); margin: calc((1.5rem - var(--touch-min)) / 2) calc(-1 * var(--space-2)) calc((1.5rem - var(--touch-min)) / 2) 0;
  padding: 0 var(--space-2); color: var(--color-text); font-size: var(--text-base); font-weight: 500;
  text-decoration: underline; text-underline-offset: 0.2em; border-radius: var(--radius-sm);
}
.feld-link:hover { background: var(--color-secondary-hover); }
.feld-link:focus-visible { outline: 3px solid var(--color-focus); outline-offset: -2px; }
input[aria-invalid="true"] { border-color: var(--color-danger); border-width: 2px; }
@media (min-width: 64rem) and (pointer: fine) {
  .einstieg .feld-link { min-height: var(--feld); font-size: 0.8125rem; margin-block: calc((1.5rem - var(--feld)) / 2); }
}

/* ---------- Zeiten (T-034) ---------- */
.icon-uhr { -webkit-mask-image: url("/assets/icons/uhr.svg"); mask-image: url("/assets/icons/uhr.svg"); }
.rahmen[data-modul="zeiterfassung"] { --modul-stein: var(--modul-zeiterfassung-stein); --modul-stein-schiene: var(--modul-zeiterfassung-stein); --modul-text: var(--modul-zeiterfassung-text); --modul-flaeche: var(--modul-zeiterfassung-flaeche); }
.stein-zeiten { background: var(--modul-zeiterfassung-stein); }

/* Zustand und Hinweise: Symbol plus Text, Farbe nur zusätzlich. Amber für alles, was Aufmerksamkeit braucht. */
.zeit-status { min-height: 2rem; }
.zeit-recorded { background: #ecebe7; color: #2b2a28; }
.zeit-recorded .status-punkt { border-color: #4f4d48; }
.zeit-to_clarify { background: #fff6e3; border-color: #d9a441; color: #6b4500; }
.zeit-approved { background: #e4f5eb; border-color: #2e6b3a; color: #174d29; }
.zeit-discarded { background: transparent; border-style: dashed; color: #4d4b46; font-weight: 500; }
.zeit-hinweis { min-height: 1.5rem; margin: 0; padding: 0 var(--space-2); gap: var(--space-1); border-radius: 5px; background: #ecebe7; color: #2b2a28; font-size: var(--text-sm); font-weight: 700; }
.zeit-hinweis .icon { width: 1rem; height: 1rem; }
.zeit-klaeren, .zeit-ueberlappung { background: #fff6e3; box-shadow: inset 0 0 0 1px #d9a441; color: #6b4500; }

/* Liste: Handy und Touch zuerst. Eine Buchung ist eine Karte aus Zeilen, die Aktion steht darunter. */
.zeiten { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.zeit { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--color-border); }
.zeit:first-child { border-top: 0; }
.zeit-kopfzeile { display: none; }
.zeit-zeile {
  display: grid; align-items: center; gap: var(--space-1) var(--space-3);
  grid-template-columns: auto minmax(0, 1fr) auto 1.25rem;
  grid-template-areas: "name name netto pfeil" "auftrag auftrag auftrag pfeil" "tag zeit zeit pfeil" "zustand zustand zustand pfeil";
  min-height: 4.5rem; padding: var(--space-3) var(--space-2); margin: 0 calc(-1 * var(--space-2));
  border-radius: var(--radius-sm); color: var(--color-text); text-decoration: none; transition: background-color 150ms;
}
.zeit-zeile:hover, .zeit-zeile:active { background: var(--color-bg); }
.zeit-zeile:focus-visible { outline-offset: -3px; }
.zeit-tag { grid-area: tag; color: var(--color-text); font-size: var(--text-base); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zeit-name { grid-area: name; font-size: var(--text-lg); font-weight: 600; overflow-wrap: anywhere; }
.zeit-auftrag { grid-area: auftrag; overflow-wrap: anywhere; }
.zeit-auftrag.kein { color: var(--color-text-muted); font-style: italic; }
.zeit-zeit { grid-area: zeit; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-3); font-variant-numeric: tabular-nums; }
.zeit-netto { grid-area: netto; justify-self: end; font-size: var(--text-lg); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zeit-zustand { grid-area: zustand; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: var(--space-1) var(--space-2); }
.zeit-zeile > .auftrag-pfeil { grid-area: pfeil; }
.zeit.beendet .zeit-name, .zeit.beendet .zeit-auftrag, .zeit.beendet .zeit-zeit, .zeit.beendet .zeit-netto { color: var(--color-text-muted); }
.zeit.beendet .zeit-netto { text-decoration: line-through; }
.zeit-aktion { padding: 0 0 var(--space-3); }
.zeit-aktion .knopf { width: 100%; min-height: var(--touch-min); gap: var(--space-2); }
.zeit.offen { background: var(--color-bg); margin-inline: calc(-1 * var(--space-2)); padding-inline: var(--space-2); border-radius: var(--radius-sm); }
.zeit.offen .zeit-zeile { background: transparent; }

/* Sammelfreigabe */
.sammelfreigabe {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4);
  margin: var(--space-2) 0 var(--space-3); padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-strong); border-left: 4px solid var(--modul-stein); border-radius: var(--radius-sm); background: var(--color-surface);
}
.sammelfreigabe-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; flex: 1 1 18rem; }
.sammelfreigabe .knopf { flex: 0 0 auto; width: auto; }

/* Geöffnete Buchung */
.zeit-detail { grid-column: 1 / -1; padding: 0 0 var(--space-4); }
.zeit-detail.extern { margin: 0 0 var(--space-4); padding: var(--space-4); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-bg); }
.zeit-detail-innen { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--color-border); border-left: 4px solid var(--modul-stein); border-radius: var(--radius-sm); background: var(--color-surface); }
.zeit-detail.extern .zeit-detail-innen { padding: 0; border: 0; background: transparent; }
.zeit-detail-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); }
.zeit-detail-kopf h3 { margin: 0; font-size: var(--text-xl); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.zeit-daten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-6); margin: 0; }
.zeit-daten dt { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 600; }
.zeit-daten dd { margin: 0; overflow-wrap: anywhere; }
.zeit-daten .notiz { grid-column: auto; }
.zeit-aktionen { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.zeit-aktionen .knopf { width: auto; flex: 1 1 10rem; }
.zeit-detail .panel { margin-top: 0; background: var(--color-bg); }
.zeit-detail .panel .aktionen { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.zeit-detail .panel .aktionen .knopf, .zeit-detail .panel .aktionen .knopf.hauptaktion { flex: 1 1 12rem; width: auto; }
.zeit-detail .meldung { margin: 0; }
.zeit-detail .verlauf { margin-top: var(--space-2); }
.zeit-detail .verlauf h4 { margin: 0 0 var(--space-2); font-size: var(--text-lg); font-weight: 600; }
.zeit-verlauf { gap: var(--space-3); }
.zeit-verlauf-eintrag { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.125rem; padding-left: var(--space-3); border-left: 2px solid var(--color-border); }
.zeit-verlauf-eintrag.art-approve { border-left-color: var(--color-success); }
.zeit-verlauf-eintrag.art-unapprove, .zeit-verlauf-eintrag.art-discard { border-left-color: var(--color-danger); }
.zeit-verlauf-eintrag .meta.grund { color: var(--color-text); }

/* Erfassen: Zeitfelder in einer Reihe, Vorschau der Nettozeit */
.zeit-felder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.zeit-vorschau {
  display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0; padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg); font-variant-numeric: tabular-nums;
}
.zeit-vorschau .netto { margin-left: auto; font-size: var(--text-lg); }
.zeit-vorschau .netto.schlecht { color: var(--color-danger); }
input[type="time"], input[type="number"] { width: 100%; min-height: var(--feld); padding: 0 var(--space-3); background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); font: inherit; font-variant-numeric: tabular-nums; }
input[type="time"][aria-invalid="true"], input[type="number"][aria-invalid="true"] { border-color: var(--color-danger); border-width: 2px; }
.haken { display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--touch-min); font-weight: 500; cursor: pointer; }
.haken input[type="checkbox"] { flex: none; width: 1.5rem; height: 1.5rem; accent-color: var(--graphit-900); }
.zeit-neu-karte { max-width: 50rem; }
.zeit-neu-karte .formular-fuss { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.gruppen-kopf .knopf.kompakt { margin-left: auto; min-height: var(--touch-min); }

/* Abschnitt „Zeiten“ am Auftrag */
.auftrag-zeiten { margin-top: var(--space-4); }
.auftrag-zeiten .zeit-zeile { grid-template-areas: "name name netto pfeil" "tag zeit zeit pfeil" "zustand zustand zustand pfeil"; }

@media (max-width: 40rem) {
  .zeit-daten { grid-template-columns: minmax(0, 1fr); }
  .zeit-felder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sammelfreigabe .knopf { width: 100%; }
  .zeit-neu-karte .formular-fuss .knopf, .zeit-neu-karte .formular-fuss .knopf.hauptaktion { flex: 1 1 100%; }
}

/* Büro-Desktop (ab 1024 px mit Maus): kompakte Tabellenzeilen, die Aktion steht rechts außen */
@media (min-width: 64rem) and (pointer: fine) {
  .zeiten-karte { --zeit-aktion: 6.75rem; --zeit-spalten: 3.75rem 7rem minmax(0, 1fr) 7.25rem 3.5rem 10.5rem; padding: var(--space-4) 1.25rem; }
  .zeiten-karte .leer-zustand { border: 0; background: var(--flaeche-weich); border-radius: 10px; }
  .zeiten-karte .auftrag-filter { margin-bottom: var(--space-3); }
  .zeiten-karte .auftrag-filter .filter-felder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
  .zeit-kopfzeile {
    display: grid; grid-template-columns: var(--zeit-spalten); align-items: center; gap: 0 var(--space-2);
    padding: var(--space-2) var(--space-2); padding-right: calc(var(--zeit-aktion) + var(--space-2)); margin: 0 calc(-1 * var(--space-2));
    border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border);
    color: var(--color-text-muted); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  }
  .zeit-kopfzeile .rechts { text-align: right; padding-right: 0.5rem; }
  .zeit { grid-template-columns: minmax(0, 1fr) var(--zeit-aktion); align-items: center; }
  .zeit-zeile {
    grid-template-columns: var(--zeit-spalten); grid-template-areas: none; min-height: 2.75rem;
    padding: 0.375rem var(--space-2); gap: 0 var(--space-2); font-size: 0.8125rem; align-items: center;
  }
  .zeit-zeile:hover { background: var(--flaeche-weich); }
  .zeit .zeit-zeile > * { grid-area: auto; }
  .zeit-zeile > .auftrag-pfeil { display: none; }
  .zeit-tag { font-size: 0.75rem; }
  .zeit-name { font-size: 0.875rem; }
  .zeit-auftrag { font-size: 0.8125rem; }
  .zeit-zeit { flex-direction: column; gap: 0.0625rem; font-size: 0.8125rem; }
  .zeit-zeit .meta { font-size: 0.6875rem; }
  .zeit-netto { justify-self: end; padding-right: 0.5rem; font-size: 0.875rem; }
  .zeit-zustand { justify-content: flex-start; gap: 0.25rem; }
  .zeit-hinweis { min-height: 1.25rem; font-size: 0.6875rem; }
  .zeit-hinweis .icon { width: 0.75rem; height: 0.75rem; }
  .zeit-status { min-height: 1.375rem; }
  .zeit-aktion { padding: 0; justify-self: end; }
  .zeit-aktion .knopf { width: auto; min-height: 2rem; padding: 0 var(--space-3); font-size: 0.8125rem; }
  .zeit.offen > .zeit-zeile { box-shadow: inset 3px 0 0 var(--modul-stein); }

  .sammelfreigabe { padding: var(--space-2) var(--space-3); font-size: 0.8125rem; }
  .sammelfreigabe .knopf.hauptaktion { min-height: 2rem; font-size: 0.8125rem; padding: 0 var(--space-3); }
  .zeit-detail-innen { padding: var(--space-3) var(--space-4); }
  .zeit-detail-kopf h3 { font-size: 0.9375rem; font-weight: 700; }
  .zeit-daten { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2) var(--space-4); }
  .zeit-daten dt { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.03em; }
  .zeit-daten dd { font-size: 0.8125rem; }
  .zeit-aktionen .knopf { flex: 0 0 auto; min-height: 2rem; padding: 0 var(--space-4); font-size: 0.8125rem; }
  .zeit-aktionen .knopf.hauptaktion { width: auto; }
  .zeit-detail .panel { font-size: 0.8125rem; max-width: 46rem; }
  .zeit-detail .panel .aktionen .knopf, .zeit-detail .panel .aktionen .knopf.hauptaktion { flex: 0 0 auto; min-height: 2rem; padding: 0 var(--space-4); font-size: 0.8125rem; }
  .zeit-detail .verlauf { font-size: 0.8125rem; }
  .zeit-detail .verlauf h4 { font-size: 0.875rem; }

  .zeit-neu-karte { padding: var(--space-5, 1.25rem) var(--space-6); }
  .zeit-neu-karte .gruppe h3 { font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); }
  .zeit-neu-karte .feld-paar.stapel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zeit-felder { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .zeit-vorschau { font-size: 0.8125rem; padding: var(--space-2) var(--space-3); }
  .zeit-neu-karte .formular-fuss .knopf, .zeit-neu-karte .formular-fuss .knopf.hauptaktion { flex: 0 0 auto; width: auto; padding: 0 var(--space-6); }
  .gruppen-kopf .knopf.kompakt { min-height: 2rem; font-size: 0.75rem; }
  .haken { min-height: 2.25rem; }
  .zeit-neu-karte #zeit-speichern.hauptaktion { min-height: 2.5rem; }

  /* Am Auftrag: ohne Auftragsspalte, ohne Aktionen */
  .auftrag-zeiten .zeiten.am-auftrag .zeit { grid-template-columns: minmax(0, 1fr); }
  .auftrag-zeiten .zeiten.am-auftrag .zeit-zeile { grid-template-columns: 3.75rem 7rem 8rem 3.5rem minmax(0, 1fr); }
}

/* Zeiten: Vorschau der Nettozeit über die ganze Breite */
.zeit-vorschau { align-self: stretch; width: 100%; max-width: none; }
.icon-material { -webkit-mask-image: url("/assets/icons/material.svg"); mask-image: url("/assets/icons/material.svg"); }

/* ---------- Material (T-035) ---------- */

/* Filter am Handy hinter einem Knopf, am Büro-Desktop immer offen */
.filter-knopf, .filter-kopf, .filter-anwenden { display: none; }
@media (max-width: 63.9375rem), (pointer: coarse) {
  .filter-klapp { gap: var(--space-3); }
  .filter-kopf { display: flex; align-items: stretch; gap: var(--space-2); }
  .filter-zurueck { display: inline-flex; align-items: center; flex: none; min-height: var(--touch-min); padding: 0 var(--space-4); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text); font-size: var(--text-lg); font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; white-space: nowrap; }
  .filter-knopf {
    display: inline-flex; align-items: center; gap: var(--space-2); flex: 1 1 auto; width: auto; min-height: var(--touch-min); padding: 0 var(--space-4);
    background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
    font: inherit; font-size: var(--text-lg); font-weight: 600; cursor: pointer;
  }
  .filter-knopf .icon { margin-left: auto; transform: rotate(90deg); transition: transform 150ms; }
  .filter-knopf[aria-expanded="true"] .icon { transform: rotate(-90deg); }
  .filter-zahl { background: var(--color-primary); color: var(--color-primary-contrast); }
  .filter-klapp .filter-felder, .filter-klapp .filter-inhalt { display: none; }
  .filter-klapp.offen .filter-felder, .filter-klapp.offen .filter-inhalt { display: grid; }
}
@media (min-width: 64rem) and (pointer: fine) {
  .filter-klapp .filter-felder, .filter-klapp.offen .filter-felder, .filter-klapp .filter-inhalt, .filter-klapp.offen .filter-inhalt { display: grid; }
}

/* Kunden, Artikel, Team (T-049): die Auswahl „Nur aktive / Alle“ steht am Handy hinter dem Knopf, Suche und Trefferzahl bleiben sichtbar */
.filter-felder.filter-segment { grid-template-columns: minmax(0, 1fr); }
.filter-hinweis { font-size: var(--text-base); font-weight: 600; color: var(--color-text-muted); }
@media (max-width: 63.9375rem), (pointer: coarse) {
  .listenkopf.filter-klapp > .filter-kopf, .listenkopf.filter-klapp > .filter-segment { flex: 1 1 100%; }
}
@media (min-width: 64rem) and (pointer: fine) {
  .filter-klapp .filter-felder.filter-segment, .filter-klapp.offen .filter-felder.filter-segment { display: contents; }
}

/* Artikel und Menge in der Liste */
.material-artikel { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; grid-area: artikel; overflow-wrap: anywhere; }
.material-artikel-name { font-weight: 600; }
.material-artikel.frei .material-artikel-name { font-style: italic; font-weight: 500; }
.material-menge { display: flex; flex-direction: column; align-items: flex-end; gap: 0.125rem; grid-area: menge; font-variant-numeric: tabular-nums; text-align: right; }
.material-menge-zahl { font-size: var(--text-lg); font-weight: 700; white-space: nowrap; }
.materialzeilen .zeit-zeile {
  grid-template-areas: "name name menge pfeil" "artikel artikel artikel pfeil" "auftrag auftrag auftrag pfeil" "tag tag tag pfeil" "zustand zustand zustand pfeil";
}
.materialzeilen .zeit-zeile .zeit-auftrag { color: var(--color-text-muted); }
.material-am-auftrag .zeit-zeile { grid-template-areas: "name name menge pfeil" "artikel artikel artikel pfeil" "tag tag tag pfeil" "zustand zustand zustand pfeil"; }

/* Erfassen: Art des Artikels, Suche, gewählter Artikel */
.artikel-modus { display: flex; flex-wrap: wrap; gap: var(--space-2); flex: 1 1 100%; }
.artikel-modus .knopf.gewaehlt { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-contrast); }
.artikel-modus .knopf.kompakt, .gruppen-kopf .artikel-modus .knopf.kompakt { margin-left: 0; min-height: var(--touch-min); }
.artikel-treffer, .artikel-wahl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); border: 0; }
.artikel-treffer-knopf {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.125rem; width: 100%; min-height: var(--touch-min); padding: var(--space-2) var(--space-3);
  background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  font: inherit; text-align: left; cursor: pointer;
}
.artikel-treffer-knopf:hover, .artikel-treffer-knopf:focus-visible { background: var(--color-bg); }
.artikel-gewaehlt {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border-strong); border-left: 4px solid var(--modul-material-stein); border-radius: var(--radius-sm); background: var(--color-surface);
}
.artikel-gewaehlt-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.artikel-gewaehlt-text .adresse { font-weight: 600; }
.artikel-gewaehlt .knopf.zurueckhaltend { width: auto; }
.unbekannt-felder { display: flex; flex-direction: column; gap: var(--space-4); }
.unbekannt-felder .meldung { margin: 0; }

/* Klärung: Artikel zuordnen oder neu anlegen */
.klaeren-artikel { display: flex; flex-direction: column; gap: var(--space-3); }
.artikel-wahl-zeile {
  display: flex; align-items: flex-start; gap: var(--space-3); min-height: var(--touch-min); padding: var(--space-2) var(--space-3);
  background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); cursor: pointer; font-weight: 400;
}
.artikel-wahl-zeile input[type="radio"] { flex: none; width: 1.5rem; height: 1.5rem; margin-top: 0.125rem; accent-color: var(--graphit-900); }
.artikel-wahl-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.klaer-neu { display: flex; flex-direction: column; gap: var(--space-3); }
.klaeren-artikel .artikel-modus { margin-left: 0; }
.code-angebot { border-left: 4px solid var(--modul-material-stein); }

@media (min-width: 64rem) and (pointer: fine) {
  .material-karte { --zeit-aktion: 6.75rem; --material-spalten: 3.5rem 6.5rem minmax(0, 1.2fr) 6.25rem minmax(0, 1.4fr) 9.5rem; }
  .material-karte .auftrag-filter .filter-felder { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .material-kopfzeile { grid-template-columns: var(--material-spalten); }
  .materialzeilen .zeit-zeile { grid-template-columns: var(--material-spalten); grid-template-areas: none; }
  .materialzeilen .zeit-zeile > * { grid-area: auto; }
  .material-menge { align-items: flex-end; padding-right: 0.5rem; }
  .material-menge-zahl { font-size: 0.875rem; }
  .material-artikel-name { font-size: 0.875rem; }
  .materialzeilen .zeit-zeile { font-size: 0.8125rem; }
  .artikel-modus { display: inline-flex; flex: 0 1 auto; margin-left: auto; }
  .artikel-modus .knopf.kompakt { min-height: 2rem; font-size: 0.75rem; }
  .artikel-treffer-knopf { min-height: 2.25rem; padding: var(--space-1) var(--space-3); font-size: 0.8125rem; }
  .artikel-wahl-zeile { min-height: 2.25rem; padding: var(--space-1) var(--space-3); font-size: 0.8125rem; }
  .artikel-gewaehlt { padding: var(--space-2) var(--space-3); font-size: 0.8125rem; }
  .klaeren-artikel, .klaer-neu { max-width: 40rem; }
  .auftrag-material .zeiten.am-auftrag .zeit { grid-template-columns: minmax(0, 1fr); }
  .auftrag-material .zeiten.am-auftrag .zeit-zeile { grid-template-columns: 3.5rem 6.5rem minmax(0, 1.4fr) 6.25rem minmax(0, 1fr); }
  .material-am-auftrag .zeit-zeile { grid-template-areas: none; }
  .material-am-auftrag .zeit-zeile > * { grid-area: auto; }
}

/* ---------- Mein Tag (T-036): Monteur-Ansicht unter /m/:tenant_id ----------
   Handy zuerst, mit einer Hand und Arbeitshandschuhen: Klickflächen ab 48 px, Eingaben 18 px, Text mindestens 7:1.
   Diese Maße gelten auch am Desktop (B-23 und B-24 betreffen nur das Büro): Die Tokens werden hier auf dem Element
   zurückgesetzt, damit die kompakte Büro-Dichte nicht durchschlägt. Graphit trägt die Fläche, Kupfer gehört nur der
   einen Aktion, die gerade zählt (Stoppen), und dem Takt der laufenden Zeit. Zustände mit Symbol und Text. */
.m-app {
  --touch: 3.5rem; --touch-min: 3rem; --feld: 3.25rem;
  --text-sm: 0.875rem; --text-base: 1rem; --text-lg: 1.125rem; --text-xl: 1.25rem; --text-2xl: 1.5rem; --text-3xl: 2rem;
  --space-3: 0.75rem; --space-4: 1rem; --space-6: 1.5rem; --space-8: 2rem; --space-12: 3rem;
  --color-bg: #f7f7f5; --color-surface: #ffffff; --color-text: #2b2a28; --color-text-muted: #4d4b46;
  --color-border: #dedcd6; --color-border-strong: #7a7872; --color-soft: #ebeae6; --color-danger: #a1251b;
  --kupfer: #ecad6f; --kupfer-ink: #1f1e1c;
  font-size: var(--text-lg); line-height: 1.45; min-height: 100dvh; background: var(--color-bg);
}
.m-main {
  display: flex; flex-direction: column; gap: var(--space-4);
  max-width: 72rem; margin: 0 auto; padding: var(--space-4) var(--space-4) 7rem;
}
.m-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: 3.75rem; padding: var(--space-2) var(--space-4); background: var(--graphit-900); color: #f0efec;
}
.m-topbar :focus-visible { outline-color: #fff; }
.m-topbar-marke { display: inline-flex; align-items: center; min-height: var(--touch-min); }
.m-topbar form { margin: 0; }
.m-topbar-knopf { background: transparent; border-color: #8f8c85; color: #f0efec; min-height: var(--touch-min); }
.m-topbar-knopf:hover, .m-topbar-knopf:active { background: var(--graphit-800); }
.m-app .icon { width: 1.5rem; height: 1.5rem; }
.m-app .rolle-tag .icon, .m-app .status-marke .icon { width: 1.125rem; height: 1.125rem; }
.m-app .rolle-tag { min-height: 2rem; padding: 0 var(--space-3); font-size: var(--text-base); }
.m-app .status-marke { min-height: 2rem; padding: 0 var(--space-3); font-size: var(--text-base); }
.m-app .zeit-status { min-height: 2rem; }
.m-app .meldung { padding: var(--space-3) var(--space-4); font-size: var(--text-lg); }
.m-app .meldung .icon { margin-top: 0.125rem; }
.m-app label { font-size: var(--text-lg); font-weight: 500; }
.m-app .feld { gap: var(--space-2); }
.m-app .knopf { font-size: var(--text-lg); min-height: var(--touch-min); }
.m-app .knopf.hauptaktion { font-size: var(--text-xl); min-height: var(--touch); }
.m-app .zeit-vorschau { font-size: var(--text-lg); }
.m-app .haken { min-height: var(--touch-min); }
.m-app textarea { min-height: 7rem; }
.m-app .pflicht { font-size: var(--text-sm); padding: 0.125rem var(--space-2); }
.m-app .feld-fehler { font-size: var(--text-base); }
.m-app .feld-fehler .icon { width: 1.25rem; height: 1.25rem; }
.m-app input[type="text"], .m-app input[type="search"], .m-app input[type="number"], .m-app input[type="date"], .m-app input[type="time"],
.m-app select { min-height: var(--feld); font-size: var(--text-lg); }

/* Ohne Verbindung: fest oben, nicht zu übersehen */
.m-offline {
  position: sticky; top: 0; z-index: 60; display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4); background: #fff; color: var(--color-danger);
  border: 3px solid var(--color-danger); border-radius: var(--radius-sm); font-size: var(--text-lg);
}
.m-offline[hidden] { display: none; }
.m-offline p { max-width: none; color: var(--color-text); }
.m-offline strong { display: block; color: var(--color-danger); }

/* Kopf */
.m-kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.m-kopf-text { display: flex; flex-direction: column; min-width: 0; }
.m-name { font-size: var(--text-2xl); font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; }
.m-betrieb { color: var(--color-text-muted); font-size: var(--text-base); }
.m-knopf-klein { min-height: var(--touch-min); padding: 0 var(--space-4); }

/* Raster: Handy eine Spalte, breit zwei */
.m-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.m-spalte { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
@media (min-width: 62rem) {
  .m-raster { grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); gap: var(--space-6); }
}

.m-karte, .m-zeilen {
  min-width: 0; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3);
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(43, 42, 40, 0.05);
}
.m-block { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.m-block > h2, .m-karte > h2, .m-gruppe h2 { font-size: var(--text-xl); font-weight: 600; }
.m-leer { color: var(--color-text-muted); font-size: var(--text-lg); max-width: none; padding: var(--space-3) 0; }

/* Tagesbalken */
.m-tag-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.m-datum { color: var(--color-text-muted); font-size: var(--text-base); font-weight: 500; }
.m-netto { display: flex; align-items: baseline; gap: var(--space-2); font-variant-numeric: tabular-nums; max-width: none; }
.m-netto strong { font-size: 2.5rem; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.m-netto span { color: var(--color-text-muted); font-size: var(--text-xl); font-weight: 500; }
.m-balken {
  width: 100%; height: 1rem; appearance: none; -webkit-appearance: none; border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full); background: var(--color-soft); overflow: hidden;
}
.m-balken::-webkit-progress-bar { background: var(--color-soft); }
.m-balken::-webkit-progress-value { background: var(--graphit-900); }
.m-balken::-moz-progress-bar { background: var(--graphit-900); }
.m-tag-rest { color: var(--color-text); font-size: var(--text-lg); max-width: none; }
.m-tag-rest .icon { vertical-align: -0.3rem; }

/* Laufende Zeit: dunkle Karte, die einzige, damit sie auffällt */
.m-laeuft { background: var(--graphit-900); color: #f7f7f5; border-color: var(--graphit-900); gap: var(--space-3); }
.m-laeuft :focus-visible { outline-color: #fff; }
.m-laeuft a { color: #f7f7f5; }
.m-laeuft-kopf { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-lg); font-weight: 600; flex-wrap: wrap; max-width: none; }
.m-puls { flex: none; width: 0.875rem; height: 0.875rem; border-radius: 50%; background: var(--kupfer); }
@media (prefers-reduced-motion: no-preference) {
  .m-puls { animation: m-puls 1.6s ease-in-out infinite; }
  @keyframes m-puls { 0%, 100% { box-shadow: 0 0 0 0 rgba(236, 173, 111, 0.6); } 50% { box-shadow: 0 0 0 0.5rem rgba(236, 173, 111, 0); } }
}
.m-laeuft-zeit { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; max-width: none; font-variant-numeric: tabular-nums; }
.m-laeuft-zeit strong { font-size: 3rem; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.m-laeuft-zeit span { color: #dedcd6; font-size: var(--text-xl); }
.m-laeuft-auftrag { font-size: var(--text-xl); font-weight: 500; max-width: none; }
.m-laeuft .zeit-klaeren { background: #fff6e3; color: #6b4500; }
.m-laeuft-warnung { background: #fff6e3; color: #6b4500; border-radius: var(--radius-sm); padding: var(--space-3); font-weight: 500; max-width: none; box-shadow: inset 0 0 0 2px #d9a441; }
.m-laeuft.vergessen { box-shadow: 0 0 0 3px var(--kupfer); }
.m-laeuft-aktion { display: flex; }
.m-stopp {
  flex: 1; min-height: var(--touch); font-size: var(--text-xl); font-weight: 700;
  background: var(--kupfer); border-color: var(--kupfer); color: var(--kupfer-ink);
}
.m-stopp:hover, .m-stopp:active { background: #f3c08e; border-color: #f3c08e; }

/* Suche */
.m-suche { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; }
.m-suche-label { font-size: var(--text-base); color: var(--color-text-muted); font-weight: 500; }

/* Aufträge: Karte mit Link und Start daneben */
.m-auftraege, .m-zeilen, .m-artikel-liste { list-style: none; margin: 0; }
.m-auftraege { padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.m-auftrag {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); align-items: center;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
}
.m-auftrag-link { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; min-height: var(--touch-min); color: var(--color-text); text-decoration: none; }
.m-auftrag-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.m-auftrag-nr { font-weight: 700; font-variant-numeric: tabular-nums; }
.m-auftrag-titel { font-size: var(--text-xl); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.m-auftrag-meta { display: flex; align-items: flex-start; gap: var(--space-2); color: var(--color-text-muted); font-size: var(--text-base); overflow-wrap: anywhere; }
.m-auftrag-meta .icon { width: 1.25rem; height: 1.25rem; flex: none; }
.m-auftrag-aktion { display: flex; align-items: center; }
.m-start-form { margin: 0; }
.m-start {
  min-width: 6.5rem; min-height: var(--touch); padding: 0 var(--space-4); font-weight: 700;
  background: var(--graphit-900); border-color: var(--graphit-900); color: #fff;
}
.m-start:hover, .m-start:active { background: #151412; border-color: #151412; }
.m-start.wechseln { background: var(--color-surface); color: var(--color-text); border: 2px solid var(--graphit-900); }
.m-start.wechseln:hover, .m-start.wechseln:active { background: var(--graphit-100); }
.m-auftrag-start { display: flex; }
.m-auftrag-start .m-start-form, .m-auftrag-start .m-start { width: 100%; }
@media (max-width: 26rem) {
  .m-auftrag { grid-template-columns: minmax(0, 1fr); }
  .m-auftrag-aktion .m-start-form, .m-auftrag-aktion .m-start { width: 100%; }
}

/* Angaben am Auftrag */
.m-angaben { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; }
.m-angaben dt { color: var(--color-text-muted); font-size: var(--text-base); font-weight: 500; }
.m-angaben dd { margin: 0; font-size: var(--text-xl); font-weight: 500; overflow-wrap: anywhere; }

/* Buchungszeilen: Zustand und Sperrgrund sichtbar, Ändern nur wenn erlaubt */
.m-zeilen { padding: 0; gap: 0; }
.m-zeile { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border-top: 1px solid var(--color-border); }
.m-zeile:first-child { border-top: 0; }
.m-zeile.verworfen .m-zeile-zeit .zahl, .m-zeile.verworfen .m-zeile-menge, .m-zeile.verworfen .m-zeile-text {
  color: var(--color-text-muted); text-decoration: line-through;
}
.m-zeile-haupt { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.m-zeile-zeit { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); font-size: var(--text-xl); max-width: none; }
.m-zeile-zeit .zahl { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.m-zeile-menge { margin-left: auto; font-size: var(--text-xl); font-variant-numeric: tabular-nums; }
.m-zeile-tag { color: var(--color-text-muted); font-size: var(--text-base); font-weight: 500; }
.m-zeile-text { font-size: var(--text-lg); max-width: none; }
.m-zeile-text a { color: var(--color-text); }
.m-zeile-marken { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); max-width: none; }
.m-zeile-grund { color: #6b4500; font-weight: 500; max-width: none; }
.m-zeile-notiz { color: var(--color-text-muted); font-size: var(--text-base); max-width: none; }
.m-zeile-aktion { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.m-gesperrt { display: flex; align-items: flex-start; gap: var(--space-2); color: var(--color-text-muted); font-size: var(--text-base); max-width: none; }
.m-gesperrt .icon { width: 1.25rem; height: 1.25rem; margin-top: 0.125rem; }

/* Untere Leiste: die zwei Dinge, die ein Monteur am Tag ständig tut */
.m-leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: var(--space-3); justify-content: center;
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: var(--color-bg); border-top: 1px solid var(--color-border-strong);
}
.m-leiste-knopf { flex: 1; max-width: 22rem; min-height: var(--touch); font-weight: 600; border-width: 2px; border-color: var(--graphit-900); }

/* Rückfragefenster */
.m-sheet-huelle { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.m-sheet-hintergrund { position: absolute; inset: 0; background: rgba(31, 30, 28, 0.6); }
.m-sheet {
  position: relative; width: 100%; max-width: 36rem; max-height: 92dvh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-6) var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom));
  background: var(--color-surface); border-radius: var(--radius-md) var(--radius-md) 0 0; box-shadow: 0 -8px 32px rgba(31, 30, 28, 0.25);
}
@media (min-width: 40rem) { .m-sheet-huelle { align-items: center; } .m-sheet { border-radius: var(--radius-md); } }
.m-sheet h2 { font-size: var(--text-2xl); }
.m-sheet-text { max-width: none; font-size: var(--text-lg); }
.m-sheet-aktion { display: flex; flex-direction: column; gap: var(--space-3); }
.m-ende-fest { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--touch-min); }
.m-ende-fest p { max-width: none; }
.m-haupt { width: 100%; }
.knopf.hauptaktion.gefahr { background: var(--color-danger); border-color: var(--color-danger); }

/* Formularseiten */
.m-seiten-kopf { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.m-seiten-kopf h1 { font-size: var(--text-2xl); }
.m-zurueck { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--touch-min); color: var(--color-text); font-weight: 500; }
.m-formular-seite { max-width: 40rem; width: 100%; }
.m-form { gap: var(--space-4); margin: 0; }
.m-gruppe { display: flex; flex-direction: column; gap: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.m-gruppe-kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.m-artikelwahl, .m-unbekannt, .m-menge { display: flex; flex-direction: column; gap: var(--space-4); }
.m-schnell { display: flex; flex-direction: column; gap: var(--space-2); }
.m-schnell h3 { font-size: var(--text-lg); font-weight: 600; }
.m-artikel-liste { padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.m-artikel {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: 100%; min-height: var(--touch);
  padding: var(--space-2) var(--space-4); text-align: left; background: var(--color-surface);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); color: var(--color-text);
}
.m-artikel:hover, .m-artikel:active { background: var(--graphit-100); border-color: var(--graphit-900); }
.m-artikel-text { display: flex; flex-direction: column; min-width: 0; }
.m-gewaehlt { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-3) var(--space-4); background: var(--color-soft); border-radius: var(--radius-sm); }
.m-gewaehlt-text { display: flex; flex-direction: column; min-width: 0; gap: 0.125rem; }
@media (min-width: 40rem) { .m-sheet-aktion { flex-direction: row-reverse; } .m-sheet-aktion .knopf { flex: 1; } }

/* Nachbesserung nach den ersten Bildern */
.m-app .feld-kopf { display: flex; align-items: center; gap: var(--space-2); }
.m-zeile-zeit .zahl { min-width: 0; padding: 0; background: none; border: 0; border-radius: 0; font-size: var(--text-xl); }
.m-block > h3 { font-size: var(--text-lg); font-weight: 600; color: var(--color-text-muted); }
@media (max-width: 26rem) { .m-leiste-knopf .icon { display: none; } .m-leiste { padding-inline: var(--space-3); } }

/* Die Büro-Dichte (B-23, B-24) färbt `.knopf:not(.hauptaktion)` und `.status-marke` am Desktop um. In der Monteur-Ansicht
   gelten die Baustellen-Werte, darum stehen die Regeln hier mit mehr Gewicht. */
.m-app .knopf.m-start { background: var(--graphit-900); border-color: var(--graphit-900); color: #fff; }
.m-app .knopf.m-start:hover, .m-app .knopf.m-start:active { background: #151412; border-color: #151412; }
.m-app .knopf.m-start.wechseln { background: var(--color-surface); color: var(--color-text); border: 2px solid var(--graphit-900); }
.m-app .knopf.m-start.wechseln:hover, .m-app .knopf.m-start.wechseln:active { background: var(--graphit-100); }
.m-app .knopf.m-stopp { background: var(--kupfer); border-color: var(--kupfer); color: var(--kupfer-ink); }
.m-app .knopf.m-stopp:hover, .m-app .knopf.m-stopp:active { background: #f3c08e; border-color: #f3c08e; }
.m-app .m-topbar .knopf.m-topbar-knopf { background: transparent; border-color: #8f8c85; color: #f0efec; }
.m-app .m-topbar .knopf.m-topbar-knopf:hover, .m-app .m-topbar .knopf.m-topbar-knopf:active { background: var(--graphit-800); }
.m-app .knopf.m-leiste-knopf { background: var(--color-surface); border: 2px solid var(--graphit-900); font-weight: 600; }
.m-app .knopf.m-leiste-knopf:hover, .m-app .knopf.m-leiste-knopf:active { background: var(--graphit-100); }
.m-app .knopf.m-artikel:hover { background: var(--graphit-100); }
.m-app .status-marke, .m-app .zeit-status { font-size: var(--text-base); font-weight: 600; letter-spacing: 0; text-transform: none; }
.m-app .rolle-tag { letter-spacing: 0; text-transform: none; }
.m-app .m-zeile-zeit .zahl { min-width: 0; padding: 0; background: none; border: 0; border-radius: 0; font-size: var(--text-xl); }
.m-app .m-zeile-zeit { font-size: var(--text-xl); }
.m-app .knopf.hauptaktion { font-size: var(--text-xl); }
.m-app .m-zeile-zeit .zahl { display: inline; }

/* Nachbesserung Runde 1: Abstände, Fragezeichen am Label, Von und Bis nebeneinander */
.m-app h3 { margin: 0; }
.m-paar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.m-app .feld-kopf { gap: 0 var(--space-1); }
.m-app .status-marke.status-done, .m-app .status-marke.status-closed, .m-app .status-marke.status-planned { color: var(--color-text); }

/* ---------- Export (T-037): Lohn und Auftrags-Übergabe, Historie, Lauf, Beleg ----------
   Modulfarbe „Auswertung“ (Steine, Bereichsleiste). Meldungen, Zeilenarten und Warnungen tragen immer Text, nie nur Farbe. */
.rahmen[data-modul="auswertung"] { --modul-stein: var(--modul-auswertung-stein); --modul-stein-schiene: var(--modul-auswertung-stein); --modul-text: var(--modul-auswertung-text); --modul-flaeche: var(--modul-auswertung-flaeche); }
.stein-auswertung { background: var(--modul-auswertung-stein); }

.export-seite { --ex-warn: #8a5200; --ex-warn-text: #5c3600; --ex-warn-flaeche: #fff6e0; --ex-storno-flaeche: #fdf1f0; }

.ex-demo { background: var(--modul-auswertung-flaeche); color: var(--color-text); border: 1px solid var(--modul-auswertung-text); font-weight: 600; }

/* Warnung vor noch offenen Buchungen: warm, mit Zähler, Sprung in die Prüflisten */
.meldung.warnung { border: 2px solid var(--ex-warn, #8a5200); background: var(--ex-warn-flaeche, #fff6e0); color: var(--ex-warn-text, #5c3600); }
.meldung.warnung .icon { color: var(--ex-warn, #8a5200); }
.warnung-text { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.warnung-text p { margin: 0; max-width: none; }
.warnung-links { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.warnung-links .knopf { background: var(--color-surface); }

.ex-reiter { margin-bottom: 0; }
.ex-ziele { align-items: center; }
.ex-ziele .hilfe-icon { align-self: center; }

.ex-filter { display: flex; flex-direction: column; gap: var(--space-3); }
.ex-filter-felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--space-3) var(--space-4); align-items: start; }
.ex-zeitraum-wahl { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; max-width: none; }
.ex-wahl-label { color: var(--color-text-muted); font-weight: 500; }

/* Summen: je eine Fläche für Zeilen, Arbeitszeit und Material */
.ex-summen { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-3); }
.ex-summe { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg); min-width: 0; }
.ex-summe dt { color: var(--color-text-muted); font-size: var(--text-base); font-weight: 500; }
.ex-summe dd { margin: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.ex-gross { font-size: var(--text-2xl); font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ex-arten { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); color: var(--color-text-muted); font-size: var(--text-base); font-variant-numeric: tabular-nums; }

.ex-gruppen { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: var(--space-4) var(--space-6); }
.ex-gruppen h3 { font-size: var(--text-lg); font-weight: 600; margin: 0 0 var(--space-2); }
.ex-gruppenliste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ex-gruppenliste li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
.ex-gruppenname { min-width: 0; overflow-wrap: anywhere; }
.ex-wert { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Zeilen als Tabelle */
.ex-tabelle-wrap { overflow-x: auto; }
.ex-tabelle { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.ex-tabelle th { padding: var(--space-2) var(--space-3); text-align: left; color: var(--color-text-muted); font-weight: 600; border-bottom: 2px solid var(--color-border-strong); white-space: nowrap; }
.ex-tabelle td { padding: var(--space-2) var(--space-3); vertical-align: top; border-bottom: 1px solid var(--color-border); min-width: 0; overflow-wrap: anywhere; }
.ex-tabelle .rechts { text-align: right; }
.ex-tabelle td > span { display: block; }
.ex-tabelle td > span.ex-hinweise { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
.ex-tabelle td > span.ex-art { display: inline-flex; }
.ex-zahl { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ex-fett { font-weight: 600; }
.ex-notiz { font-style: italic; }
.ex-zeile.art-cancellation { background: var(--ex-storno-flaeche, #fdf1f0); }
.ex-zeile:target { outline: 3px solid var(--color-focus); outline-offset: -3px; }

.ex-art { display: inline-flex; align-items: center; min-height: 1.5rem; padding: 0 var(--space-2); border-radius: var(--radius-full); border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text); font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }
.ex-art.art-correction { background: var(--graphit-900); border-color: var(--graphit-900); color: #fff; }
.ex-art.art-cancellation { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.ex-bezug { display: block; }
.ex-bezug-link { color: var(--color-text); font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }

.ex-mehr { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ex-frage p { margin: 0; }

/* Historie */
.ex-laeufe { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ex-lauf { border-bottom: 1px solid var(--color-border); }
.ex-lauf-zeile { display: grid; grid-template-columns: 4.5rem minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.3fr) 13rem 1.25rem; align-items: center; gap: var(--space-2) var(--space-4); min-height: var(--touch); padding: var(--space-2) var(--space-2); color: inherit; text-decoration: none; }
.ex-lauf-zeile:hover { background: var(--color-bg); }
.ex-lauf-nr { font-weight: 600; font-variant-numeric: tabular-nums; }
.ex-lauf-haupt, .ex-lauf-zahlen, .ex-lauf-wer { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.ex-lauf-marken { display: flex; flex-wrap: wrap; gap: var(--space-1); justify-content: flex-end; }
.ex-offen-marke { border: 1px solid var(--ex-warn, #8a5200); background: var(--ex-warn-flaeche, #fff6e0); color: var(--ex-warn-text, #5c3600); font-weight: 600; }

/* Lauf */
.ex-daten { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--space-3) var(--space-6); }
.ex-offen-text { display: inline-flex; align-items: flex-start; gap: var(--space-2); color: var(--ex-warn-text, #5c3600); font-weight: 600; }
.ex-offen-text .icon { color: var(--ex-warn, #8a5200); }
.ex-dateien { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ex-datei { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-6); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.ex-datei-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; flex: 1 1 20rem; }
.ex-datei form { margin: 0; }
.ex-hash { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--text-sm); overflow-wrap: anywhere; word-break: break-all; }
.ex-abrufe { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ex-abruf { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }

/* Hinweis an einer Buchung: in welchem Lauf übergeben */
.ex-uebergeben { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); color: var(--color-text-muted); font-size: var(--text-base); }
.ex-uebergeben .icon { width: 1rem; height: 1rem; }
.ex-uebergeben-text { font-weight: 500; }
.ex-uebergeben-link { color: var(--color-text); font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }

/* Handy: Tabellen stapeln, jede Zelle mit Bezeichnung */
@media (max-width: 40rem) {
  .ex-lauf-zeile { grid-template-columns: minmax(0, 1fr) 1.25rem; }
  .ex-lauf-zeile > * { grid-column: 1; }
  .ex-lauf-zeile > .auftrag-pfeil { grid-column: 2; grid-row: 1; }
  .ex-lauf-marken { justify-content: flex-start; }
  .ex-tabelle thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ex-tabelle, .ex-tabelle tbody { display: block; width: 100%; }
  .ex-tabelle tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3); padding: var(--space-3) var(--space-1);
    border-bottom: 2px solid var(--color-border); grid-template-areas: "art tag" "mitarbeiter mitarbeiter" "auftrag auftrag" "buchung netto" "bezug bezug";
  }
  .ex-tabelle td { display: block; min-width: 0; padding: 0; border: 0; }
  .ex-tabelle td[data-label="Art"] { grid-area: art; justify-self: start; }
  .ex-tabelle td[data-label="Tag"] { grid-area: tag; font-weight: 600; text-align: right; }
  .ex-tabelle td[data-label="Mitarbeiter"] { grid-area: mitarbeiter; }
  .ex-tabelle td[data-label="Auftrag"] { grid-area: auftrag; }
  .ex-tabelle td[data-label="Buchung"] { grid-area: buchung; }
  .ex-tabelle td[data-label="Netto / Menge"] { grid-area: netto; text-align: right; font-size: var(--text-xl); }
  .ex-tabelle td[data-label="Bezug"] { grid-area: bezug; padding-top: var(--space-1); }
  .ex-tabelle td[data-label="Bezug"]::before { content: "Bezug: "; color: var(--color-text-muted); }
  .ex-datei form, .ex-datei .knopf { width: 100%; }
  .ex-zeitraum-wahl .knopf { flex: 1 1 auto; }
}

/* Beleg: Papier, ohne Navigation */
.beleg { display: flex; flex-direction: column; gap: var(--space-6); max-width: 64rem; margin: 0 auto; }
.beleg-demo { margin: 0; padding: var(--space-3) var(--space-4); border: 3px dashed var(--color-danger); border-radius: var(--radius-sm); color: var(--color-danger); font-size: var(--text-xl); font-weight: 700; text-align: center; letter-spacing: 0.02em; }
.beleg-kopf { display: flex; flex-direction: column; gap: var(--space-1); padding-bottom: var(--space-3); border-bottom: 2px solid var(--color-text); }
.beleg-kopf h1, .beleg-kopf p { margin: 0; max-width: none; }
.beleg-kopf .beleg-marke { margin: 0 0 var(--space-3); }
.beleg-marke img { display: block; height: 1.5rem; width: auto; }
.beleg-aktionen { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.beleg-daten { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--space-3) var(--space-6); }
.beleg h2 { font-size: var(--text-xl); margin: 0 0 var(--space-2); }
.beleg-dateien { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.beleg-dateien li { display: flex; flex-direction: column; gap: 0.125rem; }
.beleg-fuss p { margin: 0; max-width: none; color: var(--color-text-muted); }

@media print {
  .beleg { max-width: none; gap: 12pt; color: #000; font-size: 10pt; }
  .beleg-demo { color: #000; border-color: #000; font-size: 12pt; }
  .beleg-kopf { border-bottom-color: #000; }
  .beleg h1 { font-size: 16pt; }
  .beleg h2 { font-size: 12pt; }
  .beleg .ex-tabelle { font-size: 8.5pt; }
  .beleg .ex-tabelle thead { display: table-header-group; }
  .beleg .ex-tabelle tr { break-inside: avoid; }
  .beleg .ex-tabelle th, .beleg .ex-tabelle td { padding: 2pt 4pt; border-color: #000; }
  .beleg .ex-zeile.art-cancellation { background: #fff; }
  .beleg .ex-art, .beleg .ex-art.art-correction, .beleg .ex-art.art-cancellation { background: #fff; color: #000; border: 1px solid #000; }
  .beleg .ex-summe { background: #fff; border-color: #000; break-inside: avoid; }
  .beleg .meta, .beleg .ex-arten, .beleg .daten dt, .beleg-fuss p { color: #000; }
  .beleg .ex-hash { font-size: 7.5pt; }
}

/* Hinweis an Buchungslisten: unter der Zeile, über die ganze Breite */
.zeit-uebergabe { grid-column: 1 / -1; margin: 0; padding: 0 0 var(--space-2); }
.zeit-uebergabe .ex-uebergeben { min-height: var(--touch-min); }
@media (min-width: 64rem) and (pointer: fine) {
  .zeit-uebergabe { padding: 0 var(--space-2) var(--space-2); }
  .zeit-uebergabe .ex-uebergeben { min-height: 0; font-size: 0.8125rem; }
}
@media (max-width: 40rem) {
  .ex-tabelle td[data-label="Bezug"] .ex-bezug { display: inline; }
  .ex-tabelle td.ex-leer { display: none; }
}

.ex-summen + .ex-gruppen { margin-top: var(--space-4); }

/* Historie: Filter des Laufs, Nachladen; verstecktes Aktualisieren für das Neulesen der Abrufe */
.ex-lauf-filter { color: var(--color-text); }
.ex-versteckt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; padding: 0; }
.beleg p, .beleg-demo { max-width: none; }
@media print {
  .beleg .daten dt, .beleg .daten dd { font-size: 10pt; }
  .beleg .ex-tabelle td, .beleg .ex-tabelle .meta { font-size: 8.5pt; }
}

/* Der Rahmen der Lauf-Ansicht (`phx-window-focus`) ist kein Layout-Kasten: die Karten bleiben Kinder von `.seite` */
#lauf-seite { display: contents; }

/* PO-Nachbesserung 1: Titel mit ?-Symbol daneben; gleich hohe Label-Zeilen in der Filterzeile */
.ex-titel-mit-hilfe { display: flex; align-items: center; gap: var(--space-1); min-width: 0; }
.ex-filter-felder .feld-kopf { min-height: 1.75rem; }

/* ---------- Artikel-Import (T-038) ---------- */
.import-seite .ai-karte { gap: var(--space-4); }
.ai-formular { display: flex; flex-direction: column; gap: var(--space-4); }
.ai-modus { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.ai-modus legend { padding: 0; margin-bottom: var(--space-2); font-weight: 600; font-size: var(--text-lg); }
.ai-wahl { display: flex; align-items: flex-start; gap: var(--space-3); min-height: var(--touch-min); padding: var(--space-3); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface); cursor: pointer; }
.ai-wahl:has(input:checked) { border-color: var(--color-text); box-shadow: inset 0 0 0 1px var(--color-text); }
.ai-wahl input { flex: none; width: 1.5rem; height: 1.5rem; margin: 0.125rem 0 0; accent-color: var(--graphit-900); }
.ai-wahl > span { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.ai-datei { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border: 2px dashed var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-bg); }
.ai-datei[data-phx-drop-target-active], .ai-datei.phx-drop-target-active { border-color: var(--color-text); background: var(--color-surface); }
.ai-datei-label { font-weight: 600; font-size: var(--text-lg); }
.ai-datei-feld { max-width: 100%; font-size: var(--text-base); }
.ai-datei-feld::file-selector-button { min-height: var(--touch-min); margin-right: var(--space-3); padding: 0 var(--space-4); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text); font: inherit; font-weight: 600; cursor: pointer; }
.ai-gewaehlt { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.ai-gewaehlt li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.ai-gewaehlt .feld-fehler { flex: 1 1 100%; margin: 0; }

.ai-zaehler { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--space-3); }
.ai-zahl { display: flex; flex-direction: column; gap: 0.125rem; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg); }
.ai-zahl dt { color: var(--color-text-muted); font-size: var(--text-base); font-weight: 500; }
.ai-zahl dd { margin: 0; font-size: var(--text-2xl); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ai-zahl.mit-fehlern { border: 2px solid var(--color-danger); background: #fdf1f0; }
.ai-zahl.mit-fehlern dd { color: var(--color-danger); }

.ai-lieferanten { margin: 0; }
.ai-haken { display: flex; align-items: center; gap: var(--space-3); min-height: var(--touch-min); font-weight: 600; cursor: pointer; }
.ai-haken input { width: 1.5rem; height: 1.5rem; accent-color: var(--graphit-900); }
.ai-frage-zahlen { margin: 0; padding-left: var(--space-6); }
.ai-filter button.auftrag-ansicht { font: inherit; font-weight: 600; cursor: pointer; }
.ai-filter button[disabled] { opacity: 0.55; cursor: not-allowed; }

.ai-tabelle-wrap { overflow-x: auto; }
.ai-tabelle { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.ai-tabelle th { padding: var(--space-2) var(--space-3); text-align: left; color: var(--color-text-muted); font-weight: 600; border-bottom: 2px solid var(--color-border-strong); white-space: nowrap; }
.ai-tabelle td { padding: var(--space-2) var(--space-3); vertical-align: top; border-bottom: 1px solid var(--color-border); overflow-wrap: anywhere; }
.ai-tabelle td > span { display: block; }
.ai-tabelle td > span.ai-marke { display: inline-flex; }
.ai-nr { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.ai-zeile.art-error { background: #fdf1f0; }
.ai-marke { align-items: center; gap: var(--space-1); min-height: 1.5rem; padding: 0 var(--space-2); border-radius: var(--radius-full); border: 1px solid var(--color-border-strong); background: var(--color-surface); color: var(--color-text); font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }
.ai-marke .icon { width: 1rem; height: 1rem; }
.ai-marke.art-update { background: var(--graphit-900); border-color: var(--graphit-900); color: #fff; }
.ai-marke.art-error { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.ai-marke.art-skip { background: var(--color-soft); }
.ai-gruende, .ai-aenderungen { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.ai-spalte { font-weight: 600; }
.ai-alt { text-decoration: line-through; color: var(--color-text-muted); }
.ai-neu { font-weight: 600; }
.ai-grund { color: var(--color-text); }

.ai-laeufe { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ai-lauf { display: grid; grid-template-columns: 4.5rem minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.9fr); gap: var(--space-1) var(--space-4); padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--color-border); }
.ai-lauf-nr { font-weight: 600; font-variant-numeric: tabular-nums; }
.ai-lauf-datei, .ai-lauf-zahlen, .ai-lauf-wer { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.ai-lauf-hash { grid-column: 2 / -1; }

@media (max-width: 40rem) {
  .ai-lauf { grid-template-columns: minmax(0, 1fr); }
  .ai-lauf-hash { grid-column: auto; }
  .ai-tabelle thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ai-tabelle, .ai-tabelle tbody { display: block; width: 100%; }
  .ai-tabelle tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-1) var(--space-3); padding: var(--space-3) var(--space-1); border-bottom: 2px solid var(--color-border); grid-template-areas: "nr marke" "artikel artikel" "detail detail"; }
  .ai-tabelle td { display: block; padding: 0; border: 0; }
  .ai-tabelle td[data-label="Zeile"] { grid-area: nr; }
  .ai-tabelle td[data-label="Ergebnis"] { grid-area: marke; }
  .ai-tabelle td[data-label="Artikel"] { grid-area: artikel; }
  .ai-tabelle td[data-label="Änderung oder Grund"] { grid-area: detail; }
  .ai-tabelle td[data-label="Zeile"]::before { content: "Zeile "; font-weight: 500; }
  .ai-zaehler { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ai-spalte { margin-right: var(--space-1); }
.ai-filter .auftrag-ansicht .zahl, .ai-filter .auftrag-ansicht[aria-current="true"] .zahl { background: var(--color-soft); color: var(--graphit-900); }

/* Unbekannte Lieferanten: alle Namen bleiben sichtbar, die Liste bricht um und scrollt */
.ai-lieferanten-liste { list-style: none; margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); max-height: 9rem; overflow-y: auto; background: var(--color-surface); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); font-weight: 500; }
.ai-lieferanten-liste li { min-width: 0; overflow-wrap: anywhere; }
.ai-lieferanten-liste:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }

/* PO-Nachbesserung 1 (T-038): Titel mit ?-Symbol in einer Zeile, Lieferantenbox flächig und linksbündig */
.ai-modus-kopf { display: flex; align-items: center; gap: var(--space-1); margin-bottom: var(--space-2); font-weight: 600; font-size: var(--text-lg); min-width: 0; }
.ai-lieferanten-box { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 2px solid #8a5200; border-radius: var(--radius-sm); background: #fff6e0; color: #5c3600; }
.ai-lieferanten-box p { margin: 0; max-width: none; }
.ai-lieferanten-kopf { display: flex; align-items: flex-start; gap: var(--space-2); }
.ai-lieferanten-kopf .icon { color: #8a5200; margin-top: 0.125rem; }
.ai-lieferanten-box .ai-lieferanten-liste { margin: 0; width: 100%; color: var(--color-text); }
.ai-lieferanten-box .meta { color: #5c3600; }

/* ---------- Kunden-Import (T-040): Kunden und Einsatzorte getrennt gezählt, zwei Spalten je Zeile ---------- */
.ci-zaehler { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.ci-gruppe { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; padding: var(--space-3); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface); }
.ci-gruppe h3 { margin: 0; font-size: var(--text-lg); font-weight: 600; }
/* Je Gruppe eine Zeile pro Zahl: Bezeichnung links, Zahl rechts. Nichts ragt heraus, auch nicht bei dreistelligen Zahlen. */
.ci-gruppe .ai-zaehler { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
.ci-gruppe .ai-zahl { flex-direction: row; align-items: baseline; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-3); min-width: 0; }
.ci-gruppe .ai-zahl dt { min-width: 0; font-size: var(--text-base); overflow-wrap: anywhere; }
.ci-gruppe .ai-zahl dd { flex: none; font-size: var(--text-xl); }
.ci-tabelle td { min-width: 0; }
.ci-tabelle td[data-label="Kunde"], .ci-tabelle td[data-label="Einsatzort"] { width: 22%; }
.ai-marke.art-same { border-style: dashed; background: var(--color-bg); font-weight: 500; }
.ci-ergaenzt { display: flex; align-items: flex-start; gap: var(--space-1); margin-top: var(--space-1); padding: var(--space-1) var(--space-2); border-left: 4px solid var(--graphit-900); background: var(--color-soft); font-size: var(--text-sm); font-weight: 600; }
.ci-ergaenzt .icon { flex: none; width: 1rem; height: 1rem; margin-top: 0.125rem; }
.ci-neu-satz { display: block; font-weight: 600; }
.ci-block { display: flex; flex-direction: column; gap: var(--space-1); }
.ci-block + .ci-block { margin-top: var(--space-2); }
.ci-block-titel { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 600; text-transform: none; }
.ai-lauf-zahlen .kunden-zahlen, .ai-lauf-zahlen .orte-zahlen { display: block; }
@media (max-width: 60rem) {
  .ci-zaehler { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .ci-tabelle tr { grid-template-areas: "nr nr" "kunde kunde" "ort ort" "detail detail"; }
  .ci-tabelle td[data-label="Kunde"] { grid-area: kunde; width: auto; }
  .ci-tabelle td[data-label="Einsatzort"] { grid-area: ort; width: auto; }
  .ci-tabelle td[data-label="Einsatzort"]::before { content: "Einsatzort: "; font-weight: 500; color: var(--color-text-muted); }
}

/* ---------- Übersicht: Zu prüfen und Export (T-039) ---------- */
.cu-pruefen { gap: var(--space-2); }
.cu-pruefen h2, .cu-pruefuntertitel { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.cu-pruefuntertitel { font-size: var(--text-lg); font-weight: 600; margin-top: var(--space-3); }
.cu-pruefliste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cu-pruefzeile { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); padding: var(--space-2) 0; border-top: 1px solid var(--color-border); min-width: 0; }
.cu-pruefzeile:first-child { border-top: 0; }
.cu-pruefname { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 7rem; font-weight: 600; }
.cu-pruefname .icon { width: 1.125rem; height: 1.125rem; color: var(--color-text-muted); }
.cu-pruefzahl { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--touch-min); padding: 0 var(--space-2); color: var(--color-text); text-decoration: none; font-variant-numeric: tabular-nums; border-radius: var(--radius-sm); }
a.cu-pruefzahl:hover { background: var(--color-bg); text-decoration: underline; text-underline-offset: 0.2em; }
a.cu-pruefzahl .icon { width: 1rem; height: 1rem; color: var(--color-text-muted); }
a.cu-pruefzahl.signal strong { color: var(--color-danger); }
.cu-pruefzahl.ohne, .cu-pruefstand.ohne { color: var(--color-text-muted); }
.cu-pruefstand { color: var(--color-text); font-size: var(--text-base); min-width: 0; }
.cu-pruefzeile.export { display: grid; grid-template-columns: minmax(7rem, auto) minmax(0, 1fr); gap: 0 var(--space-4); }
.cu-pruefzeile.export .cu-pruefstand { align-self: center; }
.cu-pruefzeile.export .cu-pruefzahl { grid-column: 2; justify-self: start; margin-left: calc(-1 * var(--space-2)); }
.cu-pruefruhe { display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--color-text-muted); }
@media (min-width: 64rem) and (pointer: fine) {
  .cu-pruefzahl { min-height: 2rem; }
}

/* Reiter „Neuer Export / Historie“ und „Importieren / Historie“: am Büro-Desktop führt die Bereichsleiste, am Handy bleiben die Reiter */
@media (min-width: 64rem) and (pointer: fine) {
  .ex-reiter, .ai-reiter { display: none; }
}

/* Niedrige Fenster am Büro-Desktop (1280×720): die Schiene mit allen Bereichen, Konto und Abmelden passt ohne Scrollen */
@media (min-width: 64rem) and (pointer: fine) and (max-height: 50rem) {
  .schiene { padding: var(--space-2) 0; gap: var(--space-1); }
  .schiene-marke { width: 1.75rem; height: 1.75rem; margin-bottom: 0; }
  .schiene-marke img { width: 1.75rem; height: 1.75rem; }
  .schiene-liste { gap: 0; }
  .schiene-link, .knopf.schiene-knopf { padding: 0.125rem 0; gap: 0; }
  .schiene-symbol { height: 1.5rem; }
  .schiene-fuss { gap: 0; }
}

/* T-039 Runde 1: Karte „Zu prüfen“ am Handy (Zahl und Wort zusammen, Zeilen untereinander, Tippflächen 48 px) */
.cu-pruefzahl { white-space: nowrap; }
@media (max-width: 63.9375rem), (pointer: coarse) {
  .cu-pruefzeile { flex-direction: row; align-items: center; gap: 0 var(--space-3); }
  .cu-pruefname { flex: 1 1 100%; min-height: 2rem; }
  .cu-pruefzahl { min-height: var(--touch-min); }
  a.cu-pruefzahl { padding: 0 var(--space-3); border: 1px solid var(--color-border-strong); background: var(--color-surface); }
  .cu-pruefzeile.export { display: flex; flex-wrap: wrap; }
  .cu-pruefzeile.export .cu-pruefstand { flex: 1 1 100%; min-height: 1.5rem; }
  .cu-pruefzeile.export .cu-pruefzahl { grid-column: auto; margin-left: 0; }
  .cu-pruefzahl.ohne { padding-left: 0; }
  /* Ein Zurücksetzen genügt: Steht es schon in der Kopfzeile des Filters, entfällt der Link über der Liste */
  .liste-zurueck.doppelt { display: none; }
}

/* T-039 PO-Nachbesserung 1: Karte „Zu prüfen“ am Desktop. Die Karte misst sich selbst (Container): In der schmalen
   Spalte rechts steht je Zeile der Name über dem Inhalt, in der breiten Karte unter „Meine Arbeit“ stehen Name und Inhalt
   in gemeinsamen Spalten, in beiden Listen gleich breit. Nie bricht ein einzelnes „zu klären“ unter das Symbol. */
.cu-pruefzahlen, .cu-pruefexport { display: contents; }
.cu-pruefen { container-type: inline-size; container-name: pruefen; }
@media (min-width: 64rem) and (pointer: fine) {
  .cu-pruefliste { padding-right: var(--space-2); }
  .cu-pruefzeile, .cu-pruefzeile.export { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); }
  .cu-pruefzeile > .cu-pruefname { flex: 1 1 100%; min-width: 0; white-space: nowrap; }
  .cu-pruefzahlen { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--space-1); min-width: 0; margin-left: calc(-1 * var(--space-2)); }
  .cu-pruefzahlen .cu-pruefzahl { padding: 0 var(--space-2); }
  .cu-pruefexport { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
  .cu-pruefzeile.export .cu-pruefstand { padding-left: 1.625rem; align-self: flex-start; }
  .cu-pruefzeile.export .cu-pruefzahl { margin-left: 0; padding-left: 1.625rem; padding-right: var(--space-2); }
}
@container pruefen (min-width: 30rem) {
  @media (min-width: 64rem) and (pointer: fine) {
    .cu-pruefliste { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: var(--space-6); }
    .cu-pruefzeile, .cu-pruefzeile.export { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; gap: 0 var(--space-6); }
    .cu-pruefzeile > .cu-pruefname { grid-column: 1; flex: none; }
    .cu-pruefzahlen { grid-column: 2; margin-left: calc(-1 * var(--space-2)); }
    .cu-pruefexport { grid-column: 2; }
    .cu-pruefzeile.export .cu-pruefstand { padding-left: 0; }
    .cu-pruefzeile.export .cu-pruefzahl { margin-left: calc(-1 * var(--space-2)); padding-left: var(--space-2); }
  }
}

/* ---------- Mein Tag, T-042: Schnellerfassung (Schritte, Tageswahl, Klärfälle) ---------- */
/* 15-Minuten-Schritte unter einem Feld: zwei Knöpfe, je mindestens 48 px hoch und halb so breit wie das Feld */
.m-schritt-feld { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.m-schritte { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.m-app .m-schritt { min-height: var(--touch-min); padding: 0 var(--space-2); font-size: var(--text-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.m-app .m-schritt:disabled { color: var(--color-text-muted); border-style: dashed; background: transparent; cursor: not-allowed; }

/* Tageswahl: Heute und Gestern immer da, die übrigen Tage hinter „Früher“ */
.m-tage { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2); }
.m-app .m-tag-knopf { min-width: 6rem; padding: 0 var(--space-4); font-weight: 600; text-decoration: none; justify-content: center; }
.m-app .m-tag-knopf[aria-current], .m-app .m-tage-frueher:not([open]) > summary[data-gewaehlt="true"] { background: var(--graphit-900); border-color: var(--graphit-900); color: var(--color-surface); }
.m-tage-frueher { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.m-tage-frueher > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; align-self: flex-start; }
.m-tage-frueher > summary::-webkit-details-marker { display: none; }
.m-tage-frueher > summary::after { content: "▾"; margin-left: var(--space-2); }
.m-tage-frueher[open] > summary::after { content: "▴"; }
.m-tage-liste { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Zu klären: Satz unter der Summe und eigene Liste */
.m-tag-klaeren { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-left: 4px solid var(--graphit-900); background: var(--color-soft); font-size: var(--text-lg); font-weight: 500; max-width: none; }
.m-tag-klaeren .icon { flex: none; margin-top: 0.125rem; }
.m-klaer h2 .zahl { margin-left: var(--space-1); }

/* Rückfragefenster: Die Felder des Formulars stehen mit Abstand untereinander, auch die Schritte und die Knöpfe */
.m-sheet .m-form { display: flex; flex-direction: column; gap: var(--space-4); }

/* ---------- Auswertungen (T-043): Mitarbeiter, Aufträge, Detail. Rein lesend. ---------- */
.ra-ansichten .icon { margin-right: var(--space-1); }
.ra-zeitraum { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.ra-monatswahl { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); }
.ra-zeitraum-text { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); text-align: center; min-width: 0; }
.ra-zeitraum-text h2 { font-size: var(--text-xl); font-weight: 600; }
.ra-aktuell { font-size: var(--text-base); font-weight: 600; }
.ra-frei { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--color-border); }
.ra-frei .feld { min-width: 11rem; flex: 0 1 12rem; }
.ra-karte { display: flex; flex-direction: column; gap: var(--space-3); }
.ra-erklaerungen { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); color: var(--color-text-muted); font-size: var(--text-base); }
.ra-erkl { display: inline-flex; align-items: center; gap: var(--space-2); }
.ra-hinweis { display: flex; align-items: flex-start; gap: var(--space-2); color: var(--color-text-muted); font-size: var(--text-base); max-width: none; }
.ra-hinweis .icon { flex: none; margin-top: 0.125rem; }
.ra-filter { display: flex; flex-direction: column; gap: var(--space-3); }
.ra-tabelle-wrap { overflow-x: auto; }
.ra-tabelle { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.ra-tabelle th, .ra-tabelle td { padding: var(--space-2) var(--space-3); text-align: left; vertical-align: top; border-bottom: 1px solid var(--color-border); }
.ra-tabelle thead th { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }
.ra-tabelle tbody th[scope="row"] { font-weight: 500; }
.ra-tabelle .zahl-spalte { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ra-zeile.inaktiv { color: var(--color-text-muted); }
.ra-summe th, .ra-summe td { background: var(--color-soft); border-top: 2px solid var(--color-border-strong); font-weight: 600; }
.ra-klaer { display: inline-flex; align-items: center; gap: var(--space-1); font-weight: 600; }
.ra-gut { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--color-text-muted); }
.ra-wege { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); margin-top: var(--space-1); }
.ra-weg { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 2.25rem; font-weight: 600; white-space: nowrap; }
.ra-fehltage > summary { flex-wrap: wrap; gap: var(--space-1) var(--space-2); font-weight: 600; }
.ra-fehltage[open] .cu-dreieck { transform: rotate(90deg); }
.ra-fehltage > summary:hover .ra-fehl-zahl { text-decoration: underline; }
.ra-monat-kurz { display: none; }
.ra-monat-knopf { white-space: nowrap; }
.ra-monat-knopf.deaktiviert { color: var(--color-text-muted); border-style: dashed; background: transparent; cursor: default; }
/* Die Unteransichten stehen am Desktop schon in der Bereichsleiste: Reiter nur, wo die Leiste fehlt */
@media (min-width: 64rem) and (pointer: fine) { .ra-ansichten { display: none; } }
.ra-tage { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); max-height: 16rem; overflow-y: auto; }
.ra-tag { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); padding: var(--space-1) var(--space-2); border-left: 4px solid var(--color-border-strong); background: var(--color-bg); }
.ra-tag.klaerfall { border-left-color: var(--graphit-900); background: var(--color-soft); font-weight: 600; }
.ra-tag-marke { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--color-text-muted); font-size: var(--text-sm); }
.ra-tag.klaerfall .ra-tag-marke { color: var(--color-text); }
.ra-auftrag-link { display: flex; flex-direction: column; gap: 0.125rem; text-decoration: none; color: inherit; }
.ra-auftrag-link:hover .adresse { text-decoration: underline; }
.ra-wert { display: flex; flex-direction: column; gap: var(--space-1); }
.ra-betrag { font-weight: 600; font-variant-numeric: tabular-nums; }
.ra-nicht { font-weight: 600; }
.ra-luecke { display: inline-flex; align-items: center; gap: var(--space-1); padding: 0 var(--space-2); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 600; width: fit-content; }
.ra-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
.ra-block { display: flex; flex-direction: column; gap: var(--space-3); }
.ra-block h2 { font-size: var(--text-xl); }
.ra-werte { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); margin: 0; }
.ra-werte dt { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 600; display: flex; align-items: center; gap: var(--space-2); }
.ra-werte dd { margin: 0; font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.ra-werte .breit { grid-column: 1 / -1; }
.ra-sprunge { grid-column: 1 / -1; }
@media (max-width: 60rem) {
  .ra-detail { grid-template-columns: minmax(0, 1fr); }
  .ra-tabelle, .ra-tabelle tbody, .ra-tabelle tfoot, .ra-tabelle tr { display: block; }
  .ra-tabelle thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ra-tabelle tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border-strong); }
  .ra-tabelle th, .ra-tabelle td { padding: 0; border: 0; }
  .ra-tabelle th[scope="row"] { grid-column: 1 / -1; font-size: var(--text-lg); }
  .ra-tabelle td { display: flex; flex-direction: column; align-items: flex-start; gap: 0.125rem; min-width: 0; }
  .ra-tabelle td::before { content: attr(data-label); color: var(--color-text-muted); font-size: var(--text-sm); font-weight: 600; }
  .ra-tabelle .zahl-spalte { text-align: left; }
  .ra-tabelle td[data-label="Werktage ohne Buchung"], .ra-tabelle td[data-label="Einkaufswert (Richtwert)"], .ra-tabelle td[data-label="Status"] { grid-column: 1 / -1; }
  .ra-tabelle .ra-summe { background: var(--color-soft); padding: var(--space-3); }
  .ra-summe th, .ra-summe td { background: transparent; border-top: 0; }
  .ra-tabelle td:empty { display: none; }
}
@media (max-width: 40rem) {
  .ra-monat-lang { display: none; }
  .ra-monat-kurz { display: inline; }
  .ra-monat-knopf { justify-content: space-between; padding: 0 var(--space-4); }
  .ra-monatswahl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ra-zeitraum-text { grid-column: 1 / -1; order: -1; }
  .ra-frei .feld { flex: 1 1 8rem; min-width: 0; }
  .ra-frei .knopf { flex: 1 1 100%; }
  .ra-werte { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 60.0625rem) and (pointer: fine) {
  .ra-tabelle th, .ra-tabelle td { padding: var(--space-1) var(--space-3); }
  .ra-weg { min-height: 2rem; }
}
.ra-filter .suche { flex: none; }
.ra-filter .filter-felder { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); max-width: 64rem; }
.ra-fehlerblock { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.ra-fehlerblock .meldung { width: 100%; }

/* ---------- Auftrags-Import (T-044): Auftrag, Kunde und Einsatzort, Mitarbeiter, Änderung; Sperre und Hinweis bleiben sichtbar ---------- */
.wi-tabelle td { min-width: 0; }
.wi-tabelle td[data-label="Auftrag"] { width: 22%; }
.wi-tabelle td[data-label="Kunde und Einsatzort"] { width: 20%; }
.wi-tabelle td[data-label="Mitarbeiter"] { width: 16%; }
.wi-marken { display: flex !important; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
.ai-marke.art-locked { background: var(--color-soft); border-style: dashed; }
.ai-marke.art-similar { background: #fff6e0; border-color: #8a5200; color: #5c3600; }
.ai-marke.art-create { background: var(--color-surface); }
.wi-person { display: flex !important; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.wi-zuweisung { min-height: 1.25rem; font-size: var(--text-sm); }
.wi-sperre, .wi-hinweis { display: flex !important; align-items: flex-start; gap: var(--space-1); margin-top: var(--space-1); padding: var(--space-1) var(--space-2); border-left: 4px solid var(--graphit-900); background: var(--color-soft); font-size: var(--text-sm); font-weight: 600; }
.wi-hinweis { border-left-color: #8a5200; background: #fff6e0; color: #5c3600; }
.wi-sperre .icon, .wi-hinweis .icon { flex: none; width: 1rem; height: 1rem; margin-top: 0.125rem; }
.ai-zahl.art-assign { background: var(--color-surface); }
.ai-lauf-zahlen .auftrag-zahlen, .ai-lauf-zahlen .zuweisung-zahlen { display: block; }
@media (max-width: 40rem) {
  .wi-tabelle tr { grid-template-areas: "nr nr" "auftrag auftrag" "kunde kunde" "mitarbeiter mitarbeiter" "detail detail"; }
  .wi-tabelle td[data-label="Auftrag"] { grid-area: auftrag; width: auto; }
  .wi-tabelle td[data-label="Kunde und Einsatzort"] { grid-area: kunde; width: auto; }
  .wi-tabelle td[data-label="Mitarbeiter"] { grid-area: mitarbeiter; width: auto; }
  .wi-tabelle td[data-label="Mitarbeiter"] { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); }
  .wi-tabelle td[data-label="Mitarbeiter"]::before { content: "Mitarbeiter:"; font-weight: 500; color: var(--color-text-muted); }
  .wi-tabelle td.wi-leer { display: none; }
}

/* ---------- Mitarbeiter-Import (T-045): Mitarbeiter aus der Datei, Bestand, Änderung; die Sperre bleibt sichtbar ---------- */
.ei-tabelle td { min-width: 0; }
.ei-tabelle td[data-label="Mitarbeiter"] { width: 28%; }
.ei-tabelle td[data-label="Bestand"] { width: 24%; }
.ai-lauf-zahlen .mitarbeiter-zahlen { display: block; }
@media (max-width: 40rem) {
  .ei-tabelle tr { grid-template-areas: "nr nr" "mitarbeiter mitarbeiter" "bestand bestand" "detail detail"; }
  .ei-tabelle td[data-label="Mitarbeiter"] { grid-area: mitarbeiter; width: auto; }
  .ei-tabelle td[data-label="Bestand"] { grid-area: bestand; width: auto; }
  .ei-tabelle td[data-label="Bestand"] { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); }
  .ei-tabelle td[data-label="Bestand"]::before { content: "Bestand:"; font-weight: 500; color: var(--color-text-muted); }
  .ei-tabelle td.ei-leer { display: none; }
}

/* ---------- T-046 (B-35): Handy kompakter ----------
   Kopfzeile 48 statt 64 px (Büro) und 60 px (Mein Tag): Logo und ein Knopf, der die ganze Zeilenhöhe nutzt. Alle Klickflächen
   bleiben bei 48 px. Darunter etwas weniger Luft und kleinere Überschriften; Eingaben bleiben bei 18 px, Fließtext bei 7:1. */
@media (max-width: 40rem) {
  input, select, .karte, .mitglied, #anlegen { scroll-margin-top: 4rem; }
  .leiste-kopf { min-height: 3rem; padding: 0 0 0 var(--space-4); }
  .leiste-menue { max-height: calc(100dvh - 3rem); }
  .menue-knopf { border-color: transparent; border-radius: 0; padding: 0 var(--space-4) 0 var(--space-3); }
  .kopf { min-height: 3rem; padding: 0 0 0 var(--space-4); }
  .kopf .knopf, .kopf .knopf:hover { border: 0; border-radius: 0; min-height: 3rem; padding: 0 var(--space-4) 0 var(--space-3); }
  .m-topbar { min-height: 3rem; padding: 0 0 0 var(--space-4); }
  .m-topbar-marke { min-height: 3rem; }
  .m-topbar-knopf, .m-app .m-topbar .knopf.m-topbar-knopf { border-color: transparent; border-radius: 0; padding: 0 var(--space-4) 0 var(--space-3); }
  .arbeitsflaeche > main { padding: var(--space-4) var(--space-3) var(--space-8); }
  .m-main { gap: var(--space-3); padding: var(--space-3) var(--space-3) 6.5rem; }
  .m-name { font-size: var(--text-xl); }
  .m-karte, .m-zeilen { padding: var(--space-3); }
}

/* T-046 Nachbesserung 1 (PO): Büro am Handy spürbar kompakter. Schrift und Abstände über die Skala der Seite (16 statt 18 px
   Fließtext, 15 px Zusatztext, H1 22 px), Eingaben bleiben 18 px, Klickflächen 48 px, Kontrast unverändert. Die Schnellansichten
   und die Status-Reiter stehen in einer Zeile (Auftragsliste wischt seitwärts) statt in drei. */
@media (max-width: 40rem) {
  :root { --text-lg: 1rem; --text-base: 0.9375rem; --text-xl: 1.125rem; --text-2xl: 1.375rem; --space-6: 1.25rem; }
  input, select, textarea { font-size: 1.125rem; }
  h1, .karte > h1 { font-size: var(--text-2xl); }
  .karte, .panel { padding: var(--space-3); }
  .seitenkopf { gap: var(--space-2) var(--space-4); }
  .seitenkopf-text { gap: 0; }
  .kopf-titel { flex-wrap: nowrap; align-items: flex-start; }
  .kopf-titel > h1, .kopf-titel > h2 { min-width: 0; }
  .auftrag-ansichten { flex-wrap: nowrap; overflow-x: auto; margin-bottom: var(--space-3); padding-bottom: var(--space-2); scrollbar-width: none; }
  .auftrag-ansichten::-webkit-scrollbar { display: none; }
  .auftrag-ansicht { flex: none; }
  .cu-reiter { flex-wrap: nowrap; gap: var(--space-2); }
  .cu-reiter-link { padding: 0 var(--space-3); gap: var(--space-1); white-space: nowrap; }
  .cu-gruppen-kopf { gap: var(--space-2); }
  .cu-gruppen-titel { white-space: nowrap; }
  .cu-mehr { white-space: nowrap; }
  /* Suche der Übersicht: das ?-Symbol steht rechts im Feld, sein Text darunter in voller Breite */
  .uebersicht-suche .suche { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-1); }
  .uebersicht-suche .suche input { flex: 1 1 0; min-width: 0; }
  .uebersicht-suche .suche .suche-symbol { bottom: auto; height: var(--feld); }
  .uebersicht-suche .suche .hilfe-pop { flex: 1 1 100%; }
}

/* ---------- T-047: Support-Band, Plattformbereich, Supportfreigabe ----------
   Das Band ist Kupfer mit dunkler Schrift (über 10:1) und steht über der ganzen Seite. „Schreiben“ trägt eine dunkle
   Marke, „Nur lesen“ eine helle. Am Handy ist es 48 px hoch und klebt unter der Kopfzeile oben, am Büro-Desktop 36 px. */
:root { --band-hoehe: 3rem; --band-bg: #ecad6f; --band-ink: #1f1e1c; }
.support-band {
  grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-2) var(--space-3); min-height: var(--band-hoehe);
  padding: 0 0 0 var(--space-3); background: var(--band-bg); color: var(--band-ink); font-size: var(--text-base); line-height: 1.2;
}
.support-band .icon { width: 1.125rem; height: 1.125rem; }
.support-band-titel { display: inline-flex; align-items: center; gap: var(--space-1); white-space: nowrap; }
.support-band-betrieb { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.support-umfang {
  flex: none; padding: 0.125rem 0.625rem; border: 1px solid var(--band-ink); border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.7); font-size: 0.8125rem; font-weight: 700; white-space: nowrap;
}
.support-umfang.schreiben { background: var(--band-ink); color: #fff; }
.support-rest { flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.support-zurueck {
  display: inline-flex; align-items: center; gap: var(--space-1); flex: none; margin-left: auto; min-height: var(--band-hoehe);
  padding: 0 var(--space-3); color: var(--band-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; white-space: nowrap;
}
.support-zurueck:hover { background: rgba(31, 30, 28, 0.12); }
.support-band :focus-visible { outline-color: var(--band-ink); outline-offset: -3px; }
.support-zurueck .kurz { display: none; }
.rahmen.mit-band > .leiste { top: var(--band-hoehe); }
.rahmen.mit-band .leiste-menue { max-height: calc(100dvh - 3rem - var(--band-hoehe)); }
@media (max-width: 60rem) {
  .rahmen.mit-band > .support-band { position: sticky; top: 0; z-index: 6; }
}
.support-rest .kurz { display: none; }
/* Handy: Der Name des Betriebs ist das Wichtigste im Band. Er bekommt den Platz, darf auf zwei Zeilen umbrechen, und die
   Restzeit steht kurz („1:30 h“). „Plattform“ bleibt eine 48-px-Fläche. */
@media (max-width: 40rem) {
  .support-band-titel strong { display: none; }
  .support-zurueck .lang { display: none; }
  .support-zurueck .kurz { display: inline; }
  .support-rest .lang { display: none; }
  .support-rest .kurz { display: inline; }
  .support-band { gap: var(--space-2); font-size: 0.8125rem; }
  .support-band-betrieb {
    flex: 1 1 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
    white-space: normal; line-height: 1.15; overflow-wrap: anywhere;
  }
  .support-umfang { padding: 0.0625rem 0.5rem; font-size: 0.75rem; }
  .support-zurueck { padding: 0 var(--space-3) 0 var(--space-2); }
}
@media (min-width: 64rem) and (pointer: fine) {
  :root { --band-hoehe: 2.25rem; }
  .rahmen.mit-band { grid-template-rows: var(--band-hoehe) var(--kopf-hoehe) minmax(0, 1fr); }
  .rahmen.mit-band > .support-band { grid-row: 1; }
  .rahmen.mit-band > .schiene, .rahmen.mit-band > .leiste, .rahmen.mit-band .arbeitsflaeche > main { grid-row: 3; }
  .rahmen.mit-band .kopfleiste { grid-row: 2; }
  .rahmen.mit-band > .leiste { top: 0; }
}

.pl-reiter { margin: 0 0 var(--space-3); }
.pl-suche { flex: none; max-width: 24rem; margin: 0 0 var(--space-3); }
.pl-demo { align-items: center; gap: var(--space-2); }
.pl-demo-wahl { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.pl-eintrag .mitglied-kopf { padding-block: var(--space-1); }
.sp-dauer { margin: var(--space-2) 0 0; padding-bottom: 0; border-bottom: 0; }
.sp-dauer .auftrag-ansicht { min-height: var(--touch-min); }
@media (min-width: 64rem) and (pointer: fine) { .sp-dauer .auftrag-ansicht { min-height: 2rem; } }

/* ---------- Betriebseinstellungen (T-048) ---------- */
.einstellungen-spalte { display: flex; flex-direction: column; gap: var(--space-4); max-width: 44rem; }
.listenkopf.einstellung-kopf { justify-content: flex-start; }
.einstellung-zeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); padding: var(--space-3) 0; }
.einstellung-text { margin: 0; min-width: 0; max-width: none; font-size: var(--text-lg); font-weight: 500; }
.einstellung-letzte { max-width: none; margin: 0; padding-top: var(--space-3); border-top: 1px solid var(--color-border); }
.einstellung-netto { align-self: end; margin: 0; min-height: var(--touch-min); display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-lg); }
.einstellungen-seite .formular .gruppe + .gruppe { margin-top: var(--space-2); }

/* Schalter: Zustand steht als Text daneben (An/Aus), nie nur als Farbe */
.schalter { display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--touch-min); padding: 0 var(--space-3); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text); font: inherit; font-size: var(--text-lg); font-weight: 600; cursor: pointer; }
.schalter-spur { position: relative; flex: none; width: 3rem; height: 1.75rem; border: 2px solid var(--color-border-strong); border-radius: 999px; background: var(--color-surface); transition: background-color 150ms; }
.schalter-knopf { position: absolute; top: 0.125rem; left: 0.125rem; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--color-border-strong); transition: transform 150ms, background-color 150ms; }
.schalter[aria-checked="true"] .schalter-spur { border-color: var(--color-primary); background: var(--color-primary); }
.schalter[aria-checked="true"] .schalter-knopf { background: var(--color-primary-contrast); transform: translateX(1.25rem); }
.schalter-text { min-width: 2.25rem; text-align: left; }
@media (min-width: 64rem) and (pointer: fine) {
  .schalter { min-height: 2.25rem; font-size: 0.875rem; }
  .einstellung-netto { min-height: 2.25rem; font-size: 0.875rem; }
}

/* ── Lizenz (B-36a) ───────────────────────────────────────────────────────── */
/* Statusleiste: eine Zeile, Zustand als Wort und Symbol, Farbe nur zusätzlich. Text immer Graphit. */
.lizenz-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); padding: var(--space-2) var(--space-4); border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm); background: var(--color-soft); color: var(--color-text); font-weight: 500; }
.arbeitsflaeche > main > .lizenz-leiste { margin-bottom: var(--space-4); }
.lizenz-leiste .icon { flex: none; width: 1.25rem; height: 1.25rem; }
.lizenz-leiste.lizenz-warnung { background: #fdf0c4; border: 2px solid #8a5a00; }
.lizenz-leiste.lizenz-gesperrt { background: #fbe9e7; border: 2px solid var(--color-danger); }
.lizenz-text { flex: 1 1 14rem; min-width: 0; }
.lizenz-link { display: inline-flex; align-items: center; min-height: var(--touch-min); color: var(--color-text); font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }

.lizenz-meldung.meldung { color: var(--color-text); border-color: #8a5a00; border-width: 2px; }
.lizenz-meldung-text { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); min-width: 0; }

/* Lizenzseite */
.lizenz-raster, .paket-liste, .lizenz-aktionen-raster { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.paket-liste { list-style: none; margin: 0; padding: 0; align-items: stretch; }
.lizenz-pakete { display: flex; flex-direction: column; gap: var(--space-3); }
.lizenz-pakete h2 { margin: 0; }
.lizenz-frist { margin: var(--space-2) 0 0; font-size: var(--text-lg); }
.platz { display: flex; flex-direction: column; gap: var(--space-1); margin-top: var(--space-3); }
.platz-zeile { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
.platz-name { font-weight: 600; }
.platz-zahl { margin-left: auto; font-variant-numeric: tabular-nums; }
.platz-wort { display: inline-flex; align-items: center; gap: var(--space-1); flex-basis: 100%; justify-content: flex-end; font-weight: 600; color: var(--color-danger); }
.platz-wort .icon { width: 1rem; height: 1rem; }
.platz progress { width: 100%; height: 0.75rem; appearance: none; border: 1px solid var(--color-border-strong); border-radius: var(--radius-full); overflow: hidden; background: var(--color-surface); }
.platz progress::-webkit-progress-bar { background: var(--color-surface); }
.platz progress::-webkit-progress-value { background: var(--color-primary); }
.platz progress::-moz-progress-bar { background: var(--color-primary); }
.platz.voll progress::-webkit-progress-value { background: var(--color-danger); }
.platz.voll progress::-moz-progress-bar { background: var(--color-danger); }
.lizenz-modulliste { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.lizenz-modulliste li { display: flex; align-items: center; gap: var(--space-2); }
.lizenz-modulliste .icon { flex: none; width: 1.125rem; height: 1.125rem; }
.lizenz-modulliste .meta { margin-left: auto; }
.lizenz-modulliste li.fehlt .lizenz-modulname { color: var(--color-text-muted); text-decoration: line-through; }
.paket { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; }
.paket.empfohlen { border: 2px solid var(--color-primary); }
.paket-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.paket-kopf h3 { margin: 0; font-size: var(--text-xl); }
.paket-empfohlen.rolle-tag { background: var(--color-primary); color: var(--color-primary-contrast); }
.paket-preis { margin: 0; color: var(--color-text-muted); }
.paket-preis strong { font-size: var(--text-3xl); color: var(--color-text); font-variant-numeric: tabular-nums; }
.paket-punkte { list-style: none; margin: 0; padding: 0; font-weight: 600; }
.paket .lizenz-modulliste { margin: 0; }
.paket-fuss { display: flex; flex-direction: column; gap: var(--space-1); margin-top: auto; }
.paket-fuss > .knopf { text-decoration: none; justify-content: center; }
.paket-aktuell { display: flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--touch-min); margin-bottom: 0; font-weight: 600; }
.lizenz-mehr { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; }
.lizenz-modul .aktionen .knopf { text-decoration: none; }

/* Plattform */
.pl-lizenzfilter { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); margin: 0; }
.lizenz-fakten { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--space-3) var(--space-4); margin: var(--space-3) 0 0; }
.lizenz-fakten dt { color: var(--color-text-muted); font-size: var(--text-sm); }
.lizenz-fakten dd { margin: 0; font-weight: 600; }
.lizenz-sensibel h3 { margin: 0 0 var(--space-2); font-size: var(--text-lg); }
.lizenz-aktionen-raster > * { margin: 0; min-width: 0; }

@media (min-width: 64rem) {
  .lizenz-raster, .paket-liste, .lizenz-aktionen-raster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 64rem) and (pointer: fine) {
  .lizenz-leiste { padding: var(--space-1) var(--space-4); }
  .lizenz-link { min-height: 2.25rem; }
}
.schalter[disabled] { opacity: 0.55; cursor: not-allowed; border-style: dashed; }
/* Schon im Paket enthalten: angekreuzt, aber sichtbar nicht wählbar */
.pl-lizenz .wahl:has(input:disabled) { border: 1px dashed var(--color-border-strong); padding: var(--space-2) var(--space-3); background: transparent; }
.pl-lizenz .wahl:has(input:disabled) .wahl-name { color: var(--color-text-muted); font-weight: 500; }

/* Plattformliste (T-050): am Handy je Betrieb eine Karte mit beschrifteten Werten, am Büro-Desktop eine Tabelle */
.pl-werkzeuge { display: flex; flex-direction: column; gap: var(--space-3); margin: var(--space-3) 0; }
.pl-werkzeuge .pl-suche { max-width: none; margin: 0; }
.pl-tabelle, .pl-tabelle tbody, .pl-tabelle tr, .pl-tabelle th, .pl-tabelle td { display: block; }
.pl-tabelle { width: 100%; border-collapse: collapse; text-align: left; }
.pl-tabelle thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.pl-betrieb { border-top: 1px solid var(--color-border); padding: var(--space-4) 0; }
.pl-name { display: flex; flex-direction: column; align-items: flex-start; gap: 0.125rem; min-width: 0; margin-bottom: var(--space-2); text-align: left; font-weight: 400; overflow-wrap: anywhere; }
.pl-tabelle th.pl-name { display: flex; }
.pl-name .adresse { font-weight: 700; }
.pl-betrieb.inaktiv .adresse { color: var(--color-text-muted); }
.pl-name .tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pl-tabelle td[data-titel] { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); padding: 0.125rem 0; font-variant-numeric: tabular-nums; }
.pl-tabelle td[data-titel]::before { content: attr(data-titel); color: var(--color-text-muted); }
.pl-tabelle td.pl-zahlung.ohne { display: none; }
.pl-aktionen { margin-top: var(--space-3); }
.pl-panelzeile > td { padding: 0; }

@media (min-width: 64rem) and (pointer: fine) {
  main:has(.pl-liste) { max-width: 90rem; padding-inline: var(--space-4); }
  .pl-werkzeuge { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
  .pl-werkzeuge .pl-suche { flex: 0 1 18rem; }
  .pl-lizenzfilter { grid-template-columns: repeat(2, minmax(0, 15rem)); }
  .pl-werkzeuge .filter-felder { display: block; }
  .pl-tabelle { display: table; font-size: var(--text-sm); }
  .pl-tabelle thead { display: table-header-group; position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .pl-tabelle tbody { display: table-row-group; }
  .pl-tabelle tr { display: table-row; }
  .pl-tabelle th, .pl-tabelle td, .pl-tabelle th.pl-name, .pl-tabelle td[data-titel], .pl-tabelle td.pl-zahlung.ohne { display: table-cell; vertical-align: middle; padding: var(--space-2) var(--space-2); }
  .pl-tabelle thead th { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); border-bottom: 1px solid var(--color-border-strong); white-space: nowrap; }
  .pl-tabelle td[data-titel]::before { content: none; }
  .pl-betrieb { padding: 0; }
  .pl-betrieb > tr:first-of-type > * { border-top: 1px solid var(--color-border); }
  .pl-tabelle th.pl-name { width: 22%; margin: 0; }
  .pl-name > * { display: block; width: fit-content; }
  .pl-name .tags { display: flex; margin-top: 0.125rem; }
  .pl-tabelle td[data-titel="Läuft bis"], .pl-tabelle td[data-titel="Mitarbeiter"], .pl-tabelle td[data-titel="Benutzer"] { white-space: nowrap; }
  .pl-aktionen { margin: 0; text-align: right; }
  .pl-aktionen .aktionen { flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); }
  .pl-aktionen .knopf { width: auto; min-width: 0; padding-inline: var(--space-3); white-space: nowrap; }
  .pl-tabelle td[data-titel="Paket"] { white-space: nowrap; }
  .pl-tabelle .pl-zahlung .rolle-tag { white-space: nowrap; }
  .pl-panelzeile > td { padding: 0 var(--space-2) var(--space-3); }
}

/* ---------- Online-Zahlung (B-36b) ---------- */
.lizenz-hinweis .lizenz-meldung-text { flex: 1; justify-content: space-between; }
.lizenz-hinweis.meldung.warnung { color: var(--color-text); background: #fdf0c4; border: 2px solid #8a5a00; }
.lizenz-hinweis.meldung.lizenz-problem { background: #fbe9e7; border-color: var(--color-danger); }
.lizenz-hinweis > .icon { flex: none; }
@media (min-width: 40rem) {
  .lizenz-hinweis.meldung { align-items: center; }
  .lizenz-hinweis > .icon { margin-top: 0; }
  .lizenz-hinweis .knopf.hauptaktion.kompakt, .lizenz-hinweis .knopf { flex: 0 0 auto; width: auto; }
}
.lizenz-zahlweise, .lizenz-rechnungen { margin: 0; }
.lizenz-rechnungen { color: var(--color-text-muted); font-size: var(--text-sm); }
.lizenz-abo .knopf { width: 100%; }
.lizenz-abo .meldung { margin: 0; }
.lizenz-pakete-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.lizenz-zahlwahl { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.lizenz-zahlwahl .segment button { min-width: 6rem; min-height: var(--touch-min); }
.lizenz-pakete > .meldung { margin: 0; }
.paket-steuer { display: block; font-size: var(--text-sm); color: var(--color-text-muted); }
.paket-fuss > .knopf { min-height: var(--touch-min); }
.lizenz-kauf { margin: 0; padding: var(--space-3); gap: var(--space-3); }
.lizenz-kauf p { margin: 0; }
.lizenz-kauf .aktionen { flex-direction: column; align-items: stretch; }
.lizenz-kauf.panel .aktionen .knopf, .lizenz-kauf.panel .aktionen .knopf.hauptaktion { flex: 0 0 auto; width: 100%; padding: 0 var(--space-3); }
@media (max-width: 40rem) {
  .lizenz-hinweis .lizenz-meldung-text > .knopf { flex: 1 1 100%; width: 100%; }
  .lizenz-zahlwahl, .lizenz-zahlwahl .segment { width: 100%; }
}
.pl-preis { display: inline-flex; flex-direction: column; align-items: flex-end; min-width: 0; overflow-wrap: anywhere; }
.pl-preise > .meldung { margin: 0; }
.pl-problem { display: flex; flex-direction: column; gap: var(--space-3); }
.pl-problem > .meldung { margin: 0; }
.pl-problem-text { display: flex; flex-direction: column; min-width: 0; }
@media (min-width: 48rem) {
  .pl-preis { align-items: flex-start; }
  .pl-preisformular, .pl-problem { max-width: 40rem; }
}

/* ---------- Nur-Lesen (B-36c) ---------- */
/* Mein Tag: Die Meldung bleibt beim Scrollen oben stehen */
.m-main > .lizenz-leiste.lizenz-gesperrt { position: sticky; top: 0; z-index: 20; font-weight: 600; box-shadow: 0 0 0 4px var(--color-bg); }
.m-app .lizenz-buchen-gesperrt .knopf { width: 100%; max-width: 46rem; min-height: var(--touch); gap: var(--space-2); font-weight: 600; color: var(--color-text-muted); background: var(--color-soft); border: 2px dashed var(--color-border-strong); opacity: 1; cursor: not-allowed; }
.m-nicht-gespeichert { scroll-margin-top: 7rem; background: #fbe9e7; border: 2px solid var(--color-danger); font-weight: 500; }
.m-stopp-gesperrt { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3); border: 2px dashed #bdbab2; border-radius: var(--radius-sm); }
.m-stopp-gesperrt .icon { flex: none; width: 1.5rem; height: 1.5rem; margin-top: 0.125rem; }
.m-stopp-gesperrt p { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; max-width: none; }
#stopp-merken { display: block; }
.m-gesperrt .icon { flex: none; }

/* Büro: Ablehnung unten im Bild, damit sie neben „Speichern“ zu sehen ist */
.meldung.fehler.nur-lesen-fest { position: fixed; z-index: 40; left: var(--space-4); right: var(--space-4); bottom: var(--space-4); max-width: 44rem; margin: 0 auto; background: #fbe9e7; border: 2px solid var(--color-danger); box-shadow: 0 0.5rem 1.5rem rgb(31 30 28 / 0.18); font-weight: 500; }
main:has(.nur-lesen-fest) { padding-bottom: 8rem; }

.laufende-sperre { display: flex; align-items: center; gap: var(--space-2); }
.laufende-sperre .rolle-tag { background: #fbe9e7; border: 1px solid var(--color-danger); color: var(--color-text); }
.laufende-liste { list-style: none; margin: 0; padding: 0; }
.laufende-liste li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--space-4); padding: var(--space-3) 0; border-top: 1px solid var(--color-border); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.laufende-seit { color: var(--color-text-muted); }
@media (min-width: 48rem) {
  .laufende-liste li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); align-items: baseline; }
}
@media (min-width: 64rem) and (pointer: fine) {
  .laufende-liste li { padding: var(--space-2) 0; font-size: var(--text-sm); }
}

.ex-nur-lesen { align-items: center; }
.ex-nur-lesen > span:not(.icon):not(.hilfe-icon) { min-width: 0; }

/* Testanfragen in /p (B-36e): Karte je Anfrage am Handy, Tabelle am Büro-Desktop wie die Plattformliste */
.pl-anfragen > .meldung, .pl-anfragen > .panel { margin-top: var(--space-3); }
.pl-anfragen > .leer-zustand { margin-top: var(--space-3); }
.pa-zahlen { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.pa-werkzeuge { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin: var(--space-3) 0; }
.pa-werkzeuge .knopf { width: auto; gap: var(--space-2); }
.pa-wahl { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: var(--space-3); min-width: var(--touch-min); min-height: var(--touch-min); cursor: pointer; }
.pa-wahl input { flex: none; width: 1.5rem; height: 1.5rem; margin: 0; }
.pa-alle { font-weight: 600; }
.pa-tabelle .pl-betrieb.gewaehlt { margin-inline: calc(-1 * var(--space-3)); padding-inline: var(--space-3); background: var(--color-soft); }
.pa-firma-zeile { display: flex; align-items: flex-start; gap: var(--space-2); width: 100%; }
.pa-firma-zeile .pa-wahl { margin: -0.75rem 0 0 -0.75rem; }
.pa-firma-text { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); min-width: 0; overflow-wrap: anywhere; }
.pa-firma-text .tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pa-tabelle .pa-zeit { color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.pa-kontakt > span { display: block; overflow-wrap: anywhere; }
.pa-text { display: block; max-width: 65ch; white-space: pre-line; overflow-wrap: anywhere; }
.pa-tabelle td.pa-nachricht { margin-top: var(--space-2); }
.pa-tabelle td.pa-nachricht.ohne { display: none; }
.pa-freigabe .feld { max-width: 28rem; }
.pa-folge { display: flex; align-items: center; gap: var(--space-2); overflow-wrap: anywhere; }
.pa-folge p { margin: 0; min-width: 0; }

@media (min-width: 64rem) and (pointer: fine) {
  .pa-titel { display: none; }
  .pa-werkzeuge { justify-content: flex-start; padding-left: var(--space-2); }
  .pa-wahl { min-width: 2.25rem; min-height: 2.25rem; }
  .pa-wahl input { width: 1.125rem; height: 1.125rem; }
  .pa-firma-zeile .pa-wahl { margin: -0.5rem 0 0 -0.5rem; }
  .pa-tabelle th, .pa-tabelle td, .pa-tabelle th.pl-name, .pa-tabelle td.pa-nachricht.ohne { display: table-cell; vertical-align: top; padding: var(--space-3) var(--space-2); }
  .pa-tabelle tr.pl-panelzeile > td { display: table-cell; padding: 0 var(--space-2) var(--space-3); }
  .pa-tabelle td.pa-nachricht { margin: 0; width: 34%; }
  .pa-tabelle td.pa-zeit { white-space: nowrap; }
  .pa-tabelle td.pl-aktionen { white-space: nowrap; }
  .pa-tabelle .pl-aktionen .aktionen { flex-wrap: nowrap; }
  .pa-tabelle .pl-betrieb.gewaehlt { margin: 0; padding: 0; background: none; }
  .pa-tabelle .pl-betrieb.gewaehlt > tr:first-of-type > * { background: var(--color-soft); }
  main:has(.pa-tabelle) .pa-tabelle .pa-firma { min-width: 14rem; }
}
