/* ============================================================================
   base.css — Lead-Portal: Tokens, Rahmen, alle Bausteine
   Reihenfolge: 1 Tokens · 2 Grund · 3 Rahmen · 4 Bausteine · 5 Ebenen (Dialog,
   Menü, Toast, Hover) · 6 Ziehen · 7 Suche, 404, Feedback · 8 Breiten
   Umbrüche: 600 / 960 / 1280. Bewegung: Feder (--feder), nie linear.
   ========================================================================== */

/* ───────────────────────────────── 1 Tokens ──────────────────────────────── */
:root {
  --grund: #F9FAFB;
  --flaeche: #FFFFFF;
  --mulde: #F2F4F7;
  --schwebe: #F9FAFB;
  --linie: #EAECF0;
  --linie-stark: #D0D5DD;
  --tinte: #101828;
  --tinte-2: #344054;
  --tinte-3: #475467;
  --tinte-4: #667085;
  --blass: #98A2B3;
  --akzent: #F2542D;                 /* kommt zur Laufzeit aus der Agentur (White-Label) */
  --akzent-tinte: #FFFFFF;
  --akzent-weich: color-mix(in srgb, var(--akzent) 10%, white);
  --gut: #17B26A;
  --warn: #F79009;
  --fehler: #F04438;
  --info: #2196F3;
  --radius: 12px;
  --radius-gross: 24px;                /* Dialoge */
  --schatten-1: 0 1px 2px rgba(16, 24, 40, .05);
  --schatten-2: 0 4px 8px -2px rgba(16, 24, 40, .10), 0 2px 4px -2px rgba(16, 24, 40, .06);
  --schatten-3: 0 12px 16px -4px rgba(16, 24, 40, .08), 0 4px 6px -2px rgba(16, 24, 40, .03);
  --feder: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1.004 83.8%, 1);
  --feder-ruhig: cubic-bezier(.22, 1, .36, 1);
  /* weiche Feder mit kleinem Überschwinger (~4 %): für lange Wege (Landung beim Ziehen, gleitende Linien) */
  --feder-sanft: linear(0, 0.063 2.5%, 0.218 5.4%, 0.674 12.6%, 0.862 16.6%, 0.969 20.4%, 1.018 23.4%, 1.043 27%, 1.047 31.4%, 1.034 38.2%, 1.008 50.4%, 0.998 62.6%, 1);
  --weg: cubic-bezier(.4, 0, 1, 1);  /* Austritt: zügig hinaus */

  /* Ergänzungen des Fundaments */
  --radius-klein: 8px;
  --seitenleiste: 284px;
  --rand: 32px;                      /* Seitenabstand des Inhalts */
  --schrift: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ring: 0 0 0 3px color-mix(in srgb, var(--akzent) 20%, transparent);
  --dunkel: rgba(0, 0, 0, .5);
  /* Wie im Original (Notiz 18): Fokus = 2 px fast schwarz; Dialoge mit kräftigem Schatten; Reiter-Grau = Schwarz 54 % */
  --fokus: rgba(0, 0, 0, .87);
  --fokus-feld: var(--akzent);       /* J1: Fokus-Rahmen der Eingabefelder (Original: Akzentfarbe) */
  --reiter-grau: rgba(0, 0, 0, .54);
  --schatten-dialog: 0 11px 15px -7px rgba(0, 0, 0, .2), 0 24px 38px 3px rgba(0, 0, 0, .14), 0 9px 46px 8px rgba(0, 0, 0, .12);
  --schatten-menue: 0 5px 5px -3px rgba(0, 0, 0, .2), 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px rgba(0, 0, 0, .12);
  --dialog-zeit: .3s cubic-bezier(.25, .8, .25, 1);
  --gut-weich: color-mix(in srgb, var(--gut) 11%, white);
  --warn-weich: color-mix(in srgb, var(--warn) 13%, white);
  --fehler-weich: color-mix(in srgb, var(--fehler) 10%, white);
  --info-weich: color-mix(in srgb, var(--info) 10%, white);
}

/* ───────────────────────────────── 2 Grund ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
/* Finger: kein blaues Aufblitzen beim Tippen; kein Ziehen-zum-Neuladen und kein Gummiband der ganzen Seite (gerollt wird
   nur in den Bereichen der App); touch-action: manipulation nimmt die Tipp-Verzögerung und den Doppeltipp-Zoom
   (Zoomen mit zwei Fingern bleibt). */
html { height: 100%; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; touch-action: manipulation; }
a, button, input, select, textarea, label, summary, [role="button"], [role="link"], [role="tab"], [role="checkbox"], [role="switch"], [role="radio"], [role="combobox"], [tabindex="0"] { touch-action: manipulation; }
body {
  height: 100%; margin: 0; overflow: hidden;
  background: var(--grund); color: var(--tinte);
  font: 400 14px/20px var(--schrift);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 600; color: var(--tinte); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: not-allowed; }
input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
small { font-size: 12px; line-height: 18px; }
::selection { background: color-mix(in srgb, var(--akzent) 22%, white); }
:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; }
/* K6 (C-5): Behälter, auf den der Fokus still zurückfällt, wenn sein Element verschwunden ist (ui.js: alsHeim) – kein Ring um eine ganze Seite */
[data-fokus-heim]:focus, [data-fokus-heim]:focus-visible { outline: none; }
[hidden] { display: none !important; }

/* schmale, ruhige Rollbalken */
* { scrollbar-width: thin; scrollbar-color: var(--linie-stark) transparent; }

.icon { flex: none; display: block; }
.nur-vorleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.zahlen { font-variant-numeric: tabular-nums; }
.gedaempft { color: var(--tinte-4); }

/* Grundtypen für Bereiche */
.abschnitt-titel { font-size: 18px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
.abschnitt-text { font-size: 14px; line-height: 20px; color: var(--tinte-3); margin-top: 2px; }
.leiste { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.leiste-luft { flex: 1; }

/* ───────────────────────────────── 3 Rahmen ──────────────────────────────── */
#app { height: 100vh; height: 100dvh; }
/* Seiten ohne Rahmen (Login): eigener Rollbereich über das ganze Fenster */
.frei { height: 100vh; height: 100dvh; overflow: auto; }
.rahmen { display: grid; grid-template-columns: var(--seitenleiste) minmax(0, 1fr); height: 100vh; height: 100dvh; }

/* Seitenleiste */
.seitenleiste {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--flaeche); border-right: 1px solid var(--linie); padding: 18px 16px 12px;
}
.wortmarke { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; min-width: 0; }
.wortmarke-zeichen {
  flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--akzent); color: var(--akzent-tinte); font-weight: 600; font-size: 16px; letter-spacing: -.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), var(--schatten-1);
}
.wortmarke--logo { flex: 1 1 auto; padding: 10px 12px 22px; }
/* Agentur-Logo: immer ganz, im eigenen Seitenverhältnis, nie gestreckt */
.wortmarke-logo { display: block; flex: none; width: auto; max-width: 100%; height: auto; max-height: 52px; object-fit: contain; object-position: left center; }
.wortmarke-name { font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seitenleiste .seitenleiste-x { display: none; margin-left: auto; } /* nur in der Schublade (< 960 px) */
.nav-trenner { height: 1px; background: var(--linie); margin: 0 0 14px; }

.nav-kunde {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 18px; min-width: 0;
  background: var(--schwebe); border: 1px solid var(--linie); border-radius: var(--radius);
}
.nav-kunde-text { min-width: 0; display: grid; }
.nav-kunde-text strong { font-weight: 600; font-size: 14px; line-height: 20px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.nav-kunde-text span { font-size: 13px; line-height: 18px; color: var(--tinte-4); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }

.nav-abschnitt { font-size: 12px; line-height: 18px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--tinte-4); padding: 0 12px; margin: 4px 0 6px; }
.nav-abschnitt:not(:first-child) { margin-top: 18px; }
.nav-liste { display: grid; gap: 2px; }
.nav-punkt {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; min-width: 0; width: 100%;
  border-radius: var(--radius); font-size: 16px; line-height: 22px; font-weight: 600; color: var(--tinte-2);
  transition: background-color .15s, color .15s;
}
.nav-punkt:hover { background: var(--schwebe); }
.nav-punkt.ist-aktiv { background: var(--mulde); color: var(--tinte); }
.nav-punkt .icon { color: var(--tinte-3); }
.nav-punkt.ist-aktiv .icon { color: var(--tinte); }
.nav-punkt-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; flex: 1; min-width: 0; }

.nav-rollbereich { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.nav-kampagne { height: 36px; font-size: 14px; line-height: 20px; font-weight: 500; gap: 14px; padding-left: 18px; }
.nav-kampagne .nav-ampel { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--linie-stark); transition: background-color .2s, box-shadow .2s; }
.nav-kampagne .nav-ampel.ist-neu { background: var(--gut); }
.nav-kampagne.ist-aktiv .nav-ampel { background: var(--akzent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 18%, transparent); }
.nav-kampagne.ist-aktiv { font-weight: 600; }

.nutzer-bereich { border-top: 1px solid var(--linie); margin-top: 12px; padding-top: 12px; }
.nutzer-kachel {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px 8px 10px; min-width: 0;
  border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche);
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.nutzer-kachel:hover, .nutzer-kachel[data-offen] { background: var(--schwebe); border-color: var(--linie-stark); }
.nutzer-kachel-text { display: grid; min-width: 0; flex: 1; text-align: left; }
.nutzer-kachel-text strong { font-size: 14px; line-height: 20px; font-weight: 600; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
/* E-Mail in einer Zeile (bricht sonst mitten im Wort); ist sie länger, kürzt sie mit title */
.nutzer-kachel-text span { font-size: 12px; line-height: 18px; color: var(--tinte-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Kundenzugang: der Name ist die E-Mail-Adresse → eine Zeile mit Auslassungspunkten statt Umbruch mitten im Wort (ganz im Tooltip) */
.nutzer-kachel-text--mail strong { display: block; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; }
.nutzer-kachel > .icon { color: var(--tinte-4); }

/* Hauptspalte */
.haupt { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; height: 100dvh; }
.mobil-leiste { display: none; }
.schublade-dunkel { display: none; }

/* --hinweis-zone: Höhe des Streifens ganz oben im Hauptbereich, der für Hinweise (Toasts) frei bleibt – dort liegt nie ein
   Bedienteil (ui.js: toastLage, „feste Zone"). Der Seitenkopf beginnt darunter. Am Handy und auf niedrigen Schirmen 0. */
:root { --hinweis-zone: 38px; }
.kopf { flex: none; padding: var(--hinweis-zone) var(--rand) 0; }
.kopf-zeile { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.seitentitel {
  position: relative; flex: 1; min-width: 0; font-size: 30px; line-height: 38px; font-weight: 600; letter-spacing: -.025em;
}
.seitentitel span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.seitentitel .titel-neu { animation: titel-ein .42s var(--feder-ruhig) backwards; }
.seitentitel .titel-alt { position: absolute; inset: 0; animation: titel-aus .24s ease both; pointer-events: none; }
@keyframes titel-ein { from { opacity: 0; transform: translateY(6px); } }
@keyframes titel-aus { to { opacity: 0; transform: translateY(-4px); } }
.kopf-archiv { flex: none; }   /* Marke „Archiviert" neben dem Seitentitel (archivierter Kunde, archivierte Kampagne) */
.kopf-werkzeug { display: flex; align-items: center; gap: 4px; flex: none; }
.kopf-aktionen { display: flex; align-items: center; gap: 8px; flex: none; margin-left: 8px; }
.kopf-aktionen:empty { display: none; }
/* „Abbrechen" im Seitenkopf hält seinen Platz, auch solange nichts geändert ist (unsichtbar, nicht bedienbar): Erschien der Knopf
   erst mit der ersten Änderung, rutschten Sprechblase und Lupe um seine Breite zur Seite. Am Handy (Leiste unten) fehlt er ganz. */
.kopf-aktionen .ist-platzhalter { visibility: hidden; pointer-events: none; }
.kopf-reiter { margin-top: 10px; }   /* keine durchgehende Linie unter den Reitern (Original) */
.kopf-unterreiter { margin-top: 14px; }
.kopf-untertitel { margin: 4px 0 8px; }

.inhalt { flex: 1; min-height: 0; overflow: auto; padding: 24px var(--rand) 48px; scrollbar-gutter: stable; }
/* nur Deckkraft: ein transform am Scrollbereich würde fest positionierte Leisten der Bereiche verschieben */
.inhalt-ein { animation: inhalt-ein .32s ease-out backwards; }
@keyframes inhalt-ein { from { opacity: 0; } }

/* ──────────────────────────────── 4 Bausteine ────────────────────────────── */

/* Knopf */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid transparent;
  font: 600 14px/20px var(--schrift); white-space: nowrap; user-select: none; cursor: pointer;
  transition: transform .45s var(--feder), background-color .15s, border-color .15s, box-shadow .15s, filter .15s, color .15s;
}
.knopf:active:not(:disabled) { transform: scale(.97); transition-duration: .11s, .15s, .15s, .15s, .15s, .15s; }
.knopf:disabled { opacity: .45; box-shadow: none; }
.knopf--haupt { background: var(--akzent); color: var(--akzent-tinte); }
.knopf--haupt:hover:not(:disabled) { filter: brightness(1.1); }
.knopf--umriss { background: var(--flaeche); border-color: var(--linie); color: var(--tinte-2); }
.knopf--umriss:hover:not(:disabled) { background: var(--mulde); }
.knopf--leise { color: var(--tinte-2); }
.knopf--leise:hover:not(:disabled) { background: var(--mulde); }
.knopf--gefahr { background: var(--fehler); color: #fff; }
.knopf--gefahr:hover:not(:disabled) { filter: brightness(1.07); }
.knopf--gefahr-umriss, .knopf.knopf--gefahr-umriss { background: var(--flaeche); border-color: color-mix(in srgb, var(--fehler) 45%, white); color: var(--fehler); }
.knopf.knopf--gefahr-umriss:hover:not(:disabled) { background: var(--fehler-weich); border-color: var(--fehler); filter: none; }
.knopf.knopf--akzent-umriss { background: var(--flaeche); border-color: color-mix(in srgb, var(--akzent) 45%, white); color: var(--akzent); }
.knopf.knopf--akzent-umriss:hover:not(:disabled) { background: var(--akzent-weich); border-color: var(--akzent); }
/* Drücken: kurz und weich hinein (kein Feder-Sprung), Loslassen federt zurück */
.knopf:active:not(:disabled), .icon-knopf:active:not(:disabled), button.chip:active, .haken:active:not(:disabled), .umschalter-teil:active, .pille--knopf:active { transition-timing-function: var(--feder-ruhig); }
.knopf--klein { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; gap: 6px; }
.knopf--voll { width: 100%; }
.knopf { max-width: 100%; }   /* nie breiter als die Umgebung; erst dann kürzt der Text (mit title) */
.knopf-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.dreher { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: drehen .7s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

/* Icon-Knopf */
.icon-knopf {
  position: relative; display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--radius);
  color: var(--tinte-2); border: 1px solid transparent;
  transition: transform .45s var(--feder), background-color .15s, color .15s, border-color .15s;
}
/* unter der Maus nur die graue Fläche, die Farbe des Symbols bleibt (Original); am Touch-Gerät wie bisher auch dunkler */
.icon-knopf:hover:not(:disabled), .icon-knopf[data-offen] { background: var(--mulde); }
@media (max-width: 959.98px), (pointer: coarse) { .icon-knopf:hover:not(:disabled), .icon-knopf[data-offen] { color: var(--tinte); } }
.icon-knopf:active:not(:disabled) { transform: scale(.92); transition-duration: .11s, .15s, .15s, .15s; }
.icon-knopf:disabled { opacity: .4; }
.icon-knopf.ist-aktiv { background: var(--mulde); color: var(--tinte); }
.icon-knopf--umriss { background: var(--flaeche); border-color: var(--linie); }
.icon-knopf--umriss:hover:not(:disabled) { background: var(--mulde); }
.icon-knopf--gefahr { color: var(--fehler); }
.icon-knopf--gefahr:hover:not(:disabled) { background: var(--fehler-weich); color: var(--fehler); }
.icon-knopf--klein { width: 32px; height: 32px; border-radius: 10px; }
.icon-knopf--gross { width: 48px; height: 48px; }
.icon-knopf-zahl {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--akzent); color: var(--akzent-tinte); font-size: 11px; line-height: 18px; font-weight: 600; text-align: center;
}

/* Felder */
/* --platz setzt Feld(): so breit wie der Platzhalter. Nie breiter als die Umgebung (kein Überlaufen). */
.feld-gruppe { display: grid; gap: 6px; min-width: min(100%, var(--platz, 0px)); }
.feld-etikett { display: flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--tinte-3); }
.feld-pflicht { color: var(--fehler); }
.feld-beschreibung { font-size: 13px; line-height: 18px; color: var(--tinte-4); margin-top: -2px; }
.feld-fehler { font-size: 13px; line-height: 18px; color: var(--fehler); }
/* Zähler im Feld (Feld({ maxLaenge })): erscheint ab 80 % der Länge, die die Daten-Schicht annimmt */
.feld-zaehler { flex: none; font-size: 12px; line-height: 16px; color: var(--tinte-4); white-space: nowrap; }
.feld-zaehler[hidden] { display: none; }
.feld-zaehler.ist-voll { color: var(--warn); font-weight: 600; }
/* Fehlersatz ohne Verrutschen (klasse: 'feld-fehler-fest' an Feld / Auswahl / FeldWertEingabe): Der Satz steht im Abstand zum
   nächsten Feld – der ist dafür 8 px größer –, nichts darunter bewegt sich, wenn er kommt oder geht. Für Formulare, die beim
   Tippen oder beim Verlassen eines Felds prüfen (sonst rutscht das Ziel des nächsten Klicks weg). */
.feld-fehler-fest { position: relative; margin-bottom: 8px; }
.feld-fehler-fest > .feld-fehler { position: absolute; left: 0; top: calc(100% + 2px); line-height: 16px; }   /* etwas Luft zum Etikett des nächsten Felds */
/* Handy: Mit Inter ist der längste Satz („Bitte gib mindestens Name, E-Mail oder Telefonnummer an") 361 px breit – eine Spur kleiner bleibt er einzeilig */
@media (max-width: 600px) { .feld-fehler-fest > .feld-fehler { font-size: 12px; letter-spacing: -.1px; } }
/* Gesperrte und nur lesbare Felder kürzen mit Auslassung (statt mitten im Wort abzuschneiden); der ganze Text steht im title der Umgebung */
.feld-eingabe:disabled, .feld-eingabe[readonly] { text-overflow: ellipsis; }
/* K6: Feld für ein Geheimnis (API-Schlüssel, Token) – ein Textfeld, das seinen Inhalt als Punkte zeigt (ui.js: Geheimfeld) */
.feld--geheim .feld-eingabe { -webkit-text-security: disc; text-security: disc; }
.feld--geheim .feld-eingabe::placeholder { -webkit-text-security: none; text-security: none; }
.feld {
  display: flex; align-items: center; gap: 8px; min-height: 40px; min-width: 0; padding: 0 12px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten-1);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.feld:hover { border-color: var(--linie-stark); }
/* Fokus wie im Original: Rahmen 2 px (1 px Rahmen + 1 px Ring: nichts verrutscht), kein farbiger Hof.
   J1 (25.10., Janniks Liste 18): im Original in der AKZENTFARBE (#FE471F) – Kundenzugang-Dialog, Kundenname, Editor; nur das
   Suchfeld im Filtermenü bleibt dort fast schwarz (.menue-suche, var(--fokus)). Sichtbarkeit: Akzent auf Weiß ≥ 3 : 1 (Rahmen,
   kein Text); zusammen mit dem Textcursor bleibt das aktive Feld klar erkennbar. */
.feld:focus-within, .feld.auswahl:focus-visible, .feld.auswahl[data-offen] { border-color: var(--fokus-feld); box-shadow: 0 0 0 1px var(--fokus-feld); outline: none; }
.feld--fehler, .feld--fehler:hover { border-color: var(--fehler); }
.feld--fehler:focus-within { border-color: var(--fehler); box-shadow: 0 0 0 1px var(--fehler), 0 0 0 3px color-mix(in srgb, var(--fehler) 18%, transparent); }
.feld--aus { background: var(--schwebe); color: var(--tinte-4); box-shadow: none; pointer-events: none; }
.feld--klein { min-height: 32px; border-radius: 10px; padding: 0 10px; }
.feld-icon { color: var(--tinte-2); }
.feld-eingabe {
  flex: 1; min-width: 0; width: 100%; height: 38px; padding: 0; border: 0; outline: 0; background: transparent;
  font: 400 16px/24px var(--schrift); color: var(--tinte);
}
.feld--klein .feld-eingabe { height: 30px; font-size: 14px; }
.feld-eingabe::placeholder { color: var(--blass); opacity: 1; text-overflow: ellipsis; }
.feld-eingabe:placeholder-shown { text-overflow: ellipsis; }
.feld--text { padding: 8px 12px; align-items: stretch; }
.feld--text .feld-eingabe { height: auto; min-height: 72px; resize: vertical; }
.feld-leeren { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: var(--tinte-4); flex: none; }
.feld-leeren:hover { background: var(--mulde); color: var(--tinte); }

/* Auswahl */
.auswahl { cursor: pointer; user-select: none; }
.auswahl-wert, .auswahl-platzhalter, .auswahl-chips { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 16px; line-height: 24px; }
.feld--klein .auswahl-wert, .feld--klein .auswahl-platzhalter { font-size: 14px; }
.auswahl-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auswahl-platzhalter { display: block; color: var(--blass); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auswahl-chips { flex-wrap: wrap; gap: 6px; padding: 6px 0; }
.auswahl-pfeil { color: var(--blass); transition: transform .35s var(--feder); }
.auswahl[data-offen] .auswahl-pfeil { transform: rotate(180deg); }
/* J1 (Liste 14): Symbol vor dem Wert (Briefumschlag im „Standard-Sender“): 20 px, der Text beginnt 16 px danach wie im Original */
.auswahl-vor { flex: none; color: var(--tinte-2); margin-right: 8px; }

/* Sortierwahl: Richtungs-Knopf + Auswahl in einem Feld */
.sortierwahl { display: inline-flex; align-items: stretch; min-width: 0; }
.sortierwahl-richtung {
  display: grid; place-items: center; flex: none; width: 40px; border: 1px solid var(--linie); border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius); background: var(--flaeche); color: var(--tinte-2);
  transition: background-color .15s, color .15s;
}
.sortierwahl-richtung:hover { background: var(--schwebe); color: var(--tinte); }
.sortierwahl-richtung .icon { transition: transform .5s var(--feder); }
.sortierwahl-richtung.ist-ab .icon { transform: scaleY(-1); }
.sortierwahl .feld-gruppe { min-width: 0; }
.sortierwahl-feld { border-radius: 0 var(--radius) var(--radius) 0; min-width: 190px; }

/* Punkt, Pille, Marke, Zahl, Chip */
.punkt { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--f, var(--tinte-4)); }
.pille {
  --f: var(--tinte-4);
  /* Original: 26 hoch, Radius 16, Innenabstand 3/9/3/7, Text 12/500/20 in der vollen Statusfarbe. Die hellen Töne rechnet das
     Original im Farbraum OKLAB aus der Statusfarbe (Notiz 20, an allen acht Tönen nachgerechnet): Fläche 8 %, Rand 36 % auf Weiß. */
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px 0 7px; border-radius: 16px; max-width: 100%;
  background: color-mix(in oklab, var(--f) 8%, white); border: 1px solid color-mix(in oklab, var(--f) 36%, white);
  color: var(--f); font-size: 12px; line-height: 20px; font-weight: 500; white-space: nowrap;
}
.pille-punkt { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--f); }
.pille-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pille--klein { height: 22px; padding: 0 8px; font-size: 12px; line-height: 18px; gap: 6px; }
/* Status-Knopf (Lead-Fenster): 40 hoch, Innenabstand 10/16, Punkt 8, Pfeil 20 px in Statusfarbe; Töne wie im Original:
   Fläche 12 % auf Weiß, Rand 36 %, Text 76 % der Statusfarbe auf Schwarz (alles in OKLAB) */
.pille--knopf { height: 40px; padding: 0 16px; border-radius: var(--radius); font-size: 14px; font-weight: 600; gap: 8px; background: color-mix(in oklab, var(--f) 12.5%, white); color: color-mix(in oklab, var(--f) 76%, black); transition: filter .15s, transform .45s var(--feder); }
.pille--knopf .pille-punkt { width: 8px; height: 8px; }
.pille--knopf > .icon { color: var(--f); }
.pille--knopf:active { transform: scale(.97); }

.marke {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap;
  background: var(--schwebe); border: 1px solid var(--linie); color: var(--tinte-2);
}
.marke--hoch { height: 26px; }   /* Zähl-Marken in Karten und Listen (Original: 26 hoch) */
.marke--info { background: color-mix(in srgb, var(--info) 5%, white); border-color: color-mix(in srgb, var(--info) 30%, white); color: var(--info); }
.marke--gut { background: var(--gut-weich); border-color: color-mix(in srgb, var(--gut) 28%, white); color: color-mix(in srgb, var(--gut) 78%, black); }
.marke--warn { background: var(--warn-weich); border-color: color-mix(in srgb, var(--warn) 32%, white); color: color-mix(in srgb, var(--warn) 72%, black); }
.marke--fehler { background: #FEF3F2; border-color: #FECDCA; color: #B42318; }
.marke--akzent { background: color-mix(in srgb, var(--akzent) 5%, white); border-color: color-mix(in srgb, var(--akzent) 30%, white); color: var(--akzent); }

.zahl {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px;
  background: var(--schwebe); border: 1px solid var(--linie); color: var(--tinte-2);
  font-size: 12px; line-height: 16px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.zahl--info { background: color-mix(in srgb, var(--info) 5%, white); border-color: color-mix(in srgb, var(--info) 30%, white); color: var(--info); }
.zahl--gut { background: var(--gut-weich); border-color: color-mix(in srgb, var(--gut) 28%, white); color: color-mix(in srgb, var(--gut) 78%, black); }
.zahl--warn { background: var(--warn-weich); border-color: color-mix(in srgb, var(--warn) 32%, white); color: color-mix(in srgb, var(--warn) 72%, black); }
.zahl--fehler { background: #FEF3F2; border-color: #FECDCA; color: #B42318; }
.zahl--akzent { background: var(--akzent-weich); border-color: color-mix(in srgb, var(--akzent) 30%, white); color: color-mix(in srgb, var(--akzent) 82%, black); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; max-width: 100%;
  background: var(--flaeche); border: 1px solid var(--linie); color: var(--tinte-3);
  font-size: 13px; line-height: 18px; font-weight: 500; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .45s var(--feder);
}
button.chip:hover { border-color: var(--linie-stark); color: var(--tinte); }
button.chip:active { transform: scale(.96); transition-duration: .15s, .15s, .15s, .11s; }
.chip.ist-aktiv { background: var(--akzent-weich); border-color: color-mix(in srgb, var(--akzent) 42%, white); color: color-mix(in srgb, var(--akzent) 86%, black); }
.chip--grau.ist-aktiv { background: var(--mulde); border-color: var(--linie-stark); color: var(--tinte); }
.chip { min-width: 0; }
.chip-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip-zahl { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--tinte-4); }
.chip.ist-aktiv .chip-zahl { color: inherit; }
.chip-x { display: grid; place-items: center; width: 16px; height: 16px; margin-right: -4px; border-radius: 50%; color: var(--tinte-4); }
.chip-x:hover { background: var(--mulde); color: var(--tinte); }

/* Schalter */
.schalter-zeile { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.schalter-zeile.ist-aus { opacity: .5; }
.schalter {
  position: relative; flex: none; width: 44px; height: 24px; border-radius: 999px; background: var(--linie);
  transition: background-color .2s; margin-top: 0;
}
.schalter-knauf {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .25); transition: transform .5s var(--feder), width .2s, background-color .2s;
}
.schalter:active:not(:disabled) .schalter-knauf { width: 22px; }
/* an: Bahn in halb durchscheinendem Akzent (auf Weiß: rosa), Knopf in Akzentfarbe – wie im Original */
.schalter.ist-an { background: color-mix(in srgb, var(--akzent) 50%, white); }
.schalter.ist-an .schalter-knauf { transform: translateX(20px); background: var(--akzent); }
.schalter.ist-an:active:not(:disabled) .schalter-knauf { transform: translateX(16px); }
.schalter--klein { width: 36px; height: 20px; }
.schalter--klein .schalter-knauf { width: 14px; height: 14px; }
.schalter--klein.ist-an .schalter-knauf { transform: translateX(16px); }
.schalter-text { display: grid; gap: 2px; min-width: 0; padding-top: 2px; }
/* Erweitert (ui.js, Runde 4b): eingeklappter Teil eines Formulars – eine Textzeile mit Pfeil, aufgeklappt die Felder darunter */
.erweitert { min-width: 0; }
.erweitert > summary { display: flex; width: fit-content; align-items: center; gap: 6px; min-height: 20px; border-radius: 6px; cursor: pointer; list-style: none;
  font-size: 14px; line-height: 20px; font-weight: 500; color: var(--tinte-3); }
.erweitert > summary::-webkit-details-marker { display: none; }
.erweitert > summary:hover { color: var(--tinte); }
.erweitert > summary .icon { flex: none; transition: transform .45s var(--feder); }
.erweitert[open] > summary .icon { transform: rotate(90deg); }
.erweitert-inhalt { display: grid; gap: 16px; min-width: 0; padding-top: 16px; }
@media (pointer: coarse) { .erweitert > summary { min-height: 44px; } }
.schalter-titel { display: flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--tinte-3); cursor: pointer; }
.schalter-text small { color: var(--tinte-4); }

/* Haken */
.haken {
  display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 6px;
  background: var(--flaeche); border: 1.5px solid var(--linie-stark); color: #fff;
  transition: background-color .15s, border-color .15s, transform .45s var(--feder);
}
.haken:active:not(:disabled) { transform: scale(.88); transition-duration: .15s, .15s, .11s; }
.haken.ist-an { background: var(--akzent); border-color: var(--akzent); }
.haken .icon { animation: haken-ein .4s var(--feder) backwards; }
@keyframes haken-ein { from { transform: scale(.4); opacity: 0; } }
.haken:disabled { opacity: .45; }
.haken-zeile { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.haken-zeile.ist-aus { opacity: .5; }
.haken-text { font-size: 14px; line-height: 20px; color: var(--tinte-2); cursor: pointer; }

/* Reiter */
.reiter { position: relative; display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.reiter::-webkit-scrollbar { display: none; }
.reiter-eintrag {
  position: relative; display: inline-flex; align-items: center; gap: 8px; flex: none; height: 36px; padding: 0 3px;
  font-size: 14px; line-height: 20px; font-weight: 600; color: var(--reiter-grau); white-space: nowrap; border-radius: 6px 6px 0 0;
  transition: color .15s, background-color .15s;
}
.reiter-eintrag:hover:not(:disabled) { background: var(--mulde); }
.reiter-eintrag::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--akzent);
  transform: scaleX(0); transition: transform .45s var(--feder);
}
.reiter-eintrag.ist-aktiv { color: var(--akzent); }
.reiter-eintrag.ist-aktiv::after { transform: scaleX(1); }
/* Sobald ui.js die Lage gemessen hat ([data-strich]), übernimmt EINE Linie, die zum aktiven Reiter gleitet. */
.reiter-strich {
  position: absolute; left: 0; bottom: 0; width: 100px; height: 2px; border-radius: 1px; background: var(--akzent); pointer-events: none;
  transform-origin: 0 50%; transform: translateX(var(--rx, 0px)) scaleX(var(--rb, 0)); opacity: 0;
}
.reiter[data-strich] > .reiter-strich { opacity: 1; transition: transform .55s var(--feder-sanft); }
.reiter[data-strich] > .reiter-eintrag::after { display: none; }
.reiter-eintrag:focus-visible { outline-offset: -2px; border-radius: 6px; }
.reiter-eintrag:disabled { opacity: .45; }
.reiter-zahl { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--mulde); color: var(--tinte-3); font-size: 12px; line-height: 20px; text-align: center; }

/* Umschalter (graue Schale) */
.umschalter { display: inline-flex; gap: 0; padding: 2px; border-radius: var(--radius); background: var(--linie); flex: none; }
.umschalter-teil {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; color: var(--tinte-4); transition: background-color .15s, color .15s, box-shadow .15s, transform .45s var(--feder);
}
.umschalter-teil.nur-icon { width: 36px; padding: 0; }
.umschalter-teil:hover { color: var(--tinte-2); }
.umschalter-teil:active { transform: scale(.94); transition-duration: .15s, .15s, .15s, .11s; }
.umschalter-teil.ist-aktiv { background: var(--flaeche); color: var(--tinte); box-shadow: 0 1px 3px rgba(16, 24, 40, .1), 0 1px 2px rgba(16, 24, 40, .06); }
.umschalter--klein .umschalter-teil { height: 28px; font-size: 13px; padding: 0 10px; }

/* Karte */
.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten-1);
  transition: box-shadow .15s cubic-bezier(.4, 0, .2, 1);
}
/* unter der Maus nur der Schatten – kein Anheben, der Rahmen bleibt (wie im Original) */
a.karte:hover, button.karte:hover, .karte.ist-klickbar:hover { box-shadow: var(--schatten-2); }

/* Avatar */
.avatar {
  display: inline-grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden;
  background: var(--mulde); color: var(--tinte-2); border: 1px solid var(--linie);
  font-weight: 600; letter-spacing: -.01em; line-height: 1; user-select: none;
}
/* 25.10. (David): Logos passen immer GANZ in den Kreis – weißer Grund, Luft rundum, nichts angeschnitten (vorher cover).
   15 % Rand: so liegt auch ein breites Logo vollständig im Kreis (die Ecken des Bildfelds bleiben innerhalb). */
.avatar:has(> img) { background: #fff; }
.avatar img { width: 100%; height: 100%; object-fit: contain; padding: 15%; box-sizing: border-box; }
.avatar--akzent { background: var(--akzent); color: var(--akzent-tinte); border-color: transparent; }
.avatar--gruen { background: var(--gut-weich); border-color: color-mix(in srgb, var(--gut) 40%, white); color: color-mix(in srgb, var(--gut) 80%, black); }
.avatar--orange { background: var(--warn-weich); border-color: color-mix(in srgb, var(--warn) 45%, white); color: color-mix(in srgb, var(--warn) 74%, black); }
.avatar--rot { background: var(--fehler-weich); border-color: color-mix(in srgb, var(--fehler) 40%, white); color: color-mix(in srgb, var(--fehler) 82%, black); }
.avatar--grau { background: var(--schwebe); border-color: var(--linie-stark); color: var(--tinte-3); }
.avatar-stapel { display: inline-flex; align-items: center; }
.avatar-stapel .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--flaeche); transition: transform .45s var(--feder); cursor: default; }
.avatar-stapel .avatar:first-child { margin-left: 0; }
.avatar-stapel .avatar:hover, .avatar-stapel .avatar:focus-visible { transform: translateY(-2px) scale(1.06); z-index: 1; }
.avatar--mehr { background: var(--flaeche); border-color: var(--linie-stark); color: var(--tinte-3); font-size: 11px; }

/* Ampel-Punkt */
.ampel { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--blass); }
.ampel--gruen { background: var(--gut); }
.ampel--orange { background: var(--warn); }
.ampel--rot { background: var(--fehler); }
.ampel--grau { background: var(--blass); }

/* Icon-Kachel */
.icon-kachel {
  display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 10px;
  background: var(--flaeche); border: 1px solid var(--linie); color: var(--tinte-4); box-shadow: var(--schatten-1);
}
.icon-kachel--klein { width: 36px; height: 36px; border-radius: 10px; }
.icon-kachel--akzent { background: var(--akzent-weich); border-color: color-mix(in srgb, var(--akzent) 28%, white); color: var(--akzent); }

/* Leerzustand */
.leer { display: grid; justify-items: center; gap: 6px; padding: 56px 24px; text-align: center; }
.leer .icon-kachel { margin-bottom: 10px; }
.leer h3 { font-size: 16px; line-height: 24px; }
.leer p { max-width: 380px; color: var(--tinte-3); }
.leer-aktion { margin-top: 14px; }
.leer--klein { padding: 28px 16px; }

/* Skelett */
.skelett { display: grid; gap: 12px; }
.skelett i {
  display: block; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, var(--mulde) 25%, var(--schwebe) 37%, var(--mulde) 63%); background-size: 400% 100%;
  animation: schimmer 1.4s ease infinite;
}
@keyframes schimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
.skelett-zeile { display: flex; align-items: center; gap: 24px; height: 56px; padding: 0 16px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); }
.skelett--karten { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.skelett-karte { display: grid; gap: 14px; padding: 22px 20px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); }
.skelett-karte i:first-child { height: 16px; }

/* Hinweis-Icon („?") */
.hinweis-icon { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; color: var(--tinte-4); cursor: help; }
.hinweis-icon:hover, .hinweis-icon:focus-visible { color: var(--tinte); }

/* Statusbalken */
.statusbalken { display: flex; gap: 2px; height: 5px; min-width: 0; }
.statusbalken.ist-leer { background: var(--mulde); }
.statusbalken-teil { flex: 1 1 0; min-width: 6px; height: 100%; border-radius: 0; background: var(--f, var(--tinte-4)); transition: transform .35s var(--feder), flex-grow .5s var(--feder-ruhig); transform-origin: center bottom; }
.statusbalken-teil:hover { transform: scaleY(1.8); }

/* Tabelle */
.tabelle-rahmen { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); overflow: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.tabelle th {
  position: sticky; top: 0; z-index: 1; padding: 12px 16px; text-align: left; white-space: nowrap;
  font-size: 12px; line-height: 18px; font-weight: 500; color: var(--tinte-3); background: #FCFCFD; border-bottom: 1px solid var(--linie);
}
.tabelle td { padding: 14px 16px; border-bottom: 1px solid var(--linie); color: var(--tinte-3); vertical-align: middle; }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle tbody tr { transition: background-color .12s; }
.tabelle tbody tr.ist-klickbar { cursor: pointer; }
.tabelle tbody tr.ist-klickbar:hover, .tabelle tbody tr.ist-gewaehlt { background: var(--mulde); }
.tabelle tbody tr:focus-visible { outline-offset: -2px; }
.tabelle .ist-rechts { text-align: right; }
.tabelle .ist-mitte { text-align: center; }
.tabelle th.ist-sortiert { color: var(--tinte); font-weight: 600; }
.tabelle-sort { display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; }
.tabelle-sort .icon { color: var(--tinte-4); }   /* Sortier-Symbol: immer zu sehen (Original) */
/* unter der Maus wird der Spaltenkopf fett (Original); am Touch-Gerät wie bisher dunkler */
.tabelle-sort:hover { font-weight: 600; }
@media (max-width: 959.98px), (pointer: coarse) { .tabelle-sort:hover { font-weight: inherit; color: var(--tinte); } }
.tabelle--kompakt td { padding: 10px 16px; }

/* Seitenwahl (Tabellenfuß) */
.seitenwahl { display: flex; align-items: center; gap: 8px; padding: 10px 4px 0; color: var(--tinte-3); font-size: 14px; }
.seitenwahl-luft { flex: 1; }
.seitenwahl-groesse { display: inline-flex; align-items: center; justify-content: space-between; gap: 4px; width: 96px; height: 40px; padding: 0 12px; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--flaeche); font-size: 16px; font-weight: 400; color: var(--tinte); }
.seitenwahl-groesse .icon { color: var(--blass); }
.seitenwahl-groesse:hover, .seitenwahl-groesse[data-offen] { box-shadow: 0 1px 3px rgba(16, 24, 40, .1), 0 1px 2px rgba(16, 24, 40, .06); }

/* Einstellungs-Zeile */
.einstellung { display: grid; grid-template-columns: minmax(200px, 320px) minmax(0, 560px); gap: 12px 40px; padding: 22px 0; border-bottom: 1px solid var(--linie); }
.einstellung:last-child { border-bottom: 0; }
.einstellung-links h4 { display: flex; align-items: center; gap: 6px; font-size: 14px; line-height: 20px; font-weight: 600; }
.einstellung-links p { margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--tinte-3); }
.einstellung-rechts { display: grid; gap: 12px; align-content: start; min-width: 0; }

/* Ablage (Upload) */
.ablage {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 24px 16px; text-align: center; cursor: pointer;
  background: var(--flaeche); border: 1.5px dashed var(--linie-stark); border-radius: var(--radius);
  transition: border-color .2s, background-color .2s, transform .45s var(--feder);
}
.ablage:hover, .ablage:focus-within { border-color: var(--akzent); }
.ablage[data-ueber] { border-color: var(--akzent); background: var(--akzent-weich); transform: scale(1.01); }
.ablage.ist-aus { opacity: .5; pointer-events: none; }
.ablage-eingabe { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ablage-text { font-weight: 600; color: var(--tinte-2); }
.ablage-hilfe { font-size: 13px; color: var(--tinte-4); }
.ablage--klein { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; gap: 0 12px; padding: 12px 14px; text-align: left; }
.ablage--klein .icon-kachel { grid-row: 1 / span 2; }
.ablage--klein .ablage-text, .ablage--klein .ablage-hilfe { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Editor */
.editor { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s; }
.editor:focus-within { border-color: var(--fokus-feld); box-shadow: 0 0 0 1px var(--fokus-feld); }
.editor-text { padding: 12px 14px; outline: none; font-size: 14px; line-height: 22px; color: var(--tinte); overflow-wrap: anywhere; max-height: 50vh; max-height: 50dvh; overflow-y: auto; }
.editor-text:empty::before { content: attr(data-platzhalter); color: var(--blass); pointer-events: none; }
.editor-text a, .formatiert a { color: var(--akzent); text-decoration: underline; }
.editor-text ul, .editor-text ol, .formatiert ul, .formatiert ol { margin: 4px 0; padding-left: 22px; }
.editor-text p, .formatiert p { margin: 0 0 6px; }
.editor-text p:last-child, .formatiert p:last-child { margin-bottom: 0; }
.formatiert { font-size: 14px; line-height: 22px; overflow-wrap: anywhere; }
.editor-leiste { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-top: 1px solid var(--linie); }
.editor-luft { flex: 1; }
.editor-groesse { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--tinte-3); }
.editor-groesse:hover, .editor-groesse[data-offen] { background: var(--mulde); color: var(--tinte); }

/* ───────────────────── 5 Ebenen: Dialog, Menü, Toast, Hover ──────────────── */
.ebenen { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.ebenen > * { pointer-events: auto; }

.dialog-huelle {
  position: fixed; inset: 0; display: grid; place-items: center; overflow: hidden;
  /* oben 40 px: darüber liegt der Streifen für Hinweise (ui.js: toastLage, „feste Zone") – kein Dialog reicht hinein */
  padding: max(40px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: var(--dunkel); animation: dunkel-ein .3s cubic-bezier(.25, .8, .5, 1) backwards;
}
.dialog-huelle:not([data-ebene="1"]) { background: rgba(16, 24, 40, .3); }
/* Computer: oben und unten 36 px wie im Original (ein 653 hoher Dialog im 726 hohen Fenster). Die Hinweise schweben in diesen 36 px. */
@media (min-width: 960px) { .dialog-huelle { padding-top: max(36px, 5vh); padding-bottom: max(36px, 5vh); } }
.dialog {
  display: flex; flex-direction: column; width: min(var(--breite, 560px), 100%); max-height: 100%; min-height: 0; overflow: hidden; outline: none;
  background: var(--flaeche); border-radius: var(--radius-gross);
  box-shadow: var(--schatten-dialog);
  animation: dialog-ein var(--dialog-zeit) backwards; transform-origin: 50% 50%;
}
.dialog--voll { width: min(1400px, 100%); height: 100%; }
@media (min-width: 960px) { .dialog--voll { width: 90vw; } }   /* Lead-Fenster: 90 % von Breite und Höhe (Original: 1217 × 653 bei 1352 × 726) */
.dialog--hoch { height: 100%; }
/* Oberkante festgehalten (ui.js, haltOben): ändert sich die Höhe des Inhalts, wächst und schrumpft der Dialog nach unten,
   statt um die Mitte zu springen. Am Handy (Vollbild, Blatt von unten) setzt ui.js das nicht. */
.dialog-huelle[data-fest] { align-items: start; }
/* opt.oben (ui.js): von Anfang an oben verankert – für Dialoge, die beim Bedienen um ganze Abschnitte wachsen */
.dialog-huelle--oben { align-items: start; }
.dialog-huelle[data-fest] > .dialog { margin-top: var(--dialog-oben, 0px); max-height: calc(100% - var(--dialog-oben, 0px)); }   /* die Oberkante bleibt: unten rollt der Inhalt */
/* Rollender Inhalt (ui.js, rollSchatten): Schatten am Kopf bzw. Fuß – oder, ohne Fuß, am unteren Rand –, solange darüber / darunter etwas folgt */
.dialog > .dialog-kopf, .dialog > .dialog-fuss { position: relative; z-index: 1; transition: box-shadow .2s; }
.dialog[data-mehr-oben] > .dialog-kopf { box-shadow: 0 10px 14px -12px rgba(16, 24, 40, .28); }
.dialog[data-mehr-unten] > .dialog-fuss { box-shadow: 0 -10px 14px -12px rgba(16, 24, 40, .28); }
.dialog[data-mehr-unten]:not(:has(> .dialog-fuss))::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 18px; pointer-events: none;
  background: linear-gradient(to top, rgba(16, 24, 40, .1), transparent); border-radius: 0 0 var(--radius-gross) var(--radius-gross); }
.dialog { position: relative; }
@keyframes dunkel-ein { from { opacity: 0; } }
@keyframes dialog-ein { from { opacity: 0; transform: scale(.8); } }
.dialog-huelle.geht { animation: dunkel-aus .2s var(--weg) both; pointer-events: none; }
.dialog-huelle.geht .dialog { animation: dialog-aus .2s var(--weg) both; }
@keyframes dunkel-aus { to { opacity: 0; } }
@keyframes dialog-aus { to { opacity: 0; transform: scale(.96); } }

.dialog-kopf { display: flex; align-items: center; gap: 16px; flex: none; min-height: 91px; padding: 24px 24px 16px; border-bottom: 1px solid var(--linie); }
.dialog-kopf .dialog-x { align-self: flex-start; margin: -4px -8px 0 0; color: var(--tinte-4); }
/* Tablet und Handy: Kopf so hoch wie sein Inhalt, das X bleibt mittig und innerhalb der sicheren Ränder (wie vor der Optik-Angleichung) */
@media (max-width: 959.98px) { .dialog-kopf { min-height: 0; } .dialog-kopf .dialog-x { align-self: center; margin: 0; } }
@media (pointer: fine) { .dialog-kopf .dialog-x .icon { width: 24px; height: 24px; } }   /* Schließen-Symbol 24 px wie im Original */
.dialog-titel { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dialog-titel h2 { font-size: 18px; line-height: 28px; letter-spacing: -.01em; }
.dialog-titel p { font-size: 14px; line-height: 20px; color: var(--tinte-3); }
.dialog-kopf-rechts { display: flex; align-items: center; gap: 8px; flex: none; }
.dialog-inhalt { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 24px; display: grid; gap: 18px; align-content: start; grid-auto-rows: max-content; }
.dialog-inhalt:empty { display: none; }
.dialog-inhalt--ohne-rand { padding: 0; gap: 0; }
.dialog-text { color: var(--tinte-3); font-size: 14px; line-height: 22px; }
/* Fuß: kein abgesetzter grauer Bereich und keine Linie – alles weiß, wie im Original */
.dialog-fuss { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex: none; padding: 8px 24px 24px; background: var(--flaeche); }
.dialog--frage .dialog-kopf { border-bottom: 0; padding-bottom: 8px; }
.dialog--frage .dialog-inhalt { padding-top: 0; }
.dialog--gefahr .icon-kachel { background: var(--fehler-weich); border-color: color-mix(in srgb, var(--fehler) 28%, white); color: var(--fehler); }
/* Bausteine für Dialog-Inhalte */
.dialog-abschnitt { display: grid; gap: 4px; }
.dialog-abschnitt h3 { font-size: 16px; line-height: 24px; }
.dialog-abschnitt p { color: var(--tinte-3); }
.schalter-liste { display: grid; gap: 18px; padding: 6px 4px; }

/* Menü */
.menue {
  position: fixed; display: flex; flex-direction: column; min-width: 200px; max-width: min(440px, calc(100vw - 16px)); overflow: hidden; outline: none;
  padding: 8px; background: var(--flaeche); border: 0; border-radius: var(--radius); box-shadow: var(--schatten-menue);
  animation: menue-ein .3s cubic-bezier(.25, .8, .25, 1) backwards;
}
.menue[data-seite="oben"] { animation-name: menue-ein-oben; }
@keyframes menue-ein { from { opacity: 0; transform: translateY(-6px); } }
@keyframes menue-ein-oben { from { opacity: 0; transform: translateY(6px); } }
.menue.geht { animation: menue-aus .14s var(--weg) both; pointer-events: none; }
.menue.geht[data-seite="oben"] { animation-name: menue-aus-oben; }
@keyframes menue-aus { to { opacity: 0; transform: translateY(-4px) scale(.985); } }
@keyframes menue-aus-oben { to { opacity: 0; transform: translateY(4px) scale(.985); } }
.menue-kopf { display: flex; align-items: center; gap: 8px; flex: none; padding: 2px 4px 8px; margin-bottom: 6px; border-bottom: 1px solid var(--linie); font-weight: 600; }
.menue-zurueck { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--tinte-3); }
.menue-zurueck:hover { background: var(--mulde); color: var(--tinte); }
.menue-suche { display: flex; align-items: center; gap: 8px; flex: none; height: 36px; padding: 0 10px; margin-bottom: 6px; border-radius: 8px; background: var(--schwebe); border: 1px solid var(--linie); color: var(--tinte-4); }
.menue-suche:focus-within { border-color: var(--fokus); box-shadow: 0 0 0 1px var(--fokus); }
.menue-suche-eingabe { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; }
.menue-suche-eingabe::placeholder { color: var(--blass); }
.menue-liste { display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  /* Rollt die Liste, zeigt ein Schatten an der Kante, dass dort noch Einträge folgen (die Deck-Flächen rollen mit, die Schatten stehen) */
  background:
    linear-gradient(var(--flaeche) 40%, transparent) center top / 100% 18px no-repeat local,
    linear-gradient(transparent, var(--flaeche) 60%) center bottom / 100% 18px no-repeat local,
    radial-gradient(farthest-side at 50% 0, rgba(16, 24, 40, .16), transparent) center top / 100% 7px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, rgba(16, 24, 40, .16), transparent) center bottom / 100% 7px no-repeat scroll; }
.menue-eintrag {
  display: flex; align-items: center; gap: 10px; flex: none; width: 100%; min-height: 36px; padding: 6px 10px; border-radius: var(--radius-klein);
  font-size: 14px; line-height: 20px; font-weight: 500; color: var(--fokus); text-align: left; outline: none; transition: background-color .1s;
}
.menue-eintrag:hover:not(:disabled), .menue-eintrag:focus-visible { background: var(--mulde); color: var(--tinte); }
.menue-eintrag.ist-aktiv { background: var(--mulde); }
/* Status-Menü wie im Original: Kasten 208, Innenabstand 4, Eintrag 40 hoch (Raster 44); der aktuelle Status nur grau hinterlegt –
   ohne Haken und ohne Unterzeile (für Vorlese-Programme bleibt er als gewählt gekennzeichnet) */
.menue--status { padding: 4px; min-width: 208px; }
.menue--schmal { min-width: 168px; }   /* ⋮-Menü am Lead: 168 breit wie im Original */
.menue--schmal .menue-text span { display: block; white-space: nowrap; }   /* Live-Durchlauf 5, C-3: kein Umbruch („PDF exportieren") */
@media (pointer: fine) { .menue--status .menue-eintrag { min-height: 40px; } }   /* am Touch-Gerät bleiben Menü-Zeilen 44 hoch */
.menue--status .menue-haken, .menue--status .menue-text small { display: none; }
.menue-eintrag:disabled { opacity: .45; }
.menue-eintrag .icon { color: var(--tinte-4); }
.menue-eintrag.ist-gefahr, .menue-eintrag.ist-gefahr .icon { color: var(--fehler); }
.menue-eintrag.ist-gefahr:hover:not(:disabled), .menue-eintrag.ist-gefahr:focus-visible { background: var(--fehler-weich); color: var(--fehler); }
.menue-text { flex: 1; min-width: 0; display: grid; }
.menue-text span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.menue-text small { color: var(--tinte-4); font-weight: 400; white-space: normal; }
.menue-zahl { color: var(--tinte-4); font-variant-numeric: tabular-nums; }
.menue-eintrag .menue-haken { color: var(--akzent); }
.menue-trenner { height: 1px; flex: none; margin: 5px 4px; background: var(--linie); }
.menue-gruppe { padding: 8px 10px 4px; font-size: 12px; line-height: 18px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tinte-4); }
.menue-leer { padding: 14px 10px; color: var(--tinte-4); text-align: center; }
.menue-frei { min-height: 0; overflow-y: auto; padding: 10px; display: grid; gap: 12px; }
.menue-frei-zeile { padding: 4px 6px; }
.menue-fuss { flex: none; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--linie); }

/* Toast: oben rechts, neue stapeln sich nach unten. --toast-ab (setzt ui.js, toastLage) schiebt den Stapel unter den
   Seitenkopf bzw. unter den Kopf eines Dialogs, den er sonst verdecken würde – Kopf-Knöpfe, Titel und X bleiben frei. */
.toasts {
  position: fixed; right: max(16px, env(safe-area-inset-right)); top: calc(max(16px, env(safe-area-inset-top)) + var(--vv-oben, 0px)); z-index: 2000; display: flex; flex-direction: column; gap: 8px;
  width: min(380px, calc(100vw - 32px)); pointer-events: none;
  transform: translate(var(--toast-quer, 0px), var(--toast-ab, 0px)); transition: transform .5s var(--feder-ruhig);
}
/* Keine Lage ohne etwas Bedienbares darunter (ui.js, toastLage): Der Hinweis lässt Klicks durch – nur sein X und sein Knopf fangen den Zeiger. */
.toasts[data-durch] .toast { pointer-events: none; }
.toasts[data-durch] .toast button { pointer-events: auto; }
.toast {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 10px 12px 14px; pointer-events: auto;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten-3);
  animation: toast-ein .5s var(--feder) backwards; transition: transform .45s var(--feder-sanft);
}
@keyframes toast-ein { from { opacity: 0; transform: translateX(32px); } }
.toast.erneut { animation: toast-erneut .45s var(--feder) backwards; }
@keyframes toast-erneut { from { transform: scale(.96); } }
.toast.geht { animation: toast-aus .22s var(--weg) both; pointer-events: none; }
@keyframes toast-aus { to { opacity: 0; transform: translateX(24px); } }
.toast-icon { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--gut-weich); color: var(--gut); }
.toast--fehler .toast-icon { background: var(--fehler-weich); color: var(--fehler); }
.toast--info .toast-icon { background: var(--info-weich); color: var(--info); }
.toast--warn .toast-icon { background: var(--warn-weich); color: var(--warn); }
.toast--fehler { border-color: color-mix(in srgb, var(--fehler) 35%, white); }
/* Einzeilig: Meldung und Zusatz stehen nebeneinander und kürzen mit Auslassung (der volle Text steht im title) */
.toast-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; padding-top: 4px; white-space: nowrap; overflow: hidden; }
.toast-text strong { flex: 0 1 auto; min-width: 0; font-size: 14px; line-height: 20px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.toast-text span { flex: 1 1 0; min-width: 0; font-size: 13px; line-height: 20px; color: var(--tinte-3); overflow: hidden; text-overflow: ellipsis; }
/* Überlappung 24.10.: am Handy (ohne feste Zone) brechen Meldung und Zusatz um – einzeilig blieb vom Zusatz nichts zu sehen
   („Zurück geht es unten links im Menü" 0 von 223 px). Die Zone am Computer bleibt einzeilig mit title (wie im Original). */
.toasts:not(.toasts--zone) .toast-text { display: block; white-space: normal; }
.toasts:not(.toasts--zone) .toast-text strong, .toasts:not(.toasts--zone) .toast-text span { display: block; overflow: visible; overflow-wrap: anywhere; }
/* FESTE ZONE (Computer, Tablet): der Streifen ganz oben im Hauptbereich. Lage und Breite setzt ui.js (toastLage) aus dem
   Hauptbereich; Hinweise stehen nebeneinander in der Mitte, höchstens zwei. Der Streifen selbst fängt keinen Zeiger. */
.toasts.toasts--zone {
  left: var(--toast-links, 0px); right: auto; width: var(--toast-breite, 100vw); top: calc(var(--toast-oben, 0px) + var(--vv-oben, 0px) + 4px);
  height: 30px; display: grid; grid-template-columns: repeat(2, minmax(0, 460px)); justify-content: center; gap: 8px; padding: 0 var(--toast-polster, 16px); transform: none; transition: none;
}
/* Zwei feste Plätze links und rechts der Mitte (ui.js vergibt sie): Kommt ein zweiter Hinweis dazu oder geht einer, bleibt der andere, wo er ist. */
.toasts--zone .toast[data-platz="1"] { grid-column: 1; grid-row: 1; justify-self: end; }
.toasts--zone .toast[data-platz="2"] { grid-column: 2; grid-row: 1; justify-self: start; }
/* Computer, über dem Seitenkopf ([data-kopf], ui.js): Der Platz zwischen Titel und Kopf-Knöpfen ist schmal. Ein einzelner Hinweis
   bekommt ihn ganz und steht rechtsbündig vor den Knöpfen (wie im Original oben rechts). Kommt ein zweiter dazu, steht er links
   daneben – der erste behält seine rechte Kante, nur sein Text kürzt früher. */
.toasts--zone[data-kopf] { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; }
.toasts--zone[data-kopf] .toast[data-platz="1"] { grid-column: 2; justify-self: end; }
.toasts--zone[data-kopf] .toast[data-platz="1"]:only-child { grid-column: 1 / -1; }
.toasts--zone[data-kopf] .toast[data-platz="2"] { grid-column: 1; justify-self: end; }
.toasts--zone .toast { min-width: 0; max-width: 100%; height: 30px; align-items: center; gap: 8px; padding: 0 4px 0 8px; border-radius: 10px; box-shadow: var(--schatten-2); }
.toasts--zone .toast, .toasts--zone .toast.geht { animation-name: toast-ein-zone; }
.toasts--zone .toast.geht { animation: toast-aus-zone .2s var(--weg) both; }
@keyframes toast-ein-zone { from { opacity: 0; transform: translateY(-10px); } }
@keyframes toast-aus-zone { to { opacity: 0; transform: translateY(-8px); } }
.toasts--zone .toast-icon { width: 20px; height: 20px; }
.toasts--zone .toast-icon .icon { width: 14px; height: 14px; }
.toasts--zone .toast-text { padding-top: 0; }
.toasts--zone .toast-aktion { height: 24px; padding: 0 8px; }
.toasts--zone .toast-x { width: 24px; height: 24px; }
.toast-aktion { flex: none; height: 28px; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--akzent); }
.toast-aktion:hover { background: var(--akzent-weich); }
.toast-x { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; color: var(--tinte-4); }
.toast-x:hover { background: var(--mulde); color: var(--tinte); }

/* Hover-Kärtchen */
.schwebe {
  position: fixed; left: 0; top: 0; z-index: 2100; pointer-events: none; opacity: 0; visibility: hidden; max-width: 280px;
  padding: 6px 10px; border-radius: var(--radius-klein); background: var(--tinte); color: #fff; box-shadow: var(--schatten-2);
  font-size: 12px; line-height: 18px; font-weight: 500; transform: translateY(4px) scale(.98);
  transition: opacity .12s, transform .32s var(--feder-ruhig), visibility 0s .12s;
}
.schwebe[data-seite="unten"] { transform: translateY(-4px) scale(.98); }
.schwebe.ist-da { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.schwebe--karte { max-width: 360px; padding: 12px 14px; background: var(--flaeche); color: var(--tinte); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten-3); font-size: 13px; font-weight: 400; }
.schwebe-titel { font-weight: 600; font-size: 13px; line-height: 18px; }
.schwebe-zeile { display: flex; align-items: center; gap: 6px; color: var(--tinte-3); }
.schwebe-liste { display: grid; gap: 5px; min-width: 190px; }   /* Finger: ganze Statusverteilung als Liste */
.schwebe-liste .schwebe-titel { margin-bottom: 2px; }
.schwebe-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schwebe-liste b { font-weight: 600; color: var(--tinte); }

/* ───────────────────────────────── 6 Ziehen ──────────────────────────────── */
[data-zieh] { -webkit-touch-callout: none; touch-action: manipulation; }
[data-zieh-griff] { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.zieh-griff { display: inline-grid; place-items: center; width: 24px; height: 32px; border-radius: 6px; color: var(--tinte-4); flex: none; transition: color .16s ease, background-color .16s ease; }
.zieh-griff:hover, .zieh-griff:focus-visible { color: var(--tinte-2); background: var(--mulde); }
[data-zieht]:not(html) { opacity: .32; }
html[data-zieht], html[data-zieht] * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
.zieh-geist {
  z-index: 3000; pointer-events: none; will-change: transform; opacity: .98; border-radius: var(--radius); box-shadow: var(--schatten-2);
  transition: scale .4s var(--feder), rotate .4s var(--feder), box-shadow .2s, opacity .16s;
}
.zieh-geist.ist-oben { scale: 1.03; rotate: 1.2deg; box-shadow: var(--schatten-3), 0 26px 50px -14px rgba(16, 24, 40, .28); }
.zieh-geist.kehrt-zurueck { transition: transform .5s var(--feder-sanft), scale .3s var(--feder-ruhig), rotate .3s var(--feder-ruhig), box-shadow .3s; }
/* Landung: federt auf den Platz der echten Karte; die wartet unsichtbar ([data-zieh-landet]) und übernimmt dann */
.zieh-geist.landet { opacity: 1; box-shadow: var(--schatten-1); transition: transform .46s var(--feder-sanft), scale .36s var(--feder-ruhig), rotate .36s var(--feder-ruhig), box-shadow .36s; }
.zieh-geist.loest-auf { opacity: 0; scale: .96; transition: opacity .18s var(--weg), scale .18s var(--weg), rotate .18s; }
/* ohne eigene Verschiebung (z. B. Hover-Hub), damit die Übergabe auf den Pixel stimmt */
[data-zieh-landet] { opacity: 0 !important; transform: none !important; transition: none !important; }
.zieh-marke { position: fixed; z-index: 2900; pointer-events: none; border-radius: 2px; background: var(--akzent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 18%, transparent); }
[data-zieh-ziel] { outline: 2px dashed color-mix(in srgb, var(--akzent) 55%, white); outline-offset: -2px; background-color: var(--akzent-weich); transition: background-color .22s var(--feder-ruhig), box-shadow .22s var(--feder-ruhig); }

/* ───────────────────────── 7 Suche, 404, Feedback ────────────────────────── */
.dialog--suche { align-self: start; margin-top: min(12vh, 110px); max-height: calc(100% - min(12vh, 110px)); }
.suche-kopf { display: flex; align-items: center; gap: 16px; flex: none; min-height: 101px; padding: 24px; border-bottom: 1px solid var(--linie); }
.suche-eingabe { flex: 1; min-width: 0; height: 40px; border: 0; outline: 0; background: transparent; font-size: 16px; line-height: 24px; border-bottom: 2px solid var(--akzent); }
.suche-eingabe::placeholder { color: var(--blass); }
.suche-chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* Auswahl-Marken der Suche: 26 hoch, 12/500/16, Symbol 12 px (mit der Maus; am Touch-Gerät bleiben sie greifbar groß); aktiv Akzent 5 % / Rahmen 30 % / Text in Akzentfarbe */
@media (pointer: fine) {
  .suche-chips .chip { height: 26px; padding: 0 8px; gap: 4px; font-size: 12px; line-height: 16px; }
  .suche-chips .chip .icon { width: 12px; height: 12px; }
}
.suche-chips .chip.ist-aktiv { background: color-mix(in srgb, var(--akzent) 5%, white); border-color: color-mix(in srgb, var(--akzent) 30%, white); color: var(--akzent); }
.suche-koerper { display: grid; gap: 16px; min-height: 180px; align-content: start; }
.suche-gruppe { display: grid; gap: 4px; }
.suche-gruppe h3 { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--tinte-3); padding: 0 8px 2px; }
.treffer { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border-radius: var(--radius); text-align: left; transition: background-color .1s; outline: none; }
.treffer:hover, .treffer.ist-markiert, .treffer:focus-visible { background: var(--mulde); }
.sicht-wahl { display: grid; gap: 2px; }   /* Demo: Dialog „Als Kunde ansehen" (Liste der Kundenzugänge) */
.treffer-text { flex: 1; min-width: 0; display: grid; }
.treffer-text strong { font-size: 14px; line-height: 20px; font-weight: 600; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.treffer-text span { font-size: 13px; line-height: 18px; color: var(--tinte-3); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
/* Kopfzeile eines Treffers: Name und – bei einem Lead, nur am Computer – das Datum (Runde 3) */
.treffer-text .treffer-kopf { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: visible; font-size: 14px; line-height: 20px; color: var(--tinte); }
.treffer-text .treffer-kopf strong { min-width: 0; }
.treffer-text .treffer-datum { display: none; }
/* K5 · Status-Pille am Lead-Treffer (Original: 22 hoch, Radius 999, im Statuston); der Name kürzt zuerst */
.treffer-text .treffer-status { flex: none; max-width: 45%; height: 22px; }
.treffer-text .treffer-status .pille-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.treffer-zeit { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12px; color: var(--tinte-4); }
.suche-leer { display: grid; justify-items: center; gap: 18px; padding: 22px 0 14px; color: var(--tinte-3); text-align: center; }
.tasten-hinweis { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--linie); border-radius: var(--radius); color: var(--tinte-2); }
kbd, .taste { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 12px; background: var(--schwebe); border: 1px solid var(--linie); font: 400 14px/1 var(--schrift); color: var(--tinte-2); }

.nicht-gefunden { height: 100vh; height: 100dvh; display: grid; align-content: center; justify-items: start; gap: 14px; padding: 48px max(24px, 9vw); }
.nicht-gefunden small { font-size: 14px; font-weight: 600; color: var(--akzent); letter-spacing: .02em; }
.nicht-gefunden h1 { font-size: clamp(34px, 5.4vw, 60px); line-height: 1.08; letter-spacing: -.035em; max-width: 16ch; }
.nicht-gefunden p { font-size: 18px; line-height: 28px; color: var(--tinte-3); max-width: 46ch; }
.nicht-gefunden .leiste { margin-top: 18px; }
/* Ruhige Seiten im Supabase-Modus (kein Zugang, Kundenansicht, keine Antwort): Zeilen kommen nacheinander von unten, mit Feder */
.ruhig > * { animation: ruhig-ein .7s var(--feder-sanft) backwards; }
.ruhig > :nth-child(2) { animation-delay: .05s; }
.ruhig > :nth-child(3) { animation-delay: .1s; }
.ruhig > :nth-child(4) { animation-delay: .16s; }
@keyframes ruhig-ein { from { opacity: 0; transform: translateY(16px); } }

.feedback { display: grid; gap: 16px; width: 100%; padding: 6px; }
.feedback-teil { display: grid; gap: 6px; min-width: 0; }
.feedback h3 { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--tinte-2); }
.feedback .umschalter { width: 100%; }
.feedback .umschalter-teil { flex: 1 1 0; min-width: 0; padding: 0 8px; }
.feedback .umschalter-teil .icon { flex: none; width: 16px; height: 16px; }
.feedback-optional { font-weight: 400; color: var(--tinte-4); }
.feedback .ablage { padding: 16px 12px; gap: 4px; }
.feedback .ablage .icon-kachel { margin-bottom: 4px; }
.feedback-datei {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 8px 10px 12px;
  background: var(--schwebe); border: 1px solid var(--linie); border-radius: var(--radius);
  animation: feedback-datei .5s var(--feder) backwards;
}
@keyframes feedback-datei { from { opacity: 0; transform: scale(.96); } }
.feedback-datei-text { flex: 1; min-width: 0; display: grid; }
.feedback-datei-text strong { font-size: 14px; line-height: 20px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feedback-datei-text span { font-size: 12px; line-height: 18px; color: var(--tinte-4); }
.feedback-achtung .icon { flex: none; margin-top: 1px; }
.feedback-achtung { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--warn-weich); border: 1px solid color-mix(in srgb, var(--warn) 30%, white); color: color-mix(in srgb, var(--warn) 62%, black); font-size: 13px; line-height: 18px; }
.feedback-fuss { font-size: 12px; line-height: 18px; color: var(--tinte-4); text-align: center; }

.fehler-kasten { display: grid; gap: 8px; padding: 18px 20px; border: 1px solid color-mix(in srgb, var(--fehler) 30%, white); background: var(--fehler-weich); border-radius: var(--radius); color: color-mix(in srgb, var(--fehler) 70%, black); }
.fehler-kasten code { font: 12px/18px ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--tinte-2); }
/* Ein Bereich lässt sich nicht laden: ein ruhiger Satz, ein Knopf „Neu laden", die technische Meldung klein darunter */
.fehler-kasten--laden p { max-width: 62ch; color: var(--tinte-2); }
.fehler-kasten--laden .leiste { margin: 6px 0 4px; }
.fehler-kasten--laden code { color: var(--tinte-3); }

/* ─────────────────── 7b Rollband, gestaffeltes Erscheinen ─────────────────── */
/* Rollband: Leisten, die quer rollen (Reiter, Chip-Bänder), blenden an der Seite aus, an der es weitergeht.
   Rein in CSS über den Roll-Stand; passt alles hinein, bleibt die Leiste unverändert. Views: Klasse „rollband". */
@property --blende-l { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --blende-r { syntax: '<length>'; inherits: false; initial-value: 0px; }
@supports (animation-timeline: scroll()) {
  .reiter, .rollband {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--blende-l), #000 calc(100% - var(--blende-r)), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 var(--blende-l), #000 calc(100% - var(--blende-r)), transparent);
    animation: rollband-blende 1s linear both; animation-timeline: scroll(self inline);
  }
  @keyframes rollband-blende {
    from { --blende-l: 0px; --blende-r: 36px; }
    8%, 92% { --blende-l: 36px; --blende-r: 36px; }
    to { --blende-l: 36px; --blende-r: 0px; }
  }
}

/* Gestaffeltes Erscheinen: Kinder einer Liste kommen kurz nacheinander (nur beim ersten Einhängen).
   Tabellenzeilen tun das von selbst; für Karten-Raster und Listen die Klasse „gestaffelt" setzen. */
.gestaffelt > *, .tabelle tbody tr { animation: reihe-ein .46s var(--feder-ruhig) backwards; }
@keyframes reihe-ein { from { opacity: 0; transform: translateY(8px); } }
.gestaffelt > :nth-child(2), .tabelle tbody tr:nth-child(2) { animation-delay: 22ms; }
.gestaffelt > :nth-child(3), .tabelle tbody tr:nth-child(3) { animation-delay: 44ms; }
.gestaffelt > :nth-child(4), .tabelle tbody tr:nth-child(4) { animation-delay: 66ms; }
.gestaffelt > :nth-child(5), .tabelle tbody tr:nth-child(5) { animation-delay: 88ms; }
.gestaffelt > :nth-child(6), .tabelle tbody tr:nth-child(6) { animation-delay: 110ms; }
.gestaffelt > :nth-child(7), .tabelle tbody tr:nth-child(7) { animation-delay: 132ms; }
.gestaffelt > :nth-child(8), .tabelle tbody tr:nth-child(8) { animation-delay: 154ms; }
.gestaffelt > :nth-child(9), .tabelle tbody tr:nth-child(9) { animation-delay: 176ms; }
.gestaffelt > :nth-child(n+10), .tabelle tbody tr:nth-child(n+10) { animation-delay: 198ms; }

/* ─────────────── 7c Computer (ab 960 px): Maße des Originals ─────────────── */
/* Gemessen am Original bei 1352 × 726 (Notiz 18). Gilt, sobald die Seitenleiste fest steht. Darunter (Tablet, Handy)
   bleibt die eigene Fassung – sie ist dort besser als das Original und wird nicht angefasst. */
@media (min-width: 960px) {
  /* Seitenleiste: kein Rahmen rechts; Logo-Kasten ab x 40, y 24, 55 hoch; Kunden-Kachel 252 × 64 ab y 103 */
  .seitenleiste { border-right: 0; padding: 0 16px 12px; }
  .wortmarke { padding: 24px 24px; min-height: 103px; }
  .wortmarke--logo { padding: 24px 24px; align-items: center; }
  .wortmarke-logo { max-height: 55px; }
  .nav-trenner { background: var(--linie-stark); margin: 0 0 17px; }
  .nav-kunde { height: 64px; padding: 12px; margin-bottom: 24px; background: var(--mulde); border: 0; }
  .nav-kunde-text strong, .nav-kunde-text span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
  .nav-kunde-text span { font-size: 14px; line-height: 20px; }
  .nav-abschnitt { height: 26px; padding: 0; margin: 0; letter-spacing: 0; }
  .nav-abschnitt:not(:first-child) { margin-top: 32px; }
  .nav-liste { gap: 0; }
  /* Menüpunkt: 40 hoch, Symbol 24 px ab x 24, Text 14/600/24 ab x 48 */
  .nav-punkt { height: 40px; min-height: 40px; padding: 0 8px; gap: 0; font-size: 14px; line-height: 24px; color: var(--tinte); }
  .nav-punkt:hover { background: var(--mulde); }
  .nav-punkt .icon { color: var(--tinte-2); }
  .nav-punkt > svg.icon { padding: 2px; }   /* Kasten 24 (Text beginnt bei x 48), die Zeichnung selbst 20 – wie die Schrift-Symbole des Originals mit ihrem Rand */
  .nav-punkt-text { display: block; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; }
  /* Kampagnen-Zeile: Punkt mittig bei x 36, Text 14/500/20 ab x 52; nicht aktiv grau, aktiv Akzent ohne Hof */
  .nav-kampagne { height: 40px; padding: 0 8px 0 16px; gap: 12px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--tinte); }
  .nav-kampagne.ist-aktiv { font-weight: 500; }
  .nav-kampagne .nav-ampel, .nav-kampagne .nav-ampel.ist-neu { background: var(--linie); }
  .nav-kampagne.ist-aktiv .nav-ampel { background: var(--akzent); box-shadow: none; }
  .nav-kampagne .zahl { min-width: 26px; height: 24px; padding: 0 8px; line-height: 18px; font-weight: 500; color: var(--tinte); background: var(--mulde); }
  /* Benutzer-Kachel: 260 × 58 ab x 12, Kreis 40, Adresse 14/400/20 */
  .nutzer-bereich { margin: 12px -4px 0; padding-top: 13px; }
  .nutzer-kachel { padding: 8px; gap: 12px; }
  .nutzer-kachel-text span { font-size: 14px; line-height: 20px; color: var(--tinte-3); }

  /* Seitenkopf: Titel ab y 19, Knopf ab y 18, Reiter ab y 70 (36 hoch), Inhalt ab y 124. Die Hinweise schweben darüber
     (ui.js: toastLage) – der Kopf hält keinen eigenen Streifen mehr frei. */
  :root { --hinweis-zone: 18px; }
  /* Langer Titel (K4, C-3): zwischen Titel und Kopf-Knöpfen ist kein Platz für einen Hinweis → der Kopf dieser Seite hält den
     Streifen darüber frei wie am Tablet (ui.js: messeKopf). Fest je Seite – der Kopf springt nicht, wenn ein Hinweis kommt. */
  :root[data-kopf-eng] { --hinweis-zone: 38px; }
  .kopf { padding-bottom: 6px; }
  .kopf-zeile { min-height: 40px; gap: 12px; }
  .seitentitel { letter-spacing: 0; }
  .kopf-werkzeug { gap: 12px; }
  .kopf-werkzeug .icon-knopf--gross { margin: -4px 0; }   /* 48er Fläche, die Zeile bleibt 40 hoch */
  .kopf-werkzeug .icon-knopf { color: var(--tinte-2); }
  .kopf-aktionen { margin-left: 0; }
  .kopf-reiter { margin-top: 12px; }
  .kopf-unterreiter { margin-top: 18px; padding-top: 12px; }
  .kopf-untertitel { margin: 0 0 16px; }
  .inhalt { padding-top: 12px; }
  /* Abschnittskopf (Einstellungsseiten): Titel, Unterzeile und rechts „Speichern" – steht fest über dem rollenden Inhalt */
  .kopf-abschnitt { display: flex; align-items: flex-start; gap: 16px; margin-top: 18px; padding: 12px 0 16px; border-bottom: 1px solid var(--linie-stark); }
  .kopf-abschnitt-text { flex: 1; min-width: 0; }
  .kopf-abschnitt .kopf-aktionen { margin-top: 6px; }
  .kopf:has(> .kopf-abschnitt) { padding-bottom: 0; }

  /* Einstellungs-Zeile: Bezeichnung 230 breit, Bedienteile ab x 559, rechte Spalte bis 679; Felder so breit wie im Original */
  .einstellung { grid-template-columns: 230px minmax(0, 679px); gap: 12px 13px; padding: 24px 0; border-bottom-color: rgba(0, 0, 0, .12); }
  .einstellung-links h4 { color: #334155; align-items: flex-start; }
  .einstellung-links h4 .hinweis-icon { margin-left: auto; }
  .einstellung-links p { color: #475569; }
  .einstellung-rechts > .breite-320 { width: 320px; max-width: 100%; }
  .einstellung-rechts > .breite-400 { width: 400px; max-width: 100%; }
  .einstellung-rechts > .breite-448 { width: 448px; max-width: 100%; }
  /* Schalter der Einstellungsseiten: Bahn 44 × 22; aus = Schwarz 38 % */
  .einstellung .schalter { height: 22px; }
  .einstellung .schalter-knauf { top: 2px; }
  .einstellung .schalter:not(.ist-an) { background: rgba(0, 0, 0, .38); }
}

/* ─────────────── 7d Computer, Runde 2 (Notiz 20, 11.10.) ─────────────── */
/* Zweiter Vergleich mit dem Original bei 1352 × 726. Wie 7c: gilt ab 960 px; was nur mit der Maus Sinn hat, steht im
   Block mit (pointer: fine). Tablet und Handy bleiben, wie sie sind. */
@media (min-width: 960px) {
  /* Symbole: Strich 2 (im 24er Raster) wie im Original – die Regel überstimmt das Attribut des gezeichneten Symbols */
  .icon[stroke-width="1.75"] { stroke-width: 2; }
  /* Seitenleiste: Menütext ab x 56 (8 px Luft nach dem Symbol), Laufweite +0,47 px; Kampagnen-Text ab x 56 */
  .nav-punkt { letter-spacing: .47px; }
  .nav-punkt-text { padding-left: 8px; }
  .nav-kampagne { letter-spacing: 0; }
  .nav-kampagne .nav-punkt-text { padding-left: 4px; }
  .nav-punkt:hover:not(.ist-aktiv) { background: color-mix(in srgb, var(--tinte) 4%, transparent); }
  .nutzer-kachel:hover, .nutzer-kachel[data-offen] { border-color: var(--linie); }
  /* Reiter: unter der Maus graue Fläche und dunkler Text; mit der Tastatur ein Schleier statt eines Umrisses */
  .reiter-eintrag:hover:not(:disabled):not(.ist-aktiv) { color: var(--tinte-2); }
  .reiter-eintrag:focus-visible { outline: 0; background: rgba(0, 0, 0, .12); }
  /* Knöpfe: gesperrt mit Deckkraft 0,6 */
  .knopf:disabled { opacity: .6; }
  /* Schalter: an = Akzent mit Deckkraft 0,32, aus (Einstellungsseiten) = Schwarz 38 % mit Deckkraft 0,32 */
  .schalter.ist-an { background: color-mix(in srgb, var(--akzent) 32%, transparent); }
  .einstellung .schalter:not(.ist-an) { background: rgba(0, 0, 0, .1216); }
  /* Dialoge: Titel mit Laufweite +0,2 px; das X steht senkrecht mittig im Kopf, 24 px vom rechten Rand */
  .dialog-titel h2 { letter-spacing: .2px; }
  .dialog-kopf .dialog-x { align-self: center; margin: 0; }
  /* Pille (Statusvorlage, Listen): Punkt 6 px im 8er Kasten, Text 19 px nach der Kante – Innenabstand 3/9/3/7 samt Rand */
  .pille:not(.pille--klein):not(.pille--knopf) { padding: 0 8px 0 6px; gap: 4px; }
  .pille:not(.pille--klein):not(.pille--knopf) .pille-punkt { margin: 0 1px; }
  /* Dialog-Inhalt: 28 px Rand links, rechts und unten, 15 px unter dem Kopf; mit Fuß 20 px bis zum Knopf (gemessen an
     „Lead erstellen", „Leads exportieren", „Neue Smart View", „Neue Quelle") */
  .dialog-inhalt { padding: 15px 28px 28px; }
  .dialog-inhalt--ohne-rand { padding: 0; }
  .dialog--frage .dialog-inhalt { padding-top: 0; }
  .dialog:has(> .dialog-fuss) > .dialog-inhalt:not(.dialog-inhalt--ohne-rand) { padding-bottom: 12px; }
  .dialog-fuss { padding: 8px 28px 28px; }
  .dialog-titel { gap: 0; }   /* Kopf mit dreizeiligem Text: 129 hoch */
  .dialog-kopf { min-height: 91px; }
  /* Lupe in Suchfeldern: 18 px, grau */
  .feld-icon { width: 18px; height: 18px; color: var(--tinte-4); }
  /* Einstellungsseiten (Notiz 20, Abschnitt 7): Abschnittskopf y 124–201 (Unterzeile 4 px unter dem Titel); Zeile: Bezeichnung
     224,5 breit, Bedienteile ab x 552,5, rechte Spalte zwei Drittel (662,7); 24 oben, 20 unten, Linie #eaecf0 über die ganze Breite */
  .kopf-abschnitt { padding-bottom: 12px; }
  .kopf-abschnitt .abschnitt-text { margin-top: 4px; }
  .einstellung { grid-template-columns: calc(25% - 24px) minmax(0, 66.667%); gap: 12px; padding: 24px 0 20px; border-bottom-color: var(--linie); }
  /* Auswahl in einer Einstellungs-Zeile: Rahmen 2 px (der zweite als innerer Ring, damit der Text nicht rückt), Pfeil 20 px */
  .einstellung .feld.auswahl { box-shadow: inset 0 0 0 1px var(--linie), var(--schatten-1); }
  .einstellung .auswahl-pfeil { width: 20px; height: 20px; }
  .knopf.knopf--gefahr-umriss { border-color: var(--fehler); }
  /* Sortierung: EIN Kasten 200 × 42 (weiß, Rahmen, Radius 12, kleiner Schatten). Links das Richtungs-Feld 28 × 40 mit
     Trennlinie und Symbol 24 px, dann der Name, rechts der Pfeil 20 px in Blassgrau (Notiz 20, Abschnitt 11) */
  .sortierwahl:not(.sv-sortierung) { align-items: center; width: 200px; height: 42px; padding-left: 5.5px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten-1); }
  .sortierwahl:not(.sv-sortierung):focus-within { border-color: var(--fokus); box-shadow: 0 0 0 1px var(--fokus); }
  .sortierwahl:not(.sv-sortierung) .sortierwahl-richtung { width: 28px; height: 40px; border: 0; border-right: 1px solid var(--linie); border-radius: 0; background: transparent; }
  .sortierwahl:not(.sv-sortierung) .sortierwahl-richtung .icon { width: 24px; height: 24px; }
  .sortierwahl:not(.sv-sortierung) .feld-gruppe { flex: 1; min-width: 0; }
  .sortierwahl:not(.sv-sortierung) .sortierwahl-feld { min-width: 0; height: 40px; min-height: 40px; padding: 0 12px 0 8px; border: 0; border-radius: 0 11px 11px 0; background: transparent; box-shadow: none; outline-offset: -2px; }
  .sortierwahl:not(.sv-sortierung) .auswahl-pfeil { width: 20px; height: 20px; color: var(--blass); }
  /* der feste Abschnittskopf endet, wo der rollende Inhalt endet (app.js: achteAufRollbalken) */
  .kopf-abschnitt { margin-right: var(--rollbalken, 0px); }
  /* 22.10. (gemeinsamer Test): In der Einrichtung steht der Kopf im Original 12 px höher (Titel y 124 statt 136, Linie 188) */
  .kopf-abschnitt--hoch { margin-top: 6px; }
}
@media (min-width: 960px) and (pointer: fine) {
  /* Rollbalken: 10 px breit, dauerhaft zu sehen, nimmt Platz (wie im Original). Die Regeln für „kein Balken" (Reiter,
     Smart-View-Band) bleiben, weil sie genauer zielen. */
  * { scrollbar-width: auto; scrollbar-color: auto; }
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--linie-stark); border-radius: 5px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--blass); }
  ::-webkit-scrollbar-corner { background: transparent; }
  .inhalt { scrollbar-gutter: auto; }
  /* Drücken: alle Knöpfe auf 95 % (die Feder beim Loslassen bleibt) */
  .knopf:active:not(:disabled), .icon-knopf:active:not(:disabled) { transform: scale(.95); }
}

/* ─────────────── 7e Computer, Runde 3 (Notiz 23, 11.10.) ─────────────── */
/* Dritter Vergleich mit dem Original bei 1352 × 726. Der ganze Block gilt ab 960 px UND nur mit der Maus (pointer: fine): Vieles
   hier macht Bedienteile kleiner (Menüzeilen 36, Kopf-Knöpfe 40, Suchfeld 32). Tablet (auch quer) und Handy bleiben, wie sie sind. */
@media (min-width: 960px) and (pointer: fine) {
  /* Tabellenkopf: Das Sortier-Symbol ist nur an der sortierten Spalte zu sehen (es behält seinen Platz). Unter der Maus wird
     der Text dunkel (#0f172a) und bleibt 500 – nicht fett (Runde 2 hatte hier nach einem Messfehler angeglichen). */
  .tabelle-sort .icon { visibility: hidden; }
  .tabelle th.ist-sortiert .tabelle-sort .icon { visibility: visible; }
  .tabelle-sort:hover { font-weight: inherit; color: #0F172A; }
  /* Reiter unter der Maus: graue Fläche, die Textfarbe bleibt */
  .reiter-eintrag:hover:not(:disabled):not(.ist-aktiv) { color: var(--reiter-grau); }
  /* Hauptknopf ohne Rahmen (der machte ihn 2 px breiter als im Original: 157,4 statt 155,4) */
  .knopf--haupt, .knopf--gefahr { border-width: 0; }
  /* Drücken und Loslassen ohne Feder: transform 0,15 s cubic-bezier(.4, 0, .2, 1) wie im Original */
  .knopf, .icon-knopf, .chip, .haken, .umschalter-teil, .pille--knopf { transition-timing-function: cubic-bezier(.4, 0, .2, 1); transition-duration: .15s; }
  .knopf:active:not(:disabled), .icon-knopf:active:not(:disabled), button.chip:active, .haken:active:not(:disabled), .umschalter-teil:active, .pille--knopf:active { transition-timing-function: cubic-bezier(.4, 0, .2, 1); transition-duration: .15s; }
  /* Tabellenzeilen stehen sofort (kein Einblenden, keine Staffel) und wechseln die Farbe unter der Maus ohne Übergang */
  .tabelle tbody tr { animation: none; transition: none; }
  /* Zahl im Tabellenfuß: 16/400/24, Laufweite −0,16 */
  .seitenwahl-groesse { line-height: 24px; letter-spacing: -.16px; }
  /* Seitenkopf: Symbolknöpfe 40 × 40 (Lupe ab x 1108,6, y 18), 16 px bis zum Knopf daneben */
  .kopf-werkzeug { gap: 20px; margin-right: 4px; }
  .kopf-werkzeug .icon-knopf--gross { width: 40px; height: 40px; margin: 0; }
  /* Schalter: Knauf 20 in der Bahn 44 × 24 (Einstellungsseiten: Bahn 22, Knauf 18, ohne Schatten; 5 px eingerückt) */
  .schalter:not(.schalter--klein) .schalter-knauf { top: 2px; left: 2px; width: 20px; height: 20px; }
  .einstellung .schalter:not(.schalter--klein) .schalter-knauf { top: 2px; left: 3px; width: 18px; height: 18px; box-shadow: none; }
  .einstellung-rechts > .schalter-zeile, .einstellung-rechts > .schalter { margin-left: 5px; }
  .schalter--klein .schalter-knauf { top: 2px; left: 2px; width: 16px; height: 16px; }
  /* Auswahl: Pfeil 20 px; Platzhalter mit Laufweite −0,16 */
  .auswahl-pfeil { width: 20px; height: 20px; }
  .auswahl-platzhalter { letter-spacing: -.16px; }
  /* Titel: Abschnitt ohne Laufweite, Dialog +0,225 */
  .abschnitt-titel { letter-spacing: 0; }
  .dialog-titel h2 { letter-spacing: .225px; }
  /* Einstellungs-Zeile: Erklärtext 1,5 px unter der Bezeichnung */
  .einstellung-links p { margin-top: 1.5px; }
  /* Sortierung (ein Kasten 200 × 42): „Letzte Änderung" passt ganz hinein (Live-Durchlauf 5, C-2: war mit Inter abgeschnitten) */
  .sortierwahl:not(.sv-sortierung) .sortierwahl-feld { padding: 0 6px 0 8px; gap: 3px; }
  /* Marke in Akzentfarbe („n Leads", Trigger): rund, 26 hoch, Innenabstand 4/8 */
  .marke--akzent { height: 26px; border-radius: 999px; }
  /* Datumswerte und Zähler in normalen Ziffern (das Original nutzt keine Tabellenziffern) */
  .fb-wert--zahl, .zahlen, .zahl, .chip-zahl, .menue-zahl { font-variant-numeric: normal; }
  /* Feedback-Fenster: 384 breit, Inhalt 342; Abstände 12; Bezeichnungen 14/500/21 #475467; Kategorie-Leiste 44 hoch (#f9fafb,
     Radius 8, Ring innen), Reiter 36 hoch in natürlicher Breite, aktiv weiß mit Schatten; Textfeld 126 hoch (16/400/28);
     Ablagefeld 106 hoch mit durchgezogenem Rahmen und EINER Textzeile; Hinweis „Dringend?" ohne Symbol; Knopf 36 hoch */
  .menue.menue--feedback { padding: 0; }
  .menue--feedback .menue-frei { padding: 16px 21px; }
  .feedback { padding: 0; gap: 12px; }
  .feedback-teil, .feedback .feld-gruppe { gap: 4.6px; }
  .feedback h3, .feedback .feld-etikett { font-size: 14px; line-height: 21px; font-weight: 500; color: var(--tinte-3); }
  .feedback .umschalter { height: 44px; padding: 4px; gap: 4px; border-radius: 8px; background: var(--schwebe); box-shadow: inset 0 0 0 1px var(--linie); }
  .feedback .umschalter-teil { flex: 1 1 0; height: 36px; padding: 0 6px; border-radius: 6px; }
  .feedback .umschalter-teil:first-child { flex-grow: 1.02; }
  .feedback .umschalter-teil.ist-aktiv { color: var(--tinte-2); }
  .feedback .feld--text { padding: 9px 12px; }
  .feedback .feld--text .feld-eingabe { height: 106px; min-height: 106px; line-height: 28px; resize: none; }
  .feedback .ablage { height: 106px; padding: 16px 24px; gap: 12px; border: 1px solid var(--linie); align-content: center; }
  .feedback .ablage .icon-kachel { width: 40px; height: 40px; margin: 0; border-radius: 8px; border-color: var(--linie-stark); }
  .feedback .ablage .icon-kachel .icon { width: 20px; height: 20px; }
  .feedback .ablage-text { font-size: 14px; line-height: 20px; font-weight: 400; color: var(--tinte-3); }
  .feedback .ablage-text b { font-weight: 600; color: color-mix(in srgb, var(--akzent) 60%, black); }
  .feedback .ablage-hilfe { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .feedback-achtung { min-height: 84px; padding: 12px 16px; align-items: center; border: 0; background: #FFFAEB; color: #93370D; font-size: 14px; line-height: 20px; box-shadow: var(--schatten-1); }
  .feedback-achtung .icon { display: none; }
  .feedback > .knopf { height: 36px; }
  .feedback-fuss { line-height: 16px; }
  /* Suche: Fenster senkrecht mittig (auch mit Treffern), leer 740 × 330; Kopf: Kasten 48, Eingabe 32 hoch, X 24 px #667085;
     inaktive Auswahl-Marke #f9fafb / #344054; Tasten-Hinweis mit EINEM Kürzel, Taste 24 × 26 mit Rahmen #f2f4f7;
     Treffer: Zeile 58 hoch (Radius 8, Raster 58), Kasten 40 mit Symbol 20, Name 14/500, Zeile 2 einzeilig 14/400/20 */
  .dialog--suche { align-self: center; margin-top: 0; max-height: 100%; }
  .suche-kopf { padding: 29px 24px 23px; align-items: flex-start; }
  .suche-eingabe { height: 32px; margin-top: 11px; }
  .suche-kopf .icon-knopf { margin-top: 4px; }
  .suche-kopf .icon-knopf { color: var(--tinte-4); }
  .suche-kopf .icon-knopf .icon { width: 24px; height: 24px; }
  .suche-chips .chip:not(.ist-aktiv) { background: var(--schwebe); color: var(--tinte-2); }
  .suche-koerper { min-height: 0; }
  .suche-leer { padding: 38px 0 28px; gap: 12px; }
  .suche-leer p { font-size: 14px; line-height: 20px; }
  .tasten-hinweis { height: 44px; padding: 0 12px; color: var(--tinte-3); }
  kbd, .taste { min-width: 24px; height: 26px; padding: 2px 4px; border-color: var(--mulde); }
  .suche-gruppe { gap: 0; }
  .suche-gruppe h3 { font-size: 14px; line-height: 20px; padding-bottom: 6px; }
  .treffer { height: 58px; padding: 9px 8px; border-radius: 8px; }
  .treffer:hover, .treffer.ist-markiert, .treffer:focus-visible { background: rgba(0, 0, 0, .05); }
  .treffer-text { align-content: center; }
  .treffer .icon-kachel { width: 40px; height: 40px; border-radius: 8px; }
  .treffer .icon-kachel .icon { width: 20px; height: 20px; }
  .treffer-text strong { display: block; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; }
  .treffer-text .treffer-datum { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--tinte-4); }
  .treffer-text .treffer-kopf { height: 20px; }
  .treffer-text .treffer-unter { display: block; font-size: 14px; line-height: 20px; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; }
  /* 404-Seite: Marke 16/600/24 (in der Akzentfarbe der Agentur), Titel 60/600/72 mit Laufweite −1,2 in EINER Zeile, Text 20/400/30,
     Knöpfe 48 hoch (Innenabstand 12/20) mit 16 px Lücke; linke Kante x 144 bei 1352 */
  .nicht-gefunden { gap: 0; padding-left: max(24px, 10.65vw); padding-right: 24px; }
  .nicht-gefunden small { font-size: 16px; line-height: 24px; letter-spacing: 0; }
  .nicht-gefunden h1 { margin-top: 12px; font-size: 60px; line-height: 72px; letter-spacing: -1.2px; max-width: none; white-space: nowrap; }
  .nicht-gefunden p { margin-top: 24px; font-size: 20px; line-height: 30px; max-width: 760px; }
  .nicht-gefunden .leiste { margin-top: 48px; gap: 16px; }
  .nicht-gefunden .knopf { height: 48px; padding: 12px 20px; font-size: 16px; line-height: 24px; }
  /* Menü: 4 px unter dem Anker gilt je Aufruf (ui.js, abstand); Benutzer-Menü: Rahmen, weicher Schatten, Einträge 36 hoch */
  .menue.menue--nutzer { padding: 5px 6px; border: 1px solid var(--linie); box-shadow: var(--schatten-3); }
  .menue--nutzer .menue-eintrag { min-height: 36px; padding: 8px 10px; gap: 8px; border-radius: var(--radius); font-weight: 600; }
  .menue--nutzer .menue-eintrag .icon { width: 16px; height: 16px; }
  .menue--nutzer .menue-eintrag.ist-gefahr { color: #D92D20; }
  .menue--nutzer .menue-eintrag.ist-gefahr .icon { color: var(--fehler); }
  .nutzer-kachel[data-offen] { background: var(--mulde); }
  /* Status-Menü: Punkt 16 px nach der Kante des Eintrags, Text 8 px danach, 14/500/16,8 */
  .menue.menue--status { min-width: 0; }
  .menue--status .menue-eintrag { padding: 6px 12px 6px 16px; gap: 8px; line-height: 16.8px; }
  /* ⋮-Menü am Lead: 167,9 × 172, Innenabstand 8, Eintrag 36 hoch (Raster 40), Symbol bei +16, Text bei +44, einzeilig */
  .menue.menue--schmal { min-width: 0; padding: 8px; }
  .menue--schmal .menue-eintrag { min-height: 36px; padding: 8px; gap: 8px; border-radius: var(--radius-klein); }
  .menue--schmal .menue-text span { display: block; white-space: nowrap; }
}

/* ─────────────── 7f Computer, Runde 4 (Notiz 26, 14.10.) ─────────────── */
/* Vierter Vergleich bei 1352 × 591–605. Wie 7e: nur ab 960 px UND mit Maus. Tablet und Handy bleiben, wie sie sind. */
@media (min-width: 960px) and (pointer: fine) {
  /* Gesetzter Haken (Tabelle, Kopf „teilweise", Listen): Kästchen hell #f5f5f5, Rahmen und Haken in Akzentfarbe, Strich 1,67.
     Teilweise = Strich „–" in Akzentfarbe im selben Kästchen. Export: weiß mit Rahmen 2 px (leads.css, Runde 4). */
  .haken.ist-an { background: #F5F5F5; border-color: var(--akzent); color: var(--akzent); }
  .haken.ist-an .icon { stroke-width: 1.67; }
  /* Kopf: erster Symbolknopf (Feedback) 48 × 48 bei y 14, Symbol 24, Strich 1,67; Lupe 40 × 40, 16 px dazwischen.
     Ohne Hauptknopf rechts: 16 px Luft bis zum Rand (Feedback x 1200, Lupe x 1264 bei 1352). */
  .kopf-werkzeug { gap: 16px; }
  .kopf-werkzeug .icon-knopf--gross:first-child { width: 48px; height: 48px; margin: -4px 0; }
  .kopf-werkzeug .icon-knopf--gross:first-child .icon { stroke-width: 1.67; }
  .kopf-zeile:not(:has(> .kopf-aktionen > *)) > .kopf-werkzeug { margin-right: 16px; }
  /* Dialoge: große Dialoge 90 % der Fensterhöhe, mittig (oben und unten je 5 %). Kleine Dialoge stehen senkrecht mittig
     (ui.js, haltOben: am Computer mit Maus Mitte statt 12 %). */
  .dialog-huelle { padding-top: 5vh; padding-bottom: 5vh; }
  /* Seitenleiste: „ADMIN" / „KUNDE" ab x 24; Kampagnen-Zeile Laufweite 0,47 (Name und Zähler); Name in der Kunden-Kachel ab x 78 */
  .nav-abschnitt { padding-left: 8px; }
  .nav-kampagne .nav-punkt-text, .nav-kampagne .zahl { letter-spacing: .47px; }
  .nav-kunde { gap: 10px; }
  /* Sortierkasten: keine Trennlinie nach dem Symbol; Text 4,5 px weiter rechts (wie im Original). Der Pfeil bleibt BEWUSST rechts
     (3 px Rand statt 12): sonst ist „Letzte Änderung" abgeschnitten (C-2, Live-Durchlauf 5; das Original zeigt „Neue Leads"). */
  .sortierwahl:not(.sv-sortierung) .sortierwahl-richtung { border-right: 0; }
  .sortierwahl:not(.sv-sortierung) .sortierwahl-feld { padding: 0 3px 0 12.5px; gap: 2px; }
  /* 404: Knöpfe 14/600/20 */
  .nicht-gefunden .knopf { font-size: 14px; line-height: 20px; }
}
/* Tooltips an Symbolknöpfen (nur unser Tool, Bedienhilfe): erst nach 600 ms, dezent (ui.js: IconKnopf, hinweis symbol) */
.schwebe.schwebe--symbol { background: var(--tinte-2); box-shadow: none; font-weight: 500; }

/* ───────────────────────────────── 8 Breiten ─────────────────────────────── */
/* < 960 px: Seitenleiste wird zur Schublade, oben eine Leiste mit Menü-Knopf */
@media (max-width: 959.98px) {
  /* Seitenabstand: nie unter der Kerbe (Querformat) */
  :root { --rand: max(24px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .rahmen { grid-template-columns: minmax(0, 1fr); }
  .seitenleiste {
    position: fixed; inset: 0 auto 0 0; z-index: 70; width: calc(var(--seitenleiste) + env(safe-area-inset-left, 0px)); max-width: 86vw; border-right: 1px solid var(--linie);
    padding: max(18px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    transform: translateX(-102%); visibility: hidden; box-shadow: none;
    transition: transform .2s cubic-bezier(.4, 0, .2, 1), visibility 0s .2s, box-shadow .2s;
    touch-action: pan-y;   /* quer wischen gehört der Schublade (Wisch nach links schließt), hoch und runter rollt die Liste */
  }
  .seitenleiste .nav-rollbereich { touch-action: pan-y; }   /* der Rollbereich darin ebenso (er ist selbst die Grenze für die Finger-Regel) */
  .seitenleiste.wird-gezogen { transition: none; }
  .rahmen--schublade .seitenleiste { transform: none; visibility: visible; box-shadow: var(--schatten-3), 30px 0 80px -30px rgba(16, 24, 40, .35); transition: transform .5s var(--feder-ruhig), visibility 0s, box-shadow .3s; }
  .seitenleiste .seitenleiste-x { display: inline-grid; }
  .schublade-dunkel { display: block; position: fixed; inset: 0; z-index: 65; background: var(--dunkel); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .rahmen--schublade .schublade-dunkel { opacity: 1; pointer-events: auto; }
  .mobil-leiste { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; height: calc(56px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); background: var(--flaeche); border-bottom: 1px solid var(--linie); }
  .mobil-leiste .wortmarke { padding: 0; min-height: 44px; }
  .inhalt { padding-bottom: max(48px, calc(24px + env(safe-area-inset-bottom))); }
  .mobil-leiste .wortmarke-logo { max-height: 30px; max-width: 46vw; object-position: center; }
  .mobil-leiste .wortmarke-zeichen { width: 30px; height: 30px; font-size: 14px; }
  .mobil-leiste-platz { flex: none; width: 40px; height: 40px; }   /* Kundensicht: Platz des Such-Knopfs, damit die Wortmarke mittig bleibt */
  .kopf { padding-top: var(--hinweis-zone); }   /* Tablet: der Streifen für Hinweise liegt unter der Leiste (ui.js: toastLage) */
  .kopf-werkzeug { display: none; }
  /* Tablet und Handy: Reiter wie bisher (Linie darunter, 15 px, weiter Abstand) */
  .kopf-reiter { border-bottom: 1px solid var(--linie); }
  .kopf-reiter .reiter-eintrag { font-size: 15px; }
  .reiter { gap: 24px; }
  .tabelle th, .tabelle td { padding-left: 12px; padding-right: 12px; }   /* schmaler Schirm: Spalten rücken zusammen */
  .einstellung { grid-template-columns: minmax(0, 1fr); }
}

/* ≤ 600 px: Handy-Fassung */
@media (max-width: 600px) {
  :root { --hinweis-zone: 18px; }
  .kopf-aktionen .ist-platzhalter { display: none; }   /* Handy: kein fester Streifen (Hinweise suchen sich dort weiter eine freie Lage) – Abstand über dem Titel wie bisher */
  :root { --rand: max(16px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .seitentitel { font-size: 24px; line-height: 32px; }
  .inhalt { padding-top: 16px; }
  /* Kopf-Aktionen (z. B. „Lead erstellen") als Knopf über die volle Breite unten */
  .kopf-aktionen { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40; margin: 0; }
  .kopf-aktionen .knopf { flex: 1; height: 48px; font-size: 15px; box-shadow: var(--schatten-3); }
  /* Gesperrter Knopf bleibt deckend, damit kein Inhalt durchscheint. */
  .kopf-aktionen .knopf:disabled { opacity: 1; background: color-mix(in srgb, var(--akzent) 42%, var(--flaeche)); color: var(--akzent-tinte); }
  .rahmen--mit-aktionen .inhalt { padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
  /* Dialoge füllen den Bildschirm */
  .dialog-huelle { padding: 0; }
  /* Vollbild: ohne Überschwinger hereinfahren (sonst blitzt unten kurz die Seite durch) */
  .dialog, .dialog--voll, .dialog--suche { width: 100%; height: 100%; max-height: none; margin: 0; border-radius: 0; box-shadow: none; animation: dialog-ein-handy .42s var(--feder-ruhig) backwards; }
  @keyframes dialog-ein-handy { from { opacity: 0; transform: translateY(24px); } }
  .dialog-kopf, .suche-kopf { padding: max(14px, env(safe-area-inset-top)) 12px 14px 16px; gap: 12px; }
  .dialog-inhalt { padding: 16px; }
  .dialog-inhalt:last-child { padding-bottom: max(16px, env(safe-area-inset-bottom)); }   /* ohne Fuß: der Inhalt endet über dem Balken unten */
  .dialog-inhalt--ohne-rand, .dialog-inhalt--ohne-rand:last-child { padding: 0; }
  /* Kurze Rückfragen und Eingaben: Blatt von unten (so hoch wie der Inhalt) statt eines fast leeren Vollbilds */
  .dialog-huelle--blatt { place-items: end stretch; }
  .dialog.dialog--blatt { height: auto; max-height: calc(100% - 12px - env(safe-area-inset-top, 0px)); border-radius: var(--radius-gross) var(--radius-gross) 0 0; box-shadow: var(--schatten-3); animation: blatt-ein .46s var(--feder-ruhig) backwards; }
  .dialog--blatt::before { content: ''; flex: none; align-self: center; width: 36px; height: 4px; margin-top: 8px; border-radius: 2px; background: var(--linie-stark); }   /* Griff */
  .dialog--blatt .dialog-kopf { padding-top: 12px; }
  @keyframes blatt-ein { from { transform: translateY(100%); } }
  .dialog-huelle.geht .dialog.dialog--blatt { animation: blatt-aus .2s var(--weg) both; }
  @keyframes blatt-aus { to { transform: translateY(100%); } }
  /* mit dem Finger am Kopf nach unten weggewischt: gleitet von dort, wo der Finger losgelassen hat, hinaus */
  .dialog-huelle.geht .dialog.wisch-zu { animation: dialog-wisch .2s var(--weg) both; }
  @keyframes dialog-wisch { to { transform: translateY(100%); } }
  .dialog-fuss { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
  .dialog-fuss .knopf { flex: 1; }
  .dialog-huelle.geht .dialog { animation-name: dialog-aus-handy; }
  /* am Kopf (und am Griff des Blatts) gehört die Bewegung des Fingers dem Wegwischen, nicht dem Rollen */
  .dialog > :first-child:not(.dialog-inhalt), .dialog--blatt { touch-action: pinch-zoom; }
  .dialog.wird-gezogen { transition: none; }
  .dialog.federt-zurueck { transition: transform .42s var(--feder-ruhig); }
  @keyframes dialog-aus-handy { to { opacity: 0; transform: translateY(20px); } }
  /* Toasts oben über die volle Breite (unter dem Seitenkopf, siehe --toast-ab); sie kommen von oben herein */
  .toasts { left: max(16px, env(safe-area-inset-left)); width: auto; }
  .toast { animation-name: toast-ein-handy; }
  .toast.geht { animation-name: toast-aus-handy; }
  @keyframes toast-ein-handy { from { opacity: 0; transform: translateY(-20px); } }
  @keyframes toast-aus-handy { to { opacity: 0; transform: translateY(-14px); } }
  .menue { max-width: calc(100vw - 16px); }
  .nicht-gefunden { padding: max(32px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom)); }
  .nicht-gefunden .leiste .knopf { flex: 1; }
}

/* Niedriger, schmaler Schirm (Handy quer): Die ganze Hauptspalte rollt – obere Leiste, Titel und Reiter rollen mit weg,
   damit der Inhalt den Bildschirm füllen kann (sonst blieben ihm rund 200 px). app.js setzt beim Seitenwechsel nach oben. */
@media (max-height: 560px) and (min-width: 600.02px) and (max-width: 959.98px) {
  .haupt { overflow: hidden auto; overscroll-behavior-y: contain; }
  .inhalt { flex: none; overflow: visible; scrollbar-gutter: auto; }
  .kopf { padding-top: 12px; }
  .seitentitel { font-size: 24px; line-height: 32px; }
  /* Seiten mit Kopf-Aktionen („Speichern", „Lead erstellen"): die Titelzeile bleibt beim Rollen oben stehen, sonst wäre
     „Speichern" nach einer Änderung weiter unten aus dem Bild. Leiste und Reiter rollen weiter weg. Der Kopf gibt dafür
     seinen Kasten auf (display: contents) – sticky hält nur innerhalb des eigenen Elternkastens. */
  .rahmen--mit-aktionen .kopf { display: contents; }
  .rahmen--mit-aktionen .kopf-zeile { position: sticky; top: 0; z-index: 30; flex: none; padding: max(8px, env(safe-area-inset-top, 0px)) var(--rand) 8px; background: var(--grund); }
  .rahmen--mit-aktionen .kopf-zeile::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 8px; background: linear-gradient(var(--grund), transparent); pointer-events: none; }
  .rahmen--mit-aktionen .kopf-reiter, .rahmen--mit-aktionen .kopf-unterreiter { flex: none; margin-left: var(--rand); margin-right: var(--rand); }
  .rahmen--mit-aktionen .kopf-reiter { margin-top: 2px; }
  /* Dialoge nutzen die ganze Höhe (wie am Handy hochkant), der Kopf ist flach; kurze Rückfragen bleiben ein Kärtchen in der Mitte */
  .dialog-huelle { padding: 0 env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px); }
  .dialog:not(.dialog--frage):not(.dialog--blatt) { width: 100%; height: 100%; max-height: none; margin: 0; border-radius: 0; box-shadow: none; }
  .dialog--frage, .dialog--blatt { max-height: calc(100% - 16px); }
  .dialog-kopf, .suche-kopf { padding: 8px 12px 8px 20px; }
  .dialog-kopf .icon-kachel { width: 36px; height: 36px; border-radius: 10px; }
  .dialog-titel p { display: block; }   /* Überlappung 24.10.: quer bricht der Untertitel um (vorher eine Zeile mit „…" ohne vollen Text) */
  .dialog-inhalt { padding: 14px 20px; }
  .dialog-inhalt--ohne-rand { padding: 0; }
  .dialog-fuss { padding: 8px 20px max(8px, env(safe-area-inset-bottom)); }
}

/* ─────────────────────────── 9 Ruhige Bewegung ───────────────────────────── */
/* Wer im System „Bewegung reduzieren" gesetzt hat, bekommt dieselben Abläufe stark verkürzt (nicht abgeschaltet:
   Zustände bleiben nachvollziehbar). Dauerläufer (Lade-Kreis, Schimmer) behalten ihr Tempo bzw. stehen still. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .12s !important; animation-delay: 0s !important; transition-duration: .1s !important; scroll-behavior: auto !important; }
  .dreher { animation-duration: .7s !important; }
  .skelett i { animation: none !important; }
  .reiter, .rollband { animation-duration: auto !important; }
}

/* ─────────────────────── 10 Bildschirm-Tastatur ──────────────────────────── */
/* Geht am Handy die Tastatur auf, wird nur der sichtbare Bereich kleiner (visualViewport), nicht das Layout. ui.js misst
   ihn und setzt am <html> data-tastatur, --vv-hoehe, --vv-oben und --tastatur (Höhe des verdeckten Streifens).
   Dialoge rücken in den sichtbaren Bereich: Kopf und Fuß (Speichern / Abbrechen) bleiben erreichbar, der Inhalt rollt. */
html[data-tastatur] .dialog-huelle { top: var(--vv-oben, 0px); bottom: auto; height: var(--vv-hoehe, 100%); padding-top: 0; padding-bottom: 0; }
html[data-tastatur] .dialog-huelle .dialog--suche { margin-top: 0; max-height: 100%; }

/* ─────────────────────────── 11 Touch-Geräte ─────────────────────────────── */
/* Gilt nur, wo der Finger das Zeigegerät ist (Handy, Tablet) – am Computer ändert sich nichts.
   Regel: Jedes Bedien-Element hat mindestens 44 × 44 px Trefferfläche. Knöpfe, Felder und Menü-Zeilen werden dafür 44 px
   hoch; kleine Elemente (Haken, Schalter, „?", X im Chip, kleine Icon-Knöpfe) behalten ihr Aussehen und bekommen eine
   unsichtbare größere Fläche (::before / ::after). Eingabefelder haben 16 px Schrift (sonst zoomt iOS beim Antippen). */
@media (pointer: coarse) {
  /* Knöpfe */
  .knopf { height: 44px; }
  .knopf--klein { position: relative; height: 36px; }
  .knopf--klein::after { content: ''; position: absolute; inset: -5px -1px; }   /* (ab der Innenkante des Rahmens gerechnet: 34 + 10 = 44) */
  .icon-knopf { width: 44px; height: 44px; }
  .icon-knopf--klein { width: 36px; height: 36px; }
  .icon-knopf--klein::after { content: ''; position: absolute; inset: -5px; }
  .icon-knopf--gross { width: 48px; height: 48px; }
  .pille--knopf { height: 44px; }
  .sortierwahl-richtung { width: 44px; }

  /* Felder */
  .feld, .feld--klein { min-height: 44px; }
  .feld-eingabe, .feld--klein .feld-eingabe { height: 42px; font-size: 16px; }
  .feld--text .feld-eingabe { height: auto; }
  .feld-leeren { position: relative; }
  .feld-leeren::after { content: ''; position: absolute; inset: -10px; }
  .suche-eingabe { height: 44px; }
  .suche-leer .tasten-hinweis { display: none; }        /* Tastenkürzel gibt es am Touch-Gerät nicht */
  .editor-text { font-size: 16px; line-height: 24px; }
  .editor-leiste { gap: 8px; }
  .editor-groesse { position: relative; height: 36px; padding: 0 10px; }
  .editor-groesse::after { content: ''; position: absolute; inset: -4px 0; }

  /* Auswahl mit mehreren Werten: Chips mit greifbarem X, Zeilen-Abstand passend zur Trefferfläche */
  .auswahl-chips { gap: 12px 6px; padding: 8px 0; }
  .auswahl-chips .chip { height: 32px; padding-right: 6px; }
  .chip-x { position: relative; flex: none; width: 24px; height: 24px; margin-right: -2px; }
  .chip-x::after { content: ''; position: absolute; inset: -10px; }
  button.chip { position: relative; height: 32px; padding: 0 12px; }
  button.chip::after { content: ''; position: absolute; inset: -7px -1px; }
  .suche-chips { gap: 12px 8px; }

  /* Schalter, Haken, „?" */
  .schalter::after { content: ''; position: absolute; inset: -10px -2px; }
  .schalter--klein::after { inset: -12px -6px; }
  .schalter-liste { gap: 20px; }
  .haken { position: relative; }
  .haken::after { content: ''; position: absolute; inset: -14px; }
  .hinweis-icon { position: relative; }
  .hinweis-icon::after { content: ''; position: absolute; inset: -12px; }

  /* Reiter, Umschalter */
  .reiter-eintrag { height: 44px; }
  .reiter-eintrag::before { content: ''; position: absolute; inset: 0 -6px; }
  .umschalter { padding: 3px; gap: 2px; }                                                        /* Touch: Schale wie bisher (am Computer 2 px, ohne Lücke) */
  .umschalter-teil, .umschalter--klein .umschalter-teil { position: relative; height: 38px; }   /* Schale: 38 + 2 × 3 = 44 */
  .umschalter-teil { min-width: 44px; }   /* F11: kurze Wörter („All" im Versand-Überblick, Englisch) – am Finger mindestens 44 breit */
  .umschalter-teil::after { content: ''; position: absolute; inset: -3px 0; }
  .umschalter-teil.nur-icon { width: 42px; }
  .umschalter-teil.nur-icon::after { inset: -3px -1px; }

  /* Menü */
  .menue-eintrag { min-height: 44px; }
  .menue-zurueck { width: 44px; height: 44px; }
  .menue-suche { height: 44px; }
  .menue-suche-eingabe { align-self: stretch; font-size: 16px; }

  /* Rahmen */
  .nav-punkt { min-height: 44px; }
  .nav-kampagne { height: 44px; }

  /* Tabelle, Seitenwahl, Toast, Ziehen */
  .tabelle-sort { position: relative; }
  .tabelle-sort::after { content: ''; position: absolute; inset: -14px -12px; }
  .seitenwahl-groesse { position: relative; height: 36px; min-width: 56px; justify-content: center; }
  .seitenwahl-groesse::after { content: ''; position: absolute; inset: -5px -1px; }
  .seitenwahl { gap: 8px 12px; flex-wrap: wrap; }
  .toast-x, .toast-aktion { position: relative; }
  .toast-x::after, .toast-aktion::after { content: ''; position: absolute; inset: -8px; }
  .zieh-griff { position: relative; width: 32px; height: 44px; }
  .zieh-griff::after { content: ''; position: absolute; inset: 0 -6px; }
  .statusbalken { position: relative; }
  .statusbalken[data-tippbar]::before { content: ''; position: absolute; inset: -19px 0; }
  .avatar-stapel[data-tippbar] { position: relative; }
  .avatar-stapel[data-tippbar]::before { content: ''; position: absolute; inset: -9px -6px; }
}

/* Ohne Maus bleibt „Hover" nach dem Tippen am Element kleben: dort heben sich Karten nicht und nichts bleibt vergrößert stehen. */
@media (hover: none) {
  a.karte:hover, button.karte:hover, .karte.ist-klickbar:hover { transform: none; box-shadow: var(--schatten-1); border-color: var(--linie); }
  a.karte:active, button.karte:active, .karte.ist-klickbar:active { transform: scale(.992); }
  .avatar-stapel .avatar:hover { transform: none; }
  .statusbalken-teil:hover { transform: none; }
}

/* Marke in der Farbe ihrer Herkunft (Chip({ ton })): eckig, Grund 7,5 %, Rahmen 22 %, Text in der Farbe – z. B. Quell-Felder im Mapping */
.chip.chip--ton { border-radius: 6px; background: color-mix(in srgb, var(--ton) 7.5%, white); border-color: color-mix(in srgb, var(--ton) 22%, white); color: var(--ton); }
@media (pointer: fine) { .chip.chip--ton { height: 22px; padding: 0 8px; font-size: 12px; line-height: 16px; } }   /* am Touch-Gerät bleibt die Marke greifbar groß (32 hoch, X mit 44er Fläche) */
.chip.chip--ton .chip-x { color: inherit; opacity: .7; }

/* ─────────────── 7g Computer, Runde 4b (Notiz 26, I „Feedback" · Block 4) ─────────────── */
@media (min-width: 960px) and (pointer: fine) {
  /* Feedback-Fenster: Rahmen #eaecf0, weicher Schatten, Innenabstand 16; hängt unter dem Knopf (y 71) und rollt innen
     (ui.js: bleibtUnten). Der Rollbalken hat seinen festen Platz rechts – der Inhalt bleibt 342 breit. */
  .menue.menue--feedback { border: 1px solid var(--linie); box-shadow: 0 12px 16px -4px rgba(16, 24, 40, .08), 0 4px 6px -2px rgba(16, 24, 40, .03); }
  .menue--feedback .menue-frei { padding: 15px; scrollbar-gutter: stable; }   /* 16 vom Außenrand = Rahmen 1 + 15; Inhalt 384 − 2 − 30 − 10 = 342 */
  .feedback .umschalter-teil:not(.ist-aktiv) .icon { color: #98A2B3; }
  .feedback .ablage .icon-kachel .icon { color: var(--tinte-2); }
  .feedback .ablage-text b { color: #981D01; }
  .feedback-achtung strong { font-weight: 600; }
}

/* ─────────────── 7h Computer, Runde 4c (Notiz 26, I „Suche", „Feedback" · Block 5) ─────────────── */
@media (min-width: 960px) and (pointer: fine) {
  /* Suche leer: Strich 556 breit (endet 32 vor dem X), Hinweistext bei +178, Tasten-Hinweis bleibt bei +230 (Fenster 330);
     Tasten-Hinweis Symbol 20 #344054, Taste nach Inhalt („F" 18,3 breit) */
  .suche-eingabe { margin-right: 16px; }
  .suche-leer { padding-top: 18px; gap: 32px; }
  .tasten-hinweis .icon { width: 20px; height: 20px; color: var(--tinte-2); }
  kbd, .taste { min-width: 0; }
  .tasten-hinweis kbd:first-of-type { min-width: 24px; }             /* „⌘" 24 breit, „F" 18,3 – zusammen 280,5 */
  /* Suche mit Treffern: das Fenster wächst mit den Treffern und bleibt mittig; mit Treffern mindestens 386 hoch
     (Notiz 23: 386 bei zwei Treffern – Annahme: darunter bleibt es bei 386, darüber wächst es je Treffer um 58) */
  .dialog--suche:has(.suche-gruppe) { min-height: min(386px, 100%); }
  /* Feedback: Kategorie-Leiste 29 unter der Oberkante der Bezeichnung (Bezeichnung 21 + 8) */
  .feedback > .feedback-teil:first-child { gap: 8px; }
}

/* ─────────────── 7i Computer, Runde 7 (Notiz 30, Bildvergleich 5) ─────────────── */
@media (min-width: 960px) and (pointer: fine) {
  /* Feedback 386 breit (app.js), Inhalt bleibt 342 (rechts 2 mehr Rand); Textfeld innen 318 × 120 bei gleicher Feldhöhe 126 */
  .menue--feedback .menue-frei { padding-right: 17px; }
  .feedback .feld--text { padding: 2px 11px; }
  .feedback .feld--text .feld-eingabe { height: 120px; min-height: 120px; }
  /* 404: Knöpfe 196,7 und 205,6 breit wie im Original (Wortlaut gleich, Schrift 14/600) */
  .nicht-gefunden .leiste .knopf { justify-content: center; }
  .nicht-gefunden .leiste .knopf:first-child { min-width: 196.7px; }
  .nicht-gefunden .leiste .knopf--haupt { min-width: 205.6px; }
}

/* ─────────────── 7j Computer, Runde 8 (Notiz 31, Kontrolllauf 8) ─────────────── */
@media (min-width: 960px) and (pointer: fine) {
  /* Feedback: Textfeld wie im Original bei Rahmen +137 – Feld 4,4 tiefer (Abstand unter „Dein Feedback" 9 statt 4,6), die Eingabe
     6 statt 3 im Feld; Feld bleibt 342 × 126, Eingabe 318 × 120 (sie reicht bis an die Unterkante, ihr Grund ist durchsichtig) */
  .feedback .feld-gruppe { gap: 9px; }
  .feedback .feld--text { height: 126px; padding: 5px 11px 0; overflow: hidden; }
}

/* ── S1: Sprache – runde Flagge (wie im Original vor „Sprache" und in der Sprachwahl), Zusatz rechts im Konto-Menü, Knopf „Sprache" ── */
.flagge { display: inline-flex; flex: none; border-radius: 50%; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .12); vertical-align: middle; }
.flagge svg { display: block; width: 100%; height: 100%; }
.menue-eintrag .flagge { width: 20px; height: 20px; }
.menue-zusatz { margin-left: auto; padding-left: 12px; font-size: 13px; line-height: 20px; font-weight: 400; color: var(--tinte-4, #667085); white-space: nowrap; }
.sprach-knopf { gap: 8px; }
.sprach-knopf .flagge { width: 18px; height: 18px; }
/* S1 (Handy, Messung in Italienisch): kurze Wörter („File" statt „Dateien") machen Reiter schmaler als 44 px, einzeilige Schalter-Texte
   rücken die Schalter auf 40 px zusammen (die Trefferflächen überlappen) – am Finger mindestens 44 × 44 */
@media (pointer: coarse) {
  .reiter-eintrag { min-width: 44px; justify-content: center; }
  .schalter-zeile { min-height: 28px; }
}

/* ─────────────── S2 (25.10., Notiz 41 „Offen"): Einstellungsseiten unter 1264 px wie im Original ───────────────
   Das Original baut jede Einstellungs-Zeile aus zwei Spalten: Bezeichnung `p-3 w-3/12` (unter 1264: `w-full`) und Feld
   `px-0 py-3 max-[1263px]:w-full min-[1264px]:w-8/12` in einer Reihe `-m-3 flex flex-wrap`. Unter 1264 px Fensterbreite steht
   das Feld darum UNTER der Bezeichnung: 12 + 12 px zwischen Text und Feld (gemessen 25.10., Kundeneinstellungen). Gilt für Agentur,
   Mein Konto, Kundeneinstellungen, Kampagnen-Einstellungen (dort auch `.ke-breit`); die Statusvorlage der Einrichtung steht in setup.css,
   die E-Mail-Konten hat J1 schon so (automations.css). Bewusst NICHT übernommen: Im Original beginnt das Feld 12 px links vom Text
   (px-0 in der -m-3-Reihe) – bei uns ragte es damit aus der Zeile (Überlappungs-Regel, Notiz 40; e2e-ueberlappung „ragt 12 px"). Das
   Feld steht bündig mit der Bezeichnung, wie bei den E-Mail-Konten. */
@media (min-width: 960px) and (max-width: 1263.98px) {
  .einstellung, .ke .ke-breit { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
  .einstellung-links h4 .hinweis-icon { margin-left: 0; }   /* Symbol bleibt beim Text statt am rechten Rand der ganzen Zeile */
}
