﻿/* ============================================================
   W6 / WX RichText V2 – Theme Override FINAL
   ------------------------------------------------------------
   Wichtig:
   - Für RichText V2 mit wx-/Svelte-Klassen
   - Muss NACH richtext.css geladen werden
   - Dark, Contrast-Dark, Light und Contrast-Light
   - Keine harten Positions-/Höhenwerte für Dropdowns setzen
   - Keine Textfarbe mit !important im Editorinhalt erzwingen
   ============================================================ */


/* ============================================================
   1) THEME VARIABLEN
   ============================================================ */

/* ---------- DARK ---------- */
html[data-wiso-theme="dark"],
html[data-wiso-theme="contrast-dark"] {
    --w6rt2-bg: #3f4350;
    --w6rt2-bg2: #0f172a;
    --w6rt2-surface: rgba(18,24,36,0.98);
    --w6rt2-surface2: rgba(12,18,28,0.98);
    --w6rt2-border: rgba(255,255,255,0.14);
    --w6rt2-border2: rgba(255,255,255,0.08);
    --w6rt2-text: rgba(235,242,255,0.92);
    --w6rt2-muted: rgba(235,242,255,0.62);
    --w6rt2-accent: rgba(120,180,255,0.98);
    --w6rt2-hover: rgba(120,180,255,0.12);
    --w6rt2-active: rgba(120,180,255,0.18);
    --w6rt2-editor-bg: #3f4350;
    --w6rt2-paper-bg: #ffffff;
    --w6rt2-paper-text: #111827;
    --w6rt2-shadow: 0 18px 42px rgba(0,0,0,0.52);
}

/* ---------- LIGHT / CONTRAST-LIGHT ---------- */
html[data-wiso-theme="light"],
html[data-wiso-theme="contrast-light"] {
    --w6rt2-bg: #f3f6fb;
    --w6rt2-bg2: #e8eef7;
    --w6rt2-surface: rgba(255,255,255,0.96);
    --w6rt2-surface2: rgba(242,246,252,0.98);
    --w6rt2-border: rgba(11,79,158,0.22);
    --w6rt2-border2: rgba(15,23,42,0.10);
    --w6rt2-text: rgba(31,41,55,0.96);
    --w6rt2-muted: rgba(71,85,105,0.72);
    --w6rt2-accent: rgba(11,79,158,0.95);
    --w6rt2-hover: rgba(65,167,225,0.10);
    --w6rt2-active: rgba(65,167,225,0.18);
    --w6rt2-editor-bg: #ffffff;
    --w6rt2-paper-bg: #ffffff;
    --w6rt2-paper-text: #111827;
    --w6rt2-shadow: 0 14px 32px rgba(15,23,42,0.14);
}

/* Contrast-Light etwas kräftiger */
html[data-wiso-theme="contrast-light"] {
    --w6rt2-bg: #eef3fb;
    --w6rt2-bg2: #dfe9f7;
    --w6rt2-surface: rgba(255,255,255,0.98);
    --w6rt2-surface2: rgba(235,242,252,0.98);
    --w6rt2-border: rgba(11,79,158,0.36);
    --w6rt2-border2: rgba(15,23,42,0.16);
    --w6rt2-text: rgba(15,23,42,0.98);
    --w6rt2-muted: rgba(51,65,85,0.82);
    --w6rt2-hover: rgba(11,79,158,0.12);
    --w6rt2-active: rgba(11,79,158,0.20);
}


    /* ============================================================
   2) WX THEME VARIABLEN ÜBERSCHREIBEN
   ============================================================ */

    html[data-wiso-theme="dark"] .wx-willow-theme,
    html[data-wiso-theme="dark"] .wx-willow-dark-theme,
    html[data-wiso-theme="dark"] .wx-material-theme,
    html[data-wiso-theme="contrast-dark"] .wx-willow-theme,
    html[data-wiso-theme="contrast-dark"] .wx-willow-dark-theme,
    html[data-wiso-theme="contrast-dark"] .wx-material-theme,
    html[data-wiso-theme="light"] .wx-willow-theme,
    html[data-wiso-theme="light"] .wx-willow-dark-theme,
    html[data-wiso-theme="light"] .wx-material-theme,
    html[data-wiso-theme="contrast-light"] .wx-willow-theme,
    html[data-wiso-theme="contrast-light"] .wx-willow-dark-theme,
    html[data-wiso-theme="contrast-light"] .wx-material-theme {
        --wx-background: var(--w6rt2-bg);
        --wx-background-alt: var(--w6rt2-surface);
        --wx-background-hover: var(--w6rt2-hover);
        --wx-color-font: var(--w6rt2-text);
        --wx-color-font-alt: var(--w6rt2-muted);
        --wx-color-font-disabled: rgba(120,130,150,0.48);
        --wx-color-primary: var(--w6rt2-accent);
        --wx-color-primary-font: #ffffff;
        --wx-color-primary-selected: var(--w6rt2-active);
        --wx-color-secondary: rgba(255,255,255,0.06);
        --wx-color-secondary-font: var(--w6rt2-text);
        --wx-color-secondary-border: var(--w6rt2-border);
        --wx-color-secondary-hover: var(--w6rt2-hover);
        --wx-color-secondary-font-hover: var(--w6rt2-text);
        --wx-border: 1px solid var(--w6rt2-border);
        --wx-border-medium: 1px solid var(--w6rt2-border2);
        --wx-border-color: var(--w6rt2-border);
        --wx-popup-background: var(--w6rt2-surface);
        --wx-popup-border: 1px solid var(--w6rt2-border);
        --wx-popup-shadow: var(--w6rt2-shadow);
        --wx-input-background: var(--w6rt2-surface2);
        --wx-input-background-disabled: rgba(120,130,150,0.08);
        --wx-input-font-color: var(--w6rt2-text);
        --wx-input-placeholder-color: var(--w6rt2-muted);
        --wx-input-icon-color: var(--w6rt2-muted);
        --wx-input-border: 1px solid var(--w6rt2-border);
        --wx-input-border-focus: 1px solid var(--w6rt2-accent);
        --wx-input-border-disabled: 1px solid var(--w6rt2-border2);
        --wx-button-background: transparent;
        --wx-button-font-color: var(--w6rt2-text);
        --wx-button-border: 1px solid transparent;
    }


/* ============================================================
   3) RICHTEXT HOST / CONTAINER
   ============================================================ */

.wx-richtext,
.wx-content-container {
    border-radius: 12px !important;
}

html[data-wiso-theme="dark"] .wx-richtext,
html[data-wiso-theme="contrast-dark"] .wx-richtext,
html[data-wiso-theme="dark"] .wx-content-container,
html[data-wiso-theme="contrast-dark"] .wx-content-container,
html[data-wiso-theme="light"] .wx-richtext,
html[data-wiso-theme="contrast-light"] .wx-richtext,
html[data-wiso-theme="light"] .wx-content-container,
html[data-wiso-theme="contrast-light"] .wx-content-container {
    background: var(--w6rt2-bg) !important;
    color: var(--w6rt2-text);
}


/* ============================================================
   4) W6 WINDOW FIX
   ============================================================ */

.w6_as2monitor_window .wiso_window-content,
.w6_as2monitor_window [data-cell-id="content"],
.w6_as2monitor_window .wiso_cell_content,
.w6_as2monitor_window .w6-richtext-v2-host,
.w6_as2monitor_window .wx-richtext,
.w6_as2monitor_window .wx-content-container {
    overflow: visible !important;
}


/* ============================================================
   5) MENUBAR
   ============================================================ */

.wx-menubar {
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
    padding: 3px 6px !important;
    width: fit-content !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

    .wx-menubar > .wx-item,
    .wx-menubar > button.wx-item {
        height: 26px !important;
        min-height: 26px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 10px !important;
        margin: 0 !important;
        border: 1px solid transparent !important;
        border-radius: 7px !important;
        outline: none !important;
        box-shadow: none !important;
        background: transparent !important;
        font-size: 12px !important;
        font-weight: 500 !important;
        line-height: 1 !important;
        text-align: center !important;
        cursor: pointer !important;
        color: var(--w6rt2-text) !important;
    }

        .wx-menubar > .wx-item:hover,
        .wx-menubar > button.wx-item:hover {
            background: var(--w6rt2-hover) !important;
            border-color: var(--w6rt2-border) !important;
            color: var(--w6rt2-accent) !important;
        }

html[data-wiso-theme="dark"] .wx-menubar > .wx-item:hover,
html[data-wiso-theme="contrast-dark"] .wx-menubar > .wx-item:hover,
html[data-wiso-theme="dark"] .wx-menubar > button.wx-item:hover,
html[data-wiso-theme="contrast-dark"] .wx-menubar > button.wx-item:hover {
    color: #ffffff !important;
}

.wx-menubar > .wx-item.wx-active,
.wx-menubar > .wx-item.wx-pressed,
.wx-menubar > button.wx-item.wx-active,
.wx-menubar > button.wx-item.wx-pressed {
    background: var(--w6rt2-active) !important;
    border-color: var(--w6rt2-accent) !important;
}


/* ============================================================
   6) TOOLBAR
   ============================================================ */

.wx-richtext-toolbar {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    overflow: visible !important;
    padding-top: 6px;
}

html[data-wiso-theme="dark"] .wx-richtext-toolbar,
html[data-wiso-theme="contrast-dark"] .wx-richtext-toolbar,
html[data-wiso-theme="dark"] .wx-richtext-menubar,
html[data-wiso-theme="contrast-dark"] .wx-richtext-menubar,
html[data-wiso-theme="light"] .wx-richtext-toolbar,
html[data-wiso-theme="contrast-light"] .wx-richtext-toolbar,
html[data-wiso-theme="light"] .wx-richtext-menubar,
html[data-wiso-theme="contrast-light"] .wx-richtext-menubar {
    background: linear-gradient(180deg, var(--w6rt2-surface), var(--w6rt2-surface2)) !important;
    border-bottom: 1px solid var(--w6rt2-border) !important;
}

/* Toolbar Buttons */
.wx-toolbar-element button,
.wx-button {
    color: var(--w6rt2-text) !important;
    background-color: transparent !important;
    border-radius: 8px;
}

    .wx-toolbar-element button:hover,
    .wx-button:hover {
        background: var(--w6rt2-hover) !important;
    }

.wx-pressed,
.wx-active {
    background: var(--w6rt2-active) !important;
}


/* ============================================================
   7) ICONS
   ============================================================ */

.wx-icon,
[class^="wxi-"],
[class*=" wxi-"] {
    color: var(--w6rt2-text) !important;
}


/* ============================================================
   8) EDITOR-FLÄCHE
   ============================================================ */

html[data-wiso-theme="dark"] .wx-editor,
html[data-wiso-theme="contrast-dark"] .wx-editor,
html[data-wiso-theme="dark"] .wx-editor-wrapper,
html[data-wiso-theme="contrast-dark"] .wx-editor-wrapper,
html[data-wiso-theme="light"] .wx-editor,
html[data-wiso-theme="contrast-light"] .wx-editor,
html[data-wiso-theme="light"] .wx-editor-wrapper,
html[data-wiso-theme="contrast-light"] .wx-editor-wrapper {
    background: var(--w6rt2-bg) !important;
}

html[data-wiso-theme="dark"] .wx-editor-content,
html[data-wiso-theme="contrast-dark"] .wx-editor-content,
html[data-wiso-theme="light"] .wx-editor-content,
html[data-wiso-theme="contrast-light"] .wx-editor-content {
    background: var(--w6rt2-editor-bg) !important;
    color: var(--w6rt2-text);
    caret-color: var(--w6rt2-text);
    overflow: auto;
}

    /* Keine feste Farbe auf Inhalte erzwingen. */
    html[data-wiso-theme="dark"] .wx-editor-content p,
    html[data-wiso-theme="dark"] .wx-editor-content span,
    html[data-wiso-theme="dark"] .wx-editor-content div,
    html[data-wiso-theme="dark"] .wx-editor-content font,
    html[data-wiso-theme="contrast-dark"] .wx-editor-content p,
    html[data-wiso-theme="contrast-dark"] .wx-editor-content span,
    html[data-wiso-theme="contrast-dark"] .wx-editor-content div,
    html[data-wiso-theme="contrast-dark"] .wx-editor-content font,
    html[data-wiso-theme="light"] .wx-editor-content p,
    html[data-wiso-theme="light"] .wx-editor-content span,
    html[data-wiso-theme="light"] .wx-editor-content div,
    html[data-wiso-theme="light"] .wx-editor-content font,
    html[data-wiso-theme="contrast-light"] .wx-editor-content p,
    html[data-wiso-theme="contrast-light"] .wx-editor-content span,
    html[data-wiso-theme="contrast-light"] .wx-editor-content div,
    html[data-wiso-theme="contrast-light"] .wx-editor-content font {
        color: inherit;
    }

/* Links ohne Inline-Farbe */
.wx-editor-content a:not([style*="color"]) {
    color: var(--w6rt2-accent);
}

/* Placeholder */
.wx-editor-content:empty:before {
    color: var(--w6rt2-muted);
}

/* Textauswahl */
.wx-editor-content ::selection {
    background: var(--w6rt2-active);
    color: inherit;
}

/* Code / Pre */
.wx-editor-content code,
.wx-editor-content pre {
    background: rgba(120,130,150,0.10) !important;
    border: 1px solid var(--w6rt2-border2) !important;
    border-radius: 8px;
    color: inherit;
}


/* ============================================================
   9) DOCUMENT / PAPER MODE
   ============================================================ */

.wx-document-mode {
    background: var(--w6rt2-bg2) !important;
}

    .wx-document-mode .wx-editor-content {
        background: var(--w6rt2-paper-bg) !important;
        color: var(--w6rt2-paper-text);
        caret-color: var(--w6rt2-paper-text);
        box-shadow: var(--w6rt2-shadow);
    }

.w6-richtext-paper-mode .wx-editor-content {
    background: var(--w6rt2-paper-bg) !important;
    color: var(--w6rt2-paper-text);
    caret-color: var(--w6rt2-paper-text);
}

    .w6-richtext-paper-mode .wx-editor-content p,
    .w6-richtext-paper-mode .wx-editor-content span,
    .w6-richtext-paper-mode .wx-editor-content div {
        color: inherit;
    }


/* ============================================================
   10) MENÜS / DROPDOWNS / POPUPS
   ============================================================ */

.wx-portal,
.wx-dropdown,
.wx-popup,
.wx-menu,
.wx-richtext-menu,
.wx-colorpicker-dropdown,
.wx-context-menu,
.wx-list {
    z-index: 2147483000 !important;
}

/* Popup-Optik für alle Themes */
.wx-popup,
.wx-dropdown,
.wx-menu,
.wx-richtext-menu,
.wx-colorpicker-dropdown,
.wx-context-menu,
.wx-list {
    background: linear-gradient(180deg, var(--w6rt2-surface), var(--w6rt2-surface2)) !important;
    border: 1px solid var(--w6rt2-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--w6rt2-shadow) !important;
    color: var(--w6rt2-text) !important;
}

    /* Menüeinträge */
    .wx-menu .wx-item,
    .wx-richtext-menu .wx-item {
        background: transparent !important;
        color: var(--w6rt2-text) !important;
    }

        .wx-menu .wx-item:hover,
        .wx-richtext-menu .wx-item:hover {
            background: var(--w6rt2-hover) !important;
        }

/* Popup-Texte */
.wx-value,
.wx-subtext {
    color: var(--w6rt2-text) !important;
}


/* ============================================================
   11) INPUTS / SELECTS / COLORPICKER
   ============================================================ */

.wx-richtext input,
.wx-richtext textarea,
.wx-richtext select,
.wx-richtext .wx-richselect,
.wx-richtext .wx-colorpicker {
    background: var(--w6rt2-surface2) !important;
    color: var(--w6rt2-text) !important;
    border-color: var(--w6rt2-border) !important;
}

    .wx-richtext input:focus,
    .wx-richtext textarea:focus,
    .wx-richtext select:focus,
    .wx-richtext .wx-richselect:focus,
    .wx-richtext .wx-colorpicker:focus {
        border-color: var(--w6rt2-accent) !important;
    }

.wx-colorpicker-preview {
    color: var(--w6rt2-text) !important;
}


/* ============================================================
   12) FULLSCREEN
   ============================================================ */

.wx-fullscreen-mode-wrapper {
    background: var(--w6rt2-bg2) !important;
}


/* ============================================================
   13) SCROLLBAR
   ============================================================ */

.wx-editor-content::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.wx-editor-content::-webkit-scrollbar-thumb {
    background: rgba(120,130,150,0.34);
    border-radius: 999px;
}

    .wx-editor-content::-webkit-scrollbar-thumb:hover {
        background: rgba(120,130,150,0.48);
    }


/* ============================================================
   14) TABBAR / RESTORE / PARKING
   ============================================================ */

.w6-richtext-tabbar-fixed {
    width: 850px !important;
    min-width: 850px !important;
    max-width: 850px !important;
    flex: 0 0 850px !important;
    overflow: hidden !important;
    min-height: 0 !important;
}

.w6-richtext-tabbar-content {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
}


.w6-richtext-tabbar-fixed .wiso_tabbar-content,
.w6-richtext-tabbar-fixed .wiso_tabbar-cell,
.w6-richtext-tabbar-fixed .wiso_layout-cell {
    overflow: hidden !important;
    min-height: 0 !important;
}

.w6-richtext-tabbar-fixed .w6-richtext-v2-host,
.w6-richtext-tabbar-fixed .wx-content-container,
.w6-richtext-tabbar-fixed .wx-richtext {
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.w6-richtext-tabbar-fixed .wx-editor-content {
    overflow: auto !important;
    min-height: 0 !important;
}

.w6-richtext-v2-host {
    transition: opacity 180ms ease, transform 180ms ease;
    will-change: opacity, transform;
}

    .w6-richtext-v2-host.w6-richtext-restoring {
        opacity: 0;
        transform: translateY(6px);
        pointer-events: none;
    }

    .w6-richtext-v2-host.w6-richtext-restored {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

#w6-richtext-parking-host > .w6-richtext-is-parked {
    width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.w6-richtext-tabbar-fixed .w6-richtext-v2-host {
    width: 100% !important;
    height: 100% !important;
    min-height: 420px;
    overflow: hidden !important;
}

    .w6-richtext-tabbar-fixed .w6-richtext-v2-host .wx-richtext,
    .w6-richtext-tabbar-fixed .w6-richtext-v2-host .wx-content-container {
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .w6-richtext-tabbar-fixed .w6-richtext-v2-host .wx-editor-content {
        min-height: 0 !important;
        overflow: auto !important;
    }
/* ==========================================================
   W6 RichText V2 – Light / Contrast-Light Edel Fix
   Ziel:
   - Content sichtbar vom Hintergrund getrennt
   - Rundungen klar erkennbar
   - Toolbar weniger blass
   - W6-like helle Kartenoptik
   ========================================================== */

html[data-wiso-theme="light"] .wx-richtext,
html[data-wiso-theme="contrast-light"] .wx-richtext,
html[data-wiso-theme="light"] .wx-content-container,
html[data-wiso-theme="contrast-light"] .wx-content-container {
    background: linear-gradient(180deg, #f7faff, #edf3fb) !important;
    border: 1px solid rgba(11,79,158,0.20) !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 30px rgba(15,23,42,0.10), inset 0 1px 0 rgba(255,255,255,0.85) !important;
    overflow: hidden !important;
}

/* Menubar/Toolbar stärker absetzen */
html[data-wiso-theme="light"] .wx-richtext-toolbar,
html[data-wiso-theme="contrast-light"] .wx-richtext-toolbar,
html[data-wiso-theme="light"] .wx-richtext-menubar,
html[data-wiso-theme="contrast-light"] .wx-richtext-menubar {
    background: linear-gradient(180deg, #ffffff, #eef5ff) !important;
    border-bottom: 1px solid rgba(11,79,158,0.18) !important;
}

/* Toolbar-Button klarer sichtbar */
html[data-wiso-theme="light"] .wx-toolbar-element button,
html[data-wiso-theme="contrast-light"] .wx-toolbar-element button,
html[data-wiso-theme="light"] .wx-button,
html[data-wiso-theme="contrast-light"] .wx-button {
    background: linear-gradient(180deg, #ffffff, #f1f6fd) !important;
    border: 1px solid rgba(11,79,158,0.18) !important;
    border-radius: 9px !important;
    color: #1f2937 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 2px 6px rgba(15,23,42,0.08) !important;
}

    html[data-wiso-theme="light"] .wx-toolbar-element button:hover,
    html[data-wiso-theme="contrast-light"] .wx-toolbar-element button:hover,
    html[data-wiso-theme="light"] .wx-button:hover,
    html[data-wiso-theme="contrast-light"] .wx-button:hover {
        background: rgba(65,167,225,0.14) !important;
        border-color: rgba(11,79,158,0.38) !important;
    }

/* Editorfläche als sichtbare Karte */
html[data-wiso-theme="light"] .wx-editor,
html[data-wiso-theme="contrast-light"] .wx-editor,
html[data-wiso-theme="light"] .wx-editor-wrapper,
html[data-wiso-theme="contrast-light"] .wx-editor-wrapper {
    background: #edf3fb !important;
    padding: 12px !important;
}

html[data-wiso-theme="light"] .wx-editor-content,
html[data-wiso-theme="contrast-light"] .wx-editor-content {
    background: #ffffff !important;
    border: 1px solid rgba(11,79,158,0.18) !important;
    border-radius: 14px !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 8px 22px rgba(15,23,42,0.08) !important;
    color: #111827;
    caret-color: #111827;
    padding: 14px !important;
    box-sizing: border-box !important;
}

/* Tab/Notizen-Kopf sichtbarer */
html[data-wiso-theme="light"] .wiso_tabbar-tab,
html[data-wiso-theme="contrast-light"] .wiso_tabbar-tab {
    background: linear-gradient(180deg, #ffffff, #eef5ff) !important;
    border: 1px solid rgba(11,79,158,0.22) !important;
    border-radius: 10px 10px 0 0 !important;
    color: #1f2937 !important;
}

html[data-wiso-theme="light"] .wiso_tabbar-tab--active,
html[data-wiso-theme="contrast-light"] .wiso_tabbar-tab--active {
    border-bottom-color: #008bd2 !important;
    box-shadow: inset 0 -2px 0 #008bd2 !important;
}

/* ==========================================================
   W6 RichText V2 in Form-Tabbar
   Ziel:
   - äußerer DB-Container bestimmt Breite/Höhe
   - nichts wächst über 1000 x 400 hinaus
   - Tabheader + RichText bleiben innerhalb des Containers
   - nur Editor-Inhalt scrollt
   ========================================================== */

/* Äußerer Form-Container: DB-Werte bleiben führend */
.wiso_layout-cell.wiso_form-element[data-cell-id="description"] {
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Form-Gruppe und Layout übernehmen exakt die Containergröße */
.wiso_layout-cell[data-cell-id="description"] .wiso_form-group,
.wiso_layout-cell[data-cell-id="description"] .wiso_layout {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Tabbar darf nicht mehr 850px oder eigene Höhen erzwingen */
.wiso_layout-cell[data-cell-id="description"] .w6-richtext-tabbar-fixed,
.wiso_layout-cell[data-cell-id="description"] .wiso_tabbar {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Tab-Header bleibt oben und nimmt nur seine echte Höhe */
.wiso_layout-cell[data-cell-id="description"] .wiso_tabbar-header__wrapper,
.wiso_layout-cell[data-cell-id="description"] .wiso_tabbar-header {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    max-height: 48px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Aktiver Tab-Inhalt nimmt die Resthöhe */
.wiso_layout-cell[data-cell-id="description"] .wiso_tabbar-cell,
.wiso_layout-cell[data-cell-id="description"] .wiso_layout-cell[data-cell-id="richtext"],
.wiso_layout-cell[data-cell-id="description"] [aria-label="tab-content-richtext"] {
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* HTML-Wrapper in der Tabbar */
.wiso_layout-cell[data-cell-id="description"] .wiso_layout-cell-content,
.wiso_layout-cell[data-cell-id="description"] .wiso_layout-cell-inner_html {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* WICHTIG:
   Inline min-height:420px überschreiben */
.wiso_layout-cell[data-cell-id="description"] .w6-richtext-v2-host,
.wiso_layout-cell[data-cell-id="description"] .w6-richtext-host {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* WX-Container dürfen nicht größer werden */
.wiso_layout-cell[data-cell-id="description"] .wx-content-container,
.wiso_layout-cell[data-cell-id="description"] .wx-richtext {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Menubar + Toolbar feste natürliche Höhe */
.wiso_layout-cell[data-cell-id="description"] .wx-richtext-menubar,
.wiso_layout-cell[data-cell-id="description"] .wx-richtext-toolbar {
    flex: 0 0 auto !important;
    overflow: visible !important;
}

/* Editorbereich bekommt Resthöhe */
.wiso_layout-cell[data-cell-id="description"] .wx-editor-area,
.wiso_layout-cell[data-cell-id="description"] .wx-editor-wrapper,
.wiso_layout-cell[data-cell-id="description"] .wx-editor {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* Nur der eigentliche Inhalt scrollt */
.wiso_layout-cell[data-cell-id="description"] .wx-editor-content {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
    overflow: auto !important;
    box-sizing: border-box !important;
    padding: 14px 16px 24px 16px !important;
}

/* ==========================================================
   W6 RichText V2 – Editor Content Scroll Fix
   ========================================================== */

.wiso_layout-cell[data-cell-id="description"] .wx-richtext {
    overflow: hidden !important;
}

.wiso_layout-cell[data-cell-id="description"] .wx-editor-area,
.wiso_layout-cell[data-cell-id="description"] .wx-editor-wrapper,
.wiso_layout-cell[data-cell-id="description"] .wx-editor {
    min-height: 0 !important;
    height: 100% !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
}

.wiso_layout-cell[data-cell-id="description"] .wx-editor-content {
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    padding: 14px 16px 28px 16px !important;
}

    /* Falls wx-editor-content durch Svelte intern keine Flex-Höhe bekommt */
    .wiso_layout-cell[data-cell-id="description"] .wx-editor-content[contenteditable="true"] {
        display: block !important;
        overflow-y: auto !important;
    }

/* ==========================================================
   W6 RichText V2 – Fullscreen + Menüs FINAL
   ========================================================== */

.wx-fullscreen-mode-wrapper,
.wx-fullscreen-mode,
.wx-richtext-fullscreen,
.wx-richtext.wx-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483000 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

    /* Fullscreen RichText */
    .wx-fullscreen-mode-wrapper .wx-richtext,
    .wx-fullscreen-mode .wx-richtext {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
    }

    /* Editorbereich intern begrenzen */
    .wx-fullscreen-mode-wrapper .wx-editor-area,
    .wx-fullscreen-mode-wrapper .wx-editor-wrapper,
    .wx-fullscreen-mode-wrapper .wx-editor,
    .wx-fullscreen-mode .wx-editor-area,
    .wx-fullscreen-mode .wx-editor-wrapper,
    .wx-fullscreen-mode .wx-editor {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    /* Nur Editor-Content scrollt */
    .wx-fullscreen-mode-wrapper .wx-editor-content,
    .wx-fullscreen-mode .wx-editor-content {
        height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

/* WX-Menüs liegen über Fullscreen */
.wx-portal,
.wx-dropdown,
.wx-popup,
.wx-menu,
.wx-richtext-menu,
.wx-colorpicker-dropdown,
.wx-context-menu,
.wx-list {
    z-index: 2147483600 !important;
}

/* Falls Menüs innerhalb Fullscreen gerendert werden */
.wx-fullscreen-mode-wrapper .wx-portal,
.wx-fullscreen-mode-wrapper .wx-dropdown,
.wx-fullscreen-mode-wrapper .wx-popup,
.wx-fullscreen-mode-wrapper .wx-menu,
.wx-fullscreen-mode-wrapper .wx-richtext-menu,
.wx-fullscreen-mode-wrapper .wx-colorpicker-dropdown,
.wx-fullscreen-mode-wrapper .wx-context-menu,
.wx-fullscreen-mode-wrapper .wx-list {
    z-index: 2147483640 !important;
    overflow: visible !important;
}

/* ==========================================================
   W6 RichText V2 – White Paper Mode nur Editorbereich
   Klasse sitzt direkt auf .wx-editor-area
   ========================================================== */

.wx-editor-area.w6-richtext-white-paper-mode,
.wx-editor-area.w6-richtext-white-paper-mode .wx-editor-wrapper,
.wx-editor-area.w6-richtext-white-paper-mode .wx-editor {
    background: #ffffff !important;
}

    .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content,
    .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content[contenteditable="true"] {
        background: #ffffff !important;
        color: #111827 !important;
        caret-color: #111827 !important;
    }

        .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content p,
        .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content span,
        .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content div,
        .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content font,
        .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content table,
        .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content tbody,
        .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content thead,
        .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content tr,
        .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content td,
        .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content th {
            color: #111827 !important;
        }

        .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content table {
            background: #ffffff !important;
            border-color: #d1d5db !important;
        }

        .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content td,
        .wx-editor-area.w6-richtext-white-paper-mode .wx-editor-content th {
            border-color: #d1d5db !important;
        }