/* ==========================================================================
   Easy Chat – Designsystem im Corporate Design von EasySite
   Nacht/Papier, Tinte, ein Akzent (Lime). Details: README, Abschnitt „Design“.
   Alle Werte kommen aus den Tokens unten. Komponenten verwenden nur Tokens.
   ========================================================================== */

/* ---------- 0. Schriften: selbst gehostet (SIL Open Font License, Lizenzen in web/fonts/) ---------- */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/bricolage-grotesque-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Archivo nur für die Wortmarke „easysite“ (variable Schrift: Breite 112 %, Stärke 800) */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url(fonts/archivo-latin-wdth-normal.woff2) format("woff2-variations"), url(fonts/archivo-latin-wdth-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

/* ---------- 1. Tokens: EasySite – Dunkel „Chill“ (Standard) ---------- */
:root {
  /* Flächen */
  --bg: #0d0f0c;               /* Nacht */
  --surface: #151913;
  --surface-2: #1c2119;
  --bg-subtle: #111410;
  --bg-muted: #1c2119;         /* = surface-2: Chips, Codes, Platzhalter */
  --bg-hover: #20261c;
  --bg-active: #272e22;
  /* Linien */
  --line: #2d3428;
  --line-strong: #3b4434;
  --border: var(--line);
  /* Text (alle ≥ 4,5 : 1 auf allen Flächen, siehe README „Design“) */
  --text: #eef0ea;
  --text-2: #c8cdc1;
  --text-muted: #a2a99a;
  --text-3: var(--text-muted);
  /* Akzent Lime – nur als Akzent (aktiver Eintrag, primärer Knopf, Zähler, Ungelesen, Fokus) */
  --accent: #c8f03c;
  --accent-hover: #d4f560;
  --on-accent: #1c2500;        /* Schrift auf Lime */
  --accent-text: #c8f03c;      /* Lime als Schrift: nur im dunklen Design */
  --accent-soft: #22290f;
  --accent-strong: var(--accent);
  --agent-ink: #c8f03c;        /* Initialen der Agenten */
  --logo-body: #eef0ea;        /* Schalter: hell auf Nacht */
  --focus-inner: transparent;
  --focus-border: #c8f03c;
  --grid-dot: rgba(200, 240, 60, .045);  /* Punktraster der leeren Chat-Fläche */
  --grid-dot-login: rgba(200, 240, 60, .07);
  /* Zustände – getrennt vom Akzent */
  --ok: #7bd389;       --ok-soft: #17261a;     --ok-text: #7bd389;
  --warn: #ffd36b;     --warn-soft: #2b2512;   --warn-text: #ffd36b;
  --danger: #ff6b5b;   --danger-soft: #2e1612; --danger-text: #ff6b5b;
  --on-state: #1a0503; /* Schrift auf Rot/Gelb/Grün (Not-Aus-Balken) */
  --mention-bg: #2a3311; --mention-text: #d9f57a;
  /* Präsenz */
  --online: #7bd389; --away: #ffd36b; --dnd: #ff6b5b; --offline: #5f6658;
  /* Aufgaben (Erbe aus Easy Company, ohne Blauviolett) */
  --st-open: #7d8475; --st-progress: #6fa8dc; --st-review: #d9f57a; --st-blocked: #ff6b5b; --st-done: #7bd389;
  --pr-critical: #ff6b5b; --pr-high: #ffb35b; --pr-normal: #c8f03c; --pr-low: #7d8475;
  /* Sprechblasen */
  --bubble-theirs: var(--surface);
  --bubble-mine: #222a1c;
  /* Typografie */
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --font-brand: "Archivo", "Arial Black", system-ui, sans-serif;
  --fs-2xs: 11px; --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 22px; --fs-2xl: 28px;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 600; /* Plex Sans liegt bis 600 vor – kein künstliches Fett */
  --lh-tight: 1.25; --lh: 1.55;
  /* Abstände */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;
  /* Radien: Karten und Blasen 12–14 px, Chips und Knöpfe als Pille */
  --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 14px; --r-full: 999px;
  --h-sm: 28px; --h: 32px; --h-lg: 40px;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-float: 0 0 0 1px rgba(238, 240, 234, .07), 0 10px 30px rgba(0, 0, 0, .55);
  --ring: 0 0 0 3px rgba(200, 240, 60, .35);
  --scrim: rgba(0, 0, 0, .55);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sidebar-w: 244px;
  --chatlist-w: 288px;
  color-scheme: dark;
}

/* ---------- 2. Tokens: Hell „Flashbang“ (gewählt oder „Wie das Gerät“ bei hellem Gerät) ---------- */
:root[data-theme="light"] {
  --bg: #f6f7f2; --surface: #ffffff; --surface-2: #eef0e8; --bg-subtle: #f0f2eb; --bg-muted: #eef0e8; --bg-hover: #e8ebe1; --bg-active: #e1e5d8;
  --line: #d9ddd2; --line-strong: #c3c9bb;
  --text: #111311; --text-2: #3b3f37; --text-muted: #5d6259;
  --accent: #c8f03c; --accent-hover: #b9e22c; --on-accent: #1c2500;
  --accent-text: #3d5200;      /* Lime nie als Schrift auf Hell (1,3 : 1) */
  --accent-soft: #eef7cf; --agent-ink: #111311; --logo-body: #111311;
  --focus-inner: #111311; --focus-border: #3d5200;
  --grid-dot: transparent; --grid-dot-login: rgba(17, 19, 17, .08);
  --ok-soft: #e7f6ea; --ok-text: #2c6b36; --warn-soft: #fff5d9; --warn-text: #7a5300; --danger-soft: #ffe9e6; --danger-text: #b3261e;
  --mention-bg: #f1f9d6; --mention-text: #3d5200;
  --offline: #a7ad9f; --st-open: #8a9082; --st-progress: #2e6fb0; --st-review: #5c7a00; --pr-normal: #5c7a00; --pr-low: #8a9082; --pr-high: #c7700d; --pr-critical: #b3261e;
  --bubble-theirs: #ffffff; --bubble-mine: #e7edd9;
  --shadow-xs: 0 1px 2px rgba(17, 19, 17, .05);
  --shadow-float: 0 0 0 1px rgba(17, 19, 17, .06), 0 6px 16px rgba(17, 19, 17, .08), 0 18px 40px rgba(17, 19, 17, .08);
  --ring: 0 0 0 3px rgba(200, 240, 60, .55);
  --scrim: rgba(17, 19, 17, .35);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg: #f6f7f2; --surface: #ffffff; --surface-2: #eef0e8; --bg-subtle: #f0f2eb; --bg-muted: #eef0e8; --bg-hover: #e8ebe1; --bg-active: #e1e5d8;
    --line: #d9ddd2; --line-strong: #c3c9bb;
    --text: #111311; --text-2: #3b3f37; --text-muted: #5d6259;
    --accent: #c8f03c; --accent-hover: #b9e22c; --on-accent: #1c2500;
    --accent-text: #3d5200;
    --accent-soft: #eef7cf; --agent-ink: #111311; --logo-body: #111311;
    --focus-inner: #111311; --focus-border: #3d5200;
    --grid-dot: transparent; --grid-dot-login: rgba(17, 19, 17, .08);
    --ok-soft: #e7f6ea; --ok-text: #2c6b36; --warn-soft: #fff5d9; --warn-text: #7a5300; --danger-soft: #ffe9e6; --danger-text: #b3261e;
    --mention-bg: #f1f9d6; --mention-text: #3d5200;
    --offline: #a7ad9f; --st-open: #8a9082; --st-progress: #2e6fb0; --st-review: #5c7a00; --pr-normal: #5c7a00; --pr-low: #8a9082; --pr-high: #c7700d; --pr-critical: #b3261e;
    --bubble-theirs: #ffffff; --bubble-mine: #e7edd9;
    --shadow-xs: 0 1px 2px rgba(17, 19, 17, .05);
    --shadow-float: 0 0 0 1px rgba(17, 19, 17, .06), 0 6px 16px rgba(17, 19, 17, .08), 0 18px 40px rgba(17, 19, 17, .08);
    --ring: 0 0 0 3px rgba(200, 240, 60, .55);
    --scrim: rgba(17, 19, 17, .35);
    color-scheme: light;
  }
}

/* ---------- 3. Basis ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font: var(--fw-regular) var(--fs-base)/var(--lh) var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ic { flex-shrink: 0; display: block; }
.grow { flex: 1; min-width: 0; }
.muted, .meta { color: var(--text-3); font-size: var(--fs-sm); }
.sub { display: block; color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-regular); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { font: var(--fs-2xs)/1 var(--font); color: var(--text-3); border: 1px solid var(--line-strong); border-radius: 4px; padding: 2px 5px; background: var(--surface); }

/* ---------- 4. Marke ---------- */
/* Logo-Hülle: Inhalt aus brandMark() (Schalter + Wortmarke), Gestaltung siehe .brand-logo */
.brand-mark { display: inline-flex; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; color: var(--text); text-decoration: none; }

/* ---------- 5. Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--h); padding: 0 var(--sp-3); border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap; box-shadow: var(--shadow-xs); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--bg-hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { border-color: var(--accent-hover); background: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); box-shadow: none; }
.btn.ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn.small { height: var(--h-sm); padding: 0 10px; font-size: var(--fs-xs); }
.btn.lg { height: var(--h-lg); font-size: var(--fs-base); }
.btn.danger-solid { border-color: var(--danger); background: var(--danger); color: var(--on-state); }
.icon-btn { display: inline-grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border: 0; border-radius: var(--r); background: transparent; color: var(--text-3); transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.active { color: var(--accent-text); }
.icon-btn.star.active { color: #d39a1c; }
.icon-btn.star.active svg { fill: currentColor; }
.icon-btn.small { width: 24px; height: 24px; border-radius: var(--r-sm); }
.link-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--accent-text); font-size: var(--fs-sm); text-decoration: none; }
.link-btn:hover { text-decoration: underline; }
.pill-btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 var(--sp-2); border: 0; border-radius: var(--r); background: transparent; color: var(--text-3); font-size: var(--fs-sm); }
.pill-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ---------- 6. Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field-label { color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
input:not([type="checkbox"]):not([type="radio"]):not(.title-input), select, textarea { border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--text); font-size: var(--fs-sm); transition: border-color .12s, box-shadow .12s; }
input:not([type="checkbox"]):not([type="radio"]), select { height: var(--h); padding: 0 10px; }
textarea { padding: 8px 10px; line-height: var(--lh); resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: var(--ring); }
.search-field { display: flex; align-items: center; gap: var(--sp-2); min-width: 180px; height: var(--h); padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text-3); transition: border-color .12s, box-shadow .12s; }
.search-field:hover { border-color: var(--line-strong); }
.search-field:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.search-field input { flex: 1; min-width: 0; height: 100%; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; }
.search-field.compact { height: 30px; border-color: transparent; background: var(--bg-muted); }
.form-error { margin: 0; color: var(--danger) !important; font-size: var(--fs-sm); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.switch { appearance: none; position: relative; flex-shrink: 0; width: 34px; height: 20px !important; padding: 0 !important; border: 0 !important; border-radius: var(--r-full) !important; background: var(--line-strong) !important; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch:checked { background: var(--accent) !important; }
.switch:checked::after { transform: translateX(14px); }
.switch.small { width: 28px; height: 16px !important; }
.switch.small::after { width: 10px; height: 10px; }
.switch.small:checked::after { transform: translateX(12px); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: 2px 0; cursor: pointer; }
.switch-row strong { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.segmented { display: flex; gap: 2px; padding: 2px; border-radius: var(--r); background: var(--bg-muted); }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 28px; border-radius: var(--r-sm); color: var(--text-3); font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.checkbox { display: grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); color: transparent; }

/* ---------- 7. Chips, Zähler, Kennzeichnungen ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-full); background: var(--surface); color: var(--text-2); font-size: var(--fs-xs); transition: border-color .12s, background .12s; }
button.chip:hover, span.chip[data-id]:hover { border-color: var(--text-3); color: var(--text); cursor: pointer; }
.chip.active { border-color: var(--text); background: var(--text); color: var(--bg); }
.chip.static { cursor: default; }
.chip .sub { display: inline; font-size: var(--fs-2xs); }
.badge, .tab-count { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: var(--r-full); background: var(--accent); color: var(--on-accent); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); line-height: 17px; text-align: center; }
.tab-count { background: var(--accent-soft); color: var(--accent-text); }
.tab-count.muted-count { min-width: 0; padding: 0; background: none; color: var(--text-3); }
.tab-count.danger { background: var(--danger-soft); color: var(--danger); }
.count, .nav-count { color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.tag, .prio, .kind-chip { padding: 0 6px; border-radius: var(--r-sm); font-size: var(--fs-2xs); font-weight: var(--fw-medium); line-height: 18px; }
.tag, .kind-chip { background: var(--bg-muted); color: var(--text-3); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.prio.hoch { background: var(--danger-soft); color: var(--danger); }
.prio.mittel { background: var(--warn-soft); color: var(--warn); }
.badge-chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; border-radius: var(--r-sm); background: var(--bg-muted); color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 20px; text-decoration: none; }
a.badge-chip:hover { background: var(--bg-active); }
.badge-chip.pin { background: var(--warn-soft); color: var(--warn); }
.badge-chip.task { background: var(--accent-soft); color: var(--accent-text); }
.badge-chip.task.done, .badge-chip.info { background: var(--ok-soft); color: var(--ok); }
.badge-chip.task.done { text-decoration: line-through; }

/* ---------- 8. Avatare & Präsenz ---------- */
.avatar { --size: 32px; position: relative; display: inline-grid; place-items: center; flex-shrink: 0; width: var(--size); height: var(--size); border-radius: 50%; color: #fff; font-size: calc(var(--size) * .42); font-weight: var(--fw-semibold); line-height: 1; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--bg); }
.avatar-stack .avatar + .avatar { margin-left: -6px; }
.status-dot { position: absolute; right: -1px; bottom: -1px; width: max(9px, calc(var(--size) * .3)); height: max(9px, calc(var(--size) * .3)); border: 2px solid var(--bg); border-radius: 50%; background: var(--offline); }
.status-dot.inline { position: static; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border: 0; }
.status-dot.online { background: var(--online); }
.status-dot.away { background: var(--away); }
.status-dot.dnd { background: var(--dnd); }
.status-dot.offline { background: var(--bg); box-shadow: inset 0 0 0 2px var(--offline); }
.status-dot.inline.offline { background: transparent; }

/* ---------- 9. Overlays: Menü, Popover, Dialog, Toast ---------- */
.menu, .emoji-popup, .mention-popup, .profile-card { position: fixed; z-index: 50; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-float); animation: pop .12s var(--ease); }
@keyframes pop { from { transform: translateY(3px); opacity: 0; } }
.menu { min-width: 220px; padding: var(--sp-1); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 30px; padding: 0 var(--sp-2); border: 0; border-radius: var(--r-sm); background: none; color: var(--text); font-size: var(--fs-sm); text-align: left; }
.menu-item:hover { background: var(--bg-hover); }
.menu-item.danger, .menu-item.danger .menu-icon { color: var(--danger); }
.menu-icon { display: grid; place-items: center; width: 16px; color: var(--text-3); }
.menu-hint { color: var(--text-3); font-size: var(--fs-xs); }
.menu-sep { height: 1px; margin: var(--sp-1) 0; background: var(--line); }
.menu-heading { padding: 6px var(--sp-2) 2px; color: var(--text-3); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); }
.emoji-popup { display: grid; grid-template-columns: repeat(8, 32px); gap: 2px; padding: 6px; }
.emoji-popup button { height: 32px; border: 0; border-radius: var(--r-sm); background: none; font-size: 18px; }
.emoji-popup button:hover { background: var(--bg-hover); }
.mention-popup { min-width: 240px; padding: var(--sp-1); }
.mention-popup div { display: flex; align-items: center; gap: var(--sp-2); height: 32px; padding: 0 var(--sp-2); border-radius: var(--r-sm); cursor: pointer; }
.mention-popup div .sub { margin-left: auto; }
.mention-popup div.sel, .mention-popup div:hover { background: var(--bg-hover); }
.profile-card { width: 280px; padding: var(--sp-4); }
.profile-top { display: flex; align-items: center; gap: var(--sp-3); }
.profile-top > div { display: flex; flex-direction: column; min-width: 0; }
.profile-top strong { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.profile-status { margin: var(--sp-3) 0 0; padding: var(--sp-2) 10px; border-radius: var(--r); background: var(--bg-muted); font-size: var(--fs-sm); }
.profile-actions { display: flex; margin-top: var(--sp-3); }
.profile-actions .btn { flex: 1; }

.dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: var(--r-xl); background: var(--surface); color: var(--text); box-shadow: var(--shadow-float); }
.dialog.wide { width: min(640px, calc(100vw - 32px)); }
.dialog[open] { animation: dialog-in .16s var(--ease); }
@keyframes dialog-in { from { transform: translateY(6px) scale(.985); opacity: 0; } }
.dialog::backdrop { background: var(--scrim); }
.dialog-inner { display: flex; flex-direction: column; gap: 14px; padding: var(--sp-6); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin: -4px -10px -2px 0; }
.dialog h3 { display: flex; align-items: center; gap: var(--sp-2); margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semibold); letter-spacing: -.005em; }
.dialog h4 { margin: 10px 0 4px; color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.dialog label:not(.switch-row):not(.status-option):not(.search-field):not(.segmented label):not(.check-inline) { display: flex; flex-direction: column; gap: 5px; color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.dialog input:not([type="checkbox"]):not([type="radio"]), .dialog select { height: 34px; }
.dialog-buttons { display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: 6px; }
.confirm-text { margin: 4px 0; font-size: var(--fs-base); }
.pick-list { max-height: 46vh; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.pick-list li { display: flex; align-items: center; gap: 10px; padding: 7px var(--sp-2); border-radius: var(--r); cursor: pointer; }
.pick-list li:hover, .pick-list li.sel { background: var(--bg-hover); }
.pick-list .empty-row { justify-content: center; color: var(--text-3); cursor: default; }
.check-list { max-height: 240px; }
.check-list li.checked .checkbox { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.people-pick { display: flex; flex-direction: column; gap: var(--sp-2); }
.info-box { padding: 10px 14px; border-radius: var(--r-lg); background: var(--bg-subtle); color: var(--text-2); font-size: var(--fs-sm); }
.info-box ul { margin: 6px 0 0; padding-left: 18px; }
.info-box .ic { display: inline; vertical-align: -2px; }
.ai-note, .ai-label { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--text-3); font-size: var(--fs-xs); }
.ai-label { font-weight: var(--fw-semibold); }
.quote-preview { margin: 0; padding: 4px 12px; border-left: 2px solid var(--accent); color: var(--text-2); font-size: var(--fs-sm); }
.summary { display: flex; flex-direction: column; gap: 4px; }
.summary-list { margin: 0; padding-left: 18px; }
.summary-list li + li { margin-top: 3px; }
.pins-list { max-height: 60vh; padding: 0; }
.pin-row { display: block; border-radius: var(--r-lg); color: inherit; text-decoration: none; }
.pin-row .msg-actions, .pin-row .day-divider { display: none !important; }
.status-options { display: flex; flex-direction: column; gap: 2px; }
.status-option { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 10px; border-radius: var(--r-lg); cursor: pointer; }
.status-option:hover { background: var(--bg-hover); }
.status-option:has(input:checked) { background: var(--accent-soft); }
.status-option input { display: none; }
.status-option .status-dot { position: static; border: 0; }
.status-input { display: flex; gap: var(--sp-2); }
.status-input .emoji-input { width: 52px; text-align: center; }
.status-input input:last-child { flex: 1; }
.notices { position: fixed; top: var(--sp-4); right: var(--sp-4); z-index: 60; display: flex; flex-direction: column; gap: var(--sp-2); width: min(340px, calc(100vw - 32px)); }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: var(--sp-3); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-float); cursor: pointer; animation: notice-in .2s var(--ease); }
@keyframes notice-in { from { transform: translateX(16px); opacity: 0; } }
.notice-icon { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--bg-muted); color: var(--text-2); }
.notice-body { display: flex; flex: 1; flex-direction: column; min-width: 0; font-size: var(--fs-sm); }
.notice-body strong { font-weight: var(--fw-semibold); }
.notice-body span { display: -webkit-box; overflow: hidden; color: var(--text-2); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.toast { position: fixed; bottom: var(--sp-6); left: 50%; z-index: 70; max-width: calc(100vw - 32px); padding: 9px var(--sp-4); border-radius: var(--r-lg); background: var(--text); color: var(--bg); font-size: var(--fs-sm); box-shadow: var(--shadow-float); transform: translateX(-50%); animation: toast-in .2s var(--ease); }
.toast.error { background: var(--danger); }
@keyframes toast-in { from { transform: translate(-50%, 6px); opacity: 0; } }

/* ---------- 10. Zustände: leer, laden ---------- */
.empty { padding: 64px var(--sp-5); color: var(--text-3); text-align: center; }
.empty h3 { margin: var(--sp-3) 0 4px; color: var(--text); font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.empty p { margin: 0 0 var(--sp-4); }
.empty-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-xl); background: var(--bg-muted); color: var(--text-3); }
.empty-line { padding: var(--sp-3) 4px; color: var(--text-3); font-size: var(--fs-sm); }
.loading { display: grid; gap: var(--sp-3); padding: var(--sp-6); }
.skeleton { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-muted), var(--bg-hover), var(--bg-muted)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.skeleton.short { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 11. Login ---------- */
.login { display: grid; place-items: center; height: 100%; padding: var(--sp-4); background: var(--bg-subtle); }
.login-card { display: flex; flex-direction: column; gap: var(--sp-3); width: min(380px, 100%); padding: var(--sp-10) var(--sp-8) var(--sp-8); border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-xs); text-align: center; }
.login-card .brand-mark { margin: 0 auto var(--sp-2); }
.login-card h1 { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: -.02em; }
.login-card p { margin: 0 0 var(--sp-2); color: var(--text-3); }
.login-card input { height: var(--h-lg) !important; }

/* ---------- 12. Layout & Seitenleiste ---------- */
.app { display: flex; height: 100%; overflow: hidden; }
.main { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.page { flex: 1; min-height: 0; overflow-y: auto; }
@keyframes slide-in { from { transform: translateX(12px); opacity: 0; } }

/* Navigationsgruppen (Favoriten in der Seitenleiste, Abschnitte in der Chatliste) */
.nav-icon { display: grid; place-items: center; width: 20px; color: var(--text-3); }

/* ---------- 13. Seitengerüst ---------- */
.page-header { display: flex; align-items: flex-end; gap: var(--sp-3); max-width: 1180px; padding: var(--sp-10) var(--sp-10) var(--sp-1); }
.page-header h2 { margin: 0; font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -.025em; line-height: var(--lh-tight); }
.page-header p { margin: 6px 0 0; color: var(--text-3); font-size: var(--fs-base); }
.page-body { max-width: 1180px; padding: var(--sp-6) var(--sp-10) var(--sp-12); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin: 0 0 var(--sp-2); }
.section-head h3 { margin: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.tabs { display: flex; gap: var(--sp-5); margin: var(--sp-4) var(--sp-10) 0; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; margin-bottom: -1px; padding: var(--sp-2) 0 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-3); font-size: var(--fs-base); font-weight: var(--fw-medium); white-space: nowrap; transition: color .12s, border-color .12s; }
.tab:hover { color: var(--text); }
.tab.active { border-bottom-color: var(--text); color: var(--text); }
.inbox-tools, .task-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-4) var(--sp-10) var(--sp-2); }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3); margin: 0 var(--sp-10) var(--sp-2); padding: var(--sp-3) 14px; border-radius: var(--r-lg); background: var(--bg-subtle); animation: pop .15s var(--ease); }
.filters label { display: flex; flex-direction: column; gap: 4px; color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.topics { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: var(--sp-1) var(--sp-10) var(--sp-2); }

/* ---------- 14. Nachrichten: Chatliste + Unterhaltung ---------- */
.conversation { display: flex; flex: 1; flex-direction: column; min-width: 0; background: var(--bg); }
.chat-header { display: flex; flex-shrink: 0; align-items: center; gap: 10px; height: 52px; padding: 0 var(--sp-4) 0 var(--sp-6); border-bottom: 1px solid var(--line); }
.chat-icon { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: var(--r); background: var(--bg-muted); color: var(--text-2); }
.chat-icon.big { width: 48px; height: 48px; border-radius: var(--r-xl); }
.chat-title { display: flex; flex: 1; align-items: baseline; gap: 10px; min-width: 0; }
.chat-title h2 { display: flex; align-items: center; gap: var(--sp-2); margin: 0; overflow: hidden; font-size: var(--fs-md); font-weight: var(--fw-semibold); letter-spacing: -.005em; white-space: nowrap; }
.chat-sub { min-width: 0; overflow: hidden; padding: 0; border: 0; background: none; color: var(--text-3); font-size: var(--fs-sm); text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.chat-sub:not(:disabled):hover { color: var(--text); }
.chat-sub:disabled { cursor: default; }
.chat-actions { display: flex; align-items: center; gap: 2px; }

.messages { flex: 1; padding: var(--sp-2) 0 var(--sp-4); overflow-y: auto; overscroll-behavior: contain; }
.chat-start { max-width: 760px; padding: var(--sp-10) var(--sp-6) var(--sp-4); }
.chat-start h3 { margin: var(--sp-3) 0 4px; font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -.02em; }
.chat-start p { margin: 0; color: var(--text-3); }
.day-divider { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-5) var(--sp-6) 6px; }
.day-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day-divider span { color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.new-divider { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-2) var(--sp-6); color: var(--danger); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); }
.new-divider::before { content: ""; flex: 1; height: 1px; background: var(--danger); opacity: .45; }
.msg { position: relative; display: flex; gap: var(--sp-3); padding: 2px var(--sp-6); transition: background .1s; }
.msg:hover { background: var(--bg-subtle); }
.msg.first { padding-top: var(--sp-3); }
.msg.pending { opacity: .6; }
.msg.saved { box-shadow: inset 2px 0 0 var(--warn); }
.msg.highlight { animation: flash 2s var(--ease); }
@keyframes flash { 0%, 30% { background: var(--mention-bg); } }
.msg .gutter { flex-shrink: 0; width: 32px; }
.time-hover { display: block; padding-top: 4px; color: var(--text-3); font-size: var(--fs-2xs); text-align: right; visibility: hidden; font-variant-numeric: tabular-nums; }
.msg:hover .time-hover { visibility: visible; }
.msg-body { flex: 1; min-width: 0; max-width: 760px; }
.msg-meta { display: flex; align-items: baseline; gap: 6px; }
.msg-author { padding: 0; border: 0; background: none; font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.msg-author:hover { text-decoration: underline; }
.status-emoji { font-size: var(--fs-xs); }
.msg-time { color: var(--text-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.saved-flag { align-self: center; color: var(--warn); }
.msg-text { color: var(--text); line-height: 1.6; overflow-wrap: anywhere; }
.msg-text code { padding: 1px 5px; border-radius: 4px; background: var(--bg-muted); color: #b83a52; font: 12.5px var(--mono); }
.msg-text pre { margin: 6px 0; padding: 10px var(--sp-3); overflow-x: auto; border-radius: var(--r-lg); background: var(--bg-muted); font: 12.5px/1.5 var(--mono); }
.msg-text pre code { padding: 0; background: none; color: inherit; }
.msg-text a { color: var(--accent-text); text-decoration: none; }
.msg-text a:hover { text-decoration: underline; }
.msg-text blockquote { margin: 2px 0; padding-left: var(--sp-3); border-left: 2px solid var(--line-strong); color: var(--text-2); }
.msg-link { font-weight: var(--fw-medium); }
.mention { padding: 0 3px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-text); font-weight: var(--fw-medium); cursor: pointer; }
.mention.me { background: var(--mention-bg); color: var(--mention-text); }
.edited { color: var(--text-3); font-size: var(--fs-2xs); }
.attachments { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: 6px; }
.att-img img { display: block; max-width: min(360px, 100%); max-height: 260px; border: 1px solid var(--line); border-radius: var(--r-lg); object-fit: cover; }
.att-file { display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: 340px; padding: var(--sp-2) 14px var(--sp-2) var(--sp-2); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .12s; }
.att-file:hover { border-color: var(--line-strong); }
.att-file strong { font-weight: var(--fw-medium); }
.att-file-icon, .tray-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-text); }
.att-voice { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); max-width: 420px; padding: 6px 10px; border-radius: var(--r-xl); background: var(--bg-muted); }
.att-voice audio { max-width: 260px; height: 32px; }
.att-voice-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--text); color: var(--bg); }
.transcript { flex-basis: 100%; margin: 0; color: var(--text-2); font-size: var(--fs-sm); font-style: italic; }
.badges, .reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.reaction { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 var(--sp-2); border: 1px solid transparent; border-radius: var(--r-full); background: var(--bg-muted); font-size: var(--fs-xs); transition: border-color .12s, transform .1s; }
.reaction:hover { border-color: var(--line-strong); }
.reaction:active { transform: scale(.95); }
.reaction.mine { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.reaction.add { background: transparent; color: var(--text-3); opacity: 0; }
.msg:hover .reaction.add { opacity: 1; }
.thread-link { display: inline-flex; align-items: center; gap: var(--sp-2); margin-top: 4px; padding: 3px var(--sp-2) 3px 2px; border: 0; border-radius: var(--r); background: none; font-size: var(--fs-sm); }
.thread-link:hover { background: var(--bg-muted); }
.thread-link strong { color: var(--accent-text); font-weight: var(--fw-semibold); }
.mini-avatars { display: inline-flex; gap: 2px; }
.msg-foot { position: relative; display: flex; justify-content: flex-end; height: 0; }
.delivery { position: absolute; right: 0; bottom: 2px; display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); }
.delivery.read { color: var(--accent); }
.delivery.failed { position: static; height: auto; margin-top: 6px; padding: 2px var(--sp-2); border: 0; border-radius: var(--r-sm); background: var(--danger-soft); color: var(--danger); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.msg-foot:has(.failed) { justify-content: flex-start; height: auto; }
.msg-actions { position: absolute; top: -14px; right: var(--sp-6); z-index: 2; display: none; padding: 2px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-float); }
.msg:hover .msg-actions { display: flex; animation: pop .12s var(--ease); }
.msg-actions .icon-btn { width: 28px; height: 28px; }
.edit-box textarea { width: 100%; border-color: var(--accent); box-shadow: var(--ring); resize: none; }
.edit-box .hint { margin-top: 2px; color: var(--text-3); font-size: var(--fs-xs); }
.load-more { display: flex; margin: var(--sp-2) auto var(--sp-3); }

/* Editor */
.composer-wrap { padding: 0 var(--sp-6) var(--sp-1); }
.composer { max-width: 920px; border: 1px solid var(--line-strong); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.composer.drop { border-style: dashed; border-color: var(--accent); background: var(--accent-soft); }
.composer-row { display: flex; align-items: flex-end; gap: 2px; padding: 6px; }
.composer textarea { flex: 1; min-height: 30px; max-height: 200px; padding: 5px 6px; border: 0 !important; background: transparent; box-shadow: none !important; outline: none; resize: none; }
.composer-tools { display: flex; align-items: center; }
.send { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 30px; margin-left: 4px; border: 0; border-radius: var(--r); background: var(--accent); color: var(--on-accent); transition: background .12s, transform .1s; }
.send:hover { background: var(--accent-hover); }
.send:active { transform: scale(.95); }
.format-bar { display: flex; gap: 2px; padding: 6px var(--sp-2) 4px; border-bottom: 1px solid var(--line); }
.ai-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: var(--sp-2) 10px 0; animation: pop .15s var(--ease); }
.attach-tray { display: flex; gap: var(--sp-2); padding: 10px 10px 0; overflow-x: auto; }
.tray-item { position: relative; display: flex; flex-direction: column; flex-shrink: 0; gap: 2px; width: 116px; padding: 6px; border-radius: var(--r-lg); background: var(--bg-muted); animation: pop .15s var(--ease); }
.tray-item img { width: 100%; height: 68px; border-radius: var(--r); object-fit: cover; }
.tray-item .tray-icon { width: 100%; height: 68px; }
.tray-name { overflow: hidden; font-size: var(--fs-xs); font-weight: var(--fw-medium); text-overflow: ellipsis; white-space: nowrap; }
.tray-size { color: var(--text-3); font-size: var(--fs-2xs); }
.tray-remove { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--text); color: var(--bg); }
.recorder { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px var(--sp-2); }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.rec-time { min-width: 40px; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.rec-wave { display: flex; flex: 1; align-items: center; gap: 3px; height: 26px; overflow: hidden; }
.rec-wave i { width: 3px; height: 30%; border-radius: 2px; background: var(--accent); animation: wave 1s infinite ease-in-out; }
.rec-wave i:nth-child(3n) { animation-delay: .2s; }
.rec-wave i:nth-child(3n+1) { animation-delay: .45s; }
.rec-wave i:nth-child(4n) { animation-delay: .7s; }
@keyframes wave { 50% { height: 100%; } }
.typing { min-height: 20px; padding: 3px 4px; color: var(--text-3); font-size: var(--fs-xs); }
.join-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-3); margin-bottom: var(--sp-6); padding: 14px; border-radius: var(--r-xl); background: var(--bg-subtle); color: var(--text-2); text-align: center; }

/* Thread */
.thread { display: flex; flex-direction: column; flex-shrink: 0; width: 380px; border-left: 1px solid var(--line); background: var(--bg); animation: slide-in .2s var(--ease); }
.thread-header { display: flex; flex-shrink: 0; align-items: center; gap: 2px; height: 52px; padding: 0 10px 0 var(--sp-5); border-bottom: 1px solid var(--line); }
.thread-header h3 { margin: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.thread-messages .msg { padding-left: var(--sp-5); padding-right: var(--sp-5); }
.thread .composer-wrap { padding: 0 var(--sp-4) var(--sp-1); }
.thread-sep { display: flex; align-items: center; gap: 10px; margin: var(--sp-3) var(--sp-5); color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.thread-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 15. Posteingang ---------- */
.inbox-list { max-width: 1060px; padding: var(--sp-1) 28px var(--sp-10); }
.list-day { padding: var(--sp-4) var(--sp-3) 4px; color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.inbox-item { position: relative; display: flex; align-items: flex-start; gap: var(--sp-3); padding: 10px var(--sp-3) 10px var(--sp-6); border-radius: var(--r-lg); outline: none; cursor: pointer; transition: background .1s; }
.inbox-item:hover, .inbox-item:focus-visible { background: var(--bg-subtle); }
.unread-dot { position: absolute; top: 22px; left: 10px; width: 6px; height: 6px; border-radius: 50%; }
.inbox-item.unread .unread-dot { background: var(--accent); }
.inbox-item.unread .item-head strong { font-weight: var(--fw-bold); }
.inbox-item:not(.unread) .item-text { color: var(--text-2); }
.item-head { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.item-head strong { font-weight: var(--fw-semibold); }
.item-head .muted { display: inline-flex; align-items: center; gap: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-time { flex-shrink: 0; margin-left: auto; color: var(--text-3); font-size: var(--fs-xs); }
.item-text { display: -webkit-box; margin-top: 1px; overflow: hidden; font-size: var(--fs-sm); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item-text blockquote { display: inline; margin: 0; padding: 0; border: 0; }
.item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.item-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.inbox-item:hover .item-actions { opacity: 1; }

/* ---------- 16. Team ---------- */
.person-status { overflow: hidden; color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-medium); text-overflow: ellipsis; white-space: nowrap; }
.person-status.online { color: var(--ok); }
.person-status.away { color: var(--warn); }
.person-status.dnd { color: var(--danger); }

/* ---------- 17. Aufgaben: Status = Punkt, Priorität = Fahne, Deadline = Uhr ---------- */
.status-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 22px; white-space: nowrap; }
.status-chip i { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--st-open); }
.status-chip.in_progress i { background: var(--st-progress); }
.status-chip.review i { background: var(--st-review); }
.status-chip.blocked { color: var(--danger); }
.status-chip.blocked i { background: var(--st-blocked); }
.status-chip.done { color: var(--ok); }
.status-chip.done i { background: var(--st-done); }
.prio-chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; border-radius: var(--r-sm); background: var(--bg-muted); color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 20px; white-space: nowrap; }
.prio-chip .ic { color: var(--pr-normal); }
.prio-chip.critical { background: var(--danger-soft); color: var(--danger); }
.prio-chip.critical .ic { color: var(--pr-critical); }
.prio-chip.high { background: var(--warn-soft); color: var(--warn); }
.prio-chip.high .ic { color: var(--pr-high); }
.prio-chip.low { color: var(--text-3); }
.prio-chip.low .ic { color: var(--pr-low); }
[data-quick] { border-radius: var(--r-sm); cursor: pointer; }
[data-quick]:hover { box-shadow: 0 0 0 2px var(--bg-active); }
.due { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: var(--fs-xs); white-space: nowrap; }
.due .ic { color: var(--text-3); }
.due.today, .due.today .ic { color: var(--warn); font-weight: var(--fw-semibold); }
.due.soon { color: var(--text); font-weight: var(--fw-medium); }
.due.overdue, .due.overdue .ic { color: var(--danger); font-weight: var(--fw-semibold); }
.due.done { color: var(--text-3); text-decoration: line-through; }
.due.none { color: var(--text-3); }
.meta-item { display: inline-flex; align-items: center; gap: 3px; color: var(--text-3); font-size: var(--fs-xs); }
.toggle-inline { display: inline-flex; align-items: center; gap: var(--sp-2); margin-left: 4px; color: var(--text-2); font-size: var(--fs-sm); white-space: nowrap; cursor: pointer; }
.task-toolbar select { height: 30px; }
.bulk-bar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px var(--sp-10) var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-lg); background: var(--text); color: var(--bg); box-shadow: var(--shadow-float); animation: pop .15s var(--ease); }
.bulk-bar strong { margin-right: 4px; font-weight: var(--fw-semibold); }
.bulk-bar select { height: var(--h-sm); }
.bulk-bar .btn.ghost { color: var(--bg); opacity: .8; }
.bulk-bar .btn.ghost:hover { background: rgba(255, 255, 255, .12); opacity: 1; }
.task-content { padding: var(--sp-2) var(--sp-10) var(--sp-12); }

/* Kennzahlen (Aufgaben + Übersicht) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: var(--sp-2) 0 28px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
.kpi { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border: 0; background: none; text-align: left; }
button.kpi:hover { background: var(--bg-subtle); }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi strong { display: block; font-size: 24px; font-weight: var(--fw-semibold); letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--text-3); font-size: var(--fs-xs); }
.kpi-icon { display: none; }
.kpi.today strong { color: var(--warn); }
.kpi.overdue strong { color: var(--danger); }
.kpi.done strong { color: var(--ok); }

/* Meine Aufgaben */
.task-group { margin-bottom: 28px; }
.task-group h3 { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 4px; padding: 0 4px var(--sp-2); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.task-group.overdue h3 { color: var(--danger); }
.task-group h3 .muted { font-size: var(--fs-xs); font-weight: var(--fw-regular); }
.task-rows { display: flex; flex-direction: column; }
.task-row { display: flex; align-items: center; gap: var(--sp-3); min-height: 40px; padding: 7px 4px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .1s; }
.task-row:hover { background: var(--bg-subtle); }
.task-row.done .task-title { color: var(--text-3); text-decoration: line-through; }
.task-row-main { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.task-title { overflow: hidden; font-weight: var(--fw-medium); text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; flex-shrink: 0; gap: 10px; }
.task-meta:empty { display: none; }
.row-due { min-width: 96px; text-align: right; }
.task-check { display: grid; place-items: center; flex-shrink: 0; width: 18px; height: 18px; padding: 0; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: transparent; transition: all .15s; }
.task-check .ic { width: 11px; height: 11px; }
.task-check:hover { border-color: var(--ok); color: var(--ok); }
.task-check.checked { border-color: var(--ok); background: var(--ok); color: var(--on-state); }

/* Board */
.task-content.view-board { padding-right: 0; }
.board { display: grid; grid-template-columns: repeat(5, minmax(248px, 1fr)); gap: var(--sp-3); min-height: 60vh; padding: 0 var(--sp-10) var(--sp-2) 0; overflow-x: auto; scroll-snap-type: x proximity; }
.column { display: flex; flex-direction: column; min-height: 200px; border-radius: var(--r-xl); background: var(--bg-subtle); scroll-snap-align: start; transition: background .15s, box-shadow .15s; }
.column.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.column-head { display: flex; align-items: center; gap: var(--sp-2); padding: 10px var(--sp-2) 6px var(--sp-3); }
.column-head .status-chip { color: var(--text); font-weight: var(--fw-semibold); }
.column-head .icon-btn { margin-left: auto; }
.quick-add { padding: 0 var(--sp-2) var(--sp-2); }
.quick-add input { width: 100%; border-color: var(--accent); box-shadow: var(--ring); }
.column-body { display: flex; flex: 1; flex-direction: column; gap: 6px; max-height: calc(100dvh - 300px); padding: 2px var(--sp-2) var(--sp-3); overflow-y: auto; }
.column-note { margin: 0; padding: var(--sp-4) 0; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); text-align: center; }
.task-card { padding: 10px var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); cursor: grab; transition: box-shadow .15s, transform .15s, border-color .15s; }
.task-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.task-card.dragging { opacity: .4; transform: rotate(1deg); }
.task-card.is-overdue { box-shadow: inset 2px 0 0 var(--danger); }
.card-top { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.card-top .cat { overflow: hidden; color: var(--text-3); font-size: var(--fs-2xs); text-overflow: ellipsis; white-space: nowrap; }
.card-status { margin-left: auto; opacity: 0; }
.task-card:hover .card-status { opacity: 1; }
.card-title { margin: 6px 0 2px; font-weight: var(--fw-medium); line-height: 1.4; overflow-wrap: anywhere; }
.card-project { display: flex; align-items: center; gap: 4px; margin-top: 2px; color: var(--text-3); font-size: var(--fs-xs); }
.card-foot { display: flex; align-items: center; gap: var(--sp-2); margin-top: 10px; }

/* Liste */
.table-wrap { overflow: auto; }
.task-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.task-table th { position: sticky; top: 0; z-index: 1; padding: 0; border-bottom: 1px solid var(--line); background: var(--bg); text-align: left; }
.task-table th button { width: 100%; padding: var(--sp-2) 10px; border: 0; background: none; color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-medium); text-align: left; white-space: nowrap; }
.task-table th button:hover, .task-table th button.sorted { color: var(--text); }
.task-table td { height: 40px; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.task-table tbody tr { cursor: pointer; transition: background .1s; }
.task-table tbody tr:hover { background: var(--bg-subtle); }
.task-table tr.selected { background: var(--accent-soft) !important; }
.task-table tr.is-overdue .col-title { box-shadow: inset 2px 0 0 var(--danger); }
.task-table tr.done .task-title { color: var(--text-3); text-decoration: line-through; }
.col-check { width: 36px; text-align: center; }
.col-check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.col-title { max-width: 380px; }
.col-title .task-title { display: inline-block; max-width: 350px; vertical-align: middle; }
.person-inline { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.list-foot { margin: var(--sp-3) 4px; }

/* Detailansicht – Eigenschaften als Label/Wert-Zeilen */
.task-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; display: flex; flex-direction: column; width: min(560px, 100vw); background: var(--surface); box-shadow: var(--shadow-float); animation: slide-in .2s var(--ease); }
.task-panel-head { display: flex; flex-shrink: 0; align-items: center; gap: 6px; height: 52px; padding: 0 var(--sp-3) 0 28px; border-bottom: 1px solid var(--line); }
.task-panel-body { display: flex; flex: 1; flex-direction: column; gap: 18px; padding: var(--sp-6) 28px var(--sp-10); overflow-y: auto; }
.title-input { margin: 0 -6px; padding: 2px 6px; overflow: hidden; border: 0; border-radius: var(--r); background: transparent; color: var(--text); font: var(--fw-bold) var(--fs-xl)/1.3 var(--font); letter-spacing: -.02em; resize: none; }
.title-input:hover { background: var(--bg-hover); }
.title-input:focus { background: transparent; outline: none; box-shadow: var(--ring); }
.overdue-banner { display: flex; align-items: center; gap: 6px; color: var(--danger); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.field-grid { display: grid; grid-template-columns: 1fr; gap: 2px; }
.field-grid label { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: var(--sp-3); color: var(--text-3); font-size: var(--fs-sm); }
.field-grid select, .field-grid input { height: 32px; border-color: transparent; background: transparent; font-weight: var(--fw-medium); }
.field-grid select:hover, .field-grid input:hover { border-color: transparent; background: var(--bg-hover); }
.block-label { display: flex; flex-direction: column; gap: 6px; color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.block-label textarea { min-height: 96px; border-color: var(--line); font-size: var(--fs-base); line-height: 1.6; }
.prio-select.critical { color: var(--pr-critical) !important; }
.prio-select.high { color: var(--pr-high) !important; }
.created-line { margin: -6px 0 0; font-size: var(--fs-xs); }
.source-box { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 2px 14px; border-left: 2px solid var(--accent); }
.source-head { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-xs); }
.source-head strong { color: var(--text-2); font-weight: var(--fw-semibold); }
.source-box blockquote { margin: 0; color: var(--text); font-size: var(--fs-base); }
.task-section { padding-top: 18px; border-top: 1px solid var(--line); }
.task-section h4 { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-3); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.comments { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment-head { display: flex; align-items: baseline; gap: var(--sp-2); font-size: var(--fs-sm); }
.comment-head strong { font-weight: var(--fw-semibold); }
.comment-text { font-size: var(--fs-base); overflow-wrap: anywhere; }
.comment-form { display: flex; align-items: flex-end; gap: 6px; margin-top: 14px; padding: 5px 5px 5px var(--sp-3); border: 1px solid var(--line-strong); border-radius: var(--r-xl); transition: border-color .12s, box-shadow .12s; }
.comment-form:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.comment-form textarea { flex: 1; min-height: 30px; padding: 5px 0; border: 0 !important; background: none; box-shadow: none !important; outline: none; resize: none; }
.activity { margin: 0; padding: 0 0 0 2px; list-style: none; }
.activity li { position: relative; display: flex; gap: var(--sp-3); padding: 0 0 10px; color: var(--text-2); font-size: var(--fs-sm); }
.activity li strong { color: var(--text); font-weight: var(--fw-semibold); }
.activity li::before { content: ""; position: absolute; top: 12px; bottom: 0; left: 3px; width: 1px; background: var(--line); }
.activity li:last-child::before { display: none; }
.activity .dot { flex-shrink: 0; width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: var(--line-strong); }

/* ---------- 18. Übersicht ---------- */
.greeting { margin: 0; font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -.025em; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--sp-10); }
.home-section + .home-section { margin-top: var(--sp-8); }
.list-plain { margin: 0; padding: 0; list-style: none; }
.row-link { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; cursor: pointer; transition: background .1s; }
.row-link:hover { background: var(--bg-subtle); }
.row-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { display: block; overflow: hidden; color: var(--text-3); font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 19. Projekte ---------- */
.project-list { border-top: 1px solid var(--line); }
.project-row { display: grid; grid-template-columns: minmax(0, 2.2fr) 120px minmax(140px, 1fr) 120px 72px; align-items: center; gap: var(--sp-4); padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .1s; }
.project-row:hover { background: var(--bg-subtle); }
.project-row.project-head { padding: var(--sp-2) 4px; color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-medium); cursor: default; }
.project-row.project-head:hover { background: none; }
.project-name { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.project-name strong { display: block; font-weight: var(--fw-semibold); }
.progress { display: flex; align-items: center; gap: var(--sp-2); color: var(--text-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.progress-bar { flex: 1; height: 4px; overflow: hidden; border-radius: var(--r-full); background: var(--bg-active); }
.progress-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }

/* ---------- 20. Kalender (Modul 05) ---------- */
/* Ereignistypen: zurückhaltender Farbstreifen (--ec) auf neutraler Fläche */
.ev, .agenda-row, .today-item { --ec: var(--text-3); }
.ev.meeting, .agenda-row.meeting, .today-item.meeting { --ec: var(--accent); }
.ev.company, .agenda-row.company, .today-item.company { --ec: var(--text-2); }
.ev.project, .agenda-row.project, .today-item.project { --ec: var(--pc, var(--st-progress)); }
.ev.milestone, .agenda-row.milestone, .today-item.milestone { --ec: var(--pc, var(--accent)); }
.ev.task, .agenda-row.task { --ec: var(--pr-normal); }
.ev.task.high, .agenda-row.task.high { --ec: var(--pr-high); }
.ev.task.critical, .agenda-row.task.critical { --ec: var(--pr-critical); }
.ev.task.low, .agenda-row.task.low { --ec: var(--pr-low); }
.ev.shift, .agenda-row.shift, .today-item.shift { --ec: var(--text-3); }
.ev.absence, .agenda-row.absence, .today-item.absence { --ec: var(--warn); }

.cal-page { max-width: 1380px; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.cal-toolbar h3 { min-width: 170px; margin: 0 var(--sp-2) 0 var(--sp-1); font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.cal-date { width: 140px; height: 30px !important; }
.cal-views { flex: 0 0 auto; }
.cal-views span { padding: 0 12px; }
.cal-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-4); }
.cal-filters .chip { cursor: pointer; color: var(--text-3); border-color: var(--line); background: none; }
.cal-filters .chip.active { border-color: var(--line-strong); background: var(--bg-active); color: var(--text); }
.cal-selects { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-left: auto; }
.cal-selects select { height: 30px; max-width: 170px; }

/* Einträge (Monat, Ganztägig-Zeile) */
.ev { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; padding: 1px 6px; border: 0; border-radius: var(--r-sm);
  background: var(--bg-muted); box-shadow: inset 2px 0 0 var(--ec); color: var(--text); font-size: var(--fs-2xs); line-height: 18px; text-align: left; cursor: pointer; }
.ev > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev .ic { flex-shrink: 0; color: var(--ec); }
.ev:hover { background: var(--bg-active); }
.ev.done, .ev.reached { color: var(--text-3); text-decoration: line-through; }
.ev.overdue, .ev.milestone.overdue { color: var(--danger); }
.ev.declined { color: var(--text-3); text-decoration: line-through; opacity: .7; }
.ev.tentative { background: var(--surface); box-shadow: inset 2px 0 0 var(--ec), inset 0 0 0 1px var(--line-strong); }
.ev.shift.draft { background: var(--surface); box-shadow: inset 2px 0 0 var(--ec), inset 0 0 0 1px var(--line-strong); font-style: italic; }
.ev.absence { background: repeating-linear-gradient(-45deg, var(--bg-muted) 0 5px, var(--surface) 5px 10px); }
.ev.editable[draggable] { cursor: grab; }

/* Monat */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--line); }
.cal-dow { padding: var(--sp-2) 10px; background: var(--bg-subtle); color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.cal-day { display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 116px; padding: 6px; background: var(--surface); }
.cal-day.other { background: var(--bg-subtle); }
.cal-day.other .cal-num { color: var(--text-3); }
.cal-day.drop-target, .tg-allcell.drop-target { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-num { align-self: flex-start; min-width: 24px; padding: 0 6px; border: 0; border-radius: var(--r-full); background: none; color: var(--text); font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.cal-num:hover { background: var(--bg-hover); }
.cal-day.today .cal-num { background: var(--accent); color: var(--on-accent); }
.cal-more { align-self: flex-start; padding: 0 6px; border: 0; background: none; color: var(--text-3); font-size: var(--fs-2xs); }
.cal-more:hover { color: var(--text); }

/* Tag & Woche: Zeitraster */
.tg { --hour: 48px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
.tg-row { display: grid; grid-template-columns: 56px repeat(var(--days), minmax(0, 1fr)); }
.tg-head { border-bottom: 1px solid var(--line); background: var(--bg-subtle); }
.tg-dayhead { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: var(--sp-2) 4px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--text-3); font-size: var(--fs-xs); }
.tg-dayhead strong { padding: 0 6px; border-radius: var(--r-full); color: var(--text); font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.tg-dayhead.today strong { background: var(--accent); color: var(--on-accent); }
.tg-dayhead:hover { background: var(--bg-hover); }
.tg-allday { border-bottom: 1px solid var(--line); }
.tg-allcell { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 30px; padding: 3px; border-left: 1px solid var(--line); }
.tg-gutter { padding: 6px 6px 0 0; color: var(--text-3); font-size: var(--fs-2xs); text-align: right; }
.tg-scroll { max-height: calc(100dvh - 330px); min-height: 360px; overflow-y: auto; }
.tg-body { position: relative; }
.tg-body .tg-gutter { position: relative; padding: 0; }
.tg-body .tg-gutter span { position: absolute; right: 6px; transform: translateY(-50%); }
.tg-col { position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--hour) - 1px), var(--line) calc(var(--hour) - 1px) var(--hour)); }
.tg-col.today { background-color: var(--bg-subtle); }
.tg-now { position: absolute; right: 0; left: 0; z-index: 3; height: 2px; background: var(--danger); pointer-events: none; }
.tg-now::before { content: ""; position: absolute; top: -3px; left: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.tg-block { position: absolute; z-index: 1; display: flex; flex-direction: column; align-items: stretch; overflow: hidden; box-shadow: none; padding: 2px 6px; border-left: 3px solid var(--ec); border-radius: var(--r-sm);
  background: var(--bg-muted); color: var(--text); font-size: var(--fs-2xs); line-height: 1.35; cursor: pointer; }
.tg-block strong { overflow: hidden; font-weight: var(--fw-semibold); text-overflow: ellipsis; white-space: nowrap; }
.tg-block span { overflow: hidden; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.tg-block:hover { background: var(--bg-active); }
.tg-block.tentative, .tg-block.shift.draft { box-shadow: none; background: var(--surface); outline: 1px dashed var(--line-strong); outline-offset: -1px; }
.tg-block.declined { opacity: .6; text-decoration: line-through; }
.tg-block.absence { background: repeating-linear-gradient(-45deg, var(--bg-muted) 0 5px, var(--surface) 5px 10px); }
.tg-block.movable { cursor: grab; touch-action: none; }
.tg-block.dragging { z-index: 5; box-shadow: var(--shadow-float); cursor: grabbing; }
.tg-resize { position: absolute; right: 0; bottom: 0; left: 0; height: 7px; cursor: ns-resize; }

/* Agenda */
.cal-agenda-list { display: flex; flex-direction: column; gap: var(--sp-5); max-width: 860px; }
.agenda-day h4 .link-btn { color: inherit; font-weight: inherit; }
.agenda-row { display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; padding: 6px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.agenda-row:hover { background: var(--bg-subtle); }
.agenda-row.done .row-text, .agenda-row.declined .row-text { color: var(--text-3); text-decoration: line-through; }
.agenda-time { flex-shrink: 0; width: 92px; color: var(--text-2); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.agenda-mark { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--ec); }
.agenda-row.tentative .agenda-mark, .agenda-row.draft .agenda-mark { background: none; box-shadow: inset 0 0 0 1.5px var(--ec); }

/* Termin-Details & Formular */
.ev-kind { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.ev-kind.meeting .ic { color: var(--accent); }
.cal-detail-title { margin: 0 0 var(--sp-3) !important; font-size: var(--fs-xl) !important; font-weight: var(--fw-bold) !important; overflow-wrap: anywhere; }
.cal-desc { margin: var(--sp-3) 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; }
.cal-detail h4 { display: flex; align-items: baseline; gap: var(--sp-2); margin: var(--sp-4) 0 var(--sp-2) !important; color: var(--text) !important; font-size: var(--fs-sm) !important; }
.cal-people li { display: flex; align-items: center; gap: var(--sp-2); padding: 4px 0; font-size: var(--fs-sm); }
.rsvp { padding: 0 8px; border-radius: var(--r-full); background: var(--bg-muted); color: var(--text-3); font-size: var(--fs-2xs); font-weight: var(--fw-medium); line-height: 20px; white-space: nowrap; }
.rsvp.accepted { background: var(--ok-soft); color: var(--ok); }
.rsvp.declined { background: var(--danger-soft); color: var(--danger); }
.rsvp.organizer { background: var(--accent-soft); color: var(--accent-text); }
.cal-rsvp { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.cal-detail-actions { flex-wrap: wrap; }
.cal-dt { display: flex; gap: 6px; }
.cal-dt input { flex: 1; min-width: 0; }
.cal-form.all-day input[type="time"] { display: none; }
.cal-people-pick .pick-list { max-height: 168px; overflow-y: auto; }
.cal-add-task { width: 100%; margin-top: 4px; }
.cal-task-chips:empty { display: none; }
.cal-task-chips .chip { cursor: pointer; }

/* Übersicht: „Heute“ */
.home-sub { margin: var(--sp-4) 0 4px; color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.today-item .nav-icon { color: var(--ec); }

/* ---------- 21. Wissen (Modul 04) ---------- */
.muted-count { color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-regular); }
.check-inline { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-2); font-size: var(--fs-sm); cursor: pointer; }
.search-field.lg { height: var(--h-lg); padding: 0 var(--sp-4); border-radius: var(--r-lg); font-size: var(--fs-md); }
.kb-search-form { max-width: 720px; margin-bottom: var(--sp-8); }
.kb-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--sp-10); }
.kb-section { margin-bottom: var(--sp-8); }
.kb-section .section-head h3 { display: flex; align-items: center; gap: var(--sp-2); }
.kb-gap { margin-top: var(--sp-6); }
.kb-list { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.kb-row { display: flex; gap: var(--sp-3); padding: var(--sp-3) 4px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .1s; }
.kb-row:hover { background: var(--bg-subtle); }
.kb-icon { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: var(--r); background: var(--bg-muted); color: var(--text-3); }
.kb-main { flex: 1; min-width: 0; }
.kb-title { display: flex; align-items: center; gap: 6px; font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.kb-title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-fav { display: inline-flex; color: #d39a1c; }
.kb-fav svg { fill: currentColor; }
.kb-summary { display: -webkit-box; margin: 2px 0 6px; overflow: hidden; color: var(--text-2); font-size: var(--fs-sm); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--sp-3); color: var(--text-3); font-size: var(--fs-xs); }
.kb-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.kb-row mark { padding: 0 1px; border-radius: 2px; background: var(--warn-soft); color: inherit; }
.kb-count { margin: 0 0 var(--sp-2); }
.kb-toolbar select { max-width: 180px; }
.kstatus { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: var(--fs-xs); }
.kstatus i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.kstatus.draft i { background: var(--warn); }
.kstatus.archived i { background: var(--text-3); }
button.tag { border: 0; cursor: pointer; }
button.tag:hover { color: var(--text); }
.tag.removable { display: inline-flex; align-items: center; gap: 2px; }
.tag.removable button { display: inline-grid; place-items: center; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }

/* Kategorien */
.kb-cat-tree { border-top: 1px solid var(--line); }
.kb-cat { padding: 4px 0; border-bottom: 1px solid var(--line); }
.kb-cat-row { display: flex; align-items: center; gap: var(--sp-2); min-height: 38px; padding: 2px 4px; border-radius: var(--r); }
.kb-cat-row:hover { background: var(--bg-subtle); }
.kb-cat-row.child { padding-left: var(--sp-8); }
.kb-cat-row.archived .kb-cat-name { color: var(--text-3); }
.kb-cat-name { padding: 0; border: 0; background: none; color: var(--text); font-size: var(--fs-base); font-weight: var(--fw-medium); text-align: left; }
.kb-cat-row.child .kb-cat-name { font-weight: var(--fw-regular); }
.kb-cat-name:hover { text-decoration: underline; }
.kb-cat-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.kb-cat-row:hover .kb-cat-actions, .kb-cat-row:focus-within .kb-cat-actions { opacity: 1; }
.kb-cat-actions [data-cat-act="up"] svg, .kb-cat-actions [data-cat-act="down"] svg { transform: rotate(90deg); }
@media (hover: none) { .kb-cat-actions { opacity: 1; } }

/* Artikel & Editor */
.kb-doc-head { display: flex; align-items: center; gap: var(--sp-2); min-height: 52px; padding: var(--sp-2) var(--sp-6); }
.kb-doc-head.sticky { position: sticky; top: 0; z-index: 3; border-bottom: 1px solid var(--line); background: var(--bg); }
.kb-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; color: var(--text-3); font-size: var(--fs-sm); }
.kb-crumbs .crumb { margin: 0; }
.kb-doc-wrap { display: grid; grid-template-columns: minmax(0, 760px) 200px; justify-content: center; gap: var(--sp-10); padding: var(--sp-6) var(--sp-10) var(--sp-12); }
.kb-doc-wrap.no-toc { grid-template-columns: minmax(0, 760px); }
.kb-doc { min-width: 0; }
.kb-doc-title { margin: 0 0 var(--sp-2); font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -.025em; line-height: var(--lh-tight); overflow-wrap: anywhere; }
.kb-lead { margin: 0 0 var(--sp-5); color: var(--text-2); font-size: var(--fs-md); line-height: 1.55; }
.kb-props { margin-bottom: var(--sp-6); padding-bottom: var(--sp-4); border-bottom: 1px solid var(--line); }
.kb-props .prop-value select { height: 30px; max-width: 100%; }
.kb-banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-4); padding: var(--sp-2) var(--sp-3); border-radius: var(--r); background: var(--bg-muted); color: var(--text-2); font-size: var(--fs-sm); }
.kb-banner.warn { background: var(--warn-soft); color: var(--text); }
.kb-banner.warn > .ic { color: var(--warn); }
.kb-source { margin: var(--sp-8) 0 var(--sp-6); }
.kb-attach { margin-top: var(--sp-8); }
.kb-attach .row-text { color: var(--text); text-decoration: none; }
.kb-task { display: flex; align-items: center; gap: 4px; }
.kb-task > :first-child { flex: 1; min-width: 0; }
.kb-toc { position: sticky; top: var(--sp-6); align-self: start; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); }
.kb-toc h4 { margin: 0 0 var(--sp-2); color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.kb-toc button { padding: 3px 0; border: 0; background: none; color: var(--text-3); text-align: left; line-height: 1.35; }
.kb-toc button:hover { color: var(--text); }
.kb-toc .lvl2 { padding-left: var(--sp-3); }
.kb-toc .lvl3, .kb-toc .lvl4 { padding-left: var(--sp-6); }

/* Lesetext (Artikel, Vorschau, Versionen) */
.kb-content { color: var(--text); font-size: var(--fs-md); line-height: 1.7; overflow-wrap: anywhere; }
.kb-content > :first-child { margin-top: 0; }
.kb-content h2 { margin: var(--sp-8) 0 var(--sp-3); font-size: var(--fs-xl); font-weight: var(--fw-bold); letter-spacing: -.015em; line-height: var(--lh-tight); scroll-margin-top: 70px; }
.kb-content h3 { margin: var(--sp-6) 0 var(--sp-2); font-size: var(--fs-lg); font-weight: var(--fw-semibold); scroll-margin-top: 70px; }
.kb-content h4, .kb-content h5 { margin: var(--sp-5) 0 var(--sp-2); font-size: var(--fs-md); font-weight: var(--fw-semibold); scroll-margin-top: 70px; }
.kb-content p { margin: 0 0 var(--sp-3); }
.kb-content ul, .kb-content ol { margin: 0 0 var(--sp-3); padding-left: var(--sp-6); }
.kb-content li { margin: 2px 0; }
.kb-content li.indent { margin-left: var(--sp-5); }
.kb-switch > span { min-width: 0; }
.kb-switch .sub { white-space: normal; }
.kb-content .kb-checklist { padding-left: 0; list-style: none; }
.kb-checklist li { display: flex; align-items: baseline; gap: var(--sp-2); }
.kb-checklist input { flex-shrink: 0; margin: 0; transform: translateY(2px); }
.kb-checklist li.done span { color: var(--text-3); text-decoration: line-through; }
.kb-content blockquote { margin: 0 0 var(--sp-3); padding: 2px 0 2px var(--sp-4); border-left: 3px solid var(--line-strong); color: var(--text-2); }
.kb-content pre { margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); overflow-x: auto; border-radius: var(--r); background: var(--bg-muted); font-size: var(--fs-sm); line-height: 1.55; }
.kb-content code { font-family: var(--mono); font-size: .9em; }
.kb-content :not(pre) > code { padding: 1px 5px; border-radius: var(--r-sm); background: var(--bg-muted); }
.kb-content hr { margin: var(--sp-6) 0; border: 0; border-top: 1px solid var(--line); }
.kb-content a { color: var(--accent-text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.kb-content a:hover { text-decoration-color: currentColor; }
.kb-table { margin: 0 0 var(--sp-4); overflow-x: auto; }
.kb-table table { border-collapse: collapse; font-size: var(--fs-sm); line-height: 1.5; }
.kb-table th, .kb-table td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.kb-table th { background: var(--bg-subtle); font-weight: var(--fw-semibold); }

/* Editor */
.kb-save-state { display: inline-flex; align-items: center; gap: 6px; margin-left: var(--sp-2); color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; }
.kb-save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.kb-save-state i.saved { background: var(--ok); }
.kb-save-state i.offline, .kb-save-state i.conflict { background: var(--warn); }
.kb-save-state i.error { background: var(--danger); }
.kb-mode { flex: 0 0 auto; }
.kb-mode span { padding: 0 10px; }
textarea.kb-title-input, textarea.kb-summary-input, textarea.kb-content-input { display: block; width: 100%; padding: 0 !important; overflow: hidden; border: 0 !important; background: none !important; box-shadow: none !important; resize: none; }
textarea.kb-title-input { margin-bottom: var(--sp-2); font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -.025em; line-height: var(--lh-tight); }
textarea.kb-summary-input { margin-bottom: var(--sp-5); color: var(--text-2); font-size: var(--fs-md); line-height: 1.55; }
textarea.kb-content-input { min-height: 320px; padding: var(--sp-2) 0 !important; font-size: var(--fs-md); line-height: 1.7; }
.kb-tags-input { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; width: 100%; }
.kb-tags-input input { flex: 1; min-width: 110px; height: 26px !important; padding: 0 4px !important; border: 0 !important; background: none !important; box-shadow: none !important; font-size: var(--fs-sm); }
.kb-fmt { position: sticky; top: 52px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.kb-fmt .txt { width: auto; min-width: 30px; padding: 0 6px; font-size: var(--fs-xs); font-weight: var(--fw-bold); }
.kb-fmt .sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.kb-edit-area { display: grid; gap: var(--sp-8); margin-top: var(--sp-3); }
.kb-edit-area.mode-write .kb-preview, .kb-edit-area.mode-preview .kb-content-input { display: none; }
.kb-edit-area.mode-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.kb-edit-area.mode-split .kb-preview { padding-left: var(--sp-6); border-left: 1px solid var(--line); }
.kb-preview { min-height: 320px; padding-top: var(--sp-2); }
.kb-doc-wrap:has(.mode-split) { grid-template-columns: minmax(0, 1200px); }
.kb-save-row { display: flex; gap: var(--sp-2); margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.kb-save-row input { flex: 1; min-width: 0; }
.kb-hint { margin-top: var(--sp-2); }

/* Neuer Artikel: Vorlagen */
.kb-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-2); margin: 0; padding: 0; border: 0; }
.kb-templates legend { margin-bottom: 5px; padding: 0; color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.dialog .kb-tpl { position: relative; gap: 2px !important; padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-lg); cursor: pointer; transition: border-color .12s, background .12s; }
.dialog .kb-tpl:hover { background: var(--bg-subtle); }
.dialog .kb-tpl:has(input:checked) { border-color: var(--accent); box-shadow: var(--ring); }
.kb-tpl input { position: absolute; opacity: 0; pointer-events: none; }
.kb-tpl strong { color: var(--text); font-size: var(--fs-sm); }
.kb-tpl span { color: var(--text-3); font-weight: var(--fw-regular); }

/* Versionsverlauf */
.kb-hist { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--sp-8); }
.kb-versions { display: flex; flex-direction: column; gap: 2px; }
.kb-ver { padding: var(--sp-2) var(--sp-3); border-radius: var(--r); cursor: pointer; transition: background .1s; }
.kb-ver:hover { background: var(--bg-hover); }
.kb-ver.sel { background: var(--bg-active); }
.kb-ver-head { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.kb-ver-note { margin-top: 2px; color: var(--text-2); font-size: var(--fs-xs); }
.kb-diff { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); font-family: var(--mono); font-size: var(--fs-xs); line-height: 1.6; }
.kb-diff div { padding: 0 var(--sp-3); white-space: pre-wrap; overflow-wrap: anywhere; }
.kb-diff span { display: inline-block; width: 16px; color: var(--text-3); user-select: none; }
.kb-diff .add { background: var(--ok-soft); }
.kb-diff .del { background: var(--danger-soft); color: var(--text-2); }
.kb-diff .gap { padding: 2px var(--sp-3); background: var(--bg-subtle); color: var(--text-3); font-family: var(--font); }
.kb-diff-title .del { color: var(--text-3); text-decoration: line-through; }
.kb-diff-title .add { font-weight: var(--fw-semibold); }

/* ==========================================================================
   22. Responsiv – Tablet & Smartphone
   ========================================================================== */
@media (max-width: 1300px) {
  .kb-doc-wrap { grid-template-columns: minmax(0, 760px); }
  .kb-toc { position: static; order: -1; padding: var(--sp-3) var(--sp-4); border-radius: var(--r); background: var(--bg-subtle); }
}
@media (max-width: 1200px) {
  .thread { position: fixed; top: 0; right: 0; bottom: 0; z-index: 25; width: min(420px, 100vw); border-left: 0; box-shadow: var(--shadow-float); }
  .home-grid { grid-template-columns: 1fr; gap: var(--sp-8); }
}
@media (max-width: 1024px) {
  :root { --sidebar-w: 216px; --chatlist-w: 248px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .page-header { padding: var(--sp-8) var(--sp-6) var(--sp-1); }
  .page-body { padding: var(--sp-5) var(--sp-6) var(--sp-10); }
  .tabs { margin-left: var(--sp-6); margin-right: var(--sp-6); }
  .inbox-tools, .task-toolbar, .topics { padding-left: var(--sp-6); padding-right: var(--sp-6); }
  .filters, .bulk-bar { margin-left: var(--sp-6); margin-right: var(--sp-6); }
  .task-content { padding-left: var(--sp-6); padding-right: var(--sp-6); }
  .task-content.view-board { padding-right: 0; }
  .inbox-list { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .col-project, .col-created_at { display: none; }
  .project-row { grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr) 100px 60px; }
  .project-row > :nth-child(2) { display: none; }
}
@media (max-width: 760px) {
  .kb-grid, .kb-hist { grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); }
  .kb-doc-head { padding: var(--sp-2) var(--sp-3) var(--sp-2) 4px; }
  .kb-doc-wrap, .kb-doc-wrap.no-toc { padding: var(--sp-4) var(--sp-4) var(--sp-10); }
  .kb-edit-area.mode-split { grid-template-columns: minmax(0, 1fr); }
  .kb-edit-area.mode-split .kb-preview { padding-left: 0; border-left: 0; }
  .kb-props .prop { grid-template-columns: 110px 1fr; }
  .kb-toolbar select { flex: 1 1 40%; max-width: none; }
  .kb-toolbar .search-field { flex-basis: 100%; }
  .kb-save-state { margin-left: 0; }
  .kb-fmt { top: 52px; }
  .kb-versions { flex-direction: row; overflow-x: auto; }
  .kb-ver { flex: 0 0 auto; }
  .chat-header { gap: 6px; padding: 0 var(--sp-2) 0 4px; }
  .chat-title { flex-direction: column; gap: 0; }
  .chat-actions .pill-btn, .chat-actions [data-h="summary"] { display: none; }
  .thread { width: 100vw; }
  .msg { gap: 10px; padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .msg-actions { right: var(--sp-3); }
  .composer-wrap { padding: 0 10px 2px; }
  .hide-mobile { display: none; }
  .page-header { align-items: center; padding: 14px var(--sp-3) 2px 4px; }
  .page-header h2, .greeting { font-size: 22px; }
  .page-header p { display: none; }
  .page-body { padding: var(--sp-4) var(--sp-3) var(--sp-8); }
  .tabs { gap: var(--sp-4); margin: var(--sp-2) var(--sp-3) 0; }
  .inbox-tools, .task-toolbar, .topics { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .filters, .bulk-bar { margin-left: var(--sp-3); margin-right: var(--sp-3); }
  .inbox-list { padding: 4px 2px var(--sp-6); }
  .item-actions { flex-direction: column; opacity: 1; }
  .form-row { grid-template-columns: 1fr; }
  .att-file { min-width: 0; }
  .notices { top: var(--sp-2); right: var(--sp-2); }
  .task-toolbar select { flex: 1 1 40%; }
  .task-toolbar .search-field { flex-basis: 100%; }
  .task-content { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .board { grid-template-columns: repeat(5, 82vw); padding-right: var(--sp-3); scroll-snap-type: x mandatory; }
  .column-body { max-height: none; }
  .task-row { flex-wrap: wrap; gap: 4px 10px; padding: 9px 2px; }
  .task-row-main { flex: 1 1 calc(100% - 32px); flex-direction: column; gap: 0; }
  .task-row .status-chip { margin-left: 28px; }
  .row-due { min-width: 0; margin-left: auto; }
  .col-assignee, .col-priority { display: none; }
  .col-title .task-title { max-width: 46vw; }
  .field-grid label { grid-template-columns: 110px 1fr; }
  .task-panel { width: 100vw; }
  .task-panel-head { padding-left: var(--sp-4); }
  .task-panel-body { padding: 18px var(--sp-4) var(--sp-8); }
  .kpi { padding: var(--sp-3) 14px; }
  .project-row { grid-template-columns: minmax(0, 1fr) 90px; gap: var(--sp-3); }
  .project-row > :nth-child(n+3) { display: none; }
  .project-row.project-head { display: none; }
  .cal-toolbar h3 { flex: 1; min-width: 0; margin-right: 0; font-size: var(--fs-md); }
  .cal-date { display: none; }
  .cal-views { order: 9; width: 100%; }
  .cal-selects { margin-left: 0; }
  .cal-selects select { flex: 1 1 40%; max-width: none; }
  .cal-filters .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .cal-day { min-height: 64px; padding: 3px; gap: 2px; }
  .cal-day .ev { height: 5px; padding: 0; font-size: 0; }
  .cal-day .ev .ic { display: none; }
  .cal-more { padding: 0 2px; font-size: 10px; }
  .cal-dow { padding: 6px 4px; text-align: center; }
  .tg-row { grid-template-columns: 40px repeat(var(--days), minmax(0, 1fr)); }
  .tg-dayhead { flex-direction: column; align-items: center; gap: 0; }
  .tg-block { padding: 1px 3px; }
  .tg-scroll { max-height: calc(100dvh - 300px); }
  .agenda-time { width: 76px; }
}
/* ==========================================================================
   23. Modul 03 – gemeinsame Bausteine
   ========================================================================== */
.eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.nowrap { white-space: nowrap; }
.btn.primary-soft { border-color: transparent; background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
.btn.primary-soft:hover { background: var(--bg-active); }
.btn.danger-text, .danger-text { color: var(--danger); }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.data-table th { position: sticky; top: 0; z-index: 1; padding: var(--sp-2) 10px; border-bottom: 1px solid var(--line); background: var(--bg); color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-medium); text-align: left; white-space: nowrap; }
.data-table td { height: 44px; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr[data-go], .data-table tbody tr[data-person] { cursor: pointer; transition: background .1s; }
.data-table tbody tr[data-go]:hover, .data-table tbody tr[data-person]:hover { background: var(--bg-subtle); }
.page-body.flush { padding-top: var(--sp-2); }
.props { display: flex; flex-direction: column; }
.prop { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: var(--sp-3); min-height: 34px; padding: 4px 0; font-size: var(--fs-sm); }
.prop-label { color: var(--text-3); }
.prop-value { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); min-width: 0; }
.kpis.compact { margin: 0 0 var(--sp-5); }
.kpis.compact .kpi { padding: var(--sp-3) var(--sp-4); }
.kpis.compact .kpi strong { font-size: 20px; }
.tab-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.tab-toolbar select { height: 30px; }
.hint-line { display: flex; align-items: center; gap: 6px; margin-top: var(--sp-4); }
.row-link.static { cursor: default; }
.row-link.static:hover { background: none; }
.tabs.inline { margin: 0 0 var(--sp-3); }
.form-row.three { grid-template-columns: 1.4fr 1fr 1fr; }
.inline-form { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); }
.inline-form.wrap { flex-wrap: wrap; }
.inline-form input:not([type="checkbox"]) { flex: 1; min-width: 120px; }
.inline-input { flex: 1; min-width: 0; height: 30px !important; border-color: transparent !important; background: transparent !important; font-weight: var(--fw-medium); }
.inline-input:hover { background: var(--bg-hover) !important; }
.inline-input:focus { border-color: var(--accent) !important; background: var(--surface) !important; }
.num-input { width: 72px; min-width: 0 !important; flex: none !important; }
.settings-body { max-height: 60vh; overflow-y: auto; }
.settings-row .prop-value select { width: 96px; }
.duration-line { margin: -4px 0 0; }

/* ---------- Projekte ---------- */
.project-dot { display: inline-block; flex-shrink: 0; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.project-name { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; max-width: 360px; }
.project-name strong { font-weight: var(--fw-semibold); }
.pstatus { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap; }
.pstatus i { width: 8px; height: 8px; border-radius: 50%; background: var(--st-open); }
.pstatus.active i { background: var(--st-progress); }
.pstatus.paused { color: var(--warn); }
.pstatus.paused i { background: var(--warn); }
.pstatus.done { color: var(--ok); }
.pstatus.done i { background: var(--st-done); }
.project-table .progress { min-width: 120px; }
.project-header { align-items: flex-start; }
.project-header h2 { display: flex; align-items: center; gap: 10px; }
.project-header .project-dot { width: 14px; height: 14px; border-radius: 4px; }
.crumb { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px; padding: 0; border: 0; background: none; color: var(--text-3); font-size: var(--fs-sm); }
.crumb:hover { color: var(--text); }
.header-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-2); }
.header-actions { display: flex; align-items: center; gap: var(--sp-2); padding-top: 22px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--sp-10); }
.lead-text { margin: 0 0 var(--sp-4); color: var(--text-2); font-size: var(--fs-md); line-height: 1.6; }
.milestone .ms-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r); background: var(--bg-muted); color: var(--text-3); }
.milestone.reached .ms-mark { background: var(--ok-soft); color: var(--ok); }
.milestone.overdue .ms-mark { background: var(--danger-soft); color: var(--danger); }
.ms-status { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-3); white-space: nowrap; }
.ms-status.reached { color: var(--ok); }
.ms-status.overdue { color: var(--danger); }
.chat-preview .msg-text.clamp { display: -webkit-box; overflow: hidden; font-size: var(--fs-sm); -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.chat-preview .row-link { align-items: flex-start; padding: 10px 4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; height: 34px; align-items: center; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: block; width: 22px; height: 22px; border-radius: 6px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); cursor: pointer; }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }

/* ---------- Schichtplan: Werkzeugleiste ---------- */
.roster-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-4) var(--sp-10) var(--sp-2); }
.view-switch { width: 240px; }
.date-nav, .zoom { display: flex; align-items: center; gap: 2px; }
.zoom { padding-left: var(--sp-2); border-left: 1px solid var(--line); }
.roster-toolbar select { height: 30px; }
.plan-status { display: inline-flex; align-items: center; gap: 4px; margin-left: var(--sp-2); padding: 0 8px; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 20px; vertical-align: 1px; }
.plan-status.draft { background: var(--bg-muted); color: var(--text-2); }
.plan-status.published { background: var(--ok-soft); color: var(--ok); }
.plan-status.changed { background: var(--warn-soft); color: var(--warn); }
.roster-body { padding: var(--sp-2) var(--sp-10) var(--sp-12); }
.day-info { margin-bottom: var(--sp-3); color: var(--text-3); font-size: var(--fs-sm); }
.warn-text { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); }
.roster-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }

/* Tagesansicht: Positionen × Zeitachse */
.roster-grid { --label: 168px; min-width: calc(var(--label) + var(--w)); }
.roster-head, .roster-row { display: flex; }
.roster-head { position: sticky; top: 0; z-index: 3; border-bottom: 1px solid var(--line); background: var(--bg-subtle); }
.roster-label { position: sticky; left: 0; z-index: 2; display: flex; flex-shrink: 0; align-items: center; gap: var(--sp-2); width: var(--label); padding: 0 var(--sp-3); border-right: 1px solid var(--line); background: var(--surface); font-weight: var(--fw-medium); }
.roster-label.head { height: 34px; background: var(--bg-subtle); color: var(--text-3); font-size: var(--fs-xs); }
.time-axis { position: relative; flex-shrink: 0; height: 34px; }
.time-axis span { position: absolute; top: 9px; padding-left: 4px; color: var(--text-3); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; border-left: 1px solid var(--line-strong); line-height: 16px; }
.roster-row + .roster-row { border-top: 1px solid var(--line); }
.roster-row.inactive .roster-label { color: var(--text-3); font-style: italic; }
.roster-track {
  position: relative; flex-shrink: 0; cursor: copy;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(var(--slot) * 2 - 1px), var(--line) calc(var(--slot) * 2 - 1px) calc(var(--slot) * 2));
}
.roster-track.drop-target { background-color: var(--accent-soft); }
.off-hours { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--bg-subtle) 0 6px, var(--bg-muted) 6px 7px); pointer-events: none; }
.free-slot { position: absolute; top: 4px; bottom: 4px; border-radius: var(--r-sm); background: repeating-linear-gradient(135deg, transparent 0 5px, var(--bg-muted) 5px 6px); pointer-events: none; }
.gap-bar { position: absolute; bottom: 0; height: 3px; border-radius: 2px; background: var(--danger); pointer-events: none; }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: .6; pointer-events: none; }
.track-empty { position: absolute; top: 50%; left: var(--sp-3); color: var(--text-3); font-size: var(--fs-xs); transform: translateY(-50%); pointer-events: none; }
.pos-dot { display: inline-block; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.shift-block {
  position: absolute; z-index: 1; display: flex; flex-direction: column; justify-content: center; height: 32px; padding: 0 10px 0 12px; overflow: hidden;
  border-radius: var(--r); background: var(--surface); box-shadow: inset 3px 0 0 var(--uc), 0 0 0 1px var(--line-strong); cursor: grab; touch-action: none; user-select: none;
  transition: box-shadow .12s;
}
.shift-block:hover { box-shadow: inset 3px 0 0 var(--uc), 0 0 0 1px var(--text-3), var(--shadow-xs); }
.shift-block:active { cursor: grabbing; }
.shift-block.saving { opacity: .55; pointer-events: none; }
.shift-block.changed { box-shadow: inset 3px 0 0 var(--uc), 0 0 0 1px var(--warn); }
.shift-block.warn .sb-time { color: var(--warn); }
.sb-name { overflow: hidden; font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.sb-name em { color: var(--text-3); font-style: normal; font-weight: var(--fw-regular); }
.sb-time { overflow: hidden; color: var(--text-3); font-size: var(--fs-2xs); line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.handle { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.handle.l { left: 0; }
.handle.r { right: 0; }
.roster-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); margin: var(--sp-3) 0 var(--sp-6); color: var(--text-2); font-size: var(--fs-xs); }
.roster-legend span { display: inline-flex; align-items: center; gap: 6px; }
.roster-legend .lg { display: inline-block; width: 16px; height: 10px; border-radius: 3px; }
.roster-legend .lg.free { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--line-strong) 3px 4px); box-shadow: inset 0 0 0 1px var(--line); }
.roster-legend .lg.off { background: repeating-linear-gradient(135deg, var(--bg-subtle) 0 3px, var(--line-strong) 3px 4px); }
.roster-legend .lg.gap { height: 3px; background: var(--danger); }

/* Wochenansicht: Positionen × Tage */
.week-grid { width: 100%; min-width: calc(160px + 7 * var(--col)); border-collapse: collapse; table-layout: fixed; font-size: var(--fs-sm); }
.week-grid th, .week-grid td { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.week-grid thead th { position: sticky; top: 0; z-index: 2; padding: var(--sp-2) 10px; background: var(--bg-subtle); text-align: left; vertical-align: top; }
.week-grid thead th.today { box-shadow: inset 0 2px 0 var(--accent); }
.week-grid .pos-col { position: sticky; left: 0; z-index: 2; width: 160px; padding: 0 var(--sp-3); border-left: 0; background: var(--surface); font-weight: var(--fw-medium); text-align: left; }
.week-grid thead .pos-col { z-index: 3; background: var(--bg-subtle); color: var(--text-3); font-size: var(--fs-xs); }
.week-grid .pos-col .pos-dot { margin-right: var(--sp-2); }
.week-grid tr.inactive .pos-col { color: var(--text-3); font-style: italic; }
.day-link { padding: 0; border: 0; background: none; font-weight: var(--fw-semibold); }
.day-link:hover { color: var(--accent-text); text-decoration: underline; }
.week-cell { position: relative; height: 64px; padding: 6px; vertical-align: top; }
.week-cell.today { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.week-cell.under { box-shadow: inset 0 -3px 0 var(--danger); }
.week-cell.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.shift-chip { display: flex; flex-direction: column; margin-bottom: 4px; padding: 3px 8px 3px 10px; border-radius: var(--r-sm); background: var(--surface); box-shadow: inset 3px 0 0 var(--uc), 0 0 0 1px var(--line-strong); cursor: grab; font-size: var(--fs-xs); line-height: 1.3; }
.shift-chip:hover { box-shadow: inset 3px 0 0 var(--uc), 0 0 0 1px var(--text-3); }
.shift-chip strong { overflow: hidden; font-weight: var(--fw-semibold); text-overflow: ellipsis; white-space: nowrap; }
.shift-chip span { color: var(--text-3); font-variant-numeric: tabular-nums; }
.shift-chip.changed { box-shadow: inset 3px 0 0 var(--uc), 0 0 0 1px var(--warn); }
.shift-chip.warn span { color: var(--warn); }
.shift-chip.dragging { opacity: .4; }
.cell-empty { display: block; padding-top: 2px; color: var(--text-3); font-size: var(--fs-2xs); }
.cell-add { position: absolute; right: 4px; bottom: 4px; display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: var(--r-sm); background: var(--bg-muted); color: var(--text-2); opacity: 0; transition: opacity .12s; }
.week-cell:hover .cell-add, .cell-add:focus-visible { opacity: 1; }
.week-grid tfoot td, .week-grid tfoot th { padding: var(--sp-2) 10px; background: var(--bg-subtle); }
.hours-section { margin-top: var(--sp-8); }
.hours-table td { height: 40px; font-variant-numeric: tabular-nums; }

/* Monatsansicht */
.roster-month .month-day { min-height: 96px; border: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.roster-month .month-day:hover { background: var(--bg-subtle); }
.md-line { color: var(--text-2); font-size: var(--fs-xs); }
.md-line strong { color: var(--text); }
.md-under { display: inline-flex; align-items: center; gap: 3px; margin-top: auto; color: var(--danger); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); }

/* Agenda (Smartphone) */
.agenda { display: flex; flex-direction: column; gap: var(--sp-5); }
.agenda-day h4 { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); margin: 0 0 var(--sp-2); padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.agenda-day.today h4 { color: var(--accent-text); }
.agenda-pos { margin-bottom: var(--sp-2); }
.agenda-pos .eyebrow { margin: 4px 0; }
.agenda-shift { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 6px; border: 0; border-radius: var(--r-lg); background: none; text-align: left; }
.agenda-shift:hover { background: var(--bg-subtle); }
.agenda-shift.mine { background: var(--accent-soft); }
.agenda-shift.changed .sub { color: var(--warn); }

@media (max-width: 1024px) {
  .roster-toolbar, .roster-body { padding-left: var(--sp-6); padding-right: var(--sp-6); }
  .roster-grid { --label: 128px; }
  .hide-tablet { display: none; }
  .overview-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
}
@media (max-width: 760px) {
  .roster-toolbar, .roster-body { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .view-switch { flex: 1 1 100%; width: auto; }
  .roster-toolbar select { flex: 1; }
  .zoom { display: none; }
  .form-row.three { grid-template-columns: 1fr 1fr; }
  .form-row.three label:first-child { grid-column: 1 / -1; }
  .prop { grid-template-columns: 120px 1fr; }
  .header-actions { padding-top: 0; }
  .project-header { flex-wrap: wrap; }
  .roster-month .month-day { min-height: 64px; padding: 4px; }
  .md-line:last-of-type { display: none; }
}

@media (hover: none) {
  .msg:hover .msg-actions { display: none; }
  .card-status { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   24. Modul 06 – Team, Rollen & Berechtigungen
   ========================================================================== */
.role-chip { display: inline-flex; align-items: center; padding: 0 8px; border-radius: var(--r-full); background: var(--bg-muted); color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 20px; white-space: nowrap; }
.role-chip.owner, .role-chip.admin { background: var(--accent-soft); color: var(--accent-text); }
.role-chip.guest { background: var(--warn-soft); color: var(--warn); }
.acct { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: var(--fs-xs); white-space: nowrap; }
.acct i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.acct.deactivated { color: var(--text-3); }
.acct.deactivated i { background: var(--text-3); }
.acct.invited i { background: none; box-shadow: inset 0 0 0 1.5px var(--accent); }
.inv { font-size: var(--fs-xs); color: var(--text-2); }
.inv.pending { color: var(--accent-text); }
.inv.expired, .inv.revoked, .inv.declined { color: var(--text-3); }
.inv.accepted { color: var(--ok); }
.team-toolbar select { max-width: 170px; }
.team-table td .row-sub { display: block; color: var(--text-3); font-size: var(--fs-xs); }
.team-table .person-inline .row-text { display: flex; flex-direction: column; line-height: 1.3; }
.avatar-ghost { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-muted); color: var(--text-3); }
.person-head { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.person-title { margin: 0 0 6px; color: var(--text-2); font-size: var(--fs-md); }
.perm-summary { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.perm-summary span { color: var(--text-2); }
.role-list { border-top: 1px solid var(--line); }
.role-row { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) 4px; border-bottom: 1px solid var(--line); }
.role-title { display: flex; align-items: center; gap: var(--sp-2); }
.role-row p { margin: 4px 0 6px; }
.role-groups { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-pill { padding: 0 6px; border-radius: var(--r-sm); background: var(--bg-muted); color: var(--text-3); font-size: var(--fs-2xs); line-height: 18px; }
.perm-pill.full { background: var(--accent-soft); color: var(--accent-text); }
.perm-pill.part { color: var(--text); }
.role-count { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; }
.perm-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-3) var(--sp-5); max-height: 52vh; overflow-y: auto; }
.perm-group { margin: 0; padding: 0; border: 0; }
.perm-group legend { margin-bottom: 4px; padding: 0; color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.dialog .perm-item { flex-direction: row !important; align-items: flex-start; gap: var(--sp-2) !important; padding: 5px 0; cursor: pointer; }
.perm-item input { margin-top: 3px; }
.perm-item > span { display: flex; flex-direction: column; }
.perm-item strong { color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.perm-item .meta { font-weight: var(--fw-regular); }
.perm-item.blocked { opacity: .55; cursor: not-allowed; }
.perm-matrix th, .perm-matrix td { white-space: nowrap; }
.perm-matrix .perm-cell { color: var(--accent-text); text-align: center; }
.perm-matrix th:not(:first-child) { text-align: center; }
.perm-group-row td { height: 32px; background: var(--bg-subtle); color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.team-list .row-link.archived .row-text { color: var(--text-3); }
.team-picks { max-height: 44vh; overflow-y: auto; }
.team-picks li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 4px 0; border-bottom: 1px solid var(--line); }
.dialog .team-picks .check-inline, .dialog .chips .check-inline { flex-direction: row !important; align-items: center; gap: 6px !important; color: var(--text); font-size: var(--fs-sm); }
.invite-link { display: flex; gap: var(--sp-2); margin: var(--sp-3) 0; }
.invite-link input { flex: 1; min-width: 0; font-family: var(--mono); font-size: var(--fs-xs); }
.audit-list { border-top: 1px solid var(--line); }
.audit-row { display: flex; gap: var(--sp-4); padding: var(--sp-2) 4px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.audit-time { flex-shrink: 0; width: 150px; }
.audit-row .row-sub { display: block; color: var(--text-3); font-size: var(--fs-xs); overflow-wrap: anywhere; white-space: normal; }
.settings-form { max-width: 720px; }
.settings-form .props { margin-bottom: var(--sp-4); }
.settings-form input[name="name"] { width: 100%; max-width: 360px; }
.login-card .btn.ghost { width: 100%; }
@media (max-width: 1024px) { .hide-tablet { display: none; } }
@media (max-width: 760px) {
  .team-toolbar select { flex: 1 1 40%; max-width: none; }
  .team-toolbar .search-field { flex-basis: 100%; }
  .audit-row { flex-direction: column; gap: 2px; }
  .audit-time { width: auto; }
  .role-row { flex-wrap: wrap; }
  .person-head { align-items: flex-start; }
}

/* ==========================================================================
   25. Modul 07 – KI-Assistent
   ========================================================================== */
#view-assistant { display: flex; flex-direction: column; }
#view-assistant[hidden] { display: none; }
.ai-provider { display: inline-flex; align-items: center; gap: 5px; align-self: center; padding: 0 10px; border-radius: var(--r-full); background: var(--bg-muted); color: var(--text-2); font-size: var(--fs-xs); line-height: 24px; white-space: nowrap; }
.ai-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); flex: 1; min-height: 0; max-width: 1180px; margin: var(--sp-4) var(--sp-10) 0; border-top: 1px solid var(--line); }
.ai-list { display: flex; flex-direction: column; min-height: 0; padding: var(--sp-3) var(--sp-3) var(--sp-3) 0; overflow-y: auto; border-right: 1px solid var(--line); }
.ai-list-head { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.ai-list-head .btn { flex: 1; }
.ai-list-note { margin: 0 0 var(--sp-2); }
.ai-conv { padding: 8px 10px; border-radius: var(--r); cursor: pointer; }
.ai-conv:hover { background: var(--bg-hover); }
.ai-conv.active { background: var(--bg-active); }
.ai-conv .row-text { display: flex; flex-direction: column; overflow: hidden; font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.ai-conv .row-sub { overflow: hidden; color: var(--text-3); font-size: var(--fs-xs); text-overflow: ellipsis; }
.ai-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ai-chat-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--line); }
.ai-chat-head strong { display: block; overflow: hidden; font-size: var(--fs-md); text-overflow: ellipsis; white-space: nowrap; }
.ai-context { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: var(--fs-xs); }
.ai-back { display: none; }
.ai-messages { display: flex; flex: 1; flex-direction: column; gap: var(--sp-6); min-height: 280px; padding: var(--sp-6) var(--sp-5); overflow-y: auto; }
.ai-msg.user { display: flex; justify-content: flex-end; }
.ai-bubble { max-width: 78%; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-lg); background: var(--bg-muted); font-size: var(--fs-base); line-height: 1.5; overflow-wrap: anywhere; }
.ai-msg.assistant { display: flex; gap: var(--sp-3); max-width: 760px; }
.ai-avatar { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); }
.ai-body { flex: 1; min-width: 0; }
.ai-text { font-size: var(--fs-base); line-height: 1.65; }
.ai-text p { margin: 0 0 var(--sp-2); }
.ai-text ul { margin: 2px 0 var(--sp-3); }
.src-ref { display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin: 0 1px; padding: 0 3px; border-radius: var(--r-sm); background: var(--bg-muted); color: var(--accent-text) !important; font-size: 10px; font-weight: var(--fw-semibold); text-decoration: none !important; vertical-align: 2px; }
.src-ref:hover { background: var(--accent-soft); }
.ai-sources { margin-top: var(--sp-2); font-size: var(--fs-xs); }
.ai-sources summary { color: var(--text-3); cursor: pointer; }
.ai-sources ol { display: flex; flex-direction: column; gap: 2px; margin: var(--sp-2) 0 0; padding: 0; list-style: none; }
.ai-sources li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); }
.ai-sources a { display: inline-flex; align-items: center; gap: 5px; color: var(--text); text-decoration: none; }
.ai-sources a:hover { color: var(--accent-text); }
.src-n { color: var(--text-3); font-variant-numeric: tabular-nums; }
.ai-tools { display: flex; align-items: center; gap: 2px; margin-top: var(--sp-2); }
.ai-tools .meta { margin-right: var(--sp-2); font-size: var(--fs-2xs); }
.ai-action { margin: var(--sp-3) 0; padding: var(--sp-3); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); border-radius: var(--r-lg); background: var(--surface); }
.ai-action.executed { border-left-color: var(--ok); }
.ai-action.rejected { border-left-color: var(--line-strong); opacity: .75; }
.ai-action.failed { border-left-color: var(--danger); }
.ai-action-head { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); }
.ai-action-status { margin-left: auto; color: var(--text-3); font-size: var(--fs-xs); }
.ai-action p { margin: 6px 0 var(--sp-2); font-size: var(--fs-sm); }
.ai-action-buttons { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ai-pending { display: flex; align-items: center; gap: var(--sp-2); color: var(--text-3); font-size: var(--fs-sm); }
.ai-pending[hidden] { display: none; }
.ai-dots { display: inline-flex; gap: 3px; }
.ai-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: ai-dot 1s infinite ease-in-out; }
.ai-dots i:nth-child(2) { animation-delay: .15s; }
.ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-composer { display: flex; align-items: flex-end; gap: var(--sp-2); margin: 0 var(--sp-5); padding: var(--sp-2); border: 1px solid var(--line-strong); border-radius: var(--r-xl); background: var(--surface); }
.ai-composer:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.ai-input { flex: 1; min-height: 34px; max-height: 220px; padding: 6px 8px !important; border: 0 !important; background: none !important; box-shadow: none !important; font-size: var(--fs-base); resize: none; }
.ai-disclaimer { display: flex; align-items: center; gap: 5px; margin: 6px var(--sp-5) var(--sp-4); color: var(--text-3); font-size: var(--fs-2xs); }
.ai-welcome { max-width: 560px; margin: auto; padding: var(--sp-10) var(--sp-5); text-align: center; }
.ai-welcome h3 { margin: var(--sp-3) 0 var(--sp-2); font-size: var(--fs-lg); }
.ai-suggest { justify-content: center; margin-top: var(--sp-4); }
.ai-messages .ai-suggest { justify-content: flex-start; margin: 0; }
.ai-suggest .chip { cursor: pointer; }
.ai-settings .prop-value input:not([type="checkbox"]), .ai-settings .prop-value select { width: 100%; max-width: 320px; }
.ai-settings .prop-value input[type="number"] { width: 140px; }
.ai-settings .prop-value .meta { flex-basis: 100%; }
.ai-live { white-space: pre-wrap; }
.ai-state { display: inline-flex; align-items: center; gap: 6px; }
.ai-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.ai-state.ready::before { background: var(--ok); }
.ai-state.offline::before, .ai-state.no_model::before { background: var(--danger); }
.ai-status-banner { display: flex; align-items: center; gap: var(--sp-2); max-width: 1180px; margin: var(--sp-4) var(--sp-10) 0; }
.ai-models { display: flex; flex-wrap: wrap; gap: 4px; }
.ai-settings .prop-value input[name="model_custom"] { margin-top: 6px; }
.ai-briefing .ai-text { font-size: var(--fs-sm); }
.ai-briefing .section-head h3 { display: flex; align-items: center; gap: 6px; }
@media (max-width: 1024px) {
  .ai-layout { margin: var(--sp-3) var(--sp-6) 0; grid-template-columns: 220px minmax(0, 1fr); }
  .ai-status-banner { margin: var(--sp-3) var(--sp-6) 0; }
}
@media (max-width: 760px) {
  .ai-layout { display: block; margin: var(--sp-2) 0 0; }
  .ai-layout.has-conv .ai-list { display: none; }
  .ai-layout:not(.has-conv) .ai-chat { display: none; }
  .ai-list { padding: var(--sp-3); border-right: 0; }
  .ai-back { display: inline-grid; }
  .ai-chat-head { padding: var(--sp-2) var(--sp-3); }
  .ai-messages { padding: var(--sp-4) var(--sp-3); }
  .ai-composer { margin: 0 var(--sp-3); }
  .ai-disclaimer { margin: 6px var(--sp-3) var(--sp-3); }
  .ai-status-banner { margin: var(--sp-2) var(--sp-3) 0; }
  .ai-bubble { max-width: 90%; }
  .ai-provider { display: none; }
}

/* --------------------------------------------------------------------------- Bots & Integrationen */
.bot-chip { display: inline-flex; align-items: center; padding: 0 5px; border-radius: var(--r-sm); background: var(--bg-muted); color: var(--text-3); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); line-height: 16px; letter-spacing: .02em; text-transform: uppercase; }
.msg-meta .bot-chip { margin-left: 2px; }
.msg-buttons { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.msg-buttons .btn.danger-text { color: var(--danger); }
.msg-clicks { margin: var(--sp-1) 0 0; padding: 0; list-style: none; color: var(--text-3); font-size: var(--fs-xs); }
.msg-clicks strong { color: var(--text-2); font-weight: var(--fw-medium); }
.msg.ephemeral { background: var(--bg-subtle); }
.ephemeral-note { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: var(--fs-xs); }
.bot-card { padding: var(--sp-4) 0; border-bottom: 1px solid var(--line); }
.bot-card:first-child { padding-top: 0; }
.bot-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.bot-head .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-card .prop-row > * { min-width: 0; }
.bot-card .prop-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: var(--sp-3); padding: var(--sp-1) 0; align-items: start; }
.bot-card .prop-row > .field-label { padding-top: 6px; }
.bot-card .muted { margin: 0; }
.copy-row { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; margin-bottom: var(--sp-1); }
.copy-row code { overflow: hidden; min-width: 0; padding: 2px 6px; border-radius: var(--r-sm); background: var(--bg-muted); font: var(--fs-xs) var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.copy-row input, .copy-row select { flex: 1; min-width: 0; }
.copy-row .grow { flex: 1; min-width: 0; }
.hook-chan { color: var(--text-2); font-size: var(--fs-sm); white-space: nowrap; }
.bot-secret { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-3); background: var(--warn-soft); }
.bot-secret label { display: grid; gap: 2px; font-size: var(--fs-xs); }
#bot-new { align-items: end; grid-template-columns: 1fr 1fr auto; }
@media (max-width: 640px) {
  .bot-card .prop-row, #bot-new { grid-template-columns: 1fr; }
  .bot-head { flex-wrap: wrap; }
}
.allow-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.allow-list .chip { cursor: pointer; }
#dialog .allow-list label.chip { flex-direction: row; height: 28px; } /* schlägt die allgemeine Dialog-Label-Regel */
.allow-list input { display: inline-block; width: auto; height: auto; margin: 0; padding: 0; box-shadow: none; accent-color: var(--accent); }
.msg-buttons a.btn { text-decoration: none; }

/* --------------------------------------------------------------------------- Übersicht: Karten, Erledigt, Banner */
.msg-card { max-width: 560px; margin-top: 2px; }
.mcard-head { display: flex; align-items: center; gap: var(--sp-2); }
.mcard-status { width: 10px; height: 10px; flex-shrink: 0; border-radius: var(--r-full); background: var(--offline); }
.mcard-status.green { background: var(--ok); }
.mcard-status.yellow { background: var(--warn); }
.mcard-status.red { background: var(--danger); }
.mcard-summary { margin: 2px 0 0; color: var(--text); line-height: var(--lh); }
.mcard-links { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-1); font-size: var(--fs-sm); }
.mcard-links a { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); text-decoration: none; }
.mcard-links a:hover { text-decoration: underline; }
.msg-buttons.resolved .btn:disabled { opacity: .45; }
.msg-resolved { display: flex; align-items: center; gap: 4px; margin: var(--sp-1) 0 0; color: var(--ok); font-size: var(--fs-xs); }
.msg-resolved strong { font-weight: var(--fw-semibold); }
.banner { position: fixed; z-index: 50; top: var(--sp-2); left: 50%; display: flex; align-items: center; gap: var(--sp-2); max-width: calc(100vw - 32px); padding: 6px 14px; border-radius: var(--r-full); box-shadow: var(--shadow-float); font-size: var(--fs-sm); transform: translateX(-50%); }
.banner[hidden] { display: none; }
.banner span { opacity: .85; white-space: nowrap; }
.steps { margin: 0 0 var(--sp-3); padding-left: 20px; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh); }
.steps .copy-row { margin-top: var(--sp-1); }

/* ==========================================================================
   Oberfläche: zwei Spalten (Liste | Chat), Sprechblasen, Projektakte
   Prinzip wie bei Messengern, eigene Gestaltung: eine Akzentfarbe, viel Weißraum, kaum Linien.
   ========================================================================== */
:root { --list-w: 360px; --panel-w: 380px; }

body { display: flex; flex-direction: column; }
.app { flex: 1; height: auto; min-height: 0; }
.login { flex: 1; height: auto; }

/* Not-Aus-Balken: über beiden Spalten, rot, in jedem Design gut lesbar */
.banner { position: static; z-index: auto; flex-shrink: 0; justify-content: center; max-width: none; padding: 8px var(--sp-4); border-radius: 0; box-shadow: none; font-size: var(--fs-sm); transform: none; }
.banner.danger { background: var(--danger); color: var(--on-state); }
.banner.warn { background: var(--warn); color: var(--on-state); }
.banner.info { background: var(--surface-2); color: var(--text); }

/* ---------- Liste links ---------- */
.list-pane { display: flex; flex-direction: column; flex-shrink: 0; width: var(--list-w); min-height: 0; border-right: 1px solid var(--line); background: var(--bg); }
.list-head { display: flex; align-items: center; gap: var(--sp-1); height: 56px; padding: 0 var(--sp-2); }
.list-title { flex: 1; margin: 0 0 0 var(--sp-1); font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -.01em; }
.me-btn { display: grid; place-items: center; padding: 2px; border: 0; border-radius: 50%; background: none; }
.list-search { margin: 0 var(--sp-3) var(--sp-2); }
.filter-chips { display: flex; flex-wrap: nowrap; gap: 6px; padding: 0 var(--sp-3) var(--sp-2); overflow-x: auto; scrollbar-width: none; }
.chip-btn { flex-shrink: 0; height: 30px; padding: 0 11px; border: 0; border-radius: var(--r-full); background: var(--bg-muted); color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.chip-btn:hover { background: var(--bg-active); color: var(--text); }
.chip-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.entry-list { flex: 1; min-height: 0; margin: 0; padding: 0 var(--sp-2) var(--sp-4); overflow-y: auto; list-style: none; }
.entry { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-2); border-radius: var(--r-lg); color: var(--text); text-decoration: none; }
.entry:hover { background: var(--bg-hover); }
.entry.active { background: var(--bg-active); }
.entry-avatar { display: grid; place-items: center; flex-shrink: 0; width: var(--size); height: var(--size); border-radius: 50%; background: var(--bg-muted); color: var(--text-2); font-size: calc(var(--size) * .42); font-weight: var(--fw-semibold); }
.entry-avatar.emoji { font-size: calc(var(--size) * .5); }
.entry-avatar.sym { background: var(--accent-soft); color: var(--accent-text); }
.entry-main { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.entry-top, .entry-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.entry-name { min-width: 0; overflow: hidden; font-weight: var(--fw-medium); text-overflow: ellipsis; white-space: nowrap; }
.entry.unread .entry-name { font-weight: var(--fw-bold); }
.entry-meta { flex-shrink: 0; color: var(--text-3); font-size: var(--fs-xs); }
.entry-pin { display: inline-flex; color: var(--text-3); }
.entry-time { flex-shrink: 0; margin-left: auto; color: var(--text-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.entry-preview { flex: 1; min-width: 0; overflow: hidden; color: var(--text-3); font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.entry-count { flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full); background: var(--accent); color: var(--on-accent); font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 20px; text-align: center; }
.entry-empty { padding: var(--sp-8) var(--sp-3); color: var(--text-3); font-size: var(--fs-sm); text-align: center; }
.search-all { margin: 0 var(--sp-3) var(--sp-3); padding: var(--sp-2); border: 0; border-radius: var(--r); background: none; color: var(--accent-text); font-size: var(--fs-sm); text-align: left; }
.search-all:hover { background: var(--bg-hover); }
.dot { display: inline-block; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--offline); }
.dot.green { background: var(--ok); }
.dot.yellow { background: var(--warn); }
.dot.red { background: var(--danger); }

/* ---------- Chat rechts ---------- */
.main { flex: 1; min-width: 0; }
.conversation { flex: 1; min-height: 0; }
.chat-header { height: 56px; gap: var(--sp-2); padding: 0 var(--sp-3); }
.chat-title-btn { display: flex; flex: 1; align-items: center; gap: var(--sp-3); min-width: 0; padding: 4px var(--sp-2) 4px 4px; border: 0; border-radius: var(--r-lg); background: none; text-align: left; }
.chat-title-btn:not(:disabled):hover { background: var(--bg-hover); }
.chat-title-btn:disabled { color: inherit; cursor: default; }
.chat-title { display: flex; flex: 1; flex-direction: column; align-items: stretch; gap: 0; min-width: 0; }
.chat-name { display: flex; align-items: center; gap: var(--sp-2); overflow: hidden; font-size: var(--fs-md); font-weight: var(--fw-semibold); white-space: nowrap; }
.chat-sub { overflow: hidden; color: var(--text-3); font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; }
.messages { padding: var(--sp-2) 0 var(--sp-4); }
.chat-start { max-width: none; padding: var(--sp-6) var(--sp-4) var(--sp-2); text-align: center; }
.chat-start .chat-icon.big, .chat-start .avatar { margin: 0 auto; }
.day-divider { justify-content: center; margin: var(--sp-4) 0 var(--sp-2); }
.day-divider::after { display: none; }
.day-divider span, .sys-line { padding: 3px 10px; border-radius: var(--r-full); background: var(--bg-muted); color: var(--text-2); font-size: var(--fs-xs); }
.sys-line { display: flex; align-items: center; justify-content: center; gap: 4px; width: fit-content; max-width: 80%; margin: 4px auto 10px; text-align: center; }
.reply-hint { max-width: 920px; margin: 0 0 6px; color: var(--text-3); font-size: var(--fs-xs); }
.composer-wrap { padding: 0 var(--sp-4) var(--sp-2); }

/* ---------- Sprechblasen ---------- */
.msg { align-items: flex-start; gap: var(--sp-2); padding: 1px var(--sp-4); }
.msg:hover { background: none; }
.msg.first { padding-top: var(--sp-2); }
.msg.saved { box-shadow: none; }
.msg.mine { flex-direction: row-reverse; }
.msg .gutter { width: 32px; }
.msg-col { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: min(640px, 78%); }
.msg.mine .msg-col { align-items: flex-end; }
.bubble { flex: none; max-width: 100%; overflow: hidden; padding: 6px 10px 4px; border-radius: 14px; background: var(--bubble-theirs); }
.msg.mine .bubble { background: var(--bubble-mine); }
.msg.theirs.first .bubble { border-top-left-radius: 4px; }
.msg.mine.first .bubble { border-top-right-radius: 4px; }
.bubble .msg-meta { flex-wrap: wrap; gap: 6px; margin-bottom: 1px; }
.bubble .msg-author { color: var(--accent-text); font-size: var(--fs-sm); }
.msg-channel { color: var(--text-3); font-size: var(--fs-xs); }
.bubble .msg-text { line-height: 1.5; }
.bubble .msg-foot { position: static; display: flex; align-items: center; justify-content: flex-end; gap: 4px; height: auto; margin-top: 1px; color: var(--text-3); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; }
.bubble .delivery { position: static; }
.bubble .edited { font-style: italic; }
.msg-card p { margin: 0; }
.mcard-head { display: flex; align-items: center; gap: 6px; }
.msg-card .mcard-summary { margin-top: 2px; line-height: 1.5; }
.mcard-links { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: 4px; font-size: var(--fs-sm); }
.mcard-links a { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); text-decoration: none; }
.mcard-links a:hover { text-decoration: underline; }
.bubble-actions { display: flex; flex-wrap: wrap; margin: 6px -10px -4px; border-top: 1px solid var(--line-strong); }
.bubble-btn { display: inline-flex; flex: 1 1 auto; align-items: center; justify-content: center; gap: 4px; min-height: 38px; padding: 6px 14px; border: 0; background: none; color: var(--accent-text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); text-decoration: none; }
.bubble-btn + .bubble-btn { border-left: 1px solid var(--line-strong); }
.bubble-btn:hover:not(:disabled) { background: var(--bg-hover); }
.bubble-btn.danger { color: var(--danger-text); }
.bubble-btn:disabled, .bubble-actions.resolved .bubble-btn { color: var(--text-3); cursor: default; }
.bubble .msg-clicks { margin: 6px 0 0; }
.msg-col .reactions { margin-top: 4px; }
.msg.ephemeral .bubble { border: 1px dashed var(--line-strong); background: var(--bg); }
.msg-actions { top: -12px; right: var(--sp-4); display: flex; opacity: 0; pointer-events: none; transition: opacity .1s; }
.msg.mine .msg-actions { right: auto; left: var(--sp-4); }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; pointer-events: auto; animation: none; }
.thread-messages .msg { padding-left: var(--sp-3); padding-right: var(--sp-3); }

.back-btn { display: none; }

/* ---------- Seitenpanels: Thread und Projektakte ---------- */
.side-panel { display: flex; flex-direction: column; flex-shrink: 0; width: var(--panel-w); min-height: 0; border-left: 1px solid var(--line); background: var(--bg); animation: slide-in .18s var(--ease); }
.akte-back { display: none; }
.akte-body { flex: 1; overflow-y: auto; padding: var(--sp-5) var(--sp-5) var(--sp-8); }
.akte-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.akte-head h3 { margin: 0 0 4px; font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.akte-badge { display: inline-block; padding: 1px 8px; border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.akte-badge.status-live, .akte-badge.status-abo { background: var(--ok-soft); color: var(--ok-text); }
.akte-props { margin: 0 0 var(--sp-2); }
.akte-props div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: var(--sp-3); padding: 4px 0; }
.akte-props dt { color: var(--text-3); font-size: var(--fs-sm); }
.akte-props dd { margin: 0; }
.akte-body h4 { margin: var(--sp-6) 0 var(--sp-3); color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: flex; gap: var(--sp-3); padding-bottom: var(--sp-4); }
.timeline li:not(:last-child)::before { content: ""; position: absolute; top: 22px; bottom: 2px; left: 9px; width: 2px; background: var(--line-strong); }
.timeline li.done:not(:last-child)::before { background: var(--accent); }
.tl-dot { display: grid; place-items: center; flex-shrink: 0; width: 20px; height: 20px; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--bg); color: var(--on-accent); }
.timeline li.done .tl-dot { border-color: var(--accent-strong); background: var(--accent-strong); }
.tl-text { display: flex; flex-direction: column; }
.tl-meta { color: var(--text-3); font-size: var(--fs-xs); }
.akte-list { margin: 0; padding: 0; list-style: none; }
.akte-list a, .akte-list .muted { display: flex; align-items: center; gap: var(--sp-2); padding: 6px 0; color: var(--accent-text); text-decoration: none; }
.akte-list a:hover { text-decoration: underline; }
.akte-typ { padding: 0 5px; border-radius: var(--r-sm); background: var(--bg-muted); color: var(--text-2); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); }
.akte-updated { margin-top: var(--sp-6); color: var(--text-3); font-size: var(--fs-xs); }
.akte-empty { padding: var(--sp-10) var(--sp-3); color: var(--text-2); text-align: center; }
.akte-empty p { margin: var(--sp-2) 0 0; }

/* ---------- Fokus: immer sichtbar ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.entry:focus-visible, .bubble-btn:focus-visible, .menu-item:focus-visible { outline-offset: -2px; }

/* ---------- Tablet: Panels schweben über dem Chat ---------- */
@media (max-width: 1100px) {
  :root { --list-w: 300px; }
  .side-panel, .thread { position: fixed; top: 0; right: 0; bottom: 0; z-index: 25; width: min(var(--panel-w), 100vw); border-left: 0; box-shadow: var(--shadow-float); }
}

/* ---------- Handy (unter 768 px): eine Spalte – Liste → Chat → Zurück ---------- */
@media (max-width: 767px) {
  .list-pane { width: 100%; border-right: 0; }
  .app .main { display: none; }
  .app.show-main .list-pane { display: none; }
  .app.show-main .main { display: flex; }
  .back-btn, .akte-back { display: inline-grid; }
  #btn-close-akte { display: none; }
  .chat-header { gap: 2px; padding: 0 var(--sp-2) 0 4px; }
  .msg { padding-left: var(--sp-2); padding-right: var(--sp-2); }
  .msg-col { max-width: 86%; }
  .composer-wrap { padding: 0 var(--sp-2) calc(var(--sp-2) + env(safe-area-inset-bottom)); }
  .side-panel, .thread { width: 100vw; box-shadow: none; }
  .chat-actions .pill-btn { display: none; }
}

/* Nachtrag: Ungelesen-Punkt, Termine */
.entry-unread { flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-strong); }
.entry-preview.termin { color: var(--text-2); }
.akte-termine { margin: 0; padding: 0; list-style: none; }
.akte-termine li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: var(--sp-3); padding: 6px 0; }
.akte-termine time { color: var(--text-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.akte-termine li.past { color: var(--text-3); }
.akte-termine li.past strong { font-weight: var(--fw-medium); }
#cal-link { flex: 1; }

/* Ordner in der Liste: Zu tun · Kunden (nach Phase) · Agenten · Überblick · Chats */
.folder { margin-top: var(--sp-2); list-style: none; }
.folder:first-child { margin-top: 0; }
.folder-items { margin: 0; padding: 0; list-style: none; }
.folder-head { display: flex; align-items: center; gap: 6px; width: 100%; height: 32px; padding: 0 var(--sp-2); border: 0; border-radius: var(--r); background: none; color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.folder-head:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-2); }
.folder-head:disabled { cursor: default; }
.folder-head .entry-count, .folder-head .entry-unread { margin-left: auto; letter-spacing: 0; }
.folder-head .entry-unread + .entry-count { margin-left: 0; }
.folder-chev { display: inline-flex; transition: transform .15s; }
.folder.closed .folder-chev { transform: rotate(-90deg); }
.folder-sub { padding: var(--sp-2) var(--sp-2) 2px calc(var(--sp-2) + 20px); color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.folder-empty { padding: 6px var(--sp-2) 6px calc(var(--sp-2) + 20px); color: var(--text-3); font-size: var(--fs-sm); }
.entry-avatar.agent { background: var(--bg-active); color: var(--text-2); }
@media (prefers-reduced-motion: reduce) { .folder-chev { transition: none; } }

/* Vorschaubild in der Karte (links), Vergrößern im Dialog, echte Listen im Text, Vorlagen in der Akte */
.msg-card.with-image { display: flex; gap: var(--sp-3); align-items: flex-start; }
.mcard-body { min-width: 0; flex: 1; }
.mcard-thumb { display: grid; flex-shrink: 0; place-items: center; width: 72px; height: 72px; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-muted); color: var(--text-2); cursor: zoom-in; text-decoration: none; }
.mcard-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mcard-thumb.ext { gap: 2px; align-content: center; font-size: var(--fs-xs); cursor: pointer; }
.zoom-view { margin: 0; text-align: center; }
.zoom-view img { max-width: 100%; max-height: 70vh; border-radius: var(--r); }
.zoom-view figcaption { margin-top: var(--sp-2); color: var(--text-2); font-size: var(--fs-sm); }
.msg-list { margin: 4px 0; padding-left: 22px; }
.msg-list li { margin: 2px 0; }
.akte-vorlagen { margin: 0; padding: 0; list-style: none; }
.akte-vorlagen > li { padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.akte-vorlagen > li:last-child { border-bottom: 0; }
.vorlage-name { font-weight: var(--fw-medium); }
.vorlage-version { margin-left: 4px; color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-regular, 400); }
.vorlage-changes { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); font-size: var(--fs-sm); }
.mcard-text { margin-top: var(--sp-2); }


/* Bibliothek: Kategorien links, Kacheln rechts; Handy: Kategorien als Reihe oben */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.bib-head { align-items: center; max-width: none; padding: var(--sp-6) var(--sp-6) var(--sp-3); }
.bib-head .back-btn { align-self: center; }
.bib-body { display: grid; grid-template-columns: 220px 1fr; gap: var(--sp-6); padding: 0 var(--sp-6) var(--sp-10); }
.bib-cats ul { position: sticky; top: 0; margin: 0; padding: 0; list-style: none; }
.bib-cats button { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); width: 100%; padding: 7px var(--sp-2); border: 0; border-radius: var(--r); background: none; color: var(--text-2); font-size: var(--fs-sm); text-align: left; }
.bib-cats button:hover { background: var(--bg-hover); color: var(--text); }
.bib-cats button[aria-pressed="true"] { background: var(--bg-active); color: var(--text); font-weight: var(--fw-semibold); }
.bib-n { color: var(--text-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.bib-main { min-width: 0; }
.bib-tools { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.bib-tools .search-field { flex: 1 1 220px; }
.bib-select select { height: var(--h); }
.bib-kat-info { margin: var(--sp-3) 0 0; color: var(--text-2); font-size: var(--fs-sm); }
.bib-count { margin: var(--sp-3) 0; color: var(--text-3); font-size: var(--fs-sm); }
.bib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--sp-4); margin: 0; padding: 0; list-style: none; }
.bib-tile { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 0 0 var(--sp-3); overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text); text-align: left; }
.bib-tile:hover { border-color: var(--line-strong); }
.bib-tile > span:not(.bib-thumb) { padding: 0 var(--sp-3); }
.bib-thumb { display: grid; place-items: center; aspect-ratio: 16 / 10; margin-bottom: var(--sp-2); background: var(--bg-muted); color: var(--text-3); }
.bib-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bib-code { color: var(--text-3); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--fs-xs); }
.bib-name { font-weight: var(--fw-medium); line-height: var(--lh-tight); }
.bib-meta { color: var(--text-3); font-size: var(--fs-xs); }
.bib-empty { padding: var(--sp-12) var(--sp-6); text-align: center; }
.bib-notice { display: flex; align-items: center; gap: 6px; margin: 0 var(--sp-6) var(--sp-4); padding: var(--sp-2) var(--sp-3); border-radius: var(--r); background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-sm); }
.bib-detail-img { width: 100%; max-height: 50vh; object-fit: contain; border-radius: var(--r); background: var(--bg-muted); }
.bib-detail h3 .bib-code { margin-right: 6px; font-size: var(--fs-sm); font-weight: var(--fw-regular, 400); }
.bib-detail h4 { margin: 0 0 var(--sp-2); color: var(--text-3); font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .06em; text-transform: uppercase; }
.bib-used { margin: 0; padding: 0; list-style: none; }
.bib-used li { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 6px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.bib-fs { display: flex; flex-direction: column; gap: var(--sp-2); margin: 0; padding: 0; border: 0; }
.bib-fs legend { margin-bottom: 6px; padding: 0; color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.bib-checks { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }
.bib-upload { max-height: calc(100dvh - 64px); overflow-y: auto; }
.bib-progress:empty { display: none; }
.bubble-error { display: flex; align-items: center; gap: 4px; margin: 4px 2px 0; color: var(--danger-text); font-size: var(--fs-xs); }
@media (max-width: 767px) {
  .bib-head { padding: var(--sp-3) var(--sp-3) var(--sp-2) 4px; }
  .bib-head p { display: none; }
  .bib-body { grid-template-columns: 1fr; gap: var(--sp-3); padding: 0 var(--sp-3) var(--sp-8); }
  .bib-cats ul { position: static; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .bib-cats button { flex-shrink: 0; width: auto; padding: 6px 11px; border-radius: var(--r-full); background: var(--bg-muted); white-space: nowrap; }
  .bib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
  .bib-notice { margin: 0 var(--sp-3) var(--sp-3); }
}
.dialog .bib-checks label.check-inline { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-regular); }
.bib-body > *, .bib-cats { min-width: 0; }
@media (max-width: 767px) {
  .bib-tools .search-field { flex-basis: 100%; }
  .bib-select { flex: 1 1 0; min-width: 0; }
  .bib-select select { width: 100%; }
  .bib-head .btn { flex-shrink: 0; }
}


/* ==========================================================================
   EasySite Corporate Design – Schriften, Logo, Formen, Bewegung
   Lime nur als Akzent (~5 % der Fläche); Zustandsfarben nur für Zustände.
   ========================================================================== */

/* Schriftrollen: Plex Sans = Oberfläche, Bricolage = Überschriften, Plex Mono = Labels, Zeiten, Codes */
h1, h2, .page-header h2, .login-card h1, .chat-name, #akte-title, .bib-detail h3, .dialog-head h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
.page-header h2, .login-card h1 { font-weight: 800; letter-spacing: -.02em; }
.field-label, .akte-props dt, .folder-sub, .entry-time, .msg-time, .bubble .msg-foot, .msg-channel, .day-divider span,
.bib-code, .bib-n, .akte-section h4, #view-akte h4, .akte h4, .bib-detail h4, .kind-chip, .entry-meta, code {
  font-family: var(--mono); font-weight: 500;
}
.entry-time, .bubble .msg-foot, .day-divider span { letter-spacing: .02em; }

/* Fokus: 3 px Lime mit 2 px Abstand; im hellen Design zusätzlich ein Tinten-Ring (Lime allein hätte 1,2 : 1) */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-inner); }
.entry:focus-visible, .bubble-btn:focus-visible, .menu-item:focus-visible, .folder-head:focus-visible, .bib-cats button:focus-visible {
  outline-offset: -3px; box-shadow: inset 0 0 0 5px var(--focus-inner);
}
input:focus, textarea:focus, select:focus, .search-field:focus-within { border-color: var(--focus-border) !important; }

/* Knöpfe und Chips als Pille; primär = Lime-Fläche mit dunkler Schrift */
.btn { border-radius: var(--r-full); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); box-shadow: none; }
.btn.primary:hover:not(:disabled) { border-color: var(--accent-hover); background: var(--accent-hover); }
.btn.danger-solid { border-color: var(--danger); background: var(--danger); color: var(--on-state); }
.icon-btn { border-radius: var(--r-full); }
.badge, .tab-count, .check-list li.checked .checkbox, .cal-day.today .cal-num, .tg-dayhead.today strong, .send {
  background: var(--accent); color: var(--on-accent);
}
.task-check.checked { color: var(--on-state); }
.chip-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.entry-count { background: var(--accent); color: var(--on-accent); }
.entry-unread { background: var(--accent); }
.timeline li.done .tl-dot { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.tl-dot { color: var(--on-accent); }
.toast { background: var(--text); color: var(--bg); }

/* Aktiver Eintrag: ruhige Fläche plus schmaler Lime-Strich */
.entry.active { background: var(--bg-active); box-shadow: inset 3px 0 0 var(--accent); }
.bib-cats button[aria-pressed="true"] { box-shadow: inset 3px 0 0 var(--accent); }

/* Ordner-Überschriften: Plex Mono, Großbuchstaben, gesperrt; Zähler als Lime-Pille */
.folder-head { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .12em; color: var(--text-muted); }
.folder-head .entry-count { font-family: var(--font); letter-spacing: 0; }

/* Agenten-Avatare: rund, surface-2, Initialen in Lime (dunkel) bzw. Tinte (hell) */
.entry-avatar.agent { background: var(--surface-2); color: var(--agent-ink); font-family: var(--mono); font-weight: 500; letter-spacing: -.02em; }
.entry-avatar.sym { background: var(--surface-2); color: var(--text-2); }

/* Sprechblasen und Karten: 14 px Ecken; Bot-Knöpfe flach, primär als Lime-Fläche, Gefahr in Rot */
.bubble { border-radius: var(--r-xl); }
.msg.theirs .bubble { box-shadow: 0 0 0 1px var(--line); }
.bubble .msg-author { color: var(--accent-text); }
.bubble-btn { color: var(--accent-text); }
.bubble-btn.primary { background: var(--accent); color: var(--on-accent); }
.bubble-btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.bubble-btn.danger { color: var(--danger-text); }
.bubble-btn:disabled, .bubble-actions.resolved .bubble-btn, .bubble-actions.resolved .bubble-btn.primary { background: none; color: var(--text-muted); }
.mcard-links a, .msg-text a, a.msg-link { color: var(--accent-text); }
.msg-resolved { color: var(--ok-text); }
.bib-tile, .msg-card .mcard-thumb, .akte-panel, .dialog { border-radius: var(--r-xl); }
.bib-notice { background: var(--accent-soft); color: var(--text); }
.bib-notice .ic { color: var(--accent-text); }

/* Not-Aus-Balken: Zustandsfarbe, dunkle Schrift (Weiß hätte auf Rot nur 2,8 : 1), ohne Animation */
.banner { animation: none !important; transition: none !important; }
.banner.danger { background: var(--danger); color: var(--on-state); }
.banner.warn { background: var(--warn); color: var(--on-state); }
.banner.info { background: var(--surface-2); color: var(--text); box-shadow: inset 0 -1px 0 var(--line); }
.banner span { opacity: 1; }

/* Leere Chat-Fläche: dezentes Punktraster (nur dunkel, nie hinter Text in Blasen – Blasen sind deckend) */
#messages { background-image: radial-gradient(var(--grid-dot) 1px, transparent 1.6px); background-size: 22px 22px; }
.chat-start .sys-line, .day-divider span, .sys-line { background: var(--surface-2); }

/* Logo: Schalter + Wortmarke „easysite“ (Archivo 800, Breite 112 %), Knopf immer Lime */
.brand-logo { display: inline-flex; align-items: center; gap: .32em; color: var(--text); font-size: 19px; line-height: 1; text-decoration: none; white-space: nowrap; }
.brand-switch { flex-shrink: 0; width: auto; height: 1.08em; color: var(--logo-body); }
.brand-switch text { font-family: var(--font-brand); font-stretch: 112%; }
.brand-word { font-family: var(--font-brand); font-size: 1em; font-weight: 800; font-stretch: 112%; letter-spacing: -.015em; text-transform: lowercase; }
.brand-logo.lg { font-size: 40px; }
.list-title { display: flex; align-items: center; margin-left: var(--sp-2); }
.login-card .brand-logo { align-self: center; margin-bottom: var(--sp-3); }

/* Anmeldung: Logo groß, Punktraster im Hintergrund */
.login { background-color: var(--bg); background-image: radial-gradient(var(--grid-dot-login) 1.2px, transparent 1.8px); background-size: 20px 20px; }
.login-card { border-color: var(--line); background: var(--surface); }

/* Bewegung: Karten blenden sanft ein (nur neue Nachrichten), sonst ruhig */
.msg.fresh .msg-card { animation: card-in .24s var(--ease) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* Häkchen, Auswahlpunkte, Regler im Browser-Standard: Lime statt Blau */
input[type="checkbox"], input[type="radio"], input[type="range"], progress { accent-color: var(--accent); }
