/* ==========================================================================
   ORBIS Anmeldesystem – Design-System
   Handgeschrieben im Stil von shadcn/ui (Zinc), ohne Build, ohne externe Ressourcen.
   Aufbau: 1 Marke · 2 Tokens · 3 Reset/Basis · 4 Layout · 5 Komponenten · 6 Utilities · 7 Druck
   Dokumentation der Klassen: internal/web/UI.md
   Gestaltungsregel: KEINE einseitige farbige Border als Indikator an abgerundeten Boxen.
   ========================================================================== */

/* ---------- 1 Marke ------------------------------------------------------
   Die EINE Stelle für Logo-/Markenfarbe. Werte als HSL ohne hsl(), wie die Tokens.
   Hell = Primärfarbe im hellen Modus, Dunkel = im dunklen Modus.            */
:root {
  --marke: 240 5.9% 10%;
  --marke-foreground: 0 0% 98%;
  --marke-dunkel: 0 0% 98%;
  --marke-dunkel-foreground: 240 5.9% 10%;
  /* Hausfarbe der ORBIS-Anwendergruppe (orbis-anwendergruppe.de: #E03A00). Primärfarbe nur auf den
     öffentlichen Seiten (oeffentlich.css); die Verwaltung bleibt neutral.
     --orbis-text: etwas dunkler für kleine Schrift auf hellem Grund (Kontrast über 4,5:1). */
  --orbis: 15.5 100% 43.9%;
  --orbis-text: 15.5 100% 38%;
}

/* ---------- 2 Tokens ------------------------------------------------------ */
:root {
  color-scheme: light;
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  --primary: var(--marke);
  --primary-foreground: var(--marke-foreground);
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 42%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --destructive: 0 72.2% 50.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 86%;
  --ring: 240 5.9% 10%;
  --radius: 0.5rem;

  /* Fläche der Seitenleiste und der Seite hinter Karten */
  --sidebar: 240 5% 96.5%;
  --flaeche: 240 5% 96.5%;
  /* Ruhige Flächen (UI.md „Ruhe“): Karten heben sich durch Fläche und Schatten ab, nicht durch Rahmen;
     Linien innerhalb von Karten sind weich, Balken zurückhaltend. */
  --karten-rand: transparent;
  --karten-schatten: 0 1px 2px 0 rgb(0 0 0 / 0.05), 0 0 0 1px rgb(0 0 0 / 0.035);
  --linie: 240 6% 93.5%;
  --balken: 240 5% 38%;

  /* Status (dezenter Hintergrund + kräftigere Schrift, AA) */
  --st-eingegangen-bg: 240 4.8% 95.9%;  --st-eingegangen-fg: 240 5.2% 33.9%;  --st-eingegangen-punkt: 240 4% 60%;
  --st-angemeldet-bg: 214 100% 96.9%;   --st-angemeldet-fg: 224 76.3% 40%;    --st-angemeldet-punkt: 217 91% 60%;
  --st-vorgemerkt-bg: 48 100% 96.1%;    --st-vorgemerkt-fg: 22.7 82.5% 31.4%; --st-vorgemerkt-punkt: 38 92% 50%;
  --st-bestaetigt-bg: 138.5 76.5% 96.7%;--st-bestaetigt-fg: 142.8 64.2% 24.1%; --st-bestaetigt-punkt: 142 71% 45%;
  --st-storniert-bg: 0 85.7% 97.3%;     --st-storniert-fg: 0 73.7% 41.8%;     --st-storniert-punkt: 0 84% 60%;
  --st-abgesagt-bg: 240 4.8% 95.9%;     --st-abgesagt-fg: 345 82.7% 38%;      --st-abgesagt-punkt: 347 77% 50%;
  --st-abgelehnt-bg: 240 5.3% 26.1%;    --st-abgelehnt-fg: 0 0% 98%;          --st-abgelehnt-punkt: 240 5% 65%;

  /* Rückmeldungen (Alert, Toast, Badge) */
  --info-bg: 214 100% 97%;    --info-fg: 224 76.3% 40%;    --info-border: 213 97% 87%;
  --erfolg-bg: 138 76% 97%;   --erfolg-fg: 142.8 64.2% 24.1%; --erfolg-border: 141 79% 85%;
  --warnung-bg: 48 100% 96%;  --warnung-fg: 22.7 82.5% 31.4%; --warnung-border: 48 96.6% 76.7%;
  --fehler-bg: 0 86% 97%;     --fehler-fg: 0 73.7% 41.8%;  --fehler-border: 0 93.5% 87.8%;
  --hervorhebung: var(--orbis); /* hervorgehobener Text in Veranstaltungstexten: ORBIS-Orange (früher <font color>) */

  --schatten-xs: 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --schatten-sm: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
  --schatten-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --schatten-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.06);
  --schatten-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.08);

  --haken: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fafafa' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --strich: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fafafa' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
  --select-pfeil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");

  --schrift: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --schrift-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --hoehe: 2.75rem;      /* Bedienelemente: 44 px auf Touch-Geräten */
  --hoehe-sm: 2.75rem;
  --hoehe-lg: 3rem;
  --kopf-hoehe: 3.5rem;
  --leiste-breite: 15.5rem;
  --dauer: 150ms;
}

@media (hover: hover) and (pointer: fine) {
  :root { --hoehe: 2.25rem; --hoehe-sm: 2rem; --hoehe-lg: 2.75rem; }
}

/* Dunkelmodus: System-Einstellung, übersteuerbar mit <html data-theme="light|dark"> */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 6% 7.5%;
    --card-foreground: 0 0% 98%;
    --popover: 240 6% 9%;
    --popover-foreground: 0 0% 98%;
    --primary: var(--marke-dunkel);
    --primary-foreground: var(--marke-dunkel-foreground);
    --secondary: 240 3.7% 15.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 66%;
    --accent: 240 3.7% 15.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 72% 51%;
    --destructive-foreground: 0 0% 98%;
    --border: 240 3.7% 15.9%;
    --input: 240 3.7% 20%;
    --ring: 240 4.9% 83.9%;
    --sidebar: 240 10% 3.9%;
    --flaeche: 240 10% 3.9%;
    --karten-rand: hsl(240 4% 14%);
    --karten-schatten: none;
    --linie: 240 4% 13.5%;
    --balken: 240 5% 72%;
    --st-eingegangen-bg: 240 4% 16%;   --st-eingegangen-fg: 240 5% 78%;  --st-eingegangen-punkt: 240 4% 55%;
    --st-angemeldet-bg: 221 50% 17%;   --st-angemeldet-fg: 213 94% 80%;  --st-angemeldet-punkt: 213 94% 68%;
    --st-vorgemerkt-bg: 32 55% 14%;    --st-vorgemerkt-fg: 46 97% 70%;   --st-vorgemerkt-punkt: 43 96% 56%;
    --st-bestaetigt-bg: 145 45% 13%;   --st-bestaetigt-fg: 142 69% 68%;  --st-bestaetigt-punkt: 142 69% 58%;
    --st-storniert-bg: 0 50% 16%;      --st-storniert-fg: 0 94% 82%;     --st-storniert-punkt: 0 91% 71%;
    --st-abgesagt-bg: 240 4% 16%;      --st-abgesagt-fg: 351 95% 80%;    --st-abgesagt-punkt: 351 95% 71%;
    --st-abgelehnt-bg: 240 4% 30%;     --st-abgelehnt-fg: 0 0% 98%;      --st-abgelehnt-punkt: 240 5% 70%;
    --info-bg: 221 50% 13%;    --info-fg: 213 94% 80%;    --info-border: 221 45% 24%;
    --erfolg-bg: 145 45% 10%;  --erfolg-fg: 142 69% 68%;  --erfolg-border: 145 40% 20%;
    --warnung-bg: 32 55% 10%;  --warnung-fg: 46 97% 70%;  --warnung-border: 32 50% 22%;
    --fehler-bg: 0 50% 12%;    --fehler-fg: 0 94% 82%;    --fehler-border: 0 45% 24%;
    --hervorhebung: 17 100% 63%; /* hervorgehobener Text: helleres Orange für dunklen Grund */
    --schatten-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --schatten-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4);
    --schatten-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --schatten-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
    --schatten-xl: 0 20px 25px -5px rgb(0 0 0 / 0.55);
    --haken: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318181b' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    --strich: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318181b' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 6% 7.5%;
  --card-foreground: 0 0% 98%;
  --popover: 240 6% 9%;
  --popover-foreground: 0 0% 98%;
  --primary: var(--marke-dunkel);
  --primary-foreground: var(--marke-dunkel-foreground);
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 66%;
  --accent: 240 3.7% 15.9%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 20%;
  --ring: 240 4.9% 83.9%;
  --sidebar: 240 10% 3.9%;
  --flaeche: 240 10% 3.9%;
  --karten-rand: hsl(240 4% 14%);
  --karten-schatten: none;
  --linie: 240 4% 13.5%;
  --balken: 240 5% 72%;
  --st-eingegangen-bg: 240 4% 16%;   --st-eingegangen-fg: 240 5% 78%;  --st-eingegangen-punkt: 240 4% 55%;
  --st-angemeldet-bg: 221 50% 17%;   --st-angemeldet-fg: 213 94% 80%;  --st-angemeldet-punkt: 213 94% 68%;
  --st-vorgemerkt-bg: 32 55% 14%;    --st-vorgemerkt-fg: 46 97% 70%;   --st-vorgemerkt-punkt: 43 96% 56%;
  --st-bestaetigt-bg: 145 45% 13%;   --st-bestaetigt-fg: 142 69% 68%;  --st-bestaetigt-punkt: 142 69% 58%;
  --st-storniert-bg: 0 50% 16%;      --st-storniert-fg: 0 94% 82%;     --st-storniert-punkt: 0 91% 71%;
  --st-abgesagt-bg: 240 4% 16%;      --st-abgesagt-fg: 351 95% 80%;    --st-abgesagt-punkt: 351 95% 71%;
  --st-abgelehnt-bg: 240 4% 30%;     --st-abgelehnt-fg: 0 0% 98%;      --st-abgelehnt-punkt: 240 5% 70%;
  --info-bg: 221 50% 13%;    --info-fg: 213 94% 80%;    --info-border: 221 45% 24%;
  --erfolg-bg: 145 45% 10%;  --erfolg-fg: 142 69% 68%;  --erfolg-border: 145 40% 20%;
  --warnung-bg: 32 55% 10%;  --warnung-fg: 46 97% 70%;  --warnung-border: 32 50% 22%;
  --fehler-bg: 0 50% 12%;    --fehler-fg: 0 94% 82%;    --fehler-border: 0 45% 24%;
  --hervorhebung: 17 100% 63%; /* hervorgehobener Text: helleres Orange für dunklen Grund */
  --schatten-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --schatten-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4);
  --schatten-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --schatten-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
  --schatten-xl: 0 20px 25px -5px rgb(0 0 0 / 0.55);
  --haken: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318181b' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --strich: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318181b' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
}

/* ---------- 3 Reset / Basis ---------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; border: 0 solid hsl(var(--border)); }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-padding-top: calc(var(--kopf-hoehe) + 1rem); }
body {
  min-height: 100dvh;
  font-family: var(--schrift);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
svg.icon { display: inline-block; flex-shrink: 0; width: 1rem; height: 1rem; vertical-align: -0.125em; }
.icon-sm { width: 0.875rem !important; height: 0.875rem !important; }
.icon-lg { width: 1.25rem !important; height: 1.25rem !important; }
.icon-xl { width: 1.5rem !important; height: 1.5rem !important; }
input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button, [role="button"], summary, label[for], select { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; border-spacing: 0; }
ul[role="list"], ol[role="list"], .liste-ohne { list-style: none; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: 1.5rem; letter-spacing: -0.025em; }
h2 { font-size: 1.125rem; }
h3 { font-size: 1rem; }
p { text-wrap: pretty; }
hr { border-top-width: 1px; border-color: hsl(var(--linie)); margin: 1.5rem 0; }
::selection { background: hsl(var(--primary) / 0.15); }
:focus { outline: none; }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; border-radius: calc(var(--radius) - 2px); }
[hidden] { display: none !important; }
code, kbd, .mono { font-family: var(--schrift-mono); font-size: 0.85em; }
code { background: hsl(var(--muted)); padding: 0.1em 0.35em; border-radius: 0.25rem; }
kbd { display: inline-block; padding: 0 0.35em; border: 1px solid hsl(var(--border)); border-bottom-width: 2px; border-radius: 0.25rem; background: hsl(var(--muted)); font-size: 0.75rem; line-height: 1.4; }

/* Fließtext aus Benutzereingaben (zeilenumbruch) */
.prosa > * + * { margin-top: 0.75em; }
.prosa a, a.link, .link { color: hsl(var(--foreground)); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: hsl(var(--muted-foreground) / 0.5); }
.prosa a:hover, a.link:hover, .link:hover { text-decoration-color: currentColor; }
/* Formatierter Text aus dem Editor bzw. sicherHTML (Leseansicht in der Verwaltung, Editor-Fläche):
   Absätze, Listen, Hervorhebung sehen überall gleich aus (öffentlich: .prosa in oeffentlich.css). */
.fliesstext { overflow-wrap: anywhere; }
.fliesstext :is(p, ul, ol) + :is(p, ul, ol) { margin-top: 0.75em; }
.fliesstext ul, .fliesstext ol { padding-left: 1.25rem; }
.fliesstext ul { list-style: disc; }
.fliesstext ol { list-style: decimal; }
.fliesstext li + li { margin-top: 0.25em; }
.fliesstext li > :is(ul, ol) { margin-top: 0.25em; }
.fliesstext b, .fliesstext strong { font-weight: 600; }
.fliesstext a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: hsl(var(--muted-foreground) / 0.5); }
.fliesstext a:hover { text-decoration-color: currentColor; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- 4 Layout ------------------------------------------------------ */

/* 4.1 Verwaltung: Seitenleiste + Kopfzeile + Inhalt */
.admin { background: hsl(var(--flaeche)); }
.admin-rahmen { min-height: 100dvh; }
.seitenleiste {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: min(var(--leiste-breite), 85vw);
  display: flex; flex-direction: column;
  background: hsl(var(--sidebar));
  transform: translateX(-100%);
  transition: transform 200ms ease, visibility 200ms;
  visibility: hidden;
}
.seitenleiste:target, .seitenleiste[data-offen] { transform: none; visibility: visible; box-shadow: var(--schatten-xl); }
.seitenleiste-schleier {
  position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / 0.45);
  opacity: 0; pointer-events: none; transition: opacity 200ms;
}
.seitenleiste:target + .seitenleiste-schleier, .seitenleiste[data-offen] + .seitenleiste-schleier { opacity: 1; pointer-events: auto; }
.seitenleiste-kopf { display: flex; align-items: center; gap: 0.625rem; height: var(--kopf-hoehe); padding: 0 1rem; flex-shrink: 0; }
.seitenleiste-schliessen { margin-left: auto; }
.seitenleiste-nav { flex: 1; overflow-y: auto; padding: 0.5rem 0.75rem 1rem; }
.seitenleiste-fuss { padding: 0.75rem; }
.nav-gruppe + .nav-gruppe { margin-top: 1.25rem; }
.nav-titel { padding: 0 0.625rem 0.375rem; font-size: 0.75rem; font-weight: 500; color: hsl(var(--muted-foreground)); }
.nav-link {
  display: flex; align-items: center; gap: 0.625rem;
  min-height: var(--hoehe); padding: 0 0.625rem; border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem; font-weight: 500; color: hsl(var(--muted-foreground));
  transition: background-color var(--dauer), color var(--dauer);
}
.nav-link .icon { opacity: 0.85; }
.nav-link:hover { background: hsl(var(--foreground) / 0.05); color: hsl(var(--accent-foreground)); }
.nav-link[aria-current="page"] { background: hsl(var(--card)); color: hsl(var(--foreground)); font-weight: 600; box-shadow: var(--karten-schatten); }
.nav-link[aria-current="page"] .icon { opacity: 1; }
.nav-zahl { margin-left: auto; font-size: 0.75rem; font-variant-numeric: tabular-nums; color: hsl(var(--muted-foreground)); }

.marke { display: flex; align-items: center; gap: 0.625rem; min-width: 0; font-weight: 600; font-size: 0.875rem; line-height: 1.2; }
.marke-zeichen {
  display: grid; place-items: center; flex-shrink: 0;
  width: 2rem; height: 2rem; border-radius: calc(var(--radius) - 1px);
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.02em;
}
/* Logo der ORBIS-Anwendergruppe (static/orbis-logo.png, 655 × 207 px, transparenter Grund; Orange
   und helles Grau tragen auf hellem wie auf dunklem Grund). */
.marke-logo { display: block; flex-shrink: 0; height: 2rem; width: auto; }
.oe-kopf .marke-logo { height: 2.5rem; }
.einfach-marke .marke-logo { height: 2.75rem; }
.marke-text { display: flex; flex-direction: column; min-width: 0; white-space: nowrap; }
.marke-text small { font-size: 0.75rem; font-weight: 400; color: hsl(var(--muted-foreground)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.admin-haupt { display: flex; flex-direction: column; min-height: 100dvh; min-width: 0; }
.kopfzeile {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 0.5rem;
  height: var(--kopf-hoehe); padding: 0 0.75rem;
  /* Deckend in der Farbe der Seite: Ein durchscheinender, weichgezeichneter Kopf zeigt beim Scrollen
     einen grauen Schleier, der an der Seitennavigation hart abgeschnitten wäre. */
  background: hsl(var(--flaeche));
}
/* Hinweis „Testbetrieb / Versand abgeschaltet“ unter der Kopfzeile (umlaufende Border, keine Seitenleiste). */
.mailbetrieb {
  display: flex; align-items: flex-start; gap: 0.625rem; margin: 0.75rem 0.75rem 0; padding: 0.625rem 0.875rem;
  border: 1px solid hsl(var(--warnung-border)); border-radius: var(--radius);
  background: hsl(var(--warnung-bg)); color: hsl(var(--warnung-fg)); font-size: 0.875rem; line-height: 1.45;
}
.mailbetrieb > .icon { flex-shrink: 0; margin-top: 0.1rem; }
.mailbetrieb p { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 640px) { .mailbetrieb { margin: 1rem calc(var(--inhalt-rand, 0px) + 1.5rem) 0; } }
@media (min-width: 1024px) { .mailbetrieb { margin: 1.25rem calc(var(--inhalt-rand, 0px) + 2rem) 0; } }
.kopfzeile-trenner { width: 1px; height: 1.25rem; background: hsl(var(--linie)); margin: 0 0.25rem; }
.kopfzeile .krumen { min-width: 0; flex: 1; }
.kopfzeile-rechts { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }

/* Mittig: Der Inhalt steht in der Mitte der Fläche neben der Seitennavigation; Brotkrumen und
   Testbetrieb-Hinweis beginnen an derselben Kante wie der Inhalt (--inhalt-rand), das Kontomenü
   bleibt in der Ecke. --inhalt-max muss zur Breitenklasse von <main> passen. */
.admin-haupt { --inhalt-max: 80rem; --inhalt-rand: max(0px, (100% - var(--inhalt-max)) / 2); }
.admin-haupt:has(> .inhalt-schmal) { --inhalt-max: 48rem; }
.admin-haupt:has(> .inhalt-mittel) { --inhalt-max: 70rem; }
.admin-haupt:has(> .inhalt-breit) { --inhalt-max: 100%; }
.inhalt { width: 100%; max-width: 80rem; margin: 0 auto; padding: 1.25rem 1rem 6rem; flex: 1; }
.inhalt-schmal { max-width: 48rem; }
.inhalt-mittel { max-width: 70rem; }
.inhalt-breit { max-width: none; }
.kopfzeile { padding-left: calc(var(--inhalt-rand, 0px) + 0.75rem); }

@media (min-width: 640px) {
  .inhalt { padding: 1.75rem 1.5rem 6rem; }
  .kopfzeile { padding: 0 1.5rem 0 calc(var(--inhalt-rand, 0px) + 1rem); }
}
@media (min-width: 1024px) {
  .admin-rahmen { display: grid; grid-template-columns: var(--leiste-breite) minmax(0, 1fr); }
  .seitenleiste { position: sticky; top: 0; height: 100dvh; width: auto; transform: none; visibility: visible; box-shadow: none !important; }
  .seitenleiste-schleier, .seitenleiste-schliessen, .nur-mobil { display: none !important; }
  .inhalt { padding: 2rem 2rem 6rem; }
  .kopfzeile { padding: 0 2rem 0 calc(var(--inhalt-rand, 0px) + 2rem); }
}

/* 4.2 Öffentliche Seiten */
.oeffentlich { background: hsl(var(--flaeche)); display: flex; flex-direction: column; }
.oe-kopf { background: hsl(var(--background)); border-bottom-width: 1px; }
.oe-kopf-innen { max-width: 45rem; margin: 0 auto; padding: 0 1rem; height: 4rem; display: flex; align-items: center; gap: 1rem; }
.oe-kopf .marke-zeichen { width: 2.25rem; height: 2.25rem; font-size: 0.75rem; }
.oe-kopf .marke { font-size: 0.9375rem; }
.oe-inhalt { width: 100%; max-width: 45rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; flex: 1; }
.oe-inhalt-breit { max-width: 64rem; }
.oe-fuss { padding: 1.5rem 1rem 2rem; text-align: center; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.oe-fuss a { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 640px) {
  .oe-inhalt { padding: 2.5rem 1.5rem 4rem; }
  .oe-kopf-innen { padding: 0 1.5rem; }
}
/* Eingebettet bzw. Kopf ausgeblendet: keine äußeren Ränder, transparenter Hintergrund */
.oeffentlich.eingebettet { background: hsl(var(--background)); }
.oeffentlich.eingebettet .oe-inhalt { padding: 0.75rem 0.75rem 1rem; max-width: 48rem; margin: 0; }
@media (min-width: 640px) { .oeffentlich.eingebettet .oe-inhalt { padding: 0.5rem 0.25rem 1.5rem; } }

/* 4.3 Einfach: zentrierte Karte (Login, Fehler ohne Sitzung) */
.einfach { background: hsl(var(--flaeche)); display: grid; place-items: center; padding: 1.5rem 1rem; }
.einfach-spalte { width: 100%; max-width: 24rem; }
.einfach-marke { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.einfach-fuss { margin-top: 1.5rem; text-align: center; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }

/* 4.4 Seitenkopf: Titel + Beschreibung + Aktionen */
.seitenkopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; margin-bottom: 1.5rem; }
.seitenkopf-text { min-width: 0; flex: 1 1 18rem; }
.seitenkopf-titel { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; }
.seitenkopf-titel + p, .seitenkopf-beschreibung { margin-top: 0.25rem; color: hsl(var(--muted-foreground)); font-size: 0.875rem; }
.seitenkopf-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.5rem; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.seitenkopf-meta > span { display: inline-flex; align-items: center; gap: 0.375rem; }
.seitenkopf-aktionen { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (min-width: 640px) { .seitenkopf-titel { font-size: 1.75rem; } }

.abschnitt + .abschnitt { margin-top: 2.5rem; }
.abschnitt-kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.875rem; }
.abschnitt-titel { font-size: 1rem; font-weight: 600; }
.abschnitt-text { font-size: 0.875rem; color: hsl(var(--muted-foreground)); margin-top: 0.125rem; }

.raster { display: grid; gap: 1rem; }
@media (min-width: 768px) {
  .raster-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raster-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .raster-seite { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
}

/* ---------- 5 Komponenten ------------------------------------------------- */

/* 5.1 Button ------------------------------------------------------------- */
.btn {
  --btn-bg: hsl(var(--primary)); --btn-fg: hsl(var(--primary-foreground)); --btn-bg-hover: hsl(var(--primary) / 0.88);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  height: var(--hoehe); padding: 0 1rem;
  border: 1px solid transparent; border-radius: calc(var(--radius) - 2px);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: 0.875rem; font-weight: 500; line-height: 1; white-space: nowrap;
  user-select: none; text-decoration: none;
  box-shadow: var(--schatten-xs);
  transition: background-color var(--dauer), border-color var(--dauer), color var(--dauer), box-shadow var(--dauer), transform 80ms;
}
.btn:hover { background: var(--btn-bg-hover); }
.btn:active:not(:disabled) { transform: translateY(0.5px); }
.btn:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; box-shadow: none; }
.btn-primary { /* Standard */ }
.btn-secondary { --btn-bg: hsl(var(--secondary)); --btn-fg: hsl(var(--secondary-foreground)); --btn-bg-hover: hsl(var(--secondary) / 0.75); box-shadow: none; }
.btn-outline { --btn-bg: hsl(var(--card)); --btn-fg: hsl(var(--foreground)); --btn-bg-hover: hsl(var(--accent)); border-color: hsl(var(--input)); }
.btn-ghost { --btn-bg: transparent; --btn-fg: hsl(var(--foreground)); --btn-bg-hover: hsl(var(--accent)); box-shadow: none; }
.btn-destructive { --btn-bg: hsl(var(--destructive)); --btn-fg: hsl(var(--destructive-foreground)); --btn-bg-hover: hsl(var(--destructive) / 0.9); }
.btn-destructive:focus-visible { outline-color: hsl(var(--destructive)); }
.btn-link { --btn-bg: transparent; --btn-bg-hover: transparent; --btn-fg: hsl(var(--foreground)); box-shadow: none; padding-inline: 0.25rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: hsl(var(--muted-foreground) / 0.5); }
.btn-link:hover { text-decoration-color: currentColor; }
.btn-sm { height: var(--hoehe-sm); padding: 0 0.75rem; font-size: 0.8125rem; gap: 0.375rem; }
.btn-lg { height: var(--hoehe-lg); padding: 0 1.5rem; font-size: 0.9375rem; }
.btn-icon { width: var(--hoehe); padding: 0; }
.btn-icon.btn-sm { width: var(--hoehe-sm); }
.btn-voll { width: 100%; }
.btn .icon { width: 1rem; height: 1rem; }
/* Ladezustand: app.js setzt data-laedt am Submit-Button */
.btn[data-laedt] { color: transparent !important; pointer-events: none; transition: none; }
.btn[data-laedt] .icon { opacity: 0; }
.btn[data-laedt]::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid var(--btn-fg); border-right-color: transparent;
  animation: drehen 0.7s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }
.btn-gruppe { display: inline-flex; }
.btn-gruppe > .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.btn-gruppe > .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* 5.2 Formularelemente --------------------------------------------------- */
.input, .textarea, .select {
  display: block; width: 100%;
  min-height: var(--hoehe); padding: 0 0.75rem;
  background: hsl(var(--background)); color: hsl(var(--foreground));
  border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px);
  font-size: 1rem; /* 16 px: verhindert Zoom in iOS */
  box-shadow: var(--schatten-xs);
  transition: border-color var(--dauer), box-shadow var(--dauer);
}
@media (hover: hover) and (pointer: fine) { .input, .textarea, .select { font-size: 0.875rem; } }
.input::placeholder, .textarea::placeholder { color: hsl(var(--muted-foreground) / 0.8); }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible, .combobox-eingabe:focus-visible {
  outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}
.input:disabled, .textarea:disabled, .select:disabled { opacity: 0.55; cursor: not-allowed; background: hsl(var(--muted)); }
.input[readonly] { background: hsl(var(--muted) / 0.5); }
[aria-invalid="true"].input, [aria-invalid="true"].textarea, [aria-invalid="true"].select, [aria-invalid="true"] .combobox-eingabe { border-color: hsl(var(--destructive)); }
[aria-invalid="true"].input:focus-visible, [aria-invalid="true"].textarea:focus-visible, [aria-invalid="true"].select:focus-visible { box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.2); }
.textarea { min-height: 5.5rem; padding: 0.5rem 0.75rem; line-height: 1.5; resize: vertical; field-sizing: content; max-height: 30rem; }
.select {
  appearance: none; -webkit-appearance: none;
  padding-right: 2.25rem;
  background-image: var(--select-pfeil); background-repeat: no-repeat; background-position: right 0.625rem center; background-size: 1rem;
}
.input[type="date"], .input[type="time"], .input[type="datetime-local"] { padding-right: 0.5rem; }
.input[type="file"] { padding: 0.375rem 0.5rem; }
.input-mit-icon { position: relative; }
.input-mit-icon > .icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); pointer-events: none; }
.input-mit-icon > .input { padding-left: 2.25rem; }

/* Editor (editor.js): eine Fläche mit Rand wie ein Eingabefeld, Werkzeuge ohne eigene Rahmen. */
.editor {
  position: relative; min-width: 0;
  background: hsl(var(--background)); color: hsl(var(--foreground));
  border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px);
  box-shadow: var(--schatten-xs);
  transition: border-color var(--dauer), box-shadow var(--dauer);
}
.editor:has(.editor-flaeche:focus, .editor-quelltext:focus), .editor[data-editor-fokus] { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15); }
.editor:has([aria-invalid="true"]) { border-color: hsl(var(--destructive)); }
.editor:has([aria-invalid="true"]:focus) { box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.2); }
.editor-werkzeuge { display: flex; flex-wrap: wrap; align-items: center; gap: 0.125rem; padding: 0.3125rem 0.3125rem 0; }
.editor-knopf {
  display: inline-grid; place-items: center; min-width: var(--hoehe-sm); height: var(--hoehe-sm); padding: 0 0.375rem;
  border-radius: calc(var(--radius) - 3px); background: transparent; color: hsl(var(--muted-foreground));
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.02em;
  transition: background-color var(--dauer), color var(--dauer);
}
.editor-knopf:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.editor-knopf[aria-pressed="true"] { background: hsl(var(--foreground) / 0.08); color: hsl(var(--foreground)); }
.editor-knopf:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: -2px; }
.editor-knopf:disabled { opacity: 0.35; pointer-events: none; }
.editor-luecke { width: 0.5rem; flex-shrink: 0; }
@media (max-width: 479px) { .editor-werkzeuge { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .editor-luecke { width: 0.125rem; } .editor-knopf { flex-shrink: 0; } }
.editor-umschalter { margin-left: auto; font-family: var(--schrift-mono); font-size: 0.6875rem; }
.editor-link { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; margin: 0.3125rem 0.3125rem 0; padding: 0.375rem; border-radius: calc(var(--radius) - 3px); background: hsl(var(--muted) / 0.5); }
.editor-link-eingabe { flex: 1 1 9rem; min-width: 0; width: auto; min-height: var(--hoehe-sm); }
.editor-link-fehler { flex-basis: 100%; }
.editor-flaeche {
  position: relative; min-height: 8rem; max-height: min(28rem, 60dvh); overflow-y: auto; overscroll-behavior: contain;
  padding: 0.375rem 0.75rem 0.75rem; font-size: 1rem; line-height: 1.55; cursor: text; outline: none;
}
@media (hover: hover) and (pointer: fine) { .editor-flaeche { font-size: 0.9375rem; } }
.editor-flaeche:focus-visible { outline: none; }
.editor-flaeche font[color] { color: hsl(var(--hervorhebung)); font-weight: 600; }
.editor[data-leer] .editor-flaeche[data-platzhalter]::before { content: attr(data-platzhalter); position: absolute; left: 0.75rem; top: 0.375rem; color: hsl(var(--muted-foreground) / 0.8); pointer-events: none; }
.editor .editor-quelltext { border: 0; border-radius: 0 0 calc(var(--radius) - 3px) calc(var(--radius) - 3px); box-shadow: none; background: transparent; min-height: 8rem; max-height: min(28rem, 60dvh); font-family: var(--schrift-mono); font-size: 0.8125rem; }
.editor .editor-quelltext:focus-visible { box-shadow: none; }

/* Checkbox und Radio */
.checkbox, .radio {
  appearance: none; -webkit-appearance: none; flex-shrink: 0;
  width: 1rem; height: 1rem; margin: 0;
  border: 1px solid hsl(var(--primary) / 0.55); border-radius: 0.25rem;
  background: hsl(var(--background)) center / 0.75rem no-repeat;
  box-shadow: var(--schatten-xs);
  transition: background-color var(--dauer), border-color var(--dauer);
  cursor: pointer;
}
.radio { border-radius: 50%; }
.checkbox:checked { background-color: hsl(var(--primary)); border-color: hsl(var(--primary)); background-image: var(--haken); }
.checkbox:indeterminate { background-color: hsl(var(--primary)); border-color: hsl(var(--primary)); background-image: var(--strich); }
.radio:checked { border-color: hsl(var(--primary)); box-shadow: inset 0 0 0 3px hsl(var(--background)); background-color: hsl(var(--primary)); }
.checkbox:focus-visible, .radio:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.checkbox:disabled, .radio:disabled { opacity: 0.5; cursor: not-allowed; }
[aria-invalid="true"].checkbox { border-color: hsl(var(--destructive)); }

/* Option mit Beschriftung: <label class="option"><input class="checkbox"> <span>…</span></label> */
.option { display: flex; align-items: flex-start; gap: 0.75rem; min-height: 1.5rem; font-size: 0.875rem; line-height: 1.45; cursor: pointer; }
.option > .checkbox, .option > .radio { margin-top: 0.125rem; }
.option-text { display: flex; flex-direction: column; gap: 0.125rem; }
.option-hilfe { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
@media (pointer: coarse) { .option { padding: 0.625rem 0; } }
.optionen { display: grid; gap: 0.75rem; }
.optionen-reihe { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }

/* Schalter (Switch) */
.schalter {
  appearance: none; -webkit-appearance: none; flex-shrink: 0; position: relative;
  width: 2.25rem; height: 1.25rem; border-radius: 999px; margin: 0;
  background: hsl(var(--input)); cursor: pointer; transition: background-color var(--dauer);
}
.schalter::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 1rem; height: 1rem; border-radius: 50%;
  background: hsl(var(--background)); box-shadow: var(--schatten-sm); transition: transform var(--dauer);
}
.schalter:checked { background: hsl(var(--primary)); }
.schalter:checked::before { transform: translateX(1rem); }
.schalter:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }

/* Feld: Label + Pflicht + Eingabe + Hilfe + Fehler */
.formular { display: grid; gap: 1.25rem; }
.feld { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; align-content: start; min-width: 0; }
.label { font-size: 0.875rem; font-weight: 500; line-height: 1.25; }
.label .pflicht, .pflicht { color: hsl(var(--destructive)); margin-left: 0.125rem; font-weight: 500; text-decoration: none; }
.label .optional { font-weight: 400; color: hsl(var(--muted-foreground)); font-size: 0.8125rem; margin-left: 0.25rem; }
.hilfe { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); line-height: 1.45; }
.feldfehler { display: flex; align-items: flex-start; gap: 0.375rem; font-size: 0.8125rem; font-weight: 500; color: hsl(var(--destructive)); line-height: 1.4; }
.feldfehler .icon { margin-top: 0.1rem; width: 0.875rem; height: 0.875rem; }
.feld-reihe { display: grid; gap: 1.25rem; }
@media (min-width: 640px) {
  .feld-reihe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feld-reihe-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feld-reihe-plz { grid-template-columns: 8rem minmax(0, 1fr); }
  .feld-reihe-anrede { grid-template-columns: 10rem 8rem minmax(0, 1fr); }
}
.feldgruppe { display: grid; gap: 1.25rem; min-width: 0; }
.feldgruppe > legend { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; padding: 0; float: left; width: 100%; }
.feldgruppe > legend + * { clear: both; }
.feldgruppe-text { font-size: 0.875rem; color: hsl(var(--muted-foreground)); margin-top: -0.75rem; }
fieldset { min-width: 0; }
fieldset.feld > legend.label { margin-bottom: 0.5rem; padding: 0; }
.formular-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding-top: 0.5rem; }
.formular-aktionen-rechts { justify-content: flex-end; }
@media (max-width: 639px) { .formular-aktionen > .btn, .card-fuss > .btn-lg { flex: 1 1 auto; } }

/* Fehlerzusammenfassung */
/* Hervorhebung in Veranstaltungstexten: eine Farbe für jedes <font color=…> der Altdaten (A-603). */
/* Hervorhebung: Schrift in Hausfarbe und halbfett, ohne Fläche. Orange ist sonst die Linkfarbe;
   Links im Fließtext sind zusätzlich unterstrichen, Hervorhebungen nicht. */
.hervorhebung { color: hsl(var(--hervorhebung)); font-weight: 600; }
.fehlerzusammenfassung { display: flex; gap: 0.75rem; padding: 1rem; border: 1px solid hsl(var(--fehler-border)); border-radius: var(--radius); background: hsl(var(--fehler-bg)); color: hsl(var(--fehler-fg)); }
.fehlerzusammenfassung:focus { outline: 2px solid hsl(var(--fehler-fg)); outline-offset: 2px; }
.fehlerzusammenfassung .icon { margin-top: 0.125rem; }
.fehlerzusammenfassung h2 { font-size: 0.9375rem; font-weight: 600; }
.fehlerzusammenfassung ul { margin-top: 0.375rem; padding-left: 1.1rem; font-size: 0.875rem; display: grid; gap: 0.125rem; }
.fehlerzusammenfassung a { text-decoration: underline; text-underline-offset: 3px; }

/* Segment-Umschalter (Radios als verbundene Schaltflächen) */
.segment { display: inline-flex; width: 100%; padding: 0.25rem; gap: 0.25rem; border-radius: var(--radius); background: hsl(var(--muted)); }
.segment-option { position: relative; flex: 1; display: flex; }
.segment-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segment-option span {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: calc(var(--hoehe) - 0.5rem); padding: 0.375rem 0.875rem;
  border-radius: calc(var(--radius) - 3px);
  font-size: 0.875rem; font-weight: 500; text-align: center; line-height: 1.25;
  color: hsl(var(--muted-foreground)); transition: background-color var(--dauer), color var(--dauer), box-shadow var(--dauer);
}
.segment-option input:hover + span { color: hsl(var(--foreground)); }
.segment-option input:checked + span { background: hsl(var(--card)); color: hsl(var(--foreground)); box-shadow: var(--schatten-sm); }
.segment-option input:focus-visible + span { outline: 2px solid hsl(var(--ring)); outline-offset: 1px; }
@media (min-width: 640px) { .segment-auto { width: auto; } }

/* Große Wahl-Karten (Mitglied/Nichtmitglied, Ja/Nein) */
.wahl { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.wahl-janein { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; max-width: 20rem; }
.wahl-option { position: relative; display: flex; }
.wahl-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wahl-karte {
  flex: 1; display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.875rem 1rem; min-height: var(--hoehe-lg);
  border: 1px solid hsl(var(--input)); border-radius: var(--radius);
  background: hsl(var(--background)); cursor: pointer;
  transition: border-color var(--dauer), background-color var(--dauer), box-shadow var(--dauer);
}
.wahl-janein .wahl-karte { align-items: center; justify-content: center; padding: 0.625rem 1rem; font-weight: 500; font-size: 0.875rem; }
.wahl-karte:hover { background: hsl(var(--accent) / 0.6); }
.wahl-karte-icon { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: calc(var(--radius) - 2px); background: hsl(var(--muted)); color: hsl(var(--foreground)); flex-shrink: 0; }
.wahl-karte-titel { display: block; font-weight: 600; font-size: 0.9375rem; }
.wahl-karte-text { display: block; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); margin-top: 0.125rem; }
.wahl-karte-marker { margin-left: auto; width: 1rem; height: 1rem; border-radius: 50%; border: 1px solid hsl(var(--input)); flex-shrink: 0; margin-top: 0.125rem; transition: all var(--dauer); }
.wahl-option input:checked + .wahl-karte { border-color: hsl(var(--primary)); box-shadow: var(--schatten-sm); background: hsl(var(--background)); }
.wahl-option input:checked + .wahl-karte .wahl-karte-marker { border-color: hsl(var(--primary)); background: hsl(var(--primary)); box-shadow: inset 0 0 0 3px hsl(var(--background)); }
.wahl-option input:checked + .wahl-karte .wahl-karte-icon { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.wahl-option input:focus-visible + .wahl-karte { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.wahl-janein .wahl-option input:checked + .wahl-karte { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
[aria-invalid="true"] .wahl-karte { border-color: hsl(var(--destructive)); }
.frage { display: grid; gap: 0.625rem; padding: 1rem 0; border-top: 1px solid hsl(var(--linie)); }
.frage:first-child { border-top-width: 0; padding-top: 0; }
.frage:last-child { padding-bottom: 0; }
.frage-text { font-size: 0.9375rem; font-weight: 500; line-height: 1.45; }
@media (min-width: 640px) {
  .frage { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; }
  .frage .wahl-janein { width: 13rem; }
  .frage .feldfehler { grid-column: 1 / -1; }
}

/* Datei-Upload */
.datei-feld { position: relative; display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border: 1px dashed hsl(var(--input)); border-radius: var(--radius); background: hsl(var(--background)); transition: border-color var(--dauer), background-color var(--dauer); }
.datei-feld:hover, .datei-feld:focus-within { border-color: hsl(var(--ring) / 0.6); background: hsl(var(--accent) / 0.4); }
.datei-feld input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.datei-feld:focus-within { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.datei-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; flex-shrink: 0; border-radius: calc(var(--radius) - 2px); background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.datei-text { min-width: 0; display: flex; flex-direction: column; font-size: 0.875rem; }
.datei-text strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datei-text span { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.datei-vorhanden { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem; border-radius: var(--radius); background: hsl(var(--muted) / 0.5); font-size: 0.875rem; }
.datei-vorhanden .datei-icon { width: 2.25rem; height: 2.25rem; background: hsl(var(--fehler-bg)); color: hsl(var(--fehler-fg)); }
.datei-vorhanden .datei-text { flex: 1; }
.datei-vorhanden .datei-text a { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datei-vorhanden .datei-text a:hover { text-decoration: underline; }
.datei-entfernen { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); cursor: pointer; white-space: nowrap; }
.datei-entfernen:has(input:checked) { color: hsl(var(--destructive)); }
.datei-vorhanden:has(.datei-entfernen input:checked) .datei-text a { text-decoration: line-through; opacity: 0.6; }

/* Combobox (Krankenhaussuche) */
.combobox { position: relative; }
.combobox-eingabe-rahmen { position: relative; }
.combobox-eingabe-rahmen > .icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); pointer-events: none; }
.combobox-eingabe { padding-left: 2.25rem !important; padding-right: 2.25rem !important; }
.combobox-leeren { position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: calc(var(--radius) - 4px); color: hsl(var(--muted-foreground)); background: transparent; }
.combobox-leeren:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.combobox-liste {
  position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 0.25rem);
  max-height: min(20rem, 50vh); overflow-y: auto; overscroll-behavior: contain;
  padding: 0.25rem; list-style: none;
  background: hsl(var(--popover)); color: hsl(var(--popover-foreground));
  border: 1px solid var(--karten-rand); border-radius: var(--radius); box-shadow: var(--karten-schatten), var(--schatten-lg);
  animation: einblenden 120ms ease-out;
}
.combobox-option { display: flex; flex-direction: column; gap: 0.0625rem; padding: 0.5rem 0.625rem; border-radius: calc(var(--radius) - 3px); font-size: 0.875rem; cursor: pointer; }
.combobox-option small { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.combobox-option[aria-selected="true"], .combobox-option:hover { background: hsl(var(--accent)); }
.combobox-option mark { background: transparent; color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: hsl(var(--muted-foreground) / 0.6); text-underline-offset: 2px; }
.combobox-option[data-gewaehlt] { font-weight: 500; }
.combobox-leer, .combobox-mehr { padding: 0.75rem 0.625rem; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); text-align: center; }
.combobox[data-aktiv] > select { display: none; }

/* 5.3 Card --------------------------------------------------------------- */
.card { background: hsl(var(--card)); color: hsl(var(--card-foreground)); border: 1px solid var(--karten-rand); border-radius: calc(var(--radius) + 4px); box-shadow: var(--karten-schatten); min-width: 0; }
.card-kopf { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem 1rem; padding: 1.25rem 1.25rem 0; }
.card-kopf-text { min-width: 0; flex: 1 1 14rem; }
.card-titel { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.card-text { margin-top: 0.25rem; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.card-inhalt { padding: 1.25rem; }
.card-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 1rem 1.25rem; background: hsl(var(--muted) / 0.45); border-radius: 0 0 calc(var(--radius) + 3px) calc(var(--radius) + 3px); }
.card-fuss-rechts { justify-content: flex-end; }
.card-kopf + .card-fuss { margin-top: 1.25rem; }
.card > .tabelle-rahmen { border: 0; border-radius: 0; box-shadow: none; }
.card > .tabelle-rahmen:last-child { border-radius: 0 0 calc(var(--radius) + 3px) calc(var(--radius) + 3px); }
.card-kopf + .tabelle-rahmen { margin-top: 1rem; border-top: 1px solid hsl(var(--linie)); }
@media (min-width: 640px) {
  .card-kopf { padding: 1.5rem 1.5rem 0; }
  .card-inhalt { padding: 1.5rem; }
  .card-fuss { padding: 1rem 1.5rem; }
}
a.card { display: block; transition: border-color var(--dauer), box-shadow var(--dauer); }
a.card:hover { box-shadow: var(--karten-schatten), var(--schatten-md); }

/* Beschreibungsliste (Schlüssel/Wert) */
.dl-raster { display: grid; gap: 0.75rem 1.5rem; font-size: 0.875rem; }
.dl-raster dt { color: hsl(var(--muted-foreground)); }
.dl-raster dd { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 640px) { .dl-raster { grid-template-columns: 11rem minmax(0, 1fr); } }

/* Leseansicht: gespeicherter Stand als ruhige Karten, je Einheit ein Dialog zum Bearbeiten
   (Veranstaltung, Anmeldung). Karte `lese-box` mit Zeilen „Bezeichnung – Wert“ ohne Rahmen und
   Trennlinien; rechts oben steht immer an derselben Stelle die eine leise Aktion `lese-aktion`.
   Abschnittstitel über der Karte (`lese-abschnitt`), mit `lese-seitlich` ab 960 px links daneben,
   oder in der Karte (`lese-box-titel`, wenn daneben eine Seitenspalte steht). */
.lese-seite { display: grid; gap: 1.5rem; }
.lese-abschnitt { display: grid; gap: 0.5rem; min-width: 0; }
.lese-abschnitt-titel { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.lese-abschnitt-text { margin-top: 0.125rem; font-size: 0.8125rem; line-height: 1.45; color: hsl(var(--muted-foreground)); text-wrap: pretty; }
@media (min-width: 960px) {
  .lese-seitlich { gap: 1.25rem; }
  .lese-seitlich > .lese-abschnitt { grid-template-columns: 13rem minmax(0, 1fr); gap: 2rem; align-items: start; }
  .lese-seitlich .lese-abschnitt-kopf { padding-top: 0.875rem; }
}
.lese-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding: 0.375rem 0; }
.lese-box > .lese-aktion { margin: 0.25rem 0.625rem 0 0; }
.lese-box-titel { padding: 0.5625rem 1.25rem 0.125rem; font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.5; }
.lese-box-titel ~ .lese-zeilen, .lese-box-titel ~ .lese-leer { grid-column: 1 / -1; }
.lese-aktion { color: hsl(var(--muted-foreground)); }
.lese-aktion:hover { color: hsl(var(--foreground)); }
.lese-leise { color: hsl(var(--muted-foreground)); }
.lese-leer { padding: 0.5rem 1.25rem; font-size: 0.875rem; line-height: 1.45; }
.lese-zeilen { min-width: 0; font-size: 0.875rem; line-height: 1.45; }
.lese-zeile { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr); column-gap: 1rem; padding: 0.5rem 1.25rem; min-width: 0; }
.lese-zeile > dt { color: hsl(var(--muted-foreground)); }
.lese-zeile > dd { min-width: 0; overflow-wrap: break-word; }
/* Zeilen mit eigener Aktion: die Bezeichnung ist der Name der Sache */
.lese-zeilen-aktiv { grid-column: 1 / -1; }
.lese-zeilen-aktiv > .lese-zeile { grid-template-columns: 10.5rem minmax(0, 1fr) auto; padding-right: 0.625rem; }
.lese-zeilen-aktiv > .lese-zeile > dt { color: hsl(var(--foreground)); font-weight: 500; }
.lese-unter { display: block; font-size: 0.75rem; font-weight: 400; color: hsl(var(--muted-foreground)); }
.lese-zeile-aktion { margin: -0.375rem 0; }
@media (max-width: 639px) {
  .lese-zeile { grid-template-columns: minmax(0, 1fr); row-gap: 0.125rem; }
  .lese-zeile > dt { font-size: 0.8125rem; }
  .lese-zeilen-aktiv > .lese-zeile { grid-template-columns: minmax(0, 1fr) auto; }
  .lese-zeilen-aktiv > .lese-zeile > dt { grid-column: 1; font-size: 0.875rem; }
  .lese-zeilen-aktiv > .lese-zeile > dd { grid-column: 1; }
  .lese-zeile-aktion { grid-column: 2; grid-row: 1 / span 2; margin: -0.125rem 0 0; }
  .lese-aktion-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* 5.4 Tabelle ------------------------------------------------------------ */
.tabelle-rahmen { position: relative; width: 100%; overflow: auto; border: 1px solid var(--karten-rand); border-radius: calc(var(--radius) + 4px); background: hsl(var(--card)); box-shadow: var(--karten-schatten); -webkit-overflow-scrolling: touch; }
@media (min-width: 1024px) { .tabelle-rahmen-hoch { max-height: calc(100dvh - 15rem); min-height: 20rem; } }
/* Listen-Seite füllt genau den Bildschirm (main.inhalt-fest): Die Karte .inhalt-fest-karte endet
   kurz vor der Unterkante, gescrollt wird nur in der Tabelle (.inhalt-fest-rumpf > .tabelle-rahmen),
   Kopf, Werkzeugzeile und Seitennavigation bleiben stehen. Wenige Zeilen: die Karte bleibt kurz.
   Nur ab Laptop-Größe; auf kleinen oder niedrigen Bildschirmen scrollt die Seite wie üblich. */
@media (min-width: 1024px) and (min-height: 600px) {
  .admin-haupt:has(> .inhalt-fest) { height: 100dvh; }
  .inhalt-fest { display: flex; flex-direction: column; min-height: 0; padding-bottom: 1.5rem; }
  .inhalt-fest > * { flex: none; }
  .inhalt-fest > .tabelle-rahmen { flex: 0 1 auto; min-height: 0; max-height: none; }
  .inhalt-fest > .inhalt-fest-karte { flex: 0 1 auto; display: flex; flex-direction: column; min-height: 0; margin-bottom: 0; }
  .inhalt-fest-karte > * { flex: none; }
  .inhalt-fest-karte > .inhalt-fest-rumpf { flex: 0 1 auto; display: flex; flex-direction: column; min-height: 0; }
  .inhalt-fest-karte > .tabelle-rahmen { flex: 0 1 auto; min-height: 0; max-height: none; }
  .inhalt-fest-rumpf > * { flex: none; }
  .inhalt-fest-rumpf > .tabelle-rahmen { flex: 0 1 auto; min-height: 0; max-height: none; }
  /* Platz für die schwebende Leiste der Sammelaktionen, solange etwas ausgewählt ist */
  .inhalt-fest:has(.aktionsleiste-schwebend[data-sichtbar]) { padding-bottom: 5.5rem; }
}
.tabelle { width: 100%; font-size: 0.875rem; caption-side: bottom; }
.tabelle caption { padding: 0.75rem; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.tabelle th, .tabelle td { padding: 0.75rem 1rem; text-align: left; vertical-align: middle; }
.tabelle thead th {
  position: sticky; top: 0; z-index: 2;
  height: 2.5rem; padding-top: 0; padding-bottom: 0;
  background: hsl(var(--card)); color: hsl(var(--muted-foreground));
  font-size: 0.8125rem; font-weight: 500; white-space: nowrap;
  box-shadow: inset 0 -1px 0 hsl(var(--linie));
}
.tabelle tbody tr { border-bottom: 1px solid hsl(var(--linie)); transition: background-color var(--dauer); }
.tabelle tbody tr:last-child { border-bottom-width: 0; }
.tabelle tbody tr:hover { background: hsl(var(--muted) / 0.5); }
.tabelle tbody tr:has(.checkbox:checked), .tabelle tbody tr[aria-selected="true"] { background: hsl(var(--muted)); }
.tabelle tfoot td { font-weight: 500; background: hsl(var(--muted) / 0.4); }
.tabelle .zahl, .tabelle th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.tabelle .eng { width: 1%; white-space: nowrap; }
.tabelle .nowrap { white-space: nowrap; }
.tabelle .gedaempft { color: hsl(var(--muted-foreground)); }
.tabelle .zelle-auswahl { width: 2.75rem; padding-right: 0; }
.tabelle .zelle-auswahl .checkbox { display: block; }
@media (pointer: coarse) { .tabelle .zelle-auswahl { position: relative; } .tabelle .zelle-auswahl .checkbox::after { content: ""; position: absolute; inset: -0.875rem; } .tabelle .zelle-auswahl .checkbox { position: relative; } }
.tabelle .zelle-aktionen { width: 1%; white-space: nowrap; text-align: right; padding-top: 0; padding-bottom: 0; }
.tabelle .zelle-haupt { font-weight: 500; color: hsl(var(--foreground)); }
.tabelle .zelle-text { min-width: 12rem; max-width: 20rem; }
.tabelle .zelle-badges { min-width: 9.5rem; }
.tabelle .zelle-haupt a:hover { text-decoration: underline; text-underline-offset: 3px; }
.zelle-sub { display: block; font-size: 0.8125rem; font-weight: 400; color: hsl(var(--muted-foreground)); max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabelle-kompakt th, .tabelle-kompakt td { padding: 0.5rem 0.75rem; }
.tabelle-kompakt thead th { height: 2.25rem; }
.tabelle-kompakt .zelle-auswahl { padding-left: 0.875rem; }
.tabelle-zebra tbody tr:nth-child(even) { background: hsl(var(--muted) / 0.3); }
/* Sortierbarer Kopf */
.th-sort { display: inline-flex; align-items: center; gap: 0.25rem; margin: 0 -0.5rem; padding: 0.25rem 0.5rem; border-radius: calc(var(--radius) - 3px); color: inherit; white-space: nowrap; }
.th-sort:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
.th-sort .icon { width: 0.875rem; height: 0.875rem; opacity: 0.5; }
.th-sort[data-aktiv] { color: hsl(var(--foreground)); }
.th-sort[data-aktiv] .icon { opacity: 1; }
.zahl .th-sort { flex-direction: row-reverse; }
/* Filterleiste über Tabellen */
.filterleiste { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; margin-bottom: 1rem; }
.filterleiste .feld { flex: 1 1 12rem; gap: 0.375rem; }
.filterleiste .feld-suche { flex: 2 1 16rem; }
.filterleiste .label { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.tabelle-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.875rem; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
/* Aktive Filter als Chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 0.875rem; }
.chip { display: inline-flex; align-items: center; gap: 0.25rem; height: 1.75rem; padding: 0 0.375rem 0 0.625rem; border-radius: 999px; font-size: 0.8125rem; background: hsl(var(--foreground) / 0.06); }
.chip a { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; color: hsl(var(--muted-foreground)); }
.chip a:hover { background: hsl(var(--accent)); color: hsl(var(--foreground)); }

/* 5.5 Badge -------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  height: 1.375rem; padding: 0 0.5rem;
  border: 1px solid transparent; border-radius: 999px;
  font-size: 0.75rem; font-weight: 500; line-height: 1; white-space: nowrap;
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
}
.badge .icon { width: 0.75rem; height: 0.75rem; }
.badges { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.badge-outline { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); } /* Ruhe: keine umrandeten Pills mehr */
.badge-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.badge-info { background: hsl(var(--info-bg)); color: hsl(var(--info-fg)); }
.badge-erfolg { background: hsl(var(--erfolg-bg)); color: hsl(var(--erfolg-fg)); }
.badge-warnung { background: hsl(var(--warnung-bg)); color: hsl(var(--warnung-fg)); }
.badge-fehler { background: hsl(var(--fehler-bg)); color: hsl(var(--fehler-fg)); }
.badge-status { --st-bg: var(--st-eingegangen-bg); --st-fg: var(--st-eingegangen-fg); --st-punkt: var(--st-eingegangen-punkt);
  background: hsl(var(--st-bg)); color: hsl(var(--st-fg)); padding-left: 0.4375rem; }
/* Status als Text mit Farbpunkt (statusPunkt): für Menüs, in denen Status zur Wahl stehen */
.status-text { --st-punkt: var(--st-eingegangen-punkt); display: inline-flex; align-items: center; gap: 0.625rem; }
.status-text > .badge-punkt { width: 0.5rem; height: 0.5rem; }
.badge-punkt { width: 0.375rem; height: 0.375rem; border-radius: 50%; background: hsl(var(--st-punkt, var(--muted-foreground))); flex-shrink: 0; }
.status-angemeldet { --st-bg: var(--st-angemeldet-bg); --st-fg: var(--st-angemeldet-fg); --st-punkt: var(--st-angemeldet-punkt); }
.status-vorgemerkt { --st-bg: var(--st-vorgemerkt-bg); --st-fg: var(--st-vorgemerkt-fg); --st-punkt: var(--st-vorgemerkt-punkt); }
.status-bestaetigt { --st-bg: var(--st-bestaetigt-bg); --st-fg: var(--st-bestaetigt-fg); --st-punkt: var(--st-bestaetigt-punkt); }
.status-storniert { --st-bg: var(--st-storniert-bg); --st-fg: var(--st-storniert-fg); --st-punkt: var(--st-storniert-punkt); }
.status-abgesagt { --st-bg: var(--st-abgesagt-bg); --st-fg: var(--st-abgesagt-fg); --st-punkt: var(--st-abgesagt-punkt); }
.status-abgelehnt { --st-bg: var(--st-abgelehnt-bg); --st-fg: var(--st-abgelehnt-fg); --st-punkt: var(--st-abgelehnt-punkt); }
.status-abgelehnt.badge-status { border-color: transparent; }
.status-abgelehnt.status-text { --st-punkt: var(--foreground); }

/* 5.6 Alert -------------------------------------------------------------- */
.alert {
  --a-bg: var(--card); --a-fg: var(--foreground); --a-border: var(--border); --a-icon: var(--foreground);
  display: flex; gap: 0.75rem; padding: 0.875rem 1rem;
  border: 1px solid hsl(var(--a-border)); border-radius: var(--radius);
  background: hsl(var(--a-bg)); color: hsl(var(--a-fg));
  font-size: 0.875rem; line-height: 1.5;
}
.alert > .icon { margin-top: 0.15rem; color: hsl(var(--a-icon)); }
.alert-inhalt { min-width: 0; flex: 1; }
.alert-titel { font-weight: 600; line-height: 1.4; }
.alert-titel + .alert-text { margin-top: 0.125rem; }
.alert-text { opacity: 0.92; }
.alert-text a { text-decoration: underline; text-underline-offset: 3px; }
.alert-aktion { margin-left: auto; align-self: center; flex-shrink: 0; }
.alert-info { --a-bg: var(--info-bg); --a-fg: var(--info-fg); --a-border: var(--info-border); --a-icon: var(--info-fg); }
.alert-erfolg { --a-bg: var(--erfolg-bg); --a-fg: var(--erfolg-fg); --a-border: var(--erfolg-border); --a-icon: var(--erfolg-fg); }
.alert-warnung { --a-bg: var(--warnung-bg); --a-fg: var(--warnung-fg); --a-border: var(--warnung-border); --a-icon: var(--warnung-fg); }
.alert-fehler { --a-bg: var(--fehler-bg); --a-fg: var(--fehler-fg); --a-border: var(--fehler-border); --a-icon: var(--fehler-fg); }

/* 5.7 Dialog ------------------------------------------------------------- */
.dialog {
  margin: auto; padding: 0; width: calc(100% - 2rem); max-width: 32rem; max-height: calc(100dvh - 2rem);
  background: hsl(var(--background)); color: hsl(var(--foreground));
  border: 1px solid var(--karten-rand); border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--schatten-xl); overflow: hidden;
}
.dialog[open] { display: flex; flex-direction: column; animation: dialog-ein 160ms cubic-bezier(0.16, 1, 0.3, 1); }
.dialog::backdrop { background: rgb(0 0 0 / 0.5); animation: einblenden 160ms ease-out; }
/* Ohne JavaScript: <a href="#dlg-id"> zeigt den Dialog über :target (nicht modal, aber bedienbar);
   „Schließen“ ist dann ein Link auf "#". */
.dialog:target:not([open]) { display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 60; height: fit-content; }
.dialog-breit { max-width: 44rem; }
.dialog-kopf { position: relative; padding: 1.5rem 3.5rem 0 1.5rem; }
.dialog-titel { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.015em; }
.dialog-text { margin-top: 0.375rem; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.dialog-inhalt { padding: 1.25rem 1.5rem; overflow-y: auto; font-size: 0.875rem; }
.dialog-fuss { display: flex; flex-direction: column-reverse; gap: 0.5rem; padding: 1rem 1.5rem 1.5rem; }
.dialog-kopf + .dialog-fuss { padding-top: 1.5rem; }
.dialog-schliessen { position: absolute; top: 1rem; right: 1rem; }
@media (min-width: 640px) { .dialog-fuss { flex-direction: row; justify-content: flex-end; } }
/* Formular als direktes Kind (<form class="dialog-formular">): Kopf und Fuß stehen, der Inhalt scrollt. */
.dialog > form, .dialog-formular { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.dialog-kopf, .dialog-fuss { flex-shrink: 0; }
.dialog-inhalt { flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.dialog-inhalt.formular, .dialog-inhalt.stapel { align-content: start; }
/* Großer Dialog für lange Texte (Editor) */
.dialog-gross { max-width: 60rem; max-height: calc(100dvh - 3rem); }
.dialog-gross .dialog-inhalt { padding-top: 1.5rem; padding-bottom: 1.5rem; }
/* Handy: Dialoge füllen die Breite; der große Dialog die ganze Höhe (dvh: bleibt mit Bildschirmtastatur bedienbar) */
@media (max-width: 639px) {
  .dialog { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
  .dialog-breit, .dialog-gross { width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; border-radius: 0; border-width: 0; }
  .dialog-breit .dialog-kopf, .dialog-gross .dialog-kopf { padding: 1rem 3.5rem 0 1rem; }
  .dialog-breit .dialog-inhalt, .dialog-gross .dialog-inhalt { padding: 1rem; }
  .dialog-breit .dialog-fuss, .dialog-gross .dialog-fuss { padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom)); flex-direction: row; justify-content: flex-end; }
  .dialog-breit .dialog-fuss > .btn, .dialog-gross .dialog-fuss > .btn { flex: 1 1 0; }
  .dialog-breit .dialog-schliessen, .dialog-gross .dialog-schliessen { top: 0.625rem; right: 0.5rem; }
}
@keyframes dialog-ein { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes einblenden { from { opacity: 0; } }
/* Mail-Vorschau im Dialog */
.vorschau-wirkung { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 1.25rem; margin-bottom: 1rem; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.vorschau-wirkung > span { display: inline-flex; align-items: center; gap: 0.375rem; }
.vorschau-mail { border-radius: var(--radius); background: hsl(var(--muted) / 0.5); overflow: hidden; }
.vorschau-mail-kopf { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.25rem 0.75rem; padding: 0.75rem 1rem 0.25rem; font-size: 0.8125rem; }
.vorschau-mail-kopf dt { color: hsl(var(--muted-foreground)); }
.vorschau-mail-kopf dd { font-weight: 500; overflow-wrap: anywhere; }
.vorschau-mail-text { padding: 1rem; font-size: 0.875rem; max-height: 16rem; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.vorschau-anhaenge { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.25rem 1rem 0.875rem; }

/* 5.8 Dropdown-Menü (details/summary) ------------------------------------ */
.dropdown { position: relative; display: inline-block; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menue {
  position: absolute; z-index: 60; top: calc(100% + 0.375rem); right: 0;
  min-width: 13rem; width: max-content; max-width: min(22rem, calc(100vw - 2rem)); padding: 0.25rem;
  background: hsl(var(--popover)); color: hsl(var(--popover-foreground));
  border: 1px solid var(--karten-rand); border-radius: var(--radius); box-shadow: var(--karten-schatten), var(--schatten-lg);
  animation: dropdown-ein 120ms ease-out; transform-origin: top right;
}
.dropdown-links .dropdown-menue { right: auto; left: 0; transform-origin: top left; }
.dropdown-oben .dropdown-menue { top: auto; bottom: calc(100% + 0.375rem); }
@keyframes dropdown-ein { from { opacity: 0; transform: scale(0.96) translateY(-2px); } }
.dropdown-eintrag {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  min-height: 2.25rem; padding: 0.375rem 0.5rem; border-radius: calc(var(--radius) - 3px);
  background: transparent; font-size: 0.875rem; text-align: left; color: inherit; cursor: pointer; white-space: nowrap;
}
@media (pointer: coarse) { .dropdown-eintrag { min-height: 2.75rem; } }
.dropdown-eintrag .icon { color: hsl(var(--muted-foreground)); }
.dropdown-eintrag:hover, .dropdown-eintrag:focus-visible { background: hsl(var(--accent)); outline: none; }
.dropdown-eintrag-gefahr { color: hsl(var(--destructive)); }
.dropdown-eintrag-gefahr .icon { color: currentColor; }
.dropdown-eintrag-gefahr:hover, .dropdown-eintrag-gefahr:focus-visible { background: hsl(var(--fehler-bg)); }
.dropdown-eintrag kbd, .dropdown-eintrag .nebentext { margin-left: auto; font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.dropdown-label { padding: 0.375rem 0.5rem; font-size: 0.75rem; font-weight: 500; color: hsl(var(--muted-foreground)); }
.dropdown-kopf { padding: 0.5rem 0.5rem 0.625rem; font-size: 0.875rem; line-height: 1.35; }
.dropdown-kopf small { display: block; font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.dropdown-trenner { height: 1px; margin: 0.25rem -0.25rem; background: hsl(var(--linie)); }
.dropdown-menue form { display: contents; }

/* Benutzermenü-Auslöser */
.benutzer { display: inline-flex; align-items: center; gap: 0.5rem; height: var(--hoehe); padding: 0 0.375rem 0 0.25rem; border-radius: 999px; font-size: 0.875rem; font-weight: 500; }
.benutzer:hover { background: hsl(var(--accent)); }
.benutzer-name { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-size: 0.75rem; font-weight: 600; flex-shrink: 0; }
.avatar-sm { width: 1.5rem; height: 1.5rem; font-size: 0.625rem; }

/* 5.9 Tabs --------------------------------------------------------------- */
.tabs-liste { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.25rem; border-radius: var(--radius); background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 0.375rem; height: calc(var(--hoehe) - 0.5rem); padding: 0 0.75rem; border-radius: calc(var(--radius) - 3px); font-size: 0.875rem; font-weight: 500; white-space: nowrap; background: transparent; color: inherit; transition: color var(--dauer), background-color var(--dauer), box-shadow var(--dauer); }
.tab:hover { color: hsl(var(--foreground)); }
.tab[aria-selected="true"], .tab[aria-current="page"] { background: hsl(var(--card)); color: hsl(var(--foreground)); box-shadow: var(--schatten-sm); }
.tab .badge { height: 1.125rem; padding: 0 0.375rem; font-size: 0.6875rem; }
.tab-panel { margin-top: 1rem; }
.tab-panel:focus-visible { outline-offset: 4px; }
/* Unterstrich-Variante für Seitenbereiche */
.tabs-linie { display: flex; gap: 1.25rem; overflow-x: auto; scrollbar-width: none; margin-bottom: 1.5rem; }
.tabs-linie .tab { height: 2.75rem; padding: 0 0.125rem; border-radius: 0; color: hsl(var(--muted-foreground)); box-shadow: none; background: none; position: relative; }
.tabs-linie .tab[aria-selected="true"], .tabs-linie .tab[aria-current="page"] { color: hsl(var(--foreground)); box-shadow: inset 0 -2px 0 hsl(var(--foreground)); }

/* 5.10 Toast / Flash ----------------------------------------------------- */
.toaster { position: fixed; z-index: 100; left: 1rem; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
@media (min-width: 640px) { .toaster { left: auto; right: 1.5rem; bottom: 1.5rem; width: 24rem; } }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.875rem 0.875rem 0.875rem 1rem;
  background: hsl(var(--popover)); color: hsl(var(--popover-foreground));
  border: 1px solid var(--karten-rand); border-radius: var(--radius); box-shadow: var(--karten-schatten), var(--schatten-lg);
  font-size: 0.875rem; font-weight: 500; line-height: 1.45;
  animation: toast-ein 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast > .icon { margin-top: 0.125rem; }
.toast-text { flex: 1; min-width: 0; }
.toast-schliessen { margin: -0.375rem -0.375rem -0.375rem 0; }
.toast-erfolg > .icon { color: hsl(var(--st-bestaetigt-punkt)); }
.toast-info > .icon { color: hsl(var(--st-angemeldet-punkt)); }
.toast-warnung > .icon { color: hsl(var(--st-vorgemerkt-punkt)); }
.toast-fehler { border-color: hsl(var(--fehler-border)); background: hsl(var(--fehler-bg)); color: hsl(var(--fehler-fg)); }
.toast[data-geht] { animation: toast-aus 180ms ease-in forwards; }
@keyframes toast-ein { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes toast-aus { to { opacity: 0; transform: translateX(16px); } }

/* 5.11 Seitennavigation (Pagination) ------------------------------------- */
.seitennav { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.seitennav-link { display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; min-width: var(--hoehe); height: var(--hoehe); padding: 0 0.625rem; border-radius: calc(var(--radius) - 2px); font-size: 0.875rem; font-weight: 500; color: hsl(var(--foreground)); border: 1px solid transparent; }
.seitennav-link:hover { background: hsl(var(--accent)); }
.seitennav-link[aria-current="page"] { background: hsl(var(--card)); box-shadow: var(--karten-schatten); border-color: var(--karten-rand); }
.seitennav-link[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.seitennav-luecke { display: inline-grid; place-items: center; width: 2rem; color: hsl(var(--muted-foreground)); }
@media (max-width: 639px) { .seitennav-zahl:not([aria-current]) { display: none; } .seitennav-luecke { display: none; } }

/* 5.12 Leerzustand ------------------------------------------------------- */
.leer { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 3rem 1.5rem; border: 1px solid var(--karten-rand); border-radius: calc(var(--radius) + 4px); background: hsl(var(--card)); box-shadow: var(--karten-schatten); }
.leer-icon { display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: 1rem; border-radius: 50%; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.leer-icon .icon { width: 1.375rem; height: 1.375rem; }
.leer-titel { font-size: 1rem; font-weight: 600; }
.leer-text { margin-top: 0.375rem; max-width: 26rem; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.leer-aktionen { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1.25rem; }
.card .leer, .tabelle-rahmen .leer { border: 0; background: none; box-shadow: none; }

/* 5.13 Breadcrumb -------------------------------------------------------- */
.krumen ol { display: flex; align-items: center; gap: 0.375rem; list-style: none; font-size: 0.875rem; color: hsl(var(--muted-foreground)); min-width: 0; }
.krumen li { display: inline-flex; align-items: center; gap: 0.375rem; min-width: 0; }
.krumen li + li::before { content: ""; width: 0.875rem; height: 0.875rem; flex-shrink: 0; opacity: 0.6; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat; }
.krumen a { white-space: nowrap; transition: color var(--dauer); }
.krumen a:hover { color: hsl(var(--foreground)); }
.krumen [aria-current="page"] { color: hsl(var(--foreground)); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 639px) { .krumen li:not(:last-child) { display: none; } .krumen li + li::before { display: none; } }

/* 5.14 Kennzahl-Kachel --------------------------------------------------- */
.kennzahlen { display: grid; gap: 0.25rem 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0.5rem; background: hsl(var(--card)); border: 1px solid var(--karten-rand); border-radius: calc(var(--radius) + 4px); box-shadow: var(--karten-schatten); }
@media (min-width: 768px) { .kennzahlen { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.25rem 1rem; padding: 0.625rem 0.75rem; } }
.kennzahl { padding: 0.75rem 0.875rem; min-width: 0; }
.kennzahl-kopf { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.kennzahl-label { font-size: 0.8125rem; font-weight: 500; color: hsl(var(--muted-foreground)); }
.kennzahl-kopf .icon { color: hsl(var(--muted-foreground)); }
.kennzahl-wert { margin-top: 0.375rem; font-size: 1.75rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kennzahl-wert small { font-size: 0.875rem; font-weight: 500; color: hsl(var(--muted-foreground)); letter-spacing: 0; }
.kennzahl-zusatz { margin-top: 0.375rem; font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.fortschritt { height: 0.3125rem; margin-top: 0.75rem; border-radius: 999px; background: hsl(var(--muted)); overflow: hidden; }
.fortschritt > span { display: block; height: 100%; border-radius: inherit; background: hsl(var(--balken)); }
progress.fortschritt { appearance: none; -webkit-appearance: none; width: 100%; border: 0; display: block; }
progress.fortschritt::-webkit-progress-bar { background: hsl(var(--muted)); border-radius: 999px; }
progress.fortschritt::-webkit-progress-value { background: hsl(var(--balken)); border-radius: 999px; }
progress.fortschritt::-moz-progress-bar { background: hsl(var(--balken)); border-radius: 999px; }

/* Fragen-Auswertung als Balkenliste: veraltet (UI.md „Ruhe“, Regel 4) – Zahlen als Text zeigen. */
.balkenliste { display: grid; gap: 0.875rem; }
.balken-zeile { display: grid; gap: 0.375rem; font-size: 0.875rem; }
.balken-kopf { display: flex; justify-content: space-between; gap: 1rem; }
.balken-kopf span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.balken-zeile .fortschritt { margin-top: 0; }

/* 5.15 Aktionsleiste für Sammelaktionen ---------------------------------- */
.aktionsleiste { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.625rem 0.75rem; margin-top: 0.75rem; border: 1px solid var(--karten-rand); border-radius: var(--radius); background: hsl(var(--card)); box-shadow: var(--karten-schatten); font-size: 0.875rem; }
.aktionsleiste-anzahl { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 500; padding-right: 0.25rem; }
.aktionsleiste-anzahl strong { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 0.375rem; border-radius: 999px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.aktionsleiste-trenner { width: 1px; align-self: stretch; background: hsl(var(--linie)); }
.aktionsleiste-aktionen { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
.aktionsleiste .select { width: auto; min-width: 12rem; }
/* app.js macht daraus eine schwebende Leiste, die erst bei Auswahl erscheint */
.aktionsleiste-schwebend {
  position: fixed; z-index: 35; left: 50%; bottom: 1rem; margin: 0;
  width: max-content; max-width: calc(100vw - 1.5rem);
  transform: translate(-50%, calc(100% + 2rem)); opacity: 0; visibility: hidden;
  background: hsl(var(--popover)); box-shadow: var(--schatten-xl);
  border-radius: calc(var(--radius) + 4px); padding: 0.5rem 0.5rem 0.5rem 0.875rem;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), opacity 160ms, visibility 220ms;
}
.aktionsleiste-schwebend[data-sichtbar] { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.aktionsleiste-schwebend:not([data-bereit]) { transition: none; }
@media (min-width: 1024px) { .aktionsleiste-schwebend { left: calc(50% + var(--leiste-breite) / 2); } .oeffentlich .aktionsleiste-schwebend { left: 50%; } }
@media (max-width: 639px) {
  .aktionsleiste-schwebend { left: 0.75rem; right: 0.75rem; width: auto; transform: translateY(calc(100% + 2rem)); }
  .aktionsleiste-schwebend[data-sichtbar] { transform: none; }
  .aktionsleiste-schwebend .aktionsleiste-aktionen { margin-left: 0; width: 100%; }
  .aktionsleiste-schwebend .aktionsleiste-aktionen > * { flex: 1 1 auto; }
  .aktionsleiste-schwebend .aktionsleiste-trenner { display: none; }
  .aktionsleiste-schwebend .aktionsleiste-aufheben { position: absolute; top: 0.25rem; right: 0.25rem; }
  .aktionsleiste-schwebend .aktionsleiste-anzahl { min-height: 2.25rem; }
}

/* 5.16 Verlauf (Timeline) ------------------------------------------------ */
.verlauf { list-style: none; position: relative; }
.verlauf-eintrag { position: relative; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 0.875rem; padding-bottom: 1.25rem; }
.verlauf-eintrag:last-child { padding-bottom: 0; }
.verlauf-eintrag:not(:last-child)::before { content: ""; position: absolute; left: calc(1rem - 0.5px); top: 2.25rem; bottom: 0.25rem; width: 1px; background: hsl(var(--linie)); }
.verlauf-punkt { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.verlauf-punkt .icon { width: 0.875rem; height: 0.875rem; }
.verlauf-punkt-mail { background: hsl(var(--info-bg)); color: hsl(var(--info-fg)); }
.verlauf-punkt-klick { background: hsl(var(--erfolg-bg)); color: hsl(var(--erfolg-fg)); }
.verlauf-punkt-fehler { background: hsl(var(--fehler-bg)); color: hsl(var(--fehler-fg)); }
.verlauf-inhalt { padding-top: 0.3125rem; font-size: 0.875rem; min-width: 0; }
.verlauf-kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.125rem 0.75rem; }
.verlauf-titel { font-weight: 500; }
.verlauf-zeit { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); white-space: nowrap; font-variant-numeric: tabular-nums; }
.verlauf-details { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.5rem; margin-top: 0.375rem; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.verlauf-details .icon-pfeil { width: 0.875rem; height: 0.875rem; }
.verlauf-notiz { margin-top: 0.5rem; padding: 0.5rem 0.75rem; border-radius: calc(var(--radius) - 2px); background: hsl(var(--muted) / 0.6); font-size: 0.8125rem; }
.verlauf-fehler { margin-top: 0.5rem; font-size: 0.8125rem; color: hsl(var(--destructive)); }

/* 5.17 Veranstaltungskarten (öffentlich) --------------------------------- */
.vliste { display: grid; gap: 0.75rem; list-style: none; }
.vkarte { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; padding: 1rem; background: hsl(var(--card)); border: 1px solid var(--karten-rand); border-radius: calc(var(--radius) + 4px); box-shadow: var(--karten-schatten); transition: box-shadow var(--dauer); }
.vkarte:hover { box-shadow: var(--karten-schatten), var(--schatten-md); }
.vkarte:focus-within { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.vkarte-datum { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 3.75rem; height: 4rem; border-radius: var(--radius); background: hsl(var(--muted)); line-height: 1; text-align: center; }
.vkarte-datum-monat { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); }
.vkarte-datum-tag { margin-top: 0.25rem; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.vkarte-titel { font-size: 1rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.vkarte-titel a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.vkarte-titel a:focus-visible { outline: none; }
.vkarte-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.375rem; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.vkarte-meta span { display: inline-flex; align-items: center; gap: 0.375rem; }
.vkarte-badges { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.625rem; }
.vkarte[data-ausgebucht] .vkarte-datum { opacity: 0.6; }
@media (min-width: 640px) { .vkarte { padding: 1.25rem; gap: 1.25rem; } .vkarte-datum { width: 4.25rem; height: 4.5rem; } }

/* Detailseite: Eckdaten */
.eckdaten { display: grid; border: 1px solid var(--karten-rand); border-radius: calc(var(--radius) + 4px); background: hsl(var(--card)); box-shadow: var(--karten-schatten); overflow: hidden; }
.eckdatum { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.875rem 1rem; }
.eckdatum + .eckdatum { border-top: 1px solid hsl(var(--linie)); }
@media (min-width: 640px) {
  .eckdaten { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .eckdatum + .eckdatum { border-top-width: 0; border-left: 1px solid hsl(var(--linie)); }
}
.eckdatum > .icon { margin-top: 0.125rem; color: hsl(var(--muted-foreground)); }
.eckdatum-label { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.eckdatum-wert { font-size: 0.875rem; font-weight: 500; }

/* 5.18 Skeleton, Spinner, Tooltip ---------------------------------------- */
.skelett { display: block; height: 1rem; border-radius: calc(var(--radius) - 2px); background: hsl(var(--muted)); animation: pulsieren 1.6s ease-in-out infinite; }
@keyframes pulsieren { 50% { opacity: 0.5; } }
.spinner { display: inline-block; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: drehen 0.7s linear infinite; vertical-align: -0.125em; }
/* Tooltip: app.js macht aus title="…" eine eigene Fläche, die sofort erscheint (position: fixed,
   Lage per Skript). Ohne JavaScript bleibt der Tooltip des Browsers. */
.tooltip {
  position: fixed; z-index: 110; left: 0; top: 0; width: max-content; max-width: min(20rem, calc(100vw - 0.5rem));
  padding: 0.375rem 0.625rem; border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); box-shadow: var(--schatten-md, 0 4px 12px rgb(0 0 0 / 0.15));
  font-size: 0.75rem; font-weight: 500; line-height: 1.4; text-align: left; white-space: pre-line; overflow-wrap: anywhere;
  pointer-events: none; animation: einblenden 80ms ease-out;
}
.tooltip[hidden] { display: none; }

/* Platzhalter-Liste (Partial platzhalter-liste): Suchfeld, darunter je Gruppe eine gedämpfte Fläche
   mit Überschrift. Je Zeile links die Bedeutung, rechts leise der Platzhalter (ab 23rem Breite
   der Liste nebeneinander, sonst untereinander). Ein Klick kopiert; die Zeile zeigt dann
   anstelle des Platzhalters „Kopiert“. */
.ph-liste { container-type: inline-size; display: grid; gap: 0.75rem; }
.ph-gruppe { padding: 0.75rem 0.375rem 0.375rem; border-radius: var(--radius); background: hsl(var(--muted) / 0.6); }
.ph-gruppe[hidden], .ph-gruppe li[hidden] { display: none; }
.ph-gruppe-titel { margin: 0 0 0.375rem; padding: 0 0.625rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: -0.005em; color: hsl(var(--foreground)); }
.ph-gruppe ul { display: grid; list-style: none; margin: 0; padding: 0; }
.ph-leer { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.ph {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "name"; gap: 0;
  width: 100%; padding: 0.375rem 0.625rem; border: 0; border-radius: calc(var(--radius) - 2px); background: transparent;
  font: inherit; font-size: 0.8125rem; line-height: 1.4; text-align: left; color: inherit; cursor: pointer;
  transition: background-color var(--dauer);
}
.ph:hover { background: hsl(var(--card)); }
.ph:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: -2px; }
.ph-text { grid-area: text; min-width: 0; color: hsl(var(--foreground)); }
.ph-name, .ph-kopiert { grid-area: name; justify-self: start; min-width: 0; }
.ph-name { padding: 0; background: none; font-size: 0.6875rem; white-space: nowrap; color: hsl(var(--muted-foreground)); }
.ph-kopiert { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; font-weight: 600; color: hsl(var(--erfolg-fg)); visibility: hidden; }
.ph-kopiert .icon { width: 0.875rem; height: 0.875rem; stroke-width: 2.5; }
.ph[data-kopiert], .ph[data-kopiert]:hover { background: hsl(var(--erfolg-bg)); }
.ph[data-kopiert] .ph-name { visibility: hidden; }
.ph[data-kopiert] .ph-kopiert { visibility: visible; }
.ph[data-kopierfehler], .ph[data-kopierfehler]:hover { background: hsl(var(--warnung-bg)); }
.ph[data-kopierfehler] .ph-name { user-select: all; color: hsl(var(--foreground)); }
@container (min-width: 23rem) {
  .ph { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text name"; align-items: baseline; gap: 0 1rem; }
  .ph-name, .ph-kopiert { justify-self: end; }
}
/* Ohne JavaScript ist die Liste nur zum Lesen und Abschreiben. */
html:not(.js) .ph { cursor: text; user-select: text; }
html:not(.js) .ph:hover { background: transparent; }

/* 5.19 Seitenbausteine: Fehlerseiten, Ergebnisseiten, öffentliche Überschriften */
.fehlerseite { text-align: center; }
.fehlerseite-gross { max-width: 30rem; margin: 3rem auto; }
.fehlerseite-code { display: inline-block; padding: 0.125rem 0.625rem; border-radius: 999px; background: hsl(var(--muted)); font-size: 0.75rem; font-weight: 600; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.fehlerseite-titel { margin-top: 0.875rem; font-size: 1.5rem; }
.fehlerseite-text { margin-top: 0.5rem; font-size: 0.9375rem; color: hsl(var(--muted-foreground)); }
.fehlerseite-aktionen { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; }
.login-titel { font-size: 1.375rem; }
.oe-abschnitt + .oe-abschnitt { margin-top: 3.5rem; }
.oe-titel { font-size: 1.625rem; font-weight: 650; letter-spacing: -0.025em; line-height: 1.2; }
@media (min-width: 640px) { .oe-titel { font-size: 2rem; } }
.oe-ueberzeile { margin-bottom: 0.375rem; font-size: 0.8125rem; font-weight: 500; color: hsl(var(--muted-foreground)); }
.oe-einleitung { margin: 0.5rem 0 1.5rem; color: hsl(var(--muted-foreground)); max-width: 40rem; }
.oe-abschnitt > .alert { margin-top: 1.5rem; }
.oe-abschnitt > .oe-titel + :not(.oe-einleitung):not(.eckdaten) { margin-top: 1.25rem; }
.ergebnis { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2.25rem 1.5rem; }
.ergebnis-icon { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); margin-bottom: 1.125rem; }
.ergebnis-icon-erfolg { background: hsl(var(--erfolg-bg)); color: hsl(var(--erfolg-fg)); }
.ergebnis-icon-info { background: hsl(var(--info-bg)); color: hsl(var(--info-fg)); }
.ergebnis-icon-warnung { background: hsl(var(--warnung-bg)); color: hsl(var(--warnung-fg)); }
.ergebnis-titel { font-size: 1.25rem; }
.ergebnis-text { margin-top: 0.5rem; max-width: 30rem; color: hsl(var(--muted-foreground)); overflow-wrap: anywhere; }
.ergebnis-text strong { color: hsl(var(--foreground)); font-weight: 500; }
.ergebnis .hilfe { margin-top: 1rem; max-width: 30rem; }
.ergebnis-aktionen { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; }
.honigtopf { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.dl-gestapelt { grid-template-columns: minmax(0, 1fr) !important; gap: 0.125rem 0; }
.dl-gestapelt dd + dt { margin-top: 0.625rem; }
.skelett-kurz { width: 40%; }
.skelett-mittel { width: 70%; }

/* Galerie (nur Entwicklung) */
.galerie-nav { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 2rem; }
.galerie-nav a { padding: 0.25rem 0.625rem; border-radius: 999px; background: hsl(var(--foreground) / 0.05); font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }
.galerie-nav a:hover { color: hsl(var(--foreground)); background: hsl(var(--accent)); }
.galerie-abschnitt { scroll-margin-top: calc(var(--kopf-hoehe) + 1rem); }
.galerie-abschnitt + .galerie-abschnitt { margin-top: 3.5rem; }
.galerie-titel { font-size: 1.125rem; font-weight: 600; }
.galerie-text { margin: 0.25rem 0 1.25rem; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.galerie-text code { font-size: 0.8125rem; }
.galerie-flaeche { padding: 1.5rem; border: 1px solid var(--karten-rand); border-radius: calc(var(--radius) + 4px); background: hsl(var(--card)); box-shadow: var(--karten-schatten); }
.galerie-flaeche-grau { background: hsl(var(--flaeche)); }
.galerie-zweispaltig { display: grid; gap: 1.5rem 2.5rem; }
@media (min-width: 768px) { .galerie-zweispaltig { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.galerie-zahlenliste { margin-top: 0.75rem; grid-template-columns: minmax(0, 1fr) auto !important; }
.galerie-zahlenliste dt { color: hsl(var(--foreground)); }
.galerie-zahlenliste dd { text-align: right; }
.galerie-chips { flex-basis: 100%; margin: 0; }

/* ---------- 6 Utilities (sparsam) ---------------------------------------- */
.sr-only, .nur-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.springen { position: absolute; left: 0.75rem; top: -3rem; z-index: 200; padding: 0.5rem 0.875rem; border-radius: var(--radius); background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-size: 0.875rem; font-weight: 500; }
.springen:focus { top: 0.75rem; }
.gedaempft { color: hsl(var(--muted-foreground)); }
.klein { font-size: 0.8125rem; }
.fett { font-weight: 600; }
.zahlen { font-variant-numeric: tabular-nums; }
.stapel { display: flex; flex-direction: column; gap: 1rem; }
.stapel-eng { display: flex; flex-direction: column; gap: 0.5rem; }
.stapel-weit { display: flex; flex-direction: column; gap: 1.5rem; }
.reihe { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.reihe-weit { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.zwischen { justify-content: space-between; }
.rechts { margin-left: auto; }
.text-rechts { text-align: right; }
.voll { width: 100%; }
.abstand-oben { margin-top: 1.5rem; }
.abstand-unten { margin-bottom: 1.5rem; }
.trenner { height: 1px; background: hsl(var(--linie)); margin: 1.5rem 0; }
.abschneiden { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nur-druck { display: none !important; }
@media (min-width: 1024px) { .nur-mobil { display: none !important; } }

/* ---------- 7 Druck ------------------------------------------------------- */
@media print {
  @page { margin: 1.5cm 1.2cm; }
  :root { --background: 0 0% 100%; --foreground: 0 0% 0%; --card: 0 0% 100%; --muted: 0 0% 96%; --muted-foreground: 0 0% 35%; --border: 0 0% 80%; }
  body { font-size: 10pt; background: #fff !important; color: #000; }
  .seitenleiste, .seitenleiste-schleier, .kopfzeile, .toaster, .aktionsleiste, .filterleiste, .seitennav, .seitenkopf-aktionen,
  .kein-druck, .btn, .zelle-auswahl, .zelle-aktionen, .oe-kopf, .oe-fuss, .galerie-nav, dialog { display: none !important; }
  .nur-druck { display: block !important; }
  .admin-rahmen { display: block; }
  .inhalt { max-width: none; padding: 0; }
  .card, .tabelle-rahmen, .kennzahl { box-shadow: none; break-inside: avoid; }
  .tabelle-rahmen { overflow: visible; max-height: none !important; border: 0; }
  .tabelle { font-size: 8.5pt; }
  .tabelle th, .tabelle td { padding: 0.3rem 0.4rem; }
  .tabelle thead th { position: static; box-shadow: none; border-bottom: 1px solid #000; color: #000; }
  .tabelle thead { display: table-header-group; }
  .tabelle tr { break-inside: avoid; }
  .tabelle tbody tr:hover, .tabelle tbody tr:has(.checkbox:checked) { background: none; }
  .badge { border: 1px solid #999 !important; background: none !important; color: #000 !important; }
  .th-sort .icon { display: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
