/* ehda.AI Design-System (Ticket 31): Gestaltungssprache von shadcn/ui ("zinc"/neutral) in reinem CSS, ohne React, Tailwind oder Node-Build.
   Diese Datei steht in allen Layouts VOR dem Seiten-CSS (chat.css, telefon.css, gemeinde.css, live.css). Sie enthaelt
     1. Schrift (selbst gehostet, Inter, SIL OFL; Datei und Lizenz unter /fonts),
     2. Design Tokens (hell, dunkel per prefers-color-scheme, zusaetzlich :root[data-theme="light|dark"]),
     3. einen kleinen Reset und den Grundstil der HTML-Elemente (ersetzt Pico CSS; alle Grundregeln stehen in :where(), haben also Spezifitaet 0
        und werden von jeder Klasse ueberschrieben),
     4. wiederverwendbare Komponenten: Button, Input/Textarea/Select, Label, Card, Badge, Separator, Tabs, Dialog, Alert, Table, Avatar,
        Skeleton, Tooltip, Kbd, Scroll-Optik, Symbole.
   Farben stehen NUR als Tokens hier; Seiten-CSS nimmt var(--...) und erfindet keine eigenen Farben. Kontraste (WCAG 2.x) rechnet
   tests/Unit/DesignTokenTest.php aus diesen Werten: Text mindestens 4,5:1, Bedienelemente und Fokus mindestens 3:1. Zustaende tragen immer
   auch ein Wort oder Symbol, nie nur Farbe. Keine externen Ressourcen (CSP: default-src 'self'). */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2-variations"), url("/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Tokens: hell --------------------------------------------------------------------------------------------------------------------------- */
:root {
  color-scheme: light;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: .625rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --ease: 150ms cubic-bezier(.4, 0, .2, 1);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .08), 0 2px 4px -2px rgb(0 0 0 / .06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .12), 0 4px 6px -4px rgb(0 0 0 / .08);
  --overlay: rgb(9 9 11 / .55);
  --ziel: 2.75rem; /* Touch-Ziel, mindestens 44 px */

  --background: #ffffff;
  --foreground: #09090b;
  --canvas: #f4f4f5;                 /* Flaeche hinter Karten (Gemeinde, Buehne) */
  --card: #ffffff;
  --card-foreground: #09090b;
  --popover: #ffffff;
  --popover-foreground: #09090b;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --primary-hover: #3f3f46;
  --primary-foreground-muted: #d4d4d8; /* gedaempfter Text auf Primary (Zeitstempel in der Blase der Person) */
  --secondary: #f4f4f5;
  --secondary-foreground: #18181b;
  --muted: #f4f4f5;
  --muted-foreground: #52525b;
  --accent: #f4f4f5;
  --accent-foreground: #18181b;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --destructive-text: #b91c1c;        /* Text und Rand in Fehlerfarbe auf --background */
  --border: #e4e4e7;                   /* feine Trennlinien (dekorativ) */
  --input: #85858f;                    /* Rand von Bedienelementen, mindestens 3:1 */
  --ring: #52525b;                     /* Fokus-Ring, mindestens 3:1 */
  --scroll: #d4d4d8;

  /* Status (Badge-Varianten und Alerts): Hintergrund / Schrift, jeweils mindestens 4,5:1 */
  --success-bg: #dcfce7;  --success-fg: #166534;
  --warning-bg: #fef3c7;  --warning-fg: #854d0e;
  --danger-bg: #fee2e2;   --danger-fg: #991b1b;
  --info-bg: #dbeafe;     --info-fg: #1e40af;
  --violet-bg: #ede9fe;   --violet-fg: #5b21b6;
  --cyan-bg: #cffafe;     --cyan-fg: #155e75;
}

/* ---- Tokens: dunkel (System) und erzwungen ------------------------------------------------------------------------------------------------ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .5), 0 2px 4px -2px rgb(0 0 0 / .4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .6), 0 4px 6px -4px rgb(0 0 0 / .5);
    --overlay: rgb(0 0 0 / .7);
    --background: #09090b;
    --foreground: #fafafa;
    --canvas: #09090b;
    --card: #121214;
    --card-foreground: #fafafa;
    --popover: #18181b;
    --popover-foreground: #fafafa;
    --primary: #fafafa;
    --primary-foreground: #18181b;
    --primary-hover: #d4d4d8;
    --primary-foreground-muted: #52525b;
    --secondary: #27272a;
    --secondary-foreground: #fafafa;
    --muted: #27272a;
    --muted-foreground: #a1a1aa;
    --accent: #27272a;
    --accent-foreground: #fafafa;
    --destructive: #dc2626;
    --destructive-foreground: #ffffff;
    --destructive-text: #f87171;
    --border: #27272a;
    --input: #71717a;
    --ring: #a1a1aa;
    --scroll: #3f3f46;
    --success-bg: #052e16;  --success-fg: #86efac;
    --warning-bg: #422006;  --warning-fg: #fcd34d;
    --danger-bg: #450a0a;   --danger-fg: #fca5a5;
    --info-bg: #172554;     --info-fg: #93c5fd;
    --violet-bg: #2e1065;   --violet-fg: #c4b5fd;
    --cyan-bg: #083344;     --cyan-fg: #67e8f9;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .5), 0 2px 4px -2px rgb(0 0 0 / .4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .6), 0 4px 6px -4px rgb(0 0 0 / .5);
  --overlay: rgb(0 0 0 / .7);
  --background: #09090b;
  --foreground: #fafafa;
  --canvas: #09090b;
  --card: #121214;
  --card-foreground: #fafafa;
  --popover: #18181b;
  --popover-foreground: #fafafa;
  --primary: #fafafa;
  --primary-foreground: #18181b;
  --primary-hover: #d4d4d8;
  --primary-foreground-muted: #52525b;
  --secondary: #27272a;
  --secondary-foreground: #fafafa;
  --muted: #27272a;
  --muted-foreground: #a1a1aa;
  --accent: #27272a;
  --accent-foreground: #fafafa;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --destructive-text: #f87171;
  --border: #27272a;
  --input: #71717a;
  --ring: #a1a1aa;
  --scroll: #3f3f46;
  --success-bg: #052e16;  --success-fg: #86efac;
  --warning-bg: #422006;  --warning-fg: #fcd34d;
  --danger-bg: #450a0a;   --danger-fg: #fca5a5;
  --info-bg: #172554;     --info-fg: #93c5fd;
  --violet-bg: #2e1065;   --violet-fg: #c4b5fd;
  --cyan-bg: #083344;     --cyan-fg: #67e8f9;
}

/* ---- Reset und Grundstil (alles in :where(), Spezifitaet 0) --------------------------------------------------------------------------------- */
:where(*, *::before, *::after) { box-sizing: border-box; }
:where(html) { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-size: 100%; }
:where(body) {
  margin: 0; background: var(--background); color: var(--foreground);
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.5; font-feature-settings: "rlig" 1, "calt" 1; font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
:where([hidden]) { display: none !important; }
:where(h1, h2, h3, h4, h5, h6) { margin: 0 0 .75rem; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; color: var(--foreground); }
:where(h1) { font-size: 1.875rem; font-weight: 700; letter-spacing: -.03em; }
:where(h2) { font-size: 1.5rem; }
:where(h3) { font-size: 1.25rem; }
:where(h4) { font-size: 1.0625rem; }
:where(h5, h6) { font-size: 1rem; }
:where(p, ul, ol, dl, form, table, figure, blockquote, pre, fieldset) { margin: 0 0 1rem; }
:where(ul, ol) { padding-left: 1.25rem; }
:where(li) { margin: 0; }
:where(dd) { margin-left: 0; }
:where(small) { font-size: .875em; }
:where(strong, b) { font-weight: 600; }
:where(a) { color: var(--foreground); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 4px; transition: text-decoration-color var(--ease), color var(--ease); }
:where(a:hover) { text-decoration-color: currentColor; }
:where(code, kbd, samp, pre) { font-family: var(--font-mono); font-size: .875em; }
:where(code) { padding: .1em .35em; border-radius: var(--radius-sm); background: var(--muted); }
:where(pre) { padding: .75rem 1rem; overflow: auto; border-radius: var(--radius-md); background: var(--muted); }
:where(pre code) { padding: 0; background: none; }
:where(blockquote) { padding: .25rem 0 .25rem 1rem; border-left: 2px solid var(--border); }
:where(mark) { background: var(--warning-bg); color: var(--warning-fg); border-radius: 2px; }
:where(img, svg, video) { max-width: 100%; }
:where(hr) { height: 1px; margin: 1.5rem 0; border: 0; background: var(--border); }
:where(details > summary) { cursor: pointer; font-weight: 500; }
:where(::selection) { background: color-mix(in srgb, var(--foreground) 18%, transparent); }
:where(:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }
:where(:focus:not(:focus-visible)) { outline: none; }
:where(.container) { width: 100%; max-width: 44rem; margin-inline: auto; padding-inline: 1rem; }
:where(.container-fluid) { width: 100%; padding-inline: 1rem; }
.nur-screenreader, .visually-hidden, .sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.klein { font-size: .875rem; color: var(--muted-foreground); }
.muted { color: var(--muted-foreground); }
.demo-hinweis { padding: .25rem 1rem; text-align: right; font-size: .75rem; letter-spacing: .04em; color: var(--muted-foreground); }
.statustext { font-size: 1.125rem; }
dl.angaben { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .25rem 1.25rem; }
dl.angaben dt { font-weight: 500; color: var(--muted-foreground); }
dl.angaben dd { margin: 0; overflow-wrap: anywhere; }

/* Einfache Seiten (Fehlerseite, Telegram-Seite): schmale Karte unter dem Seitenkopf */
main.container { padding-top: 1.5rem; padding-bottom: 1rem; }
.card.seite-karte { max-width: 28rem; margin: 8vh auto 1.5rem; }
.seite-karte .card-header { padding-top: 1.5rem; }
.seite-karte .card-footer { padding-top: 1.5rem; }
.seite-karte .card-title { font-size: 1.5rem; }

/* Scroll-Optik: duenne, ruhige Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--input); background-clip: content-box; }

/* ---- Label, Input, Textarea, Select ---------------------------------------------------------------------------------------------------------- */
:where(label) { display: block; margin: 0 0 1rem; font-size: .875rem; font-weight: 500; line-height: 1.4; }
:where(label > :is(input, select, textarea)) { margin-top: .375rem; }
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="hidden"], [type="submit"], [type="button"], [type="reset"]), select, textarea),
.input {
  display: block; width: 100%; min-height: 2.5rem; margin: 0 0 1rem; padding: .5rem .75rem;
  border: 1px solid var(--input); border-radius: var(--radius-md); background: var(--background); color: var(--foreground);
  font: inherit; font-size: .9375rem; font-weight: 400; line-height: 1.4; box-shadow: var(--shadow-sm);
  transition: border-color var(--ease), box-shadow var(--ease); -webkit-appearance: none; appearance: none;
}
:where(textarea) { min-height: 5rem; resize: vertical; }
:where(input, select, textarea)::placeholder { color: var(--muted-foreground); opacity: 1; }
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="submit"], [type="button"], [type="reset"]), select, textarea):focus-visible,
.input:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; border-color: var(--ring); }
:where(input, select, textarea)[aria-invalid="true"] { border-color: var(--destructive-text); }
:where(input, select, textarea):disabled { opacity: .55; cursor: not-allowed; }
:where(select) {
  padding-right: 2.25rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2385858f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; background-size: 1rem;
}
:where(input[type="search"]) {
  padding-left: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2385858f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left .7rem center; background-size: 1rem;
}
:where(input[type="checkbox"], input[type="radio"]) { width: 1rem; height: 1rem; margin: 0 .5rem 0 0; accent-color: var(--primary); vertical-align: -.15em; }
:where(input[type="file"]) { font: inherit; font-size: .875rem; }
:where(progress) { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: .5rem; border: 0; border-radius: 999px; background: var(--muted); overflow: hidden; color: var(--primary); }
:where(progress)::-webkit-progress-bar { background: var(--muted); border-radius: 999px; }
:where(progress)::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
:where(progress)::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
.field-hint, label + small, :where(form small) { color: var(--muted-foreground); }
:where(label + small) { display: block; margin: -.5rem 0 1rem; }
:where(input, select, textarea)[aria-invalid="true"] + small { color: var(--destructive-text); }

/* ---- Button (default, secondary, outline, ghost, destructive, link; sm, lg, icon) ------------------------------------------------------------ */
:where(button, [type="button"], [type="submit"], [type="reset"], [role="button"]), .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.5rem; margin: 0; padding: .5rem 1rem;
  border: 1px solid transparent; border-radius: var(--radius-md); background: var(--primary); color: var(--primary-foreground);
  font: inherit; font-size: .875rem; font-weight: 500; line-height: 1.25; text-align: center; text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: background-color var(--ease), color var(--ease), border-color var(--ease), box-shadow var(--ease);
  -webkit-appearance: none; appearance: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
:where(button, [type="button"], [type="submit"], [type="reset"], [role="button"]):hover, .btn:hover { background: var(--primary-hover); color: var(--primary-foreground); }
:where(button, [type="button"], [type="submit"], [role="button"]):disabled, .btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
:where(button, [role="button"]) :where(svg), .btn svg { flex: none; }
/* Pico-Namen bleiben gueltig: .secondary = secondary, .outline = outline */
:where(.secondary, .btn-secondary):is(button, [type="submit"], [type="button"], [role="button"], .btn) { background: var(--secondary); color: var(--secondary-foreground); border-color: transparent; }
:where(.secondary, .btn-secondary):is(button, [type="submit"], [type="button"], [role="button"], .btn):hover { background: color-mix(in srgb, var(--secondary-foreground) 10%, var(--secondary)); color: var(--secondary-foreground); }
:where(.outline, .btn-outline):is(button, [type="submit"], [type="button"], [role="button"], .btn),
:where(.secondary.outline):is(button, [type="submit"], [type="button"], [role="button"], .btn) { background: var(--background); color: var(--foreground); border-color: var(--input); }
:where(.outline, .btn-outline):is(button, [type="submit"], [type="button"], [role="button"], .btn):hover { background: var(--accent); color: var(--accent-foreground); }
.btn-ghost, .btn-ghost:is(button, [role="button"]) { background: transparent; color: var(--foreground); box-shadow: none; }
.btn-ghost:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-destructive, .btn-destructive:is(button, [role="button"]) { background: var(--destructive); color: var(--destructive-foreground); }
.btn-destructive:hover { background: color-mix(in srgb, var(--destructive) 88%, #000); color: var(--destructive-foreground); }
.btn-link, .btn-link:is(button, [role="button"]) { background: transparent; color: var(--foreground); box-shadow: none; text-decoration: underline; text-underline-offset: 4px; padding-inline: .25rem; }
.btn-link:hover { background: transparent; color: var(--foreground); text-decoration-thickness: 2px; }
.btn-sm { min-height: 2rem; padding: .25rem .75rem; font-size: .8125rem; }
.btn-lg { min-height: var(--ziel); padding: .5rem 2rem; font-size: .9375rem; }
.btn-icon { width: 2.5rem; min-height: 2.5rem; padding: 0; }
.btn-block { display: flex; width: 100%; }
@media (max-width: 599px) {
  :where(button, [type="button"], [type="submit"], [role="button"]), .btn { min-height: var(--ziel); }
  .btn-sm { min-height: var(--ziel); }
  .btn-icon { width: var(--ziel); }
}

/* ---- Card ----------------------------------------------------------------------------------------------------------------------------------- */
.card, :where(article) {
  margin: 0 0 1rem; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); color: var(--card-foreground); box-shadow: var(--shadow-sm);
}
.card-header { display: flex; flex-direction: column; gap: .25rem; padding: 1.5rem 1.5rem 0; }
.card-title { margin: 0; font-size: 1.125rem; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.card-description { margin: 0; font-size: .875rem; color: var(--muted-foreground); }
.card-content { padding: 1.5rem; }
.card-header + .card-content { padding-top: 1rem; }
.card-footer { display: flex; align-items: center; gap: .5rem; padding: 0 1.5rem 1.5rem; }

/* ---- Badge (default, secondary, outline, destructive; Status; Prioritaet) ------------------------------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: .25rem; padding: .125rem .625rem; border: 1px solid transparent; border-radius: 999px;
  background: var(--primary); color: var(--primary-foreground); font-size: .75rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.badge-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.badge-outline { background: transparent; color: var(--foreground); border-color: var(--input); }
.badge-destructive { background: var(--destructive); color: var(--destructive-foreground); }
.badge-success { background: var(--success-bg); color: var(--success-fg); border-color: color-mix(in srgb, var(--success-fg) 22%, transparent); }
.badge-warning { background: var(--warning-bg); color: var(--warning-fg); border-color: color-mix(in srgb, var(--warning-fg) 22%, transparent); }
.badge-danger { background: var(--danger-bg); color: var(--danger-fg); border-color: color-mix(in srgb, var(--danger-fg) 22%, transparent); }
.badge-info { background: var(--info-bg); color: var(--info-fg); border-color: color-mix(in srgb, var(--info-fg) 22%, transparent); }
.badge-violet { background: var(--violet-bg); color: var(--violet-fg); border-color: color-mix(in srgb, var(--violet-fg) 22%, transparent); }
.badge-cyan { background: var(--cyan-bg); color: var(--cyan-fg); border-color: color-mix(in srgb, var(--cyan-fg) 22%, transparent); }

/* ---- Separator ------------------------------------------------------------------------------------------------------------------------------ */
.separator { height: 1px; width: 100%; margin: 1rem 0; border: 0; background: var(--border); }
.separator-vertical { width: 1px; height: auto; align-self: stretch; margin: 0 .5rem; }

/* ---- Tabs (Liste von Links oder Knoepfen; aktiv: aria-selected="true" oder aria-current) ----------------------------------------------------------- */
.tabs-list { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .125rem; margin: 0; padding: .25rem; list-style: none; border-radius: var(--radius-md); background: var(--muted); }
.tabs-list > li { margin: 0; padding: 0; list-style: none; }
.tabs-trigger {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem; min-height: 2rem; padding: .25rem .75rem; margin: 0; border: 0; border-radius: calc(var(--radius-md) - 2px);
  background: transparent; color: var(--muted-foreground); font: inherit; font-size: .875rem; font-weight: 500; white-space: nowrap; text-decoration: none; cursor: pointer; box-shadow: none;
  transition: background-color var(--ease), color var(--ease), box-shadow var(--ease);
}
.tabs-trigger:hover { color: var(--foreground); background: transparent; }
.tabs-trigger[aria-selected="true"], .tabs-trigger[aria-current] { background: var(--background); color: var(--foreground); box-shadow: var(--shadow-sm); }
@media (max-width: 599px) { .tabs-trigger { min-height: var(--ziel); } }
@media (max-width: 599px) { :where(details > summary) { padding-block: .65rem; } }

/* ---- Dialog (natives <dialog>) ---------------------------------------------------------------------------------------------------------------- */
:where(dialog) {
  width: min(32rem, calc(100vw - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); margin: auto; padding: 1.5rem; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--popover); color: var(--popover-foreground); box-shadow: var(--shadow-lg);
}
:where(dialog)::backdrop { background: var(--overlay); }
:where(dialog > article) { margin: 0; border: 0; box-shadow: none; background: transparent; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dialog-title { margin: 0; font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; }
.dialog-description { margin: .25rem 0 0; font-size: .875rem; color: var(--muted-foreground); }
.dialog-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }

/* ---- Alert (default, destructive, success, warning, info) ----------------------------------------------------------------------------------------- */
.alert {
  display: block; margin: 0 0 1rem; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); color: var(--card-foreground);
  font-size: .875rem; line-height: 1.5;
}
.alert-title { display: block; margin: 0 0 .125rem; font-weight: 600; letter-spacing: -.01em; }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert-destructive { background: var(--danger-bg); color: var(--danger-fg); border-color: color-mix(in srgb, var(--danger-fg) 35%, transparent); }
.alert-success { background: var(--success-bg); color: var(--success-fg); border-color: color-mix(in srgb, var(--success-fg) 35%, transparent); }
.alert-warning { background: var(--warning-bg); color: var(--warning-fg); border-color: color-mix(in srgb, var(--warning-fg) 35%, transparent); }
.alert-info { background: var(--info-bg); color: var(--info-fg); border-color: color-mix(in srgb, var(--info-fg) 35%, transparent); }
.alert-destructive a, .alert-success a, .alert-warning a, .alert-info a { color: inherit; }
.alert-mit-symbol { display: grid; grid-template-columns: 1rem minmax(0, 1fr); gap: 0 .75rem; align-items: start; }
.alert-mit-symbol > .symbol { margin-top: .2rem; }

/* ---- Table (zart, Zeilenhover, sticky Kopf) --------------------------------------------------------------------------------------------------- */
:where(table) { width: 100%; border-collapse: collapse; font-size: .875rem; }
:where(caption) { padding: 0 0 .5rem; text-align: left; caption-side: top; font-size: .8125rem; color: var(--muted-foreground); }
:where(th, td) { padding: .625rem .5rem; text-align: left; vertical-align: middle; }
:where(thead th) { height: 2.5rem; font-size: .8125rem; font-weight: 500; color: var(--muted-foreground); border-bottom: 1px solid var(--border); }
:where(tbody tr) { border-top: 1px solid var(--border); transition: background-color var(--ease); }
:where(tbody tr:first-child) { border-top: 0; }
:where(tbody tr:hover) { background: color-mix(in srgb, var(--muted) 55%, transparent); }
:where(tbody th) { font-weight: 500; }
.table-sticky thead th { position: sticky; top: 0; z-index: 1; background: var(--card); }
.table-wrap, .tabelle { overflow-x: auto; }

/* ---- Avatar (Initialen), Skeleton, Tooltip, Kbd ------------------------------------------------------------------------------------------------ */
.avatar { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--primary); color: var(--primary-foreground); font-size: .875rem; font-weight: 600; letter-spacing: .02em; overflow: hidden; }
.avatar-muted { background: var(--muted); color: var(--muted-foreground); }
.skeleton { display: block; min-height: 1rem; border-radius: var(--radius-md); background: var(--muted); animation: ui-skeleton 2s ease-in-out infinite; }
@keyframes ui-skeleton { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; z-index: 50; left: 50%; bottom: calc(100% + .4rem); transform: translateX(-50%); width: max-content; max-width: 16rem; padding: .3rem .6rem;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--popover); color: var(--popover-foreground); box-shadow: var(--shadow-md);
  font-size: .75rem; font-weight: 500; line-height: 1.35; white-space: normal; text-align: center; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity var(--ease);
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; visibility: visible; }
:where(kbd), .kbd { display: inline-block; min-width: 1.4rem; padding: .05rem .4rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: var(--radius-sm); background: var(--muted); color: var(--muted-foreground); font-size: .75rem; font-weight: 500; text-align: center; }

/* ---- Symbole (Inline-SVG aus templates/ui_symbole.html.twig) ------------------------------------------------------------------------------------ */
.symbol { flex: none; vertical-align: -.15em; } /* Groesse: Attribut width/height des SVG (Makro icon(name, groesse)) */

/* ---- Bewegung, hoher Kontrast ---------------------------------------------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .skeleton { animation: none; }
}
@media (forced-colors: active) {
  :where(button, [role="button"]), .btn, .badge, .tabs-trigger, .alert, .card, :where(article), :where(dialog), :where(input, select, textarea) { border: 1px solid ButtonText; }
  :where(:focus-visible) { outline: 2px solid Highlight; }
  .badge, .alert { forced-color-adjust: auto; }
  .tabs-trigger[aria-selected="true"], .tabs-trigger[aria-current] { outline: 2px solid Highlight; }
  .avatar { border: 1px solid ButtonText; }
}
