/* ============================================================
   GnolexAI OS — Core Stylesheet
   Theme: Premium Dark | Gold Accents
   ============================================================ */

:root {
    --bg-primary:   #121212;
    --bg-secondary: #1A1A1A;
    --bg-tertiary:  #222222;
    --bg-glass:     rgba(255,255,255,0.04);
    --bg-glass-hover: rgba(255,255,255,0.07);
    --border-glass: rgba(255,255,255,0.08);
    --gold:         #FED97A;
    --gold-dark:    #EEA321;
    --gold-glow:    rgba(254,217,122,0.15);
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0A0;
    --text-muted:   #606060;
    --win-bg:       rgba(18,18,18,0.92);
    --win-border:   rgba(254,217,122,0.12);
    --win-header:   rgba(30,30,30,0.95);
    --radius-sm:    6px;
    --radius-md:    10px;
    --radius-lg:    14px;
    --radius-xl:    20px;
    --shadow-win:   0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06);
    --shadow-gold:  0 0 20px rgba(254,217,122,0.2);
    --transition:   all 0.2s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%; height: 100%; overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(254,217,122,0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(254,217,122,0.4); }

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
.splash-screen {
    position: fixed; inset: 0;
    background: radial-gradient(ellipse at 50% 40%, #1A1500 0%, #0A0A0A 60%, #000 100%);
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 2rem; z-index: 9999;
}

.splash-logo {
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
    animation: splashFadeIn 0.8s ease forwards;
}

.splash-logo-icon {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border-radius: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; font-weight: 900; color: #121212;
    box-shadow: 0 0 60px rgba(254,217,122,0.4), 0 0 120px rgba(254,217,122,0.15);
    animation: splashPulse 2s ease-in-out infinite;
}

.splash-title {
    font-size: 2.2rem; font-weight: 800; letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, var(--gold) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}

.splash-subtitle { font-size: 0.9rem; color: var(--text-secondary); letter-spacing: 3px; text-transform: uppercase; }

.splash-loader {
    width: 200px; height: 2px; background: rgba(255,255,255,0.08); border-radius: 10px; overflow: hidden;
}

.splash-loader-bar {
    height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    border-radius: 10px; animation: splashLoad 2s ease-in-out forwards;
}

@keyframes splashFadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes splashPulse  { 0%,100% { box-shadow: 0 0 60px rgba(254,217,122,0.4), 0 0 120px rgba(254,217,122,0.15); } 50% { box-shadow: 0 0 80px rgba(254,217,122,0.6), 0 0 160px rgba(254,217,122,0.25); } }
@keyframes splashLoad   { from { width: 0; } to { width: 100%; } }

/* ============================================================
   AUTH SCREEN (LOGIN / SETUP)
   ============================================================ */
.auth-screen {
    position: fixed; inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(254,217,122,0.04) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 20%, rgba(238,163,33,0.03) 0%, transparent 50%),
                #0D0D0D;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}

.auth-bg-grid {
    position: absolute; inset: 0; overflow: hidden; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.auth-card {
    position: relative; z-index: 1;
    width: 100%; max-width: 420px;
    background: rgba(20,20,20,0.85);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    backdrop-filter: blur(24px);
    box-shadow: 0 40px 100px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04), inset 0 1px 0 rgba(255,255,255,0.06);
    animation: authSlideUp 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

.auth-card-wide { max-width: 580px; }

@keyframes authSlideUp { from { opacity: 0; transform: translateY(30px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.auth-logo {
    display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2rem;
    justify-content: center;
}

.auth-logo-icon {
    width: 44px; height: 44px; background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 900; color: #121212;
    box-shadow: 0 4px 20px rgba(254,217,122,0.3);
}

.auth-logo-text { font-size: 1.4rem; font-weight: 800; }

.auth-title { font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 0.5rem; }
.auth-subtitle { font-size: 0.85rem; color: var(--text-secondary); text-align: center; margin-bottom: 2rem; }

/* Form elements */
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input {
    width: 100%; padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md); color: var(--text-primary);
    font-size: 0.9rem; outline: none; transition: var(--transition);
}
.form-input:focus { border-color: rgba(254,217,122,0.4); background: rgba(254,217,122,0.04); box-shadow: 0 0 0 3px rgba(254,217,122,0.08); }
.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: rgba(239,68,68,0.5); }

.form-input-icon { position: relative; }
.form-input-icon .form-input { padding-left: 2.8rem; }
.form-input-icon .icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.9rem; }

.form-error { font-size: 0.78rem; color: #f87171; margin-top: 0.4rem; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem; border-radius: var(--radius-md); font-size: 0.9rem;
    font-weight: 600; cursor: pointer; border: none; outline: none;
    transition: var(--transition); text-decoration: none; white-space: nowrap;
}
.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #121212; box-shadow: 0 4px 20px rgba(254,217,122,0.25);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(254,217,122,0.35); filter: brightness(1.05); }
.btn-gold:active { transform: translateY(0); }
.btn-ghost { background: rgba(255,255,255,0.06); color: var(--text-primary); border: 1px solid var(--border-glass); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.8rem; }
.btn-xs { padding: 0.3rem 0.65rem; font-size: 0.75rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ============================================================
   DESKTOP ENVIRONMENT
   ============================================================ */
.os-desktop {
    position: fixed; inset: 0;
    background:
        radial-gradient(ellipse at 15% 85%, rgba(254,217,122,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 15%, rgba(238,163,33,0.04) 0%, transparent 45%),
        linear-gradient(180deg, #111111 0%, #0D0D0D 100%);
    overflow: hidden;
    user-select: none;
}

.os-desktop::before {
    content: '';
    position: absolute; inset: 0; pointer-events: none; z-index: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.012) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* Wallpaper layer (custom desktop background) */
.os-wallpaper {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    transition: opacity 0.4s ease;
}
.os-wallpaper.has-bg::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.42) 100%);
}

/* Desktop background preview (Settings) */
.bg-preview {
    display: flex; gap: 1rem; align-items: stretch;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-md); padding: 0.85rem;
    transition: var(--transition);
}
.bg-preview.is-loading { opacity: 0.6; }
.bg-preview-thumb {
    width: 160px; height: 96px; flex-shrink: 0; border-radius: var(--radius-sm);
    background-size: cover; background-position: center;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2), 0 6px 18px rgba(0,0,0,0.3);
}
.bg-preview-default {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
    background: radial-gradient(ellipse at 15% 85%, rgba(254,217,122,0.12) 0%, transparent 55%),
                linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    color: var(--text-muted); font-size: 0.72rem;
}
.bg-preview-default i { font-size: 1.4rem; opacity: 0.5; }
.bg-preview-meta { display: flex; flex-direction: column; justify-content: center; }
.bg-preview-status { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }

/* Top Bar */
.os-topbar {
    position: fixed; top: 0; left: 0; right: 0; height: 40px;
    background: rgba(10,10,10,0.9); border-bottom: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
    display: flex; align-items: center; padding: 0 1rem; gap: 1rem;
    z-index: 1000;
}

.os-topbar-brand {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem; font-weight: 700; color: var(--gold);
}

.os-topbar-brand-icon {
    width: 22px; height: 22px; background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: 5px; display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 900; color: #121212;
}

.os-topbar-sep { width: 1px; height: 16px; background: rgba(255,255,255,0.1); }

.os-topbar-nav {
    display: flex; align-items: center; gap: 0.25rem; flex: 1;
}

.os-topbar-btn {
    padding: 0.2rem 0.7rem; border-radius: 5px; font-size: 0.78rem;
    color: var(--text-secondary); cursor: pointer; transition: var(--transition);
    background: transparent; border: none;
}
.os-topbar-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }

.os-topbar-right { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.os-topbar-clock { font-size: 0.78rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.os-topbar-user {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0.6rem;
    border-radius: 6px; cursor: pointer; transition: var(--transition);
}
.os-topbar-user:hover { background: rgba(255,255,255,0.06); }
.os-topbar-avatar {
    width: 24px; height: 24px; border-radius: 50%; overflow: hidden;
    border: 1.5px solid rgba(254,217,122,0.3);
}
.os-topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.os-topbar-username { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); }

/* Desktop Area */
.os-desktop-area {
    position: absolute; top: 40px; left: 0; right: 0; bottom: 48px;
    padding: 1.5rem;
    overflow: hidden;
}

/* Desktop Icons — absolute, draggable layer */
.os-icons-layer {
    position: absolute; inset: 0;
}

.os-icon {
    position: absolute;
    display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
    padding: 0.5rem 0.3rem; border-radius: var(--radius-md);
    cursor: pointer; width: 84px;
    transition: background 0.15s, box-shadow 0.15s, transform 0.08s;
    touch-action: none;
}

.os-icon:hover { background: rgba(255,255,255,0.07); }
.os-icon:active { transform: scale(0.95); }
.os-icon.selected { background: rgba(254,217,122,0.12); outline: 1px solid rgba(254,217,122,0.35); }
.os-icon.dragging { opacity: 0.85; z-index: 200; cursor: grabbing; transition: none; box-shadow: 0 16px 40px rgba(0,0,0,0.5); }

.os-icon-img {
    width: 50px; height: 50px; border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.45rem; transition: var(--transition);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 6px 18px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.12);
    position: relative; overflow: hidden;
}
.os-icon-img::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(160deg, rgba(255,255,255,0.18) 0%, transparent 45%);
    pointer-events: none;
}

.os-icon:hover .os-icon-img { transform: scale(1.1) translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.18); }

.os-icon-label {
    font-size: 0.7rem; font-weight: 500; color: var(--text-primary);
    text-align: center; line-height: 1.2; max-width: 80px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9); padding: 0.05rem 0.3rem;
    border-radius: 4px;
}
.os-icon.selected .os-icon-label { background: rgba(254,217,122,0.2); color: #fff; }

/* Taskbar */
.os-taskbar {
    position: fixed; bottom: 0; left: 0; right: 0; height: 48px;
    background: rgba(10,10,10,0.92); border-top: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
    display: flex; align-items: center; padding: 0 0.75rem; gap: 0.35rem;
    z-index: 1000;
}

.taskbar-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.3rem 0.75rem; border-radius: 7px; cursor: pointer;
    transition: var(--transition); max-width: 180px;
    background: rgba(255,255,255,0.05); border: 1px solid transparent;
}
.taskbar-item:hover { background: rgba(255,255,255,0.09); }
.taskbar-item.active { background: rgba(254,217,122,0.1); border-color: rgba(254,217,122,0.2); }
.taskbar-item.minimized { opacity: 0.55; }
.taskbar-item-icon { font-size: 0.85rem; flex-shrink: 0; }
.taskbar-item-title { font-size: 0.75rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taskbar-item.active .taskbar-item-title { color: var(--gold); }

.taskbar-indicator {
    width: 4px; height: 4px; border-radius: 50%; background: var(--gold);
    position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
}

/* ============================================================
   WINDOW SYSTEM
   ============================================================ */
.os-window {
    position: absolute; top: 0; left: 0;
    min-width: 380px; min-height: 300px;
    background:
        linear-gradient(180deg, rgba(34,34,38,0.72) 0%, rgba(18,18,20,0.78) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    box-shadow:
        0 40px 90px rgba(0,0,0,0.62),
        0 2px 8px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1),
        inset 0 0 0 1px rgba(255,255,255,0.02);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    backdrop-filter: blur(28px) saturate(160%);
    display: flex; flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
    will-change: transform;
}

/* Glass sheen across the top of every window */
.os-window::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 120px;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 100%);
    pointer-events: none; z-index: 0;
}

.os-window.focused {
    border-color: rgba(254,217,122,0.28);
    box-shadow:
        0 50px 110px rgba(0,0,0,0.7),
        0 0 0 1px rgba(254,217,122,0.12),
        0 0 40px rgba(254,217,122,0.08),
        inset 0 1px 0 rgba(255,255,255,0.12);
}
.os-window.minimized { display: none; }
.os-window.maximized { position: fixed !important; top: 40px !important; left: 0 !important; width: 100vw !important; height: calc(100vh - 88px) !important; transform: none !important; border-radius: 0; z-index: 9000 !important; }

/* Open / close animations */
@keyframes winOpen  { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; } }
.os-window.win-opening { animation: winOpen 0.2s cubic-bezier(0.34,1.4,0.64,1); }
.os-window.win-closing { opacity: 0 !important; transform: scale(0.95) !important; transition: opacity 0.15s ease, transform 0.15s ease; }

/* Window body wrapper (holds the Livewire component) */
.win-body { position: relative; z-index: 1; flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* Window Title Bar */
.win-titlebar {
    position: relative; z-index: 2;
    height: 42px; flex-shrink: 0;
    background: linear-gradient(180deg, rgba(40,40,44,0.6) 0%, rgba(26,26,30,0.55) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; padding: 0 0.85rem; gap: 0.55rem;
    cursor: grab;
}
.win-titlebar:active { cursor: grabbing; }

.win-controls { display: flex; gap: 0.5rem; flex-shrink: 0; }
.win-btn {
    width: 13px; height: 13px; border-radius: 50%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0; transition: filter 0.15s, transform 0.1s;
    box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.2);
}
.win-btn::after { font-size: 0; color: rgba(0,0,0,0.55); font-weight: 800; line-height: 1; }
.win-controls:hover .win-btn::after { font-size: 0.62rem; }
.win-btn:active { transform: scale(0.9); }
.win-btn-close    { background: #ff5f56; }
.win-btn-minimize { background: #ffbd2e; }
.win-btn-maximize { background: #27c93f; }
.win-btn-close::after    { content: '\00d7'; }
.win-btn-minimize::after { content: '\2212'; }
.win-btn-maximize::after { content: '\002b'; }
.win-btn-close:hover    { background: #ff3b30; }
.win-btn-minimize:hover { background: #e6a500; }
.win-btn-maximize:hover { background: #1dac35; }

.win-title-icon { font-size: 0.85rem; color: var(--gold); flex-shrink: 0; }
.win-title-text { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Window Toolbar */
.win-toolbar {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    background: rgba(255,255,255,0.02);
}

/* Window Content */
.win-content {
    flex: 1; overflow: auto; padding: 1.25rem;
}

/* Window Resize Handle */
.win-resize {
    position: absolute; bottom: 0; right: 0;
    width: 16px; height: 16px; cursor: se-resize;
    opacity: 0;
}
.os-window:hover .win-resize { opacity: 1; }

/* ============================================================
   DATA TABLE (inside windows)
   ============================================================ */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th {
    padding: 0.6rem 1rem; font-size: 0.72rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
    background: rgba(255,255,255,0.03); border-bottom: 1px solid rgba(255,255,255,0.06);
    text-align: left; white-space: nowrap;
}
.data-table td {
    padding: 0.7rem 1rem; font-size: 0.83rem; color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.04); transition: var(--transition);
}
.data-table tr:hover td { background: rgba(255,255,255,0.03); color: var(--text-primary); }
.data-table tr:last-child td { border-bottom: none; }

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.72rem; font-weight: 600;
}
.badge-active   { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.2); }
.badge-inactive { background: rgba(107,114,128,0.15); color: #9ca3af; border: 1px solid rgba(107,114,128,0.2); }
.badge-warning  { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.badge-danger   { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-gold     { background: rgba(254,217,122,0.12); color: var(--gold); border: 1px solid rgba(254,217,122,0.2); }
.badge-info     { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 1rem; margin-bottom: 1.5rem; }

.stat-card {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md); padding: 1rem 1.2rem;
    transition: var(--transition);
}
.stat-card:hover { background: rgba(255,255,255,0.05); border-color: rgba(254,217,122,0.15); }

.stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.4rem; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-value.gold { color: var(--gold); }
.stat-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }

/* ============================================================
   SEARCH BAR (inside windows)
   ============================================================ */
.win-search {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md); padding: 0.4rem 0.75rem;
    min-width: 220px;
}
.win-search input {
    background: none; border: none; outline: none; color: var(--text-primary);
    font-size: 0.83rem; width: 100%;
}
.win-search input::placeholder { color: var(--text-muted); }
.win-search i { color: var(--text-muted); font-size: 0.85rem; }

/* ============================================================
   FORM ELEMENTS (in windows)
   ============================================================ */
.win-form-group { margin-bottom: 1rem; }
.win-form-label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.4px; }
.win-form-input {
    width: 100%; padding: 0.6rem 0.85rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.85rem;
    outline: none; transition: var(--transition);
}
.win-form-input:focus { border-color: rgba(254,217,122,0.4); background: rgba(254,217,122,0.03); }
.win-form-input::placeholder { color: var(--text-muted); }
textarea.win-form-input { resize: vertical; min-height: 80px; }
select.win-form-input { cursor: pointer; }

/* ============================================================
   NOTIFICATION TOAST
   ============================================================ */
.toast-container { position: fixed; top: 50px; right: 1rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }

.toast {
    padding: 0.75rem 1.1rem; border-radius: var(--radius-md);
    font-size: 0.83rem; font-weight: 500; min-width: 260px; max-width: 350px;
    display: flex; align-items: center; gap: 0.6rem;
    backdrop-filter: blur(20px); border: 1px solid transparent;
    animation: toastSlide 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast-success { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.25); color: #34d399; }
.toast-error   { background: rgba(239,68,68,0.15);  border-color: rgba(239,68,68,0.25);  color: #f87171; }
.toast-info    { background: rgba(59,130,246,0.15);  border-color: rgba(59,130,246,0.25);  color: #60a5fa; }
.toast-warning { background: rgba(245,158,11,0.15);  border-color: rgba(245,158,11,0.25);  color: #fbbf24; }

@keyframes toastSlide { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ============================================================
   CONTEXT MENU
   ============================================================ */
.context-menu {
    position: fixed; z-index: 9998;
    background: rgba(28,28,28,0.95); border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md); padding: 0.4rem;
    min-width: 180px; box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    backdrop-filter: blur(20px);
    animation: ctxFade 0.15s ease forwards;
}
.context-menu-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.75rem; border-radius: 6px; font-size: 0.82rem;
    color: var(--text-secondary); cursor: pointer; transition: var(--transition);
}
.context-menu-item:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); }
.context-menu-item.danger:hover { background: rgba(239,68,68,0.1); color: #f87171; }
.context-menu-sep { height: 1px; background: rgba(255,255,255,0.07); margin: 0.3rem 0; }
@keyframes ctxFade { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.1); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: #f87171; }
.text-success { color: #34d399; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.72rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.p-4 { padding: 1rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* Section title inside windows */
.win-section-title {
    font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px;
    padding-bottom: 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 1rem;
}

/* Divider */
.divider { height: 1px; background: rgba(255,255,255,0.06); margin: 1rem 0; }

/* Gold accent line */
.gold-line { height: 2px; background: linear-gradient(90deg, var(--gold), transparent); border-radius: 10px; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.3; display: block; }
.empty-state p { font-size: 0.85rem; }

/* Avatar */
.avatar { border-radius: 50%; object-fit: cover; background: var(--bg-tertiary); }
.avatar-sm  { width: 28px; height: 28px; }
.avatar-md  { width: 36px; height: 36px; }
.avatar-lg  { width: 48px; height: 48px; }

/* Setup Steps */
.setup-steps { display: flex; gap: 0.5rem; margin-bottom: 2rem; justify-content: center; }
.setup-step { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.1); transition: var(--transition); }
.setup-step.active { background: var(--gold); width: 24px; border-radius: 4px; }
.setup-step.done { background: rgba(254,217,122,0.4); }

/* Checkbox & Toggle */
.form-check { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.form-check input[type=checkbox] { accent-color: var(--gold); width: 15px; height: 15px; cursor: pointer; }
.form-check-label { font-size: 0.83rem; color: var(--text-secondary); }

/* Color swatch */
.color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Loading indicators (bare wire:loading elements) shouldn't capture clicks.
   NOTE: do NOT include [wire:loading.class] here — those are normal interactive
   elements that merely toggle a class during requests. */
[wire\:loading] { pointer-events: none; }

/* ============================================================
   CONTEXT MENU EXTRAS
   ============================================================ */
.context-menu-header {
    padding: 0.4rem 0.75rem 0.5rem; font-size: 0.68rem; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px;
    border-bottom: 1px solid rgba(255,255,255,0.06); margin-bottom: 0.3rem;
}
.context-menu-item i { width: 16px; text-align: center; font-size: 0.8rem; opacity: 0.85; }
.context-menu-item .ctx-shortcut { margin-left: auto; font-size: 0.7rem; color: var(--text-muted); }

/* ============================================================
   OS MODALS (rename / icon picker)
   ============================================================ */
.os-modal-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.os-modal {
    width: 100%; max-width: 440px;
    background: linear-gradient(180deg, rgba(34,34,38,0.96) 0%, rgba(20,20,22,0.98) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 40px 100px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1);
    padding: 1.5rem;
    animation: authSlideUp 0.25s cubic-bezier(0.34,1.4,0.64,1) forwards;
}
.os-modal-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.5rem; }
.os-modal-title i { color: var(--gold); }
.os-modal-sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.2rem; }
.os-modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.3rem; }

/* Icon picker grid */
.icon-picker {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.5rem;
    max-height: 280px; overflow-y: auto; padding: 0.25rem;
}
.icon-pick {
    aspect-ratio: 1; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
    cursor: pointer; transition: var(--transition);
}
.icon-pick:hover { background: rgba(254,217,122,0.12); color: var(--gold); border-color: rgba(254,217,122,0.3); transform: translateY(-2px); }

/* ============================================================
   ICON PHOTOS + AI TOOL LOGOS
   ============================================================ */
.os-icon-photo {
    width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block;
}
.os-icon-img { overflow: hidden; }

.win-title-logo {
    width: 18px; height: 18px; border-radius: 4px; object-fit: cover; flex-shrink: 0;
}

/* AI Tools manager — logo widgets */
.tool-card-logo {
    width: 36px; height: 36px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
    background: rgba(254,217,122,0.1);
    display: flex; align-items: center; justify-content: center;
}
.tool-card-logo img { width: 100%; height: 100%; object-fit: cover; }

.tool-logo-uploader { display: flex; gap: 1rem; align-items: center; }
.tool-logo-uploader.is-loading { opacity: 0.6; }
.tool-logo-thumb {
    width: 72px; height: 72px; border-radius: 14px; flex-shrink: 0; overflow: hidden;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 1.6rem;
}
.tool-logo-thumb img { width: 100%; height: 100%; object-fit: cover; }

.tool-open-link {
    background: none; border: none; cursor: pointer; padding: 0;
    font-size: 0.72rem; color: var(--gold); display: inline-flex; align-items: center; gap: 0.35rem;
}
.tool-open-link:hover { text-decoration: underline; }

.tool-embed-status { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.5rem; }
.embed-pill {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.66rem; font-weight: 600; padding: 0.18rem 0.5rem; border-radius: 999px;
    border: 1px solid transparent;
}
.embed-ok      { color: #10b981; background: rgba(16,185,129,0.1);  border-color: rgba(16,185,129,0.25); }
.embed-blocked { color: #f59e0b; background: rgba(245,158,11,0.1);  border-color: rgba(245,158,11,0.25); }
.embed-unknown { color: var(--text-muted); background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.1); }
.embed-recheck {
    width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04);
    color: var(--text-secondary); font-size: 0.7rem; transition: var(--transition);
}
.embed-recheck:hover { color: var(--gold); border-color: rgba(254,217,122,0.3); }
.embed-recheck:disabled { opacity: 0.5; cursor: default; }

/* ============================================================
   INTERNAL BROWSER WINDOWS
   ============================================================ */
.os-browser-window .win-body { padding: 0; }

.browser-bar {
    position: relative; z-index: 2; flex-shrink: 0;
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    background: rgba(20,20,24,0.6);
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.browser-btn {
    width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04);
    color: var(--text-secondary); cursor: pointer; font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.browser-btn:hover { background: rgba(254,217,122,0.12); color: var(--gold); border-color: rgba(254,217,122,0.25); }
.browser-url {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 0.45rem;
    height: 30px; padding: 0 0.85rem; border-radius: 8px;
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.74rem; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.browser-url i { color: #10b981; font-size: 0.66rem; flex-shrink: 0; }
.browser-url span { overflow: hidden; text-overflow: ellipsis; }

/* ── Editable address bar (3-tier browser) ── */
.browser-url-form {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 0.45rem;
    height: 30px; padding: 0 0.85rem; border-radius: 8px;
    background: rgba(0,0,0,0.28); border: 1px solid rgba(255,255,255,0.08);
    transition: var(--transition);
}
.browser-url-form:focus-within {
    border-color: rgba(254,217,122,0.4);
    background: rgba(0,0,0,0.38);
    box-shadow: 0 0 0 3px rgba(254,217,122,0.07);
}
.browser-url-icon { color: #10b981; font-size: 0.66rem; flex-shrink: 0; }
.browser-url-input {
    flex: 1; min-width: 0;
    background: transparent; border: 0; outline: none;
    color: var(--text-secondary); font-size: 0.74rem;
    font-family: inherit; text-overflow: ellipsis;
}
.browser-url-input:focus { color: var(--text-primary); }
.browser-url-input::placeholder { color: rgba(255,255,255,0.22); }

.browser-body { position: relative; z-index: 1; flex: 1; background: transparent; }
.browser-frame-wrap { position: relative; flex: 1; min-height: 0; }
.browser-frame {
    position: absolute; inset: 0;
    width: 100%; height: 100%; border: 0; display: block; background: #fff;
    z-index: 1;
}

/* Launch screen for sites that forbid embedding (policy honored) */
.browser-launch {
    position: absolute; inset: 0; z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.85rem; padding: 2.5rem; text-align: center;
    background: radial-gradient(circle at 50% 30%, #1d1d22 0%, #0d0d0f 70%);
    color: var(--text-secondary);
}
/* Never let a hidden launch overlay swallow clicks */
.browser-launch[style*="display: none"],
.browser-launch[style*="display:none"] { pointer-events: none !important; }
.browser-launch-logo {
    width: 88px; height: 88px; border-radius: 22px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: rgba(254,217,122,0.1); border: 1px solid rgba(254,217,122,0.25);
    color: var(--gold); font-size: 2.2rem; margin-bottom: 0.4rem;
}
.browser-launch-logo img { width: 100%; height: 100%; object-fit: cover; }
.browser-launch h3 { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }
.browser-launch-note {
    display: flex; align-items: flex-start; gap: 0.55rem;
    max-width: 440px; font-size: 0.84rem; line-height: 1.55; color: var(--text-muted);
}
.browser-launch-note i { color: #10b981; margin-top: 0.15rem; flex-shrink: 0; }
.browser-launch-actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; flex-wrap: wrap; justify-content: center; }
.browser-launch-actions .btn { text-decoration: none; }
.browser-launch-url { font-size: 0.72rem; color: var(--gold); word-break: break-all; opacity: 0.8; }

/* ============================================================
   CHANGE-ICON UPLOAD ZONE
   ============================================================ */
.icon-upload-zone {
    display: flex; align-items: center; gap: 1.1rem;
    padding: 1rem; border-radius: var(--radius-md);
    background: rgba(255,255,255,0.03); border: 1px dashed rgba(255,255,255,0.14);
}
.icon-upload-zone.is-loading { opacity: 0.6; }
.icon-upload-preview {
    width: 84px; height: 84px; border-radius: 16px; flex-shrink: 0; overflow: hidden;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 1.8rem;
}
.icon-upload-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   NATIVE AI CHAT
   ============================================================ */
.ai-chat { display: flex; flex-direction: column; flex: 1; height: 100%; min-height: 0; }

.ai-chat-head {
    flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem; padding: 0.6rem 0.85rem; flex-wrap: wrap;
    background: rgba(20,20,24,0.5); border-bottom: 1px solid rgba(255,255,255,0.07);
}
.ai-chat-pickers { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ai-chat-field {
    display: flex; align-items: center; gap: 0.45rem;
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px; padding: 0 0.6rem; height: 32px; color: var(--text-muted);
}
.ai-chat-field i { font-size: 0.72rem; }
.ai-chat-select {
    background: transparent; border: 0; color: var(--text-primary);
    font-size: 0.78rem; outline: none; cursor: pointer; max-width: 200px;
}
.ai-chat-select option { background: #16161a; color: var(--text-primary); }
.ai-chat-actions { display: flex; gap: 0.4rem; }

.ai-chat-thread {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem;
}

.chat-msg { display: flex; gap: 0.7rem; max-width: 85%; }
.chat-user { align-self: flex-end; flex-direction: row-reverse; }
.chat-avatar {
    width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(254,217,122,0.12); color: var(--gold);
    border: 1px solid rgba(254,217,122,0.25); font-size: 0.85rem;
}
.chat-user .chat-avatar { background: rgba(255,255,255,0.08); color: var(--text-secondary); border-color: rgba(255,255,255,0.12); }
.chat-bubble {
    padding: 0.7rem 0.95rem; border-radius: 14px; font-size: 0.85rem; line-height: 1.55;
    color: var(--text-primary); white-space: pre-wrap; word-break: break-word;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
}
.chat-user .chat-bubble {
    background: linear-gradient(135deg, rgba(254,217,122,0.16), rgba(254,217,122,0.08));
    border-color: rgba(254,217,122,0.28);
}

.chat-typing { display: flex; gap: 4px; align-items: center; padding: 0.85rem 1rem; }
.chat-typing span {
    width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted);
    animation: chatTyping 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.18s; }
.chat-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes chatTyping { 0%,60%,100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.ai-chat-empty {
    margin: auto; text-align: center; max-width: 380px;
    display: flex; flex-direction: column; align-items: center; gap: 0.6rem; color: var(--text-muted);
}
.ai-chat-empty-logo {
    width: 72px; height: 72px; border-radius: 20px; margin-bottom: 0.3rem;
    display: flex; align-items: center; justify-content: center; font-size: 1.9rem;
    background: rgba(254,217,122,0.1); color: var(--gold); border: 1px solid rgba(254,217,122,0.3);
}
.ai-chat-empty h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.ai-chat-empty p { font-size: 0.82rem; line-height: 1.5; }

.ai-chat-error {
    flex-shrink: 0; margin: 0 0.85rem; padding: 0.6rem 0.85rem; border-radius: 8px;
    font-size: 0.78rem; color: #fca5a5; background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3); display: flex; gap: 0.5rem; align-items: flex-start;
}
.ai-chat-error i { margin-top: 0.1rem; }

.ai-chat-nokey {
    flex-shrink: 0; margin: 0.5rem 0.85rem 0; padding: 0.7rem 0.85rem; border-radius: 8px;
    font-size: 0.8rem; color: var(--text-secondary); background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.25);
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.ai-chat-nokey > i { color: #f59e0b; }
.ai-chat-nokey span { flex: 1; min-width: 140px; }

.ai-chat-composer {
    flex-shrink: 0; display: flex; gap: 0.6rem; align-items: flex-end;
    padding: 0.85rem; border-top: 1px solid rgba(255,255,255,0.07); background: rgba(20,20,24,0.5);
}
.ai-chat-input {
    flex: 1; resize: none; max-height: 160px;
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 0.7rem 0.9rem; color: var(--text-primary);
    font-size: 0.85rem; line-height: 1.5; outline: none; font-family: inherit;
}
.ai-chat-input:focus { border-color: rgba(254,217,122,0.4); }
.ai-chat-input:disabled { opacity: 0.6; }
.ai-chat-send {
    width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; cursor: pointer;
    border: 0; font-size: 0.95rem; color: #1a1a1a;
    background: linear-gradient(135deg, var(--gold), #f3c969);
    display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.ai-chat-send:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(254,217,122,0.3); }
.ai-chat-send:disabled { opacity: 0.5; cursor: default; }

/* ============================================================
   TOOL VIEWER CHAT BUBBLES (single #win-ai-tool window)
   ============================================================ */
.chat-msg-user,
.chat-msg-ai {
    padding: 0.65rem 0.95rem;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.55;
    max-width: 82%;
    word-break: break-word;
    white-space: pre-wrap;
}
.chat-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(254,217,122,0.18), rgba(254,217,122,0.08));
    border: 1px solid rgba(254,217,122,0.3);
    color: var(--text-primary);
}
.chat-msg-ai {
    align-self: flex-start;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    color: var(--text-primary);
}

/* ============================================================
   API KEYS (Settings)
   ============================================================ */
.api-key-list { display: flex; flex-direction: column; gap: 0.85rem; }
.api-key-row {
    padding: 0.85rem; border-radius: var(--radius-md);
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
}
.api-key-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.65rem; }
.api-key-logo {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1rem; border: 1px solid transparent;
}
.api-key-meta { display: flex; align-items: center; gap: 0.5rem; flex: 1; flex-wrap: wrap; }
.api-key-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.api-key-docs { font-size: 0.72rem; color: var(--gold); text-decoration: none; white-space: nowrap; }
.api-key-docs:hover { text-decoration: underline; }
.api-key-controls { display: flex; gap: 0.5rem; align-items: center; }
.api-key-controls .win-form-input { flex: 1; }

/* ── Tool pane setup / not-configured card ── */
.tool-pane-setup {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.8rem; padding: 2.5rem; text-align: center; color: var(--text-muted);
}
.tool-pane-setup-icon {
    width: 72px; height: 72px; border-radius: 20px; margin-bottom: 0.3rem;
    display: flex; align-items: center; justify-content: center; font-size: 1.9rem;
    background: rgba(254,217,122,0.08); color: var(--gold);
    border: 1px solid rgba(254,217,122,0.2);
}
.tool-pane-setup h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.tool-pane-setup p  { font-size: 0.82rem; line-height: 1.55; max-width: 340px; color: var(--text-secondary); }

/* ── Tool window mode toggle tabs ── */
.tool-mode-tabs {
    display: flex; gap: 2px; margin-left: auto;
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px; padding: 2px;
}
.tool-mode-tab {
    display: flex; align-items: center; gap: 0.3rem;
    background: transparent; border: 0; cursor: pointer;
    color: var(--text-muted); font-size: 0.72rem; font-weight: 500;
    padding: 0.28rem 0.7rem; border-radius: 7px;
    transition: var(--transition); white-space: nowrap;
}
.tool-mode-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.tool-mode-tab.active {
    background: linear-gradient(135deg, rgba(254,217,122,0.18), rgba(254,217,122,0.08));
    color: var(--gold); border: 1px solid rgba(254,217,122,0.3);
}

/* ============================================================
   CUSTOMER OS — Win11-style taskbar
   ============================================================ */
.os-taskbar-centered { justify-content: center; position: fixed; }
.taskbar-center { display: flex; align-items: center; gap: 0.3rem; }

/* ============================================================
   CUSTOMER SEARCH (Google-like)
   ============================================================ */
.cs-hero {
    display: flex; flex-direction: column; align-items: center;
    padding: 3rem 2rem 1.25rem; gap: 1.1rem;
    transition: padding 0.25s ease;
}
.cs-hero-compact { padding: 0.9rem 1.5rem 0.4rem; }
.cs-hero-brand { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.cs-hero-logo { height: 52px; width: auto; object-fit: contain; }
.cs-hero-icon-wrap {
    width: 68px; height: 68px; border-radius: 20px;
    background: color-mix(in srgb, var(--c) 12%, transparent);
    border: 1.5px solid color-mix(in srgb, var(--c) 30%, transparent);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.9rem; color: var(--c);
    box-shadow: 0 0 40px color-mix(in srgb, var(--c) 20%, transparent);
}
.cs-hero-title { font-size: 1.55rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
.cs-hero-sub { font-size: 0.82rem; color: var(--text-muted); max-width: 480px; line-height: 1.55; }

/* ── Search box wrapper ── */
.cs-searchbox-wrap { position: relative; }

.cs-searchbox {
    display: flex; align-items: center; gap: 0.5rem;
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px; padding: 0.7rem 1.2rem;
    transition: var(--transition);
}
.cs-searchbox:focus-within {
    border-color: rgba(254,217,122,0.5);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 0 0 4px rgba(254,217,122,0.08), 0 12px 40px rgba(0,0,0,0.35);
}
.cs-searchbox-icon { color: var(--text-muted); font-size: 0.9rem; }
.cs-searchbox-input {
    flex: 1; background: transparent; border: 0; outline: none;
    color: var(--text-primary); font-size: 0.95rem;
}
.cs-searchbox-input::placeholder { color: rgba(255,255,255,0.25); }
.cs-searchbox-clear {
    background: transparent; border: 0; cursor: pointer;
    color: var(--text-muted); padding: 0.2rem 0.4rem; border-radius: 50%;
    flex-shrink: 0;
}
.cs-searchbox-clear:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }
.cs-searchbox-spinner .spinner { width: 14px; height: 14px; }

/* Icon buttons inside search box */
.cs-searchbox-history-btn,
.cs-searchbox-adv-btn {
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); padding: 0.25rem 0.4rem; border-radius: 6px;
    font-size: 0.78rem; transition: var(--transition); flex-shrink: 0;
}
.cs-searchbox-history-btn:hover,
.cs-searchbox-adv-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }
.cs-searchbox-adv-btn.active { color: var(--gold); background: rgba(254,217,122,0.1); }

/* ── Shared dropdown base ── */
.cs-autocomplete,
.cs-history-panel {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 9999;
    background: rgba(18,18,18,0.98); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,0.55);
    backdrop-filter: blur(12px); overflow: hidden;
}
/* Transitions */
.cs-dd-enter { transition: opacity 0.14s ease, transform 0.14s ease; }
.cs-dd-enter-start { opacity: 0; transform: translateY(-6px); }
.cs-dd-enter-end   { opacity: 1; transform: translateY(0); }

/* Autocomplete items */
.cs-autocomplete-item {
    display: flex; align-items: center; gap: 0.65rem; width: 100%;
    padding: 0.62rem 1rem; background: transparent; border: none; cursor: pointer;
    color: var(--text-secondary); font-size: 0.82rem; text-align: left;
    transition: background 0.1s ease, color 0.1s ease;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cs-autocomplete-item:last-child { border-bottom: none; }
.cs-autocomplete-item:hover { background: rgba(254,217,122,0.07); color: var(--text-primary); }

/* History panel */
.cs-history-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.6rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.72rem; color: var(--text-muted); font-weight: 600;
}
.cs-history-clear {
    background: transparent; border: none; cursor: pointer;
    color: #f87171; font-size: 0.68rem; display: flex; align-items: center; gap: 0.3rem;
    padding: 0.2rem 0.4rem; border-radius: 5px; transition: var(--transition);
}
.cs-history-clear:hover { background: rgba(248,113,113,0.12); }
.cs-history-item {
    display: flex; align-items: center; gap: 0.65rem; width: 100%;
    padding: 0.58rem 1rem; background: transparent; border: none; cursor: pointer;
    color: var(--text-secondary); font-size: 0.8rem; text-align: left;
    transition: background 0.1s ease; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cs-history-item:last-child { border-bottom: none; }
.cs-history-item:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.cs-history-restore {
    margin-left: auto; opacity: 0; font-size: 0.65rem; color: var(--gold);
    transition: opacity 0.15s ease;
}
.cs-history-item:hover .cs-history-restore { opacity: 0.8; }

/* ── Advanced filter panel ── */
.cs-advanced-panel {
    width: 100%; max-width: 660px;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(254,217,122,0.18);
    border-radius: 12px; padding: 0.7rem 1rem;
}
.cs-advanced-inner { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.cs-advanced-label { font-size: 0.73rem; color: var(--gold); font-weight: 600; white-space: nowrap; }
.cs-advanced-select { font-size: 0.78rem; padding: 0.4rem 0.7rem; width: auto; min-width: 160px; }
.cs-advanced-reset {
    background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.25);
    color: #f87171; border-radius: 7px; cursor: pointer;
    font-size: 0.73rem; padding: 0.38rem 0.7rem; transition: var(--transition);
    display: flex; align-items: center; gap: 0.3rem;
}
.cs-advanced-reset:hover { background: rgba(248,113,113,0.2); }

/* ── Trending / interests area ── */
.cs-trending { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; max-width: 700px; width: 100%; }
.cs-trending-label { font-size: 0.72rem; color: var(--gold); font-weight: 700; display: flex; align-items: center; gap: 0.3rem; }

.cs-interests { display: flex; flex-direction: column; gap: 0.55rem; max-width: 700px; width: 100%; }
.cs-interests-head { display: flex; align-items: center; justify-content: space-between; }
.cs-interests-label {
    font-size: 0.73rem; font-weight: 700; color: var(--gold);
    display: flex; align-items: center; gap: 0.35rem;
}
.cs-interests-hint { font-size: 0.65rem; color: var(--text-muted); font-style: italic; }
.cs-interests-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: flex-start; }

.cs-chip {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px; padding: 0.35rem 0.85rem; cursor: pointer;
    color: var(--text-secondary); font-size: 0.74rem; transition: var(--transition);
}
.cs-chip:hover { border-color: rgba(254,217,122,0.4); color: var(--gold); background: rgba(254,217,122,0.06); }
.cs-chip-interest {
    border-color: rgba(254,217,122,0.18); background: rgba(254,217,122,0.05);
    color: var(--text-secondary);
}
.cs-chip-interest:hover { background: rgba(254,217,122,0.12); color: var(--gold); }

/* ── Results toolbar + filter badge ── */
.cs-results-toolbar {
    display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
    margin-bottom: 0.85rem;
}
.cs-results-meta { font-size: 0.74rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; }
.cs-filter-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: rgba(254,217,122,0.1); border: 1px solid rgba(254,217,122,0.3);
    color: var(--gold); border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.71rem;
}
.cs-filter-badge button {
    background: transparent; border: none; cursor: pointer;
    color: var(--gold); opacity: 0.6; font-size: 0.65rem; padding: 0;
    transition: opacity 0.15s ease;
}
.cs-filter-badge button:hover { opacity: 1; }

/* ── Result cards (redesigned) ── */
.cs-results { display: flex; flex-direction: column; gap: 0.55rem; }
.cs-result {
    display: flex; align-items: center; gap: 0.75rem;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px; padding: 0.85rem 1rem; cursor: pointer; transition: var(--transition);
}
.cs-result:hover {
    border-color: rgba(254,217,122,0.35); background: rgba(254,217,122,0.04);
    transform: translateY(-1px); box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}
.cs-result-rank {
    font-size: 0.68rem; font-weight: 800; color: var(--text-muted);
    width: 20px; text-align: center; flex-shrink: 0; opacity: 0.5;
}
.cs-result:hover .cs-result-rank { color: var(--gold); opacity: 1; }
.cs-result-body { flex: 1; min-width: 0; }
.cs-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.cs-result-badges { display: flex; align-items: center; gap: 0.3rem; flex-shrink: 0; }
.cs-result-title { font-size: 0.93rem; font-weight: 700; color: var(--text-primary); }
.cs-result-snippet { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.3rem; line-height: 1.55; }
.cs-result-meta {
    display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
    margin-top: 0.45rem; font-size: 0.7rem; color: var(--text-muted);
}
.cs-result-meta i { margin-right: 0.22rem; }
.cs-result-tag {
    background: rgba(167,139,250,0.08); border: 1px solid rgba(167,139,250,0.2);
    color: #a78bfa; border-radius: 999px; padding: 0.1rem 0.5rem;
    font-size: 0.64rem; font-weight: 600;
}
.cs-result-arrow {
    color: var(--text-muted); font-size: 0.65rem; flex-shrink: 0;
    opacity: 0; transition: opacity 0.15s ease, transform 0.15s ease;
}
.cs-result:hover .cs-result-arrow { opacity: 0.6; transform: translateX(3px); }

.cs-empty {
    text-align: center; padding: 3rem 1rem; color: var(--text-muted);
}
.cs-empty i { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.4; }
.cs-empty h3 { color: var(--text-secondary); font-size: 1rem; margin-bottom: 0.3rem; }
.cs-empty p { font-size: 0.78rem; }

/* Prompt detail overlay (inside the window) */
.cs-detail-overlay {
    position: absolute; inset: 0; z-index: 50;
    background: rgba(10,10,10,0.75); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.cs-detail {
    width: 100%; max-width: 720px; max-height: 100%;
    background: rgba(22,22,22,0.98); border: 1px solid rgba(254,217,122,0.2);
    border-radius: 14px; display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 30px 90px rgba(0,0,0,0.6);
}
.cs-detail-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    padding: 1.1rem 1.25rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cs-detail-title { font-size: 1.05rem; font-weight: 800; color: var(--text-primary); }
.cs-detail-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.cs-detail-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 1rem; }
.cs-detail-actions {
    display: flex; gap: 0.5rem; padding: 0.85rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.cs-prompt-block {
    background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; margin-bottom: 0.9rem; overflow: hidden;
}
.cs-prompt-block-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.72rem; color: var(--gold); font-weight: 700;
}
.cs-prompt-text {
    padding: 0.85rem; font-size: 0.8rem; color: var(--text-primary);
    white-space: pre-wrap; word-break: break-word; font-family: 'Consolas', monospace;
    max-height: 260px; overflow-y: auto; margin: 0;
}
.cs-usecases { list-style: none; padding: 0; margin: 0.4rem 0 0; }
.cs-usecases li { font-size: 0.78rem; color: var(--text-secondary); padding: 0.3rem 0; display: flex; gap: 0.5rem; align-items: baseline; }

/* Badges in detail header */
.cs-badge {
    display: inline-flex; align-items: center; gap: 0.28rem;
    border-radius: 999px; padding: 0.18rem 0.6rem;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.3px;
    border: 1px solid transparent;
}
.cs-badge-gold  { background: rgba(254,217,122,0.12); border-color: rgba(254,217,122,0.3); color: var(--gold); }
.cs-badge-blue  { background: rgba(96,165,250,0.1);   border-color: rgba(96,165,250,0.3);  color: #60a5fa; }
.cs-badge-type  { background: rgba(167,139,250,0.1);  border-color: rgba(167,139,250,0.3); color: #a78bfa; }

/* Content sections inside detail overlay */
.cs-section {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px; padding: 0.85rem 1rem; margin-bottom: 0.85rem;
}
.cs-section-tip {
    background: rgba(254,217,122,0.04);
    border-color: rgba(254,217,122,0.14);
}
.cs-section-header {
    display: flex; align-items: center; gap: 0.45rem;
    font-size: 0.68rem; font-weight: 800; color: var(--gold);
    text-transform: uppercase; letter-spacing: 0.9px;
    margin-bottom: 0.6rem;
}
.cs-section-tip .cs-section-header { color: var(--gold); }
.cs-section-body {
    font-size: 0.81rem; color: var(--text-secondary);
    line-height: 1.75; white-space: pre-wrap; word-break: break-word;
}

/* ============================================================
   CUSTOMER NOTEPAD — 3-pane
   ============================================================ */
.np-pane { display: flex; flex-direction: column; min-height: 0; }
.np-pane-clients  { width: 230px; border-right: 1px solid rgba(255,255,255,0.06); }
.np-pane-projects { width: 230px; border-right: 1px solid rgba(255,255,255,0.06); }
.np-pane-editor   { flex: 1; }
.np-pane-head {
    padding: 0.7rem 0.9rem; font-size: 0.74rem; font-weight: 700; color: var(--gold);
    border-bottom: 1px solid rgba(255,255,255,0.06); display: flex; align-items: center; gap: 0.4rem;
}
.np-add { padding: 0.55rem 0.7rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.np-add .win-form-input { font-size: 0.76rem; padding: 0.42rem 0.6rem; }
.np-list { flex: 1; overflow-y: auto; padding: 0.35rem; }
.np-item {
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.55rem 0.65rem; border-radius: 8px; cursor: pointer;
    transition: var(--transition); position: relative;
}
.np-item:hover { background: rgba(255,255,255,0.05); }
.np-item.active { background: rgba(254,217,122,0.1); border: 1px solid rgba(254,217,122,0.25); }
.np-item-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.np-item-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.np-item-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-item-sub { font-size: 0.66rem; color: var(--text-muted); }
.np-item-del {
    opacity: 0; background: transparent; border: 0; cursor: pointer;
    color: #f87171; font-size: 0.7rem; padding: 0.25rem; transition: var(--transition);
}
.np-item:hover .np-item-del { opacity: 0.7; }
.np-item-del:hover { opacity: 1 !important; }
.np-empty { font-size: 0.74rem; color: var(--text-muted); text-align: center; padding: 1rem 0.75rem; line-height: 1.6; }

.np-prompts-bar { display: flex; padding: 0.55rem 0.7rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.np-prompts-bar .win-form-input { font-size: 0.76rem; padding: 0.42rem 0.6rem; }

/* ── Tab bar (editor-style) ── */
.np-tabs-bar {
    flex-shrink: 0; background: rgba(0,0,0,0.22);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    overflow: hidden;
}
.np-tabs-scroll {
    display: flex; overflow-x: auto; align-items: stretch;
    scrollbar-width: none;
}
.np-tabs-scroll::-webkit-scrollbar { display: none; }

.np-tab {
    display: flex; align-items: stretch; flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.06);
    box-shadow: inset 0 2.5px 0 transparent;
    transition: var(--transition); position: relative;
}
.np-tab:hover { background: rgba(255,255,255,0.04); }
.np-tab.active {
    background: rgba(254,217,122,0.07);
    box-shadow: inset 0 2.5px 0 var(--gold);
}

.np-tab-btn {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.62rem 0.7rem 0.62rem 0.85rem;
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 0.76rem; white-space: nowrap;
    transition: var(--transition); max-width: 200px; min-width: 0;
}
.np-tab:hover .np-tab-btn { color: var(--text-secondary); }
.np-tab.active .np-tab-btn { color: var(--gold); font-weight: 600; }

.np-tab-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
    background: transparent; border: 1.5px solid rgba(255,255,255,0.2);
    transition: var(--transition);
}
.np-tab-dot.filled { background: #34d399; border-color: #34d399; }
.np-tab.active .np-tab-dot { border-color: var(--gold); }
.np-tab.active .np-tab-dot.filled { background: var(--gold); border-color: var(--gold); }

.np-tab-link-icon { font-size: 0.52rem; opacity: 0.5; }
.np-tab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.np-tab-close {
    display: flex; align-items: center; justify-content: center;
    width: 0; overflow: hidden; opacity: 0;
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 0.62rem;
    transition: width 0.15s ease, opacity 0.15s ease, color 0.15s ease;
    padding: 0;
}
.np-tab:hover .np-tab-close,
.np-tab.active .np-tab-close {
    width: 26px; opacity: 0.55; padding: 0 0.3rem;
}
.np-tab-close:hover { color: #f87171; opacity: 1 !important; }

.np-tabs-empty {
    font-size: 0.73rem; color: var(--text-muted);
    padding: 0.65rem 0.85rem; white-space: nowrap;
}

.np-editor { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0.75rem; gap: 0.6rem; }
.np-editor-toolbar { display: flex; align-items: center; gap: 0.6rem; }
.np-editor-title {
    flex: 1; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 0.5rem 0.75rem; color: var(--text-primary);
    font-size: 0.9rem; font-weight: 700; outline: none;
}
.np-editor-title:focus { border-color: rgba(254,217,122,0.4); }
.np-editor-actions { display: flex; align-items: center; gap: 0.45rem; }
.np-autosave { font-size: 0.68rem; color: #34d399; display: flex; align-items: center; gap: 0.3rem; }
.np-autosave.saving { color: var(--gold); }
.np-editor-content {
    flex: 1; min-height: 0; resize: none;
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.09);
    border-radius: 10px; padding: 0.85rem; color: var(--text-primary);
    font-size: 0.82rem; line-height: 1.6; outline: none;
    font-family: 'Consolas', monospace;
}
.np-editor-content:focus { border-color: rgba(254,217,122,0.35); }
.np-editor-notes {
    height: 84px; resize: none;
    background: rgba(254,217,122,0.03); border: 1px solid rgba(254,217,122,0.12);
    border-radius: 10px; padding: 0.7rem 0.85rem; color: var(--text-secondary);
    font-size: 0.76rem; line-height: 1.5; outline: none;
}
.np-editor-notes:focus { border-color: rgba(254,217,122,0.35); }
.np-empty-editor {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-muted); text-align: center; gap: 0.8rem; padding: 2rem;
}
.np-empty-editor i { font-size: 2.2rem; opacity: 0.35; }
.np-empty-editor p { font-size: 0.8rem; line-height: 1.7; }

/* ── GnolexPad: quick-add bar ── */
.np-quickadd {
    display: flex; gap: 0.4rem; padding: 0.55rem 0.7rem;
    border-bottom: 1px solid rgba(254,217,122,0.1);
    background: rgba(254,217,122,0.03);
}
.np-quickadd .win-form-input { font-size: 0.76rem; padding: 0.42rem 0.6rem; flex: 1; }
.np-quickadd-btn {
    background: rgba(254,217,122,0.15); border: 1px solid rgba(254,217,122,0.3);
    border-radius: 7px; color: var(--gold); cursor: pointer; padding: 0.38rem 0.6rem;
    font-size: 0.75rem; transition: var(--transition);
}
.np-quickadd-btn:hover { background: rgba(254,217,122,0.25); }

/* ── GnolexPad: personal "My Prompts" row ── */
.np-personal-item {
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.6rem 0.7rem; cursor: pointer; transition: var(--transition);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(254,217,122,0.04);
}
.np-personal-item:hover { background: rgba(254,217,122,0.08); }
.np-personal-item.active { background: rgba(254,217,122,0.12); border-bottom-color: rgba(254,217,122,0.2); }

/* ── GnolexPad: section label ── */
.np-section-label {
    font-size: 0.62rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--text-muted); padding: 0.55rem 0.7rem 0.2rem; opacity: 0.7;
}

/* ── GnolexPad: token / word counter ── */
.np-counter {
    display: flex; align-items: center; gap: 0.3rem;
    font-size: 0.67rem; color: var(--text-muted); white-space: nowrap;
    padding: 0.25rem 0.5rem; background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 6px;
}
.np-counter i { font-size: 0.6rem; opacity: 0.6; }

/* ── GnolexPad: variable fill panel ── */
.np-vars-panel {
    background: rgba(254,217,122,0.04); border: 1px solid rgba(254,217,122,0.18);
    border-radius: 10px; padding: 0.7rem 0.85rem; flex-shrink: 0;
}
.np-vars-label {
    font-size: 0.72rem; color: var(--gold); margin-bottom: 0.55rem;
    display: flex; align-items: center; gap: 0.4rem;
}
.np-vars-grid {
    display: flex; flex-wrap: wrap; gap: 0.55rem;
}
.np-var-item { display: flex; flex-direction: column; gap: 0.2rem; min-width: 140px; flex: 1; }
.np-var-label {
    font-size: 0.67rem; color: var(--gold); font-family: 'Consolas', monospace;
    background: rgba(254,217,122,0.08); border-radius: 4px;
    padding: 0.1rem 0.4rem; display: inline-block; width: fit-content;
}
.np-var-input { font-size: 0.76rem; padding: 0.38rem 0.6rem; }

/* ── Save to GnolexPad modal: quick-save card ── */
.gnp-save-quick {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 0.9rem; border-radius: 10px; cursor: pointer;
    border: 1.5px solid rgba(254,217,122,0.2); background: rgba(254,217,122,0.04);
    margin-bottom: 0.6rem; transition: var(--transition);
}
.gnp-save-quick:hover { background: rgba(254,217,122,0.09); border-color: rgba(254,217,122,0.4); }
.gnp-save-quick.active { background: rgba(254,217,122,0.12); border-color: rgba(254,217,122,0.55); }
.gnp-save-divider {
    text-align: center; font-size: 0.7rem; color: var(--text-muted);
    margin: 0.4rem 0 0.8rem; opacity: 0.6;
}

/* ── Utility button variants used in GnolexPad toolbar ── */
.btn-outline {
    background: transparent; border: 1px solid rgba(255,255,255,0.18); color: var(--text-secondary);
}
.btn-outline:hover { border-color: rgba(255,255,255,0.35); color: var(--text-primary); }
.btn-danger {
    background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.25); color: #f87171;
}
.btn-danger:hover { background: rgba(248,113,113,0.22); }

/* ============================================================
   CUSTOMER AI TOOLS grid
   ============================================================ */
.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.7rem; }
.ct-card {
    display: flex; align-items: center; gap: 0.75rem;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 0.75rem 0.9rem; transition: var(--transition);
}
.ct-card:hover { border-color: rgba(254,217,122,0.3); }
.ct-card-logo {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 1rem; overflow: hidden;
}
.ct-card-logo img { width: 100%; height: 100%; object-fit: cover; }
.ct-card-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ct-card-name { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-card-sub { font-size: 0.68rem; color: var(--text-muted); }
.ct-card-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }

/* ============================================================
   WORKSPACES
   ============================================================ */
.ws-list { display: flex; flex-direction: column; gap: 0.6rem; }
.ws-card {
    display: flex; align-items: center; gap: 0.85rem;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 0.7rem 0.9rem; transition: var(--transition);
}
.ws-card.active { border-color: rgba(254,217,122,0.4); background: rgba(254,217,122,0.04); }
.ws-card-bg {
    width: 76px; height: 46px; border-radius: 8px; flex-shrink: 0;
    background-color: rgba(255,255,255,0.05); background-size: cover; background-position: center;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.ws-card-meta { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.4rem; }
.ws-card-name { font-size: 0.86rem; font-weight: 700; color: var(--text-primary); }
.ws-card-actions { display: flex; gap: 0.3rem; flex-shrink: 0; align-items: center; }
