        /* Farby podľa Screenshoty/Rozhranie Modulario.png
           - Left rail: #FDFDFD (white)
           - Top tabs bar: #EAEDF4 (light blue-gray)
           - Summary / toolbar / footer: #FFFFFF
           - Table rows: alternate #FFFFFF / #F4F4F4
        */
        /* HTML root background musí byť rovnakej farby ako app shell, inak sa medzi dvoma multi-page
           navigáciami zobrazí biely (alebo OS-default) flash. Setupujeme to PRED #app, aby browser
           pri page-swap mal už korektný background v predošlom aj nasledujúcom dokumente. */
        html { background: #FFFFFF; color-scheme: light; }
        html[data-theme="dark"] { background: #0F1116; color-scheme: dark; }
        /* Cross-document View Transitions (Chrome 126+, Safari 18+).
           Auto-transitions medzi same-origin navigáciami plynulo cross-fadeujú celý DOM,
           čím schovajú preblik medzi ds/<id>.html stránkami. */
        @view-transition { navigation: auto; }
        ::view-transition-old(root), ::view-transition-new(root) {
            animation-duration: 180ms;
            animation-timing-function: ease-in-out;
        }
        body { font-family: 'Inter', ui-sans-serif, system-ui, sans-serif; background: #FFFFFF; font-size: 13px; overflow: hidden; }
        .app { display: grid; grid-template-columns: 1fr; height: 100vh; }

        /* ============================================================
           DARK MODE — aktivuje sa cez html[data-theme="dark"]
           Invertuje základné biele/šedé hex farby na tmavú paletu.
           Možnosti aktivácie (Profil → Preferencie → Téma):
             • Svetlá (default)
             • Tmavá (vždy dark)
             • Systémová (sleduje prefers-color-scheme)
             • Automaticky (v noci) — 19:00–07:00 dark, inak svetlo
           ============================================================ */
        html[data-theme="dark"] { color-scheme: dark; }
        html[data-theme="dark"] body,
        html[data-theme="dark"] .app { background: #0E0E10; color: #E5E5E7; }
        /* Layout surfaces */
        html[data-theme="dark"] .top-tabs { background: #15171C; border-bottom-color: #24262B; }
        html[data-theme="dark"] .table-footer,
        html[data-theme="dark"] .table-wrap,
        html[data-theme="dark"] .view-container,
        html[data-theme="dark"] .view-host,
        html[data-theme="dark"] .kanban-toolbar,
        html[data-theme="dark"] .cal2-toolbar { background: #0E0E10 !important; color: #E5E5E7; }
        /* Tabuľka */
        html[data-theme="dark"] table.dtable thead th { background: #1E2026 !important; color: #E5E5E7; border-color: #2A2D35 !important; }
        html[data-theme="dark"] table.dtable thead tr.filter-row th { background: #17191D !important; }
        html[data-theme="dark"] table.dtable thead th.col-actions-th { background: #1E2026 !important; box-shadow: -1px 0 0 0 #2A2D35, 0 1px 0 0 #2A2D35 !important; }
        html[data-theme="dark"] table.dtable thead tr.filter-row th.col-actions-th { background: #17191D !important; }
        html[data-theme="dark"] table.dtable tbody tr:nth-child(odd) td { background: #141518; color: #D8D9DD; }
        html[data-theme="dark"] table.dtable tbody tr:nth-child(even) td { background: #181A1E; color: #D8D9DD; }
        html[data-theme="dark"] table.dtable tbody tr:hover td { background: #232428 !important; }
        html[data-theme="dark"] table.dtable tbody td { border-color: #23252B; }
        html[data-theme="dark"] table.dtable tbody td.is-pinned-left,
        html[data-theme="dark"] table.dtable tbody td.is-pinned-right { background: #16181C !important; }
        html[data-theme="dark"] .cell-dots { background: #1C1E22 !important; color: #B8BAC0; }
        html[data-theme="dark"] .summary-row td { background: #1B1D20 !important; color: #E5E5E7; border-color: #2A2D35; }
        /* Karty, panely, modaly */
        html[data-theme="dark"] .cs-card,
        html[data-theme="dark"] .detail-panel,
        html[data-theme="dark"] .detail-modal,
        html[data-theme="dark"] .modal,
        html[data-theme="dark"] .cs-body,
        html[data-theme="dark"] .fs-overlay,
        html[data-theme="dark"] .company-settings { background: #16181C; color: #E5E5E7; border-color: #2A2D35; }
        html[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.65); }
        html[data-theme="dark"] .modal-head,
        html[data-theme="dark"] .modal-footer,
        html[data-theme="dark"] .cs-head { background: #16181C; border-color: #2A2D35; color: #E5E5E7; }
        html[data-theme="dark"] .cs-sidebar { background: #111214; border-color: #2A2D35; }
        html[data-theme="dark"] .cs-nav-item { color: #C8CACF; }
        html[data-theme="dark"] .cs-nav-item:hover { background: #1E2026; }
        html[data-theme="dark"] .cs-nav-item.active { background: #E5E5E7; color: #0E0E10; }
        html[data-theme="dark"] .cs-card-title,
        html[data-theme="dark"] .modal-title,
        html[data-theme="dark"] .dse-title { color: #F4F4F6; }
        html[data-theme="dark"] .cs-card-desc,
        html[data-theme="dark"] .cs-page-sub { color: #9EA0A6; }
        /* Formuláre */
        html[data-theme="dark"] .sh-input,
        html[data-theme="dark"] input[type="text"],
        html[data-theme="dark"] input[type="number"],
        html[data-theme="dark"] input[type="email"],
        html[data-theme="dark"] input[type="tel"],
        html[data-theme="dark"] input[type="date"],
        html[data-theme="dark"] input[type="datetime-local"],
        html[data-theme="dark"] textarea,
        html[data-theme="dark"] .adv-select-trigger,
        html[data-theme="dark"] .multi-select-trigger { background: #0E0E10 !important; color: #E5E5E7; border-color: #2A2D35; }
        html[data-theme="dark"] .sh-input::placeholder,
        html[data-theme="dark"] textarea::placeholder,
        html[data-theme="dark"] input::placeholder { color: #6A6C72; }
        html[data-theme="dark"] .adv-select-menu,
        html[data-theme="dark"] .multi-select-menu,
        html[data-theme="dark"] .cell-dropdown,
        html[data-theme="dark"] .sdp-popover,
        html[data-theme="dark"] .filter-menu,
        html[data-theme="dark"] .col-menu,
        html[data-theme="dark"] .actions-menu,
        html[data-theme="dark"] .agg-popup { background: #1A1C20; color: #E5E5E7; border-color: #2A2D35; box-shadow: 0 8px 24px rgba(0,0,0,0.6); }
        html[data-theme="dark"] .adv-select-item:hover,
        html[data-theme="dark"] .multi-item:hover,
        html[data-theme="dark"] .cell-dropdown-item:hover,
        html[data-theme="dark"] .sdp-day:hover,
        html[data-theme="dark"] .filter-menu-item:hover,
        html[data-theme="dark"] .col-menu-item:hover,
        html[data-theme="dark"] .actions-menu-item:hover,
        html[data-theme="dark"] .agg-popup-item:hover { background: #2A2D35; }
        html[data-theme="dark"] .sdp-day.selected { background: #E5E5E7; color: #0E0E10; }
        /* Command palette (⌘K) */
        html[data-theme="dark"] .cmdk-modal { background: #1A1C20; border-color: #2A2D35; box-shadow: 0 12px 40px rgba(0,0,0,0.65); }
        html[data-theme="dark"] .cmdk-search-row { border-color: #2A2D35; }
        html[data-theme="dark"] .cmdk-search-row svg { color: #9EA0A6; }
        html[data-theme="dark"] .cmdk-input { color: #E5E5E7; }
        html[data-theme="dark"] .cmdk-input::placeholder { color: #6A6C72; }
        html[data-theme="dark"] .cmdk-close { color: #9EA0A6; }
        html[data-theme="dark"] .cmdk-close:hover { color: #E5E5E7; }
        html[data-theme="dark"] .cmdk-kbd { background: #2A2D35; border-color: #3A3D45; color: #9EA0A6; }
        html[data-theme="dark"] .cmdk-list { color: #D8D9DD; }
        html[data-theme="dark"] .cmdk-section { color: #9EA0A6; }
        html[data-theme="dark"] .cmdk-section-count { background: #2A2D35; color: #9EA0A6; }
        html[data-theme="dark"] .cmdk-item:hover, html[data-theme="dark"] .cmdk-item.focused { background: #252830; border-left-color: #E8B22D; }
        html[data-theme="dark"] .cmdk-item-icon { background: #2A2D35; color: #D8D9DD; }
        html[data-theme="dark"] .cmdk-item-title { color: #E5E5E7; }
        html[data-theme="dark"] .cmdk-item-sub { color: #9EA0A6; }
        html[data-theme="dark"] .cmdk-item-hint { background: #2A2D35; color: #9EA0A6; }
        html[data-theme="dark"] .cmdk-item-action-btn { background: #2A2D35; color: #9EA0A6; }
        html[data-theme="dark"] .cmdk-item-action-btn:hover { background: #3A3D45; color: #E5E5E7; }
        html[data-theme="dark"] .cmdk-item.cmdk-ai { background: linear-gradient(90deg, rgba(232,178,45,0.08), transparent 60%); border-top-color: #2A2D35; }
        html[data-theme="dark"] .cmdk-item.cmdk-ai .cmdk-item-icon { background: rgba(232,178,45,0.15); }
        html[data-theme="dark"] .cmdk-empty { color: #9EA0A6; }
        html[data-theme="dark"] .cmdk-empty strong { color: #E5E5E7; }
        html[data-theme="dark"] .cmdk-footer { background: #161820; border-color: #2A2D35; color: #9EA0A6; }
        /* Buttony */
        html[data-theme="dark"] .sh-btn-outline { background: #1E2026; color: #E5E5E7; border-color: #2A2D35; }
        html[data-theme="dark"] .sh-btn-outline:hover { background: #2A2D35; }
        html[data-theme="dark"] .sh-btn-primary { background: #E5E5E7; color: #0E0E10; border-color: #E5E5E7; }
        html[data-theme="dark"] .sh-btn-primary:hover { background: #D4D4D6; }
        html[data-theme="dark"] .tf-toggle { background: #1E2026; color: #E5E5E7; border-color: #2A2D35; }
        html[data-theme="dark"] .tf-toggle:hover { background: #2A2D35; }
        html[data-theme="dark"] .tf-toggle[aria-pressed="true"] { background: #E5E5E7; color: #0E0E10; border-color: #E5E5E7; }
        /* Nav / breadcrumb */
        html[data-theme="dark"] .breadcrumb,
        html[data-theme="dark"] .breadcrumb a,
        html[data-theme="dark"] .nav-tab { color: #D8D9DD; }
        html[data-theme="dark"] .nav-tab:hover,
        html[data-theme="dark"] .nav-tab.active { background: #1E2026; color: #F4F4F6; }
        /* Kanban */
        html[data-theme="dark"] .kanban-col { background: #141518; border-color: #2A2D35; }
        html[data-theme="dark"] .kanban-col-head { background: #1A1C20; border-color: #2A2D35; }
        html[data-theme="dark"] .rc-card { background: #1A1C20; color: #E5E5E7; border-color: #2A2D35; }
        html[data-theme="dark"] .rc-card .rc-title { color: #F4F4F6; }
        /* Gantt */
        html[data-theme="dark"] .gantt2-right { background: #0E0E10; }
        html[data-theme="dark"] .gantt2-timeline-header { background: #1E2026; color: #E5E5E7; border-color: #2A2D35; }
        html[data-theme="dark"] .gantt2-month-cell,
        html[data-theme="dark"] .gantt2-day-cell { background: #1E2026 !important; color: #D8D9DD; border-color: #2A2D35 !important; }
        html[data-theme="dark"] .gantt2-day-cell.weekend { background: #17191D !important; }
        html[data-theme="dark"] .gantt2-day-cell.today { background: #3A2E0E !important; }
        html[data-theme="dark"] .gantt2-timeline-row:nth-child(odd) { background: #141518; }
        html[data-theme="dark"] .gantt2-timeline-row:nth-child(even) { background: #181A1E; }
        html[data-theme="dark"] .gantt2-grid-cell { border-color: #23252B !important; }
        html[data-theme="dark"] .gantt2-grid-cell.weekend { background: #14161A !important; }
        /* Kalendár */
        html[data-theme="dark"] .cal2-month-cell,
        html[data-theme="dark"] .cal2-week-col { background: #141518; border-color: #2A2D35; color: #D8D9DD; }
        html[data-theme="dark"] .cal2-month-cell.other { background: #17191D; color: #6A6C72; }
        html[data-theme="dark"] .cal2-month-cell.today,
        html[data-theme="dark"] .cal2-week-col.today { background: #2A2413; }
        html[data-theme="dark"] .cal2-month-dow > div,
        html[data-theme="dark"] .cal2-hour-label { color: #9EA0A6; }
        html[data-theme="dark"] .cal2-hour-slot { border-color: #23252B; }
        /* Chipy — jemné tmavé varianty (zachovaj farebnosť ale tmavšie pozadia) */
        html[data-theme="dark"] .chip-reported { background: #2A2D35; color: #B8BAC0; }
        html[data-theme="dark"] .chip-todo { background: #3A2E0E; color: #E8B22D; }
        html[data-theme="dark"] .chip-onhold { background: #E5E5E7; color: #0E0E10; }
        html[data-theme="dark"] .chip-cancelled { background: #3A1614; color: #F4A192; }
        /* Scroll */
        html[data-theme="dark"] *::-webkit-scrollbar { background: #0E0E10; }
        html[data-theme="dark"] *::-webkit-scrollbar-thumb { background: #2A2D35; }

        /* ── DARK MODE rozšírené pravidlá ── */
        /* Nav dropdowns */
        html[data-theme="dark"] .nav-menu,
        html[data-theme="dark"] .user-menu,
        html[data-theme="dark"] .gear-menu,
        html[data-theme="dark"] .company-switcher { background: #1A1C20; border-color: #2A2D35; box-shadow: 0 8px 24px rgba(0,0,0,0.55); }
        html[data-theme="dark"] .nav-menu-item { color: #D8D9DD; }
        html[data-theme="dark"] .nav-menu-item.current,
        html[data-theme="dark"] .company-switcher-item.current,
        html[data-theme="dark"] .company-switcher-add { background: #2A2D35 !important; color: #F4F4F6; }
        html[data-theme="dark"] .user-menu-item:hover,
        html[data-theme="dark"] .gear-menu-item:hover,
        html[data-theme="dark"] .company-switcher-item:hover,
        html[data-theme="dark"] .nav-menu-item:hover,
        html[data-theme="dark"] .nav-menu-item.active-trail { background: #2A2D35; color: #F4F4F6; }
        html[data-theme="dark"] .user-chevron-btn:hover { background: #2A2D35; }
        /* Toolbar & summary bar */
        html[data-theme="dark"] .toolbar,
        html[data-theme="dark"] .summary-bar { background: #0E0E10 !important; border-color: #2A2D35; }
        html[data-theme="dark"] .view-host { background: #0E0E10 !important; }
        /* Detail modal */
        html[data-theme="dark"] .detail-head { border-color: #2A2D35; }
        html[data-theme="dark"] .detail-tabs { border-color: #2A2D35; }
        html[data-theme="dark"] .detail-tab:hover { background: #2A2D35; color: #E5E5E7; }
        html[data-theme="dark"] .detail-tab.active { background: #2A2D35; color: #F4F4F6; border-bottom-color: #E8B22D; }
        html[data-theme="dark"] .detail-icon-btn:hover { background: #2A2D35; color: #E5E5E7; }
        html[data-theme="dark"] .detail-file-chip { background: #1E2026; border-color: #2A2D35; color: #D8D9DD; }
        html[data-theme="dark"] .detail-rel-input .sh-input { background: #17191D; }
        html[data-theme="dark"] .detail-rel-open:hover { background: #2A2D35; }
        html[data-theme="dark"] .detail-modal-switcher-item { background: #1A1C20; border-color: #2A2D35; color: #D8D9DD; }
        html[data-theme="dark"] .detail-modal-switcher-item:hover { background: #2A2D35; }
        html[data-theme="dark"] .detail-modal-switcher-item.active { background: #E5E5E7; color: #0E0E10; border-color: #E5E5E7; }
        /* Comment panel */
        html[data-theme="dark"] .chat-panel { background: #16181C; border-color: #2A2D35; }
        html[data-theme="dark"] .cmt-filters { background: #16181C; border-color: #2A2D35; }
        html[data-theme="dark"] .cmt-chip { background: #1E2026; color: #C8CACF; }
        html[data-theme="dark"] .cmt-chip:hover { background: #2A2D35; }
        html[data-theme="dark"] .cmt-chip.active { background: #E5E5E7; color: #0E0E10; }
        html[data-theme="dark"] .cmt-chip:not(.active) .cmt-chip-count { background: #2A2D35; color: #9EA0A6; }
        html[data-theme="dark"] .cmt-sort-btn,
        html[data-theme="dark"] .cmt-subscribe-btn { border-color: #2A2D35; color: #C8CACF; }
        html[data-theme="dark"] .cmt-sort-btn:hover,
        html[data-theme="dark"] .cmt-subscribe-btn:hover { background: #2A2D35; }
        html[data-theme="dark"] .cmt-list { background: #0E0E10; }
        html[data-theme="dark"] .cmt-item { background: #1A1C20; border-color: #2A2D35; }
        html[data-theme="dark"] .cmt-item.pinned { background: #2A2210; border-color: #6A5218; }
        html[data-theme="dark"] .cmt-reply { background: #17191D; border-color: #2A2D35; }
        html[data-theme="dark"] .cmt-compose-wrap { background: #16181C !important; border-color: #2A2D35; }
        html[data-theme="dark"] .cmt-rte-toolbar { background: #17191D; border-color: #2A2D35; }
        html[data-theme="dark"] .cmt-editor { background: #0E0E10; border-color: #2A2D35; color: #E5E5E7; }
        html[data-theme="dark"] .cmt-edited-badge,
        html[data-theme="dark"] .cmt-resolved-badge { background: #2A2D35; color: #9EA0A6; }
        html[data-theme="dark"] .cmt-pin-badge { background: #3A2E0E; color: #D4A030; }
        /* History */
        html[data-theme="dark"] .hist-entry { background: #1A1C20; border-color: #2A2D35; }
        html[data-theme="dark"] .hist-diff { background: #17191D; }
        /* Chat app */
        html[data-theme="dark"] .chat-list { background: #111214; border-color: #2A2D35; }
        html[data-theme="dark"] .chat-conv:hover { background: #1E2026; }
        html[data-theme="dark"] .chat-conv.active { background: #16181C; }
        html[data-theme="dark"] .chat-view { background: #16181C; }
        html[data-theme="dark"] .chat-view-head { border-color: #2A2D35; }
        html[data-theme="dark"] .chat-view-stream { background: #0E0E10; }
        html[data-theme="dark"] .chat-info { border-color: #2A2D35; }
        html[data-theme="dark"] .chat-messages { background: #0E0E10; }
        html[data-theme="dark"] .chat-msg-bubble { background: #1A1C20; border-color: #2A2D35; }
        html[data-theme="dark"] .chat-compose { background: #16181C; border-color: #2A2D35; }
        html[data-theme="dark"] .chat-mention-menu { background: #1A1C20; border-color: #2A2D35; box-shadow: 0 8px 24px rgba(0,0,0,0.55); }
        html[data-theme="dark"] .chat-mention-item:hover { background: #2A2D35; }
        /* AI Panel */
        html[data-theme="dark"] .ai-panel { background: #16181C; border-color: #2A2D35; box-shadow: 0 20px 48px rgba(0,0,0,0.55); }
        html[data-theme="dark"] .ai-panel-body { background: #0E0E10; }
        html[data-theme="dark"] .ai-panel-input { background: #16181C; border-color: #2A2D35; }
        html[data-theme="dark"] .ai-panel-input textarea { background: #0E0E10; color: #E5E5E7; border-color: #2A2D35; }
        html[data-theme="dark"] .ai-panel-input textarea:focus { background: #141618; border-color: #E8B22D; }
        html[data-theme="dark"] .ai-panel-foot { background: #16181C; }
        /* AI Feedback */
        html[data-theme="dark"] .ai-feedback-view { background: #16181C; }
        html[data-theme="dark"] .ai-feedback-head { background: #111214; border-color: #2A2D35; }
        html[data-theme="dark"] .ai-feedback-body { background: #16181C; }
        html[data-theme="dark"] .ai-feedback-input,
        html[data-theme="dark"] .ai-feedback-textarea,
        html[data-theme="dark"] .ai-feedback-rte { background: #0E0E10 !important; color: #E5E5E7; border-color: #2A2D35; }
        html[data-theme="dark"] .ai-feedback-input:focus,
        html[data-theme="dark"] .ai-feedback-textarea:focus,
        html[data-theme="dark"] .ai-feedback-rte:focus { border-color: #E8B22D; background: #141618 !important; }
        html[data-theme="dark"] .ai-feedback-rte:empty::before { color: #6A6C72; }
        html[data-theme="dark"] .ai-feedback-drop { background: #0E0E10; border-color: #2A2D35; color: #9EA0A6; }
        html[data-theme="dark"] .ai-feedback-drop:hover { background: #1A200E; border-color: #E8B22D; color: #E5E5E7; }
        html[data-theme="dark"] .ai-feedback-ctx { background: #1E2010; border-color: #4A4218; color: #9EA060; }
        html[data-theme="dark"] .ai-feedback-ctx strong { color: #C8C880; }
        html[data-theme="dark"] .ai-feedback-prio-btn { background: #1E2026; border-color: #2A2D35; color: #C8CACF; }
        html[data-theme="dark"] .ai-feedback-prio-btn:hover { background: #2A2D35; }
        html[data-theme="dark"] .ai-feedback-tabs { background: #1A1C20; }
        html[data-theme="dark"] .ai-feedback-tab.active { background: #2A2D35; color: #F4F4F6; }
        html[data-theme="dark"] .ai-feedback-foot { background: #111214; border-color: #2A2D35; }
        html[data-theme="dark"] .ai-feedback-cancel { background: #1E2026; border-color: #2A2D35; color: #D8D9DD; }
        html[data-theme="dark"] .ai-feedback-cancel:hover { background: #2A2D35; }
        html[data-theme="dark"] .ai-fb-file { background: #1E2026; border-color: #2A2D35; color: #9EA0A6; }
        html[data-theme="dark"] .ai-feedback-setup { background: #16181C; border-color: #2A2D35; color: #D8D9DD; }
        /* RTE overlay */
        html[data-theme="dark"] .rte-overlay { background: rgba(0,0,0,0.85); }
        html[data-theme="dark"] .rte-modal { background: #16181C; }
        html[data-theme="dark"] .rte-topbar { background: #16181C; border-color: #2A2D35; }
        html[data-theme="dark"] .rte-topbar-btn:hover { background: #2A2D35; }
        html[data-theme="dark"] .rte-doc { background: #16181C; color: #E5E5E7; }
        html[data-theme="dark"] .rte-doc-title { color: #F4F4F6; }
        html[data-theme="dark"] .rte-doc-title:empty::before { color: #6A6C72; }
        html[data-theme="dark"] .rte-block-wrap:hover { background: rgba(255,255,255,0.04); }
        html[data-theme="dark"] .rte-block-handle:hover,
        html[data-theme="dark"] .rte-block-plus:hover { background: #2A2D35; color: #E5E5E7; }
        html[data-theme="dark"] .rte-b-quote { border-left-color: #9EA0A6; color: #9EA0A6; }
        html[data-theme="dark"] .rte-b-callout { background: #2A2210; border-color: #6A5218; }
        html[data-theme="dark"] .rte-b-divider { border-top-color: #2A2D35; }
        html[data-theme="dark"] .rte-b-code { background: #111214; color: #C8CACF; }
        html[data-theme="dark"] .rte-slash { background: #1A1C20; border-color: #2A2D35; box-shadow: 0 12px 32px rgba(0,0,0,0.55); }
        html[data-theme="dark"] .rte-statusbar { background: #16181C; border-color: #2A2D35; }
        /* Marketplace */
        html[data-theme="dark"] .mp-chip { background: #1E2026; border-color: #2A2D35; color: #D8D9DD; }
        html[data-theme="dark"] .mp-card { background: #1A1C20; border-color: #2A2D35; }
        html[data-theme="dark"] .mp-badge { background: #2A2D35; color: #9EA0A6; }
        html[data-theme="dark"] .md-modal { background: #16181C; }
        html[data-theme="dark"] .md-head,
        html[data-theme="dark"] .md-tabs,
        html[data-theme="dark"] .md-close { background: #16181C; border-color: #2A2D35; }
        html[data-theme="dark"] .md-close { color: #9EA0A6; }
        html[data-theme="dark"] .md-close:hover { background: #2A2D35; color: #E5E5E7; }
        html[data-theme="dark"] .md-body { background: #0E0E10; }
        html[data-theme="dark"] .md-desc { background: #1A1C20; border-color: #2A2D35; color: #D8D9DD; }
        html[data-theme="dark"] .md-desc code { background: #2A2D35; color: #C8CACF; }
        html[data-theme="dark"] .md-screens,
        html[data-theme="dark"] .md-side,
        html[data-theme="dark"] .md-pricing-card,
        html[data-theme="dark"] .md-reviews-head,
        html[data-theme="dark"] .md-review,
        html[data-theme="dark"] .md-changelog-entry { background: #1A1C20; border-color: #2A2D35; }
        html[data-theme="dark"] .md-side .tag { background: #2A2D35; color: #C8CACF; }
        html[data-theme="dark"] .md-pricing-card button { background: #1E2026; border-color: #2A2D35; color: #D8D9DD; }
        html[data-theme="dark"] .tmp-card { background: #1A1C20; border-color: #2A2D35; }
        /* Integrations */
        html[data-theme="dark"] .intg-card { background: #1A1C20; border-color: #2A2D35; }
        html[data-theme="dark"] .intg-detail-btn { background: #1E2026; border-color: #2A2D35; color: #D8D9DD; }
        html[data-theme="dark"] .intg-detail-btn:hover { background: #2A2D35; }
        html[data-theme="dark"] .intg-install-modal { background: #16181C; }
        html[data-theme="dark"] .intg-install-foot { background: #111214; border-color: #2A2D35; }
        /* Keyboard shortcuts */
        html[data-theme="dark"] .ks-toolbar input.ks-search,
        html[data-theme="dark"] .ks-toolbar .ks-preset,
        html[data-theme="dark"] .ks-toolbar .ks-scope { background: #1E2026; border-color: #2A2D35; color: #D8D9DD; }
        html[data-theme="dark"] .ks-toolbar .ks-preset:hover { background: #2A2D35; }
        html[data-theme="dark"] .ks-cat { background: #1A1C20; border-color: #2A2D35; }
        html[data-theme="dark"] .ks-table th { background: #1E2026; border-color: #2A2D35; }
        html[data-theme="dark"] .ks-table tr:hover td { background: #1A1C20; }
        html[data-theme="dark"] .ks-key { background: #2A2D35; border-color: #3A3D45; box-shadow: 0 1px 0 #1A1C20; color: #D8D9DD; }
        html[data-theme="dark"] .ks-unbound { background: #1E2026; color: #6A6C72; }
        /* API Manager */
        html[data-theme="dark"] .apim-wrap { background: #0E0E10; }
        html[data-theme="dark"] .apim-list { background: #111214; border-color: #2A2D35; }
        html[data-theme="dark"] .apim-bar,
        html[data-theme="dark"] .apim-tabs { background: #16181C; border-color: #2A2D35; }
        html[data-theme="dark"] .apim-section { background: #1A1C20; border-color: #2A2D35; }
        html[data-theme="dark"] .apim-field input,
        html[data-theme="dark"] .apim-field select,
        html[data-theme="dark"] .apim-field textarea { background: #0E0E10; border-color: #2A2D35; color: #E5E5E7; }
        html[data-theme="dark"] .apim-step,
        html[data-theme="dark"] .apim-step-body { background: #1A1C20; border-color: #2A2D35; }
        html[data-theme="dark"] .apim-step-body { background: #17191D; }
        html[data-theme="dark"] .apim-add-step-row { background: #1A1C20; border-color: #2A2D35; color: #6A6C72; }
        /* Scenario builder */
        html[data-theme="dark"] .sol-section { background: #1A1C20; border-color: #2A2D35; }
        html[data-theme="dark"] .sol-wizard { background: #16181C; box-shadow: 0 24px 64px rgba(0,0,0,0.6); }
        html[data-theme="dark"] .exp-card,
        html[data-theme="dark"] .env-card { background: #1A1C20; border-color: #2A2D35; }
        /* ER Diagram */
        html[data-theme="dark"] .er-wrap { background: #16181C; }
        html[data-theme="dark"] .er-sidebar-head input { background: #0E0E10; border-color: #2A2D35; color: #E5E5E7; }
        html[data-theme="dark"] .er-canvas-wrap { background-color: #0E0E10 !important; background-image: radial-gradient(circle, #2A2D35 1px, transparent 1px) !important; }
        html[data-theme="dark"] .er-toolbar,
        html[data-theme="dark"] .er-legend,
        html[data-theme="dark"] .er-minimap { background: #1A1C20; border-color: #2A2D35; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
        html[data-theme="dark"] .er-entity { background: #1A1C20; }
        html[data-theme="dark"] .er-detail-panel { background: #16181C; border-color: #2A2D35; }
        html[data-theme="dark"] .er-detail-body .rel-line { background: #1E2026; }
        /* Form view */
        html[data-theme="dark"] .form-view-card { background: #1A1C20; border-color: #2A2D35; box-shadow: none; }
        html[data-theme="dark"] .form-view-input,
        html[data-theme="dark"] .form-view-textarea,
        html[data-theme="dark"] .form-view-select { background: #0E0E10; border-color: #2A2D35; color: #E5E5E7; }
        html[data-theme="dark"] .form-view-back { background: #1E2026; border-color: #2A2D35; color: #D8D9DD; }
        html[data-theme="dark"] .form-view-back:hover { background: #2A2D35; }
        html[data-theme="dark"] .form-view-file { background: #0E0E10; border-color: #2A2D35; color: #9EA0A6; }
        html[data-theme="dark"] .form-view-file:hover { background: #141618; border-color: #3A3D45; }
        html[data-theme="dark"] .form-view-radio-row,
        html[data-theme="dark"] .form-view-check-row { color: #D8D9DD; }
        /* Policy fields */
        html[data-theme="dark"] .pol-field input,
        html[data-theme="dark"] .pol-field select,
        html[data-theme="dark"] .pol-field textarea { background: #0E0E10; border-color: #2A2D35; color: #E5E5E7; }
        /* Dashboard builder */
        html[data-theme="dark"] .dbe-canvas { background: #0E0E10; }
        html[data-theme="dark"] .dbe-panel,
        html[data-theme="dark"] .dbe-cfg-panel { background: #16181C; border-color: #2A2D35; }
        html[data-theme="dark"] .dbe-palette-item { background: #1E2026; border-color: #2A2D35; color: #D8D9DD; }
        html[data-theme="dark"] .dbe-palette-item:hover { background: #2A2D35; }
        html[data-theme="dark"] .dbe-widget { background: #1A1C20; border-color: #2A2D35; }
        html[data-theme="dark"] .dbe-cfg-field > .sh-input,
        html[data-theme="dark"] .dbe-cfg-field > textarea.sh-input { background: #0E0E10; border-color: #2A2D35; color: #E5E5E7; }
        /* User management table */
        html[data-theme="dark"] .up-table th { background: #1E2026; border-color: #2A2D35; }
        html[data-theme="dark"] .up-table tr:hover td { background: #1A1C20; }
        html[data-theme="dark"] .up-status.inactive { background: #2A2D35; color: #6A6C72; }

        /* Top tabs (light blue-gray) */
        .top-tabs { background: #EAEDF4; border-bottom: 1px solid hsl(var(--border)); display: flex; align-items: center; padding: 0 16px; height: 42px; flex-shrink: 0; gap: 4px; }
        .brand-logo { color: #E8B22D; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; margin-right: 16px; user-select: none; flex-shrink: 0; }
        .nav-items { flex: 1 1 auto; display: flex; align-items: center; gap: 2px; overflow: hidden; min-width: 0; }
        .nav-tab { padding: 6px 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; border-radius: 4px; white-space: nowrap; position: relative; transition: background 0.15s ease; background: none; border: none; flex-shrink: 0; }
        .nav-tab:hover { background: rgba(0,0,0,0.04); }
        .nav-tab.active { font-weight: 700; }
        .nav-tab.open { background: rgba(0,0,0,0.06); }
        .nav-tab svg.nav-icon { width: 14px; height: 14px; color: hsl(var(--foreground)); }
        .nav-tab svg.nav-chevron { width: 12px; height: 12px; color: hsl(var(--muted-foreground)); transition: transform 0.15s ease; }
        .nav-tab.open svg.nav-chevron { transform: rotate(180deg); }
        .nav-overflow { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: hsl(var(--foreground)); cursor: pointer; border-radius: 4px; flex-shrink: 0; }
        .nav-overflow:hover { background: rgba(0,0,0,0.06); }
        .nav-overflow.open { background: rgba(0,0,0,0.08); }
        .nav-overflow svg { width: 16px; height: 16px; }

        /* Nav dropdown menu (recursive, up to 5 levels) */
        /* Horné (nav) dropdown menu — štýly zosúladené s pravým (user) menu.
           User feedback: hover nech nie je čierny, ale jemno sivý; odsadenia zosúladiť. */
        .nav-menu { position: fixed; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 6px; min-width: 240px; z-index: 700; display: none; max-height: calc(100vh - 80px); overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior: contain; }
        .nav-menu::-webkit-scrollbar { width: 0; height: 0; display: none; }
        .nav-menu.open { display: block; }
        .nav-menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; position: relative; white-space: nowrap; }
        .nav-menu-item:hover, .nav-menu-item.active-trail { background: #F4F4F4; color: hsl(var(--foreground)); }
        .nav-menu-item:hover .nav-menu-icon,
        .nav-menu-item:hover .nav-menu-arrow,
        .nav-menu-item.active-trail .nav-menu-icon,
        .nav-menu-item.active-trail .nav-menu-arrow { color: hsl(var(--foreground)); }
        .nav-menu-item.current { background: #2D2D2D; color: #FFFFFF; font-weight: 500; }
        .nav-menu-item.current .nav-menu-icon,
        .nav-menu-item.current .nav-menu-arrow { color: #FFFFFF; }
        .nav-menu-item.current:hover { background: #1F1F1F; color: #FFFFFF; }
        .nav-menu-icon { width: 16px; height: 16px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
        .nav-menu-label { flex: 1; }
        .nav-menu-arrow { width: 14px; height: 14px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
        .nav-menu-separator { height: 1px; background: hsl(var(--border)); margin: 4px -2px; }

        /* ---------- User menu (avatar dropdown) ---------- */
        .user-menu-trigger { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; }
        .user-chevron-btn { height: 28px; width: 22px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: none; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 4px; padding: 0; }
        .user-chevron-btn:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .user-chevron-btn svg { width: 12px; height: 12px; transition: transform 0.15s ease; }
        .user-menu-trigger.open .user-chevron-btn svg { transform: rotate(180deg); }
        .user-menu { position: fixed; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 6px; min-width: 240px; z-index: 120; display: none; }
        .user-menu.open { display: block; }
        .user-menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; white-space: nowrap; position: relative; }
        .user-menu-item:hover { background: #F4F4F4; }
        .user-menu-item .user-menu-arrow { margin-left: auto; color: hsl(var(--muted-foreground)); width: 12px; height: 12px; flex-shrink: 0; }
        .user-menu-item .user-menu-ic { width: 14px; height: 14px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
        .user-menu-item:hover .user-menu-ic { color: hsl(var(--foreground)); }

        /* ============================================================
           Nová firma — modal pre vytvorenie tenant-u (z company switcher).
           ============================================================ */
        .new-company-overlay { position: fixed; inset: 0; background: rgba(11,11,12,0.55); backdrop-filter: blur(4px); z-index: 4000; display: none; align-items: center; justify-content: center; padding: 24px; }
        .new-company-overlay.open { display: flex; }
        .new-company-modal { width: 720px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); background: #FFFFFF; border-radius: 12px; box-shadow: 0 24px 64px rgba(0,0,0,0.22); display: flex; flex-direction: column; overflow: hidden; animation: ncFadeIn 0.18s ease; }
        @keyframes ncFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
        .new-company-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid hsl(var(--border)); gap: 16px; }
        .new-company-title { margin: 0 0 3px; font-size: 17px; font-weight: 700; color: hsl(var(--foreground)); }
        .new-company-sub { margin: 0; font-size: 12.5px; color: hsl(var(--muted-foreground)); line-height: 1.4; }
        .new-company-close { background: transparent; border: none; cursor: pointer; color: hsl(var(--muted-foreground)); padding: 6px; border-radius: 6px; flex-shrink: 0; }
        .new-company-close:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .new-company-body { padding: 18px 22px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
        .new-company-section-title { font-size: 11px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
        .new-company-divider { height: 1px; background: hsl(var(--border)); margin: 2px 0; }
        .new-company-lookup { display: flex; gap: 8px; align-items: stretch; }
        .new-company-lookup .new-company-ico { flex: 0 0 180px; }
        .new-company-lookup .sh-btn { flex-shrink: 0; gap: 6px; }
        .new-company-hint { font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-top: 8px; line-height: 1.4; }
        .new-company-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
        .new-company-field { display: flex; flex-direction: column; gap: 4px; }
        .new-company-field.full { grid-column: 1 / -1; }
        .new-company-field label { font-size: 12px; font-weight: 500; color: hsl(var(--foreground)); }
        .new-company-field label .req { color: #D43711; margin-left: 2px; }
        .new-company-field .sh-input { font-size: 13px; height: 34px; padding: 0 10px; }
        .new-company-field select.sh-input { padding-right: 26px; }
        .new-company-subdomain { display: flex; align-items: center; gap: 0; border: 1px solid hsl(var(--border)); border-radius: 6px; background: #FFFFFF; transition: border-color 0.15s ease; }
        .new-company-subdomain:focus-within { border-color: hsl(var(--primary)); }
        .new-company-subdomain .sh-input { border: none; flex: 1; height: 32px; }
        .new-company-subdomain .sh-input:focus { box-shadow: none; }
        .new-company-subdomain-suffix { padding: 0 12px; color: hsl(var(--muted-foreground)); font-size: 13px; background: #FAFAFA; height: 32px; display: inline-flex; align-items: center; border-left: 1px solid hsl(var(--border)); flex-shrink: 0; }
        .new-company-checkbox { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: hsl(var(--foreground)); cursor: pointer; padding: 4px 0; }
        .new-company-checkbox input { margin: 0; }
        .new-company-foot { padding: 14px 22px; border-top: 1px solid hsl(var(--border)); display: flex; justify-content: flex-end; gap: 8px; background: #FAFAFA; flex-shrink: 0; }
        .new-company-foot .sh-btn { gap: 6px; }
        @media (max-width: 600px) {
            .new-company-grid { grid-template-columns: 1fr; }
            .new-company-lookup { flex-direction: column; }
            .new-company-lookup .new-company-ico { flex: 1; }
            .new-company-modal { max-height: 100vh; height: 100vh; border-radius: 0; }
        }
        html[data-theme="dark"] .new-company-modal { background: #1A1C20; color: #F4F4F6; }
        html[data-theme="dark"] .new-company-foot { background: #14161A; }
        html[data-theme="dark"] .new-company-subdomain-suffix { background: #2A2D35; }

        /* ============================================================
           Personal calendar (#calendar-app-page) — agreguje udalosti
           z DSes priradených userovi (assignee/owner = current user).
           ============================================================ */
        .ucal-wrap { flex: 1; display: grid; grid-template-columns: 280px 1fr; min-height: 0; }
        .ucal-sidebar { background: #FAFAFA; border-right: 1px solid hsl(var(--border)); padding: 14px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
        .ucal-mini { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 8px; font-size: 11.5px; }
        .ucal-mini-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-weight: 600; }
        .ucal-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
        .ucal-mini-grid .dow { font-size: 9.5px; color: hsl(var(--muted-foreground)); padding: 2px 0; }
        .ucal-mini-grid .day { padding: 4px 0; border-radius: 50%; cursor: pointer; }
        .ucal-mini-grid .day:hover { background: #F4F4F4; }
        .ucal-mini-grid .day.today { background: #E8B22D; color: #2D2D2D; font-weight: 700; }
        .ucal-mini-grid .day.other { color: #BFBFBF; }
        .ucal-mini-grid .day.has-events::after { content: ""; display: block; width: 4px; height: 4px; background: #3B82F6; border-radius: 50%; margin: 1px auto -3px; }
        #ucal-sources-list { display: flex; flex-direction: column; gap: 4px; }
        .ucal-source { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px; user-select: none; }
        .ucal-source:hover { background: #F4F4F4; }
        .ucal-source input { margin: 0; cursor: pointer; }
        .ucal-source .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
        .ucal-source .src-name { flex: 1; color: hsl(var(--foreground)); }
        .ucal-source .src-count { color: hsl(var(--muted-foreground)); font-size: 11px; }
        .ucal-main { display: flex; flex-direction: column; min-height: 0; background: #FFFFFF; }
        .ucal-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid hsl(var(--border)); flex-shrink: 0; }
        .ucal-body { flex: 1; min-height: 0; overflow: hidden; position: relative; }
        /* Vytvorenie novej udalosti — modal */
        .ucal-create-overlay { position: fixed; inset: 0; background: rgba(11,11,12,0.55); backdrop-filter: blur(4px); z-index: 4500; display: none; align-items: center; justify-content: center; padding: 24px; }
        .ucal-create-overlay.open { display: flex; }
        .ucal-create-modal { width: 520px; max-width: calc(100vw - 32px); background: #FFFFFF; border-radius: 12px; box-shadow: 0 24px 64px rgba(0,0,0,0.22); display: flex; flex-direction: column; overflow: hidden; }
        .ucal-create-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid hsl(var(--border)); }
        .ucal-create-head strong { font-size: 15px; }
        .ucal-create-close { background: transparent; border: none; cursor: pointer; padding: 4px; border-radius: 4px; color: hsl(var(--muted-foreground)); }
        .ucal-create-close:hover { background: #F4F4F4; }
        .ucal-create-body { padding: 16px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; max-height: 70vh; overflow-y: auto; }
        .ucal-create-field { display: flex; flex-direction: column; gap: 4px; }
        .ucal-create-field.full { grid-column: 1 / -1; }
        .ucal-create-field label { font-size: 12px; font-weight: 500; color: hsl(var(--foreground)); }
        .ucal-create-field label .req { color: #D43711; }
        .ucal-create-field .sh-input { font-size: 13px; height: 34px; padding: 0 10px; }
        .ucal-create-field textarea.sh-input { height: auto; min-height: 60px; padding: 8px 10px; resize: vertical; }
        .ucal-create-field select.sh-input { padding-right: 28px; }
        .ucal-create-checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; padding: 6px 0; font-weight: 400; }
        .ucal-create-checkbox input { margin: 0; }
        .ucal-create-foot { padding: 12px 18px; border-top: 1px solid hsl(var(--border)); display: flex; justify-content: flex-end; gap: 8px; background: #FAFAFA; }
        /* Drag-to-create ghost na týždennom grid-e */
        .cal2-week-event.ucal-ghost { background: rgba(232,178,45,0.5) !important; border: 2px dashed #E8B22D; box-shadow: none; pointer-events: none; }
        /* Klikateľné číslo dňa — Google-style "klik na dátum otvorí denný zoznam udalostí" */
        #ucal-body .cal2-day-num { cursor: pointer; transition: background 0.15s ease; }
        #ucal-body .cal2-day-num:hover { background: rgba(0,0,0,0.06); }
        /* Personal-calendar event — video tlačidlo viditeľné pri hover-i. */
        .ucal-event { position: relative; }
        .ucal-event:hover .ucal-event-video-btn { display: inline-flex !important; }
        .ucal-event-video-btn:hover { background: rgba(255,255,255,0.45) !important; }

        /* ============================================================
           Video call modal — mock LiveKit room. Volá sa cez
           window.startVideoCall({ title, participants, sourceRecord })
           ============================================================ */
        .video-call-overlay { position: fixed; inset: 0; background: rgba(8,9,12,0.78); backdrop-filter: blur(6px); z-index: 5000; display: none; align-items: center; justify-content: center; padding: 24px; }
        .video-call-overlay.open { display: flex; }
        .video-call-modal { width: 1100px; max-width: calc(100vw - 32px); height: 700px; max-height: calc(100vh - 32px); background: #15161A; color: #F4F4F6; border-radius: 14px; box-shadow: 0 32px 80px rgba(0,0,0,0.55); display: flex; flex-direction: column; overflow: hidden; }
        .video-call-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #25272D; gap: 14px; }
        .video-call-title { font-size: 15px; font-weight: 700; }
        .video-call-sub { font-size: 11.5px; color: rgba(255,255,255,0.6); margin-top: 2px; }
        .video-call-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,0.85); padding: 4px 10px; background: #25272D; border-radius: 999px; }
        .vc-rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #D43711; animation: vcPulse 1.4s infinite; }
        @keyframes vcPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
        .vc-timer { font-variant-numeric: tabular-nums; font-weight: 600; }
        .video-call-close { background: transparent; border: none; color: rgba(255,255,255,0.6); cursor: pointer; padding: 4px; border-radius: 6px; }
        .video-call-close:hover { background: #25272D; color: #FFFFFF; }
        .video-call-body { flex: 1; display: grid; grid-template-columns: 1fr 320px; min-height: 0; }
        .video-call-stage { padding: 16px; display: grid; gap: 12px; min-height: 0; align-content: stretch; }
        .video-call-stage[data-tiles="1"] { grid-template-columns: 1fr; grid-template-rows: 1fr; }
        .video-call-stage[data-tiles="2"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
        .video-call-stage[data-tiles="3"], .video-call-stage[data-tiles="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
        .vc-tile { background: linear-gradient(135deg, #1F2126, #2A2D35); border-radius: 10px; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; min-height: 0; }
        .vc-tile.speaking { box-shadow: 0 0 0 3px #2AB67D; }
        .vc-tile-avatar { width: 96px; height: 96px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; color: #FFFFFF; }
        .vc-tile-name { position: absolute; left: 12px; bottom: 10px; background: rgba(0,0,0,0.55); padding: 4px 10px; border-radius: 6px; font-size: 12px; }
        .vc-tile-mic { position: absolute; right: 12px; bottom: 10px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,0.55); display: inline-flex; align-items: center; justify-content: center; }
        .vc-tile-mic svg { width: 12px; height: 12px; color: #FFFFFF; }
        .vc-tile.muted .vc-tile-mic { background: #D43711; }
        .video-call-side { background: #1A1C20; border-left: 1px solid #25272D; display: flex; flex-direction: column; }
        .video-call-side-head { padding: 12px 14px; border-bottom: 1px solid #25272D; display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
        .vc-badge { background: #2AB67D; color: #0B0B0C; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; letter-spacing: 0.04em; text-transform: uppercase; }
        .video-call-transcript { flex: 1; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; }
        .vc-transcript-line { font-size: 12.5px; line-height: 1.5; }
        .vc-transcript-line .who { font-weight: 600; color: #E8B22D; margin-right: 6px; }
        .vc-transcript-line .time { font-size: 10px; color: rgba(255,255,255,0.4); margin-right: 6px; font-variant-numeric: tabular-nums; }
        .video-call-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid #25272D; }
        .video-call-controls { display: flex; gap: 8px; }
        .vc-ctl { width: 42px; height: 42px; border-radius: 50%; background: #25272D; border: none; color: #FFFFFF; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
        .vc-ctl:hover { background: #34373E; }
        .vc-ctl.is-off { background: #D43711; }
        .vc-end { background: #D43711; color: #FFFFFF; border: none; padding: 0 16px; height: 42px; border-radius: 22px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
        .vc-end:hover { background: #B82B0E; }
        @media (max-width: 720px) {
            .video-call-body { grid-template-columns: 1fr; }
            .video-call-side { border-left: none; border-top: 1px solid #25272D; max-height: 200px; }
            .ucal-wrap { grid-template-columns: 1fr; }
            .ucal-sidebar { display: none; }
        }
        /* Nastavenia firmy → Kalendár → multiselect zdrojov DŠ */
        .cs-cal-sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
        .cs-cal-source { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid hsl(var(--border)); border-radius: 8px; cursor: pointer; transition: border-color 0.15s; background: #FFFFFF; }
        .cs-cal-source:hover { border-color: #BFBFBF; }
        .cs-cal-source input[type="checkbox"] { margin: 0; cursor: pointer; flex-shrink: 0; }
        .cs-cal-source.checked { border-color: hsl(var(--primary)); background: #FFFBEE; }
        .cs-cal-source .src-color { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
        .cs-cal-source .src-info { flex: 1; min-width: 0; }
        .cs-cal-source .src-name { font-size: 13px; font-weight: 500; color: hsl(var(--foreground)); }
        .cs-cal-source .src-meta { font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 1px; }
        .user-menu-company-settings { margin-left: auto; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: hsl(var(--muted-foreground)); border-radius: 4px; cursor: pointer; flex-shrink: 0; padding: 0; }
        .user-menu-company-settings:hover { background: rgba(0,0,0,0.08); color: hsl(var(--foreground)); }
        .user-menu-company-settings svg { width: 14px; height: 14px; }
        .user-menu-item.is-company:hover .user-menu-company-settings { color: hsl(var(--foreground)); }

        /* Company settings and other full-screen overlays (profile, users, permissions, data structures, marketplace) */
        .company-settings, .fs-overlay { position: fixed; inset: 0; background: #F4F4F4; z-index: 1000; display: none; flex-direction: column; overflow: hidden; }
        .company-settings.open, .fs-overlay.open { display: flex; }
        .cs-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; background: #FFFFFF; border-bottom: 1px solid hsl(var(--border)); flex-shrink: 0; }
        .cs-head-left { display: inline-flex; align-items: center; gap: 14px; min-width: 0; }
        .cs-head-logo { width: 36px; height: 36px; border-radius: 8px; background: #E8B22D; color: #2D2D2D; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
        .cs-head-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
        .cs-head-title strong { font-size: 16px; color: hsl(var(--foreground)); }
        .cs-head-title span { font-size: 12px; color: hsl(var(--muted-foreground)); }
        .cs-head-close { width: 34px; height: 34px; border: 1px solid hsl(var(--border)); background: #FFFFFF; color: hsl(var(--foreground)); border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .cs-head-close:hover { background: #F4F4F4; }
        .cs-head-close svg { width: 16px; height: 16px; }
        .cs-body { flex: 1; display: grid; grid-template-columns: 260px 1fr; gap: 0; overflow: hidden; }
        .cs-sidebar { background: #FFFFFF; border-right: 1px solid hsl(var(--border)); padding: 16px 10px; overflow: auto; }
        .cs-section-label { padding: 8px 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); font-weight: 600; }
        .cs-nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 1px 0; font-size: 13px; color: hsl(var(--foreground)); border-radius: 6px; cursor: pointer; border: none; background: transparent; width: 100%; text-align: left; }
        .cs-nav-item:hover { background: #F4F4F4; }
        .cs-nav-item.active { background: #2D2D2D; color: #FFFFFF; font-weight: 500; }
        .cs-nav-item.active svg { color: #FFFFFF; }
        .cs-nav-item svg { width: 16px; height: 16px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
        .cs-main { overflow: auto; padding: 32px 40px 40px; }
        .cs-page-title { font-size: 22px; font-weight: 700; color: hsl(var(--foreground)); margin-bottom: 6px; }
        .cs-page-sub { font-size: 13px; color: hsl(var(--muted-foreground)); margin-bottom: 16px; }
        .cs-card { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 22px 24px; margin-bottom: 18px; }
        .cs-card-title { font-size: 14px; font-weight: 700; color: hsl(var(--foreground)); margin-bottom: 4px; }
        .cs-card-desc { font-size: 12px; color: hsl(var(--muted-foreground)); margin-bottom: 16px; }
        /* Atribúty card — plná šírka sekcie, tabuľka bez obmedzenia min-width */
        #company-attrs-card { overflow-x: auto; padding: 22px 24px; }
        #company-attrs-grid { min-width: auto; width: 100%; }
        #company-attrs-grid thead th { font-size: 12.5px; }
        #company-attrs-card > div { margin-bottom: 12px; }
        #company-attrs-grid { min-width: 0; }
        #company-attrs-grid { min-width: 0; width: 100%; }
        .cs-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; margin-bottom: 8px; }
        .cs-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; margin-bottom: 8px; }
        .cs-field { display: flex; flex-direction: column; gap: 6px; }
        .cs-field label { font-size: 12px; font-weight: 500; color: hsl(var(--muted-foreground)); }
        .cs-field .sh-input, .cs-field textarea.sh-input, .cs-field .adv-select-trigger, .cs-field .multi-trigger { height: 38px; font-size: 13px; }
        .cs-field textarea.sh-input { min-height: 88px; height: auto; resize: vertical; padding: 10px 12px; }
        .cs-page { display: none; }
        .cs-page.active { display: block; }
        .cs-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid hsl(var(--border)); }
        .cs-row:first-child { border-top: none; }
        .cs-row-text { min-width: 0; }
        .cs-row-text strong { display: block; font-size: 13px; color: hsl(var(--foreground)); margin-bottom: 2px; }
        .cs-row-text span { font-size: 12px; color: hsl(var(--muted-foreground)); }
        .cs-toggle { position: relative; width: 40px; height: 22px; border-radius: 11px; background: #D4D4D4; cursor: pointer; border: none; padding: 0; flex-shrink: 0; transition: background 0.15s ease; }
        .cs-toggle::after { content: ''; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; transition: left 0.15s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.18); }
        .cs-toggle.on { background: #2D2D2D; }
        .cs-toggle.on::after { left: 20px; }
        .cs-tags { display: flex; flex-wrap: wrap; gap: 6px; }
        .cs-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: #F4F4F4; border: 1px solid hsl(var(--border)); border-radius: 12px; font-size: 12px; color: hsl(var(--foreground)); }
        .cs-tag svg { width: 12px; height: 12px; color: hsl(var(--muted-foreground)); }

        /* Marketplace + user list specifics */
        .mp-search-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
        .mp-search-row .mp-chips { margin-bottom: 0; flex: 1; }
        .mp-chips { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
        .mp-chip { padding: 6px 12px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 16px; font-size: 12px; color: hsl(var(--foreground)); cursor: pointer; }
        .mp-chip.active { background: #2D2D2D; color: #FFFFFF; border-color: #2D2D2D; font-weight: 500; }
        .mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
        .mp-card { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: transform 0.15s ease, box-shadow 0.15s ease; }
        .mp-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
        .mp-card-head { display: flex; align-items: center; gap: 12px; }
        .mp-icon { width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; font-weight: 700; }
        .mp-icon svg { width: 22px; height: 22px; }
        .mp-card-title { font-size: 15px; font-weight: 700; color: hsl(var(--foreground)); margin: 0 0 2px; display: flex; align-items: center; gap: 6px; }
        .mp-card-sub { font-size: 12px; color: hsl(var(--muted-foreground)); }
        .mp-card-desc { font-size: 13px; color: hsl(var(--foreground)); line-height: 1.5; flex: 1; }
        .mp-card-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: hsl(var(--muted-foreground)); }
        .mp-card-meta .mp-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; }
        .mp-card-stars { color: #E8B22D; letter-spacing: -1px; }
        .mp-card-actions { display: flex; gap: 8px; align-items: center; }
        .mp-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; background: #F4F4F4; color: hsl(var(--muted-foreground)); }
        .mp-badge.installed { background: rgba(42,182,125,0.14); color: #2AB67D; }
        .mp-badge.verified { background: rgba(59,202,239,0.14); color: #2588A8; }

        /* Users list (subpage) */
        .up-table { width: 100%; border-collapse: collapse; font-size: 13px; }
        .up-table th { background: #F4F4F4; text-align: left; padding: 6px 14px; font-size: 12px; font-weight: 600; color: hsl(var(--muted-foreground)); border-bottom: 1px solid hsl(var(--border)); }
        .up-table td { padding: 7px 14px; border-bottom: 1px solid #EFEFEF; color: hsl(var(--foreground)); }
        .up-table tr:last-child td { border-bottom: none; }
        .up-user-cell { display: flex; align-items: center; gap: 10px; }
        .up-avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
        .up-user-name { display: block; font-weight: 500; }
        .up-user-email { display: block; font-size: 12px; color: hsl(var(--muted-foreground)); }
        .up-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; }
        .up-status.active { background: rgba(42,182,125,0.14); color: #2AB67D; }
        .up-status.invited { background: rgba(232,178,45,0.14); color: #B08218; }
        .up-status.inactive { background: #F4F4F4; color: hsl(var(--muted-foreground)); }
        .user-menu-item.is-company { font-weight: 600; }
        .user-menu-sep { height: 1px; background: hsl(var(--border)); margin: 4px -2px; }

        /* ---------- Instance badge + switcher ---------- */
        .instance-badge { display: inline-flex; align-items: center; gap: 5px; padding: 0 9px; height: 26px; border-radius: 13px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; cursor: pointer; border: 1px solid transparent; user-select: none; transition: opacity 0.15s; flex-shrink: 0; }
        .instance-badge:hover { opacity: 0.82; }
        .instance-badge.prod { background: rgba(42,182,125,0.14); color: #1E8A5D; border-color: rgba(42,182,125,0.3); }
        .instance-badge.test { background: rgba(232,178,45,0.14); color: #8A6318; border-color: rgba(232,178,45,0.35); }
        .instance-badge .inst-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
        .instance-badge.prod .inst-dot { background: #2AB67D; }
        .instance-badge.test .inst-dot { background: #E8B22D; }
        .instance-switcher-menu { position: fixed; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 6px; min-width: 220px; z-index: 122; display: none; }
        .instance-switcher-menu.open { display: block; }
        .inst-menu-label { padding: 4px 10px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: hsl(var(--muted-foreground)); }
        .inst-menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; }
        .inst-menu-item:hover { background: #F4F4F4; }
        .inst-menu-item.current { font-weight: 600; }
        .inst-menu-item .inst-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
        .inst-menu-item .inst-check { margin-left: auto; width: 14px; height: 14px; color: #2AB67D; }
        html[data-theme="dark"] .instance-badge.prod { background: rgba(42,182,125,0.18); color: #2AB67D; border-color: rgba(42,182,125,0.3); }
        html[data-theme="dark"] .instance-badge.test { background: rgba(232,178,45,0.18); color: #E8B22D; border-color: rgba(232,178,45,0.35); }
        html[data-theme="dark"] .instance-switcher-menu { background: #16181C; border-color: #2A2D35; }
        html[data-theme="dark"] .inst-menu-item:hover { background: #1E2026; }

        /* Company switcher (sub-panel, opens to the left of user-menu) */
        .company-switcher { position: fixed; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 6px; min-width: 280px; max-width: 340px; z-index: 121; display: none; }
        .company-switcher.open { display: block; }
        .company-switcher-list { max-height: 320px; overflow: auto; }
        .company-switcher-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .company-switcher-item:hover { background: #F4F4F4; }
        .company-switcher-item.current { background: #F4F4F4; font-weight: 600; }
        .company-switcher-add { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid hsl(var(--border)); margin-top: 4px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; border-radius: 0 0 6px 6px; }
        .company-switcher-add:hover { background: #F4F4F4; }
        .company-switcher-add svg { width: 14px; height: 14px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }

        /* ---------- Gear (view config) dropdown ---------- */
        .gear-menu { position: fixed; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 6px; min-width: 240px; z-index: 120; display: none; }
        .gear-menu.open { display: block; }
        .gear-menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; white-space: nowrap; }
        .gear-menu-item:hover { background: #F4F4F4; }
        .gear-menu-item svg { width: 14px; height: 14px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }

        /* Breadcrumb in toolbar */
        .breadcrumb { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 600; color: hsl(var(--foreground)); margin-left: 8px; min-width: 0; overflow: hidden; }
        .breadcrumb-part { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .breadcrumb-part.muted { color: hsl(var(--muted-foreground)); font-weight: 500; }
        .breadcrumb-sep { color: hsl(var(--muted-foreground)); font-weight: 400; }

        /* Summary bar (white) */
        .summary-bar { background: #FFFFFF; display: flex; gap: 24px; padding: 10px 16px; border-bottom: 1px solid hsl(var(--border)); flex-shrink: 0; }
        .summary-item { display: flex; flex-direction: column; gap: 2px; }
        .summary-label { font-size: 11px; color: hsl(var(--muted-foreground)); font-weight: 500; }
        .summary-value { font-size: 14px; color: hsl(var(--foreground)); font-weight: 500; }

        /* Toolbar (white) */
        .toolbar { display: flex; align-items: center; gap: 6px; padding: 10px 16px; background: #FFFFFF; border-bottom: 1px solid hsl(var(--border)); flex-shrink: 0; }

        /* View host — wraps all view modes */
        .view-host { flex: 1; position: relative; overflow: hidden; background: #FFFFFF; min-height: 0; }
        .view-container { position: absolute; inset: 0; display: none; overflow: auto; }
        .view-container.view-table { overflow: clip; }
        .view-container.active { display: block; }
        /* view-table je flex stĺpec: group-bar navrchu, table-wrap vyplní zvyšok */
        #view-table.active { display: flex; flex-direction: column; }
        .view-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 100%; color: hsl(var(--muted-foreground)); font-size: 13px; padding: 32px; text-align: center; }
        .view-placeholder svg { width: 48px; height: 48px; opacity: 0.5; }

        /* Environments + Solutions (Nastavenia firmy) */
        .env-hero { display:flex; align-items:center; gap:14px; padding:18px 22px; background: linear-gradient(135deg, #E6F7EF, #FFFFFF); border:1px solid #BCE4CF; border-radius:12px; margin-bottom:16px; }
        .env-hero h2 { margin: 0 0 4px; font-size: 18px; color: hsl(var(--foreground)); }
        .env-hero p { margin: 0; font-size: 12.5px; color: hsl(var(--muted-foreground)); line-height:1.55; }
        .env-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap:14px; margin-bottom:20px; }
        .env-card { background:#FFFFFF; border:2px solid hsl(var(--border)); border-radius:12px; padding:18px; position:relative; display:flex; flex-direction:column; gap:10px; }
        .env-card.prod { border-color:#2AB67D; }
        .env-card.test { border-color:#E8B22D; }
        .env-card.dev { border-color:#3BCAEF; }
        .env-card-head { display:flex; align-items:center; gap:10px; }
        .env-card-badge { padding:3px 10px; border-radius:10px; font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; }
        .env-card.prod .env-card-badge { background:#D4F5D4; color:#1E8A5D; }
        .env-card.test .env-card-badge { background:#FFF4C6; color:#8A6720; }
        .env-card.dev .env-card-badge { background:#E4F6FC; color:#2588A8; }
        .env-card-name { font-size:14px; font-weight:600; color:hsl(var(--foreground)); flex:1; }
        .env-card-status { display:inline-flex; align-items:center; gap:4px; font-size:11px; }
        .env-card-status.healthy { color:#2AB67D; }
        .env-card-status.drift { color:#E8B22D; }
        .env-card-status.unsync { color:#D43711; }
        .env-card-stats { display:grid; grid-template-columns:1fr 1fr; gap:6px 14px; font-size:11.5px; color:hsl(var(--muted-foreground)); }
        .env-card-stats strong { color:hsl(var(--foreground)); font-weight:600; }
        .env-card-actions { display:flex; gap:6px; margin-top:auto; padding-top:8px; border-top:1px solid #F0F0F0; flex-wrap:wrap; }
        .env-card-actions .sh-btn { font-size:11.5px; padding:5px 10px; flex:1; min-width:90px; }

        .sol-section { background:#FFFFFF; border:1px solid hsl(var(--border)); border-radius:12px; padding:18px; margin-bottom:14px; }
        .sol-section h3 { margin:0 0 6px; font-size:14px; display:flex; align-items:center; gap:8px; }
        .sol-section .hint { font-size:12px; color:hsl(var(--muted-foreground)); margin-bottom:14px; line-height:1.5; }
        .sol-actions-row { display:flex; gap:10px; margin-bottom:10px; flex-wrap:wrap; }
        .sol-history-table { width:100%; border-collapse:collapse; font-size:12.5px; }
        .sol-history-table th { background:#F4F4F4; padding:5px 10px; text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:0.04em; color:hsl(var(--muted-foreground)); font-weight:600; }
        .sol-history-table td { padding:5px 10px; border-bottom:1px solid #EFEFEF; }
        .sol-history-table tr:hover td { background:#FAFAFA; }
        .sol-history-table .ver { background:#2D2D2D; color:#FFFFFF; padding:2px 8px; border-radius:10px; font-family:ui-monospace,Menlo,monospace; font-size:10px; font-weight:600; display:inline-block; }
        .sol-history-table .ver.latest { background:#E8B22D; color:#2D2D2D; }
        .sol-status-ok { color:#2AB67D; font-weight:600; }
        .sol-status-failed { color:#D43711; font-weight:600; }

        /* Solution export/import wizard modal */
        .sol-wizard-overlay { position:fixed; inset:0; background:rgba(15,15,15,0.6); backdrop-filter:blur(5px); z-index:2500; display:none; align-items:center; justify-content:center; padding:24px; }
        .sol-wizard-overlay.open { display:flex; }
        .sol-wizard { width:680px; max-width:100%; background:#FFFFFF; border-radius:14px; box-shadow:0 24px 64px rgba(0,0,0,0.28); display:flex; flex-direction:column; max-height:88vh; overflow:hidden; }
        .sol-wizard-head { padding:16px 22px; border-bottom:1px solid hsl(var(--border)); display:flex; align-items:center; gap:10px; }
        .sol-wizard-head strong { flex:1; font-size:15px; }
        .sol-wizard-steps { display:flex; align-items:center; gap:6px; padding:14px 22px; background:#FAFAFA; border-bottom:1px solid hsl(var(--border)); }
        .sol-wizard-step { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:12px; font-size:11.5px; color:hsl(var(--muted-foreground)); background:#EDEDED; }
        .sol-wizard-step.active { background:#2D2D2D; color:#FFFFFF; }
        .sol-wizard-step.done { background:#D4F5D4; color:#2AB67D; }
        .sol-wizard-step-arrow { color:hsl(var(--muted-foreground)); }
        .sol-wizard-body { flex:1; overflow:auto; padding:20px 22px; }
        .sol-wizard-body h4 { margin:14px 0 6px; font-size:13px; }
        .sol-wizard-body h4:first-child { margin-top:0; }
        .sol-wizard-body label { display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border:1px solid hsl(var(--border)); border-radius:8px; margin-bottom:6px; cursor:pointer; transition:background 0.12s ease; }
        .sol-wizard-body label:hover { background:#FAFAFA; }
        .sol-wizard-body label.checked { border-color:#E8B22D; background:#FFFBEE; }
        .sol-wizard-body label input[type="checkbox"], .sol-wizard-body label input[type="radio"] { margin-top:2px; flex-shrink:0; }
        .sol-wizard-body label .l { flex:1; }
        .sol-wizard-body label .l strong { display:block; font-size:13px; color:hsl(var(--foreground)); margin-bottom:3px; }
        .sol-wizard-body label .l span { font-size:11.5px; color:hsl(var(--muted-foreground)); line-height:1.5; }
        .sol-wizard-body label .count { font-size:10.5px; color:hsl(var(--muted-foreground)); background:#F0F0F0; padding:2px 7px; border-radius:10px; margin-left:6px; }
        .sol-wizard-foot { padding:12px 22px; border-top:1px solid hsl(var(--border)); background:#FAFAFA; display:flex; align-items:center; gap:8px; }
        .sol-wizard-foot .grow { flex:1; }
        .sol-diff-preview { background:#F8F8F8; border:1px solid #EDEDED; border-radius:6px; padding:12px 14px; font-family:ui-monospace,Menlo,monospace; font-size:11.5px; line-height:1.7; max-height:260px; overflow-y:auto; }
        .sol-diff-preview .added { color:#2AB67D; }
        .sol-diff-preview .removed { color:#D43711; text-decoration:line-through; }
        .sol-diff-preview .modified { color:#E8B22D; }
        .sol-warn { background:#FFFBEE; border-left:4px solid #E8B22D; padding:10px 14px; border-radius:0 6px 6px 0; font-size:12.5px; color:#8A6720; margin-bottom:10px; }

        /* Export firmy wizard */
        .exp-hero { display:flex; align-items:center; gap:14px; padding:18px 22px; background: linear-gradient(135deg, #FFF4C6, #FFFFFF); border:1px solid #F3E4AC; border-radius:12px; margin-bottom:16px; }
        .exp-hero h2 { margin: 0 0 4px; font-size: 18px; }
        .exp-hero p { margin: 0; font-size: 12.5px; color: hsl(var(--muted-foreground)); line-height:1.55; }
        .exp-card { background:#FFFFFF; border:1px solid hsl(var(--border)); border-radius:12px; padding:18px 20px; margin-bottom:14px; }
        .exp-card h3 { margin:0 0 6px; font-size:14px; }
        .exp-card .hint { font-size:12px; color:hsl(var(--muted-foreground)); margin-bottom:14px; }
        .exp-option-group { display:flex; flex-direction:column; gap:8px; margin-bottom:14px; }
        .exp-option { display:flex; align-items:flex-start; gap:10px; padding:14px 16px; border:2px solid hsl(var(--border)); border-radius:10px; cursor:pointer; transition:all 0.12s ease; }
        .exp-option:hover { background:#FAFAFA; }
        .exp-option.checked { border-color:#E8B22D; background:#FFFBEE; }
        .exp-option input { margin-top:2px; flex-shrink:0; }
        .exp-option .l strong { display:block; font-size:13px; color:hsl(var(--foreground)); margin-bottom:3px; }
        .exp-option .l span { font-size:12px; color:hsl(var(--muted-foreground)); line-height:1.55; display:block; }
        .exp-option .size-est { font-size:10.5px; color:#8A6720; background:#FFFBEE; padding:2px 8px; border-radius:10px; display:inline-block; margin-top:4px; border:1px solid #F3E4AC; }
        .exp-summary { background:#FAFAFA; border:1px solid hsl(var(--border)); border-radius:8px; padding:12px 16px; font-size:12.5px; line-height:1.8; color:hsl(var(--foreground)); }
        .exp-summary strong { color:#2D2D2D; }
        .exp-progress { background:#F4F4F4; border-radius:20px; height:10px; overflow:hidden; margin:14px 0; }
        .exp-progress-fill { height:100%; background: linear-gradient(90deg, #E8B22D, #2AB67D); width:0%; transition:width 0.3s ease; }
        .exp-history-table { width:100%; border-collapse:collapse; font-size:12.5px; }
        .exp-history-table th { background:#F4F4F4; padding:5px 10px; text-align:left; font-size:10.5px; text-transform:uppercase; color:hsl(var(--muted-foreground)); letter-spacing:0.04em; font-weight:600; }
        .exp-history-table td { padding:5px 10px; border-bottom:1px solid #EFEFEF; }

        @media (max-width: 720px) {
            .env-grid { grid-template-columns: 1fr; }
            .sol-wizard { max-height: 100vh; border-radius: 0; width: 100%; }
            .sol-wizard-overlay { padding: 0; align-items: stretch; }
            .sol-wizard-body label { flex-wrap:wrap; }
            .sol-history-table, .exp-history-table { font-size: 11px; }
        }

        /* Rich Text Collaborative Block Editor (Notion-like) */
        .rte-overlay { position:fixed; inset:0; background:rgba(15,15,15,0.75); backdrop-filter:blur(5px); z-index:2000; display:none; align-items:stretch; justify-content:center; padding:0; }
        .rte-overlay.open { display:flex; }
        .rte-modal { width:100%; max-width:960px; background:#FFFFFF; display:flex; flex-direction:column; overflow:hidden; }
        .rte-topbar { display:flex; align-items:center; gap:10px; padding:10px 20px; border-bottom:1px solid hsl(var(--border)); background:#FFFFFF; flex-shrink:0; }
        .rte-topbar-title { flex:1; font-size:13px; color:hsl(var(--muted-foreground)); }
        .rte-topbar-title strong { color:hsl(var(--foreground)); margin-right:6px; }
        .rte-topbar-btn { background:transparent; border:none; padding:6px 10px; border-radius:6px; cursor:pointer; color:hsl(var(--foreground)); font-size:12px; display:inline-flex; align-items:center; gap:4px; }
        .rte-topbar-btn:hover { background:#F4F4F4; }
        .rte-topbar .fp-collab { position:static; }
        .rte-save-status { font-size:11px; color:#2AB67D; display:inline-flex; align-items:center; gap:4px; }

        .rte-doc { flex:1; overflow-y:auto; padding:40px 80px 100px; background:#FFFFFF; cursor:text; }
        .rte-doc-title { font-size:40px; font-weight:700; color:hsl(var(--foreground)); line-height:1.2; margin:0 0 8px; outline:none; min-height:48px; }
        .rte-doc-title:empty::before { content:'Nadpis dokumentu'; color:#BFBFBF; }
        .rte-doc-icon-row { display:flex; align-items:center; gap:8px; margin-bottom:12px; color:hsl(var(--muted-foreground)); font-size:12px; flex-wrap:wrap; }
        .rte-doc-icon { font-size:32px; cursor:pointer; padding:4px; border-radius:6px; }
        .rte-doc-icon:hover { background:#F4F4F4; }
        .rte-doc-icon-row .icon-action { display:inline-flex; align-items:center; gap:4px; padding:3px 8px; cursor:pointer; border-radius:6px; color:#BFBFBF; }
        .rte-doc-icon-row .icon-action:hover { background:#F4F4F4; color:hsl(var(--foreground)); }

        .rte-block { position:relative; padding:3px 0; outline:none; line-height:1.65; font-size:15px; color:hsl(var(--foreground)); }
        .rte-block[contenteditable="true"] { outline:none; }
        .rte-block:empty::before { content:attr(data-placeholder); color:#BFBFBF; pointer-events:none; }
        .rte-block-wrap { position:relative; display:flex; align-items:flex-start; gap:2px; border-radius:3px; }
        .rte-block-wrap:hover { background:rgba(0,0,0,0.02); }
        .rte-block-wrap:hover .rte-block-handles { opacity:1; }
        .rte-block-handles { opacity:0; flex-shrink:0; display:flex; align-items:flex-start; padding-top:6px; transition:opacity 0.1s ease; width:50px; margin-left:-50px; }
        .rte-block-handle { cursor:grab; padding:2px 4px; border-radius:3px; color:#AAAAAA; display:inline-flex; align-items:center; justify-content:center; font-size:14px; }
        .rte-block-handle:hover { background:#F0F0F0; color:hsl(var(--foreground)); }
        .rte-block-plus { cursor:pointer; padding:2px 4px; border-radius:3px; color:#AAAAAA; font-size:16px; }
        .rte-block-plus:hover { background:#F0F0F0; color:hsl(var(--foreground)); }
        .rte-block-body { flex:1; min-width:0; }

        /* Block types */
        .rte-b-h1 { font-size:30px; font-weight:700; padding:14px 0 4px; line-height:1.2; }
        .rte-b-h2 { font-size:24px; font-weight:600; padding:10px 0 3px; line-height:1.3; }
        .rte-b-h3 { font-size:20px; font-weight:600; padding:8px 0 2px; line-height:1.3; }
        .rte-b-p { font-size:15px; }
        .rte-b-quote { border-left:3px solid #2D2D2D; padding:4px 14px; font-style:italic; color:#555555; }
        .rte-b-callout { background:#FFFBEE; border:1px solid #F3E4AC; border-radius:8px; padding:12px 16px; display:flex; gap:10px; align-items:flex-start; }
        .rte-b-callout-emoji { font-size:20px; flex-shrink:0; cursor:pointer; padding:2px; border-radius:4px; }
        .rte-b-callout-emoji:hover { background:rgba(0,0,0,0.05); }
        .rte-b-callout-content { flex:1; outline:none; }
        .rte-b-divider { border:none; border-top:2px solid #EDEDED; margin:16px 0; }
        .rte-b-code { background:#2D2D2D; color:#E8E8E8; font-family:ui-monospace,Menlo,monospace; font-size:13px; padding:14px 18px; border-radius:6px; position:relative; }
        .rte-b-code::before { content:attr(data-lang); position:absolute; top:8px; right:12px; font-size:10px; color:#888; text-transform:uppercase; letter-spacing:0.05em; }
        .rte-b-bullet-item, .rte-b-number-item { display:flex; align-items:flex-start; gap:8px; }
        .rte-b-bullet-item::before { content:'•'; color:hsl(var(--muted-foreground)); padding-top:2px; flex-shrink:0; font-size:16px; }
        .rte-b-number-item::before { content:attr(data-num) '.'; color:hsl(var(--muted-foreground)); font-variant-numeric:tabular-nums; flex-shrink:0; }
        .rte-b-todo { display:flex; align-items:flex-start; gap:8px; }
        .rte-b-todo-check { width:18px; height:18px; border:2px solid #BFBFBF; border-radius:3px; cursor:pointer; flex-shrink:0; margin-top:2px; display:inline-flex; align-items:center; justify-content:center; color:transparent; transition:all 0.1s ease; }
        .rte-b-todo-check.checked { background:#2D2D2D; border-color:#2D2D2D; color:#FFFFFF; font-size:11px; font-weight:700; }
        .rte-b-todo-check.checked ~ .rte-block-body { text-decoration:line-through; color:#888; }
        .rte-b-toggle { display:flex; gap:6px; align-items:flex-start; }
        .rte-b-toggle-arrow { cursor:pointer; padding:2px; color:#888; font-size:12px; flex-shrink:0; margin-top:4px; transition:transform 0.15s ease; }
        .rte-b-toggle.open .rte-b-toggle-arrow { transform:rotate(90deg); }
        .rte-b-toggle-content { display:none; padding:4px 0 4px 24px; border-left:1px solid #EDEDED; margin-left:4px; }
        .rte-b-toggle.open .rte-b-toggle-content { display:block; }
        .rte-b-image { margin:8px 0; position:relative; }
        .rte-b-image img { max-width:100%; border-radius:6px; display:block; }
        .rte-b-image-placeholder { background:#F4F4F4; border:2px dashed #D4D4D4; padding:30px; text-align:center; border-radius:6px; color:#888; cursor:pointer; }
        .rte-b-image-placeholder:hover { background:#EDEDED; border-color:#BFBFBF; }
        .rte-b-table { width:100%; border-collapse:collapse; margin:6px 0; font-size:13px; }
        .rte-b-table th, .rte-b-table td { border:1px solid #DDDDDD; padding:6px 10px; min-width:60px; outline:none; }
        .rte-b-table th { background:#F4F4F4; text-align:left; font-weight:600; }
        .rte-b-columns { display:grid; gap:14px; margin:4px 0; }
        .rte-b-columns.cols-2 { grid-template-columns:1fr 1fr; }
        .rte-b-columns.cols-3 { grid-template-columns:repeat(3,1fr); }
        .rte-b-column { padding:4px; border-radius:4px; }
        .rte-b-embed { background:#F8F8F8; border:1px solid #EDEDED; border-radius:6px; padding:12px; display:flex; align-items:center; gap:10px; margin:4px 0; }
        .rte-b-embed-ic { width:32px; height:32px; background:#E8B22D; border-radius:6px; color:#2D2D2D; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
        .rte-b-sync { background:#E4F6FC; border-left:4px solid #3BCAEF; padding:10px 14px; border-radius:0 6px 6px 0; }
        .rte-b-sync-label { font-size:11px; color:#2588A8; margin-bottom:4px; font-weight:600; }

        /* Slash command menu */
        .rte-slash { position:absolute; background:#FFFFFF; border:1px solid hsl(var(--border)); border-radius:10px; box-shadow:0 12px 32px rgba(0,0,0,0.15); width:280px; max-height:340px; overflow-y:auto; padding:6px; z-index:200; display:none; }
        .rte-slash.open { display:block; }
        .rte-slash-head { font-size:10.5px; text-transform:uppercase; color:#888; padding:6px 10px 4px; letter-spacing:0.05em; font-weight:600; }
        .rte-slash-item { display:flex; align-items:center; gap:10px; padding:6px 10px; border-radius:6px; cursor:pointer; font-size:13px; }
        .rte-slash-item:hover, .rte-slash-item.focused { background:#F4F4F4; }
        .rte-slash-item.focused { background:#FFFBEE; }
        .rte-slash-ic { width:34px; height:34px; background:#F4F4F4; border-radius:5px; display:flex; align-items:center; justify-content:center; font-size:16px; color:hsl(var(--foreground)); flex-shrink:0; border:1px solid #EDEDED; }
        .rte-slash-body { flex:1; min-width:0; }
        .rte-slash-title { font-weight:500; color:hsl(var(--foreground)); }
        .rte-slash-sub { font-size:10.5px; color:#888; margin-top:1px; }
        .rte-slash-hint { font-size:10px; color:#888; background:#F0F0F0; padding:2px 5px; border-radius:3px; font-family:ui-monospace,Menlo,monospace; flex-shrink:0; }

        /* Floating formatting toolbar */
        .rte-float-bar { position:absolute; background:#2D2D2D; border-radius:6px; padding:2px; display:none; gap:1px; z-index:210; box-shadow:0 6px 20px rgba(0,0,0,0.25); }
        .rte-float-bar.open { display:flex; }
        .rte-float-bar button { background:transparent; border:none; color:#DDDDDD; padding:6px 8px; cursor:pointer; border-radius:4px; font-size:12px; font-family:inherit; }
        .rte-float-bar button:hover { background:rgba(255,255,255,0.1); color:#FFFFFF; }
        .rte-float-bar button.active { background:#E8B22D; color:#2D2D2D; }
        .rte-float-bar select { background:transparent; border:none; color:#DDDDDD; padding:6px 8px; cursor:pointer; font-size:12px; font-family:inherit; }
        .rte-float-bar-sep { width:1px; background:rgba(255,255,255,0.15); margin:4px 2px; }

        /* Collaborative cursors */
        .rte-cursor { position:absolute; width:2px; background:#E8B22D; pointer-events:none; z-index:100; animation:rteCursorBlink 1.2s ease-in-out infinite; }
        @keyframes rteCursorBlink { 0%,100% { opacity:0.3; } 50% { opacity:1; } }
        .rte-cursor-label { position:absolute; top:-18px; left:-2px; background:#E8B22D; color:#2D2D2D; font-size:10px; padding:1px 5px; border-radius:3px; white-space:nowrap; font-weight:600; }
        .rte-selection-range { background:rgba(232,178,45,0.2); pointer-events:none; }

        /* Word counter / AI */
        .rte-statusbar { position:sticky; bottom:0; background:#FFFFFF; border-top:1px solid hsl(var(--border)); padding:6px 20px; font-size:11px; color:hsl(var(--muted-foreground)); display:flex; gap:16px; align-items:center; flex-shrink:0; }
        .rte-statusbar .ai-btn { background:#FFFBEE; border:1px solid #F3E4AC; border-radius:4px; padding:2px 8px; cursor:pointer; color:#8A6720; font-weight:500; }
        .rte-statusbar .ai-btn:hover { background:#FFF4C6; }

        @media (max-width: 720px) {
            .rte-doc { padding:20px 14px 80px; }
            .rte-doc-title { font-size:28px; }
            .rte-block-handles { margin-left:-34px; width:32px; }
            .rte-topbar { padding:8px 10px; gap:4px; flex-wrap:wrap; }
        }

        /* File preview overlay — obrázky / videá / PDF / OnlyOffice (Word/Excel/PPT) */
        .fp-overlay { position:fixed; inset:0; background:rgba(15,15,15,0.85); z-index:2800; display:none; flex-direction:column; }
        .fp-overlay.open { display:flex; }
        .fp-head { display:flex; align-items:center; gap:10px; padding:10px 16px; background:#2D2D2D; color:#FFFFFF; flex-shrink:0; }
        .fp-head .fp-icon { width:34px; height:34px; background:#E8B22D; border-radius:8px; display:flex; align-items:center; justify-content:center; color:#2D2D2D; font-size:16px; flex-shrink:0; }
        .fp-head-main { flex:1; min-width:0; }
        .fp-head-title { font-size:14px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        .fp-head-meta { font-size:11px; color:rgba(255,255,255,0.7); margin-top:2px; }
        .fp-head-meta span { margin-right:10px; }
        .fp-head-actions { display:flex; gap:4px; flex-shrink:0; }
        .fp-head-btn { background:rgba(255,255,255,0.1); border:none; color:#FFFFFF; padding:7px 10px; border-radius:6px; cursor:pointer; font-size:12px; display:inline-flex; align-items:center; gap:4px; }
        .fp-head-btn:hover { background:rgba(255,255,255,0.2); }
        .fp-head-btn svg { width:13px; height:13px; }
        .fp-head-btn.primary { background:#E8B22D; color:#2D2D2D; font-weight:600; }
        .fp-head-btn.primary:hover { background:#D9A31E; }
        .fp-head-btn.danger { background:rgba(212,55,17,0.3); }
        .fp-head-btn.danger:hover { background:rgba(212,55,17,0.5); }

        .fp-body { flex:1; display:flex; align-items:center; justify-content:center; padding:20px; overflow:hidden; position:relative; }
        .fp-body.with-sidebar { padding-right: 320px; }

        /* Image viewer */
        .fp-image { max-width:100%; max-height:100%; object-fit:contain; cursor:grab; transition:transform 0.1s ease; background:linear-gradient(135deg,#E8ECEF 0%, #D4DAE0 100%); border-radius:6px; padding:40px; min-width:400px; min-height:300px; display:flex; align-items:center; justify-content:center; color:#707071; font-size:14px; }

        /* Video viewer */
        .fp-video { max-width:100%; max-height:100%; background:#000000; border-radius:6px; padding:40px; min-width:600px; min-height:400px; display:flex; flex-direction:column; align-items:center; justify-content:center; color:#FFFFFF; gap:14px; }
        .fp-video-play { width:80px; height:80px; background:rgba(232,178,45,0.9); border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:32px; cursor:pointer; }
        .fp-video-controls { display:flex; align-items:center; gap:12px; width:100%; max-width:600px; }
        .fp-video-progress { flex:1; height:6px; background:rgba(255,255,255,0.2); border-radius:3px; cursor:pointer; position:relative; }
        .fp-video-progress-fill { height:100%; background:#E8B22D; border-radius:3px; width:34%; }

        /* PDF viewer */
        .fp-pdf { background:#F4F4F4; border-radius:6px; padding:30px; width:100%; max-width:900px; max-height:calc(100vh - 120px); overflow:auto; display:flex; flex-direction:column; gap:12px; align-items:center; }
        .fp-pdf-page { background:#FFFFFF; width:595px; height:842px; box-shadow:0 4px 16px rgba(0,0,0,0.2); padding:48px; display:flex; flex-direction:column; font-size:13px; line-height:1.6; color:#2D2D2D; flex-shrink:0; }
        .fp-pdf-page h2 { font-size:22px; margin:0 0 12px; color:#2D2D2D; border-bottom:2px solid #E8B22D; padding-bottom:8px; }
        .fp-pdf-page h3 { font-size:16px; margin:16px 0 8px; }
        .fp-pdf-page p { margin:0 0 10px; }
        .fp-pdf-page .fp-pdf-num { font-size:10px; color:#707071; text-align:center; margin-top:auto; }
        .fp-pdf-page table { width:100%; border-collapse:collapse; margin:10px 0; font-size:11px; }
        .fp-pdf-page th { background:#F4F4F4; padding:6px 8px; text-align:left; border:1px solid #DDDDDD; }
        .fp-pdf-page td { padding:6px 8px; border:1px solid #DDDDDD; }

        /* OnlyOffice / Office docs — fake embed */
        .fp-office { width:100%; height:100%; background:#FFFFFF; border-radius:6px; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 8px 32px rgba(0,0,0,0.3); }
        .fp-office-ribbon { background:#F3F3F3; border-bottom:1px solid #D0D0D0; padding:0; flex-shrink:0; }
        .fp-office-tabs { display:flex; gap:0; padding:0 12px; border-bottom:1px solid #D0D0D0; background:#E9E9E9; height:32px; }
        .fp-office-tab { padding:6px 14px; font-size:12px; color:#444444; cursor:pointer; border-right:1px solid #D0D0D0; background:transparent; border-top:none; border-bottom:none; border-left:none; }
        .fp-office-tab.active { background:#FFFFFF; color:#2D2D2D; font-weight:600; }
        .fp-office-tab-content { padding:8px 14px; font-size:11px; color:#707071; display:flex; gap:14px; align-items:center; flex-wrap:wrap; min-height:58px; background:#F3F3F3; }
        .fp-office-tab-content .tool-group { display:flex; gap:4px; align-items:center; padding-right:10px; border-right:1px solid #D0D0D0; }
        .fp-office-tab-content .tool-group:last-child { border-right:none; }
        .fp-office-tool { width:26px; height:26px; background:#FFFFFF; border:1px solid #D0D0D0; border-radius:3px; display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:11px; }
        .fp-office-tool:hover { background:#E8F0F7; border-color:#A6C6E0; }
        .fp-office-body { flex:1; overflow:auto; background:#E0E0E0; padding:20px 0; display:flex; justify-content:center; }

        /* Word document view */
        .fp-word-page { background:#FFFFFF; width:750px; min-height:900px; padding:60px 70px; box-shadow:0 4px 16px rgba(0,0,0,0.2); font-family: Calibri, 'Segoe UI', sans-serif; font-size:14px; line-height:1.6; color:#222; margin-bottom:30px; }
        .fp-word-page h1 { font-size:28px; margin:0 0 16px; color:#1F3864; font-weight:400; }
        .fp-word-page h2 { font-size:20px; margin:20px 0 10px; color:#2E74B5; font-weight:400; }
        .fp-word-page p { margin:0 0 12px; text-align:justify; }

        /* Excel view */
        .fp-xl-wrap { background:#FFFFFF; width:100%; padding:0; margin:0 20px; box-shadow:0 4px 16px rgba(0,0,0,0.2); overflow:auto; display:flex; flex-direction:column; }
        .fp-xl-bar { display:flex; align-items:center; background:#217346; color:#FFFFFF; padding:6px 12px; font-size:12px; }
        .fp-xl-bar .cell-ref { background:#FFFFFF; color:#000000; padding:3px 8px; min-width:60px; border-radius:2px; font-family: Consolas, Menlo, monospace; font-size:11px; }
        .fp-xl-bar .formula-bar { flex:1; background:#FFFFFF; color:#000000; padding:3px 8px; margin-left:8px; font-family: Consolas, Menlo, monospace; font-size:11px; border-radius:2px; }
        .fp-xl-grid { display:grid; grid-template-columns: 28px repeat(8, 100px); font-family: Calibri, sans-serif; font-size:11px; }
        .fp-xl-grid > div { border-right:1px solid #D4D4D4; border-bottom:1px solid #D4D4D4; padding:2px 4px; min-height:20px; display:flex; align-items:center; }
        .fp-xl-grid .hdr { background:#F0F0F0; color:#707071; font-weight:500; justify-content:center; text-align:center; padding:4px; }
        .fp-xl-grid .hdr-c { background:#E7E6E6; font-weight:600; color:#2D2D2D; }
        .fp-xl-grid .num { justify-content:flex-end; text-align:right; }
        .fp-xl-grid .bold { font-weight:700; background:#FFF2CC; }
        .fp-xl-grid .total { font-weight:700; background:#D9E1F2; }
        .fp-xl-tabs { background:#F0F0F0; border-top:1px solid #D0D0D0; padding:3px 12px; display:flex; gap:0; font-size:11px; color:#2D2D2D; }
        .fp-xl-tabs span { padding:4px 12px; cursor:pointer; border-right:1px solid #D0D0D0; }
        .fp-xl-tabs span.active { background:#FFFFFF; font-weight:600; color:#217346; border-top:2px solid #217346; }

        /* PowerPoint view */
        .fp-ppt-wrap { display:flex; width:100%; height:100%; max-width:1100px; gap:12px; margin:0 20px; }
        .fp-ppt-thumbs { width:180px; background:#2D2D2D; padding:10px; display:flex; flex-direction:column; gap:8px; overflow-y:auto; flex-shrink:0; }
        .fp-ppt-thumb { aspect-ratio:16/9; background:#FFFFFF; border-radius:4px; padding:8px; font-size:9px; color:#707071; cursor:pointer; border:2px solid transparent; display:flex; flex-direction:column; gap:3px; }
        .fp-ppt-thumb.active { border-color:#E8B22D; }
        .fp-ppt-thumb .n { color:#FFFFFF; font-size:10px; margin-bottom:2px; font-weight:600; text-align:left; }
        .fp-ppt-thumb strong { font-size:8px; color:#000000; }
        .fp-ppt-main { flex:1; background:#FFFFFF; aspect-ratio:16/9; max-height:calc(100vh - 180px); border-radius:6px; padding:60px 80px; display:flex; flex-direction:column; align-items:center; justify-content:center; box-shadow:0 8px 32px rgba(0,0,0,0.3); font-family: 'Segoe UI', Calibri, sans-serif; }

        /* OnlyOffice branding strip */
        .fp-office-branded { position:absolute; bottom:8px; right:16px; font-size:10.5px; color:rgba(255,255,255,0.6); display:flex; align-items:center; gap:6px; }
        .fp-office-branded strong { color:#FFFFFF; }

        /* Collaboration presence (fake cursors) */
        .fp-collab { position:absolute; top:10px; right:10px; display:flex; gap:4px; }
        .fp-collab-avatar { width:26px; height:26px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:11px; font-weight:600; color:#FFFFFF; border:2px solid #FFFFFF; }

        /* Sidebar s info */
        .fp-sidebar { position:absolute; top:0; right:0; width:300px; height:100%; background:#FFFFFF; border-left:1px solid hsl(var(--border)); padding:18px 18px; overflow-y:auto; }
        .fp-sidebar h4 { margin:12px 0 6px; font-size:10.5px; text-transform:uppercase; color:hsl(var(--muted-foreground)); font-weight:600; letter-spacing:0.04em; }
        .fp-sidebar h4:first-child { margin-top:0; }
        .fp-sidebar .kv { display:flex; justify-content:space-between; padding:4px 0; font-size:12.5px; border-bottom:1px dashed #EDEDED; }
        .fp-sidebar .kv .k { color:hsl(var(--muted-foreground)); }
        .fp-sidebar .kv .v { font-weight:500; text-align:right; }

        /* Zoom controls */
        .fp-zoom-ctrl { position:absolute; bottom:20px; left:50%; transform:translateX(-50%); background:rgba(0,0,0,0.75); color:#FFFFFF; border-radius:22px; padding:4px 8px; display:flex; align-items:center; gap:4px; z-index:2; }
        .fp-zoom-ctrl button { background:transparent; border:none; color:#FFFFFF; cursor:pointer; padding:6px 10px; border-radius:4px; font-size:12px; }
        .fp-zoom-ctrl button:hover { background:rgba(255,255,255,0.15); }
        .fp-zoom-ctrl .z-val { padding:0 10px; font-size:12px; color:#FFFFFF; min-width:54px; text-align:center; }

        @media (max-width: 900px) {
            .fp-head { padding:8px 10px; gap:6px; flex-wrap:wrap; }
            .fp-head-actions { width:100%; justify-content:flex-start; margin-top:6px; overflow-x:auto; }
            .fp-head-btn { padding:5px 8px; font-size:11px; }
            .fp-body { padding:10px; }
            .fp-body.with-sidebar { padding-right:10px; padding-bottom:300px; }
            .fp-sidebar { top:auto; bottom:0; width:100%; height:300px; border-left:none; border-top:1px solid hsl(var(--border)); }
            .fp-pdf-page { width:100%; max-width:100%; height:auto; padding:20px; }
            .fp-word-page { width:100%; padding:30px 20px; }
            .fp-ppt-wrap { flex-direction:column; }
            .fp-ppt-thumbs { width:100%; max-height:100px; flex-direction:row; }
            .fp-ppt-thumb { width:140px; flex-shrink:0; }
            .fp-xl-grid { grid-template-columns: 24px repeat(8, 80px); font-size:10px; }
        }

        /* ER Diagram — Správa dátových štruktúr */
        .er-wrap { display:flex; height: calc(100vh - 140px); min-height:500px; background:#FFFFFF; }
        .er-sidebar { width: 220px; flex-shrink:0; border-right:1px solid hsl(var(--border)); background:#FAFAFA; display:flex; flex-direction:column; }
        .er-sidebar-head { padding:10px 12px; border-bottom:1px solid hsl(var(--border)); }
        .er-sidebar-head input { width:100%; padding:6px 10px; border:1px solid hsl(var(--border)); border-radius:6px; font-size:12px; font-family:inherit; background:#FFFFFF; }
        .er-sidebar-list { flex:1; overflow-y:auto; padding:6px; }
        .er-sidebar-item { padding:8px 10px; border-radius:6px; cursor:pointer; display:flex; align-items:center; gap:8px; font-size:12.5px; margin-bottom:2px; }
        .er-sidebar-item:hover { background:#F0F0F0; }
        .er-sidebar-item.active { background:#2D2D2D; color:#FFFFFF; }
        .er-sidebar-item .ic { width:22px; height:22px; border-radius:5px; display:flex; align-items:center; justify-content:center; font-size:11px; color:#FFFFFF; flex-shrink:0; }
        .er-sidebar-item .cnt { margin-left:auto; font-size:10.5px; opacity:0.7; }
        .er-canvas-wrap { flex:1; position:relative; overflow:hidden; background: #F4F4F4; background-image: radial-gradient(circle, #D4D4D4 1px, transparent 1px); background-size: 20px 20px; }
        .er-toolbar { position:absolute; top:10px; left:10px; display:flex; gap:4px; background:#FFFFFF; border:1px solid hsl(var(--border)); border-radius:8px; padding:4px; z-index:3; box-shadow:0 2px 8px rgba(0,0,0,0.08); flex-wrap:wrap; }
        .er-tbtn { background:transparent; border:none; padding:5px 9px; border-radius:4px; cursor:pointer; font-size:11.5px; color:hsl(var(--foreground)); display:inline-flex; align-items:center; gap:4px; }
        .er-tbtn:hover { background:#F4F4F4; }
        .er-tbtn.active { background:#2D2D2D; color:#FFFFFF; }
        .er-tbtn svg { width:12px; height:12px; }
        .er-tbtn-sep { width:1px; background:#DDD; margin:2px 2px; }
        .er-zoom-label { display:inline-flex; align-items:center; padding:0 8px; font-size:11.5px; color:hsl(var(--muted-foreground)); min-width:40px; justify-content:center; }
        .er-legend { position:absolute; bottom:10px; left:10px; background:#FFFFFF; border:1px solid hsl(var(--border)); border-radius:8px; padding:10px 12px; font-size:11px; z-index:3; box-shadow:0 2px 8px rgba(0,0,0,0.08); min-width:170px; }
        .er-legend h4 { margin:0 0 6px; font-size:10px; text-transform:uppercase; letter-spacing:0.05em; color:hsl(var(--muted-foreground)); font-weight:600; }
        .er-legend-row { display:flex; align-items:center; gap:8px; margin:3px 0; }
        .er-legend-row svg { width:34px; height:10px; flex-shrink:0; }
        .er-minimap { position:absolute; bottom:10px; right:10px; background:#FFFFFF; border:1px solid hsl(var(--border)); border-radius:8px; padding:6px; z-index:3; box-shadow:0 2px 8px rgba(0,0,0,0.08); }
        .er-minimap h4 { margin:0 0 4px; font-size:9.5px; text-transform:uppercase; color:hsl(var(--muted-foreground)); font-weight:600; text-align:center; }
        .er-minimap-canvas { width:140px; height:90px; background:#FAFAFA; border:1px solid #EDEDED; position:relative; border-radius:4px; overflow:hidden; }
        .er-canvas { position:absolute; inset:0; transform-origin: 0 0; cursor: grab; }
        .er-canvas.panning { cursor: grabbing; }
        .er-svg { position:absolute; top:0; left:0; pointer-events:none; }
        .er-entity { position:absolute; background:#FFFFFF; border:2px solid; border-radius:10px; min-width:200px; max-width:260px; box-shadow:0 2px 10px rgba(0,0,0,0.08); cursor:grab; user-select:none; overflow:hidden; transition: box-shadow 0.12s ease, transform 0.12s ease; }
        .er-entity:hover { box-shadow:0 6px 20px rgba(0,0,0,0.14); }
        .er-entity.dragging { cursor:grabbing; box-shadow:0 12px 28px rgba(0,0,0,0.22); z-index:10; }
        .er-entity.selected { outline:3px solid rgba(232,178,45,0.5); outline-offset:2px; }
        .er-entity-head { padding:8px 12px; color:#FFFFFF; display:flex; align-items:center; gap:8px; font-weight:600; font-size:13px; }
        .er-entity-head .ic { width:20px; height:20px; display:flex; align-items:center; justify-content:center; background:rgba(255,255,255,0.25); border-radius:5px; font-size:12px; flex-shrink:0; }
        .er-entity-head .cnt { margin-left:auto; font-size:10px; font-weight:500; opacity:0.85; background:rgba(0,0,0,0.2); padding:2px 7px; border-radius:10px; }
        .er-entity-body { padding:2px 0; max-height:320px; overflow-y:auto; }
        .er-attr { display:flex; align-items:center; gap:6px; padding:5px 12px; font-size:11.5px; color:hsl(var(--foreground)); border-bottom:1px solid #F3F3F3; }
        .er-attr:last-child { border-bottom:none; }
        .er-attr.pk { background:#FFFBEE; }
        .er-attr.fk { background:#E4F6FC; }
        .er-attr .type-ic { width:16px; height:16px; border-radius:3px; display:inline-flex; align-items:center; justify-content:center; background:#F0F0F0; color:#707071; font-size:9px; font-weight:700; flex-shrink:0; font-family: ui-monospace, Menlo, monospace; }
        .er-attr.pk .type-ic { background:#FFE89A; color:#8A6720; }
        .er-attr.fk .type-ic { background:#3BCAEF; color:#FFFFFF; }
        .er-attr .name { font-weight:500; }
        .er-attr .muted { color:hsl(var(--muted-foreground)); font-size:10.5px; margin-left:auto; font-family: ui-monospace, Menlo, monospace; }
        .er-attr .badge-relation { display:inline-flex; align-items:center; gap:3px; font-size:10px; padding:1px 5px; background:rgba(59,202,239,0.18); color:#1E6B85; border-radius:4px; margin-left:auto; font-weight:500; }
        .er-attr .badge-relation.reverse { background:rgba(155,81,224,0.16); color:#6B2F9E; }
        .er-attr .badge-relation.computed { background:rgba(232,178,45,0.18); color:#8A6720; }
        .er-entity-foot { padding:6px 12px; background:#FAFAFA; border-top:1px solid #EDEDED; font-size:10.5px; color:hsl(var(--muted-foreground)); display:flex; align-items:center; gap:8px; }
        .er-entity-foot button { background:transparent; border:none; padding:2px 6px; color:hsl(var(--muted-foreground)); cursor:pointer; border-radius:3px; font-size:11px; }
        .er-entity-foot button:hover { background:#E8E8E8; color:hsl(var(--foreground)); }

        /* ER detail panel (right sidebar pri selecte entity) */
        .er-detail-panel { position:absolute; top:0; right:-340px; bottom:0; width:340px; background:#FFFFFF; border-left:1px solid hsl(var(--border)); overflow-y:auto; transition: right 0.2s ease; z-index:4; }
        .er-detail-panel.open { right:0; }
        .er-detail-head { padding:14px 16px; border-bottom:1px solid hsl(var(--border)); display:flex; align-items:center; gap:10px; }
        .er-detail-head .ic { width:30px; height:30px; display:flex; align-items:center; justify-content:center; color:#FFFFFF; border-radius:7px; font-size:14px; flex-shrink:0; }
        .er-detail-head strong { flex:1; font-size:14px; }
        .er-detail-head .x { background:transparent; border:none; cursor:pointer; padding:4px; color:hsl(var(--muted-foreground)); border-radius:4px; }
        .er-detail-head .x:hover { background:#F4F4F4; color:hsl(var(--foreground)); }
        .er-detail-body { padding:14px 16px; }
        .er-detail-body h4 { margin:12px 0 6px; font-size:10.5px; text-transform:uppercase; color:hsl(var(--muted-foreground)); font-weight:600; letter-spacing:0.04em; }
        .er-detail-body h4:first-child { margin-top:0; }
        .er-detail-body .kv { display:flex; justify-content:space-between; padding:4px 0; font-size:12.5px; border-bottom:1px dashed #EDEDED; }
        .er-detail-body .kv:last-child { border-bottom:none; }
        .er-detail-body .kv .k { color:hsl(var(--muted-foreground)); }
        .er-detail-body .rel-line { font-size:12px; padding:6px 8px; background:#F8F8F8; border-radius:6px; margin-bottom:4px; line-height:1.4; }
        .er-detail-body .rel-line strong { color:hsl(var(--foreground)); }
        .er-detail-body .rel-line .arrow { color:#3BCAEF; margin:0 4px; font-weight:700; }
        .er-detail-body .sh-btn { width:100%; margin-bottom:4px; }

        /* Responzivita */
        @media (max-width: 900px) {
            .er-wrap { flex-direction:column; height:auto; }
            .er-sidebar { width:100%; border-right:none; border-bottom:1px solid hsl(var(--border)); max-height:160px; }
            .er-canvas-wrap { min-height:500px; }
            .er-toolbar { flex-wrap:wrap; }
            .er-minimap { display:none; }
            .er-detail-panel { position:fixed; top:0; right:-100%; bottom:0; width:100%; z-index:200; }
        }

        /* Marketplace — detail page + rozšírené karty pre Templates/Pluginy/Moduly */
        .mp-pricing-badge { display:inline-flex; align-items:center; gap:3px; padding:2px 7px; border-radius:10px; font-size:10px; font-weight:600; margin-left:4px; }
        .mp-pricing-free { background:#E6F7EF; color:#1E8A5D; }
        .mp-pricing-paid { background:#FFF4C6; color:#8A6720; }
        .mp-pricing-ent { background:#F2E7FA; color:#6B2F9E; }
        .mp-pricing-freemium { background:#E4F6FC; color:#2588A8; }
        .mp-rating-stars { color:#E8B22D; letter-spacing:0.5px; }

        /* Detail overlay — Marketplace item (shared pre Integrácie/Pluginy/Moduly/Templates) */
        .md-overlay { position: fixed; inset: 0; background: rgba(15,15,15,0.6); backdrop-filter: blur(5px); z-index: 2700; display: none; align-items: flex-start; justify-content: center; padding: 24px; overflow-y: auto; }
        .md-overlay.open { display: flex; }
        .md-modal { width: 940px; max-width: 100%; background: #FFFFFF; border-radius: 14px; box-shadow: 0 28px 72px rgba(0,0,0,0.3); display: flex; flex-direction: column; overflow: hidden; margin-bottom: 24px; }
        .md-head { padding: 22px 28px; border-bottom: 1px solid hsl(var(--border)); background: #FFFFFF; display: flex; align-items: flex-start; gap: 18px; }
        .md-head .md-logo { width: 72px; height: 72px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: #FFFFFF; flex-shrink: 0; }
        .md-head-main { flex: 1; min-width: 0; }
        .md-breadcrumb { font-size: 11px; color: hsl(var(--muted-foreground)); margin-bottom: 4px; }
        .md-breadcrumb a { color: inherit; text-decoration: none; }
        .md-breadcrumb a:hover { color: hsl(var(--foreground)); }
        .md-title { font-size: 22px; font-weight: 700; color: hsl(var(--foreground)); margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
        .md-subtitle { font-size: 12.5px; color: hsl(var(--muted-foreground)); margin: 6px 0 0; }
        .md-subtitle a { color: inherit; text-decoration: underline; }
        .md-meta-row { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 12px; color: hsl(var(--muted-foreground)); flex-wrap: wrap; }
        .md-meta-row .dot { width: 3px; height: 3px; border-radius: 50%; background: #BFBFBF; }
        .md-verified { display:inline-flex; align-items:center; gap:3px; color:#2AB67D; font-weight:600; }
        .md-head-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex-shrink: 0; }
        .md-install-big { background: #2D2D2D; color: #FFFFFF; border: none; border-radius: 10px; padding: 12px 24px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-width: 160px; justify-content: center; }
        .md-install-big:hover { background: #1a1a1a; }
        .md-install-big.installed { background: #E6F7EF; color: #1E8A5D; border: 1px solid #BCE4CF; }
        .md-install-big.installed:hover { background: #D4F5D4; }
        .md-price-line { font-size: 12px; color: hsl(var(--muted-foreground)); text-align: right; }
        .md-price-line strong { color: hsl(var(--foreground)); font-size: 14px; }

        .md-close { position: absolute; top: 20px; right: 24px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 50%; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: hsl(var(--muted-foreground)); z-index: 2; }
        .md-close:hover { background: #F4F4F4; color: hsl(var(--foreground)); }

        .md-tabs { display: flex; gap: 0; padding: 0 28px; border-bottom: 1px solid hsl(var(--border)); overflow-x: auto; flex-shrink: 0; background: #FFFFFF; }
        .md-tab { background: transparent; border: none; padding: 12px 18px; font-size: 13px; font-weight: 500; color: hsl(var(--muted-foreground)); cursor: pointer; position: relative; white-space: nowrap; }
        .md-tab:hover { color: hsl(var(--foreground)); }
        .md-tab.active { color: hsl(var(--foreground)); }
        .md-tab.active::after { content: ''; position: absolute; bottom: -1px; left: 18px; right: 18px; height: 2px; background: #2D2D2D; }
        .md-tab-badge { background: #E8B22D; color: #2D2D2D; font-size: 10px; padding: 1px 5px; border-radius: 8px; margin-left: 5px; font-weight: 600; }

        .md-body { padding: 22px 28px 28px; background: #FAFAFA; }
        .md-panel { display: none; }
        .md-panel.active { display: block; }
        .md-grid-cols { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }

        /* Overview */
        .md-desc { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 18px 20px; margin-bottom: 14px; font-size: 13.5px; line-height: 1.65; color: hsl(var(--foreground)); }
        .md-desc h3 { margin: 14px 0 6px; font-size: 14px; }
        .md-desc h3:first-child { margin-top: 0; }
        .md-desc ul { padding-left: 18px; margin: 6px 0; }
        .md-desc li { margin: 4px 0; }
        .md-desc code { background: #F4F4F4; padding: 1px 5px; border-radius: 3px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

        /* Screenshots gallery */
        .md-screens { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
        .md-screens h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; }
        .md-screens-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
        .md-screen-thumb { flex-shrink: 0; width: 280px; height: 170px; border-radius: 8px; background: linear-gradient(135deg, #E8ECEF 0%, #D4DAE0 100%); border: 1px solid hsl(var(--border)); cursor: zoom-in; position: relative; overflow: hidden; transition: transform 0.15s ease, box-shadow 0.15s ease; display: flex; align-items: center; justify-content: center; color: hsl(var(--muted-foreground)); font-size: 12px; text-align: center; padding: 14px; }
        .md-screen-thumb:hover { transform: scale(1.02); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
        .md-screen-thumb::after { content: '🔍'; position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.6); color: #FFFFFF; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; }
        .md-screen-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1400; display: none; align-items: center; justify-content: center; padding: 40px; }
        .md-screen-lightbox.open { display: flex; }
        .md-screen-lightbox .lb-content { max-width: 90vw; max-height: 90vh; background: linear-gradient(135deg, #E8ECEF 0%, #D4DAE0 100%); width: 1200px; height: 680px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #707071; font-size: 16px; padding: 40px; text-align: center; box-shadow: 0 24px 64px rgba(0,0,0,0.4); }

        /* Sidebar info card */
        .md-side { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 16px 18px; position: sticky; top: 20px; align-self: start; }
        .md-side h4 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: hsl(var(--muted-foreground)); font-weight: 600; }
        .md-side h4:not(:first-child) { margin-top: 12px; }
        .md-side .row { font-size: 13px; color: hsl(var(--foreground)); margin-bottom: 2px; }
        .md-side .row strong { font-weight: 600; }
        .md-side a { color: hsl(var(--foreground)); text-decoration: none; }
        .md-side a:hover { text-decoration: underline; }
        .md-side .tag { display: inline-block; padding: 2px 7px; background: #F4F4F4; border-radius: 10px; font-size: 10.5px; margin: 2px 2px 2px 0; color: hsl(var(--foreground)); }

        /* Pricing panel */
        .md-pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
        .md-pricing-card { background: #FFFFFF; border: 2px solid hsl(var(--border)); border-radius: 12px; padding: 20px 18px; position: relative; display: flex; flex-direction: column; }
        .md-pricing-card.featured { border-color: #E8B22D; background: linear-gradient(180deg, #FFFBEE 0%, #FFFFFF 40%); }
        .md-pricing-card.featured::before { content: 'NAJPOPULÁRNEJŠÍ'; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: #E8B22D; color: #2D2D2D; font-size: 10px; font-weight: 700; padding: 2px 10px; border-radius: 10px; letter-spacing: 0.05em; }
        .md-pricing-card .tier { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: hsl(var(--muted-foreground)); font-weight: 600; margin-bottom: 6px; }
        .md-pricing-card .price { font-size: 26px; font-weight: 700; color: hsl(var(--foreground)); }
        .md-pricing-card .price sub { font-size: 13px; color: hsl(var(--muted-foreground)); font-weight: 500; }
        .md-pricing-card .desc { font-size: 12.5px; color: hsl(var(--muted-foreground)); margin: 8px 0 14px; line-height: 1.5; min-height: 36px; }
        .md-pricing-card ul { padding: 0; list-style: none; margin: 0 0 16px; font-size: 12.5px; flex: 1; }
        .md-pricing-card ul li { padding: 3px 0 3px 18px; position: relative; line-height: 1.5; }
        .md-pricing-card ul li::before { content: '✓'; color: #2AB67D; position: absolute; left: 0; font-weight: 700; }
        .md-pricing-card button { width: 100%; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; border: 1px solid #2D2D2D; background: #FFFFFF; color: #2D2D2D; }
        .md-pricing-card.featured button { background: #2D2D2D; color: #FFFFFF; }
        .md-pricing-card button:hover { opacity: 0.85; }

        /* Reviews */
        .md-reviews-head { display: flex; align-items: center; gap: 24px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 18px 20px; margin-bottom: 12px; flex-wrap: wrap; }
        .md-rating-big { font-size: 44px; font-weight: 700; color: hsl(var(--foreground)); line-height: 1; }
        .md-rating-stars-big { font-size: 16px; color: #E8B22D; letter-spacing: 2px; margin-bottom: 4px; }
        .md-review-dist { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
        .md-review-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
        .md-review-row .label { width: 22px; }
        .md-review-row .bar { flex: 1; height: 6px; background: #F0F0F0; border-radius: 3px; overflow: hidden; }
        .md-review-row .bar-fill { height: 100%; background: #E8B22D; }
        .md-review-row .pct { width: 36px; text-align: right; color: hsl(var(--muted-foreground)); }
        .md-review { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
        .md-review-hdr { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
        .md-review-hdr .chat-avatar { width: 32px; height: 32px; font-size: 12px; }
        .md-review-hdr strong { font-size: 13px; }
        .md-review-hdr .md-rating-stars { font-size: 13px; margin-left: auto; }
        .md-review-hdr .date { font-size: 11.5px; color: hsl(var(--muted-foreground)); }
        .md-review-title { font-weight: 600; font-size: 13.5px; margin: 4px 0; }
        .md-review-text { font-size: 12.5px; line-height: 1.55; color: hsl(var(--foreground)); }
        .md-review-footer { display: flex; gap: 12px; margin-top: 8px; font-size: 11px; color: hsl(var(--muted-foreground)); }
        .md-review-footer button { background: transparent; border: none; color: inherit; cursor: pointer; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
        .md-review-footer button:hover { background: #F4F4F4; }

        /* Changelog */
        .md-changelog-entry { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
        .md-changelog-entry .ver-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
        .md-changelog-entry .ver { background: #2D2D2D; color: #FFFFFF; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; font-family: ui-monospace, Menlo, monospace; }
        .md-changelog-entry .ver.latest { background: #E8B22D; color: #2D2D2D; }
        .md-changelog-entry .date { font-size: 11.5px; color: hsl(var(--muted-foreground)); }
        .md-changelog-entry ul { margin: 4px 0 0 18px; font-size: 12.5px; line-height: 1.6; }
        .md-changelog-entry .change-type { display:inline-block; background:#EDEDED; padding:1px 6px; border-radius:3px; font-size:10px; font-weight:600; margin-right:4px; }
        .md-changelog-entry .change-type.new { background:#E6F7EF; color:#2E7D32; }
        .md-changelog-entry .change-type.fix { background:#FDECE6; color:#C63310; }
        .md-changelog-entry .change-type.improve { background:#E4F6FC; color:#2588A8; }

        /* Template card — špecifický vzhľad (viac ako plugin karta) */
        .tmp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
        .tmp-card { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: all 0.15s ease; }
        .tmp-card:hover { border-color: #E8B22D; box-shadow: 0 4px 18px rgba(0,0,0,0.08); transform: translateY(-2px); }
        .tmp-card-preview { height: 140px; background: linear-gradient(135deg, var(--tpl-c1, #FFFBEE) 0%, var(--tpl-c2, #FFE89A) 100%); display: flex; align-items: center; justify-content: center; font-size: 42px; position: relative; }
        .tmp-card-preview .tmp-badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; }
        .tmp-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
        .tmp-card-title { font-size: 14px; font-weight: 600; color: hsl(var(--foreground)); margin-bottom: 2px; }
        .tmp-card-cat { font-size: 11px; color: hsl(var(--muted-foreground)); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
        .tmp-card-desc { font-size: 12px; color: hsl(var(--foreground)); line-height: 1.5; flex: 1; }
        .tmp-card-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid #F0F0F0; font-size: 11px; color: hsl(var(--muted-foreground)); }
        .tmp-card-foot .sep { opacity: 0.5; }
        .tmp-card-install { margin-left: auto; background: #2D2D2D; color: #FFFFFF; border: none; padding: 5px 12px; border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer; }
        .tmp-card-install:hover { background: #1a1a1a; }

        @media (max-width: 900px) {
            .md-modal { width: 100%; margin: 0; border-radius: 0; min-height: 100vh; }
            .md-overlay { padding: 0; align-items: stretch; }
            .md-head { padding: 16px 18px; flex-wrap: wrap; gap: 12px; }
            .md-head .md-logo { width: 56px; height: 56px; font-size: 22px; border-radius: 12px; }
            .md-head-actions { width: 100%; align-items: stretch; }
            .md-install-big { width: 100%; }
            .md-tabs { padding: 0 12px; }
            .md-body { padding: 14px 16px 24px; }
            .md-grid-cols { grid-template-columns: 1fr; }
            .md-side { position: static; }
        }

        /* Klávesové skratky — Nastavenia firmy */
        .ks-toolbar { display:flex; align-items:center; gap:8px; padding: 8px 0 14px; flex-wrap:wrap; }
        .ks-toolbar input.ks-search { flex:1; min-width:240px; padding: 8px 12px; border: 1px solid hsl(var(--border)); border-radius: 8px; font-size: 12.5px; font-family: inherit; background: #FFFFFF; }
        .ks-toolbar .ks-preset { display:inline-flex; align-items:center; gap:6px; padding: 6px 12px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: #FFFFFF; font-size: 12px; cursor: pointer; color: hsl(var(--foreground)); }
        .ks-toolbar .ks-preset:hover { background: #F4F4F4; }
        .ks-toolbar .ks-preset.active { background: #2D2D2D; color: #FFFFFF; border-color: #2D2D2D; }
        .ks-toolbar .ks-scope { display:inline-flex; border: 1px solid hsl(var(--border)); border-radius: 8px; overflow:hidden; background: #FFFFFF; }
        .ks-toolbar .ks-scope button { background: transparent; border: none; padding: 6px 12px; font-size: 12px; cursor: pointer; color: hsl(var(--foreground)); }
        .ks-toolbar .ks-scope button.active { background: #2D2D2D; color: #FFFFFF; }
        .ks-toolbar .ks-grow { flex: 1; }

        .ks-cat { background:#FFFFFF; border:1px solid hsl(var(--border)); border-radius: 10px; margin-bottom: 12px; overflow:hidden; }
        .ks-cat-head { display:flex; align-items:center; gap:8px; padding: 10px 14px; background:#FAFAFA; border-bottom:1px solid hsl(var(--border)); }
        .ks-cat-head h3 { margin: 0; font-size: 13px; font-weight: 600; color: hsl(var(--foreground)); }
        .ks-cat-head .count { font-size: 11px; color: hsl(var(--muted-foreground)); background: #EDEDED; padding: 2px 8px; border-radius: 10px; }
        .ks-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
        .ks-table th { text-transform: uppercase; letter-spacing: 0.04em; font-size: 10.5px; padding: 5px 12px; background: #FFFFFF; border-bottom: 1px solid #EFEFEF; color: hsl(var(--muted-foreground)); font-weight: 600; text-align: left; }
        .ks-table td { padding: 5px 12px; border-bottom: 1px solid #F5F5F5; vertical-align: middle; }
        .ks-table tr:last-child td { border-bottom: none; }
        .ks-table tr:hover td { background: #FAFAFA; }
        .ks-action-label { font-weight: 500; color: hsl(var(--foreground)); }
        .ks-action-desc { font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
        .ks-keys { display: inline-flex; align-items: center; gap: 3px; }
        .ks-key { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 24px; padding: 0 7px; background: #F4F4F4; border: 1px solid #DDDDDD; border-radius: 5px; box-shadow: 0 1px 0 #CCCCCC; font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: hsl(var(--foreground)); font-weight: 600; }
        .ks-key-plus { color: hsl(var(--muted-foreground)); font-size: 10px; padding: 0 1px; }
        .ks-record-btn { background: transparent; border: 1px dashed #D4D4D4; padding: 4px 10px; border-radius: 6px; font-size: 11.5px; cursor: pointer; color: hsl(var(--muted-foreground)); margin-left: 8px; }
        .ks-record-btn:hover { border-color: #E8B22D; color: #B08218; background: #FFFBEE; }
        .ks-record-btn.recording { border: 1px solid #D43711; background: #FEEFE9; color: #D43711; animation: ksRec 1.2s ease-in-out infinite; }
        @keyframes ksRec { 0%, 100% { box-shadow: 0 0 0 0 rgba(212,55,17,0.4); } 50% { box-shadow: 0 0 0 4px rgba(212,55,17,0); } }
        .ks-conflict { color: #D43711; font-size: 11px; background: #FEEFE9; padding: 2px 6px; border-radius: 3px; margin-left: 6px; }
        .ks-unbound { color: hsl(var(--muted-foreground)); font-style: italic; font-size: 11px; padding: 2px 6px; background: #F4F4F4; border-radius: 3px; }
        .ks-reset-btn { background: transparent; border: none; color: hsl(var(--muted-foreground)); cursor: pointer; padding: 4px 6px; font-size: 11px; }
        .ks-reset-btn:hover { color: #D43711; }
        .ks-row-actions { text-align: right; white-space: nowrap; }

        @media (max-width: 720px) {
            .ks-table { font-size: 11.5px; }
            .ks-table th, .ks-table td { padding: 6px 10px; }
            .ks-toolbar input.ks-search { min-width: 100%; }
        }

        /* Marketplace → Integrácie (katalóg connectors) */
        .intg-search-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; justify-content: space-between; }
        .intg-search-row .intg-chips { margin-bottom: 0; flex: 1; flex-wrap: wrap; }
        .intg-chips { display:flex; gap:6px; margin-bottom:14px; flex-wrap:wrap; }
        .intg-chip { display:inline-flex; align-items:center; gap:4px; padding:4px 11px; background:#F4F4F4; border:1px solid transparent; border-radius:14px; font-size:11.5px; color:hsl(var(--foreground)); cursor:pointer; }
        .intg-chip:hover { background:#EAEAEA; }
        .intg-chip.active { background:#2D2D2D; color:#FFFFFF; }
        .intg-cat { margin-bottom: 22px; }
        .intg-cat-head { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
        .intg-cat-head .flag { display:inline-flex; align-items:center; gap:3px; padding:2px 8px; background: #FFFBEE; border: 1px solid #F3E4AC; border-radius: 10px; font-size:10.5px; color:#8A6720; font-weight:600; }
        .intg-cat-head h3 { margin: 0; font-size: 14px; color: hsl(var(--foreground)); }
        .intg-cat-head .count { font-size:11.5px; color: hsl(var(--muted-foreground)); margin-left: 4px; }
        .intg-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
        .intg-card { background:#FFFFFF; border:1px solid hsl(var(--border)); border-radius: 10px; padding: 14px; display:flex; flex-direction:column; gap: 8px; transition: all 0.15s ease; }
        .intg-card:hover { border-color: #E8B22D; box-shadow: 0 4px 14px rgba(0,0,0,0.06); transform: translateY(-1px); }
        .intg-card-head { display:flex; align-items:center; gap: 10px; }
        .intg-card-logo { width: 42px; height: 42px; border-radius: 10px; display:inline-flex; align-items:center; justify-content:center; font-size: 18px; font-weight: 700; color:#FFFFFF; flex-shrink: 0; }
        .intg-card-title { font-size: 13px; font-weight: 600; color: hsl(var(--foreground)); line-height: 1.3; }
        .intg-card-sub { font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
        .intg-card-desc { font-size: 12px; color: hsl(var(--foreground)); line-height: 1.5; flex: 1; }
        .intg-card-meta { display:flex; align-items:center; gap:8px; font-size: 10.5px; color: hsl(var(--muted-foreground)); flex-wrap:wrap; }
        .intg-card-meta .badge { background:#F4F4F4; padding:2px 7px; border-radius:8px; color:hsl(var(--foreground)); font-weight:500; font-size:10px; }
        .intg-card-meta .badge.sk { background: #FFF4C6; color: #8A6720; }
        .intg-card-meta .badge.verified { background: #D4F5D4; color: #2E7D32; }
        .intg-card-meta .badge.popular { background: #FFE89A; color: #8A6720; }
        .intg-card-actions { display:flex; gap: 6px; margin-top: 4px; }
        .intg-install-btn { flex:1; background: #2D2D2D; color: #FFFFFF; border: none; border-radius: 6px; padding: 8px 12px; font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
        .intg-install-btn:hover { background: #1a1a1a; }
        .intg-install-btn.installed { background: #E6F7EF; color: #1E8A5D; border: 1px solid #BCE4CF; }
        .intg-install-btn.installed:hover { background: #D4F5D4; }
        .intg-install-btn svg { width: 12px; height: 12px; }
        .intg-detail-btn { background: #FFFFFF; color: hsl(var(--foreground)); border: 1px solid hsl(var(--border)); border-radius: 6px; padding: 8px 12px; font-size: 12px; cursor: pointer; }
        .intg-detail-btn:hover { background: #F4F4F4; }

        /* Install modal */
        .intg-install-overlay { position: fixed; inset: 0; background: rgba(15,15,15,0.55); backdrop-filter: blur(4px); z-index: 1300; display: none; align-items: center; justify-content: center; padding: 24px; }
        .intg-install-overlay.open { display: flex; }
        .intg-install-modal { width: 520px; max-width: 100%; background: #FFFFFF; border-radius: 12px; box-shadow: 0 24px 64px rgba(0,0,0,0.25); display: flex; flex-direction: column; max-height: 85vh; overflow: hidden; }
        .intg-install-head { padding: 16px 20px; border-bottom: 1px solid hsl(var(--border)); display: flex; align-items: center; gap: 12px; }
        .intg-install-head .intg-card-logo { width: 36px; height: 36px; font-size: 15px; }
        .intg-install-head-text { flex: 1; }
        .intg-install-head-text strong { font-size: 14px; }
        .intg-install-head-text span { display:block; font-size: 11.5px; color: hsl(var(--muted-foreground)); }
        .intg-install-body { flex: 1; overflow: auto; padding: 18px 20px; }
        .intg-install-body h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--muted-foreground)); margin: 0 0 6px; font-weight: 600; }
        .intg-install-body h4:not(:first-child) { margin-top: 14px; }
        .intg-install-body p { font-size: 12.5px; line-height: 1.55; margin: 0 0 8px; }
        .intg-install-body .perm-list { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.7; color: hsl(var(--foreground)); }
        .intg-install-body .perm-list li::marker { color: #E8B22D; }
        .intg-install-body .field { margin-bottom: 10px; }
        .intg-install-body .field label { display:block; font-size:11px; font-weight:500; color:hsl(var(--muted-foreground)); margin-bottom:3px; }
        .intg-install-body .field input { width:100%; padding:7px 10px; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 12.5px; font-family: inherit; box-sizing: border-box; }
        .intg-install-foot { padding: 12px 20px; border-top: 1px solid hsl(var(--border)); background: #FAFAFA; display: flex; gap: 8px; justify-content: flex-end; }

        @media (max-width: 720px) {
            .intg-grid { grid-template-columns: 1fr; }
            .intg-chips { overflow-x: auto; flex-wrap: nowrap; }
            .intg-chips .intg-chip { flex-shrink: 0; }
        }

        /* ===========================================================
           FINAL RESPONSIVE POLISH — všetky nové sekcie (M2)
           Breakpoints: ≤1024 tablet, ≤768 mobile, ≤420 mobile-xs
           =========================================================== */
        @media (max-width: 1024px) {
            .cmdk-modal { width: 92vw; max-height: 80vh; }
            .ai-panel { width: 380px; }
            .ai-panel.open.with-artifacts { right: 12px; }
            .ai-artifacts-panel { width: 420px; }
            .sce-modal { max-width: 100vw; }
            .apim-list { width: 230px; }
            .apim-metrics-cards { grid-template-columns: repeat(2, 1fr); }
            .pol-meta-grid { grid-template-columns: repeat(2, 1fr); }
        }

        @media (max-width: 768px) {
            /* AI panel full-screen na mobile */
            .ai-fab { right: 14px; bottom: 70px; width: 48px; height: 48px; }
            .ai-panel { right: 0; bottom: 0; left: 0; top: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
            .ai-panel.open.with-artifacts { right: 0; left: 0; }
            .ai-artifacts-panel { right: 0; bottom: 0; left: 0; top: 0; width: 100%; max-width: 100%; height: 100%; border-radius: 0; z-index: 131; }
            .ai-toolbar { overflow-x: auto; flex-wrap: nowrap; padding: 6px 8px; }
            .ai-toolbar-btn, .ai-cost-pill { flex-shrink: 0; }
            .ai-cost-pill { margin-left: 6px; }

            /* Command palette full-height na mobile */
            .cmdk-overlay { padding: 0; align-items: stretch; }
            .cmdk-modal { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
            .cmdk-footer { display: none; }
            .cmdk-item { padding: 10px 12px; }
            .cmdk-item-actions { display: none; }

            /* Form view */
            .form-view-wrap { padding: 16px 12px 32px; margin: 8px auto; }
            .form-view-card { padding: 18px 14px; }
            .form-view-title { font-size: 18px; }
            .form-view-builder-bar { padding: 6px 10px; font-size: 11px; flex-wrap: wrap; gap: 6px; }

            /* Pivot */
            .pivot-wrap { flex-direction: column; }
            .pivot-config { width: 100%; max-height: 220px; border-right: none; border-bottom: 1px solid hsl(var(--border)); }
            .pivot-swap-btn { top: 4px; right: 4px; }

            /* Comments panel */
            .cmt-filters { gap: 4px; padding: 6px; overflow-x: auto; flex-wrap: nowrap; }
            .cmt-filters .cmt-chip { flex-shrink: 0; font-size: 10.5px; padding: 3px 8px; }
            .cmt-filters .cmt-grow, .cmt-sort-btn, .cmt-subscribe-btn, .cmt-ai-btn { flex-shrink: 0; }
            .cmt-rte-toolbar { overflow-x: auto; flex-wrap: nowrap; padding: 3px 5px; }
            .cmt-rte-btn { flex-shrink: 0; }
            .cmt-item { padding: 8px 10px; }
            .cmt-item-head { flex-wrap: wrap; gap: 6px; }
            .cmt-reply-compose, .cmt-replies { padding-left: 8px; }
            .cmt-compose-wrap { position: sticky; bottom: 0; background: #FFFFFF; padding: 8px 10px; z-index: 2; }

            /* Scenario editor — BPMN/Events */
            .sce-overlay { padding: 0; }
            .sce-modal { width: 100%; max-width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; }
            .sce-head { padding: 10px 12px; gap: 6px; }
            .sce-head .sce-title { font-size: 13px; }
            .sce-head .sce-sub { display: none; }
            .sce-workspace { flex-direction: column; }
            .sce-lib, .sce-inspector { width: 100%; height: 160px; border-right: none; border-left: none; border-bottom: 1px solid hsl(var(--border)); }
            .sce-inspector { order: 3; border-bottom: none; border-top: 1px solid hsl(var(--border)); height: 200px; }
            .sce-canvas-wrap { order: 2; flex: 1; min-height: 400px; }

            /* Diff modal */
            .ai-diff-cols { grid-template-columns: 1fr; }

            /* API metódy */
            .apim-wrap { flex-direction: column; min-height: 0; }
            .apim-list { width: 100%; max-height: 180px; border-right: none; border-bottom: 1px solid hsl(var(--border)); }
            .apim-bar { padding: 8px 10px; flex-wrap: wrap; }
            .apim-endpoint { font-size: 10.5px; padding: 4px 8px; order: 3; flex-basis: 100%; }
            .apim-tabs { padding: 0 8px; }
            .apim-tab { padding: 8px 10px; font-size: 11.5px; }
            .apim-try-row { grid-template-columns: 1fr; }
            .apim-metrics-cards { grid-template-columns: 1fr 1fr; }

            /* Policy detail */
            .pol-head { padding: 10px 12px; gap: 6px; flex-wrap: wrap; }
            .pol-breadcrumb { font-size: 10.5px; flex-basis: 100%; order: 3; }
            .pol-body { padding: 14px 12px 32px; }
            .pol-section { padding: 12px 14px; }
            .pol-meta-grid { grid-template-columns: 1fr; }
            .pol-rules-table { font-size: 11px; display: block; overflow-x: auto; white-space: nowrap; }
            .pol-rules-table td { min-width: 140px; }
            .pol-fb-overlay { padding: 0; align-items: stretch; }
            .pol-fb-modal { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
            .pol-fb-cond { flex-wrap: wrap; }
            .pol-fb-cond select, .pol-fb-cond input { min-width: 0; width: 100%; }

            /* Integrations */

            /* Shortcuts */
            .ks-toolbar { gap: 6px; }
            .ks-toolbar input.ks-search { min-width: 100%; order: -1; }
            .ks-preset, .ks-scope, .ks-toolbar .sh-btn { flex-shrink: 0; font-size: 11px; }
            .ks-cat-head { padding: 8px 10px; }
            .ks-table { display: block; overflow-x: auto; }
            .ks-table td { white-space: nowrap; }
            .ks-action-label { white-space: normal; }
            .ks-action-desc { white-space: normal; }

            /* Toolbar top navigation — JEDEN RIADOK + horizontálne scrollovanie (predtým wrap na 3 riadky) */
            .toolbar { flex-wrap: nowrap !important; gap: 4px; padding: 8px 12px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; }
            .toolbar::-webkit-scrollbar { display: none; }
            .toolbar > * { flex-shrink: 0 !important; }
            .toolbar .ml-auto { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; width: auto !important; flex-shrink: 0 !important; flex-wrap: nowrap; }
            .view-select-trigger { min-width: 0; }
            .view-select-label { max-width: 100px; }

            /* Toolbar inputs a search — fix width na mobile (predtým 100% prerývalo riadok) */
            .toolbar input[type="text"], .toolbar .sh-input { width: 160px !important; max-width: 160px; flex-shrink: 0; }

            /* Tabuľky všeobecne — horizontal scroll */
            .dtable, .dse-table, .pol-rules-table, .ks-table, .apim-log-table { font-size: 11.5px; }

            /* Detail split panel fallback na mobile — full-screen */
            .detail-panel { width: 100% !important; }
            .view-host.split .detail-panel { position: fixed; inset: 0; z-index: 120; }

            /* iOS Safari prevent zoom-on-focus — všetky input-y/textarea/contenteditable musia mať font-size >= 16px.
               Ináč iOS automaticky zoomne stránku pri tape do inputu. */
            input[type="text"], input[type="email"], input[type="password"],
            input[type="number"], input[type="tel"], input[type="url"],
            input[type="search"], input[type="date"], input[type="time"],
            input[type="datetime-local"], textarea, select, [contenteditable="true"] {
                font-size: 16px !important;
            }
        }

        @media (max-width: 420px) {
            .ai-fab { right: 10px; bottom: 66px; width: 44px; height: 44px; }
            .form-view-title { font-size: 16px; }
            .cmdk-item { padding: 8px 10px; }
            .cmdk-input { font-size: 13px; }
            .cmt-item-head .cmt-author { font-size: 12px; }
            .apim-metric-card .v { font-size: 18px; }
            .intg-card { padding: 12px; }
            .intg-card-logo { width: 36px; height: 36px; font-size: 14px; }
            .ks-key { min-width: 18px; height: 20px; padding: 0 5px; font-size: 10px; }
        }

        /* API metódy sub-page (DSE → API metódy) — inline podstránka */
        .apim-wrap { display:flex; height:100%; min-height:600px; background:#FFFFFF; }
        .apim-list { width: 280px; border-right: 1px solid hsl(var(--border)); background: #FAFAFA; display:flex; flex-direction:column; flex-shrink:0; }
        .apim-list-head { padding: 10px 12px; border-bottom: 1px solid hsl(var(--border)); display:flex; align-items:center; gap:6px; }
        .apim-list-head input { flex:1; padding: 6px 8px; border:1px solid hsl(var(--border)); border-radius:6px; font-size:12px; font-family:inherit; }
        .apim-list-head button { background:#2D2D2D; color:#FFFFFF; border:none; border-radius:6px; padding: 6px 10px; cursor:pointer; font-size:12px; display:inline-flex; align-items:center; gap:4px; }
        .apim-list-head button:hover { background:#1a1a1a; }
        .apim-items { flex:1; overflow-y:auto; padding:6px; }
        .apim-item { padding:8px 10px; border-radius:6px; cursor:pointer; margin-bottom:3px; display:flex; flex-direction:column; gap:2px; }
        .apim-item:hover { background:#F0F0F0; }
        .apim-item.active { background:#2D2D2D; color:#FFFFFF; }
        .apim-item-head { display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600; }
        .apim-verb { font-size: 9.5px; font-weight:700; padding:1px 5px; border-radius:3px; text-transform:uppercase; color:#FFFFFF; flex-shrink:0; }
        .apim-verb.GET { background:#2AB67D; }
        .apim-verb.POST { background:#3BCAEF; }
        .apim-verb.PUT { background:#E8B22D; }
        .apim-verb.PATCH { background:#B08218; }
        .apim-verb.DELETE { background:#D43711; }
        .apim-item.active .apim-verb { opacity:0.9; }
        .apim-item-sub { font-size: 11px; opacity:0.7; font-family: ui-monospace, Menlo, monospace; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        .apim-main { flex:1; display:flex; flex-direction:column; overflow:hidden; min-width:0; }
        .apim-bar { display:flex; align-items:center; gap:10px; padding: 10px 16px; border-bottom:1px solid hsl(var(--border)); background:#FFFFFF; flex-wrap:wrap; }
        .apim-verb-pill { font-size:11px; font-weight:700; padding:3px 8px; border-radius:4px; color:#FFFFFF; text-transform:uppercase; letter-spacing:0.04em; }
        .apim-endpoint { flex:1; font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: hsl(var(--foreground)); background:#F4F4F4; padding: 6px 10px; border-radius:6px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; border:1px solid hsl(var(--border)); }
        .apim-bar .sh-btn { font-size: 12px; padding: 6px 12px; }
        .apim-tabs { display:flex; align-items:center; border-bottom:1px solid hsl(var(--border)); padding: 0 16px; background:#FFFFFF; flex-shrink:0; overflow-x:auto; }
        .apim-tab { background:transparent; border:none; padding: 10px 14px; cursor:pointer; color:hsl(var(--muted-foreground)); font-size:12.5px; font-weight:500; position:relative; white-space:nowrap; }
        .apim-tab:hover { color: hsl(var(--foreground)); }
        .apim-tab.active { color: hsl(var(--foreground)); }
        .apim-tab.active::after { content:''; position:absolute; bottom:-1px; left:14px; right:14px; height:2px; background:#2D2D2D; }
        .apim-tab-badge { background:#E8B22D; color:#2D2D2D; font-size:10px; padding:1px 5px; border-radius:8px; margin-left:5px; font-weight:600; }
        .apim-content { flex:1; overflow:auto; padding: 18px 20px; background:#FAFAFA; }
        .apim-panel { display:none; }
        .apim-panel.active { display:block; }

        .apim-section { background:#FFFFFF; border:1px solid hsl(var(--border)); border-radius:8px; padding: 14px 16px; margin-bottom:12px; }
        .apim-section h3 { margin: 0 0 8px; font-size: 13px; font-weight:600; }
        .apim-section .hint { font-size: 11.5px; color: hsl(var(--muted-foreground)); margin: 0 0 10px; }
        .apim-grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
        .apim-field label { display:block; font-size:11px; font-weight:500; color:hsl(var(--muted-foreground)); margin-bottom:4px; }
        .apim-field input, .apim-field select, .apim-field textarea { width:100%; padding:6px 10px; border:1px solid hsl(var(--border)); border-radius:6px; font-size:12.5px; font-family:inherit; box-sizing:border-box; background:#FFFFFF; }
        .apim-field textarea { min-height:54px; resize:vertical; }
        .apim-field.mono input, .apim-field.mono textarea { font-family: ui-monospace, Menlo, monospace; font-size:12px; }

        /* Function Stack editor */
        .apim-stack { display:flex; flex-direction:column; gap: 6px; }
        .apim-step { background:#FFFFFF; border:1px solid hsl(var(--border)); border-radius:8px; overflow:hidden; }
        .apim-step-head { display:flex; align-items:center; gap:8px; padding:8px 12px; cursor:pointer; background:#FAFAFA; }
        .apim-step-head:hover { background:#F0F0F0; }
        .apim-step.open .apim-step-head { background:#EEF; }
        .apim-step-drag { color:#BFBFBF; cursor:grab; }
        .apim-step-num { width:22px; height:22px; background:#2D2D2D; color:#FFFFFF; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:11px; font-weight:600; flex-shrink:0; }
        .apim-step-type { font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; padding: 2px 7px; border-radius:3px; color:#FFFFFF; flex-shrink:0; }
        .apim-step-type.validate { background:#D43711; }
        .apim-step-type.enrich { background:#7B3FBF; }
        .apim-step-type.transform { background:#3BCAEF; }
        .apim-step-type.fetch { background:#2AB67D; }
        .apim-step-type.js { background:#E8B22D; color:#2D2D2D; }
        .apim-step-type.sql { background:#2D2D2D; }
        .apim-step-type.auth { background:#B08218; }
        .apim-step-type.response { background:#2AB67D; }
        .apim-step-type.audit { background:#707071; }
        .apim-step-type.cache { background:#3BCAEF; }
        .apim-step-type.notify { background:#E8B22D; color:#2D2D2D; }
        .apim-step-title { flex:1; font-size:12.5px; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
        .apim-step-arrow { color:hsl(var(--muted-foreground)); transition: transform 0.15s ease; font-size: 10px; }
        .apim-step.open .apim-step-arrow { transform: rotate(90deg); }
        .apim-step-remove { background:transparent; border:none; cursor:pointer; color:hsl(var(--muted-foreground)); padding:4px 6px; border-radius:4px; font-size:12px; }
        .apim-step-remove:hover { background:#FEEFE9; color:#D43711; }
        .apim-step-body { display:none; padding: 10px 12px; border-top:1px solid hsl(var(--border)); background:#FFFFFF; }
        .apim-step.open .apim-step-body { display:block; }
        .apim-step-body .apim-field + .apim-field { margin-top:8px; }
        .apim-step-body code { background:#2D2D2D; color:#E8E8E8; padding: 8px 10px; border-radius:4px; font-family: ui-monospace, Menlo, monospace; font-size:11.5px; display:block; white-space:pre; overflow:auto; }
        .apim-add-step-row { display:flex; align-items:center; gap:6px; margin-top:4px; padding:6px 12px; border:1px dashed #D4D4D4; border-radius:6px; font-size:11.5px; color:hsl(var(--muted-foreground)); cursor:pointer; justify-content:center; background:#FFFFFF; }
        .apim-add-step-row:hover { border-color:#E8B22D; background:#FFFBEE; color:#B08218; }

        /* Try-it-out panel */
        .apim-try-row { display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
        .apim-try-body { background:#2D2D2D; color:#E6E6E6; padding:10px; border-radius:6px; font-family: ui-monospace, Menlo, monospace; font-size:11.5px; min-height:120px; white-space:pre; overflow:auto; }
        .apim-try-send { background:#2AB67D; color:#FFFFFF; border:none; border-radius:6px; padding: 8px 16px; cursor:pointer; font-weight:600; font-size:12.5px; }
        .apim-try-send:hover { background:#1E8A5D; }
        .apim-try-status { display:inline-flex; align-items:center; gap:6px; padding: 3px 9px; border-radius:12px; font-size:11px; font-weight:600; }
        .apim-try-status.ok { background:#D4F5D4; color:#1E8A5D; }
        .apim-try-status.err { background:#FEEFE9; color:#D43711; }

        /* Metrics panel */
        .apim-metrics-cards { display:grid; grid-template-columns: repeat(4, 1fr); gap:10px; margin-bottom:12px; }
        .apim-metric-card { background:#FFFFFF; border:1px solid hsl(var(--border)); border-radius:8px; padding:12px; }
        .apim-metric-card .v { font-size: 22px; font-weight:700; color:hsl(var(--foreground)); }
        .apim-metric-card .l { font-size:11px; color:hsl(var(--muted-foreground)); margin-bottom:4px; }
        .apim-metric-card .t { font-size:10.5px; color:#2AB67D; font-weight:600; }
        .apim-log-table { width:100%; border-collapse: collapse; font-size:12px; }
        .apim-log-table th { text-align:left; padding:5px 8px; background:#F4F4F4; font-size:10.5px; text-transform:uppercase; font-weight:600; color:hsl(var(--muted-foreground)); letter-spacing:0.04em; }
        .apim-log-table td { padding:5px 8px; border-bottom:1px solid #EFEFEF; }
        .apim-log-table tr:hover td { background:#FAFAFA; }
        .apim-log-ok { color:#2AB67D; font-weight:600; }
        .apim-log-err { color:#D43711; font-weight:600; }

        @media (max-width: 900px) {
            .apim-wrap { flex-direction:column; }
            .apim-list { width:100%; max-height: 200px; border-right:none; border-bottom:1px solid hsl(var(--border)); }
            .apim-grid-2, .apim-try-row { grid-template-columns: 1fr; }
            .apim-metrics-cards { grid-template-columns: repeat(2, 1fr); }
        }

        /* Policy detail (Oprávnenia — Pridať/Upraviť) — inline podstránka */
        .pol-page { position: fixed !important; inset: 0 !important; background: #FFFFFF; z-index: 3000 !important; display: none; flex-direction: column; overflow: hidden; }
        .pol-page.open { display: flex !important; }
        .role-users-cell { font-size: 12px; color: hsl(var(--foreground)); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; max-width: 220px; white-space: nowrap; text-overflow: ellipsis; }
        .perm-role-row:hover { background: #FAFAFA; }
        .pol-head { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid hsl(var(--border)); flex-shrink: 0; background: #FFFFFF; }
        .pol-back { background: transparent; border: none; cursor: pointer; padding: 6px; color: hsl(var(--muted-foreground)); border-radius: 4px; display: flex; align-items: center; gap: 6px; font-size: 12px; }
        .pol-back:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .pol-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: hsl(var(--muted-foreground)); }
        .pol-breadcrumb .sep { opacity: 0.5; }
        .pol-breadcrumb strong { color: hsl(var(--foreground)); }
        .pol-breadcrumb .pol-bc-link { color: hsl(var(--muted-foreground)); text-decoration: none; padding: 2px 4px; border-radius: 4px; transition: background 0.12s, color 0.12s; }
        .pol-breadcrumb .pol-bc-link:hover { background: rgba(0,0,0,0.05); color: hsl(var(--foreground)); }
        .pol-head .pol-grow { flex: 1; }
        .pol-head .sh-btn { font-size: 12px; }

        .pol-body { flex: 1; overflow: auto; padding: 22px 28px 40px; background: #FAFAFA; }
        .pol-section { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 18px 20px; margin-bottom: 14px; }
        .pol-section h3 { font-size: 13px; font-weight: 600; color: hsl(var(--foreground)); margin: 0 0 12px; }
        .pol-meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
        .pol-field label { display: block; font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-bottom: 4px; font-weight: 500; }
        .pol-field input, .pol-field textarea, .pol-field select { width: 100%; padding: 7px 10px; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 13px; font-family: inherit; box-sizing: border-box; background: #FFFFFF; }
        .pol-field textarea { min-height: 60px; resize: vertical; }

        .pol-rules-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
        .pol-rules-table th { text-transform: uppercase; letter-spacing: 0.04em; font-size: 10.5px; color: hsl(var(--muted-foreground)); font-weight: 600; padding: 5px 10px; background: #F4F4F4; border-bottom: 1px solid hsl(var(--border)); text-align: left; }
        .pol-rules-table th:first-child { border-top-left-radius: 6px; }
        .pol-rules-table th:last-child { border-top-right-radius: 6px; }
        .pol-rules-table td { padding: 6px 10px; background: #FFFFFF; border-bottom: 1px solid #EFEFEF; vertical-align: top; }
        .pol-rules-table tr:last-child td { border-bottom: none; }
        .pol-row-drag { cursor: grab; color: #BFBFBF; text-align: center; padding-top: 16px !important; }
        .pol-row-num { font-weight: 600; color: hsl(var(--muted-foreground)); text-align: center; padding-top: 16px !important; }
        .pol-row-del { width: 28px; text-align: center; padding-top: 12px !important; }
        .pol-row-del button { background: transparent; border: none; cursor: pointer; color: hsl(var(--muted-foreground)); padding: 4px; border-radius: 4px; }
        .pol-row-del button:hover { background: #FEEFE9; color: #D43711; }

        .pol-select { position: relative; }
        .pol-select-trigger { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 12.5px; background: #FFFFFF; cursor: pointer; width: 100%; min-height: 32px; box-sizing: border-box; }
        .pol-select-trigger:hover { background: #FAFAFA; }
        .pol-select.open .pol-select-trigger { border-color: hsl(var(--primary)); }
        .pol-select-label { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .pol-select-label.empty { color: hsl(var(--muted-foreground)); font-style: italic; }
        .pol-select-chev { width: 12px; height: 12px; color: hsl(var(--muted-foreground)); transition: transform 0.12s ease; flex-shrink: 0; }
        .pol-select.open .pol-select-chev { transform: rotate(180deg); }
        .pol-select-menu { position: fixed; min-width: 220px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 6px; z-index: 3500; display: none; max-height: 320px; overflow-y: auto; overflow-x: hidden; }
        .pol-select.open .pol-select-menu { display: block; }
        .pol-select-search { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid hsl(var(--border)); margin-bottom: 4px; }
        .pol-select-search input { flex: 1; border: none; outline: none; background: transparent; font-size: 12.5px; font-family: inherit; }
        .pol-select-search svg { width: 13px; height: 13px; color: hsl(var(--muted-foreground)); }
        .pol-select-opt { padding: 6px 10px; font-size: 12.5px; cursor: pointer; border-radius: 4px; display: flex; align-items: center; gap: 8px; color: hsl(var(--foreground)); }
        .pol-select-opt:hover, .pol-select-opt.active { background: #F6F4EA; }
        .pol-select-opt .pol-select-check { width: 14px; height: 14px; border: 1.5px solid #BFBFBF; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .pol-select-opt.checked .pol-select-check { background: #2D2D2D; border-color: #2D2D2D; }
        .pol-select-opt.checked .pol-select-check::before { content: '✓'; color: #FFFFFF; font-size: 10px; font-weight: 600; }

        .pol-effect-allow { color: #2AB67D; font-weight: 600; }
        .pol-effect-deny { color: #D43711; font-weight: 600; }

        .pol-add-rule { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: #2D2D2D; color: #FFFFFF; border: none; border-radius: 6px; font-size: 12px; cursor: pointer; margin-top: 12px; }
        .pol-add-rule:hover { background: #1a1a1a; }

        /* Advanced filter builder (inline v podmienkach) */
        .pol-cond { position: relative; }
        .pol-cond-preview { padding: 6px 10px; border: 1px dashed hsl(var(--border)); border-radius: 6px; font-size: 11.5px; color: hsl(var(--muted-foreground)); cursor: pointer; background: #FAFAFA; min-height: 32px; display: flex; align-items: center; gap: 4px; font-family: ui-monospace, Menlo, monospace; }
        .pol-cond-preview:hover { border-color: #E8B22D; background: #FFFBEE; color: hsl(var(--foreground)); }
        .pol-cond-preview.empty { font-style: italic; font-family: inherit; }
        .pol-cond-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; font-size: 11px; margin: 1px 2px; }
        .pol-cond-chip .op { color: #B08218; font-weight: 600; }
        .pol-cond-chip .link { color: #2AB67D; font-weight: 600; padding: 0 3px; }

        /* Advanced filter builder overlay */
        .pol-fb-overlay { position: fixed; inset: 0; background: transparent; z-index: 3100; display: none; }
        .pol-fb-overlay.open { display: block; }
        .pol-fb-modal { position: absolute; width: 600px; max-width: calc(100vw - 32px); max-height: 70vh; background: #FFFFFF; border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 0 0 1px hsl(var(--border)); display: flex; flex-direction: column; overflow: hidden; }
        .pol-fb-head { padding: 14px 20px; border-bottom: 1px solid hsl(var(--border)); display: flex; align-items: center; gap: 10px; }
        .pol-fb-head strong { flex: 1; font-size: 15px; }
        .pol-fb-body { flex: 1; overflow: auto; padding: 20px; }
        .pol-fb-body h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; }
        .pol-fb-group { border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 10px; margin-bottom: 10px; background: #FAFAFA; }
        .pol-fb-group.nested { margin-top: 8px; background: #F0F0F0; }
        .pol-fb-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 11.5px; color: hsl(var(--muted-foreground)); }
        .pol-fb-group-head .pol-fb-ao { display: inline-flex; border: 1px solid hsl(var(--border)); border-radius: 4px; overflow: hidden; background: #FFFFFF; }
        .pol-fb-group-head .pol-fb-ao button { background: transparent; border: none; padding: 3px 10px; cursor: pointer; font-size: 11px; font-weight: 600; color: hsl(var(--foreground)); }
        .pol-fb-group-head .pol-fb-ao button.active { background: #2D2D2D; color: #FFFFFF; }
        .pol-fb-group-head .pol-fb-remove-group { margin-left: auto; background: transparent; border: none; cursor: pointer; color: hsl(var(--muted-foreground)); padding: 2px 6px; border-radius: 4px; font-size: 11px; }
        .pol-fb-group-head .pol-fb-remove-group:hover { background: #FEEFE9; color: #D43711; }
        /* Policy filter — používa rovnaký .adv-cond-row / .adv-connector pattern ako Pokročilé filtre. */
        .adv-fb-input { padding: 0 10px; height: 30px; border: 1px solid hsl(var(--border)); border-radius: 4px; font-size: 13px; font-family: inherit; background: #FFFFFF; color: hsl(var(--foreground)); outline: none; min-width: 120px; }
        .adv-fb-input:focus { border-color: hsl(var(--primary)); }
        .adv-fb-input[type="text"], .adv-fb-input[type="number"], .adv-fb-input[type="date"] { flex: 1; min-width: 140px; }
        .pol-fb-body .adv-connector select.adv-fb-connector { padding: 0 8px; height: 26px; border: 1px solid hsl(var(--border)); border-radius: 4px; font-size: 11px; font-family: inherit; font-weight: 600; background: #FFFFFF; color: hsl(var(--foreground)); outline: none; min-width: 70px; }
        .pol-fb-add button { padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
        .pol-fb-add button.primary { background: #2D2D2D; color: #FFFFFF; border: none; }
        .pol-fb-add button.primary:hover { background: #1a1a1a; }
        .pol-fb-add button.outline { background: #FFFFFF; color: hsl(var(--foreground)); border: 1px solid hsl(var(--border)); }
        .pol-fb-add button.outline:hover { background: #F4F4F4; }
        .pol-fb-foot { padding: 12px 20px; border-top: 1px solid hsl(var(--border)); display: flex; gap: 8px; justify-content: flex-end; background: #FAFAFA; align-items: center; }
        .pol-fb-preview { display: none; }

        @media (max-width: 900px) {
            .pol-meta-grid { grid-template-columns: 1fr; }
            .pol-rules-table { font-size: 11px; }
            .pol-rules-table th, .pol-rules-table td { padding: 6px; }
        }

        /* Scenario (Events) visual editor — Make + BPMN toggle */
        .sce-overlay { position: fixed; inset: 0; background: rgba(15,15,15,0.6); backdrop-filter: blur(4px); z-index: 1100; display: none; align-items: center; justify-content: center; padding: 24px; }
        .sce-overlay.open { display: flex; }
        .sce-modal { width: 100%; max-width: 1280px; height: calc(100vh - 48px); background: #FFFFFF; border-radius: 14px; box-shadow: 0 32px 72px rgba(0,0,0,0.28); display: flex; flex-direction: column; overflow: hidden; }
        .sce-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid hsl(var(--border)); background: #FAFAFA; flex-wrap: wrap; }
        .sce-title { font-size: 15px; font-weight: 600; color: hsl(var(--foreground)); }
        .sce-sub { font-size: 12px; color: hsl(var(--muted-foreground)); }
        .sce-toggle { display: inline-flex; border: 1px solid hsl(var(--border)); border-radius: 8px; overflow: hidden; background: #FFFFFF; }
        .sce-toggle button { background: transparent; border: none; padding: 6px 14px; font-size: 12px; color: hsl(var(--foreground)); cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }
        .sce-toggle button.active { background: #2D2D2D; color: #FFFFFF; }
        .sce-toggle button:not(.active):hover { background: #F0F0F0; }
        .sce-opt { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 6px 10px; border: 1px solid hsl(var(--border)); border-radius: 6px; cursor: pointer; background: #FFFFFF; color: hsl(var(--foreground)); }
        .sce-opt:hover { background: #F0F0F0; }
        .sce-opt.active { background: #FFFBEE; border-color: #E8B22D; color: #8A6720; }
        .sce-head .sce-grow { flex: 1; }
        .sce-btn { padding: 6px 12px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 12px; cursor: pointer; }
        .sce-btn:hover { background: #F0F0F0; }
        .sce-btn.primary { background: #2D2D2D; color: #FFFFFF; border-color: #2D2D2D; }
        .sce-btn.primary:hover { background: #1a1a1a; }
        .sce-close { background: transparent; border: none; cursor: pointer; padding: 6px; color: hsl(var(--muted-foreground)); border-radius: 4px; }
        .sce-close:hover { background: #F0F0F0; color: hsl(var(--foreground)); }

        .sce-workspace { flex: 1; display: flex; min-height: 0; }
        .sce-lib { width: 220px; border-right: 1px solid hsl(var(--border)); background: #FAFAFA; padding: 10px; overflow-y: auto; flex-shrink: 0; }
        .sce-lib h4 { font-size: 10.5px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.05em; margin: 10px 0 4px; }
        .sce-lib h4:first-child { margin-top: 0; }
        .sce-lib-item { display: flex; align-items: center; gap: 7px; padding: 6px 8px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 11.5px; color: hsl(var(--foreground)); cursor: grab; margin-bottom: 4px; }
        .sce-lib-item:hover { border-color: #E8B22D; background: #FFFBEE; }
        .sce-lib-ic { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; }
        .sce-canvas-wrap { flex: 1; position: relative; overflow: auto; background: #F4F4F4; background-image: radial-gradient(circle, #D4D4D4 1px, transparent 1px); background-size: 20px 20px; }
        .sce-canvas { position: relative; min-width: 1400px; min-height: 700px; padding: 40px; }

        .sce-lane { position: relative; margin-bottom: 12px; background: rgba(255,255,255,0.6); border: 1px dashed #C6C6C6; border-radius: 8px; min-height: 120px; display: flex; }
        .sce-lane-label { width: 36px; background: #EDEDED; border-right: 1px solid #D4D4D4; border-radius: 8px 0 0 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .sce-lane-label-text { transform: rotate(-90deg); font-size: 11px; font-weight: 600; color: hsl(var(--foreground)); white-space: nowrap; letter-spacing: 0.03em; }
        .sce-lane-body { flex: 1; position: relative; min-height: 120px; padding: 14px; }
        .sce-lane[data-lane="system"] .sce-lane-label { background: #E8F4FB; }
        .sce-lane[data-lane="user"] .sce-lane-label { background: #FFF4C6; }
        .sce-lane[data-lane="manager"] .sce-lane-label { background: #FDE7E0; }

        .sce-node { position: absolute; background: #FFFFFF; border: 1.5px solid hsl(var(--border)); border-radius: 8px; padding: 8px 10px; font-size: 11.5px; min-width: 120px; box-shadow: 0 2px 6px rgba(0,0,0,0.06); user-select: none; cursor: grab; transition: box-shadow 0.12s ease; }
        .sce-node:hover { border-color: #E8B22D; }
        .sce-node.selected { border-color: #E8B22D; box-shadow: 0 0 0 3px rgba(232,178,45,0.22), 0 2px 6px rgba(0,0,0,0.06); }
        .sce-node.sce-node-dragging { cursor: grabbing; box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 0 0 2px rgba(232,178,45,0.4); opacity: 0.95; }
        .sce-node-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
        .sce-node-ic { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
        .sce-node-title { font-weight: 600; font-size: 11.5px; color: hsl(var(--foreground)); }
        .sce-node-sub { font-size: 10.5px; color: hsl(var(--muted-foreground)); }

        /* Make mode default — colorful node cards */
        .sce-make .sce-node[data-type="trigger"] { border-color: #2AB67D; background: #E6F7EF; }
        .sce-make .sce-node[data-type="service"] { border-color: #3BCAEF; background: #E4F6FC; }
        .sce-make .sce-node[data-type="user"] { border-color: #E8B22D; background: #FFFBEE; }
        .sce-make .sce-node[data-type="script"] { border-color: #7B3FBF; background: #F2E7FA; }
        .sce-make .sce-node[data-type="router"] { border-color: #D43711; background: #FDE7E0; padding: 6px 12px; transform: rotate(0deg); }
        .sce-make .sce-node[data-type="timer"] { border-color: #707071; background: #F4F4F4; }
        .sce-make .sce-node[data-type="end"] { border-color: #2D2D2D; background: #2D2D2D; color: #FFFFFF; }
        .sce-make .sce-node[data-type="end"] .sce-node-title { color: #FFFFFF; }

        /* BPMN mode — standard notation */
        .sce-bpmn .sce-node { background: #FFFFFF; border-radius: 8px; }
        .sce-bpmn .sce-node[data-type="trigger"] { border-radius: 50%; width: 60px; height: 60px; min-width: 0; padding: 0; display: flex; align-items: center; justify-content: center; border-width: 1px; }
        .sce-bpmn .sce-node[data-type="end"] { border-radius: 50%; width: 60px; height: 60px; min-width: 0; padding: 0; display: flex; align-items: center; justify-content: center; border-width: 3px; background: #FFFFFF; color: hsl(var(--foreground)); }
        .sce-bpmn .sce-node[data-type="end"] .sce-node-title { color: hsl(var(--foreground)); font-size: 10px; }
        .sce-bpmn .sce-node[data-type="router"] { width: 64px; height: 64px; min-width: 0; transform: rotate(45deg); border-radius: 4px; padding: 0; display: flex; align-items: center; justify-content: center; }
        .sce-bpmn .sce-node[data-type="router"] > * { transform: rotate(-45deg); }
        .sce-bpmn .sce-node[data-type="timer"] { border-radius: 50%; width: 60px; height: 60px; min-width: 0; padding: 0; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px #FFFFFF inset, 0 0 0 4px hsl(var(--border)) inset; border-width: 1px; }
        .sce-bpmn .sce-node[data-type="user"] { padding: 10px 12px; }
        .sce-bpmn .sce-node[data-type="service"] { padding: 10px 12px; }
        .sce-bpmn .sce-node[data-type="script"] { padding: 10px 12px; }
        .sce-bpmn .sce-node .sce-node-bpmn-ic { display: none; }
        .sce-bpmn .sce-node[data-type="user"] .sce-node-bpmn-ic,
        .sce-bpmn .sce-node[data-type="service"] .sce-node-bpmn-ic,
        .sce-bpmn .sce-node[data-type="script"] .sce-node-bpmn-ic { display: inline-block; position: absolute; top: 4px; left: 6px; font-size: 11px; }

        .sce-edges { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

        .sce-bpmn-validate { background: #FFFBEE; border: 1px solid #F3E4AC; border-radius: 6px; padding: 8px 12px; font-size: 12px; margin: 8px 10px; color: #8A6720; }
        .sce-bpmn-validate ul { margin: 4px 0 0 18px; }

        .sce-inspector { width: 260px; border-left: 1px solid hsl(var(--border)); background: #FAFAFA; padding: 14px; overflow-y: auto; flex-shrink: 0; }
        .sce-inspector-empty { color: hsl(var(--muted-foreground)); font-size: 12px; text-align: center; padding: 20px 10px; }
        .sce-inspector h4 { font-size: 10.5px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.05em; margin: 10px 0 4px; }
        .sce-inspector h4:first-child { margin-top: 0; }
        .sce-insp-field { margin-bottom: 10px; }
        .sce-insp-field label { display: block; font-size: 11px; font-weight: 500; color: hsl(var(--foreground)); margin-bottom: 4px; }
        .sce-insp-field input, .sce-insp-field select, .sce-insp-field textarea { width: 100%; padding: 5px 8px; border: 1px solid hsl(var(--border)); border-radius: 4px; font-size: 12px; font-family: inherit; box-sizing: border-box; }
        .sce-insp-field textarea { min-height: 60px; resize: vertical; }

        @media (max-width: 900px) {
            .sce-modal { max-height: 100vh; height: 100vh; border-radius: 0; }
            .sce-workspace { flex-direction: column; }
            .sce-lib, .sce-inspector { width: 100%; height: 180px; border-right: none; border-left: none; border-bottom: 1px solid hsl(var(--border)); }
            .sce-canvas-wrap { flex: 1; }
        }

        /* Command palette (⌘K) overlay */
        .cmdk-overlay { position: fixed; inset: 0; background: transparent; z-index: 1000; display: none; }
        .cmdk-overlay.open { display: block; }
        .cmdk-modal { position: fixed; width: 560px; max-width: calc(100vw - 32px); max-height: 72vh; background: #FFFFFF; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,0.18); border: 1px solid hsl(var(--border)); display: flex; flex-direction: column; overflow: hidden; animation: cmdkPop 0.15s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
        @keyframes cmdkPop { from { opacity: 0; transform: translateY(-12px) scale(0.98); } to { opacity: 1; transform: none; } }
        .cmdk-search-row { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid hsl(var(--border)); flex-shrink: 0; }
        .cmdk-search-row svg { width: 18px; height: 18px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
        .cmdk-input { flex: 1; border: none; outline: none; font-size: 14px; color: hsl(var(--foreground)); background: transparent; font-family: inherit; }
        .cmdk-input::placeholder { color: hsl(var(--muted-foreground)); }
        .cmdk-kbd { background: #F0F0F0; border: 1px solid #DFDFDF; border-radius: 4px; padding: 2px 6px; font-size: 10.5px; color: hsl(var(--muted-foreground)); font-family: ui-monospace, Menlo, monospace; }
        .cmdk-close { background: transparent; border: none; cursor: pointer; padding: 4px; color: hsl(var(--muted-foreground)); }
        .cmdk-close:hover { color: hsl(var(--foreground)); }
        .cmdk-list { flex: 1; overflow-y: auto; padding: 8px 0 10px; }
        .cmdk-section { padding: 10px 14px 2px; font-size: 10.5px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.05em; display: flex; align-items: center; gap: 6px; }
        .cmdk-section-count { background: #EDEDED; color: hsl(var(--muted-foreground)); border-radius: 999px; padding: 0 6px; font-size: 10px; font-weight: 500; }
        .cmdk-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; font-size: 13px; border-left: 2px solid transparent; transition: background 0.1s ease; }
        .cmdk-item:hover, .cmdk-item.focused { background: #F6F4EA; border-left-color: #E8B22D; }
        .cmdk-item-icon { width: 30px; height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: #F4F4F4; border-radius: 6px; color: hsl(var(--foreground)); }
        .cmdk-item-icon svg { width: 16px; height: 16px; }
        .cmdk-item-body { flex: 1; min-width: 0; }
        .cmdk-item-title { font-weight: 500; color: hsl(var(--foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .cmdk-item-sub { font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .cmdk-item-hint { font-size: 10.5px; color: hsl(var(--muted-foreground)); background: #F4F4F4; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
        .cmdk-item-title mark { background: #FFE89A; color: inherit; padding: 0 1px; border-radius: 2px; }
        .cmdk-item-actions { opacity: 0; display: flex; gap: 4px; flex-shrink: 0; transition: opacity 0.1s ease; }
        .cmdk-item:hover .cmdk-item-actions, .cmdk-item.focused .cmdk-item-actions { opacity: 1; }
        .cmdk-item-action-btn { background: #EDEDED; border: none; color: hsl(var(--muted-foreground)); cursor: pointer; padding: 4px 6px; border-radius: 4px; font-size: 11px; }
        .cmdk-item-action-btn:hover { background: #DADADA; color: hsl(var(--foreground)); }
        .cmdk-item.cmdk-ai { border-top: 1px solid hsl(var(--border)); background: linear-gradient(90deg, rgba(232,178,45,0.06), transparent 60%); }
        .cmdk-item.cmdk-ai .cmdk-item-icon { background: #FFFBEE; color: #B08218; }
        .cmdk-empty { padding: 36px 20px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13px; }
        .cmdk-empty strong { color: hsl(var(--foreground)); }
        .cmdk-footer { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-top: 1px solid hsl(var(--border)); font-size: 11.5px; color: hsl(var(--muted-foreground)); background: #FAFAFA; flex-shrink: 0; flex-wrap: wrap; }
        .cmdk-footer-chip { display: inline-flex; align-items: center; gap: 4px; }
        @media (max-width: 720px) {
            .cmdk-overlay { padding-top: 0; }
            .cmdk-modal { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
            .cmdk-footer { display: none; }
        }

        /* Form view (public-form style) */
        .form-view-wrap { max-width: 720px; margin: 32px auto; padding: 0 24px 48px; }
        .form-view-brand { display:flex; align-items:center; gap:10px; margin-bottom:22px; color:hsl(var(--muted-foreground)); font-size:12px; }
        .form-view-brand svg { width: 28px; height: 28px; color: #E8B22D; }
        .form-view-card { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 12px; box-shadow: 0 4px 18px rgba(0,0,0,0.04); padding: 28px; }
        .form-view-title { font-size: 22px; font-weight: 700; color: hsl(var(--foreground)); margin: 0 0 6px; }
        .form-view-desc { font-size: 13px; color: hsl(var(--muted-foreground)); margin: 0 0 24px; line-height: 1.55; }
        .form-view-steps { display:flex; align-items:center; gap:6px; margin-bottom:20px; }
        .form-view-step { flex:1; height:4px; background:#E6E6E6; border-radius:2px; position:relative; overflow:hidden; }
        .form-view-step.done { background:#2D2D2D; }
        .form-view-step.active::after { content:''; position:absolute; inset:0; background: linear-gradient(90deg,#E8B22D,#2D2D2D); animation: formstepmove 1.2s ease-in-out infinite; }
        @keyframes formstepmove { 0%{ transform: translateX(-100%);} 100%{ transform: translateX(0);} }
        .form-view-field { margin-bottom: 16px; }
        .form-view-label { display:block; font-size:12px; font-weight:600; color:hsl(var(--foreground)); margin-bottom:6px; }
        .form-view-label .req { color:#D43711; margin-left:3px; }
        .form-view-help { font-size:11px; color:hsl(var(--muted-foreground)); margin-top:4px; }
        .form-view-input, .form-view-textarea, .form-view-select { width: 100%; height: 38px; padding: 0 12px; font-size: 13px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; color: hsl(var(--foreground)); box-sizing: border-box; font-family: inherit; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
        .form-view-input:focus, .form-view-textarea:focus, .form-view-select:focus { outline: none; border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px rgba(232,178,45,0.18); }
        .form-view-textarea { height: 92px; padding: 10px 12px; resize: vertical; }
        .form-view-radio-group, .form-view-check-group { display:flex; flex-direction: column; gap:8px; padding: 6px 0; }
        .form-view-radio-row, .form-view-check-row { display:flex; align-items:center; gap:10px; font-size:13px; cursor:pointer; }
        .form-view-file { border: 2px dashed #D4D4D4; border-radius: 8px; padding: 18px; text-align:center; font-size: 12px; color: hsl(var(--muted-foreground)); cursor:pointer; transition: background 0.15s ease; }
        .form-view-file:hover { background: #FAFAFA; border-color: #BFBFBF; }
        .form-view-file.has-file { background: #F4F9EF; border-color: #7BA93C; color: #486b20; }
        .form-view-error { display:none; color:#D43711; font-size:11px; margin-top:4px; }
        .form-view-field.invalid .form-view-input, .form-view-field.invalid .form-view-textarea, .form-view-field.invalid .form-view-select { border-color: #D43711; }
        .form-view-field.invalid .form-view-error { display:block; }
        .form-view-actions { display:flex; align-items:center; gap:10px; margin-top:22px; padding-top:18px; border-top: 1px solid hsl(var(--border)); }
        .form-view-submit { flex:1; height: 42px; background: #2D2D2D; color: #FFFFFF; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s ease; }
        .form-view-submit:hover { background: #1a1a1a; }
        .form-view-submit[disabled] { background: #BFBFBF; cursor: not-allowed; }
        .form-view-back { height: 42px; padding: 0 20px; background: #FFFFFF; color: hsl(var(--foreground)); border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 13px; cursor: pointer; }
        .form-view-back:hover { background: #F4F4F4; }
        .form-view-thankyou { text-align:center; padding:40px 20px; }
        .form-view-thankyou svg { width: 64px; height: 64px; color: #7BA93C; margin-bottom: 16px; }
        .form-view-thankyou h3 { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
        .form-view-thankyou p { color: hsl(var(--muted-foreground)); font-size: 13px; margin: 0 0 20px; }
        .form-view-footer { text-align:center; font-size:11px; color:hsl(var(--muted-foreground)); margin-top: 18px; }
        .form-view-builder-bar { display:flex; align-items:center; gap:8px; padding: 10px 16px; background: #FFFBEE; border-bottom: 1px solid #F3E4AC; font-size: 12px; }
        .form-view-builder-bar svg { width:14px; height:14px; color:#E8B22D; }
        .form-view-builder-bar .muted { color:hsl(var(--muted-foreground)); margin-right: 4px; }
        .form-view-builder-bar .link-btn { background: transparent; border: none; color: #2D2D2D; font-weight: 600; font-size: 12px; cursor: pointer; padding: 0; text-decoration: underline; }

        /* Pivot view */
        .pivot-wrap { display:flex; height:100%; background:#FFFFFF; }
        .pivot-config { width: 260px; border-right: 1px solid hsl(var(--border)); padding: 14px; overflow:auto; flex-shrink:0; background:#FAFAFA; }
        .pivot-config h4 { font-size: 12px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.04em; margin: 14px 0 8px; }
        .pivot-config h4:first-child { margin-top: 0; }
        .pivot-dropzone { min-height: 44px; border: 1.5px dashed #D4D4D4; border-radius: 6px; padding: 6px; margin-bottom: 6px; display:flex; flex-direction:column; gap:4px; transition: border-color 0.15s ease, background 0.15s ease; }
        .pivot-dropzone.hover { border-color: hsl(var(--primary)); background: rgba(232,178,45,0.08); }
        .pivot-dropzone:empty::before { content: 'Pretiahni atribút sem'; display:block; color: hsl(var(--muted-foreground)); font-size: 11px; text-align:center; padding: 10px 6px; font-style: italic; }
        .pivot-chip { display:inline-flex; align-items:center; gap:6px; padding: 4px 8px; background:#FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 14px; font-size: 11px; font-weight: 500; color: hsl(var(--foreground)); cursor: grab; user-select: none; }
        .pivot-chip[draggable="true"]:active { cursor: grabbing; }
        .pivot-chip .x { background: transparent; border: none; cursor: pointer; color: hsl(var(--muted-foreground)); padding: 0 2px; line-height:1; font-size: 13px; }
        .pivot-chip .x:hover { color: #D43711; }
        .pivot-chip .agg { background: #E6E6E6; padding: 1px 6px; border-radius: 10px; font-size: 10px; text-transform: uppercase; }
        .pivot-palette .pivot-chip { margin-right:4px; margin-bottom:4px; }
        .pivot-controls { padding-top: 12px; border-top: 1px solid hsl(var(--border)); margin-top: 12px; display:flex; flex-direction:column; gap: 8px; }
        .pivot-controls label { display:flex; align-items:center; gap:8px; font-size: 12px; color: hsl(var(--foreground)); cursor:pointer; }
        .pivot-canvas { flex: 1; overflow: auto; position: relative; }
        .pivot-empty { display:flex; align-items:center; justify-content:center; height:100%; color: hsl(var(--muted-foreground)); font-size:13px; text-align:center; padding: 40px; }
        .pivot-table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 12px; }
        .pivot-table th, .pivot-table td { padding: 6px 10px; border: 1px solid #E6E6E6; background: #FFFFFF; text-align: right; }
        .pivot-table thead th { background: #EEE; font-weight: 600; color: hsl(var(--foreground)); text-align: center; position: sticky; top: 0; z-index: 2; }
        .pivot-table tbody tr:hover td { background: #FFFDE7; cursor: pointer; }
        .pivot-table .pivot-rowlabel { background: #F4F4F4; text-align: left; font-weight: 500; position: sticky; left: 0; z-index: 1; }
        .pivot-table tfoot th, .pivot-table tfoot td { background: #2D2D2D; color: #FFFFFF; font-weight: 600; }
        .pivot-table .pivot-total-col { background: #EFEFEF; font-weight: 600; }
        .pivot-swap-btn { position: absolute; top: 8px; right: 8px; z-index: 3; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; padding: 4px 10px; font-size: 11px; cursor: pointer; }
        .pivot-swap-btn:hover { background: #F4F4F4; }
        .pivot-heatmap td:not(.pivot-rowlabel):not(.pivot-total-col) { background: var(--heat, #FFFFFF); }

        /* Cards view (custom CSS grid, not dhtmlx) */
        .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 16px; }
        /* Dashboard view (read-only) */
        .view-dashboard { padding: 16px 20px; overflow: auto; }
        .dash-view-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
        .dash-widget { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-height: 100px; }
        .dash-widget-title { font-size: 11px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.04em; }
        .dash-kpi-val { font-size: 28px; font-weight: 700; line-height: 1.1; color: hsl(var(--foreground)); }
        .dash-kpi-sub { font-size: 12px; color: hsl(var(--muted-foreground)); }
        html[data-theme="dark"] .dash-widget { background: #1A1C20; border-color: #2A2D35; }

        /* ============================================================
           BI Rich Dashboard — pre DS s `views.dashboardKind = 'bi-rich'`
           Vizuálne bohatý dashboard so sadou rôznych typov widgetov:
           KPI delta, sparkline, donut, area chart, bar/horizontal bar,
           heatmap, gauge, funnel, top-list, mini map, big number, table.
           ============================================================ */
        .bid-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; padding: 4px; }
        .bid-card { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-height: 110px; box-shadow: 0 1px 2px rgba(0,0,0,0.02); position: relative; overflow: hidden; }
        .bid-card.elev { box-shadow: 0 4px 16px rgba(15,23,42,0.06); }
        .bid-card.gradient { background: linear-gradient(135deg, #FFFFFF 0%, #F7FAFE 100%); }
        .bid-card.dark { background: linear-gradient(135deg, #2D2D2D 0%, #1F1F22 100%); color: #FFFFFF; }
        .bid-card.dark .bid-title, .bid-card.dark .bid-sub, .bid-card.dark .bid-axis-lbl { color: rgba(255,255,255,0.65); }
        .bid-card.dark .bid-big, .bid-card.dark .bid-kpi-val { color: #FFFFFF; }
        .bid-card.accent-yellow { border-top: 3px solid #E8B22D; }
        .bid-card.accent-green  { border-top: 3px solid #2AB67D; }
        .bid-card.accent-red    { border-top: 3px solid #D43711; }
        .bid-card.accent-blue   { border-top: 3px solid #3BCAEF; }
        .bid-card.accent-purple { border-top: 3px solid #A57DC0; }
        .bid-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
        .bid-title { font-size: 11px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.05em; }
        .bid-sub { font-size: 11px; color: hsl(var(--muted-foreground)); }
        .bid-pill { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: #F4F4F4; color: #4C4C4D; }
        .bid-pill.up { background: #E5F7EE; color: #1F855A; }
        .bid-pill.down { background: #FCEBE6; color: #C63310; }
        .bid-pill.neutral { background: #F0F4FA; color: #2588A8; }
        .bid-big { font-size: 30px; font-weight: 700; line-height: 1.05; color: #0F1116; letter-spacing: -0.01em; }
        .bid-kpi-val { font-size: 24px; font-weight: 700; line-height: 1.05; color: #0F1116; }
        .bid-delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
        .bid-delta.up { color: #1F855A; }
        .bid-delta.down { color: #C63310; }
        .bid-axis-lbl { font-size: 9px; color: hsl(var(--muted-foreground)); }
        .bid-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11px; color: hsl(var(--muted-foreground)); }
        .bid-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 4px; }
        .bid-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
        .bid-bar-track { flex: 1; height: 8px; background: #F1F4F9; border-radius: 4px; overflow: hidden; }
        .bid-bar-fill { height: 100%; border-radius: 4px; }
        /* Sparkline / area chart */
        .bid-spark { width: 100%; height: 56px; }
        .bid-area  { width: 100%; height: 110px; }
        .bid-line  { width: 100%; height: 110px; }
        /* Donut */
        .bid-donut { width: 110px; height: 110px; flex-shrink: 0; }
        /* Heatmap */
        .bid-heatmap { display: grid; gap: 3px; grid-template-columns: repeat(12, 1fr); }
        .bid-heatmap .cell { aspect-ratio: 1; border-radius: 3px; background: #F1F4F9; }
        /* Gauge */
        .bid-gauge { width: 140px; height: 80px; }
        /* Funnel */
        /* Funnel rows — Google-style centrované, šírka v % cez inline style.
           Riadok je auto-výškový (min 28px), aby sa text nikdy neorezal.
           Text wrappuje len ak je extrémne dlhý a riadok extrémne úzky. */
        .bid-funnel { display: flex; flex-direction: column; gap: 4px; align-items: center; }
        .bid-funnel-row { position: relative; min-height: 28px; padding: 6px 12px; color: #FFFFFF; font-size: 11px; font-weight: 600; border-radius: 4px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-shrink: 0; }
        .bid-funnel-row > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
        .bid-funnel-row .v { opacity: 0.92; white-space: nowrap; flex-shrink: 0; }
        /* Tag cloud */
        .bid-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
        .bid-tag { background: #F1F4F9; color: #2D2D2D; border-radius: 999px; padding: 4px 10px; font-weight: 500; }
        /* Mini table */
        .bid-table { width: 100%; border-collapse: collapse; font-size: 12px; }
        .bid-table th { text-align: left; font-weight: 600; color: hsl(var(--muted-foreground)); padding: 6px 8px; border-bottom: 1px solid #EFEFEF; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
        .bid-table td { padding: 6px 8px; border-bottom: 1px solid #F4F4F4; }
        .bid-table tr:last-child td { border-bottom: none; }
        .bid-table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
        /* Status dot indicators */
        .bid-stat { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #F4F4F4; color: #4C4C4D; }
        .bid-stat.green { background: #E5F7EE; color: #1F855A; }
        .bid-stat.amber { background: #FBF1D6; color: #8C5A00; }
        .bid-stat.red   { background: #FCEBE6; color: #C63310; }
        /* Stacked bar */
        .bid-stacked { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: #F1F4F9; }
        .bid-stacked > span { display: block; height: 100%; }
        /* Animate widgets in subtly */
        @keyframes bidFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
        .bid-card { animation: bidFade 0.35s ease both; }
        html[data-theme="dark"] .bid-card { background: #1A1C20; border-color: #2A2D35; }
        html[data-theme="dark"] .bid-card.gradient { background: linear-gradient(135deg, #1A1C20 0%, #14161A 100%); }
        html[data-theme="dark"] .bid-bar-track, html[data-theme="dark"] .bid-heatmap .cell { background: #2A2D35; }
        html[data-theme="dark"] .bid-big, html[data-theme="dark"] .bid-kpi-val { color: #F4F4F6; }
        html[data-theme="dark"] .bid-tag { background: #2A2D35; color: #D8D9DD; }
        .card-item { border: none; border-radius: 8px; padding: 0; background: transparent; cursor: pointer; transition: box-shadow 0.15s ease; display: flex; flex-direction: column; gap: 8px; }
        .card-item:hover .rc-card { border-color: #BFBFBF; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
        .card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
        .card-id { font-size: 11px; font-weight: 600; color: hsl(var(--muted-foreground)); letter-spacing: 0.02em; }
        .card-title { font-size: 13px; color: hsl(var(--foreground)); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
        .card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: hsl(var(--muted-foreground)); }
        .card-meta .sh-badge { font-size: 11px; }
        .card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; border-top: 1px solid #EFEFEF; font-size: 11px; color: hsl(var(--muted-foreground)); }
        .card-avatar { width: 22px; height: 22px; border-radius: 50%; background: #E8B22D; color: #2D2D2D; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }

        /* dhtmlx widget containers */
        .dhx-host { position: absolute; inset: 0; }

        /* Kanban (custom) */
        .kanban-board { display: flex; gap: 12px; padding: 16px; align-items: flex-start; min-height: 100%; }
        .kanban-col { flex: 0 0 280px; background: #F4F4F4; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; max-height: 100%; }
        .kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; border-bottom: 1px solid #E5E5E5; font-size: 13px; font-weight: 600; color: hsl(var(--foreground)); }
        .kanban-count { background: #FFFFFF; border: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); font-size: 11px; font-weight: 500; padding: 0 6px; border-radius: 10px; min-width: 20px; text-align: center; }
        .kanban-col-body { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
        /* Wrapper karty — bez vlastného borderu/paddingu, pretože vnútorný .rc-card už má svoj rám a padding. */
        .kanban-card { background: transparent; border: none; border-radius: 6px; padding: 0; cursor: grab; transition: box-shadow 0.15s ease; }
        .kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-color: #BFBFBF; }
        .kanban-card.dragging { opacity: 0.4; cursor: grabbing; }
        .kanban-col.drag-over { background: #F9F4E1; outline: 2px dashed #E8B22D; outline-offset: -4px; }
        .kanban-drop-placeholder { height: 64px; border: 2px dashed #E8B22D; background: rgba(232,178,45,0.1); border-radius: 6px; }
        .kanban-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
        .kanban-card-id { font-size: 11px; font-weight: 600; color: hsl(var(--muted-foreground)); }
        .kanban-card-title { font-size: 13px; color: hsl(var(--foreground)); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
        .kanban-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; }
        .kanban-card-priority { font-size: 11px; }
        .kanban-card-avatar { width: 22px; height: 22px; border-radius: 50%; background: #E8B22D; color: #2D2D2D; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }

        /* Gantt2 (custom — no dhtmlx) */
        .gantt2 { display: flex; height: 100%; }
        .gantt2-left { flex: 0 0 55%; max-width: 760px; min-width: 0; overflow: auto; position: relative; transition: flex-basis 0.15s ease; }
        .gantt2-left.collapsed { flex: 0 0 0px !important; overflow: hidden; }
        .gantt2-divider.collapsed { background: hsl(var(--border)); position: relative; }
        .gantt2-divider.collapsed::after { content: '▶'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 9px; color: hsl(var(--muted-foreground)); pointer-events: none; }
        .gantt2-left .table-wrap { position: relative; inset: auto; height: auto; overflow: visible; }
        /* Sticky header — hlavička ľavej tabuľky musí ostať zafixovaná pri vertikálnom scrolle. */
        .gantt2-left table.dtable thead { position: sticky; top: 0; z-index: 7; background: #FFFFFF; }
        .gantt2-left table.dtable thead tr > th { background: #F4F4F4; }
        .gantt2-left table.dtable thead tr.filter-row > th { background: #FAFAFA; }
        /* Ensure the Akcie sticky column (header + filter + cells) stays pinned to the right edge in Gantt too. */
        .gantt2-left table.dtable thead th.col-actions-th,
        .gantt2-left table.dtable tbody td.col-actions-td,
        .gantt2-left table.dtable thead tr.filter-row th.col-actions-th { position: sticky; right: 0; z-index: 8; }
        .gantt2-left table.dtable thead th.col-actions-th,
        .gantt2-left table.dtable thead tr.filter-row th.col-actions-th { z-index: 9; }
        .gantt2-divider { width: 4px; background: hsl(var(--border)); cursor: col-resize; flex-shrink: 0; }
        .gantt2-divider:hover { background: hsl(var(--accent)); }
        .gantt2-right { flex: 1; overflow: auto; position: relative; background: #FFFFFF; }
        .gantt2-timeline-header { position: sticky; top: 0; background: #FFFFFF; z-index: 3; }
        /* Gantt2 timeline header must equal dtable thead (35px label row + 32px filter row + 1px borders). */
        .gantt2-timeline-months { display: flex; height: 36px; border-bottom: 1px solid hsl(var(--border)); box-sizing: border-box; }
        .gantt2-timeline-days { display: flex; height: 32px; border-bottom: 1px solid hsl(var(--border)); box-sizing: border-box; }
        .gantt2-month-cell { display: flex; align-items: center; justify-content: center; border-right: 1px solid #EFEFEF; font-size: 12px; font-weight: 600; color: hsl(var(--foreground)); background: #FFFFFF; }
        .gantt2-day-cell { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid #EFEFEF; font-size: 10px; color: hsl(var(--muted-foreground)); background: #FFFFFF; }
        .gantt2-day-cell .dow { font-size: 9px; text-transform: uppercase; }
        .gantt2-day-cell .dom { font-size: 11px; color: hsl(var(--foreground)); font-weight: 500; }
        .gantt2-day-cell.weekend { background: #FAFAFA; }
        .gantt2-day-cell.today { background: #F9F4E1; color: hsl(var(--foreground)); }
        .gantt2-timeline-body { position: relative; }
        .gantt2-timeline-row { height: 37px; border-bottom: 1px solid #EFEFEF; position: relative; display: flex; }
        /* Swapped because .gantt2-today-line is the first child of .gantt2-timeline-body,
           which shifts :nth-child counting by one (row 1 is actually :nth-child(2)). */
        .gantt2-timeline-row:nth-child(odd) { background: #F4F4F4; }
        .gantt2-timeline-row:nth-child(even) { background: #FFFFFF; }
        .gantt2-timeline-row:hover { background: #F9F4E1; }
        .gantt2-grid-cell { flex-shrink: 0; border-right: 1px solid #EFEFEF; height: 100%; }
        .gantt2-grid-cell.weekend { background: rgba(0,0,0,0.02); }
        .gantt2-bar { position: absolute; top: 6px; height: 24px; background: #2D2D2D; border-radius: 4px; display: flex; align-items: center; color: #FFFFFF; font-size: 11px; font-weight: 500; overflow: visible; white-space: nowrap; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,0.12); z-index: 1; user-select: none; }
        .gantt2-bar:hover { opacity: 0.95; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
        .gantt2-bar.dragging { opacity: 0.75; cursor: grabbing; z-index: 5; }
        .gantt2-bar.priority-high { background: #D43711; }
        .gantt2-bar.priority-low { background: #707071; }
        .gantt2-bar-progress { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,0.28); border-radius: 4px 0 0 4px; pointer-events: none; }
        .gantt2-bar-label { position: relative; z-index: 2; padding: 0 10px; overflow: hidden; text-overflow: ellipsis; flex: 1; pointer-events: none; }
        .gantt2-bar-label[contenteditable="true"] { pointer-events: auto; cursor: text; background: rgba(255,255,255,0.15); border-radius: 2px; }
        .gantt2-bar-handle { position: absolute; top: 0; bottom: 0; width: 6px; cursor: ew-resize; background: transparent; }
        .gantt2-bar-handle.left { left: 0; border-radius: 4px 0 0 4px; }
        .gantt2-bar-handle.right { right: 0; border-radius: 0 4px 4px 0; }
        .gantt2-bar-handle:hover { background: rgba(255,255,255,0.35); }
        .gantt2-bar-progress-handle { position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px; margin-left: -6px; background: #FFFFFF; border: 2px solid #2D2D2D; border-radius: 50%; cursor: ew-resize; z-index: 3; opacity: 0; transition: opacity 0.15s ease; }
        .gantt2-bar:hover .gantt2-bar-progress-handle { opacity: 1; }
        .gantt2-bar.dragging .gantt2-bar-progress-handle { opacity: 1; }
        .gantt2-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #E8B22D; z-index: 2; pointer-events: none; }
        .gantt2-link { stroke: #707071; stroke-width: 2; fill: none; pointer-events: stroke; cursor: pointer; }
        .gantt2-link:hover { stroke: #D43711; }
        .gantt2-links-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; }
        .gantt2-links-svg * { pointer-events: auto; }

        /* Calendar 2 (custom, full-feature) */
        .cal2 { display: flex; flex-direction: column; height: 100%; }
        .cal2-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid hsl(var(--border)); background: #FFFFFF; flex-shrink: 0; }
        .cal2-nav-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid hsl(var(--border)); background: #FFFFFF; color: hsl(var(--foreground)); cursor: pointer; border-radius: 4px; }
        .cal2-nav-btn:hover { background: #F4F4F4; }
        .cal2-nav-btn svg { width: 16px; height: 16px; }
        .cal2-today-btn { padding: 0 12px; height: 32px; border: 1px solid hsl(var(--border)); background: #FFFFFF; border-radius: 4px; font-size: 13px; cursor: pointer; }
        .cal2-today-btn:hover { background: #F4F4F4; }
        .cal2-date-label { font-size: 16px; font-weight: 600; color: hsl(var(--foreground)); margin-left: 8px; }
        .cal2-view-switch { margin-left: auto; display: inline-flex; border: 1px solid hsl(var(--border)); border-radius: 6px; overflow: hidden; }
        .cal2-view-switch button { padding: 6px 14px; border: none; background: #FFFFFF; font-size: 13px; cursor: pointer; color: hsl(var(--foreground)); border-right: 1px solid hsl(var(--border)); }
        .cal2-view-switch button:last-child { border-right: none; }
        .cal2-view-switch button:hover { background: #F4F4F4; }
        .cal2-view-switch button.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
        .cal2-body { flex: 1; overflow: auto; position: relative; }

        /* Month view */
        .cal2-month { display: flex; flex-direction: column; height: 100%; }
        .cal2-month-dow { display: grid; grid-template-columns: repeat(7, 1fr); background: #FAFAFA; border-bottom: 1px solid hsl(var(--border)); }
        .cal2-month-dow > div { padding: 8px; font-size: 11px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; text-align: center; border-right: 1px solid #EFEFEF; }
        .cal2-month-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(100px, 1fr); }
        .cal2-month-cell { border-right: 1px solid #EFEFEF; border-bottom: 1px solid #EFEFEF; padding: 4px; position: relative; overflow: hidden; cursor: cell; min-height: 100px; }
        /* Víkendové bunky — jemne sivejšie pozadie pre vizuálne odlíšenie. */
        .cal2-month-cell.weekend { background: #F7F7F8; }
        .cal2-month-cell.weekend.other { background: #F1F1F2; }
        .cal2-month-cell.other { background: #FAFAFA; color: hsl(var(--muted-foreground)); }
        .cal2-month-cell.today { background: #FFF9E6; }
        .cal2-month-cell.today .cal2-day-num { background: #E8B22D; color: #2D2D2D; }
        .cal2-month-cell.drag-target { background: rgba(232,178,45,0.15); outline: 2px dashed #E8B22D; outline-offset: -2px; }
        .cal2-day-num { display: inline-block; width: 22px; height: 22px; text-align: center; line-height: 22px; font-size: 12px; font-weight: 500; border-radius: 50%; }
        .cal2-month-events { margin-top: 2px; display: flex; flex-direction: column; gap: 2px; }
        .cal2-event { background: #3B82F6; color: #FFFFFF; font-size: 11px; padding: 2px 6px; border-radius: 3px; cursor: grab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; display: flex; align-items: center; gap: 4px; }
        .cal2-event .cal2-event-time { font-weight: 600; opacity: 0.9; flex-shrink: 0; font-size: 10px; }
        .cal2-event.dragging { opacity: 0.5; cursor: grabbing; }
        .cal2-event:hover { opacity: 0.9; }
        .cal2-event.c-blue   { background: #3B82F6; }
        .cal2-event.c-yellow { background: #E8B22D; color: #2D2D2D; }
        .cal2-event.c-red    { background: #D43711; }
        .cal2-event.c-green  { background: #16A34A; }
        .cal2-event.c-purple { background: #A855F7; }
        .cal2-event.c-teal   { background: #14B8A6; }
        .cal2-event.c-orange { background: #F97316; }
        /* Mesačný "+X ďalšie" expand popup */
        .cal2-month-more { background: transparent; border: none; padding: 1px 6px; font-size: 11px; color: hsl(var(--muted-foreground)); cursor: pointer; text-align: left; border-radius: 3px; font-weight: 500; }
        .cal2-month-more:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .cal2-day-popover { position: fixed; min-width: 260px; max-width: 340px; max-height: 360px; overflow-y: auto; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.16); padding: 10px 12px; z-index: 200; }
        .cal2-day-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid #EFEFEF; margin-bottom: 6px; }
        .cal2-day-popover-head .dow { font-size: 11px; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.05em; }
        .cal2-day-popover-head .dom { font-size: 22px; font-weight: 700; line-height: 1; }
        .cal2-day-popover-head .close { background: transparent; border: none; cursor: pointer; padding: 4px; border-radius: 4px; color: hsl(var(--muted-foreground)); }
        .cal2-day-popover-head .close:hover { background: #F4F4F4; }
        .cal2-day-popover-list { display: flex; flex-direction: column; gap: 4px; }
        .cal2-day-popover-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 12.5px; }
        .cal2-day-popover-item:hover { background: #F4F4F4; }
        .cal2-day-popover-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
        .cal2-day-popover-item .time { color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; flex-shrink: 0; }
        .cal2-day-popover-item .title { flex: 1; color: hsl(var(--foreground)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

        /* Week/Day view */
        .cal2-week { display: flex; flex-direction: column; height: 100%; }
        .cal2-week-header { display: grid; grid-template-columns: 60px repeat(var(--days, 7), 1fr); border-bottom: 1px solid hsl(var(--border)); background: #FFFFFF; }
        .cal2-week-header > div { padding: 8px; text-align: center; border-right: 1px solid #EFEFEF; font-size: 12px; }
        .cal2-week-dow { font-size: 10px; color: hsl(var(--muted-foreground)); text-transform: uppercase; }
        .cal2-week-dom { font-size: 18px; font-weight: 600; color: hsl(var(--foreground)); }
        .cal2-week-header .today .cal2-week-dom { color: #E8B22D; }
        .cal2-week-body { flex: 1; display: grid; grid-template-columns: 60px repeat(var(--days, 7), 1fr); overflow: auto; position: relative; }
        .cal2-week-hours { display: flex; flex-direction: column; border-right: 1px solid hsl(var(--border)); }
        .cal2-hour-label { height: 40px; padding: 0 6px; font-size: 10px; color: hsl(var(--muted-foreground)); text-align: right; border-bottom: 1px solid transparent; }
        .cal2-week-col { position: relative; border-right: 1px solid #EFEFEF; }
        .cal2-week-col.weekend { background: #F7F7F8; }
        .cal2-week-col.today { background: #FFFDEF; }
        .cal2-week-col.weekend.today { background: #FFF8E0; }
        .cal2-week-header > div.weekend { background: #F7F7F8; }
        .cal2-hour-slot { height: 40px; border-bottom: 1px dashed #EFEFEF; cursor: cell; }
        .cal2-hour-slot:nth-child(2n) { border-bottom: 1px solid #EFEFEF; }
        /* Week/day events. Position cez ev.style.left/width pri overlapping Google-style.
           Default farba modrá (predtým čierna), color tiriedy ako .cal2-event. */
        .cal2-week-event { position: absolute; background: #3B82F6; color: #FFFFFF; font-size: 11px; padding: 4px 6px; border-radius: 4px; cursor: grab; overflow: hidden; user-select: none; z-index: 1; box-shadow: 0 0 0 1px rgba(255,255,255,0.6); display: flex; flex-direction: column; gap: 2px; }
        .cal2-week-event:hover { z-index: 6; box-shadow: 0 2px 8px rgba(0,0,0,0.18), 0 0 0 1px rgba(255,255,255,0.8); }
        .cal2-week-event .cal2-week-event-time { font-size: 10px; opacity: 0.92; font-weight: 500; }
        .cal2-week-event.c-blue   { background: #3B82F6; }
        .cal2-week-event.c-yellow { background: #E8B22D; color: #2D2D2D; }
        .cal2-week-event.c-yellow .cal2-week-event-time { color: #2D2D2D; }
        .cal2-week-event.c-red    { background: #D43711; }
        .cal2-week-event.c-green  { background: #16A34A; }
        .cal2-week-event.c-purple { background: #A855F7; }
        .cal2-week-event.c-teal   { background: #14B8A6; }
        .cal2-week-event.c-orange { background: #F97316; }
        .cal2-week-event.dragging { opacity: 0.6; cursor: grabbing; z-index: 5; }
        .cal2-week-event-resize { position: absolute; bottom: 0; left: 0; right: 0; height: 6px; cursor: ns-resize; background: transparent; border-radius: 0 0 4px 4px; }
        .cal2-week-event-resize:hover { background: rgba(255,255,255,0.25); }

        /* Diagram 2 (Whimsical-like canvas) — extended palette + contextual bars + context menu */
        .dgm2 { display: grid; grid-template-rows: auto 1fr auto; height: 100%; position: relative; }
        .dgm2-layout { display: grid; grid-template-columns: 64px 1fr; position: relative; height: 100%; overflow: hidden; }
        .dgm2-sidebar { background: #FFFFFF; border-right: 1px solid hsl(var(--border)); overflow-y: auto; display: flex; flex-direction: column; padding: 8px 4px; }
        .dgm2-cat-label { font-size: 9px; font-weight: 700; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.06em; text-align: center; padding: 8px 0 4px; }
        .dgm2-shape-btn { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; background: transparent; color: hsl(var(--foreground)); cursor: pointer; border-radius: 6px; margin: 2px auto; }
        .dgm2-shape-btn:hover { background: #F4F4F4; border-color: hsl(var(--border)); }
        .dgm2-shape-btn.active { background: #2D2D2D; color: #FFFFFF; }
        .dgm2-shape-btn svg { width: 22px; height: 22px; }
        .dgm2-cat-sep { height: 1px; background: hsl(var(--border)); margin: 6px 8px; }
        .dgm2-stage { position: relative; overflow: hidden; }

        /* Contextual selection toolbar (bottom-center, appears when shape selected) */
        .dgm2-selbar { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); background: #2D2D2D; color: #FFFFFF; border-radius: 10px; padding: 6px; display: none; gap: 2px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 6; }
        .dgm2-selbar.active { display: inline-flex; }
        .dgm2-selbar button { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: #FFFFFF; border: none; border-radius: 6px; cursor: pointer; position: relative; }
        .dgm2-selbar button:hover { background: rgba(255,255,255,0.1); }
        .dgm2-selbar button.active { background: rgba(232,178,45,0.25); color: #E8B22D; }
        .dgm2-selbar button svg { width: 16px; height: 16px; }
        .dgm2-selbar-sep { width: 1px; background: rgba(255,255,255,0.15); height: 20px; margin: 0 2px; }
        .dgm2-color-dot { width: 18px; height: 18px; border-radius: 50%; background: #E8B22D; border: 2px solid #FFFFFF; }
        .dgm2-fill-variants { display: flex; gap: 2px; }
        .dgm2-fill-variants button { width: 28px; height: 28px; }
        .dgm2-fill-variants .dot-solid { background: #E8B22D; border-radius: 4px; }
        .dgm2-fill-variants .dot-outline { background: transparent; border: 2px solid #E8B22D; border-radius: 4px; width: 18px; height: 18px; }
        .dgm2-fill-variants .dot-dashed { background: transparent; border: 2px dashed #E8B22D; border-radius: 4px; width: 18px; height: 18px; }
        .dgm2-color-picker { position: absolute; background: #FFFFFF; color: hsl(var(--foreground)); border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.18); padding: 10px; display: none; flex-wrap: wrap; gap: 6px; width: 192px; z-index: 10; }
        .dgm2-color-picker.open { display: flex; }
        .dgm2-color-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #FFFFFF; box-shadow: 0 0 0 1px hsl(var(--border)); cursor: pointer; }
        .dgm2-color-swatch:hover { transform: scale(1.1); }

        /* Right-click context menu */
        .dgm2-ctx { position: fixed; background: #2D2D2D; color: #FFFFFF; border-radius: 10px; padding: 6px; min-width: 280px; display: none; z-index: 200; box-shadow: 0 12px 32px rgba(0,0,0,0.3); }
        .dgm2-ctx.open { display: block; }
        .dgm2-ctx-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; color: #FFFFFF; }
        .dgm2-ctx-item:hover { background: rgba(255,255,255,0.08); }
        .dgm2-ctx-item.disabled { opacity: 0.35; cursor: not-allowed; }
        .dgm2-ctx-item.disabled:hover { background: transparent; }
        .dgm2-ctx-item svg { width: 14px; height: 14px; color: rgba(255,255,255,0.7); flex-shrink: 0; }
        .dgm2-ctx-item .dgm2-ctx-label { flex: 1; }
        .dgm2-ctx-item .dgm2-ctx-key { display: inline-flex; gap: 3px; font-size: 11px; color: rgba(255,255,255,0.5); }
        .dgm2-ctx-item .dgm2-ctx-key kbd { padding: 2px 5px; background: rgba(255,255,255,0.1); border-radius: 3px; font-family: inherit; }
        .dgm2-ctx-sep { height: 1px; background: rgba(255,255,255,0.15); margin: 4px 0; }
        .dgm2-ctx-submenu::after { content: '›'; font-size: 14px; color: rgba(255,255,255,0.5); }

        /* Top-right action buttons in diagram toolbar */
        .dgm2-top-actions { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; }
        .dgm2-top-actions .dgm2-tool { width: auto; padding: 0 10px; height: 32px; font-size: 12px; gap: 6px; }
        .dgm2-export-menu, .dgm2-templates-menu, .dgm2-cmd-menu { position: absolute; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.18); padding: 6px; min-width: 220px; display: none; z-index: 20; }
        .dgm2-export-menu.open, .dgm2-templates-menu.open, .dgm2-cmd-menu.open { display: block; }
        .dgm2-export-menu .actions-menu-item { padding: 8px 12px; }

        /* Command palette (Cmd+K) */
        .dgm2-cmd-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 190; display: none; align-items: flex-start; justify-content: center; padding-top: 120px; }
        .dgm2-cmd-overlay.open { display: flex; }
        .dgm2-cmd-panel { background: #FFFFFF; border-radius: 12px; box-shadow: 0 24px 48px rgba(0,0,0,0.2); width: 540px; max-width: 90vw; overflow: hidden; }
        .dgm2-cmd-input { width: 100%; height: 52px; padding: 0 18px; font-size: 15px; border: none; outline: none; border-bottom: 1px solid hsl(var(--border)); }
        .dgm2-cmd-list { max-height: 380px; overflow-y: auto; padding: 6px; }
        .dgm2-cmd-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; }
        .dgm2-cmd-item:hover, .dgm2-cmd-item.active { background: #F4F4F4; }
        .dgm2-cmd-item svg { width: 16px; height: 16px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
        .dgm2-cmd-item .dgm2-cmd-key { margin-left: auto; font-size: 11px; color: hsl(var(--muted-foreground)); }

        /* Templates gallery modal */
        .dgm2-templates-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.42); z-index: 180; display: none; align-items: flex-start; justify-content: center; padding: 48px 20px; overflow: auto; }
        .dgm2-templates-modal.open { display: flex; }
        .dgm2-tpl-dialog { background: #FFFFFF; border-radius: 12px; box-shadow: 0 24px 48px rgba(0,0,0,0.22); width: 960px; max-width: 100%; overflow: hidden; }
        .dgm2-tpl-head { padding: 16px 22px; border-bottom: 1px solid hsl(var(--border)); display: flex; align-items: center; justify-content: space-between; }
        .dgm2-tpl-grid { padding: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
        .dgm2-tpl-card { border: 1px solid hsl(var(--border)); border-radius: 8px; overflow: hidden; cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
        .dgm2-tpl-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.1); }
        .dgm2-tpl-thumb { height: 140px; background: #F4F4F4; display: flex; align-items: center; justify-content: center; color: hsl(var(--muted-foreground)); }
        .dgm2-tpl-thumb svg { width: 60%; height: 60%; opacity: 0.5; }
        .dgm2-tpl-body { padding: 10px 12px; }
        .dgm2-tpl-body strong { display: block; font-size: 13px; margin-bottom: 2px; }
        .dgm2-tpl-body span { font-size: 11px; color: hsl(var(--muted-foreground)); }

        /* Alignment guides */
        .dgm2-guide { position: absolute; background: #E8B22D; pointer-events: none; z-index: 7; }
        .dgm2-guide.v { width: 1px; top: 0; bottom: 0; }
        .dgm2-guide.h { height: 1px; left: 0; right: 0; }

        /* Section (frame) shape */
        .dgm2-shape.section > svg rect { fill: rgba(59,202,239,0.05); stroke: #3BCAEF; stroke-width: 2; stroke-dasharray: 8 4; }
        .dgm2-shape.section .dgm2-shape-text { align-items: flex-start; font-size: 12px; font-weight: 700; color: #2588A8; padding: 6px 10px; }

        /* Extra shape styles */
        .dgm2-shape.triangle > svg polygon,
        .dgm2-shape.hexagon > svg polygon,
        .dgm2-shape.pentagon > svg polygon,
        .dgm2-shape.star > svg polygon,
        .dgm2-shape.parallelogram > svg polygon,
        .dgm2-shape.trapezoid > svg polygon { fill: #FFFFFF; stroke: #BFBFBF; stroke-width: 1; }
        /* Arrow — solid fill, no outline, muted Modulario gray */
        .dgm2-shape.arrow > svg polygon { fill: #BFBFBF; stroke: none; }
        .dgm2-shape.cylinder > svg path { fill: #FFFFFF; stroke: #BFBFBF; stroke-width: 1; }
        .dgm2-shape.cloud > svg path { fill: #FFFFFF; stroke: #BFBFBF; stroke-width: 1; }
        .dgm2-shape.process > svg rect { fill: #FFFFFF; stroke: #BFBFBF; stroke-width: 1; rx: 20; }

        /* Comment pin */
        .dgm2-comment-pin { position: absolute; width: 22px; height: 22px; border-radius: 50% 50% 50% 0; background: #E8B22D; transform: rotate(-45deg); display: inline-flex; align-items: center; justify-content: center; color: #2D2D2D; font-size: 10px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
        .dgm2-comment-pin span { transform: rotate(45deg); }
        .dgm2 { display: flex; flex-direction: column; height: 100%; }
        .dgm2-toolbar { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-bottom: 1px solid hsl(var(--border)); background: #FFFFFF; flex-shrink: 0; }
        .dgm2-tool { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; background: transparent; color: hsl(var(--foreground)); cursor: pointer; border-radius: 6px; }
        .dgm2-tool:hover { background: #F4F4F4; }
        .dgm2-tool.active { background: #2D2D2D; color: #FFFFFF; }
        .dgm2-tool svg { width: 18px; height: 18px; }
        .dgm2-sep { width: 1px; background: hsl(var(--border)); height: 24px; margin: 0 6px; }
        .dgm2-zoom-label { font-size: 12px; color: hsl(var(--muted-foreground)); min-width: 44px; text-align: center; }
        .dgm2-canvas-wrap { flex: 1; position: relative; overflow: hidden; background: #FAFAFA; background-image: radial-gradient(circle, #D8D8D8 1px, transparent 1px); background-size: 20px 20px; }
        .dgm2-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
        .dgm2-canvas svg { display: block; }
        .dgm2-shape { position: absolute; cursor: move; user-select: none; }
        .dgm2-shape .dgm2-shape-text { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #2D2D2D; text-align: center; padding: 8px; overflow: hidden; word-break: break-word; }
        .dgm2-shape.selected { outline: 2px solid #E8B22D; outline-offset: 3px; }
        .dgm2-shape.rect > svg rect { fill: #FFFFFF; stroke: #BFBFBF; stroke-width: 1; }
        .dgm2-shape.ellipse > svg ellipse { fill: #FFFFFF; stroke: #BFBFBF; stroke-width: 1; }
        .dgm2-shape.diamond > svg polygon { fill: #FFFFFF; stroke: #BFBFBF; stroke-width: 1; }
        .dgm2-shape.note > svg rect { fill: #FFF9C4; stroke: #E8B22D; stroke-width: 1; }
        .dgm2-shape.text-only > svg rect { fill: transparent; stroke: transparent; }
        .dgm2-shape-handles { position: absolute; inset: -6px; pointer-events: none; }
        .dgm2-handle { position: absolute; width: 10px; height: 10px; background: #FFFFFF; border: 2px solid #E8B22D; border-radius: 50%; pointer-events: auto; }
        .dgm2-handle.nw { top: -5px; left: -5px; cursor: nwse-resize; }
        .dgm2-handle.ne { top: -5px; right: -5px; cursor: nesw-resize; }
        .dgm2-handle.sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
        .dgm2-handle.se { bottom: -5px; right: -5px; cursor: nwse-resize; }
        .dgm2-conn-dot { position: absolute; width: 10px; height: 10px; background: #E8B22D; border: 2px solid #FFFFFF; border-radius: 50%; cursor: crosshair; z-index: 5; opacity: 0; transition: opacity 0.1s; }
        .dgm2-shape:hover .dgm2-conn-dot, .dgm2-shape.selected .dgm2-conn-dot { opacity: 1; }
        .dgm2-conn-dot.top { top: -5px; left: calc(50% - 5px); }
        .dgm2-conn-dot.right { right: -5px; top: calc(50% - 5px); }
        .dgm2-conn-dot.bottom { bottom: -5px; left: calc(50% - 5px); }
        .dgm2-conn-dot.left { left: -5px; top: calc(50% - 5px); }
        .dgm2-connectors { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; }
        .dgm2-connectors path { fill: none; stroke: #BFBFBF; stroke-width: 1.25; pointer-events: stroke; cursor: pointer; }
        .dgm2-connectors path:hover { stroke: #707071; }
        .dgm2-connectors path.selected { stroke: #E8B22D; stroke-width: 1.5; }

        /* Diagram (custom SVG) */
        .diagram-wrap { padding: 24px; min-height: 100%; display: flex; align-items: flex-start; justify-content: center; overflow: auto; }
        .diagram-svg { width: 1040px; height: 520px; max-width: 100%; }
        .diag-node { fill: #FFFFFF; stroke: hsl(var(--border)); stroke-width: 1; }
        .diag-node.root { fill: #2D2D2D; }
        .diag-node.highlight { fill: #F9F4E1; stroke: #E8B22D; }
        .diag-label { font-family: 'Inter', system-ui, sans-serif; font-size: 13px; fill: hsl(var(--foreground)); font-weight: 500; }
        .diag-label.root { fill: #FFFFFF; font-weight: 600; }
        .diag-link { stroke: #BFBFBF; stroke-width: 1.5; fill: none; }

        /* Table */
        .table-wrap { flex: 1; overflow: auto; background: #FFFFFF; position: absolute; inset: 0; }
        /* Auto-hide scrollbar: track je transparentný, thumb sa zjaví iba keď
           user-hoverne nad wrap-om. Ak sa tabuľka zmestí na celú šírku, horizontálny
           scrollbar nie je zbytočne viditeľný. */
        .table-wrap { scrollbar-width: thin; scrollbar-color: transparent transparent; }
        .table-wrap:hover { scrollbar-color: rgba(0,0,0,0.25) transparent; }
        .table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
        .table-wrap::-webkit-scrollbar-track { background: transparent; }
        .table-wrap::-webkit-scrollbar-thumb { background: transparent; border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
        .table-wrap:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.22); background-clip: padding-box; }
        .table-wrap::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.4) !important; background-clip: padding-box; }
        .table-wrap::-webkit-scrollbar-corner { background: transparent; }
        /* V table pohľade table-wrap nie je absolútny — je flex item, aby group-bar bol viditeľný nad ním a sticky hlavičky stĺpcov fungovali správne */
        #view-table .table-wrap { position: relative; inset: auto; flex: 1; min-height: 0; overflow: auto; }
        /* Kotví celú hlavičku (header row + filter row) pri vertikálnom scrollovaní — spoľahlivejšie ako per-th sticky pri overflow v oboch osiach */
        #view-table table.dtable thead { position: sticky; top: 0; z-index: 5; }
        table.dtable { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
        table.dtable thead tr:first-child th { height: 30px; box-sizing: border-box; }
        table.dtable thead tr.filter-row th { height: 26px; box-sizing: border-box; }
        table.dtable thead th { position: -webkit-sticky; position: sticky; top: 0; background: #E6E6E6; border-bottom: 1px solid hsl(var(--border)); border-right: 1px solid #D4D4D4; padding: 0 10px; text-align: left; font-weight: 600; color: hsl(var(--foreground)); white-space: nowrap; font-size: 12px; z-index: 4; }
        /* Filter riadok má ležať POD hlavným hlavičkovým riadkom (30px), oba zostávajú sticky pri scrollovaní.
           top: 27px — 3px overlap s hlavičkou (30px height) zabrání tomu, aby pri scrollovaní medzerou
           presvitali riadky tabuľky pod filter-rowom. (Predtým bolo 28px / 2px overlap, ale na niektorých
           zoom-leveloch sa občas vytvoril sub-pixel gap a bleeding-through bolo vidieť.) */
        table.dtable thead tr.filter-row th { position: sticky; top: 26px; background: #EDEDED; border-bottom: 1px solid hsl(var(--border)); border-right: 1px solid #D4D4D4; z-index: 3; }
        /* Column resizer handle — rozšírená hit-oblasť 10 px (±5 px od hranice stĺpca),
           aby bolo pohodlné chytiť ju bez trafenia pixelu. Vizuálny hover zostáva subtle. */
        .col-resizer { position: absolute; top: 0; right: -5px; bottom: 0; width: 10px; cursor: col-resize; user-select: none; z-index: 7; background: transparent; }
        .col-resizer:hover, .col-resizer.resizing { background: rgba(232, 178, 45, 0.35); }
        body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none !important; }
        table.dtable thead th:last-child { border-right: none; }
        table.dtable thead th .th-inner { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
        table.dtable thead th .th-label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; flex: 1; min-width: 0; padding: 2px 0; overflow: hidden; white-space: nowrap; }
        table.dtable thead th .th-label-text { overflow: hidden; white-space: nowrap; min-width: 0; display: inline-block; max-width: 100%; }
        /* position: relative removed — sticky (line above) already creates containing block for col-resizer/col-menu-btn */
        table.dtable thead th .th-label:hover { color: hsl(var(--foreground)); }
        table.dtable thead th.is-sorted .th-label { color: hsl(var(--foreground)); font-weight: 600; }
        table.dtable thead th .sort-ind { width: 0; height: 12px; color: hsl(var(--muted-foreground)); opacity: 0; flex-shrink: 0; overflow: hidden; transition: opacity 0.12s ease, width 0.12s ease; }
        table.dtable thead th:hover .sort-ind { opacity: 0.55; width: 12px; }
        table.dtable thead th.is-sorted .sort-ind { opacity: 1; color: hsl(var(--primary)); width: 12px; }
        /* Multi-sort priority badge (1 = najvyššia priorita) */
        .sort-priority-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 14px; height: 14px; padding: 0 3px; margin-left: 4px; border-radius: 7px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-size: 9px; font-weight: 700; line-height: 1; }
        table.dtable thead th .col-menu-btn { opacity: 0; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: none; background: #E6E6E6; border-radius: 3px; color: hsl(var(--muted-foreground)); cursor: pointer; padding: 0; transition: opacity 0.15s ease, background 0.15s ease; z-index: 2; }
        table.dtable thead tr.filter-row th .col-menu-btn { background: #EDEDED; }
        table.dtable thead th:hover .col-menu-btn,
        table.dtable thead th .col-menu-btn.open { opacity: 1; }
        table.dtable thead th .col-menu-btn:hover { background: rgba(0,0,0,0.06); color: hsl(var(--foreground)); }
        table.dtable thead th .col-menu-btn svg { width: 14px; height: 14px; }
        /* Column pinning — sticky left/right */
        /* Pinned hlavička musí byť sticky v OBOCH smeroch (top + left/right) — inline style
           nastavuje left/right, CSS musí zachovať `top: 0`. Explicitne preto znovu deklarujeme. */
        table.dtable thead th.is-pinned-left,
        table.dtable thead th.is-pinned-right { position: sticky !important; top: 0 !important; z-index: 6; background: #E6E6E6; }
        /* Pinned filter-row musí byť pod hlavnou hlavičkou (top: 27px — 3px overlap) a sticky v oboch smeroch. */
        table.dtable thead tr.filter-row th.is-pinned-left,
        table.dtable thead tr.filter-row th.is-pinned-right { position: sticky !important; top: 27px !important; background: #EDEDED; z-index: 5; }
        /* Pinned body bunky musia byť nad .cell-dots (z-index 2), aby truncation "…" z vedľajších
           stĺpcov nepresvitali nad ukotvenú bunku pri horizontálnom scrollovaní. */
        table.dtable tbody td.is-pinned-left,
        table.dtable tbody td.is-pinned-right { position: sticky; z-index: 3; background: #FFFFFF; }
        table.dtable tbody tr:nth-child(even) td.is-pinned-left,
        table.dtable tbody tr:nth-child(even) td.is-pinned-right { background: #F4F4F4; }
        table.dtable tbody tr:hover td.is-pinned-left,
        table.dtable tbody tr:hover td.is-pinned-right { background: #F9F4E1; }
        table.dtable thead th.is-pinned-left.pinned-last,
        table.dtable tbody td.is-pinned-left.pinned-last { border-right: 2px solid hsl(var(--border)); box-shadow: 2px 0 4px -2px rgba(0,0,0,0.08); }
        table.dtable thead th.is-pinned-right.pinned-first,
        table.dtable tbody td.is-pinned-right.pinned-first { border-left: 2px solid hsl(var(--border)); box-shadow: -2px 0 4px -2px rgba(0,0,0,0.08); }
        table.dtable thead th.is-pinned-left .pin-ind,
        table.dtable thead th.is-pinned-right .pin-ind { width: 10px; height: 10px; color: hsl(var(--primary)); flex-shrink: 0; }
        table.dtable thead th .pin-ind { width: 10px; height: 10px; display: none; flex-shrink: 0; }
        table.dtable thead th.is-pinned-left .pin-ind,
        table.dtable thead th.is-pinned-right .pin-ind { display: inline-flex; }
        /* Group header rows */
        .dtable tr.group-row td { background: #FAFAFA !important; border-top: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); padding: 6px 10px; font-weight: 600; color: hsl(var(--foreground)); cursor: pointer; user-select: none; }
        .dtable tr.group-row.level-0 td { background: #F0F0F0 !important; }
        .dtable tr.group-row.level-1 td { background: #F5F5F5 !important; }
        .dtable tr.group-row.level-2 td { background: #FAFAFA !important; }
        .dtable tr.group-row td:hover { background: #EFEFEF !important; }
        .group-row-inner { display: inline-flex; align-items: center; gap: 8px; }
        .group-caret { width: 14px; height: 14px; color: hsl(var(--muted-foreground)); flex-shrink: 0; transition: transform 0.15s ease; }
        .group-row.collapsed .group-caret { transform: rotate(-90deg); }
        .group-label { font-weight: 700; color: hsl(var(--foreground)); }
        .group-count { display: inline-block; padding: 1px 7px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; font-size: 11px; font-weight: 500; color: hsl(var(--muted-foreground)); }
        .group-key { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--muted-foreground)); font-weight: 500; margin-right: 4px; }
        /* Active groupings pill bar under toolbar (shows current groupBy chain) */
        .group-bar { display: none; align-items: center; gap: 6px; padding: 6px 16px; background: #FAFAFA; border-bottom: 1px solid hsl(var(--border)); font-size: 12px; color: hsl(var(--muted-foreground)); flex-wrap: wrap; }
        .group-bar.active { display: flex; }
        .group-bar-label { font-weight: 500; }
        .group-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 12px; font-size: 12px; color: hsl(var(--foreground)); }
        .group-pill-remove { width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; padding: 0; border-radius: 50%; }
        .group-pill-remove:hover { background: #F4F4F4; color: hsl(var(--destructive)); }
        .group-pill-remove svg { width: 10px; height: 10px; }
        .group-bar-clear { background: transparent; border: none; font-size: 12px; color: hsl(var(--primary)); cursor: pointer; padding: 3px 6px; font-weight: 500; }
        .group-bar-clear:hover { text-decoration: underline; }
        /* Filter-row pod hlavičkami (top: 29px pre 1px overlap s hlavičkou — zabráni presvitaniu scroll riadkov) */
        table.dtable thead tr.filter-row th { position: sticky; top: 29px; background: #FFFFFF; padding: 0; border-bottom: 1px solid hsl(var(--border)); border-right: 1px solid #EFEFEF; }
        table.dtable thead tr.filter-row th:last-child { border-right: none; }
        table.dtable tbody tr { height: 37px; cursor: pointer; position: relative; }
        .row-kebab { display: none !important; }
        table.dtable tbody tr:hover .row-kebab { display: none !important; }
        /* Sticky Akcie column — always at right: 0; min-rail offset handled by main padding-right */
        table.dtable thead th.col-actions-th,
        table.dtable tbody td.col-actions-td,
        table.dtable thead tr.filter-row th.col-actions-th { position: sticky !important; right: 0 !important; background: #FFFFFF; box-shadow: -1px 0 0 0 #E5E5E5; width: 56px !important; min-width: 56px !important; max-width: 56px !important; padding-left: 4px !important; padding-right: 4px !important; }
        table.dtable tbody td.col-actions-td { padding: 4px 4px !important; }
        table.dtable thead th.col-actions-th { background: #E6E6E6 !important; z-index: 6 !important; top: 0 !important; box-shadow: -1px 0 0 0 #E5E5E5, 0 1px 0 0 hsl(var(--border)) !important; }
        table.dtable thead tr.filter-row th.col-actions-th { background: #EDEDED !important; z-index: 5 !important; top: 29px !important; border-top: none !important; }
        table.dtable tbody td.col-actions-td { z-index: 2 !important; padding-left: 4px !important; padding-right: 4px !important; }
        table.dtable tbody tr:hover td.col-actions-td { background: #FAFAFA; }
        table.dtable tbody tr:nth-child(even) td.col-actions-td { background: #F4F4F4; }
        /* Column drag-to-reorder */
        table.dtable thead th[draggable="true"] { cursor: grab; }
        table.dtable thead th[draggable="true"]:active { cursor: grabbing; }
        table.dtable thead th.col-dragging { opacity: 0.45; background: #F9F4E1 !important; }
        table.dtable thead th.col-drop-before { box-shadow: inset 3px 0 0 0 #0B0B0C !important; }
        table.dtable thead th.col-drop-after { box-shadow: inset -3px 0 0 0 #0B0B0C !important; }
        .row-actions-ic { display: inline-flex; gap: 2px; align-items: center; justify-content: flex-start; }
        .row-act { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: #707071; cursor: pointer; border-radius: 4px; padding: 0; flex-shrink: 0; }
        .row-act:hover { background: #EDEDED; color: #0B0B0C; }
        .row-act svg { width: 14px; height: 14px; }
        .row-act.row-act-danger:hover { background: rgba(212,55,17,0.1); color: #C63310; }
        .row-kebab:hover { color: hsl(var(--foreground)); background: #F4F4F4; }
        .row-kebab svg { width: 12px; height: 12px; }
        .row-kebab-menu { position: fixed; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,0.14); padding: 4px; min-width: 180px; z-index: 120; display: none; }
        .row-kebab-menu.open { display: block; }
        .row-kebab-menu .actions-menu-item { padding: 7px 10px; }
        /* Skrytý spinner pre number inputy — nepoužívame natívne kolečká */
        .cell-edit-input[type="number"]::-webkit-outer-spin-button,
        .cell-edit-input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
        .cell-edit-input[type="number"] { -moz-appearance: textfield; }
        /* Inline editing — editor vyplní celú bunku, jeden riadok, žiadne rozťahovanie */
        .cell-edit-input { width: 100%; height: 100%; border: 2px solid hsl(var(--primary)); background: #FFFBEE; padding: 0 10px; font-size: 13px; font-family: inherit; color: hsl(var(--foreground)); outline: none; box-sizing: border-box; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: block; }
        td.is-editing { padding: 0 !important; height: 37px; }
        .cell-edit-trigger { width: 100%; height: 37px; padding: 0 10px; border: 2px solid #E8B22D; background: #FFFBEE; text-align: left; font-size: 13px; font-family: inherit; color: hsl(var(--foreground)); cursor: pointer; outline: none; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 0; display: block; }
        .cell-edit-trigger:focus { border-color: #2D2D2D; }
        .cell-edit-date { width: 100%; height: 37px; padding: 0 10px; border: 2px solid hsl(var(--primary)); background: #FFFBEE; font-size: 13px; font-family: inherit; outline: none; box-sizing: border-box; white-space: nowrap; overflow: hidden; border-radius: 0; }
        /* Readonly bunky v móde úpravy — neklikateľné, vizuálne odlíšené */
        table.dtable.edit-mode td[data-key="id"],
        table.dtable.edit-mode td[data-key="rem"],
        table.dtable.edit-mode td[data-key="last"],
        table.dtable.edit-mode td[data-key="poduloh"],
        table.dtable.edit-mode td[data-key="ai_sum"] { cursor: not-allowed !important; opacity: 0.6; }
        table.dtable tbody tr.group-row { cursor: pointer; }
        table.dtable tbody tr td.col-check,
        table.dtable tbody tr td .cell-dots { cursor: default; }
        /* Pevná výška riadku — rozbaľovanie do viacerých riadkov je potlačené (nowrap + ellipsis) */
        table.dtable tbody tr { height: 30px; }
        table.dtable tbody td { padding: 4px 10px; border-bottom: 1px solid #EFEFEF; border-right: 1px solid #EFEFEF; max-width: 280px; color: hsl(var(--foreground)); vertical-align: middle; box-sizing: border-box; position: relative; overflow: hidden; height: 30px; white-space: nowrap; }
        /* Pozn.: NEPOUŽÍVAME text-overflow: ellipsis, lebo truncation dots pridáva JS ako samostatný klikateľný .cell-dots span.
           CSS ellipsis by kreslil druhé "…" vedľa klikateľných — preto je vypnuté. Jedinou bodkovou značkou je .cell-dots. */
        .cell-text { display: block; white-space: nowrap; overflow: hidden; max-width: 100%; }
        .cell-text.is-truncated { padding-right: 26px; }
        .cell-dots { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 22px; display: none; align-items: center; justify-content: center; color: hsl(var(--muted-foreground)); cursor: pointer; font-size: 14px; font-weight: 700; line-height: 1; letter-spacing: 1px; border-radius: 3px; z-index: 2; }
        .cell-dots.show { display: inline-flex; }
        .dtable tbody tr:nth-child(odd) td .cell-dots { background: #FFFFFF; }
        .dtable tbody tr:nth-child(even) td .cell-dots { background: #F4F4F4; }
        .dtable tbody tr:hover td .cell-dots { background: #F9F4E1; }
        .cell-dots:hover { color: hsl(var(--foreground)); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.18); }
        table.dtable tbody td:last-child { border-right: none; }
        table.dtable tbody tr:nth-child(even) td { background: #F4F4F4; }
        table.dtable tbody tr:nth-child(odd) td { background: #FFFFFF; }
        /* Pointer cursor + hover. CSS :hover + JS-class fallback pre spoľahlivosť. */
        table.dtable tbody tr[data-row-id] { cursor: pointer; }
        table.dtable tbody tr[data-row-id]:hover td,
        table.dtable tbody tr.is-row-hover td { background: #F9F4E1; }
        table.dtable td.col-check, table.dtable th.col-check { width: 32px; padding: 4px 10px; text-align: center; vertical-align: middle; }
        table.dtable td.col-check .sh-checkbox,
        table.dtable th.col-check .sh-checkbox { display: inline-block; vertical-align: middle; margin: 0; }
        /* Select-all checkbox v hlavičke musí byť vizuálne centrovaný v 30px-vysokom thead riadku */
        table.dtable thead th.col-check { line-height: 0; }
        table.dtable td.col-num { text-align: right; }

        /* Row chips */
        .chip-reported { background: #EDEDED; color: #4C4C4D; }
        .chip-todo { background: #F9F7D5; color: #8B6914; }
        .chip-inprogress { background: #D4E7FF; color: #1B4C87; }
        .chip-review { background: #FFE6CC; color: #8B5A0A; }
        .chip-done { background: #D5F5D5; color: #1E6B1E; }
        .chip-onhold { background: #4C4C4D; color: #FFFFFF; }
        .chip-cancelled { background: #FDDAD2; color: #D43711; }

        .priority-high { color: #D43711; font-weight: 500; }
        .priority-medium { color: hsl(var(--foreground)); }
        .priority-low { color: hsl(var(--muted-foreground)); }

        /* Footer (white) */
        .table-footer { display: flex; align-items: center; gap: 8px; padding: 6px 16px; background: #FFFFFF; border-top: 1px solid hsl(var(--border)); flex-shrink: 0; }
        /* Eliminuj prípadné whitespace medzi toolbarom a tabuľkou + medzi tabuľkou a footer-om. */
        #view-host { margin: 0 !important; padding: 0 !important; }
        #view-table, .view-container.view-table { margin: 0 !important; padding: 0 !important; }
        #view-table > .table-wrap { margin: 0 !important; padding: 0 !important; border: none !important; }
        #view-table > .group-bar:not(.active) { display: none !important; height: 0 !important; margin: 0 !important; padding: 0 !important; border: none !important; }
        /* Posledný riadok tabuľky bez border-bottom — footer má svoj border-top, dvojitý border vytváral 1px presvitajúci pruh. */
        table.dtable tbody tr:last-child td { border-bottom: none; }
        .table-footer .tf-left, .table-footer .tf-right { flex: 1 1 0; display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
        .table-footer .tf-right { justify-content: flex-end; }
        .table-footer #pager { flex: 0 0 auto; }
        .tf-toggle { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 4px; border: 1px solid hsl(var(--border)); background: #FFFFFF; color: hsl(var(--foreground)); font-size: 12px; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
        .tf-toggle.tf-toggle-icon { width: 30px; padding: 0; justify-content: center; }
        .tf-toggle:hover { background: #F4F4F4; }
        .tf-toggle svg { width: 14px; height: 14px; }
        .tf-toggle[aria-pressed="true"] { background: #2D2D2D; border-color: #2D2D2D; color: #FFFFFF; }
        .tf-toggle[aria-pressed="true"]:hover { background: #1F1F1F; }
        .tf-toggle .tf-toggle-label { white-space: nowrap; }
        /* Record-visual modal — štýly pre sloty a preview kartičky */
        .rv-slot-row { display: flex; flex-direction: column; gap: 4px; }
        .rv-slot-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--muted-foreground)); font-weight: 600; }
        .rv-preview .rv-pv-title { font-size: 14px; }
        .rv-preview[data-empty="true"] { opacity: 0.6; }
        .rv-preview .rv-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
        /* Zdieľaná kartička záznamu (renderRecordCardHtml) — používa Kanban, Karty, Kalendár, Gantt */
        .rc-card { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto; gap: 6px 10px; padding: 10px 12px 10px 16px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 12px; color: hsl(var(--foreground)); overflow: hidden; min-height: 64px; }
        .rc-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--rc-accent, #2D2D2D); border-radius: 6px 0 0 6px; }
        .rc-card .rc-top { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11.5px; color: hsl(var(--muted-foreground)); min-width: 0; }
        .rc-card .rc-tl, .rc-card .rc-tr, .rc-card .rc-bl, .rc-card .rc-br { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
        .rc-card .rc-title { grid-column: 1 / -1; font-weight: 600; font-size: 13px; color: #0B0B0C; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
        .rc-card .rc-bottom { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; color: hsl(var(--muted-foreground)); min-width: 0; }
        .rc-card.rc-size-sm { min-height: 0; padding: 6px 8px 6px 12px; font-size: 11px; gap: 2px 8px; }
        .rc-card.rc-size-sm .rc-title { font-size: 12px; -webkit-line-clamp: 1; }
        .rc-card.rc-size-sm .rc-top, .rc-card.rc-size-sm .rc-bottom { font-size: 10.5px; }
        .rc-card.rc-size-lg { min-height: 120px; padding: 14px 16px 14px 20px; }
        .rc-card.rc-size-lg .rc-title { font-size: 14px; -webkit-line-clamp: 3; }
        /* DS-aware kartička s viacerými info riadkami (rc-rows). */
        .rc-card-ds { grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 4px; }
        .rc-card-ds .rc-id { font-size: 10.5px; font-weight: 600; color: hsl(var(--muted-foreground)); letter-spacing: 0.02em; }
        .rc-card-ds .rc-title { margin-top: 2px; }
        .rc-card-ds .rc-rows { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
        .rc-card-ds .rc-row { display: flex; align-items: center; gap: 6px; font-size: 11.5px; min-width: 0; }
        .rc-card-ds .rc-row-label { color: hsl(var(--muted-foreground)); font-weight: 500; flex-shrink: 0; min-width: 64px; }
        .rc-card-ds .rc-row-val { color: hsl(var(--foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
        .rc-card-ds .rc-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .rc-card-ds .rc-link { color: #2588A8; }
        .rc-card-ds.rc-size-sm .rc-row { font-size: 10.5px; }
        .rc-card-ds.rc-size-sm .rc-row-label { min-width: 50px; }
        /* Mode flag on .dtable to hint edit affordances on body cells */
        .dtable.mode-edit tbody td[data-key]:not([data-key="actions"]):not([data-key="check"]) { cursor: text; }
        .dtable.mode-edit tbody td[data-key]:not([data-key="actions"]):not([data-key="check"]):hover { box-shadow: inset 0 0 0 1px #E8B22D; }
        /* Edit mode: sticky "nový záznam" row at the TOP of the table (pod header+filter row) */
        .dtable tbody tr.edit-add-row { cursor: pointer; }
        #view-table table.dtable tbody tr.edit-add-row td { position: sticky; top: 56px; z-index: 3; }
        .dtable tbody tr.edit-add-row td { background: #FDF8D5; border-top: 1px solid #E8B22D; border-bottom: 1px solid #E8B22D; border-right: 1px solid #E8E8E8; height: 30px; padding: 4px 10px; font-size: 13px; color: hsl(var(--muted-foreground)); vertical-align: middle; overflow: hidden; white-space: nowrap; }
        .dtable tbody tr.edit-add-row td.col-check { padding: 0; text-align: center; }
        .dtable tbody tr.edit-add-row td:last-child { border-right: none; }
        .dtable tbody tr.edit-add-row:hover td { background: #FCF0A8; }
        .dtable tbody tr.edit-add-row .edit-add-row-placeholder { color: hsl(var(--muted-foreground)); font-style: italic; opacity: 0.7; }
        .dtable tbody tr.edit-add-row.is-adding td { background: #FFFBEE; cursor: text; }
        .dtable tbody tr.edit-add-row.is-adding td input { width: 100%; border: none; background: transparent; font-size: 13px; font-family: inherit; color: hsl(var(--foreground)); padding: 0; outline: none; }
        .edit-add-row-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; background: hsl(var(--primary)); color: #fff; border-radius: 4px; font-size: 16px; font-weight: 700; flex-shrink: 0; line-height: 1; }
        /* Summary row (one global row, sticky to the bottom of the table) — jeden riadok, žiadne rozťahovanie */
        .dtable tbody tr.summary-row { background: #FAFAF5 !important; border-top: 2px solid #D4D4D4; font-weight: 600; position: sticky; bottom: 0; z-index: 3; height: 30px; }
        .dtable tbody tr.summary-row td { background: inherit; user-select: none; padding-right: 10px; text-align: right; cursor: default; height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
        .dtable tbody tr.summary-row td .agg-val { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
        .dtable tbody tr.summary-row td[data-key="actions"] { background: inherit !important; }
        /* Interactive cells (numeric + date) */
        .dtable tbody tr.summary-row td.summary-cell { cursor: pointer; }
        .dtable tbody tr.summary-row td.summary-cell.agg-empty { color: hsl(var(--muted-foreground)); font-weight: 400; }
        .dtable tbody tr.summary-row td.summary-cell.agg-empty::after { content: "+"; opacity: 0.35; margin-left: 2px; font-size: 11px; }
        .dtable tbody tr.summary-row td.summary-cell:hover { background: #F2EFDB !important; }
        .dtable tbody tr.summary-row td .agg-op { display: inline-block; color: hsl(var(--muted-foreground)); font-weight: 500; margin-right: 4px; font-size: 11px; }
        .dtable tbody tr.summary-row td .agg-val { font-variant-numeric: tabular-nums; }
        /* Group summary rows — one per group, appears after the group's last visible row */
        .dtable tbody tr.group-summary-row { background: #F5F5F0 !important; border-top: 1px solid #D8D8D8; height: 30px; }
        .dtable tbody tr.group-summary-row td { background: inherit; padding: 3px 10px; font-size: 12px; font-weight: 500; color: hsl(var(--muted-foreground)); text-align: right; cursor: default; white-space: nowrap; user-select: none; }
        .dtable tbody tr.group-summary-row td.grp-sum-label { text-align: left; font-size: 11px; }
        .dtable tbody tr.group-summary-row td .agg-op { display: inline-block; margin-right: 3px; font-size: 10px; }
        .dtable tbody tr.group-summary-row td .agg-val { font-variant-numeric: tabular-nums; }
        .dtable tbody tr.group-summary-row td[data-key="actions"] { background: inherit !important; }
        html[data-theme="dark"] .dtable tbody tr.group-summary-row { background: #1B1D20 !important; }
        html[data-theme="dark"] .dtable tbody tr.group-summary-row td { color: #9B9C9D; }
        /* Inline cell dropdown (Select / Link editor) */
        .cell-dropdown { position: fixed; z-index: 1100; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); padding: 4px; display: none; min-width: 200px; max-width: 360px; }
        .cell-dropdown.open { display: block; }
        .cell-dropdown-search { padding: 4px; border-bottom: 1px solid hsl(var(--border)); margin-bottom: 4px; }
        .cell-dropdown-search input { width: 100%; height: 26px; padding: 0 8px; font-size: 12px; border: 1px solid hsl(var(--border)); border-radius: 4px; outline: none; }
        .cell-dropdown-search input:focus { border-color: #2D2D2D; }
        .cell-dropdown-list { max-height: 260px; overflow: auto; }
        .cell-dropdown-item { padding: 7px 10px; font-size: 12.5px; border-radius: 4px; cursor: pointer; color: hsl(var(--foreground)); }
        .cell-dropdown-item:hover { background: #F4F4F4; }
        .cell-dropdown-item.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
        .cell-dropdown-empty { padding: 10px; font-size: 12px; color: hsl(var(--muted-foreground)); text-align: center; }
        .cell-edit-trigger { width: 100%; height: 28px; padding: 0 10px; background: #FFFFFF; border: 1px solid #E8B22D; border-radius: 4px; text-align: left; font-size: 12px; color: hsl(var(--foreground)); cursor: pointer; outline: none; }
        .cell-edit-trigger:focus { border-color: #2D2D2D; }
        .cell-edit-input.invalid { border-color: #D43711 !important; background: #FEEFE9 !important; }
        .cell-edit-date { width: 100%; height: 28px; padding: 0 6px; border: 1px solid #E8B22D; border-radius: 4px; font-size: 12px; outline: none; }
        .cell-edit-date:focus { border-color: #2D2D2D; }
        /* Aggregation popup */
        .agg-popup { position: fixed; min-width: 160px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); padding: 4px; z-index: 160; display: none; }
        .agg-popup.open { display: block; }
        .agg-popup .agg-popup-item { padding: 8px 14px; font-size: 13px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: hsl(var(--foreground)); }
        .agg-popup .agg-popup-item:hover { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
        .agg-popup .agg-popup-item.active { background: #F4F4F4; color: hsl(var(--foreground)); }
        .agg-popup .agg-popup-item.active::after { content: "✓"; font-weight: 700; }
        .pager-btn { min-width: 28px; height: 28px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; color: hsl(var(--foreground)); font-size: 13px; background: none; border: none; cursor: pointer; }
        .pager-btn:hover { background: #F4F4F4; }
        .pager-btn.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }

        /* Filter input under header — spans full cell width */
        .col-filter-wrap { position: relative; display: flex; align-items: center; background: #FFFFFF; height: 32px; width: 100%; transition: background-color 0.15s ease; }
        .col-filter-wrap:focus-within { background: #FAFAFA; }
        .col-filter-icon { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; color: hsl(var(--muted-foreground)); cursor: pointer; border: none; background: transparent; padding: 0; border-radius: 3px; flex-shrink: 0; margin-left: 6px; }
        .col-filter-icon:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .col-filter-icon svg { width: 12px; height: 12px; }
        .col-filter { flex: 1; min-width: 0; width: 100%; height: 100%; padding: 0 10px 0 4px; font-size: 12px; border: none; background: transparent; outline: none; color: hsl(var(--foreground)); }
        /* Filter row reset button — sits in the leftmost (col-check) cell of the filter row.
           Hidden until any filter or sort is active; flips to visible via .is-active class. */
        .filter-reset-btn { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: none; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease; }
        .filter-reset-btn.is-active { opacity: 1; pointer-events: auto; }
        .filter-reset-btn:hover { background: #FEE2E2; color: #DC2626; }
        .filter-reset-btn svg { width: 13px; height: 13px; }
        html[data-theme="dark"] .filter-reset-btn:hover { background: #3F1D1D; color: #FCA5A5; }

        /* Filter operator dropdown — z-index well above sticky cells (col-actions-td uses 2,
           col-actions-th uses 6); the menu is also portaled to <body> on open so no ancestor
           stacking context (e.g. sticky th) can trap it. */
        .filter-menu { position: fixed; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); padding: 4px; z-index: 1000; min-width: 200px; display: none; }
        .filter-menu.open { display: block; }
        /* Range filter — kompaktný inline layout v štýle starého modulária.
           Obe inputy nemajú vlastný border — splynú s bunkou filter-row, oddeľuje ich len pomlčka.
           Ikona vľavo odlíši typ (# pre číslo, kalendár pre dátum). */
        .col-filter-range-wrap { display: flex; align-items: center; width: 100%; height: 100%; padding: 0 4px 0 2px; gap: 4px; }
        .col-filter-range-wrap .col-filter-icon { margin-left: 0; }
        .col-filter-range-wrap.is-scalar .col-filter-range { display: none; }
        .col-filter-range { display: flex; flex: 1; min-width: 0; align-items: center; gap: 2px; height: 100%; }
        .col-filter-range input { flex: 1; min-width: 0; width: 100%; height: 100%; padding: 0 4px; font-size: 11px; border: none; background: transparent; outline: none; color: hsl(var(--foreground)); font-family: inherit; }
        .col-filter-range input::placeholder { color: hsl(var(--muted-foreground)); opacity: 0.7; font-size: 10.5px; }
        .col-filter-range input:focus { background: #FFFFFF; box-shadow: inset 0 -1px 0 0 hsl(var(--primary)); }
        .col-filter-range .sep { color: hsl(var(--muted-foreground)); font-size: 12px; flex-shrink: 0; padding: 0 2px; }
        /* Datepicker inputy — používame custom shadcn-style picker, natívny sa nepoužíva */
        .col-filter-range input.sdp-input { cursor: pointer; }
        .col-filter-range input[type="number"]::-webkit-outer-spin-button,
        .col-filter-range input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
        .col-filter-range input[type="number"] { -moz-appearance: textfield; }
        /* Shadcn-style date picker popover */
        .sdp-popover { position: fixed; z-index: 1200; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 12px; width: 276px; display: none; font-size: 13px; color: hsl(var(--foreground)); }
        .sdp-popover.open { display: block; }
        .sdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
        .sdp-month-label { font-weight: 600; font-size: 13px; }
        .sdp-nav { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid hsl(var(--border)); background: #FFFFFF; border-radius: 6px; cursor: pointer; color: hsl(var(--foreground)); padding: 0; }
        .sdp-nav:hover { background: #F4F4F4; }
        .sdp-nav svg { width: 14px; height: 14px; }
        .sdp-weekdays, .sdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
        .sdp-weekdays { margin-bottom: 4px; }
        .sdp-weekdays > div { text-align: center; font-size: 11px; color: hsl(var(--muted-foreground)); font-weight: 500; padding: 4px 0; text-transform: uppercase; letter-spacing: 0.04em; }
        .sdp-grid { grid-auto-rows: 34px; }
        .sdp-day { display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: 6px; font-size: 13px; cursor: pointer; color: hsl(var(--foreground)); padding: 0; font-family: inherit; }
        .sdp-day:hover { background: #F4F4F4; }
        .sdp-day.muted { color: hsl(var(--muted-foreground)); opacity: 0.45; }
        .sdp-day.today { font-weight: 700; box-shadow: inset 0 0 0 1px hsl(var(--border)); }
        .sdp-day.selected { background: #2D2D2D; color: #FFFFFF; font-weight: 600; }
        .sdp-day.selected:hover { background: #1F1F1F; }
        .sdp-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid hsl(var(--border)); }
        .sdp-action { background: transparent; border: none; color: hsl(var(--foreground)); font-size: 12.5px; cursor: pointer; padding: 4px 8px; border-radius: 4px; font-family: inherit; }
        .sdp-action:hover { background: #F4F4F4; }
        .sdp-action.primary { color: #2D2D2D; font-weight: 600; }

        /* Column header context menu */
        .col-menu { position: fixed; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); padding: 4px; z-index: 700; min-width: 160px; display: none; }
        .col-menu.open { display: block; }
        .col-menu-item { display: flex; align-items: center; padding: 8px 12px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; border-radius: 4px; white-space: nowrap; }
        .col-menu-item:hover { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }

        /* Truncated cell value popup */
        .cell-popup { position: fixed; z-index: 100; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,0.12); padding: 10px 14px; max-width: 480px; max-height: 320px; overflow: auto; font-size: 13px; line-height: 1.45; color: hsl(var(--foreground)); white-space: normal; word-wrap: break-word; display: none; }
        .cell-popup.open { display: block; }
        .cell-popup.pinned { border-color: hsl(var(--primary) / 0.35); box-shadow: 0 8px 24px rgba(0,0,0,0.16); }
        .dtable tbody td.truncated { cursor: pointer; }

        /* Advanced filter panel */
        .adv-filter-panel { position: fixed; top: 0; left: 0; width: 720px; max-width: calc(100vw - 32px); background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 700; display: none; }
        .adv-filter-panel.open { display: block; }
        .adv-filter-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid hsl(var(--border)); }
        .adv-filter-title { font-size: 15px; font-weight: 700; color: hsl(var(--foreground)); }
        .adv-filter-close { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 4px; }
        .adv-filter-close:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .adv-filter-body { padding: 14px 18px; max-height: 60vh; overflow: auto; }
        .adv-cond-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
        .adv-drag { color: hsl(var(--muted-foreground)); cursor: grab; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 14px; }
        .adv-select { position: relative; display: inline-block; }
        /* Dropdowny v hlavnom toolbare (Gantt zoom / Kanban group+sort / Kalendár view) —
           rovnaká výška ako search input (36 px) a trigger sa natiahne na celú šírku wrappera,
           aby pri min-width nevznikali prázdne miesta napravo od textu. */
        #gantt2-zoom, #kanban-group, #kanban-sort, #cal2-top-view { display: inline-flex; }
        #gantt2-zoom .adv-select-trigger,
        #kanban-group .adv-select-trigger,
        #kanban-sort .adv-select-trigger,
        #cal2-top-view .adv-select-trigger { width: 100%; height: 36px; font-size: 12.5px !important; font-weight: 500; }
        /* Globálne zjednotenie font-size pre všetky dropdowny v hornej lište (toolbar / nav-tabs) — match s sh-btn-sm 12.5px */
        .toolbar .adv-select-trigger,
        .toolbar .multi-trigger,
        .toolbar .view-select-trigger,
        .toolbar .sh-btn,
        .toolbar .sh-input,
        .top-tabs .adv-select-trigger,
        .top-tabs .multi-trigger,
        .top-tabs .view-select-trigger,
        .top-tabs .sh-btn { font-size: 12.5px !important; }
        .toolbar .adv-select-item,
        .toolbar .multi-item { font-size: 12.5px; }
        .adv-select-trigger { height: 32px; padding: 0 28px 0 10px; border: 1px solid hsl(var(--border)); border-radius: 4px; background: #FFFFFF; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; display: inline-flex; align-items: center; white-space: nowrap; max-width: 100%; }
        .adv-select-trigger:hover { border-color: #BFBFBF; }
        .adv-select.open .adv-select-trigger { border-color: hsl(var(--primary)); }
        .adv-select-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .adv-select-chevron { width: 12px; height: 12px; color: hsl(var(--muted-foreground)); margin-left: 6px; flex-shrink: 0; }
        .adv-select-leadicon { display: inline-flex; align-items: center; flex-shrink: 0; }
        /* Kompaktný režim — toolbar je úzky → skry textový label, nechaj len ikonu + chevron.
           Aktivuje sa cez .ds-toolbar-compact na rodičovi (alebo iframe-embed prostredie). */
        .ds-toolbar-compact .adv-select.has-leadicon .adv-select-label { display: none !important; }
        .ds-toolbar-compact .adv-select.has-leadicon .adv-select-trigger { padding: 0 22px 0 8px; min-width: 0 !important; width: auto !important; height: 30px; font-size: 12px; }
        .ds-toolbar-compact .adv-select.has-leadicon { min-width: 0 !important; }
        .ds-toolbar-compact .adv-select.has-leadicon .adv-select-leadicon { margin-right: 0; }
        .ds-toolbar-compact .view-select-label { display: none !important; }
        .ds-toolbar-compact .view-select-trigger { padding: 0 22px 0 8px; height: 30px; font-size: 12px; }
        .ds-toolbar-compact .sh-btn { font-size: 12px; }
        .ds-toolbar-compact .adv-select-trigger { font-size: 12px; }
        /* Štvorcové ikon-only tlačidlá nesmú byť zúžené ani pri compact mode */
        .sh-btn-icon-sm { width: 2.25rem !important; min-width: 2.25rem !important; flex-shrink: 0 !important; aspect-ratio: 1 / 1; }
        .ds-toolbar-compact .sh-btn-icon-sm { width: 2rem !important; min-width: 2rem !important; height: 2rem !important; }
        /* Pagination + edit mode font sizes — držať konzistentne aj v narrow detaile */
        .ds-toolbar-compact .table-footer, .ds-toolbar-compact .tf-info, .ds-toolbar-compact .tf-pgsize, .ds-toolbar-compact .tf-pager, .ds-toolbar-compact .tf-pager-info { font-size: 12px !important; }
        .ds-toolbar-compact .tf-pgsize select, .ds-toolbar-compact .tf-pgsize .adv-select-trigger { font-size: 12px !important; height: 28px !important; padding: 0 22px 0 8px !important; }
        .ds-toolbar-compact .pgbtn { width: 26px !important; height: 26px !important; font-size: 12px !important; }
        .ds-toolbar-compact .editing-row td input, .ds-toolbar-compact .editing-row td .sh-input { font-size: 12px !important; }
        .ds-toolbar-compact .editing-row td input::placeholder { font-size: 12px !important; }
        /* Akcie stĺpec — žiaden filter ikon, iba sivý placeholder podobný iným cells */
        .filter-row th.col-actions-th { background: #FAFAFA; }
        .filter-row th.col-actions-th .col-filter-wrap, .filter-row th.col-actions-th .col-filter-icon, .filter-row th.col-actions-th .col-filter, .filter-row th[data-filter-col-key="actions"] .col-filter-wrap, .filter-row th[data-filter-col-key="actions"] button { display: none !important; }
        /* Pravostranné prvky toolbaru (filter, columns, view, search) na pravo aj pri narrow šírke */
        .dse-header .ml-auto, .dse-toolbar .ml-auto { margin-left: auto !important; }
        .dse-header > .ml-auto, .dse-toolbar > .ml-auto { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
        html.ds-embedded .dse-header { display: flex; align-items: center; gap: 6px; }
        html.ds-embedded .dse-header > .ml-auto { margin-left: auto !important; }
        .ds-toolbar-compact #tbl-quick-search { width: 32px !important; padding-left: 28px !important; padding-right: 4px !important; transition: width 0.2s; }
        .ds-toolbar-compact #tbl-quick-search:focus { width: 180px !important; }
        .ds-toolbar-compact #cal2-top-label { display: none !important; }
        .ds-toolbar-compact #gantt2-now-btn span, .ds-toolbar-compact #gantt2-now-btn { font-size: 0; }
        .ds-toolbar-compact #gantt2-now-btn svg { font-size: 14px; }
        .adv-select-menu { position: fixed; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,0.12); padding: 4px; z-index: 1100; min-width: 140px; max-height: 280px; overflow: auto; display: none; }
        .adv-select.open .adv-select-menu { display: block; }
        .adv-select-item { padding: 6px 10px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; border-radius: 4px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
        .adv-select-item:hover { background: #F4F4F4; }
        .adv-select-item.active { background: hsl(var(--primary) / 0.12); color: hsl(var(--primary)); font-weight: 500; }
        .adv-select-item.ds-hidden, .multi-item.ds-hidden { display: none !important; }
        .ds-search { position: sticky; top: 0; background: #FFFFFF; padding: 6px 6px 8px 6px; border-bottom: 1px solid hsl(var(--border)); margin: -4px -4px 4px -4px; display: flex; align-items: center; gap: 6px; z-index: 1; }
        .ds-search svg.ds-search-icon { width: 14px; height: 14px; color: hsl(var(--muted-foreground)); margin-left: 6px; flex-shrink: 0; }
        .ds-search input { flex: 1; height: 28px; padding: 0 6px; border: none; outline: none; font-size: 13px; background: transparent; color: hsl(var(--foreground)); min-width: 0; }
        .ds-search input::placeholder { color: hsl(var(--muted-foreground)); }
        .ds-search-clear { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 3px; flex-shrink: 0; margin-right: 4px; visibility: hidden; }
        .ds-search-clear.ds-visible { visibility: visible; }
        .ds-search-clear:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .ds-search-clear svg { width: 12px; height: 12px; }
        .ds-empty { padding: 10px 12px; font-size: 12px; color: hsl(var(--muted-foreground)); text-align: center; display: none; }
        .ds-empty.ds-visible { display: block; }
        .adv-input { height: 32px; padding: 0 10px; border: 1px solid hsl(var(--border)); border-radius: 4px; background: #FFFFFF; font-size: 13px; color: hsl(var(--foreground)); flex: 1; min-width: 80px; outline: none; }
        .adv-input:focus { border-color: hsl(var(--primary)); }
        .adv-cond-del { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid hsl(var(--border)); background: #FFFFFF; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 4px; flex-shrink: 0; }
        .adv-cond-del:hover { background: #F4F4F4; color: hsl(var(--destructive)); }
        .adv-connector { margin-left: 18px; margin-bottom: 8px; }
        .adv-connector .adv-select-trigger { min-width: 80px; }

        /* Compact page-size dropdown in footer */
        .page-size-select .adv-select-trigger { height: 24px; padding: 0 18px 0 6px; font-size: 11px; min-width: 44px; }
        .page-size-select .adv-select-chevron { margin-left: 3px; width: 9px; height: 9px; }
        .page-size-select .adv-select-menu { min-width: 56px; font-size: 11px; padding: 2px; }
        .page-size-select .adv-select-item { padding: 3px 8px; font-size: 11px; justify-content: center; }
        .adv-group { border: 1px solid hsl(var(--border)); border-radius: 6px; padding: 12px; margin-bottom: 12px; background: #FAFAFA; position: relative; }
        .adv-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
        .adv-group-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: hsl(var(--foreground)); }
        .adv-add-row { display: flex; gap: 8px; margin-top: 4px; }
        .adv-btn-add { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border: none; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
        .adv-btn-add.secondary { background: #FFFFFF; color: hsl(var(--foreground)); border: 1px solid hsl(var(--border)); }
        .adv-btn-add:hover { opacity: 0.9; }
        .adv-btn-add svg { width: 14px; height: 14px; }
        .adv-backdrop { position: fixed; inset: 0; background: transparent; z-index: 695; display: none; }
        .adv-backdrop.open { display: block; }
        .filter-menu-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; border-radius: 4px; white-space: nowrap; }
        .filter-menu-item:hover { background: #F4F4F4; }
        .filter-menu-item svg { width: 14px; height: 14px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
        .filter-menu-item.active { background: hsl(var(--foreground)); color: hsl(var(--background)); }
        .filter-menu-item.active svg { color: hsl(var(--background)); }
        /* Offset preset (Posun) — skrytý defaultne, zobrazí sa iba keď má menu aktívny scope (Dnes/Týždeň/Mesiac/Rok) */
        .filter-menu .filter-menu-item[data-op="offset"] { display: none; }
        .filter-menu[data-has-scope="1"] .filter-menu-item[data-op="offset"] { display: flex; }
        /* Offset spinner vnútri menu-item (Posun o N) */
        .filter-menu-item .dpt-spin { display: inline-flex; align-items: center; gap: 2px; margin: 0 2px; }
        .filter-menu-item .dpt-spin-btn { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; background: hsl(var(--background)); color: hsl(var(--foreground)); border: 1px solid hsl(var(--border)); border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 600; padding: 0; line-height: 1; }
        .filter-menu-item .dpt-spin-btn:hover { background: #F4F4F4; }
        .filter-menu-item .dpt-spin-input { width: 44px; height: 22px; text-align: center; font-size: 12px; border: 1px solid hsl(var(--border)); border-radius: 4px; background: hsl(var(--background)); color: hsl(var(--foreground)); padding: 0 2px; font-family: inherit; }
        .filter-menu-item .dpt-spin-input::-webkit-outer-spin-button,
        .filter-menu-item .dpt-spin-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
        .filter-menu-item .dpt-spin-input { -moz-appearance: textfield; }
        .filter-menu-item.active .dpt-spin-btn,
        .filter-menu-item.active .dpt-spin-input { color: hsl(var(--foreground)); }

        /* View selector (Pohľady) */
        .view-select { position: relative; display: inline-block; }
        .view-select-trigger { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; min-width: 180px; }
        .view-select-trigger:hover { border-color: #BFBFBF; }
        .view-select.open .view-select-trigger { border-color: hsl(var(--primary)); }
        .view-select-icon { width: 16px; height: 16px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
        .view-select-label { flex: 1; text-align: left; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
        .view-select-chevron { width: 14px; height: 14px; color: hsl(var(--muted-foreground)); transition: transform 0.15s ease; flex-shrink: 0; }
        .view-select.open .view-select-chevron { transform: rotate(180deg); }
        .view-menu { position: fixed; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 10px; z-index: 700; min-width: 260px; max-width: 320px; display: none; }
        .view-menu.open { display: block; }
        .view-search-wrap { position: relative; margin-bottom: 10px; }
        .view-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: hsl(var(--muted-foreground)); pointer-events: none; }
        .view-search { width: 100%; height: 36px; padding: 0 32px 0 32px; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 13px; background: #FFFFFF; outline: none; color: hsl(var(--foreground)); }
        .view-search:focus { border-color: hsl(var(--primary)); }
        .view-search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 3px; }
        .view-search-clear:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .view-search-clear svg { width: 12px; height: 12px; }
        .view-list { max-height: 280px; overflow: auto; margin-bottom: 8px; border-bottom: 1px solid hsl(var(--border)); padding-bottom: 8px; }
        .view-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
        .view-item:hover { background: #F4F4F4; }
        .view-item.active { background: #F4F4F4; }
        .view-item-icon { width: 18px; height: 18px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
        .view-item-body { flex: 1; min-width: 0; }
        .view-item-name { font-size: 14px; font-weight: 500; color: hsl(var(--foreground)); line-height: 1.2; }
        .view-item-meta { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
        .view-item-more { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 3px; flex-shrink: 0; }
        .view-item-more:hover { background: rgba(0,0,0,0.08); color: hsl(var(--foreground)); }
        .view-item-more svg { width: 14px; height: 14px; }
        .view-add-btn { width: 100%; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border: none; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; }
        .view-add-btn:hover { opacity: 0.9; }

        /* Column visibility panel (opened from toolbar icon) */
        .colvis-panel { position: fixed; top: 0; left: 0; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 700; width: 280px; max-height: 480px; display: none; flex-direction: column; overflow: hidden; }
        .colvis-panel.open { display: flex; }
        .colvis-panel .colvis-scroll { flex: 1; overflow: auto; padding: 12px; min-height: 0; }
        .colvis-panel .colvis-foot { flex-shrink: 0; padding: 10px 12px; border-top: 1px solid hsl(var(--border)); background: #FFFFFF; border-radius: 0 0 8px 8px; }
        .colvis-search-wrap { position: relative; margin-bottom: 10px; }
        .colvis-tree { display: flex; flex-direction: column; gap: 4px; }
        .colvis-node { display: flex; align-items: center; gap: 8px; padding: 6px 6px; font-size: 13px; border-radius: 4px; cursor: pointer; }
        .colvis-node:hover { background: #F4F4F4; }
        .colvis-node.indent-1 { padding-left: 16px; }
        .colvis-node.indent-2 { padding-left: 32px; }
        .colvis-node-cat { font-weight: 600; }

        /* Modal (view settings) */
        /* ============================================================================
           Z-INDEX HIERARCHIA (čítaj zhora nadol — vyššia hodnota = vyššia vrstva)
           30000  Toast notifications (non-blocking, top-right)
           20000  Systémové modály (mAlert / mConfirm / mPrompt — MUSIA byť nad všetkým)
           10500  pol-page (Policy editor — nad permissions-page)
           10002  AI panel (chat + artifacts)
           10001  AI FAB (dostupný na každej obrazovke)
            9999  Detail modal .maximized (fullscreen nad všetkým okrem AI + systémových modálov)
            5000+ Scenario builder sub-overlays (metrics, code editor)
            3000  Dashboard builder / DBE widget modal
            2500  Solution wizard
            2000  Rich-text editor full-screen overlay
            1000  fs-overlay, company-settings (Profile, DŠ editor, Oprávnenia, Dokumentácia, …)
             500  Detail modal layer (floating detail modals nad bázou)
             200  Detail modal nad inline panel
             150  permissions-save-bar, misc floating bars
             120  user-menu, gear-menu, company-switcher
             100  dropdowns, popovers, nav-menu
             ≤50  base UI (sidebar, tabbar)
           ============================================================================ */
        .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.42); z-index: 20000; display: none; align-items: flex-start; justify-content: center; overflow: auto; padding: 40px 16px; }
        .modal-overlay.open { display: flex; }
        .modal { background: #FFFFFF; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,0.25); width: 100%; max-width: 1040px; display: flex; flex-direction: column; max-height: calc(100vh - 80px); }
        .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px 12px; }
        .modal-title { font-size: 18px; font-weight: 700; color: hsl(var(--foreground)); }
        .modal-close { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 4px; }
        .modal-close:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .modal-tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid hsl(var(--border)); }
        .modal-tab { padding: 8px 14px; background: transparent; border: none; font-size: 13px; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 6px 6px 0 0; position: relative; top: 1px; }
        .modal-tab:hover { color: hsl(var(--foreground)); }
        .modal-tab.active { background: #F4F4F4; color: hsl(var(--foreground)); font-weight: 500; border: 1px solid hsl(var(--border)); border-bottom-color: transparent; }
        .modal-body { padding: 16px 20px; overflow: auto; flex: 1; }
        .modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid hsl(var(--border)); }
        /* Modulario dialog (alert / confirm / prompt replacement) */
        .m-dialog .m-dialog-message { font-size: 13px; color: #2D2D2D; line-height: 1.5; white-space: pre-line; }
        .sh-btn.sh-btn-danger { background: #C63310; color: #FFFFFF; border-color: #C63310; }
        .sh-btn.sh-btn-danger:hover { background: #9E2810; border-color: #9E2810; }
        .tab-panel { display: none; }
        .tab-panel.active { display: block; }

        .form-section { margin-bottom: 24px; }
        .form-section-title { font-size: 14px; font-weight: 700; color: hsl(var(--foreground)); margin-bottom: 14px; }
        .form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
        .form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; }
        .form-checkboxes-row { display: flex; align-items: center; gap: 24px; padding-top: 4px; border-top: 1px solid hsl(var(--border)); margin-top: 4px; padding-top: 14px; }
        .form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
        .form-field label { font-size: 12px; color: hsl(var(--foreground)); font-weight: 500; }
        .form-field .req { color: hsl(var(--destructive)); margin-left: 2px; }
        .form-field .adv-select, .form-field .adv-select-trigger { width: 100%; }
        .form-field .adv-select-trigger { height: 40px; padding: 0 32px 0 12px; font-size: 13px; }
        .form-field .adv-select-chevron { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
        .form-field .adv-select-trigger { position: relative; }
        .form-field .sh-input { height: 40px; font-size: 13px; }

        /* Multiselect (chips + dropdown) */
        .multi-select { position: relative; display: block; }
        .multi-trigger { min-height: 40px; padding: 4px 32px 4px 8px; border: 1px solid hsl(var(--border)); border-radius: 4px; background: #FFFFFF; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; position: relative; width: 100%; }
        .multi-trigger:hover { border-color: #BFBFBF; }
        .multi-select.open .multi-trigger { border-color: hsl(var(--primary)); }
        .multi-trigger .multi-placeholder { color: hsl(var(--muted-foreground)); font-size: 13px; }
        .multi-chevron { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; color: hsl(var(--muted-foreground)); pointer-events: none; }
        .multi-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 2px 8px; background: #F4F4F4; border-radius: 3px; font-size: 12px; color: hsl(var(--foreground)); }
        .multi-chip button { border: none; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; width: 14px; height: 14px; border-radius: 2px; }
        .multi-chip button:hover { background: rgba(0,0,0,0.08); color: hsl(var(--foreground)); }
        .multi-menu { position: fixed; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,0.12); padding: 4px; z-index: 110; min-width: 160px; max-height: 260px; overflow: auto; display: none; }
        .multi-select.open .multi-menu { display: block; }
        .multi-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; border-radius: 4px; }
        .multi-item:hover { background: #F4F4F4; }
        .multi-item input { pointer-events: none; }
        .form-readonly-value { font-size: 13px; color: hsl(var(--muted-foreground)); padding: 6px 0; }
        .form-checkbox-row { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; padding: 6px 0; }
        .dse-fml-pill { padding: 3px 10px; font-size: 12px; border-radius: 14px; background: #E8F0FE; color: #1967D2; border: 1px solid #C5D8FA; cursor: pointer; white-space: nowrap; }
        .dse-fml-pill:hover { background: #C5D8FA; }
        .dse-fml-fn { background: #F3E8FF; color: #7C3AED; border-color: #DDD6FE; }
        .dse-fml-fn:hover { background: #DDD6FE; }
        .dse-fml-const { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
        .dse-fml-const:hover { background: #FDE68A; }
        .dse-fml-op { padding: 3px 10px; font-size: 13px; font-weight: 600; border-radius: 6px; background: #F4F4F4; color: #2D2D2D; border: 1px solid hsl(var(--border)); cursor: pointer; }
        .dse-fml-op:hover { background: #E8E8E8; }
        .dse-fml-token { padding: 2px 8px; font-size: 12px; border-radius: 12px; background: #2D2D2D; color: #fff; display: inline-flex; align-items: center; gap: 4px; }
        .dse-fml-token-op { background: transparent; color: #6b7280; font-weight: 600; font-size: 13px; padding: 2px 2px; }
        .form-checkboxes .form-checkbox-row { padding: 4px 0; }

        /* More-actions dropdown (toolbar "...") */
        .actions-menu { position: fixed; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 6px; z-index: 65; min-width: 220px; display: none; }
        .actions-menu.open { display: block; }
        .actions-menu-header { padding: 8px 10px 6px; font-size: 11px; color: hsl(var(--muted-foreground)); font-weight: 500; border-bottom: 1px solid hsl(var(--border)); margin-bottom: 4px; }
        .actions-menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; }
        .actions-menu-item:hover { background: #F4F4F4; }
        .actions-menu-item.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
        .actions-menu-item.active .actions-menu-icon { color: hsl(var(--primary-foreground)); }
        .actions-menu-icon { width: 16px; height: 16px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }

        /* Data structure info modal */
        .info-grid { display: flex; flex-direction: column; }
        .info-row { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid hsl(var(--border)); font-size: 13px; align-items: baseline; }
        .info-row:last-child { border-bottom: none; }
        .info-k { color: hsl(var(--muted-foreground)); font-weight: 500; }
        .info-v { color: hsl(var(--foreground)); }
        .info-v code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; background: #F4F4F4; padding: 1px 6px; border-radius: 3px; color: hsl(var(--foreground)); }
        .info-muted { color: hsl(var(--muted-foreground)); }

        /* Export modal — small dialog */
        .modal-overlay.modal-sm .modal { max-width: 520px; }
        .export-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
        .export-field > label { font-size: 12px; color: hsl(var(--foreground)); font-weight: 500; }
        .export-field .adv-select, .export-field .adv-select-trigger { width: 100%; }
        .export-field .adv-select-trigger { height: 40px; padding: 0 32px 0 12px; font-size: 13px; position: relative; }
        .export-field .adv-select-chevron { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
        .export-multi { border: 1px solid hsl(var(--border)); border-radius: 4px; max-height: 240px; overflow: auto; padding: 6px; background: #FFFFFF; }
        .export-multi .export-multi-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 3px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; }
        .export-multi .export-multi-row:hover { background: #F4F4F4; }
        .export-multi .export-multi-row.header { border-bottom: 1px solid hsl(var(--border)); margin-bottom: 4px; padding-bottom: 8px; font-weight: 500; }
        .export-question { font-size: 13px; color: hsl(var(--foreground)); margin-bottom: 14px; }

        /* Detail record panel (split mode) — overlays the view without shrinking the table. */
        .detail-panel { position: absolute; top: 0; bottom: 0; right: 0; width: 560px; min-width: 360px; max-width: 90vw; background: #FFFFFF; border-left: 1px solid hsl(var(--border)); display: none; flex-direction: column; overflow: hidden; box-shadow: -4px 0 16px rgba(0,0,0,0.08); z-index: 100; }
        .view-host.split .detail-panel { display: flex; }
        /* When split panel is open, shrink the table view so it doesn't extend under the panel */
        .view-host.split #view-table { right: var(--dp-w, 560px); }
        .detail-resizer { position: absolute; left: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 10; user-select: none; }
        .detail-resizer::after { content: ''; position: absolute; left: 3px; top: 0; bottom: 0; width: 1px; background: transparent; transition: background 0.15s ease; }
        .detail-resizer:hover::after,
        .detail-resizer.dragging::after { background: hsl(var(--primary)); }
        body.detail-resizing, body.detail-resizing * { cursor: col-resize !important; user-select: none !important; }

        /* DS editor (Atribúty / Layout / Udalosti / Rovnice / Oprávnenia / História) */
        /* Minimal mode — applies to fs-overlay AND company-settings, hides legacy sidebar + header */
        .fs-overlay.minimal .cs-head,
        .fs-overlay.minimal .cs-sidebar,
        .company-settings.minimal .cs-head,
        .company-settings.minimal .cs-sidebar { display: none; }
        .fs-overlay.minimal .cs-body,
        .company-settings.minimal .cs-body { grid-template-columns: 1fr; height: 100%; }
        .fs-overlay.minimal .cs-main,
        .company-settings.minimal .cs-main { padding: 28px 32px; overflow: auto; background: #FFFFFF; }
        .fs-overlay.minimal .cs-page:not(.active),
        .company-settings.minimal .cs-page:not(.active) { display: none; }

        /* Standalone "Atribúty" top breadcrumb strip */
        .ds-ss-strip { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 18px; }
        .ds-ss-crumbs { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: hsl(var(--muted-foreground)); }
        .ds-ss-crumbs .ds-ss-crumb-sep { color: #BFBFBF; }
        .ds-ss-crumbs strong { color: hsl(var(--foreground)); font-weight: 600; }
        .ds-ss-close { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid hsl(var(--border)); border-radius: 6px; cursor: pointer; color: hsl(var(--foreground)); }
        .ds-ss-close:hover { background: #F4F4F4; }
        .ds-ss-close svg { width: 14px; height: 14px; }

        /* Attribute spreadsheet — matches SVG design "Správa DŠ - Atribúty" */
        .ds-ss-toolbar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px 8px 0 0; border-bottom: none; }
        .ds-ss-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid hsl(var(--border)); background: #FFFFFF; color: hsl(var(--foreground)); border-radius: 6px; cursor: pointer; flex-shrink: 0; position: relative; }
        .ds-ss-btn:hover { border-color: #BFBFBF; background: #FAFAFA; }
        .ds-ss-btn svg { width: 14px; height: 14px; }
        .ds-ss-btn.primary { background: #2D2D2D; color: #FFFFFF; border-color: #2D2D2D; }
        .ds-ss-btn.primary:hover { background: #000000; color: #FFFFFF; }
        .ds-ss-btn.with-label { width: auto; padding: 0 10px; gap: 6px; font-size: 12px; font-weight: 500; }
        .ds-ss-btn .ds-ss-badge { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; font-size: 10px; color: hsl(var(--muted-foreground)); display: inline-flex; align-items: center; justify-content: center; font-weight: 500; }
        .ds-ss-breadcrumb { font-size: 14px; font-weight: 700; padding: 0 8px; color: hsl(var(--foreground)); }
        .ds-ss-search { height: 32px; padding: 0 10px; border: 1px solid hsl(var(--border)); border-radius: 6px; background: #FFFFFF; font-size: 12px; color: hsl(var(--foreground)); min-width: 140px; max-width: 200px; outline: none; flex: 1; }
        .ds-ss-search:focus { border-color: hsl(var(--primary)); }
        .ds-ss { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 0 0 8px 8px; overflow: hidden; }
        .ds-ss-grid { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
        .ds-ss-grid colgroup col.col-cb { width: 40px; }
        .ds-ss-grid colgroup col.col-drag { width: 32px; }
        .ds-ss-grid colgroup col.col-type { width: 190px; }
        .ds-ss-grid colgroup col.col-key { width: 170px; }
        .ds-ss-grid colgroup col.col-flags { width: 220px; }
        .ds-ss-grid colgroup col.col-act { width: 80px; }
        .ds-ss-grid thead th { background: #DBDBDB; color: #2D2D2D; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; text-align: left; padding: 8px 12px; border-right: 1px solid #EDEDED; border-bottom: 1px solid #EDEDED; }
        .ds-ss-grid thead tr.ds-ss-filter th { background: #F4F4F4; padding: 6px 12px; border-bottom: 1px solid #EDEDED; }
        .ds-ss-grid thead th:last-child { border-right: none; }
        .ds-ss-grid tbody tr { background: #FFFFFF; }
        .ds-ss-grid tbody tr.ds-ss-group { background: #EDEDED; cursor: pointer; }
        .ds-ss-grid tbody tr.ds-ss-group td { padding: 8px 12px; font-weight: 700; color: #2D2D2D; border-bottom: 1px solid #DBDBDB; }
        .ds-ss-grid tbody tr.ds-ss-group .ds-ss-caret { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: middle; transition: transform 0.15s ease; }
        .ds-ss-grid tbody tr.ds-ss-group.collapsed .ds-ss-caret { transform: rotate(-90deg); }
        .ds-ss-grid tbody tr.ds-ss-group .ds-ss-count { margin-left: 8px; padding: 1px 6px; background: #FFFFFF; border: 1px solid #BFBFBF; border-radius: 10px; font-size: 10px; font-weight: 500; color: #707071; }
        .ds-ss-grid tbody tr.ds-ss-row:hover { background: #F9F4E1; }
        .ds-ss-grid tbody td { padding: 8px 12px; border-bottom: 1px solid #EFEFEF; vertical-align: middle; }
        .ds-ss-grid td.ds-ss-cb { text-align: center; padding: 8px 0; }
        .ds-ss-grid td.ds-ss-cb .sh-checkbox { margin: 0; }
        .ds-ss-drag { color: #707071; cursor: grab; user-select: none; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; letter-spacing: 1px; }
        .ds-ss-type-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; background: #F4F4F4; border: 1px solid #DBDBDB; border-radius: 5px; font-size: 12px; color: #2D2D2D; font-weight: 500; width: 100%; }
        .ds-ss-type-chip .ds-ss-type-ic { width: 18px; height: 18px; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(45,45,45,0.08); }
        .ds-ss-type-chip .ds-ss-type-ic svg { width: 12px; height: 12px; }
        .ds-ss-type-chip.relation .ds-ss-type-ic { background: rgba(59,202,239,0.14); color: #2588A8; }
        .ds-ss-type-chip.enum .ds-ss-type-ic { background: rgba(232,178,45,0.18); color: #B08218; }
        .ds-ss-type-chip.number .ds-ss-type-ic { background: rgba(42,182,125,0.14); color: #1E8A5D; }
        .ds-ss-type-chip.date .ds-ss-type-ic { background: rgba(59,202,239,0.14); color: #2588A8; }
        .ds-ss-type-chip.priority .ds-ss-type-ic { background: rgba(212,55,17,0.14); color: #C63310; }
        .ds-ss-type-chip.computed .ds-ss-type-ic { background: rgba(232,178,45,0.18); color: #B08218; }
        .ds-ss-type-chip.richtext .ds-ss-type-ic { background: rgba(42,182,125,0.14); color: #1E8A5D; }
        .ds-ss-type-chip.boolean .ds-ss-type-ic { background: rgba(212,55,17,0.1); color: #C63310; }
        .ds-ss-type-chip.attachment .ds-ss-type-ic { background: rgba(45,45,45,0.08); color: #555; }
        .ds-ss-type-chip.image .ds-ss-type-ic { background: rgba(59,202,239,0.14); color: #2588A8; }
        .ds-ss-type-chip.multiselect .ds-ss-type-ic { background: rgba(232,178,45,0.18); color: #B08218; }
        .ds-ss-type-chip.url .ds-ss-type-ic { background: rgba(42,182,125,0.14); color: #1E8A5D; }
        .ds-ss-type-chip.color .ds-ss-type-ic { background: rgba(212,55,17,0.1); color: #C63310; }
        .ds-ss-type-chip.rating .ds-ss-type-ic { background: rgba(232,178,45,0.18); color: #B08218; }
        .ds-ss-type-chip.group .ds-ss-type-ic { background: rgba(59,202,239,0.14); color: #2588A8; }
        .ds-ss-type-chip .ds-ss-chev { margin-left: auto; color: hsl(var(--muted-foreground)); }
        .ds-ss-type-chip .ds-ss-chev svg { width: 10px; height: 10px; }
        .ds-ss-name { font-size: 12px; font-weight: 500; color: #2D2D2D; }
        .ds-ss-key { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: #707071; background: #F4F4F4; padding: 2px 6px; border-radius: 3px; display: inline-block; }
        .ds-ss-flags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
        .ds-ss-flag { padding: 2px 6px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 3px; }
        .ds-ss-flag.req { background: rgba(212,55,17,0.12); color: #C63310; }
        .ds-ss-flag.uniq { background: rgba(59,202,239,0.14); color: #2588A8; }
        .ds-ss-flag.ro { background: rgba(232,178,45,0.14); color: #B08218; }
        .ds-ss-flag.hid { background: #F4F4F4; color: #707071; }
        .ds-ss-actions { display: inline-flex; gap: 2px; }
        .ds-ss-actions button { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: none; color: #707071; cursor: pointer; border-radius: 3px; }
        .ds-ss-actions button:hover { background: #EDEDED; color: #2D2D2D; }
        .ds-ss-actions button svg { width: 12px; height: 12px; }
        .ds-ss-pager { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid #EDEDED; background: #FAFAFA; font-size: 11px; color: #707071; }
        .ds-ss-pager-nav { display: inline-flex; align-items: center; gap: 2px; }
        .ds-ss-pager button { min-width: 24px; height: 24px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: #2D2D2D; border-radius: 3px; cursor: pointer; font-size: 11px; }
        .ds-ss-pager button:hover:not(:disabled) { background: #EDEDED; }
        .ds-ss-pager button.active { background: #2D2D2D; color: #FFFFFF; }
        .ds-ss-pager button:disabled { opacity: 0.35; }
        .ds-ss-pager button svg { width: 10px; height: 10px; }
        .ds-ss-pager-size { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid #DBDBDB; border-radius: 3px; background: #FFFFFF; cursor: pointer; color: #2D2D2D; }
        .ds-ss-pager-count { margin-left: auto; }

        /* ====== Redesigned DS editor (minimal-mode "Upraviť dátovú štruktúru") ====== */
        .fs-overlay.minimal#ds-editor-page { background: #FFFFFF; }
        .fs-overlay.minimal .cs-body { position: relative; }
        .fs-overlay.minimal .cs-main { padding: 18px 16px 24px; overflow: auto; background: #FFFFFF; }
        /* DS editor minimal — stránka sa nescrolluje, iba tabuľka atribútov/udalostí */
        #ds-editor-page.minimal .cs-main { overflow: hidden; display: flex; flex-direction: column; }
        #ds-editor-page.minimal .cs-page.active { flex: 1; min-height: 0; overflow: auto; }
        #ds-editor-page.minimal .cs-page[data-page="attrs"].active,
        #ds-editor-page.minimal .cs-page[data-page="events"].active,
        #ds-editor-page.minimal .cs-page[data-page="equations"].active,
        #ds-editor-page.minimal .cs-page[data-page="views"].active,
        #ds-editor-page.minimal .cs-page[data-page="api-methods"].active { display: flex; flex-direction: column; overflow: hidden; }
        #ds-editor-page.minimal .dse-view[data-minimal-only] { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
        #ds-editor-page.minimal .dse-table-wrap { flex: 1; min-height: 0; }
        /* Hide legacy strip/toolbar/pager inside the new minimal layout */
        .fs-overlay.minimal .ds-ss-strip,
        .fs-overlay.minimal .cs-page[data-page="attrs"] .ds-ss-toolbar,
        .fs-overlay.minimal .cs-page[data-page="attrs"] .ds-ss { display: none; }
        /* In minimal mode, hide all legacy content in events and privacy pages — show only .dse-view */
        .fs-overlay.minimal .cs-page[data-page="events"] > :not(.dse-view),
        .fs-overlay.minimal .cs-page[data-page="privacy"] > :not(.dse-view) { display: none !important; }
        /* Toggle new-layout-only elements */
        [data-minimal-only] { display: none; }
        .fs-overlay.minimal [data-minimal-only] { display: block; }
        .fs-overlay.minimal .dse-topbar[data-minimal-only] { display: block; }
        /* Company settings (`.company-settings.minimal`) používa rovnaký pattern ako .fs-overlay.minimal,
           takže aj jeho data-minimal-only elementy musia byť viditeľné (inak sa nezobrazí topbar, × a save footer). */
        .company-settings.minimal [data-minimal-only] { display: block; }
        .company-settings.minimal .dse-topbar[data-minimal-only] { display: block; }
        /* Všetky dropdowny v .cs-field (regionálne nastavenia, forma firmy atď.) — roztiahnuť
           trigger na plnú šírku poľa, aby nevznikal prázdny white-space napravo. */
        .cs-field .adv-select, .cs-field .adv-select-trigger { width: 100%; }
        .cs-field .multi-select, .cs-field .multi-select-trigger { width: 100%; }
        /* Kompaktnejší layout v DS nastaveniach — menšie paddings, kompaktné inputy,
           aby sa viac polí zmestilo na obrazovku a používateľ nemusel toľko scrollovať. */
        #ds-editor-page .cs-page[data-page="visual-editor"].active { display: flex; }
        #ds-editor-page.minimal .cs-page[data-page="visual-editor"].active { flex: 1; min-height: 0; overflow: hidden; }
        #ds-editor-page .cs-page[data-page="settings"] .cs-card { padding: 12px 14px; margin-bottom: 10px; }
        #ds-editor-page .cs-page[data-page="settings"] .cs-card-title { font-size: 13px; margin-bottom: 8px; }
        #ds-editor-page .cs-page[data-page="settings"] .cs-grid-2,
        #ds-editor-page .cs-page[data-page="settings"] .cs-grid-3 { gap: 8px 12px !important; }
        #ds-editor-page .cs-page[data-page="settings"] .cs-field { margin-bottom: 0; }
        #ds-editor-page .cs-page[data-page="settings"] .cs-field label { font-size: 11.5px; margin-bottom: 3px; }
        #ds-editor-page .cs-page[data-page="settings"] .cs-field .sh-input,
        #ds-editor-page .cs-page[data-page="settings"] .cs-field input.sh-input { height: 30px; padding: 4px 8px; font-size: 12.5px; }
        #ds-editor-page .cs-page[data-page="settings"] .cs-field textarea.sh-input { min-height: 48px; padding: 6px 8px; font-size: 12.5px; }
        #ds-editor-page .cs-page[data-page="settings"] .cs-field .adv-select-trigger { height: 30px; padding: 0 24px 0 8px; font-size: 12.5px; }
        #ds-editor-page .cs-page[data-page="settings"] .form-checkbox-row { padding: 2px 0; font-size: 12.5px; }
        #ds-editor-page .cs-page[data-page="settings"] .cs-row { padding: 6px 0; }
        #ds-editor-page .cs-page[data-page="settings"] .info-row { padding: 6px 0; font-size: 12px; }
        /* Zjednotený layout: Dátové štruktúry — skryjeme pôvodný head + sidebar, horné taby sú jediná navigácia */
        #data-structures-page > .cs-head { display: none; }
        #data-structures-page .cs-body > .cs-sidebar.fs-sidebar { display: none; }
        #data-structures-page .dse-topbar[data-minimal-only] { padding: 20px 24px 0 !important; margin-bottom: 0 !important; background: #FFFFFF; }
        html[data-theme="dark"] #data-structures-page .dse-topbar[data-minimal-only] { background: #16181C; }
        #data-structures-page .dse-topbar .dse-header-actions { z-index: 2; }
        #data-structures-page .dse-title { padding-right: 48px; }
        /* DS editor must appear above data-structures-page (same z-index 1000, but editor is earlier in DOM) */
        #ds-editor-page { z-index: 1002; }
        /* DS management — slide-in detail panel */
        .ds-mgmt-detail { position: absolute; right: 0; top: 0; bottom: 0; width: 340px; background: #FFFFFF; border-left: 1px solid #EDEDED; box-shadow: -6px 0 20px rgba(0,0,0,0.08); z-index: 10; display: flex; flex-direction: column; overflow: hidden; transform: translateX(100%); transition: transform 0.2s ease; }
        .ds-mgmt-detail.open { transform: translateX(0); }
        .ds-mgmt-detail-head { padding: 16px 16px 12px; border-bottom: 1px solid #EDEDED; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
        .ds-mgmt-detail-icon { width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .ds-mgmt-detail-icon svg { width: 18px; height: 18px; }
        .ds-mgmt-detail-name { font-size: 14px; font-weight: 600; color: #0B0B0C; line-height: 1.3; }
        .ds-mgmt-detail-cat { font-size: 11.5px; color: #707071; margin-top: 2px; }
        .ds-mgmt-detail-close { margin-left: auto; width: 28px; height: 28px; border: none; background: transparent; cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #707071; flex-shrink: 0; }
        .ds-mgmt-detail-close:hover { background: #EFEFEF; color: #0B0B0C; }
        .ds-mgmt-detail-close svg { width: 16px; height: 16px; }
        .ds-mgmt-detail-stats { padding: 12px 16px; border-bottom: 1px solid #EDEDED; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; flex-shrink: 0; }
        .ds-mgmt-stat { background: #F8F8F8; border: 1px solid #EBEBEB; border-radius: 6px; padding: 8px 6px; text-align: center; }
        .ds-mgmt-stat-val { font-size: 18px; font-weight: 700; color: #0B0B0C; line-height: 1; }
        .ds-mgmt-stat-label { font-size: 10px; color: #707071; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.03em; }
        .ds-mgmt-detail-info { padding: 12px 16px; border-bottom: 1px solid #EDEDED; display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
        .ds-mgmt-info-row { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
        .ds-mgmt-info-label { color: #707071; min-width: 76px; flex-shrink: 0; }
        .ds-mgmt-info-val { color: #0B0B0C; font-weight: 500; }
        .ds-mgmt-detail-actions { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
        .dse-table tbody tr.dse-row-selected td { background: #FFFBEE !important; }
        html[data-theme="dark"] .ds-mgmt-detail { background: #1E2026; border-left-color: #2D3038; box-shadow: -6px 0 20px rgba(0,0,0,0.3); }
        html[data-theme="dark"] .ds-mgmt-detail-head,
        html[data-theme="dark"] .ds-mgmt-detail-stats,
        html[data-theme="dark"] .ds-mgmt-detail-info { border-bottom-color: #2D3038; }
        html[data-theme="dark"] .ds-mgmt-stat { background: #252830; border-color: #2D3038; }
        html[data-theme="dark"] .ds-mgmt-detail-name,
        html[data-theme="dark"] .ds-mgmt-stat-val,
        html[data-theme="dark"] .ds-mgmt-info-val { color: #FFFFFF; }
        html[data-theme="dark"] .ds-mgmt-detail-cat,
        html[data-theme="dark"] .ds-mgmt-stat-label,
        html[data-theme="dark"] .ds-mgmt-info-label { color: #9A9B9D; }
        html[data-theme="dark"] .ds-mgmt-detail-close:hover { background: #2D3038; color: #FFFFFF; }
        html[data-theme="dark"] .dse-table tbody tr.dse-row-selected td { background: #2A2400 !important; }
        /* Nastavenia firmy — hybridný layout: top-level karty (Firma/Ľudia/Bezpečnosť/Pokročilé)
           v .dse-topbar + sub-kategórie zostávajú v ľavom sidebare filterované podľa aktívnej karty. */
        #company-settings > .cs-head { display: none; }
        #company-settings .dse-topbar[data-minimal-only] { padding: 20px 24px 0 !important; margin-bottom: 0 !important; background: #FFFFFF; }
        #company-settings .cs-body { flex: 1; min-height: 0; }
        /* Sticky save footer */
        .cs-save-footer-bar { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 24px; border-top: 1px solid hsl(var(--border)); background: #FFFFFF; flex-shrink: 0; }
        html[data-theme="dark"] .cs-save-footer-bar { background: #16181C; border-color: #2A2D35; }
        html[data-theme="dark"] #company-settings .dse-topbar[data-minimal-only] { background: #16181C; }
        .fs-overlay.minimal .dse-view[data-minimal-only] { display: block; }
        .fs-overlay.minimal .dse-save-wrap[data-minimal-only] { display: block; }

        .dse-topbar { position: relative; margin-bottom: 28px; }
        #ds-editor-page .dse-topbar { margin-bottom: 8px; }
        #ds-editor-page.minimal .cs-main { padding-top: 8px; }
        #company-settings { background: #FFFFFF; }
        /* Save footer in minimal mode: restore flex display (overrides [data-minimal-only]:{display:block}) */
        .fs-overlay.minimal .cs-save-footer-bar[data-minimal-only],
        .company-settings.minimal .cs-save-footer-bar[data-minimal-only] { display: flex; justify-content: flex-end; }
        /* Checkbox: lock dimensions so check/uncheck doesn't cause 1px layout shift */
        .form-checkbox-row input[type="checkbox"],
        .form-checkbox-row .sh-checkbox { flex-shrink: 0; width: 15px; height: 15px; margin: 0; vertical-align: middle; }
        .dse-header-actions { position: absolute; top: 0; right: 0; display: inline-flex; gap: 4px; align-items: center; }
        .dse-hdr-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: #707071; border-radius: 6px; cursor: pointer; }
        .dse-hdr-btn:hover { background: #F4F4F4; color: #0B0B0C; }
        .dse-hdr-btn svg { width: 18px; height: 18px; }

        /* Názov podstránky — menšia veľkosť, karty idú pod ním (nie vedľa). Referenčný vzor: modal "Upraviť pohľad". */
        .dse-title { font-size: 20px; font-weight: 700; color: #0B0B0C; letter-spacing: -0.01em; margin: 0 0 12px; display: flex; align-items: baseline; gap: 8px; }
        .dse-title .dse-title-sep { color: #BFBFBF; font-weight: 600; }
        /* Nadpis + popis podstránky a popisy sekcií (cs-card-desc) sú vo všetkých podstránkach
           duplicitné / zbytočné — tab názov + názov karty samé o sebe stačí.
           `.cs-card-desc` obsahuje aj prípadné odkazy/linky, skryjú sa spolu. */
        .fs-overlay .cs-page > .cs-page-title,
        .fs-overlay .cs-page > .cs-page-sub,
        .company-settings .cs-page > .cs-page-title,
        .company-settings .cs-page > .cs-page-sub,
        .cs-card-desc { display: none; }
        /* Karty sú POD názvom — rovnaký vzor ako `.modal-tabs` v modáli "Upraviť pohľad":
           tenký spodný border cez celý riadok, aktívny tab má biely fill + border ktorý sa
           vizuálne spája s panelom pod ním (border-bottom-color: transparent). */
        .dse-tabs { display: flex; gap: 4px; padding: 0; border: none; border-bottom: 1px solid hsl(var(--border)); background: transparent; margin: 0 0 4px; }
        .dse-tab { padding: 8px 14px; background: transparent; border: none; font-size: 13px; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 6px 6px 0 0; position: relative; top: 1px; line-height: 1.2; }
        .dse-tab:hover { color: hsl(var(--foreground)); }
        .dse-tab.active { background: #F4F4F4; color: hsl(var(--foreground)); font-weight: 500; border: 1px solid hsl(var(--border)); border-bottom-color: transparent; }
        /* Modály otvárané z DS editora (fs-overlay z-index 1000) musia byť nad ním — inak
           ich fs-overlay zakryje a užívateľ ich uvidí až po zatvorení editora. */
        #dse-layout-modal,
        #dse-add-modal,
        #dse-edit-attr-modal,
        #dse-event-modal,
        #info-modal-overlay,
        #ds-info-modal,
        #company-add-attr-modal { z-index: 1200; }

        .dse-toolbar { display: flex; align-items: center; gap: 6px; margin: 4px 0 10px; }
        .dse-cat-strip { display: flex; align-items: flex-end; gap: 0; padding-bottom: 0; border-bottom: 1px solid hsl(var(--border)); margin-bottom: 12px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
        .dse-cat-strip::-webkit-scrollbar { display: none; }
        .dse-cat-tab { display: inline-flex; align-items: center; gap: 3px; padding: 8px 14px; border: none; border-radius: 0; font-size: 13px; font-weight: 400; color: hsl(var(--muted-foreground)); background: transparent; cursor: pointer; white-space: nowrap; transition: color 0.12s; border-radius: 6px 6px 0 0; position: relative; top: 1px; line-height: 1.2; }
        .dse-cat-tab:hover { color: hsl(var(--foreground)); }
        .dse-cat-tab.active { background: #F4F4F4; color: hsl(var(--foreground)); font-weight: 500; border: 1px solid hsl(var(--border)); border-bottom-color: transparent; }
        .dse-cat-tab-edit, .dse-cat-tab-del { display: none; width: 16px; height: 16px; border: none; background: transparent; cursor: pointer; font-size: 11px; border-radius: 3px; padding: 0; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1; }
        .dse-cat-tab:hover .dse-cat-tab-edit, .dse-cat-tab:hover .dse-cat-tab-del { display: inline-flex; color: hsl(var(--muted-foreground)); }
        .dse-cat-tab:hover .dse-cat-tab-edit:hover { background: rgba(0,0,0,0.08); color: hsl(var(--foreground)); }
        .dse-cat-tab:hover .dse-cat-tab-del:hover { background: rgba(212,55,17,0.12); color: #C63310; }
        .dse-cat-tab.active .dse-cat-tab-edit { display: inline-flex; color: hsl(var(--muted-foreground)); }
        .dse-cat-tab.active .dse-cat-tab-edit:hover { background: rgba(0,0,0,0.08); color: hsl(var(--foreground)); }
        .dse-cat-tab.active .dse-cat-tab-del { display: inline-flex; color: hsl(var(--muted-foreground)); }
        .dse-cat-tab.active .dse-cat-tab-del:hover { background: rgba(212,55,17,0.12); color: #C63310; }
        .dse-cat-add-btn { width: 26px; height: 26px; border: 1px dashed hsl(var(--border)); border-radius: 6px; background: transparent; cursor: pointer; font-size: 15px; color: hsl(var(--muted-foreground)); display: inline-flex; align-items: center; justify-content: center; transition: background 0.12s, border-color 0.12s; margin-left: 2px; flex-shrink: 0; }
        .dse-cat-add-btn:hover { background: #F4F4F4; color: hsl(var(--foreground)); border-style: solid; }
        .dse-toolbar .dse-grow { flex: 1; }
        .dse-ibtn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #DBDBDB; background: #FFFFFF; color: #2D2D2D; border-radius: 6px; cursor: pointer; flex-shrink: 0; }
        .dse-ibtn:hover { background: #F4F4F4; border-color: #BFBFBF; }
        .dse-ibtn.primary { background: #0B0B0C; color: #FFFFFF; border-color: #0B0B0C; }
        .dse-ibtn.primary:hover { background: #000000; }
        .dse-ibtn.active { background: #F4F4F4; border-color: #E8B22D; color: #2D2D2D; box-shadow: inset 0 1px 3px rgba(0,0,0,0.08); }
        .dse-ibtn:disabled { opacity: 0.4; cursor: not-allowed; }
        .dse-ibtn svg { width: 14px; height: 14px; }
        /* Mód úpravy — toggle pill pri atribútoch DŠ */
        .dse-edit-mode-btn[aria-pressed="true"] {
            background: #FFF3D1; border-color: #E8B22D; color: #6F4E0F;
        }
        /* (#2) Podpis používateľa — UI v profile */
        .profile-sig-wrap { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
        .profile-sig-preview {
            width: 260px; height: 92px; background: #FAFAFA; border: 1.5px dashed hsl(var(--border));
            border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden;
            color: #9B9C9D; font-size: 12px; flex-shrink: 0;
        }
        .profile-sig-preview[data-empty="false"] { border-style: solid; border-color: #E8B22D; background: #FFFFFF; }
        .profile-sig-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
        .profile-sig-placeholder { text-align: center; padding: 0 12px; }
        .profile-sig-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
        .profile-sig-usage {
            margin-top: 14px; padding: 10px 12px; background: #FFFBEE; border: 1px solid rgba(232,178,45,0.35);
            border-radius: 6px;
        }
        .profile-sig-usage-head { font-size: 11px; font-weight: 700; color: #6F4E0F; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
        .profile-sig-usage-row { display: grid; grid-template-columns: 160px 170px 1fr; gap: 10px; font-size: 12px; padding: 3px 0; }
        .profile-sig-usage-ds { color: #2D2D2D; font-weight: 500; }
        .profile-sig-usage-attr { color: #6F4E0F; font-family: ui-monospace, Menlo, monospace; }
        .profile-sig-usage-count { color: #707071; font-size: 11px; }
        /* Attribute settings — checkbox "Použiť podpis" (iba pre typ Príloha) */
        .dse-attr-signature-row { display: none; }
        .dse-attr-signature-row.visible { display: block; }
        .dse-edit-mode-btn[aria-pressed="true"] svg { color: #B08218; }
        /* User feedback: "z tabuľky atribútov odstráň riadok kategória, pretože je tam zbytočný —
           kategória je uvedená nad tabuľkou prepínači kariet (dse-cat-tab)."
           → skryjeme všetky `dse-cat-row` grupy v tabuľke atribútov (riadky ako Základné /
           Stav a priorita / Ľudia / …), kategórie zostávajú iba ako taby nad tabuľkou. */
        #ds-editor-page .dse-table .dse-cat-row,
        .cs-page[data-page="attrs"] .dse-table .dse-cat-row { display: none; }
        /* User feedback: "zo vizuálneho editora atribútov odstráň informáciu o veľkosti atribútu
           (12×1, 2×1 …). Je tam zbytočná." Resize handles zostávajú, iba text. */
        .layout-tile .lt-size { display: none !important; }
        /* Pri zapnutom Módu úpravy signalizuj klikateľnosť flagov */
        .dse-table.edit-mode tbody tr:not(.dse-cat-row) td .dse-bool {
            cursor: pointer;
            transition: transform 0.1s ease, box-shadow 0.1s ease;
        }
        .dse-table.edit-mode tbody tr:not(.dse-cat-row) td .dse-bool:hover {
            transform: scale(1.1);
            box-shadow: 0 0 0 2px rgba(232,178,45,0.35);
        }
        /* Ak Mód úpravy NIE JE zapnutý, klik kdekoľvek v riadku (mimo akcií/checkboxu) otvorí nastavenia */
        .dse-table:not(.edit-mode) tbody tr:not(.dse-cat-row):not(.dse-section-row) { cursor: pointer; }
        .dse-table:not(.edit-mode) tbody tr:not(.dse-cat-row):not(.dse-section-row):hover td { background: #FFFBEE; }
        .dse-section-row td { background: #F7F7F8; padding: 6px 12px; font-size: 11px; font-weight: 700; color: #707071; text-transform: uppercase; letter-spacing: 0.06em; border-top: 2px solid #EDEDED; border-bottom: 1px solid #EDEDED; }
        html[data-theme="dark"] .dse-section-row td { background: #1C1E22; color: #9B9C9D; border-color: #2A2D35; }
        .dse-ibtn-pill { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; background: #FFFFFF; border: 1px solid #DBDBDB; border-radius: 6px; cursor: pointer; font-size: 13px; color: #2D2D2D; font-weight: 500; }
        .dse-ibtn-pill:hover { background: #F4F4F4; }
        .dse-ibtn-pill svg { width: 14px; height: 14px; color: #2D2D2D; }
        .dse-ibtn-pill .dse-pill-chev { color: #707071; }
        .dse-ibtn-save { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; background: #0B0B0C; border: 1px solid #0B0B0C; border-radius: 6px; cursor: pointer; font-size: 13px; color: #FFFFFF; font-weight: 500; }
        .dse-ibtn-save:hover { background: #1a1a1a; }
        .dse-ibtn-save svg { width: 14px; height: 14px; }

        .dse-search { position: relative; flex-shrink: 0; }
        .dse-search input { height: 32px; padding: 0 34px 0 12px; border: 1px solid #DBDBDB; border-radius: 6px; font-size: 13px; min-width: 240px; outline: none; background: #FFFFFF; color: #2D2D2D; }
        .dse-search input:focus { border-color: #0B0B0C; }
        .dse-search .dse-search-ic { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #707071; pointer-events: none; }
        .dse-search .dse-search-ic svg { width: 14px; height: 14px; }

        /* ----- Table ----- */
        .dse-table-wrap { border: 1px solid #DBDBDB; border-radius: 8px; overflow: auto; background: #FFFFFF; }
        .dse-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 1440px; }
        .dse-table col.dse-col-cb { width: 44px; }
        .dse-table col.dse-col-name { width: 210px; }
        .dse-table col.dse-col-var { width: 130px; }
        .dse-table col.dse-col-type { width: 200px; }
        .dse-table col.dse-col-flag { width: 100px; }
        .dse-table col.dse-col-eq { width: 170px; }
        .dse-table col.dse-col-w { width: 80px; }
        .dse-table col.dse-col-def { width: 170px; }
        .dse-table col.dse-col-desc { width: 220px; }
        .dse-table col.dse-col-act { width: 110px; }

        .dse-table thead th { background: #FFFFFF; font-weight: 500; color: #2D2D2D; text-align: left; padding: 5px 8px; font-size: 13px; border-right: 1px solid #EDEDED; border-bottom: 1px solid #DBDBDB; white-space: nowrap; vertical-align: middle; }
        .dse-table thead tr.dse-filters th { background: #FFFFFF; padding: 0; border-bottom: 1px solid #DBDBDB; border-right: 1px solid #EDEDED; font-weight: 400; height: 32px; }
        .dse-table thead tr.dse-filters th:focus-within { background: #FAFAFA; }
        .dse-filter-cell { position: relative; display: flex; align-items: center; height: 32px; width: 100%; background: transparent; }
        .dse-filter-cell input { flex: 1; min-width: 0; width: 100%; height: 100%; padding: 0 22px 0 26px; border: none; background: transparent; font-size: 12px; outline: none; color: #2D2D2D; }
        .dse-filter-cell input::placeholder { color: #9B9C9D; }
        .dse-filter-cell .dse-filter-ic { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: #BFBFBF; pointer-events: none; display: inline-flex; }
        .dse-filter-cell .dse-filter-ic svg { width: 12px; height: 12px; }
        .dse-filter-cell .dse-filter-chev { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: #707071; pointer-events: none; display: inline-flex; }
        .dse-filter-cell .dse-filter-chev svg { width: 11px; height: 11px; }
        .dse-table thead tr.dse-filters th.dse-filter-actions { text-align: center; }
        .dse-table thead tr.dse-filters th.dse-filter-actions button { width: 26px; height: 26px; border: none; background: transparent; color: #707071; border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
        .dse-table thead tr.dse-filters th.dse-filter-actions button:hover { background: #F4F4F4; color: #0B0B0C; }
        .dse-table thead tr.dse-filters th.dse-filter-actions button svg { width: 13px; height: 13px; }

        .dse-table tbody td { padding: 4px 8px; border-bottom: 1px solid #EFEFEF; border-right: 1px solid #EDEDED; font-size: 13px; color: #2D2D2D; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .dse-table tbody tr:hover td { background: #FAFAFA; }
        .cs-page[data-page="attrs"] .dse-table tbody tr:not(.dse-cat-row) { cursor: pointer; }
        .dse-table tbody tr.dse-cat-row td, .dse-table tbody tr.dse-cat-row:hover td { background: #FAFAFA; border-bottom: 1px solid #EFEFEF; }
        .dse-table tbody tr.dse-cat-row.collapsed + tr { border-top: 1px solid #EFEFEF; }

        .dse-cb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin: 0; border: 1.5px solid #BFBFBF; border-radius: 4px; background: #FFFFFF; cursor: pointer; display: inline-block; vertical-align: middle; position: relative; }
        .dse-cb:hover { border-color: #0B0B0C; }
        .dse-cb:checked { background: #0B0B0C; border-color: #0B0B0C; }
        .dse-cb:focus { outline: none; box-shadow: 0 0 0 2px rgba(11,11,12,0.12); }

        .dse-cat-cell { display: inline-flex; align-items: center; gap: 10px; color: #0B0B0C; }
        .dse-cat-caret { width: 14px !important; height: 14px !important; color: #2D2D2D; cursor: pointer; transition: transform 0.15s; flex-shrink: 0; }
        .dse-cat-cell .dse-cat-caret { width: 14px; height: 14px; color: #2D2D2D; cursor: pointer; transition: transform 0.15s; flex-shrink: 0; }
        .dse-cat-cell.collapsed .dse-cat-caret { transform: rotate(-90deg); }
        .dse-cat-cell .dse-cat-label { font-weight: 700; font-size: 13px; color: #0B0B0C; }
        .dse-cat-cell .dse-cat-label strong { font-weight: 700; }
        .dse-cat-cell .dse-cat-add { width: 22px; height: 22px; border: none; background: transparent; border-radius: 4px; color: #0B0B0C; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
        .dse-cat-cell .dse-cat-add:hover { background: #EDEDED; }
        .dse-cat-cell .dse-cat-add svg { width: 12px; height: 12px; stroke-width: 2.4; }

        .dse-drag { color: #BFBFBF; cursor: grab; user-select: none; display: inline-flex; align-items: center; justify-content: center; width: 14px; }
        .dse-drag:hover { color: #2D2D2D; }
        .dse-drag:active { cursor: grabbing; }
        .dse-drag svg { width: 10px; height: 14px; }
        .dse-table tbody tr.dse-dragging td { opacity: 0.35; background: #FFF9E0 !important; }
        .dse-table tbody tr.dse-drop-before td { box-shadow: inset 0 2px 0 0 #0B0B0C; }
        .dse-table tbody tr.dse-drop-after td { box-shadow: inset 0 -2px 0 0 #0B0B0C; }

        .dse-name-cell { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
        .dse-name-num { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 4px; background: #EDEDED; color: #2D2D2D; font-size: 11px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .dse-mp-ic { width: 24px; height: 24px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .dse-mp-ic svg { width: 13px; height: 13px; }
        .dse-name-text { font-size: 13px; font-weight: 500; color: #0B0B0C; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .dse-name-cell.dse-group-row { font-weight: 700; }
        .dse-name-cell.dse-group-row .dse-name-text { font-weight: 700; }
        .dse-name-cell .dse-cat-add { width: 22px; height: 22px; border: none; background: transparent; border-radius: 4px; color: #0B0B0C; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .dse-name-cell .dse-cat-add:hover { background: #EDEDED; }
        .dse-name-cell .dse-cat-add svg { width: 12px; height: 12px; stroke-width: 2.4; }

        .dse-row-nested .dse-name-cell { padding-left: 28px; }

        /* Boolean status icons — subtle, no colored background */
        .dse-bool { width: 20px; height: 20px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; }
        .dse-bool.on { background: transparent; color: #2AB67D; }
        .dse-bool.off { background: transparent; color: #B0B0B0; }
        .dse-bool svg { width: 14px; height: 14px; stroke-width: 2.2; }

        .dse-eq { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #2D2D2D; }
        .dse-muted-sm { font-size: 13px; color: #2D2D2D; }

        .dse-row-actions { display: inline-flex; gap: 2px; justify-content: flex-start; }
        .dse-row-actions button { width: 28px; height: 28px; border: none; background: transparent; color: #707071; cursor: pointer; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; }
        .dse-row-actions button:hover { background: #F4F4F4; color: #0B0B0C; }
        .dse-row-actions button svg { width: 14px; height: 14px; }

        /* Layout modal grid */
        .layout-hint { font-size: 12px; color: #707071; margin-bottom: 14px; padding: 10px 12px; background: #FAFAFA; border: 1px solid #EDEDED; border-radius: 6px; }
        .layout-section { margin-bottom: 22px; }
        .layout-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
        .layout-section-head h4 { font-size: 13px; font-weight: 600; color: #0B0B0C; margin: 0; }
        .layout-section-head .layout-sec-meta { font-size: 11px; color: #707071; }
        #il-cat-strip.dse-cat-strip { border-bottom: 1px solid hsl(var(--border)); margin-bottom: 0; padding: 0 8px; background: #fff; }
        .il-sml-btn { padding: 3px 8px; font-size: 11.5px; font-weight: 600; background: transparent; border: 1px solid #DBDBDB; border-radius: 4px; cursor: pointer; color: hsl(var(--muted-foreground)); transition: all 0.12s; }
        .il-sml-btn:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .il-sml-btn.active { background: #F4F4F4; border-color: #E8B22D; color: #2D2D2D; }
        .layout-grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 56px; gap: 8px; padding: 10px; background: repeating-linear-gradient(to right, transparent 0, transparent calc(100%/12 - 1px), #F4F4F4 calc(100%/12 - 1px), #F4F4F4 calc(100%/12)); border: 1px dashed #DBDBDB; border-radius: 8px; min-height: 120px; }
        .layout-tile { position: relative; background: #FFFFFF; border: 1px solid #DBDBDB; border-radius: 6px; padding: 8px 10px 8px 28px; font-size: 13px; color: #0B0B0C; display: flex; align-items: center; user-select: none; box-shadow: 0 1px 2px rgba(0,0,0,0.04); min-height: 40px; }
        .layout-tile:hover { border-color: #0B0B0C; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
        .layout-tile.lt-dragging { opacity: 0.4; background: #FFF9E0; }
        .layout-tile .lt-drag { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 16px; height: 100%; display: flex; align-items: center; justify-content: center; color: #BFBFBF; cursor: grab; }
        .layout-tile .lt-drag:hover { color: #2D2D2D; }
        .layout-tile .lt-drag:active { cursor: grabbing; }
        .layout-tile .lt-drag svg { width: 10px; height: 14px; }
        .layout-tile .lt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
        .layout-tile .lt-size { font-size: 10px; color: #707071; font-family: ui-monospace, Menlo, monospace; padding: 2px 6px; background: #F4F4F4; border-radius: 3px; margin-left: 8px; flex-shrink: 0; }
        .layout-tile .lt-resize-r { position: absolute; right: 0; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
        .layout-tile .lt-resize-r:hover { background: rgba(11,11,12,0.08); }
        .layout-tile .lt-resize-b { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; cursor: ns-resize; }
        .layout-tile .lt-resize-b:hover { background: rgba(11,11,12,0.08); }
        .layout-tile .lt-resize-br { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 45%, #BFBFBF 45%, #BFBFBF 55%, transparent 55%, transparent 65%, #BFBFBF 65%, #BFBFBF 75%, transparent 75%); border-bottom-right-radius: 6px; }
        .layout-tile .lt-resize-br:hover { background: linear-gradient(135deg, transparent 45%, #0B0B0C 45%, #0B0B0C 55%, transparent 55%, transparent 65%, #0B0B0C 65%, #0B0B0C 75%, transparent 75%); }
        .layout-tile.lt-group { border-style: dashed; background: #FAFAFA; }
        .layout-drop-before { box-shadow: inset 3px 0 0 0 #0B0B0C !important; }
        .layout-drop-after { box-shadow: inset -3px 0 0 0 #0B0B0C !important; }

        /* ============ Scenario Builder (Make-style) ============ */
        #scenario-builder-page { z-index: 1100; }
        #scenario-builder-page .cs-main { padding: 0; overflow: hidden; background: #F4F4F4; display: flex; flex-direction: column; }
        .sb-topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #FFFFFF; border-bottom: 1px solid #DBDBDB; flex-shrink: 0; z-index: 10; }
        .sb-topbar .sb-close { width: 32px; height: 32px; border: none; background: transparent; color: #707071; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .sb-topbar .sb-close:hover { background: #F4F4F4; color: #0B0B0C; }
        .sb-topbar .sb-close svg { width: 18px; height: 18px; }
        .sb-topbar .sb-name { flex: 1; min-width: 0; border: 1px solid transparent; padding: 6px 10px; border-radius: 6px; font-size: 16px; font-weight: 700; color: #0B0B0C; background: transparent; }
        .sb-topbar .sb-name:focus { border-color: #DBDBDB; background: #FFFFFF; outline: none; }
        .sb-topbar .sb-state { padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; border: 1px solid transparent; cursor: pointer; }
        .sb-topbar .sb-state.draft { background: #EDEDED; color: #2D2D2D; }
        .sb-topbar .sb-state.active { background: rgba(42,182,125,0.14); color: #1E8A5D; }
        .sb-topbar .sb-state.testing { background: rgba(59,202,239,0.18); color: #2588A8; }
        .sb-topbar .sb-state.paused { background: rgba(232,178,45,0.18); color: #B08218; }
        .sb-topbar .sb-actions { display: inline-flex; gap: 6px; align-items: center; }
        .sb-topbar button.sb-btn { height: 32px; padding: 0 12px; border: 1px solid #DBDBDB; background: #FFFFFF; border-radius: 6px; font-size: 13px; color: #2D2D2D; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
        .sb-topbar button.sb-btn:hover { background: #F4F4F4; }
        .sb-topbar button.sb-btn svg { width: 14px; height: 14px; }
        .sb-btn svg { width: 14px; height: 14px; }
        .sb-topbar button.sb-btn.primary { background: #0B0B0C; color: #FFFFFF; border-color: #0B0B0C; }
        .sb-topbar button.sb-btn.primary:hover { background: #1a1a1a; }
        .sb-topbar button.sb-btn.run { background: #2AB67D; color: #FFFFFF; border-color: #2AB67D; }
        .sb-topbar button.sb-btn.run:hover { background: #25A06E; }

        .sb-workspace { flex: 1; display: grid; grid-template-columns: 260px 1fr 320px; min-height: 0; background: #F4F4F4; }
        .sb-library { background: #FFFFFF; border-right: 1px solid #DBDBDB; overflow-y: auto; padding: 10px 8px; }
        .sb-library-search { position: sticky; top: 0; padding-bottom: 8px; background: #FFFFFF; margin-bottom: 4px; z-index: 1; }
        .sb-library-search input { width: 100%; height: 30px; padding: 0 10px; border: 1px solid #DBDBDB; border-radius: 6px; font-size: 12px; outline: none; }
        .sb-cat { margin-bottom: 6px; }
        .sb-cat-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; font-size: 11px; font-weight: 700; color: #707071; text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; border-radius: 4px; }
        .sb-cat-head:hover { background: #F4F4F4; }
        .sb-cat-head .sb-caret { width: 12px; height: 12px; transition: transform 0.15s; }
        .sb-cat.collapsed .sb-caret { transform: rotate(-90deg); }
        .sb-cat.collapsed .sb-modules-list { display: none; }
        .sb-mod-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; color: #2D2D2D; user-select: none; }
        .sb-mod-item:hover { background: #F4F4F4; }
        .sb-mod-item .sb-mod-ic { width: 22px; height: 22px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: #2D2D2D; }
        .sb-mod-item .sb-mod-ic svg { width: 12px; height: 12px; }
        .sb-mod-item .sb-mod-ic.trigger { background: rgba(232,178,45,0.2); color: #B08218; }
        .sb-mod-item .sb-mod-ic.search { background: rgba(59,202,239,0.18); color: #2588A8; }
        .sb-mod-item .sb-mod-ic.action { background: rgba(42,182,125,0.14); color: #1E8A5D; }
        .sb-mod-item .sb-mod-ic.comm { background: rgba(212,55,17,0.12); color: #C63310; }
        .sb-mod-item .sb-mod-ic.ai { background: rgba(128,90,213,0.16); color: #5A2D9F; }
        .sb-mod-item .sb-mod-ic.flow { background: #EDEDED; color: #2D2D2D; }

        .sb-canvas-wrap { position: relative; overflow: auto; background-image: radial-gradient(circle, #D4D4D4 1px, transparent 1px); background-size: 20px 20px; background-color: #FAFAFA; }
        .sb-canvas { position: relative; width: 4000px; height: 2000px; transform-origin: 0 0; }
        .sb-connections { position: absolute; inset: 0; pointer-events: none; width: 100%; height: 100%; }
        .sb-connections path { fill: none; stroke: #707071; stroke-width: 2; pointer-events: stroke; cursor: pointer; }
        .sb-connections path:hover { stroke: #0B0B0C; stroke-width: 3; }
        .sb-connections path.error-route { stroke: #E8820E; stroke-dasharray: 6 4; }
        .sb-connections path.dimmed { opacity: 0.3; }
        .sb-connections .sb-filter-badge { fill: #FFFFFF; stroke: #0B0B0C; stroke-width: 1; cursor: pointer; }
        .sb-connections .sb-filter-badge-icon { fill: #0B0B0C; pointer-events: none; }
        .sb-conn-tooltip { position: absolute; background: #0B0B0C; color: #FFFFFF; padding: 6px 10px; border-radius: 6px; font-size: 11px; white-space: nowrap; pointer-events: none; z-index: 20; }

        .sb-mod { position: absolute; width: 170px; background: #FFFFFF; border: 2px solid #DBDBDB; border-radius: 12px; padding: 10px 12px; cursor: move; user-select: none; box-shadow: 0 2px 6px rgba(0,0,0,0.06); transition: box-shadow 0.15s, border-color 0.15s; }
        .sb-mod:hover { border-color: #BFBFBF; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
        .sb-mod.selected { border-color: #0B0B0C; box-shadow: 0 0 0 3px rgba(11,11,12,0.1); }
        .sb-mod.error { border-color: #C63310; }
        .sb-mod.running { border-color: #2AB67D; animation: sbPulse 1.2s ease-in-out infinite; }
        @keyframes sbPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(42,182,125,0.3); } 50% { box-shadow: 0 0 0 6px rgba(42,182,125,0); } }
        .sb-mod-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
        .sb-mod-delete { width: 18px; height: 18px; border: none; background: transparent; color: #9B9C9D; cursor: pointer; border-radius: 3px; font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.12s; flex-shrink: 0; padding: 0; }
        .sb-mod:hover .sb-mod-delete { opacity: 1; }
        .sb-mod-delete:hover { background: #FEECEC; color: #D43711; }
        .sb-mod-head .sb-mod-icon { width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .sb-mod-head .sb-mod-icon svg { width: 14px; height: 14px; }
        .sb-mod-head .sb-mod-type { font-size: 10px; font-weight: 600; color: #707071; text-transform: uppercase; letter-spacing: 0.04em; }
        .sb-mod-name { font-size: 13px; font-weight: 600; color: #0B0B0C; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .sb-mod-desc { font-size: 11px; color: #707071; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .sb-mod-ops { position: absolute; top: -10px; right: -10px; min-width: 22px; height: 22px; padding: 0 7px; background: #0B0B0C; color: #FFFFFF; border-radius: 11px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
        .sb-mod-badge-status { position: absolute; top: -6px; left: -6px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #FFFFFF; }
        .sb-mod-badge-status.ok { background: #2AB67D; }
        .sb-mod-badge-status.error { background: #C63310; }
        .sb-mod-badge-status.skipped { background: #BFBFBF; }
        /* Ports */
        .sb-mod .sb-port { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #FFFFFF; border: 2px solid #0B0B0C; cursor: crosshair; opacity: 0.9; }
        .sb-mod .sb-port:hover { transform: scale(1.25); background: #0B0B0C; }
        .sb-mod .sb-port.sb-port-in { left: -8px; top: 50%; transform: translateY(-50%); }
        .sb-mod .sb-port.sb-port-out { right: -8px; top: 50%; transform: translateY(-50%); }
        .sb-mod .sb-port.sb-port-err { right: -8px; bottom: -8px; border-color: #E8820E; }
        .sb-mod .sb-port.sb-port-err:hover { background: #E8820E; }
        .sb-mod.trigger .sb-mod-icon { background: rgba(232,178,45,0.2); color: #B08218; }
        .sb-mod.search .sb-mod-icon { background: rgba(59,202,239,0.18); color: #2588A8; }
        .sb-mod.action .sb-mod-icon { background: rgba(42,182,125,0.14); color: #1E8A5D; }
        .sb-mod.comm .sb-mod-icon { background: rgba(212,55,17,0.12); color: #C63310; }
        .sb-mod.ai .sb-mod-icon { background: rgba(128,90,213,0.16); color: #5A2D9F; }
        .sb-mod.flow .sb-mod-icon { background: #EDEDED; color: #2D2D2D; }

        /* Add-module ghost slot between existing modules */
        .sb-add-slot { position: absolute; width: 32px; height: 32px; border-radius: 50%; background: #FFFFFF; border: 2px dashed #BFBFBF; display: inline-flex; align-items: center; justify-content: center; color: #707071; cursor: pointer; transform: translate(-50%, -50%); }
        .sb-add-slot:hover { background: #0B0B0C; color: #FFFFFF; border-color: #0B0B0C; border-style: solid; }
        .sb-add-slot svg { width: 14px; height: 14px; }

        /* Mini module picker popover */
        .sb-picker { position: fixed; background: #FFFFFF; border: 1px solid #DBDBDB; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.18); width: 320px; max-height: 420px; overflow: auto; z-index: 200; display: none; padding: 8px; }
        .sb-picker.open { display: block; }
        .sb-picker-search { position: sticky; top: 0; background: #FFFFFF; padding: 4px 4px 8px; border-bottom: 1px solid #EDEDED; margin-bottom: 6px; }
        .sb-picker-search input { width: 100%; height: 32px; padding: 0 10px; border: 1px solid #DBDBDB; border-radius: 6px; font-size: 13px; outline: none; }
        .sb-picker .sb-mod-item { font-size: 13px; padding: 8px 10px; }

        /* Right config panel */
        .sb-config { background: #FFFFFF; border-left: 1px solid #DBDBDB; padding: 16px; overflow-y: auto; }
        .sb-config-empty { color: #707071; font-size: 13px; padding: 20px 0; text-align: center; }
        .sb-config h3 { font-size: 14px; font-weight: 700; color: #0B0B0C; margin: 0 0 4px; }
        .sb-config-desc { font-size: 12px; color: #707071; margin-bottom: 14px; }
        .sb-config-field { margin-bottom: 12px; }
        .sb-config-field label { display: block; font-size: 11px; font-weight: 600; color: #707071; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
        .sb-config-field input, .sb-config-field select, .sb-config-field textarea { width: 100%; padding: 8px 10px; border: 1px solid #DBDBDB; border-radius: 6px; font-size: 13px; outline: none; font-family: inherit; }
        .sb-config-field textarea { min-height: 60px; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
        .sb-config-field input:focus, .sb-config-field select:focus, .sb-config-field textarea:focus { border-color: #0B0B0C; }
        .sb-config-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid #EDEDED; }
        .sb-config-section .sb-section-title { font-size: 11px; font-weight: 700; color: #2D2D2D; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }
        .sb-config-check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: #2D2D2D; }
        .sb-config-actions { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
        .sb-config-actions button { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid #DBDBDB; background: #FFFFFF; border-radius: 6px; font-size: 12px; cursor: pointer; }
        .sb-config-actions button:hover { background: #F4F4F4; }
        .sb-config-actions button.danger { color: #C63310; }
        .sb-config-actions button.danger:hover { background: rgba(212,55,17,0.08); border-color: rgba(212,55,17,0.35); }
        /* (#4) Scenario metrics bar — persistent dole */
        .sb-metrics-bar {
            display: flex; align-items: center; gap: 14px; padding: 8px 16px;
            background: #FFFFFF; border-top: 1px solid #DBDBDB; flex-shrink: 0;
            font-size: 12px; color: #2D2D2D;
        }
        .sb-metric { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
        .sb-metric-ic { font-size: 12px; opacity: 0.8; }
        .sb-metric-k { color: #707071; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
        .sb-metric-v { font-weight: 700; color: #0B0B0C; }
        .sb-metric-sep { width: 1px; height: 18px; background: #DBDBDB; }
        .sb-metric-spark { display: inline-flex; align-items: center; gap: 8px; }
        .sb-spark { width: 120px; height: 24px; }
        .sb-metric-lastrun { color: #2AB67D; }
        .sb-metrics-expand { padding: 0 12px; height: 28px; font-size: 12px; }
        /* Metrics detail panel (overlay) */
        .sb-metrics-panel {
            position: fixed; top: 10%; left: 50%; transform: translateX(-50%);
            width: 760px; max-width: calc(100vw - 40px); max-height: 80vh;
            background: #FFFFFF; border: 1px solid #DBDBDB; border-radius: 10px;
            box-shadow: 0 24px 64px rgba(0,0,0,0.24); z-index: 5000;
            display: none; flex-direction: column; overflow: hidden;
        }
        .sb-metrics-panel.open { display: flex; }
        .sb-metrics-panel-head { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid #EDEDED; background: #FAFAFA; }
        .sb-metrics-panel-head strong { flex: 1; font-size: 14px; color: #0B0B0C; }
        .sb-metrics-panel-close { width: 28px; height: 28px; border: none; background: transparent; color: #707071; border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
        .sb-metrics-panel-close:hover { background: #F4F4F4; color: #0B0B0C; }
        .sb-metrics-panel-body { flex: 1; overflow: auto; padding: 16px; }
        .sb-metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
        .sb-metric-card { border: 1px solid #EDEDED; border-radius: 8px; padding: 12px 14px; background: #FAFAFA; }
        .sb-metric-card-k { font-size: 10.5px; color: #707071; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
        .sb-metric-card-v { font-size: 20px; font-weight: 700; color: #0B0B0C; }
        .sb-metric-card-v span { font-size: 13px; color: #707071; font-weight: 500; margin-left: 2px; }
        .sb-metric-card-v.ok { color: #1E8A5D; }
        .sb-metric-card-trend { margin-top: 4px; font-size: 11px; color: #707071; }
        .sb-metric-card-trend.up { color: #1E8A5D; }
        .sb-metric-card-trend.down { color: #C63310; }
        .sb-metric-card-trend.stable { color: #707071; }
        .sb-metrics-timeline { border: 1px solid #EDEDED; border-radius: 8px; padding: 14px; background: #FFFFFF; margin-bottom: 16px; }
        .sb-metrics-timeline-head { font-size: 11px; color: #707071; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
        .sb-metrics-timeline-svg { width: 100%; height: 120px; display: block; }
        .sb-metrics-errors { border: 1px solid #EDEDED; border-radius: 8px; background: #FFFFFF; overflow: hidden; }
        .sb-metrics-errors-head { padding: 10px 14px; font-size: 11px; color: #707071; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid #EDEDED; background: #FAFAFA; }
        .sb-metrics-errors-row { display: grid; grid-template-columns: 60px 200px 1fr; gap: 10px; padding: 8px 14px; font-size: 12px; border-bottom: 1px solid #F4F4F4; }
        .sb-metrics-errors-row:last-child { border-bottom: none; }
        .sb-err-time { color: #707071; font-family: ui-monospace, Menlo, monospace; }
        .sb-err-mod { font-weight: 600; color: #2D2D2D; }
        .sb-err-msg { color: #C63310; }
        /* (#5) Code editor modal */
        .sb-code-overlay {
            position: fixed; inset: 0; background: rgba(10,10,12,0.48); backdrop-filter: blur(3px);
            z-index: 5100; display: none; align-items: center; justify-content: center; padding: 20px;
        }
        .sb-code-overlay.open { display: flex; }
        .sb-code-modal { width: 900px; max-width: 100%; max-height: 86vh; background: #FFFFFF; border-radius: 10px; box-shadow: 0 32px 80px rgba(0,0,0,0.32); display: flex; flex-direction: column; overflow: hidden; }
        .sb-code-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #FAFAFA; border-bottom: 1px solid #EDEDED; }
        .sb-code-tabs { display: flex; gap: 4px; flex: 1; }
        .sb-code-tab { padding: 6px 12px; background: transparent; border: none; font-size: 12.5px; color: #707071; cursor: pointer; border-radius: 6px; }
        .sb-code-tab:hover { background: #F4F4F4; color: #0B0B0C; }
        .sb-code-tab.active { background: #FFFFFF; color: #0B0B0C; font-weight: 600; box-shadow: inset 0 0 0 1px #DBDBDB; }
        .sb-code-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
        .sb-code-pane { display: none; flex-direction: column; flex: 1; padding: 12px; gap: 8px; }
        .sb-code-pane.active { display: flex; }
        .sb-code-hint { background: #F6F4EA; border-left: 3px solid #E8B22D; padding: 8px 12px; font-size: 12px; color: #2D2D2D; border-radius: 4px; line-height: 1.5; }
        .sb-code-hint code { background: #FFFFFF; padding: 1px 5px; border-radius: 3px; font-size: 11.5px; }
        .sb-code-editor { flex: 1; min-height: 380px; padding: 12px 14px; border: 1px solid #DBDBDB; border-radius: 6px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.55; background: #0B0B0C; color: #E6E6E6; resize: none; outline: none; white-space: pre; overflow: auto; }
        .sb-code-editor:focus { border-color: #E8B22D; box-shadow: 0 0 0 3px rgba(232,178,45,0.25); }
        .sb-code-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #EDEDED; background: #FAFAFA; justify-content: flex-end; align-items: center; }

        /* Floating save button */
        .dse-save-wrap { position: absolute; right: 32px; bottom: 24px; z-index: 25; }
        .dse-save-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; background: #0B0B0C; color: #FFFFFF; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; box-shadow: 0 4px 14px rgba(11,11,12,0.18); }
        .dse-save-btn:hover { background: #1a1a1a; }
        .dse-save-btn svg { width: 14px; height: 14px; }

        /* Keep existing badges classes for type picker cards */
        .ds-attr-row { display: grid; grid-template-columns: 24px 28px 1fr 120px auto auto; gap: 10px; align-items: center; padding: 10px 14px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; margin-bottom: 6px; }
        .ds-attr-row .ds-drag { color: hsl(var(--muted-foreground)); cursor: grab; font-size: 14px; letter-spacing: 1px; user-select: none; }
        .ds-attr-row .ds-type-ic { width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .ds-attr-row .ds-type-ic svg { width: 14px; height: 14px; }
        .ds-attr-row .ds-name { font-size: 13px; font-weight: 600; color: hsl(var(--foreground)); }
        .ds-attr-row .ds-sys { display: block; font-size: 11px; color: hsl(var(--muted-foreground)); font-family: ui-monospace, Menlo, monospace; font-weight: 400; }
        .ds-attr-row .ds-type-lbl { font-size: 12px; color: hsl(var(--muted-foreground)); }
        .ds-attr-badges { display: inline-flex; gap: 4px; }
        .ds-attr-badge { padding: 2px 6px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 3px; background: #F4F4F4; color: hsl(var(--muted-foreground)); }
        .ds-attr-badge.req { background: rgba(212,55,17,0.12); color: #C63310; }
        .ds-attr-badge.uniq { background: rgba(59,202,239,0.14); color: #2588A8; }
        .ds-attr-badge.ro { background: rgba(232,178,45,0.14); color: #B08218; }
        .ds-attr-badge.hid { background: #F4F4F4; color: hsl(var(--muted-foreground)); }
        .ds-attr-actions { display: inline-flex; gap: 4px; }
        .ds-attr-actions button { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid hsl(var(--border)); border-radius: 4px; color: hsl(var(--muted-foreground)); cursor: pointer; }
        .ds-attr-actions button:hover { color: hsl(var(--foreground)); border-color: #BFBFBF; }
        .ds-attr-actions button svg { width: 12px; height: 12px; }

        .ds-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 12px; }
        .ds-type-card { display: flex; align-items: center; gap: 11px; padding: 10px 14px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; cursor: pointer; transition: border-color 0.15s ease, background 0.1s ease; }
        .ds-type-card:hover { border-color: #2D2D2D; background: #FAFAFA; }
        .ds-type-card .ds-type-ic { width: 34px; height: 34px; margin-bottom: 0; flex-shrink: 0; background: rgba(45,45,45,0.07) !important; color: #2D2D2D !important; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
        .ds-type-card .ds-type-ic svg { width: 17px; height: 17px; }
        .ds-type-card strong { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 0; }
        .ds-type-card span { display: none; }

        /* Layout builder canvas */
        .lb-wrap { display: grid; grid-template-columns: 240px 1fr 260px; gap: 14px; height: 600px; }
        .lb-panel { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }
        .lb-panel-head { padding: 10px 12px; border-bottom: 1px solid hsl(var(--border)); font-size: 12px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.04em; background: #FAFAFA; }
        .lb-panel-body { flex: 1; overflow: auto; padding: 10px; }
        .lb-attr-pill { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #F4F4F4; border-radius: 4px; margin-bottom: 4px; cursor: grab; font-size: 12px; }
        .lb-attr-pill .ds-type-ic { width: 20px; height: 20px; }
        .lb-attr-pill .ds-type-ic svg { width: 10px; height: 10px; }
        .lb-section { border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: #FFFFFF; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
        .lb-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
        .lb-section-name { font-size: 12px; font-weight: 600; color: hsl(var(--foreground)); }
        .lb-section-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; min-height: 36px; }
        .lb-slot { padding: 8px 10px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 4px; font-size: 12px; color: hsl(var(--foreground)); cursor: grab; }
        .lb-slot[data-span="12"] { grid-column: span 12; }
        .lb-slot[data-span="6"] { grid-column: span 6; }
        .lb-slot[data-span="4"] { grid-column: span 4; }
        .lb-slot[data-span="3"] { grid-column: span 3; }
        .lb-canvas { background: #F3F3F5; }
        .lb-breakpoints { display: inline-flex; gap: 4px; padding: 4px; background: #F4F4F4; border-radius: 6px; }
        .lb-bp { padding: 4px 10px; font-size: 11px; border: none; background: transparent; border-radius: 4px; cursor: pointer; color: hsl(var(--muted-foreground)); }
        .lb-bp.active { background: #FFFFFF; color: hsl(var(--foreground)); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

        /* Event builder */
        .ev-row { display: grid; grid-template-columns: 140px 1fr 100px 140px auto; gap: 10px; align-items: center; padding: 10px 14px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; margin-bottom: 6px; }
        .ev-trigger-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: rgba(232,178,45,0.14); color: #B08218; border-radius: 10px; font-size: 11px; font-weight: 600; }
        .ev-trigger-badge.sched { background: rgba(59,202,239,0.14); color: #2588A8; }
        .ev-trigger-badge.manual { background: #F4F4F4; color: hsl(var(--muted-foreground)); }
        .ev-name { font-size: 13px; font-weight: 600; }
        .ev-desc { display: block; font-size: 11px; color: hsl(var(--muted-foreground)); font-weight: 400; }
        .ev-action-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
        .ev-action-card { padding: 10px 12px; border: 1px solid hsl(var(--border)); border-radius: 6px; background: #FFFFFF; display: grid; grid-template-columns: 30px 28px 120px 1fr auto; gap: 10px; align-items: center; }
        .ev-action-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; background: #2D2D2D; color: #FFFFFF; border-radius: 50%; font-size: 11px; font-weight: 700; }
        .ev-action-ic { width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: #F4F4F4; color: hsl(var(--foreground)); }
        .ev-action-ic svg { width: 14px; height: 14px; }
        .ev-action-type { font-size: 12px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.04em; }
        .ev-action-body { font-size: 13px; color: hsl(var(--foreground)); }
        .ev-action-body code { font-family: ui-monospace, Menlo, monospace; font-size: 11px; background: #F4F4F4; padding: 1px 5px; border-radius: 3px; }

        /* Dashboard editor — Airtable-inspired 3-panel layout (topbar + left palette + canvas + right properties) */
        .dbe-topbar { position: fixed; top: 0; left: 0; right: 0; height: 42px; background: #2D2D2D; color: #FFFFFF; display: none; align-items: center; gap: 12px; padding: 0 16px; z-index: 500; font-size: 13px; }
        html[data-theme="dark"] .dbe-topbar { background: #0E0F13; border-bottom: 1px solid #24262B; }
        body.dbe-mode .dbe-topbar { display: flex; }
        body.dbe-mode .top-tabs { display: none !important; }
        body.dbe-mode .toolbar { display: none !important; }
        body.dbe-mode .view-host,
        body.dbe-mode .toolbar,
        body.dbe-mode .table-footer { display: none !important; } /* presunuté do canvasu ako widget */
        .dbe-title { flex: 1; font-weight: 600; color: #FFFFFF; font-size: 13px; text-align: center; }
        .dbe-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; color: #FFFFFF; font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; }
        .dbe-btn:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.32); }
        .dbe-btn-primary { background: #E8B22D; color: #2D2D2D; border-color: #E8B22D; }
        .dbe-btn-primary:hover { background: #D8A424; border-color: #D8A424; }
        .dbe-actions { display: flex; gap: 8px; }

        /* Layout — full-width canvas (bez bočných sidebarov, paleta a config sú v modáli) */
        .dbe-layout { position: fixed; top: 42px; left: 0; right: 0; bottom: 0; display: none; background: #F4F4F4; z-index: 400; }
        body.dbe-mode .dbe-layout { display: block; }
        .dbe-canvas { position: relative; width: 100%; height: 100%; overflow: auto; padding: 16px; background: #F4F4F4; }

        /* 12-col grid guides — viditeľný mriežkový podklad pre orientáciu.
           Riadok = 32px (obdĺžnikové bunky), gap = 6px. Tým pádom widget s h:1 = 32px,
           h:2 ~ 70px, h:3 ~ 108px atď. Auto-grow gridu robí JS po pridaní widgetu blízko
           dolnej hrane (pridá +2 riadky → "nekonečné plátno"). */
        .dbe-grid-guide { position: absolute; inset: 16px; display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 32px; gap: 6px; pointer-events: none; z-index: 0; }
        .dbe-grid-guide::before,
        .dbe-grid-guide::after { content: none; }
        .dbe-grid-guide .dbe-grid-cell { background: #FFFFFF; border: 1px dashed #D4D4D4; border-radius: 4px; }

        /* Widget grid — rovnaký raster ako guides, widgety sú nad guides-om */
        .dbe-new-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 32px; gap: 6px; min-height: 100%; }
        .dbe-new-grid.no-widgets { min-height: 300px; }
        /* Drag-and-drop affordance — widget počas presúvania získava .dragging,
           drop zóna ukáže placeholder shadow. Pridáva vizuálnu spätnú väzbu. */
        .dbe-new-widget.dragging { opacity: 0.4; cursor: grabbing !important; }
        .dbe-new-widget { cursor: grab; }
        .dbe-new-widget:active { cursor: grabbing; }
        .dbe-grid-cell.drop-target { background: rgba(232,178,45,0.18); border-color: #E8B22D; border-style: solid; }

        /* Widget modal — paleta + konfigurácia widgetu */
        .dbe-widget-modal-overlay { position: fixed; inset: 0; background: rgba(15,15,15,0.55); backdrop-filter: blur(4px); z-index: 3000; display: none; align-items: center; justify-content: center; padding: 24px; }
        .dbe-widget-modal-overlay.open { display: flex; }
        .dbe-widget-modal { width: 1000px; max-width: calc(100vw - 48px); height: 640px; max-height: calc(100vh - 48px); background: #FFFFFF; border-radius: 12px; box-shadow: 0 24px 64px rgba(0,0,0,0.22); display: flex; flex-direction: column; overflow: hidden; }
        .dbe-widget-modal-head { padding: 14px 18px; border-bottom: 1px solid hsl(var(--border)); display: flex; align-items: flex-start; gap: 12px; }
        .dbe-widget-modal-title { flex: 1; display: flex; flex-direction: column; gap: 2px; }
        .dbe-widget-modal-title strong { font-size: 15px; font-weight: 600; color: hsl(var(--foreground)); }
        .dbe-widget-modal-title span { font-size: 12px; color: hsl(var(--muted-foreground)); }
        .dbe-widget-modal-close { background: transparent; border: none; color: hsl(var(--muted-foreground)); cursor: pointer; padding: 4px; border-radius: 4px; }
        .dbe-widget-modal-close:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .dbe-widget-modal-body { flex: 1; display: flex; min-height: 0; }
        .dbe-widget-modal-picker { width: 320px; flex-shrink: 0; border-right: 1px solid hsl(var(--border)); background: #FAFAFA; display: flex; flex-direction: column; overflow: hidden; padding: 12px; }
        .dbe-widget-modal-picker .dbe-palette-sidebar-search { margin-bottom: 10px; position: relative; display: flex; align-items: center; }
        .dbe-widget-modal-picker .dbe-palette-sidebar-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); pointer-events: none; flex-shrink: 0; z-index: 1; }
        .dbe-widget-modal-picker .dbe-palette-sidebar-search input { width: 100%; height: 32px; padding: 0 10px 0 32px; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 13px; font-family: inherit; background: #FFFFFF; color: hsl(var(--foreground)); outline: none; box-sizing: border-box; }
        .dbe-widget-modal-picker .dbe-palette-sidebar-search input:focus { border-color: hsl(var(--primary)); }
        .dbe-widget-modal-picker-body { flex: 1; overflow: auto; padding-right: 4px; }
        .dbe-widget-modal-picker .dbe-palette-section { margin-bottom: 12px; }
        .dbe-widget-modal-picker .dbe-palette-section[hidden] { display: none; }
        .dbe-widget-modal-picker .dbe-palette-label { font-size: 10.5px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; padding: 0 2px; }
        .dbe-widget-modal-picker .dbe-palette-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
        .dbe-widget-modal-picker .dbe-palette-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; cursor: pointer; text-align: left; font-family: inherit; transition: border-color 0.15s, background 0.15s; }
        .dbe-widget-modal-picker .dbe-palette-item:hover { border-color: #2D2D2D; background: #FAFAFA; }
        .dbe-widget-modal-picker .dbe-palette-item[hidden] { display: none; }
        .dbe-widget-modal-picker .dbe-palette-item.active { border-color: #E8B22D; background: #FFFBEE; box-shadow: 0 0 0 2px rgba(232,178,45,0.25); }
        .dbe-widget-modal-picker .dbe-palette-item svg { width: 16px; height: 16px; color: hsl(var(--muted-foreground)); }
        .dbe-widget-modal-picker .dbe-palette-item strong { font-size: 12px; color: hsl(var(--foreground)); line-height: 1.2; }
        .dbe-widget-modal-picker .dbe-palette-item span { font-size: 10.5px; color: hsl(var(--muted-foreground)); line-height: 1.35; }

        .dbe-widget-modal-config { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
        .dbe-widget-modal-config-empty { flex: 1; padding: 60px 32px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
        .dbe-widget-modal-config-empty svg { width: 48px; height: 48px; color: hsl(var(--muted-foreground)); opacity: 0.4; }
        .dbe-widget-modal-config-content { flex: 1; display: flex; flex-direction: column; min-height: 0; }
        .dbe-widget-modal-config-content[hidden] { display: none; }
        .dbe-cfg-empty-title { font-size: 14px; font-weight: 600; color: hsl(var(--foreground)); }
        .dbe-cfg-empty-sub { font-size: 12px; line-height: 1.5; max-width: 320px; }

        .dbe-widget-modal-foot { padding: 12px 18px; border-top: 1px solid hsl(var(--border)); display: flex; gap: 8px; justify-content: flex-end; background: #FAFAFA; }

        /* Widget — spoločný vzhľad pre view widget aj pridané widgety. Všetky v gride, všetky drag/resize-able */
        .dbe-new-widget { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
        .dbe-new-widget:hover { border-color: #2D2D2D; }
        .dbe-new-widget.dragging { opacity: 0.4; }
        .dbe-new-widget.drag-over { border-color: #E8B22D; background: rgba(232,178,45,0.06); box-shadow: inset 0 0 0 2px rgba(232,178,45,0.4); }
        /* V dashboard editori: vnútorný (klonovaný) widget už má border + background z wrappera — vypni duplicitný border. */
        .dbe-new-widget .dbe-nw-body > .ph-kpi,
        .dbe-new-widget .dbe-nw-body > .ph-panel,
        .dbe-new-widget .dbe-nw-body > .dash-widget,
        .dbe-new-widget .dbe-nw-body > .dash-panel { border: none !important; box-shadow: none !important; background: transparent !important; }
        .dbe-new-widget.resizing { box-shadow: 0 0 0 2px #E8B22D; }
        .dbe-new-widget.selected { border-color: #E8B22D; box-shadow: 0 0 0 2px rgba(232,178,45,0.25); }
        .dbe-new-widget .dbe-nw-body { flex: 1; min-height: 0; overflow: hidden; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
        /* Special: view widget — obsahuje pôvodnú tabuľku + toolbar + footer; body má 0 padding aby tabuľka sadla na okraje */
        .dbe-new-widget[data-kind="view"] .dbe-nw-body { padding: 0; }
        .dbe-new-widget[data-kind="view"] .dbe-nw-body .toolbar { display: flex !important; flex-shrink: 0; }
        .dbe-new-widget[data-kind="view"] .dbe-nw-body .view-host { display: block !important; position: relative; flex: 1; min-height: 0; overflow: auto; }
        .dbe-new-widget[data-kind="view"] .dbe-nw-body .table-footer { display: flex !important; flex-shrink: 0; }
        .dbe-new-widget[data-w="1"] { grid-column: span 1; }
        .dbe-new-widget[data-w="2"] { grid-column: span 2; }
        .dbe-new-widget[data-w="3"] { grid-column: span 3; }
        .dbe-new-widget[data-w="4"] { grid-column: span 4; }
        .dbe-new-widget[data-w="5"] { grid-column: span 5; }
        .dbe-new-widget[data-w="6"] { grid-column: span 6; }
        .dbe-new-widget[data-w="7"] { grid-column: span 7; }
        .dbe-new-widget[data-w="8"] { grid-column: span 8; }
        .dbe-new-widget[data-w="9"] { grid-column: span 9; }
        .dbe-new-widget[data-w="10"] { grid-column: span 10; }
        .dbe-new-widget[data-w="11"] { grid-column: span 11; }
        .dbe-new-widget[data-w="12"] { grid-column: span 12; }
        .dbe-new-widget[data-h="1"] { grid-row: span 1; }
        .dbe-new-widget[data-h="2"] { grid-row: span 2; }
        .dbe-new-widget[data-h="3"] { grid-row: span 3; }
        .dbe-new-widget[data-h="4"] { grid-row: span 4; }
        .dbe-new-widget[data-h="5"] { grid-row: span 5; }
        .dbe-new-widget[data-h="6"] { grid-row: span 6; }
        .dbe-new-widget[data-h="7"] { grid-row: span 7; }
        .dbe-new-widget[data-h="8"] { grid-row: span 8; }
        .dbe-new-widget[data-h="9"] { grid-row: span 9; }
        .dbe-new-widget[data-h="10"] { grid-row: span 10; }
        .dbe-new-widget[data-h="11"] { grid-row: span 11; }
        .dbe-new-widget[data-h="12"] { grid-row: span 12; }
        .dbe-new-widget[data-h="13"] { grid-row: span 13; }
        .dbe-new-widget[data-h="14"] { grid-row: span 14; }
        .dbe-new-widget[data-h="15"] { grid-row: span 15; }
        .dbe-new-widget[data-h="16"] { grid-row: span 16; }
        .dbe-new-widget[data-h="17"] { grid-row: span 17; }
        .dbe-new-widget[data-h="18"] { grid-row: span 18; }
        .dbe-new-widget[data-h="19"] { grid-row: span 19; }
        .dbe-new-widget[data-h="20"] { grid-row: span 20; }
        .dbe-new-widget[data-h="21"] { grid-row: span 21; }
        .dbe-new-widget[data-h="22"] { grid-row: span 22; }
        .dbe-new-widget[data-h="23"] { grid-row: span 23; }
        .dbe-new-widget[data-h="24"] { grid-row: span 24; }
        .dbe-new-widget[data-h="25"] { grid-row: span 25; }
        .dbe-new-widget[data-h="26"] { grid-row: span 26; }
        .dbe-new-widget[data-h="27"] { grid-row: span 27; }
        .dbe-new-widget[data-h="28"] { grid-row: span 28; }
        .dbe-new-widget[data-h="29"] { grid-row: span 29; }
        .dbe-new-widget[data-h="30"] { grid-row: span 30; }
        .dbe-new-widget[data-h="31"] { grid-row: span 31; }
        .dbe-new-widget[data-h="32"] { grid-row: span 32; }
        .dbe-new-widget[data-h="33"] { grid-row: span 33; }
        .dbe-new-widget[data-h="34"] { grid-row: span 34; }
        .dbe-new-widget[data-h="35"] { grid-row: span 35; }
        .dbe-new-widget[data-h="36"] { grid-row: span 36; }
        .dbe-new-widget[data-h="37"] { grid-row: span 37; }
        .dbe-new-widget[data-h="38"] { grid-row: span 38; }
        .dbe-new-widget[data-h="39"] { grid-row: span 39; }
        .dbe-new-widget[data-h="40"] { grid-row: span 40; }
        .dbe-new-widget .dbe-nw-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid hsl(var(--border)); background: #FAFAFA; cursor: grab; flex-shrink: 0; }
        .dbe-new-widget .dbe-nw-head:active { cursor: grabbing; }
        .dbe-new-widget .dbe-nw-drag { width: 14px; height: 14px; color: hsl(var(--muted-foreground)); flex-shrink: 0; opacity: 0.5; }
        .dbe-new-widget:hover .dbe-nw-drag { opacity: 1; }
        .dbe-new-widget .dbe-nw-title { flex: 1; font-size: 11.5px; font-weight: 600; color: hsl(var(--foreground)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .dbe-new-widget .dbe-nw-val { font-size: 28px; font-weight: 700; color: hsl(var(--foreground)); }
        .dbe-new-widget .dbe-widget-act { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid transparent; border-radius: 4px; color: hsl(var(--muted-foreground)); cursor: pointer; padding: 0; flex-shrink: 0; }
        .dbe-new-widget .dbe-widget-act:hover { background: #FFFFFF; border-color: hsl(var(--border)); color: hsl(var(--foreground)); }

        /* Resize handles — east (šírka), south (výška), south-east (oboje) */
        .dbe-new-widget .dbe-resize { position: absolute; background: transparent; z-index: 3; }
        .dbe-new-widget .dbe-resize-e { right: 0; top: 0; bottom: 12px; width: 6px; cursor: col-resize; }
        .dbe-new-widget .dbe-resize-s { left: 0; right: 12px; bottom: 0; height: 6px; cursor: row-resize; }
        .dbe-new-widget .dbe-resize-se { right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, #BFBFBF 50%, #BFBFBF 60%, transparent 60%, transparent 70%, #BFBFBF 70%, #BFBFBF 80%, transparent 80%); border-bottom-right-radius: 8px; }
        .dbe-new-widget:hover .dbe-resize-e { background: linear-gradient(to right, transparent 40%, rgba(232,178,45,0.5) 40%); }
        .dbe-new-widget:hover .dbe-resize-s { background: linear-gradient(to bottom, transparent 40%, rgba(232,178,45,0.5) 40%); }
        .dbe-config-tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid hsl(var(--border)); background: #FAFAFA; }
        .dbe-config-tab { flex: 1; background: transparent; border: none; border-bottom: 2px solid transparent; padding: 10px 8px; font-size: 12px; font-weight: 500; color: hsl(var(--muted-foreground)); cursor: pointer; font-family: inherit; }
        .dbe-config-tab:hover { color: hsl(var(--foreground)); }
        .dbe-config-tab.active { color: hsl(var(--foreground)); border-bottom-color: #E8B22D; }
        .dbe-config-body { flex: 1; overflow: auto; padding: 14px 16px; }
        .dbe-config-foot { padding: 10px 16px; border-top: 1px solid hsl(var(--border)); display: flex; justify-content: flex-end; gap: 8px; background: #FAFAFA; }
        .dbe-cfg-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
        .dbe-cfg-field > label { font-size: 11px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.04em; }
        .dbe-cfg-field > .sh-input, .dbe-cfg-field > textarea.sh-input { font-size: 13px; padding: 8px 10px; }
        .dbe-cfg-field > .adv-select { width: 100%; }
        .dbe-cfg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
        .dbe-cfg-toggle { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid hsl(var(--border)); }
        .dbe-cfg-toggle:last-child { border-bottom: none; }
        .dbe-cfg-toggle-label { font-size: 12.5px; color: hsl(var(--foreground)); }
        .dbe-cfg-toggle-sub { font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
        .dbe-cfg-color-row { display: flex; gap: 6px; flex-wrap: wrap; }
        .dbe-cfg-color { width: 26px; height: 26px; border-radius: 4px; cursor: pointer; border: 2px solid transparent; }
        .dbe-cfg-color.active { border-color: #2D2D2D; }
        .dbe-cfg-section + .dbe-cfg-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid hsl(var(--border)); }
        .dbe-cfg-section-label { font-size: 11px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }

        /* Dashboard builder */
        .db-grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 110px; gap: 12px; min-height: 500px; padding: 16px; background: repeating-linear-gradient(0deg, #FAFAFA, #FAFAFA 110px, #F4F4F4 110px, #F4F4F4 122px); border: 1px dashed hsl(var(--border)); border-radius: 8px; }
        .db-widget { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 14px; position: relative; cursor: move; overflow: hidden; }
        .db-widget:hover { border-color: #2D2D2D; }
        .db-widget h4 { font-size: 12px; font-weight: 600; color: hsl(var(--muted-foreground)); margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.04em; }
        .db-widget .db-big { font-size: 32px; font-weight: 700; color: hsl(var(--foreground)); line-height: 1; }
        .db-widget .db-delta { font-size: 12px; color: #2AB67D; margin-top: 4px; }
        .db-widget .db-delta.down { color: #D43711; }
        .db-widget[data-w="3"] { grid-column: span 3; }
        .db-widget[data-w="4"] { grid-column: span 4; }
        .db-widget[data-w="6"] { grid-column: span 6; }
        .db-widget[data-w="12"] { grid-column: span 12; }
        .db-widget[data-h="2"] { grid-row: span 2; }
        .db-widget[data-h="3"] { grid-row: span 3; }
        .db-chart-mock { height: 100%; background: linear-gradient(180deg, transparent 0%, rgba(232,178,45,0.12) 100%); border-bottom: 2px solid #E8B22D; position: relative; margin-top: 12px; }
        .db-chart-mock::after { content: ''; position: absolute; inset: 0; background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 40" preserveAspectRatio="none"><polyline points="0,30 15,22 30,26 45,12 60,18 75,8 100,14" fill="none" stroke="%23E8B22D" stroke-width="1.5"/></svg>') no-repeat center / 100% 100%; }
        .db-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 16px; }
        .db-palette-item { padding: 14px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; cursor: grab; text-align: center; }
        .db-palette-item:hover { border-color: #2D2D2D; }
        .db-palette-item svg { width: 28px; height: 28px; color: hsl(var(--muted-foreground)); margin-bottom: 6px; }
        .db-palette-item strong { display: block; font-size: 12px; color: hsl(var(--foreground)); }
        .db-palette-item span { font-size: 10px; color: hsl(var(--muted-foreground)); }

        /* Email client */
        .em-wrap { display: grid; grid-template-columns: 220px 360px 1fr; height: calc(100vh - 90px); background: #FFFFFF; }
        .em-sidebar { border-right: 1px solid hsl(var(--border)); padding: 14px 10px; overflow: auto; background: #FAFAFA; }
        .em-compose-btn { width: 100%; height: 40px; background: #E8B22D; color: #2D2D2D; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; margin-bottom: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
        .em-compose-btn:hover { background: #D8A424; }
        .em-folder { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: hsl(var(--foreground)); }
        .em-folder:hover { background: #F4F4F4; }
        .em-folder.active { background: #2D2D2D; color: #FFFFFF; }
        .em-folder-count { font-size: 11px; color: hsl(var(--muted-foreground)); }
        .em-folder.active .em-folder-count { color: rgba(255,255,255,0.7); }
        .em-folder svg { width: 14px; height: 14px; margin-right: 8px; flex-shrink: 0; }
        .em-list { border-right: 1px solid hsl(var(--border)); overflow: auto; }
        .em-list-head { padding: 10px 14px; border-bottom: 1px solid hsl(var(--border)); background: #FAFAFA; display: flex; align-items: center; gap: 8px; }
        .em-list-head input { flex: 1; height: 32px; padding: 0 10px; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 13px; outline: none; }
        .em-thread { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-bottom: 1px solid #EFEFEF; cursor: pointer; }
        .em-thread:hover { background: #FAFAFA; }
        .em-thread.active { background: #F4F4F4; }
        .em-thread.unread .em-thread-from { font-weight: 700; }
        .em-thread.unread .em-thread-subject { font-weight: 600; }
        .em-thread-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
        .em-thread-from { font-size: 13px; color: hsl(var(--foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .em-thread-time { font-size: 11px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
        .em-thread-subject { font-size: 13px; color: hsl(var(--foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .em-thread-preview { font-size: 12px; color: hsl(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .em-thread-labels { display: flex; gap: 4px; margin-top: 2px; }
        .em-label { padding: 1px 6px; font-size: 10px; font-weight: 600; border-radius: 3px; }
        .em-label.lbl-prj { background: rgba(232,178,45,0.2); color: #B08218; }
        .em-label.lbl-fa { background: rgba(42,182,125,0.18); color: #1E8A5D; }
        .em-label.lbl-im { background: rgba(212,55,17,0.14); color: #C63310; }
        .em-view { display: flex; flex-direction: column; overflow: hidden; }
        .em-view-head { padding: 16px 22px; border-bottom: 1px solid hsl(var(--border)); }
        .em-view-subject { font-size: 18px; font-weight: 700; color: hsl(var(--foreground)); margin-bottom: 8px; }
        .em-view-tags { display: inline-flex; gap: 6px; }
        .em-view-actions { float: right; display: inline-flex; gap: 6px; }
        .em-msg { padding: 14px 22px; border-bottom: 1px solid #EFEFEF; }
        .em-msg:last-child { border-bottom: none; }
        .em-msg-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
        .em-msg-avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
        .em-msg-body { flex: 1; }
        .em-msg-from { font-weight: 600; font-size: 13px; }
        .em-msg-to { font-size: 12px; color: hsl(var(--muted-foreground)); }
        .em-msg-time { font-size: 11px; color: hsl(var(--muted-foreground)); float: right; }
        .em-msg-text { font-size: 13px; color: hsl(var(--foreground)); line-height: 1.6; white-space: pre-wrap; }
        .em-reply-bar { padding: 12px 22px; border-top: 1px solid hsl(var(--border)); background: #FAFAFA; display: flex; gap: 6px; }

        /* Visual editor (HTML+JS) */
        .ve-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; height: 520px; }
        .ve-pane { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }
        .ve-pane-head { padding: 8px 12px; border-bottom: 1px solid hsl(var(--border)); background: #FAFAFA; font-size: 12px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.04em; display: flex; align-items: center; justify-content: space-between; }
        .ve-editor { flex: 1; overflow: auto; padding: 12px 14px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6; background: #0F1115; color: #E5E7EB; white-space: pre; border: none; outline: none; resize: none; width: 100%; }
        .ve-editor.is-js { background: #10141B; }
        .ve-preview { flex: 1; overflow: auto; padding: 20px; background: #FFFFFF; }

        /* Chat app (standalone) */
        .chat-wrap { display: grid; grid-template-columns: 280px 1fr 260px; height: calc(100vh - 90px); }
        .chat-list { border-right: 1px solid hsl(var(--border)); background: #FAFAFA; overflow: auto; }
        .chat-list-head { padding: 12px 14px; border-bottom: 1px solid hsl(var(--border)); display: flex; align-items: center; justify-content: space-between; }
        .chat-list-head strong { font-size: 14px; }
        .chat-conv { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #EFEFEF; cursor: pointer; }
        .chat-conv:hover { background: #F4F4F4; }
        .chat-conv.active { background: #FFFFFF; border-left: 3px solid #E8B22D; padding-left: 11px; }
        .chat-conv-body { flex: 1; min-width: 0; }
        .chat-conv-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .chat-conv-last { font-size: 11px; color: hsl(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .chat-view { display: flex; flex-direction: column; overflow: hidden; background: #FFFFFF; }
        .chat-view-head { padding: 14px 22px; border-bottom: 1px solid hsl(var(--border)); }
        .chat-view-stream { flex: 1; overflow: auto; padding: 16px 22px; background: #FAFAFA; }
        .chat-info { border-left: 1px solid hsl(var(--border)); padding: 16px; overflow: auto; }
        .chat-online { width: 8px; height: 8px; border-radius: 50%; background: #2AB67D; display: inline-block; }

        /* Audit log viewer */
        .al-filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
        .al-filters > div { flex: 0 0 auto; min-width: 160px; max-width: 200px; }
        .al-table { width: 100%; border-collapse: collapse; font-size: 13px; }
        .al-table th { background: #F4F4F4; text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid hsl(var(--border)); }
        .al-table td { padding: 10px 12px; border-bottom: 1px solid #EFEFEF; vertical-align: top; }
        .al-action { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 11px; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
        .al-action.create { background: rgba(42,182,125,0.15); color: #1E8A5D; }
        .al-action.update { background: rgba(232,178,45,0.15); color: #B08218; }
        .al-action.delete { background: rgba(212,55,17,0.15); color: #C63310; }
        .al-action.login { background: rgba(59,202,239,0.14); color: #2588A8; }

        /* Import wizard modal */
        .iw-modal .modal { max-width: 900px; width: 900px; }
        .iw-steps { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: #FAFAFA; border-bottom: 1px solid hsl(var(--border)); gap: 4px; }
        .iw-step { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 12px; color: hsl(var(--muted-foreground)); position: relative; }
        .iw-step-num { width: 24px; height: 24px; border-radius: 50%; background: #E4E4E4; color: hsl(var(--muted-foreground)); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
        .iw-step.active { color: hsl(var(--foreground)); font-weight: 600; }
        .iw-step.active .iw-step-num { background: #2D2D2D; color: #FFFFFF; }
        .iw-step.done .iw-step-num { background: #2AB67D; color: #FFFFFF; }
        .iw-step:not(:last-child)::after { content: ''; flex: 1; height: 1px; background: hsl(var(--border)); margin-left: 8px; }
        .iw-body { padding: 24px 28px; min-height: 380px; max-height: 60vh; overflow: auto; }
        .iw-step-panel { display: none; }
        .iw-step-panel.active { display: block; }
        .iw-step-title { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
        .iw-step-desc { font-size: 13px; color: hsl(var(--muted-foreground)); margin-bottom: 18px; }
        .iw-dropzone { border: 2px dashed hsl(var(--border)); border-radius: 10px; padding: 40px 20px; text-align: center; background: #FAFAFA; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
        .iw-dropzone:hover { border-color: #2D2D2D; background: #F4F4F4; }
        .iw-dropzone svg { width: 40px; height: 40px; color: hsl(var(--muted-foreground)); margin-bottom: 10px; }
        .iw-dropzone h4 { font-size: 14px; margin: 0 0 4px; }
        .iw-dropzone p { font-size: 12px; color: hsl(var(--muted-foreground)); margin: 0; }
        .iw-file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #F4F4F4; border: 1px solid hsl(var(--border)); border-radius: 6px; margin-top: 10px; }
        .iw-file svg { width: 20px; height: 20px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
        .iw-file strong { display: block; font-size: 13px; }
        .iw-file span { font-size: 11px; color: hsl(var(--muted-foreground)); }
        .iw-mapping { width: 100%; font-size: 13px; border-collapse: collapse; }
        .iw-mapping th { text-align: left; padding: 8px 10px; border-bottom: 1px solid hsl(var(--border)); font-size: 11px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.04em; background: #FAFAFA; }
        .iw-mapping td { padding: 8px 10px; border-bottom: 1px solid #EFEFEF; }
        .iw-mapping tr:last-child td { border-bottom: none; }
        .iw-phases { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
        .iw-phase { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #FAFAFA; border-radius: 6px; font-size: 13px; }
        .iw-phase-icon { width: 20px; height: 20px; border-radius: 50%; background: #E4E4E4; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
        .iw-phase.done .iw-phase-icon { background: #2AB67D; color: #FFFFFF; }
        .iw-phase.done .iw-phase-icon svg { width: 12px; height: 12px; }
        .iw-phase.active .iw-phase-icon { background: #E8B22D; }
        .iw-phase.active .iw-phase-icon::after { content: ''; width: 8px; height: 8px; border: 2px solid #2D2D2D; border-top-color: transparent; border-radius: 50%; animation: iw-spin 0.8s linear infinite; }
        @keyframes iw-spin { to { transform: rotate(360deg); } }
        .iw-progress { width: 100%; height: 8px; background: #F4F4F4; border-radius: 4px; overflow: hidden; margin: 16px 0; }
        .iw-progress-bar { height: 100%; background: linear-gradient(90deg, #E8B22D, #2AB67D); transition: width 0.3s ease; }
        .iw-result-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 8px; margin-bottom: 10px; }
        .iw-result-row.ok { background: rgba(42,182,125,0.08); }
        .iw-result-row.warn { background: rgba(232,178,45,0.08); }
        .iw-result-row.err { background: rgba(212,55,17,0.08); }
        .iw-result-row svg { width: 20px; height: 20px; flex-shrink: 0; }
        .iw-result-row.ok svg { color: #2AB67D; }
        .iw-result-row.warn svg { color: #E8B22D; }
        .iw-result-row.err svg { color: #D43711; }

        /* Timeline view */
        .tl-wrap { padding: 24px; }
        .tl-head { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
        .tl-track { position: relative; padding-left: 30px; border-left: 2px solid hsl(var(--border)); }
        .tl-item { position: relative; padding: 12px 16px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; margin-bottom: 12px; cursor: pointer; transition: box-shadow 0.15s ease; }
        .tl-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
        .tl-item::before { content: ''; position: absolute; left: -37px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: #E8B22D; border: 2px solid #FFFFFF; box-shadow: 0 0 0 2px hsl(var(--border)); }
        .tl-item.priority-high::before { background: #D43711; }
        .tl-item.priority-low::before { background: #707071; }
        .tl-date { font-size: 11px; color: hsl(var(--muted-foreground)); margin-bottom: 4px; font-weight: 500; }
        .tl-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
        .tl-meta { font-size: 12px; color: hsl(var(--muted-foreground)); display: flex; gap: 10px; }

        /* Map view */
        .map-wrap { position: relative; width: 100%; height: 100%; background: #E8ECEF; overflow: hidden; }
        .leaflet-map { position: absolute; inset: 0; z-index: 1; background: #E8ECEF; }
        .leaflet-map .leaflet-control-zoom { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
        .mod-map-pin { background: transparent; border: none; }
        .mod-map-pin-inner { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: flex; align-items: center; justify-content: center; color: #FFFFFF; font-size: 10px; font-weight: 700; box-shadow: 0 3px 10px rgba(0,0,0,0.25); border: 2px solid #FFFFFF; }
        .mod-map-pin-inner span { transform: rotate(45deg); }
        /* Cluster icon (Modulario-styled) */
        .mod-map-cluster { background: transparent; border: none; }
        .mod-map-cluster-inner { border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #FFFFFF; font-weight: 700; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,0.25); border: 3px solid #FFFFFF; transition: transform 0.15s ease; }
        .mod-map-cluster:hover .mod-map-cluster-inner { transform: scale(1.08); }
        /* Hide the default marker-cluster styles (we use our own) */
        .leaflet-marker-icon.marker-cluster-small div,
        .leaflet-marker-icon.marker-cluster-medium div,
        .leaflet-marker-icon.marker-cluster-large div { display: none; }

        .mod-map-popup.leaflet-popup { margin-bottom: 0; }
        .mod-map-popup .leaflet-popup-content-wrapper { border-radius: 10px; padding: 0 !important; min-width: 380px; overflow: hidden; }
        .mod-map-popup .leaflet-popup-content { margin: 24px 26px !important; font-size: 14px; line-height: 1.55; min-width: 340px; width: auto !important; }
        .mod-map-popup .leaflet-popup-tip-container { margin-top: -1px; }
        .mod-map-popup .mod-map-popup-id { font-size: 13px; color: #707071; font-family: ui-monospace, Menlo, monospace; letter-spacing: 0.02em; padding-right: 28px; }
        .mod-map-popup .mod-map-popup-title { font-size: 16px; font-weight: 700; color: #0B0B0C; margin-top: 6px; line-height: 1.35; }
        .mod-map-popup .mod-map-popup-meta { font-size: 13px; color: #707071; margin-top: 10px; }
        .mod-map-popup .mod-map-popup-open { display: inline-block; margin-top: 16px; padding: 10px 20px; background: #0B0B0C; color: #FFFFFF; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
        .mod-map-popup .mod-map-popup-open:hover { background: #1a1a1a; }
        .mod-map-popup .leaflet-popup-close-button { top: 10px !important; right: 10px !important; width: 24px !important; height: 24px !important; font-size: 20px !important; line-height: 22px !important; padding: 0 !important; color: #707071 !important; border-radius: 4px !important; }
        .mod-map-popup .leaflet-popup-close-button:hover { background: #F4F4F4 !important; color: #0B0B0C !important; }
        .map-canvas { position: absolute; inset: 0; background:
            linear-gradient(rgba(180,190,200,0.4) 1px, transparent 1px) 0 0 / 80px 80px,
            linear-gradient(90deg, rgba(180,190,200,0.4) 1px, transparent 1px) 0 0 / 80px 80px,
            radial-gradient(circle at 30% 40%, rgba(165,200,160,0.35) 0%, transparent 25%),
            radial-gradient(circle at 70% 60%, rgba(120,170,220,0.35) 0%, transparent 30%),
            #E8ECEF; }
        .map-marker { position: absolute; width: 28px; height: 28px; margin: -28px 0 0 -14px; background: #D43711; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center; color: #FFFFFF; font-size: 10px; font-weight: 700; }
        .map-marker:hover { background: #B02F0E; transform: rotate(-45deg) scale(1.1); }
        .map-marker span { transform: rotate(45deg); }
        .map-toolbar { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 4px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
        .map-toolbar button { width: 30px; height: 30px; border: none; background: #FFFFFF; cursor: pointer; color: hsl(var(--foreground)); font-size: 16px; }
        .map-toolbar button:hover { background: #F4F4F4; }
        .map-toolbar button + button { border-top: 1px solid hsl(var(--border)); }
        .map-legend { position: absolute; bottom: 12px; left: 12px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; padding: 8px 12px; font-size: 12px; display: flex; gap: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
        .map-legend-item { display: flex; align-items: center; gap: 6px; }
        .map-legend-dot { width: 10px; height: 10px; border-radius: 50%; }

        /* Toast container + toasts */
        .toast-container { position: fixed; right: 20px; bottom: 20px; z-index: 30000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
        body.min-rail-on .toast-container { right: 64px; }
        .toast { min-width: 280px; max-width: 420px; padding: 12px 14px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-left: 4px solid hsl(var(--primary)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); display: flex; align-items: flex-start; gap: 10px; pointer-events: auto; animation: toast-in 0.22s ease-out; }
        .toast.closing { animation: toast-out 0.18s ease-in forwards; }
        @keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
        @keyframes toast-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }
        .toast-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
        .toast.toast-success { border-left-color: #2AB67D; }
        .toast.toast-success .toast-icon { color: #2AB67D; }
        .toast.toast-error { border-left-color: #D43711; }
        .toast.toast-error .toast-icon { color: #D43711; }
        .toast.toast-warning { border-left-color: #E8B22D; }
        .toast.toast-warning .toast-icon { color: #E8B22D; }
        .toast.toast-info { border-left-color: #3BCAEF; }
        .toast.toast-info .toast-icon { color: #3BCAEF; }
        .toast-body { flex: 1; min-width: 0; font-size: 13px; color: hsl(var(--foreground)); line-height: 1.4; }
        .toast-body strong { display: block; margin-bottom: 2px; }
        .toast-actions { display: flex; gap: 4px; flex-shrink: 0; }
        .toast-action { padding: 2px 8px; font-size: 12px; font-weight: 500; color: hsl(var(--primary)); background: transparent; border: none; cursor: pointer; border-radius: 3px; }
        .toast-action:hover { background: #F4F4F4; }
        .toast-close { width: 22px; height: 22px; border: none; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
        .toast-close:hover { background: #F4F4F4; }
        .toast-close svg { width: 12px; height: 12px; }

        /* Notification bell + panel */
        .notif-panel { position: fixed; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.14); min-width: 380px; max-width: 440px; max-height: 540px; z-index: 125; display: none; flex-direction: column; overflow: hidden; }
        .notif-panel.open { display: flex; }
        .notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid hsl(var(--border)); }
        .notif-title { font-size: 14px; font-weight: 700; color: hsl(var(--foreground)); }
        .notif-mark-all { font-size: 12px; color: hsl(var(--primary)); background: transparent; border: none; cursor: pointer; padding: 0; font-weight: 500; }
        .notif-mark-all:hover { text-decoration: underline; }
        .notif-tabs { display: flex; padding: 0 10px; gap: 2px; border-bottom: 1px solid hsl(var(--border)); background: #FAFAFA; }
        .notif-tab { padding: 8px 12px; font-size: 12px; font-weight: 500; color: hsl(var(--muted-foreground)); background: transparent; border: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
        .notif-tab.active { color: hsl(var(--foreground)); border-bottom-color: hsl(var(--primary)); }
        .notif-list { flex: 1; overflow-y: auto; }
        .notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #EFEFEF; cursor: pointer; position: relative; }
        .notif-item:hover { background: #FAFAFA; }
        .notif-item.unread { background: rgba(232,178,45,0.07); }
        .notif-item.unread::before { content: ''; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; background: hsl(var(--primary)); border-radius: 50%; margin-top: -3px; }
        .notif-item-avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
        .notif-item-body { flex: 1; min-width: 0; font-size: 13px; color: hsl(var(--foreground)); line-height: 1.4; }
        .notif-item-body strong { font-weight: 600; }
        .notif-item-time { font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 3px; }
        .notif-empty { padding: 40px 16px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13px; }
        .notif-foot { padding: 8px 16px; border-top: 1px solid hsl(var(--border)); display: flex; justify-content: space-between; align-items: center; background: #FAFAFA; }
        .notif-foot .sh-btn { font-size: 12px; height: 28px; padding: 0 10px; }
        .notif-dot { position: absolute; top: -2px; right: -2px; min-width: 14px; height: 14px; padding: 0 3px; background: #D43711; color: #FFFFFF; border-radius: 8px; font-size: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #FFFFFF; }

        /* Minimized records rail (right edge) — always visible */
        .min-rail { position: fixed; top: 42px; right: 0; bottom: 0; width: 44px; background: #FFFFFF; border-left: 1px solid hsl(var(--border)); padding: 8px 6px; z-index: 15; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; overflow-x: hidden; box-shadow: -2px 0 8px rgba(0,0,0,0.04); scrollbar-width: none; }
        .min-rail::-webkit-scrollbar { display: none; }
        .min-rail-items { scrollbar-width: none; }
        .min-rail-items::-webkit-scrollbar { display: none; }
        body.detail-fullscreen:not(.min-rail-on) .min-rail { display: none !important; }
        .min-rail-btn { width: 32px; height: 32px; border-radius: 50%; border: none; background: #2D2D2D; color: #FFFFFF; font-size: 12px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.12s ease, box-shadow 0.12s ease; position: relative; }
        .min-rail-btn:hover { transform: scale(1.08); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
        .min-rail-btn[data-color="yellow"] { background: #E8B22D; color: #2D2D2D; }
        .min-rail-btn[data-color="blue"] { background: #3BCAEF; color: #FFFFFF; }
        .min-rail-btn[data-color="green"] { background: #2AB67D; color: #FFFFFF; }
        .min-rail-btn[data-color="red"] { background: #D43711; color: #FFFFFF; }
        /* Hover tooltip for min-rail buttons — shows full task name to the left of the rail */
        .min-rail-tooltip { position: fixed; z-index: 200; background: #2D2D2D; color: #FFFFFF; padding: 8px 12px; border-radius: 6px; font-size: 12px; line-height: 1.4; max-width: 320px; box-shadow: 0 6px 18px rgba(0,0,0,0.18); pointer-events: none; display: none; white-space: normal; }
        .min-rail-tooltip::after { content: ''; position: absolute; left: 100%; top: 50%; margin-top: -5px; border: 5px solid transparent; border-left-color: #2D2D2D; }
        .min-rail-tooltip strong { display: block; font-size: 11px; font-weight: 600; color: #E8B22D; margin-bottom: 2px; }
        /* Adjust AI fab position so it doesn't collide with the rail when the rail is active */
        body.min-rail-on .ai-fab { right: 66px; }
        body.min-rail-on .ai-panel { right: 66px; }
        /* Posun celého obsahu doľava keď je min-rail aktívny — zabraňuje překrývaniu tabulky */
        body.min-rail-on .app > main { padding-right: 44px; transition: padding-right 0.15s ease; }
        /* Top-tabs musí byť na plnú šírku aj keď je min-rail aktívny */
        body.min-rail-on nav.top-tabs { width: calc(100% + 44px); }

        /* Active tab-icon state in detail header (chat/history) */
        .detail-icon-btn.active { background: #2D2D2D; color: #FFFFFF; }
        .detail-icon-btn.active:hover { background: #000000; color: #FFFFFF; }

        /* Floating detail modal (can open multiple, draggable + resizable) */
        .detail-modal-layer { position: fixed; inset: 0; pointer-events: none; z-index: 500; }
        .detail-modal { position: fixed; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; box-shadow: 0 20px 48px rgba(0,0,0,0.22), 0 4px 12px rgba(0,0,0,0.08); display: flex; flex-direction: column; overflow: hidden; pointer-events: auto; resize: both; min-width: 420px; min-height: 320px; }
        .detail-modal.dragging, .detail-modal.focused { box-shadow: 0 28px 60px rgba(0,0,0,0.28), 0 6px 16px rgba(0,0,0,0.12); }
        .detail-modal .detail-head { cursor: grab; user-select: none; }
        .detail-modal .detail-head.dragging { cursor: grabbing; }
        .detail-modal .detail-body { min-height: 0; }
        /* Snap overlay — preview rect shown while dragging near screen edges */
        .modal-snap-overlay { position: fixed; z-index: 499; background: rgba(59,130,246,0.12); border: 2px solid rgba(59,130,246,0.55); border-radius: 10px; pointer-events: none; display: none; transition: left .1s,top .1s,width .1s,height .1s; }
        .modal-snap-overlay.visible { display: block; }
        /* Maximized modal — TRUE fullscreen: prekrýva header, sidebar, rail, AI FAB, všetko */
        .detail-modal.maximized {
            left: 0 !important; top: 0 !important;
            width: 100vw !important; height: 100vh !important;
            resize: none; border-radius: 0;
            z-index: 9999 !important;
        }
        body.min-rail-on .detail-modal.maximized { width: 100vw !important; }
        .detail-modal.maximized .detail-head { cursor: default; }
        /* Skry iba ai-artifacts-panel pod fullscreen modálom — min-rail ostáva viditeľný
           pre rýchle prepínanie medzi minimalizovanými záznamami.
           AI chat FAB/panel (z-index 10001/10002) je vždy dostupný. */
        body.detail-fullscreen .ai-artifacts-panel { display: none !important; }
        body.detail-fullscreen.min-rail-on .min-rail { display: flex !important; z-index: 10000 !important; top: 42px !important; }
        body.detail-fullscreen.min-rail-on .detail-modal.maximized { width: calc(100vw - 44px) !important; }
        /* Duplicate-open highlight animation — krátky scale + border/shadow flash */
        @keyframes detailDupePulse {
            0%   { transform: translateY(0) scale(1);     box-shadow: 0 20px 48px rgba(0,0,0,0.22), 0 4px 12px rgba(0,0,0,0.08); border-color: hsl(var(--border)); }
            30%  { transform: translateY(-2px) scale(1.045); box-shadow: 0 0 0 3px rgba(232,178,45,0.55), 0 32px 72px rgba(232,178,45,0.35); border-color: #E8B22D; }
            70%  { transform: translateY(-1px) scale(1.015); box-shadow: 0 0 0 2px rgba(232,178,45,0.35), 0 28px 60px rgba(232,178,45,0.22); border-color: #E8B22D; }
            100% { transform: translateY(0) scale(1);     box-shadow: 0 20px 48px rgba(0,0,0,0.22), 0 4px 12px rgba(0,0,0,0.08); border-color: hsl(var(--border)); }
        }
        .detail-modal.dupe-highlight { animation: detailDupePulse 0.65s ease-out; }
        /* Modal switcher (visible iba keď je niektorý modal maximizovaný) */
        .detail-modal-switcher {
            position: absolute; top: 46px; left: 0; right: 0;
            display: flex; gap: 4px; padding: 6px 10px; background: #FAFAFA;
            border-bottom: 1px solid hsl(var(--border));
            overflow-x: auto; white-space: nowrap;
        }
        .detail-modal.maximized .detail-body { padding-top: 44px; }
        .detail-modal:not(.maximized) .detail-modal-switcher { display: none; }
        .detail-modal-switcher-item {
            display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
            background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 999px;
            font-size: 12px; color: #2D2D2D; cursor: pointer; max-width: 220px;
        }
        .detail-modal-switcher-item:hover { background: #F4F4F4; }
        .detail-modal-switcher-item.active { background: #2D2D2D; color: #FFFFFF; border-color: #2D2D2D; }
        .detail-modal-switcher-item .sw-letter {
            width: 18px; height: 18px; border-radius: 50%; background: #E8B22D; color: #2D2D2D;
            display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 10px; flex-shrink: 0;
        }
        .detail-modal-switcher-item.active .sw-letter { background: #FFFFFF; color: #2D2D2D; }
        .detail-modal-switcher-item .sw-title {
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px;
        }
        .detail-modal-switcher-item .sw-min,
        .detail-modal-switcher-item .sw-close {
            width: 14px; height: 14px; border: none; background: transparent; color: inherit; opacity: 0.55; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
        }
        .detail-modal-switcher-item .sw-min:hover,
        .detail-modal-switcher-item .sw-close:hover { opacity: 1; }
        .detail-modal-switcher-item .sw-min svg,
        .detail-modal-switcher-item .sw-close svg { width: 11px; height: 11px; }
        /* Rail actions — Otvoriť / minimalizovať všetky, umiestnené v pravom dolnom rohu railu */
        .min-rail-items { flex: 1; display: flex; flex-direction: column; gap: 6px; align-items: center; width: 100%; min-height: 0; overflow-y: auto; }
        .min-rail-actions {
            display: flex; flex-direction: column; gap: 4px; padding: 6px 0 4px;
            border-top: 1px solid #EDEDED; margin-top: auto; width: 100%;
            align-items: center; flex-shrink: 0; background: #FFFFFF;
        }
        .min-rail-action {
            width: 32px; height: 32px; border: 1px solid hsl(var(--border)); background: #FFFFFF;
            border-radius: 6px; color: #2D2D2D; cursor: pointer;
            display: inline-flex; align-items: center; justify-content: center;
            padding: 0; flex-shrink: 0;
        }
        .min-rail-action:hover { background: #F4F4F4; }
        .min-rail-action svg { width: 14px; height: 14px; }
        .min-rail-action:disabled { opacity: 0.35; cursor: not-allowed; }
        /* Maximize button — rovnaký štýl ako ostatné detail-icon-btn; v split paneli
           (docked side) nemá zmysel, tak ho tam skryjeme. */
        .detail-icon-btn.detail-maximize-btn svg { transition: transform 0.15s ease; }
        .detail-panel .detail-maximize-btn { display: none; }
        .min-rail-items { display: flex; flex-direction: column; gap: 4px; align-items: center; }
        .min-rail-tooltip { pointer-events: none; }

        /* Gantt timeline header — match the dtable header gray stripe */
        .gantt2-timeline-header { background: #E6E6E6; }
        .gantt2-timeline-months { background: #E6E6E6; border-bottom: 1px solid #D4D4D4 !important; }
        .gantt2-month-cell { background: #E6E6E6 !important; border-right: 1px solid #D4D4D4 !important; color: hsl(var(--foreground)); font-weight: 600; }
        .gantt2-timeline-days { background: #EDEDED; border-bottom: 1px solid hsl(var(--border)) !important; }
        .gantt2-day-cell { background: #EDEDED !important; border-right: 1px solid #D4D4D4 !important; color: hsl(var(--foreground)); font-weight: 500; }
        .gantt2-day-cell .dow { color: hsl(var(--muted-foreground)); }
        .gantt2-day-cell.weekend { background: #E4E4E4 !important; }
        .gantt2-day-cell.today { background: #F9F4E1 !important; }
        /* User feedback: "Detaily záznamu trochu zmenši toto odsadenie." — zúženie paddingu v head + tabs + body. */
        .detail-head { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px 8px; }
        .detail-title { font-size: 16px; font-weight: 700; color: hsl(var(--foreground)); margin: 0; line-height: 1.35; flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
        .detail-meta { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
        .detail-id { font-size: 13px; font-weight: 600; color: hsl(var(--muted-foreground)); margin-right: 4px; }
        .detail-icon-btn { width: 28px; height: 28px; border: none; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; }
        .detail-icon-btn:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .detail-icon-btn svg { width: 16px; height: 16px; }
        .detail-tabs { display: flex; gap: 2px; padding: 4px 12px 0; border-bottom: 1px solid hsl(var(--border)); overflow-x: auto; flex-shrink: 0; scrollbar-width: none; }
        .detail-tabs::-webkit-scrollbar { display: none; }
        .detail-tab { background: transparent; border: none; padding: 8px 12px; font-size: 13px; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 6px 6px 0 0; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
        .detail-tab:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .detail-tab.active { background: #F4F4F4; color: hsl(var(--foreground)); font-weight: 600; border-bottom-color: hsl(var(--primary)); }
        .detail-body { flex: 1; overflow: auto; padding: 10px 14px 20px; }
        .detail-body .form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 14px; margin-bottom: 14px; }
        .detail-body .form-field { gap: 4px; }
        .detail-body .form-field > label { font-size: 12px; font-weight: 500; color: hsl(var(--muted-foreground)); letter-spacing: 0.01em; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
        .detail-body .form-field > label .req { color: hsl(var(--destructive)); }
        .detail-body .detail-tab-panel > .form-field:first-child { margin-bottom: 10px; }
        /* All inputs across the detail form share a single typographic scale — font 13px, height 36px.
           Výnimka: textarea musí mať vlastnú (auto) výšku + vertikálny padding, inak sa obsah tlačí k hornému
           okraju bez medzery (bug: padding-top pri Poznámke). Preto textarea vyňatý z fixed-height pravidla. */
        .detail-body .sh-input,
        .detail-body .adv-select-trigger,
        .detail-body .multi-trigger,
        .detail-body .form-checkbox-row { font-size: 13px; font-weight: 400; height: 36px; }
        .detail-body textarea.sh-input { font-size: 13px; font-weight: 400; height: auto; min-height: 72px; padding: 8px 12px; resize: vertical; line-height: 1.45; }
        .detail-body .detail-tab-panel > .form-field:first-child .sh-input { font-size: 13px; height: 36px; font-weight: 400; }
        .detail-body .multi-chip { font-size: 13px; }
        .detail-body .multi-placeholder { font-size: 13px; }
        .detail-body .adv-select-label { font-size: 13px; }
        .detail-body .form-grid-3 + .form-grid-3 { margin-top: 0; }
        /* Boolean field — no frame, just the checkbox aligned like other inputs */
        .detail-body .form-checkbox-row { height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 4px; border: none; background: transparent; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; }
        .detail-body .detail-dropzone { padding: 10px; min-height: 64px; gap: 8px; }
        .detail-tab-panel { display: none; }
        .detail-tab-panel.active { display: block; }
        .detail-tab-empty { padding: 40px 20px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13px; }
        .detail-rel-input { position: relative; display: flex; align-items: stretch; }
        .detail-rel-input .sh-input { flex: 1; padding-right: 36px; background: #FAFAFA; cursor: default; }
        .detail-rel-open { position: absolute; right: 0; top: 0; bottom: 0; width: 32px; border: none; background: transparent; border-left: 1px solid hsl(var(--border)); border-radius: 0 4px 4px 0; color: hsl(var(--muted-foreground)); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
        .detail-rel-open:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .detail-rel-open svg { width: 14px; height: 14px; }
        .detail-dropzone { border: 1px dashed hsl(var(--border)); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 64px; }
        .detail-dz-new { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; background: #FFFFFF; color: hsl(var(--muted-foreground)); border: 1px solid hsl(var(--border)); border-radius: 4px; font-size: 11px; cursor: pointer; margin-top: auto; }
        .detail-dz-new:hover { background: #F4F4F4; color: hsl(var(--foreground)); border-color: #C0C0C0; }
        .detail-dz-new svg { width: 11px; height: 11px; }
        /* Dropzone itself is clickable */
        .detail-dropzone { cursor: pointer; }
        .detail-dropzone:hover { border-color: hsl(var(--primary) / 0.4); background: hsl(var(--primary) / 0.02); }
        .detail-file-chip { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: #F4F4F4; border: 1px solid hsl(var(--border)); border-radius: 4px; font-size: 12px; color: hsl(var(--foreground)); align-self: stretch; max-width: 100%; min-width: 0; }
        .detail-file-chip svg { width: 14px; height: 14px; color: hsl(var(--muted-foreground)); flex-shrink: 0; }
        .detail-file-chip a { color: hsl(var(--foreground)); text-decoration: underline; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .detail-file-chip button { width: 18px; height: 18px; border: none; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
        .detail-file-chip button:hover { background: rgba(0,0,0,0.08); color: hsl(var(--foreground)); }
        .detail-file-chip button svg { width: 12px; height: 12px; }
        /* User feedback: "odstráň túto sivú lištu" — sivé pozadie + border-top footeru odstránené,
           akčné tlačidlá zostávajú ale splývajú s panelom bez vizuálneho oddelenia. */
        .detail-footer { display: flex !important; flex-wrap: nowrap !important; align-items: center; justify-content: flex-end; gap: 6px; padding: 10px 14px; background: transparent; border-top: none; flex-shrink: 0; position: relative; overflow: hidden !important; min-width: 0; max-width: 100%; }
        .detail-footer .detail-action { flex-shrink: 0 !important; }
        .detail-footer .detail-overflow-btn { flex-shrink: 0 !important; }
        .detail-modal .detail-footer, .detail-panel .detail-footer { flex-wrap: nowrap !important; overflow: hidden !important; }
        /* Visual detail (faktúra, ponuka, atď.) — editovateľné inputy s viditeľným borderom (zjavne editovateľné) */
        /* Tier 1: light (white) variant */
        .ds-vis input.ds-vis-input,
        .ds-vis input[type="text"].ds-vis-input,
        .ds-vis input[type="number"].ds-vis-input,
        .ds-vis input[type="date"].ds-vis-input,
        input.ds-vis-input {
            width: 100% !important;
            box-sizing: border-box !important;
            padding: 8px 12px !important;
            font: inherit !important;
            color: #0B0B0C !important;
            outline: none !important;
            transition: background 0.15s, border-color 0.15s, box-shadow 0.15s !important;
            border: 1px solid hsl(var(--border)) !important;
            background: #FFFFFF !important;
            border-radius: 8px !important;
            min-height: 36px !important;
            -webkit-appearance: none !important;
            -moz-appearance: none !important;
            appearance: none !important;
        }
        /* Tier 2: dark variant — vyššia špecificita ako light */
        .ds-vis input.ds-vis-input.ds-vis-input-dark,
        .ds-vis input[type="text"].ds-vis-input.ds-vis-input-dark,
        .ds-vis input[type="number"].ds-vis-input.ds-vis-input-dark,
        input.ds-vis-input.ds-vis-input-dark {
            background: rgba(255, 255, 255, 0.08) !important;
            border: 1px solid rgba(255, 255, 255, 0.30) !important;
            color: #FFFFFF !important;
            border-radius: 8px !important;
        }
        .ds-vis input.ds-vis-input:hover { border-color: #BFBFBF !important; }
        .ds-vis input.ds-vis-input:focus { border-color: #E8B22D !important; box-shadow: 0 0 0 3px rgba(232, 178, 45, 0.18) !important; }
        .ds-vis input.ds-vis-input.ds-vis-input-dark:hover { background: rgba(255, 255, 255, 0.14) !important; border-color: rgba(255, 255, 255, 0.50) !important; }
        .ds-vis input.ds-vis-input.ds-vis-input-dark:focus { background: rgba(232, 178, 45, 0.20) !important; border-color: #E8B22D !important; box-shadow: 0 0 0 3px rgba(232, 178, 45, 0.30) !important; }
        /* Visual items table — zarovnaná hlavička + riadky cez zdielanú grid template + min-width:0 */
        .ds-vis-items-row { display: grid; grid-template-columns: 5fr 1fr 1fr 1fr 1fr 1fr 28px; gap: 8px; align-items: center; }
        .ds-vis-items-row > * { min-width: 0; }
        .ds-vis-items-head { background: #F4F4F4; padding: 10px 28px; font-size: 11px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.06em; }
        .ds-vis-items-head > *  { padding: 0 12px; }
        .ds-vis-items-head .num { text-align: right; }
        /* Read-only inputs (computed values) — vyzerajú ako statický text, bez border + bg */
        .ds-vis input.ds-vis-input[readonly] { border: none !important; background: transparent !important; box-shadow: none !important; padding: 6px 0 !important; cursor: default !important; }
        .ds-vis input.ds-vis-input[readonly]:hover, .ds-vis input.ds-vis-input[readonly]:focus { border: none !important; background: transparent !important; box-shadow: none !important; }
        /* Delete row button — bez border, len ikona */
        .ds-vis .ds-vis-row-delete { border: none !important; background: transparent !important; }
        .ds-vis .ds-vis-row-delete:hover { background: rgba(178, 48, 48, 0.10) !important; }
        .ds-vis .ds-vis-select .adv-select-trigger { border-radius: 8px !important; height: 36px !important; border: 1px solid hsl(var(--border)) !important; background: #FFFFFF !important; }
        .ds-vis .ds-vis-select.ds-vis-select-dark .adv-select-trigger { background: rgba(255, 255, 255, 0.08) !important; border-color: rgba(255, 255, 255, 0.30) !important; color: #FFFFFF !important; }
        .ds-vis-input:hover { border-color: #BFBFBF; }
        .ds-vis-input:focus { border-color: #E8B22D; box-shadow: 0 0 0 3px rgba(232, 178, 45, 0.18); background: #FFFFFF; }
        .ds-vis-input.ds-vis-input-num { font-variant-numeric: tabular-nums; }
        .ds-vis-input.ds-vis-input-dark { color: #FFFFFF; background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.18); }
        .ds-vis-input.ds-vis-input-dark::placeholder { color: rgba(255, 255, 255, 0.4); }
        .ds-vis-input.ds-vis-input-dark:hover { background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.36); }
        .ds-vis-input.ds-vis-input-dark:focus { background: rgba(232, 178, 45, 0.18); border-color: #E8B22D; box-shadow: 0 0 0 3px rgba(232, 178, 45, 0.25); color: #FFFFFF; }
        .ds-vis-input[type="date"] { font-variant-numeric: tabular-nums; }
        .ds-vis-input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.6; }
        .ds-vis-input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
        .ds-vis-input.ds-vis-input-dark[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); }
        .ds-vis-select .adv-select-trigger { background: #FFFFFF; border: 1px solid hsl(var(--border)); padding: 0 28px 0 10px; height: 32px; font: inherit; color: inherit; border-radius: 6px; }
        .ds-vis-select .adv-select-trigger:hover { border-color: #BFBFBF; }
        .ds-vis-select.open .adv-select-trigger { border-color: #E8B22D; box-shadow: 0 0 0 3px rgba(232, 178, 45, 0.18); }
        .ds-vis-select.ds-vis-select-dark .adv-select-trigger { color: #FFFFFF; background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.18); }
        .ds-vis-select.ds-vis-select-dark .adv-select-trigger .adv-select-chevron { color: rgba(255, 255, 255, 0.6); }
        .ds-vis-select.ds-vis-select-dark .adv-select-trigger:hover { background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.36); }
        .ds-vis-items-row { display: grid; grid-template-columns: 5fr 1fr 1fr 1fr 1fr 1fr 28px; gap: 12px; padding: 8px 0; border-bottom: 1px solid #F0F0F2; align-items: center; }
        .ds-vis-row-remove { width: 24px; height: 24px; border: none; background: transparent; cursor: pointer; color: hsl(var(--muted-foreground)); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; }
        .ds-vis-row-remove:hover { background: rgba(214, 68, 68, 0.10); color: #B23030; }
        /* Print view — len ds-vis (faktúra) sa tlačí, ostatné UI je skryté */
        @media print {
            body * { visibility: hidden !important; }
            .ds-vis, .ds-vis * { visibility: visible !important; }
            .ds-vis { position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; box-shadow: none !important; border: none !important; }
            .ds-vis-input { border-bottom-color: transparent !important; background: transparent !important; }
            .ds-vis [data-vis-items], .ds-vis [data-vis-items] * { visibility: visible !important; }
            button { display: none !important; }
        }
        .detail-footer .sh-btn { gap: 4px; padding: 0 10px; }
        .detail-footer .sh-btn-icon-sm { padding: 0; }
        .detail-footer .detail-action.ds-hidden { display: none; }

        /* ---------- Detail chat (discussion) ---------- */
        .chat-panel { display: flex; flex-direction: column; height: calc(100% - 20px); min-height: 360px; max-height: calc(100vh - 240px); border: 1px solid hsl(var(--border)); border-radius: 8px; overflow: hidden; background: #FFFFFF; }
        .chat-messages { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: #FAFAFA; }
        .chat-msg { display: flex; gap: 8px; align-items: flex-start; max-width: 88%; }
        .chat-msg-other { align-self: flex-start; }
        .chat-msg-self { align-self: flex-end; flex-direction: row-reverse; }
        .chat-avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
        .chat-msg-bubble { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: hsl(var(--foreground)); line-height: 1.45; word-wrap: break-word; }
        .chat-msg-self .chat-msg-bubble { background: #2D2D2D; color: #FFFFFF; border-color: #2D2D2D; }
        .chat-msg-self .chat-msg-bubble .chat-msg-meta { color: rgba(255,255,255,0.7); }
        .chat-msg-meta { font-size: 11px; color: hsl(var(--muted-foreground)); margin-bottom: 4px; }
        .chat-msg-text { white-space: pre-wrap; }
        .chat-mention { color: #E8B22D; font-weight: 600; background: rgba(232,178,45,0.14); padding: 1px 4px; border-radius: 3px; }
        .chat-msg-self .chat-mention { color: #FFD77A; background: rgba(255,215,122,0.18); }
        .chat-compose { position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid hsl(var(--border)); background: #FFFFFF; }
        .chat-compose textarea { flex: 1; min-height: 38px; max-height: 140px; padding: 9px 12px; border: 1px solid hsl(var(--border)); border-radius: 8px; font-size: 13px; font-family: inherit; color: hsl(var(--foreground)); resize: none; outline: none; line-height: 1.4; background: #FAFAFA; }
        .chat-compose textarea:focus { border-color: #E8B22D; background: #FFFFFF; box-shadow: 0 0 0 3px rgba(232,178,45,0.18); }
        .chat-mention-menu { position: absolute; bottom: 100%; left: 10px; right: 10px; margin-bottom: 6px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); padding: 4px; max-height: 220px; overflow: auto; z-index: 10; }
        .chat-mention-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; }
        .chat-mention-item:hover, .chat-mention-item.active { background: #F4F4F4; }
        .chat-mention-item .chat-avatar { width: 22px; height: 22px; font-size: 10px; }
        .chat-mention-item .chat-mention-sub { margin-left: auto; color: hsl(var(--muted-foreground)); font-size: 11px; }

        /* Monday-style Comments / Discussion */
        .cmt-filters { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #FFFFFF; border-bottom: 1px solid hsl(var(--border)); flex-wrap: wrap; }
        .cmt-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: #F4F4F4; border: 1px solid transparent; border-radius: 14px; font-size: 11.5px; color: hsl(var(--foreground)); cursor: pointer; transition: all 0.12s ease; }
        .cmt-chip:hover { background: #EAEAEA; }
        .cmt-chip.active { background: #2D2D2D; color: #FFFFFF; }
        .cmt-chip-count { background: rgba(255,255,255,0.2); padding: 0 5px; border-radius: 8px; font-size: 10px; }
        .cmt-chip:not(.active) .cmt-chip-count { background: #DDDDDD; color: hsl(var(--muted-foreground)); }
        .cmt-filters .cmt-grow { flex: 1; }
        .cmt-sort-btn, .cmt-subscribe-btn { background: transparent; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 11.5px; padding: 4px 10px; cursor: pointer; color: hsl(var(--foreground)); }
        .cmt-sort-btn:hover, .cmt-subscribe-btn:hover { background: #F4F4F4; }
        .cmt-subscribe-btn.on { background: #FFFBEE; border-color: #E8B22D; color: #B08218; }
        .cmt-ai-btn { background: #2D2D2D; color: #FFFFFF; border: none; border-radius: 6px; font-size: 11.5px; padding: 4px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
        .cmt-ai-btn:hover { background: #1a1a1a; }

        .cmt-list { flex: 1; overflow: auto; padding: 10px 12px 8px; display: flex; flex-direction: column; gap: 10px; background: #FAFAFA; }
        .cmt-item { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 10px 12px; transition: border-color 0.12s ease; }
        .cmt-item.pinned { background: #FFFBEE; border-color: #F3E4AC; }
        .cmt-item.resolved { opacity: 0.72; }
        .cmt-item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
        .cmt-item-head .chat-avatar { width: 28px; height: 28px; font-size: 11px; }
        .cmt-author { font-weight: 600; font-size: 13px; color: hsl(var(--foreground)); }
        .cmt-time { font-size: 11px; color: hsl(var(--muted-foreground)); }
        .cmt-edited-badge, .cmt-pin-badge, .cmt-resolved-badge { font-size: 10px; padding: 1px 6px; border-radius: 10px; background: #EDEDED; color: hsl(var(--muted-foreground)); font-weight: 500; }
        .cmt-pin-badge { background: #FFF4C6; color: #8A6720; }
        .cmt-resolved-badge { background: #D4F5D4; color: #2E7D32; }
        .cmt-kebab { background: transparent; border: none; cursor: pointer; color: hsl(var(--muted-foreground)); padding: 2px 4px; margin-left: auto; border-radius: 4px; line-height: 0; }
        .cmt-kebab:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .cmt-kebab svg { width: 14px; height: 14px; }
        .cmt-kebab-menu { position: absolute; min-width: 180px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); padding: 4px; z-index: 150; display: none; }
        .cmt-kebab-menu.open { display: block; }
        .cmt-kebab-item { padding: 7px 10px; font-size: 12.5px; color: hsl(var(--foreground)); cursor: pointer; border-radius: 4px; display: flex; align-items: center; gap: 8px; }
        .cmt-kebab-item:hover { background: #F4F4F4; }
        .cmt-kebab-item.danger { color: #D43711; }
        .cmt-kebab-item.danger:hover { background: #FEEFE9; }
        .cmt-kebab-separator { height: 1px; background: hsl(var(--border)); margin: 4px 0; }

        .cmt-body { font-size: 13px; line-height: 1.55; color: hsl(var(--foreground)); }
        .cmt-body p { margin: 0 0 6px; }
        .cmt-body ul, .cmt-body ol { margin: 4px 0 6px 20px; }
        .cmt-body code { background: #F4F4F4; padding: 1px 5px; border-radius: 3px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
        .cmt-body pre { background: #F4F4F4; padding: 8px 10px; border-radius: 6px; overflow: auto; font-family: ui-monospace, Menlo, monospace; font-size: 12px; margin: 6px 0; }
        .cmt-body a { color: hsl(var(--primary)); text-decoration: underline; }
        .cmt-body strong { font-weight: 700; }
        .cmt-body em { font-style: italic; }

        .cmt-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
        .cmt-attach-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: #F4F4F4; border-radius: 6px; font-size: 11.5px; color: hsl(var(--foreground)); cursor: pointer; }
        .cmt-attach-chip:hover { background: #EAEAEA; }

        .cmt-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
        .cmt-reaction { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: #F4F4F4; border: 1px solid transparent; border-radius: 12px; font-size: 12px; cursor: pointer; transition: all 0.1s ease; line-height: 1; }
        .cmt-reaction:hover { background: #EAEAEA; }
        .cmt-reaction.mine { background: #FFFBEE; border-color: #E8B22D; color: #B08218; }
        .cmt-reaction-add { background: transparent; border: 1px dashed #D4D4D4; padding: 2px 8px; color: hsl(var(--muted-foreground)); font-size: 14px; line-height: 1; border-radius: 12px; cursor: pointer; }
        .cmt-reaction-add:hover { border-color: #AAAAAA; color: hsl(var(--foreground)); }
        .cmt-reaction-picker { position: absolute; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); padding: 6px 8px; z-index: 150; display: none; gap: 4px; }
        .cmt-reaction-picker.open { display: flex; }
        .cmt-reaction-picker button { background: transparent; border: none; font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 6px; border-radius: 4px; }
        .cmt-reaction-picker button:hover { background: #F4F4F4; }

        .cmt-actions-row { display: flex; gap: 4px; margin-top: 4px; }
        .cmt-action-btn { background: transparent; border: none; color: hsl(var(--muted-foreground)); font-size: 11.5px; padding: 2px 6px; border-radius: 4px; cursor: pointer; }
        .cmt-action-btn:hover { background: #F4F4F4; color: hsl(var(--foreground)); }
        .cmt-action-btn strong { font-weight: 600; }

        .cmt-replies { margin-top: 8px; padding-left: 14px; border-left: 2px solid #EDEDED; display: flex; flex-direction: column; gap: 8px; }
        .cmt-reply { background: #FAFAFA; border: 1px solid hsl(var(--border)); border-radius: 6px; padding: 8px 10px; }
        .cmt-replies-toggle { background: transparent; border: none; color: hsl(var(--primary)); font-size: 11.5px; font-weight: 500; padding: 4px 0; cursor: pointer; }
        .cmt-replies-toggle:hover { text-decoration: underline; }
        .cmt-reply-compose { margin-top: 8px; border-top: 1px dashed #E4E4E4; padding-top: 8px; display: none; }
        .cmt-reply-compose.open { display: block; }

        .cmt-compose-wrap { background: #FFFFFF; border-top: 1px solid hsl(var(--border)); padding: 10px 12px; }
        .cmt-rte-toolbar { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border: 1px solid hsl(var(--border)); border-bottom: none; border-radius: 8px 8px 0 0; background: #FAFAFA; flex-wrap: wrap; }
        .cmt-rte-btn { background: transparent; border: none; padding: 4px 6px; border-radius: 4px; cursor: pointer; color: hsl(var(--foreground)); font-size: 12px; display: inline-flex; align-items: center; gap: 3px; }
        .cmt-rte-btn:hover { background: #EAEAEA; }
        .cmt-rte-btn.active { background: #2D2D2D; color: #FFFFFF; }
        .cmt-rte-btn svg { width: 13px; height: 13px; }
        .cmt-rte-sep { width: 1px; height: 18px; background: #DDDDDD; margin: 0 4px; }
        .cmt-editor { min-height: 64px; max-height: 200px; padding: 10px 12px; border: 1px solid hsl(var(--border)); border-top: none; border-radius: 0 0 8px 8px; font-size: 13px; color: hsl(var(--foreground)); outline: none; overflow-y: auto; line-height: 1.55; background: #FFFFFF; }
        .cmt-editor:focus { border-color: #E8B22D; box-shadow: 0 0 0 3px rgba(232,178,45,0.14); }
        .cmt-editor[placeholder]:empty::before { content: attr(placeholder); color: hsl(var(--muted-foreground)); pointer-events: none; }
        .cmt-compose-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
        .cmt-typing { font-size: 11.5px; color: hsl(var(--muted-foreground)); font-style: italic; }
        .cmt-compose-grow { flex: 1; }
        .cmt-send-btn { background: #2D2D2D; color: #FFFFFF; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; padding: 6px 14px; cursor: pointer; }
        .cmt-send-btn:hover { background: #1a1a1a; }
        .cmt-send-btn[disabled] { background: #BFBFBF; cursor: not-allowed; }

        .cmt-mention-dropdown { position: absolute; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); padding: 4px; max-height: 220px; overflow: auto; z-index: 150; min-width: 260px; display: none; }
        .cmt-mention-dropdown.open { display: block; }

        /* Responsive adjustments */
        @media (max-width: 720px) {
            .cmt-filters { gap: 4px; padding: 6px; }
            .cmt-chip { padding: 3px 8px; font-size: 11px; }
            .cmt-rte-toolbar { overflow-x: auto; flex-wrap: nowrap; }
            .cmt-item { padding: 8px 10px; }
        }

        /* ---------- Detail history ---------- */
        .hist-panel { display: flex; flex-direction: column; gap: 10px; }
        .hist-entry { border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 12px 14px; background: #FFFFFF; }
        .hist-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
        .hist-author { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: hsl(var(--foreground)); min-width: 0; }
        .hist-avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
        .hist-count { color: hsl(var(--muted-foreground)); }
        .hist-right { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
        .hist-time { font-size: 12px; color: hsl(var(--muted-foreground)); white-space: nowrap; }
        .hist-restore { height: 26px; font-size: 12px; padding: 0 10px; }
        .hist-diffs { display: flex; flex-direction: column; gap: 4px; }
        .hist-diff { display: flex; align-items: center; gap: 8px; font-size: 12px; color: hsl(var(--foreground)); padding: 4px 8px; background: #FAFAFA; border-radius: 5px; flex-wrap: wrap; }
        .hist-attr { font-weight: 600; color: hsl(var(--foreground)); min-width: 100px; }
        .hist-old { color: hsl(var(--muted-foreground)); text-decoration: line-through; background: rgba(212,55,17,0.08); padding: 1px 6px; border-radius: 3px; }
        .hist-arrow { color: hsl(var(--muted-foreground)); }
        .hist-new { color: hsl(var(--foreground)); background: rgba(42,182,125,0.12); padding: 1px 6px; border-radius: 3px; font-weight: 500; }

        /* ---------- Reverse relation (e.g. Trackovanie tab) ---------- */
        .rel-block { display: flex; flex-direction: column; gap: 0; border: 1px solid hsl(var(--border)); border-radius: 8px; overflow: hidden; background: #FFFFFF; }
        .rel-head { padding: 12px 14px 8px; border-bottom: 1px solid hsl(var(--border)); }
        .rel-title { font-size: 14px; font-weight: 700; color: hsl(var(--foreground)); }
        .rel-title .req { color: hsl(var(--destructive)); margin-left: 2px; }
        /* Toolbar is a single row that never wraps; items shrink / scroll on narrow widths. */
        .rel-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid hsl(var(--border)); background: #FAFAFA; flex-wrap: nowrap; overflow-x: auto; }
        .rel-toolbar::-webkit-scrollbar { height: 6px; }
        .rel-toolbar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 3px; }
        .rel-btn { position: relative; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid hsl(var(--border)); background: #FFFFFF; color: hsl(var(--foreground)); border-radius: 6px; cursor: pointer; flex-shrink: 0; }
        .rel-btn:hover { border-color: #BFBFBF; }
        .rel-btn svg { width: 14px; height: 14px; }
        .rel-btn.rel-btn-primary { background: #2D2D2D; border-color: #2D2D2D; color: #FFFFFF; }
        .rel-btn.rel-btn-primary:hover { background: #000000; border-color: #000000; }
        .rel-btn.rel-btn-view { width: auto; padding: 0 6px 0 8px; gap: 2px; }
        .rel-btn.rel-btn-view .rel-btn-chev { width: 12px; height: 12px; color: hsl(var(--muted-foreground)); }
        .rel-btn-badge { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; font-size: 10px; color: hsl(var(--muted-foreground)); display: inline-flex; align-items: center; justify-content: center; font-weight: 500; }
        .rel-table-wrap { position: relative; overflow: hidden; min-height: 120px; background: #FFFFFF; }
        /* Reuse main dtable visuals but slightly tighter for the embedded relation. */
        .rel-dtable { font-size: 12px; }
        .rel-dtable thead tr:first-child th { height: 32px; }
        .rel-dtable thead tr.filter-row th { height: 30px; top: 32px; }
        .rel-dtable .col-filter-wrap { height: 30px; }
        .rel-empty { padding: 32px 16px; text-align: center; color: hsl(var(--muted-foreground)); font-size: 12px; }
        .rel-pager { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid hsl(var(--border)); background: #FAFAFA; font-size: 12px; color: hsl(var(--muted-foreground)); }
        .rel-pager-nav { display: inline-flex; align-items: center; gap: 2px; }
        .rel-pgbtn { min-width: 26px; height: 26px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: hsl(var(--foreground)); border-radius: 3px; cursor: pointer; font-size: 12px; }
        .rel-pgbtn:hover:not(:disabled) { background: #F4F4F4; }
        .rel-pgbtn:disabled { opacity: 0.35; cursor: default; }
        .rel-pgbtn svg { width: 12px; height: 12px; }
        .rel-pgbtn.rel-pgbtn-active { background: #2D2D2D; color: #FFFFFF; }
        .rel-pager-size { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: 1px solid hsl(var(--border)); border-radius: 3px; background: #FFFFFF; font-size: 11px; cursor: pointer; color: hsl(var(--foreground)); }
        .rel-pager-size svg { width: 10px; height: 10px; color: hsl(var(--muted-foreground)); }
        .rel-pager-count { color: hsl(var(--muted-foreground)); font-size: 12px; margin-left: auto; }
        .detail-overflow-menu { min-width: 200px; z-index: 200; }

        /* Bulk edit modal */
        .be-section { margin-top: 20px; }
        .be-section:first-of-type { margin-top: 0; }
        .be-section-head { display: flex; align-items: center; margin-bottom: 10px; }
        .be-section-title { font-size: 13px; font-weight: 600; color: hsl(var(--foreground)); }
        .be-list { display: flex; flex-direction: column; gap: 8px; }
        .be-attr-row { display: grid; grid-template-columns: 260px 1fr 32px; gap: 10px; align-items: center; padding: 10px 12px; background: #FAFAFA; border: 1px solid hsl(var(--border)); border-radius: 6px; }
        .be-eq-row { grid-template-columns: 280px 1fr 32px; }
        .be-attr-row .be-attr-label { font-size: 13px; font-weight: 500; color: hsl(var(--foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .be-attr-row .be-attr-input .sh-input, .be-attr-row .be-attr-input .adv-select-trigger, .be-attr-row .be-attr-input .multi-trigger { height: 36px; }
        .be-eq-row .be-eq-target .adv-select, .be-eq-row .be-eq-target .adv-select-trigger { width: 100%; }
        .be-eq-row .be-eq-target .adv-select-trigger { height: 36px; position: relative; padding: 0 32px 0 12px; }
        .be-eq-row .be-eq-target .adv-select-chevron { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
        .be-eq-row .be-eq-eq .sh-input { height: 36px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; }
        .be-attr-row .be-del { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid hsl(var(--border)); background: #FFFFFF; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 4px; }
        .be-attr-row .be-del:hover { color: hsl(var(--destructive)); }
        .be-attr-row .be-del svg { width: 14px; height: 14px; }
        .be-empty { font-size: 12px; color: hsl(var(--muted-foreground)); padding: 8px 12px; background: #FAFAFA; border: 1px dashed hsl(var(--border)); border-radius: 6px; text-align: center; }
        .be-add-row { display: flex; gap: 8px; margin-top: 14px; }
        .be-attr-picker { margin-top: 10px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; padding: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
        .be-attr-picker-list { max-height: 260px; overflow: auto; padding: 4px; }
        .be-attr-picker-item { padding: 8px 10px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; border-radius: 4px; }
        .be-attr-picker-item:hover { background: #F4F4F4; }
        .be-attr-picker-item.disabled { color: hsl(var(--muted-foreground)); cursor: not-allowed; opacity: 0.55; }
        .be-attr-picker-item.disabled:hover { background: transparent; }
        /* Equations rows — visually identical to attribute rows */

        /* ---------- AI chat (floating) ---------- */
        .ai-fab { position: fixed; right: 22px; bottom: 76px; width: 56px; height: 56px; border-radius: 50%; border: none; background: #E8B22D; color: #2D2D2D; cursor: grab; box-shadow: 0 6px 20px rgba(232,178,45,0.45), 0 2px 6px rgba(0,0,0,0.12); display: inline-flex; align-items: center; justify-content: center; z-index: 10001; transition: transform 0.15s ease, box-shadow 0.15s ease; user-select: none; }
        .ai-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(232,178,45,0.55), 0 3px 8px rgba(0,0,0,0.14); }
        .ai-fab:active { transform: translateY(0); }
        .ai-fab-icon { width: 22px; height: 22px; }
        .ai-fab-pulse { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(232,178,45,0.6); animation: aiFabPulse 2.4s ease-out infinite; pointer-events: none; }
        @keyframes aiFabPulse { 0% { transform: scale(0.9); opacity: 0.75; } 100% { transform: scale(1.35); opacity: 0; } }
        .ai-fab.open .ai-fab-pulse { display: none; }

        .ai-panel { position: fixed; right: 22px; bottom: 146px; width: 420px; max-width: calc(100vw - 44px); height: 600px; max-height: calc(100vh - 120px); background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 16px; box-shadow: 0 20px 48px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.08); display: none; flex-direction: column; overflow: hidden; z-index: 10002; }
        .ai-panel.open { display: flex; animation: aiPanelIn 0.18s ease-out; }
        @keyframes aiPanelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
        .ai-panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #2D2D2D; color: #FFFFFF; cursor: grab; user-select: none; }
        .ai-panel-head:active { cursor: grabbing; }
        .ai-mode-tabs { display: flex; background: #2D2D2D; border-bottom: 1px solid rgba(255,255,255,0.12); flex-shrink: 0; }
        .ai-mode-tab { flex: 1; padding: 7px 12px; background: transparent; border: none; border-bottom: 2px solid transparent; font-size: 12.5px; cursor: pointer; font-weight: 500; color: rgba(255,255,255,0.55); transition: color 0.15s; }
        .ai-mode-tab:hover { color: rgba(255,255,255,0.85); }
        .ai-mode-tab.active { color: #FFFFFF; border-bottom-color: #E8B22D; }
        .ai-panel-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
        .ai-panel-badge { width: 32px; height: 32px; border-radius: 10px; background: #E8B22D; color: #2D2D2D; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .ai-panel-badge svg { width: 18px; height: 18px; }
        .ai-panel-title-text { display: flex; flex-direction: column; gap: 0; min-width: 0; }
        .ai-panel-title-text strong { font-size: 14px; font-weight: 600; }
        .ai-panel-subtitle { font-size: 11px; color: rgba(255,255,255,0.7); }
        .ai-panel-actions { display: flex; gap: 4px; flex-shrink: 0; }
        .ai-panel-icon-btn { width: 30px; height: 30px; border: none; background: transparent; color: #FFFFFF; cursor: pointer; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
        .ai-panel-icon-btn:hover { background: rgba(255,255,255,0.1); }
        .ai-panel-icon-btn svg { width: 16px; height: 16px; }

        .ai-panel-body { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: #FAFAFA; }
        .ai-msg { display: flex; gap: 8px; align-items: flex-start; }
        .ai-msg-bot { align-self: flex-start; max-width: 92%; }
        .ai-msg-user { align-self: flex-end; max-width: 82%; flex-direction: row-reverse; }
        .ai-msg-avatar { width: 28px; height: 28px; border-radius: 50%; background: #E8B22D; color: #2D2D2D; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .ai-msg-avatar svg { width: 16px; height: 16px; }
        .ai-msg-user .ai-msg-avatar { background: #2D2D2D; color: #FFFFFF; font-size: 11px; font-weight: 700; }
        .ai-msg-bubble { background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: hsl(var(--foreground)); line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
        .ai-msg-bot .ai-msg-bubble { border-top-left-radius: 4px; }
        .ai-msg-user .ai-msg-bubble { background: #2D2D2D; color: #FFFFFF; border-color: #2D2D2D; border-top-right-radius: 4px; }
        .ai-msg-welcome .ai-msg-bubble { background: linear-gradient(180deg, #FFFBEE 0%, #FFFFFF 100%); border-color: rgba(232,178,45,0.4); }
        .ai-capabilities { margin: 8px 0 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
        .ai-capabilities li { font-size: 12.5px; color: hsl(var(--foreground)); }

        .ai-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
        .ai-typing span { width: 6px; height: 6px; background: hsl(var(--muted-foreground)); border-radius: 50%; animation: aiTypingDot 1.1s infinite ease-in-out both; }
        .ai-typing span:nth-child(2) { animation-delay: 0.15s; }
        .ai-typing span:nth-child(3) { animation-delay: 0.3s; }
        @keyframes aiTypingDot { 0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

        .ai-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; padding: 0 2px; }
        /* AI chat — rozšírené UX */
        .ai-toolbar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid hsl(var(--border)); background: #FAFAFA; flex-wrap: wrap; font-size: 11px; }
        .ai-toolbar-btn { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 12px; cursor: pointer; color: hsl(var(--foreground)); font-size: 11px; }
        .ai-toolbar-btn:hover { background: #F0F0F0; }
        .ai-toolbar-btn.active { background: #2D2D2D; color: #FFFFFF; border-color: #2D2D2D; }
        .ai-toolbar-btn svg { width: 11px; height: 11px; }
        .ai-cost-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: #EDEDED; border-radius: 10px; font-size: 10.5px; color: hsl(var(--muted-foreground)); }
        .ai-cost-pill strong { color: hsl(var(--foreground)); font-weight: 600; }
        .ai-slash-menu { position: absolute; bottom: 100%; left: 12px; right: 12px; margin-bottom: 4px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.14); max-height: 260px; overflow: auto; padding: 6px; z-index: 20; display: none; }
        .ai-slash-menu.open { display: block; }
        .ai-slash-group { font-size: 10px; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 8px 2px; font-weight: 600; }
        .ai-slash-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: hsl(var(--foreground)); }
        .ai-slash-item:hover, .ai-slash-item.focused { background: #F6F4EA; }
        .ai-slash-item-ic { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: #F0F0F0; border-radius: 5px; font-size: 13px; }
        .ai-slash-item-body { flex: 1; min-width: 0; }
        .ai-slash-item-title { font-weight: 500; }
        .ai-slash-item-sub { font-size: 10.5px; color: hsl(var(--muted-foreground)); }
        .ai-slash-item-hint { font-size: 10px; color: hsl(var(--muted-foreground)); background: #F4F4F4; padding: 1px 5px; border-radius: 4px; flex-shrink: 0; }
        /* Inline action buttons in bot messages */
        .ai-actions-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
        .ai-action-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; background: #2D2D2D; color: #FFFFFF; border: none; border-radius: 6px; font-size: 11.5px; cursor: pointer; font-weight: 500; }
        .ai-action-btn:hover { background: #1a1a1a; }
        .ai-action-btn.outline { background: #FFFFFF; color: hsl(var(--foreground)); border: 1px solid hsl(var(--border)); }
        .ai-action-btn.outline:hover { background: #F0F0F0; }
        .ai-action-btn.danger { background: #D43711; }
        .ai-action-btn.danger:hover { background: #B02F0E; }
        /* Tools transparency block */
        .ai-tools-block { margin-top: 8px; padding: 6px 10px; background: #F6F4EA; border: 1px solid #EFE4BE; border-radius: 6px; font-size: 11.5px; color: hsl(var(--foreground)); }
        .ai-tools-head { display: flex; align-items: center; gap: 5px; cursor: pointer; font-weight: 500; color: hsl(var(--muted-foreground)); font-size: 11px; user-select: none; }
        .ai-tools-head::before { content: '▸'; transition: transform 0.12s ease; }
        .ai-tools-block.open .ai-tools-head::before { transform: rotate(90deg); }
        .ai-tools-list { margin-top: 6px; display: none; font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: hsl(var(--muted-foreground)); }
        .ai-tools-block.open .ai-tools-list { display: block; }
        .ai-tools-list > div { padding: 2px 0; }
        .ai-tools-list strong { color: hsl(var(--foreground)); font-weight: 600; }
        /* Undo bar */
        .ai-undo-bar { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; color: hsl(var(--muted-foreground)); }
        .ai-undo-btn { background: transparent; border: 1px solid hsl(var(--border)); border-radius: 4px; padding: 2px 8px; cursor: pointer; color: hsl(var(--foreground)); font-size: 11px; }
        .ai-undo-btn:hover { background: #FEEFE9; border-color: #D43711; color: #D43711; }
        /* Streaming cursor */
        .ai-stream-cursor { display: inline-block; width: 2px; height: 14px; background: #2D2D2D; vertical-align: -2px; margin-left: 1px; animation: aiBlink 0.9s steps(2) infinite; }
        @keyframes aiBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
        /* Artifacts side panel */
        .ai-artifacts-panel { position: fixed; right: 22px; bottom: 92px; width: 540px; max-width: calc(100vw - 44px); height: 600px; max-height: calc(100vh - 120px); background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 16px; box-shadow: 0 20px 48px rgba(0,0,0,0.18); display: none; flex-direction: column; overflow: hidden; z-index: 129; }
        .ai-artifacts-panel.open { display: flex; }
        .ai-panel.open.with-artifacts { right: calc(22px + 540px + 14px); transition: right 0.2s ease; }
        .ai-artifacts-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid hsl(var(--border)); background: #FAFAFA; }
        .ai-artifacts-head strong { font-size: 13px; color: hsl(var(--foreground)); flex: 1; }
        .ai-artifacts-body { flex: 1; overflow: auto; padding: 16px; font-size: 13px; }
        .ai-artifacts-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: hsl(var(--muted-foreground)); text-align: center; padding: 40px 20px; gap: 10px; }
        .ai-artifact-card { border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 12px; background: #FFFFFF; }
        .ai-artifact-card + .ai-artifact-card { margin-top: 10px; }
        .ai-artifact-title { font-size: 12px; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
        .ai-artifact-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: #F0F0F0; border-radius: 10px; font-size: 11px; margin: 2px; }
        .ai-artifact-code { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; background: #2D2D2D; color: #E6E6E6; padding: 10px; border-radius: 6px; overflow: auto; white-space: pre; }
        /* Responsive for AI panel */
        @media (max-width: 720px) {
            .ai-panel { right: 8px; left: 8px; bottom: 80px; width: auto; max-width: none; height: calc(100vh - 120px); }
            .ai-artifacts-panel { right: 8px; left: 8px; bottom: 80px; width: auto; max-width: none; height: calc(100vh - 120px); }
            .ai-panel.open.with-artifacts { right: 8px; left: 8px; }
            .ai-toolbar { flex-wrap: wrap; }
            .ai-cost-pill { font-size: 10px; }
        }
        /* Diff preview modal */
        .ai-diff-overlay { position: fixed; inset: 0; background: rgba(15,15,15,0.55); backdrop-filter: blur(4px); z-index: 1001; display: none; align-items: center; justify-content: center; padding: 20px; }
        .ai-diff-overlay.open { display: flex; }
        .ai-diff-modal { width: 720px; max-width: 100%; max-height: 80vh; background: #FFFFFF; border-radius: 12px; box-shadow: 0 24px 64px rgba(0,0,0,0.22); display: flex; flex-direction: column; overflow: hidden; }
        .ai-diff-head { padding: 14px 18px; border-bottom: 1px solid hsl(var(--border)); display: flex; align-items: center; gap: 10px; }
        .ai-diff-head strong { font-size: 15px; color: hsl(var(--foreground)); flex: 1; }
        .ai-diff-body { flex: 1; overflow: auto; padding: 16px; }
        .ai-diff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
        .ai-diff-col { background: #FAFAFA; border: 1px solid hsl(var(--border)); border-radius: 6px; padding: 10px; font-size: 12px; min-height: 200px; }
        .ai-diff-col h5 { margin: 0 0 8px; font-size: 11px; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.05em; }
        .ai-diff-col .added { background: #D4F5D4; padding: 1px 4px; border-radius: 3px; }
        .ai-diff-col .removed { background: #FFD1D1; padding: 1px 4px; border-radius: 3px; text-decoration: line-through; color: #8A1A0D; }
        .ai-diff-warn { margin-top: 12px; background: #FFF4C6; border-left: 4px solid #E8B22D; padding: 10px 12px; font-size: 12px; border-radius: 4px; }
        .ai-diff-foot { padding: 12px 18px; border-top: 1px solid hsl(var(--border)); display: flex; gap: 8px; justify-content: flex-end; background: #FAFAFA; }
        @media (max-width: 720px) { .ai-diff-cols { grid-template-columns: 1fr; } }
        .ai-chip { padding: 6px 10px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 999px; font-size: 12px; color: hsl(var(--foreground)); cursor: pointer; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
        .ai-chip:hover { background: #FFFBEE; border-color: rgba(232,178,45,0.6); color: #2D2D2D; }

        .ai-panel-input { display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px; border-top: 1px solid hsl(var(--border)); background: #FFFFFF; }
        .ai-panel-input textarea { flex: 1; min-height: 40px; max-height: 140px; padding: 10px 12px; border: 1px solid hsl(var(--border)); border-radius: 10px; font-size: 13px; font-family: inherit; color: hsl(var(--foreground)); resize: none; outline: none; line-height: 1.4; background: #FAFAFA; }
        .ai-panel-input textarea:focus { border-color: #E8B22D; background: #FFFFFF; box-shadow: 0 0 0 3px rgba(232,178,45,0.18); }
        .ai-input-icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid transparent; color: #707071; cursor: pointer; border-radius: 10px; flex-shrink: 0; transition: all 0.15s ease; }
        .ai-input-icon-btn:hover { background: #F4F4F4; color: #2D2D2D; border-color: hsl(var(--border)); }
        .ai-input-icon-btn svg { width: 18px; height: 18px; }
        .ai-input-icon-btn.recording { background: rgba(212,55,17,0.12); color: #C63310; border-color: rgba(212,55,17,0.35); animation: aiMicPulse 1.2s ease-in-out infinite; }
        @keyframes aiMicPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(212,55,17,0.3); } 50% { box-shadow: 0 0 0 6px rgba(212,55,17,0); } }
        .ai-send { width: 40px; height: 40px; border: none; border-radius: 10px; background: #2D2D2D; color: #FFFFFF; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.15s ease; }
        /* Attachments strip above input */
        .ai-attachments { padding: 8px 12px 0; background: #FFFFFF; display: flex; flex-wrap: wrap; gap: 6px; max-height: 140px; overflow-y: auto; }
        .ai-att { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; background: #F4F4F4; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 12px; color: #2D2D2D; max-width: 220px; }
        .ai-att .ai-att-ic { width: 14px; height: 14px; flex-shrink: 0; color: #707071; }
        .ai-att .ai-att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
        .ai-att .ai-att-size { color: #9B9C9D; font-size: 11px; flex-shrink: 0; }
        .ai-att .ai-att-remove { width: 18px; height: 18px; border: none; background: transparent; color: #707071; cursor: pointer; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .ai-att .ai-att-remove:hover { background: #EDEDED; color: #C63310; }
        .ai-att .ai-att-remove svg { width: 12px; height: 12px; }
        .ai-att-thumb { width: 20px; height: 20px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
        .ai-send:hover { background: #000000; }
        .ai-send:disabled { background: #D4D4D4; cursor: not-allowed; }
        .ai-send svg { width: 16px; height: 16px; }
        .ai-panel-foot { padding: 6px 14px 10px; font-size: 11px; color: hsl(var(--muted-foreground)); text-align: center; background: #FFFFFF; }

        /* ---------- AI Feedback (bug / nápad → Google Doc) ---------- */
        .ai-feedback-view { position: absolute; inset: 93px 0 0 0; background: #FFFFFF; display: none; flex-direction: column; z-index: 5; }
        .ai-panel.feedback-open .ai-feedback-view { display: flex; }
        .ai-panel.feedback-open .ai-toolbar,
        .ai-panel.feedback-open .ai-panel-body,
        .ai-panel.feedback-open .ai-attachments,
        .ai-panel.feedback-open .ai-panel-input,
        .ai-panel.feedback-open .ai-panel-foot { display: none !important; }
        .ai-feedback-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid hsl(var(--border)); background: #FAFAFA; }
        .ai-feedback-head strong { font-size: 13px; color: hsl(var(--foreground)); flex: 1; }
        .ai-feedback-back { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; background: transparent; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 12px; color: hsl(var(--foreground)); cursor: pointer; }
        .ai-feedback-back:hover { background: #F0F0F0; }
        .ai-feedback-back svg { width: 11px; height: 11px; }
        .ai-feedback-sub { font-size: 11px; color: hsl(var(--muted-foreground)); }
        a.ai-feedback-sub { text-decoration: none; cursor: pointer; }
        a.ai-feedback-sub:hover { text-decoration: underline; color: hsl(var(--foreground)); }
        .ai-feedback-body { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
        .ai-feedback-tabs { display: flex; gap: 6px; background: #F4F4F4; padding: 4px; border-radius: 8px; }
        .ai-feedback-tab { flex: 1; padding: 7px 10px; background: transparent; border: none; border-radius: 6px; font-size: 12.5px; color: hsl(var(--foreground)); cursor: pointer; font-weight: 500; }
        .ai-feedback-tab.active { background: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,0.08); color: #2D2D2D; }
        .ai-feedback-label { font-size: 11.5px; font-weight: 600; color: hsl(var(--foreground)); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: -4px; }
        .ai-feedback-label .req { color: #D43711; }
        .ai-feedback-input,
        .ai-feedback-textarea { width: 100%; padding: 9px 11px; border: 1px solid hsl(var(--border)); border-radius: 8px; font-size: 13px; font-family: inherit; color: hsl(var(--foreground)); background: #FAFAFA; resize: none; outline: none; box-sizing: border-box; }
        .ai-feedback-input:focus,
        .ai-feedback-textarea:focus { border-color: #E8B22D; background: #FFFFFF; box-shadow: 0 0 0 3px rgba(232,178,45,0.18); }
        .ai-feedback-textarea { min-height: 110px; line-height: 1.5; }
        .ai-feedback-rte { width: 100%; padding: 9px 11px; border: 1px solid hsl(var(--border)); border-radius: 8px; font-size: 13px; font-family: inherit; color: hsl(var(--foreground)); background: #FAFAFA; outline: none; box-sizing: border-box; min-height: 110px; line-height: 1.5; overflow-y: auto; max-height: 240px; white-space: pre-wrap; word-wrap: break-word; cursor: text; }
        .ai-feedback-rte:focus { border-color: #E8B22D; background: #FFFFFF; box-shadow: 0 0 0 3px rgba(232,178,45,0.18); }
        .ai-feedback-rte:empty::before { content: attr(data-placeholder); color: #9EA0A6; pointer-events: none; display: block; }
        .ai-feedback-rte img { max-width: 100%; border-radius: 4px; margin: 4px 0; display: block; max-height: 200px; object-fit: contain; }
        .ai-feedback-prio { display: flex; gap: 4px; flex-wrap: wrap; }
        .ai-feedback-prio-btn { flex: 1; min-width: 60px; padding: 6px 8px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 6px; font-size: 12px; color: hsl(var(--foreground)); cursor: pointer; }
        .ai-feedback-prio-btn:hover { background: #F4F4F4; }
        .ai-feedback-prio-btn.active { background: #2D2D2D; color: #FFFFFF; border-color: #2D2D2D; }
        .ai-feedback-prio-btn[data-prio="Kritická"].active { background: #D43711; border-color: #D43711; }
        .ai-feedback-prio-btn[data-prio="Vysoká"].active { background: #E8B22D; border-color: #E8B22D; color: #2D2D2D; }
        .ai-feedback-drop { border: 1.5px dashed hsl(var(--border)); border-radius: 8px; padding: 18px 10px; text-align: center; font-size: 12.5px; color: hsl(var(--muted-foreground)); cursor: pointer; background: #FAFAFA; transition: border-color 0.15s, background 0.15s; }
        .ai-feedback-drop:hover,
        .ai-feedback-drop.drag { border-color: #E8B22D; background: #FFFBEE; color: #2D2D2D; }
        .ai-feedback-drop .link { color: #8A6A1C; text-decoration: underline; }
        .ai-feedback-files { display: flex; flex-wrap: wrap; gap: 8px; }
        .ai-feedback-files:empty { display: none; }
        .ai-fb-file { position: relative; width: 72px; height: 72px; border: 1px solid hsl(var(--border)); border-radius: 6px; overflow: hidden; background: #F4F4F4; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; font-size: 10px; color: hsl(var(--muted-foreground)); }
        .ai-fb-file img { width: 100%; height: 100%; object-fit: cover; }
        .ai-fb-file-ic { font-size: 20px; }
        .ai-fb-file-name { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
        .ai-fb-file-remove { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #FFFFFF; border: none; cursor: pointer; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
        .ai-fb-file-remove:hover { background: #D43711; }
        .ai-feedback-ctx { background: #F6F4EA; border: 1px solid #EFE4BE; border-radius: 6px; padding: 8px 10px; font-size: 11.5px; color: #5A4A16; display: grid; grid-template-columns: 1fr; gap: 2px; }
        .ai-feedback-ctx strong { color: #2D2D2D; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; }
        .ai-feedback-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid hsl(var(--border)); background: #FFFFFF; }
        .ai-feedback-cancel { padding: 8px 14px; background: #FFFFFF; border: 1px solid hsl(var(--border)); border-radius: 8px; font-size: 13px; color: hsl(var(--foreground)); cursor: pointer; }
        .ai-feedback-cancel:hover { background: #F4F4F4; }
        .ai-feedback-submit { flex: 1; padding: 8px 14px; background: #2D2D2D; color: #FFFFFF; border: none; border-radius: 8px; font-size: 13px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
        .ai-feedback-submit:hover { background: #000000; }
        .ai-feedback-submit:disabled { background: #9B9C9D; cursor: not-allowed; }
        .ai-feedback-spin { width: 13px; height: 13px; border: 2px solid rgba(255,255,255,0.35); border-top-color: #FFFFFF; border-radius: 50%; animation: aiFbSpin 0.7s linear infinite; }
        @keyframes aiFbSpin { to { transform: rotate(360deg); } }
        .ai-feedback-msg { padding: 10px 12px; border-radius: 6px; font-size: 12.5px; }
        .ai-feedback-msg.ok { background: #E8F7EF; border: 1px solid #A8D9BE; color: #1B5A35; }
        .ai-feedback-msg.err { background: #FDECE8; border: 1px solid #F3B8AA; color: #8A1A0D; }
        .ai-feedback-msg a { color: inherit; font-weight: 600; text-decoration: underline; }
        /* Setup overlay — prvé použitie */
        .ai-feedback-setup { position: absolute; inset: 0; background: rgba(255,255,255,0.98); padding: 18px; overflow: auto; display: none; flex-direction: column; gap: 12px; z-index: 10; }
        .ai-panel.feedback-setup-open .ai-feedback-setup { display: flex; }
        .ai-feedback-setup h4 { margin: 0; font-size: 14px; color: #2D2D2D; }
        .ai-feedback-setup ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: hsl(var(--foreground)); }
        .ai-feedback-setup ol a { color: #8A6A1C; }
        .ai-feedback-setup code { background: #F4F4F4; padding: 1px 4px; border-radius: 3px; font-size: 11.5px; }
        .ai-feedback-setup .link-btn { background: transparent; border: none; color: #8A6A1C; text-decoration: underline; cursor: pointer; padding: 0; font-size: 12.5px; }
        .ai-feedback-setup-actions { display: flex; gap: 8px; margin-top: 4px; }
        .ai-feedback-toolbar-btn { background: #FFF3D1 !important; border-color: #E8B22D !important; color: #6F4E0F !important; }
        .ai-feedback-toolbar-btn:hover { background: #FFEBB0 !important; }

        @media (max-width: 520px) {
            .ai-panel { right: 10px; left: 10px; width: auto; bottom: 140px; height: calc(100vh - 160px); }
            .ai-fab { right: 14px; bottom: 70px; }
        }

        /* Conditional formatting rule card */
        .format-rule { border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 16px; margin-bottom: 12px; background: #FFFFFF; position: relative; }
        .format-rule-del { position: absolute; right: 10px; top: 10px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid hsl(var(--border)); background: #FFFFFF; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 4px; }
        .format-rule-del:hover { color: hsl(var(--destructive)); }
        .format-rule-del svg { width: 14px; height: 14px; }
        .color-input { display: flex; align-items: center; gap: 8px; }
        .color-swatch { width: 36px; height: 36px; padding: 0; border: 1px solid hsl(var(--border)); border-radius: 4px; background: transparent; cursor: pointer; }
        .color-input .sh-input { flex: 1; }
        .format-cond-builder { margin-top: 16px; padding: 12px; background: #FAFAFA; border: 1px solid hsl(var(--border)); border-radius: 6px; }
        /* Cron builder modal — 3-úrovňový editor */
        .cb-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 2500; display: none; align-items: center; justify-content: center; padding: 20px; }
        .cb-overlay.open { display: flex; }
        .cb-modal { background: #FFFFFF; border-radius: 12px; max-width: 780px; width: 100%; max-height: 92vh; overflow: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.4); }
        .cb-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid hsl(var(--border)); }
        .cb-head h3 { margin: 0; font-size: 18px; flex: 1; }
        .cb-head .cb-close { background: transparent; border: none; font-size: 20px; cursor: pointer; padding: 4px 10px; border-radius: 6px; }
        .cb-head .cb-close:hover { background: #F4F4F4; }
        .cb-body { padding: 22px; }
        .cb-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid hsl(var(--border)); padding-bottom: 0; }
        .cb-tab { padding: 8px 14px; background: transparent; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-size: 13px; color: hsl(var(--muted-foreground)); margin-bottom: -1px; }
        .cb-tab.active { color: hsl(var(--foreground)); border-bottom-color: #E8B22D; font-weight: 600; }
        .cb-tab-panel { display: none; }
        .cb-tab-panel.active { display: block; }
        .cb-preset { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: #F8F8F8; border: 1px solid hsl(var(--border)); border-radius: 8px; margin-bottom: 8px; cursor: pointer; transition: all 0.15s; }
        .cb-preset:hover { background: #FFFBEE; border-color: #E8B22D; }
        .cb-preset.selected { background: #FFFBEE; border-color: #E8B22D; box-shadow: 0 0 0 2px rgba(232, 178, 45, 0.25); }
        .cb-preset-label { font-weight: 500; }
        .cb-preset-cron { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: hsl(var(--muted-foreground)); padding: 3px 8px; background: #FFFFFF; border-radius: 4px; }
        .cb-visual-row { display: grid; grid-template-columns: 140px 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
        .cb-visual-row > label { font-size: 12.5px; color: hsl(var(--muted-foreground)); font-weight: 500; }
        .cb-dow-picker { display: flex; gap: 4px; }
        .cb-dow-btn { padding: 6px 10px; background: #F4F4F4; border: 1px solid hsl(var(--border)); border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 500; transition: all 0.1s; }
        .cb-dow-btn.active { background: #E8B22D; color: #2D2D2D; border-color: #B38318; }
        .cb-cron-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 14px; }
        .cb-cron-box { display: flex; flex-direction: column; align-items: center; }
        .cb-cron-box input { width: 100%; text-align: center; padding: 8px; border: 1px solid hsl(var(--border)); border-radius: 6px; font-family: ui-monospace, Menlo, monospace; font-size: 14px; font-weight: 600; }
        .cb-cron-box input:focus { outline: none; border-color: #E8B22D; box-shadow: 0 0 0 2px rgba(232, 178, 45, 0.2); }
        .cb-cron-box small { margin-top: 4px; font-size: 10px; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.05em; }
        .cb-nl { padding: 12px 14px; background: #F1FAF4; border: 1px solid #BCE4CF; border-radius: 8px; font-size: 13px; color: #2E7D32; margin-bottom: 14px; }
        .cb-nl strong { font-weight: 600; }
        .cb-next-runs { padding: 12px 14px; background: #F4F4F4; border-radius: 8px; font-size: 12px; }
        .cb-next-runs-title { font-weight: 600; margin-bottom: 6px; font-size: 12.5px; color: hsl(var(--foreground)); }
        .cb-next-run { padding: 4px 0; font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: hsl(var(--muted-foreground)); }
        .cb-opts { margin-top: 18px; padding-top: 18px; border-top: 1px solid hsl(var(--border)); }
        .cb-opts h4 { margin: 0 0 10px; font-size: 13px; }
        .cb-opts-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dashed hsl(var(--border)); font-size: 12.5px; }
        .cb-opts-row:last-child { border-bottom: none; }
        .cb-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid hsl(var(--border)); background: #FAFAFA; }

        /* Impersonation banner — sticky top, vizuálne nelze prehliadnuť */
        .imp-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 3000; display: none; align-items: center; gap: 14px; padding: 10px 20px; background: linear-gradient(90deg, #FF6B35, #F7B500); color: #FFFFFF; font-size: 13px; font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: imp-slide 0.3s ease; }
        .imp-banner.active { display: flex; }
        @keyframes imp-slide { from { transform: translateY(-100%); } to { transform: translateY(0); } }
        .imp-banner-icon { font-size: 22px; }
        .imp-banner-text { flex: 1; }
        .imp-banner-text strong { font-weight: 700; }
        .imp-banner-text small { display: block; font-size: 11.5px; opacity: 0.92; font-weight: 400; margin-top: 2px; }
        .imp-banner-timer { font-variant-numeric: tabular-nums; background: rgba(0,0,0,0.22); padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
        .imp-banner-btn { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4); color: #FFFFFF; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
        .imp-banner-btn:hover { background: rgba(255,255,255,0.32); }
        .imp-banner-btn.exit { background: rgba(0,0,0,0.3); }
        .imp-banner-btn.exit:hover { background: rgba(0,0,0,0.45); }
        body.imp-active { padding-top: 46px; }
        body.imp-active::before { content: ''; position: fixed; top: 46px; left: 0; right: 0; bottom: 0; pointer-events: none; box-shadow: inset 0 0 0 3px rgba(255,107,53,0.35); z-index: 2999; }

        /* Impersonation start modal */
        .imp-start-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 3100; display: none; align-items: center; justify-content: center; padding: 20px; }
        .imp-start-overlay.open { display: flex; }
        .imp-start-modal { background: #FFFFFF; border-radius: 10px; max-width: 520px; width: 100%; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
        .imp-start-modal h3 { margin: 0 0 8px; font-size: 18px; }
        .imp-start-modal p { margin: 0 0 14px; font-size: 13px; color: hsl(var(--muted-foreground)); }
        .imp-start-modal .imp-target { padding: 12px; background: #FFF4E6; border: 1px solid #F3D19E; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
        .imp-start-modal label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; margin-top: 10px; }
        .imp-start-modal .imp-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

        /* ---- Nav DS List Overlay (generic list view for nav items) ---- */
        #nav-ds-list-page .ndsl-topbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px 10px; border-bottom: 1px solid hsl(var(--border)); flex-shrink: 0; }
        #nav-ds-list-page .ndsl-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
        #nav-ds-list-page .ndsl-info { flex: 1; min-width: 0; }
        #nav-ds-list-page .ndsl-title { font-size: 17px; font-weight: 700; color: hsl(var(--foreground)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        #nav-ds-list-page .ndsl-sub { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 1px; }
        #nav-ds-list-page .ndsl-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 24px; border-bottom: 1px solid hsl(var(--border)); flex-shrink: 0; background: hsl(var(--background)); }
        #nav-ds-list-page .ndsl-toolbar .ndsl-search { position: relative; }
        #nav-ds-list-page .ndsl-toolbar .ndsl-search input { height: 32px; padding: 0 10px 0 32px; font-size: 13px; border: 1px solid hsl(var(--border)); border-radius: 6px; background: hsl(var(--background)); color: hsl(var(--foreground)); outline: none; width: 220px; }
        #nav-ds-list-page .ndsl-toolbar .ndsl-search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); pointer-events: none; }
        #nav-ds-list-page .ndsl-body { flex: 1; overflow: auto; padding: 0; }
        #nav-ds-list-page .ndsl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
        #nav-ds-list-page .ndsl-table thead th { position: sticky; top: 0; background: hsl(var(--background)); border-bottom: 1px solid hsl(var(--border)); padding: 9px 12px; font-weight: 600; font-size: 12px; color: hsl(var(--muted-foreground)); text-align: left; white-space: nowrap; user-select: none; }
        #nav-ds-list-page .ndsl-table thead th:first-child { width: 36px; padding: 9px 8px; }
        #nav-ds-list-page .ndsl-table tbody tr { border-bottom: 1px solid hsl(var(--border)); cursor: pointer; }
        #nav-ds-list-page .ndsl-table tbody tr:hover { background: hsl(var(--muted) / 0.5); }
        #nav-ds-list-page .ndsl-table tbody td { padding: 10px 12px; color: hsl(var(--foreground)); vertical-align: middle; white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
        #nav-ds-list-page .ndsl-table tbody td:first-child { padding: 10px 8px; }
        #nav-ds-list-page .ndsl-table tbody td .ndsl-id { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); padding: 2px 6px; border-radius: 4px; }
        #nav-ds-list-page .ndsl-table tbody td .ndsl-status { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 12px; }
        #nav-ds-list-page .ndsl-table .ndsl-row-actions { display: none; gap: 4px; }
        #nav-ds-list-page .ndsl-table tbody tr:hover .ndsl-row-actions { display: inline-flex; }
        #nav-ds-list-page .ndsl-table .ndsl-row-btn { background: none; border: 1px solid hsl(var(--border)); border-radius: 4px; padding: 3px 5px; cursor: pointer; color: hsl(var(--muted-foreground)); display: flex; align-items: center; }
        #nav-ds-list-page .ndsl-table .ndsl-row-btn:hover { color: hsl(var(--foreground)); background: hsl(var(--muted)); }
        #nav-ds-list-page .ndsl-footer { display: flex; align-items: center; padding: 8px 24px; border-top: 1px solid hsl(var(--border)); font-size: 12px; color: hsl(var(--muted-foreground)); flex-shrink: 0; gap: 16px; }

        /* ---- DS list inline view — uses same dtable component as tasks ---- */
        /* Pôvodné #view-ds-list { display: flex; } overrideovalo .view-container { display: none }
           kvôli ID specificite → prekrývalo view-table aj v prípade, že ds-list nebol aktívny.
           Fix: display: none default, flex iba pri .active (matchuje .view-container.active). */
        #view-ds-list { overflow: hidden; display: none; flex-direction: column; }
        #view-ds-list.active { display: flex; }
        #view-ds-list .table-wrap { position: relative; flex: 1; min-height: 0; overflow: auto; }
        #view-ds-list table.dtable thead { position: sticky; top: 0; z-index: 5; }
        #view-ds-list table.dtable tbody tr { cursor: pointer; }
        #view-ds-list table.dtable tbody td { vertical-align: middle; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
        #view-ds-list table.dtable tbody td.col-actions-td { text-align: right; }
        #view-ds-list .dsl-id { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); padding: 2px 6px; border-radius: 4px; }
        #view-ds-list .dsl-status { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 12px; }
        #view-ds-list .dsl-row-actions { display: none; gap: 4px; justify-content: flex-end; }
        #view-ds-list table.dtable tbody tr:hover .dsl-row-actions { display: inline-flex; }
        #view-ds-list .dsl-row-btn { background: none; border: 1px solid hsl(var(--border)); border-radius: 4px; padding: 3px 5px; cursor: pointer; color: hsl(var(--muted-foreground)); display: flex; align-items: center; }
        #view-ds-list .dsl-row-btn:hover { color: hsl(var(--foreground)); background: hsl(var(--muted)); }
        #view-ds-list .dsl-footer { padding: 8px 12px; border-top: 1px solid hsl(var(--border)); font-size: 12px; color: hsl(var(--muted-foreground)); background: hsl(var(--background)); flex-shrink: 0; }

        /* ---- DS record detail panel (right-side slide-in) ---- */
        .dsl-detail-wrap { position: fixed; inset: 0; z-index: 600; display: none; pointer-events: none; }
        .dsl-detail-wrap.open { display: block; }
        .dsl-detail-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.18); pointer-events: auto; }
        .dsl-detail-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 560px; min-width: 360px; max-width: 90vw; background: #FFFFFF; border-left: 1px solid hsl(var(--border)); display: flex; flex-direction: column; overflow: hidden; box-shadow: -4px 0 20px rgba(0,0,0,0.12); pointer-events: auto; transform: translateX(100%); transition: transform 0.22s cubic-bezier(0.22,1,0.36,1); }
        .dsl-detail-wrap.open .dsl-detail-panel { transform: translateX(0); }
        .dsl-detail-head { display: flex; align-items: flex-start; gap: 8px; padding: 14px 16px 10px; border-bottom: 1px solid hsl(var(--border)); flex-shrink: 0; }
        .dsl-detail-title { margin: 0; font-size: 16px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; color: hsl(var(--foreground)); }
        .dsl-detail-meta { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
        .dsl-detail-id { font-family: ui-monospace, Menlo, monospace; font-size: 12px; font-weight: 600; color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); padding: 2px 8px; border-radius: 4px; margin-right: 4px; }
        .dsl-detail-icon-btn { width: 28px; height: 28px; border: 1px solid transparent; background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
        .dsl-detail-icon-btn:hover { color: hsl(var(--foreground)); background: hsl(var(--muted)); border-color: hsl(var(--border)); }
        .dsl-detail-icon-btn svg { width: 14px; height: 14px; }
        .dsl-detail-icon-btn.dsl-detail-close:hover { color: #C63310; }
        html[data-theme="dark"] .dsl-detail-icon-btn:hover { background: #2A2D35; border-color: #3A3D45; color: #F4F4F6; }
        .dsl-detail-tabs { display: flex; border-bottom: 1px solid hsl(var(--border)); padding: 0 16px; flex-shrink: 0; }
        .dsl-detail-tab { padding: 8px 12px; font-size: 13px; font-weight: 500; border: none; background: none; cursor: pointer; color: hsl(var(--muted-foreground)); border-bottom: 2px solid transparent; margin-bottom: -1px; }
        .dsl-detail-tab.active { color: hsl(var(--foreground)); border-bottom-color: hsl(var(--primary)); }
        .dsl-detail-tab:hover:not(.active) { color: hsl(var(--foreground)); background: hsl(var(--muted) / 0.5); }
        .dsl-detail-body { flex: 1; overflow-y: auto; padding: 16px; }
        .dsl-detail-field { margin-bottom: 14px; }
        .dsl-detail-field label { display: block; font-size: 11.5px; font-weight: 600; color: hsl(var(--muted-foreground)); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
        .dsl-detail-field .dsl-field-val { font-size: 13px; color: hsl(var(--foreground)); padding: 6px 10px; background: hsl(var(--muted) / 0.4); border: 1px solid hsl(var(--border)); border-radius: 6px; min-height: 32px; line-height: 1.4; }
        .dsl-detail-field .dsl-status { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 12px; }
        .dsl-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
        .dsl-detail-placeholder { padding: 32px 0; text-align: center; color: hsl(var(--muted-foreground)); font-size: 13px; }
        html[data-theme="dark"] .dsl-detail-panel { background: #16181C; border-color: #2A2D35; }
        html[data-theme="dark"] .dsl-detail-field .dsl-field-val { background: rgba(255,255,255,0.04); border-color: #2A2D35; color: #D8D9DD; }

        /* Cross-DS relation link (cellHtml render) — klikateľný odkaz na target DS listing. */
        .rel-link { color: #2588A8; text-decoration: none; cursor: pointer; }
        .rel-link:hover { text-decoration: underline; color: #1A6B86; }
        .dtable tbody tr:hover td .rel-link { color: #1A6B86; }

/* =============================================================================
   MOBILE RESPONSIVE BATCH — 2026-04-24
   User feedback z Google Docu (35 položiek). CSS fixes pre iPhone / Android.
   ============================================================================= */

/* iOS zoom fix — font-size >= 16px na všetkých inputoch zabráni auto-zoomu pri fokuse.
   Mobile Safari zoomne, ak input má font < 16px; toto pravidlo platí iba na mobile. */
@media (max-width: 768px) {
    .sh-input, input.sh-input, textarea.sh-input, select, textarea, input[type="text"],
    input[type="email"], input[type="password"], input[type="number"], input[type="search"],
    input[type="tel"], input[type="url"], input[type="date"], input[type="datetime-local"],
    input[type="time"], .adv-select-trigger, .multi-trigger {
        font-size: 16px !important;
    }
}

/* Generic mobile helpers — skryté triedy pre "hide on mobile" + horizontálny scroll tabov. */
@media (max-width: 768px) {
    .mobile-hide { display: none !important; }
    .scrollable-tabs {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        scrollbar-width: none;
    }
    .scrollable-tabs::-webkit-scrollbar { display: none; }
}

/* ---- Tasks 1, 7, 12: mobile toolbar single-row + hide records count + scrollable tabs ---- */
@media (max-width: 768px) {
    /* Hlavný toolbar: všetky akcie musia byť v 1 riadku. Názov DŠ a šírka vyhľadávania
       sa škrtnú tak, aby sa zmestila lupa + pridať/zmazať/viac/filtre/stĺpce/pohľady. */
    .toolbar {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        padding: 6px 8px !important;
        gap: 4px !important;
        scrollbar-width: none;
    }
    .toolbar::-webkit-scrollbar { display: none; }
    /* Skryj názov DŠ nad tabuľkou (už máš breadcrumb + title bar). */
    #breadcrumb, .dse-title-seg, .toolbar-title { display: none !important; }
    /* View switcher: skryť label aktívneho pohľadu, nechať iba ikonku. */
    .vw-pill-label, .vm-pill-label, #view-select .vw-active-label,
    #view-select > span:not(.vw-ic):not(.chev) { display: none !important; }
    /* Search: skry "Hľadať úlohu…" label, ikona lupy ostane ako jediná indikácia. */
    #tbl-quick-search::placeholder { color: transparent; }
    #tbl-quick-search { width: 36px !important; min-width: 36px !important; padding-left: 30px !important; transition: width 0.2s ease; }
    #tbl-quick-search:focus { width: 160px !important; }
    /* Footer pri zozname záznamov — skry "300 záznamov" text, aby sa zmestil pager + prepínače. */
    .table-footer .rel-pager-count, .table-footer #pager-count, .table-footer .total-records,
    .table-footer .tf-records-info { display: none !important; }
    /* Horizontálne tab switchery (DSE, CS, view-modal, atď.) — scrollovateľné na mobile. */
    .dse-tabs, .cs-top-tabs, #cs-top-tabs, .modal-tabs, .dse-cat-strip, .cb-tabs,
    .dsl-detail-tabs, .detail-tabs {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        scrollbar-width: none;
    }
    .dse-tabs::-webkit-scrollbar, .cs-top-tabs::-webkit-scrollbar,
    #cs-top-tabs::-webkit-scrollbar, .modal-tabs::-webkit-scrollbar,
    .dse-cat-strip::-webkit-scrollbar, .cb-tabs::-webkit-scrollbar,
    .dsl-detail-tabs::-webkit-scrollbar, .detail-tabs::-webkit-scrollbar { display: none; }
}

/* ---- Tasks 2, 4, 5, 6: detail záznamu fullscreen + margin + truncate title + right padding ---- */
@media (max-width: 768px) {
    /* Task 2: detail panel celoobrazovkový (bez split-view). */
    .view-host.split .detail-panel,
    .detail-panel {
        position: fixed !important;
        inset: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        z-index: 300;
        border-left: none;
    }
    /* DSL detail panel (pre DS listy) — takisto fullscreen. */
    .dsl-detail-wrap.open .dsl-detail-panel {
        width: 100% !important;
        max-width: 100% !important;
    }
    /* Task 4: lišta s tlačidlami v detaile potrebuje margin ľavý/pravý,
       aby tlačidlá neboli nalepené na okraji. */
    .detail-meta, .dsl-detail-meta {
        flex-wrap: wrap;
        gap: 4px !important;
        padding-right: 8px;
    }
    .detail-head, .dsl-detail-head {
        padding: 10px 14px 8px !important;
        gap: 8px !important;
    }
    /* Task 5: nadpis záznamu nesmie preliezť cez viac riadkov — ak sa nezmestí, skráť s "…". */
    .detail-title, .dsl-detail-title {
        -webkit-line-clamp: 1 !important;
        line-clamp: 1;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: block !important;
        max-width: 100%;
        min-width: 0;
        flex: 1 1 auto;
    }
    /* Task 6: atribúty detailu sa orezávali sprava. Pridaj pravý padding + nechaj lámanie textu. */
    .detail-body, .dsl-detail-body {
        padding: 10px 14px 80px !important;
    }
    .detail-body .form-grid-3, .detail-body .form-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    .detail-body .form-field { min-width: 0; }
    .detail-body input, .detail-body textarea, .detail-body .sh-input,
    .detail-body .adv-select-trigger, .detail-body .multi-trigger {
        max-width: 100%;
        width: 100% !important;
        box-sizing: border-box;
    }
}

/* ---- Task 8: minimalizované záznamy bar — skryť v overlayoch (CS, profile, atď.) ---- */
.company-settings.open ~ #minimized-bar,
.fs-overlay.open ~ #minimized-bar,
body:has(.company-settings.open) #minimized-bar,
body:has(.fs-overlay.open) #minimized-bar,
body:has(#minimized-bar) .company-settings.open + #minimized-bar { display: none !important; }
/* Fallback bez :has() — JS logika by tiež zaistila. */
.company-settings.open #minimized-bar, .fs-overlay.open #minimized-bar { display: none !important; }

/* ---- Tasks 9, 10, 11: company settings tables + audit log + ostatné karty responsive ---- */
@media (max-width: 900px) {
    /* Scrollovacie obaly pre tabuľky v CS — nepresahujú cez viditeľnú plochu. */
    #company-settings .cs-card, #company-settings .dse-table-wrap {
        overflow-x: auto;
        max-width: 100%;
    }
    #company-settings .dse-table { min-width: 560px; }
    /* Audit log tabuľka scrollovateľná horizontálne, riadky nelámu. */
    #company-settings .cs-page[data-page="audit"] .dse-table,
    #company-settings .cs-page[data-page="audit"] table { min-width: 640px; }
    /* Ostatné karty (cs-grid-3, cs-grid-2) — na mobile stĺpce padajú pod seba. */
    #company-settings .cs-grid-3, #company-settings .cs-grid-2,
    .fs-overlay.open .cs-grid-3, .fs-overlay.open .cs-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    #company-settings .cs-field, .fs-overlay.open .cs-field { min-width: 0; }
    #company-settings .cs-row, .fs-overlay.open .cs-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    #company-settings .cs-row-text, .fs-overlay.open .cs-row-text {
        flex: 1 1 100%;
        min-width: 0;
    }
}

/* ---- Task 19: Scenario builder mobile — canvas fullscreen, panels slide-out ---- */
@media (max-width: 900px) {
    #scenario-builder-page .sce-workspace {
        position: relative;
        grid-template-columns: 1fr !important;
    }
    #scenario-builder-page .sce-lib,
    #scenario-builder-page .sce-inspector {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        z-index: 10;
        background: #FFFFFF;
        border: 1px solid hsl(var(--border));
        box-shadow: 0 4px 20px rgba(0,0,0,0.18);
        transition: transform 0.2s ease;
    }
    #scenario-builder-page .sce-lib {
        left: 0;
        transform: translateX(-100%);
    }
    #scenario-builder-page .sce-lib.mobile-open { transform: translateX(0); }
    #scenario-builder-page .sce-inspector {
        right: 0;
        transform: translateX(100%);
    }
    #scenario-builder-page .sce-inspector.mobile-open { transform: translateX(0); }
    #scenario-builder-page .sce-canvas-wrap { width: 100%; }
    /* Toggle tlačidlá pre panely */
    #scenario-builder-page .sce-mobile-toggle-lib,
    #scenario-builder-page .sce-mobile-toggle-insp {
        display: inline-flex !important;
        position: absolute;
        top: 50%;
        width: 32px;
        height: 60px;
        background: #2D2D2D;
        color: #FFFFFF;
        border: none;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 11;
        transform: translateY(-50%);
    }
    #scenario-builder-page .sce-mobile-toggle-lib {
        left: 0;
        border-radius: 0 6px 6px 0;
    }
    #scenario-builder-page .sce-mobile-toggle-insp {
        right: 0;
        border-radius: 6px 0 0 6px;
    }
}
@media (min-width: 901px) {
    #scenario-builder-page .sce-mobile-toggle-lib,
    #scenario-builder-page .sce-mobile-toggle-insp { display: none !important; }
}

/* ---- Task 20, 21: metriky zaťaženia + horný panel SB responsive ---- */
@media (max-width: 900px) {
    #scenario-builder-page .sce-metrics,
    #scenario-builder-page .sce-load-metrics,
    .metrics-grid, .metrics-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        overflow-x: auto;
    }
    #scenario-builder-page .sce-topbar,
    #scenario-builder-page .sb-topbar {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        gap: 4px !important;
        padding: 6px 8px !important;
        scrollbar-width: none;
    }
    #scenario-builder-page .sce-topbar::-webkit-scrollbar,
    #scenario-builder-page .sb-topbar::-webkit-scrollbar { display: none; }
}

/* ---- Task 28: kôš vyhľadávanie icon-only na mobile ---- */
@media (max-width: 768px) {
    #trash-page .trash-search input::placeholder,
    #trash-page input[type="search"]::placeholder { color: transparent; }
    #trash-page .trash-search input,
    #trash-page input[type="search"] {
        width: 36px !important;
        min-width: 36px !important;
        padding-left: 30px !important;
        transition: width 0.2s ease;
    }
    #trash-page .trash-search input:focus,
    #trash-page input[type="search"]:focus { width: 100% !important; max-width: 260px; }
}

/* ---- Task 32: import modal responsive ---- */
@media (max-width: 768px) {
    .imp-overlay .imp-modal,
    #import-modal .imp-modal,
    [id*="import"] .modal {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        inset: 0 !important;
    }
    .imp-body, .imp-content { overflow-x: auto; }
    .imp-step, .imp-grid { grid-template-columns: 1fr !important; }
}

/* ---- Task 33: docs page mobile navigation ---- */
@media (max-width: 900px) {
    #docs-page .docs-body, #docs-page .cs-body {
        display: flex !important;
        flex-direction: column !important;
    }
    #docs-page .docs-sidebar, #docs-page .cs-sidebar {
        width: 100% !important;
        max-height: 40vh;
        border-right: none !important;
        border-bottom: 1px solid hsl(var(--border));
        overflow-y: auto;
    }
    /* Toggle tlačidlo pre docs sidebar na mobile (ak existuje). */
    #docs-page .docs-sidebar-toggle { display: inline-flex !important; }
}

/* ---- Tasks 24, 25: chat mobile — conversation list slide-out + auto-hide pri voľbe ----
   DOM: #chat-app-page > .chat-wrap > .chat-list (konverzácie) + .chat-view (detail) + .chat-info. */
@media (max-width: 768px) {
    #chat-app-page .chat-wrap {
        position: relative;
        display: block !important;
    }
    #chat-app-page .chat-list {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 85vw;
        max-width: 320px;
        background: #FFFFFF;
        z-index: 10;
        border-right: 1px solid hsl(var(--border));
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        display: flex;
        flex-direction: column;
    }
    /* Default na mobile: list je schovaný, chat-view má full width. */
    #chat-app-page.show-chat-list .chat-list { transform: translateX(0); }
    #chat-app-page .chat-view { width: 100% !important; display: flex !important; }
    /* chat-info (pravý panel s profilom partnera) — tiež schovaný na mobile. */
    #chat-app-page .chat-info { display: none !important; }
    /* Mobile toggle button — zobrazíme pri hover over top toolbar. */
    #chat-app-page .chat-mobile-toggle { display: inline-flex !important; }
    /* Backdrop keď je list otvorený (klik mimo list = zavrieť). */
    #chat-app-page.show-chat-list::before {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 9;
    }
}
@media (min-width: 769px) {
    #chat-app-page .chat-mobile-toggle { display: none !important; }
}

/* ---- Tasks 26, 27: email mobile — účty + list slide-out, detail fullscreen.
   DOM: #email-client-page > .em-wrap > (.em-sidebar + .em-list + .em-detail). */
@media (max-width: 768px) {
    #email-client-page .em-wrap {
        position: relative;
        display: block !important;
    }
    /* em-sidebar (folders) + em-list (emails) = obidva v drawer-i zľava. */
    #email-client-page .em-sidebar,
    #email-client-page .em-list {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        background: #FFFFFF;
        z-index: 10;
        border-right: 1px solid hsl(var(--border));
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        display: flex;
        flex-direction: column;
    }
    #email-client-page .em-sidebar { width: 70vw; max-width: 260px; }
    #email-client-page .em-list { width: 90vw; max-width: 360px; }
    #email-client-page.show-email-list .em-sidebar,
    #email-client-page.show-email-list .em-list { transform: translateX(0); }
    /* Detail e-mailu = full-width main area. */
    #email-client-page .em-detail {
        width: 100% !important;
        display: flex !important;
    }
    /* Pri otvorení e-mailu detail = fullscreen cez všetko ostatné. */
    #email-client-page.show-email-detail .em-detail {
        position: fixed !important;
        inset: 0 !important;
        z-index: 300 !important;
        background: #FFFFFF;
    }
    #email-client-page .email-mobile-toggle { display: inline-flex !important; }
    #email-client-page.show-email-list::before {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 9;
    }
}
@media (min-width: 769px) {
    #email-client-page .email-mobile-toggle { display: none !important; }
}

/* Mobile toggle tlačidlo — štýl. */
.chat-mobile-toggle, .email-mobile-toggle {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: 1px solid hsl(var(--border));
    background: #FFFFFF;
    color: hsl(var(--foreground));
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    margin-right: 6px;
}
.chat-mobile-toggle:hover, .email-mobile-toggle:hover { background: #F4F4F4; }
.chat-mobile-toggle svg, .email-mobile-toggle svg { width: 16px; height: 16px; }
