/* ============================================
           CSS CUSTOM PROPERTIES (Branding)
           Überschrieben via JS applyBrandingTheme()
           ============================================ */
        :root {
            --brand-primary: #8B5E3C;
            --brand-primary-hover: #6d4a2e;
            --brand-secondary: #f39c12;
            --brand-accent: #3498db;
            --brand-on-primary: #ffffff;
            --brand-emphasis: #8B5E3C;
            --brand-soft-bg: #f4f0ec;
            --brand-soft-border: #d5c6b8;
            --brand-button-bg: #8B5E3C;
            --brand-button-hover: #6d4a2e;
            --brand-button-text: #ffffff;
            --brand-chip-active-bg: #8B5E3C;
            --brand-chip-active-text: #ffffff;
            --brand-chip-active-border: #8B5E3C;
            --brand-welcome-heading: #8B5E3C;
            --brand-step-number-bg: #8B5E3C;
            --brand-step-number-text: #ffffff;
            --brand-chat-label: #6b7b8d;
            --brand-chat-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            --app-header-height: 57px;
            --app-nav-width: 138px;
            --app-nav-offset-half: 69px;
        }

/* ============================================
           RESET & BASICS
           ============================================ */
        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: #f0f2f5;
            min-height: 100vh;
            color: #2c3e50;
            display: flex;
            flex-direction: column;
        }

        /* ============================================
           HEADER
           ============================================ */
        header {
            background: #ffffff;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
            padding: 8px 24px;
            border-bottom: 1px solid #e0e4e8;
            display: flex;
            justify-content: space-between;
            align-items: center;
            min-height: var(--app-header-height);
            flex-shrink: 0;
            position: relative;
            z-index: 30;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 14px;
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--brand-primary);
        }
        .logo img {
            height: 40px;
            width: auto;
            object-fit: contain;
        }
        #headerTitle { color: inherit; font-weight: 600; font-size: 1.1rem; }
        #headerSubtitle { color: #6b7b8d; font-weight: normal; font-size: 0.9rem; }

        .header-status {
            display: flex; align-items: center; gap: 8px;
            font-size: 0.85rem; color: #6b7b8d;
        }
        .status-dot {
            width: 8px; height: 8px; border-radius: 50%;
            background: #2ecc71; display: inline-block;
        }
        .status-dot.offline { background: #e74c3c; }

        /* ============================================
           MAIN LAYOUT
           ============================================ */
        .app-container {
            position: relative;
            display: flex;
            flex: 1 1 auto;
            overflow: hidden;
            height: calc(100vh - var(--app-header-height));
            padding-left: var(--app-nav-width);
            background: #f0f2f5;
        }

        /* ============================================
           NAV ICON BAR (links, schmal)
           ============================================ */
        .nav-icon-bar {
            width: var(--app-nav-width);
            background: linear-gradient(180deg, #ff2030 0%, #ec1121 54%, #cf0d18 100%);
            display: flex;
            flex-direction: column;
            align-items: stretch;
            padding: 14px 10px 16px;
            gap: 10px;
            flex-shrink: 0;
            z-index: 20;
            position: fixed;
            top: var(--app-header-height);
            left: 0;
            bottom: 0;
            height: calc(100vh - var(--app-header-height));
            overflow: hidden;
            box-shadow: inset -1px 0 0 rgba(255,255,255,0.14);
        }
        .nav-icon-btn {
            width: 100%;
            min-height: 58px;
            padding: 10px 8px 9px;
            border: 1px solid transparent;
            background: transparent;
            color: rgba(255,255,255,0.86);
            font-size: 1rem;
            border-radius: 16px;
            cursor: pointer;
            transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            position: relative;
        }
        .nav-icon-btn:hover {
            background: rgba(255,255,255,0.16);
            color: #fff;
            transform: translateY(-1px);
        }
        .nav-icon-btn.active {
            background: #ffffff;
            color: var(--brand-primary);
            border-color: rgba(255,255,255,0.4);
            box-shadow: 0 10px 20px rgba(97, 8, 15, 0.22);
        }
        .nav-icon-btn .nav-label {
            display: block;
            font-size: 0.66rem;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 84px;
            text-align: center;
            line-height: 1.2;
            letter-spacing: 0.02em;
        }
        .nav-top-group {
            display: flex;
            flex: 1 1 auto;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            gap: 8px;
            width: 100%;
            min-height: 0;
            overflow: hidden;
            padding: 10px 8px;
            border-radius: 24px;
            background: rgba(255,255,255,0.09);
            border: 1px solid rgba(255,255,255,0.13);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
        }
        .nav-top-group::-webkit-scrollbar { width: 3px; }
        .nav-top-group::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 3px; }
        .nav-bottom-group {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            width: 100%;
            flex-shrink: 0;
            margin-top: auto;
            padding: 10px 8px;
            border-radius: 24px;
            background: rgba(255,255,255,0.09);
            border: 1px solid rgba(255,255,255,0.13);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
        }

        /* ============================================
           SIDEBAR (Quellen) - Panel-Container
           ============================================ */
        /* ============================================
           SIDEBAR — entfernt (v2.5), nur Compat-Reste
           ============================================ */

        /* ============================================
           PANEL: KOSTEN
           ============================================ */
        .cost-panel { padding: 16px; overflow-y: auto; flex: 1; }
        .cost-panel h3 { font-size: 0.95rem; color: var(--brand-primary); margin-bottom: 12px; }
        .cost-stat-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 18px;
        }
        .cost-stat-card {
            background: #f7f9fc;
            border: 1px solid #e0e4e8;
            border-radius: 10px;
            padding: 12px;
            text-align: center;
        }
        .cost-stat-value {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--brand-primary);
        }
        .cost-stat-label {
            font-size: 0.7rem;
            color: #6b7b8d;
            margin-top: 2px;
        }
        .cost-model-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 12px;
            background: #f7f9fc;
            border-radius: 8px;
            margin-bottom: 6px;
            font-size: 0.8rem;
        }
        .cost-model-name { font-weight: 600; color: #2c3e50; }
        .cost-model-info { color: #6b7b8d; text-align: right; }
        .cost-section { margin-bottom: 20px; }
        .cost-section h4 { font-size: 0.82rem; color: #4a5568; margin-bottom: 8px; font-weight: 600; }
        .cost-hint {
            background: rgba(139, 94, 60, 0.05);
            border: 1px solid rgba(139, 94, 60, 0.15);
            border-radius: 8px;
            padding: 10px 12px;
            font-size: 0.75rem;
            color: #4a5568;
            line-height: 1.5;
        }
        .cost-hint strong { color: var(--brand-primary); }
        .cost-loading { text-align: center; padding: 40px; color: #6b7b8d; font-size: 0.85rem; }

        /* ============================================
           PANEL: HILFE
           ============================================ */
        .help-panel { padding: 16px; overflow-y: auto; flex: 1; }
        .help-panel h3 { font-size: 0.95rem; color: var(--brand-primary); margin-bottom: 10px; }
        .help-section {
            margin-bottom: 18px;
            background: #f7f9fc;
            border-radius: 10px;
            padding: 14px;
            border: 1px solid #e0e4e8;
        }
        .help-section h4 {
            font-size: 0.82rem;
            color: var(--brand-primary);
            margin-bottom: 8px;
            font-weight: 600;
        }
        .help-section p, .help-section li {
            font-size: 0.78rem;
            color: #4a5568;
            line-height: 1.6;
        }
        .help-section ul { padding-left: 16px; }
        .help-section li { margin-bottom: 4px; }
        .help-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.68rem;
            font-weight: 600;
        }
        .help-badge.small { background: #d4edda; color: #155724; }
        .help-badge.large { background: #cce5ff; color: #004085; }

        .help-search input {
            width: 100%;
            border: 1px solid #d0d5dd;
            border-radius: 10px;
            padding: 10px 12px;
            font-size: 0.84rem;
            outline: none;
            transition: border-color 0.15s, box-shadow 0.15s;
        }
        .help-search input:focus {
            border-color: var(--brand-primary);
            box-shadow: 0 0 0 3px rgba(0, 36, 102, 0.08);
        }
        .help-filter-bar {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            padding: 10px 16px;
            border-bottom: 1px solid #e0e4e8;
            background: #fff;
        }
        .help-filter-btn {
            border: 1px solid #d0d7e2;
            background: #f8fafc;
            color: #536273;
            border-radius: 999px;
            padding: 6px 11px;
            font-size: 0.74rem;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s, color 0.15s;
        }
        .help-filter-btn:hover {
            border-color: #a9b8ca;
            color: #2f4053;
        }
        .help-filter-btn.active {
            background: var(--brand-primary);
            border-color: var(--brand-primary);
            color: #fff;
        }
        .help-result-summary {
            margin-bottom: 14px;
            padding: 13px 14px;
            border-radius: 12px;
            border: 1px solid #dbe5ef;
            background: linear-gradient(180deg, #fbfdff 0%, #f2f7fb 100%);
        }
        .help-result-summary.help-result-focused {
            background: linear-gradient(180deg, #f4f8fc 0%, #edf4fb 100%);
            border-color: #d1dfef;
        }
        .help-result-title {
            font-size: 0.84rem;
            font-weight: 700;
            color: #223447;
        }
        .help-result-text {
            margin-top: 6px;
            font-size: 0.76rem;
            line-height: 1.55;
            color: #5d6d7e;
        }
        .help-search-suggestions,
        .help-related-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
        }
        .help-suggestion-chip,
        .help-link-chip {
            border: 1px solid #d8e0ea;
            background: #fff;
            color: #2f4e74;
            border-radius: 999px;
            padding: 6px 10px;
            font-size: 0.73rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s, color 0.15s;
        }
        .help-suggestion-chip:hover,
        .help-link-chip:hover {
            background: #eef5ff;
            border-color: #a9c1e0;
            color: #173f74;
        }

        /* FAQ-Akkordeon */
        .faq-category { margin-bottom: 16px; }
        .faq-category-focused { margin-bottom: 0; }
        .faq-category-title {
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--brand-primary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 6px;
            padding: 0 4px;
        }
        .faq-item {
            background: #f7f9fc;
            border: 1px solid #e0e4e8;
            border-radius: 8px;
            margin-bottom: 8px;
            overflow: hidden;
        }
        .faq-question {
            width: 100%;
            border: none;
            background: transparent;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 4px;
            font-size: 0.8rem;
            font-weight: 500;
            color: #2c3e50;
            padding: 10px 14px;
            cursor: pointer;
            position: relative;
            padding-right: 30px;
            text-align: left;
        }
        .faq-question-main {
            display: block;
            font-size: 0.84rem;
            font-weight: 700;
            line-height: 1.45;
            color: #223447;
        }
        .faq-question-sub {
            display: block;
            font-size: 0.75rem;
            font-weight: 400;
            line-height: 1.5;
            color: #66788a;
        }
        .faq-question::after {
            content: '▸';
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            transition: transform 0.15s;
            color: #9ca3af;
        }
        .faq-item.open .faq-question::after { transform: translateY(-50%) rotate(90deg); }
        .faq-answer {
            display: none;
            padding: 0 14px 12px;
            font-size: 0.78rem;
            color: #4a5568;
            line-height: 1.6;
            border-top: 1px solid #e5ebf1;
        }
        .faq-item.open .faq-answer { display: block; }
        .faq-answer ul, .faq-answer ol { padding-left: 16px; margin: 4px 0; }
        .faq-answer li { margin-bottom: 3px; }
        .faq-badge-row {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin: 10px 0 8px;
        }
        .faq-badge {
            display: inline-flex;
            align-items: center;
            border-radius: 999px;
            padding: 3px 8px;
            font-size: 0.68rem;
            font-weight: 700;
            letter-spacing: 0.02em;
            background: #eef2f6;
            color: #4f6071;
        }
        .faq-badge.all { background: #edf2ff; color: #425897; }
        .faq-badge.users { background: #e7f4ec; color: #1f6a41; }
        .faq-badge.admins { background: #fff4dc; color: #8b5d00; }
        .faq-badge.impact { background: #e7eefb; color: #214b87; }
        .faq-badge.problem { background: #fdeceb; color: #a33a38; }
        .faq-badge.start { background: #fff2e2; color: #9a4d12; }
        .faq-summary {
            margin-bottom: 10px;
            color: #415365;
        }
        .help-topic-section { margin-top: 10px; }
        .help-topic-title {
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #697b8f;
            margin-bottom: 4px;
        }
        .help-related {
            margin-top: 12px;
            padding-top: 10px;
            border-top: 1px dashed #d7e0e8;
        }

        /* ============================================
           PANEL: DASHBOARD
           ============================================ */
        .dash-panel { padding: 16px; overflow-y: auto; flex: 1; }
        .dash-panel h3 { font-size: 0.95rem; color: var(--brand-primary); margin-bottom: 12px; }
        .dash-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 18px;
        }
        .dash-card {
            background: #f7f9fc;
            border: 1px solid #e0e4e8;
            border-radius: 10px;
            padding: 14px;
            text-align: center;
        }
        .dash-card-icon { font-size: 1.4rem; margin-bottom: 4px; }
        .dash-card-value { font-size: 1.3rem; font-weight: 700; color: var(--brand-primary); }
        .dash-card-label { font-size: 0.7rem; color: #6b7b8d; margin-top: 2px; }
        .dash-card.wide { grid-column: 1 / -1; }

        /* ============================================
           PANEL: EINSTELLUNGEN
           ============================================ */
        .settings-panel { padding: 16px; overflow-y: auto; flex: 1; }
        .settings-panel h3 { font-size: 0.95rem; color: var(--brand-primary); margin-bottom: 12px; }
        .settings-group {
            margin-bottom: 16px;
            background: #f7f9fc;
            border-radius: 10px;
            padding: 14px;
            border: 1px solid #e0e4e8;
        }
        .settings-group label {
            display: block;
            font-size: 0.8rem;
            font-weight: 600;
            color: #2c3e50;
            margin-bottom: 6px;
        }
        .settings-group select, .settings-group input {
            width: 100%;
            padding: 8px 10px;
            border: 1px solid #d0d5dd;
            border-radius: 8px;
            font-size: 0.82rem;
            outline: none;
        }
        .settings-group select:focus, .settings-group input:focus { border-color: var(--brand-primary); }
        .settings-group .settings-hint {
            font-size: 0.7rem;
            color: #6b7b8d;
            margin-top: 4px;
        }
        .settings-save-btn {
            background: var(--brand-primary);
            color: #fff;
            border: none;
            padding: 8px 20px;
            border-radius: 8px;
            font-size: 0.82rem;
            cursor: pointer;
            transition: background 0.15s;
        }
        .settings-save-btn:hover { background: #002266; }
        .settings-save-btn:disabled {
            opacity: 0.72;
            cursor: not-allowed;
        }
        .settings-save-btn.is-loading {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            cursor: wait;
        }
        .settings-save-btn .settings-btn-spinner {
            display: none;
            width: 12px;
            height: 12px;
            border: 2px solid rgba(255, 255, 255, 0.35);
            border-top-color: #ffffff;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            flex: 0 0 auto;
        }
        .settings-save-btn.is-loading .settings-btn-spinner {
            display: inline-block;
        }
        .settings-hint.is-loading {
            color: var(--brand-primary);
            font-weight: 600;
        }

        /* ============================================
           PANEL: CHAT-VERLAUF (links)
           ============================================ */
        .history-panel { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
        .history-panel-header {
            padding: 16px;
            border-bottom: 1px solid #e0e4e8;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .history-panel-header h3 { font-size: 0.95rem; color: var(--brand-primary); margin: 0; }
        .history-panel-list { flex: 1; overflow-y: auto; padding: 8px; }
        .btn-organize {
            display: flex;
            align-items: center;
            gap: 4px;
            background: rgba(139, 94, 60, 0.08);
            color: var(--brand-primary);
            border: 1px solid rgba(139, 94, 60, 0.2);
            border-radius: 6px;
            padding: 4px 10px;
            font-size: 0.72rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }
        .btn-organize:hover {
            background: rgba(139, 94, 60, 0.15);
            border-color: var(--brand-primary);
        }
        .btn-organize-icon { font-size: 0.8rem; }

        /* Visibility Toggle Buttons */
        .btn-vis {
            flex: 1;
            padding: 6px 10px;
            border: 1px solid #dfe3e8;
            border-radius: 8px;
            background: #f8f9fa;
            color: #6b7b8d;
            font-size: 0.78rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
        }
        .btn-vis:hover {
            border-color: var(--brand-primary);
            color: var(--brand-primary);
        }
        .btn-vis.active {
            background: rgba(139, 94, 60, 0.12);
            border-color: var(--brand-primary);
            color: var(--brand-primary);
        }

        /* Upload-Zone */
        .upload-zone {
            border: 2px dashed rgba(139, 94, 60, 0.25);
            border-radius: 8px;
            padding: 16px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
            margin-bottom: 12px;
            background: #f7f9fc;
        }
        .upload-zone:hover, .upload-zone.dragover {
            border-color: var(--brand-primary);
            background: rgba(139, 94, 60, 0.04);
        }
        .upload-zone p { font-size: 0.8rem; color: #6b7b8d; }
        .upload-zone .icon { font-size: 1.5rem; margin-bottom: 4px; }

        .upload-input { display: none; }

        /* URL-Eingabe */
        .url-input-group {
            display: flex; gap: 8px;
        }
        .url-input-group input {
            flex: 1;
            padding: 8px 12px;
            border-radius: 6px;
            border: 1px solid #d0d5dd;
            background: #ffffff;
            color: #2c3e50;
            font-size: 0.85rem;
        }
        .url-input-group input::placeholder { color: #9ca3af; }
        .url-input-group input:focus { outline: none; border-color: var(--brand-primary); }

        .btn {
            padding: 8px 16px;
            border-radius: 6px;
            border: none;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 600;
            transition: all 0.2s;
        }
        .btn-primary { background: var(--brand-primary); color: #ffffff; }
        .btn-primary:hover { background: #002266; }
        .btn-primary:disabled { background: #c0c7d0; color: #8b95a0; cursor: not-allowed; }

        .btn-danger {
            background: transparent;
            color: #e74c3c;
            padding: 4px 8px;
            font-size: 0.8rem;
            border: 1px solid rgba(231, 76, 60, 0.3);
            border-radius: 4px;
        }
        .btn-danger:hover { background: rgba(231, 76, 60, 0.15); }

        /* ============================================
           ORDNER — Sidebar-Elemente entfernt (v2.5)
           folder-bar, folder-tab, source-filter-info,
           doc-search, select-all-btn entfernt
           ============================================ */

        .folder-checkbox {
            width: 14px; height: 14px;
            accent-color: var(--brand-primary);
            cursor: pointer;
            flex-shrink: 0;
            margin: 0;
        }

        .doc-folder-badge {
            font-size: 0.6rem;
            color: var(--brand-primary);
            background: rgba(139, 94, 60, 0.08);
            padding: 1px 5px;
            border-radius: 4px;
            margin-left: 4px;
        }

        .doc-actions {
            display: flex;
            gap: 4px;
            align-items: center;
            flex-shrink: 0;
        }

        .btn-move {
            background: transparent;
            border: 1px solid #d0d5dd;
            color: #6b7b8d;
            padding: 2px 6px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.7rem;
        }
        .btn-move:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

        .btn-preview {
            background: transparent;
            border: 1px solid #d0d5dd;
            color: #6b7b8d;
            padding: 2px 6px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.75rem;
            line-height: 1;
        }
        .btn-preview:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

        .btn-download {
            background: transparent;
            border: 1px solid #d0d5dd;
            color: #6b7b8d;
            padding: 2px 6px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.75rem;
            line-height: 1;
        }
        .btn-download:hover { border-color: var(--brand-primary); color: var(--brand-primary); }

        /* Dokument-Vorschau Overlay */
        .preview-overlay {
            display: none; position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.4);
            z-index: 1050;
            justify-content: center; align-items: center;
        }
        .preview-overlay.active { display: flex; }
        .preview-box {
            background: #ffffff;
            border: 1px solid #e0e4e8;
            border-radius: 16px;
            width: 900px;
            max-width: 95vw;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
        }
        .preview-header {
            padding: 16px 20px;
            border-bottom: 1px solid #e0e4e8;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .preview-header h3 {
            color: var(--brand-primary);
            font-size: 0.95rem;
            margin: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
        }
        .preview-close {
            background: none; border: none; color: #6b7b8d;
            cursor: pointer; font-size: 1.2rem; padding: 4px 8px;
        }
        .preview-close:hover { color: #2c3e50; }
        .preview-body {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
            font-size: 0.85rem;
            color: #4a5568;
            line-height: 1.7;
            white-space: pre-wrap;
            word-wrap: break-word;
        }
        .preview-meta {
            padding: 12px 20px;
            border-top: 1px solid #e0e4e8;
            font-size: 0.72rem;
            color: #6b7b8d;
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
            align-items: center;
        }
        .preview-actions {
            display: flex;
            gap: 6px;
            padding: 10px 20px;
            border-top: 1px solid #e0e4e8;
            background: #fafbfc;
            flex-shrink: 0;
        }
        .preview-action-btn {
            padding: 6px 14px;
            border-radius: 6px;
            border: 1px solid #d0d5dd;
            background: #fff;
            color: #4a5568;
            cursor: pointer;
            font-size: 0.78rem;
            transition: all 0.15s;
        }
        .preview-action-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
        .preview-action-btn.primary {
            background: var(--brand-primary);
            color: #fff;
            border-color: var(--brand-primary);
        }
        .preview-action-btn.primary:hover { background: #002266; }
        .preview-body iframe {
            width: 100%;
            height: 100%;
            border: none;
            min-height: 500px;
        }
        .preview-body.pdf-view {
            padding: 0;
            overflow: hidden;
        }

        /* Tabellen-Viewer */
        .table-viewer-overlay {
            display: none; position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1060;
            justify-content: center; align-items: center;
        }
        .table-viewer-overlay.active { display: flex; }
        .table-viewer-box {
            background: #ffffff;
            border-radius: 16px;
            width: 95vw;
            max-width: 1400px;
            height: 90vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
        }
        .tv-header {
            padding: 14px 20px;
            border-bottom: 1px solid #e0e4e8;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }
        .tv-header h3 {
            color: var(--brand-primary); font-size: 0.95rem; margin: 0;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
        }
        .tv-close {
            background: none; border: none; color: #6b7b8d;
            cursor: pointer; font-size: 1.3rem; padding: 4px 8px;
        }
        .tv-close:hover { color: #2c3e50; }
        .tv-sheet-tabs {
            display: flex; gap: 0; border-bottom: 1px solid #e0e4e8;
            padding: 0 20px; flex-shrink: 0; overflow-x: auto;
        }
        .tv-sheet-tab {
            padding: 8px 16px; cursor: pointer; font-size: 0.8rem;
            color: #6b7b8d; border-bottom: 2px solid transparent;
            white-space: nowrap; transition: all 0.2s;
        }
        .tv-sheet-tab:hover { color: var(--brand-primary); }
        .tv-sheet-tab.active {
            color: var(--brand-primary); border-bottom-color: var(--brand-primary); font-weight: 600;
        }
        .tv-body {
            flex: 1; overflow: auto; position: relative;
        }
        .tv-table-wrap {
            min-width: 100%; display: inline-block;
        }
        .tv-table {
            border-collapse: collapse; width: 100%; font-size: 0.78rem;
        }
        .tv-table th {
            position: sticky; top: 0; z-index: 2;
            background: #f0f3f7; color: var(--brand-primary); font-weight: 600;
            padding: 8px 12px; border: 1px solid #e0e4e8;
            text-align: left; white-space: nowrap; cursor: pointer;
            user-select: none;
        }
        .tv-table th:first-child {
            width: 44px; text-align: center; cursor: default;
        }
        .tv-table th:hover { background: #e2e8f0; }
        .tv-table th.tv-col-selected { background: rgba(139, 94, 60, 0.15); }
        .tv-table td {
            padding: 6px 12px; border: 1px solid #e8ecf0;
            color: #4a5568; max-width: 300px;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
            cursor: cell;
        }
        .tv-table td:first-child {
            width: 44px; text-align: center; color: #9ca3af;
            font-size: 0.7rem; cursor: pointer; background: #fafbfc;
        }
        .tv-table tr:hover td { background: #f7f9fc; }
        .tv-table tr:hover td:first-child { background: #eef1f6; }
        .tv-table td.tv-cell-selected,
        .tv-table td.tv-row-selected {
            background: rgba(139, 94, 60, 0.08) !important;
        }
        .tv-table td.tv-cell-active {
            background: rgba(139, 94, 60, 0.18) !important;
            outline: 2px solid var(--brand-primary);
            outline-offset: -2px;
        }
        .tv-table tr.tv-row-highlight td {
            background: rgba(139, 94, 60, 0.08) !important;
        }
        .tv-table th.tv-col-selected,
        .tv-table td.tv-col-selected {
            background: rgba(139, 94, 60, 0.08) !important;
        }
        .tv-footer {
            padding: 10px 20px;
            border-top: 1px solid #e0e4e8;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
            gap: 12px;
            flex-wrap: wrap;
        }
        .tv-selection-info {
            font-size: 0.78rem; color: #4a5568;
        }
        .tv-pagination {
            display: flex; align-items: center; gap: 8px;
            font-size: 0.78rem; color: #6b7b8d;
        }
        .tv-pagination button {
            padding: 4px 10px; border: 1px solid #d0d5dd;
            border-radius: 6px; background: #fff; cursor: pointer;
            font-size: 0.75rem; color: #4a5568;
        }
        .tv-pagination button:hover:not(:disabled) {
            border-color: var(--brand-primary); color: var(--brand-primary);
        }
        .tv-pagination button:disabled {
            opacity: 0.4; cursor: default;
        }
        .tv-actions {
            display: flex; gap: 8px;
        }
        .tv-actions button {
            padding: 6px 14px; border-radius: 8px; font-size: 0.78rem;
            cursor: pointer; border: 1px solid #d0d5dd;
            background: #fff; color: #4a5568; transition: all 0.2s;
        }
        .tv-actions button:hover {
            border-color: var(--brand-primary); color: var(--brand-primary);
        }
        .tv-actions button.tv-btn-primary {
            background: var(--brand-primary); color: #fff; border-color: var(--brand-primary);
        }
        .tv-actions button.tv-btn-primary:hover {
            background: #002266;
        }
        .tv-no-data {
            padding: 60px 20px; text-align: center; color: #9ca3af;
            font-size: 0.9rem;
        }

        /* ============================================
           POPUP OVERLAYS (Upload, History, GDrive, Help, Settings)
           ============================================ */
        .popup-overlay {
            display: none; position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.4);
            z-index: 1060;
            justify-content: center; align-items: center;
            animation: fadeIn 0.15s ease;
        }
        .popup-overlay.active { display: flex; }
        .popup-box {
            background: #ffffff;
            border-radius: 16px;
            width: 580px;
            max-width: 95vw;
            max-height: 88vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
            animation: slideUp 0.2s ease;
        }
        .popup-box-tall {
            height: 75vh;
        }
        .popup-header {
            padding: 16px 24px;
            border-bottom: 1px solid #e0e4e8;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
            background: #fafbfc;
        }
        .popup-header h3 {
            color: var(--brand-primary); font-size: 1.05rem; margin: 0; font-weight: 700;
        }
        .popup-close {
            background: none; border: none; color: #6b7b8d;
            cursor: pointer; font-size: 1.5rem; padding: 4px 8px;
            line-height: 1; border-radius: 6px; transition: all 0.15s;
        }
        .popup-close:hover { color: #2c3e50; background: #f0f2f5; }
        .popup-body {
            flex: 1; overflow-y: auto;
        }

        /* ============================================
           QUELLEN-MANAGER (Vollbild-Overlay)
           ============================================ */
        .sm-overlay {
            display: none; position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1070;
            justify-content: center; align-items: center;
            animation: fadeIn 0.15s ease;
        }
        .sm-overlay.active { display: flex; }
        .sm-box {
            background: #ffffff;
            border-radius: 16px;
            width: 96vw;
            max-width: 1500px;
            height: 92vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
            animation: slideUp 0.2s ease;
        }
        .sm-header {
            padding: 16px 24px;
            border-bottom: 1px solid #e0e4e8;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
            background: #fafbfc;
        }
        .sm-header-left {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        .sm-header h3 {
            color: var(--brand-primary); font-size: 1.1rem; margin: 0; font-weight: 700;
        }
        .sm-header-stats {
            font-size: 0.78rem; color: #6b7b8d;
        }
        .sm-header-actions {
            display: flex; gap: 8px; align-items: center;
        }
        .sm-close {
            background: none; border: none; color: #6b7b8d;
            cursor: pointer; font-size: 1.5rem; padding: 4px 8px;
            line-height: 1;
        }
        .sm-close:hover { color: #2c3e50; }
        .sm-upload-btn {
            display: flex; align-items: center; gap: 4px;
            background: rgba(139, 94, 60, 0.08);
            color: var(--brand-primary); border: 1px solid rgba(139, 94, 60, 0.2);
            border-radius: 8px; padding: 6px 14px;
            font-size: 0.78rem; font-weight: 600;
            cursor: pointer; transition: all 0.2s;
        }
        .sm-upload-btn:hover {
            background: rgba(139, 94, 60, 0.15);
            border-color: var(--brand-primary);
        }
        .sm-overlay[data-mode="personal"] .sm-header { border-bottom-color: rgba(139, 94, 60, 0.3); }

        .sm-body {
            flex: 1;
            display: flex;
            overflow: hidden;
        }

        /* Left sidebar: folders (resizable) */
        .sm-folders {
            width: 280px;
            min-width: 180px;
            max-width: 500px;
            border-right: none;
            display: flex;
            flex-direction: column;
            background: #fafbfc;
            flex-shrink: 0;
        }
        /* Draggable resize handle between sidebar and content */
        .sm-resizer {
            width: 4px;
            cursor: col-resize;
            background: #e0e4e8;
            flex-shrink: 0;
            position: relative;
            transition: background 0.15s;
            z-index: 2;
        }
        .sm-resizer:hover,
        .sm-resizer.active {
            background: var(--brand-primary, #8B5E3C);
        }
        .sm-resizer::before {
            content: '';
            position: absolute;
            top: 0; bottom: 0;
            left: -3px; right: -3px;
        }
        .sm-folders-header {
            padding: 12px 16px;
            font-size: 0.78rem;
            font-weight: 600;
            color: #6b7b8d;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 1px solid #e0e4e8;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .sm-add-folder-btn {
            background: rgba(139, 94, 60, 0.08);
            border: 1px solid rgba(139, 94, 60, 0.2);
            color: var(--brand-primary);
            border-radius: 4px;
            padding: 2px 8px;
            cursor: pointer;
            font-size: 0.75rem;
            font-weight: 600;
        }
        .sm-add-folder-btn:hover { background: rgba(139, 94, 60, 0.15); }
        .sm-folder-list {
            flex: 1;
            overflow-y: auto;
            padding: 8px;
        }
        .sm-folder-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 5px 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.82rem;
            color: #4a5568;
            transition: all 0.12s;
            margin-bottom: 1px;
            border: 1px solid transparent;
        }
        .sm-folder-item:hover { background: rgba(0,0,0,0.04); }
        .sm-folder-item.active {
            background: rgba(139, 94, 60, 0.1);
            color: var(--brand-primary);
            font-weight: 600;
        }
        .sm-folder-item-left {
            display: flex; align-items: center; gap: 8px;
            min-width: 0; flex: 1;
        }
        .sm-folder-item-icon { font-size: 1rem; flex-shrink: 0; }
        .sm-folder-item-name {
            overflow: hidden; text-overflow: ellipsis;
            display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
            word-break: break-word; line-height: 1.3;
        }
        .sm-folder-item-count {
            font-size: 0.7rem; color: #9ca3af; flex-shrink: 0;
            background: #eef1f6; border-radius: 10px; padding: 1px 7px;
        }
        .sm-folder-item.active .sm-folder-item-count {
            background: rgba(139, 94, 60, 0.15); color: var(--brand-primary);
        }
        .sm-folder-item-actions {
            display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s;
        }
        .sm-folder-item:hover .sm-folder-item-actions { opacity: 1; }
        .sm-folder-item-actions button {
            background: none; border: none; cursor: pointer;
            color: #9ca3af; font-size: 0.8rem; padding: 2px 4px;
        }
        .sm-folder-item-actions button:hover { color: #e74c3c; }

        /* Explorer-style tree (Windows-like) */
        .sm-tree-arrow {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 20px;
            height: 20px;
            font-size: 0.5rem;
            color: #8896a6;
            cursor: pointer;
            border-radius: 3px;
            flex-shrink: 0;
            transition: all 0.1s ease;
            user-select: none;
        }
        .sm-tree-arrow:hover {
            background: rgba(0,0,0,0.07);
            color: #4a5568;
        }
        .sm-tree-arrow-open {
            color: var(--brand-primary);
            transform: rotate(0deg);
        }
        .sm-tree-arrow-hidden {
            visibility: hidden;
        }
        .sm-tree-leaf {
            width: 20px;
            visibility: hidden;
        }
        .sm-tree-node {
            position: relative;
        }
        /* Windows-style tree connector lines */
        .sm-tree-node::before {
            content: '';
            position: absolute;
            left: calc(var(--tree-indent, 32px) - 10px);
            top: 0;
            height: 100%;
            width: 1px;
            background: #dde1e6;
            pointer-events: none;
        }
        .sm-tree-node:last-child::before {
            height: 50%;
        }
        .sm-tree-divider {
            height: 1px;
            background: #e0e4e8;
            margin: 6px 8px;
        }
        .sm-tree-empty {
            padding: 16px 12px;
            font-size: 0.75rem;
            color: #9ca3af;
            text-align: center;
            line-height: 1.5;
        }
        /* Windows-style folder icon (SVG inline) */
        .sm-folder-icon-svg {
            width: 16px; height: 16px;
            flex-shrink: 0;
        }
        /* Dragging state for folders */
        .sm-folder-item.dragging {
            opacity: 0.5;
        }
        .sm-folder-item.drop-target-above {
            border-top: 2px solid var(--brand-primary);
        }

        /* Section headers (Firmen-Dokumente / Meine Dokumente) */
        .sm-section-header {
            display: flex;
            align-items: center;
            padding: 8px 12px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.82rem;
            font-weight: 700;
            color: #4a5568;
            transition: all 0.15s;
            margin-bottom: 2px;
            gap: 2px;
        }
        .sm-section-header:hover { background: #eef1f6; }
        .sm-section-header.active {
            background: rgba(139, 94, 60, 0.1);
            color: var(--brand-primary);
        }
        .sm-section-arrow {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            font-size: 0.55rem;
            color: #8896a6;
            cursor: pointer;
            border-radius: 4px;
            flex-shrink: 0;
            transition: all 0.12s;
            user-select: none;
        }
        .sm-section-arrow:hover {
            background: rgba(0,0,0,0.06);
            color: #4a5568;
        }
        .sm-section-icon {
            font-size: 1rem;
            flex-shrink: 0;
            margin-right: 6px;
        }
        .sm-section-label {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            word-break: break-word;
        }
        .sm-section-child {
            padding-left: 32px;
        }

        /* Right content: documents */
        .sm-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .sm-toolbar {
            padding: 12px 20px;
            border-bottom: 1px solid #e0e4e8;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            flex-shrink: 0;
            flex-wrap: wrap;
        }
        .sm-toolbar-left {
            display: flex; gap: 8px; align-items: center;
        }
        .sm-toolbar-right {
            display: flex; gap: 8px; align-items: center;
        }
        .sm-search-input {
            padding: 6px 12px;
            border-radius: 6px;
            border: 1px solid #d0d5dd;
            background: #f7f9fc;
            color: #2c3e50;
            font-size: 0.82rem;
            outline: none;
            width: 240px;
        }
        .sm-search-input:focus { border-color: var(--brand-primary); }
        .sm-search-input::placeholder { color: #9ca3af; }
        .sm-sort-select {
            padding: 6px 10px;
            border-radius: 6px;
            border: 1px solid #d0d5dd;
            background: #fff;
            font-size: 0.8rem;
            color: #4a5568;
            cursor: pointer;
        }
        .sm-sort-select:focus { outline: none; border-color: var(--brand-primary); }
        .sm-view-toggle {
            display: flex; border: 1px solid #d0d5dd; border-radius: 6px; overflow: hidden;
        }
        .sm-view-btn {
            background: #fff; border: none; padding: 5px 10px;
            cursor: pointer; font-size: 0.82rem; color: #6b7b8d;
            transition: all 0.15s;
        }
        .sm-view-btn.active {
            background: var(--brand-primary); color: #fff;
        }
        .sm-view-btn:not(.active):hover { background: #f0f3f7; }
        .sm-bulk-actions {
            display: flex; gap: 6px; align-items: center;
        }
        .sm-bulk-btn {
            padding: 5px 12px;
            border-radius: 6px;
            border: 1px solid #d0d5dd;
            background: #fff;
            font-size: 0.78rem;
            cursor: pointer;
            color: #4a5568;
            transition: all 0.15s;
        }
        .sm-bulk-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
        .sm-bulk-btn.danger { color: #e74c3c; border-color: rgba(231,76,60,0.3); }
        .sm-bulk-btn.danger:hover { background: rgba(231,76,60,0.08); border-color: #e74c3c; }
        .sm-select-all-label {
            font-size: 0.78rem; color: #6b7b8d; display: flex;
            align-items: center; gap: 4px; cursor: pointer;
        }
        .sm-select-all-label input { accent-color: var(--brand-primary); cursor: pointer; }

        /* Document grid */
        .sm-doc-area {
            flex: 1; overflow-y: auto; padding: 16px 20px;
        }
        .sm-doc-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 12px;
        }
        .sm-doc-card {
            background: #f7f9fc;
            border: 1px solid #e0e4e8;
            border-radius: 10px;
            padding: 14px;
            transition: all 0.2s;
            cursor: default;
            position: relative;
        }
        .sm-doc-card:hover { border-color: #b0b8c8; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
        .sm-doc-card.selected {
            border-color: rgba(139, 94, 60, 0.5);
            background: rgba(139, 94, 60, 0.04);
        }
        .sm-doc-card.just-uploaded {
            border-color: #2ecc71;
            background: rgba(46, 204, 113, 0.06);
            animation: pulseNew 1.5s ease 2;
        }
        .sm-doc-card.just-uploaded::after {
            content: 'NEU';
            position: absolute;
            top: 8px;
            right: 8px;
            background: #2ecc71;
            color: #fff;
            font-size: 0.6rem;
            font-weight: 700;
            padding: 2px 6px;
            border-radius: 4px;
        }
        @keyframes pulseNew {
            0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
            50% { box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.2); }
        }
        .sm-doc-card-header {
            display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px;
        }
        .sm-doc-card-checkbox {
            margin-top: 2px; accent-color: var(--brand-primary); cursor: pointer; flex-shrink: 0;
        }
        .sm-doc-card-icon {
            font-size: 1.6rem; flex-shrink: 0;
        }
        .sm-doc-card-info { flex: 1; min-width: 0; }
        .sm-doc-card-name {
            font-size: 0.85rem; font-weight: 600; color: #2c3e50;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            margin-bottom: 2px;
        }
        .sm-doc-card-meta {
            font-size: 0.7rem; color: #9ca3af;
        }
        .sm-doc-card-folder-badge {
            display: inline-block;
            background: rgba(139, 94, 60, 0.08);
            color: var(--brand-primary);
            font-size: 0.65rem;
            padding: 1px 6px;
            border-radius: 4px;
            margin-top: 4px;
        }
        .sm-doc-card-actions {
            display: flex; gap: 4px; margin-top: 10px;
            padding-top: 10px; border-top: 1px solid #e8ecf0;
        }
        .sm-doc-card-actions button {
            flex: 1;
            padding: 5px 0;
            border: 1px solid #e0e4e8;
            background: #fff;
            border-radius: 6px;
            font-size: 0.72rem;
            cursor: pointer;
            color: #6b7b8d;
            transition: all 0.15s;
        }
        .sm-doc-card-actions button:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
        .sm-doc-card-actions button.danger:hover { border-color: #e74c3c; color: #e74c3c; }

        /* Document list view */
        .sm-doc-list { display: flex; flex-direction: column; gap: 4px; }
        .sm-doc-row {
            display: flex;
            align-items: center;
            padding: 10px 14px;
            background: #f7f9fc;
            border: 1px solid #e0e4e8;
            border-radius: 8px;
            gap: 12px;
            transition: all 0.15s;
        }
        .sm-doc-row:hover { background: #eef1f6; }
        .sm-doc-row.selected {
            border-color: rgba(139, 94, 60, 0.5);
            background: rgba(139, 94, 60, 0.04);
        }
        .sm-doc-row-checkbox { accent-color: var(--brand-primary); cursor: pointer; flex-shrink: 0; }
        .sm-doc-row-icon { font-size: 1.1rem; flex-shrink: 0; }
        .sm-doc-row-name {
            flex: 1; font-size: 0.82rem; font-weight: 500;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            min-width: 0;
        }
        .sm-doc-row-type {
            font-size: 0.72rem; color: #9ca3af; width: 50px; text-align: center;
            flex-shrink: 0;
        }
        .sm-doc-row-chunks {
            font-size: 0.72rem; color: #9ca3af; width: 70px; text-align: center;
            flex-shrink: 0;
        }
        .sm-doc-row-folder {
            font-size: 0.68rem; color: var(--brand-primary); width: 100px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            flex-shrink: 0;
        }
        .sm-doc-row-actions {
            display: flex; gap: 4px; flex-shrink: 0;
        }
        .sm-doc-row-actions button {
            padding: 4px 8px;
            border: 1px solid #e0e4e8;
            background: #fff;
            border-radius: 4px;
            font-size: 0.7rem;
            cursor: pointer;
            color: #6b7b8d;
            transition: all 0.15s;
        }
        .sm-doc-row-actions button:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
        .sm-doc-row-actions button.danger:hover { border-color: #e74c3c; color: #e74c3c; }

        .sm-empty {
            text-align: center; padding: 60px 20px; color: #9ca3af;
            font-size: 0.9rem;
        }
        .sm-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

        /* Drop zone highlight */
        .sm-folder-item.drop-target {
            background: rgba(139, 94, 60, 0.15);
            border: 1px dashed var(--brand-primary);
        }
        .sm-doc-card.dragging, .sm-doc-row.dragging {
            opacity: 0.5;
        }

        /* Footer (v2.5: mit Chat-Auswahl-Steuerung) */
        .sm-footer {
            padding: 10px 20px;
            border-top: 1px solid #e0e4e8;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
            font-size: 0.78rem;
            color: #6b7b8d;
            background: #fafbfc;
            gap: 12px;
        }
        .sm-footer-left {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .sm-footer-right {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .sm-footer-btn {
            background: transparent;
            border: 1px solid #d0d5dd;
            padding: 3px 10px;
            border-radius: 5px;
            font-size: 0.72rem;
            cursor: pointer;
            color: #4a5568;
            transition: all 0.15s;
        }
        .sm-footer-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
        .sm-footer-divider { color: #d0d5dd; }
        .sm-footer-done-btn {
            background: var(--brand-primary);
            color: #fff;
            border: none;
            padding: 5px 16px;
            border-radius: 6px;
            font-size: 0.78rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.15s;
        }
        .sm-footer-done-btn:hover { background: var(--brand-primary-hover); }

        /* Chat-aktiv Checkbox im Ordnerbaum (v2.5.1) */
        .sm-folder-chat-cb {
            width: 13px; height: 13px;
            accent-color: var(--brand-primary);
            cursor: pointer;
            flex-shrink: 0;
            margin: 0 2px 0 0;
        }
        .sm-section-header .sm-folder-chat-cb {
            margin: 0 4px 0 0;
        }

        /* Inline-Aktionen an Ordnern (+ und ×) */
        .sm-folder-item-actions button:first-child {
            color: var(--brand-primary);
            font-size: 1rem;
            font-weight: 700;
        }
        .sm-folder-item-actions button:first-child:hover { color: var(--brand-primary-hover); }

        /* Dokumentenliste — Sidebar entfernt (v2.5) */

        /* ============================================
           CHAT BEREICH (mit optionaler rechter Sidebar)
           ============================================ */
        .chat-wrapper {
            flex: 1;
            display: flex;
            overflow: hidden;
            min-width: 0;
        }
        .chat-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            min-width: 0;
        }

        /* Chat-Header (schlank: Titel + Buttons) */
        .chat-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 20px;
            border-bottom: 1px solid #e0e4e8;
            background: #ffffff;
            flex-shrink: 0;
        }
        .chat-header-left {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .chat-title {
            font-size: 0.9rem;
            font-weight: 600;
            color: #2c3e50;
            max-width: 400px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .chat-header-actions {
            display: flex;
            gap: 6px;
            align-items: center;
        }
        .chat-header-btn {
            padding: 6px 12px;
            border-radius: 6px;
            border: 1px solid #d0d5dd;
            background: transparent;
            color: #4a5568;
            cursor: pointer;
            font-size: 0.78rem;
            transition: all 0.15s;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .chat-header-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
        .chat-header-btn.active { border-color: var(--brand-primary); color: var(--brand-primary); background: rgba(139, 94, 60, 0.06); }
        .chat-header-btn.new-chat { border-color: rgba(139, 94, 60, 0.4); color: var(--brand-primary); }
        .chat-header-btn.new-chat:hover { background: rgba(139, 94, 60, 0.06); }

        /* ============================================
           QUELLEN-LEISTE (Source Bar) im Chat
           ============================================ */
        .source-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 7px 20px;
            background: #f7f9fc;
            border-bottom: 1px solid #e0e4e8;
            cursor: pointer;
            flex-shrink: 0;
            user-select: none;
            transition: background 0.15s;
        }
        .source-bar.hidden-in-welcome {
            display: none;
        }
        .source-bar:hover { background: #eef1f6; }
        .source-bar-label {
            font-size: 0.78rem;
            color: #4a5568;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .source-bar-label strong { color: var(--brand-primary); }
        .source-bar-toggle {
            font-size: 0.7rem;
            color: var(--brand-primary);
            font-weight: 500;
        }

        /* Source-Bar-Dropdown entfernt (v2.5) — alles über Explorer-Overlay */

        /* Modell-Selector (in der Eingabeleiste) */
        .model-select {
            padding: 5px 10px;
            border-radius: 8px;
            border: 1px solid #d0d5dd;
            background: #ffffff;
            color: #2c3e50;
            font-size: 0.78rem;
            cursor: pointer;
            outline: none;
            transition: border-color 0.15s;
            appearance: none;
            -webkit-appearance: none;
            padding-right: 24px;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7b8d'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 8px center;
            flex-shrink: 0;
        }
        .model-select:hover, .model-select:focus { border-color: var(--brand-primary); }
        .model-select option { background: #ffffff; color: #2c3e50; }

        /* ============================================
           CHAT HISTORY SIDEBAR (rechts, ein/ausklappbar)
           ============================================ */
        .chat-history-sidebar {
            width: 0;
            min-width: 0;
            overflow: hidden;
            background: #ffffff;
            border-left: 1px solid #e0e4e8;
            transition: width 0.3s ease, min-width 0.3s ease;
            display: flex;
            flex-direction: column;
        }
        .chat-history-sidebar.open {
            width: 300px;
            min-width: 300px;
        }
        .chat-history-sidebar-header {
            padding: 14px 16px;
            border-bottom: 1px solid #e0e4e8;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }
        .chat-history-sidebar-header h3 {
            font-size: 0.9rem;
            color: var(--brand-primary);
            margin: 0;
        }
        .chat-history-close {
            background: none;
            border: none;
            color: #6b7b8d;
            cursor: pointer;
            font-size: 1.1rem;
            padding: 2px 6px;
            border-radius: 4px;
            transition: all 0.15s;
        }
        .chat-history-close:hover { color: #2c3e50; background: #f0f2f5; }

        .chat-history-list {
            flex: 1;
            overflow-y: auto;
            padding: 8px;
        }
        .chat-history-item {
            display: flex;
            align-items: center;
            padding: 10px 12px;
            border-radius: 8px;
            margin-bottom: 4px;
            cursor: pointer;
            transition: all 0.15s;
            border: 1px solid transparent;
            gap: 10px;
        }
        .chat-history-item:hover { background: #f0f2f5; }
        .chat-history-item.active {
            border-color: rgba(139, 94, 60, 0.3);
            background: rgba(139, 94, 60, 0.05);
        }
        .chat-history-item-info {
            flex: 1;
            min-width: 0;
        }
        .chat-history-item-title {
            font-size: 0.82rem;
            font-weight: 500;
            color: #2c3e50;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .chat-history-item-meta {
            font-size: 0.68rem;
            color: #6b7b8d;
            margin-top: 2px;
        }
        .chat-history-item-delete {
            background: none;
            border: none;
            color: #e74c3c;
            cursor: pointer;
            font-size: 0.75rem;
            opacity: 0;
            transition: opacity 0.15s;
            padding: 4px 6px;
            border-radius: 4px;
        }
        .chat-history-item-actions {
            display: flex;
            gap: 2px;
            opacity: 0;
            transition: opacity 0.15s;
        }
        .chat-history-item-action {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 0.75rem;
            padding: 4px 6px;
            border-radius: 4px;
            color: #6b7b8d;
        }
        .chat-history-item-action:hover { background: rgba(0,0,0,0.08); }
        .chat-history-item:hover .chat-history-item-actions,
        .chat-history-item:hover .chat-history-item-delete { opacity: 1; }
        .chat-history-item-delete:hover { background: rgba(231, 76, 60, 0.15); }
        .chat-history-item.dragging { opacity: 0.4; }

        /* Chat-Ordner */
        .chat-folder { margin-bottom: 4px; }
        .chat-folder-header {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 10px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: 600;
            color: #2c3e50;
            transition: background 0.15s;
        }
        .chat-folder-header:hover { background: #f0f2f5; }
        .chat-folder-toggle { font-size: 0.6rem; color: #6b7b8d; }
        .chat-folder-icon { font-size: 0.9rem; }
        .chat-folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .chat-folder-count {
            font-size: 0.65rem;
            color: #9ca3af;
            background: #f0f2f5;
            padding: 1px 6px;
            border-radius: 8px;
        }
        .chat-folder-actions {
            display: flex;
            gap: 2px;
            opacity: 0;
            transition: opacity 0.15s;
        }
        .chat-folder-header:hover .chat-folder-actions { opacity: 1; }
        .chat-folder-actions button {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 0.75rem;
            padding: 2px 5px;
            border-radius: 4px;
            color: #6b7b8d;
        }
        .chat-folder-actions button:hover { background: rgba(0,0,0,0.08); }
        .chat-folder-body { padding-left: 12px; }
        .chat-folder-empty {
            font-size: 0.72rem;
            color: #b0b8c4;
            padding: 8px 12px;
            text-align: center;
            border: 1px dashed #d0d5dd;
            border-radius: 6px;
            margin: 4px 0;
        }
        .chat-folder-divider {
            font-size: 0.7rem;
            color: #9ca3af;
            font-weight: 600;
            padding: 10px 10px 4px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .folder-drop-target.drag-over {
            background: rgba(139, 94, 60, 0.08);
            border-radius: 8px;
            outline: 2px dashed rgba(139, 94, 60, 0.3);
            outline-offset: -2px;
        }

        /* Lernbox-Liste */
        .lb-category { margin-bottom: 12px; }
        .lb-category-title {
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--brand-primary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 4px;
            padding: 0 4px;
        }
        .lb-entry {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 10px;
            background: #f8f9fa;
            border-radius: 6px;
            font-size: 0.8rem;
            margin-bottom: 3px;
        }
        .lb-entry:hover { background: #f0f2f5; }
        .lb-scope-icon { font-size: 0.72rem; color: #aaa; }
        .lb-from { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .lb-arrow { color: #8896a4; flex-shrink: 0; }
        .lb-to { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .lb-del {
            background: none; border: none; cursor: pointer; color: #c62828;
            font-size: 0.9rem; opacity: 0; transition: opacity 0.15s; padding: 2px 5px; border-radius: 4px;
        }
        .lb-entry:hover .lb-del { opacity: 1; }
        .lb-del:hover { background: rgba(198,40,40,0.1); }

        .chat-history-empty {
            text-align: center;
            padding: 30px 16px;
            color: #9ca3af;
            font-size: 0.8rem;
        }

        /* History search */
        .history-search {
            padding: 8px 12px;
            border-bottom: 1px solid #e0e4e8;
        }
        .history-search input {
            width: 100%;
            padding: 7px 10px;
            border: 1px solid #d0d5dd;
            border-radius: 6px;
            font-size: 0.78rem;
            outline: none;
            transition: border-color 0.15s;
        }
        .history-search input:focus {
            border-color: var(--brand-primary);
        }

        /* Welcome recent chats section */
        .welcome-recent-chats {
            margin-top: 28px;
            text-align: left;
            max-width: 440px;
            margin-left: auto;
            margin-right: auto;
        }
        .welcome-recent-header {
            font-size: 0.78rem;
            font-weight: 600;
            color: #8896a6;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin-bottom: 8px;
            padding-left: 4px;
        }
        .welcome-recent-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 12px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.15s;
            font-size: 0.82rem;
            color: #4a5568;
        }
        .welcome-recent-item:hover {
            background: rgba(139, 94, 60, 0.06);
        }
        .welcome-recent-icon {
            font-size: 0.9rem;
            flex-shrink: 0;
        }
        .welcome-recent-title {
            flex: 1;
            min-width: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .welcome-recent-date {
            font-size: 0.7rem;
            color: #9ca3af;
            flex-shrink: 0;
        }

        /* Improved empty states */
        .empty-state-icon {
            font-size: 2rem;
            margin-bottom: 8px;
            opacity: 0.5;
        }
        .empty-state-hint {
            font-size: 0.75rem;
            color: #8896a6;
            line-height: 1.5;
        }
        .doc-list-empty {
            text-align: center;
            padding: 36px 20px;
            color: #9ca3af;
            font-size: 0.82rem;
            line-height: 1.6;
        }

        /* Onboarding Tour */
        .onboarding-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.35);
            z-index: 10000;
        }
        .onboarding-highlight {
            position: relative;
            z-index: 10001 !important;
            box-shadow: 0 0 0 4px rgba(139, 94, 60, 0.5), 0 0 20px rgba(139, 94, 60, 0.3);
            border-radius: 10px;
        }
        .onboarding-tooltip {
            position: fixed;
            background: #fff;
            border-radius: 12px;
            padding: 18px 20px;
            width: min(360px, calc(100vw - 16px));
            max-width: calc(100vw - 16px);
            min-width: 240px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
            z-index: 10002;
            animation: onboardingFadeIn 0.25s ease-out;
        }
        @keyframes onboardingFadeIn {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .onboarding-title {
            font-size: 0.92rem;
            font-weight: 700;
            color: var(--brand-primary);
            margin-bottom: 6px;
        }
        .onboarding-text {
            font-size: 0.82rem;
            color: #4a5568;
            line-height: 1.5;
            margin-bottom: 14px;
        }
        .onboarding-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
        }
        .onboarding-progress {
            font-size: 0.7rem;
            color: #9ca3af;
        }
        .onboarding-actions {
            display: flex;
            gap: 6px;
        }
        .onboarding-skip {
            border: none;
            background: none;
            color: #9ca3af;
            font-size: 0.75rem;
            cursor: pointer;
            padding: 4px 8px;
        }
        .onboarding-skip:hover { color: #6b7b8d; }
        .onboarding-next {
            border: none;
            background: var(--brand-primary);
            color: #fff;
            font-size: 0.78rem;
            padding: 6px 14px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
        }
        .onboarding-next:hover { background: #7a5235; }

        @media (max-width: 760px) {
            .onboarding-tooltip {
                width: calc(100vw - 24px);
                max-width: calc(100vw - 24px);
                min-width: 0;
                padding: 16px;
            }

            .onboarding-footer {
                flex-direction: column;
                align-items: stretch;
            }

            .onboarding-progress {
                width: 100%;
            }

            .onboarding-actions {
                width: 100%;
                justify-content: flex-end;
            }
        }

        /* Upload visibility hint */
        .upload-vis-hint {
            font-size: 0.72rem;
            color: #6b7b8d;
            padding: 6px 10px;
            background: #f7f9fc;
            border-radius: 6px;
            margin-bottom: 12px;
            border: 1px solid #e8ecf0;
            transition: all 0.2s;
        }

        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 24px 24px 100px 24px;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        .chat-messages:has(.chat-welcome) {
            justify-content: center;
            padding-bottom: 120px;
        }

        .chat-welcome {
            text-align: center;
            padding: 30px 40px 20px;
            color: #6b7b8d;
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
        }
        .chat-welcome h2 {
            font-size: 1.6rem;
            color: var(--brand-primary);
            margin-bottom: 8px;
            font-weight: 700;
            letter-spacing: -0.3px;
        }
        .chat-welcome .welcome-subtitle {
            font-size: 0.85rem;
            color: #8896a6;
            margin-bottom: 28px;
        }
        .chat-welcome .welcome-steps {
            display: flex;
            flex-direction: column;
            gap: 10px;
            text-align: left;
            margin: 0 auto;
            max-width: 440px;
        }
        .chat-welcome .welcome-step {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            font-size: 0.88rem;
            line-height: 1.5;
            color: #5a6b7d;
        }
        .chat-welcome .welcome-step-num {
            flex-shrink: 0;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: var(--brand-primary);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            font-weight: 700;
            margin-top: 1px;
        }
        .chat-welcome p { font-size: 0.95rem; line-height: 1.6; }

        /* Source-Bar im Welcome-Zustand inline */
        .welcome-source-bar {
            margin-top: 28px;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 20px;
            background: #f0f3f8;
            border: 1px solid #dce1e9;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.15s;
            font-size: 0.82rem;
            color: #4a5568;
            user-select: none;
        }
        .welcome-source-bar:hover {
            background: #e6eaf2;
            border-color: var(--brand-primary);
        }
        .welcome-source-bar strong { color: var(--brand-primary); }
        .welcome-source-bar .source-icon {
            font-size: 1rem;
        }

        /* Startbildschirm: Action Cards */
        .welcome-actions {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 14px;
            max-width: 440px;
            margin: 0 auto 24px;
        }
        @media (min-width: 640px) {
            .welcome-actions {
                grid-template-columns: repeat(4, 1fr);
                max-width: 600px;
            }
        }
        .welcome-action-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
            padding: 22px 12px 18px;
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 14px;
            cursor: pointer;
            transition: all 0.18s ease;
            user-select: none;
        }
        .welcome-action-card:hover {
            border-color: var(--brand-primary);
            background: var(--brand-soft-bg, #f4f0ec);
            transform: translateY(-2px);
            box-shadow: 0 4px 16px rgba(0,0,0,0.07);
        }
        .welcome-action-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 48px;
            height: 48px;
            border-radius: 12px;
            background: var(--brand-soft-bg, #f4f0ec);
            color: var(--brand-primary);
            transition: background 0.18s;
        }
        .welcome-action-card:hover .welcome-action-icon {
            background: var(--brand-primary);
            color: var(--brand-on-primary, #fff);
        }
        .welcome-action-icon svg {
            stroke: currentColor;
        }
        .welcome-action-label {
            font-size: 0.82rem;
            font-weight: 600;
            color: #4a5568;
            text-align: center;
            line-height: 1.3;
        }
        .welcome-action-card:hover .welcome-action-label {
            color: var(--brand-primary);
        }

        /* Nachrichten */
        .message {
            max-width: 85%;
            padding: 14px 18px;
            border-radius: 12px;
            font-size: 0.9rem;
            line-height: 1.7;
        }
        .message.user {
            align-self: flex-end;
            background: var(--brand-primary);
            color: #ffffff;
            border-bottom-right-radius: 4px;
        }
        .message.assistant {
            align-self: flex-start;
            background: #ffffff;
            border: 1px solid #e0e4e8;
            border-bottom-left-radius: 4px;
            color: #2c3e50;
        }

        /* Markdown-Rendering in Nachrichten */
        .message.assistant h1, .message.assistant h2, .message.assistant h3 {
            color: var(--brand-primary);
            margin: 12px 0 6px 0;
        }
        .message.assistant h1 { font-size: 1.15rem; }
        .message.assistant h2 { font-size: 1.05rem; }
        .message.assistant h3 { font-size: 0.95rem; }

        .message.assistant p { margin-bottom: 8px; }

        .message.assistant ul, .message.assistant ol {
            margin: 8px 0 8px 20px;
            padding-left: 0;
        }
        .message.assistant li {
            margin-bottom: 4px;
            line-height: 1.6;
        }

        .message.assistant strong { color: var(--brand-primary); }

        .message.assistant code {
            background: #f0f2f5;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 0.85rem;
            font-family: 'Consolas', monospace;
            color: #c7254e;
        }

        .message.assistant pre {
            background: #f7f9fc;
            padding: 12px;
            border-radius: 8px;
            overflow-x: auto;
            margin: 8px 0;
            border: 1px solid #e0e4e8;
        }
        .message.assistant pre code {
            background: none;
            padding: 0;
        }

        .message.assistant blockquote {
            border-left: 3px solid var(--brand-primary);
            padding-left: 12px;
            margin: 8px 0;
            color: #6b7b8d;
            font-style: italic;
        }

        .message.assistant hr {
            border: none;
            border-top: 1px solid #e0e4e8;
            margin: 12px 0;
        }

        .message.assistant table {
            border-collapse: collapse;
            margin: 8px 0;
            width: 100%;
        }
        .message.assistant th, .message.assistant td {
            border: 1px solid #e0e4e8;
            padding: 6px 10px;
            text-align: left;
            font-size: 0.85rem;
        }
        .message.assistant th { background: rgba(139, 94, 60, 0.06); color: var(--brand-primary); }

        .message-sources {
            margin-top: 12px;
            padding-top: 10px;
            border-top: 1px solid #e0e4e8;
            font-size: 0.75rem;
            color: #6b7b8d;
        }
        .message-sources .source-tag {
            display: inline-block;
            background: rgba(139, 94, 60, 0.06);
            border: 1px solid rgba(139, 94, 60, 0.15);
            color: var(--brand-primary);
            padding: 2px 8px;
            border-radius: 12px;
            margin: 2px 4px 2px 0;
            font-size: 0.7rem;
        }

        /* Warn-Banner: Keine passenden Quellen gefunden */
        .message-no-sources-banner {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 14px;
            padding: 10px 14px;
            background: #fff8e1;
            border: 1px solid #ffe082;
            border-radius: 10px;
            font-size: 0.82rem;
            color: #795548;
        }
        .message-no-sources-banner .no-sources-icon {
            font-size: 1.1rem;
            flex-shrink: 0;
        }

        /* Quellen-Header oben in der Nachricht (NotebookLM-Stil) */
        .message-sources-header {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 6px;
            margin-bottom: 14px;
            padding-bottom: 10px;
            border-bottom: 1px solid #e0e4e8;
            font-size: 0.8rem;
            color: #6b7b8d;
        }
        .message-sources-header .sources-icon {
            font-size: 1rem;
        }
        .message-sources-header strong {
            color: var(--brand-primary);
            font-weight: 600;
            margin-right: 4px;
        }
        .message-sources-header .source-tag {
            display: inline-block;
            background: rgba(139, 94, 60, 0.06);
            border: 1px solid rgba(139, 94, 60, 0.15);
            color: var(--brand-primary);
            padding: 2px 8px;
            border-radius: 12px;
            margin: 2px 4px 2px 0;
            font-size: 0.7rem;
        }
        .message-sources-header .source-tag-link {
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s;
        }
        .message-sources-header .source-tag-link:hover {
            background: rgba(139, 94, 60, 0.15);
            border-color: rgba(139, 94, 60, 0.35);
        }

        /* Quellen-Footer UNTER der Antwort */
        .message-sources-footer {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 6px;
            margin-top: 14px;
            padding-top: 10px;
            border-top: 1px solid #e0e4e8;
            font-size: 0.8rem;
            color: #6b7b8d;
        }
        .message-sources-footer .sources-icon {
            font-size: 1rem;
        }
        .message-sources-footer strong {
            color: var(--brand-primary);
            font-weight: 600;
            margin-right: 4px;
        }
        .message-sources-footer .source-tag {
            display: inline-block;
            background: rgba(139, 94, 60, 0.06);
            border: 1px solid rgba(139, 94, 60, 0.15);
            color: var(--brand-primary);
            padding: 2px 8px;
            border-radius: 12px;
            margin: 2px 4px 2px 0;
            font-size: 0.7rem;
        }
        .message-sources-footer .source-tag .source-num {
            font-weight: 700;
            margin-right: 2px;
        }
        .message-sources-footer .source-tag-link {
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s;
        }
        .message-sources-footer .source-tag-link:hover {
            background: rgba(139, 94, 60, 0.15);
            border-color: rgba(139, 94, 60, 0.35);
        }

        /* Inline-Zitat-Badges [1], [2] etc. im Antworttext */
        .cite-badge {
            display: inline;
            background: rgba(139, 94, 60, 0.08);
            color: var(--brand-primary);
            font-size: 0.72rem;
            font-weight: 700;
            padding: 1px 4px;
            border-radius: 4px;
            margin: 0 1px;
            vertical-align: super;
            line-height: 1;
        }
        .cite-badge-link {
            cursor: pointer;
            transition: background 0.15s;
        }
        .cite-badge-link:hover {
            background: rgba(139, 94, 60, 0.2);
            text-decoration: underline;
        }

        .message-settings-bar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 6px;
            margin-bottom: 10px;
            padding-bottom: 8px;
            border-bottom: 1px solid #eee;
            font-size: 0.72rem;
            color: #9ca3af;
        }
        .message-settings-bar .settings-tag {
            display: inline-flex;
            align-items: center;
            gap: 3px;
            background: #f3f4f6;
            border: 1px solid #e5e7eb;
            color: #6b7280;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.68rem;
        }
        .message-settings-bar .settings-tag .tag-label {
            color: #9ca3af;
            font-weight: 400;
        }
        .message-settings-bar .settings-tag .tag-value {
            color: #4b5563;
            font-weight: 600;
        }

        /* Strukturierte Antworten: Abschnitte mit fetten Titeln */
        .message.assistant ol {
            margin-left: 0;
            padding-left: 24px;
            margin-bottom: 12px;
        }
        .message.assistant ol > li {
            margin-bottom: 10px;
            padding-left: 4px;
        }
        .message.assistant ol > li > strong:first-child {
            color: #2c3e50;
        }

        /* Experten-Tipp / Praxis-Tipp am Ende */
        .message.assistant p:last-of-type strong:first-child {
            color: var(--brand-primary);
        }

        /* Klickbare Follow-up-Fragen (NotebookLM-Stil) */
        .followup-container {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-top: 18px;
            padding-top: 14px;
            border-top: 1px solid #e0e4e8;
        }
        .followup-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            background: rgba(139, 94, 60, 0.04);
            border: 1px solid rgba(139, 94, 60, 0.18);
            border-radius: 10px;
            padding: 10px 16px;
            font-size: 0.88rem;
            color: #3a3a3a;
            cursor: pointer;
            text-align: left;
            transition: all 0.15s ease;
            line-height: 1.4;
        }
        .followup-btn:hover {
            background: rgba(139, 94, 60, 0.10);
            border-color: var(--brand-primary);
            color: var(--brand-primary);
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(139, 94, 60, 0.12);
        }
        .followup-btn:active {
            transform: translateY(0);
        }
        .followup-btn .followup-icon {
            flex-shrink: 0;
            font-size: 1rem;
            opacity: 0.7;
        }

        /* Aktions-Buttons unter jeder Assistenten-Nachricht */
        .message-action-bar {
            display: flex;
            gap: 6px;
            margin-top: 10px;
            padding-top: 8px;
            border-top: 1px solid #e0e4e8;
            opacity: 1;
            flex-wrap: wrap;
            align-items: center;
        }

        .msg-action-btn {
            background: #f7f9fc;
            border: 1px solid #d0d5dd;
            color: #6b7b8d;
            padding: 3px 10px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 0.68rem;
            transition: all 0.15s;
        }
        .msg-action-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary);
        }

        /* Bewertungs-Buttons (Daumen) */
        .msg-rating-group {
            display: flex;
            gap: 2px;
            margin-right: 4px;
        }
        .msg-rating-btn {
            background: none;
            border: 1px solid transparent;
            cursor: pointer;
            font-size: 1rem;
            padding: 3px 8px;
            border-radius: 5px;
            transition: all 0.2s;
            opacity: 0.5;
        }
        .msg-rating-btn:hover { opacity: 1; background: #f0f2f5; transform: scale(1.15); }
        .msg-rating-btn:active { transform: scale(0.9); }
        .msg-rating-btn.pending {
            opacity: 1;
            background: rgba(255,255,255,0.95);
            border-color: rgba(139,94,60,0.18);
        }
        .msg-rating-btn:disabled {
            cursor: default;
            transform: none;
        }
        .msg-rating-btn.active[data-rating="1"] { opacity: 1; background: #e6f4ea; border-color: #34a853; }
        .msg-rating-btn.active[data-rating="-1"] { opacity: 1; background: #fce8e6; border-color: #ea4335; }
        .msg-rating-btn.active { opacity: 1; }

        .message.loading {
            align-self: flex-start;
            background: #f7f9fc;
            border: 1px solid #e0e4e8;
        }
        .loading-dots span {
            animation: blink 1.4s infinite;
            font-size: 1.2rem;
        }
        .loading-dots span:nth-child(2) { animation-delay: 0.2s; }
        .loading-dots span:nth-child(3) { animation-delay: 0.4s; }
        @keyframes blink {
            0%, 20% { opacity: 0.2; }
            50% { opacity: 1; }
            100% { opacity: 0.2; }
        }

        /* Chat-Eingabe: fixed, mittig im Chat-Bereich (versetzt um halbe Sidebar-Breite) */
        .chat-input-area {
            position: fixed;
            left: calc(50% + var(--app-nav-offset-half));
            transform: translateX(-50%);
            width: 100%;
            max-width: 800px;
            padding: 12px 24px 16px;
            z-index: 100;
            pointer-events: none;
            transition: bottom 0.4s ease, top 0.4s ease, background 0.4s ease;
        }

        /* Zustand 1: Zentriert (kein Chat aktiv) */
        .chat-input-area.centered {
            bottom: 24px;
            top: auto;
            background: transparent;
        }

        /* Zustand 2: Unten fixiert (Chat laeuft) */
        .chat-input-area.docked {
            bottom: 0;
            top: auto;
            background: linear-gradient(to top, rgba(240, 242, 245, 0.98) 60%, rgba(240, 242, 245, 0) 100%);
        }

        .chat-input-group {
            display: flex;
            gap: 10px;
            align-items: flex-end;
            pointer-events: all;
            background: #ffffff;
            border: 1px solid #d0d5dd;
            border-radius: 16px;
            padding: 8px 8px 8px 14px;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        }

        .chat-input-group textarea {
            flex: 1;
            padding: 10px 4px;
            border-radius: 8px;
            border: none;
            background: transparent;
            color: #2c3e50;
            font-size: 0.9rem;
            font-family: inherit;
            resize: none;
            min-height: 24px;
            max-height: 120px;
            outline: none;
        }
        .chat-input-group textarea::placeholder { color: #9ca3af; }

        .chat-context-badge {
            display: none;
            align-items: center;
            gap: 8px;
            padding: 8px 14px;
            margin-bottom: 8px;
            background: rgba(139, 94, 60, 0.06);
            border: 1px solid rgba(139, 94, 60, 0.2);
            border-radius: 10px;
            font-size: 0.78rem;
            color: var(--brand-primary);
            max-width: 100%;
            pointer-events: all;
        }
        .chat-context-badge.active { display: flex; }
        .chat-context-badge .ccb-icon { font-size: 1rem; flex-shrink: 0; }
        .chat-context-badge .ccb-text {
            flex: 1; overflow: hidden; text-overflow: ellipsis;
            white-space: nowrap; min-width: 0;
        }
        .chat-context-badge .ccb-preview {
            font-size: 0.72rem; color: #4a5568; margin-top: 2px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .chat-context-badge .ccb-close {
            background: none; border: none; color: #6b7b8d;
            cursor: pointer; font-size: 1.1rem; padding: 2px 4px;
            flex-shrink: 0; line-height: 1;
        }
        .chat-context-badge .ccb-close:hover { color: #e53e3e; }

        /* Inline-Chat im Tabellen-Viewer */
        .tv-inline-chat {
            display: none;
            border-top: 1px solid #e0e4e8;
            flex-direction: column;
            max-height: 280px;
            flex-shrink: 0;
        }
        .tv-inline-chat.active { display: flex; }
        .tv-inline-chat-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 8px 16px; background: #f7f9fc;
            border-bottom: 1px solid #e0e4e8;
        }
        .tv-inline-chat-header span {
            font-size: 0.8rem; font-weight: 600; color: var(--brand-primary);
        }
        .tv-inline-chat-close {
            background: none; border: none; color: #6b7b8d;
            cursor: pointer; font-size: 1rem; padding: 2px 6px;
        }
        .tv-inline-chat-close:hover { color: #e53e3e; }
        .tv-inline-chat-messages {
            flex: 1; overflow-y: auto; padding: 10px 16px;
            font-size: 0.8rem; color: #4a5568;
            display: flex; flex-direction: column; gap: 8px;
        }
        .tv-chat-msg {
            padding: 8px 12px; border-radius: 10px;
            max-width: 85%; line-height: 1.5; word-wrap: break-word;
        }
        .tv-chat-msg.user {
            background: var(--brand-primary); color: #fff;
            align-self: flex-end; border-bottom-right-radius: 4px;
        }
        .tv-chat-msg.assistant {
            background: #f0f3f7; color: #2d3748;
            align-self: flex-start; border-bottom-left-radius: 4px;
        }
        .tv-inline-chat-input {
            display: flex; gap: 8px; padding: 10px 16px;
            border-top: 1px solid #e0e4e8; background: #fafbfc;
        }
        .tv-inline-chat-input input {
            flex: 1; padding: 8px 12px; border: 1px solid #d0d5dd;
            border-radius: 8px; font-size: 0.8rem; outline: none;
        }
        .tv-inline-chat-input input:focus { border-color: var(--brand-primary); }
        .tv-inline-chat-input button {
            padding: 8px 14px; background: var(--brand-primary); color: #fff;
            border: none; border-radius: 8px; cursor: pointer;
            font-size: 0.8rem;
        }
        .tv-inline-chat-input button:hover { background: #002266; }

        .send-btn {
            width: 42px; height: 42px;
            border-radius: 10px;
            background: var(--brand-primary); border: none;
            color: #ffffff; font-size: 1.1rem;
            cursor: pointer; transition: all 0.2s;
            flex-shrink: 0;
        }
        .send-btn:hover { background: #002266; }
        .send-btn:disabled { background: #c0c7d0; cursor: not-allowed; }

        /* Stop-Button (ersetzt Send waehrend Streaming) */
        .stop-btn {
            width: 42px; height: 42px;
            border-radius: 10px;
            background: #e74c3c; border: none;
            color: #ffffff; font-size: 1.1rem;
            cursor: pointer; transition: all 0.2s;
            flex-shrink: 0;
            display: none;
        }
        .stop-btn:hover { background: #c0392b; }

        /* Vereinfachte Chat-Steuerung über dem Input */
        .chat-settings-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 12px;
            padding: 8px 14px;
            margin-bottom: 8px;
            pointer-events: all;
            border: 1px solid rgba(208, 213, 221, 0.9);
            border-radius: 16px;
            background: rgba(255, 255, 255, 0.88);
            backdrop-filter: blur(12px);
            box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
        }
        .chat-settings-primary {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            flex: 1 1 auto;
            min-width: 0;
        }
        .source-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
            padding-right: 14px;
        }
        .source-btn.has-selection {
            background: var(--brand-soft-bg);
            border-color: var(--brand-soft-border);
            color: var(--brand-emphasis);
        }
        .source-btn-icon {
            font-size: 0.92rem;
            line-height: 1;
        }
        .source-btn-text {
            font-weight: 600;
            letter-spacing: 0.45px;
            text-transform: uppercase;
        }
        .source-btn:disabled,
        .source-btn.disabled {
            cursor: not-allowed;
            opacity: 0.55;
            border-color: #d8dee6;
            color: #6b7280;
            box-shadow: none;
        }
        .source-btn:disabled:hover,
        .source-btn.disabled:hover {
            border-color: #d8dee6;
            color: #6b7280;
        }
        .source-btn-meta {
            padding: 2px 8px;
            border-radius: 999px;
            background: rgba(148, 163, 184, 0.14);
            color: #6b7280;
            font-size: 0.7rem;
            font-weight: 600;
            line-height: 1.2;
        }
        .source-btn.has-selection .source-btn-meta {
            background: rgba(252, 12, 24, 0.12);
            color: var(--brand-emphasis);
        }
        .chat-settings-meta {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            gap: 10px;
            margin-left: 0;
            flex-shrink: 0;
        }
        .chat-settings-summary {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 6px 14px;
            flex: 1 1 auto;
            min-width: 0;
            font-size: 0.74rem;
            line-height: 1.45;
            color: #6b7280;
            white-space: normal;
        }
        .chat-settings-summary-item {
            display: inline-flex;
            align-items: baseline;
            flex-wrap: wrap;
            gap: 4px;
        }
        .chat-settings-summary-label {
            font-weight: 700;
            color: #475569;
        }
        .chat-settings-summary-value {
            color: #6b7280;
        }
        .chat-settings-group {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }
        .chat-settings-stack {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .chat-settings-label {
            font-size: 0.72rem;
            color: #6b7b8d;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-right: 4px;
        }
        .chat-setting-btn {
            padding: 5px 12px;
            border-radius: 999px;
            border: 1px solid #d0d5dd;
            background: #fff;
            font-size: 0.78rem;
            color: #4a5568;
            cursor: pointer;
            transition: all 0.15s;
        }
        .chat-setting-btn:hover {
            border-color: var(--brand-primary);
            color: var(--brand-primary);
        }
        .chat-setting-btn.active {
            background: var(--brand-primary);
            color: #fff;
            border-color: var(--brand-primary);
        }
        .chat-options-btn {
            font-weight: 600;
            letter-spacing: 0.2px;
        }
        .chat-options-btn span {
            margin-right: 4px;
        }
        .response-btn {
            font-weight: 600;
            letter-spacing: 0.3px;
        }
        .chat-advanced-panel {
            position: absolute;
            right: 24px;
            bottom: calc(100% - 4px);
            width: min(520px, calc(100% - 48px));
            z-index: 130;
            pointer-events: all;
            display: flex;
            flex-direction: column;
            gap: 14px;
            margin-bottom: 0;
            padding: 14px;
            border: 1px solid #e5e7eb;
            border-radius: 18px;
            background: #ffffff;
            backdrop-filter: blur(14px);
            box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
        }
        .chat-advanced-panel[hidden] {
            display: none;
        }
        .chat-floating-panel {
            position: absolute;
            bottom: calc(100% - 4px);
            width: min(440px, calc(100% - 48px));
            z-index: 130;
            pointer-events: all;
            display: flex;
            flex-direction: column;
            gap: 14px;
            margin-bottom: 0;
            padding: 14px;
            border-radius: 18px;
            backdrop-filter: blur(14px);
            box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
        }
        .chat-web-panel {
            left: 24px;
            border: 1px solid #c8d8f6;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 248, 255, 0.98) 100%);
            box-shadow: 0 18px 40px rgba(21, 101, 192, 0.12);
        }
        .chat-web-panel[hidden] {
            display: none;
        }
        .chat-image-panel {
            left: 24px;
            border: 1px solid #f4c2c5;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 246, 246, 0.98) 100%);
            box-shadow: 0 18px 40px rgba(252, 12, 24, 0.08);
        }
        .chat-image-panel[hidden] {
            display: none;
        }
        .chat-image-panel-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 0;
        }
        .chat-image-panel-copy {
            display: flex;
            flex-direction: column;
            gap: 4px;
            min-width: 0;
        }
        .chat-image-panel-header h4 {
            font-size: 1rem;
            color: #1f2937;
            margin-top: 2px;
        }
        .chat-image-panel-copy .chat-advanced-note {
            max-width: none;
        }
        .chat-panel-close {
            width: 32px;
            height: 32px;
            border: 1px solid #f1b7bc;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.9);
            color: #9f1239;
            font-size: 1.1rem;
            line-height: 1;
            cursor: pointer;
            flex-shrink: 0;
            transition: all 0.15s;
        }
        .chat-panel-close:hover {
            border-color: #e88994;
            background: #fff1f2;
        }
        .chat-image-panel-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
        }
        .chat-image-panel-actions .chat-setting-btn {
            min-width: 136px;
        }
        .chat-panel-secondary-btn {
            border-color: #f1b7bc;
            background: #ffffff;
            color: #9f1239;
        }
        .chat-panel-secondary-btn:hover {
            border-color: #e88994;
            background: #fff1f2;
            color: #9f1239;
        }
        .chat-panel-apply-btn {
            background: var(--brand-primary);
            color: #fff;
            border-color: var(--brand-primary);
        }
        .chat-panel-apply-btn:hover {
            filter: brightness(0.94);
            color: #fff;
        }
        .chat-advanced-section {
            min-width: 0;
            padding: 12px;
            border: 1px solid #eef1f4;
            border-radius: 14px;
            background: linear-gradient(180deg, #fbfcfd 0%, #f7f9fb 100%);
        }
        .chat-advanced-header {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-bottom: 12px;
        }
        .chat-advanced-kicker {
            font-size: 0.68rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--brand-primary);
        }
        .chat-advanced-header h4 {
            font-size: 0.92rem;
            color: #1f2937;
        }
        .chat-advanced-note {
            font-size: 0.78rem;
            line-height: 1.45;
            color: #6b7280;
        }
        .chat-advanced-field {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .chat-advanced-field .chat-settings-label {
            margin-right: 0;
        }
        /* WISSEN button */
        .wissen-btn {
            font-weight: 600;
            letter-spacing: 0.3px;
        }
        .wissen-btn.active {
            background: #2e7d32 !important;
            border-color: #2e7d32 !important;
            color: #fff !important;
        }
        .wissen-btn.active:hover {
            background: #1b5e20 !important;
            border-color: #1b5e20 !important;
        }

        /* WEB button */
        .web-btn {
            font-weight: 600;
            letter-spacing: 0.3px;
        }
        .web-btn.active {
            background: #1565c0 !important;
            border-color: #1565c0 !important;
            color: #fff !important;
        }
        .web-btn.active:hover {
            background: #0d47a1 !important;
            border-color: #0d47a1 !important;
        }
        .web-depth-buttons {
            align-items: center;
        }

        /* Deep Search button */
        .deep-btn {
            font-weight: 600;
            letter-spacing: 0.3px;
        }
        .deep-btn.active {
            background: #6a1b9a !important;
            border-color: #6a1b9a !important;
            color: #fff !important;
        }
        .deep-btn.active:hover {
            background: #4a148c !important;
            border-color: #4a148c !important;
        }

        .image-btn {
            font-weight: 600;
            letter-spacing: 0.3px;
        }

        /* ============================================
           LOADING OVERLAY
           ============================================ */
        .processing-overlay {
            display: none; position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.3);
            z-index: 1000;
            justify-content: center; align-items: center;
        }
        .processing-overlay.active { display: flex; }
        .processing-box {
            background: #ffffff;
            border: 1px solid #e0e4e8;
            border-radius: 12px;
            padding: 30px 40px;
            text-align: center;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
            color: #2c3e50;
        }
        .processing-box .spinner {
            width: 40px; height: 40px;
            border: 3px solid rgba(139, 94, 60, 0.15);
            border-top-color: var(--brand-primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 16px;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* ============================================
           BACKGROUND TASK WIDGET (nicht-blockierend)
           ============================================ */
        .bg-task-widget {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 360px;
            background: #ffffff;
            border: 1px solid #e0e4e8;
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.15);
            z-index: 900;
            overflow: hidden;
            transition: opacity 0.3s, transform 0.3s;
            opacity: 0;
            transform: translateY(20px);
            pointer-events: none;
        }
        .bg-task-widget.active {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }
        .bg-task-header {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 14px 16px 8px;
        }
        .bg-task-header .bg-task-spinner {
            width: 20px; height: 20px;
            border: 2px solid rgba(139, 94, 60, 0.15);
            border-top-color: var(--brand-primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            flex-shrink: 0;
        }
        .bg-task-header .bg-task-spinner.done {
            border: none;
            animation: none;
            background: #27ae60;
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
        }
        .bg-task-header .bg-task-title {
            flex: 1;
            font-size: 0.85rem;
            font-weight: 600;
            color: #2c3e50;
        }
        .bg-task-header .bg-task-close {
            background: none;
            border: none;
            font-size: 16px;
            cursor: pointer;
            color: #999;
            padding: 0 4px;
        }
        .bg-task-header .bg-task-close:hover { color: #333; }
        .bg-task-body {
            padding: 0 16px 12px;
        }
        .bg-task-status {
            font-size: 0.78rem;
            color: #7f8c8d;
            margin-bottom: 8px;
        }
        .bg-task-bar-container {
            width: 100%;
            height: 6px;
            background: #ecf0f1;
            border-radius: 3px;
            overflow: hidden;
        }
        .bg-task-bar {
            height: 100%;
            background: var(--brand-primary);
            border-radius: 3px;
            transition: width 0.4s ease;
            width: 0%;
        }
        .bg-task-bar.done { background: #27ae60; }
        .bg-task-details {
            margin-top: 8px;
            max-height: 120px;
            overflow-y: auto;
            font-size: 0.72rem;
            color: #95a5a6;
        }
        .bg-task-details .bg-task-item {
            padding: 2px 0;
            display: flex;
            gap: 6px;
            align-items: center;
        }
        .bg-task-details .bg-task-item.success { color: #27ae60; }
        .bg-task-details .bg-task-item.error { color: #e74c3c; }

        /* ============================================
           LINK DISCOVERY MODAL
           ============================================ */
        .modal-overlay {
            display: none; position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.35);
            z-index: 1000;
            justify-content: center; align-items: center;
        }
        .modal-overlay.active { display: flex; }

        .modal {
            background: #ffffff;
            border: 1px solid #e0e4e8;
            border-radius: 16px;
            width: 600px;
            max-width: 90vw;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
        }
        .modal-header {
            padding: 20px 24px 16px;
            border-bottom: 1px solid #e0e4e8;
        }
        .modal-header h3 {
            color: var(--brand-primary);
            font-size: 1.1rem;
            margin-bottom: 4px;
        }
        .modal-header p {
            color: #6b7b8d;
            font-size: 0.8rem;
        }
        .modal-body {
            flex: 1;
            overflow-y: auto;
            padding: 16px 24px;
        }
        .modal-footer {
            padding: 16px 24px;
            border-top: 1px solid #e0e4e8;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
        }
        .modal-footer .info { font-size: 0.8rem; color: #6b7b8d; }
        .modal-footer .info span { color: var(--brand-primary); font-weight: 600; }
        .modal-actions { display: flex; gap: 8px; }

        .btn-secondary {
            padding: 8px 16px;
            border-radius: 6px;
            border: 1px solid #d0d5dd;
            background: transparent;
            color: #4a5568;
            cursor: pointer;
            font-size: 0.85rem;
        }
        .btn-secondary:hover { background: #f0f2f5; }

        /* Link-Items im Modal */
        .link-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: 6px;
            margin-bottom: 4px;
            transition: all 0.15s;
        }
        .link-item:hover { background: #f0f2f5; }
        .link-item.main-page {
            background: rgba(139, 94, 60, 0.05);
            border: 1px solid rgba(139, 94, 60, 0.2);
            margin-bottom: 12px;
        }
        .link-item input[type="checkbox"] {
            width: 18px; height: 18px;
            accent-color: var(--brand-primary);
            cursor: pointer;
            flex-shrink: 0;
        }
        .link-item-info {
            flex: 1; min-width: 0;
        }
        .link-item-label {
            font-size: 0.85rem;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .link-item-url {
            font-size: 0.7rem;
            color: #9ca3af;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .link-item-badge {
            font-size: 0.65rem;
            padding: 2px 6px;
            border-radius: 8px;
            background: rgba(139, 94, 60, 0.08);
            color: var(--brand-primary);
            flex-shrink: 0;
        }

        .modal-select-bar {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid #e0e4e8;
        }
        .modal-select-bar button {
            background: none; border: none;
            color: var(--brand-primary); cursor: pointer;
            font-size: 0.8rem; text-decoration: underline;
        }

        /* ============================================
           UNIVERSAL DIALOG MODAL
           ============================================ */
        .dialog-overlay {
            display: none; position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.35);
            z-index: 1100;
            justify-content: center; align-items: center;
            animation: fadeIn 0.15s ease;
        }
        .dialog-overlay.active { display: flex; }
        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

        .dialog-box {
            background: #ffffff;
            border: 1px solid #e0e4e8;
            border-radius: 16px;
            width: 420px;
            max-width: 90vw;
            overflow: hidden;
            animation: slideUp 0.2s ease;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
        }
        @keyframes slideUp {
            from { transform: translateY(20px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }

        .dialog-header {
            padding: 20px 24px 12px;
            border-bottom: 1px solid #e0e4e8;
        }
        .dialog-header h3 {
            color: var(--brand-primary);
            font-size: 1rem;
            margin: 0;
        }
        .dialog-header p {
            color: #6b7b8d;
            font-size: 0.8rem;
            margin-top: 4px;
        }

        .dialog-body {
            padding: 16px 24px;
        }

        .dialog-input {
            width: 100%;
            padding: 10px 14px;
            border-radius: 8px;
            border: 1px solid #d0d5dd;
            background: #f7f9fc;
            color: #2c3e50;
            font-size: 0.9rem;
            font-family: inherit;
            outline: none;
            transition: border-color 0.2s;
        }
        .dialog-input:focus { border-color: var(--brand-primary); }
        .dialog-input::placeholder { color: #9ca3af; }

        .dialog-folder-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
            max-height: 280px;
            overflow-y: auto;
        }

        .dialog-folder-option {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            border-radius: 8px;
            border: 1px solid #e0e4e8;
            background: #f7f9fc;
            cursor: pointer;
            transition: all 0.15s;
            color: #2c3e50;
            font-size: 0.88rem;
        }
        .dialog-folder-option:hover {
            background: rgba(139, 94, 60, 0.05);
            border-color: rgba(139, 94, 60, 0.3);
        }
        .dialog-folder-option .folder-option-icon {
            font-size: 1.1rem;
            flex-shrink: 0;
        }
        .dialog-folder-option .folder-option-name {
            flex: 1;
        }
        .dialog-folder-option .folder-option-count {
            font-size: 0.7rem;
            color: #6b7b8d;
            background: #e0e4e8;
            padding: 2px 8px;
            border-radius: 10px;
        }

        .dialog-message {
            color: #4a5568;
            font-size: 0.9rem;
            line-height: 1.5;
        }
        .dialog-message strong { color: var(--brand-primary); }

        .dialog-footer {
            padding: 12px 24px 16px;
            border-top: 1px solid #e0e4e8;
            display: flex;
            justify-content: flex-end;
            gap: 8px;
        }

        .dialog-btn {
            padding: 9px 20px;
            border-radius: 8px;
            border: none;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 600;
            transition: all 0.2s;
        }
        .dialog-btn-cancel {
            background: transparent;
            border: 1px solid #d0d5dd;
            color: #4a5568;
        }
        .dialog-btn-cancel:hover { background: #f0f2f5; }

        .dialog-btn-primary {
            background: var(--brand-primary);
            color: #ffffff;
        }
        .dialog-btn-primary:hover { background: #002266; }

        .dialog-btn-danger {
            background: rgba(231, 76, 60, 0.15);
            border: 1px solid rgba(231, 76, 60, 0.4);
            color: #e74c3c;
        }
        .dialog-btn-danger:hover { background: rgba(231, 76, 60, 0.25); }

        /* Toast Notifications */
        .toast-container {
            position: fixed;
            top: 16px;
            right: 16px;
            z-index: 1200;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .toast {
            padding: 12px 20px;
            border-radius: 10px;
            font-size: 0.85rem;
            color: #2c3e50;
            background: #ffffff;
            border: 1px solid #e0e4e8;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
            animation: toastIn 0.25s ease, toastOut 0.3s ease 2.7s forwards;
            max-width: 360px;
        }
        .toast.success { border-color: rgba(46, 204, 113, 0.4); }
        .toast.success::before { content: '\2713  '; color: #2ecc71; font-weight: bold; }
        .toast.error { border-color: rgba(231, 76, 60, 0.4); }
        .toast.error::before { content: '\2717  '; color: #e74c3c; font-weight: bold; }
        .toast.info { border-color: rgba(52, 152, 219, 0.4); }
        .toast.info::before { content: '\2139  '; color: #3498db; font-weight: bold; }

        @keyframes toastIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
        @keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

        /* ============================================
           LOGIN SCREEN
           ============================================ */
        .login-screen {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: linear-gradient(135deg, #f0f2f5 0%, #e8ecf1 100%);
            z-index: 2000;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .login-screen.hidden { display: none; }

        .login-box {
            background: #ffffff;
            border: 1px solid #e0e4e8;
            border-radius: 20px;
            padding: 40px;
            width: 400px;
            max-width: 90vw;
            text-align: center;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
        }
        .login-box .login-logo {
            width: 120px;
            margin-bottom: 20px;
        }
        .login-box h1 {
            color: #0c3c60;
            font-size: 1.4rem;
            margin-bottom: 6px;
        }
        .login-box p {
            color: #6b7b8d;
            font-size: 0.85rem;
            margin-bottom: 28px;
        }
        .login-field {
            width: 100%;
            padding: 12px 16px;
            border-radius: 10px;
            border: 1px solid #d0d5dd;
            background: #f7f9fc;
            color: #2c3e50;
            font-size: 0.9rem;
            margin-bottom: 12px;
            outline: none;
            font-family: inherit;
        }
        .login-field:focus { border-color: #0c3c60; }
        .login-field::placeholder { color: #9ca3af; }

        .login-btn {
            width: 100%;
            padding: 12px;
            border-radius: 10px;
            border: none;
            background: #0c3c60;
            color: #ffffff;
            font-size: 0.95rem;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.2s;
            margin-top: 8px;
        }
        .login-btn:hover { background: #3c6078; }
        .login-btn:disabled { background: #c0c7d0; cursor: not-allowed; }

        .login-error {
            color: #e74c3c;
            font-size: 0.8rem;
            margin-top: 12px;
            min-height: 20px;
        }

        .login-tabs {
            display: flex;
            margin-bottom: 24px;
            border-bottom: 1px solid #e0e4e8;
        }
        .login-tab {
            flex: 1;
            padding: 10px;
            background: none;
            border: none;
            color: #9ca3af;
            font-size: 0.9rem;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            transition: all 0.2s;
            font-family: inherit;
        }
        .login-tab.active {
            color: #0c3c60;
            border-bottom-color: #0c3c60;
        }
        .login-tab:hover { color: #2c3e50; }
        .login-form-section { display: none; }
        .login-form-section.active { display: block; }

        .logout-btn {
            background: none;
            border: 1px solid #d0d5dd;
            color: #6b7b8d;
            padding: 4px 10px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.75rem;
            margin-left: 12px;
            transition: all 0.15s;
        }
        .logout-btn:hover { background: #f0f2f5; color: #e74c3c; border-color: rgba(231, 76, 60, 0.3); }

        /* ============================================
           RESPONSIVE
           ============================================ */

        /* Tablet (max 1024px) */
        @media (max-width: 1024px) {
            .chat-title { max-width: 200px; }
            .chat-settings-bar {
                align-items: flex-start;
                flex-wrap: wrap;
            }
            .chat-settings-meta {
                width: 100%;
                justify-content: space-between;
                margin-left: 0;
            }
            .chat-image-panel-header {
                flex-direction: column;
            }
        }

        /* Smartphone (max 768px) */
        @media (max-width: 768px) {
            .app-container { flex-direction: column; height: calc(100vh - 48px); padding-left: 0; }

            /* Nav-Icon-Bar: horizontal am unteren Rand */
            .nav-icon-bar {
                width: 100%; height: 48px;
                flex-direction: row; justify-content: space-around;
                padding: 4px 0; gap: 0;
                order: 99; /* nach unten schieben */
                position: fixed; bottom: 0; left: 0; z-index: 200;
                top: auto;
                box-shadow: 0 -8px 18px rgba(0,0,0,0.14);
            }
            .nav-icon-btn { width: 38px; height: 38px; min-height: 38px; font-size: 1.1rem; padding: 0; border-radius: 12px; }
            .nav-icon-btn .nav-label { display: none !important; }
            .nav-spacer { display: none; }
            .nav-top-group,
            .nav-bottom-group {
                flex-direction: row;
                overflow: visible;
                flex: 0;
                min-height: auto;
                gap: 0;
                margin: 0;
                padding: 0;
                background: transparent;
                border: none;
                box-shadow: none;
            }

            /* Chat-Area: restliche Höhe, Platz für Navigation unten */
            .chat-area { min-height: 0; padding-bottom: 56px; }

            /* Chat-History-Sidebar: Overlay statt Spalte */
            .chat-history-sidebar.open {
                position: fixed; right: 0; top: 0; bottom: 48px;
                width: 85vw; max-width: 320px; min-width: auto;
                z-index: 150; box-shadow: -4px 0 20px rgba(0,0,0,0.15);
            }

            /* Chat-Input: volle Breite, Mindestabstand zu Nav-Bar */
            .chat-input-area {
                max-width: 100%; padding: 8px 12px 60px;
                left: 0; transform: none;
            }
            .chat-input-area.centered { bottom: 0; transform: none; left: 0; }
            .chat-input-area.docked { bottom: 0; transform: none; left: 0; }
            .chat-settings-bar {
                padding: 10px 12px;
                border-radius: 14px;
            }
            .chat-settings-primary {
                gap: 6px;
            }
            .chat-settings-meta {
                width: 100%;
                justify-content: space-between;
            }
            .source-btn {
                max-width: 100%;
            }
            .chat-advanced-panel {
                left: 12px;
                right: 12px;
                bottom: calc(100% - 2px);
                width: auto;
                padding: 12px;
                border-radius: 14px;
            }
            .chat-web-panel,
            .chat-image-panel {
                left: 12px;
                right: 12px;
                bottom: calc(100% - 2px);
                width: auto;
                padding: 12px;
                border-radius: 14px;
            }
            .chat-image-panel-actions {
                flex-direction: column-reverse;
            }
            .chat-image-panel-actions .chat-setting-btn {
                width: 100%;
            }
            .chat-input-group { border-radius: 12px; }
            .chat-input-group textarea { font-size: 1rem; /* besser tippbar auf Touch */ }

            /* Send-Button: Touch-freundlich */
            .send-btn { width: 44px; height: 44px; }
            .stop-btn { width: 44px; height: 44px; }

            /* Header kompakter */
            .chat-header { padding: 8px 12px; }
            .chat-title { max-width: 160px; font-size: 0.82rem; }

            /* Login-Box: auf schmalem Screen scrollbar */
            .login-box { padding: 24px 16px; }

            /* Modals: volle Breite auf Mobile */
            .fulltext-modal-content { max-width: 95vw !important; }
        }

        /* Kleine Smartphones (max 480px) */
        @media (max-width: 480px) {
            .chat-header { padding: 6px 8px; }
            .chat-title { max-width: 120px; font-size: 0.78rem; }
            .chat-input-area { padding: 6px 8px 56px; }
            .nav-icon-btn { width: 34px; height: 34px; font-size: 1rem; }
            .logout-btn { font-size: 0.65rem; padding: 3px 7px; margin-left: 6px; }
            .chat-settings-summary {
                display: flex;
                font-size: 0.68rem;
                gap: 4px 10px;
            }
            .chat-settings-meta {
                justify-content: space-between;
                align-items: flex-start;
                flex-direction: column;
            }
            .chat-setting-btn { padding: 5px 10px; font-size: 0.74rem; }
        }

        /* ============================================
           GOOGLE DRIVE PANEL (Sidebar -- nur Status)
           ============================================ */
        .gd-section { padding: 12px; }
        .gd-connect-box {
            text-align: center; padding: 32px 16px;
            background: #f8f9fa; border-radius: 10px; border: 1px dashed #d0d5dd;
        }
        .gd-connect-icon { font-size: 2.5rem; margin-bottom: 12px; }
        .gd-connect-text { font-size: 0.82rem; color: #6b7b8d; margin-bottom: 16px; line-height: 1.5; }
        .gd-connect-hint { font-size: 0.75rem; color: #999; margin-top: 14px; line-height: 1.5; }
        .gd-connect-btn { width: 100%; padding: 10px; font-size: 0.85rem; }
        .gd-status-bar {
            display: flex; justify-content: space-between; align-items: center;
            background: #e8f5e9; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
        }
        .gd-status-info { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: #2e7d32; }
        .gd-status-dot {
            width: 8px; height: 8px; border-radius: 50%; background: #2e7d32; display: inline-block;
        }
        .gd-disconnect-btn {
            background: none; border: none; color: #999; cursor: pointer; font-size: 1.2rem;
            padding: 2px 6px; border-radius: 4px; transition: all 0.15s;
        }
        .gd-disconnect-btn:hover { background: #ffebee; color: #c62828; }
        .gd-open-browser-btn {
            width: 100%; padding: 12px; font-size: 0.88rem; font-weight: 600;
            background: var(--brand-primary); color: #fff; border: none; border-radius: 8px;
            cursor: pointer; transition: background 0.15s; display: flex;
            align-items: center; justify-content: center; gap: 8px;
        }
        .gd-open-browser-btn:hover { background: var(--brand-primary-hover); }
        .gd-sidebar-stats { font-size: 0.78rem; color: #6b7b8d; margin-top: 12px; line-height: 1.6; }

        /* Auto-Sync Section */
        .gd-autosync-section {
            margin-top: 16px; padding: 12px;
            background: #f0f7ff; border-radius: 10px; border: 1px solid #d0e3f7;
        }
        .gd-autosync-header {
            display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
        }
        .gd-autosync-header h4 { margin: 0; font-size: 0.82rem; color: #1a73e8; }
        .gd-sync-now-btn {
            background: #1a73e8; color: #fff; border: none; border-radius: 6px;
            padding: 4px 10px; font-size: 0.72rem; cursor: pointer; transition: background 0.15s;
        }
        .gd-sync-now-btn:hover { background: #1557b0; }
        .gd-sync-now-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .gd-autosync-list { max-height: 200px; overflow-y: auto; }
        .gd-autosync-item {
            display: flex; align-items: center; gap: 6px;
            padding: 6px 8px; border-radius: 6px; margin-bottom: 4px;
            background: #fff; font-size: 0.78rem;
        }
        .gd-autosync-item-name {
            flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .gd-autosync-item-actions { display: flex; gap: 2px; }
        .gd-autosync-item-btn {
            background: none; border: none; cursor: pointer; padding: 2px 5px;
            border-radius: 4px; font-size: 0.8rem; transition: background 0.15s;
        }
        .gd-autosync-item-btn:hover { background: #f0f2f5; }
        .gd-autosync-hint {
            font-size: 0.72rem; color: #999; margin-top: 6px; line-height: 1.4;
        }
        .gd-autosync-interval {
            font-size: 0.7rem; color: #aaa; margin-top: 6px;
        }
        .gd-folder-sync-btn {
            background: none; border: 1px solid transparent; cursor: pointer;
            padding: 2px 6px; border-radius: 4px; font-size: 0.85rem;
            transition: all 0.15s; opacity: 0.4; flex-shrink: 0;
        }
        .gd-folder-sync-btn:hover { background: #e3f2fd; opacity: 1; border-color: #90caf9; }
        .gd-folder-sync-btn.active { opacity: 1; background: #e3f2fd; border-color: #1a73e8; }
        .gd-autosync-toolbar-btn {
            background: #f0f7ff; color: #1a73e8; border: 1px solid #90caf9; border-radius: 6px;
            padding: 4px 10px; font-size: 0.75rem; cursor: pointer; white-space: nowrap;
            transition: all 0.15s; flex-shrink: 0;
        }
        .gd-autosync-toolbar-btn:hover { background: #d0e3f7; }
        .gd-autosync-toolbar-btn.active {
            background: #1a73e8; color: #fff; border-color: #1a73e8;
        }
        .gd-autosync-toolbar-btn.active:hover { background: #c62828; border-color: #c62828; }

        /* ============================================
           GOOGLE DRIVE BROWSER OVERLAY
           ============================================ */
        .gd-overlay {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.45); z-index: 1000; justify-content: center; align-items: center;
        }
        .gd-overlay.open { display: flex; }
        .gd-overlay-box {
            background: #fff; border-radius: 14px; width: 960px; max-width: 95vw;
            height: 82vh; display: flex; flex-direction: column;
            box-shadow: 0 12px 40px rgba(0,0,0,0.2); position: relative;
        }
        .gd-split { display: flex; flex: 1; min-height: 0; overflow: hidden; }
        .gd-split-left {
            flex: 1; display: flex; flex-direction: column; min-width: 0;
            border-right: 1px solid #e0e4e8;
        }
        .gd-split-right {
            width: 280px; min-width: 280px; display: flex; flex-direction: column;
            background: #fafbfc;
        }
        .gd-queue-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 10px 14px; border-bottom: 1px solid #e0e4e8;
        }
        .gd-queue-header h4 { font-size: 0.85rem; color: #2c3e50; margin: 0; }
        .gd-queue-clear {
            font-size: 0.7rem; color: #999; background: none; border: none;
            cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: all 0.15s;
        }
        .gd-queue-clear:hover { color: #c62828; background: #ffebee; }
        .gd-queue-list { flex: 1; overflow-y: auto; padding: 6px; }
        .gd-queue-empty {
            text-align: center; padding: 28px 12px; color: #bbb; font-size: 0.78rem; line-height: 1.6;
        }
        .gd-queue-item {
            display: flex; align-items: center; gap: 6px; padding: 5px 8px;
            border-radius: 6px; font-size: 0.76rem; transition: background 0.12s;
        }
        .gd-queue-item:hover { background: #f0f2f5; }
        .gd-queue-item-icon { font-size: 0.9rem; flex-shrink: 0; }
        .gd-queue-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2c3e50; }
        .gd-queue-item-remove {
            background: none; border: none; color: #ccc; cursor: pointer;
            font-size: 0.85rem; padding: 0 4px; border-radius: 4px; transition: color 0.15s; flex-shrink: 0;
        }
        .gd-queue-item-remove:hover { color: #c62828; }
        .gd-queue-group {
            font-size: 0.7rem; color: var(--brand-primary); font-weight: 600; padding: 6px 8px 2px;
            border-bottom: 1px solid #f0f2f5; margin-top: 4px;
        }
        .gd-queue-footer {
            padding: 10px 14px; border-top: 1px solid #e0e4e8; display: flex;
            flex-direction: column; gap: 6px;
        }
        .gd-queue-count { font-size: 0.78rem; color: #6b7b8d; text-align: center; }
        .gd-queue-footer .gd-import-btn { width: 100%; padding: 8px; font-size: 0.82rem; }
        .gd-queue-footer .gd-cancel-btn { width: 100%; padding: 6px; font-size: 0.78rem; }
        .gd-overlay-header {
            display: flex; justify-content: space-between; align-items: flex-start;
            padding: 18px 22px 12px; border-bottom: 1px solid #e0e4e8;
        }
        .gd-overlay-header h3 { font-size: 1rem; color: #2c3e50; margin-bottom: 4px; }
        .gd-overlay-subtitle { font-size: 0.78rem; color: #6b7b8d; }
        .gd-overlay-close {
            background: none; border: none; font-size: 1.4rem; color: #999;
            cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: all 0.15s;
        }
        .gd-overlay-close:hover { background: #f0f2f5; color: #333; }
        .gd-overlay-toolbar {
            display: flex; justify-content: space-between; align-items: center;
            padding: 10px 22px; border-bottom: 1px solid #f0f2f5; background: #fafbfc;
        }
        .gd-breadcrumb { font-size: 0.8rem; color: #6b7b8d; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
        .gd-crumb { cursor: pointer; color: var(--brand-primary); font-weight: 500; transition: color 0.15s; }
        .gd-crumb:hover { color: var(--brand-primary-hover); text-decoration: underline; }
        .gd-crumb-sep { color: #bbb; }
        .gd-refresh-btn {
            background: none; border: 1px solid #d0d5dd; color: #6b7b8d;
            width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
            font-size: 1rem; display: flex; align-items: center; justify-content: center;
            transition: all 0.15s; flex-shrink: 0;
        }
        .gd-refresh-btn:hover { background: #f0f2f5; color: #2c3e50; }
        .gd-overlay-body { flex: 1; overflow-y: auto; padding: 0; min-height: 0; }
        .gd-file-list { background: #fff; }
        .gd-search-bar {
            display: flex; gap: 6px; padding: 10px 22px; border-bottom: 1px solid #f0f2f5;
            background: #fafbfc;
        }
        .gd-search-input {
            flex: 1; padding: 7px 12px; border: 1px solid #d0d5dd; border-radius: 6px;
            font-size: 0.82rem; outline: none; transition: border-color 0.15s;
        }
        .gd-search-input:focus { border-color: var(--brand-primary); }
        .gd-search-btn {
            padding: 7px 14px; background: var(--brand-primary); color: #fff; border: none;
            border-radius: 6px; font-size: 0.82rem; cursor: pointer; transition: background 0.15s;
            white-space: nowrap;
        }
        .gd-search-btn:hover { background: var(--brand-primary-hover); }
        .gd-search-clear {
            padding: 7px 10px; background: none; border: 1px solid #d0d5dd; color: #6b7b8d;
            border-radius: 6px; font-size: 0.82rem; cursor: pointer; transition: all 0.15s;
        }
        .gd-search-clear:hover { background: #f0f2f5; }
        .gd-loading, .gd-empty {
            text-align: center; padding: 32px; color: #999; font-size: 0.85rem;
        }
        .gd-file-item {
            display: flex; align-items: center; gap: 10px; padding: 10px 22px;
            border-bottom: 1px solid #f0f2f5; cursor: pointer; transition: background 0.12s;
            font-size: 0.85rem;
        }
        .gd-file-item:last-child { border-bottom: none; }
        .gd-file-item:hover { background: #f8f9fa; }
        .gd-file-item.gd-folder { font-weight: 500; }
        .gd-file-item.gd-unsupported { opacity: 0.4; cursor: default; }
        .gd-file-item.gd-synced { background: #f0faf0; }
        .gd-file-icon { font-size: 1.15rem; flex-shrink: 0; width: 24px; text-align: center; }
        .gd-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .gd-file-badge {
            font-size: 0.68rem; padding: 2px 8px; border-radius: 8px; flex-shrink: 0;
            background: #e8f5e9; color: #2e7d32;
        }
        .gd-file-check {
            width: 17px; height: 17px; accent-color: var(--brand-primary); flex-shrink: 0; cursor: pointer;
        }
        .gd-file-size { color: #bbb; font-size: 0.72rem; flex-shrink: 0; }
        .gd-import-btn { padding: 8px 20px; font-size: 0.82rem; }
        .gd-import-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .gd-select-all-bar {
            display: flex; align-items: center; gap: 10px; padding: 6px 22px;
            border-bottom: 1px solid #f0f2f5; background: #fafbfc; font-size: 0.8rem;
        }
        .gd-select-all-bar label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: #6b7b8d; }
        .gd-folder-import-btn {
            margin-left: auto; padding: 4px 12px; font-size: 0.75rem;
            background: #fff8f0; border: 1px solid #f0d9b5; color: var(--brand-primary);
            border-radius: 6px; cursor: pointer; transition: all 0.15s; font-weight: 500;
        }
        .gd-folder-import-btn:hover { background: #f0d9b5; }
        .gd-progress-overlay {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(255,255,255,0.95); display: flex; flex-direction: column;
            align-items: center; justify-content: center; z-index: 10; border-radius: 14px;
        }
        .gd-progress-title { font-size: 1rem; font-weight: 600; color: #2c3e50; margin-bottom: 8px; }
        .gd-progress-file { font-size: 0.82rem; color: #6b7b8d; margin-bottom: 16px; max-width: 80%; text-align: center; }
        .gd-progress-bar-bg {
            width: 320px; max-width: 80%; height: 8px; background: #e0e4e8;
            border-radius: 4px; overflow: hidden; margin-bottom: 8px;
        }
        .gd-progress-bar-fill {
            height: 100%; background: var(--brand-primary); border-radius: 4px;
            transition: width 0.3s ease;
        }

/* ============================================
           ADMIN BENUTZERVERWALTUNG
           ============================================ */
        .admin-users-header {
            display: grid;
            grid-template-columns: 1fr 90px 100px 100px 1fr;
            gap: 8px;
            padding: 8px 12px;
            font-size: 0.75rem;
            font-weight: 600;
            color: #8a9bae;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            border-bottom: 1px solid #e8ecf0;
            margin-bottom: 4px;
        }
        .admin-user-row {
            display: grid;
            grid-template-columns: 1fr 90px 100px 100px 1fr;
            gap: 8px;
            padding: 10px 12px;
            border: 1px solid #e8ecf0;
            border-radius: 8px;
            margin-bottom: 4px;
            align-items: center;
            font-size: 0.85rem;
            transition: background 0.15s;
        }
        .admin-user-row:hover {
            background: #f8f9fa;
        }
        .admin-user-inactive {
            opacity: 0.55;
            background: #fafafa;
        }
        .admin-col-name {
            font-weight: 600;
            color: #2c3e50;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .admin-col-actions {
            display: flex;
            gap: 4px;
            flex-wrap: wrap;
        }
        .admin-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.72rem;
            font-weight: 600;
            letter-spacing: 0.02em;
        }
        .admin-badge-admin {
            background: var(--brand-primary);
            color: var(--brand-on-primary);
        }
        .admin-badge-user {
            background: #e8ecf0;
            color: #5a6b7d;
        }
        .admin-badge-active {
            background: #d4edda;
            color: #155724;
        }
        .admin-badge-inactive {
            background: #f8d7da;
            color: #721c24;
        }
        .admin-action-btn {
            background: #f0f2f5;
            border: 1px solid #dde1e6;
            padding: 3px 8px;
            border-radius: 6px;
            font-size: 0.72rem;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s;
            white-space: nowrap;
        }
        .admin-action-btn:hover {
            background: #e2e6ea;
            border-color: #c8cdd2;
        }
        .admin-action-warn {
            color: #856404;
        }
        .admin-action-warn:hover {
            background: #fff3cd;
            border-color: #ffc107;
        }
        .admin-action-danger {
            color: #721c24;
        }
        .admin-action-danger:hover {
            background: #f8d7da;
            border-color: #dc3545;
        }
        .admin-self-label {
            font-size: 0.78rem;
            color: #8a9bae;
            font-style: italic;
        }
        .admin-error {
            color: #e74c3c;
            padding: 12px;
            font-size: 0.85rem;
        }
        .admin-empty {
            color: #8a9bae;
            padding: 24px;
            text-align: center;
            font-size: 0.88rem;
        }
        .admin-password-display {
            background: #f0f2f5;
            border: 1px solid #dde1e6;
            border-radius: 8px;
            padding: 12px 16px;
            margin-top: 10px;
            text-align: center;
            cursor: pointer;
            transition: background 0.15s;
        }
        .admin-password-display:hover {
            background: #e8ecf0;
        }
        .admin-password-display code {
            display: block;
            font-size: 1.2rem;
            font-weight: 700;
            color: #2c3e50;
            margin-bottom: 4px;
            letter-spacing: 0.08em;
        }

        @media (max-width: 768px) {
            .admin-users-header { display: none; }
            .admin-user-row {
                grid-template-columns: 1fr;
                gap: 4px;
            }
            .admin-col-actions {
                margin-top: 6px;
            }
        }
        .gd-progress-count { font-size: 0.78rem; color: #999; }

        /* ============================================
           ONEDRIVE BROWSER (od-* mirrors gd-* pattern)
           ============================================ */
        .od-section { padding: 12px; }
        .od-connect-box {
            text-align: center; padding: 32px 16px;
            background: #f8f9fa; border-radius: 10px; border: 1px dashed #d0d5dd;
        }
        .od-connect-icon { font-size: 2.5rem; margin-bottom: 12px; }
        .od-connect-text { font-size: 0.82rem; color: #6b7b8d; margin-bottom: 16px; line-height: 1.5; }
        .od-connect-hint { font-size: 0.75rem; color: #999; margin-top: 14px; line-height: 1.5; }
        .od-connect-btn { width: 100%; padding: 10px; font-size: 0.85rem; }
        .od-status-bar {
            display: flex; justify-content: space-between; align-items: center;
            background: #e3f2fd; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
        }
        .od-status-info { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: #0078d4; }
        .od-status-dot {
            width: 8px; height: 8px; border-radius: 50%; background: #0078d4; display: inline-block;
        }
        .od-disconnect-btn {
            background: none; border: none; color: #999; cursor: pointer; font-size: 1.2rem;
            padding: 2px 6px; border-radius: 4px; transition: all 0.15s;
        }
        .od-disconnect-btn:hover { background: #ffebee; color: #c62828; }
        .od-open-browser-btn {
            width: 100%; padding: 12px; font-size: 0.88rem; font-weight: 600;
            background: var(--brand-primary); color: #fff; border: none; border-radius: 8px;
            cursor: pointer; transition: background 0.15s; display: flex;
            align-items: center; justify-content: center; gap: 8px;
        }
        .od-open-browser-btn:hover { background: var(--brand-primary-hover); }
        .od-sidebar-stats { font-size: 0.78rem; color: #6b7b8d; margin-top: 12px; line-height: 1.6; }

        /* OneDrive Auto-Sync */
        .od-autosync-section {
            margin-top: 16px; padding: 12px;
            background: #e3f2fd; border-radius: 10px; border: 1px solid #90caf9;
        }
        .od-autosync-header {
            display: flex; align-items: center; gap: 6px; margin-bottom: 2px;
        }
        .od-autosync-icon { font-size: 1rem; flex-shrink: 0; }
        .od-autosync-name {
            flex: 1; font-weight: 600; font-size: 0.82rem; color: #2c3e50;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .od-autosync-meta { font-size: 0.72rem; color: #6b7b8d; margin-bottom: 6px; }
        .od-autosync-actions { display: flex; gap: 6px; }
        .od-autosync-toggle, .od-autosync-remove {
            background: none; border: 1px solid #d0d5dd; border-radius: 6px;
            padding: 3px 10px; font-size: 0.72rem; cursor: pointer; transition: all 0.15s;
        }
        .od-autosync-toggle:hover { background: #f0f7ff; border-color: #0078d4; color: #0078d4; }
        .od-autosync-remove:hover { background: #ffebee; border-color: #c62828; color: #c62828; }
        .od-autosync-status { font-size: 0.72rem; color: #0078d4; margin-bottom: 8px; }
        .od-autosync-empty { text-align: center; padding: 16px; color: #999; font-size: 0.78rem; }
        .od-autosync-disabled { opacity: 0.5; }
        .od-autosync-item {
            background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
            border: 1px solid #e0e4e8;
        }
        .od-sync-now-btn {
            background: #0078d4; color: #fff; border: none; border-radius: 6px;
            padding: 4px 10px; font-size: 0.72rem; cursor: pointer; transition: background 0.15s;
        }
        .od-sync-now-btn:hover { background: #005a9e; }
        .od-sync-now-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .od-folder-sync-btn {
            background: none; border: 1px solid transparent; cursor: pointer;
            padding: 2px 6px; border-radius: 4px; font-size: 0.85rem;
            transition: all 0.15s; opacity: 0.4; flex-shrink: 0;
        }
        .od-folder-sync-btn:hover { background: #e3f2fd; opacity: 1; border-color: #90caf9; }
        .od-folder-sync-btn.active { opacity: 1; background: #e3f2fd; border-color: #0078d4; }
        .od-toolbar-btn {
            background: #e3f2fd; color: #0078d4; border: 1px solid #90caf9; border-radius: 6px;
            padding: 4px 10px; font-size: 0.75rem; cursor: pointer; white-space: nowrap;
            transition: all 0.15s; flex-shrink: 0;
        }
        .od-toolbar-btn:hover { background: #bbdefb; }
        .od-toolbar-btn.active { background: #0078d4; color: #fff; border-color: #0078d4; }
        .od-toolbar-btn.active:hover { background: #c62828; border-color: #c62828; }

        /* OneDrive Browser Overlay */
        .od-overlay {
            display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.45); z-index: 1000; justify-content: center; align-items: center;
        }
        .od-overlay.open { display: flex; }
        .od-overlay-box {
            background: #fff; border-radius: 14px; width: 960px; max-width: 95vw;
            height: 82vh; display: flex; flex-direction: column;
            box-shadow: 0 12px 40px rgba(0,0,0,0.2); position: relative;
        }
        .od-split { display: flex; flex: 1; min-height: 0; overflow: hidden; }
        .od-split-left {
            flex: 1; display: flex; flex-direction: column; min-width: 0;
            border-right: 1px solid #e0e4e8;
        }
        .od-split-right {
            width: 280px; min-width: 280px; display: flex; flex-direction: column;
            background: #fafbfc;
        }
        .od-queue-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 10px 14px; border-bottom: 1px solid #e0e4e8;
        }
        .od-queue-header h4 { font-size: 0.85rem; color: #2c3e50; margin: 0; }
        .od-queue-clear {
            font-size: 0.7rem; color: #999; background: none; border: none;
            cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: all 0.15s;
        }
        .od-queue-clear:hover { color: #c62828; background: #ffebee; }
        .od-queue-list { flex: 1; overflow-y: auto; padding: 6px; }
        .od-queue-empty {
            text-align: center; padding: 28px 12px; color: #bbb; font-size: 0.78rem; line-height: 1.6;
        }
        .od-queue-item {
            display: flex; align-items: center; gap: 6px; padding: 5px 8px;
            border-radius: 6px; font-size: 0.76rem; transition: background 0.12s;
        }
        .od-queue-item:hover { background: #f0f2f5; }
        .od-queue-item-icon { font-size: 0.9rem; flex-shrink: 0; }
        .od-queue-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2c3e50; }
        .od-queue-item-remove {
            background: none; border: none; color: #ccc; cursor: pointer;
            font-size: 0.85rem; padding: 0 4px; border-radius: 4px; transition: color 0.15s; flex-shrink: 0;
        }
        .od-queue-item-remove:hover { color: #c62828; }
        .od-queue-group {
            font-size: 0.7rem; color: var(--brand-primary); font-weight: 600; padding: 6px 8px 2px;
            border-bottom: 1px solid #f0f2f5; margin-top: 4px;
        }
        .od-queue-footer {
            padding: 10px 14px; border-top: 1px solid #e0e4e8; display: flex;
            flex-direction: column; gap: 6px;
        }
        .od-queue-count { font-size: 0.78rem; color: #6b7b8d; text-align: center; }
        .od-overlay-header {
            display: flex; justify-content: space-between; align-items: flex-start;
            padding: 18px 22px 12px; border-bottom: 1px solid #e0e4e8;
        }
        .od-overlay-header h3 { font-size: 1rem; color: #2c3e50; margin-bottom: 4px; }
        .od-overlay-subtitle { font-size: 0.78rem; color: #6b7b8d; }
        .od-overlay-close {
            background: none; border: none; font-size: 1.4rem; color: #999;
            cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: all 0.15s;
        }
        .od-overlay-close:hover { background: #f0f2f5; color: #333; }
        .od-overlay-toolbar {
            display: flex; justify-content: space-between; align-items: center;
            padding: 10px 22px; border-bottom: 1px solid #f0f2f5; background: #fafbfc;
        }
        .od-breadcrumb { font-size: 0.8rem; color: #6b7b8d; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
        .od-crumb { cursor: pointer; color: var(--brand-primary); font-weight: 500; transition: color 0.15s; }
        .od-crumb:hover { color: var(--brand-primary-hover); text-decoration: underline; }
        .od-crumb-sep { color: #bbb; }
        .od-overlay-body { flex: 1; overflow-y: auto; padding: 0; min-height: 0; }
        .od-file-list { background: #fff; }
        .od-search-bar {
            display: flex; gap: 6px; padding: 10px 22px; border-bottom: 1px solid #f0f2f5;
            background: #fafbfc;
        }
        .od-search-input {
            flex: 1; padding: 7px 12px; border: 1px solid #d0d5dd; border-radius: 6px;
            font-size: 0.82rem; outline: none; transition: border-color 0.15s;
        }
        .od-search-input:focus { border-color: var(--brand-primary); }
        .od-search-btn {
            padding: 7px 14px; background: var(--brand-primary); color: #fff; border: none;
            border-radius: 6px; font-size: 0.82rem; cursor: pointer; transition: background 0.15s;
            white-space: nowrap;
        }
        .od-search-btn:hover { background: var(--brand-primary-hover); }
        .od-search-clear {
            padding: 7px 10px; background: none; border: 1px solid #d0d5dd; color: #6b7b8d;
            border-radius: 6px; font-size: 0.82rem; cursor: pointer; transition: all 0.15s;
        }
        .od-search-clear:hover { background: #f0f2f5; }
        .od-loading, .od-empty {
            text-align: center; padding: 32px; color: #999; font-size: 0.85rem;
        }
        .od-file-item {
            display: flex; align-items: center; gap: 10px; padding: 10px 22px;
            border-bottom: 1px solid #f0f2f5; cursor: pointer; transition: background 0.12s;
            font-size: 0.85rem;
        }
        .od-file-item:last-child { border-bottom: none; }
        .od-file-item:hover { background: #f8f9fa; }
        .od-file-item.od-folder { font-weight: 500; }
        .od-file-item.od-unsupported { opacity: 0.4; cursor: default; }
        .od-file-item.od-synced { background: #f0faf0; }
        .od-file-icon { font-size: 1.15rem; flex-shrink: 0; width: 24px; text-align: center; }
        .od-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .od-file-badge {
            font-size: 0.68rem; padding: 2px 8px; border-radius: 8px; flex-shrink: 0;
            background: #e8f5e9; color: #2e7d32;
        }
        .od-file-check {
            width: 17px; height: 17px; accent-color: var(--brand-primary); flex-shrink: 0; cursor: pointer;
        }
        .od-file-size { color: #bbb; font-size: 0.72rem; flex-shrink: 0; }
        .od-import-btn { padding: 8px 20px; font-size: 0.82rem; }
        .od-import-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .od-select-all-bar {
            display: flex; align-items: center; gap: 10px; padding: 6px 22px;
            border-bottom: 1px solid #f0f2f5; background: #fafbfc; font-size: 0.8rem;
        }
        .od-select-all-bar label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: #6b7b8d; }
        .od-folder-import-btn {
            margin-left: auto; padding: 4px 12px; font-size: 0.75rem;
            background: #fff8f0; border: 1px solid #f0d9b5; color: var(--brand-primary);
            border-radius: 6px; cursor: pointer; transition: all 0.15s; font-weight: 500;
        }
        .od-folder-import-btn:hover { background: #f0d9b5; }
        .od-progress-overlay {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(255,255,255,0.95); display: flex; flex-direction: column;
            align-items: center; justify-content: center; z-index: 10; border-radius: 14px;
        }
        .od-progress-title { font-size: 1rem; font-weight: 600; color: #2c3e50; margin-bottom: 8px; }
        .od-progress-file { font-size: 0.82rem; color: #6b7b8d; margin-bottom: 16px; max-width: 80%; text-align: center; }
        .od-progress-bar-bg {
            width: 320px; max-width: 80%; height: 8px; background: #e0e4e8;
            border-radius: 4px; overflow: hidden; margin-bottom: 8px;
        }
        .od-progress-bar-fill {
            height: 100%; background: var(--brand-primary); border-radius: 4px;
            transition: width 0.3s ease;
        }
        .od-progress-count { font-size: 0.78rem; color: #999; }
        .od-tree-arrow {
            display: inline-block; width: 16px; text-align: center; font-size: 0.7rem;
            cursor: pointer; transition: transform 0.15s; flex-shrink: 0; color: #999;
        }

        /* ============================================
           ONBOARDING POSITION MODIFIERS
           ============================================ */
        .onboarding-top::before,
        .onboarding-bottom::before,
        .onboarding-left::before,
        .onboarding-right::before {
            content: '';
            position: absolute;
            width: 10px;
            height: 10px;
            background: #fff;
            transform: rotate(45deg);
            box-shadow: -1px -1px 3px rgba(0, 0, 0, 0.06);
        }
        .onboarding-bottom::before { top: -5px; left: 24px; }
        .onboarding-top::before { bottom: -5px; left: 24px; box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.06); }
        .onboarding-right::before { left: -5px; top: 16px; }
        .onboarding-left::before { right: -5px; top: 16px; box-shadow: 1px -1px 3px rgba(0, 0, 0, 0.06); }

        /* ============================================
           IMAGE GENERATION
           ============================================ */
        .image-aspect-buttons {
            display: flex;
            gap: 6px;
            margin-left: 0;
            align-items: center;
            flex-wrap: wrap;
        }
        .image-settings-controls {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .image-model-select {
            width: 100%;
            min-width: 0 !important;
            max-width: 100%;
            height: 38px;
            padding: 6px 10px !important;
            font-size: 0.78rem !important;
            border-radius: 10px;
        }
        .aspect-btn {
            min-width: 36px !important;
            padding: 6px 10px !important;
            font-size: 0.82rem !important;
        }
        .image-gen-container {
            margin: 8px 0;
        }
        .image-gen-container img {
            max-width: 100%;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
        }
        .image-gen-prompt {
            margin-top: 8px;
            padding: 8px 12px;
            background: #f8f9fa;
            border-radius: 8px;
            font-size: 0.8rem;
            color: #6b7b8d;
            cursor: pointer;
        }
        .image-gen-prompt summary {
            font-weight: 500;
            color: #495057;
        }
        .image-gen-prompt pre {
            margin-top: 4px;
            white-space: pre-wrap;
            font-size: 0.78rem;
        }
        .image-gen-actions {
            margin-top: 8px;
            display: flex;
            gap: 8px;
        }
        .image-gen-actions button {
            background: var(--brand-soft-bg, #f4f0ec);
            border: 1px solid var(--brand-soft-border, #d5c6b8);
            border-radius: 6px;
            padding: 4px 10px;
            font-size: 0.78rem;
            cursor: pointer;
            color: #495057;
        }
        .image-gen-actions button:hover {
            border-color: var(--brand-emphasis, #8B5E3C);
            color: var(--brand-emphasis, #8B5E3C);
        }
        .image-loading {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 16px;
            color: #6b7b8d;
        }
        .image-loading .spinner {
            width: 20px; height: 20px;
            border: 2px solid #e0e4e8;
            border-top-color: var(--brand-primary, #8B5E3C);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        /* ============================================
           TEMPORÄRER ANHANG (Attach Button + Chips)
           ============================================ */
        .attach-btn {
            width: 36px; height: 36px;
            border-radius: 8px;
            background: transparent;
            border: 1px solid #d0d5dd;
            color: var(--brand-primary, #8B5E3C);
            font-size: 1.1rem;
            cursor: pointer;
            transition: all 0.15s;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            line-height: 1;
        }
        .attach-btn:hover {
            border-color: var(--brand-primary, #8B5E3C);
            background: var(--brand-soft-bg, rgba(139, 94, 60, 0.08));
        }
        .attach-btn.has-files {
            background: var(--brand-soft-bg, rgba(139, 94, 60, 0.08));
            border-color: var(--brand-soft-border, rgba(139, 94, 60, 0.3));
            color: var(--brand-emphasis, #6B4226);
        }
        .attach-btn.uploading {
            opacity: 0.6;
            cursor: wait;
        }

        .attach-badge-area {
            display: none;
            flex-wrap: wrap;
            gap: 6px;
            padding: 0 2px;
            margin-bottom: 6px;
            pointer-events: all;
        }
        .attach-badge-area.active { display: flex; }

        .attach-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px 10px 4px 12px;
            border-radius: 999px;
            background: var(--brand-soft-bg, rgba(139, 94, 60, 0.08));
            border: 1px solid var(--brand-soft-border, rgba(139, 94, 60, 0.2));
            font-size: 0.75rem;
            color: var(--brand-emphasis, #6B4226);
            max-width: 220px;
            white-space: nowrap;
            overflow: hidden;
        }
        .attach-chip .chip-name {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            min-width: 0;
        }
        .attach-chip .chip-close {
            background: none;
            border: none;
            color: #6b7b8d;
            cursor: pointer;
            font-size: 0.9rem;
            padding: 0 2px;
            flex-shrink: 0;
            line-height: 1;
        }
        .attach-chip .chip-close:hover { color: #e53e3e; }
        .attach-chip.uploading {
            opacity: 0.6;
            border-style: dashed;
        }
        @keyframes spin { to { transform: rotate(360deg); } }