/**
 * AT·OM DESKTOP OS — Système opérationnel
 * Styles du bureau, pages, docks, bottom bar, zones
 *
 * Phase 11: Immersive HUD — voir css/immersive.css pour les docks et bottom bar
 *
 * Z-INDEX SCHEME:
 *   1-9      : Bureau zones / Home view (background)
 *   10       : Nav bar (page navigation)
 *   200      : Docks latéraux (gauche: sphères, droite: comm)
 *   300      : Topbar
 *   400-401  : Bottom bar + minimap
 *   500      : Context menus / minimap popup
 *   1000     : Modals / Checkpoints
 *   9999     : System overlays
 *
 * Legacy (Phase 1-10 — still in file but not rendered):
 *   Hub panel, floating windows, old taskbar, snap preview
 */

/* ═══════════════════════════════════════════════════════════════════════════════
   DESKTOP VARIABLES
   ═══════════════════════════════════════════════════════════════════════════════ */
:root {
    /* Desktop structure */
    --topbar-h: 56px;
    --taskbar-h: 44px;            /* Legacy — Phase 11 uses --bottombar-h from immersive.css */
    --hub-w: 240px;               /* Legacy — Phase 11 uses --dock-expanded-w */
    --hub-collapsed-w: 52px;      /* Legacy — Phase 11 uses --dock-icon-w */

    /* Desktop colors */
    --desktop-bg: #0a0a0f;
    --surface: #111118;
    --surface-hover: #1a1a24;
    --surface-active: #222230;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --border-focus: var(--cobalt);
    --text-primary: #e8e8ed;
    --text-secondary: #8b8b96;
    --text-muted: #55555f;
    --accent: var(--cobalt);
    --accent-glow: var(--cobalt-glow);
    --gold: var(--or);
    --gold-glow: var(--or-glow);

    /* Window chrome */
    --win-radius: 8px;
    --win-titlebar-h: 32px;
    --win-border: 1px solid var(--border);
    --win-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    --win-shadow-focus: 0 12px 48px rgba(0, 0, 0, 0.6), 0 4px 16px rgba(0, 71, 171, 0.15);

    /* Transitions */
    --t-fast: 0.15s ease;
    --t-normal: 0.25s var(--ease-out);
    --t-smooth: 0.35s var(--ease-out);
}


/* ═══════════════════════════════════════════════════════════════════════════════
   DESKTOP SHELL — Le conteneur OS
   ═══════════════════════════════════════════════════════════════════════════════ */
#desktop-shell {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--desktop-bg);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    font-size: 13px;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   TOPBAR — Barre du haut (statut système)
   ═══════════════════════════════════════════════════════════════════════════════ */
#desktop-topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 300;
    flex-shrink: 0;
    user-select: none;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-logo-img {
    height: 44px;
    border-radius: 10px;
    vertical-align: middle;
    box-shadow: 0 0 14px rgba(58, 186, 106, 0.3);
    border: 1px solid rgba(58, 186, 106, 0.25);
}
.topbar-logo {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-shadow: 0 0 8px rgba(58, 186, 106, 0.2);
    color: var(--gold);
}

.topbar-sphere {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    background: rgba(0, 71, 171, 0.15);
    border-radius: 4px;
    font-size: 11px;
    color: var(--accent);
}

.topbar-sphere-icon { font-size: 12px; }

.topbar-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.topbar-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--vert);
}

.topbar-status-dot.warning { background: var(--or); }
.topbar-status-dot.error { background: var(--rouge); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: background var(--t-fast), color var(--t-fast);
    position: relative;
}

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

.topbar-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 14px;
    height: 14px;
    background: var(--rouge);
    border-radius: 7px;
    font-size: 9px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.topbar-clock {
    font-size: 11px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    text-align: right;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   DESKTOP BODY — Hub + Workspace (Legacy — Phase 11 uses #desktop-main)
   ═══════════════════════════════════════════════════════════════════════════════ */
#desktop-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   HUB PANEL — Panel latéral fixe gauche (Legacy — Phase 11 uses docks)
   ═══════════════════════════════════════════════════════════════════════════════ */
#desktop-hub-panel {
    width: var(--hub-w);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 200;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--t-smooth);
}

#desktop-hub-panel.collapsed {
    width: var(--hub-collapsed-w);
}

/* Hub section */
.hub-section {
    border-bottom: 1px solid var(--border);
}

.hub-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background var(--t-fast), color var(--t-fast);
    user-select: none;
}

.hub-section-header:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.hub-section-header.active {
    color: var(--accent);
}

.hub-section-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.hub-section-label {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
}

.hub-section-badge {
    min-width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 9px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.hub-section-chevron {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform var(--t-fast);
}

.hub-section-header.expanded .hub-section-chevron {
    transform: rotate(90deg);
}

/* Hub collapsed: hide labels, badges, chevrons */
#desktop-hub-panel.collapsed .hub-section-label,
#desktop-hub-panel.collapsed .hub-section-badge,
#desktop-hub-panel.collapsed .hub-section-chevron,
#desktop-hub-panel.collapsed .hub-section-content {
    display: none;
}

#desktop-hub-panel.collapsed .hub-section-header {
    justify-content: center;
    padding: 12px 0;
}

/* Hub section content (expandable) */
.hub-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--t-smooth);
}

.hub-section-content.expanded {
    max-height: 400px;
}

.hub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 48px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 12px;
    transition: background var(--t-fast), color var(--t-fast);
}

.hub-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.hub-item.active {
    color: var(--accent);
    background: rgba(0, 71, 171, 0.08);
}

.hub-item-icon {
    font-size: 13px;
    width: 18px;
    text-align: center;
}

.hub-item-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hub-item-dot.online { background: var(--vert); }
.hub-item-dot.offline { background: var(--text-muted); }

/* Hub collapse toggle */
.hub-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    margin: 4px 8px;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: background var(--t-fast), color var(--t-fast);
}

.hub-collapse-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}


/* ═══════════════════════════════════════════════════════════════════════════════
   WORKSPACE — Zone de travail principale
   ═══════════════════════════════════════════════════════════════════════════════ */
#desktop-workspace {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   BUREAU ZONES — Les 6 zones fixes (Rule #7)
   ═══════════════════════════════════════════════════════════════════════════════ */
#bureau-zones {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    height: 100%;
    min-height: 0;
}

.bureau-zone {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--win-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    transition: border-color var(--t-fast);
}

.bureau-zone:hover {
    border-color: var(--border-hover);
}

.bureau-zone.zone-focused {
    border-color: var(--accent);
}

/* Zone header */
.zone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    user-select: none;
}

.zone-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.zone-title-icon { font-size: 13px; }

.zone-actions {
    display: flex;
    gap: 4px;
}

.zone-action-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 3px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: background var(--t-fast), color var(--t-fast);
}

.zone-action-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* Zone content */
.zone-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    min-height: 0;
}

/* Zone-specific: Quick Capture */
.zone-quick-capture .zone-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface-hover);
    border-radius: 6px;
    margin-bottom: 8px;
}

.zone-quick-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.zone-quick-input::placeholder {
    color: var(--text-muted);
}

.zone-quick-send {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background var(--t-fast);
}

.zone-quick-send:hover {
    background: #0055cc;
}

/* Zone list items (threads, agents, meetings, files, resume) */
.zone-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background var(--t-fast), color var(--t-fast);
}

.zone-list-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.zone-list-item-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.zone-list-item-text {
    flex: 1;
    min-width: 0;
}

.zone-list-item-title {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zone-list-item-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
}

.zone-list-item-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.zone-list-item-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--vert);
}

.zone-list-item-badge.draft {
    background: rgba(139, 139, 150, 0.15);
    color: var(--text-muted);
}

.zone-list-item-time {
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Zone empty state */
.zone-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    gap: 6px;
}

.zone-empty-icon {
    font-size: 24px;
    opacity: 0.5;
}

/* C6 — Empty state hint (call-to-action) */
.zone-empty-hint {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 2px;
}

/* C5 — Loading state */
.zone-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    color: var(--text-muted);
    font-size: 11px;
}

.zone-loading-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--or, #D8B26A);
    animation: zone-pulse 1.2s ease-in-out infinite;
}

@keyframes zone-pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* C7 — Error state */
.zone-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    color: var(--rouge, #ef4444);
    font-size: 11px;
    text-align: center;
}

.zone-error-inline {
    font-size: 10px;
    color: var(--rouge, #ef4444);
    text-align: center;
    padding: 4px 8px;
    opacity: 0.8;
}

.zone-retry {
    color: var(--accent, #0047AB);
    cursor: pointer;
    text-decoration: underline;
    font-size: 10px;
}

.zone-retry:hover {
    opacity: 0.8;
}

/* C7 — Offline banner */
.offline-banner {
    position: fixed;
    top: var(--topbar-h, 36px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 6px 20px;
    border-radius: 0 0 8px 8px;
    font-size: 11px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
}

.offline-banner.hidden {
    opacity: 0;
    pointer-events: none;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   WINDOWS LAYER — Couche des fenêtres flottantes
   ═══════════════════════════════════════════════════════════════════════════════ */
#windows-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#windows-layer > * {
    pointer-events: auto;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   ATOM WINDOW — Fenêtre flottante (Legacy chrome — Phase 11 uses AtomPage)
   NOTE: .win-content, .win-chat, .engine-* content styles are STILL ACTIVE
   ═══════════════════════════════════════════════════════════════════════════════ */
.atom-window {
    position: absolute;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: var(--win-border);
    border-radius: var(--win-radius);
    box-shadow: var(--win-shadow);
    min-width: 280px;
    min-height: 180px;
    overflow: hidden;
    transition: box-shadow var(--t-fast);
}

.atom-window.focused {
    border-color: rgba(0, 71, 171, 0.3);
    box-shadow: var(--win-shadow-focus);
}

.atom-window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    border: none;
}

.atom-window.minimized {
    display: none;
}

.atom-window.snapped-left {
    top: 0 !important;
    left: 0 !important;
    width: 50% !important;
    height: 100% !important;
    border-radius: 0;
}

.atom-window.snapped-right {
    top: 0 !important;
    left: 50% !important;
    width: 50% !important;
    height: 100% !important;
    border-radius: 0;
}

/* Window titlebar */
.win-titlebar {
    display: flex;
    align-items: center;
    height: var(--win-titlebar-h);
    padding: 0 8px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    cursor: default;
    flex-shrink: 0;
    user-select: none;
    -webkit-app-region: drag;
}

.atom-window.focused .win-titlebar {
    background: linear-gradient(180deg, rgba(0, 71, 171, 0.06), transparent);
}

.win-titlebar-icon {
    font-size: 13px;
    margin-right: 6px;
    flex-shrink: 0;
}

.win-titlebar-text {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.atom-window.focused .win-titlebar-text {
    color: var(--text-primary);
}

.win-titlebar-controls {
    display: flex;
    gap: 4px;
    margin-left: 8px;
    -webkit-app-region: no-drag;
}

.win-ctrl-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: background var(--t-fast), color var(--t-fast);
}

.win-ctrl-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.win-ctrl-btn.close:hover {
    background: var(--rouge);
    color: white;
}

/* Window tab bar */
.win-tabs {
    display: flex;
    align-items: center;
    padding: 0 4px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.win-tabs::-webkit-scrollbar { display: none; }

.win-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color var(--t-fast), border-color var(--t-fast);
    user-select: none;
}

.win-tab:hover {
    color: var(--text-secondary);
}

.win-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.win-tab-close {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-size: 10px;
    opacity: 0;
    transition: opacity var(--t-fast), background var(--t-fast);
}

.win-tab:hover .win-tab-close { opacity: 0.6; }
.win-tab-close:hover {
    opacity: 1 !important;
    background: rgba(220, 20, 60, 0.3);
}

.win-tab-add {
    padding: 6px 8px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--t-fast);
}

.win-tab-add:hover { color: var(--text-primary); }

/* Window content */
.win-content,
.page-content {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

/* Window status bar */
.win-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
    user-select: none;
}

/* Window resize handles */
.win-resize {
    position: absolute;
}

.win-resize-n { top: -3px; left: 8px; right: 8px; height: 6px; cursor: n-resize; }
.win-resize-s { bottom: -3px; left: 8px; right: 8px; height: 6px; cursor: s-resize; }
.win-resize-e { right: -3px; top: 8px; bottom: 8px; width: 6px; cursor: e-resize; }
.win-resize-w { left: -3px; top: 8px; bottom: 8px; width: 6px; cursor: w-resize; }
.win-resize-ne { top: -3px; right: -3px; width: 12px; height: 12px; cursor: ne-resize; }
.win-resize-nw { top: -3px; left: -3px; width: 12px; height: 12px; cursor: nw-resize; }
.win-resize-se { bottom: -3px; right: -3px; width: 12px; height: 12px; cursor: se-resize; }
.win-resize-sw { bottom: -3px; left: -3px; width: 12px; height: 12px; cursor: sw-resize; }

/* Snap preview overlay */
.snap-preview {
    position: absolute;
    background: rgba(0, 71, 171, 0.1);
    border: 2px solid rgba(0, 71, 171, 0.4);
    border-radius: var(--win-radius);
    z-index: 900;
    pointer-events: none;
    transition: all var(--t-fast);
}


/* ═══════════════════════════════════════════════════════════════════════════════
   WINDOW CONTENT TYPES — Chat, Thread, etc.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Chat window content */
.win-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.win-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-msg.agent {
    align-self: flex-start;
    background: var(--surface-hover);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-msg.user {
    align-self: flex-end;
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-msg-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 2px;
}

.chat-typing {
    align-self: flex-start;
    padding: 8px 16px;
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

.win-chat-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
}

.chat-input-field {
    flex: 1;
    padding: 8px 12px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    resize: none;
    max-height: 100px;
}

.chat-input-field:focus {
    border-color: var(--accent);
}

.chat-send-btn {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: background var(--t-fast);
}

.chat-send-btn:hover { background: #0055cc; }


/* ═══════════════════════════════════════════════════════════════════════════════
   TASKBAR — Barre des tâches en bas (Legacy — Phase 11 uses #immersive-taskbar)
   ═══════════════════════════════════════════════════════════════════════════════ */
#desktop-taskbar {
    height: var(--taskbar-h);
    display: flex;
    align-items: center;
    padding: 0 8px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 400;
    flex-shrink: 0;
    user-select: none;
}

.taskbar-start {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: background var(--t-fast);
}

.taskbar-start:hover {
    background: var(--surface-hover);
}

.taskbar-separator {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 6px;
}

/* Quick Actions Zone */
.taskbar-quick-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.taskbar-quick-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    line-height: 1;
}

.taskbar-quick-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border);
}

.taskbar-quick-btn:active {
    background: var(--surface-active, rgba(255,255,255,0.1));
}

.taskbar-windows {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    min-width: 0;
}

.taskbar-windows::-webkit-scrollbar { display: none; }

.taskbar-win-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    max-width: 180px;
    transition: background var(--t-fast), color var(--t-fast);
}

.taskbar-win-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.taskbar-win-btn.active {
    background: var(--surface-active);
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent);
}

.taskbar-win-btn.minimized {
    opacity: 0.5;
}

.taskbar-win-icon { font-size: 13px; }

.taskbar-win-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

.taskbar-tray {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.taskbar-tray-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    transition: background var(--t-fast), color var(--t-fast);
}

.taskbar-tray-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.taskbar-tray-btn.has-alert {
    color: var(--or);
}

.taskbar-tray-btn {
    position: relative;
}

.tray-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    font-size: 9px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    color: #fff;
    background: var(--ac, #6366f1);
    border-radius: 7px;
}

.taskbar-clock-area {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0 8px;
    font-size: 11px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   CONTEXT MENU
   ═══════════════════════════════════════════════════════════════════════════════ */
.context-menu {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    padding: 4px;
    z-index: 500;
    min-width: 160px;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    transition: background var(--t-fast), color var(--t-fast);
}

.context-menu-item:hover {
    background: var(--surface-active);
    color: var(--text-primary);
}

.context-menu-item-icon {
    width: 16px;
    text-align: center;
    font-size: 12px;
}

.context-menu-item-shortcut {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-muted);
}

.context-menu-separator {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   CHECKPOINT MODAL — Governance overlay
   ═══════════════════════════════════════════════════════════════════════════════ */
.checkpoint-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.checkpoint-modal {
    background: var(--surface);
    border: 1px solid var(--or);
    border-radius: 12px;
    padding: 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5), 0 0 40px var(--gold-glow);
}

.checkpoint-icon {
    font-size: 32px;
    text-align: center;
    margin-bottom: 12px;
}

.checkpoint-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gold);
    text-align: center;
    margin-bottom: 8px;
}

.checkpoint-desc {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}

.checkpoint-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.checkpoint-btn {
    padding: 8px 24px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--t-fast);
}

.checkpoint-btn.approve {
    background: var(--vert);
    color: white;
}

.checkpoint-btn.approve:hover { background: #0fa874; }

.checkpoint-btn.reject {
    background: transparent;
    border: 1px solid var(--rouge);
    color: var(--rouge);
}

.checkpoint-btn.reject:hover {
    background: var(--rouge);
    color: white;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   SUGGESTION TOAST — Activation contextuelle
   ═══════════════════════════════════════════════════════════════════════════════ */
.suggestion-toast {
    position: absolute;
    bottom: 60px;
    right: 20px;
    background: var(--surface);
    border: 1px solid var(--border-hover);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 12px 16px;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 450;
    animation: toast-in 0.3s var(--ease-out);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.suggestion-toast-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.suggestion-toast-actions {
    display: flex;
    gap: 8px;
}

.suggestion-btn {
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background var(--t-fast);
}

.suggestion-btn.accept {
    background: var(--accent);
    color: white;
}

.suggestion-btn.dismiss {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}


/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile & Tablet
   ═══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    :root {
        --hub-w: 100%;
        --topbar-h: 32px;
        --taskbar-h: 40px;
    }

    #desktop-hub-panel {
        position: absolute;
        top: var(--topbar-h);
        left: -100%;
        bottom: var(--taskbar-h);
        width: 280px;
        z-index: 250;
        transition: left var(--t-smooth);
    }

    #desktop-hub-panel.mobile-open {
        left: 0;
    }

    #bureau-zones {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        grid-auto-rows: minmax(120px, auto);
    }

    .atom-window {
        /* On mobile, windows are always maximized */
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0;
        border: none;
    }

    .taskbar-win-title { display: none; }
    .topbar-center { display: none; }
}

@media (min-width: 769px) and (max-width: 1200px) {
    #bureau-zones {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: 1fr 1fr 1fr;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════════
   SCROLLBAR STYLING
   ═══════════════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* ═══════════════════════════════════════════════════════════════════════════════
   SEARCH OVERLAY — Ctrl+K spotlight search
   ═══════════════════════════════════════════════════════════════════════════════ */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    z-index: 9999;
    backdrop-filter: blur(4px);
    animation: fade-in 0.15s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-dialog {
    width: 560px;
    max-width: 90vw;
    background: var(--surface);
    border: 1px solid var(--border-hover);
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 71, 171, 0.1);
    overflow: hidden;
}

.search-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.search-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.search-field {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.search-field::placeholder {
    color: var(--text-muted);
}

.search-kbd {
    padding: 2px 8px;
    background: var(--surface-hover);
    border-radius: 4px;
    font-size: 10px;
    font-family: monospace;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.search-section {
    margin-bottom: 8px;
}

.search-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 6px 8px 4px;
    font-weight: 600;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    transition: background var(--t-fast), color var(--t-fast);
}

.search-item:hover,
.search-item.highlight {
    background: var(--surface-active);
    color: var(--text-primary);
}

.search-item-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.search-item-text {
    flex: 1;
}

.search-item kbd {
    padding: 1px 6px;
    background: var(--surface-hover);
    border-radius: 3px;
    font-size: 9px;
    font-family: monospace;
    color: var(--text-muted);
    border: 1px solid var(--border);
    flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   START MENU — System menu above taskbar
   ═══════════════════════════════════════════════════════════════════════════════ */
.start-menu {
    position: fixed;
    width: 480px;
    max-width: 90vw;
    background: var(--surface);
    border: 1px solid var(--border-hover);
    border-radius: 12px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 71, 171, 0.1);
    z-index: 9998;
    overflow: hidden;
    animation: start-menu-in 0.2s var(--ease-out);
}

@keyframes start-menu-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.start-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.start-menu-logo {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--gold);
}

.start-menu-version {
    font-size: 10px;
    color: var(--text-muted);
}

.start-menu-body {
    display: flex;
    max-height: 50vh;
    overflow-y: auto;
}

.start-menu-col {
    flex: 1;
    padding: 8px;
}

.start-menu-actions {
    border-right: 1px solid var(--border);
}

.start-menu-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 8px 10px 4px;
    font-weight: 600;
}

.start-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 12px;
    transition: background var(--t-fast), color var(--t-fast);
}

.start-menu-item:hover {
    background: var(--surface-active);
    color: var(--text-primary);
}

.start-menu-item-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.start-menu-separator {
    height: 1px;
    background: var(--border);
    margin: 6px 10px;
}

.start-menu-footer {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    border-top: 1px solid var(--border);
}

.start-menu-footer .start-menu-item {
    font-size: 11px;
}

@media (max-width: 768px) {
    .start-menu {
        width: 100%;
        border-radius: 12px 12px 0 0;
        bottom: var(--taskbar-h) !important;
        left: 0 !important;
        right: 0;
    }

    .start-menu-body {
        flex-direction: column;
    }

    .start-menu-actions {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .search-dialog {
        width: 100%;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════════
   ENGINE SHARED — Toolbar, common patterns
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-tb {
    padding: 4px 8px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
    white-space: nowrap;
}
.engine-tb:hover { background: var(--surface-active); color: var(--text-primary); }
.engine-tb:active { transform: scale(0.96); }
.engine-tb-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; flex-shrink: 0; }
.engine-toolbar-group { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.engine-toolbar-right { margin-left: auto; }


/* ═══════════════════════════════════════════════════════════════════════════════
   DOCUMENT EDITOR (ENG_DOC_PDF)
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-doc { display: flex; flex-direction: column; height: 100%; }

.engine-doc-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow-x: auto;
}

.engine-doc-editor {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    outline: none;
    min-height: 200px;
}
.engine-doc-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}
.engine-doc-editor h1 { font-size: 24px; font-weight: 700; margin: 16px 0 8px; color: var(--text-primary); }
.engine-doc-editor h2 { font-size: 20px; font-weight: 600; margin: 14px 0 6px; }
.engine-doc-editor h3 { font-size: 16px; font-weight: 600; margin: 12px 0 4px; }
.engine-doc-editor blockquote {
    border-left: 3px solid var(--accent);
    padding: 8px 16px;
    margin: 12px 0;
    color: var(--text-secondary);
    background: var(--surface-hover);
    border-radius: 0 6px 6px 0;
}
.engine-doc-editor a { color: var(--accent); text-decoration: underline; }
.engine-doc-editor .doc-table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
}
.engine-doc-editor .doc-table td {
    border: 1px solid var(--border);
    padding: 6px 10px;
    font-size: 13px;
}

.engine-doc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 12px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.engine-doc-autosave { color: var(--vert); }


/* ═══════════════════════════════════════════════════════════════════════════════
   SPREADSHEET / TABLEUR (ENG_DATA_TABULAR)
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-tableur { display: flex; flex-direction: column; height: 100%; }

.engine-tableur-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.engine-formula-bar {
    flex: 1;
    max-width: 300px;
    padding: 4px 8px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
    font-family: 'SF Mono', 'Consolas', monospace;
    outline: none;
}
.engine-formula-bar:focus { border-color: var(--accent); }

.engine-tableur-grid-wrapper {
    flex: 1;
    overflow: auto;
}

.engine-tableur-grid {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
}
.engine-tableur-grid th,
.engine-tableur-grid td {
    border: 1px solid var(--border);
    padding: 0;
}

.engine-cell-header {
    background: var(--surface);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    padding: 3px 8px !important;
    min-width: 32px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.engine-row-header {
    background: var(--surface);
    color: var(--text-muted);
    font-size: 10px;
    text-align: center;
    padding: 2px 6px !important;
    min-width: 32px;
    width: 32px;
    position: sticky;
    left: 0;
    z-index: 1;
}

.engine-cell {
    min-width: 80px;
    max-width: 200px;
    padding: 3px 6px !important;
    font-size: 12px;
    color: var(--text-primary);
    outline: none;
    cursor: cell;
    transition: background var(--t-fast);
    height: 24px;
}
.engine-cell:focus { background: rgba(0, 71, 171, 0.08); }
.engine-cell-selected { background: rgba(0, 71, 171, 0.12); box-shadow: inset 0 0 0 2px var(--accent); }

.engine-tableur-footer {
    display: flex;
    justify-content: space-between;
    padding: 4px 12px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.engine-tableur-stats { color: var(--accent); font-weight: 500; }


/* ═══════════════════════════════════════════════════════════════════════════════
   PRESENTATION (ENG_PRESENTATION)
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-pres { display: flex; height: 100%; }

.engine-pres-sidebar {
    width: 160px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.engine-pres-slides { flex: 1; padding: 8px; overflow-y: auto; }

.engine-pres-thumb {
    padding: 8px;
    border-radius: 6px;
    border: 2px solid transparent;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color var(--t-fast), background var(--t-fast);
}
.engine-pres-thumb:hover { background: var(--surface-hover); }
.engine-pres-thumb.active { border-color: var(--accent); background: rgba(0, 71, 171, 0.08); }
.engine-pres-thumb-num { font-size: 9px; color: var(--text-muted); margin-bottom: 2px; }
.engine-pres-thumb-title { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.engine-pres-add-slide {
    margin: 8px;
    padding: 8px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
}
.engine-pres-add-slide:hover { border-color: var(--accent); color: var(--accent); }

.engine-pres-main { flex: 1; display: flex; flex-direction: column; }

.engine-pres-canvas {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}
.engine-pres-slide-title {
    font-size: 28px;
    font-weight: 700;
    color: white;
    text-align: center;
    margin-bottom: 16px;
    outline: none;
    min-width: 200px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.engine-pres-slide-body {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    text-align: center;
    max-width: 600px;
    line-height: 1.6;
    outline: none;
    min-width: 200px;
}

.engine-pres-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.engine-pres-counter { font-size: 11px; color: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════════════════════════
   BROWSER (ENG_WEB_READ)
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-browser { display: flex; flex-direction: column; height: 100%; }

.engine-browser-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.engine-browser-url {
    flex: 1;
    padding: 5px 10px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
}
.engine-browser-url:focus { border-color: var(--accent); }

.engine-browser-viewport { flex: 1; overflow: hidden; position: relative; background: #0d0d12; }
.engine-browser-iframe { width: 100%; height: 100%; border: none; }

.engine-browser-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.engine-browser-quicklinks {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.engine-browser-quicklink {
    padding: 6px 14px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
}
.engine-browser-quicklink:hover { background: var(--surface-active); color: var(--text-primary); }

.engine-browser-status {
    display: flex;
    justify-content: space-between;
    padding: 3px 12px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.engine-browser-secure { color: var(--vert); }


/* ═══════════════════════════════════════════════════════════════════════════════
   DASHBOARD (KPI / Charts)
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-dashboard { padding: 16px; overflow-y: auto; height: 100%; box-sizing: border-box; }

.engine-dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.engine-dash-title { font-size: 16px; font-weight: 600; margin: 0; }
.engine-dash-filters { display: flex; align-items: center; gap: 10px; }

.engine-dash-period {
    padding: 4px 10px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 11px;
}
.engine-dash-sphere {
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(0, 71, 171, 0.1);
    border-radius: 4px;
    color: var(--accent);
}

.engine-dash-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.engine-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}
.engine-kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}
.engine-kpi-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 6px;
}
.engine-kpi-change {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 500;
}
.engine-kpi-change.positive { color: var(--vert); }
.engine-kpi-change.negative { color: var(--rouge); }
.engine-kpi-change.neutral { color: var(--text-muted); }

.engine-dash-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.engine-chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}
.engine-chart-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.engine-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 100px;
}
.engine-bar {
    flex: 1;
    background: var(--accent);
    border-radius: 2px 2px 0 0;
    min-width: 3px;
    opacity: 0.7;
    transition: opacity var(--t-fast);
}
.engine-bar:hover { opacity: 1; }

.engine-sphere-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.engine-sphere-bar-label { font-size: 10px; color: var(--text-muted); min-width: 100px; }
.engine-sphere-bar-track {
    flex: 1;
    height: 8px;
    background: var(--surface-hover);
    border-radius: 4px;
    overflow: hidden;
}
.engine-sphere-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s var(--ease-out);
}


/* ═══════════════════════════════════════════════════════════════════════════════
   ACTIVITY FEED
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-activity { display: flex; flex-direction: column; height: 100%; }

.engine-activity-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.engine-activity-title { font-size: 14px; font-weight: 600; margin: 0; }
.engine-activity-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vert);
    animation: live-pulse 2s infinite;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.engine-activity-feed {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.engine-activity-item {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    transition: background var(--t-fast);
}
.engine-activity-item:hover { background: var(--surface-hover); }
.engine-activity-item.new { animation: activity-in 0.4s var(--ease-out); }
@keyframes activity-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.engine-activity-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.engine-activity-text { flex: 1; font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.engine-activity-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; }


/* ═══════════════════════════════════════════════════════════════════════════════
   SETTINGS (Categories)
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-settings { display: flex; height: 100%; }

.engine-settings-sidebar {
    width: 180px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 8px;
    flex-shrink: 0;
    overflow-y: auto;
}

.engine-settings-cat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: background var(--t-fast), color var(--t-fast);
}
.engine-settings-cat:hover { background: var(--surface-hover); color: var(--text-primary); }
.engine-settings-cat.active { background: rgba(0, 71, 171, 0.12); color: var(--accent); }
.engine-settings-cat-icon { font-size: 14px; width: 20px; text-align: center; flex-shrink: 0; }

.engine-settings-main { flex: 1; padding: 16px 20px; overflow-y: auto; }

.engine-settings-section { margin-bottom: 20px; }
.engine-settings-section-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.engine-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.engine-setting-info { flex: 1; }
.engine-setting-label { font-size: 13px; color: var(--text-primary); font-weight: 500; }
.engine-setting-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.engine-setting-select {
    padding: 5px 10px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
}

.engine-setting-value { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.engine-setting-badge { padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.engine-setting-badge.active { background: rgba(16, 185, 129, 0.15); color: var(--vert); }

/* Toggle switch */
.engine-toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.engine-toggle input { opacity: 0; width: 0; height: 0; }
.engine-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--surface-active);
    border-radius: 22px;
    transition: background var(--t-fast);
}
.engine-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform var(--t-fast);
}
.engine-toggle input:checked + .engine-toggle-slider { background: var(--accent); }
.engine-toggle input:checked + .engine-toggle-slider::before { transform: translateX(18px); }
.engine-toggle input:disabled + .engine-toggle-slider { opacity: 0.4; cursor: not-allowed; }

/* Governance rules */
.engine-governance-rules { display: flex; flex-direction: column; gap: 6px; }
.engine-rule {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface-hover);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}
.engine-rule-num {
    font-size: 10px;
    font-weight: 700;
    color: var(--or);
    min-width: 20px;
}
.engine-rule-status {
    margin-left: auto;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 500;
}
.engine-rule-status.active { background: rgba(16, 185, 129, 0.15); color: var(--vert); }


/* ═══════════════════════════════════════════════════════════════════════════════
   SIMULATION (World Engine)
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-simulation { display: flex; flex-direction: column; height: 100%; }

.engine-sim-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.engine-sim-play { background: var(--vert); color: white; border-color: var(--vert); }
.engine-sim-speed { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.engine-sim-tick { font-size: 11px; color: var(--text-muted); font-family: monospace; }

.engine-sim-viewport { flex: 1; position: relative; overflow: hidden; background: #050510; }
.engine-sim-canvas { width: 100%; height: 100%; display: block; }

.engine-sim-panel {
    padding: 6px 12px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.engine-sim-stats { display: flex; gap: 20px; }
.engine-sim-stat { display: flex; align-items: center; gap: 6px; }
.engine-sim-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.engine-sim-stat-value { font-size: 12px; color: var(--text-primary); font-weight: 600; font-family: monospace; }


/* ═══════════════════════════════════════════════════════════════════════════════
   EMAIL / MESSAGES
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-email { display: flex; height: 100%; }

.engine-email-sidebar {
    width: 200px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.engine-email-compose {
    margin: 10px;
    padding: 8px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}
.engine-email-compose:hover { filter: brightness(1.1); }

.engine-email-folders { flex: 1; padding: 4px; }

.engine-email-folder {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: background var(--t-fast);
}
.engine-email-folder:hover { background: var(--surface-hover); }
.engine-email-folder.active { background: rgba(0, 71, 171, 0.12); color: var(--accent); }
.engine-email-count {
    margin-left: auto;
    font-size: 10px;
    background: var(--accent);
    color: white;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.engine-email-list { flex: 1; overflow-y: auto; }

.engine-email-item {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--t-fast);
}
.engine-email-item:hover { background: var(--surface-hover); }
.engine-email-item.unread { border-left: 3px solid var(--accent); }
.engine-email-from { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.engine-email-subject { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.engine-email-preview { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.engine-email-date { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

.engine-email-detail { padding: 16px; }
.engine-email-back { margin-bottom: 12px; }
.engine-email-detail-header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.engine-email-detail-from { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.engine-email-detail-subject { font-size: 16px; font-weight: 500; color: var(--text-primary); margin-top: 4px; }
.engine-email-detail-body { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }
.engine-email-detail-actions { display: flex; gap: 8px; }


/* ═══════════════════════════════════════════════════════════════════════════════
   XR VISUALIZATION
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-xr { display: flex; flex-direction: column; height: 100%; }

.engine-xr-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #0a0a20 0%, #030308 100%);
}
.engine-xr-canvas { width: 100%; height: 100%; display: block; }

.engine-xr-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    pointer-events: none;
}
.engine-xr-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 10px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.engine-xr-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.engine-xr-info { font-size: 10px; color: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════════════════════════
   PHASE 7 — ENCYCLOPÉDIE
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-encyclopedia { display: flex; flex-direction: column; height: 100%; }
.engine-ency-toolbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.engine-ency-search { flex: 1; background: var(--surface-hover); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; color: var(--text-primary); font-size: 12px; outline: none; }
.engine-ency-search:focus { border-color: var(--accent); }
.engine-ency-body { display: flex; flex: 1; overflow: hidden; }
.engine-ency-sidebar { width: 180px; border-right: 1px solid var(--border); overflow-y: auto; padding: 6px; }
.engine-ency-node { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 12px; color: var(--text-secondary); transition: background 0.15s; }
.engine-ency-node:hover { background: var(--surface-hover); }
.engine-ency-node.active { background: rgba(0,71,171,0.15); color: var(--accent); }
.engine-ency-node-icon { font-size: 14px; }
.engine-ency-detail { flex: 1; overflow-y: auto; padding: 12px; }
.engine-ency-detail-card { }
.engine-ency-detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.engine-ency-detail-section { margin-bottom: 14px; }
.engine-ency-detail-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 6px; }
.engine-ency-links { display: flex; flex-direction: column; gap: 4px; }
.engine-ency-link { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 8px; background: rgba(255,255,255,0.02); border-radius: 4px; }
.engine-ency-link-conf { margin-left: auto; font-size: 10px; color: var(--vert); opacity: 0.7; }
.engine-ency-detail-actions { margin-top: 16px; text-align: center; }
.engine-ency-footer { display: flex; justify-content: space-between; padding: 6px 12px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════════════════════════
   PHASE 7 — ARBRE DE VIE
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-tree { display: flex; flex-direction: column; height: 100%; }
.engine-tree-toolbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.engine-tree-view-label { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-secondary); cursor: pointer; padding: 2px 6px; }
.engine-tree-view-label input { margin: 0; }
.engine-tree-viewport { flex: 1; position: relative; overflow: hidden; background: radial-gradient(ellipse at center, rgba(10,10,30,1) 0%, rgba(5,5,15,1) 100%); }
.engine-tree-canvas { width: 100%; height: 100%; cursor: grab; }
.engine-tree-canvas:active { cursor: grabbing; }
.engine-tree-footer { display: flex; justify-content: space-between; padding: 6px 12px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════════════════════════
   PHASE 7 — MOTEUR CAUSAL
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-causal { display: flex; flex-direction: column; height: 100%; }
.engine-causal-toolbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.engine-causal-body { display: flex; flex: 1; overflow: hidden; }
.engine-causal-sidebar { width: 160px; border-right: 1px solid var(--border); overflow-y: auto; padding: 6px; }
.engine-causal-chain { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 12px; color: var(--text-secondary); transition: background 0.15s; }
.engine-causal-chain:hover { background: var(--surface-hover); }
.engine-causal-chain.active { background: rgba(0,71,171,0.15); color: var(--accent); }
.engine-causal-detail { flex: 1; overflow-y: auto; }
.engine-causal-cascade { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.engine-causal-step { display: flex; align-items: center; gap: 6px; }
.engine-causal-step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: white; font-size: 10px; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.engine-causal-step-text { font-size: 12px; color: var(--text-primary); padding: 4px 10px; background: rgba(255,255,255,0.04); border-radius: 4px; }
.engine-causal-arrow { font-size: 14px; color: var(--text-muted); }
.engine-causal-footer { display: flex; justify-content: space-between; padding: 6px 12px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════════════════════════
   PHASE 7 — GAME STUDIO
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-game { display: flex; flex-direction: column; height: 100%; padding: 16px; overflow-y: auto; gap: 12px; }
.engine-game-header { margin-bottom: 4px; }
.engine-game-templates { display: flex; flex-direction: column; gap: 10px; }
.engine-game-card { display: flex; align-items: center; gap: 14px; padding: 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 8px; transition: border-color 0.2s; }
.engine-game-card:hover { border-color: var(--accent); }
.engine-game-card-icon { font-size: 32px; flex-shrink: 0; }
.engine-game-card-content { flex: 1; }
.engine-game-card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.engine-game-card-desc { font-size: 11px; color: var(--text-secondary); margin-top: 3px; line-height: 1.4; }
.engine-game-card-mechanics { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.engine-game-mechanic { font-size: 9px; padding: 2px 6px; background: rgba(0,71,171,0.1); color: var(--accent); border-radius: 3px; }
.engine-game-footer { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════════════════════════
   PHASE 7 — CONSOLE DES ORACLES
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-oracles { display: flex; flex-direction: column; height: 100%; }
.engine-oracle-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.engine-oracle-query { flex: 1; background: var(--surface-hover); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; color: var(--text-primary); font-size: 12px; outline: none; }
.engine-oracle-query:focus { border-color: #8B5CF6; }
.engine-oracle-body { display: flex; flex: 1; overflow: hidden; }
.engine-oracle-sidebar { width: 160px; border-right: 1px solid var(--border); overflow-y: auto; padding: 6px; }
.engine-oracle-circle-title { font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 8px 4px; font-weight: 600; }
.engine-oracle-item { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 11px; color: var(--text-secondary); transition: background 0.15s; }
.engine-oracle-item:hover { background: var(--surface-hover); }
.engine-oracle-results { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.engine-oracle-card { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; animation: fadeInUp 0.3s ease; }
.engine-oracle-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.engine-oracle-card-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.engine-oracle-card-circle { font-size: 9px; color: var(--text-muted); margin-left: auto; }
.engine-oracle-card-body { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.engine-oracle-footer { display: flex; justify-content: space-between; padding: 6px 12px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-muted); }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ═══════════════════════════════════════════════════════════════════════════════
   PHASE 7 — MOTEUR VIBRATIONNEL
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-vibration { display: flex; flex-direction: column; height: 100%; }
.engine-vib-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.engine-vib-input { flex: 1; background: var(--surface-hover); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; color: var(--text-primary); font-size: 12px; outline: none; }
.engine-vib-input:focus { border-color: var(--or); }
.engine-vib-body { display: flex; flex: 1; overflow: hidden; }
.engine-vib-sidebar { width: 120px; border-right: 1px solid var(--border); overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.engine-vib-freq { padding: 6px 8px; cursor: pointer; font-size: 11px; display: flex; flex-direction: column; gap: 1px; border-radius: 4px; transition: background 0.15s; }
.engine-vib-freq:hover { background: var(--surface-hover); }
.engine-vib-freq-hz { font-weight: 600; color: var(--text-primary); }
.engine-vib-freq-name { font-size: 9px; color: var(--text-muted); }
.engine-vib-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.engine-vib-canvas-container { flex: 1; position: relative; background: radial-gradient(ellipse at center, rgba(15,10,25,1), rgba(5,5,10,1)); }
.engine-vib-canvas { width: 100%; height: 100%; }
.engine-vib-result { padding: 10px; border-top: 1px solid var(--border); overflow-y: auto; max-height: 160px; }
.engine-vib-result-card { padding: 8px; }
.engine-vib-stat { padding: 6px 8px; background: rgba(255,255,255,0.03); border-radius: 4px; }
.engine-vib-stat-label { display: block; font-size: 9px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.04em; }
.engine-vib-stat-value { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.engine-vib-footer { display: flex; justify-content: space-between; padding: 6px 12px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-muted); }
.engine-vib-disclaimer { color: var(--or); font-style: italic; }


/* ═══════════════════════════════════════════════════════════════════════════════
   PHASE 7 — FOUNDATION STONES
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-stones { display: flex; flex-direction: column; height: 100%; }
.engine-stone-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.engine-stone-tab { flex: 1; padding: 10px 8px; text-align: center; font-size: 12px; cursor: pointer; background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--text-secondary); transition: all 0.2s; }
.engine-stone-tab:hover { background: var(--surface-hover); }
.engine-stone-tab.active { color: var(--stone-color, var(--accent)); border-bottom-color: var(--stone-color, var(--accent)); background: rgba(255,255,255,0.03); }
.engine-stone-content { flex: 1; overflow-y: auto; padding: 16px; }
.engine-stone-card { }
.engine-stone-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.engine-stone-section { margin-bottom: 16px; }
.engine-stone-section-title { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; }
.engine-stone-etymologies { display: flex; flex-direction: column; gap: 4px; }
.engine-stone-etym { display: flex; align-items: center; gap: 10px; padding: 4px 8px; background: rgba(255,255,255,0.02); border-radius: 4px; font-size: 12px; }
.engine-stone-etym-lang { font-weight: 600; color: var(--text-muted); text-transform: capitalize; min-width: 70px; font-size: 10px; }
.engine-stone-etym-val { color: var(--text-primary); font-style: italic; }
.engine-stone-cascade { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.engine-stone-cascade-step { font-size: 12px; padding: 4px 10px; background: rgba(255,255,255,0.04); border-radius: 4px; color: var(--text-primary); }
.engine-stone-sanctuary { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.engine-stone-sense { padding: 6px 10px; background: rgba(255,255,255,0.02); border-radius: 4px; }
.engine-stone-sense-label { display: block; font-size: 9px; text-transform: capitalize; color: var(--text-muted); }
.engine-stone-sense-val { font-size: 12px; color: var(--text-secondary); }
.engine-stone-footer { display: flex; justify-content: space-between; padding: 6px 12px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════════════════════════
   PHASE 7 — COSMOLOGIE
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-cosmo { display: flex; flex-direction: column; height: 100%; }
.engine-cosmo-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.engine-cosmo-tab { flex: 1; padding: 8px 6px; text-align: center; font-size: 11px; cursor: pointer; background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--text-secondary); transition: all 0.2s; }
.engine-cosmo-tab:hover { background: var(--surface-hover); }
.engine-cosmo-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.engine-cosmo-viewport { flex: 1; overflow-y: auto; padding: 16px; }
.engine-cosmo-system { }
.engine-cosmo-system-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.engine-cosmo-canvas-container { width: 100%; height: 200px; background: radial-gradient(ellipse at center, rgba(10,10,30,1), rgba(5,5,15,1)); border-radius: 8px; margin-bottom: 12px; }
.engine-cosmo-canvas { width: 100%; height: 100%; }
.engine-cosmo-info { }
.engine-cosmo-unified { }
.engine-cosmo-unified-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.engine-cosmo-unified-card { padding: 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 8px; text-align: center; }
.engine-cosmo-footer { display: flex; justify-content: space-between; padding: 6px 12px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════════════════════════
   GENERIC FALLBACK
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-generic { display: flex; align-items: center; justify-content: center; height: 100%; }
.engine-generic-center { text-align: center; color: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════════════════════════
   ENGINE RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .engine-pres { flex-direction: column; }
    .engine-pres-sidebar { width: 100%; max-height: 120px; border-right: none; border-bottom: 1px solid var(--border); }
    .engine-pres-slides { display: flex; gap: 4px; overflow-x: auto; }
    .engine-pres-thumb { min-width: 80px; }

    .engine-settings { flex-direction: column; }
    .engine-settings-sidebar {
        width: 100%;
        max-height: 100px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding: 4px;
    }
    .engine-settings-cat { white-space: nowrap; }

    .engine-email { flex-direction: column; }
    .engine-email-sidebar {
        width: 100%;
        max-height: 120px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .engine-dash-charts { grid-template-columns: 1fr; }

    .engine-encyclopedia .engine-ency-body { flex-direction: column; }
    .engine-ency-sidebar { width: 100%; max-height: 120px; border-right: none; border-bottom: 1px solid var(--border); }

    .engine-causal-body { flex-direction: column; }
    .engine-causal-sidebar { width: 100%; max-height: 100px; border-right: none; border-bottom: 1px solid var(--border); display: flex; gap: 4px; overflow-x: auto; padding: 4px; }
    .engine-causal-chain { white-space: nowrap; }

    .engine-oracle-body { flex-direction: column; }
    .engine-oracle-sidebar { width: 100%; max-height: 100px; border-right: none; border-bottom: 1px solid var(--border); display: flex; gap: 4px; overflow-x: auto; flex-wrap: nowrap; padding: 4px; }

    .engine-vib-body { flex-direction: column; }
    .engine-vib-sidebar { width: 100%; max-height: 80px; border-right: none; border-bottom: 1px solid var(--border); flex-direction: row; overflow-x: auto; }

    .engine-stone-sanctuary { grid-template-columns: 1fr; }
    .engine-cosmo-unified-grid { grid-template-columns: 1fr; }
}


/* ═══════════════════════════════════════════════════════════════════════════════
   MODULE MONITOR (Phase 8 — L'Assemblage)
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-modules { display: flex; flex-direction: column; height: 100%; font-size: 13px; }
.engine-mod-filters { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); align-items: center; flex-wrap: wrap; }
.engine-mod-filter-btn { background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); padding: 4px 10px; border-radius: 12px; cursor: pointer; font-size: 11px; transition: all 0.15s; display: flex; align-items: center; gap: 4px; }
.engine-mod-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.engine-mod-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.engine-mod-count { background: rgba(255,255,255,0.2); padding: 1px 6px; border-radius: 8px; font-size: 10px; }
.engine-mod-count-active { background: rgba(76,175,80,0.3); }
.engine-mod-cat-select { background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-secondary); padding: 4px 8px; border-radius: 6px; font-size: 11px; margin-left: auto; cursor: pointer; }
.engine-mod-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.engine-mod-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-style: italic; }

.engine-mod-item { padding: 8px 12px; border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.04)); transition: background 0.15s; }
.engine-mod-item:hover { background: rgba(255,255,255,0.03); }
.engine-mod-item.active { border-left: 3px solid #4CAF50; }
.engine-mod-item.error { border-left: 3px solid #f44336; }
.engine-mod-item-main { display: flex; align-items: center; gap: 8px; }
.engine-mod-status { font-size: 10px; flex-shrink: 0; }
.engine-mod-icon { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.engine-mod-info { flex: 1; min-width: 0; }
.engine-mod-name { font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.engine-mod-desc { color: var(--text-muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.engine-mod-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.engine-mod-cat-badge { font-size: 9px; padding: 1px 6px; border-radius: 8px; white-space: nowrap; }
.engine-mod-uptime { font-size: 10px; color: var(--text-muted); font-family: monospace; }
.engine-mod-actions { display: flex; gap: 4px; flex-shrink: 0; }
.engine-mod-btn { padding: 3px 10px; border-radius: 6px; border: none; cursor: pointer; font-size: 10px; transition: all 0.15s; }
.engine-mod-btn.activate { background: rgba(76,175,80,0.15); color: #4CAF50; }
.engine-mod-btn.activate:hover { background: rgba(76,175,80,0.3); }
.engine-mod-btn.deactivate { background: rgba(244,67,54,0.1); color: #f44336; }
.engine-mod-btn.deactivate:hover { background: rgba(244,67,54,0.25); }
.engine-mod-permanent { font-size: 9px; color: var(--text-muted); font-style: italic; padding: 3px 8px; }
.engine-mod-last-result { font-size: 10px; color: var(--text-muted); padding-left: 42px; margin-top: 2px; }
.engine-mod-footer { display: flex; justify-content: space-between; padding: 6px 12px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted); }

/* Hub badge for module count */
.hub-badge { background: var(--accent); color: #fff; font-size: 9px; padding: 1px 5px; border-radius: 8px; margin-left: auto; min-width: 14px; text-align: center; }


/* ═══════════════════════════════════════════════════════════════════════════════
   PHASE 10 — CHE·NU GOVERNANCE STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── SILENCE MODE ──────────────────────────────────────────────────────────── */
.silence-mode .suggestion-toast,
.silence-mode .hub-badge,
.silence-mode .notification-dot,
.silence-mode .fab-pulse,
.silence-mode .topbar-notification,
.silence-mode [data-suggestion] {
    display: none !important;
}
.silence-mode .desktop-topbar {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}
.silence-mode .topbar-sphere {
    background: rgba(255,255,255,0.05) !important;
    color: var(--text-secondary) !important;
}
.silence-mode .tray-icon {
    opacity: 0.4;
}
/* Silence mode indicator */
.silence-mode::after {
    content: '🤫 Mode Silence';
    position: fixed;
    bottom: 52px;
    right: 12px;
    font-size: 10px;
    color: var(--text-muted);
    padding: 3px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    z-index: 999;
    pointer-events: none;
    opacity: 0.6;
}

/* ─── DECISION ECHO WINDOW ──────────────────────────────────────────────────── */
.engine-decision-echo { display: flex; flex-direction: column; height: 100%; }
.engine-echo-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.engine-echo-toolbar select, .engine-echo-filter {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}
.engine-echo-count { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.engine-echo-disclaimer { padding: 6px 14px; font-size: 10px; color: var(--text-muted); font-style: italic; border-bottom: 1px solid var(--border); }
.engine-echo-list { flex: 1; overflow-y: auto; padding: 8px; }
.engine-echo-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); font-size: 13px; text-align: center; padding: 20px; }
.engine-echo-item {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    background: var(--surface);
    transition: background 0.15s;
}
.engine-echo-item:hover { background: var(--surface-hover); }
.engine-echo-time { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; font-family: monospace; }
.engine-echo-statement { font-size: 12px; color: var(--text-primary); line-height: 1.5; }
.engine-echo-meta { display: flex; gap: 8px; margin-top: 6px; font-size: 10px; color: var(--text-muted); }
.engine-echo-scope {
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(99,102,241,0.15);
    color: #818CF8;
}
.engine-echo-reversibility { font-size: 9px; }
.engine-echo-sphere { font-size: 9px; }
.engine-echo-footer { padding: 6px 12px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-muted); text-align: center; }

/* ─── CONTEXT RECOVERY WINDOW ───────────────────────────────────────────────── */
.engine-recovery { display: flex; flex-direction: column; height: 100%; padding: 20px; }
.engine-recovery-calm {
    text-align: center;
    padding: 16px 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}
.engine-recovery-icon { font-size: 36px; margin-bottom: 8px; }
.engine-recovery-title { font-size: 15px; color: var(--text-primary); font-weight: 500; margin-bottom: 4px; }
.engine-recovery-subtitle { font-size: 12px; color: var(--text-muted); font-style: italic; }
.engine-recovery-state {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 12px 0;
}
.engine-recovery-state-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.engine-recovery-state-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
    color: var(--text-secondary);
}
.engine-recovery-state-item strong { color: var(--text-primary); font-weight: 500; }
.engine-recovery-choices {
    margin: 16px 0;
}
.engine-recovery-choices-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.engine-recovery-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-secondary);
    font-size: 12px;
}
.engine-recovery-option:hover { background: var(--surface-hover); border-color: var(--border-hover); }
.engine-recovery-option.selected { background: rgba(99,102,241,0.1); border-color: #6366F1; color: var(--text-primary); }
.engine-recovery-option input[type="radio"] { accent-color: #6366F1; }
.engine-recovery-confirm {
    display: block;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: #6366F1;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    margin-top: 12px;
    transition: background 0.2s;
}
.engine-recovery-confirm:hover { background: #5558E6; }
.engine-recovery-footer {
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* ─── LEGACY EXPORT WINDOW ──────────────────────────────────────────────────── */
.engine-legacy { display: flex; flex-direction: column; height: 100%; padding: 16px; overflow-y: auto; }
.engine-legacy-header {
    text-align: center;
    padding: 10px 0 14px;
}
.engine-legacy-icon { font-size: 32px; }
.engine-legacy-title { font-size: 15px; color: var(--text-primary); font-weight: 500; margin: 4px 0; }
.engine-legacy-subtitle { font-size: 12px; color: var(--text-muted); }
.engine-legacy-section-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.engine-legacy-mode {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.engine-legacy-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}
.engine-legacy-radio:hover { color: var(--text-primary); }
.engine-legacy-radio input[type="radio"] { accent-color: #6366F1; }
.engine-legacy-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.engine-legacy-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
}
.engine-legacy-checkbox input[type="checkbox"] { accent-color: #6366F1; }
.engine-legacy-forbidden {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.engine-legacy-forbidden-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.6;
}
.engine-legacy-export-btn {
    display: block;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: #6366F1;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}
.engine-legacy-export-btn:hover { background: #5558E6; }
.engine-legacy-disclaimer {
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-style: italic;
}


/* ─── NARRATIVE NOTES WINDOW ──────────────────────────────────────────────────── */
.engine-narrative-notes { display: flex; flex-direction: column; height: 100%; }
.engine-notes-header { padding: 8px 14px; border-bottom: 1px solid var(--border); }
.engine-notes-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 3px solid var(--text-muted);
}
.engine-notes-create {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.engine-notes-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
}
.engine-notes-input:focus {
    outline: none;
    border-color: var(--border-focus);
}
.engine-notes-input::placeholder { color: var(--text-muted); }
.engine-notes-controls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}
.engine-notes-type {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12px;
    flex: 1;
}
.engine-notes-btn {
    background: var(--cobalt, #0047AB);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.engine-notes-btn:hover { opacity: 0.85; }
.engine-notes-list { flex: 1; overflow-y: auto; padding: 8px 14px; }
.engine-note-item {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    background: var(--surface);
    transition: background 0.15s;
}
.engine-note-item:hover { background: var(--surface-hover); }
.engine-note-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.engine-note-type { font-size: 11px; color: var(--text-secondary); }
.engine-note-date { font-size: 10px; color: var(--text-muted); font-family: monospace; margin-left: auto; }
.engine-note-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}
.engine-note-item:hover .engine-note-delete { opacity: 1; }
.engine-note-delete:hover { color: #F43F5E; }
.engine-note-content {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.engine-note-sphere {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
}
.engine-notes-footer {
    padding: 8px 14px;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    text-align: center;
    font-style: italic;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   AGENT MEMORY WINDOW
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-agent-memory { display: flex; flex-direction: column; height: 100%; padding: 12px; overflow-y: auto; }
.engine-amem-header { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.engine-amem-select {
    flex: 1; padding: 6px 10px; font-size: 13px;
    background: var(--surface); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 6px;
    cursor: pointer;
}
.engine-amem-select:focus { outline: none; border-color: var(--accent); }
.engine-amem-btn {
    padding: 5px 10px; background: var(--surface-hover); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
    font-size: 12px; transition: background 0.2s;
}
.engine-amem-btn:hover { background: rgba(255,255,255,0.08); }
.engine-amem-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.engine-amem-btn.primary:hover { opacity: 0.9; }
.engine-amem-sections { display: flex; flex-direction: column; gap: 0; flex: 1; }
.engine-amem-section { padding: 10px 0; border-bottom: 1px solid var(--border); }
.engine-amem-section-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.engine-amem-section-desc { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.engine-amem-list { display: flex; flex-direction: column; gap: 4px; max-height: 140px; overflow-y: auto; margin-bottom: 8px; }
.engine-amem-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; background: rgba(255,255,255,0.03);
    border: 1px solid var(--border); border-radius: 6px; font-size: 12px;
}
.engine-amem-item-text { flex: 1; color: var(--text-secondary); line-height: 1.4; }
.engine-amem-item-del {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 12px; padding: 2px 4px; border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.engine-amem-item-del:hover { color: #f44; background: rgba(255,68,68,0.1); }
.engine-amem-empty { font-size: 11px; color: var(--text-muted); padding: 10px; text-align: center; font-style: italic; }
.engine-amem-add { display: flex; gap: 6px; }
.engine-amem-input {
    flex: 1; padding: 6px 8px; font-size: 12px;
    background: var(--surface); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: 6px;
}
.engine-amem-input:focus { outline: none; border-color: var(--accent); }
.engine-amem-input::placeholder { color: var(--text-muted); }
.engine-amem-stats {
    display: flex; gap: 16px; font-size: 11px; color: var(--text-secondary);
    padding: 8px; background: rgba(255,255,255,0.02); border-radius: 6px;
}
.engine-amem-stats b { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════════════════
   SPRINT 5 — TOAST SYSTEM
   ═══════════════════════════════════════════════════════════════════════════════ */
#atom-toast-container {
    position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column-reverse; gap: 8px;
    z-index: 10000; pointer-events: none;
}
.atom-toast {
    padding: 8px 18px; border-radius: 10px; font-size: 12px;
    display: flex; align-items: center; gap: 8px;
    backdrop-filter: blur(12px);
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto; white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.atom-toast.show { opacity: 1; transform: translateY(0); }
.atom-toast-info    { background: rgba(30,58,138,0.92); color: #e8e8ed; }
.atom-toast-success { background: rgba(16,185,129,0.92); color: white; }
.atom-toast-warning { background: rgba(245,158,11,0.92); color: #1a1a2e; }
.atom-toast-error   { background: rgba(239,68,68,0.92); color: white; }
.atom-toast-icon    { font-size: 14px; flex-shrink: 0; }
.atom-toast-msg     { line-height: 1.4; }

/* ═══════════════════════════════════════════════════════════════════════════════
   SPRINT 5 — DYNAMIC SEARCH
   ═══════════════════════════════════════════════════════════════════════════════ */
.search-section-dynamic { border-top: 1px solid rgba(255,255,255,0.06); margin-top: 4px; padding-top: 4px; }
.search-section-dynamic .search-section-title { color: var(--sacred-gold, #D8B26A); }
.search-item-dynamic { transition: background 0.15s; }

/* ═══════════════════════════════════════════════════════════════════════════════
   SPRINT 5 — PARTNER PAGE
   ═══════════════════════════════════════════════════════════════════════════════ */
.engine-partner { padding: 32px 24px; max-width: 1100px; margin: 0 auto; }
.partner-header { text-align: center; margin-bottom: 32px; }
.partner-title { font-size: 22px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.partner-subtitle { font-size: 13px; color: var(--text-secondary); }
.partner-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.partner-card {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 24px 20px; display: flex; flex-direction: column;
    align-items: center; text-align: center; position: relative; transition: transform 0.2s, border-color 0.2s;
}
.partner-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.15); }
.partner-card-popular {
    border-color: var(--sacred-gold, #D8B26A);
    background: rgba(216,178,106,0.06);
    box-shadow: 0 4px 24px rgba(216,178,106,0.15);
}
.partner-popular-badge {
    position: absolute; top: -10px; right: 16px;
    background: var(--sacred-gold, #D8B26A); color: #1a1a2e;
    font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 10px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.partner-card-icon { font-size: 36px; margin-bottom: 12px; }
.partner-card-name { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.partner-card-price { font-size: 20px; font-weight: 700; color: var(--sacred-gold, #D8B26A); margin-bottom: 16px; }
.partner-card-features {
    list-style: none; padding: 0; margin: 0 0 20px; text-align: left; width: 100%;
    font-size: 12px; color: var(--text-secondary); line-height: 1.8;
}
.partner-card-features li::before { content: '✓ '; color: var(--sacred-gold, #D8B26A); font-weight: 600; }
.partner-card-cta {
    margin-top: auto; padding: 8px 24px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15); background: transparent;
    color: var(--text-primary); cursor: pointer; font-size: 13px; font-weight: 500;
    transition: background 0.2s, transform 0.1s;
}
.partner-card-cta:hover { background: rgba(255,255,255,0.08); }
.partner-card-cta.highlight {
    background: var(--sacred-gold, #D8B26A); color: #1a1a2e; border-color: var(--sacred-gold, #D8B26A);
    font-weight: 600;
}
.partner-card-cta.highlight:hover { filter: brightness(1.1); }
.partner-footer { text-align: center; font-size: 11px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════════
   SPRINT 5 — ONBOARDING TOUR
   ═══════════════════════════════════════════════════════════════════════════════ */
.onboarding-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    z-index: 9998; cursor: pointer;
}
.onboarding-tooltip {
    position: fixed; background: #1a1a2e;
    border: 1px solid rgba(216,178,106,0.35); border-radius: 16px;
    padding: 20px; max-width: 320px; z-index: 9999;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    animation: onboardingIn 0.3s ease;
}
@keyframes onboardingIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.onboarding-step-counter {
    font-size: 11px; color: var(--sacred-gold, #D8B26A);
    margin-bottom: 8px; font-weight: 600; letter-spacing: 0.5px;
}
.onboarding-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: #e8e8ed; }
.onboarding-text { font-size: 13px; color: rgba(255,255,255,0.65); line-height: 1.6; margin-bottom: 18px; }
.onboarding-actions { display: flex; justify-content: space-between; align-items: center; }
.onboarding-skip {
    background: none; border: none; color: rgba(255,255,255,0.55);
    cursor: pointer; font-size: 12px; padding: 4px 0;
}
.onboarding-skip:hover { color: rgba(255,255,255,0.6); }
.onboarding-next {
    background: var(--sacred-gold, #D8B26A); color: #1a1a2e;
    border: none; padding: 7px 18px; border-radius: 8px;
    cursor: pointer; font-weight: 600; font-size: 13px;
    transition: filter 0.15s;
}
.onboarding-next:hover { filter: brightness(1.1); }
.onboarding-highlight {
    position: relative; z-index: 9999;
    box-shadow: 0 0 0 4px rgba(216,178,106,0.45), 0 0 20px rgba(216,178,106,0.15);
    border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SPRINT 5 — LIGHT MODE
   ═══════════════════════════════════════════════════════════════════════════════ */
[data-theme="light"] {
    --surface: #f5f5f7;
    --surface-elevated: #ffffff;
    --surface-hover: rgba(0,0,0,0.04);
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted: #aeaeb2;
    --border: rgba(0,0,0,0.1);
    --border-subtle: rgba(0,0,0,0.06);
    --accent: #0066CC;
    --sacred-gold: #A07818;
}

/* Topbar */
[data-theme="light"] .topbar {
    background: rgba(255,255,255,0.88); color: #1d1d1f;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    backdrop-filter: blur(20px);
}
[data-theme="light"] .topbar-btn,
[data-theme="light"] .topbar-monde-btn { color: #1d1d1f; }
[data-theme="light"] .topbar-btn:hover,
[data-theme="light"] .topbar-monde-btn:hover { background: rgba(0,0,0,0.06); }
[data-theme="light"] .topbar-monde-btn.active { background: rgba(0,0,0,0.08); color: #A07818; }
[data-theme="light"] .topbar-badge { background: #0066CC; }
[data-theme="light"] .topbar-clock { color: #6e6e73; }

/* Hub Sidebar */
[data-theme="light"] .hub-sidebar {
    background: #f0f0f2; border-right: 1px solid rgba(0,0,0,0.08);
}
[data-theme="light"] .hub-section-title { color: #6e6e73; }
[data-theme="light"] .hub-thread,
[data-theme="light"] .hub-agent { color: #1d1d1f; }
[data-theme="light"] .hub-thread:hover,
[data-theme="light"] .hub-agent:hover { background: rgba(0,0,0,0.05); }
[data-theme="light"] .hub-thread.active { background: rgba(0,102,204,0.08); border-left-color: #0066CC; }

/* Main Viewport */
[data-theme="light"] .desktop-viewport { background: #e8ecf1; }
[data-theme="light"] #desktop-shell { background: #f5f5f7; color: #1d1d1f; }

/* Windows / Pages */
[data-theme="light"] .page-container,
[data-theme="light"] .window-content { background: #ffffff; color: #1d1d1f; }
[data-theme="light"] .page-tab { color: #6e6e73; border-bottom-color: transparent; }
[data-theme="light"] .page-tab.active { color: #1d1d1f; border-bottom-color: #0066CC; }
[data-theme="light"] .page-tab:hover { background: rgba(0,0,0,0.04); }

/* Taskbar */
[data-theme="light"] .taskbar {
    background: rgba(255,255,255,0.9); border-top: 1px solid rgba(0,0,0,0.08);
    backdrop-filter: blur(20px);
}
[data-theme="light"] .taskbar-tray-btn { color: #1d1d1f; }
[data-theme="light"] .taskbar-tray-btn:hover { background: rgba(0,0,0,0.06); }

/* Search Overlay */
[data-theme="light"] .search-dialog {
    background: #ffffff; border: 1px solid rgba(0,0,0,0.12);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
[data-theme="light"] .search-field {
    background: #f5f5f7; color: #1d1d1f; border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .search-item { color: #1d1d1f; }
[data-theme="light"] .search-item:hover,
[data-theme="light"] .search-item.highlight { background: rgba(0,0,0,0.04); }
[data-theme="light"] .search-section-title { color: #6e6e73; }
[data-theme="light"] .search-kbd { background: #e8e8ed; color: #6e6e73; }

/* Chat Panel */
[data-theme="light"] .chat-panel { background: #ffffff; border-left: 1px solid rgba(0,0,0,0.08); }
[data-theme="light"] .chat-messages { background: #f5f5f7; }
[data-theme="light"] .chat-message-user { background: #0066CC; color: white; }
[data-theme="light"] .chat-message-agent { background: #e8e8ed; color: #1d1d1f; }
[data-theme="light"] .chat-input { background: #f5f5f7; color: #1d1d1f; border-color: rgba(0,0,0,0.1); }

/* Settings */
[data-theme="light"] .engine-settings { background: #ffffff; }
[data-theme="light"] .engine-settings-sidebar { background: #f5f5f7; border-right-color: rgba(0,0,0,0.08); }
[data-theme="light"] .engine-settings-cat { color: #1d1d1f; }
[data-theme="light"] .engine-settings-cat:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .engine-settings-cat.active { background: rgba(0,102,204,0.08); color: #0066CC; }
[data-theme="light"] .engine-setting-row { border-bottom-color: rgba(0,0,0,0.06); }
[data-theme="light"] .engine-setting-select {
    background: #f5f5f7; color: #1d1d1f; border-color: rgba(0,0,0,0.1);
}

/* Cards, Modals, Generic */
[data-theme="light"] .engine-generic { background: #ffffff; }
[data-theme="light"] .engine-generic-center { color: #1d1d1f; }
[data-theme="light"] .suggestion-btn.accept { background: #0066CC; }

/* Activity Feed */
[data-theme="light"] .engine-activity { background: #ffffff; }
[data-theme="light"] .engine-activity-item { border-bottom-color: rgba(0,0,0,0.06); }
[data-theme="light"] .engine-activity-item.new { background: rgba(0,102,204,0.04); }
[data-theme="light"] .engine-activity-time { color: #aeaeb2; }

/* Partner */
[data-theme="light"] .partner-card { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .partner-card:hover { border-color: rgba(0,0,0,0.15); }
[data-theme="light"] .partner-card-popular { border-color: #A07818; background: rgba(160,120,24,0.04); }
[data-theme="light"] .partner-card-cta { border-color: rgba(0,0,0,0.15); color: #1d1d1f; }
[data-theme="light"] .partner-card-cta:hover { background: rgba(0,0,0,0.04); }

/* Toast (light variants) */
[data-theme="light"] .atom-toast-info { background: rgba(0,102,204,0.92); color: white; }

/* Quick Capture */
[data-theme="light"] .quick-capture-area { background: #f5f5f7; border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .quick-capture-input { background: #ffffff; color: #1d1d1f; }

/* Notification popup */
[data-theme="light"] .notification-popup { background: #ffffff; border: 1px solid rgba(0,0,0,0.1); box-shadow: 0 8px 30px rgba(0,0,0,0.12); }
[data-theme="light"] .notification-item { color: #1d1d1f; border-bottom-color: rgba(0,0,0,0.06); }
[data-theme="light"] .notification-item:hover { background: rgba(0,0,0,0.03); }

/* Onboarding light */
[data-theme="light"] .onboarding-tooltip { background: #ffffff; border-color: rgba(0,0,0,0.12); color: #1d1d1f; box-shadow: 0 12px 40px rgba(0,0,0,0.15); }
[data-theme="light"] .onboarding-title { color: #1d1d1f; }
[data-theme="light"] .onboarding-text { color: rgba(0,0,0,0.55); }
[data-theme="light"] .onboarding-skip { color: rgba(0,0,0,0.35); }
[data-theme="light"] .onboarding-skip:hover { color: rgba(0,0,0,0.6); }

/* ═══════════════════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════════════════ */
.no-select { user-select: none; -webkit-user-select: none; }
.no-drag { -webkit-app-region: no-drag; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }


/* ═══════════════════════════════════════════════════════════════════════════════
   SIMPLIFIED MODE — Sprint E : New user experience
   Hides advanced features until user is ready
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Hide advanced elements in simplified mode */
.simplified-mode #dock-right { display: none; }
.simplified-mode .topbar-lentille,
.simplified-mode #topbar-lentille { opacity: 0.3; pointer-events: none; }
.simplified-mode .minimap-action-btn#minimap-back,
.simplified-mode .minimap-action-btn#minimap-forward { display: none; }
.simplified-mode .gov-dashboard-btn,
.simplified-mode [data-shortcut="encyclopedia"],
.simplified-mode [data-shortcut="activity"] { display: none; }
.simplified-mode .sphere-locked { display: none; }

/* Simplified mode banner */
#simplified-mode-banner {
    position: fixed;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(30, 58, 138, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(216, 178, 106, 0.25);
    border-radius: 12px;
    z-index: 9000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 0.3s ease;
    max-width: 90vw;
}
.simplified-banner-icon { font-size: 1rem; }
.simplified-banner-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
}
.simplified-banner-btn {
    padding: 5px 14px;
    background: var(--sacred-gold, #D8B26A);
    color: #1a1a2e;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.simplified-banner-btn:hover { opacity: 0.85; }
.simplified-banner-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}
.simplified-banner-close:hover { color: rgba(255, 255, 255, 0.8); }

/* Light mode variant */
[data-theme="light"] #simplified-mode-banner {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .simplified-banner-text { color: rgba(0, 0, 0, 0.7); }
[data-theme="light"] .simplified-banner-close { color: rgba(0, 0, 0, 0.3); }

/* Mobile: stack banner vertically */
@media (max-width: 768px) {
    #simplified-mode-banner { flex-wrap: wrap; justify-content: center; text-align: center; }
    .simplified-banner-text { white-space: normal; font-size: 0.8rem; }
}
