/* ============================================================
   CreatorOS — Design-System in der UGC-Max-Optik.
   Ursprung war „Modern Blue" aus dem Finance OS. Seit dem 11.10.2026
   trägt CreatorOS dieselbe visuelle Sprache wie UGCmax.de auf dem VPS:
   EINE Markenfarbe (TikTok-Rot #F1204A), neutrale Graustufen OHNE
   Blaustich, runde Ecken und Pill-Knöpfe.
   Ergänzung: Inter wird mitgeliefert (fonts/InterVariable.woff2),
   damit die Typografie überall gleich ausfällt — auch in Webviews
   ohne lokale Inter-Installation.
   ============================================================ */

@font-face {
  font-family: "Inter";
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   Design-Tokens (UI-Konzept 2026)
   Tokens → Komponenten → Screens. Dark Mode via [data-theme].

   Diese Datei ist die Quelle. `survey/apps/frontend/tokens.css` ist eine
   bewusste Kopie derselben Tokens (die Umfrage soll aussehen wie das
   Creator OS, kein zweites Designsystem) — Änderungen hier müssen dort
   nachgezogen werden.
   ============================================================ */

:root {
  /* Brand — EINE solide Farbe, kein Verlauf (UGC-Max-Regel: „kein
     Farbverlauf"). Alles Markige nimmt sie einfarbig: Knöpfe, Avatare,
     Fortschrittsbalken, Diagramm-Hauptserie. */
  --color-primary: #F1204A;
  --color-primary-hover: #D9183F;
  /* Zweite Diagramm-Serie. Graphit, weil Rot schon die Hauptserie ist und
     keine neue Farbe ins neutrale System kommen soll. */
  --color-accent: #404040;

  /* Surfaces — neutral, ohne Blaustich (UGC Max: 95 / 97 / 99 %) */
  --color-background: #F2F2F2;
  --color-surface: #F7F7F7;
  --color-white: #FCFCFC;
  --color-surface-elevated: #FCFCFC;

  /* Text */
  --color-text-primary: #171717;
  --color-text-secondary: #666666;
  --color-text-muted: #8C8C8C;

  /* Lines */
  --color-border: #DEDEDE;
  --color-border-strong: #C7C7C7;

  /* Status
     „Fehler" ist bewusst DUNKLER als die Markenfarbe: Markenknopf und
     Löschen dürfen nicht gleich aussehen, sonst verliert der Danger-Knopf
     seine Warnwirkung. „Info" bleibt blau — seit Rot die Marke ist, hebt
     sich das neutrale Blau sogar besser ab als vorher. */
  --color-success: #16A34A;
  --color-success-bg: #DCFCE7;
  --color-success-text: #15803D;
  --color-warning: #F59E0B;
  --color-warning-bg: #FEF3C7;
  --color-warning-text: #B45309;
  --color-error: #B91C1C;
  --color-error-bg: #FEE2E2;
  --color-error-text: #991B1B;
  --color-info-bg: #E0F2FE;
  --color-info-text: #0369A1;

  /* Active nav — der Text ist dunkler als die Marke: #F1204A käme auf dem
     Rot-Wash nur auf 3,6:1, #C81E3F erreicht 4,8:1 (WCAG AA). */
  --color-nav-active-bg: #FDE8EC;
  --color-nav-active-text: #C81E3F;

  /* Focus-Ring — einmal definiert (UGC Max: --ring), nicht je Feld */
  --color-ring: rgba(241, 32, 74, 0.15);

  /* Radius — UGC-Max-Skala (Basis 16, md = Basis − 2, sm = Basis − 4) */
  --radius-sm: 12px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Shadows — neutrales Schwarz. Das frühere slate-900 (15, 23, 42) trug
     einen Blaustich, der auf den grauen Flächen sichtbar wurde. */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);

  /* Spacing (4er-Basis) */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px;

  /* Layout */
  --sidebar-w: 256px;
  --transition: 180ms ease-out;

  /* Prüfstand — die P1/P2/P3-Stufen (ADR-014, Block F aus docs/test-stack.html).
     Es gibt sie nur hier und in [data-theme="dark"]: kein Wert steht in nur
     einem Modus, sonst wäre der Rand im anderen unsichtbar.
     Unverändert: das sind dokumentierte Schweregrade, keine Markenfarben. */
  --p1: #BB2318;  --p1-wash: #FBE9E7;
  --p2: #A0550A;  --p2-wash: #FBF0DF;
  --p3: #5A6878;  --p3-wash: #ECF0F4;
}

[data-theme="dark"] {
  /* Neutrales Grau (#121212 / #1F1F1F / #2E2E2E) — KEIN Blaustich.
     Die Markenfarbe wird hier absichtlich NICHT überschrieben: Rot bleibt
     in beiden Themes dasselbe Rot (wie bei UGC Max). */
  --color-background: #121212;
  --color-surface: #1F1F1F;
  --color-white: #1F1F1F;
  --color-surface-elevated: #2E2E2E;
  --color-text-primary: #FAFAFA;
  --color-text-secondary: #A3A3A3;
  --color-text-muted: #7A7A7A;
  --color-border: #333333;
  --color-border-strong: #474747;
  --color-accent: #A3A3A3;
  --color-nav-active-bg: rgba(241, 32, 74, 0.16);
  --color-nav-active-text: #FF5570;
  --color-ring: rgba(241, 32, 74, 0.30);
  --color-success-bg: rgba(22, 163, 74, 0.16);
  --color-success-text: #4ADE80;
  --color-warning-bg: rgba(245, 158, 11, 0.14);
  --color-warning-text: #FBBF24;
  --color-error-bg: rgba(185, 28, 28, 0.18);
  --color-error-text: #FCA5A5;
  --color-info-bg: rgba(6, 182, 212, 0.14);
  --color-info-text: #22D3EE;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.45);

  /* Prüfstand: dieselben drei Stufen, aufgehellt für den dunklen Grund. */
  --p1: #F0776A;  --p1-wash: #3A1A17;
  --p2: #E0A44E;  --p2-wash: #3A2A12;
  --p3: #93A2B2;  --p3-wash: #222C37;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text-primary);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
.hidden { display: none !important; }
.muted { color: var(--color-text-muted); }
.small { font-size: 0.8rem; }
h1, h2, h3 { color: var(--color-text-primary); }
h2 { font-size: 1.4rem; font-weight: 700; margin: var(--space-2) 0 var(--space-5); letter-spacing: -0.01em; }
h3 { font-size: 0.95rem; font-weight: 600; margin: 0 0 var(--space-3); }
a { color: var(--color-primary); text-decoration: none; }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 4px; }

/* ---------- Buttons ---------- */
/* Pill-Form wie bei UGC Max (`rounded-full`, „TikTok-Anmutung"). Wer seinen
   Radius eigens setzt — Navigation, Auswahlkarten, Icon-Knöpfe — bleibt
   davon unberührt, weil die Regel dort später überschrieben wird. */
button {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius-pill);
  height: 44px; padding: 0 var(--space-5);
  transition: background var(--transition), border-color var(--transition),
    box-shadow var(--transition), transform var(--transition), filter var(--transition);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
}
button.primary { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }
button.primary:hover { background: var(--color-primary-hover); box-shadow: var(--shadow-md); }
button.primary:active { transform: scale(0.97); }
button.secondary { background: var(--color-surface-elevated); border-color: var(--color-border); color: var(--color-text-primary); }
button.secondary:hover { background: var(--color-surface); border-color: var(--color-border-strong); }
button.ghost { background: transparent; color: var(--color-primary); border-color: transparent; }
button.ghost:hover { background: var(--color-nav-active-bg); }
button.small { height: 34px; padding: 0 var(--space-3); font-size: 0.83rem; border-radius: var(--radius-pill); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Inputs ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.83rem; font-weight: 500; color: var(--color-text-secondary); }
input, select, textarea {
  font: inherit; color: var(--color-text-primary);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  height: 44px; padding: 0 var(--space-3);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
textarea { height: auto; padding: var(--space-2) var(--space-3); resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-ring);
}
input.acc { width: 84px; }
input::placeholder { color: var(--color-text-muted); }

/* ---------- Cards ---------- */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.placeholder { border-style: dashed; background: var(--color-surface); box-shadow: none; }

/* ---------- Badges / Pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.74rem; font-weight: 600; padding: 3px 10px;
  border-radius: var(--radius-pill); background: var(--color-surface);
  color: var(--color-text-secondary); border: 1px solid var(--color-border);
  white-space: nowrap;
}
.pill.ok { background: var(--color-success-bg); color: var(--color-success-text); border-color: transparent; }
.pill.bad { background: var(--color-error-bg); color: var(--color-error-text); border-color: transparent; }
.pill.warn { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: transparent; }
.pill.info { background: var(--color-info-bg); color: var(--color-info-text); border-color: transparent; }

.msg { min-height: 1.3em; font-size: 0.84rem; color: var(--color-warning-text); margin: var(--space-2) 0 0; }

/* ---------- Login (Split Screen, Konzept §9/§71) ---------- */
#login-view {
  min-height: 100vh; display: grid;
  grid-template-columns: minmax(420px, 46%) 1fr;
}
.login-hero {
  position: relative; overflow: hidden;
  background: #111111 url("/hero-login.png") center / cover no-repeat;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--space-12);
  color: #fff;
}
.login-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.55) 62%, rgba(0, 0, 0, 0.88) 100%);
}
.login-hero > * { position: relative; z-index: 1; }
.hero-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; margin-bottom: auto; }
.hero-logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--color-primary); display: grid; place-items: center;
  font-size: 15px; color: #fff; box-shadow: var(--shadow-md);
}
.hero-claim { color: #FFFFFF; font-size: clamp(1.9rem, 3.2vw, 2.9rem); font-weight: 700; line-height: 1.12; margin: 0 0 var(--space-4); letter-spacing: -0.015em; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45); }
.hero-sub { font-size: 1.02rem; color: rgba(250, 250, 250, 0.85); margin: 0 0 var(--space-6); }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); font-size: 0.92rem; color: rgba(250, 250, 250, 0.92); }
.hero-points li { display: flex; align-items: center; gap: 10px; }
.hero-check { width: 20px; height: 20px; border-radius: 50%; background: rgba(241, 32, 74, 0.4); display: inline-grid; place-items: center; flex-shrink: 0; font-size: 11px; color: #fff; }

.login-side {
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-10) var(--space-8);
  background: linear-gradient(180deg, #F7F7F7 0%, #EDEDED 100%);
}
[data-theme="dark"] .login-side { background: linear-gradient(180deg, #121212 0%, #1C1C1C 100%); }
.login-card {
  width: 100%; max-width: 440px;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
}
.login-head { margin-bottom: var(--space-6); }
.login-head h1 { font-size: 1.45rem; font-weight: 700; margin: 0 0 6px; }
.login-head .sub { color: var(--color-text-secondary); font-size: 0.92rem; margin: 0; }
.login-card label { margin-bottom: var(--space-4); }

/* OAuth (offizielle Logos: keine Nachbauten, klare Buchstaben-Tiles) */
.oauth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin: 0 0 var(--space-2); }
.oauth-btn {
  height: 48px; border-radius: var(--radius-md); font-size: 0.88rem;
  background: var(--color-surface-elevated); border: 1px solid var(--color-border);
  color: var(--color-text-primary);
}
.oauth-btn:hover { background: var(--color-surface); border-color: var(--color-border-strong); box-shadow: var(--shadow-sm); }
/* Provider-Logos: offizielle Brand-SVGs, einheitliche weiße Chips
   (Google-Richtlinie verlangt weißen Chip für das G — für Symmetrie gilt
   derselbe Chip für alle vier), Logo 14px zentriert in 20px Chip */
.provider-chip {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px;
  background: #FFFFFF; border: 1px solid var(--color-border);
  display: inline-grid; place-items: center;
}
.provider-chip img { width: 14px; height: 14px; display: block; }
.provider-label { font-weight: 600; }

.divider { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) 0; color: var(--color-text-muted); font-size: 0.78rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.login-links { display: flex; justify-content: flex-end; margin: -6px 0 var(--space-4); font-size: 0.82rem; }

.login-actions { display: flex; gap: var(--space-3); margin-top: var(--space-2); }
.login-actions button { flex: 1; }
.login-foot { margin-top: var(--space-6); text-align: center; font-size: 0.82rem; color: var(--color-text-muted); }
.login-foot a { font-weight: 600; }

@media (max-width: 920px) {
  #login-view { grid-template-columns: 1fr; }
  .login-hero { min-height: 220px; padding: var(--space-8); }
  .hero-points { display: none; }
}

/* ---------- App Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  background: var(--color-surface-elevated);
  border-right: 1px solid var(--color-border);
  display: flex; flex-direction: column;
  padding: var(--space-4) var(--space-3);
}
.brand { display: flex; align-items: center; gap: 10px; padding: var(--space-2) var(--space-3) var(--space-4); font-weight: 700; font-size: 1rem; }
.badge { background: var(--color-warning-bg); color: var(--color-warning-text); border-radius: var(--radius-pill); font-size: 0.58rem; padding: 2px 7px; font-weight: 700; letter-spacing: 0.05em; }

#main-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section {
  font-size: 0.67rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--color-text-muted); padding: var(--space-4) var(--space-3) var(--space-1);
}
.nav-item {
  display: flex; align-items: center; justify-content: flex-start; gap: 11px; width: 100%;
  text-align: left; height: 42px; padding: 0 var(--space-3);
  background: transparent; border: none; border-radius: var(--radius-md);
  color: var(--color-text-secondary); font-size: 0.9rem; font-weight: 500;
  box-shadow: none;
}
.nav-item .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .pill { margin-left: auto; font-size: 0.6rem; padding: 1px 7px; }
.nav-item:hover { background: var(--color-surface); color: var(--color-text-primary); }
.nav-item.active { background: var(--color-nav-active-bg); color: var(--color-nav-active-text); font-weight: 600; }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item .nav-count { margin-left: auto; font-size: 0.68rem; font-weight: 700; background: var(--color-warning-bg); color: var(--color-warning-text); border-radius: var(--radius-pill); padding: 1px 8px; }
.nav-count.hidden { display: none; }
.nav-settings { border-top: 1px solid var(--color-border); margin-top: var(--space-3); padding-top: var(--space-2); }
.check { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; font-size: 0.88rem; color: var(--color-text-secondary); margin-top: var(--space-2); cursor: pointer; }
.check input { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--color-primary); }

.sidebar-footer { border-top: 1px solid var(--color-border); padding-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.sidebar-footer select { height: 38px; font-size: 0.85rem; }
.userbox { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: 0.84rem; color: var(--color-text-secondary); min-width: 0; }
.userbox > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Content ---------- */
.content { flex: 1; min-width: 0; padding: var(--space-6) var(--space-8); max-width: 1200px; }
.content h2 { margin-top: 0; }
.page-sub { color: var(--color-text-secondary); margin: 0 0 var(--space-5); font-size: 0.92rem; }
.page-actions { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }
.card-sub { margin: -6px 0 var(--space-3); font-size: 0.85rem; }
.hint { margin: 4px 0 10px; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.kpi {
  background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
}
.kpi .l { font-size: 0.77rem; font-weight: 600; color: var(--color-text-muted); display: flex; align-items: center; gap: 9px; }
.kpi .l .kpi-ico { width: 28px; height: 28px; border-radius: 8px; background: var(--color-nav-active-bg); color: var(--color-primary); display: inline-grid; place-items: center; font-size: 13px; }
/* Ohne feste Größe füllt das Symbol die 28px-Box vollständig aus und stößt an den
   Rand. 15px entsprechen dem Verhältnis der übrigen Icon-Boxen (§7, z. B. Glocke). */
.kpi .l .kpi-ico svg { width: 15px; height: 15px; }
.kpi .v { font-size: 1.45rem; font-weight: 700; margin-top: var(--space-2); letter-spacing: -0.01em; }
.kpi.good .v { color: var(--color-success); }

/* ---------- Promo-Banner (Dashboard) ---------- */
/* Einstieg in den Arbeitsablauf, zwischen Kennzahlen und Umsatzentwicklung. Bekommt
   eigene Farbwerte, weil es diese Fläche sonst nirgends gibt — ein sehr flacher,
   neutraler Verlauf statt der einfarbigen Karte. Alles andere (Radien, Abstände,
   Grautöne, Schatten) kommt aus den Tokens, damit der Banner nicht wie eingekauft
   wirkt. Kein Markenrot: der Banner soll einladen, nicht schreien. */
.promo {
  --promo-bg: linear-gradient(135deg, #FCFCFC 0%, #F7F7F7 48%, #F2F2F2 100%);
  --promo-border: #E6E6E6;

  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 540px);
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-5);
  padding: var(--space-8) var(--space-8) var(--space-8) var(--space-10);
  background: var(--promo-bg);
  border: 1px solid var(--promo-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .promo {
  --promo-bg: linear-gradient(135deg, #1F1F1F 0%, #242424 48%, #2A2A2A 100%);
  --promo-border: #333333;
}

.promo-head {
  margin: 0 0 var(--space-3);
  font-size: 1.62rem; font-weight: 700; line-height: 1.22; letter-spacing: -0.02em;
  color: var(--color-text-primary);
}
.promo-head span { color: var(--color-primary); }
.promo-sub {
  margin: 0 0 var(--space-5); max-width: 48ch;
  font-size: 0.94rem; line-height: 1.55; color: var(--color-text-secondary);
}
.promo-aktion { margin-bottom: var(--space-4); }
/* Ohne feste Größe zieht sich der Pfeil auf die ganze Buttonfläche (§7). */
#promo-start svg { width: 17px; height: 17px; flex-shrink: 0; }
.promo-benefits {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5);
  margin: 0; padding: 0; list-style: none;
}
.promo-benefits li {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.82rem; font-weight: 500; color: var(--color-text-secondary);
}
.promo-benefits svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--color-success); }

/* Willkommenskarte nach dem Einrichtungs-Ablauf (Konzept §15, ADR-013). Sie trägt
   dieselben Tokens wie die Karten darunter — sie ist der erste Satz des
   Dashboards, keine Werbefläche, und deshalb ruhiger als der Promo-Banner. */
.dash-willkommen {
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.dash-willkommen h2 {
  margin: 0 0 var(--space-2); font-size: 1.15rem; font-weight: 650;
  letter-spacing: -0.01em; color: var(--color-text-primary);
}
.dash-willkommen .dw-gross {
  margin: 0 0 var(--space-3); font-size: 1.5rem; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.25; text-wrap: balance;
  color: var(--color-text-primary);
}
.dash-willkommen .hint { margin: 0 0 var(--space-5); }
.dw-aktion { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.dw-aktion button { min-height: 42px; }

/* Illustration: reines Dekor, trägt alt="". Liegt als PNG im Static-Mount — die CSP
   verbietet data:-URIs, ein <img> auf eigener Herkunft ist erlaubt. Feste Maße über
   width/height im Markup, damit beim Laden nichts springt. */
.promo-illo { display: flex; align-items: center; justify-content: center; }
.promo-illo img { display: block; width: 100%; max-width: 540px; height: auto; }
@media (max-width: 900px) {
  .promo { grid-template-columns: minmax(0, 1fr); gap: var(--space-5);
    padding: var(--space-6); }
  .promo-illo { order: 2; }
  .promo-illo img { max-width: 420px; }
}
@media (max-width: 480px) {
  .promo { padding: var(--space-5); }
  .promo-head { font-size: 1.35rem; }
  /* Der feste Zeilenumbruch der Headline passt auf schmalen Geräten nicht mehr. */
  .promo-head br { display: none; }
}

/* ---------- Layout Helpers ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
/* Rasterelemente haben min-width: auto und würden sich am breitesten Inhalt
   (Pipeline-Reihen, Aufgaben-Spalten) aufziehen — dadurch lief die Seite über. */
.two-col > .card { min-width: 0; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.row { display: flex; gap: var(--space-3); align-items: flex-end; }
.row.wrap { flex-wrap: wrap; }
.lines label { flex: 1; min-width: 200px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-white); }
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
th { font-size: 0.71rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); background: var(--color-surface); position: sticky; top: 0; z-index: 1; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--color-surface); }
tr:last-child td { border-bottom: none; }
td input { height: 36px; }
td b { font-weight: 650; }
/* Nachladen großer Listen (Konzept §49) */
.more-row td { text-align: center; background: var(--color-surface); }
.more-row:hover { background: var(--color-surface); }

/* ---------- Tasks ---------- */
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; display: flex; gap: 9px; align-items: baseline; }
.task-list li:last-child { border-bottom: none; }

/* Dashboard-Aufgaben: Datum und Badge in festen Spalten, damit alle Zeilen
   bündig untereinander stehen. Feste Breiten statt `auto`, weil jede <li> ihr
   eigenes Raster ist — `auto` würde pro Zeile anders ausfallen.
   `minmax(0, 1fr)` für den Titel: mit `auto` kann die Spalte nicht unter die
   längste Silbe schrumpfen und drückte die Zeile aus der Karte heraus. */
.task-list.task-cols li { display: grid; grid-template-columns: auto minmax(0, 1fr) 6rem 6.5rem; column-gap: 9px; }
.task-list.task-cols li > span { overflow-wrap: anywhere; }
.task-list.task-cols .task-due { text-align: right; }
.task-list.task-cols .pill { justify-self: stretch; justify-content: center; }
/* Auf schmalen Fenstern passen vier Spalten nicht mehr: Datum und Badge
   rutschen in eine zweite Zeile unter den Titel. */
@media (max-width: 560px) {
  .task-list.task-cols li { grid-template-columns: auto minmax(0, 1fr); row-gap: 4px; }
  .task-list.task-cols .task-due { text-align: left; }
  .task-list.task-cols .pill { justify-self: start; }
}

/* ---------- Empty State (Konzept §41/§62) ---------- */
.empty-cell { padding: 0; }
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  padding: var(--space-10) var(--space-6); text-align: center; color: var(--color-text-muted); }
.empty .e-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--color-nav-active-bg);
  display: grid; place-items: center; color: var(--color-primary); margin-bottom: var(--space-1); }
.empty .e-ico svg { width: 20px; height: 20px; }
.empty b { color: var(--color-text-secondary); font-size: 0.92rem; }
.empty p { margin: 0; font-size: 0.84rem; max-width: 400px; }

/* ---------- Toast (Konzept §48/§64) ---------- */
#toast {
  position: fixed; right: var(--space-6); bottom: var(--space-6); z-index: 80;
  background: var(--color-surface-elevated); border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-text-muted);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: var(--space-3) var(--space-4); font-size: 0.87rem;
  display: flex; gap: 9px; align-items: center;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  max-width: 400px;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast::before { content: ""; width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: inline-grid; place-items: center; font-size: 11px; color: #fff; font-weight: 700; }
#toast.ok { border-left: 3px solid var(--color-success); }
#toast.err { border-left: 3px solid var(--color-error); }
#toast.ok::before { content: "✓"; background: var(--color-success); }
#toast.err::before { content: "✕"; background: var(--color-error); }

/* ---------- Responsive (Konzept §44/§69: Bottom-Nav statt Icon-Wüste) ---------- */
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  /* Sidebar wird zum Off-Canvas-Menü, geöffnet über „Mehr" in der Bottom-Nav */
  .sidebar {
    position: fixed; z-index: 66; top: 0; left: 0; bottom: 0; height: 100vh; width: min(300px, 86vw);
    flex-direction: column; flex-wrap: nowrap; align-items: stretch;
    transform: translateX(-102%); transition: transform var(--transition);
    box-shadow: var(--shadow-lg); padding-bottom: var(--space-4);
  }
  .sidebar.open { transform: none; }
  .sidebar .nav-section { display: block; }
  #main-nav { flex-direction: column; flex-wrap: nowrap; }
  .nav-item { width: 100%; }
  .sidebar-footer { flex-direction: column; border-top: 1px solid var(--color-border); padding-top: var(--space-4); width: 100%; align-items: stretch; }
  .content { padding: var(--space-4); padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .app-foot { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .modal-actions { justify-content: stretch; }
  .modal-actions > * { flex: 1; }
}
.sidebar-backdrop { position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, 0.45); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- PDF-Vorschau & Teilen ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(3px); padding: var(--space-4); }
.modal { width: min(980px, 100%); max-height: 94vh; display: flex; flex-direction: column; gap: var(--space-3);
  background: var(--color-surface-elevated); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-4); box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.modal-head h3 { margin: 0; }
.pdf-frame-wrap { flex: 1; min-height: 52vh; border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface); }
.pdf-frame-wrap iframe { width: 100%; height: 100%; border: none; display: block; }
.modal-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.share-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.share-row input { flex: 1; min-width: 200px; font-size: 0.82rem; }
.btnlike { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 var(--space-3);
  font-size: 0.83rem; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  background: var(--color-surface-elevated); color: var(--color-text-primary); text-decoration: none; cursor: pointer; }
.btnlike:hover { background: var(--color-surface); }
@media (max-width: 768px) {
  .pdf-frame-wrap { min-height: 38vh; }
  .modal { max-height: 97vh; }
}

/* ============================================================
   UI-Konzept — Nachtrag: Topbar/Avatar (§46/§48), Command-
   Palette (§65), Drawer (§21/§53), Skeletons (§42/§63), Chart
   (§17/§22), Dropzone (§55), Filter-Chips (§20), Status-Icons
   (§45), Button-Loading (§39), Utilities (statt Inline-Styles,
   CSP: default-src 'self' blockiert style-Attribute)
   ============================================================ */

/* ---------- Topbar (Konzept §48) ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--space-4);
  margin: calc(-1 * var(--space-6)) calc(-1 * var(--space-8)) var(--space-5);
  padding: var(--space-3) var(--space-8); min-height: 64px;
  background: var(--color-background); border-bottom: 1px solid var(--color-border); }
.topbar-title { font-size: 1.25rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; flex: 1;
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }
/* Jahres-Schalter (Konzept §4/§31): sitzt bei den Aktionen, weil er das ganze
   Programm umstellt — nicht in einem einzelnen Tab. Bewusst die native
   Darstellung (kein `appearance: none`): der kleine Pfeil ist das einzige
   Zeichen, das „hier kann man wählen" sagt. `max-width` + Ellipse, damit ein
   langes Etikett wie „2025/2026" die Topbar auf 375 px nicht sprengt. */
.jahr-select { cursor: pointer; max-width: 9.5rem; text-overflow: ellipsis; }
.jahr-select:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.cmdk-trigger { height: 40px; border: 1px solid var(--color-border); background: var(--color-surface-elevated);
  color: var(--color-text-muted); border-radius: var(--radius-md); padding: 0 var(--space-3);
  gap: 8px; font-weight: 500; max-width: 240px; overflow: hidden; }
.cmdk-trigger svg { width: 16px; height: 16px; flex-shrink: 0; }
.cmdk-trigger:hover { background: var(--color-surface); color: var(--color-text-secondary); box-shadow: none; }
.cmdk-trigger kbd { font: inherit; font-size: 0.7rem; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: 6px; padding: 1px 6px; color: var(--color-text-secondary); }

.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: var(--radius-md);
  background: var(--color-surface-elevated); border: 1px solid var(--color-border);
  color: var(--color-text-secondary); flex-shrink: 0; font-size: 1rem; }
.icon-btn:hover { background: var(--color-surface); box-shadow: none; }
/* Ohne feste Größe zieht sich das SVG auf die ganze Buttonfläche (38x38 px) — die
   Symbole wirken dann überdimensioniert. 20px entsprechen der Sidebar (§7). */
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Avatar & Menü (Konzept §46) ---------- */
.avatar-wrap { position: relative; }
.avatar { width: 38px; height: 38px; padding: 0; border-radius: 12px; background: var(--color-primary);
  color: #fff; font-weight: 700; font-size: 0.88rem; }
.avatar-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 250px;
  background: var(--color-surface-elevated); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: var(--space-2); z-index: 40; }
.avatar-menu-head { padding: var(--space-2) var(--space-3) var(--space-3); display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--color-border); margin-bottom: var(--space-1); }
.avatar-menu-head b { font-size: 0.9rem; }
.menu-item { width: 100%; justify-content: flex-start; height: 38px; padding: 0 var(--space-3);
  background: transparent; border: none; box-shadow: none; color: var(--color-text-secondary);
  font-weight: 500; border-radius: var(--radius-sm); font-size: 0.88rem; }
.menu-item:hover { background: var(--color-surface); color: var(--color-text-primary); box-shadow: none; }
.menu-item.danger { color: var(--color-error-text); }
.menu-item.danger:hover { background: var(--color-error-bg); color: var(--color-error-text); }
.menu-sep { height: 1px; background: var(--color-border); margin: var(--space-1) var(--space-2); }

/* ---------- Dienste-Menü (Stand im Konto) ----------
   Sitzt in der Kopfzeile neben den Aktionen. Alle Farben kommen aus Tokens —
   in beiden Themes muss die Liste auf `--color-surface-elevated` lesbar sein. */
.dienstmenue { position: relative; display: inline-flex; }
.dienstmenue .pfeil { font-size: 0.72rem; opacity: 0.7; }
.dienstmenue-liste {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; max-width: 320px;
  display: flex; flex-direction: column; gap: 2px; padding: var(--space-2);
  background: var(--color-surface-elevated); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 40;
}
.dienstmenue-punkt {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  color: var(--color-text-primary); text-decoration: none; font-size: 0.88rem; font-weight: 500;
}
a.dienstmenue-punkt:hover { background: var(--color-surface); box-shadow: none; }
.dienstmenue-punkt .stand { color: var(--color-text-muted); font-size: 0.76rem; white-space: nowrap; }
.dienstmenue-verwalten { color: var(--color-primary); }
.dienstmenue-trenner { height: 1px; background: var(--color-border); margin: var(--space-1) var(--space-2); }
.dienstmenue-leer, .dienstmenue-hinweis { display: block; padding: var(--space-2) var(--space-3); line-height: 1.4; }
.dienstmenue-hinweis { color: var(--color-warning-text); }

/* ---------- Command Palette (Konzept §65) ---------- */
.cmdk-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh var(--space-4) var(--space-4); }
.cmdk { width: min(560px, 100%); background: var(--color-surface-elevated);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; }
.cmdk-input-wrap { display: flex; align-items: center; gap: 10px; padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border); }
.cmdk-input-wrap svg { width: 18px; height: 18px; color: var(--color-text-muted); flex-shrink: 0; }
.cmdk-input-wrap input { border: none; box-shadow: none; height: 36px; background: transparent; padding: 0; }
.cmdk-input-wrap input:focus { box-shadow: none; }
.cmdk-list { max-height: 320px; overflow-y: auto; padding: var(--space-2); }
.cmdk-item { width: 100%; display: flex; align-items: center; gap: 11px; height: 42px; padding: 0 var(--space-3);
  border: none; background: transparent; box-shadow: none; border-radius: var(--radius-sm);
  color: var(--color-text-primary); font-weight: 500; text-align: left; justify-content: flex-start; }
.cmdk-item svg { width: 18px; height: 18px; color: var(--color-text-muted); flex-shrink: 0; }
.cmdk-item[aria-selected="true"] { background: var(--color-nav-active-bg); color: var(--color-nav-active-text); }
.cmdk-item[aria-selected="true"] svg { color: var(--color-nav-active-text); }
.cmdk-empty { padding: var(--space-6); text-align: center; color: var(--color-text-muted); font-size: 0.88rem; }
.cmdk-foot { display: flex; gap: var(--space-4); padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--color-border); color: var(--color-text-muted); font-size: 0.72rem; }

/* ---------- Detail-Drawer (Konzept §21/§53) ---------- */
.drawer-overlay { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, 0.42); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 56; width: min(480px, 100vw);
  background: var(--color-surface-elevated); border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: drawer-in 200ms ease-out; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--color-border); }
.drawer-head h3 { margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--space-5); }
.drawer-actions { display: flex; gap: var(--space-2); padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border); }
.drawer-actions button { flex: 1; }
.dl { display: grid; grid-template-columns: 120px 1fr; gap: var(--space-3) var(--space-4); font-size: 0.88rem; margin: 0; }
.dl dt { color: var(--color-text-muted); }
.dl dd { margin: 0; color: var(--color-text-primary); overflow-wrap: break-word; }

/* ---------- Skeleton Loading (Konzept §42/§63) ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--color-surface); border-radius: 6px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(120, 120, 120, 0.22), transparent);
  animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton-line { height: 14px; width: 72%; }
.kpi.skeleton { height: 96px; box-shadow: none; }

/* ---------- Chart (Konzept §17/§22) ---------- */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.card-head h3 { margin: 0; }
.chart-wrap { width: 100%; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-wrap .grid { stroke: var(--color-border); stroke-width: 1; }
.chart-wrap .axis { stroke: var(--color-border-strong); stroke-width: 1; }
.chart-wrap .line-in { fill: none; stroke: var(--color-primary); stroke-width: 2.5; stroke-linecap: round; }
.chart-wrap .area-in { fill: rgba(241, 32, 74, 0.1); }
.chart-wrap .line-out { fill: none; stroke: var(--color-accent); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 5 4; }
.chart-wrap .d-in { fill: var(--color-primary); }
.chart-wrap .d-out { fill: var(--color-accent); }
.chart-wrap .lbl { fill: var(--color-text-muted); font-size: 10px; font-family: inherit; }
.chart-legend { display: flex; gap: var(--space-4); font-size: 0.8rem; color: var(--color-text-secondary); flex-wrap: wrap; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot-in { background: var(--color-primary); }
.dot-out { background: var(--color-accent); }
.chart-empty { padding: var(--space-8); text-align: center; color: var(--color-text-muted); font-size: 0.88rem; margin: 0; }

/* ---------- Dropzone (Konzept §55) ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  border: 2px dashed var(--color-border-strong); border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-4); cursor: pointer; color: var(--color-text-secondary);
  transition: border-color var(--transition), background var(--transition); margin-bottom: var(--space-3); }
.dropzone svg { width: 28px; height: 28px; color: var(--color-primary); }
.dropzone p { margin: 0; font-size: 0.9rem; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.drag { border-color: var(--color-primary); background: var(--color-nav-active-bg); }
.dropzone.drag { border-style: solid; }

/* ---------- Die Dashboard-Kachel als Ablage (Fund F-08) ----------
   `.promo` ist bereits eine Fläche mit Rand und Hintergrund; sie bekommt hier nur
   die Zustände einer Ablage dazu — dieselben wie `.dropzone`, damit eine gezogene
   Datei hier aussieht wie dort. Kein `tabindex`: die Tastatur hat den Knopf
   daneben, und ein Fokus auf der ganzen Kachel ohne Wirkung wäre eine Sackgasse. */
.promo.promo-drop {
  border-style: dashed; border-width: 2px; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.promo.promo-drop.drag { border-style: solid; border-color: var(--color-primary); background: var(--color-nav-active-bg); }
.promo.promo-drop.drag .promo-illo { opacity: 0.4; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Filter-Chips (Konzept §20/§50) ---------- */
.chip-row { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); flex-wrap: wrap; }
.chip { height: 32px; padding: 0 var(--space-4); border-radius: var(--radius-pill);
  background: var(--color-surface-elevated); border: 1px solid var(--color-border);
  color: var(--color-text-secondary); font-size: 0.82rem; font-weight: 600; }
.chip:hover { background: var(--color-surface); box-shadow: none; }
.chip.active { background: var(--color-nav-active-bg); color: var(--color-nav-active-text); border-color: transparent; }

/* ---------- Steuerjahre verwalten (Konzept §4/§31) ---------- */
.sub-block { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.sub-block h4 { margin: 0 0 var(--space-2); font-size: 0.95rem; color: var(--color-text-primary); }
.fy-list { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-3) 0; }
.fy-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); background: var(--color-surface-elevated); }
.fy-row .fy-name { font-weight: 600; min-width: 5.5rem; }
.fy-row .fy-range { color: var(--color-text-secondary); font-size: 0.85rem; }
.fy-row .fy-actions { margin-left: auto; }

/* ---------- Status in Pills: nur noch Text ----------
   Früher stand ein Zeichen vor jedem Badge (✓ ✕ ! i). Das machte die Badges
   unterschiedlich breit und ließ sie unruhig untereinander stehen. Der Text
   sagt die Bedeutung ohnehin schon („Offen", „Bezahlt", „Dringend"), die Farbe
   bleibt als zweiter Hinweis. */

/* ---------- Danger-Button (wird in JS genutzt, war undefiniert) ---------- */
button.danger { background: var(--color-error-bg); color: var(--color-error-text); border-color: transparent; }
button.danger:hover { background: var(--color-error); color: #fff; }

/* ---------- Button-Loading (Konzept §39) ---------- */
button.loading { pointer-events: none; opacity: 0.75; }
button.loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid currentColor; border-top-color: transparent; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Firmendaten: Anzeige (Konzept §37) ---------- */
.fv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 var(--space-5); margin-top: var(--space-2); }
.fv-item { display: flex; flex-direction: column; gap: 3px; padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border); min-width: 0; }
.fv-l { font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--color-text-muted); }
.fv-v { font-size: 0.94rem; color: var(--color-text-primary); overflow-wrap: anywhere; }
.fv-leer { color: var(--color-text-muted); }
/* Ohne feste Größe zieht sich das Symbol auf die ganze Buttonfläche (§7). */
#firma-edit svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Klickbare Tabellenzeilen ---------- */
tr.clickable { cursor: pointer; }

/* ---------- Utilities (ersetzen blockierte Inline-Styles) ---------- */
.brand-logo { width: 28px; height: 28px; font-size: 13px; border-radius: 8px; }
.w-xs { width: 64px; } .w-narrow { width: 84px; } .w-zip { width: 92px; } .w-mid { width: 132px; }
.w-mid2 { width: 150px; } .w-num { width: 120px; } .w-search { min-width: 240px; }
.inline-input { flex: 1; min-width: 180px; height: 40px; }
.inline-w { width: 140px; height: 40px; flex-shrink: 0; }
.inline-sel { width: 150px; height: 40px; flex-shrink: 0; }
.xml-pre { max-height: 260px; overflow: auto; font-size: 12px; background: var(--color-surface); border-radius: var(--radius-sm); }

@media (max-width: 860px) {
  .topbar { margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) var(--space-4);
    padding: var(--space-2) var(--space-4); min-height: 56px; gap: var(--space-2); }
  .topbar-title { font-size: 1.05rem; }
  .cmdk-trigger { max-width: 44px; padding: 0; justify-content: center; }
  .cmdk-trigger .txt, .cmdk-trigger kbd { display: none; }
  .dl { grid-template-columns: 96px 1fr; }
}

/* ============================================================
   UI-Konzept — Teil 2: Belege/OCR (§22-§24), Vorschläge (§19/
   §32), TikTok (§25-§30), Benachrichtigungen (§40), Einstel-
   lungen-Subnav (§37), Onboarding (§12), Mobile (§44/§45),
   Tabellen-UX (§49/§50), Rechts-Fußzeile (§55)
   ============================================================ */

/* ---------- Geplant-Kennzeichnung (ehrlich, kein Fake-UI) ---------- */
.badge.muted { background: var(--color-surface); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.pill.planned { background: var(--color-surface); color: var(--color-text-muted); border-style: dashed; }
.card.placeholder h3 { display: flex; align-items: center; gap: var(--space-2); }

/* ---------- Sub-Tabs (Einstellungen, Verträge, TikTok) ----------
   Pill-Reiter in der Form des „+ Neu"-Knopfes: der aktive Reiter ist eine
   gefüllte Markenfläche mit weißer Schrift, die übrigen sitzen neutral mit
   Rand daneben. Vorher war das eine Unterstreichung — die trug den runden
   Knopf nicht mit, der Rest der Oberfläche ist seit dem Umbau pillenförmig. */
.subtabs { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-5); }
.subtab { height: 38px; padding: 0 var(--space-4); box-shadow: none;
  color: var(--color-text-secondary); font-weight: 500; font-size: 0.88rem;
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated); border: 1px solid var(--color-border); }
.subtab:hover { background: var(--color-surface); color: var(--color-text-primary); border-color: var(--color-border-strong); box-shadow: none; }
.subtab.active { background: var(--color-primary); color: #fff; font-weight: 600;
  border-color: transparent; box-shadow: var(--shadow-sm); }
.subtab.active:hover { background: var(--color-primary-hover); color: #fff; }
@media (max-width: 860px) {
  .subtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtab { flex-shrink: 0; }
}

/* ---------- Upload-Pipeline (Konzept §23) ---------- */
.pipeline { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  margin: var(--space-3) 0; padding: var(--space-3); background: var(--color-surface);
  border-radius: var(--radius-md); font-size: 0.84rem; }
.pipeline .p-step { display: flex; align-items: center; gap: 7px; color: var(--color-text-muted); }
.pipeline .p-step.done { color: var(--color-success-text); }
.pipeline .p-step.active { color: var(--color-primary); font-weight: 600; }
.pipeline .p-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center;
  border: 1.5px solid currentColor; font-size: 11px; flex-shrink: 0; }
.pipeline .p-step.done .p-dot { background: var(--color-success-bg); border-color: transparent; }
.pipeline .p-arrow { color: var(--color-border-strong); }

/* ---------- Confidence-Anzeige (Konzept §24) ---------- */
.conf { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--color-text-secondary); }
.conf-bar { flex: 1; min-width: 60px; height: 6px; border-radius: var(--radius-pill); background: var(--color-surface); overflow: hidden; }
.conf-fill { height: 100%; border-radius: var(--radius-pill); background: var(--color-success); }
.conf-fill.mid { background: var(--color-warning); }
.conf-fill.low { background: var(--color-error); }
.field-row { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
.field-row:last-child { border-bottom: none; }
.field-label { font-size: 0.82rem; color: var(--color-text-muted); }
.field-val { font-size: 0.9rem; overflow-wrap: break-word; }
.field-edit { display: flex; gap: var(--space-2); align-items: center; margin-top: 4px; }
.field-edit input { height: 34px; font-size: 0.85rem; }

/* ---------- Tabellen-UX (Konzept §49/§50) ---------- */
.table-search { height: 36px; max-width: 260px; font-size: 0.84rem; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--color-text-secondary); }
th.sortable::after { content: "↕"; margin-left: 6px; opacity: 0.35; font-size: 0.85em; }
th.sortable[data-dir="asc"]::after { content: "↑"; opacity: 1; color: var(--color-primary); }
th.sortable[data-dir="desc"]::after { content: "↓"; opacity: 1; color: var(--color-primary); }
th.col-check { width: 44px; }
td.col-check { width: 44px; }
td input[type="checkbox"], th input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--color-primary); }
.bulk-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  background: var(--color-nav-active-bg); border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4); margin-bottom: var(--space-3); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .cell-actions { display: flex; gap: var(--space-1); flex-wrap: nowrap; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- Aufgabenliste ---------- */
/* Ein Datum, das überschritten ist, muss auffallen, ohne zu schreien — die Aufgabe
   selbst ist noch da, nur ihre Frist nicht mehr. */
.warn-text { color: var(--color-warning-text); font-weight: 600; }
.auf-kommentare { list-style: none; margin: 0 0 var(--space-4); padding: 0;
  display: flex; flex-direction: column; gap: var(--space-3); }
.auf-kommentar { border-left: 2px solid var(--color-border); padding-left: var(--space-3); }
.auf-kommentar > div:last-child { white-space: pre-wrap; overflow-wrap: break-word; }

/* ---------- Benachrichtigungen (Konzept §40) ---------- */
.bell-wrap { position: relative; }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-pill); background: var(--color-error); color: #fff;
  font-size: 0.62rem; font-weight: 700; display: grid; place-items: center; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 32px));
  max-height: 70vh; overflow-y: auto; background: var(--color-surface-elevated);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); z-index: 45; }
.notif-head { display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border); position: sticky; top: 0;
  background: var(--color-surface-elevated); }
.notif-list { padding: var(--space-2); }
.notif-group { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--color-text-muted); padding: var(--space-3) var(--space-3) var(--space-1); }
.notif-item { display: flex; gap: var(--space-3); align-items: flex-start; width: 100%; text-align: left;
  /* Die globale button-Regel zentriert (justify-content: center). Die Zeilen sind
     <button>, also muss die Ausrichtung hier ausdrücklich zurückgesetzt werden —
     sonst schwebt der Inhalt je nach Textlänge unterschiedlich weit eingerückt. */
  justify-content: flex-start;
  padding: var(--space-3); border-radius: var(--radius-sm); background: transparent; border: none;
  box-shadow: none; height: auto; color: var(--color-text-primary); font-weight: 500; }
.notif-item:hover { background: var(--color-surface); box-shadow: none; }
.notif-item .n-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--color-nav-active-bg);
  color: var(--color-primary); display: grid; place-items: center; flex-shrink: 0; }
.notif-item .n-ico svg { width: 16px; height: 16px; }
.notif-item .n-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-item .n-txt b { font-size: 0.87rem; font-weight: 600; }
.notif-item .n-txt span { font-size: 0.78rem; color: var(--color-text-muted); }
.notif-row { display: flex; align-items: stretch; gap: 2px; }
.notif-row .notif-item { flex: 1; min-width: 0; }
.notif-done { width: 34px; flex-shrink: 0; border: none; background: transparent; box-shadow: none;
  color: var(--color-text-muted); border-radius: var(--radius-sm); display: grid; place-items: center; }
.notif-done:hover { background: var(--color-surface); color: var(--color-success); box-shadow: none; }
.notif-done svg { width: 16px; height: 16px; }

/* ---------- Dashboard: Handlungsbedarf und Meldungen ----------
   Die Kachelreihe bündelt, was offen ist; die Meldungszeilen darunter nennen
   den Einzelfall. Beide kommen aus derselben Liste. Die Schwere trägt Farbe,
   aber nie allein: jede Kachel und jede Zeile sagt ihren Zustand im Klartext
   (d-label / d-hint, n-sev), damit sie auch ohne Farbwahrnehmung lesbar ist. */
.sec-h { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--color-text-muted); margin: var(--space-6) 0 var(--space-3); }
.sec-h:first-of-type { margin-top: var(--space-4); }

.demand-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-3); margin-bottom: var(--space-5); }
.demand { display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  text-align: left; height: auto; padding: var(--space-4); background: var(--color-white);
  border: 1px solid var(--color-border); border-left-width: 3px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); color: var(--color-text-primary); }
.demand:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-md); }
.demand .d-count { font-size: 1.5rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.demand .d-label { font-size: 0.85rem; font-weight: 600; }
.demand .d-hint { font-size: 0.75rem; color: var(--color-text-muted); }
/* Die linke Kante trägt die Schwere — die Fläche bleibt ruhig. */
.demand.sev-critical { border-left-color: var(--color-error); }
.demand.sev-due { border-left-color: var(--color-warning); }
.demand.sev-info { border-left-color: var(--color-border-strong); }
.demand.sev-critical .d-count { color: var(--color-error); }

.notif-item .n-sev { margin-left: auto; flex-shrink: 0; font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); align-self: center; }
/* Vorher war jede Meldung orange — damit war die Farbe bedeutungslos. */
.notif-item.sev-critical .n-ico { background: var(--color-error-bg); color: var(--color-error-text); }
.notif-item.sev-critical .n-sev { color: var(--color-error-text); }
.notif-item.sev-due .n-ico { background: var(--color-warning-bg); color: var(--color-warning-text); }
.notif-item.sev-due .n-sev { color: var(--color-warning-text); }
.notif-item.sev-info .n-ico { background: var(--color-info-bg); color: var(--color-info-text); }
.notif-item .n-txt b { display: flex; align-items: center; gap: 6px; }
/* Anzahl bei Sammelmeldungen. Bewusst neutral: die Zahlenplakette sagt „so
   viele“, nicht „dringend“ — die Schwere trägt die linke Kante. */
.n-count { display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill);
  background: var(--color-surface); border: 1px solid var(--color-border);
  color: var(--color-text-secondary); font-size: 0.72rem; font-weight: 700; line-height: 1; }
.more-btn { margin-top: var(--space-2); }

.task-group + .task-group { margin-top: var(--space-4); }
.task-group-h { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--color-text-muted); margin: 0 0 var(--space-2); display: flex; gap: 6px; align-items: baseline; }

/* Stichtag und Bezugsgröße der Kennzahl (§ „jede Zahl nennt ihre Quelle“). */
.kpi .k-meta { font-size: 0.72rem; color: var(--color-text-muted); margin-top: var(--space-1); }

/* Erklärter Hinweis statt roher 403 (Konzept §38) */
.tabpane.pane-denied > *:not(.pane-notice) { display: none; }
.pane-notice .card { margin: 0; }

/* ---------- Onboarding-Assistent (Konzept §12) ---------- */
.onb-modal { width: min(600px, 100%); }
.onb-body { min-height: 260px; display: flex; flex-direction: column; gap: var(--space-4); }
.onb-step-title { font-size: 1.05rem; font-weight: 650; }
.onb-hint { font-size: 0.85rem; color: var(--color-text-secondary); margin: -8px 0 0; }
.onb-progress { display: flex; gap: 6px; }
.onb-progress i { height: 4px; flex: 1; border-radius: var(--radius-pill); background: var(--color-border); }
.onb-progress i.on { background: var(--color-primary); }
.onb-review { display: grid; grid-template-columns: 150px 1fr; gap: var(--space-2) var(--space-4); font-size: 0.88rem; }
.onb-review dt { color: var(--color-text-muted); }
.onb-review dd { margin: 0; }

/* Der Einrichtungs-Ablauf (`opts.fullscreen`).
   Kein Formular, das über der Seite schwebt, sondern ein eigener Ort: opaker
   Grund statt durchscheinender Seite, randlose Karte, eine Entscheidung pro
   Bildschirm. Der Rest der Klasse ist derselbe — es gibt **einen** Assistenten. */
.modal-overlay.onb-flow {
  background: var(--color-background);
  align-items: flex-start;
  padding: var(--space-6) var(--space-4);
  overflow-y: auto;
}
.onb-flow .onb-modal {
  width: min(760px, 100%);
  max-height: none;
  border-radius: var(--radius-lg);
  box-shadow: none;
  padding: var(--space-6) var(--space-8);
  animation: onb-rein var(--transition);
}
@keyframes onb-rein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .onb-flow .onb-modal { animation: none; } }
.onb-flow .modal-head { border-bottom: none; padding-bottom: 0; align-items: baseline; }
.onb-flow .modal-head h3 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; }
.onb-flow #onb-skip { margin-left: auto; }
.onb-flow .onb-body { min-height: 380px; justify-content: center; gap: var(--space-5); }
.onb-flow .onb-step-title { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
.onb-flow .onb-hint { font-size: 0.95rem; margin: -12px 0 0; max-width: 60ch; }
.onb-flow .modal-actions { border-top: none; padding-top: var(--space-4); }
.onb-flow .modal-actions button { min-height: 44px; padding-inline: var(--space-6); font-size: 0.95rem; }

/* Auswahlkarten: eine Entscheidung, große Fläche, ganzes Feld klickbar */
.onb-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--space-3); }
.onb-karte {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; text-align: left;
  padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); color: var(--color-text-primary); cursor: pointer;
  font-size: 0.95rem; font-family: inherit; transition: border-color var(--transition), background var(--transition);
}
.onb-karte:hover { border-color: var(--color-border-strong); background: var(--color-surface-elevated); }
.onb-karte[aria-pressed="true"] { border-color: var(--color-primary); background: var(--color-nav-active-bg); }
.onb-karte:disabled { cursor: not-allowed; opacity: 0.55; }
.onb-karte:disabled:hover { border-color: var(--color-border); background: var(--color-surface); }
.onb-karte .onb-karte-ico { display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: var(--radius-sm); background: var(--color-background); color: var(--color-primary); }
.onb-karte .onb-karte-ico svg { width: 18px; height: 18px; }
.onb-karte .onb-karte-text { display: flex; flex-direction: column; gap: 2px; }
.onb-karte .onb-karte-sub { font-size: 0.78rem; color: var(--color-text-muted); }

/* Der Begrüßungssatz im ersten Schritt — größer als eine Schritt-Überschrift,
   weil er nichts fragt, sondern anfängt. */
.onb-gross { font-size: 1.35rem; font-weight: 650; line-height: 1.35; margin: 0; text-wrap: balance; }

/* Beleg-Upload im Ablauf */
.onb-tropfen { border: 2px dashed var(--color-border-strong); border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-4); text-align: center; cursor: pointer; }
.onb-tropfen.hover { border-color: var(--color-primary); background: var(--color-nav-active-bg); }
.onb-tropfen .onb-zahlen { font-size: 1.05rem; font-weight: 650; margin-top: var(--space-3); }
.onb-ergebnis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-3); }
.onb-ergebnis .kpi { text-align: center; }
/* Fortschritt der Beleg-Analyse: Balken und Meldung gehören zusammen, die Meldung
   nennt den gemessenen Zähler, der Balken zeigt ihn. */
.onb-bal-msg { font-size: 0.85rem; color: var(--color-text-secondary); margin: 0 0 var(--space-2); }
.onb-balken { height: 6px; border-radius: var(--radius-pill); background: var(--color-border); overflow: hidden; }
.onb-balken i { display: block; height: 100%; border-radius: var(--radius-pill);
  background: var(--color-primary); transition: width 240ms ease; }
@media (prefers-reduced-motion: reduce) { .onb-balken i { transition: none; } }

/* ---------- Rechts-Modal & Fußzeile (Konzept §55) ---------- */
.legal-modal { width: min(720px, 100%); }
.legal-body { overflow-y: auto; font-size: 0.88rem; line-height: 1.6; color: var(--color-text-secondary); }
.legal-body h4 { margin: var(--space-4) 0 var(--space-2); font-size: 0.92rem; color: var(--color-text-primary); }
.legal-body p { margin: 0 0 var(--space-3); }
.legal-body ul { margin: 0 0 var(--space-3); padding-left: var(--space-5); }
.legal-body .todo { background: var(--color-warning-bg); color: var(--color-warning-text);
  border-radius: var(--radius-sm); padding: var(--space-3); font-size: 0.85rem; }
.login-foot.legal { margin-top: var(--space-3); }
.app-foot { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap;
  margin-top: var(--space-8); padding-top: var(--space-4); border-top: 1px solid var(--color-border);
  font-size: 0.78rem; color: var(--color-text-muted); }
.app-foot .foot-links { display: flex; gap: var(--space-3); margin-left: auto; }
.app-foot .foot-links a { font-weight: 600; }

/* ---------- Mobile Bottom-Nav + Quick Action (Konzept §44/§45/§69/§70) ---------- */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; align-items: stretch; justify-content: space-around;
  background: var(--color-surface-elevated); border-top: 1px solid var(--color-border);
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.06);
  padding-bottom: env(safe-area-inset-bottom); }
.bn-item { flex: 1; height: 60px; min-height: 44px; flex-direction: column; gap: 3px;
  background: transparent; border: none; box-shadow: none; border-radius: 0;
  color: var(--color-text-muted); font-size: 0.66rem; font-weight: 600; padding: 0; }
.bn-item svg { width: 21px; height: 21px; }
.bn-item:hover { background: transparent; box-shadow: none; color: var(--color-text-secondary); }
.bn-item.active { color: var(--color-nav-active-text); background: transparent; }
.fab { position: fixed; right: var(--space-4); z-index: 51;
  bottom: calc(72px + env(safe-area-inset-bottom));
  width: 54px; height: 54px; padding: 0; border-radius: 50%;
  background: var(--color-primary); color: #fff; box-shadow: var(--shadow-lg); }
.fab svg { width: 22px; height: 22px; }
.fab:hover { filter: brightness(0.95); }
@media (min-width: 861px) { .bottom-nav, .fab { display: none !important; } }

/* ---------- Detlef — KI-Steuer-Assistent (Dock unten rechts) ---------- */
/* Runder KI-Knopf mit Badge — dort, wo Besucher einen Assistenten erwarten: in
   der Ecke unten rechts, außerhalb der Sidebar. row-reverse dreht nur die
   Reihenfolge: der Kreis hält die Ecke, das Badge weist nach innen. */
.detlef-dock { position: fixed; z-index: 52;
  right: var(--space-4); bottom: var(--space-6);
  /* Abstand ≥ Ringausschlag, sonst läuft der äußere Ring unter das Badge. */
  display: flex; flex-direction: row-reverse; align-items: center; gap: var(--space-3); }
.detlef-fab {
  position: relative; width: 52px; height: 52px; padding: 0; flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.85); border-radius: 50%;
  background: var(--color-primary); color: #fff; box-shadow: var(--shadow-lg); }
.detlef-fab:hover { filter: brightness(0.95); }
/* Ohne feste Maße zieht sich das SVG auf die ganze Knopffläche. Der Ring-Span
   liegt absolut und trägt nichts — das Symbol bleibt das einzige Flusskind und
   wird dadurch mittig gesetzt. */
.df-ico { width: 26px; height: 26px; }
/* Reine Zierde, trägt keine Information. Zwei um eine halbe Periode versetzte
   Ringe: ein einzelner war die meiste Zeit unsichtbar. */
.df-ring { position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--color-primary); opacity: 0; pointer-events: none;
  animation: df-pulse 5.4s ease-out infinite; }
.df-ring-2 { animation-delay: 2.7s; }
@keyframes df-pulse {
  0%   { transform: scale(0.88); opacity: 0; }
  15%  { opacity: 0.85; }
  65%  { opacity: 0.45; }
  100% { transform: scale(1.22); opacity: 0; }
}
/* Ohne Animation steht der Ring still — dann muss er von sich aus sichtbar sein. */
@media (prefers-reduced-motion: reduce) {
  .df-ring { opacity: 0.6; }
  .df-ring-2 { display: none; }
}

.detlef-badge {
  height: auto; padding: 9px var(--space-4); text-align: left; line-height: 1.25;
  border: 1px solid #F6C6D0; border-radius: var(--radius-pill);
  background: var(--color-white); color: var(--color-text-primary); box-shadow: var(--shadow-md); }
[data-theme="dark"] .detlef-badge { border-color: #5C2530; }
.detlef-badge:hover { border-color: var(--color-primary); color: var(--color-primary); }
.db-txt { display: flex; flex-direction: column; }
.db-txt b { font-size: 0.88rem; font-weight: 700; }
.db-txt span { font-size: 0.72rem; font-weight: 500; color: var(--color-text-muted); }
.detlef-badge:hover .db-txt span { color: inherit; }

.detlef-panel { position: fixed; z-index: 53;
  right: var(--space-4);
  bottom: calc(var(--space-6) + 52px + var(--space-3));
  width: min(430px, calc(100vw - 2 * var(--space-4)));
  max-height: min(640px, calc(100vh - 190px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--color-white); border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  animation: dp-in 180ms ease-out; }
@keyframes dp-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dp-head { display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border); background: var(--color-surface); }
.dp-avatar { width: 36px; height: 36px; flex-shrink: 0; display: inline-flex;
  align-items: center; justify-content: center; border-radius: 50%;
  background: var(--color-primary); color: #fff; }
.dp-avatar svg { width: 19px; height: 19px; }
.dp-id { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dp-id b { font-size: 0.92rem; }
.dp-id span { font-size: 0.75rem; color: var(--color-text-muted); }

/* Das Panel hat genau eine Scroll-Fläche: den Chat oder die Werkzeuge. Deshalb
   scrollt `.dp-body` selbst nicht mehr, sondern verteilt die Höhe. */
.dp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.dp-body:not(.manuell) #dp-manual { display: none; }
.dp-body.manuell #dp-chat { display: none; }
#dp-manual { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-4); }
.dp-manual-toggle { padding: var(--space-2) var(--space-4); border-top: 1px solid var(--color-border); }
.dp-manual-toggle button { width: 100%; }
/* Der Verweigerungshinweis steht außerhalb beider Ansichten, also braucht er
   sein Polster selbst — `.dp-body` hat keins mehr. */
#dp-denied { margin: 0; padding: var(--space-3) var(--space-4); }

/* ---------- Der Chat ---------- */
.dp-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dp-chatbar { display: flex; align-items: center; gap: 6px;
  padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border);
  background: var(--color-surface); }
.dp-conv { flex: 1; min-width: 0; font-size: 0.82rem; }

/* Die Nachrichtenliste ist die einzige Stelle, die scrollt — die Eingabezeile
   bleibt stehen, sonst müsste man zum Tippen erst zurückscrollen. */
.dp-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-3); }
.dp-leer { margin: 0; font-size: 0.82rem; line-height: 1.55; color: var(--color-text-muted); }

.dp-msg { display: flex; flex-direction: column; gap: 5px; max-width: 92%; }
.dp-msg-user { align-self: flex-end; align-items: flex-end; }
.dp-msg-bot { align-self: flex-start; }
.dp-bubble { padding: 9px var(--space-3); border-radius: var(--radius-lg);
  font-size: 0.84rem; line-height: 1.55; overflow-wrap: anywhere; }
.dp-msg-user .dp-bubble { background: var(--color-primary); color: #fff;
  border-bottom-right-radius: 5px; }
.dp-msg-bot .dp-bubble { background: var(--color-surface); color: var(--color-text-primary);
  border: 1px solid var(--color-border); border-bottom-left-radius: 5px; }
.dp-msg-bad .dp-bubble { border-color: var(--color-error); color: var(--color-error-text);
  background: var(--color-error-bg); }
.dp-bubble > :first-child { margin-top: 0; }
.dp-bubble > :last-child { margin-bottom: 0; }
.dp-bubble p { margin: 0 0 6px; }
.dp-bubble .dp-h { font-weight: 700; }
.dp-list { margin: 0 0 6px; padding-left: 18px; }
.dp-list li { margin: 2px 0; }

/* Tabellen in einer Sprechblase: die einzige Stelle, die waagerecht scrollen
   darf — die Seite selbst tut es nie. */
.dp-tab-wrap { overflow-x: auto; margin: 0 0 6px; }
.dp-tab { border-collapse: collapse; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.dp-tab th, .dp-tab td { padding: 3px 9px; border-bottom: 1px solid var(--color-border);
  text-align: left; white-space: nowrap; }
.dp-tab th { color: var(--color-text-muted); font-weight: 600; }

/* Der wandernde Balken: solange das Modell schreibt, soll sichtbar sein, dass
   noch etwas kommt. Reine Zierde — die Antwort steht auch ohne ihn da. */
.dp-tippt .dp-bubble { min-height: 34px; }
.dp-caret { display: inline-block; width: 6px; height: 13px; margin-left: 2px;
  vertical-align: text-bottom; background: var(--color-primary);
  animation: dp-blink 1s steps(2, start) infinite; }
@keyframes dp-blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .dp-caret { animation: none; } }

/* Werkzeug-Chips: was Detlef nachgeschaut hat, im Verlauf sichtbar. Sie tragen
   Information — welches Werkzeug, wie viel es fand — und sind kein Schmuck. */
.dp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.dp-chips:empty { display: none; }
.dp-chip { font-size: 0.68rem; padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--color-surface); color: var(--color-text-muted);
  border: 1px solid var(--color-border); }
.dp-chip.laeuft { border-style: dashed; border-color: var(--color-primary);
  color: var(--color-primary); }
.dp-chip.bad { background: var(--color-error-bg); color: var(--color-error-text);
  border-color: transparent; }
.dp-chip.wartet { border-style: dashed; border-color: var(--color-warning);
  background: var(--color-warning-bg); color: var(--color-warning-text); }

/* Offene Vorschläge: was Detlef ändern will, wartet hier auf einen Klick.
   Bewusst über dem Verlauf und mit eigener Fläche — das ist keine Nachricht,
   das ist etwas zu tun. */
.dp-proposals { display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3) var(--space-4) 0; }
.dp-proposals.hidden { display: none; }
.dp-vorschlag { border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-surface); padding: var(--space-3); }
/* Nur der Rahmen wird rot, nicht die Fläche: die Karte trägt Fließtext und
   Werte, und die müssen in beiden Themes auf ruhigem Grund lesbar bleiben.
   Das Signal sitzt im Rahmen und im roten Knopf. */
.dp-vorschlag.kritisch { border-color: var(--color-error-text); }
.dp-vorschlag-kopf { display: flex; align-items: center; gap: var(--space-2);
  font-size: 0.82rem; font-weight: 600; margin-bottom: var(--space-2); }
.dp-vorschlag-kopf .pill { margin-left: auto; }
.dp-vorschlag p { margin: 0 0 var(--space-2); font-size: 0.78rem;
  line-height: 1.45; color: var(--color-text-secondary); }
.dp-vorschlag dl { margin: 0 0 var(--space-2); font-size: 0.78rem; }
.dp-vorschlag dt { color: var(--color-text-muted); }
.dp-vorschlag pre { margin: 0; max-height: 160px; overflow: auto; }
.dp-vorschlag .row { margin-top: var(--space-2); }

.dp-composer { display: flex; align-items: flex-end; gap: var(--space-2);
  padding: var(--space-3) var(--space-4); border-top: 1px solid var(--color-border); }
.dp-composer textarea { flex: 1; min-height: 42px; max-height: 120px; resize: none;
  font-size: 0.84rem; line-height: 1.45; }
.dp-composer button { flex-shrink: 0; }
#dp-chat-msg { margin: 0; padding: 0 var(--space-4) var(--space-3); }
#dp-chat-msg:empty { display: none; }

.dp-note { margin: 0 0 var(--space-4); font-size: 0.8rem; line-height: 1.5;
  color: var(--color-text-secondary); }
.dp-note .pill { margin-right: 6px; }
.dp-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-4); }
.dp-sec { margin-bottom: var(--space-4); padding-top: var(--space-4);
  border-top: 1px solid var(--color-border); }
.dp-sec h4 { margin: 0 0 var(--space-2); font-size: 0.86rem; }
.dp-fields { margin-top: var(--space-3); }
.dp-fields label { min-width: 130px; }
.dp-sec label.wide { flex: 1; min-width: 100%; }

/* Kompakter als die große Dropzone im Belege-Tab — das Panel ist schmal. */
.dp-drop { display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 76px; padding: var(--space-4) var(--space-3); cursor: pointer;
  border: 2px dashed var(--color-border-strong); border-radius: var(--radius-md);
  font-size: 0.82rem; color: var(--color-text-secondary);
  transition: border-color var(--transition), background var(--transition); }
.dp-drop:hover, .dp-drop:focus-visible, .dp-drop.drag {
  border-color: var(--color-primary); background: var(--color-nav-active-bg); }

/* Werkzeugergebnis: Feldliste statt Roh-JSON, die Rohdaten darunter aufklappbar. */
.dp-erg .dp-feld { grid-template-columns: 1fr auto; }
.dp-roh { margin-top: var(--space-3); }
.dp-roh summary { cursor: pointer; font-size: 0.74rem; color: var(--color-text-muted); }
.dp-roh[open] summary { margin-bottom: var(--space-2); }

.dp-res-title { margin: var(--space-4) 0 var(--space-2); font-size: 0.82rem; }
.dp-out { margin: 0; }
.dp-feld { display: grid; grid-template-columns: 1fr auto 42px; gap: var(--space-2);
  align-items: baseline; padding: 7px 0; font-size: 0.82rem;
  border-bottom: 1px solid var(--color-border); }
.dp-feld:last-child { border-bottom: none; }
.dpf-l { color: var(--color-text-muted); }
.dpf-v { font-weight: 600; text-align: right; word-break: break-word; }
.dpf-c { font-size: 0.72rem; text-align: right; color: var(--color-text-muted); }
/* Unter 60 % ist der Wert unsicher — die Zahl färbt sich, nicht der ganze Wert. */
.dp-feld.unsicher .dpf-c { color: var(--color-warning-text); font-weight: 600; }

/* Rechts unten sitzt auf schmalen Fenstern schon der Schnell-Upload. Detlef
   stellt sich darüber in dieselbe Spalte, statt den Knopf zu überdecken — die
   Kante ist beiden gemeinsam, deshalb steht die Höhe nur einmal hier. */
@media (max-width: 860px) {
  body { --dp-dock-b: calc(72px + 54px + var(--space-4) + env(safe-area-inset-bottom)); }
  .detlef-dock { bottom: var(--dp-dock-b); }
  .detlef-panel { left: var(--space-4); right: var(--space-4); width: auto;
    bottom: calc(var(--dp-dock-b) + 52px + var(--space-3));
    max-height: calc(100vh - 240px); }
}
@media (max-width: 560px) {
  /* Der Badge-Text würde neben dem Knopf zu breit — die Kurzform genügt. */
  .db-txt span { display: none; }
}

/* ---------- TikTok-Bereich (Konzept §25-§30) ---------- */
.tt-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-3); }
.tt-account { border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4); background: var(--color-surface); }
.tt-account .t-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.tt-account b { font-size: 0.92rem; }
.tt-account .t-handle { font-size: 0.8rem; color: var(--color-text-muted); }

/* ---------- KI-/Regel-Vorschlagskarten (Konzept §32) ---------- */
/* min(320px, 100%): eine feste Mindestspur von 320px passt nicht in ein
   schmales Fenster und schob die ganze Seite waagerecht auf. */
.sug-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: var(--space-4); }
.sug-card { background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow-sm); }
.sug-card .s-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.sug-card .s-amount { font-size: 1.15rem; font-weight: 700; }
.sug-card .s-row { display: flex; align-items: center; gap: var(--space-3); font-size: 0.85rem; margin-top: var(--space-2); }
.sug-card .s-why { font-size: 0.83rem; color: var(--color-text-secondary); background: var(--color-surface);
  border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); margin-top: var(--space-3); }
.sug-card .s-actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.sug-card .s-actions button { flex: 1; }

/* ---------- Integrationsübersicht (§37) ---------- */
.tt-account .tta-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tt-account .tta-txt span { overflow-wrap: anywhere; }
#int-oauth .tt-account, #int-banking .tt-account, #int-accounts .tt-account {
  display: flex; align-items: center; gap: var(--space-3); }
#int-oauth .tt-account .tta-txt, #int-banking .tt-account .tta-txt,
#int-accounts .tt-account .tta-txt { flex: 1; }
.check-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: 6px; }
.check-list li { display: flex; align-items: flex-start; gap: var(--space-2); font-size: 0.85rem;
  color: var(--color-text-secondary); }
.check-list li.ok { color: var(--color-text-primary); }
.check-list .cl-ico { width: 18px; height: 18px; flex-shrink: 0; color: var(--color-warning); }
.check-list li.ok .cl-ico { color: var(--color-success); }
.check-list .cl-ico svg { width: 16px; height: 16px; display: block; }

/* ---------- KI-Assistent (§31) ---------- */
.ai-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.2fr); gap: var(--space-4); align-items: start; }
@media (max-width: 860px) { .ai-grid { grid-template-columns: 1fr; } }
.ai-tools { display: grid; gap: var(--space-2); }
/* Die Grundregel `button` setzt height:44px und justify-content:center. Ein
   Werkzeugknopf traegt aber drei Zeilen (Name, Beschreibung, Recht): der Inhalt
   war hoeher als der Knopf, quoll heraus und ueberlappte den naechsten — die
   Zeilen liegen nur `--space-2` auseinander. height:auto laesst den Inhalt die
   Hoehe bestimmen, min-height haelt die Mindestgroesse eines Knopfes. */
.ai-tool { display: flex; gap: var(--space-3); align-items: flex-start; text-align: left;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--space-3); box-shadow: none;
  color: var(--color-text-primary); font-weight: 400;
  height: auto; min-height: 44px; justify-content: flex-start; white-space: normal; }
.ai-tool:hover { background: var(--color-nav-active-bg); box-shadow: none; }
.ai-tool[aria-pressed="true"] { border-color: var(--color-primary); background: var(--color-nav-active-bg); }
.ai-tool .ai-ico { width: 20px; height: 20px; flex-shrink: 0; color: var(--color-primary); }
.ai-tool .ai-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ai-tool .ai-txt b { font-size: 0.88rem; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.ai-tool .ai-txt span { font-size: 0.82rem; color: var(--color-text-secondary); line-height: 1.35; }
/* max-height ohne overflow liess lange Werkzeugausgaben aus dem Kasten laufen —
   und weil .card ebenfalls kein overflow hat, gleich aus der Karte heraus. */
.ai-out { max-height: 340px; overflow-y: auto; }
.field.wide { flex: 1 1 100%; }
.field.wide textarea { width: 100%; }

/* ---------- Sample Card (Konzept §57) ---------- */
.sample-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4); margin-top: var(--space-3); }
.sample-card { display: flex; flex-direction: column; gap: var(--space-3);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-4); }
.sample-card.is-reverted { opacity: 0.62; }
.sample-card .sc-img { height: 84px; border-radius: var(--radius-md); background: var(--color-nav-active-bg);
  display: grid; place-items: center; color: var(--color-primary); }
.sample-card .sc-img svg { width: 30px; height: 30px; }
.sample-card .sc-body { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.sample-card .sc-body b { font-size: 0.94rem; line-height: 1.3; }
.sample-card .sc-meta { font-size: 0.82rem; color: var(--color-text-secondary); }
/* Der Warenwert ist der Kern der Karte — deshalb farblich und typografisch hervorgehoben. */
.sample-card .sc-value { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2);
  margin-top: var(--space-1); padding: var(--space-2) var(--space-3);
  background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); }
.sample-card .sc-value-label { font-size: 0.71rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--color-text-muted); }
.sample-card .sc-value-num { font-size: 1.06rem; font-weight: 700; color: var(--color-text-primary); }
.sample-card .sc-note { font-size: 0.76rem; color: var(--color-text-muted); }
.sample-card .sc-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  flex-wrap: wrap; padding-top: var(--space-1); border-top: 1px solid var(--color-border); }
.sample-card.skeleton-card { height: 232px; border-color: transparent; }
[data-theme="dark"] .sample-card { background: var(--color-surface-elevated); }
[data-theme="dark"] .sample-card .sc-value { background: var(--color-surface); }

/* ---------- Import-Ergebnis (Kontenrahmen) ---------- */
.import-result { margin-top: var(--space-3); font-size: 0.85rem; }
.import-result ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); color: var(--color-error-text); }

/* ---------- Rollen-/Rechte-Matrix (§38) ---------- */
#perm-table td, #perm-table th { padding: 8px 10px; font-size: 0.82rem; }
#perm-table td:first-child { font-weight: 500; }
.yes { color: var(--color-success-text); font-weight: 700; }
.no { color: var(--color-text-muted); }

/* ---------- Dark-Mode-Feinheiten ---------- */
[data-theme="dark"] .login-hero { background-color: #0A0A0A; }
[data-theme="dark"] .sug-card { background: var(--color-surface-elevated); }
[data-theme="dark"] .table-wrap { background: var(--color-surface-elevated); }
[data-theme="dark"] .kpi { background: var(--color-surface-elevated); }
[data-theme="dark"] .bottom-nav { box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.4); }

/* ============================================================
   Prüfstand (ADR-014) — Testmodus, Entwicklermodus, Sandbox
   ============================================================
   Alles unter einem Präfix (`pruef-`) außer den Karten der Fundliste: die
   tragen die Namen aus Block F (`fall`, `prio`), weil sie dessen Struktur
   übernehmen — auf den Tokens dieser App, nicht auf seinen Farbwerten. */

/* ---------- Sandbox-Banner ---------- */
.pruef-banner { display: flex; align-items: center; gap: var(--space-3);
  margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4);
  border: 1px solid var(--p2); border-left-width: 4px; border-radius: var(--radius-md);
  background: var(--p2-wash); color: var(--color-text-primary); font-size: 0.88rem; }
.pruef-banner .pb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--p2); flex-shrink: 0; }
.pruef-banner .pb-txt { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.pruef-banner .pb-txt b { color: var(--p2); letter-spacing: 0.02em; text-transform: uppercase; font-size: 0.72rem; }
.pruef-banner button { margin-left: auto; flex-shrink: 0; }

/* ---------- Schalter im Admin-Untertab ---------- */
.pruef-sandbox { margin-top: var(--space-4); padding: var(--space-4);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
.pruef-sandbox .ps-kopf { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.pruef-sandbox p { margin: 0 0 var(--space-3); }
.pruef-details { display: grid; grid-template-columns: minmax(120px, max-content) 1fr;
  gap: var(--space-1) var(--space-4); margin: var(--space-3) 0; font-size: 0.82rem; }
.pruef-details dt { color: var(--color-text-muted); }
.pruef-details dd { margin: 0; overflow-wrap: anywhere; }
.pruef-links a { font-weight: 600; font-size: 0.85rem; }

/* ---------- Testlauf-Knopf ----------
   Unten **links**, nicht rechts: rechts sitzen schon der Beleg-Upload (mobil)
   und Detlef. Zwei schwebende Knöpfe übereinander sind einer zu viel. */
.pruef-fab { position: fixed; z-index: 51; display: flex; align-items: center; gap: var(--space-2);
  left: var(--space-4); bottom: calc(76px + env(safe-area-inset-bottom));
  height: 46px; padding: 0 var(--space-4); border-radius: var(--radius-pill);
  background: var(--color-surface-elevated); color: var(--color-text-primary);
  border: 1px solid var(--color-border-strong); box-shadow: var(--shadow-lg); font-size: 0.85rem; }
.pruef-fab svg { width: 18px; height: 18px; }
.pruef-fab .pf-count { min-width: 22px; padding: 1px 6px; border-radius: var(--radius-pill);
  background: var(--p1); color: #fff; font-size: 0.72rem; font-weight: 700; text-align: center; }
@media (min-width: 861px) {
  .pruef-fab { left: calc(var(--sidebar-w) + var(--space-6)); bottom: var(--space-6); }
}

/* ---------- Popover: Rechtsklick, Alt-Klick und Textauswahl ---------- */
/* Über den Modals der App (`.modal-overlay`, z-index 60), nicht darunter: in der
   Testfirma läuft der Einrichtungs-Assistent vollbild, und dort wird markiert
   (ADR-014). Die eigenen Overlays des Prüfstands stehen aus demselben Grund
   darüber — `#bug-modal` stünde sonst allein wegen der Reihenfolge im Markup
   hinter dem Assistenten, und „Fehler markieren" sähe aus, als täte es nichts. */
.pruef-pop { position: fixed; left: 0; top: 0; z-index: 62; }
#bug-modal, #bug-list-modal, #pruef-log-modal { z-index: 62; }
.pruef-pop-btn { display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  background: var(--color-surface-elevated); color: var(--color-text-primary);
  border: 1px solid var(--color-border-strong); box-shadow: var(--shadow-lg); font-size: 0.85rem; }

/* ---------- Fund erfassen ---------- */
.pruef-modal { width: min(720px, 100%); }
.pruef-form { display: flex; flex-direction: column; gap: var(--space-3); overflow-y: auto; }
.pruef-form .grow { flex: 1; min-width: 200px; }
.pruef-shot { border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.pruef-shot img { display: block; width: 100%; max-height: 320px; object-fit: contain; background: var(--color-surface); }
.pruef-shot p { margin: 0; padding: var(--space-2) var(--space-3); border-top: 1px solid var(--color-border); }

/* ---------- Fundliste (Block-F-Design) ---------- */
.pruef-liste-modal { width: min(1000px, 100%); }
.pruef-liste { display: flex; flex-direction: column; gap: var(--space-3); overflow-y: auto; min-height: 80px; }
.pruef-liste .empty { padding: var(--space-8) var(--space-4); text-align: center; }
.pruef-liste .empty p { margin: var(--space-2) 0 0; color: var(--color-text-muted); font-size: 0.85rem; }

.fall { border: 1px solid var(--color-border); border-left: 4px solid var(--p3);
  border-radius: var(--radius-md); background: var(--color-surface-elevated); padding: var(--space-3) var(--space-4); }
.fall[data-p="P1"] { border-left-color: var(--p1); }
.fall[data-p="P2"] { border-left-color: var(--p2); }
.fall[data-p="P3"] { border-left-color: var(--p3); }
.fall-kopf { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; font-size: 0.78rem; }
.fall-id { font-weight: 700; }
.fall[data-p="P1"] .fall-id { color: var(--p1); }
.fall[data-p="P2"] .fall-id { color: var(--p2); }
.fall[data-p="P3"] .fall-id { color: var(--p3); }
.fall-datum { margin-left: auto; }
.fall-titel { margin: var(--space-2) 0; font-size: 0.98rem; }
.fall-felder { display: grid; grid-template-columns: minmax(72px, max-content) 1fr;
  gap: 2px var(--space-3); margin: 0; font-size: 0.84rem; }
.fall-felder dt { color: var(--color-text-muted); }
.fall-felder dd { margin: 0; overflow-wrap: anywhere; }
.fall-auswahl { margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--color-border-strong); background: var(--color-surface);
  font-style: italic; overflow-wrap: anywhere; }
.fall-aktionen { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.prio-gruppe { display: flex; gap: 2px; }
.prio, .statusbtn { height: 28px; min-height: 28px; padding: 0 var(--space-3);
  background: transparent; border: 1px solid var(--color-border); color: var(--color-text-secondary);
  border-radius: var(--radius-sm); font-size: 0.76rem; font-weight: 600; }
.prio:hover, .statusbtn:hover { background: var(--color-surface); color: var(--color-text-primary); }
.prio[aria-pressed="true"][data-prio="P1"] { background: var(--p1-wash); border-color: var(--p1); color: var(--p1); }
.prio[aria-pressed="true"][data-prio="P2"] { background: var(--p2-wash); border-color: var(--p2); color: var(--p2); }
.prio[aria-pressed="true"][data-prio="P3"] { background: var(--p3-wash); border-color: var(--p3); color: var(--p3); }
.statusbtn[aria-pressed="true"] { background: var(--color-nav-active-bg); border-color: var(--color-primary); color: var(--color-nav-active-text); }
.fall-aktionen button[data-weg] { margin-left: auto; }
.fall-aktionen button[data-weg].danger { background: var(--color-error-bg); border-color: var(--color-error); color: var(--color-error-text); }
.fall-bild { margin-top: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.fall-bild img { display: block; width: 100%; max-height: 420px; object-fit: contain; background: var(--color-surface); }

/* ---------- Bericht ---------- */
.pruef-bericht { display: flex; flex-direction: column; gap: var(--space-3); overflow: hidden; }
.pruef-pre { margin: 0; padding: var(--space-4); overflow: auto; max-height: 60vh;
  border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface);
  color: var(--color-text-primary); font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- API-Log ---------- */
.pruef-log-modal { width: min(760px, 100%); }
#pruef-log-table { width: 100%; border-collapse: collapse; }
#pruef-log-table th, #pruef-log-table td { padding: 6px 10px; text-align: left; font-size: 0.8rem;
  border-bottom: 1px solid var(--color-border); }
#pruef-log-table th { color: var(--color-text-muted); font-weight: 600; }

/* ---------- Die Aufnahme selbst ----------
   Beim Screenshot ausblenden, was über der Seite schwebt: der Beleg soll die
   Seite zeigen, nicht ihre Bedienelemente. `visibility` statt `display`, damit
   das Layout in der Aufnahme dasselbe bleibt. */
.pruef-aufnahme .detlef-dock,
.pruef-aufnahme .bottom-nav,
.pruef-aufnahme .fab,
.pruef-aufnahme .pruef-fab,
.pruef-aufnahme .pruef-pop { visibility: hidden !important; }

/* ============================================================
   Creator OS — Ergänzungen (neue Module, gleiche Tokens)
   ============================================================ */

/* ---------- Modal-Body (Abstand, weil .modal nur padding außen hat) ---------- */
.modal-body { overflow-y: auto; }
.modal-body form.two-col { grid-template-columns: 1fr 1fr; }
.modal-body .check { min-height: 44px; }

/* ---------- Drawer-Abschnitte ---------- */
.drawer-h { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.row-sep { margin-top: var(--space-3); }
.dash-alerts { display: flex; flex-direction: column; gap: 2px; }
.dash-alerts .notif-item { padding: var(--space-2) var(--space-3); }

/* ---------- Deal-Pipeline (Dashboard) ---------- */
.pipe-row { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-1); }
.pipe-col { flex: 1; min-width: 92px; display: flex; flex-direction: column; gap: 2px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--space-3); text-align: center; }
.pipe-col b { font-size: 1.3rem; letter-spacing: -0.01em; }
.pipe-col span { font-size: 0.72rem; color: var(--color-text-muted); line-height: 1.3; }

/* ---------- Deal-Timeline ---------- */
.timeline { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); margin-bottom: var(--space-4); }
.tl-step { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 600;
  color: var(--color-text-muted); background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-pill); padding: 3px 10px; }
.tl-step i { width: 8px; height: 8px; border-radius: 50%; background: var(--color-border-strong); flex-shrink: 0; }
.tl-step.done { color: var(--color-success-text); background: var(--color-success-bg); border-color: transparent; }
.tl-step.done i { background: var(--color-success); }
.tl-step.current { color: var(--color-nav-active-text); background: var(--color-nav-active-bg); border-color: transparent; }
.tl-step.current i { background: var(--color-primary); }

/* ---------- Deal-Kanban ---------- */
.kanban { display: flex; gap: var(--space-3); overflow-x: auto; align-items: flex-start; padding-bottom: var(--space-3); }
.kb-col { flex: 0 0 240px; max-width: 240px; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-2); }
.kb-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.78rem;
  font-weight: 700; color: var(--color-text-secondary); padding: var(--space-2) var(--space-2) var(--space-1); }
.kb-head span { color: var(--color-text-muted); font-weight: 600; }
.kb-card { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; height: auto;
  min-height: 0; padding: var(--space-3); margin-bottom: var(--space-2); justify-content: flex-start;
  background: var(--color-surface-elevated); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm); font-weight: 400; white-space: normal; }
.kb-card:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-md); }
.kb-card b { font-size: 0.86rem; line-height: 1.3; }
.kb-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.kb-empty { text-align: center; padding: var(--space-4) 0; }

/* ---------- Content-Karten ---------- */
/* Die Grundregel `button` legt eine waagerechte Flex-Zeile an. Titel, Marke,
   Hook und Plattform-Badges standen dadurch nebeneinander, wurden auf ~60px
   gequetscht und liefen aus der Karte heraus (und damit aus der Seite).
   `.kb-card` macht es vor: Spalte, Zeilen linksbündig, Umbruch erlaubt. */
.content-card { flex-direction: column; align-items: stretch; gap: 4px; width: 100%;
  text-align: left; height: auto; min-height: 0; justify-content: flex-start; white-space: normal; }
.content-card .chip-row { margin-top: var(--space-2); margin-bottom: 0; }
.content-card .pill { font-size: 0.66rem; padding: 2px 7px; }

/* ---------- Content-Planer (Monatsraster) ---------- */
.pl-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--space-1);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface); padding: var(--space-1); overflow: hidden; }
.pl-head { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--color-text-muted); padding: var(--space-2); text-align: center; }
.pl-cell { min-height: 92px; background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); padding: var(--space-1); display: flex; flex-direction: column;
  gap: 2px; overflow: hidden; }
[data-theme="dark"] .pl-cell { background: var(--color-surface-elevated); }
.pl-cell.heute { border-color: var(--color-primary); box-shadow: 0 0 0 1px var(--color-primary) inset; }
.pl-day { font-size: 0.68rem; font-weight: 700; color: var(--color-text-muted); padding: 1px 3px; }
.pl-entry { height: auto; min-height: 0; padding: 2px 5px; font-size: 0.66rem; font-weight: 600;
  text-align: left; justify-content: flex-start; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; border-radius: var(--radius-sm); border: none; box-shadow: none;
  background: var(--color-info-bg); color: var(--color-info-text); }
.pl-entry:hover { filter: brightness(0.97); box-shadow: none; }
.pl-entry.done { background: var(--color-success-bg); color: var(--color-success-text); }
.pl-month { font-size: 0.92rem; }

/* ---------- Balken-Charts (Analytics, Shop) ---------- */
.hbar-row { display: grid; grid-template-columns: minmax(110px, 180px) 1fr auto; gap: var(--space-2);
  align-items: center; padding: var(--space-1) 0; font-size: 0.84rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text-secondary); }
.hbar-track { height: 10px; border-radius: var(--radius-pill); background: var(--color-surface);
  border: 1px solid var(--color-border); overflow: hidden; }
.hbar-fill { display: block; height: 100%; width: 0; border-radius: var(--radius-pill);
  background: var(--color-primary); transition: width 300ms ease-out; }
.hbar-fill.alt { background: var(--color-accent); }
@media (prefers-reduced-motion: reduce) { .hbar-fill { transition: none; } }

/* ---------- Off-Canvas-Anker ohne Bottom-Nav (Creator OS nutzt Burger) ---------- */
@media (max-width: 860px) {
  .nav-burger-anim { transform: none; }
}

/* ---------- Checkboxen global auf Icon-Größe (Basisregel setzt 44px/100%) ---------- */
input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--color-primary);
}

/* ---------- Icons in Buttons bemessen (Basis-Button hat keine SVG-Größe) ---------- */
button svg { width: 16px; height: 16px; flex-shrink: 0; }
/* Die Spezialflächen behalten ihre eigenen Maße (höhere Spezifität):
   .icon-btn svg 20px, .nav-item svg 20px, .empty .e-ico svg 20px, .dropzone svg 28px,
   .kpi .l .kpi-ico svg 15px, .kb/… - alles unverändert aus dem Design-System. */

/* ============================================================
   Postfach (E-Mail) — Liste · Verlauf · Verfassen
   ============================================================ */

.linklike {
  background: none; border: 0; padding: 0; height: auto; min-height: 0;
  color: var(--color-primary); font: inherit; font-size: 0.85rem; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.linklike:hover { color: var(--color-primary-hover); box-shadow: none; background: none; }

.chip-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; margin-left: var(--space-2); padding: 0 5px;
  border-radius: var(--radius-pill); background: var(--color-primary); color: #fff;
  font-size: 0.7rem; font-weight: 700; line-height: 1;
}
.chip.active .chip-count { background: var(--color-nav-active-text); }

/* ---------- Kopfzeile über der Liste ---------- */
.mail-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4);
}
.mail-toolbar .chip-row { margin-bottom: 0; }
.mail-tools { display: flex; align-items: center; gap: var(--space-2); }
.mail-tools input[type="search"] {
  height: 34px; width: 220px; padding: 0 var(--space-3);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-white); color: var(--color-text-primary); font: inherit; font-size: 0.88rem;
}
.mail-tools input[type="search"]:focus {
  outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-nav-active-bg);
}

.mail-banner {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4);
  border: 1px solid var(--color-border); border-left: 3px solid var(--color-warning);
  border-radius: var(--radius-md); background: var(--color-warning-bg); color: var(--color-warning-text);
  font-size: 0.88rem;
}
.mail-banner span { color: var(--color-text-secondary); }
.mail-banner button { margin-left: auto; }

/* ---------- Zweispaltiges Layout ---------- */
.mail-layout {
  display: grid; grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 0; border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-white); overflow: hidden; min-height: 520px;
}

/* ---------- Liste ---------- */
.mail-list { border-right: 1px solid var(--color-border); display: flex; flex-direction: column; min-width: 0; }
.mail-list-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2);
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border);
  font-size: 0.82rem; background: var(--color-surface);
}
.mail-items { overflow-y: auto; max-height: 640px; }
.mail-none { padding: var(--space-5) var(--space-4); }

.mail-item {
  display: block; width: 100%; height: auto; min-height: 0;
  padding: var(--space-3) var(--space-4); border: 0; border-bottom: 1px solid var(--color-border);
  border-radius: 0; background: none; text-align: left; cursor: pointer;
  font: inherit; color: inherit; box-shadow: none;
}
.mail-item:hover { background: var(--color-surface); }
.mail-item.active { background: var(--color-nav-active-bg); }
.mail-item.active:hover { background: var(--color-nav-active-bg); }
.mail-item-top { display: flex; align-items: center; gap: var(--space-2); }
.mail-item-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.mail-item.unread .mail-item-top b { font-weight: 700; }
.mail-item.unread .mail-item-subject { color: var(--color-text-primary); font-weight: 600; }
.mail-when { color: var(--color-text-muted); font-size: 0.75rem; flex-shrink: 0; }
.mail-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: transparent;
}
.mail-dot.on { background: var(--color-primary); }
.mail-item-subject {
  margin-top: 2px; font-size: 0.84rem; color: var(--color-text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mail-item-auszug {
  margin-top: 2px; font-size: 0.8rem; color: var(--color-text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mail-item-pills { display: flex; gap: var(--space-1); flex-wrap: wrap; margin-top: var(--space-2); }

/* ---------- Verlauf ---------- */
.mail-reader { display: flex; flex-direction: column; min-width: 0; }
.mail-head {
  display: flex; gap: var(--space-5); flex-wrap: wrap;
  padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.mail-head-main { flex: 1 1 320px; min-width: 0; }
.mail-head-main h2 { margin: 0 0 var(--space-2); font-size: 1.05rem; }
.mail-head-meta { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; font-size: 0.86rem; }
.mail-head-links { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-3); }
.mail-head-side { flex: 0 0 auto; min-width: 220px; }
.mail-head-side .row { margin-top: var(--space-3); flex-wrap: wrap; }

.mail-msgs { flex: 1; padding: var(--space-5); overflow-y: auto; max-height: 560px; }
.mail-msg {
  border: 1px solid var(--color-border); border-left: 3px solid var(--color-border-strong);
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4);
  background: var(--color-white);
}
.mail-msg header { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-2); }
.mail-msg-wer {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 1px 6px; border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text-muted);
}
.mail-msg-name { font-weight: 600; font-size: 0.88rem; }
.mail-msg-zeit { margin-left: auto; color: var(--color-text-muted); font-size: 0.78rem; }
.mail-msg-body { white-space: pre-wrap; overflow-wrap: break-word; margin: 0; font-size: 0.9rem; }
.mail-msg.out { border-left-color: var(--color-primary); }
.mail-msg.in { border-left-color: var(--color-success); background: var(--color-surface); }
.mail-msg.failed { border-left-color: var(--color-error); }
.mail-msg.draft { border-left-color: var(--color-warning); border-style: dashed; }
.mail-msg-fehler {
  margin: 0 0 var(--space-2); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); background: var(--color-error-bg); color: var(--color-error-text);
  font-size: 0.82rem;
}
.mail-msg-fehler.entwurf { background: var(--color-warning-bg); color: var(--color-warning-text); }

/* ---------- Verfassen ---------- */
.mail-compose {
  border-top: 1px solid var(--color-border); padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
}
.mail-compose-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.mail-compose select {
  height: 32px; border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-white); color: var(--color-text-primary); font: inherit; font-size: 0.84rem;
}
.mail-compose textarea {
  width: 100%; border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-white); color: var(--color-text-primary);
  font: inherit; font-size: 0.9rem; padding: var(--space-3); resize: vertical;
}
.mail-compose textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-nav-active-bg); }
.mail-compose-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-3); }
.mail-hint { color: var(--color-text-muted); font-size: 0.8rem; margin-left: auto; }
.mail-empty-card { text-align: center; }
.mail-empty-card .linklike { font-size: inherit; }

[data-theme="dark"] .mail-layout,
[data-theme="dark"] .mail-tools input[type="search"],
[data-theme="dark"] .mail-compose textarea,
[data-theme="dark"] .mail-compose select,
[data-theme="dark"] .mail-msg { background: var(--color-surface-elevated); }
[data-theme="dark"] .mail-item.active,
[data-theme="dark"] .mail-item.active:hover { background: var(--color-nav-active-bg); }
[data-theme="dark"] .mail-msg.in { background: var(--color-surface); }
[data-theme="dark"] .mail-banner { border-color: var(--color-border); }

@media (max-width: 900px) {
  .mail-layout { grid-template-columns: 1fr; }
  .mail-list { border-right: 0; border-bottom: 1px solid var(--color-border); }
  .mail-items { max-height: 300px; }
  .mail-head { padding: var(--space-4); }
  .mail-msgs { padding: var(--space-4); max-height: none; }
  .mail-compose { padding: var(--space-4); }
  .mail-tools input[type="search"] { width: 100%; }
  .mail-hint { margin-left: 0; }
}

/* Fällige Nachfass-Mails auf dem Dashboard */
.fy-row-list { display: flex; flex-direction: column; gap: var(--space-2); }
.fy-row-list .fy-row { margin: 0; }

/* ---------- Feldbreiten in zweispaltigen Formularen ---------- */
/* `full: true` setzt die Klasse `wide`; im Grid muss sie beide Spalten greifen,
   sonst stünde ein Notizfeld nur in einer halben Zeile. */
.two-col > .wide { grid-column: 1 / -1; }

/* ---------- Vertragstext ---------- */
.contract-text {
  white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem; line-height: 1.6;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: var(--space-4);
  margin: 0; max-height: 60vh; overflow: auto;
  color: var(--color-text-primary);
}

/* ---------- Platzhalter-Legende ---------- */
.ph-legend { box-shadow: none; background: var(--color-surface); }
.ph-row { display: flex; gap: var(--space-3); align-items: baseline; padding: 3px 0; }
.ph-label { flex: 0 0 110px; font-size: 0.78rem; font-weight: 600; color: var(--color-text-secondary); }
.ph-items { display: flex; flex-wrap: wrap; gap: 4px; }
.ph-items code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem; padding: 1px 5px; border-radius: var(--radius-sm);
  background: var(--color-white); border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}
[data-theme="dark"] .ph-items code { background: var(--color-surface-elevated); }

/* Hinweistext neben den Aktionsknöpfen (Vertragsformular). */
.mail-hint.bad-text { color: var(--color-error); }

/* Unsichtbares Feld für den Kopier-Rückfall (execCommand braucht ein
   auswählbares, aber nicht sichtbares Feld im Dokument). */
.offscreen { position: fixed; top: 0; left: -9999px; opacity: 0; pointer-events: none; }

/* ---------- Druck: Vertragstext als PDF ---------- */
/* `#print-root` ist auf dem Bildschirm leer und unsichtbar; erst beim Drucken
   wird es gefüllt und alles andere ausgeblendet. Kein Popup (CSP) und keine
   neue Abhängigkeit. */
#print-root { display: none; }

@media print {
  body.printing-contract > * { display: none !important; }
  body.printing-contract > #print-root { display: block !important; }
  /* Immer hell drucken — der Dunkelmodus käme sonst als schwarze Fläche heraus. */
  body.printing-contract #print-root {
    color: #000; background: #FFF;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 11.5pt; line-height: 1.5;
    padding: 0; margin: 0;
  }
  body.printing-contract .print-title {
    font-size: 15pt; font-weight: 700; margin: 0 0 12pt; padding-bottom: 6pt;
    border-bottom: 1px solid #000; color: #000;
  }
  body.printing-contract .print-text {
    white-space: pre-wrap; word-break: break-word;
    font-family: inherit; font-size: 11.5pt; margin: 0; color: #000;
  }
}

