/* ============================================================================
   IndigoCore — App-Stylesheet
   Orientiert am Style-Schema der Indigo-Systems-Gruppe (Lexend, warmes Paper,
   Glass-Look, Indigo-Blau). Tokens = identisch zur Marketing-Seite.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   Schriftart „Lexend" — LOKAL gehostet (keine Verbindung zu Google).
   Lizenz: SIL Open Font License 1.1 (kommerzielle Nutzung & Selbsthosting
   erlaubt) — siehe /public/fonts/LICENSE.txt. Subset: latin (inkl. ä ö ü ß €).
   ---------------------------------------------------------------------------- */
@font-face { font-family: 'Lexend'; font-style: normal; font-weight: 300; font-display: swap; src: url('/public/fonts/lexend-300.woff2') format('woff2'); }
@font-face { font-family: 'Lexend'; font-style: normal; font-weight: 400; font-display: swap; src: url('/public/fonts/lexend-400.woff2') format('woff2'); }
@font-face { font-family: 'Lexend'; font-style: normal; font-weight: 500; font-display: swap; src: url('/public/fonts/lexend-500.woff2') format('woff2'); }
@font-face { font-family: 'Lexend'; font-style: normal; font-weight: 600; font-display: swap; src: url('/public/fonts/lexend-600.woff2') format('woff2'); }
@font-face { font-family: 'Lexend'; font-style: normal; font-weight: 700; font-display: swap; src: url('/public/fonts/lexend-700.woff2') format('woff2'); }
@font-face { font-family: 'Lexend'; font-style: normal; font-weight: 800; font-display: swap; src: url('/public/fonts/lexend-800.woff2') format('woff2'); }

:root {
  /* Neutralpalette — kühles Hellgrau (Clean Enterprise) */
  --bg:     #F6F7F9;  /* App-Hintergrund */
  --ink:    #1B1F24;  /* Überschriften / starker Text */
  --graph:  #3B424C;  /* Fließtext */
  --stone:  #6B7280;  /* sekundär / Labels */
  --sand:   #9AA1AC;
  --stone2: #D7DBE0;
  --paper:  #FFFFFF;
  --white:  #FFFFFF;

  /* Indigo-Blau (Markenfarbe IndigoCore) — unverändert */
  --ib1: #042C53;
  --ib2: #185FA5;
  --ib3: #378ADD;
  --ib4: #85B7EB;
  --ib5: #B5D4F4;
  --ib6: #EAF2FB;
  --ib-logo: #0C447C;

  /* Status */
  --ok:   #2F8559;
  --warn: #B6892F;
  --err:  #C0392B;

  /* Flächen & Ränder (solide statt Glas) */
  --glass-bg:        #FFFFFF;
  --glass-bg-strong: #FFFFFF;
  --glass-border:    #E4E7EC;  /* feiner Kartenrand */
  --glass-stroke:    #EEF0F3;  /* Trennlinien / Tabellen */
  --glass-shadow:    0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --glass-shadow-lg: 0 6px 16px rgba(16,24,40,.08), 0 2px 6px rgba(16,24,40,.05);
  --blur:            none;     /* keine Transparenz/Blur mehr */
  --hover:           var(--hover);  /* Hover-Flächen (Listenzeilen, Nav, Menüs) */
  --subtle:          var(--subtle);  /* dezente Flächen (Tabellenkopf, Inset) */
  /* Markenfarben der Produkte (für Akzente) */
  --at5: #9FE1CB;

  --r-pill: 100px;
  --r-lg: 14px;
  --r-xl: 18px;
  --font: 'Lexend', -apple-system, 'Segoe UI', Roboto, sans-serif;

  --sidebar-w: 276px;
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.link { color: var(--ib2); font-weight: 600; }
.link:hover { color: var(--ib1); }

/* ── Hintergrund-Orbs deaktiviert (Clean-Enterprise-Look, ruhiger Hintergrund) ── */
.orbs { display: none; }
.orbs--legacy { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(72px); opacity: .26; will-change: transform; }
.orb-1 { width: 640px; height: 640px; background: var(--ib5); top: -240px; right: -160px; animation: orbFloat1 18s ease-in-out infinite; }
.orb-2 { width: 460px; height: 460px; background: var(--at5); bottom: -180px; left: -120px; animation: orbFloat2 22s ease-in-out infinite; }
.orb-3 { width: 340px; height: 340px; background: var(--ib4); top: 55%; left: 52%; opacity: .18; animation: orbFloat3 15s ease-in-out infinite; }
@keyframes orbFloat1 { 0%,100%{transform:translate(0,0)} 33%{transform:translate(-40px,30px)} 66%{transform:translate(30px,-20px)} }
@keyframes orbFloat2 { 0%,100%{transform:translate(0,0)} 33%{transform:translate(30px,-40px)} 66%{transform:translate(-20px,25px)} }
@keyframes orbFloat3 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-2%,2%)} }

/* ── Sanftes Einblenden beim Erscheinen (reveal) ───────────────────────── */
/* Entrance-Animation deaktiviert (ruhiger Enterprise-Look, kein Flackern im Scrollbereich) */
.reveal, .reveal.visible { opacity: 1; transform: none; }

/* ── App-Shell: Sidebar + Hauptbereich ─────────────────────────────────── */
.app-shell { display: flex; height: 100vh; overflow: hidden; position: relative; z-index: 1; }

.app-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  display: flex; flex-direction: row;
  background: var(--glass-bg);
  border-right: 1px solid var(--glass-border);
  overflow: hidden;
  z-index: 20;
}

/* ── Two-Tier-Navigation: Rail (Tier 1) + Panel (Tier 2) ────────────────── */
.tt-rail {
  flex: none; width: 60px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 0; background: color-mix(in srgb, var(--ink) 4%, var(--glass-bg));
  border-right: 1px solid var(--glass-stroke);
}
.tt-brand { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 6px; }
.tt-brand img { display: block; border-radius: 9px; }
.tt-rail-nav { display: flex; flex-direction: column; gap: 6px; }
.tt-rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.tt-rail-item {
  position: relative; width: 42px; height: 42px; border: none; background: transparent; cursor: pointer;
  border-radius: 12px; display: grid; place-items: center; color: var(--stone);
  transition: background .12s, color .12s;
}
.tt-rail-item svg { width: 22px; height: 22px; }
.tt-rail-item:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.tt-rail-item.is-active { background: color-mix(in srgb, var(--ib2) 15%, transparent); color: var(--ib2); }
.tt-rail-item:focus-visible { outline: 2px solid var(--ib2); outline-offset: 2px; }
.tt-rail-item::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 8px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 30; box-shadow: var(--glass-shadow-lg);
}
.tt-rail-item:hover::after { opacity: 1; }
.tt-panels { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 14px 12px; overflow-y: auto; }
.tt-panel { display: none; flex-direction: column; gap: 2px; }
.tt-panel.is-active { display: flex; }
.tt-panel-head { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--stone); padding: 2px 11px 10px; margin: 0; }
.tt-panel-items { display: flex; flex-direction: column; gap: 3px; }
/* Konto im Rail-Fuß + „Konto"-Panel (ersetzt das Topbar-Dropdown) */
.tt-rail-account:hover, .tt-rail-account.is-active { background: transparent; }
.tt-rail-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--ib2), var(--ib3)); transition: box-shadow .12s; }
.tt-rail-account:hover .tt-rail-avatar, .tt-rail-account.is-active .tt-rail-avatar { box-shadow: 0 0 0 2px var(--ib4); }
.tt-account-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; padding: 4px 10px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--glass-stroke); }
.tt-account-avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 21px; color: #fff; background: linear-gradient(135deg, var(--ib2), var(--ib3)); margin-bottom: 2px; }
.tt-account-name { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-account-rolebadge { font-size: 11px; font-weight: 700; color: var(--ib2); background: color-mix(in srgb, var(--ib2) 12%, transparent); padding: 2px 10px; border-radius: 999px; }
.tt-account-email { font-size: 12px; color: var(--stone); margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Abmelden im Rail-Fuß (immer sichtbar) */
.tt-rail-logout-form { margin: 0; }
.tt-rail-logout { color: var(--stone); }
.tt-rail-logout:hover { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
/* Brand-Leiste im Panel (neben dem Rail-Logo) */
.tt-brandbar { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 6px; margin-bottom: 8px; }
.tt-brandname { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; color: var(--ink); }
.tt-brandname:hover { color: var(--ib2); }
.tt-ver { font-size: 10.5px; font-weight: 700; color: var(--ib2); background: color-mix(in srgb, var(--ib2) 13%, transparent); padding: 2px 8px; border-radius: 999px; letter-spacing: .02em; }
/* Panel-Einträge auf Höhe der Kategorie-/Rail-Icons (42 px) */
.tt-panel-items .app-nav-item { min-height: 42px; padding-top: 0; padding-bottom: 0; }
.tt-panel-items form { margin: 0; }
.tt-panel-items button.app-nav-item { width: 100%; border: none; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.tt-logout { color: var(--err); }
.tt-logout svg { color: var(--err); opacity: 1; }
.tt-logout:hover { background: color-mix(in srgb, var(--err) 10%, transparent); color: var(--err); }
.app-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; }
.app-brand img { display: block; border-radius: 7px; }
.app-brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; color: var(--ink); }

.app-nav { display: flex; flex-direction: column; gap: 2px; }
.app-sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid var(--glass-stroke); }

.app-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 11px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--graph);
  transition: background .12s, color .12s;
}
.app-nav-item svg { width: 18px; height: 18px; flex: none; opacity: .7; }
.app-nav-item:hover { background: var(--hover); color: var(--ink); }
.app-nav-item:hover svg { opacity: .9; }
.app-nav-item.active { background: var(--ib6); color: var(--ib1); font-weight: 600; }
.app-nav-item.active svg { opacity: 1; color: var(--ib2); }

/* ── Hauptbereich (feste Höhe, nur Inhalt scrollt) ─────────────────────── */
.app-main {
  flex: 1; min-width: 0; margin-left: var(--sidebar-w);
  height: 100vh; display: flex; flex-direction: column;
}
.app-topbar {
  flex: none; display: flex; align-items: center; gap: 14px;
  padding: 11px 26px; background: var(--white);
  border-bottom: 1px solid var(--glass-stroke);
}
.app-topbar-titles { min-width: 0; flex: 1; }
.topbar-burger {
  display: none; flex: none; width: 38px; height: 38px; border-radius: 9px;
  align-items: center; justify-content: center; border: 1px solid var(--glass-border);
  background: var(--white); color: var(--ink); cursor: pointer;
}
.topbar-burger svg { width: 22px; height: 22px; }
.app-eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--stone); margin-bottom: 2px; }
.app-title { font-size: 21px; font-weight: 700; letter-spacing: -0.4px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar-right { display: flex; align-items: center; gap: 10px; }
.app-chip {
  font-size: 12px; font-weight: 600; color: var(--ib1);
  background: var(--ib6); border: 1px solid var(--ib5);
  padding: 6px 12px; border-radius: var(--r-pill);
}

.app-content { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 26px 26px; display: flex; flex-direction: column; gap: 14px; }

/* Schwebende Glocke oben rechts (ersetzt die Topbar) — IndigoUI-Surface-Button */
.notif-fab { position: fixed; top: 16px; right: 16px; z-index: 60; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); color: var(--graph); transition: background .15s, color .15s, border-color .15s, box-shadow .15s; }
.notif-fab:hover { background: var(--ib6); color: var(--ib2); border-color: var(--ib4); box-shadow: var(--glass-shadow-lg); }
.notif-fab:focus-visible { outline: 2px solid var(--ib2); outline-offset: 2px; }
.notif-fab svg { width: 22px; height: 22px; }

/* Seitenkopf im Content (ersetzt den Topbar-Titel) */
.page-title { flex: none; padding-right: 52px; }
.page-title-kicker { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--stone); margin: 0 0 3px; }
.page-title-h { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; color: var(--ink); margin: 0; line-height: 1.15; }
@media (max-width: 820px) {
  .notif-fab { top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 12px; }
  .notif-fab svg { width: 20px; height: 20px; }
  .page-title { padding-right: 48px; }
  .page-title-h { font-size: 20px; }
}

/* Einheitlicher Seitenkopf: erklärender Satz links, Primär-Aktion rechts */
.page-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.page-head-sub { font-size: 13.5px; color: var(--stone); max-width: 70ch; }
.page-head-action { flex: none; display: inline-flex; align-items: center; gap: 7px; }

/* Listen-Karte: fixer Kopf/Filter, nur der Tabellen-Body scrollt */
.list-toolbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.list-card { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--white); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--glass-shadow); }
.data-table-wrap { flex: 1; min-height: 0; overflow: auto; }
.data-table-wrap .data-table thead th { position: sticky; top: 0; z-index: 1; background: var(--subtle); }
/* Seiten-System (Pager) — fixer Fuß der Listen-Karte */
.list-pager { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 9px 14px; border-top: 1px solid var(--glass-stroke); background: var(--white); }
.pager-info { font-size: 12.5px; color: var(--stone); }
.pager-controls { display: flex; align-items: center; gap: 4px; }
.pager-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--glass-border); background: var(--white); color: var(--graph); font-size: 13px; font-weight: 600; cursor: pointer; }
.pager-btn:hover { border-color: var(--ib4); color: var(--ib1); }
.pager-btn.is-current { background: var(--ib1); border-color: var(--ib1); color: #fff; }
.pager-btn.is-disabled { opacity: .4; pointer-events: none; }
.pager-btn svg { width: 18px; height: 18px; }
.pager-gap { padding: 0 3px; color: var(--sand); }
.toolbar-info { font-size: 13px; color: var(--stone); }
/* Einheitlicher Leerzustand in einer Listen-Karte */
.list-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px 20px; text-align: center; }
.list-empty svg { width: 38px; height: 38px; color: var(--sand); }
.list-empty-text { font-size: 14px; color: var(--stone); }

/* Breadcrumb */
.breadcrumb { flex: none; display: flex; align-items: center; gap: 7px; font-size: 13px; flex-wrap: wrap; margin-bottom: 2px; }
.crumb { color: var(--stone); }
a.crumb:hover { color: var(--ib2); }
.crumb-current { color: var(--ink); font-weight: 600; }
.crumb-sep { color: var(--sand); }

/* Rechte-Akkordeon (Mitarbeiter-Detail) */
.perm-acc { border: 1px solid var(--glass-border); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.perm-acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--subtle); }
.perm-acc > summary::-webkit-details-marker { display: none; }
.perm-acc[open] > summary { border-bottom: 1px solid var(--glass-stroke); }
.perm-acc .perm-list { border: none; border-radius: 0; background: transparent; }
.perm-acc-count { font-size: 11.5px; font-weight: 700; color: var(--ib2); background: var(--ib6); padding: 2px 9px; border-radius: 100px; }

/* Ticket-Detail füllt die Shell-Höhe (kein Seiten-Scroll) */
@media (min-width: 901px) {
  .ticket-layout { flex: 1; min-height: 0; }
  .ticket-layout .chat-panel { height: 100%; min-height: 0; max-height: none; }
  .ticket-layout .ticket-side { overflow-y: auto; max-height: 100%; }
}
@media (max-width: 900px) {
  .ticket-layout .chat-panel { height: auto; min-height: 340px; max-height: 68vh; }
}

/* Drawer-Hintergrund (mobil) */
.drawer-backdrop { display: none; }
/* Mobile Bottom-Navigation */
.mobile-nav { display: none; }

/* ── Statistik-Karten ──────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(186px, 1fr)); gap: 12px; }
.stat-card {
  display: flex; align-items: center; gap: 13px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
  padding: 15px 17px;
}
.stat-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--ib2) 13%, transparent); color: var(--ib2); }
.stat-ic svg { width: 22px; height: 22px; }
.stat-ic.is-green { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.stat-ic.is-amber { background: color-mix(in srgb, var(--warn) 17%, transparent); color: var(--warn); }
.stat-meta { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 12.5px; font-weight: 500; color: var(--stone); }
.stat-value { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -0.6px; line-height: 1.05; margin-top: 2px; }
.stat-hint { font-size: 12px; color: var(--sand); }

/* ── Panel ─────────────────────────────────────────────────────────────── */
.panel {
  background: var(--white);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow);
  padding: 20px 22px;
}
.panel-title { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -0.2px; margin-bottom: 8px; }
.panel-text { font-size: 14px; color: var(--graph); max-width: 72ch; margin-bottom: 8px; }
.panel-text code { background: var(--hover); padding: 1px 6px; border-radius: 5px; font-size: 13px; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  padding: 8px 15px; border-radius: 9px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--ib1); color: #fff; }
.btn-primary:hover { background: var(--ib2); }
.btn-logo { width: 18px; height: 18px; vertical-align: -4px; margin-right: 7px; }
.btn-block { width: 100%; }

/* ── Formularfelder ────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field span, .field > label { font-size: 13px; font-weight: 600; color: var(--graph); }
.field input {
  font-family: var(--font); font-size: 14px; color: var(--ink);
  padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--stone2); background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--ib3); box-shadow: 0 0 0 3px rgba(55,138,221,0.15); }
.field textarea {
  font-family: var(--font); font-size: 14px; color: var(--ink); line-height: 1.5;
  padding: 9px 12px; border-radius: 8px; resize: vertical; min-height: 70px;
  border: 1px solid var(--stone2); background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea:focus { outline: none; border-color: var(--ib3); box-shadow: 0 0 0 3px rgba(55,138,221,0.15); }
.field input:disabled { color: var(--stone); background: var(--hover); }
.check-inline { align-self: end; padding-bottom: 12px; }

/* ── Login-Seite ───────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; z-index: 1;
}
.login-card {
  width: 100%; max-width: 380px; text-align: center;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--white);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow-lg);
  padding: 32px 30px 28px;
}
.login-domain { align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--graph); background: var(--ib6); border: 1px solid color-mix(in srgb, var(--ib2) 18%, transparent); border-radius: var(--r-pill); padding: 5px 12px; letter-spacing: .01em; }
.login-domain-ic { width: 14px; height: 14px; flex: none; color: var(--ok); }
.login-logo { display: block; margin: 0 auto 2px; border-radius: 12px; }
.login-title { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; color: var(--ink); }
.login-sub { font-size: 13.5px; color: var(--stone); margin-top: -8px; margin-bottom: 6px; }
.login-error { font-size: 13px; color: var(--err); background: rgba(180,69,60,0.08); border: 1px solid rgba(180,69,60,0.2); border-radius: 12px; padding: 10px 12px; }
.login-note { font-size: 11.5px; color: var(--sand); margin-top: 4px; }

/* ── Logout-Button (Sidebar) + Benutzer-Anzeige (Topbar) ───────────────── */
.app-logout { margin: 0; }
.app-logout-btn { width: 100%; font: inherit; background: none; border: none; cursor: pointer; }

.app-user { display: flex; align-items: center; gap: 10px; }
.app-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--ib2); color: #fff;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.app-user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.app-user-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.app-user-role { font-size: 11.5px; color: var(--stone); }

/* ── Topbar: Benutzer-Menü (Dropdown) ──────────────────────────────────── */
.user-menu { position: relative; }
.user-menu > summary {
  display: flex; align-items: center; gap: 10px;
  list-style: none; cursor: pointer; user-select: none;
  padding: 4px 8px 4px 4px; border-radius: var(--r-pill);
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary::marker { content: ''; }
.user-menu > summary:hover,
.user-menu[open] > summary { background: var(--glass-bg); border-color: var(--glass-stroke); }
.user-menu-chev { width: 16px; height: 16px; opacity: .5; transition: transform .2s; flex: none; }
.user-menu[open] > summary .user-menu-chev { transform: rotate(180deg); }

.user-menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  min-width: 250px; padding: 8px;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: 16px;
  box-shadow: var(--glass-shadow-lg, var(--glass-shadow));
}
.user-menu-head { display: flex; align-items: center; gap: 12px; padding: 8px 10px 10px; }
.app-user-avatar-lg { width: 42px; height: 42px; border-radius: 13px; font-size: 17px; }
.user-menu-head-meta { min-width: 0; }
.user-menu-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.user-menu-email { font-size: 12px; color: var(--stone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-id { display: flex; align-items: center; gap: 10px; padding: 0 10px 10px; }
.user-menu-id-text { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--stone); }
.user-menu-sep { height: 1px; background: var(--glass-stroke); margin: 2px 6px 6px; }
.user-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 10px; border: none; background: transparent;
  font-family: var(--font); font-size: 14px; font-weight: 500; color: var(--graph); text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.user-menu-item:hover { background: rgba(44,44,42,0.05); color: var(--ink); }
.user-menu-ic { width: 18px; height: 18px; flex: none; opacity: .8; }
.user-menu-logout { color: var(--err); }
.user-menu-logout:hover { background: rgba(180,69,60,.08); color: var(--err); }
.user-menu-admin { color: var(--ib1); font-weight: 600; }
.user-menu-admin svg { color: var(--ib2); opacity: 1; }
.user-menu-admin:hover { background: var(--ib6); color: var(--ib1); }

/* ── Toolbar / Hinweise ────────────────────────────────────────────────── */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar-info { font-size: 14px; font-weight: 500; color: var(--stone); }
.notice { padding: 12px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; margin-bottom: 18px; }
.notice-ok  { background: rgba(61,122,101,.10); color: var(--ok);  border: 1px solid rgba(61,122,101,.22); }
.notice-err { background: rgba(180,69,60,.08);  color: var(--err); border: 1px solid rgba(180,69,60,.22); }
.notice-info { background: var(--ib6); color: var(--ib1); border: 1px solid var(--ib5); }
.hint-note { font-size: 13px; color: var(--stone); background: rgba(44,44,42,.04); padding: 10px 12px; border-radius: 12px; }
.form-message { font-size: 14.5px; color: var(--ink); line-height: 1.6; white-space: pre-wrap; word-break: break-word; background: var(--subtle); border: 1px solid var(--glass-stroke); border-radius: 12px; padding: 12px 14px; }
/* System-Status (Mitarbeiter-UI) */
.status-rows { display: flex; flex-direction: column; }
.status-row { padding: 16px 2px; border-bottom: 1px solid var(--glass-stroke); }
.status-row:last-child { border-bottom: none; }
.status-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.status-name { font-weight: 600; font-size: 15px; color: var(--ink); }
.status-row-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.status-row-controls select, .status-row-controls input[type="text"] { font-family: var(--font); font-size: 14px; color: var(--ink); padding: 9px 11px; border-radius: 10px; border: 1px solid var(--glass-stroke); background: rgba(255,255,255,0.7); }
.status-row-controls select { flex: none; min-width: 160px; }
.status-row-controls input[type="text"] { flex: 1 1 auto; min-width: 200px; }
.status-meta { font-size: 12px; color: var(--stone); margin-top: 8px; }

/* ── Support-Dienst (Präsenz) ── */
.duty-bar { flex: none; display: flex; align-items: center; gap: 12px 14px; flex-wrap: wrap; padding: 9px 14px; border-radius: var(--r-lg); border: 1px solid var(--glass-stroke); }
.duty-bar.is-on { background: rgba(46,107,84,.09); border-color: rgba(46,107,84,.28); }
.duty-bar.is-off { background: rgba(44,44,42,.04); }
.duty-bar-status { display: flex; align-items: center; gap: 10px; }
.duty-bar-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.duty-bar.is-on .duty-bar-dot { background: #2E6B54; animation: dutyPulse 2.2s ease-in-out infinite; }
.duty-bar.is-off .duty-bar-dot { background: var(--sand); }
@keyframes dutyPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(46,107,84,.45); } 70% { box-shadow: 0 0 0 6px rgba(46,107,84,0); } }
.duty-bar-text { font-size: 14px; color: var(--ink); }
.duty-bar-people { display: flex; gap: 7px; flex-wrap: wrap; margin-left: auto; }
.duty-bar-actions { margin-left: 8px; }
.duty-bar.is-off .duty-bar-people + .duty-bar-actions { margin-left: 8px; }
.duty-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--graph); background: var(--white); border: 1px solid var(--glass-stroke); padding: 4px 10px; border-radius: 100px; }
.duty-chip[data-me] { border-color: rgba(46,107,84,.45); color: #2E6B54; }
.duty-dot { width: 7px; height: 7px; border-radius: 50%; background: #2E6B54; flex: none; }
/* Gate-Screen */
.duty-gate { display: flex; justify-content: center; padding: 22px 0; }
.duty-gate-card { max-width: 480px; text-align: center; padding: 38px 34px; }
.duty-gate-icon { width: 64px; height: 64px; border-radius: 18px; background: rgba(24,95,165,.10); color: #185FA5; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.duty-gate-icon svg { width: 32px; height: 32px; }
.duty-gate-title { font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.duty-gate-sub { font-size: 15px; color: var(--graph); line-height: 1.6; margin-bottom: 18px; }
.duty-people { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 22px; }
.duty-gate-form { margin-bottom: 18px; }
.duty-gate-hint { font-size: 12.5px; color: var(--stone); line-height: 1.55; }

/* ── Tabelle ───────────────────────────────────────────────────────────── */
.panel-flush { padding: 0; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--stone); padding: 14px 18px; border-bottom: 1px solid var(--glass-stroke); }
.data-table td { padding: 14px 18px; border-bottom: 1px solid var(--glass-stroke); color: var(--graph); }
.data-table tr:last-child td { border-bottom: none; }
.row-link { cursor: pointer; transition: background .12s; }
.row-link:hover { background: rgba(44,44,42,.035); }
.cell-strong { font-weight: 600; color: var(--ink); }
.cell-muted { color: var(--stone); }
.cell-empty { text-align: center; color: var(--stone); padding: 30px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--graph); }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 100px; }
.badge-ok    { background: rgba(61,122,101,.12); color: var(--ok); }
.badge-warn  { background: rgba(182,137,47,.16); color: var(--warn); }
.badge-muted { background: rgba(136,135,128,.16); color: var(--stone); }
.badge-err { background: rgba(180,69,60,.12); color: var(--err); }

/* ── Formulare / Cards ─────────────────────────────────────────────────── */
.form-card { background: var(--white); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--glass-shadow); padding: 18px 20px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 200px; }
.field-narrow { max-width: 280px; }
.field select { font-family: var(--font); font-size: 14px; color: var(--ink); padding: 9px 12px; border-radius: 8px; border: 1px solid var(--stone2); background: var(--white); }
.field select:focus { outline: none; border-color: var(--ib3); box-shadow: 0 0 0 3px rgba(55,138,221,0.15); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 4px; }

.card-title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 14px; }
.card-subtitle { font-size: 14px; font-weight: 600; color: var(--graph); margin-bottom: 10px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--glass-stroke); font-size: 14px; }
.kv span:first-child { color: var(--stone); }
.divider { border: none; border-top: 1px solid var(--glass-stroke); margin: 16px 0; }
.action-row { display: flex; gap: 10px; align-items: center; }
.action-row input { flex: 1; font-family: var(--font); font-size: 14px; color: var(--ink); padding: 9px 12px; border-radius: 8px; border: 1px solid var(--stone2); background: var(--white); }
.action-row input:focus { outline: none; border-color: var(--ib3); box-shadow: 0 0 0 3px rgba(55,138,221,0.15); }

.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }

/* ── Button-Varianten ──────────────────────────────────────────────────── */
.btn-secondary { background: var(--white); color: var(--ink); border-color: var(--stone2); }
.btn-secondary:hover { background: var(--hover); border-color: var(--sand); }
.btn-ghost { background: none; color: var(--graph); padding: 8px 12px; }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { background: rgba(192,57,43,0.08); color: var(--err); border-color: rgba(192,57,43,0.22); }
.btn-danger:hover { background: rgba(192,57,43,0.14); }

/* ── Admin-Bereich ─────────────────────────────────────────────────────── */
.panel-accent { border-left: 3px solid var(--ib2); }
.app-nav-admin { color: var(--ib1); }
.app-nav-admin svg { opacity: 1; color: var(--ib2); }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 22px; }
.link-card {
  display: block; background: var(--white);
  border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow); padding: 18px;
  transition: border-color .15s, box-shadow .15s;
}
a.link-card:hover { border-color: var(--ib4); box-shadow: var(--glass-shadow-lg); }
.link-card-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--ib6); color: var(--ib2);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.link-card-icon svg { width: 22px; height: 22px; }
.link-card h3 { font-size: 15.5px; font-weight: 700; color: var(--ink); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-card p { font-size: 13px; color: var(--graph); line-height: 1.5; }
.link-card-go { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--ib2); }
.link-card.is-soon { opacity: .72; }
.link-card.is-soon .link-card-icon { background: rgba(136,135,128,.14); color: var(--stone); }

/* ── 2FA ───────────────────────────────────────────────────────────────── */
.qr-box { display: flex; justify-content: center; padding: 14px; background: #fff; border: 1px solid var(--glass-stroke); border-radius: 14px; margin: 10px 0; width: -moz-fit-content; width: fit-content; }
.code-key { font-size: 15px; letter-spacing: 1px; background: rgba(44,44,42,.05); padding: 10px 12px; border-radius: 10px; user-select: all; word-break: break-all; }
.recovery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.code-chip { background: rgba(44,44,42,.05); border: 1px solid var(--glass-stroke); border-radius: 8px; padding: 8px 10px; text-align: center; font-size: 13.5px; }

/* ── Chips / Checkboxen / Sub-Zeile ───────────────────────────────────── */
.chip { display: inline-block; font-size: 12px; font-weight: 600; color: var(--ib1); background: var(--ib6); border: 1px solid var(--ib5); padding: 3px 9px; border-radius: 100px; margin: 0 4px 2px 0; }
.cell-sub { display: block; font-size: 12px; color: var(--stone); font-weight: 400; }
.check-row { display: flex; flex-wrap: wrap; gap: 16px; padding: 8px 0 2px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--graph); cursor: pointer; }
.check input { width: 16px; height: 16px; }
.type-row { padding: 12px 0; border-bottom: 1px solid var(--glass-stroke); }
.type-row:last-child { border-bottom: none; }
.type-key { min-width: 130px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px 16px; padding: 4px 0; }
.perm-group { margin-bottom: 16px; }
.perm-key { font-size: 11px; }

/* ── Rechte-Zuweisung (Mitarbeiter): saubere, gleichmäßige Liste ───────── */
.detail-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.perm-form { max-width: 100%; }
.perm-section { margin: 0 0 18px; }
.perm-area { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--stone); margin: 0 0 8px; }
.perm-list { display: flex; flex-direction: column; border: 1px solid var(--glass-stroke); border-radius: 14px; overflow: hidden; background: rgba(255,255,255,0.45); }
.perm-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--glass-stroke); cursor: pointer; }
.perm-item:first-child { border-top: none; }
label.perm-item:hover { background: rgba(44,44,42,0.025); }
.perm-item input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; cursor: pointer; }
.perm-item input:disabled { cursor: default; }
.perm-check-icon { flex: none; width: 18px; height: 18px; border-radius: 5px; background: var(--ib2); color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.perm-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.perm-name { font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.perm-desc { font-size: 12.5px; color: var(--graph); line-height: 1.4; }
.perm-tag { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--stone); background: rgba(136,135,128,.16); padding: 2px 7px; border-radius: 100px; }
.perm-item-static { cursor: default; }

/* ── Erscheinungsbild: Akzent-Themes (remappen die --ib*-Tokens) ── */
/* Akzentfarben — theme-indigo entspricht den Standardwerten (:root) */
.theme-indigo { --ib1:#042C53; --ib2:#185FA5; --ib3:#378ADD; --ib4:#85B7EB; --ib5:#B5D4F4; --ib6:#E6F1FB; }
.theme-gruen { --ib1:#2F6552; --ib2:#3D7A65; --ib3:#5BAE93; --ib4:#8FD9BE; --ib5:#BFE6D6; --ib6:#E8F6F0; }
.theme-teal  { --ib1:#085041; --ib2:#0F6E56; --ib3:#1D9E75; --ib4:#5DCAA5; --ib5:#9FE1CB; --ib6:#E1F5EE; }

.settings-card { max-width: 560px; }
.accent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0 18px; }
.accent-option { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1.5px solid var(--glass-stroke); border-radius: 16px; cursor: pointer; background: rgba(255,255,255,0.55); transition: border-color .15s, box-shadow .15s, transform .1s; }
.accent-option:hover { transform: translateY(-1px); border-color: var(--ib4); }
.accent-option.selected { border-color: var(--ib3); box-shadow: 0 0 0 3px var(--ib6); }
.accent-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.accent-swatch { height: 42px; border-radius: 10px; background: linear-gradient(135deg, var(--ib3), var(--ib1)); }
.accent-name { font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.accent-option.selected .accent-name::after { content: '✓'; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ib2); color: #fff; font-size: 11px; }

/* ── Kundenportal (eigener Bereich) ───────────────────────────────────── */
.portal { min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; }
.portal-bar {
  position: sticky; top: 14px; z-index: 50;
  width: calc(100% - 32px); max-width: 1120px; margin: 14px auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px 12px 22px;
  background: var(--glass-bg); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: var(--r-pill);
  box-shadow: var(--glass-shadow); transition: background .3s, box-shadow .3s;
}
.portal-bar.scrolled { background: var(--glass-bg-strong); box-shadow: var(--glass-shadow-lg); }
.portal-bar-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.portal-bar .app-brand { flex: 0 0 auto; padding: 0; }

/* Kundennummer-Markierung */
.kdnr-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); background: var(--ib6); border: 1px solid var(--ib5); color: var(--ib1); font-size: 13px; line-height: 1; white-space: nowrap; }
.kdnr-label { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ib2); opacity: .85; }
.kdnr-badge .mono { font-weight: 700; letter-spacing: .02em; }

/* Avatar-/Konto-Menü (Portal-Header) */
.user-menu { position: relative; flex: 0 0 auto; }
.user-menu-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; cursor: pointer; padding: 3px 4px 3px 3px; border-radius: var(--r-pill); transition: background .15s; }
.user-menu-btn:hover { background: rgba(44,44,42,0.05); }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ib2); color: #fff; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.user-menu-caret { width: 16px; height: 16px; color: var(--stone); transition: transform .15s; }
.user-menu-btn[aria-expanded="true"] .user-menu-caret { transform: rotate(180deg); }
.user-menu-panel { position: absolute; top: calc(100% + 10px); right: 0; min-width: 232px; z-index: 60; display: flex; flex-direction: column; gap: 3px; padding: 10px; background: var(--glass-bg-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--glass-shadow-lg); }
.user-menu-panel[hidden] { display: none; }
.user-menu-head { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 8px 10px 12px; border-bottom: 1px solid var(--glass-stroke); margin-bottom: 5px; }
.user-menu-name { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.user-menu-item { display: block; width: 100%; text-align: left; font-family: var(--font); font-size: 14px; color: var(--graph); background: none; border: none; cursor: pointer; padding: 9px 10px; border-radius: 10px; transition: background .15s, color .15s; }
.user-menu-item:hover { background: rgba(44,44,42,0.05); color: var(--ink); }
.user-menu-logout { color: var(--err); font-weight: 600; }
.user-menu-logout:hover { background: rgba(180,69,60,0.08); }
.portal-main { width: 100%; max-width: 940px; margin: 0 auto; padding: 30px 24px 60px; display: flex; flex-direction: column; gap: 16px; }
.portal-nav { display: flex; gap: 4px; flex: 1 1 auto; min-width: 0; justify-content: center; overflow-x: auto; scrollbar-width: none; }
.portal-nav::-webkit-scrollbar { display: none; }
.portal-nav a { font-size: 14px; font-weight: 500; color: var(--graph); padding: 8px 14px; border-radius: 100px; white-space: nowrap; transition: background .15s, color .15s; }
.portal-nav a:hover { background: rgba(44,44,42,.05); color: var(--ink); }
.portal-nav a.active { background: var(--ib6); color: var(--ib1); font-weight: 600; }

/* Portal-Startseite */
.portal-hero { margin-bottom: 6px; }
.portal-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.portal-card { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--glass-bg); border: 1px solid var(--glass-stroke); border-radius: 18px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.portal-card:hover { box-shadow: var(--glass-shadow-lg); border-color: var(--ib4); }
.portal-card-icon { flex: none; width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: var(--ib6); color: var(--ib2); }
.portal-card-icon svg { width: 24px; height: 24px; }
.portal-card-body { flex: 1 1 auto; }
.portal-card-body h3 { font-size: 15.5px; font-weight: 700; color: var(--ink); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.portal-card-body p { font-size: 13px; color: var(--graph); line-height: 1.45; }
.portal-card-go { flex: none; color: var(--ib3); font-size: 20px; font-weight: 600; }
.portal-section-title { font-size: 14px; font-weight: 700; color: var(--stone); text-transform: uppercase; letter-spacing: .04em; margin-top: 18px; }
.portal-products { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Portal-Übersicht (lebendige Startseite) ───────────────────────────── */
/* Smart-Status-Zeile */
.status-line { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 15px; color: var(--graph); }
.status-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; box-shadow: 0 0 0 4px rgba(0,0,0,0.04); }
.status-ok .status-dot { background: var(--ok); }
.status-info .status-dot { background: var(--ib3); }
.status-warn .status-dot { background: var(--warn); }

/* „Aktuell für dich" — Status + Aufgaben in einer Karte */
.focus-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.focus-head-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.focus-head .card-title { margin-bottom: 0; }
.focus-status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--graph); }

/* Abschnitts-Abstände statt Trennstrichen */
.subtitle-spaced { margin-top: 24px; }
.card-section { margin-top: 18px; }

/* Abo & Zahlungen */
.pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.pay-fact { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: rgba(255,255,255,0.5); border: 1px solid var(--glass-stroke); border-radius: 12px; }
.pay-label { font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--stone); }
.pay-value { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -.3px; }
.pay-value.pay-open { color: var(--warn); }
.pay-sub { font-size: 11.5px; color: var(--stone); }
.pay-latest { padding: 12px 14px; background: var(--ib6); border: 1px solid var(--ib5); border-radius: 12px; margin-bottom: 14px; }
.pay-latest-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 7px; }
.pay-latest-amount { font-weight: 700; color: var(--ink); }
.pay-empty { font-size: 13px; color: var(--stone); margin-top: 4px; }
.pay-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Handlungsbedarf */
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--glass-stroke); border-left: 3px solid var(--ib3); border-radius: 12px; background: rgba(255,255,255,0.5); }
.todo-item .todo-text { flex: 1 1 auto; min-width: 0; font-size: 14px; color: var(--ink); }
.todo-item .btn { flex: none; }
.todo-icon { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ib3); }
.todo-err { border-left-color: var(--err); } .todo-err .todo-icon { background: var(--err); }
.todo-warn { border-left-color: var(--warn); } .todo-warn .todo-icon { background: var(--warn); }
.todo-info { border-left-color: var(--ib3); } .todo-info .todo-icon { background: var(--ib3); }
.todo-empty { display: flex; align-items: center; gap: 11px; font-size: 14.5px; color: var(--ok); font-weight: 500; }
.todo-empty-check { width: 28px; height: 28px; border-radius: 50%; background: rgba(61,122,101,0.14); color: var(--ok); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.todo-level { flex: none; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 3px 9px; border-radius: 100px; }
.todo-level-err { background: rgba(180,69,60,0.12); color: var(--err); }
.todo-level-warn { background: rgba(182,137,47,0.16); color: var(--warn); }
.todo-level-info { background: var(--ib6); color: var(--ib2); }

/* Farblegende */
.todo-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--glass-stroke); font-size: 12.5px; color: var(--stone); }
.legend-title { font-weight: 600; color: var(--graph); }
.legend-entry { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot-err { background: var(--err); } .dot-warn { background: var(--warn); } .dot-info { background: var(--ib3); } .dot-ok { background: var(--ok); }

a.stat-link { transition: transform .15s, box-shadow .15s, border-color .15s; }
a.stat-link:hover { transform: translateY(-2px); box-shadow: var(--glass-shadow-lg); border-color: var(--ib4); }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.quick-action { display: flex; align-items: center; gap: 11px; padding: 14px 16px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--glass-shadow); font-size: 14px; font-weight: 600; color: var(--ink); transition: transform .15s, box-shadow .15s, border-color .15s; }
.quick-action:hover { box-shadow: var(--glass-shadow-lg); border-color: var(--ib4); }
.quick-action svg { width: 22px; height: 22px; color: var(--ib2); flex: none; }
.portal-overview-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: stretch; }
.overview-main, .overview-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.account-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
/* Jeweils letzte Karte je Spalte füllt die Resthöhe → beide Spalten enden bündig */
.overview-side .contact-card,
.overview-main > .form-card:last-child { flex: 1 1 auto; }
.contact-foot { margin-top: auto; padding-top: 14px; font-size: 13px; color: var(--stone); line-height: 1.5; }
.card-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head-row .card-title { margin-bottom: 0; }
.contact-name { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.contact-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 7px 0; border-bottom: 1px solid var(--glass-stroke); }
.contact-row:last-child { border-bottom: none; }
.contact-row > span:first-child { color: var(--stone); }
.mini-ticket { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--glass-stroke); border-radius: 12px; background: rgba(255,255,255,0.5); transition: border-color .15s; }
.mini-ticket:hover { border-color: var(--ib4); }
.mini-ticket-main { min-width: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Support-Kasten: gleichmäßige Abstände in beiden Zuständen */
.support-body { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.support-body .btn { align-self: flex-start; }
.support-meta { font-size: 13px; color: var(--stone); margin: 0; }

/* ── Ticket-Liste (Kundenportal) ───────────────────────────────────────── */
.support-strip { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.support-strip-icon { flex: none; width: 46px; height: 46px; border-radius: 13px; background: var(--ib6); color: var(--ib2); display: flex; align-items: center; justify-content: center; }
.support-strip-icon svg { width: 24px; height: 24px; }
.support-strip-text { flex: 1 1 240px; min-width: 0; }
.support-strip-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.support-strip-sub { font-size: 13px; color: var(--graph); line-height: 1.5; }
.support-strip-meta { display: flex; flex-direction: column; gap: 2px; text-align: right; font-size: 13px; }

.ticket-stats { display: flex; gap: 20px; flex-wrap: wrap; padding: 2px 4px; }
.ticket-stat { font-size: 13.5px; color: var(--stone); }
.ticket-stat strong { font-size: 16px; color: var(--ink); margin-right: 3px; }

/* ── Ticket-Filter (Pills statt Dropdown) ─────────────────────────────────── */
.ticket-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 16px; }
.ticket-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.tfilter { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: var(--r-pill); border: 1px solid var(--stone2); background: var(--white); color: var(--graph); font-size: 13px; font-weight: 600; line-height: 1; transition: border-color .15s, background .15s, color .15s; }
.tfilter:hover { border-color: var(--ib4); background: var(--ib6); color: var(--ib1); }
.tfilter.is-active { background: var(--ib1); border-color: var(--ib1); color: #fff; }
.tfilter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 100px; background: rgba(44,44,42,0.10); color: inherit; font-size: 11.5px; font-weight: 700; }
.tfilter.is-active .tfilter-count { background: rgba(255,255,255,0.25); }
.tfilter-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex: none; }
.tfilter-prio.is-active .tfilter-dot { background: #fff; }
.tfilter-archive { color: var(--stone); }
/* Bearbeiter-Spalte */
.cell-free { color: var(--stone); font-style: italic; font-size: 13px; }
.assignee-mine { color: var(--ib2); }

.ticket-cards { display: flex; flex-direction: column; gap: 10px; }
.ticket-card { display: flex; align-items: center; gap: 14px; padding: 15px 18px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--glass-shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.ticket-card:hover { box-shadow: var(--glass-shadow-lg); border-color: var(--ib4); }
.ticket-card-status { flex: none; }
.ticket-card-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ticket-card-subject { font-size: 15px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-card-meta { font-size: 12.5px; color: var(--stone); }
.ticket-card-go { flex: none; color: var(--ib3); font-size: 18px; font-weight: 600; }

/* ── Leerer Zustand (generisch) ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-state-icon { width: 60px; height: 60px; border-radius: 16px; background: var(--ib6); color: var(--ib2); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.empty-state-icon svg { width: 30px; height: 30px; }
.empty-state-title { font-size: 18px; font-weight: 700; color: var(--ink); }
.empty-state-text { font-size: 14px; color: var(--graph); line-height: 1.6; max-width: 440px; margin-bottom: 6px; }
.empty-state-sm { padding: 22px; }
.empty-state-sm .empty-state-text { margin-bottom: 0; }

/* Produkt-Vorschaukarten (fiktive Integration, Stufe A) */
.product-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.product-int-card { border: 1px solid var(--glass-stroke); border-radius: var(--r-lg); padding: 18px; background: rgba(255,255,255,0.5); display: flex; flex-direction: column; gap: 14px; }
.product-int-head { display: flex; align-items: center; gap: 12px; }
.product-int-head .product-logo { border-radius: 7px; flex: none; }
.product-int-id { display: flex; flex-direction: column; min-width: 0; }
.product-int-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.product-int-tag { font-size: 12.5px; color: var(--stone); }
.product-int-status { margin-left: auto; flex: none; }
.product-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.product-metric { background: var(--glass-bg); border: 1px solid var(--glass-stroke); border-radius: 12px; padding: 10px 6px; text-align: center; }
.pm-value { display: block; font-size: 16px; font-weight: 700; color: var(--ib1); letter-spacing: -.3px; }
.pm-label { display: block; font-size: 11px; color: var(--stone); margin-top: 3px; line-height: 1.3; }
.product-int-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { transform: none; box-shadow: none; background: var(--ib1); }
@media (max-width: 420px) { .product-metrics { grid-template-columns: 1fr 1fr; } }

.product-pill { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--glass-bg); border: 1px solid var(--glass-stroke); padding: 8px 14px 8px 10px; border-radius: 100px; }
.product-pill-name { margin-right: 2px; }

/* Produkt-Logos (occuply / anamly) — überall einheitlich */
.product-logo { display: inline-block; vertical-align: middle; flex: none; border-radius: 5px; }
.product-inline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.product-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); background: rgba(255,255,255,0.6); border: 1px solid var(--glass-stroke); padding: 3px 10px 3px 6px; border-radius: 100px; font-size: 13px; }
.product-tag img { border-radius: 4px; }
.chip-product { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 6px; }
.chip-product img { border-radius: 3px; }
.check-product { gap: 8px; }
.check-product .product-logo { border-radius: 4px; }

/* ── Chat-Panel (Ticket-Verlauf wie ein Messenger) ─────────────────────── */
.ticket-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ticket-meta { display: flex; align-items: center; gap: 12px; }

.chat-panel {
  position: relative;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  border-radius: 16px; box-shadow: var(--glass-shadow);
  height: calc(100vh - 220px); min-height: 440px; max-height: 760px;
}
.chat-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--glass-stroke);
  background: var(--subtle);
}
.chat-panel-head .chat-title { font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.chat-panel-head .chat-sub { font-size: 12.5px; color: var(--stone); margin-top: 2px; }

/* Nachrichtenbereich */
.thread.chat {
  flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  padding: 22px 20px; scroll-behavior: smooth;
  background:
    radial-gradient(circle at 18% 0%, rgba(55,138,221,0.05), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(55,138,221,0.04), transparent 55%);
}
.thread.chat::-webkit-scrollbar { width: 10px; }
.thread.chat::-webkit-scrollbar-thumb { background: rgba(44,44,42,0.16); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }

/* Eine Nachricht = Avatar + Sprechblase */
/* Einheitliche Breite für ALLE Sprechblasen (gleich groß, egal wie lang der Text) */
.msg { display: flex; align-items: flex-end; gap: 9px; width: 78%; max-width: 78%; }
.msg-staff { align-self: flex-start; }
.msg-mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble { flex: 1 1 auto; min-width: 0; }
.msg-avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; background: var(--ib2);
  box-shadow: 0 2px 6px rgba(12,68,124,0.25);
}
.msg-bubble { padding: 11px 15px; border-radius: 16px; border: 1px solid var(--glass-stroke); background: #fff; box-shadow: 0 2px 10px rgba(44,44,42,0.05); }
.msg-staff .msg-bubble { border-bottom-left-radius: 5px; }
.msg-mine .msg-bubble { border-bottom-right-radius: 5px; background: var(--ib2); border-color: var(--ib2); }
.msg-mine .msg-author, .msg-mine .msg-time { color: rgba(255,255,255,0.82); }
.msg-mine .msg-body { color: #fff; }
.msg-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 3px; }
.msg-author { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.msg-time { font-size: 11px; color: var(--stone); }
.msg-body { font-size: 14px; color: var(--graph); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* Tipp-Anzeige */
.typing { display: flex; align-items: center; gap: 5px; padding: 4px 22px 10px; min-height: 14px; }
.typing[hidden] { display: none; }
.typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ib3); animation: typingblink 1.2s infinite ease-in-out; }
.typing-dot:nth-child(2) { animation-delay: .18s; }
.typing-dot:nth-child(3) { animation-delay: .36s; }
.typing-text { font-size: 12px; color: var(--stone); margin-left: 6px; }
@keyframes typingblink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: .9; transform: translateY(-2px); } }

/* Eingabeleiste (angedockt) */
.chat-compose { display: flex; gap: 10px; align-items: flex-end; padding: 12px 18px; border-top: 1px solid var(--glass-stroke); background: var(--subtle); }
.chat-compose textarea { flex: 1 1 auto; resize: none; min-height: 44px; max-height: 140px; font-family: var(--font); font-size: 14.5px; color: var(--ink); line-height: 1.45; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--stone2); background: var(--white); transition: border-color .15s, box-shadow .15s; }
.chat-compose textarea:focus { outline: none; border-color: var(--ib3); box-shadow: 0 0 0 3px var(--ib6); }
.chat-compose .btn { flex: none; align-self: stretch; }
/* Werkzeug-Button (Textbausteine) in der Eingabeleiste */
.compose-tool { flex: none; align-self: stretch; width: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--stone2); background: var(--white); color: var(--graph); border-radius: 12px; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.compose-tool:hover { border-color: var(--ib4); color: var(--ib2); background: var(--ib6); }
.compose-tool svg { width: 21px; height: 21px; }
.chat-closed { padding: 12px 18px; border-top: 1px solid var(--glass-stroke); background: var(--subtle); font-size: 13.5px; color: var(--stone); text-align: center; }

/* Textbaustein-Popover (über der Eingabeleiste, schwebend über dem Verlauf) */
.canned-pop { position: absolute; left: 14px; right: 14px; bottom: 76px; z-index: 30; max-height: 56%; display: flex; flex-direction: column; overflow: hidden;
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border); border-radius: 14px; box-shadow: var(--glass-shadow-lg); }
.canned-pop[hidden] { display: none; }
.canned-pop-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--glass-stroke); font-size: 13px; font-weight: 700; color: var(--ink); }
.canned-pop-head .inline-ic { opacity: .7; }
.canned-pop-close { border: none; background: none; font-size: 21px; line-height: 1; color: var(--stone); cursor: pointer; padding: 0 2px; }
.canned-pop-close:hover { color: var(--ink); }

/* ── Status-Buttons (Ticket) ───────────────────────────────────────────── */
.status-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.btn-status { font-family: var(--font); font-size: 13px; font-weight: 600; padding: 9px 13px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; transition: filter .15s, transform .1s, background .15s; }
.btn-status:hover { filter: brightness(0.97); }
.btn-status:active { transform: translateY(1px); }
.btn-status-open { color: var(--warn); border-color: rgba(182,137,47,0.40); background: rgba(182,137,47,0.12); }
.btn-status-open.is-active { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-status-progress { color: var(--ib2); border-color: var(--ib4); background: var(--ib6); }
.btn-status-progress.is-active { background: var(--ib2); border-color: var(--ib2); color: #fff; }
.btn-status-closed { color: var(--graph); border-color: var(--glass-stroke); background: rgba(136,135,128,0.12); }
.btn-status-closed.is-active { background: var(--graph); border-color: var(--graph); color: #fff; }

/* Rechte Spalte im Ticket (nur noch Status/Aktionen — kompakt, füllt die Chat-Höhe) */
.ticket-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; min-height: 0; overflow-y: auto; }
.ticket-side .btn-block { margin-top: 14px; }
/* Textbaustein-Liste (im Popover) — scrollt innerhalb des Popovers */
.canned-list { display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow-y: auto; padding: 8px; }
/* Nachricht löschen */
.msg-del { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 16px; line-height: 1; color: var(--stone); padding: 0 2px; opacity: .5; transition: opacity .15s, color .15s; }
.msg-del:hover { opacity: 1; color: var(--err); }
.msg-mine .msg-del { color: rgba(255,255,255,0.8); }
.msg-mine .msg-del:hover { color: #fff; }

/* System-Nachrichten (zentriert, dezent) */
.msg-system { align-self: center; max-width: 90%; text-align: center; margin: 4px auto; padding: 6px 14px; border-radius: 100px; background: var(--ib6); border: 1px solid var(--ib5); color: var(--ib1); font-size: 12.5px; line-height: 1.4; }
.msg-system-text { font-weight: 600; }
.msg-system-time { display: block; font-size: 10.5px; color: var(--ib2); opacity: .75; margin-top: 1px; }

/* Ticket-ID Badge (hervorgehoben in der Status-Box) */
.ticket-id-badge { display: inline-flex; align-items: center; font-family: var(--font-mono, ui-monospace, monospace); font-size: 12.5px; font-weight: 700; letter-spacing: .03em; color: var(--ib1); background: var(--ib6); border: 1px solid var(--ib5); padding: 4px 10px; border-radius: var(--r-pill); line-height: 1; }

/* Claim / Übernehmen */
.claim-form { margin-bottom: 12px; }
.kv-assignee { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--glass-stroke); }

/* Bewertung (Kunde) */
.rating-form { padding: 16px; margin: 4px 0; border: 1px solid var(--ib5); border-radius: var(--r-card, 14px); background: var(--ib6); text-align: center; }
.rating-q { font-weight: 600; color: var(--ib1); margin: 0 0 8px; }
.rating-stars { display: inline-flex; gap: 4px; direction: rtl; }
.rating-star { background: none; border: none; cursor: pointer; font-size: 30px; line-height: 1; color: var(--ib5); padding: 0 2px; transition: color .12s, transform .12s; }
.rating-star:hover, .rating-star:hover ~ .rating-star, .rating-star:focus-visible { color: #E0A82E; transform: scale(1.1); }
.rating-done { text-align: center; padding: 12px; color: var(--ib1); font-weight: 600; }
.rating-given { font-size: 16px; letter-spacing: 1px; }
.star-on { color: #E0A82E; }
.star-off { color: var(--ib5); }
.stat-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; padding: 2px 9px; border-radius: var(--r-pill); background: var(--ib6); border: 1px solid var(--ib5); color: var(--ib1); font-weight: 700; font-size: 13px; }

/* Nur-Lesen-Hinweis im Chat (Mitarbeiter ohne Schreibrecht) */
.chat-readonly { display: flex; align-items: flex-start; gap: 9px; margin: 12px 18px 16px; padding: 11px 14px; border-radius: 12px; background: var(--ib6); border: 1px solid var(--ib5); color: var(--ib1); font-size: 13px; line-height: 1.45; }
/* „tippt gerade" (Staff-Ansicht) */
.chat-typing { display: flex; align-items: center; gap: 9px; margin: 0 18px 8px; padding: 4px 0; font-size: 12.5px; color: var(--stone); }
.chat-typing .ct-dots { display: inline-flex; gap: 4px; }
.chat-typing .ct-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--stone); animation: ctTyping 1.2s ease-in-out infinite; }
.chat-typing .ct-dots i:nth-child(2) { animation-delay: .15s; }
.chat-typing .ct-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ctTyping { 0%,100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-4px); opacity: 1; } }
.inline-ic { width: 18px; height: 18px; flex: none; margin-top: 1px; opacity: .8; }
/* Icon vor einer Überschrift (z. B. „Geschützter Admin-Bereich") */
.title-ic { width: 20px; height: 20px; vertical-align: -3px; margin-right: 8px; opacity: .85; }

/* Wer bearbeitet das Ticket? */
.assignee-box { padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--ib6); border: 1px solid var(--ib5); }
.assignee-label { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ib2); margin-bottom: 4px; }
.assignee-name { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; color: var(--ib1); }
.assignee-none { color: var(--stone); font-weight: 600; }
.assignee-you { font-weight: 600; color: var(--ib2); }
.assignee-dot { width: 9px; height: 9px; border-radius: 50%; background: #2FA36B; box-shadow: 0 0 0 3px rgba(47,163,107,.18); }
.assignee-dot.dot-open { background: var(--warn); box-shadow: 0 0 0 3px rgba(182,137,47,.18); }
.collab-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--ib5); }
.collab-label { font-size: 12px; color: var(--stone); margin-right: 2px; }
.collab-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ib1); background: #fff; border: 1px solid var(--ib5); padding: 3px 4px 3px 10px; border-radius: var(--r-pill); }
.collab-remove { display: inline; margin: 0; }
.collab-remove button { background: none; border: none; cursor: pointer; color: var(--stone); font-size: 15px; line-height: 1; padding: 0 4px; border-radius: 50%; }
.collab-remove button:hover { color: var(--err); }

/* Kolleg:in einladen */
.invite-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--glass-stroke); }
.invite-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.invite-row { display: flex; gap: 8px; }
.invite-row select { flex: 1 1 auto; min-width: 0; }

/* Support-Leistung (Mitarbeiter-Detail) */
.perf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.perf-fact { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 12px; background: var(--ib6); border: 1px solid var(--ib5); }
.perf-value { font-size: 26px; font-weight: 800; color: var(--ib1); line-height: 1.1; }
.perf-unit { font-size: 14px; font-weight: 600; color: var(--ib2); }
.perf-label { font-size: 12.5px; font-weight: 600; color: var(--graph); }
.perf-sub { font-size: 11.5px; color: var(--stone); margin-top: 2px; }
.perf-fact .rating-given { font-size: 15px; letter-spacing: 1px; margin-top: 2px; }
@media (max-width: 480px) { .perf-grid { grid-template-columns: 1fr; } }
.canned-item { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; cursor: pointer; padding: 9px 11px; border: 1px solid var(--glass-stroke); border-radius: 10px; background: transparent; font-family: var(--font); transition: border-color .15s, background .15s; }
.canned-item:hover { border-color: var(--ib4); background: var(--ib6); }
.canned-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.canned-preview { font-size: 11.5px; color: var(--stone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Modal / Popup (Overlay) ───────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(20,20,19,0.48); animation: modalFade .15s ease-out; }
.modal-overlay[hidden] { display: none; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.modal-card { width: 100%; max-width: 480px; max-height: 86vh; overflow-y: auto; display: flex; flex-direction: column; color: var(--ink); background: #FBFAF6; border: 1px solid var(--glass-stroke); border-radius: 20px; box-shadow: 0 30px 90px rgba(44,44,42,0.30); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--glass-stroke); }
.modal-sub { font-size: 12.5px; color: var(--stone); margin-top: 2px; }
.modal-body { padding: 8px 22px 16px; display: flex; flex-direction: column; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--glass-stroke); }
.modal-x { background: none; border: none; font-size: 26px; line-height: 1; color: var(--stone); cursor: pointer; padding: 0 2px; }
.modal-x:hover { color: var(--ink); }

/* Benachrichtigungen: Glocke + Liste */
.notif-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; color: var(--graph); transition: background .15s, color .15s; }
.notif-bell:hover { background: rgba(44,44,42,0.06); color: var(--ink); }
.notif-bell svg { width: 22px; height: 22px; }
.notif-badge { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--err); color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }
.notif-badge[hidden] { display: none; }
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; background: var(--glass-bg); border: 1px solid var(--glass-stroke); border-radius: 14px; transition: border-color .15s, transform .1s; }
a.notif-item:hover { transform: translateY(-1px); border-color: var(--ib4); }
.notif-unread { background: var(--glass-bg-strong); border-color: var(--ib5); }
.notif-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--glass-stroke); }
.notif-unread .notif-dot { background: var(--ib3); }
.notif-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-title { font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.notif-body { font-size: 13px; color: var(--graph); }
.notif-time { flex: none; font-size: 12px; color: var(--stone); }
/* Zeile mit Löschen-Button */
.notif-row { display: flex; align-items: stretch; gap: 6px; }
.notif-row .notif-item { flex: 1 1 auto; }
.notif-del { flex: none; width: 34px; border: 1px solid var(--glass-stroke); border-radius: 12px; background: var(--glass-bg); color: var(--stone); font-size: 18px; line-height: 1; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.notif-del:hover { color: var(--err); border-color: var(--err); background: rgba(193,74,74,0.06); }

/* Kategorie-Badges (Neuigkeiten) */
.news-cat { font-size: 11px; font-weight: 700; }
.cat-info { background: var(--ib6); color: var(--ib2); }
.cat-update { background: rgba(47,138,107,.14); color: #2F7A5E; }
.cat-maintenance { background: rgba(182,137,47,.16); color: var(--warn); }
.cat-announcement { background: rgba(99,80,200,.14); color: #5b46c8; }
/* Relevanz-Tags */
.prio-tag { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 2px 8px; border-radius: 100px; }
.prio-high { background: rgba(193,74,74,.14); color: var(--err); }
.prio-normal { background: var(--ib6); color: var(--ib2); }
.prio-low { background: rgba(136,135,128,.14); color: var(--stone); }

/* Mitteilungen (Portal) */
.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-item { padding: 18px 20px; background: var(--glass-bg); border: 1px solid var(--glass-stroke); border-radius: 16px; }
.news-pinned { border-color: var(--ib4); background: var(--glass-bg-strong); }
.news-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 6px; }
.news-head h3 { font-size: 15.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-date { font-size: 12px; color: var(--stone); flex: none; }
.news-body { font-size: 14px; color: var(--graph); line-height: 1.55; white-space: pre-wrap; }

/* kleine Buttons in Tabellen-Aktionen */
.btn-sm { padding: 6px 11px; font-size: 13px; }
.cell-right { text-align: right; white-space: nowrap; }

/* ══ Support-Posteingang: neue Komponenten (Onepager) ══ */
/* Kanal-Streifen — schlanker Filter statt großem Karten-Grid */
.chan-strip { flex: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chan-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: var(--r-pill); border: 1px solid var(--glass-border); background: var(--white); color: var(--graph); font-size: 13px; font-weight: 600; line-height: 1; transition: border-color .15s, background .15s, color .15s; }
.chan-pill:hover { border-color: var(--ib4); background: var(--ib6); color: var(--ib1); }
.chan-pill.is-active { border-color: var(--ib1); background: var(--ib1); color: #fff; }
.chan-pill .chan-pill-ic { width: 16px; height: 16px; opacity: .9; }
.chan-pill svg.chan-pill-ic { fill: currentColor; }
.chan-pill-n { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 100px; background: rgba(44,44,42,.10); font-size: 11px; font-weight: 700; }
.chan-pill.is-active .chan-pill-n { background: rgba(255,255,255,.22); }
.chan-pill.is-demo:not(.is-active) { color: var(--stone); }

/* Werkzeugleiste: Lebenszyklus-Tabs links, Kategorie + Suche rechts */
.support-toolbar { gap: 10px 14px; }
.support-search { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.support-search input[type="search"] { width: 200px; max-width: 46vw; padding: 7px 12px; font-family: var(--font); font-size: 13.5px; color: var(--ink); border: 1px solid var(--stone2); border-radius: 9px; background: var(--white); transition: border-color .15s, box-shadow .15s; }
.support-search input[type="search"]:focus { outline: none; border-color: var(--ib3); box-shadow: 0 0 0 3px var(--ib6); }
.filter-select { font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--graph); padding: 7px 30px 7px 12px; border: 1px solid var(--stone2); border-radius: 9px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center; background-size: 13px; -webkit-appearance: none; appearance: none; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.filter-select:hover { border-color: var(--ib4); }
.filter-select:focus { outline: none; border-color: var(--ib3); box-shadow: 0 0 0 3px var(--ib6); }

/* Kategorie-Tags (im Posteingang & in den Detailseiten) */
.cat-tag { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 100px; line-height: 1.3; white-space: nowrap; }
.cat-allgemein { background: rgba(107,114,128,.14); color: #4B5563; }
.cat-technik { background: rgba(192,57,43,.12); color: var(--err); }
.cat-abrechnung { background: rgba(24,95,165,.12); color: var(--ib2); }
.cat-vertrieb { background: rgba(47,133,89,.13); color: var(--ok); }
.cat-none { background: transparent; color: var(--sand); font-weight: 500; }

/* Posteingang-Tabelle: Bearbeiter/Zeit kompakt */
.support-table td:first-child, .support-table th:first-child { white-space: nowrap; }

/* Detailseiten: Kategorie-Auswahl + Kopf-Tags */
.chat-head-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--stone); margin-bottom: 6px; }
.form-card > .filter-select, .form-card form > .filter-select { width: 100%; }

/* ══ Datenschutz / Compliance (DSGVO) ══ */
.ds-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ds-card { display: flex; flex-direction: column; gap: 8px; background: var(--white); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--glass-shadow); padding: 18px 20px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.ds-card:hover { box-shadow: var(--glass-shadow-lg); border-color: var(--ib4); transform: translateY(-2px); }
.ds-card-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--ib6); border: 1px solid var(--ib5); display: inline-flex; align-items: center; justify-content: center; color: var(--ib2); }
.ds-card-ic svg { width: 22px; height: 22px; fill: currentColor; }
.ds-card-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.ds-card-desc { font-size: 13px; color: var(--stone); line-height: 1.5; flex: 1; }
.ds-card-meta { font-size: 12px; font-weight: 600; color: var(--ib2); }
.ds-card-meta.is-warn { color: var(--warn); }
.vvt-card .kv { align-items: flex-start; }
.vvt-card .kv span:first-child { min-width: 168px; flex: none; }
.vvt-card .kv span:last-child { text-align: right; }
.vvt-toms { margin: 4px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--graph); line-height: 1.45; }
.ds-banner { flex: none; padding: 12px 16px; border-radius: var(--r-lg); font-size: 13.5px; font-weight: 600; line-height: 1.45; border: 1px solid; }
.ds-banner.is-err { background: rgba(192,57,43,.10); border-color: rgba(192,57,43,.30); color: var(--err); }
.ds-banner.is-warn { background: rgba(182,137,47,.12); border-color: rgba(182,137,47,.32); color: var(--warn); }
.ds-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ds-msgs { display: flex; flex-direction: column; gap: 5px; margin: 4px 0 10px; padding: 8px 12px; background: var(--subtle); border-radius: 10px; }
.ds-msg { font-size: 13px; color: var(--graph); line-height: 1.4; }
.ds-msg-role { display: inline-block; min-width: 64px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--stone); margin-right: 6px; }

/* ══ IndigoGuard (Sicherheit) ══ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.kpi-card { background: var(--white); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--glass-shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--stone); }
.kpi-value { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.kpi-value.is-warn { color: var(--warn); }
.kpi-value.is-err { color: var(--err); }
.guard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .guard-grid { grid-template-columns: 1fr; } }
/* Charts — serverseitiges SVG (CSP-sicher) */
.chart { margin-top: 8px; }
.chart-svg { width: 100%; height: 132px; display: block; }
.chart-svg .bar:hover { opacity: .8; }
.bar-ok { fill: #2F8559; }
.bar-err { fill: #C0392B; }
.bar-warn { fill: #B6892F; }
.chart-xaxis { display: flex; margin-top: 6px; }
.chart-xaxis span { flex: 1; text-align: center; font-size: 10px; color: var(--sand); white-space: nowrap; overflow: hidden; }
.chart-legend { display: inline-flex; gap: 12px; }
.lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--stone); }
.lg::before { content: ''; width: 10px; height: 10px; border-radius: 3px; }
.lg-ok::before { background: #2F8559; }
.lg-err::before { background: #C0392B; }
/* Horizontale Balken (Ereignis-Typen) */
.hbars { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.hbar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.hbar-label { flex: 0 0 180px; color: var(--graph); }
.hbar-track { flex: 1; height: 10px; background: var(--ib6); border-radius: 100px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--ib2); border-radius: 100px; }
.hbar-val { flex: 0 0 36px; text-align: right; font-weight: 700; color: var(--ink); }
@media (max-width: 560px) { .hbar-label { flex-basis: 110px; } }

/* ══ Sicherheits-Plattform (Risiko-Engine / API-Keys) ══ */
.kpi-link { text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.kpi-link:hover { border-color: var(--ib2); }
.kpi-value-sm { font-size: 15px; font-weight: 700; color: var(--ib2); }
.card-subtitle { font-size: 14px; font-weight: 700; color: var(--ink); margin: 4px 0 10px; }

/* ══ Kontrollzentrum: Lagebild (Score-Gauge, Sparklines, Heatmap) ══ */
.kpi-bump { animation: kpi-bump .5s ease; display: inline-block; }
@keyframes kpi-bump { 0% { transform: scale(1); } 30% { transform: scale(1.14); } 100% { transform: scale(1); } }
.live-blink::before { background: var(--ib2) !important; }
.live-dot { flex: none; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--ib2); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2F8559; box-shadow: 0 0 0 0 rgba(47,133,89,.5); animation: ic-pulse 2s ease-out infinite; }
@keyframes ic-pulse { 0% { box-shadow: 0 0 0 0 rgba(47,133,89,.45); } 70% { box-shadow: 0 0 0 7px rgba(47,133,89,0); } 100% { box-shadow: 0 0 0 0 rgba(47,133,89,0); } }

.guard-hero { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 14px; align-items: stretch; margin-bottom: 14px; }
@media (max-width: 900px) { .guard-hero { grid-template-columns: 1fr; } }

.score-card { display: flex; align-items: center; gap: 18px; }
.score-ring { flex: none; width: 124px; height: 124px; }
.score-ring svg { width: 100%; height: 100%; }
.ring-track { stroke: var(--ib6); }
.ring-prog { stroke: var(--ib2); transition: stroke-dasharray .6s ease; }
.score-good .ring-prog { stroke: #2F8559; }
.score-fair .ring-prog { stroke: var(--warn); }
.score-poor .ring-prog { stroke: var(--err); }
.ring-num { font-size: 30px; font-weight: 800; fill: var(--ink); }
.ring-unit { font-size: 10px; font-weight: 600; fill: var(--stone); }
.score-meta { min-width: 0; }
.score-level { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 10px; border-radius: 100px; }
.score-good .score-level { background: rgba(47,133,89,.14); color: #2F8559; }
.score-fair .score-level { background: rgba(182,137,47,.16); color: var(--warn); }
.score-poor .score-level { background: rgba(192,57,43,.14); color: var(--err); }
.score-title { font-size: 16px; font-weight: 800; color: var(--ink); margin: 6px 0 8px; }
.score-factors { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.score-factors li { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--graph); }
.score-f-delta { flex: none; font-weight: 800; color: var(--err); font-variant-numeric: tabular-nums; min-width: 30px; }
.score-f-label { min-width: 0; }

.kpi-grid-spark .kpi-card { position: relative; padding-bottom: 8px; }
.spark { width: 100%; height: 30px; margin-top: 6px; display: block; }
.spark-line { stroke-width: 2; }
.spark-area { opacity: .14; stroke: none; }
.spark-ok .spark-line { stroke: #2F8559; } .spark-ok .spark-area { fill: #2F8559; }
.spark-warn .spark-line { stroke: var(--warn); } .spark-warn .spark-area { fill: var(--warn); }
.spark-err .spark-line { stroke: var(--err); } .spark-err .spark-area { fill: var(--err); }

/* Tenant-Sicherheit: Geo-Lagebild + Karten mit Score-Ring */
.hbar-fill-warn { background: var(--warn); }
.tenant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tenant-card { display: flex; flex-direction: column; gap: 12px; }
.tenant-card-top { display: flex; gap: 14px; align-items: center; }
.tenant-ring { flex: none; width: 64px; height: 64px; }
.tenant-ring svg { width: 100%; height: 100%; }
.tenant-ring .ring-num { font-size: 18px; font-weight: 800; fill: var(--ink); }
.tenant-meta { min-width: 0; }
.tenant-name { font-size: 16px; font-weight: 800; color: var(--ink); margin: 0; }
.tenant-sub { font-size: 12px; color: var(--stone); margin: 1px 0 6px; }
.tenant-badges { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tenant-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-err  { color: var(--err);  background: rgba(192,57,43,.10); border-color: rgba(192,57,43,.22); }
.chip-warn { color: var(--warn); background: rgba(182,137,47,.12); border-color: rgba(182,137,47,.30); }
.chip-ok   { color: #2F8559;     background: rgba(47,133,89,.12);  border-color: rgba(47,133,89,.26); }
.chip-soft { color: var(--stone); background: var(--hover); border-color: var(--glass-stroke); }
.tenant-link { align-self: flex-start; margin-top: auto; }

/* Heatmap (Fehllogins Wochentag × Stunde) */
.heatmap { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.hm-hours { display: grid; grid-template-columns: 32px 1fr; }
.hm-hours span { grid-column: 2; }
.hm-hours { position: relative; height: 14px; font-size: 10px; color: var(--stone); }
.hm-hours span { position: absolute; }
.hm-hours span:nth-child(1) { left: 32px; } .hm-hours span:nth-child(2) { left: 28%; } .hm-hours span:nth-child(3) { left: 52%; } .hm-hours span:nth-child(4) { left: 76%; } .hm-hours span:nth-child(5) { right: 0; }
.hm-row { display: flex; align-items: center; gap: 8px; }
.hm-day { flex: 0 0 24px; font-size: 11px; font-weight: 700; color: var(--stone); }
.hm-cells { flex: 1; display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.hm { display: block; aspect-ratio: 1 / 1; border-radius: 3px; background: var(--ib6); }
.hm-legend { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--stone); }
.hm-legend .hm { width: 12px; height: 12px; }
.hm-0 { background: var(--ib6); }
.hm-1 { background: rgba(192,57,43,.22); }
.hm-2 { background: rgba(192,57,43,.42); }
.hm-3 { background: rgba(192,57,43,.66); }
.hm-4 { background: rgba(192,57,43,.92); }

/* hbar-Breiten (CSP-sicher, ohne Inline-Style) */
.hbar-w-0{width:0} .hbar-w-5{width:5%} .hbar-w-10{width:10%} .hbar-w-15{width:15%} .hbar-w-20{width:20%} .hbar-w-25{width:25%} .hbar-w-30{width:30%} .hbar-w-35{width:35%} .hbar-w-40{width:40%} .hbar-w-45{width:45%} .hbar-w-50{width:50%} .hbar-w-55{width:55%} .hbar-w-60{width:60%} .hbar-w-65{width:65%} .hbar-w-70{width:70%} .hbar-w-75{width:75%} .hbar-w-80{width:80%} .hbar-w-85{width:85%} .hbar-w-90{width:90%} .hbar-w-95{width:95%} .hbar-w-100{width:100%}
/* Notfall-/Lockdown-Modus */
.lockdown-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 2px; padding: 11px 18px; background: rgba(192,57,43,0.10); border-bottom: 1px solid rgba(192,57,43,0.25); color: var(--err); font-size: 14px; }
.lockdown-banner-ic { width: 20px; height: 20px; flex: none; }
.lockdown-banner-text { flex: 1 1 auto; }
.lockdown-banner-link { color: var(--err); font-weight: 700; text-decoration: underline; flex: none; }
.lockdown-card { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.lockdown-card.is-on { border-color: rgba(192,57,43,0.35); background: rgba(192,57,43,0.045); }
.lockdown-head { display: flex; gap: 14px; align-items: flex-start; }
.lockdown-ic { width: 28px; height: 28px; flex: none; color: var(--stone); margin-top: 2px; }
.lockdown-card.is-on .lockdown-ic { color: var(--err); }
.lockdown-desc { margin: 4px 0 0; line-height: 1.5; }
.lockdown-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lockdown-reason { flex: 1 1 280px; min-width: 200px; font-family: var(--font); font-size: 14px; color: var(--ink); padding: 9px 12px; border-radius: 10px; border: 1px solid var(--glass-stroke); background: rgba(255,255,255,0.7); }
.lockdown-reason:focus { outline: none; border-color: var(--ib3); box-shadow: 0 0 0 3px rgba(55,138,221,0.15); }
body.mode-dark .lockdown-reason { background: rgba(255,255,255,0.05); }

/* CSP-sichere Utilities (ersetzen Inline-style) */
.form-card-760 { max-width: 760px; }
.form-card-980 { max-width: 980px; }
.inline-form { display: inline; }
.row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cell-danger { color: var(--err); font-weight: 700; }

/* Register-getriebener Seitenkopf (sec-head) */
.sec-head { margin: 0 0 18px; }
.sec-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.sec-kicker { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--stone); margin: 0 0 3px; }
.sec-title { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; color: var(--ink); margin: 0; line-height: 1.15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec-head-flags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-top: 4px; }
.sec-purpose { font-size: 14px; color: var(--stone); max-width: 80ch; margin: 8px 0 0; line-height: 1.5; }
@media (max-width: 640px) { .sec-title { font-size: 20px; } }

/* Hilfe-Callout (klappbar, ohne JS) */
.help-callout { margin-top: 10px; border: 1px solid var(--glass-border); border-radius: var(--r-lg); background: var(--ib6); overflow: hidden; max-width: 80ch; }
.help-callout > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 9px 12px; font-size: 13px; font-weight: 700; color: var(--ib2); list-style: none; }
.help-callout > summary::-webkit-details-marker { display: none; }
.help-callout[open] > summary { border-bottom: 1px solid var(--glass-border); }
.help-ic { width: 16px; height: 16px; flex: none; }
.help-callout-body { padding: 11px 12px; font-size: 13.5px; color: var(--graph); line-height: 1.55; }

/* Einheitlicher Leerzustand */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 26px 16px; color: var(--stone); }
.empty-ic { width: 32px; height: 32px; color: var(--sand); opacity: .75; }
.empty-text { margin: 0; font-size: 14px; max-width: 54ch; }
.empty-good .empty-ic { color: #2F8559; opacity: .85; }
.empty-warn .empty-ic { color: var(--warn); opacity: .9; }

/* Rail-Badge (Werte zur Laufzeit injiziert) */
.panel-rail-item .rail-badge { margin-left: auto; flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 100px; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.rail-badge-count { background: var(--ib6); color: var(--ib2); }
.rail-badge-warning { background: rgba(182,137,47,.18); color: var(--warn); }
.rail-badge-critical { background: rgba(192,57,43,.16); color: var(--err); }

/* Empfehlungen (priorisiert) */
.rec-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rec { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--glass-border); border-left-width: 4px; border-radius: var(--r-lg); background: var(--white); }
.rec-sev { flex: 0 0 70px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.rec-body { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; }
.rec-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.rec-detail { font-size: 12.5px; color: var(--stone); }
.rec-action { flex: none; }
.rec-critical { border-left-color: var(--err); } .rec-critical .rec-sev { color: var(--err); }
.rec-warning { border-left-color: var(--warn); } .rec-warning .rec-sev { color: var(--warn); }
.rec-info { border-left-color: var(--ib3); } .rec-info .rec-sev { color: var(--ib2); }

/* Zentrale Schnellaktionen */
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.action-mini { display: flex; gap: 6px; align-items: center; }
.action-input { font-family: var(--font); font-size: 13.5px; color: var(--ink); padding: 7px 11px; border-radius: 9px; border: 1px solid var(--glass-stroke); background: rgba(255,255,255,0.7); min-width: 210px; }
.action-input:focus { outline: none; border-color: var(--ib3); box-shadow: 0 0 0 3px rgba(55,138,221,0.15); }
body.mode-dark .action-input { background: rgba(255,255,255,0.05); }

/* „Alle Bereiche"-Raster (register-getrieben) */
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.area-card { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; transition: border-color .12s, box-shadow .12s, transform .06s; }
.area-card:hover { border-color: var(--ib4); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.area-card:active { transform: translateY(1px); }
.area-ic { width: 22px; height: 22px; flex: none; color: var(--ib2); margin-top: 1px; }
.area-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.area-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.area-purpose { font-size: 12.5px; color: var(--stone); line-height: 1.4; }

/* Filter-Leisten (Audit/Konten/Geräte/Timeline) */
.filter-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-input { font-family: var(--font); font-size: 13px; color: var(--ink); padding: 7px 11px; border-radius: 9px; border: 1px solid var(--stone2); background: var(--white); min-width: 150px; }
.filter-input:focus { outline: none; border-color: var(--ib3); box-shadow: 0 0 0 3px var(--ib6); }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.lock-min { width: 66px; font-family: var(--font); font-size: 13px; color: var(--ink); padding: 6px 8px; border-radius: 8px; border: 1px solid var(--stone2); background: var(--white); }
.filter-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: 13px; font-weight: 600; color: var(--graph); padding: 6px 12px; border-radius: 100px; border: 1px solid var(--stone2); text-decoration: none; transition: background .12s, color .12s, border-color .12s; }
.pill:hover { border-color: var(--ib4); color: var(--ink); }
.pill.active { background: var(--ib6); color: var(--ib2); border-color: var(--ib5); font-weight: 700; }
body.mode-dark .filter-input, body.mode-dark .lock-min { background: rgba(255,255,255,0.05); }

/* Schutz-Presets */
.preset-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 4px; }
.preset-form { display: flex; }
.preset-btn { flex: 1; display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer; padding: 12px 14px; border: 1px solid var(--glass-stroke); border-radius: var(--r-lg); background: var(--white); transition: border-color .12s, box-shadow .12s, transform .06s; font-family: var(--font); }
.preset-btn:hover { border-color: var(--ib4); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.preset-btn:active { transform: translateY(1px); }
.preset-name { font-size: 14px; font-weight: 800; color: var(--ink); }
.preset-desc { font-size: 12px; color: var(--stone); line-height: 1.35; }
body.mode-dark .preset-btn { background: rgba(255,255,255,0.04); }
.tc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 4px; }

/* Rail-Suche */
.rail-search { position: relative; margin: 0 0 10px; }
.rail-search-ic { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--stone); pointer-events: none; }
.rail-search-input { width: 100%; font-family: var(--font); font-size: 13px; color: var(--ink); padding: 8px 10px 8px 30px; border: 1px solid var(--stone2); border-radius: 9px; background: var(--white); }
.rail-search-input:focus { outline: none; border-color: var(--ib3); box-shadow: 0 0 0 3px var(--ib6); }
body.mode-dark .rail-search-input { background: rgba(255,255,255,0.05); }

/* Such-Ergebnisse */
.search-big { flex: 1 1 auto; min-width: 220px; }
.search-results { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.search-item { display: flex; gap: 11px; align-items: center; padding: 9px 10px; border-radius: 10px; text-decoration: none; transition: background .12s; }
.search-item:hover { background: var(--hover); }
.search-ic { width: 18px; height: 18px; flex: none; color: var(--ib2); }
.search-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.search-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.search-sub { font-size: 12.5px; color: var(--stone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Schieberegler (Risiko-Schwellen) */
.slider-field { gap: 8px; }
.slider-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.slider-val { font-size: 15px; font-weight: 800; color: var(--ib2); font-variant-numeric: tabular-nums; min-width: 2.5em; text-align: right; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--hover); accent-color: var(--ib2); cursor: pointer; }
.range:focus { outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ib2); border: 2px solid var(--white); box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer; }
.range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(55,138,221,0.2); }
.range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--ib2); border: 2px solid var(--white); box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer; }
.range:disabled { opacity: .5; cursor: not-allowed; }
.slider-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--stone); }

.key-reveal { border-color: var(--ib2); }
.key-code { background: var(--ib6); border: 1px solid var(--glass-border); border-radius: var(--r-lg); padding: 12px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; user-select: all; margin: 4px 0 0; }
.siem-preview { max-height: 320px; overflow: auto; white-space: pre; word-break: normal; user-select: text; font-size: 12px; line-height: 1.5; }
.state-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.scope-set { border: 1px solid var(--glass-border); border-radius: var(--r-lg); padding: 10px 14px; margin: 4px 0 12px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.scope-set legend { font-size: 12px; font-weight: 600; color: var(--stone); padding: 0 6px; }
.row-muted { opacity: .55; }

/* ══ Admin-Panel (Kontrollzentrum mit linker Leiste) ══ */
.panel-wrap { display: flex; gap: 22px; align-items: flex-start; }
.panel-rail { flex: 0 0 234px; position: sticky; top: 12px; background: var(--white); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--glass-shadow); padding: 12px; }
.panel-rail-head { display: flex; align-items: center; gap: 9px; padding: 6px 10px 12px; font-weight: 800; color: var(--ink); font-size: 14px; }
.panel-rail-logo { width: 20px; height: 20px; color: var(--ib2); }
.panel-rail-group { padding: 6px 0; border-top: 1px solid var(--glass-border); }
.panel-rail-group:first-of-type { border-top: 0; }
.panel-rail-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--sand); padding: 6px 10px 4px; margin: 0; }
.panel-rail-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--graph); text-decoration: none; font-size: 14px; font-weight: 500; transition: background .12s, color .12s; }
.panel-rail-item:hover { background: var(--ib7, rgba(0,0,0,.04)); color: var(--ink); }
.panel-rail-item.active { background: var(--ib6); color: var(--ib2); font-weight: 700; }
.panel-rail-ic { width: 19px; height: 19px; flex: 0 0 19px; }
.panel-main { flex: 1 1 auto; min-width: 0; }
@media (max-width: 880px) {
  .panel-wrap { flex-direction: column; gap: 14px; }
  .panel-rail { position: static; width: 100%; flex-basis: auto; display: flex; flex-wrap: wrap; gap: 4px; }
  .panel-rail-head { width: 100%; padding-bottom: 6px; }
  .panel-rail-group { border-top: 0; padding: 0; display: contents; }
  .panel-rail-title { display: none; }
  .panel-rail-item { flex: 0 0 auto; }
}

@media print {
  .app-sidebar, .app-topbar, .page-head-action, .breadcrumb, .duty-bar { display: none !important; }
  .app-content { overflow: visible !important; padding: 0 !important; }
  .form-card, .ds-card { box-shadow: none !important; border-color: #ccc !important; break-inside: avoid; }
}
.btn-danger-text { color: var(--err); }
.btn-danger-text:hover { background: rgba(180,69,60,0.10); }

/* ── Rechnungen ────────────────────────────────────────────────────────── */
.toolbar-actions { display: flex; gap: 10px; align-items: center; }
.search-form { display: flex; gap: 8px; align-items: center; flex: 1 1 auto; min-width: 0; }
.search-form input[type="search"] { flex: 1 1 auto; min-width: 150px; max-width: 360px; font-family: var(--font); font-size: 14px; color: var(--ink); padding: 9px 12px; border-radius: 10px; border: 1px solid var(--glass-stroke); background: rgba(255,255,255,0.7); }
.search-form select { font-family: var(--font); font-size: 14px; color: var(--ink); padding: 9px 11px; border-radius: 10px; border: 1px solid var(--glass-stroke); background: rgba(255,255,255,0.7); }
.search-form input:focus, .search-form select:focus { outline: none; border-color: var(--ib3); box-shadow: 0 0 0 3px var(--ib6); }
.badge-soft { background: var(--ib6); color: var(--ib2); }
.field-group { border: 1px solid var(--glass-stroke); border-radius: 14px; padding: 12px 16px 4px; margin: 6px 0 2px; background: rgba(255,255,255,0.4); }
.field-group > legend { font-size: 12.5px; font-weight: 700; color: var(--stone); padding: 0 6px; }
.field-hint { font-size: 12px; color: var(--stone); margin: 0 0 10px; }
.items-head, .item-row { display: grid; grid-template-columns: 1fr 90px 130px 92px; gap: 10px; align-items: center; }
.items-head { font-size: 12px; color: var(--stone); padding: 2px 2px 6px; }
.item-row { margin-bottom: 8px; }
.item-row input, .item-row select { width: 100%; font-family: var(--font); font-size: 14px; color: var(--ink); padding: 9px 11px; border-radius: 10px; border: 1px solid var(--glass-stroke); background: rgba(255,255,255,0.7); }
.item-row input:focus, .item-row select:focus { outline: none; border-color: var(--ib3); box-shadow: 0 0 0 3px var(--ib6); }
.inv-items { margin: 14px 0; }
.inv-items th, .inv-items td { padding: 8px 10px; }
.inv-totals { max-width: 280px; margin-left: auto; }
.inv-total-gross { font-weight: 700; color: var(--ink); border-bottom: none !important; font-size: 16px; }

/* ── Responsiv ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .ticket-side { height: auto; min-height: 0; max-height: none; }
}

/* Mitarbeiter-Shell: Sidebar → horizontale Icon-Leiste oben */
/* ── Mobil/Tablet: Off-canvas-Drawer + Bottom-Tabs statt Sidebar ────────── */
@media (max-width: 820px) {
  .app-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 84vw;
    transform: translateX(-100%); transition: transform .25s ease;
    z-index: 70; border-right: 1px solid var(--glass-border); box-shadow: var(--glass-shadow-lg);
  }
  body.nav-open .app-sidebar { transform: translateX(0); }
  .drawer-backdrop {
    display: block; position: fixed; inset: 0; z-index: 65;
    background: rgba(16,24,40,.42); opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  body.nav-open .drawer-backdrop { opacity: 1; pointer-events: auto; }

  .app-main { margin-left: 0; }
  .topbar-burger { display: inline-flex; }
  .app-eyebrow { display: none; }
  .app-title { font-size: 17px; }
  .app-topbar { padding: 9px 12px; }
  .app-content { padding: 14px 14px calc(72px + env(safe-area-inset-bottom, 0px)); }
  /* Benutzer-Menü kompakt: nur Avatar */
  .user-menu > summary .app-user-meta, .user-menu > summary .user-menu-chev { display: none; }

  /* Bottom-Navigation */
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--white); border-top: 1px solid var(--glass-border);
    justify-content: space-around; align-items: stretch;
  }
  .mnav-item {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-family: var(--font); font-size: 10.5px; font-weight: 600; color: var(--stone);
    background: none; border: none; cursor: pointer; text-decoration: none;
  }
  .mnav-item svg { width: 23px; height: 23px; opacity: .75; }
  .mnav-item.active { color: var(--ib2); }
  .mnav-item.active svg { opacity: 1; }
}

/* Kundenportal: Navigation rutscht in eigene Zeile, bevor die Leiste überläuft */
@media (max-width: 920px) {
  .portal-bar { flex-wrap: wrap; padding: 11px 16px; gap: 8px 14px; border-radius: var(--r-lg); width: calc(100% - 24px); margin-top: 12px; top: 12px; }
  .portal-nav { order: 3; flex: 1 1 100%; justify-content: flex-start; gap: 2px; }
  .portal-nav a { padding: 7px 12px; }
}
@media (max-width: 820px) {
  .portal-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .portal-main { padding: 24px 16px 48px; }
  .portal-cards { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
  .portal-bar .app-brand-name { display: none; }
  .portal-bar-right { gap: 8px; }
}

/* Tabellen & Positions-Editor auf kleinen Geräten */
@media (max-width: 700px) {
  .items-head { display: none; }
  .item-row { grid-template-columns: 1fr 1fr; }
  .panel-flush { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 540px; }
  .data-table th, .data-table td { padding: 11px 13px; }
}

/* Formularfelder & Karten enger stapeln */
@media (max-width: 560px) {
  .form-row .field { min-width: 100%; }
  .form-card { padding: 18px 16px; }
  .app-main { padding: 18px 14px 36px; }
  .app-title { font-size: 21px; }
  .toolbar { flex-wrap: wrap; gap: 10px; }
  .search-form { flex-wrap: wrap; }
  .modal-card { max-width: 100%; }
}

/* ── Sidebar: aufklappbare Gruppen (Dropdown) ──────────────────────────── */
.app-nav-group-wrap { display: block; }
summary.app-nav-group {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  list-style: none; cursor: pointer; user-select: none;
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--stone); padding: 13px 12px 6px; border-radius: 10px;
  transition: color .15s;
}
summary.app-nav-group::-webkit-details-marker { display: none; }
summary.app-nav-group::marker { content: ''; }
summary.app-nav-group:hover { color: var(--ink); }
.nav-group-chev { width: 16px; height: 16px; opacity: .6; transition: transform .2s; flex: none; }
.app-nav-group-wrap[open] > summary .nav-group-chev { transform: rotate(180deg); }
.app-nav-sub { display: flex; flex-direction: column; gap: 3px; padding-top: 2px; }

/* ── Mein Konto: Profil-Kopf ───────────────────────────────────────────── */
.konto-head { display: flex; align-items: center; gap: 16px; }
.konto-avatar {
  width: 56px; height: 56px; border-radius: 16px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ib1); color: #fff; font-size: 24px; font-weight: 700;
}
.konto-head-name { font-size: 20px; font-weight: 700; color: var(--ink); }
.konto-head-sub { display: flex; align-items: center; gap: 8px; margin-top: 7px; flex-wrap: wrap; }

/* ── Kalender ──────────────────────────────────────────────────────────── */
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-month { font-size: 19px; font-weight: 700; color: var(--ink); min-width: 168px; text-align: center; }
.btn-icon { padding: 8px; line-height: 0; }
.btn-icon svg { width: 18px; height: 18px; display: block; }
.cal-switch { display: flex; align-items: center; gap: 8px; }
.cal-switch select { font-family: var(--font); font-size: 14px; color: var(--ink); padding: 9px 12px; border-radius: 10px; border: 1px solid var(--glass-border); background: var(--glass-bg); }
.cal-context { font-size: 13.5px; color: var(--graph); display: flex; align-items: center; gap: 6px; }
.cal-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-search { display: flex; align-items: center; gap: 8px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-lg); padding: 7px 12px; box-shadow: var(--glass-shadow); transition: border-color .12s, box-shadow .12s; }
.cal-search:focus-within { border-color: var(--ib4); box-shadow: 0 0 0 3px var(--ib6); }
.cal-search-ic { width: 17px; height: 17px; flex: none; color: var(--stone); }
.cal-search input { border: none; background: transparent; font-family: var(--font); font-size: 14px; color: var(--ink); padding: 2px; min-width: 140px; }
.cal-search input:focus { outline: none; }
.cal-search-clear { display: inline-flex; color: var(--stone); flex: none; }
.cal-search-clear svg { width: 16px; height: 16px; }
.cal-search-clear:hover { color: var(--err); }

/* Kategorie-Farben — eine Variable je Kategorie (color-mix → Light/Dark) */
.cal-cat-meeting  { --cat: #2F7BC4; }
.cal-cat-kunde    { --cat: #3A9E6B; }
.cal-cat-frist    { --cat: #C9952F; }
.cal-cat-abwesend { --cat: #7A63D4; }
.cal-cat-intern   { --cat: #2A9DA6; }
.cal-cat-privat   { --cat: #7A828F; }
.cal-cat-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--cat, var(--ib3)); }
.cal-cat-tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--cat, var(--ib2)) 15%, transparent); color: var(--cat, var(--ib2)); white-space: nowrap; }

.cal-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--graph); background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-pill); padding: 6px 13px; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.cal-chip .cal-cat-dot { width: 9px; height: 9px; }
.cal-chip:hover { border-color: var(--ib4); color: var(--ink); }
.cal-chip.is-active { background: color-mix(in srgb, var(--cat, var(--ib2)) 14%, transparent); border-color: transparent; color: var(--cat, var(--ib2)); }

.cal-card { padding: 0; overflow: hidden; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head { background: color-mix(in srgb, var(--ink) 3%, transparent); border-bottom: 1px solid var(--glass-border); }
.cal-weekday { padding: 10px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--stone); text-align: center; }
.cal-cell {
  min-height: 100px; padding: 7px 8px; cursor: pointer; transition: background .12s;
  border-right: 1px solid var(--glass-stroke); border-bottom: 1px solid var(--glass-stroke);
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: color-mix(in srgb, var(--ib2) 6%, transparent); }
.cal-cell.is-out { background: color-mix(in srgb, var(--ink) 2%, transparent); }
.cal-cell.is-out .cal-day { opacity: .4; }
.cal-cell.is-today { background: color-mix(in srgb, var(--ib2) 7%, transparent); }
.cal-cell.is-today .cal-day { background: var(--ib2); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--ib2) 40%, transparent); }
.cal-day { font-size: 13px; font-weight: 600; color: var(--ink); width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-events { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-ev { display: flex; align-items: center; gap: 5px; width: 100%; text-align: left; font-family: var(--font); font-size: 11.5px; padding: 3px 7px; border: none; border-radius: 7px; background: color-mix(in srgb, var(--cat, var(--graph)) 12%, transparent); color: var(--ink); overflow: hidden; white-space: nowrap; cursor: pointer; transition: filter .12s; }
.cal-ev:hover { filter: brightness(.97); }
.cal-ev .cal-cat-dot { width: 6px; height: 6px; }
.cal-ev-time { font-weight: 700; flex: none; color: var(--cat, var(--ib2)); }
.cal-ev-title { overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 11px; font-weight: 600; color: var(--stone); padding-left: 4px; }

.cal-list { display: flex; flex-direction: column; }
.cal-li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px; border-top: 1px solid var(--glass-stroke); border-radius: 8px; }
.cal-li:first-child { border-top: none; }
.cal-li-click { cursor: pointer; transition: background .12s; }
.cal-li-click:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.cal-li-click:focus-visible { outline: 2px solid var(--ib2); outline-offset: -2px; }
.cal-li-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 5px; background: var(--cat, var(--ib3)); }
.cal-li-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.cal-li-time { font-size: 12px; font-weight: 700; color: var(--ib2); }
.cal-li-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.cal-li-meta { font-size: 12px; color: var(--stone); display: inline-flex; align-items: center; gap: 4px; }
.cal-li-delform { flex: none; }
.cal-li-del { border: none; background: transparent; color: var(--stone); cursor: pointer; padding: 4px; border-radius: 8px; flex: none; }
.cal-li-del svg { width: 17px; height: 17px; display: block; }
.cal-li-del:hover { color: var(--err); background: rgba(180,69,60,.08); }

/* Suchergebnisse */
.cal-results { padding: 16px 18px; }
.cal-results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.cal-results-count { font-size: 12.5px; color: var(--stone); }

/* Termin-Detail-Modal */
.cal-evm-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.cal-evm-desc { font-size: 14px; color: var(--graph); line-height: 1.55; white-space: pre-wrap; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--glass-stroke); }
.cal-evm-del { color: var(--err); }
.cal-evm-del:hover { background: rgba(180,69,60,.08); }
.cal-evm-del svg { width: 17px; height: 17px; }

@media (max-width: 560px) { .cal-cell { min-height: 70px; } .cal-ev-title { display: none; } }

/* Ansicht-Umschalter (Monat/Woche) + Neu-Button */
.cal-seg { display: inline-flex; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-pill); padding: 3px; }
.cal-seg-btn { font-size: 13px; font-weight: 600; color: var(--stone); padding: 6px 14px; border-radius: var(--r-pill); cursor: pointer; transition: background .12s, color .12s; }
.cal-seg-btn:hover { color: var(--ink); }
.cal-seg-btn.is-active { background: var(--ib6); color: var(--ib2); }
.cal-new-btn { flex: none; }

/* Demnächst — kompakte horizontale Leiste unter dem Kalender */
.cal-soon { margin-top: 2px; }
.cal-soon-list { display: flex; flex-direction: row; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.cal-soon-list .cal-li { flex: 0 0 240px; border: 1px solid var(--glass-stroke); border-radius: 10px; padding: 10px 12px; }

/* Wochenansicht — Zeitraster (7:00–21:00, Stunde = 44px) */
.cal-week-head, .cal-week-allday, .cal-week-grid { display: grid; grid-template-columns: 52px repeat(7, 1fr); }
/* Kopf identisch zum Monat: getönter Balken, Wochentag (Versalien) + Tageszahl als Kreis (Heute = blau) */
.cal-week-head { background: color-mix(in srgb, var(--ink) 3%, transparent); border-bottom: 1px solid var(--glass-border); }
.cal-week-dhead { padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; border-left: 1px solid var(--glass-stroke); }
.cal-week-dhead .cal-wd-day { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--stone); }
.cal-week-dhead .cal-wd-num { font-size: 13px; font-weight: 600; color: var(--ink); width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-week-dhead.is-today .cal-wd-num { background: var(--ib2); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--ib2) 40%, transparent); }
.cal-week-allday { border-bottom: 1px solid var(--glass-border); min-height: 30px; }
.cal-week-axis-lbl { font-size: 10px; color: var(--stone); text-align: right; padding: 7px 7px 0 0; }
.cal-week-ad-cell { border-left: 1px solid var(--glass-stroke); padding: 4px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.cal-week-axis { display: flex; flex-direction: column; }
.cal-week-hour { height: 44px; position: relative; }
.cal-week-hour span { position: absolute; top: 3px; right: 7px; font-size: 10.5px; font-weight: 600; color: var(--stone); }
.cal-week-col { position: relative; border-left: 1px solid var(--glass-stroke); }
.cal-week-col.is-today { background: color-mix(in srgb, var(--ib2) 6%, transparent); }
.cal-week-col.is-drop-target { background: color-mix(in srgb, var(--ib2) 12%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ib2) 35%, transparent); }
.cal-week-slot { height: 44px; border-top: 1px solid var(--glass-stroke); cursor: pointer; transition: background .1s; }
.cal-week-slot:first-child { border-top: none; }
.cal-week-slot:hover { background: color-mix(in srgb, var(--ib2) 8%, transparent); }
/* Jetzt-Linie (aktuelle Uhrzeit) */
.cal-week-grid { position: relative; }
.cal-now-line { position: absolute; left: 52px; right: 0; border-top: 2px solid var(--err); z-index: 15; pointer-events: none; }
.cal-now-line[hidden] { display: none; }
.cal-now-dot { position: absolute; left: -5px; top: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--err); box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 22%, transparent); }
.cal-week-ev { position: absolute; left: 2px; width: calc(100% - 5px); overflow: hidden; border: none; border-radius: 6px; padding: 3px 6px 5px; text-align: left; font-family: var(--font); cursor: grab; background: color-mix(in srgb, var(--cat, var(--ib2)) 16%, var(--glass-bg)); border-left: 3px solid var(--cat, var(--ib2)); color: var(--ink); display: flex; flex-direction: column; gap: 1px; line-height: 1.2; transition: filter .12s; touch-action: none; }
.cal-week-ev:hover { filter: brightness(.96); }
.cal-week-ev.is-dragging { z-index: 20; opacity: .9; cursor: grabbing; box-shadow: var(--glass-shadow-lg); filter: none; }
.cal-week-ev-time { font-size: 10px; font-weight: 700; color: var(--cat, var(--ib2)); pointer-events: none; }
.cal-week-ev-title { font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.cal-week-ev-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.cal-week-ev-resize::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 16px; height: 2px; border-radius: 2px; transform: translateX(-50%); background: color-mix(in srgb, var(--cat, var(--ib2)) 55%, transparent); opacity: 0; transition: opacity .12s; }
.cal-week-ev:hover .cal-week-ev-resize::after { opacity: 1; }

/* Mehrtägige Termine (Spann-Hinweis) */
.cal-ev.is-multi { border-left: 3px solid var(--cat, var(--ib2)); padding-left: 5px; }

/* Bearbeiten-Knopf im Detail-Modal + optionaler Label-Zusatz */
.cal-evm-edit svg { width: 17px; height: 17px; }
.field-opt { font-weight: 400; color: var(--stone); font-size: 12px; }

/* kleines Modal (Bestätigung) */
.modal-sm { width: min(440px, 100%); }

@media (max-width: 700px) {
  /* Wochenraster horizontal scrollbar halten, Spalten nutzbar breit */
  .cal-week { overflow-x: auto; }
  .cal-week-head, .cal-week-allday, .cal-week-grid { grid-template-columns: 44px repeat(7, minmax(76px, 1fr)); min-width: 600px; }
  .cal-now-line { left: 44px; }
  .cal-week-dhead { font-size: 11px; padding: 6px 2px; }
  .cal-week-ev-title { font-size: 10.5px; }
  .cal-soon-list .cal-li { flex-basis: 200px; }
}

/* ── Hilfe & FAQ ───────────────────────────────────────────────────────── */
/* ── Hilfe & FAQ — kompakter Onepager (IndigoUI) ───────────────────────── */
.faq-meta { font-size: 13px; color: var(--stone); margin: -4px 0 2px; }
.faq-search {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  padding: 10px 14px; box-shadow: var(--glass-shadow); transition: border-color .12s, box-shadow .12s;
}
.faq-search:focus-within { border-color: var(--ib4); box-shadow: 0 0 0 3px var(--ib6); }
.faq-search-ic { width: 19px; height: 19px; flex: none; color: var(--stone); }
.faq-search input {
  flex: 1 1 auto; min-width: 120px; border: none; background: transparent;
  font-family: var(--font); font-size: 15px; color: var(--ink); padding: 4px 2px;
}
.faq-search input:focus { outline: none; }

.faq-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.faq-chip {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font);
  font-size: 13px; font-weight: 600; color: var(--graph);
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-pill);
  padding: 7px 13px; cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.faq-chip svg { width: 16px; height: 16px; opacity: .7; }
.faq-chip:hover { border-color: var(--ib4); color: var(--ink); }
.faq-chip.is-active { background: var(--ib6); border-color: transparent; color: var(--ib2); }
.faq-chip.is-active svg { opacity: 1; color: var(--ib2); }
.faq-chip:focus-visible { outline: 2px solid var(--ib2); outline-offset: 2px; }
.faq-result { font-size: 13px; color: var(--stone); margin: -2px 2px; }

.faq-list { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--glass-shadow); overflow: hidden; }
.faq-section { padding: 0; }
.faq-section + .faq-section { border-top: 1px solid var(--glass-border); }
.faq-section-label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--stone); padding: 12px 16px 4px; margin: 0; }
.faq-section-label svg { width: 15px; height: 15px; color: var(--ib2); }
.faq-items { display: flex; flex-direction: column; }
.faq-item { border-top: 1px solid var(--glass-stroke); }
.faq-section-label + .faq-items > .faq-item:first-child { border-top: none; }
.faq-q {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  list-style: none; cursor: pointer; padding: 11px 16px;
  font-size: 14px; font-weight: 600; color: var(--ink); transition: background .12s;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::marker { content: ''; }
.faq-q:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.faq-q:focus-visible { outline: 2px solid var(--ib2); outline-offset: -2px; }
.faq-chev { width: 18px; height: 18px; flex: none; opacity: .5; color: var(--ib2); transition: transform .2s, opacity .2s; }
.faq-item[open] > .faq-q .faq-chev { transform: rotate(180deg); opacity: 1; }
.faq-a { font-size: 13.5px; color: var(--graph); line-height: 1.6; padding: 0 16px 14px; max-width: 76ch; }
.faq-a a { color: var(--ib2); font-weight: 600; }
.faq-empty { text-align: center; padding: 28px 0; color: var(--stone); font-size: 14px; }

/* FAQ-Startseite: Intro + Bereichs-Kacheln */
.faq-home { display: flex; flex-direction: column; gap: 14px; }
.faq-home[hidden], .faq-list[hidden] { display: none; }
.faq-hero { display: flex; align-items: flex-start; gap: 14px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--glass-shadow); padding: 18px 20px; }
.faq-hero-ic { flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--ib6); color: var(--ib2); }
.faq-hero-ic svg { width: 24px; height: 24px; }
.faq-hero-title { font-size: 18px; font-weight: 800; color: var(--ink); margin: 0 0 4px; }
.faq-hero-text { font-size: 13.5px; color: var(--graph); line-height: 1.55; margin: 0; max-width: 72ch; }
.faq-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 10px; }
.faq-card { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--glass-shadow); padding: 13px 14px; cursor: pointer; font-family: var(--font); transition: transform .12s, border-color .12s, box-shadow .12s; }
.faq-card:hover { transform: translateY(-2px); border-color: var(--ib4); box-shadow: var(--glass-shadow-lg); }
.faq-card:focus-visible { outline: 2px solid var(--ib2); outline-offset: 2px; }
.faq-card-ic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--ib6); color: var(--ib2); }
.faq-card-ic svg { width: 20px; height: 20px; }
.faq-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.faq-card-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.faq-card-sub { font-size: 12px; color: var(--stone); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.faq-card-count { flex: none; font-size: 12px; font-weight: 700; color: var(--ib2); background: var(--ib6); border-radius: var(--r-pill); padding: 2px 9px; }

/* ── Dashboard: Bereichs-Überschriften ─────────────────────────────────── */
.section-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--stone); margin: 8px 2px -4px;
}
.section-head .inline-ic { opacity: .7; }

/* ── Dashboard: Kommandozentrale ───────────────────────────────────────── */
.dash-hero { flex: none; }
.dash-greeting { font-size: 23px; font-weight: 800; color: var(--ink); letter-spacing: -0.4px; }
.dash-date { font-size: 13.5px; color: var(--stone); margin-top: 1px; text-transform: capitalize; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dash-panel { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.dash-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--glass-stroke); }
.dash-panel-head h3 { font-size: 14.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.dash-panel-head .inline-ic { opacity: .65; }
.dash-panel-body { padding: 4px 16px 10px; overflow-y: auto; max-height: 280px; }
.dash-empty { font-size: 13.5px; color: var(--stone); padding: 14px 2px; line-height: 1.6; }
.dash-list { display: flex; flex-direction: column; }
.dash-li { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--glass-stroke); }
.dash-li:first-child { border-top: none; }
.dash-li.row-link { cursor: pointer; border-radius: 8px; }
.dash-li.row-link:hover { background: var(--subtle); }
.dash-li-time { flex: none; font-size: 12.5px; font-weight: 700; color: var(--ib2); min-width: 58px; }
.dash-li-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.dash-li-title { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-li-sub { font-size: 12px; color: var(--stone); }

.dash-quick { flex: none; }
.dash-section-title { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--stone); margin-bottom: 10px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; }
.quick-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 11px; padding: 15px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: var(--glass-shadow); font-size: 13.5px; font-weight: 600; color: var(--ink); transition: transform .15s, border-color .15s, box-shadow .15s; }
.quick-tile:hover { transform: translateY(-2px); border-color: var(--ib4); box-shadow: var(--glass-shadow-lg); }
.quick-tile svg { width: 22px; height: 22px; color: var(--ib2); background: color-mix(in srgb, var(--ib2) 12%, transparent); border-radius: 11px; padding: 9px; box-sizing: content-box; transition: background .15s, color .15s; }
.quick-tile:hover svg { background: var(--ib2); color: #fff; }

@media (max-width: 760px) { .dash-grid { grid-template-columns: 1fr; } }

/* ── Support: Kanal-Karten ─────────────────────────────────────────────── */
.chan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.chan-card {
  display: block; background: var(--glass-bg);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  padding: 16px 18px; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.chan-card:hover { box-shadow: var(--glass-shadow-lg); border-color: var(--ib4); }
.chan-card.is-active { border-color: var(--ib3, var(--ib2)); box-shadow: 0 0 0 1px var(--ib2) inset; }
.chan-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.chan-ic {
  width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ib6); color: var(--ib2);
}
.chan-ic svg { width: 20px; height: 20px; }
.chan-ic img { display: block; border-radius: 5px; }
.chan-soon { font-size: 10.5px; }
.chan-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.chan-sub { font-size: 12.5px; color: var(--stone); margin-top: 1px; }
.chan-count { font-size: 13px; color: var(--graph); margin-top: 10px; }
.chan-new { color: var(--warn); font-weight: 600; }

/* Kanal-Chip in der Posteingang-Tabelle */
.src-badge {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; color: var(--graph);
  background: rgba(44,44,42,.05); padding: 4px 10px; border-radius: 100px;
}
.src-badge svg { width: 15px; height: 15px; opacity: .8; }
.src-badge img { display: block; border-radius: 3px; }

/* ── Modul-Platzhalter: Funktionsliste ─────────────────────────────────── */
.detail-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.feature-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.feature-item { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink); }
.feature-ic { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--ib2); opacity: .9; }
.feature-desc { display: block; font-size: 12.5px; color: var(--stone); margin-top: 2px; font-weight: 400; }

/* ── Hell/Dunkel-Auswahl (Mein Konto) ──────────────────────────────────── */
.setting-label { font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--stone); margin: 4px 0 8px; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.mode-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 16px; border: 1.5px solid var(--glass-stroke); border-radius: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.mode-option.selected { border-color: var(--ib3); box-shadow: 0 0 0 1px var(--ib3) inset; }
.mode-preview { width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
.mode-preview svg { width: 22px; height: 22px; }
.mode-preview-light { background: #F4F6F9; color: #B6892F; border: 1px solid #E4E7EC; }
.mode-preview-dark { background: #11151B; color: #9DB6E0; border: 1px solid #2A323D; }

/* ── Dunkelmodus (body.mode-dark) ──────────────────────────────────────── */
body.mode-dark {
  --bg:     #0F141A;
  --ink:    #E8EAED;
  --graph:  #C4C9D0;
  --stone:  #909AA4;
  --sand:   #6B7681;
  --stone2: #333C46;
  --paper:  #181E26;
  --white:  #181E26;
  --glass-bg:        #181E26;
  --glass-bg-strong: #1C232C;
  --glass-border:    #2A323D;
  --glass-stroke:    #242C35;
  --glass-shadow:    0 1px 2px rgba(0,0,0,.30), 0 2px 6px rgba(0,0,0,.35);
  --glass-shadow-lg: 0 10px 28px rgba(0,0,0,.48), 0 2px 8px rgba(0,0,0,.40);
  --hover:  rgba(255,255,255,.055);
  --subtle: rgba(255,255,255,.035);
  --ib6: rgba(120,160,215,.16);   /* weiche Akzentfläche — neutral für alle Akzente */
  --ib5: rgba(120,160,215,.30);
  --ok: #5FBF93; --warn: #D6A646; --err: #E07B6F; /* Status-Farben für Kontrast auf Dunkel */
}
/* Akzent-Text/-Flächen auf Dunkel aufhellen */
body.mode-dark .app-nav-item.active { color: var(--ib4); }
body.mode-dark .app-nav-item.active svg { color: var(--ib4); }
body.mode-dark .link { color: var(--ib4); }
body.mode-dark .link:hover { color: var(--ib3); }
body.mode-dark .badge-soft { color: var(--ib4); }
body.mode-dark .btn-primary { background: var(--ib2); }
body.mode-dark .btn-primary:hover { background: var(--ib3); }
body.mode-dark .tfilter.is-active { background: var(--ib2); border-color: var(--ib2); }
body.mode-dark .tfilter.is-active .tfilter-count { background: rgba(255,255,255,.20); }
/* sichtbare Inset-/Hover-Flächen, die sonst auf Dunkel verschwinden */
body.mode-dark .data-table-wrap .data-table thead th { background: #1C232C; }
body.mode-dark .row-link:hover { background: var(--hover); }
body.mode-dark .msg-bubble { background: #232b36; }
body.mode-dark .code-key, body.mode-dark .code-chip, body.mode-dark .src-badge,
body.mode-dark .panel-text code, body.mode-dark .kdnr-badge { background: rgba(255,255,255,.06); }
body.mode-dark .hint-note { background: rgba(255,255,255,.04); }
body.mode-dark .cal-head { background: rgba(255,255,255,.03); }
body.mode-dark .cal-cell.is-out { background: rgba(255,255,255,.02); }
body.mode-dark .thread.chat::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); }
body.mode-dark .modal-card { background: var(--glass-bg-strong); }
body.mode-dark .topbar-burger { background: var(--glass-bg); }

/* ── Animationen (clean & dezent) ──────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ic-rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes ic-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ic-modal { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes ic-bounce { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-5px); opacity: 1; } }
@keyframes ic-shimmer { 100% { transform: translateX(100%); } }

/* ── IndigoUI-Loader: Spinner · Dots · Skeleton ─────────────────────────── */
.spinner { width: 24px; height: 24px; border: 2.5px solid color-mix(in srgb, var(--ink) 12%, transparent); border-top-color: var(--ib2); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.spinner.lg { width: 40px; height: 40px; border-width: 3px; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--ib2); animation: ic-bounce 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
.skeleton { position: relative; overflow: hidden; background: color-mix(in srgb, var(--ink) 9%, transparent); border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--white) 75%, transparent), transparent); transform: translateX(-100%); animation: ic-shimmer 1.4s infinite; }
.sk-line { height: 12px; border-radius: 6px; }
.sk-title { height: 18px; border-radius: 7px; }
.sk-circle { border-radius: 50%; }
.cal-evm-loading { display: flex; align-items: center; justify-content: center; padding: 26px 0; }

/* Top-Ladeleiste bei Navigation/Aktionen */
.nav-progress {
  position: fixed; top: 0; left: 0; height: 2.5px; width: 0; z-index: 9999;
  background: linear-gradient(90deg, var(--ib2), var(--ib3));
  box-shadow: 0 0 8px var(--ib3); opacity: 0; pointer-events: none;
  transition: width .35s cubic-bezier(.2,.7,.3,1), opacity .25s ease;
}
.nav-progress.active { opacity: 1; }
.nav-progress.done { width: 100% !important; }

/* Button-Lade-Spinner */
.btn.is-loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.is-loading::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 15px; height: 15px; margin: -8px 0 0 -8px;
  border: 2px solid rgba(140,140,150,.4); border-top-color: var(--ib3); border-radius: 50%;
  animation: spin .6s linear infinite;
}

/* Sanftes, gestaffeltes Einblenden des Seiteninhalts (Mitarbeiter & Kundenportal) */
.app-content > *, .portal-main > * { animation: ic-rise .34s cubic-bezier(.2,.7,.3,1) both; }
.app-content > *:nth-child(1), .portal-main > *:nth-child(1) { animation-delay: 0s; }
.app-content > *:nth-child(2), .portal-main > *:nth-child(2) { animation-delay: .045s; }
.app-content > *:nth-child(3), .portal-main > *:nth-child(3) { animation-delay: .09s; }
.app-content > *:nth-child(4), .portal-main > *:nth-child(4) { animation-delay: .135s; }
.app-content > *:nth-child(5), .portal-main > *:nth-child(5) { animation-delay: .18s; }
.app-content > *:nth-child(n+6), .portal-main > *:nth-child(n+6) { animation-delay: .22s; }

/* Modal: weiches Auf-Skalieren */
.modal-overlay:not([hidden]) { animation: ic-fade .18s ease both; }
.modal-overlay:not([hidden]) .modal-card { animation: ic-modal .22s cubic-bezier(.2,.7,.3,1) both; }

/* Details/Akkordeons & Karten-Hover sind bereits per transition animiert. */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .orb { animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .app-content > *, .portal-main > *, .modal-overlay:not([hidden]), .modal-overlay:not([hidden]) .modal-card { animation: none !important; }
  .nav-progress { display: none !important; }
}

/* ═══════════════ Support: Agenten-Inbox (Zwei-Spalten) ═══════════════ */
.sup-inbox { display: grid; grid-template-columns: minmax(300px, 360px) 1fr; gap: 16px; align-items: start; margin-top: 14px; }
.sup-list { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-xl); box-shadow: var(--glass-shadow); overflow: hidden auto; max-height: calc(100vh - 230px); }
.sup-item { display: flex; gap: 11px; padding: 13px 14px; border-bottom: 1px solid var(--glass-stroke); cursor: pointer; text-decoration: none; color: inherit; position: relative; transition: background .12s; }
.sup-item:last-of-type { border-bottom: 0; }
.sup-item:hover { background: var(--subtle); }
.sup-item.is-active { background: var(--ib6); }
.sup-item.is-active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ib2); }
.sup-item.is-demo { cursor: default; }
.sup-item-av { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; background: linear-gradient(135deg, var(--ib2), var(--ib3)); }
.sup-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sup-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.sup-item-name { flex: 1; min-width: 0; font-weight: 600; color: var(--ink); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-item-time { flex: none; font-size: 11px; color: var(--stone); }
.sup-item-sub { display: block; font-size: 12px; color: var(--stone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-item-prev { display: block; font-size: 12.5px; color: var(--graph); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-item-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 3px; }
.sup-item-asg { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--ib2); }
.sup-item-asg svg { width: 13px; height: 13px; }
.src-badge-sm { font-size: 11px; gap: 4px; padding: 2px 6px; }
.src-badge-sm svg, .src-badge-sm img { width: 13px; height: 13px; }

.sup-thread-col { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-xl); box-shadow: var(--glass-shadow); min-height: 480px; display: flex; flex-direction: column; overflow: hidden; }
.sup-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 40px; text-align: center; color: var(--stone); }
.sup-empty svg { width: 46px; height: 46px; color: var(--sand); }
.sup-empty-title { font-weight: 700; color: var(--ink); font-size: 16px; margin: 6px 0 0; }
.sup-empty-text { font-size: 13px; max-width: 32ch; margin: 0; }

.sup-thread { display: flex; flex-direction: column; min-height: 0; height: min(calc(100vh - 230px), 760px); }
.sup-thread-head { display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--glass-border); flex: none; }
.sup-thread-back { display: none; flex: none; width: 34px; height: 34px; border-radius: 9px; align-items: center; justify-content: center; color: var(--graph); border: 1px solid var(--glass-border); }
.sup-thread-back svg { width: 18px; height: 18px; }
.sup-thread-av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--ib2), var(--ib3)); }
.sup-thread-id { flex: 1; min-width: 0; }
.sup-thread-name { font-weight: 700; color: var(--ink); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-thread-sub { font-size: 12.5px; color: var(--stone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-thread-tags { display: flex; align-items: center; gap: 7px; flex: none; }
.sup-thread-bar { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-bottom: 1px solid var(--glass-stroke); flex: none; flex-wrap: wrap; }
.sup-thread-bar-spacer { flex: 1; }
.sup-thread-bar form { margin: 0; }
.sup-thread-bar .cat-select { max-width: 180px; }
.sup-thread-meta { flex: none; border-bottom: 1px solid var(--glass-stroke); padding: 0 16px; }
.sup-thread-meta > summary { padding: 9px 0; font-size: 12.5px; font-weight: 600; color: var(--ib2); cursor: pointer; }
.sup-thread-meta-body { padding: 0 0 12px; }
.sup-thread > .thread { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.sup-thread > .chat-compose { flex: none; border-top: 1px solid var(--glass-border); padding: 12px 16px; margin: 0; }
.sup-thread > .chat-typing, .sup-thread > .chat-readonly { flex: none; padding: 8px 16px; margin: 0; }

@media (max-width: 860px) {
  .sup-inbox { grid-template-columns: 1fr; }
  .sup-list { max-height: none; }
  .sup-wrap:not(.has-conv) .sup-thread-col { display: none; }
  .sup-wrap.has-conv .sup-list,
  .sup-wrap.has-conv .duty-bar,
  .sup-wrap.has-conv .chan-strip,
  .sup-wrap.has-conv .support-toolbar { display: none; }
  .sup-thread-back { display: inline-flex; }
  .sup-thread { height: calc(100vh - 140px); }
}

/* Ticket im rechten Pane */
.sup-thread { position: relative; }
.sup-thread > .typing { flex: none; padding: 8px 16px; margin: 0; }
.sup-thread-bar .status-buttons { display: flex; gap: 4px; flex-wrap: wrap; margin: 0; }
.sup-thread-bar .status-buttons .btn-status { padding: 6px 10px; font-size: 12px; }
.sup-thread-meta .assignee-box { display: flex; flex-direction: column; gap: 6px; }
.sup-thread-meta .invite-form { margin-top: 10px; }
.sup-thread-meta .invite-row { display: flex; gap: 8px; }
.sup-thread-meta .invite-row select { flex: 1; min-width: 0; }

/* ===== Webhosting + Stilfinder (Mitarbeiterportal) — CSP-sicher: keine Inline-Styles ===== */
.wh-mb { margin-bottom: 16px; }
.wh-toolbar { padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.wh-search { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wh-search .input[type=search] { min-width: 260px; }
.wh-kpis { display: flex; gap: 14px; align-items: center; font-size: 13px; color: #888780; flex-wrap: wrap; }
.wh-kpis strong { color: #2C2C2A; }
.wh-empty { text-align: center; color: #888780; padding: 28px; }
.wh-dash { color: #B4B2A9; }
.wh-formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }
.wh-formgrid .input, .wh-formgrid select.input { width: 100%; }
.wh-cards2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.wh-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wh-actions-inline { display: flex; gap: 8px; }
.wh-meta { font-size: 13px; color: #888780; margin: 0 0 6px; }
.wh-meta-strong { font-size: 13px; color: #444441; margin: 0 0 4px; }
.wh-note { font-size: 12.5px; color: #888780; margin: 0 0 12px; }
.wh-line { font-size: 13px; margin: 0 0 6px; }
.wh-hint { color: #B4B2A9; }
.wh-notice { border-left: 4px solid #2F8559; margin-bottom: 16px; }
.wh-error { border-left: 4px solid #A4392B; margin-bottom: 16px; }
.wh-field { display: block; margin-bottom: 12px; }
.wh-w100 { width: 100%; }
.wh-danger { color: #A4392B; }
.wh-confirm { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin-bottom: 10px; }
.wh-filerow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* Stilfinder-Karte im Detail */
.wh-brief-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 12px; }
.wh-brief-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: #F4F2EC; border: 1px solid #E7E4DC; border-radius: 8px; padding: 7px 10px; flex: 1; min-width: 220px; word-break: break-all; color: #2C2C2A; }
.wh-brief-answers { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; font-size: 13.5px; }
.wh-brief-answers dt { color: #888780; }
.wh-brief-answers dd { margin: 0; color: #2C2C2A; }
.wh-brief-answers dd.pre { white-space: pre-wrap; }
@media (max-width: 600px) { .wh-brief-answers { grid-template-columns: 1fr; gap: 2px 0; } .wh-brief-answers dt { margin-top: 8px; } }

/* Kundenportal: „Deine Website"-Karte (CSP-sicher) */
.kp-site-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid rgba(44,44,42,.06); }
.kp-site-main { min-width: 0; flex: 1; }
.kp-site-title { font-weight: 600; }
.kp-site-domain { color: #888780; }
.kp-site-foot { margin-top: 10px; }

/* ── Dark-Mode-Badge-Kontrast (IndigoUI-DoD, Slice 3) ───────────────────────
   Helle „Soft"-Pillen waren im Dark-Mode kaum lesbar (heller/dunkelblauer Text
   auf hellem bzw. dunklem Grund). Idiom wie body.mode-dark .badge-soft → --ib4. */
body.mode-dark .chip-product { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); color: var(--ib4); }
body.mode-dark .kdnr-badge { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: var(--ib4); }
body.mode-dark .tt-account-rolebadge { background: rgba(133,183,235,.16); color: var(--ib4); }


/* ═══════════════════════════════════════════════════════════════════════════
   Werkstatt — Board-Oberfläche  (.ws-*)

   Diese Datei lädt die App-Shell (partials/app-head.ejs) — /werkstatt sieht
   also DIESEN Block. Derselbe Block steht am Ende von indigoui.css, weil dort
   die übrigen .ws-Regeln liegen und die Design-System-Seite nur jene Datei
   lädt. Wer hier etwas ändert, ändert es bitte dort mit.

   Liegt hier und nicht im HTML, weil die Content-Security-Policy der Plattform
   `style-src 'self'` ohne 'unsafe-inline' setzt: Jedes style-Attribut würde der
   Browser verwerfen. Aussehen also komplett hier, Verhalten in
   /public/js/werkstatt.js.

   Die Werkstatt läuft in zwei Stylesheets mit unterschiedlichen Token-Namen
   (indigocore: --ink/--graph/--glass-border/--ib2, indigoui: --ink/--text/
   --border/--accent). Statt beide Namensräume zu vermischen, übersetzt der
   Token-Block unten einmal auf eigene --ws-*-Namen — mit Fallback-Kette, damit
   derselbe Block in beiden Dateien identisch funktioniert.
   Die Namen hängen an `body` und nicht an `:root`, weil der Dunkelmodus über
   `body.mode-dark` umschaltet: Auf :root gesetzt, würden die Werte den hellen
   Stand einfrieren.
   ═══════════════════════════════════════════════════════════════════════════ */
body {
  --ws-flaeche:      var(--white, var(--surface, #FFFFFF));
  --ws-rand:         var(--glass-border, var(--border, #E4E7EC));
  --ws-linie:        var(--glass-stroke, var(--divider, #EEF0F3));
  --ws-ink:          var(--ink, #1B1F24);
  --ws-text:         var(--graph, var(--text, #3B424C));
  --ws-leise:        var(--stone, var(--muted, #6B7280));
  --ws-blass:        var(--sand, var(--faint, #9AA1AC));
  --ws-akzent:       var(--ib2, var(--accent, #185FA5));
  --ws-akzent-hell:  var(--ib3, var(--accent-2, #378ADD));
  --ws-akzent-weich: var(--ib6, var(--accent-soft, #EAF2FB));
  --ws-akzent-rand:  var(--ib5, var(--accent-soft, #B5D4F4));
  --ws-ok:           var(--ok, var(--success, #2F8559));
  --ws-warn:         var(--warn, var(--warning, #B6892F));
  --ws-err:          var(--err, var(--danger, #C0392B));
  --ws-schatten:     var(--glass-shadow, 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06));
  --ws-schrift:      var(--font, 'Lexend', -apple-system, 'Segoe UI', Roboto, sans-serif);
  --ws-mono:         ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Weiche Flächen aus der Textfarbe gemischt — funktioniert in beiden Modi,
     ohne dass es je Modus einen eigenen Wert braucht. */
  --ws-inset:        color-mix(in srgb, var(--ws-ink) 5%, transparent);
  --ws-inset-stark:  color-mix(in srgb, var(--ws-ink) 9%, transparent);
}

/* `hidden` muss auch dann greifen, wenn die Klasse display:flex setzt —
   sonst bleibt ein „versteckter" Kasten sichtbar stehen. */
.ws-meldung[hidden], .ws-feld[hidden], .ws-link[hidden], .ws-karte[hidden],
.ws-knoepfe[hidden], .ws-zaehler[hidden], .ws-sitz[hidden], .ws-lage[hidden],
.ws-stepper[hidden], .ws-zeile[hidden] { display: none !important; }

/* ── Grundbausteine ──────────────────────────────────────────────────────── */
.ws-card {
  background: var(--ws-flaeche);
  border: 1px solid var(--ws-rand);
  border-radius: var(--r-lg, 14px);
  box-shadow: var(--ws-schatten);
  overflow: hidden;
}
.ws-card-pad { padding: 16px; }
.ws-card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 16px; border-bottom: 1px solid var(--ws-linie);
}
.ws-card-title { font-size: 14.5px; font-weight: 700; color: var(--ws-ink); }
.ws-detail-titel { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-card-note { font-size: 12.5px; color: var(--ws-leise); }
.ws-stack > * + * { margin-top: 14px; }
.ws-spacer { flex: 1 1 auto; }
.ws-zeile { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ws-trenner { border: 0; border-top: 1px solid var(--ws-linie); margin: 4px 0; }
.ws-leer { font-size: 13.5px; color: var(--ws-leise); padding: 18px 16px; text-align: center; }
.ws-faint { font-size: 12px; color: var(--ws-blass); font-weight: 400; }
.ws-hinweis { font-size: 12.5px; color: var(--ws-leise); margin: 4px 0 10px; max-width: 78ch; line-height: 1.55; }
.ws-unter { font-size: 13.5px; font-weight: 700; color: var(--ws-ink); }
.ws-unter-klein { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
                  color: var(--ws-blass); margin: 10px 0 4px; }
.ws-link { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--ws-akzent); }
.ws-link:hover { text-decoration: underline; }
.ws-gefahr { color: var(--ws-err); }
.ws-knoepfe { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ws-feld { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ws-feld textarea, .ws-feld input { width: 100%; }

/* ── 1 · Lage-Leiste ─────────────────────────────────────────────────────── */
.ws-lage {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--ws-flaeche);
  border: 1px solid var(--ws-rand);
  border-radius: var(--r-lg, 14px);
  box-shadow: var(--ws-schatten);
}

.ws-pille {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-size: 11.5px; font-weight: 700; line-height: 1.5;
  padding: 3px 10px; border-radius: 100px;
  border: 1px solid transparent; white-space: nowrap;
}
.ws-pille-neutral { background: var(--ws-inset); color: var(--ws-leise); }
.ws-pille-info    { background: var(--ws-akzent-weich); color: var(--ws-akzent); border-color: var(--ws-akzent-rand); }
.ws-pille-ok      { background: color-mix(in srgb, var(--ws-ok) 14%, transparent);   color: var(--ws-ok); }
.ws-pille-warn    { background: color-mix(in srgb, var(--ws-warn) 18%, transparent); color: var(--ws-warn); }
.ws-pille-err     { background: color-mix(in srgb, var(--ws-err) 14%, transparent);  color: var(--ws-err); }

/* ── Meldezeile (eigene Klicks, nicht das Lauf-Protokoll) ────────────────── */
.ws-meldung {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--ws-rand); background: var(--ws-flaeche);
  font-size: 13px; color: var(--ws-text);
}
.ws-meldung-text { flex: 1; min-width: 0; }
.ws-meldung-zu {
  flex: none; appearance: none; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 17px; line-height: 1; color: var(--ws-blass); padding: 0 2px;
}
.ws-meldung-zu:hover { color: var(--ws-ink); }
.ws-meldung-ok   { border-color: color-mix(in srgb, var(--ws-ok) 40%, transparent);
                   background: color-mix(in srgb, var(--ws-ok) 8%, transparent); }
.ws-meldung-warn { border-color: color-mix(in srgb, var(--ws-warn) 45%, transparent);
                   background: color-mix(in srgb, var(--ws-warn) 10%, transparent); }
.ws-meldung-err  { border-color: color-mix(in srgb, var(--ws-err) 42%, transparent);
                   background: color-mix(in srgb, var(--ws-err) 8%, transparent); color: var(--ws-ink); }
.ws-meldung-info { border-color: var(--ws-akzent-rand); background: var(--ws-akzent-weich); }

/* ── Hinweiskästen ───────────────────────────────────────────────────────── */
.ws-box { border: 1px solid var(--ws-rand); border-radius: 12px; padding: 12px 14px; background: var(--ws-flaeche); }
.ws-box-titel { font-size: 13.5px; font-weight: 700; color: var(--ws-ink); }
.ws-box-text  { font-size: 13px; color: var(--ws-text); margin-top: 3px; line-height: 1.55; max-width: 80ch; }
.ws-box-warn  { border-color: color-mix(in srgb, var(--ws-warn) 45%, transparent);
                background: color-mix(in srgb, var(--ws-warn) 9%, transparent); }
.ws-box-info  { border-color: var(--ws-akzent-rand); background: var(--ws-akzent-weich); }
.ws-box-ok    { border-color: color-mix(in srgb, var(--ws-ok) 38%, transparent);
                background: color-mix(in srgb, var(--ws-ok) 7%, transparent); }
.ws-warnzeile { font-size: 12.5px; font-weight: 600; color: var(--ws-warn); margin-top: 8px; }

/* ── Ein-/Ausklappen (natives details — kein JS, CSP-sicher) ─────────────── */
.ws-details { border: 1px solid var(--ws-rand); border-radius: 10px; background: var(--ws-flaeche); }
.ws-details > summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 9px 13px; font-size: 13px; font-weight: 600; color: var(--ws-text);
  display: flex; align-items: center; gap: 7px;
}
.ws-details > summary::-webkit-details-marker { display: none; }
.ws-details > summary::before { content: "▸"; color: var(--ws-blass); font-size: 11px; }
.ws-details[open] > summary::before { content: "▾"; }
.ws-details[open] > summary { border-bottom: 1px solid var(--ws-linie); }
.ws-details > *:not(summary) { margin: 11px 13px; }

.ws-pre {
  font-family: var(--ws-schrift); font-size: 13px; line-height: 1.6; color: var(--ws-text);
  white-space: pre-wrap; word-break: break-word;
  max-height: 22rem; overflow-y: auto;
}
.ws-pre-kurz { max-height: 12rem; margin-top: 7px; }

/* ── 2 · Neues Vorhaben ──────────────────────────────────────────────────── */
.ws-neu > summary { list-style: none; cursor: pointer; padding: 13px 16px; display: block; }
.ws-neu > summary::-webkit-details-marker { display: none; }
.ws-neu-titel { display: inline-flex; align-items: center; gap: 8px;
                font-size: 14.5px; font-weight: 700; color: var(--ws-ink); }
.ws-neu-titel::before { content: "+"; display: grid; place-items: center;
  width: 21px; height: 21px; border-radius: 7px; font-size: 15px; line-height: 1;
  background: var(--ws-akzent-weich); color: var(--ws-akzent); }
.ws-neu[open] .ws-neu-titel::before { content: "–"; }
.ws-neu-sub { display: block; font-size: 12.5px; color: var(--ws-leise); margin-top: 3px; }
.ws-neu[open] > summary { border-bottom: 1px solid var(--ws-linie); }

/* ── 2 · Planungs-Sitzungen ──────────────────────────────────────────────── */
.ws-sitz { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ws-sitz-btn {
  appearance: none; font: inherit; cursor: pointer; text-align: left;
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  font-size: 12.5px; padding: 5px 11px; border-radius: 100px;
  border: 1px solid var(--ws-rand); background: var(--ws-flaeche); color: var(--ws-text);
}
.ws-sitz-btn:hover { border-color: var(--ws-akzent-hell); color: var(--ws-ink); }
.ws-sitz-btn.is-aktiv { background: var(--ws-akzent-weich); border-color: var(--ws-akzent-rand);
                        color: var(--ws-akzent); font-weight: 700; }
.ws-sitz-titel { min-width: 0; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-sitz-zahl { flex: none; font-family: var(--ws-mono); font-size: 10.5px; color: var(--ws-blass); }

/* ── 2 · Gesprächsverlauf ────────────────────────────────────────────────── */
.ws-chat {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 24rem; overflow-y: auto;
  padding: 10px; border: 1px solid var(--ws-rand); border-radius: 10px;
  background: var(--ws-inset);
}
.ws-chat:empty { display: none; }
.ws-msg { padding: 8px 11px; border-radius: 10px; max-width: 92%; font-size: 13.5px; line-height: 1.55; }
.ws-msg-wer { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
              letter-spacing: .05em; opacity: .6; margin-bottom: 2px; }
.ws-msg-text { white-space: pre-wrap; word-break: break-word; }
.ws-msg-user { align-self: flex-end; background: var(--ws-akzent-weich); color: var(--ws-ink); }
.ws-msg-assistant { align-self: flex-start; background: var(--ws-flaeche); border: 1px solid var(--ws-rand); }
.ws-msg-warten .ws-msg-text { opacity: .6; font-style: italic; }
.ws-msg-fehler { background: color-mix(in srgb, var(--ws-err) 10%, transparent);
                 border-color: color-mix(in srgb, var(--ws-err) 35%, transparent); }
.ws-msg-fehler .ws-msg-text { color: var(--ws-err); font-style: normal; opacity: 1; }

/* ── 3/4 · Board ─────────────────────────────────────────────────────────── */
.ws-board { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.ws-spalte { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 1080px) { .ws-board { grid-template-columns: 1fr; } }

/* ── 3 · Vorhaben-Karten ─────────────────────────────────────────────────── */
.ws-liste { display: flex; flex-direction: column; gap: 8px; padding: 10px; max-height: 30rem; overflow-y: auto; }
.ws-liste:empty { display: none; }
.ws-karte {
  appearance: none; font: inherit; text-align: left; cursor: pointer; width: 100%;
  display: flex; flex-direction: column; gap: 7px;
  padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--ws-rand); background: var(--ws-flaeche);
  transition: border-color .12s, box-shadow .12s;
}
.ws-karte:hover { border-color: var(--ws-akzent-hell); }
.ws-karte.is-aktiv { border-color: var(--ws-akzent-hell);
                     box-shadow: 0 0 0 3px color-mix(in srgb, var(--ws-akzent-hell) 22%, transparent); }
.ws-karte-kopf { display: flex; align-items: flex-start; gap: 8px; }
.ws-karte-titel { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 650; color: var(--ws-ink);
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ws-zaehler { display: flex; flex-wrap: wrap; gap: 5px; }
.ws-zahl {
  font-family: var(--ws-mono); font-size: 10.5px; font-variant-numeric: tabular-nums;
  color: var(--ws-leise); background: var(--ws-inset);
  border: 1px solid var(--ws-linie); border-radius: 6px; padding: 1px 6px;
}
.ws-zahl-info  { color: var(--ws-akzent); background: var(--ws-akzent-weich); border-color: var(--ws-akzent-rand); }
.ws-zahl-gruen { color: var(--ws-ok);   background: color-mix(in srgb, var(--ws-ok) 12%, transparent); }
.ws-zahl-gelb  { color: var(--ws-warn); background: color-mix(in srgb, var(--ws-warn) 16%, transparent); }
.ws-zahl-rot   { color: var(--ws-err);  background: color-mix(in srgb, var(--ws-err) 12%, transparent); }

/* ── 4 · Phasen-Fortschritt (PLAN → ENTWICKLUNG → TEST → LIVE) ───────────── */
.ws-stepper { display: flex; align-items: flex-start; gap: 0; }
.ws-step { flex: none; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ws-step-dot {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--ws-rand); background: var(--ws-flaeche); color: var(--ws-blass);
  transition: background .2s, border-color .2s, color .2s;
}
.ws-step-label { font-size: 11px; font-weight: 600; color: var(--ws-blass); text-align: center; }
.ws-step-bar { flex: 1 1 auto; min-width: 12px; height: 3px; border-radius: 2px;
               margin-top: 16px; background: var(--ws-inset-stark); }
.ws-step-bar.is-voll { background: var(--ws-ok); }
.ws-step-bar.is-halb { background: linear-gradient(90deg, var(--ws-ok) 55%, var(--ws-inset-stark) 55%); }

.ws-step.is-fertig .ws-step-dot   { background: var(--ws-ok); border-color: var(--ws-ok); color: #fff; }
.ws-step.is-fertig .ws-step-label { color: var(--ws-ok); }
.ws-step.is-aktiv .ws-step-dot    { border-color: var(--ws-akzent); color: var(--ws-akzent);
                                    background: var(--ws-akzent-weich);
                                    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ws-akzent) 15%, transparent);
                                    animation: ws-puls 1.9s ease-in-out infinite; }
.ws-step.is-aktiv .ws-step-label  { color: var(--ws-ink); font-weight: 700; }
.ws-step.is-problem .ws-step-dot  { border-color: var(--ws-err); color: var(--ws-err);
                                    background: color-mix(in srgb, var(--ws-err) 10%, transparent); }
.ws-step.is-problem .ws-step-label{ color: var(--ws-err); }
@keyframes ws-puls { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

/* Der Haken ersetzt die Ziffer, sobald die Phase durch ist — die Nummer hat
   dann keinen Informationswert mehr. */
.ws-step.is-fertig .ws-step-dot { font-size: 0; }
.ws-step.is-fertig .ws-step-dot::before { content: "✓"; font-size: 15px; }

/* ── 4 · Laufzeit + Prognose ─────────────────────────────────────────────── */
.ws-lauf { border: 1px solid var(--ws-rand); border-radius: 12px; padding: 12px 14px; background: var(--ws-inset); }
.ws-lauf-zeit { font-size: 13.5px; font-weight: 700; color: var(--ws-ink); font-variant-numeric: tabular-nums; }
.ws-lauf-rest { font-size: 12.5px; color: var(--ws-leise); }
.ws-balken { height: 7px; border-radius: 4px; background: var(--ws-inset-stark); overflow: hidden; margin-top: 9px; }
.ws-balken-fuell { height: 100%; width: 0; border-radius: 4px; background: var(--ws-akzent); transition: width .5s ease; }
/* Ohne belastbare Prognose zeigt der Balken Bewegung, aber keinen Prozentwert:
   „es läuft" ist ehrlich, eine erfundene Restzeit wäre es nicht. */
.ws-balken.is-unbestimmt .ws-balken-fuell { width: 34%; animation: ws-wander 2.2s ease-in-out infinite; }
@keyframes ws-wander { 0% { transform: translateX(-110%); } 100% { transform: translateX(320%); } }
.ws-lauf .ws-faint:empty { display: none; }

/* ── 4 · Rechtsprüfung ───────────────────────────────────────────────────── */
.ws-ampel { border: 1px solid var(--ws-rand); border-radius: 12px; padding: 12px 14px; }
.ws-ampel.is-gruen { border-color: color-mix(in srgb, var(--ws-ok) 38%, transparent);
                     background: color-mix(in srgb, var(--ws-ok) 7%, transparent); }
.ws-ampel.is-gelb  { border-color: color-mix(in srgb, var(--ws-warn) 45%, transparent);
                     background: color-mix(in srgb, var(--ws-warn) 9%, transparent); }
.ws-ampel.is-rot   { border-color: color-mix(in srgb, var(--ws-err) 45%, transparent);
                     background: color-mix(in srgb, var(--ws-err) 8%, transparent); }
.ws-ampel-licht { flex: none; width: 11px; height: 11px; border-radius: 50%;
                  background: var(--ws-blass); box-shadow: 0 0 0 3px var(--ws-inset); }
.ws-ampel-licht.is-gruen { background: var(--ws-ok); }
.ws-ampel-licht.is-gelb  { background: var(--ws-warn); }
.ws-ampel-licht.is-rot   { background: var(--ws-err); }
.ws-ampel .ws-details { margin-top: 10px; background: transparent; }

/* ── 5 · Protokoll ───────────────────────────────────────────────────────── */
.ws-log {
  max-height: 26rem; overflow-y: auto; padding: 6px 14px;
  font-family: var(--ws-mono); font-size: 12.25px; line-height: 1.55;
}
.ws-log:empty { display: none; }
.ws-ev {
  display: grid; grid-template-columns: 4.8rem 5.4rem minmax(0, 1fr); gap: 9px;
  padding: 4px 0; border-bottom: 1px solid var(--ws-linie); align-items: baseline;
}
.ws-ev:last-child { border-bottom: 0; }
.ws-ev-zeit { color: var(--ws-blass); font-variant-numeric: tabular-nums; }
.ws-ev-art  { font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: .05em;
              color: var(--ws-leise); }
.ws-ev-text { white-space: pre-wrap; word-break: break-word; color: var(--ws-text); }

.ws-ev-fehler  .ws-ev-art, .ws-ev-fehler .ws-ev-text { color: var(--ws-err); }
.ws-ev-fertig  .ws-ev-art, .ws-ev-deploy .ws-ev-art  { color: var(--ws-ok); }
.ws-ev-frage   .ws-ev-art, .ws-ev-antwort .ws-ev-art { color: var(--ws-warn); }
.ws-ev-status  .ws-ev-art { color: var(--ws-akzent); }
.ws-ev-status  .ws-ev-text { color: var(--ws-ink); }
.ws-ev-befehl  .ws-ev-text, .ws-ev-datei .ws-ev-text { color: var(--ws-leise); }

/* ── Schmale Fenster ─────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .ws-ev { grid-template-columns: minmax(0, 1fr); gap: 1px; padding: 7px 0; }
  .ws-ev-zeit, .ws-ev-art { display: inline; margin-right: 8px; }
  .ws-step { width: 68px; }
  .ws-step-label { font-size: 10px; }
  .ws-liste { max-height: none; }
}

/* Bewegung ist Beiwerk — wer sie abbestellt hat, bekommt sie nicht. */
@media (prefers-reduced-motion: reduce) {
  .ws-step.is-aktiv .ws-step-dot,
  .ws-balken.is-unbestimmt .ws-balken-fuell { animation: none; }
  .ws-balken.is-unbestimmt .ws-balken-fuell { width: 100%; opacity: .5; }
  .ws-balken-fuell, .ws-karte { transition: none; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Werkstatt — vollstaendiges Aussehen
   ═══════════════════════════════════════════════════════════════════════════
   Diese Regeln standen zuerst in indigoui.css — dort haben sie NIE gegriffen:
   partials/app-head.ejs laedt fuer alle Shell-Seiten indigocore.css, und die
   Werkstatt haengt an dieser Shell. Das Board war deshalb ein unformatierter
   Textstapel, obwohl jede einzelne Klasse definiert war. Wer sie zurueck nach
   indigoui.css schiebt, muss zuerst app-head.ejs umstellen.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   Werkstatt — Ereignis-Protokoll
   Eigener, eng gefasster Block (.ws-*). Liegt hier statt inline, weil die
   Content-Security-Policy nur Stylesheets von 'self' erlaubt.
   ═══════════════════════════════════════════════════════════════════ */
.ws-log {
  max-height: 30rem;
  overflow-y: auto;
  padding: .5rem .75rem;
  font-size: .8125rem;
  line-height: 1.5;
  font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
}
.ws-ev {
  display: grid;
  grid-template-columns: 5.5rem 6.5rem 1fr;
  gap: .5rem;
  padding: .25rem 0;
  border-bottom: 1px solid var(--line, rgba(0,0,0,.06));
  align-items: baseline;
}
.ws-ev:last-child { border-bottom: 0; }
.ws-ev-zeit { color: var(--text-muted, #6b7280); font-variant-numeric: tabular-nums; }
.ws-ev-art  { font-weight: 600; text-transform: uppercase; font-size: .6875rem; letter-spacing: .04em; }
.ws-ev-text { white-space: pre-wrap; word-break: break-word; }

.ws-ev-fehler  .ws-ev-art, .ws-ev-fehler  .ws-ev-text { color: var(--danger, #b3261e); }
.ws-ev-fertig  .ws-ev-art, .ws-ev-deploy  .ws-ev-art  { color: var(--success, #2f8559); }
.ws-ev-frage   .ws-ev-art, .ws-ev-antwort .ws-ev-art  { color: var(--warning, #b6892f); }
.ws-ev-status  .ws-ev-art { color: var(--accent, #4b3f9e); }
.ws-ev-befehl  .ws-ev-text, .ws-ev-datei .ws-ev-text { color: var(--text-muted, #6b7280); }

/* ── Werkstatt: Planungs-Gespräch ──────────────────────────────────── */
.ws-chat {
  max-height: 24rem;
  overflow-y: auto;
  padding: .5rem;
  border: 1px solid var(--line, rgba(0,0,0,.1));
  border-radius: .5rem;
  background: var(--surface-sunken, rgba(0,0,0,.02));
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.ws-chat:empty { display: none; }
.ws-msg { padding: .5rem .7rem; border-radius: .5rem; max-width: 92%; font-size: .875rem; line-height: 1.55; }
.ws-msg-wer { display: block; font-size: .6875rem; font-weight: 700; text-transform: uppercase;
              letter-spacing: .04em; opacity: .65; margin-bottom: .15rem; }
.ws-msg-text { white-space: pre-wrap; word-break: break-word; }
.ws-msg-user { align-self: flex-end; background: var(--accent-soft, rgba(75,63,158,.1)); }
.ws-msg-assistant { align-self: flex-start; background: var(--surface, rgba(0,0,0,.04)); }
.ws-msg-warten .ws-msg-text { opacity: .55; font-style: italic; }
.ws-msg-fehler { background: rgba(192,57,43,.1); }
.ws-msg-fehler .ws-msg-text { color: var(--danger, #b3261e); font-style: normal; opacity: 1; }

/* Warnhinweis in Einstellungs-/Einrichtungskarten (z. B. 2FA: alten
   Authenticator-Eintrag zuerst löschen). Bewusst zurückhaltend — es ist ein
   Hinweis, keine Fehlermeldung. */
.panel-text-warn {
  background: rgba(182,149,47,.1);
  border-left: 3px solid var(--warning, #b6952f);
  border-radius: 0 .4rem .4rem 0;
  padding: .6rem .85rem;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Werkstatt — Board-Oberfläche  (.ws-*)

   Ergänzt die älteren .ws-log/.ws-chat-Blöcke weiter oben und überschreibt sie,
   wo beide dieselbe Regel setzen. Achtung: /werkstatt lädt diese Datei NICHT
   (die App-Shell bindet indigocore.css ein) — derselbe Block steht deshalb
   auch dort. Wer hier etwas ändert, ändert es bitte dort mit.

   Liegt hier und nicht im HTML, weil die Content-Security-Policy der Plattform
   `style-src 'self'` ohne 'unsafe-inline' setzt: Jedes style-Attribut würde der
   Browser verwerfen. Aussehen also komplett hier, Verhalten in
   /public/js/werkstatt.js.

   Die Werkstatt läuft in zwei Stylesheets mit unterschiedlichen Token-Namen
   (indigocore: --ink/--graph/--glass-border/--ib2, indigoui: --ink/--text/
   --border/--accent). Statt beide Namensräume zu vermischen, übersetzt der
   Token-Block unten einmal auf eigene --ws-*-Namen — mit Fallback-Kette, damit
   derselbe Block in beiden Dateien identisch funktioniert.
   Die Namen hängen an `body` und nicht an `:root`, weil der Dunkelmodus über
   `body.mode-dark` umschaltet: Auf :root gesetzt, würden die Werte den hellen
   Stand einfrieren.
   ═══════════════════════════════════════════════════════════════════════════ */
body {
  --ws-flaeche:      var(--white, var(--surface, #FFFFFF));
  --ws-rand:         var(--glass-border, var(--border, #E4E7EC));
  --ws-linie:        var(--glass-stroke, var(--divider, #EEF0F3));
  --ws-ink:          var(--ink, #1B1F24);
  --ws-text:         var(--graph, var(--text, #3B424C));
  --ws-leise:        var(--stone, var(--muted, #6B7280));
  --ws-blass:        var(--sand, var(--faint, #9AA1AC));
  --ws-akzent:       var(--ib2, var(--accent, #185FA5));
  --ws-akzent-hell:  var(--ib3, var(--accent-2, #378ADD));
  --ws-akzent-weich: var(--ib6, var(--accent-soft, #EAF2FB));
  --ws-akzent-rand:  var(--ib5, var(--accent-soft, #B5D4F4));
  --ws-ok:           var(--ok, var(--success, #2F8559));
  --ws-warn:         var(--warn, var(--warning, #B6892F));
  --ws-err:          var(--err, var(--danger, #C0392B));
  --ws-schatten:     var(--glass-shadow, 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06));
  --ws-schrift:      var(--font, 'Lexend', -apple-system, 'Segoe UI', Roboto, sans-serif);
  --ws-mono:         ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Weiche Flächen aus der Textfarbe gemischt — funktioniert in beiden Modi,
     ohne dass es je Modus einen eigenen Wert braucht. */
  --ws-inset:        color-mix(in srgb, var(--ws-ink) 5%, transparent);
  --ws-inset-stark:  color-mix(in srgb, var(--ws-ink) 9%, transparent);
}

/* `hidden` muss auch dann greifen, wenn die Klasse display:flex setzt —
   sonst bleibt ein „versteckter" Kasten sichtbar stehen. */
.ws-meldung[hidden], .ws-feld[hidden], .ws-link[hidden], .ws-karte[hidden],
.ws-knoepfe[hidden], .ws-zaehler[hidden], .ws-sitz[hidden], .ws-lage[hidden],
.ws-stepper[hidden], .ws-zeile[hidden] { display: none !important; }

/* ── Grundbausteine ──────────────────────────────────────────────────────── */
.ws-card {
  background: var(--ws-flaeche);
  border: 1px solid var(--ws-rand);
  border-radius: var(--r-lg, 14px);
  box-shadow: var(--ws-schatten);
  overflow: hidden;
}
.ws-card-pad { padding: 16px; }
.ws-card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 16px; border-bottom: 1px solid var(--ws-linie);
}
.ws-card-title { font-size: 14.5px; font-weight: 700; color: var(--ws-ink); }
.ws-detail-titel { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-card-note { font-size: 12.5px; color: var(--ws-leise); }
.ws-stack > * + * { margin-top: 14px; }
.ws-spacer { flex: 1 1 auto; }
.ws-zeile { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ws-trenner { border: 0; border-top: 1px solid var(--ws-linie); margin: 4px 0; }
.ws-leer { font-size: 13.5px; color: var(--ws-leise); padding: 18px 16px; text-align: center; }
.ws-faint { font-size: 12px; color: var(--ws-blass); font-weight: 400; }
.ws-hinweis { font-size: 12.5px; color: var(--ws-leise); margin: 4px 0 10px; max-width: 78ch; line-height: 1.55; }
.ws-unter { font-size: 13.5px; font-weight: 700; color: var(--ws-ink); }
.ws-unter-klein { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
                  color: var(--ws-blass); margin: 10px 0 4px; }
.ws-link { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--ws-akzent); }
.ws-link:hover { text-decoration: underline; }
.ws-gefahr { color: var(--ws-err); }
.ws-knoepfe { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ws-feld { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ws-feld textarea, .ws-feld input { width: 100%; }

/* ── 1 · Lage-Leiste ─────────────────────────────────────────────────────── */
.ws-lage {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--ws-flaeche);
  border: 1px solid var(--ws-rand);
  border-radius: var(--r-lg, 14px);
  box-shadow: var(--ws-schatten);
}

.ws-pille {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  font-size: 11.5px; font-weight: 700; line-height: 1.5;
  padding: 3px 10px; border-radius: 100px;
  border: 1px solid transparent; white-space: nowrap;
}
.ws-pille-neutral { background: var(--ws-inset); color: var(--ws-leise); }
.ws-pille-info    { background: var(--ws-akzent-weich); color: var(--ws-akzent); border-color: var(--ws-akzent-rand); }
.ws-pille-ok      { background: color-mix(in srgb, var(--ws-ok) 14%, transparent);   color: var(--ws-ok); }
.ws-pille-warn    { background: color-mix(in srgb, var(--ws-warn) 18%, transparent); color: var(--ws-warn); }
.ws-pille-err     { background: color-mix(in srgb, var(--ws-err) 14%, transparent);  color: var(--ws-err); }

/* ── Meldezeile (eigene Klicks, nicht das Lauf-Protokoll) ────────────────── */
.ws-meldung {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--ws-rand); background: var(--ws-flaeche);
  font-size: 13px; color: var(--ws-text);
}
.ws-meldung-text { flex: 1; min-width: 0; }
.ws-meldung-zu {
  flex: none; appearance: none; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 17px; line-height: 1; color: var(--ws-blass); padding: 0 2px;
}
.ws-meldung-zu:hover { color: var(--ws-ink); }
.ws-meldung-ok   { border-color: color-mix(in srgb, var(--ws-ok) 40%, transparent);
                   background: color-mix(in srgb, var(--ws-ok) 8%, transparent); }
.ws-meldung-warn { border-color: color-mix(in srgb, var(--ws-warn) 45%, transparent);
                   background: color-mix(in srgb, var(--ws-warn) 10%, transparent); }
.ws-meldung-err  { border-color: color-mix(in srgb, var(--ws-err) 42%, transparent);
                   background: color-mix(in srgb, var(--ws-err) 8%, transparent); color: var(--ws-ink); }
.ws-meldung-info { border-color: var(--ws-akzent-rand); background: var(--ws-akzent-weich); }

/* ── Hinweiskästen ───────────────────────────────────────────────────────── */
.ws-box { border: 1px solid var(--ws-rand); border-radius: 12px; padding: 12px 14px; background: var(--ws-flaeche); }
.ws-box-titel { font-size: 13.5px; font-weight: 700; color: var(--ws-ink); }
.ws-box-text  { font-size: 13px; color: var(--ws-text); margin-top: 3px; line-height: 1.55; max-width: 80ch; }
.ws-box-warn  { border-color: color-mix(in srgb, var(--ws-warn) 45%, transparent);
                background: color-mix(in srgb, var(--ws-warn) 9%, transparent); }
.ws-box-info  { border-color: var(--ws-akzent-rand); background: var(--ws-akzent-weich); }
.ws-box-ok    { border-color: color-mix(in srgb, var(--ws-ok) 38%, transparent);
                background: color-mix(in srgb, var(--ws-ok) 7%, transparent); }
.ws-warnzeile { font-size: 12.5px; font-weight: 600; color: var(--ws-warn); margin-top: 8px; }

/* ── Ein-/Ausklappen (natives details — kein JS, CSP-sicher) ─────────────── */
.ws-details { border: 1px solid var(--ws-rand); border-radius: 10px; background: var(--ws-flaeche); }
.ws-details > summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 9px 13px; font-size: 13px; font-weight: 600; color: var(--ws-text);
  display: flex; align-items: center; gap: 7px;
}
.ws-details > summary::-webkit-details-marker { display: none; }
.ws-details > summary::before { content: "▸"; color: var(--ws-blass); font-size: 11px; }
.ws-details[open] > summary::before { content: "▾"; }
.ws-details[open] > summary { border-bottom: 1px solid var(--ws-linie); }
.ws-details > *:not(summary) { margin: 11px 13px; }

.ws-pre {
  font-family: var(--ws-schrift); font-size: 13px; line-height: 1.6; color: var(--ws-text);
  white-space: pre-wrap; word-break: break-word;
  max-height: 22rem; overflow-y: auto;
}
.ws-pre-kurz { max-height: 12rem; margin-top: 7px; }

/* ── 2 · Neues Vorhaben ──────────────────────────────────────────────────── */
.ws-neu > summary { list-style: none; cursor: pointer; padding: 13px 16px; display: block; }
.ws-neu > summary::-webkit-details-marker { display: none; }
.ws-neu-titel { display: inline-flex; align-items: center; gap: 8px;
                font-size: 14.5px; font-weight: 700; color: var(--ws-ink); }
.ws-neu-titel::before { content: "+"; display: grid; place-items: center;
  width: 21px; height: 21px; border-radius: 7px; font-size: 15px; line-height: 1;
  background: var(--ws-akzent-weich); color: var(--ws-akzent); }
.ws-neu[open] .ws-neu-titel::before { content: "–"; }
.ws-neu-sub { display: block; font-size: 12.5px; color: var(--ws-leise); margin-top: 3px; }
.ws-neu[open] > summary { border-bottom: 1px solid var(--ws-linie); }

/* ── 2 · Planungs-Sitzungen ──────────────────────────────────────────────── */
.ws-sitz { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ws-sitz-btn {
  appearance: none; font: inherit; cursor: pointer; text-align: left;
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  font-size: 12.5px; padding: 5px 11px; border-radius: 100px;
  border: 1px solid var(--ws-rand); background: var(--ws-flaeche); color: var(--ws-text);
}
.ws-sitz-btn:hover { border-color: var(--ws-akzent-hell); color: var(--ws-ink); }
.ws-sitz-btn.is-aktiv { background: var(--ws-akzent-weich); border-color: var(--ws-akzent-rand);
                        color: var(--ws-akzent); font-weight: 700; }
.ws-sitz-titel { min-width: 0; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-sitz-zahl { flex: none; font-family: var(--ws-mono); font-size: 10.5px; color: var(--ws-blass); }

/* ── 2 · Gesprächsverlauf ────────────────────────────────────────────────── */
.ws-chat {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 24rem; overflow-y: auto;
  padding: 10px; border: 1px solid var(--ws-rand); border-radius: 10px;
  background: var(--ws-inset);
}
.ws-chat:empty { display: none; }
.ws-msg { padding: 8px 11px; border-radius: 10px; max-width: 92%; font-size: 13.5px; line-height: 1.55; }
.ws-msg-wer { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
              letter-spacing: .05em; opacity: .6; margin-bottom: 2px; }
.ws-msg-text { white-space: pre-wrap; word-break: break-word; }
.ws-msg-user { align-self: flex-end; background: var(--ws-akzent-weich); color: var(--ws-ink); }
.ws-msg-assistant { align-self: flex-start; background: var(--ws-flaeche); border: 1px solid var(--ws-rand); }
.ws-msg-warten .ws-msg-text { opacity: .6; font-style: italic; }
.ws-msg-fehler { background: color-mix(in srgb, var(--ws-err) 10%, transparent);
                 border-color: color-mix(in srgb, var(--ws-err) 35%, transparent); }
.ws-msg-fehler .ws-msg-text { color: var(--ws-err); font-style: normal; opacity: 1; }

/* ── 3/4 · Board ─────────────────────────────────────────────────────────── */
.ws-board { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.ws-spalte { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 1080px) { .ws-board { grid-template-columns: 1fr; } }

/* ── 3 · Vorhaben-Karten ─────────────────────────────────────────────────── */
.ws-liste { display: flex; flex-direction: column; gap: 8px; padding: 10px; max-height: 30rem; overflow-y: auto; }
.ws-liste:empty { display: none; }
.ws-karte {
  appearance: none; font: inherit; text-align: left; cursor: pointer; width: 100%;
  display: flex; flex-direction: column; gap: 7px;
  padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--ws-rand); background: var(--ws-flaeche);
  transition: border-color .12s, box-shadow .12s;
}
.ws-karte:hover { border-color: var(--ws-akzent-hell); }
.ws-karte.is-aktiv { border-color: var(--ws-akzent-hell);
                     box-shadow: 0 0 0 3px color-mix(in srgb, var(--ws-akzent-hell) 22%, transparent); }
.ws-karte-kopf { display: flex; align-items: flex-start; gap: 8px; }
.ws-karte-titel { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 650; color: var(--ws-ink);
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ws-zaehler { display: flex; flex-wrap: wrap; gap: 5px; }
.ws-zahl {
  font-family: var(--ws-mono); font-size: 10.5px; font-variant-numeric: tabular-nums;
  color: var(--ws-leise); background: var(--ws-inset);
  border: 1px solid var(--ws-linie); border-radius: 6px; padding: 1px 6px;
}
.ws-zahl-info  { color: var(--ws-akzent); background: var(--ws-akzent-weich); border-color: var(--ws-akzent-rand); }
.ws-zahl-gruen { color: var(--ws-ok);   background: color-mix(in srgb, var(--ws-ok) 12%, transparent); }
.ws-zahl-gelb  { color: var(--ws-warn); background: color-mix(in srgb, var(--ws-warn) 16%, transparent); }
.ws-zahl-rot   { color: var(--ws-err);  background: color-mix(in srgb, var(--ws-err) 12%, transparent); }

/* ── 4 · Phasen-Fortschritt (PLAN → ENTWICKLUNG → TEST → LIVE) ───────────── */
.ws-stepper { display: flex; align-items: flex-start; gap: 0; }
.ws-step { flex: none; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ws-step-dot {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--ws-rand); background: var(--ws-flaeche); color: var(--ws-blass);
  transition: background .2s, border-color .2s, color .2s;
}
.ws-step-label { font-size: 11px; font-weight: 600; color: var(--ws-blass); text-align: center; }
.ws-step-bar { flex: 1 1 auto; min-width: 12px; height: 3px; border-radius: 2px;
               margin-top: 16px; background: var(--ws-inset-stark); }
.ws-step-bar.is-voll { background: var(--ws-ok); }
.ws-step-bar.is-halb { background: linear-gradient(90deg, var(--ws-ok) 55%, var(--ws-inset-stark) 55%); }

.ws-step.is-fertig .ws-step-dot   { background: var(--ws-ok); border-color: var(--ws-ok); color: #fff; }
.ws-step.is-fertig .ws-step-label { color: var(--ws-ok); }
.ws-step.is-aktiv .ws-step-dot    { border-color: var(--ws-akzent); color: var(--ws-akzent);
                                    background: var(--ws-akzent-weich);
                                    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ws-akzent) 15%, transparent);
                                    animation: ws-puls 1.9s ease-in-out infinite; }
.ws-step.is-aktiv .ws-step-label  { color: var(--ws-ink); font-weight: 700; }
.ws-step.is-problem .ws-step-dot  { border-color: var(--ws-err); color: var(--ws-err);
                                    background: color-mix(in srgb, var(--ws-err) 10%, transparent); }
.ws-step.is-problem .ws-step-label{ color: var(--ws-err); }
@keyframes ws-puls { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

/* Der Haken ersetzt die Ziffer, sobald die Phase durch ist — die Nummer hat
   dann keinen Informationswert mehr. */
.ws-step.is-fertig .ws-step-dot { font-size: 0; }
.ws-step.is-fertig .ws-step-dot::before { content: "✓"; font-size: 15px; }

/* ── 4 · Laufzeit + Prognose ─────────────────────────────────────────────── */
.ws-lauf { border: 1px solid var(--ws-rand); border-radius: 12px; padding: 12px 14px; background: var(--ws-inset); }
.ws-lauf-zeit { font-size: 13.5px; font-weight: 700; color: var(--ws-ink); font-variant-numeric: tabular-nums; }
.ws-lauf-rest { font-size: 12.5px; color: var(--ws-leise); }
.ws-balken { height: 7px; border-radius: 4px; background: var(--ws-inset-stark); overflow: hidden; margin-top: 9px; }
.ws-balken-fuell { height: 100%; width: 0; border-radius: 4px; background: var(--ws-akzent); transition: width .5s ease; }
/* Ohne belastbare Prognose zeigt der Balken Bewegung, aber keinen Prozentwert:
   „es läuft" ist ehrlich, eine erfundene Restzeit wäre es nicht. */
.ws-balken.is-unbestimmt .ws-balken-fuell { width: 34%; animation: ws-wander 2.2s ease-in-out infinite; }
@keyframes ws-wander { 0% { transform: translateX(-110%); } 100% { transform: translateX(320%); } }
.ws-lauf .ws-faint:empty { display: none; }

/* ── 4 · Rechtsprüfung ───────────────────────────────────────────────────── */
.ws-ampel { border: 1px solid var(--ws-rand); border-radius: 12px; padding: 12px 14px; }
.ws-ampel.is-gruen { border-color: color-mix(in srgb, var(--ws-ok) 38%, transparent);
                     background: color-mix(in srgb, var(--ws-ok) 7%, transparent); }
.ws-ampel.is-gelb  { border-color: color-mix(in srgb, var(--ws-warn) 45%, transparent);
                     background: color-mix(in srgb, var(--ws-warn) 9%, transparent); }
.ws-ampel.is-rot   { border-color: color-mix(in srgb, var(--ws-err) 45%, transparent);
                     background: color-mix(in srgb, var(--ws-err) 8%, transparent); }
.ws-ampel-licht { flex: none; width: 11px; height: 11px; border-radius: 50%;
                  background: var(--ws-blass); box-shadow: 0 0 0 3px var(--ws-inset); }
.ws-ampel-licht.is-gruen { background: var(--ws-ok); }
.ws-ampel-licht.is-gelb  { background: var(--ws-warn); }
.ws-ampel-licht.is-rot   { background: var(--ws-err); }
.ws-ampel .ws-details { margin-top: 10px; background: transparent; }

/* ── 5 · Protokoll ───────────────────────────────────────────────────────── */
.ws-log {
  max-height: 26rem; overflow-y: auto; padding: 6px 14px;
  font-family: var(--ws-mono); font-size: 12.25px; line-height: 1.55;
}
.ws-log:empty { display: none; }
.ws-ev {
  display: grid; grid-template-columns: 4.8rem 5.4rem minmax(0, 1fr); gap: 9px;
  padding: 4px 0; border-bottom: 1px solid var(--ws-linie); align-items: baseline;
}
.ws-ev:last-child { border-bottom: 0; }
.ws-ev-zeit { color: var(--ws-blass); font-variant-numeric: tabular-nums; }
.ws-ev-art  { font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: .05em;
              color: var(--ws-leise); }
.ws-ev-text { white-space: pre-wrap; word-break: break-word; color: var(--ws-text); }

.ws-ev-fehler  .ws-ev-art, .ws-ev-fehler .ws-ev-text { color: var(--ws-err); }
.ws-ev-fertig  .ws-ev-art, .ws-ev-deploy .ws-ev-art  { color: var(--ws-ok); }
.ws-ev-frage   .ws-ev-art, .ws-ev-antwort .ws-ev-art { color: var(--ws-warn); }
.ws-ev-status  .ws-ev-art { color: var(--ws-akzent); }
.ws-ev-status  .ws-ev-text { color: var(--ws-ink); }
.ws-ev-befehl  .ws-ev-text, .ws-ev-datei .ws-ev-text { color: var(--ws-leise); }

/* ── Schmale Fenster ─────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .ws-ev { grid-template-columns: minmax(0, 1fr); gap: 1px; padding: 7px 0; }
  .ws-ev-zeit, .ws-ev-art { display: inline; margin-right: 8px; }
  .ws-step { width: 68px; }
  .ws-step-label { font-size: 10px; }
  .ws-liste { max-height: none; }
}

/* Bewegung ist Beiwerk — wer sie abbestellt hat, bekommt sie nicht. */
@media (prefers-reduced-motion: reduce) {
  .ws-step.is-aktiv .ws-step-dot,
  .ws-balken.is-unbestimmt .ws-balken-fuell { animation: none; }
  .ws-balken.is-unbestimmt .ws-balken-fuell { width: 100%; opacity: .5; }
  .ws-balken-fuell, .ws-karte { transition: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Werkstatt — Kimi-Kopf
   ═══════════════════════════════════════════════════════════════════════════
   Steht ganz oben und beantwortet die eine Frage, die man beim Öffnen hat:
   arbeitet er, und woran? Das Attribut data-zustand am Kasten steuert Farbe
   und Bewegung (gesetzt von werkstatt.js) — dadurch braucht das JS kein
   style-Attribut, was die Content-Security-Policy ohnehin verböte.

   Bewegung ist hier Information, nicht Dekoration: Der Ring pulst nur, wenn
   wirklich etwas läuft. Steht er still, steht auch Kimi. Wer
   prefers-reduced-motion gesetzt hat, bekommt denselben Zustand ohne Zappeln.
   ═══════════════════════════════════════════════════════════════════════════ */

.ws-kimi {
  display: flex; align-items: flex-start; gap: .9rem;
  padding: .95rem 1.1rem; margin-bottom: .6rem;
  border: 1px solid var(--line, rgba(0,0,0,.1));
  border-left: 3px solid var(--line, rgba(0,0,0,.15));
  border-radius: .75rem;
  background: var(--surface, #fff);
  transition: border-left-color .4s ease, background .4s ease;
}

/* ── Avatar mit Puls ───────────────────────────────────────────────────── */
.ws-kimi-avatar { position: relative; flex: 0 0 auto; width: 2.6rem; height: 2.6rem; }
.ws-kimi-initial {
  position: absolute; inset: 0; display: grid; place-items: center;
  border-radius: 50%; font-weight: 800; font-size: 1.05rem; color: #fff;
  background: var(--text-muted, #6b7280);
  transition: background .4s ease;
}
.ws-kimi-ring {
  position: absolute; inset: -.35rem; border-radius: 50%;
  border: 2px solid currentColor; color: var(--text-muted, #6b7280);
  opacity: 0; transform: scale(.8);
}

/* ── Text ──────────────────────────────────────────────────────────────── */
.ws-kimi-mitte { flex: 1 1 auto; min-width: 0; }
.ws-kimi-kopf  { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.ws-kimi-name  { font-weight: 800; font-size: 1rem; }
.ws-kimi-tut   { font-size: .9375rem; color: var(--text-muted, #4b5563); }
.ws-kimi-runde {
  font-size: .75rem; font-weight: 700; padding: .12rem .5rem; border-radius: 100px;
  background: var(--surface-sunken, rgba(0,0,0,.05)); color: var(--text-muted, #4b5563);
  font-variant-numeric: tabular-nums;
}
.ws-kimi-woran {
  margin: .3rem 0 0; font-size: .875rem; line-height: 1.5;
  color: var(--text, #1a2027);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ws-kimi-fuss  { display: flex; align-items: baseline; gap: .5rem; margin-top: .35rem; }
.ws-kimi-zeit, .ws-kimi-rest {
  font-size: .8125rem; color: var(--text-muted, #6b7280); font-variant-numeric: tabular-nums;
}
.ws-kimi-zeit:empty, .ws-kimi-rest:empty { display: none; }

/* ── Denkpunkte ────────────────────────────────────────────────────────── */
.ws-kimi-punkte { display: inline-flex; gap: .18rem; align-items: center; }
.ws-kimi-punkte i {
  width: .3rem; height: .3rem; border-radius: 50%; background: currentColor;
  color: var(--accent, #4b3f9e); opacity: .35;
}

/* ── Fortschrittsbalken ────────────────────────────────────────────────── */
.ws-kimi-balken {
  height: .3rem; border-radius: 100px; margin-top: .5rem; overflow: hidden;
  background: var(--line, rgba(0,0,0,.1));
}
.ws-kimi-fuell {
  height: 100%; width: 0; border-radius: 100px;
  background: var(--accent, #4b3f9e);
  transition: width .9s linear;
}

/* ── Warteschlange darunter ────────────────────────────────────────────── */
.ws-kimi-schlange {
  margin: 0 0 1rem; padding: .45rem .8rem;
  font-size: .8125rem; color: var(--text-muted, #6b7280);
  background: var(--surface-sunken, rgba(0,0,0,.03));
  border-radius: .5rem;
}

/* ══ Zustände ══════════════════════════════════════════════════════════════ */

/* Ruhe — nichts bewegt sich. */
.ws-kimi[data-zustand="ruhe"] .ws-kimi-woran { color: var(--text-muted, #6b7280); }

/* Runner nicht erreichbar. */
.ws-kimi[data-zustand="weg"] { border-left-color: var(--danger, #b3261e); }
.ws-kimi[data-zustand="weg"] .ws-kimi-initial { background: var(--danger, #b3261e); }

/* Arbeitet — Ring pulst, Punkte laufen. */
.ws-kimi[data-zustand="entwickelt"],
.ws-kimi[data-zustand="denkt"],
.ws-kimi[data-zustand="test"],
.ws-kimi[data-zustand="deploy"] {
  border-left-color: var(--accent, #4b3f9e);
  background: linear-gradient(90deg, rgba(75,63,158,.05), transparent 60%);
}
.ws-kimi[data-zustand="entwickelt"] .ws-kimi-initial,
.ws-kimi[data-zustand="denkt"] .ws-kimi-initial,
.ws-kimi[data-zustand="test"] .ws-kimi-initial,
.ws-kimi[data-zustand="deploy"] .ws-kimi-initial { background: var(--accent, #4b3f9e); }

.ws-kimi[data-zustand="entwickelt"] .ws-kimi-ring,
.ws-kimi[data-zustand="denkt"] .ws-kimi-ring,
.ws-kimi[data-zustand="test"] .ws-kimi-ring,
.ws-kimi[data-zustand="deploy"] .ws-kimi-ring {
  color: var(--accent, #4b3f9e);
  animation: ws-puls 1.9s ease-out infinite;
}
.ws-kimi[data-zustand="entwickelt"] .ws-kimi-punkte i,
.ws-kimi[data-zustand="denkt"] .ws-kimi-punkte i,
.ws-kimi[data-zustand="test"] .ws-kimi-punkte i,
.ws-kimi[data-zustand="deploy"] .ws-kimi-punkte i {
  animation: ws-huepf 1.25s ease-in-out infinite;
}
.ws-kimi-punkte i:nth-child(2) { animation-delay: .16s; }
.ws-kimi-punkte i:nth-child(3) { animation-delay: .32s; }

/* Rückfrage — bernstein, ruhiger Atem statt Puls: es wartet auf einen Menschen. */
.ws-kimi[data-zustand="frage"] {
  border-left-color: var(--warning, #b6952f);
  background: linear-gradient(90deg, rgba(182,149,47,.09), transparent 60%);
}
.ws-kimi[data-zustand="frage"] .ws-kimi-initial { background: var(--warning, #b6952f); }
.ws-kimi[data-zustand="frage"] .ws-kimi-ring {
  color: var(--warning, #b6952f); opacity: .5; transform: scale(1);
  animation: ws-atem 2.6s ease-in-out infinite;
}
.ws-kimi[data-zustand="frage"] .ws-kimi-woran { font-weight: 600; }

/* Unbekannte Dauer: der Balken wandert, statt eine erfundene Prozentzahl zu zeigen. */
.ws-kimi-balken.is-unbestimmt .ws-kimi-fuell {
  width: 35%;
  animation: ws-wandern 1.7s ease-in-out infinite;
}

@keyframes ws-puls {
  0%   { opacity: .55; transform: scale(.85); }
  70%  { opacity: 0;   transform: scale(1.25); }
  100% { opacity: 0;   transform: scale(1.25); }
}
@keyframes ws-huepf {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30%           { opacity: 1;  transform: translateY(-.22rem); }
}
@keyframes ws-atem {
  0%, 100% { opacity: .25; }
  50%      { opacity: .7; }
}
@keyframes ws-wandern {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}

/* Wer Bewegung abgestellt hat, bekommt denselben Zustand — nur ohne Zappeln.
   Der Ring bleibt sichtbar, damit "arbeitet" trotzdem erkennbar ist. */
@media (prefers-reduced-motion: reduce) {
  .ws-kimi-ring, .ws-kimi-punkte i, .ws-kimi-fuell { animation: none; }
  .ws-kimi[data-zustand="entwickelt"] .ws-kimi-ring,
  .ws-kimi[data-zustand="denkt"] .ws-kimi-ring,
  .ws-kimi[data-zustand="test"] .ws-kimi-ring,
  .ws-kimi[data-zustand="deploy"] .ws-kimi-ring,
  .ws-kimi[data-zustand="frage"] .ws-kimi-ring { opacity: .6; transform: scale(1); }
  .ws-kimi-punkte i { opacity: .6; }
  .ws-kimi-balken.is-unbestimmt .ws-kimi-fuell { width: 100%; opacity: .45; }
}

@media (max-width: 600px) {
  .ws-kimi { flex-direction: column; }
  .ws-kimi-woran { -webkit-line-clamp: 4; }
}
