 
    /* --- THEME & VARS (iSoniik Lexie) --- */
    :root {
        --bg: #050505; 
        --surface: rgba(20, 20, 23, 0.75); 
        --surface-hover: rgba(255, 255, 255, 0.08);
        --border: rgba(255, 255, 255, 0.08); 
        --text: #ececec; 
        --text-muted: #9ca3af;
        --primary: #8b5cf6; /* Fiolet */
        --primary-glow: rgba(139, 92, 246, 0.4);
        --accent: #ec4899; /* Róż */
        --success: #10b981; 
        --danger: #ef4444; 
        --warning: #f59e0b;
        --glass: blur(24px);
        --radius-lg: 24px;
        --radius-md: 16px;
        --radius-sm: 10px;
        
        /* Scrollbar */
        --scroll-track: #0a0a0a;
        --scroll-thumb: #333;
        --scroll-thumb-hover: #555;
    }
 

/* Styl dla dynamicznie generowanego kontenera treści, jeśli go nie ma */
.dynamic-modal-body {
    padding: 30px;
    font-size: 14px;
    color: var(--text-muted);
}
    /* --- RESET --- */
    #wpadminbar { display: none !important; } html { margin-top: 0 !important; }
    * { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; user-select: none; }
    
/* --- ZAAWANSOWANE TŁO (CYBERPUNK NEBULA) --- */

 
/* --- ANIMACJE TŁA --- */

/* Przesuwanie siatki po skosie */
@keyframes gridFloat {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-80px, -80px); }
}

/* Pulsowanie kolorów */
@keyframes nebulaPulse {
    0% { 
        transform: scale(1) rotate(0deg); 
        opacity: 0.6; 
    }
    50% { 
        transform: scale(1.1) rotate(3deg); 
        opacity: 0.9; 
    }
    100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 0.6; 
    }
}
    
  /* --- STYLIZACJA PASKA PRZEWIJANIA (SCROLLBAR) DLA GRIDU --- */

/* 1. Definicja szerokości paska */
#grid-scroll-area::-webkit-scrollbar {
    width: 8px; /* Wąski, elegancki pasek */
}

/* 2. Tło paska (Track) */
#grid-scroll-area::-webkit-scrollbar-track {
    background: transparent; /* Przezroczyste tło, żeby nie rzucało się w oczy */
    margin: 20px 0;          /* Marginesy góra/dół, żeby pasek nie dotykał krawędzi */
}

/* 3. Uchwyt paska (Thumb) */
#grid-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15); /* Półprzezroczysty biały */
    border-radius: 10px;     /* Mocno zaokrąglony */
    border: 2px solid transparent; /* Triki, żeby pasek był "chudszy" optycznie */
    background-clip: content-box;
    transition: background 0.3s;
}

/* 4. Uchwyt po najechaniu myszką */
#grid-scroll-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3); /* Jaśniejszy po najechaniu */
    background-clip: content-box;
}

/* 5. Wsparcie dla Firefoxa */
#grid-scroll-area {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}  
  .modal-id-badge:hover {opacity:1}  
/* --- NOWY STYL DEBUGGERA (BOTTOM BAR) --- */
.modal-id-badge {
    position: absolute;
    bottom: 3px;          /* Na dole */
    right: 30px;           /* Po prawej */
     left: 30px;     
    top: auto;             /* Resetujemy górę */
    width: auto;
    min-width: 200px;
    max-width: 400px;
    opacity: 0.2;
    background: rgba(15, 15, 20, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    z-index: 9999;
    
    display: flex;
    flex-direction: column-reverse; /* Żeby lista wysuwała się DO GÓRY */
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* HEADER: Pasek widoczny zawsze */
.badge-header {
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: transparent;
    border-top: 1px solid transparent;
}

.badge-header:hover {
    background: rgba(255,255,255,0.03);
}

.badge-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-id-text {
    font-family: 'Consolas', monospace;
    color: var(--primary); 
    font-weight: 700;
    background: rgba(139, 92, 246, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.badge-hint-text {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.7;
}

.badge-toggle-icon {
    font-size: 10px;
    opacity: 0.5;
    transition: transform 0.3s;
}

/* BODY: Lista komend (Wysuwana do góry) */
.badge-body {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.2);
    border-radius: 12px 12px 0 0;
}

/* Stan ROZWINIĘTY */
.modal-id-badge.expanded {
    border-color: var(--accent);
    box-shadow: 0 -10px 40px rgba(236, 72, 153, 0.15);
    transform: translateY(-5px);
}

.modal-id-badge.expanded .badge-header {
    border-top-color: rgba(255,255,255,0.1);
}

.modal-id-badge.expanded .badge-toggle-icon {
    transform: rotate(180deg);
    color: var(--accent);
    opacity: 1;
}

.modal-id-badge.expanded .badge-body {
    max-height: 300px; /* Limit wysokości */
    opacity: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Stylizacja listy komend wewnątrz */
.cmd-item {
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    border-left: 2px solid var(--border);
}
.cmd-item:hover {
    background: rgba(255,255,255,0.06);
    border-left-color: var(--success);
}

.cmd-regex { 
    color: #e2e8f0; 
    font-family: 'Consolas', monospace; 
    font-size: 10px; 
    line-height: 1.4;
    word-break: break-all; 
}
.cmd-action { 
    color: var(--text-muted); 
    font-size: 9px; 
    margin-top: 4px; 
    display: flex; 
    align-items: center; 
    gap: 4px; 
    text-transform: uppercase; 
    font-weight: 600; 
}
/* Styl, gdy AI mówi (fala dźwiękowa / inny kolor) */
#mic-btn-main.speaking {
    background: #fff; /* Biały kolor oznacza, że AI nadaje */
    color: #000;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    animation: pulseSpeaking 1.5s infinite;
    pointer-events: auto; /* Pozwala kliknąć, żeby uciszyć */
}

@keyframes pulseSpeaking {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
/* HEADER: Zawsze widoczny pasek z ID */
.badge-header {
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid transparent;
    transition: 0.2s;
}
.badge-header:hover {
    background: rgba(255,255,255,0.05);
}
.badge-id-text {
    font-weight: 700;
    color: var(--accent); /* Różowy kolor ID */
    letter-spacing: 0.5px;
}
.badge-toggle-icon {
    font-size: 10px;
    opacity: 0.5;
    transform: rotate(0deg);
    transition: transform 0.3s;
}

/* BODY: Ukryte szczegóły */
.badge-body {
    max-height: 0; /* Domyślnie zwinięte */
    opacity: 0;
    overflow-y: auto;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.2);
}

/* Klasa aktywna (rozwinięta) */
.modal-id-badge.expanded {
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.15);
}
.modal-id-badge.expanded .badge-header {
    border-bottom-color: var(--border);
}
.modal-id-badge.expanded .badge-toggle-icon {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--primary);
}
.modal-id-badge.expanded .badge-body {
    max-height: 300px; /* Maksymalna wysokość rozwinięcia */
    opacity: 1;
    padding: 10px;
}

/* Wnętrze listy komend */
.cmd-item {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(255,255,255,0.1);
}
.cmd-item:last-child { border: none; margin: 0; padding: 0; }
.cmd-regex { color: #a5b4fc; font-family: 'Consolas', monospace; font-size: 10px; word-break: break-all; }
.cmd-action { color: #6ee7b7; font-size: 9px; font-weight: 600; margin-top: 2px; }

/* Stopka z instrukcją */
.badge-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 9px;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}
    
    
    
    
/* Styl dla trybu jasnego */
body.light-mode {
    --bg: #f3f4f6;
    --surface: rgba(255, 255, 255, 0.85);
    --surface-hover: rgba(0, 0, 0, 0.05);
    --border: rgba(0, 0, 0, 0.1);
    --text: #111827;
    --text-muted: #6b7280;
    --primary: #7c3aed; /* Nieco ciemniejszy fiolet dla kontrastu */
}
    /* --- ICONS (SVG) --- */
    .icon { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
    .icon-sm { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

    /* --- LAYOUT (SIDEBAR PO PRAWEJ) --- */
    #app-container { display: flex; flex: 1; width: 100%; height: 100%; overflow: hidden; position: relative; }
    
    /* GŁÓWNA TREŚĆ - Pierwsza w kolejności, zajmuje lewą stronę */
    #main-area { flex-grow: 1; display: flex; flex-direction: column; height: 100%; min-width: 0; position: relative; z-index: 1; }
    
    /* SIDEBAR - Drugi w kolejności, zajmuje prawą stronę */
    #sidebar { 
        width: 340px; min-width: 340px; background: var(--surface); backdrop-filter: var(--glass);
        border-left: 1px solid var(--border); /* Krawędź z lewej */
        display: flex; flex-direction: column; height: 100%; 
        transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease; 
        z-index: 50; overflow: hidden; 
    }
    #sidebar.hidden { width: 0; min-width: 0; border: none; opacity: 0; }

    /* --- TOP BAR --- */
    #os-top-bar { 
        background: rgba(15, 15, 18, 0.6); backdrop-filter: var(--glass); border-bottom: 1px solid var(--border); 
        padding: 0 20px; display: flex; align-items: center; height: 60px; flex-shrink: 0; gap: 12px; 
    }
    .brand { font-weight: 800; font-size: 15px; letter-spacing: 0.5px; color: #fff; margin-right: 12px; display: flex; align-items: center; gap: 8px; }
    
    #tabs-container { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; padding: 0 10px; }
    
/* --- ZAKTUALIZOWANY STYL ZAKŁADEK --- */
.app-tab { 
    padding: 6px 12px; 
    background: rgba(255,255,255,0.03); 
    border-radius: var(--radius-sm); 
    cursor: pointer; 
    font-size: 12px; height:39px;
    font-weight: 500; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    border: 1px solid transparent; 
    transition: all 0.2s; 
    color: var(--text-muted);
    
    /* NOWE: Ograniczenie szerokości */
    max-width: 160px; 
}

/* NOWA KLASA DLA TEKSTU W ZAKŁADCE */
.tab-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1; /* Zajmij dostępne miejsce */
    min-width: 0; /* Fix dla flexboxa */
}

/* POPRAWKA DLA PRZYCISKU ZAMKNIĘCIA */
.app-tab .close-x { 
    font-size: 10px; 
    opacity: 0.5; 
    width: 16px; 
    height: 16px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 50%;
    
    /* NOWE: Nie zgniataj przycisku */
    flex-shrink: 0; 
}
    .app-tab:hover { background: rgba(255,255,255,0.06); color: var(--text); }
    .app-tab.active { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.2); }
     .app-tab .close-x:hover { background: rgba(255,255,255,0.1); opacity: 1; color: #fff; }

    .btn-icon { background: transparent; border: none; color: var(--text-muted); cursor: pointer; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
    .btn-icon:hover { background: var(--surface-hover); color: #fff; }
    .divider { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }

    /* --- WORKSPACE --- */
    #workspace { flex: 1; position: relative; overflow: hidden; width: 100%; height: 100%; }
    .tabcontent { width: 100%; height: 100%; display: none; position: absolute; top: 0; left: 0; }
    .tabcontent.active { display: block; animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
    .tabcontent iframe {     width: -webkit-fill-available!important;
    height: -webkit-fill-available!important;
    display: block!important;
    border: none!important;
    background: var(--bg-gradient-2)!important;
    padding: 6px 5px!important;
    border-radius: 37px!important;
    margin: 11px 33px; !important}
    #dynamic-frame { width: 100%; height: 100%; border: none; display: none; background: #fff; }
    #dynamic-frame.active { display: block; }
    
    /* DASHBOARD */
    #dashboard-view { width: 100%; height: 100%; display: none; padding: 40px; overflow-y: auto; position: absolute; top: 0; left: 0; }
    #dashboard-view.active { display: block; animation: fadeIn 0.4s ease-out; }

    .dash-header-row { margin-bottom: 40px; }
    .dash-title { font-size: 32px; font-weight: 800; color: #fff; margin-bottom: 5px; letter-spacing: -0.5px; }
    .dash-date { font-size: 14px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }

    .dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 1200px; }
    .dash-card { background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; transition: 0.3s; }
    .dash-card:hover { background: rgba(255,255,255,0.04); border-color: rgba(139, 92, 246, 0.3); transform: translateY(-2px); }
    .dash-card.wide { grid-column: span 2; }
    
    .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
    .card-title { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
    .card-icon { color: var(--primary); }

    .cal-item { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
    .cal-item:last-child { border-bottom: none; }
    .cal-date { width: 44px; text-align: center; background: rgba(255,255,255,0.05); border-radius: 12px; padding: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 44px; }
    .cal-d-num { font-weight: 700; font-size: 15px; color: #fff; }
    .cal-d-month { font-size: 9px; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; }
    .cal-info { display: flex; flex-direction: column; justify-content: center; }
    .cal-title { font-size: 14px; font-weight: 500; color: #fff; margin-bottom: 2px; }
    .cal-time { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }

    .quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .qa-btn-dash { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); color: var(--text); padding: 14px; border-radius: 14px; text-align: left; font-size: 13px; font-weight: 500; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 10px; }
    .qa-btn-dash:hover { background: var(--primary); border-color: var(--primary); color: white; }

    /* --- CHAT (Prawa strona) --- */
    #chat-history { flex: 1; padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
    .bubble { padding: 12px 18px; border-radius: 18px; font-size: 14px; max-width: 90%; line-height: 1.5; animation: slideInRight 0.3s ease-out; word-wrap: break-word; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
    .bubble.user { align-self: flex-end; background: var(--primary); color: white; border-bottom-right-radius: 4px; }
    .bubble.ai { align-self: flex-start; background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
    .bubble.sys { align-self: center; background: transparent; color: var(--text-muted); font-size: 11px; padding: 4px 12px; border: 1px solid var(--border); border-radius: 100px; opacity: 0.8; }
/* --- MINIMALIZACJA DOCKA --- */

/* Przycisk minimalizacji wewnątrz docka */
#mic-minimize-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 0 0 0 8px; /* Odstęp od głównego przycisku */
    display: flex;
    align-items: center;
    transition: 0.2s;
}
#mic-minimize-btn:hover { color: #fff; transform: translateY(2px); }

/* Klasa ukrywająca dock (zjeżdża w dół) */
#mic-dock.minimized {
    transform: translateY(150%); /* Chowa pod ekran */
    opacity: 0;
    pointer-events: none;
}

/* Kiedy dock jest widoczny, dodajemy małe przejście */
#mic-dock {
    /* ... twoje stare style ... */
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55), opacity 0.4s;
}
    /* --- MIC UI (Prawy Dolny Róg) --- */
    #mic-dock { scale:0.8;
        position: fixed; bottom: 55px!important; right: 2px!important;
        left: auto !important; transform: none !important;
        display: flex; align-items: center; gap: 0;
        background: rgba(10, 10, 12, 0.6); backdrop-filter: blur(16px);
        padding: 5px; border-radius: 50px;
        border: 1px solid rgba(255,255,255,0.08);
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        z-index: 9999; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        width: auto;
    }
    #mic-dock.expanded { padding: 5px 16px 5px 5px; gap: 12px; background: rgba(15, 15, 17, 0.95); border-color: var(--primary); }
    
    #dock-status { font-size: 12px; font-weight: 600; color: white; opacity: 0; width: 0; overflow: hidden; white-space: nowrap; transition: 0.3s; }
    #mic-dock.expanded #dock-status { opacity: 1; width: auto; margin-right: 4px; }

    #mic-btn-main {
        width: 42px; height: 42px; border-radius: 50%;
        background: rgba(255,255,255,0.06); border: none;
        color: #fff; display: flex; align-items: center; justify-content: center;
        cursor: pointer; transition: all 0.3s;
    }
    #mic-btn-main:hover { background: rgba(255,255,255,0.15); transform: scale(1.05); }
    #mic-btn-main.listening { background: var(--accent); box-shadow: 0 0 20px rgba(236, 72, 153, 0.4); animation: breathe 2s infinite; }
    #mic-btn-main.processing { background: var(--primary); animation: spin 1s linear infinite; }
    #mic-btn-main.processing::after { content: ''; width: 14px; height: 14px; border: 2px solid white; border-top-color: transparent; border-radius: 50%; }

    /* Suggestion Cloud */
    #suggestion-cloud {
        position: absolute; bottom: 110%; right: 0;
        display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
        pointer-events: none; width: 220px;
    }
    .sug-bubble {
        background: rgba(255, 255, 255, 0.95); color: #000;
        padding: 8px 14px; border-radius: 12px; border-bottom-right-radius: 2px;
        font-size: 12px; font-weight: 600; cursor: pointer;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2); opacity: 0;
        transform: translateY(10px) scale(0.9); transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        pointer-events: auto;
    }
    .sug-bubble:hover { transform: translateY(0) scale(1.05); background: #fff; }
    #suggestion-cloud.visible .sug-bubble { opacity: 1; transform: translateY(0) scale(1); }
    #suggestion-cloud.visible .sug-bubble:nth-child(1) { transition-delay: 0ms; }
    #suggestion-cloud.visible .sug-bubble:nth-child(2) { transition-delay: 80ms; }
    #suggestion-cloud.visible .sug-bubble:nth-child(3) { transition-delay: 160ms; }

    /* --- OTHER UI ELEMENTS --- */
    #dictation-popover {
        position: fixed; bottom: 90px; right: 20px; transform: translateY(20px);
        background: rgba(20, 20, 22, 0.9); backdrop-filter: blur(20px);
        border: 1px solid var(--border); border-radius: 16px; padding: 16px;
        display: flex; flex-direction: column; gap: 10px; opacity: 0; pointer-events: none; transition: 0.3s;
        box-shadow: 0 20px 50px rgba(0,0,0,0.5); width: 300px; z-index: 9998;
        left: auto !important;
    }
    #dictation-popover.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
    .dict-text { font-size: 14px; color: var(--text); text-align: center; margin-bottom: 8px; width: 100%; max-height: 100px; overflow-y: auto; }
    .dict-controls { display: flex; gap: 8px; justify-content: center; }
    
    #toast { position: fixed; top: 30px; left: 50%; transform: translateX(-50%) translateY(-20px); background: #111; border: 1px solid var(--border); color: white; padding: 10px 20px; border-radius: 100px; z-index: 10000; opacity: 0; transition: 0.4s; font-size: 13px; font-weight: 500; pointer-events: none; display: flex; gap: 8px; align-items: center; }
    #toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

    /* Modals & Projects (Keeping structure) */
    .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(10px); z-index: 10000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: 0.3s; }
    .modal-overlay.open { opacity: 1; pointer-events: auto; }
    .modal-box {padding:2px 0px 44px; background: #161618; color: var(--text); border: 1px solid var(--border); border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; max-width: 90%; max-height: 85%; transform: scale(0.95); transition: 0.3s; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7); }
    .modal-overlay.open .modal-box { transform: scale(1); }
    
    #projects-modal-box { width: 900px; max-width: 95vw; height: 80vh; }
    .projects-layout { display: flex; flex: 1; overflow: hidden; }
    .projects-sidebar { width: 300px; background: rgba(255,255,255,0.02); border-right: 1px solid var(--border); padding: 24px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
    .projects-main { flex: 1; padding: 24px; overflow-y: auto; background: rgba(0,0,0,0.1); }
    .new-proj-form { display: flex; flex-direction: column; gap: 12px; }
    .p-inp { background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: white; padding: 10px; border-radius: 8px; font-family: inherit; }
    .project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
    .project-card { background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: 0.2s; }
    .project-card:hover { transform: translateY(-3px); border-color: var(--primary); background: rgba(255,255,255,0.07); }
    .p-top { display: flex; justify-content: space-between; }
    .p-icon { font-size: 24px; background: rgba(255,255,255,0.05); width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
    .p-del { font-size: 11px; color: var(--danger); padding: 4px; cursor: pointer; opacity: 0; }
    .project-card:hover .p-del { opacity: 1; }
    
    /* Shared Modal Styles */
    #grid-content { padding: 40px; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 24px; overflow-y: auto; width: 800px; max-height: 70vh; }
    .grid-item { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 16px; border-radius: 18px; cursor: pointer; background: rgba(255,255,255,0.02); border: 1px solid transparent; transition: 0.2s; }
    .grid-item:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.1); transform: translateY(-4px); }
    .grid-icon { font-size: 28px; }
    .grid-label { font-size: 12px; font-weight: 500; color: var(--text-muted); text-align: center; }
    .qa-header { padding: 6px 24px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.01); display: flex; justify-content: space-between; align-items: center; background: var(--border);}
    .qa-title { font-size: 16px; font-weight: 600; color: var(--text-muted); }
    .qa-body { padding: 30px; font-size: 16px; line-height: 1.6; color: var(--text); opacity: 0.9; }
    .qa-actions { padding: 20px 30px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; background: rgba(0,0,0,0.2); }
    .qa-btn { padding: 8px 20px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,0.05); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 500; transition: 0.2s; }
    .qa-btn:hover { background: rgba(255,255,255,0.1); }
    .qa-btn.primary { background: var(--primary); border-color: var(--primary); color: white; }
    #widgets-grid { padding: 40px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; width: 600px; }
    .widget-card { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; cursor: pointer; transition: 0.3s; text-align: center; }
    .widget-card:hover { background: var(--surface-hover); border-color: var(--primary); transform: translateY(-5px); }
    .w-icon { font-size: 32px; background: rgba(99, 102, 241, 0.1); width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 16px; color: var(--primary); margin-bottom: 5px; }
    .w-title { font-size: 15px; font-weight: 600; color: white; }
    .w-desc { font-size: 12px; color: var(--text-muted); }

    /* Playlist */
    #playlist-content { padding: 24px; width: 450px; display: flex; flex-direction: column; gap: 12px; }
    .playlist-card { display: flex; align-items: center; gap: 16px; padding: 16px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 16px; cursor: pointer; transition: 0.2s; }
    .playlist-card:hover { background: rgba(255,255,255,0.06); border-color: var(--primary); }
    .pl-icon { font-size: 20px; width: 36px; height: 36px; background: var(--primary-glow); display: flex; align-items: center; justify-content: center; border-radius: 10px; color: #fff; }

    /* Music Widget */
    #music-widget { position: fixed; bottom: 20px; left: 20px; z-index: 9000; background: rgba(20, 20, 22, 0.8); border: 1px solid var(--border); backdrop-filter: blur(20px); padding: 12px; border-radius: 50px; display: flex; align-items: center; gap: 16px; box-shadow: 0 20px 40px rgba(0,0,0,0.4); width: 300px; transition: 0.5s; transform: translateY(0); opacity: 1; }
    #music-widget.hidden { transform: translateY(20px); opacity: 0; pointer-events: none; }
    .music-art { width: 36px; height: 36px; background: linear-gradient(135deg, var(--primary), #a855f7); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
    .music-info { flex: 1; overflow: hidden; }
    #music-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
    #music-playlist-name { font-size: 10px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px; }
    .music-controls { display: flex; gap: 2px; }
    .music-controls button { background: transparent; border: none; color: var(--text); cursor: pointer; font-size: 16px; padding: 6px; opacity: 0.8; transition: 0.2s; }
/* --- NOWE STYLE PLAYERA --- */
#music-widget {
    /* Zwiększamy trochę widget, żeby pomieścił suwak */
    height: 80px; 
    padding: 10px 15px;
    align-items: center;
}

/* Obrazek okładki */
#music-cover {
    width: 50px; height: 50px; border-radius: 8px; object-fit: cover;
    margin-right: 12px; display: none; /* Domyślnie ukryty, JS pokaże jeśli jest src */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.music-art-fallback {
    width: 50px; height: 50px; border-radius: 8px; 
    background: linear-gradient(135deg, #333, #111);
    display: flex; align-items: center; justify-content: center;
    margin-right: 12px; font-size: 20px; color: #555;
}

/* Suwak głośności */
.vol-container {
    display: flex; align-items: center; gap: 6px; margin-top: 4px;
}
#music-vol-slider {
    -webkit-appearance: none; width: 80px; height: 4px; 
    background: rgba(255,255,255,0.1); border-radius: 2px; outline: none;
}
#music-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 10px; height: 10px; 
    background: var(--text); border-radius: 50%; cursor: pointer;
}

/* Lista Playlisty (Popover) */
#music-playlist-popover {
    position: absolute; bottom: 90px; left: 0; width: 100%;
    background: rgba(20, 20, 23, 0.95); border: 1px solid var(--border);
    backdrop-filter: blur(20px); border-radius: 16px;
    padding: 10px; display: none; flex-direction: column;
    max-height: 300px; box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    z-index: -1; /* Żeby był "za" lub "nad" widgetem w kontekście stackowania */
}
#music-playlist-popover.visible { display: flex; animation: slideUpFade 0.3s ease; }

.pl-pop-header {
    font-size: 10px; text-transform: uppercase; color: var(--text-muted);
    font-weight: 700; padding: 0 10px 8px 10px; border-bottom: 1px solid var(--border);
}
#pl-pop-list { overflow-y: auto; margin-top: 5px; }

/* Element listy */
.pl-pop-item {
    padding: 8px 10px; font-size: 12px; color: var(--text-muted);
    border-radius: 6px; cursor: pointer; white-space: nowrap; 
    overflow: hidden; text-overflow: ellipsis;
}
.pl-pop-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.pl-pop-item.active { color: var(--primary); font-weight: 600; background: rgba(139, 92, 246, 0.1); }

@keyframes slideUpFade { from{opacity:0; transform:translateY(20px)} to{opacity:1; transform:translateY(0)} }
    @keyframes fadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }
    @keyframes slideInRight { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
    @keyframes breathe { 0% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.4); } 50% { box-shadow: 0 0 20px 6px rgba(236, 72, 153, 0.2); } 100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.4); } }
    @keyframes spin { 100% { transform: rotate(360deg); } }
    
    
    
/* 1. Modal na pełny ekran */
#grid-modal .modal-box {
     width: 99vw;
    height: 99vh;
    max-width: none;
    max-height: none;
    background: var(--primary-glow);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

/* 2. Pasek Narzędzi (Większy, bardziej "Airy") */
.app-toolbar {
    padding: 30px 40px;
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
 

/* 3. Karty Aplikacji (Nowy Styl) */
.apps-grid-layout {
    display: grid;
    /* Responsywne kafelki - min 200px */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    padding-bottom: 40px;
}

.app-card-v4 {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 20px;
        min-width: 179px !important;
    height: 269px !important;
    padding: 0; /* Bez paddingu, żeby grafika wypełniała */
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: initial!important;
    height: 180px; /* Stała wysokość */
}

/* Efekt Hover - Uniesienie i Światło */
.app-card-v4:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255,255,255,0.06);
    border-color: var(--primary);
    box-shadow: 0 15px 40px -10px rgba(0,0,0,0.5), 0 0 20px rgba(139, 92, 246, 0.2);
}

/* Grafika / Miniaturka */
.app-card-thumb {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle at center, rgba(255,255,255,0.03), transparent);
}

/* SVG wewnątrz karty */
.app-card-thumb svg {
    width: 80%;
    height: 80%;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
    transition: 0.4s;
}
.app-card-v4:hover .app-card-thumb svg {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px var(--primary));
}

/* Stopka karty (Tytuł) */
.app-card-footer {
    height: 50px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

.app-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-card-icon-small {
    font-size: 16px;
    opacity: 0.7;
}
.app-search-input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    transition: 0.2s;
}
.app-search-input:focus { border-color: var(--primary); box-shadow: 0 0 15px var(--primary-glow); }

.app-filters {
    display: flex;
    gap: 8px;
}
.filter-pill {
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
}
.filter-pill:hover { background: rgba(255,255,255,0.1); color: white; }
.filter-pill.active { background: var(--primary); color: white; border-color: rgba(255,255,255,0.1); }

/* Główny obszar przewijania */
#grid-scroll-area {
    padding: 4px 10%;
    overflow-y: auto;
    flex: 1;
}

/* Nagłówki sekcji */
.section-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 16px;
    margin-top: 32px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-header:first-child { margin-top: 0; }
.section-line { height: 1px; background: var(--border); flex: 1; opacity: 0.5; }

/* Poziomy Scroll (Systemowe/Ulubione) */
.h-apps-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none; /* Firefox */
}
.h-apps-row::-webkit-scrollbar { display: none; }

.sys-card {
    min-width: 130px;
    height: 110px;
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}
.sys-card:hover { transform: translateY(-4px); border-color: var(--primary); background: rgba(255,255,255,0.08); }
.sys-card .icon-box { font-size: 28px; filter: drop-shadow(0 0 10px rgba(255,255,255,0.1)); }
.sys-card .label { font-size: 12px; font-weight: 600; color: white; }

/* Siatka Pozostałych Aplikacji */
.apps-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(222px, 1fr));
    gap: 20px;
}





.app-item-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    border-radius: 16px;
    cursor: pointer;
    transition: 0.2s;
    background: transparent;
    border: 1px solid transparent;
}
.app-item-small:hover { background: rgba(255,255,255,0.05); border-color: var(--border); }
.app-icon-circle {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.03);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 1px solid var(--border);
}
.app-label-small { font-size: 11px; color: var(--text-muted); text-align: center; font-weight: 500; line-height: 1.3; }
.app-item-small:hover .app-label-small { color: white; }
    
    
    
    /* ========================================= */
    /* === VOICE OS V3: WIDGET SOCKET SYSTEM === */
    /* ========================================= */

    /* Baza dla wszystkich gniazd */
    .sys-widget-socket {
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        /* Puste gniazda nie zajmują miejsca */
        min-height: 0; 
    }
    
    /* Ukrywanie pustych gniazd (opcjonalne, dla czystości) */
    .sys-widget-socket:empty {
        display: none !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    /* [SOCKET A] Top Bar Center */
    #socket_topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-right: 15px;
        /* Separator wizualny od reszty */
        padding-right: 15px;
        border-right: 1px solid rgba(255,255,255,0.05);
    }

    /* [SOCKET B] Under Nav Alert Strip */
    #socket_under_nav {
        width: 100%;
        background: rgba(20, 20, 23, 0.95);
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        animation: slideDownSocket 0.3s ease-out;
    }
    #socket_under_nav:not(:empty) {
        padding: 8px 20px;
        min-height: 40px;
    }

    /* [SOCKET C] Mic Satellite (Dokowany przy mikrofonie) */
    #socket_dock {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-right: 8px;
    }

    /* [SOCKET D] Utility Corner (Fixed Bottom Left) */
    #socket_corner {
        /* Pozycjonowanie jest w HTML (fixed), tu wygląd */
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        /* Zapewnia, że widgety nie klikają się pod spodem */
        pointer-events: auto; 
    }

    /* [SOCKET E] Sidebar Context Pin (Sticky) */
    #socket_sidebar {
        position: sticky;
        top: 0;
        z-index: 20;
        background: rgba(20, 20, 23, 0.9);
        backdrop-filter: blur(12px);
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    #socket_sidebar:not(:empty) {
        padding: 15px 20px;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    }

    /* [SOCKET F] Dashboard Grid Injection */
    #socket_dashboard {
        /* W HTML ma grid-column: span 3 */
        display: block;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 24px;
        width: 100%;
    }

    /* [SOCKET G] Overlay / Focus Mode */
    #socket_overlay {
        position: fixed;
        inset: 0;
        z-index: 9990; /* Poniżej Modali (10000), powyżej Docka */
        background: rgba(5, 5, 5, 0.85); /* Mocne przyciemnienie */
        backdrop-filter: blur(8px);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        pointer-events: none; /* Przepuszcza kliknięcia gdy pusty */
        transition: opacity 0.5s ease;
    }
    #socket_overlay:not(:empty) {
        opacity: 1;
        pointer-events: auto; /* Blokuje tło gdy aktywny */
    }

    /* --- Przykładowy styl dla generycznego widgetu wewnątrz gniazda --- */
    .ai-widget-card {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 15px;
        color: var(--text);
        font-size: 13px;
        animation: fadeIn 0.4s ease;
    }
    
    @keyframes slideDownSocket {
        from { transform: translateY(-10px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    
    
    
    /* --- STYL OKNA SLIDERÓW --- */
#sliders-modal-box {
    width: 95vw;          /* Prawie cała szerokość */
    height: 90vh;         /* Prawie cała wysokość */
    max-width: 1800px;
    display: flex;
    flex-direction: column;
    background: rgba(10, 10, 15, 0.95); /* Ciemniejsze tło */
    backdrop-filter: blur(40px);
}

.sliders-scroll-container {
    display: flex;
    gap: 40px;
    padding: 60px;
    overflow-x: auto;
    overflow-y: hidden;
    height: 100%;
    align-items: center;
    scroll-behavior: smooth;
    /* Ukrywanie paska przewijania */
    scrollbar-width: none; 
}
.sliders-scroll-container::-webkit-scrollbar { display: none; }

/* Karta Slidera */
.slide-card {
    min-width: 400px;
    height: 500px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
}

.slide-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    background: rgba(255,255,255,0.06);
}

.slide-img {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: white;
}

.slide-info {
    padding: 30px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
}

.slide-info h3 { margin: 0 0 10px 0; color: white; font-size: 24px; }
.slide-info p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* Placeholder */
.slide-card.empty { border-style: dashed; opacity: 0.6; }
.slide-card.empty:hover { opacity: 1; border-color: var(--success); }
  /* --- PRZYCISK PIN W BIBLIOTECE --- */
.card-pin-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0; /* Domyślnie ukryty, widać po najechaniu na kartę */
    transform: translateY(-5px);
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 10;
    color: var(--text-muted);
}

/* Pokaż przycisk po najechaniu na kartę */
.app-card-v4:hover .card-pin-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Stan aktywny (Przypięty) - zawsze widoczny */
.card-pin-btn.active {
    opacity: 1;
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(0);
    box-shadow: 0 0 10px var(--primary-glow);
}

.card-pin-btn:hover {
    background: #fff;
    color: #000;
}

/* --- KAFELKI NA PULPICIE (Dashboard Pins) --- */
.dash-pin-card {
    min-width: 140px;
    height: 80px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    cursor: pointer;
    transition: 0.2s;
}
.dash-pin-card:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-3px);
    border-color: var(--primary);
}
.dpc-icon { font-size: 24px; }
.dpc-name { font-size: 13px; font-weight: 600; color: #fff; }  
 
 
   /* --- BRANDING V3 --- */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: default;
}

.brand-icon {
    width: 36px;
    height: 36px;
    /* Subtelna animacja pulsowania */
    animation: brandPulse 4s infinite ease-in-out;
}

.brand-text {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Gradient tylko na drugim członie nazwy */
.brand-accent {
    background: linear-gradient(135deg, #a78bfa 0%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

@keyframes brandPulse {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(139, 92, 246, 0.3)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 12px rgba(236, 72, 153, 0.5)); transform: scale(1.05); }
}
    /* =================================== */
    /* VOICE OS V3 - VISUAL REFRESH 2024  */
    /* Design: Futuristic Glassmorphism    */
    /* =================================== */

    /* --- THEME VARIABLES --- */
    :root {
        /* Kolory bazowe */
        --bg: #0a0a0f;
        --bg-gradient-1: rgba(139, 92, 246, 0.03);
        --bg-gradient-2: rgba(236, 72, 153, 0.02);
        --surface: rgba(20, 20, 30, 0.65);
        --surface-hover: rgba(255, 255, 255, 0.1);
        --border: rgba(255, 255, 255, 0.1);
        --text: #f0f0f5;
        --text-muted: #9ca3b0;
        
        /* Akcenty */
        --primary: #8b5cf6;
        --primary-glow: rgba(139, 92, 246, 0.5);
        --accent: #ec4899;
        --accent-glow: rgba(236, 72, 153, 0.4);
        --success: #10b981;
        --danger: #ef4444;
        --warning: #f59e0b;
        
        /* Efekty */
        --glass: blur(32px);
        --radius-lg: 28px;
        --radius-md: 18px;
        --radius-sm: 12px;
        --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.5), 
                           0 0 1px rgba(255, 255, 255, 0.1);
        --glow-primary: 0 0 30px var(--primary-glow);
        --glow-accent: 0 0 25px var(--accent-glow);
        
        /* Animacje */
        --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
        --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }

    /* Tryb Jasny */
    body.light-mode {
        --bg: #f5f5fa;
        --bg-gradient-1: rgba(139, 92, 246, 0.08);
        --bg-gradient-2: rgba(236, 72, 153, 0.05);
        --surface: rgba(255, 255, 255, 0.85);
        --surface-hover: rgba(0, 0, 0, 0.05);
        --border: rgba(0, 0, 0, 0.1);
        --text: #1a1a1f;
        --text-muted: #6b7280;
        --primary: #7c3aed;
        --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.1), 
                           0 0 1px rgba(0, 0, 0, 0.05);
    }

    /* --- RESET & BASE --- */
    #wpadminbar { display: none !important; }
    html { margin-top: 0 !important; }
    
    * {
        box-sizing: border-box;
        outline: none;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }

/* --- ZAAWANSOWANE TŁO (CYBERPUNK NEBULA) --- */
/* --- ZAAWANSOWANE TŁO (CYBERPUNK NEBULA) --- */

body {
    margin: 0;
    /* Głęboka, "kosmiczna" czerń jako baza */
    background-color: #020203; 
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* WARSTWA 1: Cyfrowa Siatka (Grid) - Daje efekt przestrzeni 3D */
body::before {
    content: "";
    position: fixed;
    inset: -100px; /* Margines na przesunięcie */
    z-index: -2;
    
    /* Cienkie linie siatki */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    
    /* Animacja powolnego dryfowania */
    animation: gridFloat 60s linear infinite;
    
    /* Maskowanie - siatka zanika przy krawędziach ekranu (winieta) */
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

/* WARSTWA 2: Pulsująca Mgławica (Kolory) */
body::after {
    content: "";
    position: fixed;
    top: -50%; left: -50%; right: -50%; bottom: -50%;
    z-index: -1;
    
    /* Twoje kolory firmowe w postaci wielkich plam */
    background: 
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.15), transparent 40%), /* Fiolet (Środek) */
        radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.12), transparent 40%), /* Róż (Prawa góra) */
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.1), transparent 40%);  /* Niebieski (Lewy dół) */
        
    /* Bardzo mocne rozmycie, żeby kolory się mieszały */
    filter: blur(80px);
    
    /* Animacja "oddychania" i obrotu */
    animation: nebulaPulse 15s ease-in-out infinite alternate;
    opacity: 0.8;
}

/* --- ANIMACJE TŁA --- */

/* Przesuwanie siatki po skosie */
@keyframes gridFloat {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-80px, -80px); }
}

/* Pulsowanie kolorów */
@keyframes nebulaPulse {
    0% { 
        transform: scale(1) rotate(0deg); 
        opacity: 0.6; 
    }
    50% { 
        transform: scale(1.1) rotate(3deg); 
        opacity: 0.9; 
    }
    100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 0.6; 
    }
}

/* --- ANIMACJE TŁA --- */

/* Przesuwanie siatki po skosie */
@keyframes gridFloat {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-80px, -80px); }
}

/* Pulsowanie kolorów */
@keyframes nebulaPulse {
    0% { 
        transform: scale(1) rotate(0deg); 
        opacity: 0.6; 
    }
    50% { 
        transform: scale(1.1) rotate(3deg); 
        opacity: 0.9; 
    }
    100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 0.6; 
    }
}

    @keyframes gradientShift {
        0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
        50% { opacity: 0.8; transform: scale(1.1) rotate(5deg); }
    }
 

    @keyframes particleFloat {
        0% { background-position: 0% 0%; }
        100% { background-position: 100% 100%; }
    }

    /* --- ICONS --- */
    .icon {
        width: 20px;
        height: 20px;
        stroke: currentColor;
        stroke-width: 2;
        fill: none;
        stroke-linecap: round;
        stroke-linejoin: round;
        transition: all 0.3s var(--transition-smooth);
    }

    .icon-sm {
        width: 16px;
        height: 16px;
        stroke: currentColor;
        stroke-width: 2;
        fill: none;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* --- MAIN LAYOUT --- */
    #app-container {
        display: flex;
        flex: 1;
        width: 100%;
        height: 100%;
        overflow: hidden;
        position: relative;
        z-index: 1;
    }

    #main-area {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        height: 100%;
        min-width: 0;
        position: relative;
        z-index: 1;
    }

    #sidebar {
        width: 360px;
        min-width: 360px;
        background: var(--surface);
        backdrop-filter: var(--glass);
        border-left: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        height: 100%;
        transition: all 0.5s var(--transition-smooth);
        z-index: 50;
        overflow: hidden;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
    }

    #sidebar.hidden {
        width: 0;
        min-width: 0;
        border: none;
        opacity: 0;
    }

    /* --- TOP BAR --- */
    #os-top-bar {
        background: rgba(15, 15, 20, 0.7);
        backdrop-filter: var(--glass);
        border-bottom: 1px solid var(--border);
        padding: 0 24px;
        display: flex;
        align-items: center;
        height: 64px;
        flex-shrink: 0;
        gap: 14px;
        position: relative;
        z-index: 100;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    }

    /* Subtelny gradient na top barze */
    #os-top-bar::before {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, 
            transparent, 
            var(--primary) 30%, 
            var(--accent) 70%, 
            transparent
        );
        opacity: 0.3;
    }

    .brand {
        font-weight: 800;
        font-size: 16px;
        letter-spacing: 0.5px;
        color: #fff;
        margin-right: 16px;
        display: flex;
        align-items: center;
        gap: 10px;
        position: relative;
    }

    /* Glow effect na logo */
    .brand svg {
        filter: drop-shadow(0 0 8px var(--primary-glow));
        animation: logoPulse 3s ease-in-out infinite;
    }

    @keyframes logoPulse {
        0%, 100% { filter: drop-shadow(0 0 8px var(--primary-glow)); }
        50% { filter: drop-shadow(0 0 15px var(--primary-glow)); }
    }

    #tabs-container {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        flex: 1;
        scrollbar-width: none;
        padding: 0 12px;
    }

    #tabs-container::-webkit-scrollbar { display: none; }

    .app-tab {
        padding: 8px 16px;
        background: rgba(255, 255, 255, 0.04);
        border-radius: var(--radius-sm);
        cursor: pointer;
        font-size: 13px;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 10px;
        white-space: nowrap;
        border: 1px solid transparent;
        transition: all 0.3s var(--transition-smooth);
        color: var(--text-muted);
        position: relative;
        overflow: hidden;
    }

    /* Efekt świetlny przy hover */
    .app-tab::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, var(--primary-glow), var(--accent-glow));
        opacity: 0;
        transition: opacity 0.3s;
    }

    .app-tab:hover::before { opacity: 0.15; }

    .app-tab:hover {
        background: rgba(255, 255, 255, 0.08);
        color: var(--text);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .app-tab.active {
        background: linear-gradient(135deg, 
            rgba(139, 92, 246, 0.2), 
            rgba(236, 72, 153, 0.15)
        );
        color: #fff;
        border-color: rgba(139, 92, 246, 0.3);
        box-shadow: 0 0 20px var(--primary-glow);
    }

    .app-tab .close-x {
        font-size: 11px;
        opacity: 0.5;
        width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.2s;
    }

    .app-tab .close-x:hover {
        background: rgba(255, 255, 255, 0.15);
        opacity: 1;
        color: #fff;
        transform: rotate(90deg);
    }

    .btn-icon {
        background: transparent;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s var(--transition-smooth);
        position: relative;
    }

    .btn-icon::before {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 10px;
        background: var(--surface-hover);
        opacity: 0;
        transition: opacity 0.3s;
    }

    .btn-icon:hover::before { opacity: 1; }

    .btn-icon:hover {
        color: #fff;
        transform: translateY(-2px);
    }

    .btn-icon:active {
        transform: translateY(0) scale(0.95);
    }

    .divider {
        width: 1px;
        height: 24px;
        background: var(--border);
        margin: 0 8px;
        opacity: 0.5;
    }

    /* --- WORKSPACE --- */
    #workspace {
        flex: 1;
        position: relative;
        overflow: hidden;
        width: 100%;
        height: 100%;
    }

    .tabcontent {
        width: 100%;
        height: 100%;
        display: none;
        position: absolute;
        top: 0;
        left: 0;
    }

    .tabcontent.active {
        display: block;
        animation: contentFadeIn 0.5s var(--transition-smooth);
    }

    @keyframes contentFadeIn {
        from {
            opacity: 0;
            transform: scale(0.98) translateY(10px);
        }
        to {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }

    .tabcontent iframe {
        width: 100%;
        height: 100%;
        border: none;
        background: #fff;
        display: block;
    }

    #dynamic-frame {
        width: 100%;
        height: 100%;
        border: none;
        display: none;
        background: #fff;
    }

    #dynamic-frame.active { display: block; }

    /* --- DASHBOARD --- */
    #dashboard-view {
        width: 100%;
        height: 100%;
        display: none;
        padding: 22px 48px;
        overflow-y: auto;
        position: absolute;
        top: 0;
        left: 0;
    }

    #dashboard-view.active {
        display: block;
        animation: dashboardEntrance 0.6s var(--transition-smooth);
    }

    @keyframes dashboardEntrance {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Custom scrollbar dla Dashboard */
    #dashboard-view::-webkit-scrollbar { width: 8px; }
    #dashboard-view::-webkit-scrollbar-track { background: transparent; }
    #dashboard-view::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
    }
    #dashboard-view::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    .dash-header-row {
        margin-bottom: 48px;
        animation: slideInDown 0.6s var(--transition-smooth);
    }

    @keyframes slideInDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .dash-title {
        font-size: 36px;
        font-weight: 900;
        background: linear-gradient(135deg, var(--primary), var(--accent));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        margin-bottom: 8px;
        letter-spacing: -1px;
    }

    .dash-date {
        font-size: 14px;
        color: var(--text-muted);
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 1.5px;
    }

    .dash-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 28px;
        max-width: 1400px;
    }

    .dash-card {
        background: var(--surface);
        backdrop-filter: var(--glass);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: 28px;
        display: flex;
        flex-direction: column;
        transition: all 0.4s var(--transition-smooth);
        position: relative;
        overflow: hidden;
        animation: cardEntrance 0.6s var(--transition-smooth) backwards;
    }

    /* Staggered animation dla kart */
    .dash-card:nth-child(1) { animation-delay: 0.1s; }
    .dash-card:nth-child(2) { animation-delay: 0.2s; }
    .dash-card:nth-child(3) { animation-delay: 0.3s; }
    .dash-card:nth-child(4) { animation-delay: 0.4s; }

    @keyframes cardEntrance {
        from {
            opacity: 0;
            transform: translateY(30px) scale(0.95);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    /* Glow effect przy hover */
    .dash-card::before {
        content: '';
        position: absolute;
        inset: -2px;
        background: linear-gradient(135deg, var(--primary), var(--accent));
        border-radius: var(--radius-lg);
        opacity: 0;
        transition: opacity 0.4s;
        z-index: -1;
    }

    .dash-card:hover::before { opacity: 0.3; }

    .dash-card:hover {
        transform: translateY(-4px) scale(1.01);
        box-shadow: var(--shadow-elevated), var(--glow-primary);
        border-color: rgba(139, 92, 246, 0.4);
    }

    .dash-card.wide {
        grid-column: span 2;
    }

    .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 24px;
    }

    .card-title {
        font-size: 13px;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .card-icon {
        color: var(--primary);
        filter: drop-shadow(0 0 8px var(--primary-glow));
    }

    /* Calendar Items */
    .cal-item {
        display: flex;
        gap: 18px;
        padding: 14px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        transition: all 0.3s;
    }

    .cal-item:last-child { border-bottom: none; }

    .cal-item:hover {
        padding-left: 8px;
        background: rgba(255, 255, 255, 0.02);
        border-radius: 12px;
    }

    .cal-date {
        width: 48px;
        text-align: center;
        background: linear-gradient(135deg, 
            rgba(139, 92, 246, 0.15), 
            rgba(236, 72, 153, 0.1)
        );
        border-radius: 14px;
        padding: 6px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 48px;
        box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
    }

    .cal-d-num {
        font-weight: 800;
        font-size: 16px;
        color: #fff;
    }

    .cal-d-month {
        font-size: 9px;
        color: var(--text-muted);
        text-transform: uppercase;
        margin-top: 2px;
        letter-spacing: 0.5px;
    }

    .cal-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .cal-title {
        font-size: 15px;
        font-weight: 600;
        color: #fff;
        margin-bottom: 4px;
    }

    .cal-time {
        font-size: 12px;
        color: var(--text-muted);
        display: flex;
        align-items: center;
        gap: 6px;
    }

    /* Quick Actions */
    .quick-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 14px;
    }

    .qa-btn-dash {
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border);
        color: var(--text);
        padding: 16px;
        border-radius: 16px;
        text-align: left;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s var(--transition-smooth);
        display: flex;
        align-items: center;
        gap: 12px;
        position: relative;
        overflow: hidden;
    }

    .qa-btn-dash::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, var(--primary), var(--accent));
        opacity: 0;
        transition: opacity 0.3s;
    }

    .qa-btn-dash:hover::before { opacity: 0.15; }

    .qa-btn-dash:hover {
        transform: translateY(-2px) scale(1.02);
        border-color: var(--primary);
        color: white;
        box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
    }

    .qa-btn-dash:active {
        transform: translateY(0) scale(0.98);
    }

    /* --- CHAT SIDEBAR --- */
    #chat-history {
        flex: 1;
        padding: 28px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 18px;
        scroll-behavior: smooth;
    }

    #chat-history::-webkit-scrollbar { width: 6px; }
    #chat-history::-webkit-scrollbar-track { background: transparent; }
    #chat-history::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
    }

    .bubble {
        padding: 14px 20px;
        border-radius: 20px;
        font-size: 14px;
        max-width: 85%;
        line-height: 1.6;
        animation: bubbleSlide 0.4s var(--transition-smooth);
        word-wrap: break-word;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    @keyframes bubbleSlide {
        from {
            opacity: 0;
            transform: translateY(15px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .bubble.user {
        align-self: flex-end;
        background: linear-gradient(135deg, var(--primary), var(--accent));
        color: white;
        border-bottom-right-radius: 4px;
        box-shadow: 0 4px 16px var(--primary-glow);
    }

    .bubble.ai {
        align-self: flex-start;
        background: var(--surface);
        backdrop-filter: var(--glass);
        border: 1px solid var(--border);
        color: var(--text);
        border-bottom-left-radius: 4px;
    }

    .bubble.sys {
        align-self: center;
        background: transparent;
        color: var(--text-muted);
        font-size: 11px;
        padding: 6px 14px;
        border: 1px solid var(--border);
        border-radius: 100px;
        opacity: 0.7;
    }

/* --- LEWY SIDEBAR (MENU GŁÓWNE) --- */
#left-sidebar {
    position: fixed;
    top: 0;
    left: 0; /* Przyklejony do lewej */
    width: 320px;
    height: 100vh;
    background: rgba(15, 15, 20, 0.95); /* Ciemne tło */
    backdrop-filter: blur(20px); /* Rozmycie */
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10000; /* Bardzo wysoko, nad wszystkim */
    
    /* Domyślnie ukryty za lewą krawędzią */
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    display: flex;
    flex-direction: column;
    padding-top: 20px; /* Miejsce od góry */
}

/* Klasa otwierająca */
#left-sidebar.active {
    transform: translateX(0); /* Wysuwa się */
    box-shadow: 10px 0 50px rgba(0,0,0,0.5);
}

/* --- OVERLAY (TŁO) DLA LEWEGO SIDEBARU --- */
#left-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999; /* Tuż pod sidebarem */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#left-menu-overlay.visible {
    opacity: 1;
    pointer-events: auto; /* Blokuje klikanie w tło */
}

/* Przycisk zamykania wewnątrz sidebaru */
.sidebar-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: 0.2s;
}
.sidebar-close-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

    /* --- MIC DOCK (Bottom Right) --- */
    #mic-dock {
        position: fixed;
        bottom: 28px;
        right: 28px;
        display: flex;
        align-items: center;
        gap: 0;
        background: rgba(10, 10, 15, 0.8);
        backdrop-filter: var(--glass);
        padding: 6px;
        border-radius: 60px;
        border: 1px solid var(--border);
        box-shadow: var(--shadow-elevated);
        z-index: 9999;
        transition: all 0.5s var(--transition-smooth);
    }

    #mic-dock::before {
        content: '';
        position: absolute;
        inset: -2px;
        background: linear-gradient(135deg, var(--primary), var(--accent));
        border-radius: 60px;
        opacity: 0;
        transition: opacity 0.4s;
        z-index: -1;
    }

    #mic-dock:hover::before { opacity: 0.3; }

    #mic-dock.expanded {
        padding: 6px 20px 6px 6px;
        gap: 14px;
        background: rgba(15, 15, 20, 0.95);
        border-color: var(--primary);
        box-shadow: var(--shadow-elevated), var(--glow-primary);
    }

    #dock-status {
        font-size: 13px;
        font-weight: 600;
        color: white;
        opacity: 0;
        width: 0;
        overflow: hidden;
        white-space: nowrap;
        transition: all 0.4s var(--transition-smooth);
    }

    #mic-dock.expanded #dock-status {
        opacity: 1;
        width: auto;
        margin-right: 6px;
    }

    #mic-btn-main {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: linear-gradient(135deg, 
            rgba(139, 92, 246, 0.2), 
            rgba(236, 72, 153, 0.15)
        );
        border: 2px solid rgba(255, 255, 255, 0.1);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.4s var(--transition-smooth);
        position: relative;
        overflow: hidden;
    }

    #mic-btn-main::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle, var(--primary-glow), transparent 70%);
        opacity: 0;
        transition: opacity 0.4s;
    }

    #mic-btn-main:hover::before { opacity: 1; }

    #mic-btn-main:hover {
        transform: scale(1.08);
        box-shadow: 0 8px 24px var(--primary-glow);
        border-color: var(--primary);
    }

    #mic-btn-main.listening {
        background: linear-gradient(135deg, var(--accent), #f472b6);
        box-shadow: 0 0 30px var(--accent-glow), 0 0 60px var(--accent-glow);
        animation: breatheGlow 2s ease-in-out infinite;
    }

    @keyframes breatheGlow {
        0%, 100% {
            box-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-glow);
            transform: scale(1);
        }
        50% {
            box-shadow: 0 0 30px var(--accent-glow), 0 0 60px var(--accent-glow);
            transform: scale(1.05);
        }
    }

    #mic-btn-main.processing {
        background: linear-gradient(135deg, var(--primary), #a78bfa);
        animation: spinGlow 1s linear infinite;
    }

    @keyframes spinGlow {
        0% {
            transform: rotate(0deg);
            box-shadow: 0 0 20px var(--primary-glow);
        }
        100% {
            transform: rotate(360deg);
            box-shadow: 0 0 30px var(--primary-glow);
        }
    }

    /* Suggestion Cloud */
    #suggestion-cloud {
        position: absolute;
        bottom: 110%;
        right: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
        pointer-events: none;
        width: 240px;
    }

    .sug-bubble {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.95), 
            rgba(255, 255, 255, 0.85)
        );
        color: #1a1a1f;
        padding: 10px 16px;
        border-radius: 14px;
        border-bottom-right-radius: 2px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
        opacity: 0;
        transform: translateY(15px) scale(0.9);
        transition: all 0.4s var(--transition-bounce);
        pointer-events: auto;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    .sug-bubble:hover {
        transform: translateY(0) scale(1.05);
        background: linear-gradient(135deg, white, rgba(255, 255, 255, 0.95));
        box-shadow: 0 8px 28px rgba(139, 92, 246, 0.3);
    }

    #suggestion-cloud.visible .sug-bubble {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
/* Animacja dla zablokowanego przycisku wklejania */
@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); background: rgba(239, 68, 68, 0.2); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); background: rgba(239, 68, 68, 0.5); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); background: rgba(239, 68, 68, 0.2); }
}

.pulse-error {
    animation: pulseRed 1.5s infinite;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}
/* --- ZMODYFIKOWANY WIDGET --- */
#music-widget {
    height: auto; /* Elastyczna wysokość */
    padding: 0;   /* Padding przenosimy do środka */
    flex-direction: column;
    align-items: stretch;
    overflow: visible; /* Żeby popover wysuwał się poza */
    gap: 0;
}

.music-widget-header {
    display: flex; justify-content: space-between;
    padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.2); border-radius: 50px 50px 0 0;
}

.mw-tool-btn {
    background: transparent; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px; border-radius: 4px; display: flex;
}
.mw-tool-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

.music-body-row {
    display: flex; align-items: center; padding: 10px 15px 5px 15px;
}

.music-controls {
    padding: 5px 15px 12px 15px; justify-content: center;
}

/* --- IKONA W TOP BARZE (Equalizer) --- */
#top-music-indicator.hidden { display: none; }
#top-music-indicator { color: var(--primary); width: 40px; }

.equalizer { display: flex; gap: 2px; align-items: flex-end; height: 14px; }
.bar { width: 3px; background: currentColor; border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.bar:nth-child(1) { height: 60%; animation-delay: 0s; }
.bar:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.bar:nth-child(3) { height: 50%; animation-delay: 0.4s; }

/* Gdy zapauzowane, zatrzymaj animację */
#top-music-indicator.paused .bar { animation: none; height: 4px; opacity: 0.5; }

@keyframes eq {
    0% { height: 40%; }
    50% { height: 100%; }
    100% { height: 40%; }
}


/* --- GÓRNY WSKAŹNIK MIKROFONU --- */
#top-mic-indicator {
    transition: all 0.3s ease;
    color: var(--text-muted); /* Domyślny */
}

/* Stan: Nasłuch (Czerwony Puls) */
#top-mic-indicator.listening {
    color: var(--accent); /* Różowy/Czerwony */
    background: rgba(236, 72, 153, 0.1);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.3);
    animation: breathe 4s infinite;
}

/* Stan: Myślenie (Fioletowe Kręcenie) */
#top-mic-indicator.processing {
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
    animation: spin 1s linear infinite; /* Używamy istniejącej animacji spin */
}

/* Stan: Mówienie (Biały) */
#top-mic-indicator.speaking {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}
 

 
/* --- UKRYWANIE SOKETÓW (BENTO) --- */
/* Ukrywamy tylko karty bento, reszta layoutu zostaje */
/* --- UKRYWANIE TYLKO SOCKET INJECTORA --- */
body.sockets-hidden #debug-injector {
    display: none !important;
}

/* Opcjonalnie: Jeśli chcesz, żeby miejsce po nim płynnie znikało */
#debug-injector {
    transition: opacity 0.3s ease, height 0.3s ease;
    overflow: hidden;  
}

/* --- DUŻY SLIDER PANELI (WIDEO <-> GRID) --- */
.panels-viewport {
    width: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 20px;
    min-height: 400px; /* Wysokość minimalna obszaru */
}

.panels-track {
    display: flex;
    width: 200%; /* Dwa panele, więc 200% szerokości */
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.panel-slide {
    width: 50%; /* Każdy panel zajmuje połowę tracka (czyli 100% widoku) */
    flex-shrink: 0;
    padding: 5px; /* Lekki odstęp */
}

/* --- DUMMY VIDEO --- */
.video-placeholder {
    width: 100%;
    height: 100%;
    min-height: 350px;
    background: #000;
    border: 1px solid var(--border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.video-placeholder::after {
    content: '';
    position: absolute; inset:0;
    background: linear-gradient(45deg, rgba(139, 92, 246, 0.1), transparent);
}
.play-btn-big {
    font-size: 60px; color: white; opacity: 0.8;
    text-shadow: 0 0 30px rgba(255,255,255,0.5);
    z-index: 2; cursor: pointer; transition: 0.2s;
}
.play-btn-big:hover { transform: scale(1.1); color: var(--primary); }

/* Nawigacja slajdów (Strzałki na boki) */
.panel-nav-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1);
    color: white; width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10; font-size: 18px;
    backdrop-filter: blur(5px); transition: 0.2s;
}
.panel-nav-arrow:hover { background: var(--primary); }
.panel-nav-arrow.prev { left: 10px; display: none; } /* Domyślnie ukryta na 1 slajdzie */
.panel-nav-arrow.next { right: 10px; }
 
 
    /* --- COCKPIT DASHBOARD V3 --- */

/* 1. Układ Siatki (Bento Box) */
.cockpit-layout {
    display: grid;
    grid-template-columns: 330px 1fr 330px; /* Lewo, Środek (szeroki), Prawo */
    grid-template-rows: auto auto 1fr;      /* Nagłówek, Dock, Główna treść */
    gap: 22px;
    max-width: 96%;
    margin: 0 auto;
    height: 100%;
    padding-bottom: 80px; /* Miejsce na dock mikrofonu */
}

/* 2. Nagłówek Powitalny (Hero) */
.cockpit-hero {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: -33px;
    border-bottom: 0px solid rgba(255,255,255,0.05);
}

.hero-greeting h1 {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.hero-greeting p {
    margin: 5px 0 0 0;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 3. Pasek Przypiętych (Glass Dock) - Subtelny */
.glass-dock-container {
    grid-column: 1 / -1;
    display: none; /* Domyślnie ukryty, JS pokaże */
}

.glass-dock {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 24px;
    backdrop-filter: blur(10px);
    width: fit-content;
    margin: 0 auto; /* Wyśrodkowany */
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.dock-item {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    border: 1px solid transparent;
}

.dock-item:hover {
    transform: translateY(-5px) scale(1.1);
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
    box-shadow: 0 5px 15px var(--primary-glow);
    z-index: 10;
}

/* Tooltip dla docka */
.dock-item::after {
    content: attr(data-title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}
.dock-item:hover::after { opacity: 1; bottom: -35px; }


/* 4. Widgety Bento */
.bento-card {
    background: rgba(20, 20, 23, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: 0.3s;
    backdrop-filter: blur(20px);
    overflow: hidden;
    position: relative;
}
.bento-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(30, 30, 35, 0.8);
}

.bento-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Kolumny */
.col-left { grid-column: 1; display: flex; flex-direction: column; gap: 24px; }
.col-center { grid-column: 2; display: flex; flex-direction: column; gap: 24px; }
.col-right { grid-column: 3; display: flex; flex-direction: column; gap: 24px; }

/* Specjalne style dla Widgetów */
.weather-status {
    display: flex;
    align-items: center;
    gap: 15px;
}
.temp-big { font-size: 32px; font-weight: 800; color: #fff; }
.status-details { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
 

/* Poprawka dla Sticky Note w nowym układzie */
#widget-sticky-note {
    background: rgba(255, 255, 0, 0.02) !important;
    border-color: rgba(255, 255, 0, 0.15) !important;
}
/* --- SOCKET SYSTEM V3 --- */

/* Puste gniazda nie psują layoutu */
.sys-widget-socket:empty {
    display: none !important;
}

/* Gniazda w kolumnach Bento powinny rozciągać dzieci */
#socket_bento_left, #socket_bento_main, #socket_bento_right {
    display: flex;
    flex-direction: column;
    gap: 24px; /* Odstęp między widgetami w tej samej kolumnie */
    width: 100%;
}

/* Dock Bar (Pasek alertów) */
#socket_dock_bar {
    width: 100%;
    margin-bottom: 20px;
}
#socket_dock_bar .ai-widget-card {
    background: rgba(236, 72, 153, 0.1);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* Top Bar Status (Małe elementy) */
#socket_top_status .ai-widget-card {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

/* --- KONFIGURACJA POŁOŻENIA PASKA --- */

/* Domyślnie (Góra): #main-area to flex-column */
#main-area {
    flex-direction: column; 
}

/* Tryb Dół (Bottom): Odwracamy kolejność flexa */
body.nav-bottom #main-area {
    flex-direction: column-reverse;
}

/* Korekty wizualne dla paska na dole */
body.nav-bottom #os-top-bar {
    border-bottom: none;          /* Usuń linię na dole */
    border-top: 1px solid var(--border); /* Dodaj linię na górze */
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2); /* Cień rzucany w górę */
    z-index: 200; /* Musi być wysoko */
}

/* Ważne: Przesunięcie elementów pływających, żeby pasek ich nie zasłaniał */
body.nav-bottom #mic-dock {
    bottom: 90px !important; /* Podnosimy mikrofon wyżej */
}

body.nav-bottom #music-widget {
    bottom: 90px !important; /* Podnosimy widget muzyczny wyżej */
}

body.nav-bottom #socket_corner {
    bottom: 100px !important; /* Podnosimy utility corner */
}
  

 
    
    .hub-logo {
    background: linear-gradient(135deg, #a78bfa 0%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

    
 

    
   

    /* ---------- BANER ---------- */
    .cyberia-banner{
      position:relative;
             /* max szerokość */
      aspect-ratio:300/133;       /* zachowujemy proporcje */
      cursor:pointer;
    }

    .cyberia-banner svg{
      width:100%;height:100%;
      display:block;
    }

    /* ---------- CONTENT ---------- */
    .cyberia-content{
      position:absolute;
      inset:0;
      padding:14px;
      display:flex;
      flex-direction:column;
      justify-content:space-between;
    }

    .cyberia-left{
      display:flex;
      align-items:flex-start;
      gap:10px;
    }

    .cyberia-atom{
      color:#00ff41;
      font-size:55px;
      filter:drop-shadow(0 0 8px #00ff41);
    }

    .cyberia-title{
      color:#00ff41;
      font-size:20px;
      letter-spacing:2px;
      line-height:1;
      text-shadow:0 0 10px #00ff41;
    font-family:"Courier New",Courier,monospace;  }

    .cyberia-sub{
      color:#7dffb2;
      font-size:10px;
      line-height:1.3;
      opacity:.9;
    font-family:"Courier New",Courier,monospace;  }

    .cyberia-buttons{
      display:flex;
      gap:6px;
      align-items:center;
    }

    .cyberia-buttons button{
      background:transparent;
      border:1px solid #00ff41;
      color:#00ff41;
      font-size:11px;
      padding:5px 10px;
      border-radius:5px;
      cursor:pointer;
      letter-spacing:1px;
      transition:background .2s,box-shadow .2s;
    }

    .cyberia-buttons button:hover{
      background:rgba(0,255,65,.1);
      box-shadow:0 0 10px rgba(0,255,65,.7);
    }

    .btn-newtab{width:28px;padding:5px 0}
   
     
        /* Niezbędne style dla Twoich ikon */
        .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
        .icon-sm { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
        .divider { width: 1px; height: 24px; background: var(--border); margin: 0 12px; }
        /* Upewnij się, że kontener ikon jest elastyczny */
        .user-avatar-img {
  height: -webkit-fill-available;
    border-radius: 50%;
    max-width: 99px;
    border-radius: 22px;width: 63px;
    height: 63px;
}

        #top-icons-container { display: flex; align-items: center; gap: 4px; }
     
 
.spinning { animation: spin 1s linear infinite; }
.wave-bar { width: 4px; background: var(--primary); animation: wave 1s ease-in-out infinite; border-radius: 4px; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
/* --- SWITCH TOGGLE --- */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 34px; border: 1px solid var(--border); }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 2px; bottom: 2px; background-color: #aaa; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); border-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); background-color: #fff; }
@keyframes wave { 0%, 100% { height: 10px; } 50% { height: 30px; } }
 
