/*
  marke-ui.css — Die Stil-Basis der Oberfläche: shadcn-Aufbau + Marke Agents4Hire.

  Kurzbeschreibung (für Laien): Hier steht, wie jeder Baustein der Oberfläche
  aussieht — Seitenleiste, Kopfzeile, Knöpfe, Felder, Karten, Tabellen, Chat mit
  KI-Bausteinen, Meldungen, Dialog, Ladekreis, Aufnahme. Ruhiger, flacher Aufbau
  wie bei shadcn/ui; Farben, Logo, Schrift und Maße kommen aus der Marke.
  Festgelegt von Ralph am 17.10.2026 (marke/REGELN.md, Abschnitt „Stil-Basis").

  Wirkt NUR, wenn die Seite sich anschließt: <html class="marke marke-ui">.
  Ohne die Klasse ändert sich nichts — so lässt sich Werkzeug für Werkzeug
  umstellen (zuerst nur für Ralph, dann Freigabe).

  Einbinden (nach brand.css, das marke.css mitbringt):
    <link rel="stylesheet" href="/assets/css/brand.css">
    <link rel="stylesheet" href="/assets/css/marke-ui.css">

  Farben nur aus marke.css (--marke-…). Grau, Weiß, Schwarz sind frei.
  Ansicht aller Bausteine: marke/ui-referenz.html
  (Artefakt neu erzeugen: node tools/marke-ui-artefakt.js)
*/

/* ── Lokale Ableitungen (keine neuen Farben, nur Mischungen aus der Marke) ── */
:root.marke-ui {
  --ui-nav-ton:      var(--marke-nav-blau);
  --ui-nav-kachel:   var(--marke-nav-kachel);
  --ui-cust-ton:     var(--marke-customized);
  --ui-cust-kachel:  var(--marke-customized-kachel);
  --ui-ok-zart:      color-mix(in srgb, var(--marke-ok) 12%, transparent);
  --ui-warn-zart:    color-mix(in srgb, var(--marke-warn) 13%, transparent);
  --ui-gefahr-zart:  color-mix(in srgb, var(--marke-gefahr) 11%, transparent);
  --ui-fokus:        0 0 0 3px var(--marke-akzent-zart);
  --ui-hover:        color-mix(in srgb, var(--marke-text) 5%, transparent);
}
:root.marke-ui[data-theme="dark"] {
  --ui-nav-ton:      color-mix(in srgb, var(--marke-nav-blau) 55%, white);
  --ui-nav-kachel:   color-mix(in srgb, var(--marke-nav-blau) 26%, transparent);
  --ui-cust-ton:     var(--marke-tuerkis);
  --ui-cust-kachel:  color-mix(in srgb, var(--marke-tuerkis) 16%, transparent);
}

/* ═══ Grundlage ══════════════════════════════════════════════════════════════ */
.marke-ui body {
  margin: 0;
  background: var(--marke-grund);
  color: var(--marke-text);
  font-family: var(--marke-schrift);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.marke-ui *, .marke-ui *::before, .marke-ui *::after { box-sizing: border-box; }
.marke-ui [hidden] { display: none !important; }
.marke-ui input[type=checkbox], .marke-ui input[type=radio], .marke-ui input[type=range] { accent-color: var(--marke-nav-blau); } /* Auswahl = Blau */ /* Bausteine mit eigenem display dürfen hidden nicht aushebeln */
.marke-ui ::selection { background: var(--marke-akzent-zart); }
.marke-ui :focus-visible { outline: 2px solid var(--marke-akzent); outline-offset: 2px; }
/* Textfelder zeigen den Fokus über ihren Rahmen bzw. den Rahmen ihres Kastens
   (Chat-Eingabe, Suchfeld) – kein zweiter Ring innen (Ralph 17.10.2026) */
.marke-ui input:focus-visible, .marke-ui textarea:focus-visible, .marke-ui [contenteditable]:focus-visible { outline: 0; }
.marke-ui * { scrollbar-width: thin; scrollbar-color: var(--marke-linie-stark) transparent; }
.marke-ui .a4h-svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Schrift-Leiter 11 / 12 / 13 / 14 / 15 / 20 */
.marke-ui .a4h-h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
.marke-ui .a4h-h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.marke-ui .a4h-h3 { margin: 0; font-size: 14px; font-weight: 600; }
.marke-ui .a4h-sub { margin: 0; font-size: 13px; color: var(--marke-text-2); }
.marke-ui .a4h-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--marke-text-3); }
.marke-ui .a4h-kbd { font: 500 11px var(--marke-schrift-code); padding: 1px 5px; border: 1px solid var(--marke-linie); border-radius: 4px; background: var(--marke-flaeche-2); color: var(--marke-text-2); }
.marke-ui .a4h-zahl { font-variant-numeric: tabular-nums; }

/* ═══ Rahmen: Seitenleiste | Arbeitsfläche ══════════════════════════════════ */
.marke-ui .a4h-shell { display: grid; grid-template-columns: var(--marke-seitenleiste) minmax(0, 1fr); min-height: 100%; }
.marke-ui .a4h-side { display: flex; flex-direction: column; gap: var(--marke-sp-3); padding: var(--marke-sp-3) var(--marke-sp-2); background: var(--marke-grund); border-right: 1px solid var(--marke-linie); min-width: 0; }
.marke-ui .a4h-side-logo { padding: 6px 10px 2px; }
.marke-ui .a4h-side-logo img { display: block; height: 24px; width: auto; max-width: 100%; }
.marke-ui .a4h-side-fuss { margin-top: auto; }
.marke-ui .a4h-main { display: flex; flex-direction: column; min-width: 0; background: var(--marke-flaeche); }
/* Logo: auf Hell die dunkle Datei, auf Dunkel die weiße — nie umfärben */
.marke-ui img.logo-dunkel { display: none; }
.marke-ui[data-theme="dark"] img.logo-hell { display: none; }
.marke-ui[data-theme="dark"] img.logo-dunkel { display: block; }

/* ═══ Seitenleiste (Referenz, Ralph 09.10.2026) ═════════════════════════════
   Symbol in eigener Kachel; aktiv: Kachel gefüllt, Symbol weiß, Eintrag weiß
   mit dunklem Umriss. Blau = Plattform, Petrol = Customized. Kein Anheben. */
.marke-ui .a4h-nav { display: flex; flex-direction: column; gap: 2px; }
.marke-ui .a4h-nav-titel { padding: 10px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--marke-text-3); }
.marke-ui .a4h-nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 5px 8px 5px 5px; border: 2px solid transparent; border-radius: var(--marke-r-l);
  background: transparent; color: var(--marke-text); font: 600 14px var(--marke-schrift);
  text-align: left; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s;
}
.marke-ui .a4h-nav-item svg {
  flex: none; box-sizing: border-box; width: 32px; height: 32px; padding: 7px; border-radius: 8px;
  background: var(--ui-nav-kachel); color: var(--ui-nav-ton);
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: background .15s, color .15s;
}
.marke-ui .a4h-nav-item:hover { background: color-mix(in srgb, var(--ui-nav-ton) 7%, transparent); }
.marke-ui .a4h-nav-item.is-active, .marke-ui .a4h-nav-item.active { background: var(--marke-flaeche); border-color: var(--marke-text); }
.marke-ui .a4h-nav-item.is-active svg, .marke-ui .a4h-nav-item.active svg { background: var(--ui-nav-ton); color: white; }
.marke-ui .a4h-nav.is-customized .a4h-nav-item svg { background: var(--ui-cust-kachel); color: var(--ui-cust-ton); }
.marke-ui .a4h-nav.is-customized .a4h-nav-item:hover { background: color-mix(in srgb, var(--ui-cust-ton) 7%, transparent); }
.marke-ui .a4h-nav.is-customized .a4h-nav-item.is-active svg { background: var(--ui-cust-ton); color: white; }
.marke-ui .a4h-nav-count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--marke-text-3); font-variant-numeric: tabular-nums; }
.marke-ui .a4h-nav-item.is-add { margin-top: var(--marke-sp-2); border: 2px dashed color-mix(in srgb, var(--ui-nav-ton) 34%, transparent); color: var(--marke-text-2); }
.marke-ui .a4h-nav-item.is-add svg { background: transparent; }

/* Konto unten in der Leiste */
.marke-ui .a4h-konto { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--marke-r-m); }
.marke-ui .a4h-konto:hover { background: var(--ui-hover); }
.marke-ui .a4h-avatar { width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; flex: none; background: var(--marke-akzent-zart); color: var(--marke-akzent); font-size: 12px; font-weight: 700; }

/* ═══ Kopfzeile eines Werkzeugs (Ralph 10.10.2026) ══════════════════════════
   Eine Zeile, 46 px, Reiter links; rechts: Pillen → Suche → Symbole →
   Nebenknopf → Hauptknopf. Kein Werkzeugname, kein farbiges Band. */
.marke-ui .a4h-topbar { display: flex; align-items: center; gap: var(--marke-sp-2); height: 46px; padding: 0 var(--marke-sp-4); border-bottom: 1px solid var(--marke-linie); background: var(--marke-flaeche); min-width: 0; }
.marke-ui .a4h-tabs-grow { flex: 1 1 auto; }
/* brand.css richtet die Kopfzeile auf die Unterkante der Reiter aus (8 px Abstand,
   flex-end). In der Stil-Basis sitzt alles auf einer Mittellinie. */
.marke-ui .a4h-topbar > *:not(.a4h-tabs):not(.tabs):not(.a4h-tabs-grow) { margin-bottom: 0; }
.marke-ui .a4h-topbar > *:not(.a4h-tabs):not(.tabs) { align-items: center; }

/* Reiter = Segment-Knöpfe (umgesetzt 17.10.2026) */
.marke-ui .a4h-tabs { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.marke-ui .a4h-tabs::-webkit-scrollbar { display: none; }
/* Reiter UND Filter: EINE Form überall (Ralph 17.10.2026, Vorbild „Alle · Privat ·
   Geteilt" im Wissen): Pille 28 px, dünner Rand, aktiv im Blau der Seitenleiste
   (Ralph 17.10.2026: „alle Auswahl in diesem Blau“; Weiß darauf 6,6:1). Bewusst mit
   !important – Seiten mit eigener Reiter-Optik (Unterstrich, Segment) dürfen die
   eine Form nicht wieder aufweichen. */
.marke-ui .a4h-tab,
.marke-ui .a4h-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px !important; min-height: 0 !important; padding: 0 12px !important; margin: 0 !important;
  border: 1px solid var(--marke-linie-stark) !important; border-radius: var(--marke-r-pill) !important;
  background: var(--marke-flaeche) !important; box-shadow: none !important;
  color: var(--marke-text-2) !important; font: 600 12px/1 var(--marke-schrift) !important;
  white-space: nowrap; cursor: pointer; transition: color .12s, border-color .12s, background .12s;
}
.marke-ui .a4h-tab::after, .marke-ui .a4h-tab::before { display: none !important; }
.marke-ui .a4h-tab:hover, .marke-ui .a4h-chip:hover { color: var(--marke-text) !important; border-color: var(--marke-text-3) !important; }
.marke-ui .a4h-tab.is-active, .marke-ui .a4h-tab.is-on, .marke-ui .a4h-tab.active,
.marke-ui .a4h-chip.is-on, .marke-ui .a4h-chip.active {
  background: var(--marke-nav-blau) !important; border-color: var(--marke-nav-blau) !important; color: white !important;
}
.marke-ui .a4h-tab.is-active .a4h-tab-count, .marke-ui .a4h-tab.active .a4h-tab-count { background: rgba(255, 255, 255, .22); color: white; }
.marke-ui .a4h-tab-count { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 999px; background: var(--marke-flaeche-2); color: var(--marke-text-2); font-variant-numeric: tabular-nums; }

/* Suchfeld: schmal, Text „Suchen" (wie im CRM) */
.marke-ui .a4h-search { display: inline-flex; align-items: center; gap: 6px; height: 30px; max-width: 100%; padding: 0 10px; border: 1px solid var(--marke-linie); border-radius: var(--marke-r-m); background: var(--marke-feld); color: var(--marke-text-3); }
.marke-ui .a4h-search:focus-within { border-color: var(--marke-akzent); box-shadow: var(--ui-fokus); }
/* Lupe als Linien-Symbol statt 🔍 aus dem Kanon-Markup */
.marke-ui .a4h-search-icon { font-size: 0; width: 14px; height: 14px; opacity: 1; background-color: var(--marke-text-3);
  -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%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%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%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") center / contain no-repeat; }
.marke-ui .a4h-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--marke-text); font: 400 13px var(--marke-schrift); }
.marke-ui .a4h-search input::placeholder { color: var(--marke-text-3); }

/* ═══ Knöpfe (fünf Arten, Ralph 10.10.2026) ═════════════════════════════════ */
.marke-ui .a4h-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--marke-r-m);
  font: 600 13px/1 var(--marke-schrift); white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, filter .15s;
}
.marke-ui .a4h-btn:disabled, .marke-ui .a4h-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.marke-ui .a4h-btn--primary { background: var(--marke-akzent); color: var(--marke-auf-akzent); }
.marke-ui .a4h-btn--primary:hover { filter: brightness(1.08); }
.marke-ui .a4h-btn--sec { background: var(--marke-flaeche); color: var(--marke-text); border-color: var(--marke-linie-stark); }
.marke-ui .a4h-btn--sec:hover { background: var(--marke-flaeche-2); }
.marke-ui .a4h-btn--ghost { background: transparent; color: var(--marke-text-2); }
.marke-ui .a4h-btn--ghost:hover { color: var(--marke-text); background: var(--ui-hover); }
.marke-ui .a4h-btn--danger { background: var(--marke-gefahr); color: white; }
.marke-ui .a4h-btn--danger:hover { filter: brightness(1.08); }
.marke-ui .a4h-btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.marke-ui .a4h-btn--lg { height: 44px; padding: 0 20px; font-size: 15px; } /* nur Website und Anmeldung */
.marke-ui .a4h-btnrow { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--marke-sp-2); }

/* Symbolknopf: 30 × 30, Linien-Symbol 16 px, grau; gefüllt nur als Hauptaktion */
.marke-ui .a4h-icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: var(--marke-r-m); background: transparent; color: var(--marke-text-2); cursor: pointer; transition: background .15s, color .15s; }
.marke-ui .a4h-icon-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.marke-ui .a4h-icon-btn:hover { background: var(--ui-hover); color: var(--marke-text); }
.marke-ui .a4h-icon-btn.is-active { background: var(--ui-nav-kachel); color: var(--ui-nav-ton); }
.marke-ui .a4h-icon-btn.is-primary { background: var(--marke-akzent); color: var(--marke-auf-akzent); }
.marke-ui .a4h-icon-btn.is-danger:hover { background: var(--ui-gefahr-zart); color: var(--marke-gefahr); }
.marke-ui .a4h-iconbar { display: inline-flex; align-items: center; gap: 2px; padding: 0; background: transparent; border: 0; } /* ohne graue Gruppenfläche aus brand.css */

/* ═══ Felder ════════════════════════════════════════════════════════════════ */
.marke-ui .a4h-feldgruppe { display: grid; gap: 6px; }
.marke-ui .a4h-field-label { font-size: 13px; font-weight: 500; color: var(--marke-text); }
.marke-ui .a4h-field {
  width: 100%; height: 34px; padding: 0 12px; border: 1px solid var(--marke-linie); border-radius: var(--marke-r-m);
  background: var(--marke-feld); color: var(--marke-text); font: 400 14px var(--marke-schrift);
  transition: border-color .15s, box-shadow .15s;
}
.marke-ui textarea.a4h-field { height: auto; min-height: 76px; padding: 8px 12px; resize: vertical; line-height: 1.5; }
.marke-ui .a4h-field::placeholder { color: var(--marke-text-3); }
.marke-ui .a4h-field:focus { outline: 0; border-color: var(--marke-akzent); box-shadow: var(--ui-fokus); }
.marke-ui .a4h-field.is-invalid { border-color: var(--marke-gefahr); }
.marke-ui .a4h-hint { font-size: 12px; color: var(--marke-text-3); }
.marke-ui .a4h-hint.is-danger { color: var(--marke-gefahr); }
.marke-ui .a4h-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.marke-ui .a4h-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--marke-nav-blau); }
.marke-ui .a4h-switch { position: relative; width: 36px; height: 20px; flex: none; padding: 0; border: 0; border-radius: 999px; background: var(--marke-linie-stark); cursor: pointer; transition: background .15s; }
.marke-ui .a4h-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: white; box-shadow: var(--marke-schatten-leise); transition: left .15s; }
.marke-ui .a4h-switch[aria-checked="true"] { background: var(--marke-nav-blau); }
.marke-ui .a4h-switch[aria-checked="true"]::after { left: 18px; }

/* ═══ Karten — flach (Ralph 17.10.2026) ═════════════════════════════════════
   Weiße Fläche, dünner Rand, leiser Schatten. Kein Anheben, keine Farbkante.
   Klickbar: Rand wird beim Überfahren kräftiger. */
.marke-ui .a4h-card { display: grid; gap: var(--marke-sp-3); align-content: start; padding: var(--marke-sp-4); background: var(--marke-flaeche); border: 1px solid var(--marke-linie); border-radius: var(--marke-r-l); box-shadow: var(--marke-schatten-leise); min-width: 0; }
.marke-ui .a4h-card.is-clickable { cursor: pointer; transition: border-color .15s; }
.marke-ui .a4h-card.is-clickable:hover { border-color: var(--marke-linie-stark); }
.marke-ui .a4h-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--marke-sp-2); }
.marke-ui .a4h-stat { display: grid; gap: 2px; }
.marke-ui .a4h-stat-wert { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.marke-ui .a4h-stat-text { font-size: 12px; color: var(--marke-text-2); }

/* ═══ Pillen (Status) und Filter-Chips ═════════════════════════════════════ */
.marke-ui .a4h-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border: 1px solid var(--marke-linie); border-radius: var(--marke-r-pill); background: transparent; color: var(--marke-text-2); font-size: 12px; font-weight: 500; white-space: nowrap; }
.marke-ui .a4h-pill svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.marke-ui .a4h-pill.is-ok     { border-color: transparent; background: var(--ui-ok-zart);     color: var(--marke-ok); }
.marke-ui .a4h-pill.is-warn   { border-color: transparent; background: var(--ui-warn-zart);   color: var(--marke-warn); }
.marke-ui .a4h-pill.is-danger { border-color: transparent; background: var(--ui-gefahr-zart); color: var(--marke-gefahr); }
.marke-ui .a4h-pill.is-info   { border-color: transparent; background: var(--ui-nav-kachel); color: var(--ui-nav-ton); } /* Lila sparsam: Info-Stand blau */
.marke-ui .a4h-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ═══ Tabelle ═══════════════════════════════════════════════════════════════ */
.marke-ui .a4h-tabelle-box { border: 1px solid var(--marke-linie); border-radius: var(--marke-r-m); overflow-x: auto; background: var(--marke-flaeche); }
.marke-ui .a4h-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.marke-ui .a4h-table th { text-transform: none; letter-spacing: 0; padding: 8px 12px; text-align: left; font-size: 12px; font-weight: 500; color: var(--marke-text-2); border-bottom: 1px solid var(--marke-linie); background: var(--marke-flaeche-2); white-space: nowrap; }
.marke-ui .a4h-table td { padding: 9px 12px; border-bottom: 1px solid var(--marke-linie); }
.marke-ui .a4h-table tr:last-child td { border-bottom: 0; }
.marke-ui .a4h-table tbody tr:hover td { background: var(--ui-hover); }
.marke-ui .a4h-table .is-zahl { text-align: right; }
.marke-ui .a4h-table th.is-num, .marke-ui .a4h-table td.is-num { text-align: right; }

/* ═══ Chat mit KI-Bausteinen ════════════════════════════════════════════════
   Eigene Nachricht als graue Blase rechts; Antwort ohne Blase, darüber die
   Denkschritte (aufklappbar) und Werkzeug-Aufrufe, darunter Quellen,
   Prüfsiegel und leise Aktionen. */
.marke-ui .a4h-verlauf { display: flex; flex-direction: column; gap: 20px; padding: var(--marke-sp-5) var(--marke-sp-4); overflow-y: auto; }
.marke-ui .a4h-blase { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.marke-ui .a4h-blase.is-eigen { align-self: flex-end; background: var(--marke-flaeche-2); color: var(--marke-text); }
/* KI-Antwort in eigener Blase: weiß, dünner Rand, Ecke oben links (Ralph 17.10.2026) */
.marke-ui .a4h-blase.is-fremd,
.marke-ui .a4h-antwort { align-self: flex-start; max-width: 680px; padding: 12px 16px; border: 1px solid var(--marke-linie); border-radius: 14px; border-top-left-radius: var(--marke-r-s); background: var(--marke-flaeche); box-shadow: var(--marke-schatten-leise); }
.marke-ui .a4h-antwort { display: grid; gap: var(--marke-sp-3); min-width: 0; }
.marke-ui .a4h-ki-denken { border: 1px solid var(--marke-linie); border-radius: var(--marke-r-m); font-size: 13px; }
.marke-ui .a4h-ki-denken > summary { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--marke-text-2); list-style: none; cursor: pointer; }
.marke-ui .a4h-ki-denken > summary::-webkit-details-marker { display: none; }
.marke-ui .a4h-ki-denken > summary:hover { color: var(--marke-text); }
.marke-ui .a4h-ki-denken > div { padding: 10px 12px; border-top: 1px solid var(--marke-linie); color: var(--marke-text-2); }
.marke-ui .a4h-ki-werkzeug { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--marke-linie); border-radius: var(--marke-r-m); font: 400 13px var(--marke-schrift-code); color: var(--marke-text); min-width: 0; }
.marke-ui .a4h-ki-werkzeug .a4h-pill { margin-left: auto; font-family: var(--marke-schrift); }
.marke-ui .a4h-ki-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.marke-ui .a4h-quelle { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--marke-r-s); background: var(--marke-flaeche-2); color: var(--marke-text-2); font-size: 12px; text-decoration: none; }
.marke-ui .a4h-quelle b { color: var(--marke-akzent); font-weight: 700; }
.marke-ui a.a4h-quelle:hover { color: var(--marke-text); }

/* Eingabe unten im Chat */
.marke-ui .a4h-eingabe { display: grid; gap: var(--marke-sp-2); margin: 0 var(--marke-sp-4) var(--marke-sp-4); padding: 10px; border: 1px solid var(--marke-linie-stark); border-radius: var(--marke-r-l); background: var(--marke-flaeche); transition: border-color .15s, box-shadow .15s; }
.marke-ui .a4h-eingabe:focus-within { border-color: var(--marke-akzent); box-shadow: var(--ui-fokus); }
.marke-ui .a4h-eingabe textarea { min-height: 44px; border: 0; outline: 0; resize: none; background: transparent; color: var(--marke-text); font: 400 14px var(--marke-schrift); }
.marke-ui .a4h-eingabe textarea::placeholder { color: var(--marke-text-3); }
.marke-ui .a4h-eingabe-leiste { display: flex; align-items: center; justify-content: space-between; gap: var(--marke-sp-2); }

/* ═══ Rückmeldungen ═════════════════════════════════════════════════════════ */
.marke-ui .a4h-msg { padding: 10px 12px; border: 1px solid var(--marke-linie); border-radius: var(--marke-r-m); background: var(--marke-flaeche-2); color: var(--marke-text); font-size: 13px; line-height: 1.45; }
.marke-ui .a4h-msg.is-ok     { border-color: color-mix(in srgb, var(--marke-ok) 40%, transparent);     background: var(--ui-ok-zart); }
.marke-ui .a4h-msg.is-warn   { border-color: color-mix(in srgb, var(--marke-warn) 42%, transparent);   background: var(--ui-warn-zart); }
.marke-ui .a4h-msg.is-danger { border-color: color-mix(in srgb, var(--marke-gefahr) 40%, transparent); background: var(--ui-gefahr-zart); }

/* Kurze Meldung: hell, unten rechts, grüner Rand links, kein Emoji */
.marke-ui .a4h-toast { position: fixed; right: var(--marke-sp-4); bottom: var(--marke-sp-4); z-index: 110; max-width: 380px; padding: 12px 14px; border: 1px solid var(--marke-linie); border-left: 3px solid var(--marke-ok); border-radius: var(--marke-r-m); background: var(--marke-flaeche); box-shadow: var(--marke-schatten); font-size: 13px; }
/* Kein eigenes display: Seiten blenden ihre Meldung selbst ein und aus.
   Das Symbol steht links daneben. */
.marke-ui .a4h-toast > svg { float: left; margin: 1px 10px 0 0; }
.marke-ui .a4h-toast.is-statisch { position: static; }
.marke-ui .a4h-toast.is-danger { border-left-color: var(--marke-gefahr); }
.marke-ui .a4h-toast.is-warn { border-left-color: var(--marke-warn); }
/* Meldung mit beiden Klassen (a4h-msg + a4h-toast): hell, nur der Rand links trägt die Farbe */
.marke-ui .a4h-toast.a4h-msg { background: var(--marke-flaeche); border-color: var(--marke-linie); border-left: 3px solid var(--marke-ok); }
.marke-ui .a4h-toast.a4h-msg.is-ok { border-left-color: var(--marke-ok); }
.marke-ui .a4h-toast.a4h-msg.is-warn { border-left-color: var(--marke-warn); }
.marke-ui .a4h-toast.a4h-msg.is-danger { border-left-color: var(--marke-gefahr); }
.marke-ui .a4h-toast b { display: block; font-weight: 600; }
.marke-ui .a4h-toast span { color: var(--marke-text-2); }

/* Der eine Ladekreis: lila Ring. Nur für Elemente ohne eigene Zeichnung —
   ein <svg class="a4h-spin"> (brand-spinner.js) behält seine Form und
   sein Ein-/Ausblenden aus brand.css bzw. der Seite. */
.marke-ui .a4h-spin:not(svg) { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--marke-akzent-zart); border-top-color: var(--marke-ladekreis); border-radius: 999px; animation: a4h-ui-drehen .8s linear infinite; vertical-align: middle; }
/* Gezeichneter Ladekreis (brand-spinner.js) zeichnet in currentColor – bewusst lila */
.marke-ui svg.a4h-spin { color: var(--marke-ladekreis); }
.marke-ui .a4h-spin.is-gross:not(svg) { width: 28px; height: 28px; border-width: 3px; }
@keyframes a4h-ui-drehen { to { transform: rotate(360deg); } }

/* Leerzustand: was fehlt + was man tun kann */
.marke-ui .a4h-empty { display: flex; flex-direction: column; align-items: center; gap: var(--marke-sp-2); padding: var(--marke-sp-5) var(--marke-sp-4); border: 1px dashed var(--marke-linie-stark); border-radius: var(--marke-r-l); text-align: center; color: var(--marke-text-2); font-size: 13px; }
.marke-ui .a4h-empty-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--marke-r-m); background: var(--marke-flaeche-2); color: var(--marke-text-2); }
.marke-ui .a4h-empty-text { max-width: 42ch; }

/* Hover-Karte: hell, Schatten — überall, auch Widget und AIOS */
.marke-ui div.a4h-tip, .marke-ui .a4h-tip.is-karte { position: absolute; z-index: 120; max-width: 280px; padding: 10px 12px; border: 1px solid var(--marke-linie); border-radius: var(--marke-r-m); background: var(--marke-flaeche); color: var(--marke-text); box-shadow: var(--marke-schatten); font-size: 12px; line-height: 1.45; }
.marke-ui div.a4h-tip.is-statisch { position: static; }
.marke-ui div.a4h-tip b { display: block; margin-bottom: 2px; font-size: 13px; }

/* Hilfe-Fragezeichen */
.marke-ui .a4h-hilfe { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--marke-linie-stark); border-radius: 999px; background: transparent; color: var(--marke-text-2); font: 700 11px var(--marke-schrift); cursor: help; }
.marke-ui .a4h-hilfe:hover { border-color: var(--marke-akzent); color: var(--marke-akzent); }

/* ═══ Dialog: weiß, Radius 12, ohne Rand, Hintergrund bleibt sichtbar ═══════ */
.marke-ui .a4h-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--marke-sp-4); background: var(--marke-abdunklung); }
.marke-ui .a4h-overlay[hidden] { display: none; }
.marke-ui .a4h-modal { width: min(460px, 100%); display: grid; gap: var(--marke-sp-4); padding: var(--marke-sp-5); border: 0; border-radius: var(--marke-r-l); background: var(--marke-flaeche); box-shadow: var(--marke-schatten); }
.marke-ui .a4h-modal.is-statisch { position: static; }
/* Polster und Trennlinien aus brand.css nicht doppelt: der Dialog trägt sie selbst */
.marke-ui .a4h-modal-head, .marke-ui .a4h-modal-body, .marke-ui .a4h-modal-foot { padding: 0; border: 0; }
.marke-ui .a4h-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--marke-sp-3); }
.marke-ui .a4h-modal-body { color: var(--marke-text-2); font-size: 14px; }
.marke-ui .a4h-modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--marke-sp-2); }

/* ═══ Aufnahme läuft: dunkle Leiste mit Punkt, Pegel, Zeit, Stopp ═══════════ */
.marke-ui .a4h-aufnahme { display: inline-flex; align-items: center; gap: 12px; height: 40px; padding: 0 6px 0 14px; border-radius: var(--marke-r-pill); background: var(--marke-grafit); color: white; font-size: 13px; font-weight: 600; }
.marke-ui .a4h-aufnahme-punkt { width: 10px; height: 10px; border-radius: 999px; background: var(--marke-aufnahme); animation: a4h-ui-puls 1.2s ease-in-out infinite; }
.marke-ui .a4h-aufnahme-pegel { display: inline-flex; align-items: center; gap: 2px; height: 16px; }
.marke-ui .a4h-aufnahme-pegel i { width: 3px; border-radius: 2px; background: var(--marke-aufnahme); }
.marke-ui .a4h-aufnahme-zeit { font-variant-numeric: tabular-nums; }
.marke-ui .a4h-aufnahme-stopp { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: var(--marke-r-pill); background: var(--marke-aufnahme); color: white; font: 600 12px var(--marke-schrift); cursor: pointer; }
@keyframes a4h-ui-puls { 50% { opacity: .35; } }

/* ═══ App-Leiste: Name eines eigenständigen Werkzeugs (eigenes Fenster) ═════ */
.marke-ui .a4h-appbar { display: flex; align-items: center; gap: var(--marke-sp-2); padding: 14px 24px; border-bottom: 1px solid var(--marke-linie); background: var(--marke-flaeche); min-width: 0; }
.marke-ui .a4h-appbar-titel { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marke-ui .a4h-appbar-grow { flex: 1 1 auto; }

/* ═══ Menüs: Aufklapp-, Konto- und Rechtsklick-Menü — eine Form ════════════
   Helle Karte, Einträge mit Linien-Symbol, Trenner, Gefahr-Eintrag rot,
   Tastenkürzel rechts. Aufklapp-Pille öffnet es (viele Einträge zur Auswahl). */
.marke-ui .a4h-menue { display: grid; gap: 1px; min-width: 210px; max-width: 320px; padding: 4px; border: 1px solid var(--marke-linie); border-radius: var(--marke-r-m); background: var(--marke-flaeche); box-shadow: var(--marke-schatten); }
.marke-ui .a4h-menue.is-schwebend { position: absolute; z-index: 130; }
.marke-ui .a4h-menue-titel { padding: 6px 8px 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--marke-text-3); }
.marke-ui .a4h-menue-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--marke-r-s); background: transparent; color: var(--marke-text); font: 400 13px var(--marke-schrift); text-align: left; text-decoration: none; cursor: pointer; }
.marke-ui .a4h-menue-item svg { width: 16px; height: 16px; flex: none; color: var(--marke-text-2); stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.marke-ui .a4h-menue-item:hover, .marke-ui .a4h-menue-item:focus-visible { background: var(--ui-hover); outline: 0; }
.marke-ui .a4h-menue-item.is-active { color: var(--marke-nav-blau); font-weight: 600; }
.marke-ui .a4h-menue-item.is-active svg { color: var(--marke-nav-blau); }
.marke-ui .a4h-menue-item.is-danger, .marke-ui .a4h-menue-item.is-danger svg { color: var(--marke-gefahr); }
.marke-ui .a4h-menue-item .a4h-kbd { margin-left: auto; }
.marke-ui .a4h-menue-trenner { height: 1px; margin: 4px -4px; background: var(--marke-linie); }
.marke-ui .a4h-menue-farben { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px; }
.marke-ui .a4h-menue-farben button { width: 18px; height: 18px; padding: 0; border: 2px solid var(--marke-flaeche); border-radius: 999px; box-shadow: 0 0 0 1px var(--marke-linie); cursor: pointer; }
.marke-ui .a4h-menue-farben button.is-on { box-shadow: 0 0 0 2px var(--marke-text); }
.marke-ui .a4h-auswahl { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 12px; border: 1px solid var(--marke-linie); border-radius: var(--marke-r-pill); background: var(--marke-flaeche); color: var(--marke-text); font: 600 12px var(--marke-schrift); cursor: pointer; }
.marke-ui .a4h-auswahl svg { width: 14px; height: 14px; color: var(--marke-text-3); stroke: currentColor; fill: none; stroke-width: 2; }
.marke-ui .a4h-auswahl:hover { border-color: var(--marke-linie-stark); }

/* ═══ Auswahlliste: ersetzt das graue Windows-<select> ══════════════════════
   Knopf zeigt die Wahl; darunter klappt eine helle Liste auf — mit Suche,
   Gruppen, Haken an der aktuellen Wahl, Tastenkürzel rechts, „Eigene …"
   unten. Verhalten: /assets/js/marke-ui-auswahl.js (Pfeile, Enter, Esc). */
.marke-ui .a4h-select { position: relative; display: inline-flex; min-width: 0; }
.marke-ui .a4h-select-knopf { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; height: 34px; padding: 0 10px 0 12px; border: 1px solid var(--marke-linie-stark); border-radius: var(--marke-r-m); background: var(--marke-flaeche); color: var(--marke-text); font: 500 13px var(--marke-schrift); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.marke-ui .a4h-select-knopf > span:first-child { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marke-ui .a4h-select-knopf svg { width: 16px; height: 16px; flex: none; color: var(--marke-text-3); stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.marke-ui .a4h-select-knopf:hover { border-color: var(--marke-text-3); }
.marke-ui .a4h-select.is-offen .a4h-select-knopf { border-color: var(--marke-akzent); box-shadow: var(--ui-fokus); }
.marke-ui .a4h-select.is-offen .a4h-select-knopf svg { transform: rotate(180deg); }
.marke-ui .a4h-select-knopf.is-leer > span:first-child { color: var(--marke-text-3); }
.marke-ui .a4h-liste { position: absolute; top: calc(100% + 4px); left: 0; z-index: 140; display: flex; flex-direction: column; width: max(100%, 280px); max-width: min(380px, calc(100vw - 32px)); max-height: 340px; border: 1px solid var(--marke-linie); border-radius: var(--marke-r-m); background: var(--marke-flaeche); box-shadow: var(--marke-schatten); overflow: hidden; }
.marke-ui .a4h-liste[hidden] { display: none; }
.marke-ui .a4h-liste.is-oben { top: auto; bottom: calc(100% + 4px); }
.marke-ui .a4h-liste.is-statisch { position: static; }
.marke-ui .a4h-liste-suche { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--marke-linie); color: var(--marke-text-3); }
.marke-ui .a4h-liste-suche svg { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; }
.marke-ui .a4h-liste-suche input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--marke-text); font: 400 13px var(--marke-schrift); }
.marke-ui .a4h-liste-suche input::placeholder { color: var(--marke-text-3); }
.marke-ui .a4h-liste-inhalt { flex: 1; overflow-y: auto; padding: 4px; }
.marke-ui .a4h-liste-gruppe { padding: 8px 8px 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--marke-text-3); }
.marke-ui .a4h-option { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--marke-r-s); background: transparent; color: var(--marke-text); font: 400 13px var(--marke-schrift); text-align: left; cursor: pointer; }
.marke-ui .a4h-option > span:first-of-type { flex: 1; min-width: 0; }
.marke-ui .a4h-option .a4h-option-haken { width: 16px; height: 16px; flex: none; color: var(--marke-nav-blau); stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.marke-ui .a4h-option[aria-selected="true"] { color: var(--marke-nav-blau); font-weight: 600; }
.marke-ui .a4h-option[aria-selected="true"] .a4h-option-haken { visibility: visible; }
.marke-ui .a4h-option:hover, .marke-ui .a4h-option.is-fokus { background: var(--ui-hover); }
.marke-ui .a4h-option.is-eigen { color: var(--marke-text-2); }
.marke-ui .a4h-liste-leer { padding: 16px 12px; text-align: center; font-size: 13px; color: var(--marke-text-3); }

.marke-ui .a4h-liste:focus-visible { outline: 0; }
.marke-ui .a4h-liste.is-schwebend { position: fixed; z-index: 2147483000; max-height: 340px; }
.marke-ui .a4h-option[disabled] { opacity: .45; cursor: default; }

/* Jedes echte <select> sieht im neuen Design aus wie der Auswahl-Knopf;
   aufgeklappt wird unsere Liste (marke-ui-auswahl.js). Breite/Lage bleiben
   Sache der Seite. Ausnahme pro Feld: data-a4h-nativ. */
.marke-ui select:not([multiple]):not([size]):not([data-a4h-nativ]) {
  -webkit-appearance: none; appearance: none;
  min-height: 34px; padding: 0 32px 0 12px;
  border: 1px solid var(--marke-linie); border-radius: var(--marke-r-m);
  background-color: var(--marke-feld); color: var(--marke-text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888894' 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 10px center; background-size: 16px;
  font: 500 13px var(--marke-schrift); cursor: pointer;
}
.marke-ui select:not([multiple]):not([size]):not([data-a4h-nativ]):hover { border-color: var(--marke-text-3); }
.marke-ui select:not([multiple]):not([size]):not([data-a4h-nativ]):focus,
.marke-ui select.is-a4h-offen { outline: 0; border-color: var(--marke-akzent); box-shadow: var(--ui-fokus); }

/* Tastenkombination als Tasten: Strg + Umschalt + F5 */
.marke-ui .a4h-tasten { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.marke-ui .a4h-tasten kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid var(--marke-linie-stark); border-bottom-width: 2px; border-radius: 5px; background: var(--marke-flaeche); color: var(--marke-text); font: 600 11px var(--marke-schrift); }
.marke-ui .a4h-tasten i { font-style: normal; font-size: 11px; color: var(--marke-text-3); }
.marke-ui .a4h-option .a4h-tasten kbd { height: 20px; min-width: 20px; font-size: 10.5px; color: var(--marke-text-2); }

/* ═══ Belegung: Tastenkürzel und Maustasten ═════════════════════════════════
   Liste in einer Karte, Zeile = Aktion links, Steuerung rechts. Das Tasten-
   feld nimmt per Klick die nächste Kombination auf; Wirkung sofort, kein
   Speichern-Knopf. „Aus" nimmt die Belegung weg. */
.marke-ui .a4h-zeilen { border: 1px solid var(--marke-linie); border-radius: var(--marke-r-l); background: var(--marke-flaeche); }
.marke-ui .a4h-zeilen > .a4h-einstellung { padding: 12px 14px; }
.marke-ui .a4h-einstellung.is-aus > div:first-child { opacity: .55; }
.marke-ui .a4h-einstellung-steuerung { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; flex-wrap: wrap; }
.marke-ui .a4h-taste { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 168px; height: 34px; padding: 0 10px; border: 1px solid var(--marke-linie-stark); border-radius: var(--marke-r-m); background: var(--marke-flaeche-2); color: var(--marke-text); font: 600 12px var(--marke-schrift); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.marke-ui .a4h-taste:hover { border-color: var(--marke-akzent); }
.marke-ui .a4h-taste.is-leer { border-style: dashed; background: transparent; color: var(--marke-text-3); font-weight: 500; }
.marke-ui .a4h-taste.is-horcht { border-color: var(--marke-akzent); background: var(--marke-akzent-zart); color: var(--marke-akzent); box-shadow: var(--ui-fokus); animation: a4h-ui-horchen 1.2s ease-in-out infinite; }
.marke-ui .a4h-taste.is-fehler { border-color: var(--marke-gefahr); background: var(--ui-gefahr-zart); color: var(--marke-gefahr); }
@keyframes a4h-ui-horchen { 50% { box-shadow: 0 0 0 5px var(--marke-akzent-zart); } }
.marke-ui .a4h-hint.is-ok { color: var(--marke-ok); }
.marke-ui .a4h-btn--sec.is-scharf { border-color: var(--marke-gefahr); color: var(--marke-gefahr); background: var(--ui-gefahr-zart); }

/* Maus-Symbol: zeigt, welche Taste gemeint ist (Rad, Daumen vorn/hinten) */
.marke-ui .a4h-maus { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: var(--marke-r-m); background: var(--ui-nav-kachel); color: var(--ui-nav-ton); }
.marke-ui .a4h-maus svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.marke-ui .a4h-maus .is-gemeint { fill: currentColor; }
.marke-ui .a4h-belegung-name { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 220px; }
.marke-ui .a4h-belegung-name > span { display: grid; gap: 2px; min-width: 0; }

/* ═══ Widget-Fenster: Fenster, die das Desktop-Widget öffnet ════════════════
   Rahmenlos (frame:false) mit eigener Titelleiste. Hell, dieselben Bausteine
   wie im Workspace. Knöpfe rechts, die Hauptsache ganz außen. Rückfragen nur
   über das eigene Rückfrage-Fenster, nie die graue Windows-Box.
   Im Installer: Werte in desktop/renderer/_shared.css müssen diesen folgen. */
.marke-ui .a4h-fenster { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--marke-linie); border-radius: var(--marke-r-l); background: var(--marke-flaeche); box-shadow: var(--marke-schatten); }
.marke-ui .a4h-fenster-kopf { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 5px 0 14px; border-bottom: 1px solid var(--marke-linie); background: var(--marke-flaeche); -webkit-app-region: drag; user-select: none; }
.marke-ui .a4h-fenster-kopf img { height: 16px; width: auto; }
.marke-ui .a4h-fenster-kopf img.is-voll { height: 20px; } /* ganzes Logo statt Symbol, z. B. Anmeldung */
.marke-ui .a4h-fenster-kopf button, .marke-ui .a4h-fenster-kopf a, .marke-ui .a4h-fenster-kopf input, .marke-ui .a4h-fenster-kopf .a4h-tabs { -webkit-app-region: no-drag; }
.marke-ui .a4h-fenster-titel { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marke-ui .a4h-fenster-kopf .a4h-icon-btn { width: 30px; height: 30px; }
.marke-ui .a4h-fenster-zu:hover { background: var(--marke-gefahr); color: white; }
.marke-ui .a4h-fenster-inhalt { display: grid; gap: var(--marke-sp-3); align-content: start; flex: 1; padding: 20px; overflow: auto; font-size: 14px; color: var(--marke-text-2); }
.marke-ui .a4h-fenster-inhalt h3 { margin: 0; color: var(--marke-text); font-size: 15px; font-weight: 600; }
/* Fuß: weiß wie das Fenster, ohne graues Band (Ralph 17.10.2026) — wie der
   Dialog. Nur bei langen, scrollenden Fenstern trennt eine Linie (is-linie). */
.marke-ui .a4h-fenster-fuss { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--marke-sp-2); padding: 4px 20px 20px; background: var(--marke-flaeche); }
.marke-ui .a4h-fenster-fuss.is-linie { padding-top: 12px; padding-bottom: 12px; border-top: 1px solid var(--marke-linie); }
.marke-ui .a4h-fenster-fuss .a4h-hint { margin-right: auto; max-width: 46ch; }
.marke-ui .a4h-btn--breit { width: 100%; }
/* Pflicht-Hinweis (z. B. § 201 StGB vor der Besprechungsaufnahme) — darf nie wegfallen */
.marke-ui .a4h-pflicht { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--marke-linie); border-left: 3px solid var(--marke-aufnahme); border-radius: var(--marke-r-m); background: var(--marke-flaeche); color: var(--marke-text); }
.marke-ui .a4h-pflicht-punkt { width: 10px; height: 10px; margin-top: 6px; flex: none; border-radius: 999px; background: var(--marke-aufnahme); box-shadow: 0 0 0 4px color-mix(in srgb, var(--marke-aufnahme) 18%, transparent); }
.marke-ui .a4h-aufklapp { border: 1px solid var(--marke-linie); border-radius: var(--marke-r-m); }
.marke-ui .a4h-aufklapp > summary { padding: 8px 12px; color: var(--marke-akzent); font-weight: 600; font-size: 13px; cursor: pointer; }
.marke-ui .a4h-aufklapp > div { padding: 0 12px 10px; font-size: 13px; }
/* Einstellungen: Zeile = Text links, Steuerung rechts */
.marke-ui .a4h-einstellung { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--marke-sp-3); padding: 12px 0; border-bottom: 1px solid var(--marke-linie); }
.marke-ui .a4h-einstellung:last-child { border-bottom: 0; }
.marke-ui .a4h-einstellung > div:first-child:not(.a4h-belegung-name) { display: grid; gap: 2px; min-width: 0; flex: 1 1 220px; }
.marke-ui .a4h-einstellung b { color: var(--marke-text); font-size: 14px; font-weight: 600; }
.marke-ui .a4h-einstellung select.a4h-field { width: auto; min-width: 160px; } /* nur in Einstellungs-Zeilen schmal */
/* Startbild / Ladefehler: Logo, Ladekreis, ein Satz */
.marke-ui .a4h-startbild { display: grid; justify-items: center; gap: var(--marke-sp-4); padding: 36px 24px; text-align: center; color: var(--marke-text-2); font-size: 13px; }
.marke-ui .a4h-startbild img { width: 64px; height: auto; }

/* ═══ Desktop-Widget: dunkles Glas ══════════════════════════════════════════ */
/* marke-ausnahme: Das Widget bleibt dunkles Glas (Ralph 09.10.2026, REGELN „Festgelegt“) – schwebt über beliebigen Programmen und muss auf jedem Hintergrund lesbar sein. Nur Grafit, Schwarz/Weiß-Transparenzen und Markenfarben. */
.marke-ui .a4h-widget { position: relative; width: 400px; height: 330px; flex: none; }
.marke-ui .a4h-widget-kern { position: absolute; width: 132px; height: 132px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--marke-lila) 22%, white); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.marke-ui .a4h-widget-kern img { width: 96px; height: auto; }
.marke-ui .a4h-widget-platz { position: absolute; width: 52px; height: 52px; display: grid; place-items: center; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--marke-grafit) 78%, transparent); color: white; cursor: pointer; transition: background .15s; }
.marke-ui .a4h-widget-platz svg, .marke-ui .a4h-widget-punkt svg, .marke-ui .a4h-widget-knopf svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.marke-ui .a4h-widget-platz:hover { background: var(--marke-akzent); }
.marke-ui .a4h-widget-platz.is-laeuft { background: var(--marke-aufnahme); }
.marke-ui .a4h-widget-punkt { position: absolute; width: 36px; height: 36px; display: grid; place-items: center; border: 2px solid var(--marke-tuerkis); border-radius: 50%; background: var(--marke-grafit); color: white; cursor: pointer; }
.marke-ui .a4h-widget-punkt svg { width: 16px; height: 16px; }
.marke-ui .a4h-widget-eingabe { display: flex; align-items: center; gap: 6px; width: 440px; max-width: 100%; height: 54px; padding: 0 6px 0 20px; border: 1.5px solid color-mix(in srgb, var(--marke-lila) 60%, transparent); border-radius: var(--marke-r-pill); background: color-mix(in srgb, var(--marke-grafit) 92%, transparent); box-shadow: 0 12px 30px rgba(0, 0, 0, .35); color: white; }
.marke-ui .a4h-widget-eingabe input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: white; font: 400 16px var(--marke-schrift); }
.marke-ui .a4h-widget-eingabe input::placeholder { color: rgba(255, 255, 255, .5); }
.marke-ui .a4h-widget-knopf { width: 42px; height: 42px; display: grid; place-items: center; flex: none; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: white; cursor: pointer; }
.marke-ui .a4h-widget-knopf.is-senden { border: 1.5px solid var(--marke-lila); background: color-mix(in srgb, var(--marke-lila) 30%, transparent); }
.marke-ui .a4h-widget-knopf:hover { background: rgba(255, 255, 255, .16); }

/* ═══ Klappliste und Regel-Zeilen aus menue.css (Vorgaben, Team, Diktat, Postfach …) ═══ */
.marke-ui .falt > summary { font-weight: 600; }
.marke-ui .falt-stand { color: var(--marke-text-3); } /* dunkel sonst unlesbar (menue.css-Grauwert für Hell) */
.marke-ui .falt > summary::before {
  content: ""; width: 14px; height: 14px; flex: none; opacity: .55; background: currentColor; transition: transform .15s;
  -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 / 14px 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 / 14px no-repeat;
}
.marke-ui .falt[open] > summary::before { content: ""; transform: rotate(90deg); }
.marke-ui .falt > summary:hover, .marke-ui .falt > summary:focus-visible { color: var(--marke-text); }
.marke-ui .falt-stand { white-space: normal; text-align: right; max-width: 45%; line-height: 1.3; }
.marke-ui .regel-weg { width: 30px; height: 30px; flex: none; display: inline-grid; place-items: center; padding: 0; border-radius: var(--marke-r-m); color: var(--marke-text-2); font-size: 0; }
.marke-ui .regel-weg::before {
  content: ""; width: 16px; height: 16px; 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='M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6'/%3E%3C/svg%3E") center / 16px 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='M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.marke-ui .regel-weg:hover { background: color-mix(in srgb, var(--marke-gefahr) 11%, transparent); color: var(--marke-gefahr); }

/* Fehler-melden-Punkt (bug-button.js) flach wie ein Symbolknopf; Meldungen stehen darüber */
.marke-ui #a4h-bug-dot { background: var(--marke-flaeche) !important; border: 1px solid var(--marke-linie-stark) !important; box-shadow: var(--marke-schatten-leise) !important; color: var(--marke-text-2) !important; transform: none !important; }
.marke-ui .a4h-toast { bottom: 72px; }

/* ═══ Schmal: Seitenleiste weg, Kopfzeile scrollt ═══════════════════════════ */
@media (max-width: 760px) {
  .marke-ui .a4h-shell { grid-template-columns: minmax(0, 1fr); }
  .marke-ui .a4h-side { display: none; }
  .marke-ui .a4h-search { width: 140px; }
  .marke-ui .a4h-blase.is-eigen { max-width: 92%; }
}
@media (max-width: 460px) {
  .marke-ui .a4h-widget { zoom: .8; } /* nie nach rechts scrollen: einpassen statt abschneiden */
}
@media (prefers-reduced-motion: reduce) {
  .marke-ui *, .marke-ui *::before, .marke-ui *::after { animation: none !important; transition: none !important; }
}
