/* === RESET & BASE === */
/* Inter selbst gehostet (Variable Font, latin-Subset inkl. Umlaute + €) —
   kein Google-Fonts-Request mehr: schneller, offline-faehig, DSGVO-sauber.
   Die Datei deckt als Variable Font alle Gewichte 400–700 ab. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/assets/fonts/inter-latin.woff2') format('woff2');
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
input, textarea, select, button { font-family: inherit; font-size: inherit; color: inherit; }
input, textarea, select { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.5rem 0.75rem; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(91, 75, 196, 0.15); }
/* Suchfelder bleiben beim Fokus dezent — kein Akzent-Ring */
input[type="search"]:focus { border-color: var(--color-border); box-shadow: none; }

/* Strukturelle Tokens — Farben/Schatten definiert ausschliesslich themes.css
   (frueher lag hier ein kompletter Dark-Satz, der nur wegen der Bundle-
   Reihenfolge base→themes unsichtbar blieb) */
:root {
    --radius: 10px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--color-primary); }
h1 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.1rem; font-weight: 600; }
/* === THEME DEFINITIONEN === */
/* 2 Modi: Light (Default) + Dark */
/* Aktives Theme: data-theme Attribut auf <html> ("light" | "dark") */

/* Brand-Akzent (faictory, themeunabhaengig): zweifarbiger Verlauf wie auf
   faictory.de fuer Primaer-Buttons + Sidebar-Marke/Nav-Avatar. Core-Default;
   ein Projekt-CI kann --accent/--accent-2/--accent-gradient uebersteuern
   (partials/ci-style.php). Konsumiert via var(--accent-gradient, var(--color-primary))
   in components.css (.btn--primary) und layout.css (Marke, Nav-Avatar). */
:root {
    --accent: #f97467;
    --accent-2: #790a0a;
    --accent-gradient: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
}

/* --- LIGHT (Default) --- */
[data-theme="light"], :root {
    --color-primary: #5b4bc4;
    --color-primary-dark: #4d3fa6;
    --color-primary-light: #efedf9;
    --color-bg: #f6f5fa;
    --color-surface: #ffffff;
    --color-surface-hover: #faf9fd;
    --color-text: #211e33;
    --color-text-muted: #6f6d7a;
    --color-text-light: #a8a29e;
    --color-border: #e7e5e4;
    --color-border-light: #f5f5f4;
    --color-success: #059669;
    --color-success-light: #ecfdf5;
    --color-error: #dc2626;
    --color-error-light: #fef2f2;
    --color-warning: #d97706;
    --color-warning-light: #fffbeb;
    --shadow: 0 1px 2px rgba(33,30,51,0.05), 0 4px 16px rgba(33,30,51,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.06), 0 4px 6px rgba(0,0,0,0.03);
    --login-gradient: linear-gradient(135deg, #faf5ff 0%, #fafaf9 50%, #f5f3ff 100%);
    --color-favorite: #fbbf24;
}

/* --- DARK --- */
[data-theme="dark"] {
    --color-primary: #897dd5;
    --color-primary-dark: #5b4bc4;
    --color-primary-light: rgba(137, 125, 213, 0.12);
    --color-bg: #09090b;
    --color-surface: #18181b;
    --color-surface-hover: #27272a;
    --color-text: #fafafa;
    --color-text-muted: #a1a1aa;
    --color-text-light: #71717a;
    --color-border: #27272a;
    --color-border-light: #1e1e22;
    --color-success: #34d399;
    --color-success-light: rgba(52, 211, 153, 0.12);
    --color-error: #f87171;
    --color-error-light: rgba(248, 113, 113, 0.12);
    --color-warning: #fbbf24;
    --color-warning-light: rgba(251, 191, 36, 0.12);
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.25);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.45), 0 4px 10px rgba(0,0,0,0.3);
    --login-gradient: linear-gradient(135deg, #09090b 0%, #0f0a1f 50%, #09090b 100%);
    --color-favorite: #fbbf24;
}

/* Light-Theme Alert-Borders: kraeftigere Border, weil die *-light-Hintergruende
   im Light-Mode fast weiss sind */
[data-theme="light"] .alert--success { border-color: #a7f3d0; }
[data-theme="light"] .alert--error { border-color: #fecaca; }
[data-theme="light"] .alert--warning { border-color: #fde68a; }

/* Dark/Light-Switch (Einstellungen → Erscheinungsbild) */
.theme-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: calc(var(--radius) - 3px); }
.theme-switch-opt { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: calc(var(--radius) - 3px); font-size: 13px; font-weight: 600; color: var(--color-text-muted); text-decoration: none; transition: all 0.15s; }
.theme-switch-opt:hover { color: var(--color-primary); }
.theme-switch-opt--active { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow); }
.theme-switch-opt--active:hover { color: var(--color-text); }
/* === Icon System (SVG inline, Linear-Style) === */
/* Monochrome, 1px stroke, currentColor */

.icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    flex-shrink: 0;
}
.icon--sm { width: 14px; height: 14px; }
.icon--lg { width: 20px; height: 20px; }

/* Icons als background-image SVG (currentColor via filter) */
.icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
/* === Avatar (Sidebar-Benutzer-Chip + Konto-Popover) ===
   Frueher gab es hier die komplette Top-Navigation (.nav*). Die ist entfernt —
   Sidebar ist das einzige Layout. Nur die Avatar-Klassen bleiben, weil sie der
   Benutzer-Chip und das Konto-Menue (partials/_usermenu-popover.php) nutzen. */
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--color-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.nav-avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

/* === Main Content === */
.main {
    padding: 0;
    width: 100%;
}

/* Container-Varianten: tragen das Padding, damit .main padding-frei bleibt.
 * So koennen Module mit eigener Sidebar edge-to-edge im .main sitzen,
 * waehrend normaler Content bequem Abstand hat. */
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 2rem; }
.container--narrow { width: 100%; max-width: 640px; margin: 0 auto; padding: 2rem; }
.container--wide { width: 100%; max-width: none; margin: 0; padding: 1rem; }

/* ============================================================
 * Sidebar-Layout (body[data-layout="sidebar"])
 * Haupt-Navi wandert in eine fixe linke Spalte, Modul-Submenues
 * werden zu ausklappbaren Unterelementen.
 *
 * Breiten-Management via CSS-Variable --sidebar-width. Beim Collapse
 * wird nur die Variable geaendert, alles andere (Sidebar, Content,
 * Transitions) folgt automatisch.
 * ============================================================ */

body[data-layout="sidebar"] {
    --sidebar-width: 240px;
    --sidebar-gap: 0.5rem;
}

/* Collapsed-Mode: Sidebar schrumpft zur schmalen Icon-Rail (66px), sie bleibt
 * sichtbar. Nur die Variable aendert sich — .main und .app-sidebar folgen.
 * Wieder-Aufklappen ueber die Brand-Marke (app.js). */
body[data-layout="sidebar"][data-sidebar-collapsed="1"] {
    --sidebar-width: 66px;
    --sidebar-gap: 0px;
}


/* Gap wird ueber margin-left erzeugt, NICHT ueber padding-left.
 * Dadurch bleibt .main's Padding einheitlich bei 2rem und alle Views
 * die sich mit 'margin: -2rem' in .main rausziehen funktionieren konsistent. */
body[data-layout="sidebar"] .main {
    margin-left: calc(var(--sidebar-width) + var(--sidebar-gap));
    width: calc(100% - var(--sidebar-width) - var(--sidebar-gap));
    padding: 0;
    min-height: 100vh;
    transition: margin-left 0.2s ease, width 0.2s ease;
}

.app-sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width, 240px); /* folgt der Collapse-Variable: 240px <-> 66px */
    height: 100vh;
    /* --sidebar-* setzt das CI-Theming (partials/ci-style.php); ohne CI gilt das Theme. */
    background: var(--sidebar-bg, var(--color-surface));
    border-right: 1px solid var(--color-border);
    box-shadow: none;
    padding: 20px 12px;
    z-index: 100;
    flex-direction: column;
    gap: 4px;
    transition: width 0.2s ease, padding 0.2s ease;
}

body[data-layout="sidebar"] .app-sidebar {
    display: flex;
}

/* Collapsed: schmale Icon-Rail (Prototyp-Spec) — Labels/Name/Claim/Meta aus,
 * Icons zentriert. Die Sidebar bleibt sichtbar, verschwindet NICHT. */
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar {
    padding: 20px 10px;
    overflow: visible;
}
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-brand {
    justify-content: center;
    padding: 4px 0 18px;
}
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-brand-name,
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-group-label { display: none; }
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-link {
    justify-content: center;
    padding: 9px 0;
    gap: 0;
    position: relative;
}
/* Eingeklappt: die Nav darf nicht clippen, sonst wird der Icon-Tooltip abgeschnitten. */
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-nav { overflow: visible; }
/* Label wird zum Tooltip: weisse Schrift auf schwarzem, abgerundetem "Button" rechts neben dem Icon. */
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-link-label {
    display: block;
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    flex: none;
    padding: 6px 11px;
    background: #1a1a22;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease;
    z-index: 300;
}
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-link:hover .app-sidebar-link-label {
    opacity: 1;
    visibility: visible;
}
/* Eingeklappt: Chevron der Submenue-Parents entfaellt (kein Platz in der Rail). */
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-link-chevron { display: none; }
/* Eingeklappt: Submenue-Liste ausblenden — die Rail zeigt nur die Modul-Icons. */
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-submenu { display: none; }
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-user {
    justify-content: center;
    margin: 6px -10px 0;
    padding: 12px 0 2px;
    gap: 0;
}
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-user-meta { display: none; }

/* Brand nach Prototyp-Spec: Mark + Name/Claim + Collapse-Pfeil, keine Trennlinie. */
.app-sidebar-brand {
    padding: 4px 10px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.app-sidebar-brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--accent-gradient, var(--color-primary));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 15px;
    flex: 0 0 auto;
    text-decoration: none;
}
/* Vollbreiten-Logo (ci_logo_mode = 'full'): Logo oben, Titel darunter — statt
   Logo und Titel nebeneinander. Die Breite kommt als Inline-Style aus ci_logo_width. */
.app-sidebar-brand--full {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}
.app-sidebar-brand-full {
    display: flex;
    justify-content: center;
    text-decoration: none;
}
.app-sidebar-brand-full-img {
    max-width: 100%;
    height: auto;
    display: block;
}
/* Im Vollbreiten-Modus traegt der Titel die Zeile — die kleine Marke waere
   doppelt gemoppelt. */
.app-sidebar-brand--full { position: relative; }
.app-sidebar-brand--full .app-sidebar-brand-mark { display: none; }
.app-sidebar-brand--full .app-sidebar-brand-name {
    flex: none;
    text-align: center;
    align-self: center;
    max-width: 100%;
}
/* Einklapp-Pfeil oben rechts statt in einer eigenen Zeile: sonst kostet er
   Hoehe und schiebt die Navigation nach unten. */
.app-sidebar-brand--full .app-sidebar-collapse-btn {
    position: absolute;
    top: 0;
    right: 0;
}

/* Eingeklappte Icon-Rail (66px): kein Platz fuer ein breites Logo — dort gilt
   wieder die quadratische Marke, unabhaengig vom gewaehlten Modus. */
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-brand--full { flex-direction: row; }
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-brand-full { display: none; }
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-brand--full .app-sidebar-brand-mark { display: grid; }

.app-sidebar-brand-letter { display: grid; place-items: center; }
/* Hochgeladenes Logo (CI-Feld ci_logo) fuellt die Marke statt des Buchstabens. */
.app-sidebar-brand-logo { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; display: block; }
.app-sidebar-brand-expand { display: none; place-items: center; }
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-brand-mark:hover .app-sidebar-brand-logo { display: none; }
/* Eingeklappt: Hover ueber die Marke tauscht Logo/Buchstabe gegen das Aufklapp-Icon
 * (Klick klappt auf, siehe app.js). Ausgeklappt ist die Marke der Dashboard-Link. */
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-brand-mark { cursor: pointer; }
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-brand-mark:hover .app-sidebar-brand-letter { display: none; }
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-brand-mark:hover .app-sidebar-brand-expand { display: grid; }
.app-sidebar-brand-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--sidebar-ink-strong, var(--color-text));
    text-decoration: none;
    letter-spacing: -0.01em;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Claim unter dem App-Namen (CI-Feld ci_claim, z.B. "CRM & Projekte") */
.app-sidebar-brand-claim {
    display: block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--sidebar-ink, var(--color-text-muted));
    opacity: 0.75;
    margin-top: -2px;
}

/* ---- Bereichs-Switcher (docs/frontend.md "Bereiche") ----------------------
 * 2 Bereiche: Segmented-Pill ueber dem Dashboard-Link. 3+: Combobox-Button
 * mit Popover. Eingeklappte Rail zeigt nur die Initialen (Regeln unten). */
.app-sidebar-areas {
    margin: 0 0 14px;
    flex-shrink: 0;
    position: relative;
}
.app-sidebar-areas--pill {
    display: flex;
    padding: 3px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) - 3px);
    gap: 2px;
}
/* Textfarben theme-basiert (nicht --sidebar-ink): der Pill-Hintergrund ist
 * --color-bg, nicht die CI-Sidebar-Farbe — sidebar-ink waere darauf unlesbar. */
.app-sidebar-area-seg {
    flex: 1;
    text-align: center;
    padding: 5px 8px;
    border-radius: calc(var(--radius) - 3px);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-sidebar-area-seg:hover { color: var(--color-primary); }
.app-sidebar-area-seg--active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow);
}
.app-sidebar-area-seg--active:hover { color: var(--color-text); }
.app-sidebar-area-seg-initial { display: none; }

/* Combobox (3+ Bereiche): Button mit aktuellem Label + Chevron, Popover-Liste. */
.app-sidebar-area-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) - 3px);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
}
.app-sidebar-area-btn:hover { border-color: color-mix(in srgb, var(--color-primary) 35%, var(--color-border)); }
.app-sidebar-area-btn-label {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-sidebar-area-btn-initial { display: none; }
.app-sidebar-area-chevron { flex: 0 0 auto; opacity: 0.6; }
.app-sidebar-area-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) - 2px);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 300;
}
.app-sidebar-area-item {
    display: block;
    padding: 7px 10px;
    border-radius: calc(var(--radius) - 4px);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
}
.app-sidebar-area-item:hover { background: color-mix(in srgb, var(--color-text-muted) 9%, transparent); }
.app-sidebar-area-item--active { color: var(--color-primary); font-weight: 600; }

/* Eingeklappte Icon-Rail: Pill wird zur Initial-Spalte, Combobox zum Initial-Button. */
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-areas--pill {
    flex-direction: column;
    border-radius: calc(var(--radius) - 3px);
    padding: 3px;
}
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-area-seg {
    padding: 6px 0;
    border-radius: calc(var(--radius) - 3px);
}
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-area-seg-label { display: none; }
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-area-seg-initial { display: inline; }
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-area-btn {
    justify-content: center;
    padding: 7px 0;
    gap: 0;
}
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-area-btn-label,
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-area-chevron { display: none; }
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-area-btn-initial { display: inline; }
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-area-menu {
    left: calc(100% + 8px);
    right: auto;
    top: 0;
    min-width: 180px;
}

.app-sidebar-nav {
    flex: 1;
    min-height: 0;
}

.app-sidebar-module {
    display: block;
}

/* Gruppen-Ueberschrift in der Nav (manifest.nav_group + config app.nav_groups) */
.app-sidebar-group-label {
    padding: 1rem 1.25rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-ink, var(--color-text-light));
    opacity: 0.75;
}
.app-sidebar-group-label:first-child { padding-top: 0.35rem; }

/* Nav-Reiter als abgerundete Pills (CI-Default aus CRM): kein Border-Left,
   keine eckige Voll-Breite — Hover/Active liegen als abgerundete Flaeche inset
   in der 12px-Sidebar-Polsterung. Hover = zarter Ink-Wash, Active = Primaerfarbe
   dezent auf Surface. */
.app-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: calc(var(--radius) - 3px);
    color: var(--sidebar-ink, var(--color-text-muted));
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}
.app-sidebar-link:hover {
    background: color-mix(in srgb, var(--sidebar-ink, var(--color-text-muted)) 9%, transparent);
    color: var(--sidebar-ink-strong, var(--color-text));
}
.app-sidebar-link--active {
    background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
    color: var(--color-primary);
    font-weight: 600;
}
.app-sidebar-link-icon { display: flex; align-items: center; flex: 0 0 auto; opacity: 0.75; }
.app-sidebar-link--active .app-sidebar-link-icon { opacity: 1; }
.app-sidebar-link-label { flex: 1; }
/* Nav-Badge (manifest.nav_badge, z.B. faellige Wiedervorlagen): Pille am rechten Rand. */
.app-sidebar-link-badge {
    flex: 0 0 auto;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--color-warning);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
/* Eingeklappt: Badge schrumpft zum Punkt oben rechts am Icon — Zahl entfaellt,
   das "hier ist was offen"-Signal bleibt sichtbar. */
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-link-badge {
    position: absolute;
    top: 5px;
    right: 8px;
    min-width: 8px;
    width: 8px;
    height: 8px;
    padding: 0;
    font-size: 0;
    line-height: 0;
}
.app-sidebar-link-chevron {
    transition: transform 0.15s;
    opacity: 0.6;
    font-size: 0.7rem;
}
.app-sidebar-module--expanded > .app-sidebar-link .app-sidebar-link-chevron {
    transform: rotate(90deg);
}

/* Submenue eines Moduls (manifest.sidebar): eingerueckte Pills im GLEICHEN Stil
   wie die Modul-Links — kein Border-Left, kein Fremd-Hintergrund (der frueher die
   dunkle Sidebar als weisse Box durchbrach), abgerundet. Hover = zarter Ink-Wash,
   Active = Primaerfarbe dezent auf Surface. */
.app-sidebar-submenu {
    display: none;
    margin: 2px 0 4px;
    padding-left: 20px;
}
.app-sidebar-module--expanded .app-sidebar-submenu { display: block; }

.app-sidebar-subitem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: calc(var(--radius) - 3px);
    color: var(--sidebar-ink, var(--color-text-muted));
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}
.app-sidebar-subitem:hover {
    background: color-mix(in srgb, var(--sidebar-ink, var(--color-text-muted)) 9%, transparent);
    color: var(--sidebar-ink-strong, var(--color-text));
}
.app-sidebar-subitem--active {
    background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface));
    color: var(--color-primary);
    font-weight: 600;
}

.app-sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.app-sidebar-footer-btn {
    background: none;
    border: none;
    padding: 0.4rem;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.app-sidebar-footer-btn:hover { background: var(--color-bg); color: var(--color-text); }
.app-sidebar-footer-profile { margin-left: auto; }

/* Klickbarer User-Chip unten: oeffnet das Settings-Modal (Button-Reset noetig,
 * da im Core ein <button> statt eines <a>). Nur durch eine feine Linie abgesetzt. */
.app-sidebar-user {
    background: none;
    border: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    width: calc(100% + 24px);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px -12px 0;
    padding: 12px 12px 2px;
    border-top: 1px solid var(--color-border);
    color: var(--sidebar-ink, var(--color-text-muted));
    text-decoration: none;
    flex-shrink: 0;
}
.app-sidebar-user .nav-avatar,
.app-sidebar-user .nav-avatar-img { flex: 0 0 auto; }
.app-sidebar-user .nav-avatar { background: var(--accent-gradient, var(--color-primary)); }
.app-sidebar-user-meta { min-width: 0; }
.app-sidebar-user-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--sidebar-ink-strong, var(--color-text));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-sidebar-user-role {
    display: block;
    font-size: 11px;
    color: var(--sidebar-ink, var(--color-text-muted));
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Kein Hover-Umfaerben des Namens: er bleibt --sidebar-ink-strong (weiss/schwarz
 * je nach Sidebar-Farbe, core/Color.php readableInk) statt der Primaerfarbe. */

/* Sidebar-Collapse-Button: sitzt rechts in der Brand-Zeile und klappt die
 * Sidebar zur Icon-Rail ein. Wieder-Aufklappen laeuft ueber die Brand-Marke
 * (app.js). Im eingeklappten Zustand ist der Button daher verborgen. */
.app-sidebar-collapse-btn {
    flex: 0 0 auto;
    /* Nach rechts schieben — trug frueher der flex:1-Titel; ohne Titel (leeres
       ci_sidebar_title) muss der Button selbst den Raum nehmen. */
    margin-left: auto;
    width: 26px;
    height: 26px;
    border-radius: calc(var(--radius) - 4px);
    border: 0;
    background: transparent;
    color: var(--sidebar-ink, var(--color-text-muted));
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s, background 0.15s;
}
.app-sidebar-collapse-btn:hover { opacity: 1; background: var(--sidebar-hover, var(--color-bg)); }
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-sidebar-collapse-btn { display: none; }

/* Responsive: Bei schmalen Bildschirmen faellt die Sidebar auf die Icon-Rail
 * (66px) zurueck, damit der Inhalt Platz bekommt. app.js setzt zusaetzlich
 * data-sidebar-collapsed (blendet die Labels aus); ohne JS bleibt es eine
 * reine Icon-Spalte. Aufklappen ueber die Brand-Marke. */
@media (max-width: 900px) {
    body[data-layout="sidebar"] {
        --sidebar-width: 66px;
        --sidebar-gap: 0px;
    }
    /* Schmale Viewports = Icon-Rail per Media-Query (ohne data-Attribut):
     * Bereichs-Switcher zeigt auch hier nur die Initialen. */
    body[data-layout="sidebar"] .app-sidebar-areas--pill {
        flex-direction: column;
        border-radius: calc(var(--radius) - 3px);
    }
    body[data-layout="sidebar"] .app-sidebar-area-seg {
        padding: 6px 0;
        border-radius: calc(var(--radius) - 3px);
    }
    body[data-layout="sidebar"] .app-sidebar-area-seg-label { display: none; }
    body[data-layout="sidebar"] .app-sidebar-area-seg-initial { display: inline; }
    body[data-layout="sidebar"] .app-sidebar-area-btn { justify-content: center; padding: 7px 0; gap: 0; }
    body[data-layout="sidebar"] .app-sidebar-area-btn-label,
    body[data-layout="sidebar"] .app-sidebar-area-chevron { display: none; }
    body[data-layout="sidebar"] .app-sidebar-area-btn-initial { display: inline; }
    body[data-layout="sidebar"] .app-sidebar-area-menu {
        left: calc(100% + 8px);
        right: auto;
        top: 0;
        min-width: 180px;
    }
}

/* Embed-Layout (app/views/layouts/fragment.php, Aufruf mit ?embed=1): Wrapper
   fuer eine Settings-Ansicht ohne App-Sidebar. Rest des frueheren Settings-
   Modals — dessen Styles sind entfernt, diese beiden Klassen sind in Gebrauch. */
.settings-fragment {
    display: flex;
    flex: 1;
    min-height: 0;
}
.settings-flash {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
    pointer-events: none;
}
.settings-flash .flash { pointer-events: auto; }


/* Avatar-Farbauswahl: Runde Dots mit Hover/Active/Selected-State. */
.avatar-color-dot {
    cursor: pointer;
    display: inline-block;
}
.avatar-color-dot input { display: none; }
.avatar-color-dot span {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    box-sizing: content-box;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.avatar-color-dot:hover span {
    transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}
.avatar-color-dot--selected span,
.avatar-color-dot input:checked + span {
    border-color: var(--color-text);
    transform: scale(1.1);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* Passwort-Block eingeklappt (details/summary) */
details.section-card > summary::-webkit-details-marker { display: none; }
details.section-card > summary { user-select: none; }
details.section-card[open] > summary svg {
    transform: rotate(180deg);
}

/* === Page Header === */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 { margin-bottom: 0; }

.page-subline { color: var(--color-text-muted); font-size: 0.85rem; margin-top: 0.15rem; }

/* Core-Version rechts oben im Einstellungs-Header — dezente Marke, kein Blickfang:
   sie soll auffindbar sein (Support/Update-Frage), nicht um Aufmerksamkeit buhlen. */
/* Versions-Badges im Einstellungs-Kopf: Core + Module mit eigenem CHANGELOG,
   je mit Bezeichnung, oben rechts nebeneinander (umbricht bei Enge). */
.version-badges {
    flex: 0 0 auto;
    align-self: flex-start;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}
.version-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-text-muted) 12%, transparent);
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.version-badge-label {
    text-transform: uppercase;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    opacity: 0.7;
}

/* === Split-Layout (z.B. Einstellungen: Form links, Vorschau rechts) === */
.split { display: grid; grid-template-columns: 1fr 340px; gap: 1rem; align-items: start; }
.split--ci { grid-template-columns: 1fr 1fr; }
.split > div > .card + .card { margin-top: 1rem; }

@media (max-width: 1100px) {
    .split--ci { grid-template-columns: 1fr; }
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* === Breadcrumb === */
.breadcrumb {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Konto-Menue (Benutzer-Popover) — der eine Weg zu Einstellungen + Abmelden.
   Trigger: .app-sidebar-user (Benutzer-Chip unten in der Sidebar). Popover
   oeffnet nach oben (--up). */
.app-usermenu { position: relative; }
.app-usermenu > [data-usermenu-toggle] { cursor: pointer; background: none; border: 0; font: inherit; }
.app-usermenu-caret { margin-left: auto; color: var(--color-text-muted); flex-shrink: 0; }
body[data-layout="sidebar"][data-sidebar-collapsed="1"] .app-usermenu-caret { display: none; }

.app-usermenu-popover {
    position: absolute;
    min-width: 232px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) + 2px);
    box-shadow: var(--shadow-lg, 0 12px 32px rgba(0, 0, 0, 0.16));
    padding: 6px;
    z-index: 400;
}
.app-usermenu--up .app-usermenu-popover { bottom: calc(100% + 8px); left: 0; }
.app-usermenu--down .app-usermenu-popover { top: calc(100% + 8px); right: 0; }

.app-usermenu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.app-usermenu-head-meta { display: flex; flex-direction: column; min-width: 0; }
.app-usermenu-head-name { font-weight: 700; color: var(--color-text); }
.app-usermenu-head-email {
    font-size: 0.8rem; color: var(--color-text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-usermenu-sep { height: 1px; background: var(--color-border); margin: 4px 6px; }
.app-usermenu-logout { margin: 0; }
.app-usermenu-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 10px; border-radius: calc(var(--radius) - 2px);
    color: var(--color-text); text-decoration: none;
    background: none; border: 0; font: inherit; text-align: left; cursor: pointer;
}
.app-usermenu-item:hover { background: var(--color-bg, #f5f4f7); }
.app-usermenu-ico { color: var(--color-text-muted); flex-shrink: 0; }
}
.breadcrumb a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-primary); }

/* === Alerts === */
.alert {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert--success { background: var(--color-success-light); color: var(--color-success); border: 1px solid rgba(52, 211, 153, 0.2); }
.alert--error   { background: var(--color-error-light); color: var(--color-error);     border: 1px solid rgba(248, 113, 113, 0.2); }
.alert--warning { background: var(--color-warning-light); color: var(--color-warning); border: 1px solid rgba(251, 191, 36, 0.2); }

/* Flash Toast (fixed bottom center) */
.flash-toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    pointer-events: none;
}
.flash-toast {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: flash-in 0.3s ease, flash-out 0.3s ease 3.5s forwards;
    max-width: 500px;
}
.flash-toast--success { background: var(--color-success); color: #fff; }
.flash-toast--error { background: var(--color-error); color: #fff; }
.flash-toast--warning { background: var(--color-warning); color: #000; }
@keyframes flash-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes flash-out { from { opacity: 1; } to { opacity: 0; transform: translateY(10px); } }

/* === Cards === */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    transition: none;
}

/* Ruhige Flaechen (CI-Default): kein Hover-Lift, Karten bleiben auf Ruhe-Schatten. */
.card:hover { box-shadow: var(--shadow); }
.card h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: var(--color-text); }
.card h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; }

/* === Section Cards (Bildgenerator-Style) === */
.section-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: visible;
    box-shadow: var(--shadow);
    /* Core-Default-Abstand zwischen gestapelten Karten (z.B. Settings-Panels).
       Zentral hier statt per Inline-margin in jeder View — Projekte ueber-
       schreiben bei Bedarf via eigenem CSS (.section-card { margin-bottom: ... }).
       Vertikale Margins benachbarter Karten kollabieren, doppeln also nicht. */
    margin-bottom: 1rem;
}

.section-card-header {
    padding: 1rem 1rem 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-card-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}

.section-card-body { padding: 1rem; }

/* Karten-Kopf: Titel + optionale Aktionen in einer Zeile */
.card-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.card-head h3 { margin: 0; }

/* === Tab-Leiste (z.B. Einstellungen-Panels) === */
.tabs { display: inline-flex; gap: 2px; background: var(--color-surface-hover); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 3px; margin-bottom: 1rem; }
/* Ein Tab. Der Reset (border/background/appearance/font/cursor) laesst
   <button class="tab"> exakt wie <a class="tab"> aussehen — sonst rendert der
   Button seine native graue Box (Grund fuer "Elemente sieht anders aus als
   Einstellungen"). white-space:nowrap: Labels brechen nie um; passt die Leiste
   nicht mehr in ihren Container, schaltet app.js auf das .tabs-select-Dropdown. */
.tab { display: inline-flex; align-items: center; padding: 0.35rem 0.9rem; border: 0; background: transparent; border-radius: calc(var(--radius) - 3px); font-family: inherit; font-size: 0.85rem; font-weight: 500; line-height: 1.4; white-space: nowrap; color: var(--color-text-muted); text-decoration: none; cursor: pointer; appearance: none; -webkit-appearance: none; }
.tab:hover { color: var(--color-text); text-decoration: none; }
.tab--active { background: var(--color-surface); color: var(--color-text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
/* Eingeklappt (app.js: Overflow erkannt) — die Tab-Leiste weicht dem Dropdown. */
.tabs.is-collapsed { display: none; }
/* Dropdown-Ersatz fuer die horizontale Nav auf schmalen Containern. Gleiche
   Optik wie ein Tab-Feld; native <select>-Pfeil durch eigenes Chevron ersetzt. */
.tabs-select {
    display: block;
    max-width: 100%;
    margin-bottom: 1rem;
    padding: 0.45rem 2.1rem 0.45rem 0.9rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    background-color: var(--color-surface);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.tabs-select:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.tabs-select[hidden] { display: none; }

/* === Range-Slider mit Endpunkt-Hinweisen (klein ↔ groß) === */
.range-row { display: flex; align-items: center; gap: 0.6rem; }
.range-row input[type="range"] { flex: 1; min-width: 0; }
.range-row .range-hint { font-size: 0.72rem; color: var(--color-text-muted); white-space: nowrap; }

/* === Forms === */
.form-group { margin-bottom: 1.125rem; }

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-group textarea { min-height: 44px; resize: none; overflow: hidden; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

/* --accent-gradient kommt aus CI (ci-style.php) oder einem Projekt-Theme;
   ohne Wert flacher Primaerfarben-Button. Hover dunkelt per filter ab,
   damit auch ein Verlauf sichtbar reagiert (Background-Tausch wuerde ihn ersetzen). */
.btn--primary { background: var(--accent-gradient, var(--color-primary)); color: #fff; }
/* Hover bewusst dezent (CI-Default): der Verlauf bleibt sichtbar, nur leicht abgedunkelt. */
.btn--primary:hover { filter: brightness(0.96); color: #fff; box-shadow: var(--shadow); }

.btn--outline { background: var(--color-surface); color: var(--color-text-muted); border-color: var(--color-border); }
.btn--outline:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn--danger { background: var(--color-error); color: #fff; }
.btn--danger:hover { background: #dc2626; color: #fff; }

.btn--success { background: var(--color-success); color: #fff; }
.btn--success:hover { background: #059669; }

.btn--sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }
.btn--full { width: 100%; }
.btn--icon { padding: 0.5rem; width: 36px; height: 36px; border-radius: var(--radius); background: var(--color-bg); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.btn--icon:hover { background: var(--color-border-light); color: var(--color-text); }

/* === Login === */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: var(--login-gradient, linear-gradient(135deg, #09090b 0%, #0f0a1f 50%, #09090b 100%));
}

.login-branding { text-align: center; margin-bottom: 1.5rem; }
.login-branding-logo { font-weight: 700; font-size: 1.5rem; letter-spacing: -0.03em; color: var(--color-text); }
.login-branding-logo span { color: var(--color-primary); }
.login-branding-tagline { font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.04em; margin-top: 0.75rem; color: var(--color-text); }
.login-branding-tagline em { font-style: normal; background: linear-gradient(135deg, var(--color-primary), #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.login-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-text);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.login-legal { text-align: center; margin-top: 1.25rem; font-size: 0.7rem; color: var(--color-text-muted); line-height: 1.5; max-width: 320px; }
.login-legal a { color: var(--color-primary); text-decoration: none; }
.login-legal a:hover { text-decoration: underline; }

/* === Tags/Badges === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.625rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge--success { background: var(--color-success-light); color: var(--color-success); }
.badge--warning { background: var(--color-warning-light); color: var(--color-warning); }
.badge--error   { background: var(--color-error-light); color: var(--color-error); }
.badge--muted   { background: #f3f4f6; color: var(--color-text-muted); }

/* Farben fuer Auswahl-Options (Lead-Phase etc.) — bewusst heller Hintergrund + sattere Textfarbe */
.badge--blue    { background: #dbeafe; color: #1e40af; }
.badge--purple  { background: #ede9fe; color: #6d28d9; }
.badge--teal    { background: #ccfbf1; color: #0f766e; }
.badge--green   { background: #dcfce7; color: #166534; }
.badge--yellow  { background: #fef3c7; color: #92400e; }
.badge--orange  { background: #ffedd5; color: #9a3412; }
.badge--red     { background: #fee2e2; color: #991b1b; }
.badge--pink    { background: #fce7f3; color: #9d174d; }
.badge--brown   { background: #f5e8d8; color: #78350f; }
.badge--gray    { background: #e5e7eb; color: #374151; }

/* Dot-Pille (CI-Default): Status-Optik mit vorangestelltem Punkt. Die Farbe
   kommt ueber die .badge--*-Klassen (z.B. class="pill badge--green"), currentColor
   faerbt den Punkt mit. */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
}
.pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

/* Inline-Edit in Tabellen-Zellen */
.db-cell--editable { cursor: pointer; position: relative; }
.db-cell--editable:hover { background: var(--color-surface-hover); }
.db-cell--editable:hover::after {
    content: "▾";
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: var(--color-text-muted);
    pointer-events: none;
}

/* === Tables === */
table { width: 100%; border-collapse: collapse; }
/* Tabellenkopf als Uppercase-Label (CI-Default), luftigere Zellen. */
th { text-align: left; padding: 0.625rem 1rem; font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--color-text-muted); border-bottom: 1px solid var(--color-border); white-space: nowrap; }
td { padding: 0.7rem 1rem; height: 44px; vertical-align: middle; font-size: 0.85rem; border-bottom: 1px solid var(--color-border-light); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: var(--color-surface-hover); }

/* === Datenlisten (partials/list.php + assets/js/list/) === */
.list-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.list-toolbar .list-count { font-size: 0.8rem; color: var(--color-text-muted); }
.list-toolbar-spacer { flex: 1; }
/* Live-Suchfeld (partials/list.php 'search' + list-page.js) */
.list-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) - 3px);
    padding: 0.4rem 0.65rem;
    width: 260px;
    color: var(--color-text-muted);
}
.list-search svg { flex: none; }
.list-search input {
    border: 0;
    background: transparent;
    padding: 0;
    outline: none;
    color: var(--color-text);
    font-size: 0.85rem;
    width: 100%;
}
.list-search input:focus { box-shadow: none; }
.list-search:focus-within { border-color: var(--color-border); }
.list-table-wrap { overflow-x: auto; }
tr.clickable-row { cursor: pointer; }

/* Filter-Panel (Markup-Vertrag: assets/js/list/filters.js) */
#filter-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
#filter-rows { display: flex; flex-direction: column; gap: 0.4rem; }
#filter-rows .filter-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
#filter-rows .filter-row select,
#filter-rows .filter-row input { font-size: 0.8rem; padding: 0.3rem 0.5rem; }
#filter-panel .filter-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* Pagination unter der Liste */
.list-pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.list-pagination a,
.list-pagination span.page-current,
.list-pagination span.page-gap {
    min-width: 30px;
    padding: 0.3rem 0.55rem;
    text-align: center;
    font-size: 0.8rem;
    border-radius: var(--radius-sm, 6px);
    text-decoration: none;
    color: var(--color-text-muted);
}
.list-pagination a:hover { background: var(--color-surface-hover); color: var(--color-text); }
.list-pagination span.page-current {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

/* === Charts (core/Chart.php — Inline-SVG) === */
.chart { display: block; width: 100%; height: auto; }
.chart--donut { max-width: 200px; margin: 0 auto; }
.chart--empty {
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

/* Abstand zwischen Settings-Boxen kommt jetzt zentral vom .section-card-Default
   (margin-bottom, siehe oben); der fruehere .settings-content-Adjacency-Block
   war toter Code (kein View nutzt .settings-content). */
.section-card { min-height: 55px; } /* IGEPA_SECTION_MINHEIGHT */

/* === Login/Auth === */
/* Auth-spezifische Overrides (vormals public.css); ergaenzen den Login-Block oben.
   Genutzt von app/views/auth/ (login, 2fa-challenge, reset-/forgot-password, _branding). */
.login-branding { text-align: center; margin-bottom: 1.5rem; }
.login-branding-logo { font-weight: 700; font-size: 1.5rem; letter-spacing: -0.03em; margin-bottom: 0.25rem; }
.login-branding-logo span { color: var(--color-primary); }
.login-branding-tagline { font-size: 0.85rem; color: var(--color-text-muted); }
.login-legal { text-align: center; margin-top: 1.25rem; font-size: 0.7rem; color: var(--color-text-muted); line-height: 1.5; max-width: 320px; margin-left: auto; margin-right: auto; }
.login-legal a { color: var(--color-primary); text-decoration: none; }
.login-legal a:hover { text-decoration: underline; }

/* === Modal / Popup (generisch) — Steuerung: assets/js/app.js ===
 * Der kanonische Popup-Baustein. EIN korrektes Verhalten fuer alle Projekte:
 *   - zentriert (Flex align/justify center)
 *   - Hintergrund abgedunkelt + geblurrt
 *   - Hintergrund NICHT scrollbar (body.modal-open sperrt overflow)
 *   - schliesst per X / [data-modal-close] / Backdrop-Klick / ESC
 * Nie wieder pro Projekt neu bauen. Markup-Vertrag siehe app.js. */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    overflow-y: auto;              /* sehr hohe Dialoge scrollen im Overlay ... */
    overscroll-behavior: contain;
}
.modal[hidden] { display: none; }
body.modal-open { overflow: hidden; }   /* ... die Seite dahinter bleibt fix */

/* Bestaetigungs-Dialog (customConfirm() in app.js, u.a. alle .confirm-delete-Forms):
   zentriertes Overlay wie .modal. OHNE diese Regel ist .confirm-dialog
   position:static und haengt unsichtbar am Seitenende — dann scheint "Loeschen"
   wirkungslos. z-index ueber .modal, damit ein Confirm auch im Modal sichtbar ist. */
.confirm-dialog {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.confirm-dialog-box {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
}
.confirm-dialog-box p { margin: 0 0 1.25rem; color: var(--color-text); }
.confirm-btns { display: flex; justify-content: flex-end; gap: 0.5rem; }

.modal-dialog {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 3rem);
    margin: auto;                 /* zentriert auch, wenn hoeher als das Overlay */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-dialog--sm { max-width: 360px; }
.modal-dialog--lg { max-width: 760px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}
.modal-header h2, .modal-header h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius);
}
.modal-close:hover { background: var(--color-bg); color: var(--color-text); }
.modal-body { padding: 1.25rem; overflow-y: auto; }
.modal-body > :last-child { margin-bottom: 0; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
}

/* === Raster (generisch) ===
 * Gleichmaessige Spalten mit echtem Abstand (gap) — ersetzt handgebaute
 * Flex-/Margin-Konstruktionen. .grid--auto fuellt so viele Spalten wie passen. */
.grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(var(--grid-min, 220px), 1fr)); }
@media (max-width: 900px) {
    .grid--cols-3, .grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .grid--cols-2, .grid--cols-3, .grid--cols-4 { grid-template-columns: 1fr; }
}

/* === Abschnitts-Titel: Ueberschrift gehoert UEBER die Box, nicht hinein ===
 * Haeufiger Fehler war die Ueberschrift innerhalb der Card. Kanonisch:
 * <h2 class="section-title">Titel</h2> <div class="card"> Inhalt </div> */
.section-title { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.6rem; color: var(--color-text); }
.section-title + .card, .section-title + .section-card { margin-top: 0; }
.section-lead { font-size: 0.85rem; color: var(--color-text-muted); margin: -0.3rem 0 0.9rem; }

/* === Tab-Panels (Reiter-Inhalt; .tabs/.tab existieren bereits oben) === */
.tab-panel[hidden] { display: none; }

/* === Element-Katalog (showcase/index.php): Demo-Bausteine === */
.demo-swatch {
    height: 44px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
}
.demo-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.demo-note { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 0.5rem; }
.demo-note code, code.inline-code {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 5px;
    padding: 0.05rem 0.35rem;
    font-size: 0.78rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* --- Kompaktes Formular-Grid (Settings-Panels: SMTP, Team, Profil, 2FA) ---
   Basis-Primitive fuer Label-ueber-Feld-Formulare. base.css stylt zwar jedes
   input/select generisch (Rahmen/Padding), aber ohne diese Regeln stehen Labels
   inline in Default-Groesse und die Felder stapeln full-width statt im 2-Spalten-
   Grid. Aus dem faictory-igepa-Projekt (project.css, "Golden-Master modules.css")
   in den Core zurueckportiert, damit alle Feature-Panels sauber rendern. Die
   spezifischeren .stammdaten-grid-Regeln weiter unten ueberschreiben das Label-
   Layout dort bewusst (Label links neben Feld). */
.crm-compact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.375rem 0.75rem; }
@media (max-width: 640px) { .crm-compact-grid { grid-template-columns: 1fr; } }
.crm-field label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--color-text); margin-bottom: 0.3rem; }
.crm-field input, .crm-field select, .crm-field textarea { width: 100%; padding: 0.4rem 0.625rem; border: 1px solid var(--color-border); border-radius: var(--radius); font-size: 0.85rem; background: var(--color-bg); color: var(--color-text); }
/* Checkbox/Radio nie full-width ziehen (die generische .crm-field-input-Regel
   oben wuerde sie sonst strecken → Label rutscht weg, Kontrollkaestchen mittig).
   Betrifft z. B. den Button-Farbverlauf-Schalter im CI-Panel. */
.crm-field input[type="checkbox"], .crm-field input[type="radio"] { width: auto; }
.crm-field textarea { resize: vertical; min-height: 2.5rem; font-family: inherit; }
.crm-field input:focus, .crm-field select:focus, .crm-field textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15); }

/* --- Stammdaten (Settings): Split-Layout + Beleg-Fusszeilen-Vorschau --- */
.stammdaten-split { display: grid; grid-template-columns: 1fr 360px; gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .stammdaten-split { grid-template-columns: 1fr; } }
.stammdaten-intro { color: var(--color-text-muted); font-size: 0.8rem; margin: 0 0 1.25rem; line-height: 1.5; }
.stammdaten-sub { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin: 1.5rem 0 0.85rem; padding-top: 1.25rem; border-top: 1px solid var(--color-border-light); }
.stammdaten-grid { display: flex; flex-direction: column; }
.stammdaten-grid .crm-field { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: center; gap: 0.5rem 1.25rem; padding: 0.6rem 0; border-bottom: 1px solid var(--color-border-light); }
.stammdaten-grid .crm-field:last-child, .stammdaten-grid .stammdaten-check:last-child { border-bottom: 0; }
.stammdaten-grid .crm-field label { margin: 0; font-size: 0.82rem; font-weight: 500; color: var(--color-text); }
.stammdaten-grid .crm-field input, .stammdaten-grid .crm-field select { width: 100%; }
.stammdaten-check { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0; border-bottom: 1px solid var(--color-border-light); font-size: 0.85rem; color: var(--color-text-muted); cursor: pointer; }
.stammdaten-check input { flex-shrink: 0; }
.stammdaten-actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--color-border-light); }
@media (max-width: 640px) { .stammdaten-grid .crm-field { grid-template-columns: 1fr; align-items: start; gap: 0.3rem; } }
.beleg-foot-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; font-size: 0.75rem; line-height: 1.55; color: var(--color-text-muted); padding-top: 12px; border-top: 1px solid var(--color-border-light); }
.beleg-foot-preview strong { color: var(--color-text); }

/* === Busy-State (Ladeanimation fuer Aktions-Buttons/Forms, siehe app.js ctBusy) === */
/* Opt-in per data-busy. Der Spinner ersetzt den Button-Text, waehrend eine Aktion
   laeuft (synchron bis Seitenwechsel oder AJAX-Abschluss). Verhindert Doppel-Klick. */
.ct-busy {
    cursor: progress !important;
    opacity: 0.85;
}
.ct-busy .ct-busy-spinner,
.ct-busy-spinner {
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ct-spin 0.6s linear infinite;
    vertical-align: -0.1em;
    box-sizing: border-box;
}
.ct-busy-text { margin-left: 0.5em; }
@keyframes ct-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .ct-busy-spinner { animation-duration: 1.4s; }
}

/* === Job-Tray (Hintergrund-Jobs Stufe 2, siehe app.js ctJobs) === */
/* Persistente Anzeige aktiver Hintergrund-Jobs unten rechts. Ueberlebt
   Navigation (ctJobs.resume() holt offene Jobs nach jedem Seitenladen). */
.ct-jobs-tray {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(22rem, calc(100vw - 2rem));
    pointer-events: none;
}
.ct-job {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    background: var(--color-surface, #fff);
    color: var(--color-text, #1a1a2e);
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
    border-left: 3px solid var(--color-primary, #4f46e5);
    border-radius: var(--radius, 8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.85rem;
    line-height: 1.3;
}
.ct-job.is-done { border-left-color: var(--color-success, #16a34a); }
.ct-job.is-failed { border-left-color: var(--color-error, #dc2626); }
.ct-job.is-clickable { cursor: pointer; }
.ct-job-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ct-job-meta {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
}

/* SMTP-Verbindungsstatus (Feature smtp): dauerhaftes Badge je Konto im Panel.
   Zustand kommt als Modifier smtp-status--never|ok|fail aus der View. */
.smtp-status {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    background: var(--color-bg, #f5f4f7);
}
.smtp-status strong { font-size: 0.85rem; }
.smtp-status--never strong { color: var(--color-text-muted, #6b7280); }
.smtp-status--ok strong { color: var(--color-success, #1a7f4b); }
.smtp-status--fail strong { color: var(--color-error, #b42318); }
.smtp-status-when { color: var(--color-text-muted); font-size: 0.78rem; }
.smtp-status-error { flex-basis: 100%; color: var(--color-error); font-size: 0.78rem; }

/* Team-Benutzerliste (Feature team): kompakte Spalten-Zeilen + Akkordeon.
   Spalten: Kürzel · Name · E-Mail (mittig) · Rolle (rechts) · Chevron. */
.team-member { border: 1px solid var(--color-border-light); border-radius: var(--radius); margin-bottom: 0.5rem; }
.team-row {
    display: grid;
    grid-template-columns: 56px minmax(110px, 1.1fr) minmax(150px, 1.6fr) 160px 20px;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
}
.team-row--head {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--color-text-muted); font-weight: 600; padding: 0.3rem 0.85rem;
}
.team-row--summary { cursor: pointer; list-style: none; }
.team-row--summary::-webkit-details-marker { display: none; }
.team-row--summary:hover { background: var(--color-bg, #f5f4f7); border-radius: calc(var(--radius) - 2px); }
.team-kuerzel {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 30px; padding: 0 6px;
    border-radius: calc(var(--radius) - 3px); background: var(--color-bg, #f5f4f7);
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; color: var(--color-text-muted);
}
.team-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-email { color: var(--color-text-muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-row-role { text-align: right; }
.team-chevron { color: var(--color-text-muted); font-size: 0.8rem; transition: transform 0.15s; text-align: right; }
.team-member[open] .team-chevron { transform: rotate(180deg); }
@media (max-width: 640px) {
    .team-row { grid-template-columns: 44px 1fr auto; }
    .team-row--head, .team-email { display: none; }
}
/* === Responsive === */
@media (max-width: 768px) {
    .container, .container--narrow, .container--wide { padding: 1rem; }
    .module-grid { grid-template-columns: 1fr 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .lp-hero h1 { font-size: 2.25rem; }
    .lp-hero-grid { grid-template-columns: 1fr !important; text-align: center; }
    .lp-hero-grid .lp-hero-cta { justify-content: center; }
    .lp-grid--3, .lp-grid--4, .lp-grid--5 { grid-template-columns: 1fr; }
    .lp-feature-grid { grid-template-columns: 1fr !important; }
    .lp-feature-grid .lp-card { grid-column: span 1 !important; grid-template-columns: 1fr !important; }
    .lp-steps { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
    .lp-stats { grid-template-columns: repeat(2, 1fr); }
    .lp-footer-grid { grid-template-columns: 1fr 1fr !important; }
    .lp-contact-grid { grid-template-columns: 1fr !important; gap: 2rem !important; }
    .lp-funktionen-grid { grid-template-columns: 1fr !important; }
    .lp-nav-center { display: none; }
    .lp-nav-right { gap: 0.25rem; }
}
/* =========================================================================
 * PWA / Standalone — systemweit, unabhaengig vom Modul.
 *
 * Greift NUR, wenn die App vom Homescreen als installierte App laeuft
 * (display-mode: standalone bzw. iOS legacy navigator.standalone -> .pwa-standalone).
 * Im normalen Browser-Tab bleibt alles unveraendert.
 *
 * Ziel: Inhalte aus den Geraete-"Notches"/Home-Indicator-Bereichen halten
 * (safe-area-insets) und Touch-Bedienung angenehm machen.
 * ========================================================================= */

@media (display-mode: standalone) {
    /* Safe-Area-Padding fuer fixierte Kopf-/Fussleisten und den Body-Rand. */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        /* Kein Pull-to-Refresh / Overscroll-Bounce in der App-Huelle. */
        overscroll-behavior-y: none;
    }

    /* Fixierte Topnav unter die Statusbar/Notch schieben. */
    .topnav,
    .app-header {
        padding-top: calc(env(safe-area-inset-top) + 0.25rem);
    }

    /* Lange Listen/Scrollbereiche unten frei vom Home-Indicator halten. */
    .main-content,
    .app-main {
        padding-bottom: calc(env(safe-area-inset-bottom) + 0.5rem);
    }
}

/* iOS Safari (Legacy) meldet display-mode unzuverlaessig -> Body-Klasse als Fallback,
 * gesetzt per JS aus navigator.standalone. Gleiche Regeln wie oben. */
.pwa-standalone {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    overscroll-behavior-y: none;
}
.pwa-standalone .topnav,
.pwa-standalone .app-header {
    padding-top: calc(env(safe-area-inset-top) + 0.25rem);
}

/* Touch-Komfort in der installierten App: keine versehentliche Text-Selektion
 * auf Bedien-Elementen, aber Eingabefelder/Inhalte bleiben selektierbar. */
@media (display-mode: standalone) {
    button, .btn, a.btn, nav a {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    input, textarea, select, [contenteditable] {
        -webkit-user-select: text;
        user-select: text;
    }
}
/* Innovation Box — Projekt-Styles (haengt der Bundler als letzte Datei an).
   Farbwelt der analogen Box: Rot/Orange/Gelb auf Anthrazit, gruene Akzente. */

:root {
    --ib-rot: #e63312;
    --ib-orange: #f39200;
    --ib-gelb: #ffcc00;
    --ib-gruen: #4a9c6d;
    --ib-anthrazit: #26221f;
    --ib-postit: #fff8c4;
}

/* Globaler Schutz: [hidden] gewinnt immer gegen eigene display-Regeln
   (dialog[open]-Zustaende bleiben unberuehrt). */
[hidden]:not(dialog[open]) { display: none !important; }

/* ---------- Fliesstext: Absaetze mit Leerzeile ----------
   Der Core-Reset (base.css: * { margin: 0 }) entfernt alle p-Abstaende —
   in Text-Karten (Karteninhalte, Profile, Forum) sollen Absaetze atmen. */
.card p + p,
.ib-aktuell-body p + p,
.ib-post p + p { margin-top: .9rem; }

/* ---------- Seitenkopf ---------- */
.ib-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.ib-page-head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.ib-muted { color: var(--color-text-muted); }
.ib-empty { text-align: center; padding: 2.5rem 1.5rem; }

/* ---------- Projektliste ---------- */
.ib-project-card { display: block; text-decoration: none; color: inherit; margin-bottom: 1rem; transition: transform .12s ease, box-shadow .12s ease; }
.ib-project-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.ib-project-card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.ib-project-card-meta { display: flex; justify-content: space-between; margin-top: .5rem; font-size: .85rem; color: var(--color-text-muted); }
.ib-progress { height: 8px; border-radius: 999px; background: var(--color-border); overflow: hidden; margin-top: .75rem; }
.ib-progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ib-rot), var(--ib-orange)); }

/* ---------- Journey (Dashboard) ---------- */
.ib-journey { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.ib-station { display: flex; flex-direction: column; gap: .35rem; padding: .9rem; border-radius: 12px; text-decoration: none; color: #fff; min-height: 120px; position: relative; transition: transform .12s ease; }
.ib-station:hover { transform: translateY(-2px); }
.ib-station-nr { position: absolute; top: .6rem; right: .7rem; font-weight: 800; font-size: 1.1rem; opacity: .85; }
.ib-station-icon svg { width: 28px; height: 28px; }
.ib-station-titel { font-weight: 700; line-height: 1.15; }
.ib-station-karten { font-size: .72rem; opacity: .8; }
.ib-station--done { outline: 3px solid var(--ib-gelb); outline-offset: 2px; }
.ib-c-rot { background: var(--ib-rot); }
.ib-c-orange { background: var(--ib-orange); }
.ib-c-gelb { background: var(--ib-gelb); color: var(--ib-anthrazit); }
.ib-c-gruen { background: var(--ib-gruen); }
.ib-c-anthrazit { background: var(--ib-anthrazit); }
.ib-c-grau { background: #6b6560; }

/* ---------- Stepper (Stations-Seite): gruen=fertig, hellgruen=aktuell,
   grau=offen (davor), grau+transparent=kommend — ohne Haken ---------- */
.ib-stepper { display: flex; gap: .4rem; margin: 1rem 0; flex-wrap: wrap; }
.ib-step { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--color-border); color: var(--color-text); text-decoration: none; font-weight: 700; font-size: .85rem; }
.ib-step--done { background: var(--ib-gruen); color: #fff; }
.ib-step--active { background: #8fd6a8; color: #1d4a2e; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ib-gruen) 35%, transparent); }
.ib-step--open { background: var(--color-border); color: var(--color-text); }
.ib-step--future { background: var(--color-border); color: var(--color-text); opacity: .45; }

/* ---------- Zurueck-Button (statt Breadcrumbs) ---------- */
.ib-back { display: inline-flex; align-items: center; gap: .3rem; color: var(--color-text-muted); text-decoration: none; font-size: .9rem; margin-bottom: 1.5rem; }
.ib-back:hover { color: var(--color-text); }

/* ---------- Partner-Chat: Assistent-Look (mittig, Pill-Eingabe) ---------- */
.ib-chatx { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100vh - 190px); }
.ib-chatx-head { display: flex; align-items: center; gap: .7rem; padding-bottom: .9rem; }
.ib-chat-status { display: flex; align-items: center; gap: .4rem; }
.ib-chat-status .badge { text-decoration: none; }
.ib-chat-status-form { display: flex; gap: .3rem; align-items: center; }
.ib-chat-status-form select { font-size: .8rem; max-width: 190px; }
.ib-chatx-log { flex: 1; display: flex; flex-direction: column; gap: .6rem; padding: 1rem 0 1.5rem; }
.ib-chatx-empty { margin: 3.5rem auto 0; width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: .8rem; }
.ib-chatx-empty h1 { text-align: center; font-size: 1.7rem; margin: 0 0 1.25rem; }
.ib-chatx-empty form { display: contents; }
.ib-chatx-vorschlag { text-align: left; background: var(--color-surface); border: none; border-radius: 16px; padding: 1.05rem 1.4rem; font: inherit; color: var(--color-text); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.05); transition: box-shadow .12s ease, transform .12s ease; }
.ib-chatx-vorschlag:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-1px); }
.ib-chatx-bar { position: sticky; bottom: 1.25rem; display: flex; align-items: center; gap: .5rem; background: var(--color-surface); border-radius: 999px; box-shadow: 0 8px 30px rgba(0,0,0,.14); padding: .45rem .45rem .45rem 1.4rem; }
.ib-chatx-bar input[type="text"] { flex: 1; border: none; background: transparent; font: inherit; color: var(--color-text); padding: .55rem 0; }
.ib-chatx-bar input[type="text"]:focus { outline: none; box-shadow: none; }
.ib-chatx-send { width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer; background: var(--accent-gradient, var(--ib-rot)); color: #fff; font-size: 1.25rem; font-weight: 700; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.ib-chatx-send:hover { filter: brightness(1.08); }
.ib-chatx .ib-chat-msg { max-width: 75%; font-size: .95rem; padding: .65rem .9rem; }
.ib-link-btn { border: none; background: none; color: var(--ib-rot); cursor: pointer; font-size: .9rem; text-decoration: underline; padding: 0; }
.ib-link-btn--active { font-weight: 700; }

/* ---------- Journey-Roadmap ---------- */
.ib-roadmap { position: relative; display: flex; justify-content: space-between; gap: .25rem; padding: .5rem 0 .25rem; overflow-x: auto; }
.ib-roadmap-linie { position: absolute; left: 16px; right: 16px; top: 21px; height: 4px; border-radius: 2px; background: var(--color-border); }
.ib-roadmap-punkt { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; text-decoration: none; color: var(--color-text); min-width: 62px; }
.ib-roadmap-dot { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; background: var(--color-border); color: var(--color-text); border: 3px solid var(--color-surface); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.ib-roadmap-label { font-size: .72rem; text-align: center; line-height: 1.15; color: var(--color-text-muted); max-width: 86px; }
.ib-roadmap-punkt--done .ib-roadmap-dot { background: var(--ib-gruen); color: #fff; }
.ib-roadmap-punkt--current .ib-roadmap-dot { background: #8fd6a8; color: #1d4a2e; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ib-gruen) 35%, transparent); }
.ib-roadmap-punkt--current .ib-roadmap-label { color: var(--color-text); font-weight: 700; }
.ib-roadmap-punkt--future { opacity: .45; }

/* ---------- Aktueller Schritt ---------- */
.ib-aktuell { padding: 0; overflow: hidden; }
.ib-aktuell-kopf { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.5rem; color: #fff; }
.ib-aktuell-kopf h2 { color: inherit; }
.ib-aktuell-body { padding: 1.25rem 1.5rem; }

/* ---------- Aufgaben-Beispiele ---------- */
.ib-beispiel { margin-top: .25rem; }
.ib-beispiel summary { cursor: pointer; font-size: .78rem; color: var(--color-text-muted); }
.ib-beispiel p { font-size: .82rem; background: color-mix(in srgb, var(--ib-gelb) 18%, transparent); border-radius: 8px; padding: .5rem .65rem; margin: .35rem 0 0; }

/* ---------- Agent-Sprechblase ---------- */
.ib-agent-bubble { position: fixed; right: 1.25rem; bottom: 5.75rem; z-index: 899; width: min(340px, calc(100vw - 2.5rem)); }
.ib-agent-bubble-inner { position: relative; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px 14px 2px 14px; box-shadow: 0 10px 28px rgba(0,0,0,.22); padding: .9rem 1rem; font-size: .88rem; }
.ib-agent-bubble-inner::after { content: ""; position: absolute; right: 18px; bottom: -8px; border-width: 8px 8px 0 8px; border-style: solid; border-color: var(--color-surface) transparent transparent transparent; }
.ib-agent-bubble-inner p { margin: .35rem 0 0; }
.ib-agent-bubble-close { position: absolute; top: .35rem; right: .5rem; border: none; background: none; font-size: 1.1rem; cursor: pointer; color: var(--color-text-muted); }

/* ---------- Team-Popup ---------- */
.ib-dialog--team { width: min(560px, calc(100vw - 2rem)); }
.ib-team-liste { display: flex; flex-direction: column; gap: .5rem; max-height: 40vh; overflow-y: auto; }
.ib-team-mitglied { display: flex; align-items: center; gap: .75rem; padding: .5rem .6rem; border: 1px solid var(--color-border); border-radius: 10px; }
.ib-team-mitglied--ich { border-color: var(--ib-orange); background: color-mix(in srgb, var(--ib-orange) 6%, transparent); }
.ib-team-avatar { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.ib-team-avatar--mini { width: 26px; height: 26px; font-size: .85rem; }
.ib-team-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ib-team-info .ib-muted { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
.ib-team-rolle { font-size: .78rem; color: var(--ib-orange); font-weight: 600; }
.ib-team-rollenwahl select { font-size: .8rem; max-width: 160px; }
.ib-team-rollenhilfe { margin-top: .9rem; }
.ib-team-rollenhilfe summary { cursor: pointer; font-weight: 600; font-size: .88rem; }
.ib-team-formulare { border-top: 1px solid var(--color-border); margin-top: 1rem; padding-top: .75rem; display: flex; flex-direction: column; gap: .25rem; }

.ib-phase-head { display: flex; align-items: center; gap: 1.25rem; border-radius: 14px; padding: 1.25rem 1.5rem; color: #fff; }
.ib-phase-head h1 { margin: 0; color: inherit; }
.ib-phase-head-meta { font-size: .8rem; opacity: .85; text-transform: uppercase; letter-spacing: .05em; }
.ib-phase-claim { margin: .25rem 0 0; font-weight: 600; opacity: .95; }
.ib-phase-head-icon svg { width: 46px; height: 46px; }
.ib-phase-nav { display: flex; justify-content: space-between; margin-top: 1.5rem; gap: 1rem; }

.ib-hinweis { background: color-mix(in srgb, var(--ib-gelb) 25%, transparent); border-left: 4px solid var(--ib-gelb); padding: .75rem 1rem; border-radius: 8px; margin-top: .75rem; }
.ib-hinweis--warn { background: color-mix(in srgb, var(--ib-rot) 12%, transparent); border-left-color: var(--ib-rot); }
.ib-inspiration summary { cursor: pointer; font-weight: 600; margin-top: .5rem; }
.ib-inspiration ul { columns: 2; margin-top: .5rem; }
.ib-inspiration li { break-inside: avoid; margin-bottom: .25rem; }

/* ---------- Boxkarte: Karteninhalt im Look der analogen Box ---------- */
.ib-boxkarte { position: relative; overflow: hidden; border-radius: 18px; padding: 1.75rem 2rem 1.5rem; box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.ib-boxkarte-wz { position: absolute; right: -30px; bottom: -30px; width: 220px; height: 220px; opacity: .1; pointer-events: none; }
.ib-boxkarte-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.ib-boxkarte-meta { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; opacity: .8; margin-bottom: .3rem; }
.ib-boxkarte-titel { margin: 0; font-size: 1.9rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; line-height: 1.05; }
.ib-boxkarte-logo { font-weight: 700; font-size: .85rem; opacity: .9; white-space: nowrap; }
.ib-boxkarte-lead { font-size: 1.15rem; font-weight: 700; margin: 0 0 1rem; }
.ib-boxkarte-text { margin: 0 0 .9rem; line-height: 1.55; position: relative; }
.ib-boxkarte-text--gross { font-size: 1.02rem; }
.ib-boxkarte-block { border-left: 3px solid currentColor; padding-left: .9rem; margin: 0 0 .9rem; }
.ib-boxkarte-kicker { display: block; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .25rem; }
.ib-boxkarte-kicker em { font-style: normal; font-weight: 500; opacity: .75; text-transform: none; letter-spacing: 0; }
.ib-zitat { position: relative; background: #fff; color: #26221f; border-radius: 14px; padding: .85rem 1.1rem; margin: 0 0 1.1rem; font-style: italic; box-shadow: 1px 2px 6px rgba(0,0,0,.15); }
.ib-zitat::after { content: ''; position: absolute; left: 26px; bottom: -9px; width: 18px; height: 18px; background: inherit; transform: rotate(45deg) skew(8deg, 8deg); box-shadow: 3px 3px 5px rgba(0,0,0,.06); }
.ib-kasten { background: var(--ib-gelb); color: #26221f; border-radius: 12px; padding: .85rem 1.1rem; font-weight: 600; margin: .25rem 0 .9rem; box-shadow: 1px 2px 6px rgba(0,0,0,.15); }
.ib-boxkarte-inspiration { margin-top: .5rem; }
.ib-boxkarte-inspiration summary { cursor: pointer; font-weight: 700; }
.ib-boxkarte-inspiration ul { columns: 2; margin: .6rem 0 0 1.1rem; }
.ib-boxkarte-inspiration li { break-inside: avoid; margin-bottom: .25rem; }
.ib-boxkarte-fuss { display: flex; justify-content: flex-end; margin-top: 1.1rem; }
.ib-boxkarte-cta { background: #fff; color: #26221f; font-weight: 700; }
.ib-boxkarte-cta:hover { background: var(--ib-gelb); color: #26221f; }
/* Farbwelten (Titel wie im Original: Gelb auf dunkel/rot, dunkel auf orange) */
.ib-boxkarte--anthrazit { background: var(--ib-anthrazit); color: #f3efe9; }
.ib-boxkarte--anthrazit .ib-boxkarte-titel { color: var(--ib-gelb); }
.ib-boxkarte--rot { background: var(--ib-rot); color: #fff; }
.ib-boxkarte--rot .ib-boxkarte-titel { color: var(--ib-gelb); }
.ib-boxkarte--orange { background: var(--ib-orange); color: #2b2015; }
.ib-boxkarte--orange .ib-boxkarte-titel { color: #fff; }
.ib-boxkarte--orange .ib-kasten { background: #fff; }
.ib-boxkarte--gruen { background: var(--ib-gruen); color: #fff; }
.ib-boxkarte--gruen .ib-boxkarte-titel { color: var(--ib-gelb); }

/* ---------- Aufgaben-Kasten (oranger Karten-Kasten wie #6/#7) ---------- */
.ib-aufgaben { background: var(--ib-orange); color: #2b2015; border-radius: 18px; padding: 1.25rem 1.4rem; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.ib-aufgaben-kopf { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.ib-aufgaben-kopf svg { width: 22px; height: 22px; }
.ib-aufgaben-kopf h2 { margin: 0; font-size: 1.05rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.ib-aufgaben .ib-todo { border-bottom-color: rgba(43,32,21,.18); }
.ib-aufgaben .ib-todo-check { background: #fff; border-color: rgba(43,32,21,.45); }
.ib-aufgaben .ib-todo--done .ib-todo-check { background: var(--ib-gruen); border-color: var(--ib-gruen); }
.ib-aufgaben .ib-todo--done .ib-todo-body > span { color: rgba(43,32,21,.55); }
.ib-aufgaben .ib-beispiel summary { color: rgba(43,32,21,.8); }
.ib-aufgaben .ib-beispiel p { background: rgba(255,255,255,.75); }

/* ---------- Canvas & Post-its ---------- */
.ib-canvas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .9rem; }
.ib-canvas--matrix { grid-template-columns: 1fr 1fr; }
.ib-canvas--bmc { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1100px) { .ib-canvas--bmc { grid-template-columns: repeat(3, 1fr); } }
.ib-canvas-feld { border: 2px dashed var(--color-border); border-radius: 12px; padding: .9rem; background: var(--color-surface); }
.ib-canvas-feld h3 { margin: 0 0 .4rem; font-size: 1rem; }
.ib-canvas-feld--rot h3 { color: var(--ib-rot); }
.ib-canvas-feld--orange h3 { color: var(--ib-orange); }
.ib-canvas-feld--gelb h3 { color: #b78f00; }
.ib-canvas-feld--gruen h3 { color: var(--ib-gruen); }
.ib-canvas-fragen { font-size: .78rem; color: var(--color-text-muted); margin: 0 0 .6rem 1rem; padding: 0; }
.ib-postits { display: flex; flex-wrap: wrap; gap: .6rem; }
.ib-postits--book .ib-postit { max-width: 260px; }
.ib-postit { background: var(--ib-postit); color: #3a3423; padding: .6rem .7rem .4rem; border-radius: 2px; box-shadow: 1px 2px 5px rgba(0,0,0,.18); transform: rotate(-.6deg); min-width: 130px; max-width: 220px; font-size: .88rem; display: flex; flex-direction: column; gap: .3rem; }
.ib-postit:nth-child(even) { transform: rotate(.8deg); background: #ffeaa7; }
.ib-postit.ib-postit--ki { background: #dcefff; outline: 2px solid #7db8e8; }
.ib-postit-foot { display: flex; justify-content: space-between; align-items: center; font-size: .68rem; opacity: .7; }
.ib-postit-del { border: none; background: none; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .15rem; color: inherit; }
.ib-postit-add { display: flex; gap: .4rem; margin-top: .6rem; }
.ib-postit-add input[type="text"] { flex: 1; }

/* ---------- Canvas-Poster (VC1/VC2/BMC wie die Faltposter der Box) ---------- */
.ib-poster { border-radius: 16px; padding: 1.4rem 1.6rem 1.1rem; box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.ib-poster--vc { background: var(--ib-orange); color: #2b2015; }
.ib-poster--bmc { background: var(--ib-anthrazit); color: #f3efe9; }
.ib-poster-titelzeile { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .8rem; }
.ib-poster-titel { font-size: 1.05rem; }
.ib-poster-titel strong { font-weight: 900; }
.ib-poster-logo { font-weight: 700; font-size: .82rem; opacity: .85; }
.ib-poster-rechts { display: flex; align-items: center; gap: .6rem; }
.ib-poster-vollbild { border: none; background: rgba(255,255,255,.25); color: inherit; border-radius: 8px; width: 30px; height: 30px; font-size: 1rem; cursor: pointer; line-height: 1; }
.ib-poster-vollbild:hover { background: rgba(255,255,255,.45); }
.ib-poster--bmc .ib-poster-vollbild { background: rgba(255,255,255,.15); }

/* Vollbild: Poster fuellt den ganzen Bildschirm (Workshop/Beamer) */
body.ib-vollbild-offen { overflow: hidden; }
.ib-poster--vollbild { position: fixed; inset: 0; z-index: 1100; border-radius: 0; overflow-y: auto; padding: 1.5rem 3vw 2rem; box-shadow: none; display: flex; flex-direction: column; }
.ib-poster--vollbild .ib-vc-kreis, .ib-poster--vollbild .ib-vc-quadrat { width: min(78vh, 92vw, 1300px); height: min(78vh, 92vw, 1300px); max-width: none; flex-shrink: 0; margin: 1.2rem auto; }
.ib-poster--vollbild .ib-vc-seg h3 { font-size: 1.05rem; }
.ib-poster--vollbild .ib-postit--klein { font-size: .85rem; max-width: 190px; }
.ib-poster--vollbild .ib-bmc-raster { flex: 1; grid-template-rows: minmax(24vh, 1fr) minmax(24vh, 1fr) minmax(18vh, auto); }
.ib-poster--vollbild .ib-bmc-zelle h3 { font-size: .9rem; }
.ib-poster--vollbild .ib-poster-kopffeld { max-width: 1000px; margin-left: auto; margin-right: auto; width: 100%; }
.ib-poster-kopffeld { display: flex; align-items: center; gap: .6rem; background: #fff; color: #2b2015; border-radius: 10px; padding: .45rem .45rem .45rem .9rem; box-shadow: inset 0 0 0 1px rgba(43,32,21,.12); }
.ib-poster-kopffeld label { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.ib-poster-kopffeld input { flex: 1; border: none; background: transparent; font: inherit; color: inherit; padding: .3rem 0; }
.ib-poster-kopffeld input:focus { outline: none; box-shadow: none; }
.ib-vc-kreis, .ib-vc-quadrat { position: relative; background: #fff; color: #2b2015; max-width: 780px; margin: 1.2rem auto 0; aspect-ratio: 1; overflow: hidden; }
.ib-vc-kreis { border-radius: 50%; }
.ib-vc-quadrat { border-radius: 14px; }
.ib-vc-linien { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ib-vc-linien line { stroke: #2b2015; stroke-width: .5; opacity: .3; }
.ib-vc-zentrum { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 2px solid rgba(43,32,21,.35); display: flex; align-items: center; justify-content: center; font-size: 1.9rem; z-index: 2; }
.ib-vc-seg { position: absolute; display: flex; flex-direction: column; gap: .35rem; overflow-y: auto; padding: .25rem; }
.ib-vc-seg h3 { margin: 0; font-size: .85rem; font-weight: 800; }
.ib-vc-seg--oben   { top: 5%; left: 17%; right: 17%; height: 40%; }
.ib-vc-kreis .ib-vc-seg--oben { top: 7%; left: 24%; right: 24%; height: 37%; }
.ib-vc-seg--rechts { top: 52%; right: 4.5%; width: 42%; bottom: 6%; }
.ib-vc-seg--unten  { top: 52%; left: 4.5%;  width: 42%; bottom: 6%; }
.ib-vc-kreis .ib-vc-seg--rechts { right: 8%; width: 38%; bottom: 9%; }
.ib-vc-kreis .ib-vc-seg--unten  { left: 8%;  width: 38%; bottom: 9%; }
.ib-poster-fuss { display: flex; justify-content: space-between; gap: 1rem; font-size: .72rem; opacity: .85; margin-top: 1rem; flex-wrap: wrap; }
.ib-postits--poster { gap: .35rem; }
.ib-postit--klein { min-width: 86px; max-width: 150px; font-size: .72rem; padding: .35rem .45rem .2rem; }
.ib-postit--klein .ib-postit-foot { font-size: .6rem; }
.ib-postit-add--poster { margin-top: .1rem; }
.ib-postit-add--poster input[type="text"] { font-size: .75rem; padding: .3rem .5rem; min-width: 0; }
.ib-postit-add--poster .btn { padding: .3rem .5rem; font-size: .7rem; }

.ib-bmc-raster { display: grid; margin-top: .4rem; gap: 3px; background: var(--ib-orange); border: 3px solid var(--ib-orange); border-radius: 12px; overflow: hidden;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: minmax(150px, auto) minmax(150px, auto) minmax(120px, auto);
    grid-template-areas:
        "partner partner aktivitaeten aktivitaeten wert wert beziehung beziehung segmente segmente"
        "partner partner ressourcen ressourcen wert wert kanaele kanaele segmente segmente"
        "kosten kosten kosten kosten kosten einnahmen einnahmen einnahmen einnahmen einnahmen"; }
.ib-bmc-zelle { background: #faf6ee; color: #2b2015; padding: .6rem .7rem; display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.ib-bmc-zelle h3 { margin: 0; font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; display: flex; align-items: flex-start; gap: .3rem; overflow-wrap: anywhere; hyphens: auto; }
@media (max-width: 950px) {
    .ib-bmc-raster { grid-template-columns: 1fr 1fr; grid-template-rows: none; grid-template-areas:
        "partner aktivitaeten" "ressourcen wert" "beziehung kanaele" "segmente segmente" "kosten einnahmen"; }
}

/* ---------- Scorecard ---------- */
.ib-scorecard-wrap { overflow-x: auto; }
.ib-scorecard { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ib-scorecard th, .ib-scorecard td { padding: .45rem .6rem; border-bottom: 1px solid var(--color-border); text-align: left; }
.ib-scorecard-gruppe td { font-weight: 700; padding-top: .8rem; }
.ib-sc-grau td { color: #6b6560; }
.ib-sc-gelb td { color: #b78f00; }
.ib-sc-gruen td { color: var(--ib-gruen); }
.ib-sc-rot td { color: var(--ib-rot); }
.ib-score-radios { display: flex; gap: .35rem; }
.ib-score-radios label { display: flex; align-items: center; gap: .15rem; cursor: pointer; }
.ib-score-avg { font-weight: 700; }

/* ---------- ToDos ---------- */
.ib-todo { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; border-bottom: 1px solid var(--color-border); }
.ib-todo:last-child { border-bottom: none; }
.ib-todo-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--color-border); background: var(--color-surface); cursor: pointer; color: #fff; font-size: .8rem; line-height: 1; flex-shrink: 0; margin-top: .15rem; }
.ib-todo--done .ib-todo-check { background: var(--ib-gruen); border-color: var(--ib-gruen); }
.ib-todo--done .ib-todo-body > span { text-decoration: line-through; color: var(--color-text-muted); }
.ib-todo-body { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.ib-todo-assign select { font-size: .78rem; padding: .15rem .3rem; max-width: 180px; }
.ib-todo-gruppe { margin: 1rem 0 .25rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.ib-todo-gruppe a { color: var(--color-text-muted); text-decoration: none; }

/* ---------- Formulare ---------- */
.ib-form-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .75rem; }
.ib-form-row input[type="text"], .ib-form-row select, .ib-form-row input[type="date"] { flex: 1; min-width: 140px; }
.ib-choice { display: flex; flex-direction: column; gap: .4rem; }
.ib-choice-opt { display: flex; gap: .5rem; align-items: center; cursor: pointer; }
.ib-satz { line-height: 2.4; font-size: 1.05rem; }
.ib-satz input { display: inline-block; width: 220px; margin: 0 .25rem; border: none; border-bottom: 2px solid var(--ib-orange); border-radius: 0; background: transparent; padding: .15rem .3rem; font: inherit; color: inherit; }
.ib-satz input:focus { outline: none; border-bottom-color: var(--ib-rot); }

/* ---------- Genius ---------- */
.ib-experts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
@media (max-width: 1500px) { .ib-experts { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1150px) { .ib-experts { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 750px)  { .ib-experts { grid-template-columns: 1fr; } }
.ib-expert { display: flex; flex-direction: column; }
.ib-expert .ib-expert-foot { margin-top: auto; padding-top: .75rem; }
.ib-expert-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.ib-expert-head h2 { margin: 0; font-size: 1.05rem; }
.ib-expert-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .75rem; }
.ib-expert-row { display: flex; justify-content: space-between; align-items: center; padding: .25rem 0; font-size: .9rem; }
.ib-match { margin-bottom: 1rem; }
.ib-team { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }

/* ---------- Projektliste: Ansicht-Toggle + Dialog ---------- */
.ib-viewtoggle { display: inline-flex; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; }
.ib-viewtoggle-btn { border: none; background: var(--color-surface); padding: .45rem .8rem; cursor: pointer; font-size: .85rem; color: var(--color-text); }
.ib-viewtoggle-btn--active { background: var(--ib-rot); color: #fff; }
.ib-projects[data-view="kacheln"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.ib-projects[data-view="kacheln"] .ib-project-card { margin-bottom: 0; }
.ib-projects[data-view="liste"] .ib-project-card { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; align-items: center; padding: .8rem 1.25rem; margin-bottom: .5rem; }
.ib-projects[data-view="liste"] .ib-project-card-desc,
.ib-projects[data-view="liste"] .ib-progress { display: none; }
.ib-projects[data-view="liste"] .ib-project-card-head h2 { font-size: 1.05rem; margin: 0; }
.ib-projects[data-view="liste"] .ib-project-card-meta { margin-top: 0; gap: 1rem; display: flex; }
.ib-dialog { border: none; border-radius: 14px; padding: 1.5rem; width: min(480px, calc(100vw - 2rem)); box-shadow: 0 20px 60px rgba(0,0,0,.35); background: var(--color-surface); color: var(--color-text); margin: auto; }
.ib-dialog::backdrop { background: rgba(0,0,0,.45); }
.ib-dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.ib-dialog-head h2 { margin: 0; }
.ib-dialog-close { border: none; background: none; font-size: 1.4rem; cursor: pointer; color: var(--color-text-muted); }
.ib-dialog-foot { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

/* ---------- Ideenbuch: Toolbar, Farben, Prio ---------- */
.ib-idee-add { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.ib-idee-add input[type="text"] { flex: 1; min-width: 220px; }
.ib-farbwahl { display: flex; gap: .3rem; }
.ib-farbe { width: 26px; height: 26px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; display: inline-block; }
.ib-farbe:has(input:checked) { border-color: var(--ib-anthrazit); box-shadow: 0 0 0 2px #fff inset; }
.ib-farbe input { position: absolute; opacity: 0; pointer-events: none; }
.ib-ki-leiste { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .75rem; }
.ib-postit--idee { max-width: 240px; cursor: grab; }
.ib-postit--idee.ib-dragging { opacity: .4; }
.ib-postit--duplikat { outline: 3px dashed var(--ib-rot); outline-offset: 2px; }
.ib-postit-prio { align-self: flex-start; font-size: .62rem; }
.ib-postit-tools { display: flex; gap: .1rem; align-items: center; }
.ib-ptool { border: none; background: none; cursor: pointer; font-size: .85rem; padding: .05rem .2rem; opacity: .7; color: inherit; }
.ib-ptool:hover { opacity: 1; }

/* ---------- Ideenbuch: Notizbuch-Ansicht (Handschrift) ---------- */
.ib-notizbuch { position: relative; margin-top: 1.25rem; background: #fdf9ee; border-radius: 6px 14px 14px 6px; padding: 2.5rem 2.5rem 2.5rem 4.5rem; box-shadow: 0 10px 30px rgba(0,0,0,.15); background-image: repeating-linear-gradient(transparent, transparent 35px, #d8cdb4 35px, #d8cdb4 36px); border-left: 14px solid var(--ib-orange); color: #2f2a1e; }
.ib-notizbuch::before { content: ""; position: absolute; top: 0; bottom: 0; left: 3.4rem; width: 2px; background: rgba(230, 51, 18, .35); }
.ib-notizbuch-titel { font-family: "Noteworthy", "Bradley Hand", "Comic Sans MS", "Segoe Print", cursive; font-size: 1.5rem; margin: 0 0 1rem; color: #2f2a1e; }
.ib-notizbuch-zeile { font-family: "Noteworthy", "Bradley Hand", "Comic Sans MS", "Segoe Print", cursive; font-size: 1.15rem; line-height: 36px; margin: 0; display: flex; gap: .6rem; align-items: baseline; }
.ib-notizbuch-bullet { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex-shrink: 0; transform: rotate(-4deg); box-shadow: 1px 1px 2px rgba(0,0,0,.2); }
.ib-notizbuch-prio { color: var(--ib-rot); font-weight: 700; }

/* ---------- Ideenbuch: Workspace ---------- */
.ib-workspace { position: relative; height: 70vh; min-height: 480px; border: 2px dashed var(--color-border); border-radius: 14px; background: var(--color-surface); background-image: radial-gradient(circle, var(--color-border) 1px, transparent 1px); background-size: 24px 24px; overflow: hidden; }
.ib-postit--frei { position: absolute; width: 170px; max-width: none; cursor: grab; touch-action: none; user-select: none; box-shadow: 2px 4px 10px rgba(0,0,0,.25); }
.ib-postit--frei:active { cursor: grabbing; z-index: 10; }
.ib-postit-prio-mini { font-size: .65rem; font-weight: 700; opacity: .75; }

/* ---------- Ideen-Chat-Dialog ---------- */
.ib-dialog--chat[open] { display: flex; flex-direction: column; max-height: 80vh; }
.ib-ideechat-log { min-height: 220px; max-height: 45vh; overflow-y: auto; margin: .75rem 0; display: flex; flex-direction: column; gap: .5rem; }

/* ---------- Kanban-Board ---------- */
.ib-kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.25rem; align-items: start; }
@media (max-width: 900px) { .ib-kanban { grid-template-columns: 1fr; } }
.ib-kanban-spalte { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: .75rem; }
.ib-kanban-kopf { display: flex; justify-content: space-between; align-items: center; padding: .25rem .35rem .6rem; border-bottom: 3px solid var(--color-border); margin-bottom: .6rem; }
.ib-kanban-kopf h2 { margin: 0; font-size: 1rem; }
.ib-kanban-kopf--offen { border-bottom-color: var(--ib-orange); }
.ib-kanban-kopf--aktiv { border-bottom-color: #3b82c4; }
.ib-kanban-kopf--erledigt { border-bottom-color: var(--ib-gruen); }
.ib-kanban-liste { display: flex; flex-direction: column; gap: .6rem; min-height: 120px; border-radius: 8px; }
.ib-kanban-liste.ib-dragover { background: color-mix(in srgb, var(--ib-orange) 10%, transparent); outline: 2px dashed var(--ib-orange); }
.ib-kanban-karte { background: var(--color-bg, #fff); border: 1px solid var(--color-border); border-radius: 10px; padding: .6rem .75rem; cursor: grab; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.ib-kanban-karte.ib-dragging { opacity: .4; }
.ib-kanban-titel { margin: 0 0 .4rem; font-size: .9rem; }
.ib-kanban-meta { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .4rem; }
.ib-kanban-meta a { text-decoration: none; }
.ib-kanban-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.ib-kanban-pfeile { display: flex; gap: .1rem; }
[data-theme="dark"] .ib-kanban-karte { background: var(--color-surface); }

/* ---------- Genius: Profile, Chat, Forum ---------- */
.ib-logo { width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 1rem; flex-shrink: 0; }
.ib-logo--xl { width: 84px; height: 84px; border-radius: 18px; font-size: 1.8rem; }
.ib-expert--link { text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .12s ease, box-shadow .12s ease; }
.ib-expert--link:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.ib-expert-head { display: flex; gap: .7rem; align-items: flex-start; }
.ib-skills { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.ib-skill { background: color-mix(in srgb, var(--ib-orange) 14%, transparent); color: #9a5b00; border: 1px solid color-mix(in srgb, var(--ib-orange) 40%, transparent); border-radius: 999px; padding: .15rem .6rem; font-size: .78rem; }
[data-theme="dark"] .ib-skill { color: #ffb75e; }
.ib-partner-hero { display: flex; gap: 1.25rem; align-items: flex-start; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; padding: 1.5rem; flex-wrap: wrap; }
.ib-partner-hero h1 { margin: 0; }
.ib-partner-links { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.ib-partner-links a { text-decoration: none; }
.ib-partner-cta { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; }
.ib-showroom { display: flex; flex-direction: column; gap: .9rem; }
.ib-showroom-item { border: 1px solid var(--color-border); border-left: 4px solid var(--ib-orange); border-radius: 10px; padding: .8rem 1rem; }
.ib-showroom-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.ib-showroom-head h3 { margin: 0; font-size: 1rem; }
.ib-showroom-ergebnis { color: var(--ib-gruen); font-weight: 600; font-size: .9rem; margin: .35rem 0 0; }
.ib-chatpage { display: grid; grid-template-columns: 3fr 2fr; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .ib-chatpage { grid-template-columns: 1fr; } }
.ib-chatpage-main { display: flex; flex-direction: column; min-height: 480px; }
.ib-chatpage-head { display: flex; gap: .7rem; align-items: center; border-bottom: 1px solid var(--color-border); padding-bottom: .75rem; margin-bottom: .75rem; }
.ib-chatpage-log { flex: 1; display: flex; flex-direction: column; gap: .6rem; overflow-y: auto; max-height: 55vh; padding-right: .25rem; }
.ib-chatpage-system { align-self: center; background: color-mix(in srgb, var(--ib-gruen) 15%, transparent); border: 1px dashed var(--ib-gruen); border-radius: 999px; padding: .3rem .9rem; font-size: .8rem; text-align: center; }
.ib-chatpage-form { display: flex; gap: .5rem; margin-top: .9rem; }
.ib-chatpage-form input[type="text"] { flex: 1; }
.ib-chatlist-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-decoration: none; color: inherit; margin-bottom: .75rem; }
.ib-chatlist-preview { font-size: .85rem; margin: .25rem 0 0; }
.ib-thread { display: block; text-decoration: none; color: inherit; margin-bottom: .75rem; }
.ib-thread-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.ib-thread-head h2 { margin: 0; font-size: 1.05rem; }
.ib-thread-meta { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem; font-size: .82rem; color: var(--color-text-muted); }
.ib-post { margin-bottom: .75rem; }
.ib-post--partner { border-left: 4px solid var(--ib-gruen); }
.ib-post-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ib-post-head a { text-decoration: none; color: inherit; }

/* ---------- KI-Assistent (Chat) ---------- */
.ib-chat { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 900; }
.ib-chat-fab { width: 56px; height: 56px; border-radius: 50%; border: none; background: linear-gradient(135deg, var(--ib-rot), var(--ib-orange)); color: #fff; font-size: 1.5rem; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.ib-chat-panel[hidden] { display: none; }
.ib-chat-fab[hidden] { display: none; }
.ib-chat-panel { width: min(380px, calc(100vw - 2rem)); height: 480px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; }
.ib-chat-head { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; background: var(--ib-anthrazit); color: #fff; }
.ib-chat-head .ib-muted { color: #cfc9c4; margin-left: auto; }
.ib-chat-close { border: none; background: none; color: #fff; font-size: 1.2rem; cursor: pointer; }
.ib-chat-log { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .6rem; }
.ib-chat-msg { max-width: 85%; padding: .5rem .7rem; border-radius: 10px; font-size: .88rem; white-space: pre-line; }
.ib-chat-msg--user { align-self: flex-end; background: var(--ib-rot); color: #fff; border-bottom-right-radius: 2px; }
.ib-chat-msg--assistant { align-self: flex-start; background: var(--color-border); border-bottom-left-radius: 2px; }
.ib-chat-form { display: flex; gap: .4rem; padding: .6rem; border-top: 1px solid var(--color-border); }
.ib-chat-form input { flex: 1; }
.ib-chat-suggestions { display: flex; flex-direction: column; gap: .35rem; align-self: flex-start; max-width: 90%; }
.ib-chat-suggestion { border: 1px dashed #7db8e8; background: #dcefff; color: #1d4b6e; border-radius: 8px; padding: .4rem .6rem; font-size: .8rem; text-align: left; cursor: pointer; }
.ib-chat-suggestion:disabled { opacity: .7; cursor: default; }
.ib-chat-suggestion-link { font-size: .75rem; margin-left: .25rem; }

/* ---------- Konzept-Dokument (druckfaehig) ---------- */
.ib-doc-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap; }
.ib-doc { max-width: 900px; margin: 0 auto; background: #fff; color: #26221f; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.12); padding: 3rem 3.5rem; }
.ib-doc-cover { text-align: center; border-bottom: 3px solid var(--ib-rot); padding-bottom: 2rem; margin-bottom: 2rem; }
.ib-doc-brand { font-weight: 700; color: var(--ib-rot); letter-spacing: .05em; margin-bottom: 1rem; }
.ib-doc-cover h1 { font-size: 2.2rem; margin: 0 0 .75rem; }
.ib-doc-satz { font-size: 1.1rem; font-style: italic; color: #5a534c; max-width: 640px; margin: 0 auto .75rem; }
.ib-doc-meta { color: #8a8178; font-size: .85rem; margin: 0; }
.ib-doc-abschnitt { margin-bottom: 2rem; }
.ib-doc-abschnitt h2 { color: var(--ib-rot); font-size: 1.25rem; border-bottom: 1px solid #eee5da; padding-bottom: .35rem; margin: 0 0 .9rem; }
.ib-doc-abschnitt h3 { font-size: .95rem; margin: .9rem 0 .35rem; }
.ib-doc-abschnitt ul { margin: 0 0 .5rem 1.2rem; }
.ib-doc-abschnitt li { margin-bottom: .25rem; }
.ib-doc-spalten { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.ib-doc-bmc { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.ib-doc-bmc > div { border: 1px solid #eee5da; border-radius: 10px; padding: .7rem .9rem; }
.ib-doc-bmc-wert { border-color: var(--ib-orange) !important; background: color-mix(in srgb, var(--ib-orange) 8%, #fff); }
.ib-doc-leer { color: #b0a89e; font-style: italic; }
.ib-doc-fuss { text-align: center; color: #b0a89e; font-size: .8rem; border-top: 1px solid #eee5da; padding-top: 1rem; }
@media print {
    .ib-no-print, .app-sidebar, .app-topbar, .ib-chat, .flash-toast-container { display: none !important; }
    body, .app-main, .app-content { background: #fff !important; margin: 0 !important; padding: 0 !important; }
    .ib-doc { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
    .ib-doc-abschnitt { break-inside: avoid; }
}

/* ---------- Pitch-Day-Modus ---------- */
.ib-pitch { position: relative; background: var(--ib-anthrazit); color: #f3efe9; border-radius: 18px; min-height: 62vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 34px rgba(0,0,0,.25); }
.ib-pitch-timer { position: absolute; top: 1.1rem; right: 1.4rem; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ib-gelb); z-index: 2; }
.ib-pitch-timer--rot { color: #ff6a4d; animation: ib-blink 1s infinite; }
@keyframes ib-blink { 50% { opacity: .35; } }
.ib-folie { display: none; flex: 1; flex-direction: column; justify-content: center; padding: 3rem 4rem; }
.ib-folie--aktiv { display: flex; }
.ib-folie-kicker { text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; color: var(--ib-orange); margin-bottom: .5rem; }
.ib-folie h1 { font-size: 2.6rem; margin: 0 0 1.25rem; color: var(--ib-gelb); text-transform: uppercase; font-weight: 900; }
.ib-folie ul { list-style: none; margin: 0; font-size: 1.25rem; line-height: 1.5; }
.ib-folie li { margin-bottom: .8rem; padding-left: 1.4rem; position: relative; }
.ib-folie li::before { content: '▸'; position: absolute; left: 0; color: var(--ib-orange); }
.ib-pitch-nav { display: flex; justify-content: center; align-items: center; gap: 1rem; padding: 1rem; border-top: 1px solid rgba(255,255,255,.12); }
.ib-pitch-live { font-size: 1.1rem; }
.ib-pitch-live-zahl { font-size: 3.2rem; font-weight: 900; color: var(--ib-gelb); }
.ib-pitch-live-zahl small { font-size: 1.2rem; color: #f3efe9; }
.ib-pitch-kommentare { display: flex; flex-direction: column; gap: .45rem; margin-top: 1rem; max-width: 640px; }
.ib-pitch-kommentar { background: rgba(255,255,255,.1); border-radius: 10px; padding: .5rem .8rem; font-size: .95rem; }
.ib-pitch-kommentar--invest { background: color-mix(in srgb, var(--ib-gruen) 35%, transparent); }

/* ---------- Voting ---------- */
.ib-voting { max-width: 480px; margin: 2rem auto; }
.ib-voting-kopf { text-align: center; margin-bottom: 1.25rem; }
.ib-sterne { display: flex; flex-direction: row-reverse; justify-content: center; gap: .3rem; font-size: 2.4rem; }
.ib-sterne input { display: none; }
.ib-sterne label { cursor: pointer; color: var(--color-border); transition: color .1s ease; }
.ib-sterne input:checked ~ label, .ib-sterne label:hover, .ib-sterne label:hover ~ label { color: var(--ib-gelb); }

/* ---------- Methodenkoffer ---------- */
.ib-timerbox { text-align: center; }
.ib-timer { font-size: 3.4rem; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--ib-rot); margin: .5rem 0; }
.ib-timer-hinweis { color: var(--color-text-muted); font-size: .9rem; margin-top: .75rem; }
.ib-trends { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-top: .75rem; }
.ib-trend { border: 1px solid var(--color-border); border-radius: 14px; padding: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.ib-trend-emoji { font-size: 1.8rem; }
.ib-trend h3 { margin: 0; }
.ib-trend p { font-size: .85rem; margin: 0; color: var(--color-text-muted); }
.ib-trend-frage { color: var(--color-text) !important; font-style: italic; }
.ib-trend form { margin-top: auto; padding-top: .5rem; }

/* ---------- Batch-Hub ---------- */
.ib-countdown { display: flex; align-items: center; gap: .7rem; background: var(--ib-anthrazit); color: #fff; border-radius: 14px; padding: .7rem 1.1rem; }
.ib-countdown-zahl { font-size: 2.2rem; font-weight: 900; color: var(--ib-gelb); }
.ib-countdown-text { font-size: .8rem; line-height: 1.25; }
.ib-batch-team { display: flex; align-items: center; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--color-border); }
.ib-batch-team:last-of-type { border-bottom: none; }
.ib-batch-team--eigen { background: color-mix(in srgb, var(--ib-orange) 8%, transparent); border-radius: 10px; padding: .65rem .75rem; }
.ib-ankuendigung { border-left: 3px solid var(--ib-orange); padding: .1rem 0 .1rem .9rem; margin-bottom: 1rem; }
.ib-ankuendigung-kopf { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .2rem; }
.ib-zeitstrahl { position: relative; padding-left: 1.4rem; }
.ib-zeitstrahl::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--color-border); }
.ib-zeitstrahl-punkt { position: relative; display: flex; gap: .8rem; margin-bottom: 1.1rem; }
.ib-zeitstrahl-dot { position: absolute; left: -1.4rem; top: .3rem; width: 14px; height: 14px; border-radius: 50%; background: var(--ib-orange); border: 3px solid var(--color-surface); }
.ib-zeitstrahl-punkt--vorbei { opacity: .55; }
.ib-zeitstrahl-punkt--vorbei .ib-zeitstrahl-dot { background: var(--ib-gruen); }

/* ---------- Innovation-Pass ---------- */
.ib-pass { max-width: 860px; margin: 0 auto; display: grid; grid-template-columns: 300px 1fr; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 34px rgba(0,0,0,.2); }
@media (max-width: 800px) { .ib-pass { grid-template-columns: 1fr; } }
.ib-pass-cover { background: var(--ib-anthrazit); color: #f3efe9; padding: 2.5rem 1.75rem; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6rem; }
.ib-pass-wappen { font-size: 3.4rem; border: 3px double var(--ib-gelb); border-radius: 50%; width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; }
.ib-pass-titel { font-weight: 900; letter-spacing: .18em; color: var(--ib-gelb); }
.ib-pass-untertitel { font-size: .75rem; opacity: .75; letter-spacing: .06em; }
.ib-pass-inhaber { margin-top: 1.5rem; display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; }
.ib-pass-inhaber strong { font-size: 1.05rem; }
.ib-pass-inhaber em { font-style: normal; opacity: .75; }
.ib-pass-seite { background: #f8f4ec; color: #26221f; padding: 2rem; background-image: repeating-linear-gradient(0deg, transparent, transparent 34px, rgba(38,34,31,.05) 35px); }
.ib-pass-seite h2 { margin: 0 0 1rem; font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; color: #8a8178; }
.ib-pass-stempel { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .9rem; }
.ib-pass-feld { border: 2px dashed #cfc5b6; border-radius: 12px; min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; padding: .5rem; text-align: center; }
.ib-pass-feld-nr { font-size: 1.4rem; font-weight: 800; color: #cfc5b6; }
.ib-pass-feld-titel { font-size: .72rem; color: #8a8178; }
.ib-pass-feld--gestempelt { border-style: solid; }
.ib-stempel { border: 3px solid currentColor; border-radius: 50%; width: 86px; height: 86px; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(-8deg); opacity: .85; line-height: 1.1; }
.ib-pass-feld:nth-child(even) .ib-stempel { transform: rotate(6deg); }
.ib-stempel--rot { color: var(--ib-rot); }
.ib-stempel--orange { color: #c77400; }
.ib-stempel--gruen { color: var(--ib-gruen); }
.ib-stempel--anthrazit { color: #4a443f; }
.ib-stempel-nr { font-weight: 900; font-size: .95rem; }
.ib-stempel-text { font-size: .58rem; font-weight: 800; letter-spacing: .1em; }
.ib-stempel-datum { font-size: .55rem; }
.ib-pass-fuss { margin-top: 1.25rem; font-weight: 600; }
@media print { .ib-pass { box-shadow: none; } }

/* ---------- Projekt-Tagebuch ---------- */
.ib-tagebuch { max-width: 760px; }
.ib-tagebuch-tag { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.ib-tagebuch-datum { font-weight: 700; color: var(--color-text-muted); font-size: .9rem; padding-top: .45rem; text-align: right; }
.ib-tagebuch-eintraege { border-left: 3px solid var(--color-border); padding-left: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.ib-tagebuch-eintrag { display: flex; gap: .55rem; align-items: flex-start; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; padding: .55rem .8rem; font-size: .92rem; }
.ib-tb-rot { border-left: 4px solid var(--ib-rot); }
.ib-tb-orange { border-left: 4px solid var(--ib-orange); }
.ib-tb-gelb { border-left: 4px solid var(--ib-gelb); }
.ib-tb-gruen { border-left: 4px solid var(--ib-gruen); }
.ib-tb-anthrazit { border-left: 4px solid var(--ib-anthrazit); }

/* ---------- Personas ---------- */
.ib-personas { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.ib-persona { background: var(--color-surface); border: 1px solid var(--color-border); border-top: 6px solid var(--ib-rot); border-radius: 14px; padding: 1.25rem; display: flex; flex-direction: column; gap: .8rem; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.ib-persona-kopf { display: flex; gap: .8rem; align-items: center; }
.ib-persona-kopf h2 { margin: 0; font-size: 1.1rem; }
.ib-persona-avatar { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; flex-shrink: 0; }
.ib-persona-zitat { font-style: italic; background: color-mix(in srgb, var(--ib-gelb) 20%, transparent); border-radius: 10px; padding: .6rem .8rem; }
.ib-persona-block strong { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.ib-persona-block p { margin: .25rem 0 0; font-size: .92rem; }

/* ---------- Fokus-Modus (Workshop) ---------- */
body.ib-fokus .app-sidebar, body.ib-fokus .ib-back, body.ib-fokus .ib-topzeile,
body.ib-fokus .ib-boxkarte, body.ib-fokus .ib-chat, body.ib-fokus .ib-agent-bubble { display: none !important; }
body.ib-fokus .main { margin-left: 0 !important; padding: 4.5rem 3vw 2rem !important; max-width: none !important; }
body.ib-fokus { font-size: 1.12em; }
/* Buttons/Links in Karten-Koepfen sitzen systemweit oben rechts in der Ecke */
.card-head > .btn, .card-head > .ib-link-btn, .card-head > form, .card-head > .ib-toggle { margin-left: auto; }
.ib-fokusbar { display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 950; background: var(--ib-anthrazit); color: #f3efe9; padding: .55rem 1.25rem; align-items: center; gap: 1rem; }
body.ib-fokus .ib-fokusbar { display: flex; }
.ib-fokusbar-timer { font-weight: 800; font-size: 1.3rem; color: var(--ib-gelb); font-variant-numeric: tabular-nums; margin-left: auto; }
.ib-fokusbar-btn { background: rgba(255,255,255,.12); color: #fff; border: none; }

/* ---------- Konfetti ---------- */
.ib-konfetti { position: fixed; top: -12px; width: 10px; height: 14px; z-index: 1200; pointer-events: none; animation: ib-konfetti-fall linear forwards; border-radius: 2px; }
@keyframes ib-konfetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(105vh) rotate(680deg); opacity: .7; }
}
.ib-konfetti-toast { position: fixed; top: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 1201; background: var(--ib-anthrazit); color: #fff; border-radius: 999px; padding: .7rem 1.4rem; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.3); }

/* ---------- Unboxing ---------- */
.ib-unboxing { position: fixed; inset: 0; z-index: 1300; background: rgba(24,20,17,.94); display: flex; align-items: center; justify-content: center; opacity: 1; transition: opacity .5s ease; cursor: pointer; }
.ib-unboxing--weg { opacity: 0; pointer-events: none; }
.ib-unboxing-buehne { position: relative; width: min(90vw, 900px); height: min(70vh, 560px); }
.ib-unboxing-box { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); width: 230px; }
.ib-unboxing-korpus { background: var(--ib-anthrazit); color: #f3efe9; border: 2px solid #4a443f; border-radius: 10px; height: 120px; display: flex; align-items: center; justify-content: center; font-weight: 900; letter-spacing: .1em; }
.ib-unboxing-deckel { background: var(--ib-rot); color: #fff; border-radius: 10px 10px 4px 4px; height: 38px; display: flex; align-items: center; justify-content: center; font-weight: 700; transform-origin: left bottom; transition: transform 1s ease .4s; }
.ib-unboxing--los .ib-unboxing-deckel { transform: rotate(-110deg) translateY(-6px); }
.ib-unboxing-karte { position: absolute; left: 50%; bottom: 30%; width: 92px; padding: .5rem .4rem; border-radius: 8px; text-align: center; font-weight: 800; font-size: .85rem; color: #fff; opacity: 0; transform: translate(-50%, 0) rotate(0deg); transition: transform 1.1s cubic-bezier(.2,.7,.3,1), opacity .4s ease; transition-delay: calc(.9s + var(--i) * .12s); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.ib-unboxing-karte small { font-weight: 600; font-size: .58rem; display: block; }
.ib-unboxing--los .ib-unboxing-karte { opacity: 1; transform: translate(calc(-50% + (var(--i) - 5) * 76px), calc(-190px - (var(--i) % 2) * 46px)) rotate(calc((var(--i) - 5) * 4deg)); }
.ib-unboxing-text { position: absolute; bottom: 4%; left: 0; right: 0; text-align: center; color: #f3efe9; font-size: 1.1rem; font-weight: 700; opacity: 0; transition: opacity .6s ease 2.4s; }
.ib-unboxing--los .ib-unboxing-text { opacity: 1; }

/* ---------- Kartendeck (3D-Flip) ---------- */
.ib-deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.ib-flip { perspective: 1000px; cursor: pointer; min-height: 150px; }
.ib-flip-innen { position: relative; width: 100%; height: 100%; min-height: 150px; transform-style: preserve-3d; transition: transform .55s ease; }
.ib-flip--umgedreht .ib-flip-innen { transform: rotateY(180deg); }
.ib-flip-front, .ib-flip-back { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 12px; padding: .9rem 1rem; box-shadow: 0 4px 14px rgba(0,0,0,.15); display: flex; flex-direction: column; }
.ib-flip-front { color: #fff; justify-content: space-between; }
.ib-flip-nr { font-size: 1.5rem; font-weight: 900; }
.ib-flip-titel { font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.ib-flip-logo { font-size: .68rem; opacity: .8; font-weight: 700; }
.ib-flip-front.ib-boxkarte--anthrazit .ib-flip-nr, .ib-flip-front.ib-boxkarte--rot .ib-flip-nr, .ib-flip-front.ib-boxkarte--gruen .ib-flip-nr { color: var(--ib-gelb); }
.ib-flip-back { background: #faf6ee; color: #2b2015; transform: rotateY(180deg); justify-content: space-between; gap: .5rem; }
.ib-flip-back p { margin: 0; font-size: .82rem; line-height: 1.45; }

/* ---------- Ideen-Battle ---------- */
.ib-battle-stand { text-align: center; font-weight: 700; margin-bottom: 1rem; }
.ib-battle-arena { display: flex; align-items: stretch; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.ib-battle-karte { border: none; cursor: pointer; min-width: 260px; max-width: 340px; min-height: 170px; font-size: 1.05rem; font-weight: 600; transform: rotate(-1deg); transition: transform .12s ease, box-shadow .12s ease; text-align: left; padding: 1.1rem; }
.ib-battle-karte:hover { transform: rotate(0deg) scale(1.04); box-shadow: 0 10px 26px rgba(0,0,0,.25); }
.ib-battle-vs { align-self: center; font-size: 1.6rem; font-weight: 900; color: var(--ib-rot); }

/* ---------- Gateway-Check ---------- */
.ib-dialog--gateway { max-width: 560px; }
.ib-gateway { border: 1px solid var(--color-border); border-radius: 12px; padding: .75rem .9rem; margin-top: .75rem; }
.ib-gateway-kopf { display: flex; align-items: center; gap: .55rem; }
.ib-gateway-kopf .badge { margin-left: auto; }
.ib-gateway-ampel { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.ib-gateway--gruen .ib-gateway-ampel { background: var(--ib-gruen); }
.ib-gateway--gelb .ib-gateway-ampel { background: var(--ib-gelb); }
.ib-gateway--rot .ib-gateway-ampel { background: var(--ib-rot); }
.ib-gateway-punkte { list-style: none; margin: .5rem 0 0; font-size: .85rem; display: flex; flex-direction: column; gap: .25rem; }
.ib-gateway-ok { color: var(--color-text-muted); }

/* ---------- Zeitkapsel ---------- */
.ib-zeitkapsel-zu { display: flex; align-items: center; gap: 1rem; }
.ib-zeitkapsel-siegel { font-size: 2.2rem; }
.ib-zeitkapsel-brief { background: #fdf9ef; color: #3a3423; border: 1px solid #e8ddc8; border-radius: 10px; padding: 1.1rem 1.3rem; font-family: "Noteworthy", "Bradley Hand", "Segoe Print", cursive; font-size: 1.05rem; line-height: 1.6; }

/* ---------- Wochen-Digest (Mail-Vorschau) ---------- */
.ib-mail { max-width: 720px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.ib-mail-kopf { background: color-mix(in srgb, var(--ib-anthrazit) 92%, #fff); color: #f3efe9; padding: .9rem 1.25rem; font-size: .85rem; display: flex; flex-direction: column; gap: .2rem; }
.ib-mail-body { padding: 1.25rem 1.5rem; }
.ib-mail-liste { margin: .5rem 0 1rem 1.1rem; display: flex; flex-direction: column; gap: .3rem; font-size: .92rem; }

/* ---------- Plattform: Lab, CRM, Kalender, Hub, Opportunities, Deck ---------- */
.ib-tabelle { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ib-tabelle th, .ib-tabelle td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--color-border); }
.ib-tabelle th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-muted); }
.ib-termin { display: flex; gap: .55rem; align-items: flex-start; padding: .4rem 0; }
.ib-termin-punkt { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: .3rem; display: inline-block; }
.ib-kontakt { padding: .4rem 0; border-bottom: 1px solid var(--color-border); }
.ib-kontakt:last-of-type { border-bottom: none; }
.ib-programm-projekt { display: flex; align-items: center; gap: .8rem; padding: .5rem 0; border-bottom: 1px solid var(--color-border); }
.ib-programm-projekt:last-of-type { border-bottom: none; }
.ib-freigabe { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; flex-wrap: wrap; }
.ib-fieldset { border: 1px dashed var(--color-border); border-radius: 10px; padding: .75rem .9rem 0; margin: .75rem 0; }
.ib-fieldset legend { font-size: .78rem; font-weight: 700; color: var(--color-text-muted); padding: 0 .4rem; }

/* Kalender */
.ib-kalender { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ib-kalender-wt { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--color-text-muted); padding: .25rem; }
.ib-kalender-tag { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 8px; min-height: 92px; padding: .3rem; position: relative; }
.ib-kalender-tag--leer { background: transparent; border: none; }
.ib-kalender-tag--heute { outline: 2px solid var(--ib-orange); }
.ib-kalender-nr { font-size: .72rem; font-weight: 700; color: var(--color-text-muted); }
.ib-kalender-event { position: relative; font-size: .68rem; background: color-mix(in srgb, var(--ib-orange) 10%, var(--color-surface)); border-left: 3px solid var(--ib-orange); border-radius: 4px; padding: .15rem .3rem; margin-top: .2rem; padding-right: 1rem; }
.ib-kalender-del { position: absolute; right: 2px; top: 0; }
.ib-kalender-del button { border: none; background: none; cursor: pointer; font-size: .75rem; color: var(--color-text-muted); }
.ib-kalender-legende { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; align-items: center; }
.ib-kalender-legende .ib-termin-punkt { margin-top: 0; vertical-align: middle; }

/* Community-Hub-Karten (Logo-Flaeche oben) */
.ib-hub-branche { margin: 1.25rem 0 .6rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .07em; color: var(--color-text-muted); }
.ib-hubkarte { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.ib-hubkarte:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.ib-hubkarte-logo { position: relative; height: 96px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 2rem; font-weight: 900; letter-spacing: .05em; }
.ib-hubkarte-region { position: absolute; right: .6rem; top: .6rem; }
.ib-hubkarte-body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.ib-hubkarte-body h3 { margin: 0; font-size: 1rem; }
.ib-hubkarte-claim { margin: 0; font-size: .85rem; color: var(--color-text-muted); }

/* Pitch-Deck-Raster */
.ib-deckgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
.ib-deckfolie { position: relative; background: var(--ib-anthrazit); color: #f3efe9; border-radius: 12px; padding: 1.1rem 1.25rem 1.5rem; aspect-ratio: 16 / 10; overflow: hidden; display: flex; flex-direction: column; }
.ib-deckfolie--cover { background: linear-gradient(135deg, var(--ib-rot), var(--ib-orange)); }
.ib-deckfolie-kopf { display: flex; justify-content: space-between; align-items: center; }
.ib-deckfolie-kicker { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ib-gelb); }
.ib-deckfolie--cover .ib-deckfolie-kicker { color: #fff; }
.ib-deckfolie h2 { margin: .3rem 0 .6rem; font-size: 1.15rem; font-weight: 900; text-transform: uppercase; }
.ib-deckfolie ul { list-style: none; margin: 0; font-size: .82rem; display: flex; flex-direction: column; gap: .35rem; overflow: hidden; }
.ib-deckfolie li { padding-left: 1rem; position: relative; }
.ib-deckfolie li::before { content: '▸'; position: absolute; left: 0; color: var(--ib-orange); }
.ib-deckfolie--cover li::before { color: #fff; }
.ib-deckfolie-nr { position: absolute; right: .8rem; bottom: .5rem; font-size: .7rem; opacity: .6; }
.ib-deckfolie .ib-ptool { color: #f3efe9; }
.ib-deckfolie .ib-visual svg { max-height: 150px; width: auto; }
@media print { .ib-deckgrid { grid-template-columns: 1fr; } .ib-deckfolie { break-inside: avoid; aspect-ratio: auto; min-height: 320px; } }

/* Elevator + Visual */
.ib-elevator { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; align-items: start; }
.ib-elevator textarea { width: 100%; }
.ib-visual svg { width: 100%; height: auto; border-radius: 10px; }

/* ---------- Ansichten-Switcher unten in der Sidebar ---------- */
.ib-areas-unten { margin-top: auto; padding: .5rem .75rem .25rem; position: relative; }
.ib-areas-unten .app-sidebar-areas { margin: 0; }
.ib-areas-unten .app-sidebar-area-menu { top: auto; bottom: calc(100% + 6px); }

/* ---------- Projekt-Dashboard (UI-Audit: erst Status, dann Werkzeuge) ---------- */
.ib-topzeile { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.ib-topzeile .ib-back { justify-self: start; white-space: nowrap; }
.ib-topzeile-aktionen { justify-self: end; display: flex; gap: .5rem; }
@media (max-width: 1000px) {
    .ib-topzeile { grid-template-columns: auto auto; }
    .ib-topzeile .ib-journeyleiste { grid-column: 1 / -1; grid-row: 2; width: 100%; }
}
.ib-minijourney { display: flex; align-items: center; gap: 5px; }
.ib-minijourney-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--color-border); display: inline-block; transition: transform .1s ease; }
.ib-minijourney-dot:hover { transform: scale(1.5); }
.ib-minijourney-dot--done { background: var(--ib-gruen); }
.ib-minijourney-dot--current { background: #7ec99a; box-shadow: 0 0 0 3px color-mix(in srgb, #7ec99a 35%, transparent); }
.ib-minijourney-dot--open { background: #b9b3ac; }
.ib-minijourney-dot--future { background: var(--color-border); opacity: .55; }
.ib-minijourney-stand { font-size: .75rem; font-weight: 700; color: var(--color-text-muted); margin-left: .35rem; }

.ib-dashboard { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
@media (max-width: 1100px) { .ib-dashboard { grid-template-columns: 1fr; } }
.ib-dashboard-haupt { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.ib-dashboard-seite { display: flex; flex-direction: column; gap: .7rem; }
.ib-nachricht { position: relative; padding-right: 1.4rem; }
.ib-nachricht-weg { position: absolute; top: 0; right: 0; }
.ib-nachricht-weg button { border: 0; background: none; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--color-text-muted); padding: .1rem .25rem; border-radius: 6px; }
.ib-nachricht-weg button:hover { background: var(--color-border); color: var(--color-text); }

/* Statuszeile: Pass-Statuskarte + Gateway-Status */
.ib-statuszeile { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
@media (max-width: 800px) { .ib-statuszeile { grid-template-columns: 1fr; } }

/* === Runde 11: Batch-Karte im Projekt-Dashboard ============================ */
.ib-batchkarte { display: flex; flex-direction: column; gap: .35rem; padding: .9rem 1rem; text-decoration: none; color: inherit; }
.ib-batchkarte:hover { border-color: var(--ib-orange); }
.ib-batchkarte-termin { font-size: .78rem; color: var(--color-text-muted); display: flex; align-items: baseline; gap: .4rem; }
.ib-batchkarte-tage { flex: 0 0 auto; font-size: .68rem; font-weight: 700; color: var(--ib-orange); background: color-mix(in srgb, var(--ib-orange) 12%, var(--color-surface)); border-radius: 999px; padding: .05rem .45rem; }

/* === Runde 11: Service-/Raum-Kacheln mit Beispielbild ====================== */
.ib-servicekacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.ib-servicekachel { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.ib-servicekachel-bild { width: 100%; aspect-ratio: 5 / 3; object-fit: cover; display: block; }
.ib-servicekachel-body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; gap: .5rem; }
.ib-servicekachel-body p, .ib-servicekachel-body h3 { margin: 0; }
.ib-servicekachel-btn { margin-top: auto; align-self: flex-start; }

/* Slot-Kalender im Buchungs-Popup */
.ib-dialog--breit { width: min(640px, 92vw); }
.ib-slotwahl { max-height: 40vh; overflow-y: auto; border: 1px solid var(--color-border); border-radius: 8px; padding: .5rem .75rem; }
.ib-slotwahl-tag { display: flex; align-items: center; gap: .75rem; padding: .3rem 0; border-bottom: 1px dashed var(--color-border); }
.ib-slotwahl-tag:last-child { border-bottom: 0; }
.ib-slotwahl-datum { flex: 0 0 110px; font-size: .8rem; font-weight: 600; }
.ib-slotwahl-pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.ib-slot input { position: absolute; opacity: 0; pointer-events: none; }
.ib-slot span { display: inline-block; font-size: .74rem; padding: .2rem .55rem; border: 1px solid var(--color-border); border-radius: 999px; cursor: pointer; }
.ib-slot:hover span { border-color: var(--ib-orange); }
.ib-slot:has(input:checked) span { background: var(--ib-orange); border-color: var(--ib-orange); color: #fff; font-weight: 700; }

/* Meine Buchungen: Verwaltungs-Sidebar */
.ib-buchung { padding: .6rem 0; border-bottom: 1px solid var(--color-border); display: flex; flex-direction: column; gap: .25rem; }
.ib-buchung:last-child { border-bottom: 0; }
.ib-buchung-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.ib-buchung--storniert { opacity: .55; }
.ib-buchung--storniert .ib-buchung-kopf strong { text-decoration: line-through; }
.ib-buchung-aktionen { display: flex; gap: .4rem; margin-top: .25rem; }
.ib-kalender-event--storniert { opacity: .5; text-decoration: line-through; }
.ib-buchung-datei { border-top: 1px dashed var(--color-border); margin-top: .75rem; padding-top: .6rem; }
.ib-check { display: flex; align-items: center; gap: .5rem; font-size: .85rem; margin: .5rem 0; }
.ib-check input { width: auto; }

/* Hub-Karten & Firmenkopf mit Beispielbild */
.ib-hubkarte-logo--bild { padding: 0; }
.ib-hubkarte-logo--bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ib-firmenkopf { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.ib-firmenkopf-bild { width: 170px; aspect-ratio: 5 / 3; object-fit: cover; border-radius: 10px; flex: 0 0 auto; }
.ib-firmenkopf h1 { margin: 0; font-size: 1.4rem; }
.ib-firmenkopf-aktion { margin-left: auto; display: flex; flex-direction: column; gap: .5rem; align-items: stretch; }

/* Lab: Raum-Kacheln + kompakter Batch-Kalender */
.ib-raum-abschnitt { margin-top: .7rem; padding-top: .5rem; border-top: 1px dashed var(--color-border); }
.ib-kalender--kompakt { gap: 3px; }
.ib-kalender--kompakt .ib-kalender-tag { min-height: 52px; }
.ib-toggle { display: flex; gap: .35rem; }
.ib-passkarte { display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: inherit; transition: transform .12s ease; }
.ib-passkarte:hover { transform: translateY(-2px); }
.ib-passkarte-kopf { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; }
.ib-passkarte-stempel { display: flex; gap: .3rem; flex-wrap: wrap; }
.ib-ministempel { width: 24px; height: 24px; border-radius: 50%; border: 2px dashed var(--color-border); display: inline-flex; align-items: center; justify-content: center; font-size: .62rem; font-weight: 800; color: #fff; }
.ib-ministempel--da { border-style: solid; border-color: transparent; transform: rotate(-8deg); }
.ib-gatewaykarte { display: flex; flex-direction: column; gap: .4rem; cursor: pointer; font: inherit; text-align: left; border: 1px solid var(--color-border); transition: transform .12s ease; }
.ib-gatewaykarte:hover { transform: translateY(-2px); }
.ib-gatewaykarte-titel { margin: 0; font-weight: 700; }
.ib-gatewaykarte .ib-gateway-ampel { display: inline-block; vertical-align: middle; margin-right: .3rem; }
.ib-gatewaykarte-ampel--gruen { background: var(--ib-gruen); }
.ib-gatewaykarte-ampel--gelb { background: var(--ib-gelb); }
.ib-gatewaykarte-ampel--rot { background: var(--ib-rot); }

/* Kachelraster: Arbeitsbereiche */
.ib-kacheln { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 900px) { .ib-kacheln { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .ib-kacheln { grid-template-columns: 1fr; } }
.ib-kachel { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; padding: 1.15rem 1.25rem; min-height: 128px; text-decoration: none; color: inherit; font: inherit; cursor: pointer; text-align: left; transition: transform .12s ease, box-shadow .12s ease; }
.ib-kachel strong { font-size: 1rem; }
.ib-kachel-info { font-size: .74rem; color: var(--color-text-muted); opacity: .8; margin-top: auto; }
.ib-kachel:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.ib-kachel-icon { font-size: 1.7rem; }
.ib-kachel-status { font-size: .82rem; color: var(--color-text); }

/* Journey-Leiste: mittig in der Top-Zeile, benannte Stationen */
.ib-journeyleiste { display: grid; grid-template-columns: repeat(11, minmax(52px, 84px)); justify-content: center; }
.ib-journeystep { position: relative; display: flex; flex-direction: column; align-items: center; gap: .4rem; text-decoration: none; color: inherit; padding: 2px 2px 0; }
.ib-journeystep::before, .ib-journeystep::after { content: ""; position: absolute; top: 15px; height: 3px; background: var(--color-border); width: 50%; }
.ib-journeystep::before { left: 0; }
.ib-journeystep::after { right: 0; }
.ib-journeystep:first-child::before, .ib-journeystep:last-child::after { display: none; }
.ib-journeystep--done::before, .ib-journeystep--done::after,
.ib-journeystep--current::before { background: var(--ib-gruen); }
.ib-journeystep-dot { position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .76rem; font-weight: 800; background: var(--color-border); color: var(--color-text-muted); transition: transform .1s ease; }
.ib-journeystep:hover .ib-journeystep-dot { transform: scale(1.18); }
.ib-journeystep--done .ib-journeystep-dot { background: var(--ib-gruen); color: #fff; }
.ib-journeystep--current .ib-journeystep-dot { background: #7ec99a; color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, #7ec99a 35%, transparent); }
.ib-journeystep--open .ib-journeystep-dot { background: #b9b3ac; color: #fff; }
.ib-journeystep--future .ib-journeystep-dot { opacity: .55; }
.ib-journeystep-name { font-size: .68rem; line-height: 1.25; text-align: center; color: var(--color-text-muted); hyphens: auto; }
.ib-journeystep--done .ib-journeystep-name, .ib-journeystep--current .ib-journeystep-name { color: var(--color-text); font-weight: 600; }
.ib-journeystep--future .ib-journeystep-name { opacity: .6; }
@media (max-width: 900px) { .ib-journeystep-name { display: none; } .ib-journeyleiste { margin-bottom: 1rem; } }

/* Innovation-Pass als Mini-Stempelkarte in der Dashboard-Sidebar */
.ib-passmini { text-decoration: none; color: inherit; display: block; transition: transform .12s ease; }
.ib-passmini:hover { transform: translateY(-2px); }
.ib-pass-stempel--mini { grid-template-columns: repeat(3, 1fr); gap: .45rem; background: #f8f4ec; padding: .6rem; border-radius: 10px; background-image: repeating-linear-gradient(0deg, transparent, transparent 22px, rgba(38,34,31,.05) 23px); }
.ib-pass-stempel--mini .ib-pass-feld { min-height: 68px; border-width: 1.5px; border-radius: 8px; padding: .3rem .2rem; gap: .15rem; }
.ib-pass-stempel--mini .ib-stempel { width: 38px; height: 38px; border-width: 2px; }
.ib-pass-stempel--mini .ib-stempel-nr { font-size: .56rem; }
.ib-pass-stempel--mini .ib-stempel-text { font-size: .34rem; letter-spacing: .06em; }
.ib-pass-stempel--mini .ib-pass-feld-nr { font-size: .95rem; }
.ib-pass-stempel--mini .ib-pass-feld-titel { font-size: .52rem; line-height: 1.2; }

/* Rechte Sidebar */
.ib-seite-aufgabe { display: flex; gap: .5rem; align-items: flex-start; padding: .3rem 0; font-size: .85rem; border-bottom: 1px solid var(--color-border); }
.ib-seite-aufgabe:last-of-type { border-bottom: none; }
.ib-seite-digest { display: flex; flex-direction: column; gap: .3rem; text-decoration: none; color: inherit; transition: transform .12s ease; }
.ib-seite-digest:hover { transform: translateY(-2px); }

/* Dark-Mode-Feinschliff */
[data-theme="dark"] .ib-postit { color: #3a3423; }
[data-theme="dark"] .ib-chat-msg--assistant { background: #3a3632; }
