/* ==========================================================================
   MailGenius – Marke 3.0: Schrift, Farben, Raster, Grundbausteine
   Gemeinsam für Webseite (site.css), Kundenportal (app.css), Anmeldung (auth.css) und Rechtliches.

   Grundsätze (nach dem System von klingelfrei.de, eigene Farben):
   - Hell. Kühles Off-White als Seitengrund, Weiß für Karten, Tinte (Navy) für Text und Hauptknopf,
     Blau als Akzent (als Schrift nur in der dunklen Stufe --brand, ≥ 4,5:1), Gelb nur als Fläche/Funke.
   - 4-px-Raster (--abstand-1 … -9), Ecken 8/12/16/24, „Linie vor Schatten“.
   - Schriftstufen mit clamp(), Geist (OFL, selbst gehostet) mit angeglichenem Ersatz gegen Springen.
   - Bewegung erklärt einen Ablauf; bei prefers-reduced-motion stehen die Endzustände sofort.
   Variablen-Namen der Version 2 bleiben erhalten (app.css/app.js nutzen sie): --bg, --surface, --line, --text,
   --muted, --brand, --ok, --err, --c-* usw.
   ========================================================================== */

/* --- Schriften ------------------------------------------------------------ */
@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* Ersatz mit angeglichenen Maßen (Arial), damit beim Nachladen nichts springt.
   Werte aus den Schriftdateien berechnet (Geist: Einheiten 1000, Ober-/Unterlänge 1005/295). */
@font-face {
  font-family: "Geist Ersatz";
  src: local("Arial"), local("ArialMT"), local("Helvetica");
  font-weight: 100 549;
  size-adjust: 104%;
  ascent-override: 96.6%;
  descent-override: 28.4%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Geist Ersatz";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold");
  font-weight: 550 900;
  size-adjust: 102.3%;
  ascent-override: 98.2%;
  descent-override: 28.8%;
  line-gap-override: 0%;
}

/* --- Werte (Tokens) -------------------------------------------------------- */
:root {
  /* Marke */
  --mg-blau: #2456d6;            /* Blau als Schrift/Akzent auf Hell (6,2:1 auf Weiß) */
  --mg-blau-hell: #3b82f6;       /* Blau aus dem Zeichen – nur Fläche/Verlauf, nie kleine Schrift */
  --mg-indigo: #4338ca;
  --mg-funke: #ffd166;           /* Gelb: nur Fläche und Funken, nie Schrift */
  --mg-funke-soft: #fff4d6;
  --mg-tinte: #0e1730;           /* Navy: Text, Hauptknopf, dunkles Band */
  --mg-tinte-2: #1b2748;
  --mg-verlauf: linear-gradient(135deg, #3b82f6 0%, #4338ca 100%);
  --mg-verlauf-text: linear-gradient(100deg, #2456d6 0%, #4338ca 100%);

  /* Ordnerfarben (Punkt/Fläche). Schrift in Ordnerfarbe immer über .ordner (abgedunkelt, ≥ 4,9:1). */
  --c-inbox: #3b82f6;
  --c-invoice: #f59e0b;
  --c-order: #10b981;
  --c-social: #8b5cf6;
  --c-news: #ec4899;
  --c-spam: #64748b;
  --c-danger: #ef4444;

  /* Zustände (als Schrift auf Weiß ≥ 5:1) */
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --err: #c2261c;
  --err-soft: #fdecea;
  --info: #2456d6;
  --info-soft: #e8eefd;

  /* Flächen und Schrift */
  --bg: #f5f7fb;                 /* Seitengrund, kühles Off-White */
  --surface: #ffffff;            /* Karten */
  --surface-2: #eef2f8;          /* zweite Ebene: Segmente, Chips, Leisten */
  --surface-3: #e3e9f2;
  --line: #e1e6ef;               /* Trennlinien, Kartenränder */
  --line-strong: #c5cedb;        /* kräftigere Linie (Hover, Knopf-Rand) */
  --line-input: #8a95a8;         /* Rand von Eingabefeldern (3:1 auf Weiß) */
  --text: #0e1730;               /* 17,7:1 auf Weiß */
  --text-2: #3a4660;             /* 9,4:1 */
  --muted: #56627a;              /* 6,1:1 auf Weiß, 5,7:1 auf --bg */
  --brand: #2456d6;
  --brand-strong: #1c46b8;
  --brand-soft: #e8eefd;
  --on-brand: #ffffff;
  --focus: #2456d6;

  /* Hauptknopf: Tinte */
  --knopf: #0e1730;
  --knopf-hover: #22305a;
  --knopf-text: #ffffff;

  /* Schatten: sparsam – zuerst Linie, Schatten nur für Dinge, die sich lösen */
  --shadow-1: 0 1px 2px rgb(14 23 48 / .05);
  --shadow-2: 0 1px 2px rgb(14 23 48 / .05), 0 12px 32px -12px rgb(14 23 48 / .16);
  --shadow-3: 0 2px 6px rgb(14 23 48 / .06), 0 32px 80px -28px rgb(14 23 48 / .34);

  /* Raster (Grundschritt 4 px) */
  --abstand-1: 4px;
  --abstand-2: 8px;
  --abstand-3: 12px;
  --abstand-4: 16px;
  --abstand-5: 24px;
  --abstand-6: 32px;
  --abstand-7: 48px;
  --abstand-8: 64px;
  --abstand-9: 96px;

  /* Ecken */
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --r-xl: 24px;
  --r-full: 999px;
  /* Namen aus Version 2 */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 16px;

  /* Schrift */
  --font: "Geist", "Geist Ersatz", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --schrift-held: clamp(2.5rem, 1.5rem + 4.2vw, 4.75rem);
  --schrift-titel-1: clamp(2rem, 1.45rem + 2.3vw, 3.25rem);
  --schrift-titel-2: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem);
  --schrift-titel-3: clamp(1.125rem, 1.05rem + .3vw, 1.3125rem);
  --schrift-gross: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
  --schrift-text: 1rem;
  --schrift-klein: .875rem;
  --schrift-mini: .8125rem;

  /* Bewegung */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --dauer-kurz: .15s;
  --dauer: .3s;
  --dauer-lang: .6s;

  --bedienhoehe: 44px;
  --kopf-hoehe: 64px;

  color-scheme: light;
  interpolate-size: allow-keywords;
}
@media (min-width: 1000px) { :root { --kopf-hoehe: 72px; } }

/* --- Grundlagen ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--kopf-hoehe) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--schrift-text);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; font-weight: 650; text-wrap: balance; }
p { text-wrap: pretty; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
b, strong { font-weight: 650; }
::selection { background: #d5e1ff; color: var(--text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only, .nur-vorlesen { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.sprunglink { position: absolute; left: 12px; top: -80px; z-index: 1000; padding: 12px 18px; border-radius: var(--r-m); background: var(--knopf); color: var(--knopf-text); font-weight: 600; text-decoration: none; transition: top .2s; }
.sprunglink:focus { top: 12px; }
.ic { width: 1.25em; height: 1.25em; flex: none; }
.mono { font-family: var(--mono); font-feature-settings: normal; letter-spacing: 0; }
.zahlen { font-variant-numeric: tabular-nums; }

/* --- Schriftstufen --------------------------------------------------------- */
.titel-held { font-size: var(--schrift-held); line-height: 1.02; letter-spacing: -.045em; font-weight: 700; }
.titel-1 { font-size: var(--schrift-titel-1); line-height: 1.08; letter-spacing: -.035em; font-weight: 680; }
.titel-2 { font-size: var(--schrift-titel-2); line-height: 1.12; letter-spacing: -.032em; font-weight: 660; }
.titel-3 { font-size: var(--schrift-titel-3); line-height: 1.3; letter-spacing: -.015em; font-weight: 640; }
.einleitung { font-size: var(--schrift-gross); line-height: 1.55; color: var(--text-2); max-width: 40em; }
.text-klein { font-size: var(--schrift-klein); }
.text-leise { color: var(--muted); }
/* Dachzeile über Überschriften: kleines Etikett in Großbuchstaben */
.dachzeile {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 var(--abstand-3);
  font-size: var(--schrift-mini); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
}
.dachzeile .ic { width: 16px; height: 16px; }
.verlauf-text { background: var(--mg-verlauf-text); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* --- Zeichen + Wortmarke -------------------------------------------------- */
.marke { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--text); font-weight: 680; letter-spacing: -.03em; font-size: 1.1875rem; }
.marke svg { width: 32px; height: 32px; flex: none; }
.marke .tld { color: var(--muted); font-weight: 500; }

/* --- Knöpfe -------------------------------------------------------------
   .btn = Zweitknopf (weiß mit Linie) · --primary Hauptknopf (Tinte, einer je Ansicht) · --akzent (Blau)
   --ghost (ohne Rahmen) · --danger · --hell (auf dunklem Band) · Größen --sm/--lg · --block · --icon
   Ladezustand: .is-busy (Text weg, Kreisel) · deaktiviert: [disabled] / aria-disabled */
.btn {
  --b-bg: var(--surface);
  --b-fg: var(--text);
  --b-line: var(--line-strong);
  --b-hover-bg: var(--surface);
  --b-hover-line: var(--text-2);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--bedienhoehe); padding: 0 18px;
  border-radius: var(--r-m);
  border: 1px solid var(--b-line);
  background: var(--b-bg); color: var(--b-fg);
  font-weight: 600; font-size: .9375rem; letter-spacing: -.01em; line-height: 1.15;
  text-decoration: none; text-align: center; cursor: pointer;
  transition: transform var(--dauer-kurz) var(--ease), background-color .2s, border-color .2s, box-shadow .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--b-hover-bg); border-color: var(--b-hover-line); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn .ic { width: 18px; height: 18px; }
.btn--primary { --b-bg: var(--knopf); --b-fg: var(--knopf-text); --b-line: var(--knopf); --b-hover-bg: var(--knopf-hover); --b-hover-line: var(--knopf-hover);
  box-shadow: 0 1px 0 rgb(255 255 255 / .08) inset, 0 8px 20px -10px rgb(14 23 48 / .55); }
.btn--akzent { --b-bg: var(--brand); --b-fg: #fff; --b-line: var(--brand); --b-hover-bg: var(--brand-strong); --b-hover-line: var(--brand-strong); }
.btn--ghost { --b-bg: transparent; --b-line: transparent; --b-hover-bg: var(--surface-2); --b-hover-line: transparent; }
.btn--danger { --b-bg: var(--surface); --b-fg: var(--err); --b-line: color-mix(in srgb, var(--err) 40%, var(--line)); --b-hover-bg: var(--err-soft); --b-hover-line: var(--err); }
.btn--hell { --b-bg: #fff; --b-fg: var(--mg-tinte); --b-line: #fff; --b-hover-bg: #e9efff; --b-hover-line: #e9efff; }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 1rem; border-radius: var(--r-m); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: .875rem; border-radius: 10px; }
.btn--sm .ic { width: 16px; height: 16px; }
.btn--block { width: 100%; }
.btn--icon { width: var(--bedienhoehe); min-width: var(--bedienhoehe); padding: 0; }
.btn--icon.btn--sm { width: 36px; min-width: 36px; }
.btn.is-busy { pointer-events: none; color: transparent !important; }
.btn.is-busy > * { visibility: hidden; }
.btn.is-busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--b-fg); border-right-color: transparent; animation: mg-dreh .7s linear infinite; }
@keyframes mg-dreh { to { transform: rotate(360deg); } }

/* Textlink mit Pfeil */
.textlink { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--brand); font-weight: 600; text-decoration: none; }
.textlink:hover { text-decoration: underline; }
.textlink .ic { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.textlink:hover .ic { transform: translateX(3px); }

/* --- Formulare -----------------------------------------------------------
   <div class="feld"><label for>…</label><input class="eingabe"><p class="hinweis">…</p></div>
   Fehler: aria-invalid="true" am Feld + <p class="fehlertext" role="alert">. Symbol im Feld: .mit-symbol */
.formular { display: grid; gap: var(--abstand-4); }
.feld { display: grid; gap: 6px; min-width: 0; }
.feld > label, .feld .label { font-size: .875rem; font-weight: 600; color: var(--text); }
.feld > label.haken { font-size: .9375rem; font-weight: 450; color: var(--text-2); }
.feld .optional { font-weight: 450; color: var(--muted); }
.feld .hinweis { margin: 0; font-size: .8125rem; color: var(--muted); }
.feld-zeile { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.feld-zeile label { font-size: .875rem; font-weight: 600; }
.feld-zeile a { font-size: .875rem; font-weight: 600; }
.eingabe {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border-radius: var(--r-m); border: 1px solid var(--line-input);
  background: var(--surface); color: var(--text);
  font-size: 1rem; line-height: 1.3;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.eingabe::placeholder { color: #7b869a; opacity: 1; }
.eingabe:hover { border-color: var(--text-2); }
.eingabe:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgb(36 86 214 / .16); }
.eingabe[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 4px rgb(194 38 28 / .12); }
.eingabe:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
select.eingabe { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2356627a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
textarea.eingabe { min-height: 132px; resize: vertical; line-height: 1.5; }
.fehlertext { margin: 0; color: var(--err); font-size: .875rem; font-weight: 550; }
.fehlertext:not(:empty)::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px;
  background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Symbol links im Feld */
.mit-symbol { position: relative; }
.mit-symbol > .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.mit-symbol > .eingabe { padding-left: 44px; }

/* Passwort mit Auge */
.passwort-feld { position: relative; }
.passwort-feld .eingabe { padding-right: 52px; }
.passwort-feld .zeigen { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: var(--r-s); cursor: pointer; }
.passwort-feld .zeigen:hover { color: var(--text); background: var(--surface-2); }
.passwort-feld .zeigen .ic { width: 20px; height: 20px; }

/* Passwortstärke: <div class="staerke" data-stufe="0-4"><i></i><i></i><i></i><i></i></div> */
.staerke { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.staerke i { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background-color .25s; }
.staerke[data-stufe="1"] i:nth-child(-n+1) { background: var(--err); }
.staerke[data-stufe="2"] i:nth-child(-n+2) { background: var(--warn); }
.staerke[data-stufe="3"] i:nth-child(-n+3) { background: #2f8f4e; }
.staerke[data-stufe="4"] i { background: var(--ok); }
/* Regeln, die sich beim Tippen abhaken: <ul class="pw-regeln"><li data-regel="laenge">…</li></ul> */
.pw-regeln { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .8125rem; color: var(--muted); }
.pw-regeln li { display: flex; align-items: center; gap: 8px; transition: color .2s; }
.pw-regeln li::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-input); background: var(--surface); transition: background-color .2s, border-color .2s; }
.pw-regeln li.erfuellt { color: var(--text); }
.pw-regeln li.erfuellt::before { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat; }

/* Häkchen (Checkbox): <label class="haken"><input type="checkbox"> <span>Text</span></label> */
.haken { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: .9375rem; line-height: 1.5; color: var(--text-2); }
.haken input { appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border-radius: 7px; border: 1.5px solid var(--line-input); background: var(--surface); display: grid; place-items: center; cursor: pointer; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.haken input::after { content: ""; width: 12px; height: 12px; background: #fff; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%); transform: scale(0); transition: transform .2s var(--ease-spring); }
.haken input:hover { border-color: var(--text-2); }
.haken input:checked { background: var(--brand); border-color: var(--brand); }
.haken input:checked::after { transform: scale(1); }
.haken input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.haken input[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 3px rgb(194 38 28 / .14); }
.haken span { padding-top: 1px; }
/* Auswahlknopf (Radio) in derselben Form */
.haken input[type="radio"] { border-radius: 50%; }
.haken input[type="radio"]::after { width: 10px; height: 10px; border-radius: 50%; clip-path: none; }
/* Gruppen: <fieldset class="feld"><legend>…</legend> … </fieldset> */
fieldset.feld, fieldset.gruppe { min-width: 0; margin: 0; padding: 0; border: 0; gap: 10px; }
fieldset.feld > legend, fieldset.gruppe > legend { float: left; width: 100%; margin-bottom: 4px; padding: 0; font-size: .875rem; font-weight: 600; color: var(--text); }
fieldset.feld > legend + * { clear: left; }
input[type="date"].eingabe { min-height: 48px; }
.haken a { font-weight: 550; }

/* Schalter (Checkbox mit role switch optional) */
.schalter { position: relative; flex: none; width: 46px; height: 28px; appearance: none; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-strong); cursor: pointer; transition: background-color .2s var(--ease), border-color .2s; margin: 0; }
.schalter::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(14 23 48 / .3); transition: transform .25s var(--ease-spring); }
.schalter:checked { background: var(--brand); border-color: var(--brand); }
.schalter:checked::after { transform: translateX(18px); }
.schalter:disabled { cursor: not-allowed; opacity: .55; }

/* Segment (Umschalter): Knöpfe mit aria-pressed ODER Radios in Labels */
.segment { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line); }
.segment button, .segment label { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: .875rem; cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s; white-space: nowrap; }
.segment button .ic, .segment label .ic { width: 16px; height: 16px; }
.segment button:hover, .segment label:hover { color: var(--text); }
.segment button[aria-pressed="true"], .segment button[aria-checked="true"], .segment label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(14 23 48 / .08), 0 0 0 1px var(--line); }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Falle für Bots (Formular-Honeypot) */
.feld--falle { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Karten -------------------------------------------------------------- */
.karte { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(20px, 2.4vw, 28px); }
.karte--hoch { box-shadow: var(--shadow-2); }
.karte--leise { background: var(--surface-2); border-color: transparent; }

/* --- Chips und Ordner ----------------------------------------------------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .8125rem; font-weight: 550; line-height: 1.4; color: var(--text-2); white-space: nowrap; }
/* Ordner-Chip: <span class="ordner" data-c="invoice">MG-Rechnungen</span> (Farbe über data-c oder --c) */
.ordner { --c: var(--c-inbox); display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: .8125rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: color-mix(in srgb, var(--c) 55%, var(--text)); }
.ordner::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.ordner .ic { width: 14px; height: 14px; }
.mg [data-c="inbox"] { --c: var(--c-inbox); }
.mg [data-c="invoice"] { --c: var(--c-invoice); }
.mg [data-c="order"] { --c: var(--c-order); }
.mg [data-c="social"] { --c: var(--c-social); }
.mg [data-c="news"] { --c: var(--c-news); }
.mg [data-c="spam"] { --c: var(--c-spam); }
.mg [data-c="danger"] { --c: var(--c-danger); }
/* Symbol in Ordnerfarbe auf getönter Fläche */
.ordner-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--c-inbox)) 13%, var(--surface)); color: color-mix(in srgb, var(--c, var(--c-inbox)) 70%, var(--text)); }
.ordner-ic .ic { width: 18px; height: 18px; }
/* Avatar mit Anfangsbuchstabe */
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: .875rem; background: color-mix(in srgb, var(--c, var(--c-spam)) 15%, var(--surface)); color: color-mix(in srgb, var(--c, var(--c-spam)) 60%, var(--text)); }

/* --- Hinweise und Meldungen ---------------------------------------------
   Im Text: <div class="hinweis-box hinweis-box--ok|--warn|--err" role="status">Symbol + Text</div>
   Kurzmeldung (Toast) unten: Container [data-meldungen] class="meldungen", darin .meldung.meldung--ok|--fehler */
.hinweis-box { --s: var(--info); --s-bg: var(--info-soft); display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-m); background: var(--s-bg); border: 1px solid color-mix(in srgb, var(--s) 22%, transparent); color: var(--text); font-size: .9375rem; line-height: 1.5; }
.hinweis-box .ic { flex: none; width: 20px; height: 20px; color: var(--s); margin-top: 1px; }
.hinweis-box b { display: block; }
.hinweis-box p { margin: 0; }
.hinweis-box--ok { --s: var(--ok); --s-bg: var(--ok-soft); }
.hinweis-box--warn { --s: var(--warn); --s-bg: var(--warn-soft); }
.hinweis-box--err { --s: var(--err); --s-bg: var(--err-soft); }

.meldungen { position: fixed; z-index: 900; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.meldung { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-l); background: var(--mg-tinte); color: #f1f5fb; font-size: .9375rem; font-weight: 500; box-shadow: 0 20px 50px -18px rgb(14 23 48 / .55); animation: mg-hoch .35s var(--ease) both; }
.meldung .ic { width: 18px; height: 18px; flex: none; }
.meldung--ok .ic { color: #4ade80; }
.meldung--fehler .ic, .meldung--err .ic { color: #f87171; }
.meldung.ist-weg { animation: mg-runter .25s var(--ease) forwards; }
@keyframes mg-hoch { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes mg-runter { to { opacity: 0; transform: translateY(10px) scale(.98); } }

/* Status-Punkt */
.punkt { --s: var(--ok); display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--s); box-shadow: 0 0 0 3px color-mix(in srgb, var(--s) 22%, transparent); }
.punkt--live { animation: mg-puls 2s ease-out 3; }   /* endlich (WCAG 2.2.2); Dauerpuls nur, wo es einen Pause-Knopf gibt */
@keyframes mg-puls { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--s) 45%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }

/* --- Dialoge (natives <dialog class="dialog">) ---------------------------- */
.dialog { width: min(560px, 100% - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); color: var(--text); box-shadow: var(--shadow-3); overflow: auto; overscroll-behavior: contain; }
.dialog--klein { width: min(440px, 100% - 24px); }
.dialog::backdrop { background: rgb(14 23 48 / .38); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog[open] { animation: mg-dialog .3s var(--ease); }
@keyframes mg-dialog { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.dialog-innen { position: relative; padding: clamp(22px, 4vw, 32px); display: grid; gap: 18px; }
.dialog-innen h2 { margin: 0; font-size: 1.375rem; letter-spacing: -.025em; padding-right: 44px; }
.dialog-innen > p { margin: 0; color: var(--text-2); }
.dialog-zu { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: var(--r-m); border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.dialog-zu:hover { background: var(--surface-2); color: var(--text); }
.dialog-knoepfe { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* --- Hilfen ------------------------------------------------------------- */
.trenner { height: 1px; border: 0; margin: var(--abstand-5) 0; background: var(--line); }
kbd { font-family: var(--mono); font-size: .8125em; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); }

/* --- Bewegung reduzieren: Endzustände sofort ------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}
