/* ==========================================================================
   matchDesk UI-Kit · Basis, Typografie, Icons, Aktionen, Eingaben, Status
   Klassen-API: Block md-x, Teil md-x-teil, Variante md-x--variante.
   Zustände über ARIA/HTML (aria-current, aria-selected, aria-pressed,
   aria-invalid, aria-busy, disabled), damit Aussehen und Zugänglichkeit
   nicht auseinanderlaufen können.

   Quelle ist seit HAN-5998 diese Datei (die Entwurfskopie in docs/ui-neubau/kit/
   ist eingefroren).

   ÜBERGANG: Die globalen Element-Regeln (*, html, body, img, svg, button, input,
   ::selection, Fokus, [hidden], reduzierte Bewegung) gelten nur unter .md-root.
   Sonst würden sie alte ads-*-Bildschirme verändern, etwa die Inline-SVG-Icons
   (display: block), Schriften von Feldern oder das Verhalten von [hidden].
   :where() hält die Spezifität so niedrig wie bei den globalen Regeln des Entwurfs,
   Komponentenklassen gewinnen also wie bisher. .md-root ist <body> oder ein Container
   (nie <html>: dessen font-size verschöbe alle rem-Werte) und übernimmt die Regeln
   von body (Fläche, Schrift, Farbe). Rahmen und umgebaute Bildschirme tragen
   .md-root. Mit dem Aufräumen (Phase 6b) werden die Selektoren wieder global.
   ========================================================================== */

:where(.md-root), :where(.md-root) *, :where(.md-root) *::before, :where(.md-root) *::after { box-sizing: border-box; }
:where(.md-root) {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  margin: 0;
  font-family: var(--md-font-sans);
  font-size: var(--md-fs-body);
  line-height: var(--md-lh-body);
  color: var(--md-text);
  background: var(--md-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Startwerte für Vererbtes: im Übergang steht .md-root in einem body, das der Bestand formt
     (body.ads-layout, etwa letter-spacing). Eigenständig, wie das body des Entwurfs. */
  letter-spacing: normal; word-spacing: normal; text-transform: none; font-style: normal; font-weight: 400; text-align: start;
}
:where(.md-root) :is(img, svg) { display: block; max-width: 100%; }
:where(.md-root) :is(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.md-root)::selection, :where(.md-root) ::selection { background: var(--md-pink-200); color: var(--md-ink-900); }

:where(.md-root) :where(a, button, summary, [tabindex], input[type="checkbox"], input[type="radio"]):focus-visible {
  outline: 2px solid var(--md-focus);
  outline-offset: 2px;
}

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

:where(.md-root)[hidden], :where(.md-root) [hidden] { display: none !important; }

.md-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Icons (Lucide, gepinnt und selbst gehostet) --------------------------
   Größen-Varianten mit doppelter Klasse: Lucide liefert sein SVG mit der Klasse
   "lucide", und style.css gibt jedem svg.lucide eine Größe (Spezifität 0,1,1),
   die eine einfache Variante (0,1,0) überstimmen würde. Kontextregeln wie
   .md-btn .md-icon (0,2,0) stehen weiter unten und gewinnen wie bisher. */
.md-icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.md-icon.md-icon--xs { width: 14px; height: 14px; stroke-width: 2; }
.md-icon.md-icon--sm { width: 16px; height: 16px; }
.md-icon.md-icon--lg { width: 20px; height: 20px; }
.md-icon.md-icon--xl { width: 24px; height: 24px; stroke-width: 1.5; }

/* --- Typografie ------------------------------------------------------------ */
.md-display { margin: 0; font-size: var(--md-fs-display); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: var(--md-text-strong); }
.md-h1 { margin: 0; font-size: var(--md-fs-h1); line-height: 1.25; font-weight: 700; letter-spacing: var(--md-tracking-title); color: var(--md-text-strong); }
.md-h2 { margin: 0; font-size: var(--md-fs-h2); line-height: 1.35; font-weight: 700; letter-spacing: -.01em; color: var(--md-text-strong); }
.md-h3 { margin: 0; font-size: var(--md-fs-h3); line-height: 1.4; font-weight: 700; color: var(--md-text-strong); }
.md-lead { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--md-text-muted); max-width: 62ch; }
.md-p { margin: 0; max-width: 72ch; }
.md-label {
  font-family: var(--md-font-mono); font-size: var(--md-fs-label); font-weight: 500;
  letter-spacing: var(--md-tracking-label); text-transform: uppercase;
  line-height: 1.4; color: var(--md-text-muted);
}
.md-small { font-size: var(--md-fs-small); line-height: 1.5; }
.md-mono { font-family: var(--md-font-mono); font-size: .93em; letter-spacing: 0; }
.md-num { font-variant-numeric: tabular-nums; }
.md-nowrap { white-space: nowrap; }
.md-link {
  color: inherit; font-weight: 600; text-decoration: underline;
  text-decoration-color: var(--md-line-strong); text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: text-decoration-color var(--md-dur-1) var(--md-ease);
}
.md-link:hover { text-decoration-color: currentColor; }
/* Link, der schon durch seinen Ort als Link erkennbar ist (Hauptzelle einer Tabellenzeile, Fußzeile): Strich erst beim Zeigen */
.md-link--plain { font-weight: inherit; text-decoration-line: none; }
.md-link--plain:hover { text-decoration-line: underline; }
/* Farb- und Gewichtshilfen nach den Links, damit sie auch an einem Link gelten */
.md-muted { color: var(--md-text-muted); }
.md-strong { font-weight: 600; color: var(--md-text-strong); }
.md-kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  font-family: var(--md-font-mono); font-size: 11px; font-weight: 500; color: var(--md-text-muted);
  background: var(--md-bg-surface); border: 1px solid var(--md-line-strong); border-bottom-width: 2px;
  border-radius: var(--md-radius-xs);
}

/* --- Fehlerzusammenfassung über einem Formular (nach dem Absenden, Fokus hierher) */
.md-errorsummary { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--md-radius-md); background: var(--md-danger-bg); border: 1px solid var(--md-danger-line); }
.md-errorsummary-title { display: flex; gap: 8px; align-items: center; font-weight: 700; color: var(--md-text-strong); }
.md-errorsummary-title .md-icon { color: var(--md-danger-fg); }
.md-errorsummary ul { margin: 0; padding-left: 26px; display: grid; gap: 4px; font-size: var(--md-fs-small); }
.md-errorsummary a { color: var(--md-danger-fg); font-weight: 600; text-underline-offset: 3px; }

/* --- Layout-Grundformen ----------------------------------------------------- */
.md-stack { display: flex; flex-direction: column; gap: var(--_gap, var(--md-space-4)); }
.md-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--_gap, var(--md-space-2)); }
.md-spread { display: flex; align-items: center; justify-content: space-between; gap: var(--md-space-4); flex-wrap: wrap; }
.md-grid { display: grid; gap: var(--md-gap); grid-template-columns: repeat(auto-fit, minmax(var(--_min, 260px), 1fr)); }
.md-divider { height: 1px; background: var(--md-line-soft); border: 0; margin: 0; }

/* ==========================================================================
   Aktionen
   Rangfolge je Ansicht: höchstens EIN Primärbutton. Sekundär für weitere
   Aktionen, Ghost für Nebenaktionen, Rest ins Überlaufmenü.
   ========================================================================== */
.md-btn {
  --_h: var(--md-control-h);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--md-space-2);
  height: var(--_h); min-width: var(--_h); padding: 0 var(--md-control-px);
  border: 1px solid transparent; border-radius: var(--md-radius-control);
  font-size: var(--md-fs-body); font-weight: 600; line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer; user-select: none; background: transparent; color: var(--md-text);
  transition: background-color var(--md-dur-1) var(--md-ease), border-color var(--md-dur-1) var(--md-ease),
              color var(--md-dur-1) var(--md-ease), transform var(--md-dur-1) var(--md-ease), box-shadow var(--md-dur-1) var(--md-ease);
}
.md-btn .md-icon { width: 16px; height: 16px; }
.md-btn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px); }

.md-btn--primary { background: var(--md-accent); color: var(--md-text-on-accent); box-shadow: var(--md-shadow-accent); }
.md-btn--primary:hover { background: var(--md-accent-hover); }
.md-btn--primary:active { background: var(--md-accent-press); }

.md-btn--secondary { background: var(--md-bg-surface); color: var(--md-text-strong); border-color: var(--md-line-strong); }
.md-btn--secondary:hover { background: var(--md-bg-subtle); border-color: var(--md-ink-400); }

.md-btn--ghost { color: var(--md-text); }
.md-btn--ghost:hover { background: var(--md-bg-hover); color: var(--md-text-strong); }

.md-btn--danger { background: var(--md-danger-solid); color: var(--md-text-on-solid); }
.md-btn--danger:hover { filter: brightness(.92); }
.md-btn--danger-quiet { color: var(--md-danger-fg); border-color: var(--md-danger-line); background: var(--md-bg-surface); }
.md-btn--danger-quiet:hover { background: var(--md-danger-bg); }

.md-btn--sm { --_h: var(--md-control-h-sm); padding: 0 12px; font-size: var(--md-fs-small); gap: 6px; border-radius: var(--md-radius-control-sm); }
.md-btn--lg { --_h: 48px; padding: 0 24px; font-size: .9375rem; border-radius: 11px; }
.md-btn--icon { padding: 0; width: var(--_h); }
.md-btn--block { width: 100%; }

.md-btn:disabled, .md-btn[aria-disabled="true"] {
  cursor: not-allowed; background: var(--md-bg-sunken); color: var(--md-text-disabled);
  border-color: transparent; box-shadow: none; filter: none;
}
.md-btn--ghost:disabled { background: transparent; }

/* Laufender Vorgang: Beschriftung bleibt stehen, damit die Breite nicht springt */
.md-btn[aria-busy="true"] { cursor: progress; }
.md-btn[aria-busy="true"] .md-icon--spin { animation: md-spin 900ms linear infinite; }
@keyframes md-spin { to { transform: rotate(360deg); } }

.md-btn-group { display: inline-flex; gap: var(--md-space-2); align-items: center; flex-wrap: wrap; }

/* ==========================================================================
   Eingaben
   Label steht immer über dem Feld. Pflicht ist der Normalfall, optionale
   Felder tragen „(optional)". Fehler stehen unter dem Feld, mit Icon.
   ========================================================================== */
.md-field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.md-field-label { display: flex; align-items: baseline; gap: 6px; font-size: var(--md-fs-small); font-weight: 600; color: var(--md-text-strong); }
.md-field-optional { font-weight: 400; color: var(--md-text-muted); }
.md-field-help { font-size: var(--md-fs-small); line-height: 1.45; color: var(--md-text-muted); }
.md-field-error { display: flex; gap: 6px; align-items: flex-start; font-size: var(--md-fs-small); line-height: 1.45; font-weight: 500; color: var(--md-danger-fg); }
.md-field-error .md-icon { width: 15px; height: 15px; margin-top: 2px; }

.md-input, .md-textarea, .md-select select {
  width: 100%; min-width: 0; height: var(--md-control-h); padding: 0 12px;
  font-size: var(--md-fs-body); color: var(--md-text-strong);
  background: var(--md-bg-field); border: 1px solid var(--md-line-field); border-radius: var(--md-radius-field);
  transition: border-color var(--md-dur-1) var(--md-ease), box-shadow var(--md-dur-1) var(--md-ease), background-color var(--md-dur-1) var(--md-ease);
}
.md-textarea { height: auto; min-height: 104px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.md-textarea--compact { min-height: 64px; }
.md-input::placeholder, .md-textarea::placeholder { color: var(--md-text-placeholder); opacity: 1; }
.md-input:hover, .md-textarea:hover, .md-select select:hover { border-color: var(--md-ink-600); }
.md-input:focus, .md-textarea:focus, .md-select select:focus {
  outline: none; border-color: var(--md-accent); box-shadow: var(--md-shadow-focus); background: var(--md-bg-surface);
}
.md-input[aria-invalid="true"], .md-textarea[aria-invalid="true"], .md-select select[aria-invalid="true"] { border-color: var(--md-danger-fg); }
.md-input[aria-invalid="true"]:focus { box-shadow: var(--md-shadow-focus-danger); }
.md-input:disabled, .md-textarea:disabled, .md-select select:disabled {
  cursor: not-allowed; color: var(--md-text-disabled); background: var(--md-bg-sunken); border-color: var(--md-line);
}
.md-input[readonly] { background: var(--md-bg-subtle); border-color: var(--md-line); }
.md-input--mono { font-family: var(--md-font-mono); font-size: .8125rem; letter-spacing: .02em; }
.md-input--time { width: 120px; }
.md-input--narrow { width: 140px; }

.md-select { position: relative; }
.md-select select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; }
.md-select .md-icon { position: absolute; right: 12px; top: 50%; translate: 0 -50%; pointer-events: none; color: var(--md-icon); width: 16px; height: 16px; }

/* Feld mit Vor-/Nachsatz: Betrag in €, Prozent, Einheit */
.md-input-group {
  display: flex; align-items: stretch; height: var(--md-control-h);
  background: var(--md-bg-field); border: 1px solid var(--md-line-field); border-radius: var(--md-radius-field);
  transition: border-color var(--md-dur-1) var(--md-ease), box-shadow var(--md-dur-1) var(--md-ease);
}
.md-input-group:hover { border-color: var(--md-ink-600); }
.md-input-group:focus-within { border-color: var(--md-accent); box-shadow: var(--md-shadow-focus); background: var(--md-bg-surface); }
.md-input-group .md-input { height: 100%; border: 0; background: transparent; box-shadow: none; }
.md-input-group .md-input:focus { box-shadow: none; }
.md-affix { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; color: var(--md-text-muted); font-size: var(--md-fs-small); white-space: nowrap; }
.md-affix--end { border-left: 1px solid var(--md-line); }
.md-affix--start { border-right: 1px solid var(--md-line); }
.md-affix--bare { border: 0; padding-right: 0; }
.md-input-group .md-btn { height: calc(100% - 8px); margin: 4px; }

/* Checkbox und Radio: eigene Form, echte Inputs */
.md-check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; line-height: 1.45; }
.md-check input, .md-choice input {
  appearance: none; -webkit-appearance: none; margin: 1px 0 0; flex: none;
  width: 18px; height: 18px; display: grid; place-content: center; cursor: pointer;
  background: var(--md-bg-surface); border: 1.5px solid var(--md-line-field); border-radius: 5px;
  transition: background-color var(--md-dur-1) var(--md-ease), border-color var(--md-dur-1) var(--md-ease);
}
.md-check input::before, .md-choice input::before {
  content: ""; width: 10px; height: 10px; background: var(--md-text-on-accent);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0); transition: transform var(--md-dur-1) var(--md-ease);
}
.md-check input:checked, .md-check input:indeterminate, .md-choice input:checked { background: var(--md-accent); border-color: var(--md-accent); }
.md-check input:checked::before, .md-choice input:checked::before { transform: scale(1); }
.md-check input:indeterminate::before { clip-path: none; height: 2px; border-radius: 1px; transform: scale(1); }
.md-check input[type="radio"], .md-choice input[type="radio"] { border-radius: 50%; }
.md-check input[type="radio"]::before, .md-choice input[type="radio"]::before { clip-path: none; width: 8px; height: 8px; border-radius: 50%; }
.md-check input[type="radio"]:checked, .md-choice input[type="radio"]:checked { background: var(--md-bg-surface); border-width: 1.5px; }
.md-check input[type="radio"]:checked::before, .md-choice input[type="radio"]:checked::before { background: var(--md-accent); }
.md-check input:disabled { cursor: not-allowed; background: var(--md-bg-sunken); border-color: var(--md-line); }
.md-check input[aria-invalid="true"] { border-color: var(--md-danger-fg); }
.md-check-text { display: grid; gap: 2px; }
.md-check-text small { color: var(--md-text-muted); font-size: var(--md-fs-small); }

/* Auswahlkarte: Radio als große Fläche (Liefermethode, Abrechnungsmodell) */
.md-choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; cursor: pointer;
  background: var(--md-bg-surface); border: 1px solid var(--md-line-strong); border-radius: var(--md-radius-md);
  transition: border-color var(--md-dur-1) var(--md-ease), background-color var(--md-dur-1) var(--md-ease), box-shadow var(--md-dur-1) var(--md-ease);
}
.md-choice:hover { border-color: var(--md-ink-500); }
.md-choice:has(input:checked) { border-color: var(--md-accent); background: var(--md-bg-selected); box-shadow: inset 0 0 0 1px var(--md-accent); }
.md-choice:has(input:focus-visible) { outline: 2px solid var(--md-focus); outline-offset: 2px; }
.md-choice input { margin-top: 2px; }
.md-choice-title { font-weight: 600; color: var(--md-text-strong); display: flex; gap: 8px; align-items: center; }
.md-choice-desc { font-size: var(--md-fs-small); color: var(--md-text-muted); }
.md-choice > .md-check-text, .md-check > .md-check-text { flex: 1 1 auto; min-width: 0; }
.md-choice:has(input:disabled) { cursor: not-allowed; background: var(--md-bg-subtle); border-color: var(--md-line); box-shadow: none; }
.md-choice:has(input:disabled) .md-choice-title { color: var(--md-text-disabled); } /* die Beschreibung nennt den Grund und bleibt lesbar */
.md-choice input:disabled { cursor: not-allowed; background: var(--md-bg-sunken); border-color: var(--md-line); }

/* Schalter: Zustand steht immer zusätzlich als Wort daneben */
.md-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.md-switch input {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; position: relative; cursor: pointer;
  width: 38px; height: 22px; border-radius: var(--md-radius-pill); background: var(--md-ink-500);
  transition: background-color var(--md-dur-2) var(--md-ease);
}
.md-switch input::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--md-knob); box-shadow: var(--md-shadow-knob); transition: transform var(--md-dur-2) var(--md-ease);
}
.md-switch input:checked { background: var(--md-accent); }
.md-switch input:checked::before { transform: translateX(16px); }
.md-switch input:disabled { opacity: .5; cursor: not-allowed; }
.md-switch-state { font-size: var(--md-fs-small); font-weight: 600; color: var(--md-text-muted); min-width: 64px; }

/* Segmente: 2 bis 5 gleichrangige Optionen (Zeitraum, Ansicht, Liefermodus) */
.md-segmented {
  display: inline-flex; padding: 3px; gap: 2px; background: var(--md-bg-sunken);
  border: 1px solid var(--md-line); border-radius: var(--md-radius-control);
}
.md-segmented button {
  height: calc(var(--md-control-h) - 8px); padding: 0 14px; border: 0; border-radius: var(--md-radius-control-sm);
  background: transparent; color: var(--md-text-muted); font-size: var(--md-fs-small); font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background-color var(--md-dur-1) var(--md-ease), color var(--md-dur-1) var(--md-ease);
}
.md-segmented button:hover { color: var(--md-text-strong); }
.md-segmented button[aria-pressed="true"] { background: var(--md-bg-surface); color: var(--md-text-strong); box-shadow: var(--md-shadow-1); }

/* Chip-Eingabe: PLZ-Präfixe, E-Mail-Listen, Platzhalter */
.md-chipfield {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: var(--md-control-h); padding: 5px 8px;
  background: var(--md-bg-field); border: 1px solid var(--md-line-field); border-radius: var(--md-radius-field);
}
.md-chipfield:focus-within { border-color: var(--md-accent); box-shadow: var(--md-shadow-focus); background: var(--md-bg-surface); }
.md-chipfield input { flex: 1; min-width: 96px; height: 26px; border: 0; outline: 0; background: transparent; padding: 0 4px; }
.md-chipfield input::placeholder { color: var(--md-text-placeholder); }
.md-tag {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 10px;
  background: var(--md-bg-sunken); border: 1px solid var(--md-line); border-radius: var(--md-radius-control-sm);
  font-size: var(--md-fs-small); font-weight: 600; color: var(--md-text-strong);
}
.md-tag--mono { font-family: var(--md-font-mono); font-weight: 500; font-size: .78125rem; }
.md-tag button {
  width: 20px; height: 20px; display: grid; place-items: center; border: 0; border-radius: 5px;
  background: transparent; color: var(--md-icon); cursor: pointer;
}
.md-tag button:hover { background: var(--md-bg-pressed); color: var(--md-text-strong); }
.md-tag button .md-icon { width: 13px; height: 13px; stroke-width: 2; }
.md-tag--static { padding: 0 10px; }
.md-tag--action { cursor: pointer; padding: 0 10px; }
.md-tag--action:hover { border-color: var(--md-ink-400); background: var(--md-bg-surface); }

/* Datei-Ablage */
.md-dropzone {
  display: grid; justify-items: center; text-align: center; gap: 8px; padding: 28px 24px;
  border: 1.5px dashed var(--md-line-field); border-radius: var(--md-radius-card); background: var(--md-bg-field);
  color: var(--md-text-muted); cursor: pointer;
  transition: border-color var(--md-dur-1) var(--md-ease), background-color var(--md-dur-1) var(--md-ease);
}
.md-dropzone:hover, .md-dropzone[data-state="over"] { border-color: var(--md-accent); background: var(--md-bg-selected); }
.md-dropzone-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--md-bg-surface); border: 1px solid var(--md-line); color: var(--md-text-strong); }
.md-dropzone strong { color: var(--md-text-strong); }
.md-dropzone--inline { grid-auto-flow: column; justify-content: start; align-items: center; text-align: left; padding: var(--md-space-3) var(--md-space-4); }

.md-fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--md-space-4); min-width: 0; }
.md-fieldset legend { padding: 0; margin-bottom: var(--md-space-3); font-weight: 700; color: var(--md-text-strong); }
.md-form-grid { display: grid; gap: var(--md-space-4) var(--md-space-5); grid-template-columns: repeat(var(--_cols, 2), minmax(0, 1fr)); }
.md-form-grid .md-span-all { grid-column: 1 / -1; }

/* ==========================================================================
   Status: immer Farbe UND Wort, bei Warnung und Fehler zusätzlich Icon
   ========================================================================== */
.md-badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: var(--md-radius-xs); font-family: var(--md-font-mono); font-size: var(--md-fs-label); font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase; line-height: 1; white-space: nowrap;
  background: var(--md-neutral-bg); color: var(--md-neutral-fg);
}
.md-badge .md-icon { width: 13px; height: 13px; stroke-width: 2.1; }
.md-badge--success { background: var(--md-success-bg); color: var(--md-success-fg); }
.md-badge--warning { background: var(--md-warning-bg); color: var(--md-warning-fg); }
.md-badge--danger  { background: var(--md-danger-bg);  color: var(--md-danger-fg); }
.md-badge--info    { background: var(--md-info-bg);    color: var(--md-info-fg); }
.md-badge--accent  { background: var(--md-accent-bg);  color: var(--md-accent-fg); }
.md-badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--md-line-strong); color: var(--md-text-muted); }
.md-badge--lg { height: 26px; padding: 0 10px; font-size: 12px; }

.md-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--md-radius-pill); background: var(--md-bg-sunken); color: var(--md-text-muted);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
}
.md-count--attention { background: var(--md-warning-bg); color: var(--md-warning-fg); }

/* Ampel mit mehreren unabhängigen Prüfungen (DNS, Besitz, Zertifikat) */
.md-signal { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.md-signal-item {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px;
  border-radius: var(--md-radius-control-sm); background: var(--md-bg-subtle); border: 1px solid var(--md-line);
  font-size: var(--md-fs-small);
}
.md-signal-item .md-icon { width: 16px; height: 16px; stroke-width: 2; }
.md-signal-item b { font-weight: 600; color: var(--md-text-strong); }
.md-signal-item[data-state="ok"] .md-icon { color: var(--md-success-fg); }
.md-signal-item[data-state="warn"] .md-icon { color: var(--md-warning-fg); }
.md-signal-item[data-state="fail"] .md-icon { color: var(--md-danger-fg); }
.md-signal-item[data-state="pending"] .md-icon { color: var(--md-icon-muted); }
.md-signal-item span { color: var(--md-text-muted); }

.md-avatar {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--md-accent-bg); color: var(--md-accent-fg); font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.md-avatar--sm { width: 26px; height: 26px; font-size: 11px; }
.md-avatar--neutral { background: var(--md-bg-sunken); color: var(--md-text-strong); }
