/* Virtual Office - GBA Pixel Art Style */

/* ─── MAIN MENU PANEL ──────────────────────────── */
.main-menu-panel {
    position: absolute;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 270px;
    background: #1a1a2e;
    border-right: 2px solid #ffd700;
    display: flex;
    flex-direction: column;
    z-index: 150;
    transition: left 0.25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.6);
}
.main-menu-panel.open { left: 0; }
.main-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #0d0d1e;
    border-bottom: 1px solid #2a2a4e;
    color: #ffd700;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    flex-shrink: 0;
}
.main-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.main-menu-body::-webkit-scrollbar { width: 5px; }
.main-menu-body::-webkit-scrollbar-track { background: #1a1a2e; }
.main-menu-body::-webkit-scrollbar-thumb { background: #2a2a4e; border-radius: 3px; }
.mm-section {
    border: 1px solid #2a2a4e;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(0,0,0,0.2);
}
.mm-section-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 7px;
    color: #ffd700;
    margin-bottom: 8px;
}
.mm-label {
    display: block;
    font-size: 11px;
    color: #aaa;
    margin: 6px 0 3px;
}
.mm-input {
    width: 100%;
    padding: 6px 8px;
    background: #0d0d1e;
    border: 1px solid #2a2a4e;
    border-radius: 4px;
    color: #e8e8f0;
    font-size: 12px;
    margin-bottom: 4px;
}
.mm-input:focus { border-color: #ffd700; outline: none; }
.mm-btn {
    width: 100%;
    padding: 6px 10px;
    margin: 4px 0;
    background: #2a2a4e;
    border: 1px solid #3a3a5e;
    border-radius: 4px;
    color: #ccc;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}
.mm-btn:hover { background: #3a3a5e; color: #fff; }
.mm-btn-primary { background: #1b5e20; border-color: #4caf50; color: #66bb6a; }
.mm-btn-primary:hover { background: #2e7d32; color: #a5d6a7; }
.mm-btn-danger { background: #4a1515; border-color: #f44336; color: #ef9a9a; }
.mm-btn-danger:hover { background: #6a1b1b; color: #ffcdd2; }
.mm-warning {
    font-size: 9px;
    color: #f44336;
    margin-top: 2px;
    opacity: 0.7;
}
.mm-help p {
    font-size: 10px;
    color: #999;
    margin: 4px 0;
    line-height: 1.5;
}
.mm-help b { color: #ccc; }
.mm-save-all {
    margin-top: 8px;
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    padding: 10px;
}
.mm-status {
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-top: 4px;
}
.mm-status.ok { background: rgba(76,175,80,0.15); color: #81c784; border: 1px solid #4caf50; }
.mm-status.err { background: rgba(244,67,54,0.15); color: #ef9a9a; border: 1px solid #f44336; }
.mm-status.info { background: rgba(33,150,243,0.15); color: #90caf9; border: 1px solid #2196f3; }
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
    --ui-bg: #0a0a0f;
    --ui-surface: #1a1a2e;
    --ui-border: #2a2a3e;
    --ui-text: #e8e8f0;
    --pq-blue: #1976d2;
    --pq-dark: #0d47a1;
    --eng-orange: #e65100;
    --eng-dark: #bf360c;
    --gold: #ffd700;
    --gba-cream: #f8f8d8;
}

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

html, body {
    background: var(--ui-bg);
    color: var(--ui-text);
    font-family: 'Press Start 2P', cursive;
    height: 100%;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}



/* --- MAIN LAYOUT --- */
.main-container {
    display: flex;
    flex-direction: row;
    border: none;
    border-radius: 0;
    background: #000;
    margin: 0;
    max-width: 100%;
    height: 100vh;
    overflow: hidden;
    box-shadow:
        0 0 60px rgba(255, 215, 0, 0.08),
        0 0 120px rgba(0, 0, 0, 0.8),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
}

/* Left column: canvas + toolbar */
.left-column {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.game-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

#officeCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
    image-rendering: pixelated;
    touch-action: none;
}
#officeCanvas:active { cursor: grabbing; }

/* Toolbar - always visible below canvas */
.toolbar {
    display: flex;
    justify-content: space-around;
    padding: 10px 8px;
    background: #151520;
    border-top: 2px solid var(--ui-border);
    gap: 4px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.toolbar-divider {
    width: 1px;
    background: #3a3a5e;
    align-self: stretch;
    margin: 2px 4px;
}

.toolbar button.active-edit {
    background: #1b5e20 !important;
    border-color: #66bb6a !important;
    color: #66bb6a !important;
    box-shadow: 0 0 8px rgba(102, 187, 106, 0.3);
}

.toolbar button.active-edit:hover {
    background: #2e7d32 !important;
}

/* Bio file editor */
.bio-editor {
    width: 100%;
    min-height: 120px;
    max-height: 400px;
    background: #0d1117;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 4px;
    padding: 8px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.4;
    resize: vertical;
    box-sizing: border-box;
    tab-size: 4;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: hidden;
    overflow-y: auto;
}
@media (max-width: 768px) {
    .bio-editor {
        min-height: 100px;
        max-height: 200px;
        font-size: 10px;
        width: 100% !important;
    }
    .bio-btn-row {
        flex-direction: row;
        justify-content: center;
    }
}
.bio-editor:focus {
    border-color: #ffd600;
    outline: none;
}
.bio-editor[readonly] {
    background: #161b22;
    color: #8b949e;
}
.bio-btn-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    padding: 6px 0;
    position: sticky;
    bottom: 0;
    background: #1a1a2e;
    z-index: 1;
}
.bio-edit-btn {
    padding: 6px 16px;
    background: #263238;
    color: #ffd600;
    border: 1px solid #ffd600;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}
.bio-edit-btn:hover {
    background: #37474f;
}
.bio-save-btn {
    margin-top: 6px;
    padding: 6px 16px;
    background: #1b5e20;
    color: #66bb6a;
    border: 1px solid #66bb6a;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}
.bio-save-btn:hover {
    background: #2e7d32;
}
.bio-save-btn.saved {
    background: #0d47a1;
    color: #90caf9;
    border-color: #90caf9;
}

/* Sidebar edge toggle tab */
.sidebar-edge {
    width: 20px;
    background: var(--ui-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: #888;
    font-size: 10px;
    transition: background 0.2s, color 0.2s;
    user-select: none;
}
.sidebar-edge:hover {
    background: #3a3a5e;
    color: var(--gold);
}

button {
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(180deg, #2a2a3e, #1a1a2e);
    border: 2px solid #3a3a4e;
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 8px;
    color: var(--ui-text);
    box-shadow: 0 3px 0 #0a0a0f;
    transition: all 0.1s;
    touch-action: manipulation;
}
button:hover { background: linear-gradient(180deg, #3a3a5e, #2a2a3e); border-color: var(--gold); }
button:active { transform: translateY(3px); box-shadow: none; }

/* --- SIDEBAR --- */
.sidebar {
    width: 360px;
    background: var(--ui-surface);
    padding: 16px;
    display: block;
    overflow-y: scroll;
    overflow-x: hidden;
    flex-shrink: 0;
    transition: width 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}
.sidebar > * { margin-bottom: 10px; }
.sidebar.collapsed {
    width: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}


.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: var(--ui-bg); }
.sidebar::-webkit-scrollbar-thumb { background: var(--ui-border); border-radius: 3px; }

.brand {
    text-align: center;
    padding: 12px 0;
    border-bottom: 2px solid var(--gold);
    margin-bottom: 4px;
}
.brand h2 { color: var(--gold); font-size: 13px; text-shadow: 0 0 10px rgba(255,215,0,0.4); }
.brand h3 { color: #fff; font-size: 11px; margin-top: 6px; letter-spacing: 4px; }

.branch-manager-panel {
    border: 2px solid var(--ui-border);
    border-radius: 6px;
    padding: 8px;
    background: rgba(0,0,0,0.3);
}
.branch-manager-actions {
    display:flex;
    justify-content:flex-end;
    margin-bottom:8px;
}
.branch-manager-actions button,
.branch-actions button {
    background:#1f1f35;
    color:var(--gold);
    border:1px solid #4a4a70;
    border-radius:4px;
    padding:4px 6px;
    font-size:7px;
    font-family:'Press Start 2P', cursive;
    cursor:pointer;
}
.branch-actions {
    display:flex;
    gap:4px;
    margin-left:auto;
}
.branch-section {
    border: 2px solid var(--ui-border);
    border-radius: 6px;
    padding: 8px;
    background: rgba(0,0,0,0.3);
    margin-bottom:10px;
}
.branch-section.branch-gold { border-color: var(--gold); }
.branch-section.branch-blue { border-color: var(--pq-blue); }
.branch-section.branch-orange { border-color: var(--eng-orange); }
.branch-section.branch-cyan { border-color: #00bcd4; }
.branch-section.branch-red { border-color: #ff6d00; }
.branch-section.branch-gray { border-color: #90a4ae; }
.branch-section.branch-gold h4 { color: var(--gold); }
.branch-section.branch-blue h4 { color: #64b5f6; }
.branch-section.branch-orange h4 { color: #ffab40; }
.branch-section.branch-cyan h4 { color: #4dd0e1; }
.branch-section.branch-red h4 { color: #ff8a65; }
.branch-section.branch-gray h4 { color: #b0bec5; }
.branch-section h4, .activity-feed h4, .branch-manager-panel h4 { font-size: 8px; margin-bottom: 8px; cursor: pointer; user-select: none; }
.branch-header-row { display:flex; align-items:center; gap:6px; }
.branch-unassigned-note { font-size:6px; color:#9e9e9e; margin-top:4px; }
.collapsible h4:hover { opacity: 0.8; }
.section-arrow { font-size: 7px; margin-right: 2px; }

.agent-list {
    max-height: 120px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.agent-list::-webkit-scrollbar { width: 4px; }
.agent-list::-webkit-scrollbar-thumb { background: var(--ui-border); border-radius: 2px; }

.agent-entry {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 6px; border-radius: 3px;
    background: rgba(255,255,255,0.03);
    font-size: 7px;
    cursor: pointer;
    touch-action: manipulation;
}
.agent-entry .dot {
    width: 6px; height: 6px; border-radius: 50%;
    flex-shrink: 0;
}
.agent-entry .dot.working { background: #e53935; box-shadow: 0 0 4px #e53935; }
.agent-entry .dot.idle { background: #4caf50; box-shadow: 0 0 4px #4caf50; }
.agent-entry .dot.meeting { background: #2196f3; box-shadow: 0 0 4px #2196f3; }
.agent-entry .dot.break, .agent-entry .dot.lounge { background: #ff9800; box-shadow: 0 0 4px #ff9800; }
.agent-entry .dot.moving { background: #9c27b0; box-shadow: 0 0 4px #9c27b0; }
.agent-entry .dot.chatting { background: #66bb6a; box-shadow: 0 0 4px #66bb6a; }
.agent-entry .dot.stretching { background: #ffb74d; box-shadow: 0 0 4px #ffb74d; }
.agent-entry .dot.walking { background: #ce93d8; box-shadow: 0 0 4px #ce93d8; }
.agent-entry .dot.visiting { background: #66bb6a; box-shadow: 0 0 4px #66bb6a; }
.agent-entry .dot.browsing { background: #ff7043; box-shadow: 0 0 4px #ff7043; }
.agent-entry .dot.lounging { background: #5c6bc0; box-shadow: 0 0 4px #5c6bc0; }
.agent-entry .dot.reading { background: #7e57c2; box-shadow: 0 0 4px #7e57c2; }
.agent-entry .dot.gazing { background: #4fc3f7; box-shadow: 0 0 4px #4fc3f7; }
.agent-entry .dot.snacking { background: #ffa726; box-shadow: 0 0 4px #ffa726; }
.agent-entry .dot.hydrating { background: #29b6f6; box-shadow: 0 0 4px #29b6f6; }
.agent-entry .dot.watching\ TV { background: #ab47bc; box-shadow: 0 0 4px #ab47bc; }
.agent-entry .dot[class*="coffee"] { background: #8d6e63; box-shadow: 0 0 4px #8d6e63; }
.agent-entry .dot[class*="sipping"] { background: #8d6e63; box-shadow: 0 0 4px #8d6e63; }
.agent-entry .name { color: #ccc; min-width: 40px; }
.agent-entry .state { color: #888; font-size: 6px; margin-left: auto; }

.status-panel {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--ui-border);
    padding: 8px;
    border-radius: 4px;
    font-size: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}
.status-panel p { margin: 2px 0; }

.activity-feed {
    font-size: 7px;
    color: #888;
    border-top: 1px solid var(--ui-border);
    padding-top: 8px;
}
.activity-feed .section-body {
    min-height: 120px;
    max-height: 400px;
    overflow-y: scroll;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    padding: 4px;
    background: rgba(0,0,0,0.2);
}
.activity-feed .section-body::-webkit-scrollbar { width: 6px; }
.activity-feed .section-body::-webkit-scrollbar-thumb { background: var(--ui-border); border-radius: 3px; }
.activity-feed h4 { color: #4caf50; }
#log-list { list-style: none; }
#log-list li {
    margin-bottom: 4px; padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    line-height: 1.4;
}

/* --- MODAL --- */
.modal {
    position: fixed; top: 0; left: 0;
    width: 100vw; height: 100vh;
    /* Use dvh/dvw for visual viewport on mobile (ignores zoom) */
    width: 100dvw; height: 100dvh;
    background: rgba(0,0,0,0.85);
    display: flex; justify-content: center; align-items: center; z-index: 10000;
    backdrop-filter: blur(4px);
    padding: 10px;
    overflow-y: auto;
}
.hidden { display: none; }
.modal-content {
    background: var(--ui-surface);
    color: var(--ui-text);
    border: 3px solid var(--gold);
    border-radius: 8px;
    padding: 20px;
    width: 520px;
    max-width: calc(100vw - 20px); max-width: calc(100dvw - 20px);
    max-height: 90vh; max-height: 90dvh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 0 40px rgba(255,215,0,0.15);
    margin: auto;
    /* Reset any zoom transform */
    zoom: 1;
}
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-thumb { background: var(--ui-border); border-radius: 3px; }
.modal-header {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: -20px; z-index: 5;
    background: var(--ui-surface);
    margin: -20px -20px 0 -20px;
    padding: 20px 20px 8px 20px;
    border-bottom: 1px solid var(--ui-border);
}
.modal-emoji { font-size: 24px; }
.modal-content h2 { font-size: 14px; color: var(--gold); }
.modal-role { font-size: 9px; color: #888; margin: 4px 0 12px 0; }
.close-btn {
    font-size: 24px; cursor: pointer; color: #f44336;
    z-index: 10;
    padding: 4px 8px;
    touch-action: manipulation;
    margin-left: auto;
}
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 100%; overflow: visible; word-break: break-word; }
.modal-section {
    overflow: visible; max-width: 100%;
    background: rgba(0,0,0,0.3); padding: 10px;
    border-radius: 4px; border: 1px solid var(--ui-border);
    box-sizing: border-box;
}
.modal-section.bio-section {
    overflow: visible;
}
.modal-section h3 { font-size: 8px; color: var(--gold); margin-bottom: 6px; }
.modal-section p { font-size: 8px; margin: 3px 0; }
.full-width { grid-column: span 2; }
.scroll-box {
    max-height: 80px; overflow-y: auto;
    background: rgba(0,0,0,0.4); border: 1px solid var(--ui-border);
    padding: 6px; font-family: monospace; font-size: 9px; color: #aaa;
    border-radius: 3px;
}
.scroll-box::-webkit-scrollbar { width: 6px; }
.scroll-box::-webkit-scrollbar-thumb { background: var(--ui-border); border-radius: 3px; }
.log-entry { margin-bottom: 3px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 2px; }

/* Task I/O in modal */
.io-box {
    max-height: 140px;
    overflow-y: auto;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    line-height: 1.8;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--ui-border);
    padding: 8px;
    border-radius: 3px;
}
.io-box::-webkit-scrollbar { width: 6px; }
.io-box::-webkit-scrollbar-thumb { background: var(--ui-border); border-radius: 3px; }
.io-from { color: var(--gold); margin-bottom: 6px; font-size: 7px; }
.io-from strong { color: #fff; }
.io-text { color: #ccc; white-space: pre-wrap; word-break: break-word; }

.modal-controls {
    display: flex; gap: 6px; margin-top: 12px; justify-content: center;
    flex-wrap: wrap;
}
.modal-controls button { font-size: 7px; padding: 6px 8px; }
.modal-controls-sep { color: #555; margin: 0 4px; font-size: 12px; }

/* --- RESPONSIVE: Sidebar below canvas on narrow screens --- */
@media (max-width: 900px) {
    html, body { overflow: auto; }
    .main-container {
        flex-direction: column;
        margin: 0;
        border-radius: 0;
        border: none;
        max-width: 100vw;
        height: auto;
    }

    .left-column {
        width: 100%;
    }

    .game-wrapper {
        width: 100%;
        height: 56vh;
        min-height: 280px;
    }

    #officeCanvas {
        border-bottom: 4px solid var(--ui-border);
    }

    .game-wrapper {
        touch-action: pan-y;
    }

    #officeCanvas {
        touch-action: pan-y;
    }

    .sidebar-edge {
        width: 100%;
        height: 20px;
    }

    .sidebar {
        width: 100%;
        max-height: none;
        height: auto;
        flex-direction: column;
        padding: 12px;
    }
    .sidebar.collapsed {
        width: 100%;
        height: 0;
        padding: 0;
    }

    .brand h2 { font-size: 11px; }
    .brand h3 { font-size: 9px; }

    .sidebar .branch-sections-row {
        display: flex;
        gap: 8px;
    }

    .toolbar {
        padding: 6px 4px;
        margin: 4px auto;
        border-radius: 0;
    }
    .toolbar button {
        font-size: 7px;
        padding: 6px 8px;
        flex: 1 1 auto;
        min-width: 0;
    }

    .modal-content {
        width: 95vw;
        max-height: 85vh;
        padding: 14px;
    }
    .modal-content h2 { font-size: 12px; }
    .modal-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: span 1; }
    .close-btn { font-size: 28px; top: 6px; right: 10px; }
}

/* --- PC PERFORMANCE MONITOR --- */
.pc-monitor {
    border: 2px solid #3a3a4e;
    border-radius: 6px;
    background: rgba(0,0,0,0.4);
    overflow: hidden;
}
.pc-monitor-toggle {
    font-size: 8px;
    color: #4fc3f7;
    padding: 8px 10px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}
.pc-monitor-toggle:hover { color: #81d4fa; }
.pc-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    margin-left: auto;
    flex-shrink: 0;
}
.pc-dot.online { background: #4caf50; box-shadow: 0 0 6px #4caf50; }
.pc-dot.offline { background: #f44336; box-shadow: 0 0 6px #f44336; }

.pc-monitor-body {
    padding: 6px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pc-metric-row {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 4px;
    padding: 6px 8px;
}
.pc-metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.pc-label {
    font-size: 7px;
    color: #aaa;
    font-family: 'Press Start 2P', monospace;
}
.pc-value {
    font-size: 9px;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-weight: bold;
}
.pc-bar-track {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}
.pc-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease, background 0.3s;
}
.pc-bar.cpu { background: linear-gradient(90deg, #4fc3f7, #0288d1); }
.pc-bar.ram { background: linear-gradient(90deg, #ce93d8, #8e24aa); }
.pc-bar.gpu { background: linear-gradient(90deg, #66bb6a, #2e7d32); }

.pc-graph {
    width: 100%;
    height: 40px;
    border-radius: 3px;
    background: rgba(0,0,0,0.3);
    margin-bottom: 2px;
}
.pc-detail {
    font-size: 6px;
    color: #777;
    font-family: 'Press Start 2P', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pc-power-summary {
    font-size: 7px;
    color: #ffd700;
    font-family: 'Press Start 2P', monospace;
    text-align: center;
    padding: 6px 4px;
    border-top: 1px solid rgba(255,215,0,0.2);
    margin-top: 4px;
}

/* --- API USAGE MONITOR --- */
.api-usage-monitor {
    border: 2px solid #3a3a4e;
    border-radius: 6px;
    background: rgba(0,0,0,0.4);
    overflow: hidden;
    margin-top: 8px;
}
.api-usage-toggle {
    font-size: 8px;
    color: #b39ddb;
    padding: 8px 10px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}
.api-usage-toggle:hover { color: #d1c4e9; }
.api-usage-body {
    padding: 6px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.api-auth-tag {
    font-size: 5px;
    padding: 1px 4px;
    border: 1px solid;
    border-radius: 2px;
    font-family: 'Press Start 2P', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.api-warning {
    font-size: 6px;
    font-family: 'Press Start 2P', monospace;
    padding: 3px 5px;
    border-radius: 3px;
    margin: 3px 0;
    line-height: 1.4;
}
.api-warning.exhausted {
    background: rgba(244,67,54,0.15);
    border: 1px solid rgba(244,67,54,0.4);
    color: #ff8a80;
    animation: pulse-warn 2s ease-in-out infinite;
}
.api-warning.invalid {
    background: rgba(244,67,54,0.15);
    border: 1px solid rgba(244,67,54,0.4);
    color: #ef5350;
}
.api-warning.rate-limited {
    background: rgba(255,152,0,0.15);
    border: 1px solid rgba(255,152,0,0.4);
    color: #ffb74d;
}
.api-warning.error {
    background: rgba(158,158,158,0.15);
    border: 1px solid rgba(158,158,158,0.3);
    color: #999;
}
.api-health-ok {
    font-size: 6px;
    font-family: 'Press Start 2P', monospace;
    color: #66bb6a;
    margin: 3px 0;
}
@keyframes pulse-warn {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* --- SMS PANEL --- */
.sms-panel {
    position: fixed;
    bottom: 0;
    right: 388px;
    width: 360px;
    height: 500px;
    background: var(--ui-surface);
    border: 2px solid #5c6bc0;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    display: flex;
    flex-direction: column;
    z-index: 10001;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
}
.sms-panel.open { transform: translateY(0); }

.sms-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #5c6bc0, #3f51b5);
    border-radius: 10px 10px 0 0;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}
.sms-header .sms-count {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}
.sms-mode-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 8px;
}
.sms-mode-label {
    font-size: 11px;
    font-weight: normal;
    opacity: 0.9;
}
.sms-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 18px;
}
.sms-switch input { opacity: 0; width: 0; height: 0; }
.sms-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #5c6bc0;
    border-radius: 18px;
    transition: 0.3s;
}
.sms-slider:before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.sms-switch input:checked + .sms-slider { background: #ffd700; }
.sms-switch input:checked + .sms-slider:before { transform: translateX(18px); }
.sms-header .sms-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
}

.sms-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sms-messages::-webkit-scrollbar { width: 6px; }
.sms-messages::-webkit-scrollbar-thumb { background: var(--ui-border); border-radius: 3px; }

.sms-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}
.sms-msg.outbound {
    align-self: flex-end;
    background: #5c6bc0;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.sms-msg.inbound {
    align-self: flex-start;
    background: #2a2d35;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}
.sms-msg.blocked {
    align-self: center;
    background: #4a1c1c;
    color: #ff8a80;
    font-size: 11px;
    opacity: 0.7;
}
.sms-msg.intervention {
    align-self: flex-end;
    background: #2e7d32;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.sms-msg-meta {
    font-size: 10px;
    opacity: 0.7;
    margin-bottom: 2px;
}
.sms-msg-body {
    font-size: 13px;
}

.sms-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-top: 1px solid var(--ui-border);
}
.sms-recipient {
    flex: 1;
    background: var(--ui-surface);
    color: var(--text-primary);
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
}
.sms-phone-manual {
    flex: 1;
    background: var(--ui-surface);
    color: var(--text-primary);
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
}
.sms-toggle-manual {
    background: none;
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
}
.sms-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    color: var(--ui-text);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    resize: none;
}
.sms-input:focus { border-color: #5c6bc0; outline: none; }
.sms-send-btn {
    background: linear-gradient(135deg, #5c6bc0, #3f51b5);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
    flex-shrink: 0;
}
.sms-send-btn:hover { transform: scale(1.05); }

/* --- CHAT PANEL --- */
.chat-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #e6b800);
    border: 3px solid #c9a200;
    font-size: 24px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(255,215,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: sans-serif;
}
.chat-toggle-btn:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(255,215,0,0.6); }
.chat-toggle-btn.active { display: none !important; }

.chat-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 380px;
    height: 500px;
    min-height: 250px;
    max-height: 95vh;
    background: var(--ui-surface);
    border: 2px solid var(--gold);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    display: flex;
    flex-direction: column;
    z-index: 10001;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
}
.chat-panel.open { transform: translateY(0); }
/* Resize drag handle */
.chat-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    cursor: ns-resize;
    z-index: 10;
    background: transparent;
    border-radius: 12px 12px 0 0;
}
.chat-resize-handle:hover,
.chat-resize-handle.dragging {
    background: rgba(255, 215, 0, 0.3);
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 10px;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid var(--ui-border);
    border-radius: 12px 12px 0 0;
    font-size: 10px;
    color: var(--gold);
    font-family: 'Press Start 2P', cursive;
    overflow: hidden;
}
/* Agent selector dropdown */
.chat-agent-select {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--ui-border);
    color: var(--gold);
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    max-width: 160px;
    outline: none;
    flex-shrink: 0;
}
.chat-agent-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 4px rgba(255, 215, 0, 0.3);
}
.chat-agent-select option, .chat-agent-select optgroup {
    background: #1a1a2e;
    color: #eee;
    font-family: Arial, sans-serif;
    font-size: 13px;
    padding: 4px 8px;
}
.chat-agent-select optgroup {
    color: #888;
    font-weight: bold;
    font-size: 11px;
}
.chat-new-session {
    margin-left: auto;
    background: none;
    border: none;
    color: #aaa;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    box-shadow: none;
}
.chat-new-session:hover { color: #fff; }
.chat-header-btns {
    display: flex;
    align-items: center;
    gap: 0px;
    flex-shrink: 0;
    margin-left: 6px;
}
.chat-move-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    box-shadow: none;
    transition: color 0.2s;
}
.chat-move-btn:hover { color: var(--gold); }
.chat-move-btn.active { color: var(--gold); }
/* Glow on header when move mode is active */
.chat-panel.move-active .chat-header {
    box-shadow: 0 0 12px rgba(255,215,0,0.6), inset 0 0 8px rgba(255,215,0,0.15);
    border-bottom: 1px solid var(--gold);
    cursor: grab;
}
.chat-panel.move-active.dragging .chat-header {
    cursor: grabbing;
    box-shadow: 0 0 20px rgba(255,215,0,0.8), inset 0 0 12px rgba(255,215,0,0.25);
}
.chat-close {
    background: none;
    border: none;
    color: #f44336;
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    box-shadow: none;
}

/* Chat panel floating/dragging states */
.chat-panel.floating {
    position: fixed;
    border-radius: 12px;
    border-bottom: 2px solid var(--gold);
    transition: none;
    transform: none !important;
}
.chat-panel.floating .chat-resize-handle {
    border-radius: 12px 12px 0 0;
}
.chat-panel.dragging {
    opacity: 0.85;
    cursor: grabbing;
    user-select: none;
}
.chat-panel.snap-left {
    left: 0 !important;
    right: auto !important;
    border-radius: 0 12px 12px 0;
    border-left: none;
    border-right: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    transform: none !important;
}
.chat-panel.snap-right {
    left: auto !important;
    border-radius: 12px 0 0 12px;
    border-right: none;
    border-left: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    transform: none !important;
}
/* Snap zone indicators during drag */
.chat-snap-zone {
    position: fixed;
    top: 0;
    width: 60px;
    height: 100vh;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}
.chat-snap-zone.left { left: 0; background: linear-gradient(90deg, rgba(255,215,0,0.3), transparent); }
.chat-snap-zone.right { right: 0; background: linear-gradient(-90deg, rgba(255,215,0,0.3), transparent); }
.chat-snap-zone.active { opacity: 1; }
.chat-status {
    font-size: 7px;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    white-space: nowrap;
    flex-shrink: 0;
}
.chat-status.connected { color: #4caf50; }
.chat-status.connecting { color: #ffc107; }
.chat-status.disconnected { color: #f44336; }

.bio-toggle {
    cursor: pointer;
    user-select: none;
}
.bio-toggle:hover { color: #fff; }
.bio-content {
    max-height: 400px;
    overflow-y: auto;
    font-size: 8px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    margin-top: 6px;
    color: #ccc;
    box-sizing: border-box;
}
.bio-content.hidden { display: none; }

/* Skills section */
.skill-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px;
    margin: 2px 0;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 11px;
}
.skill-row-info {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}
.skill-row-btns {
    display: flex;
    gap: 4px;
    margin-left: 8px;
    flex-shrink: 0;
}
.skill-row-btns button {
    background: none;
    border: 1px solid #555;
    color: #e8e8f0;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}
.skill-row-btns button:hover {
    border-color: #ffd700;
}
.skill-form-input {
    width: 100%;
    padding: 4px 8px;
    margin-bottom: 4px;
    background: #0d1117;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
}
.skill-form-textarea {
    width: 100%;
    min-height: 120px;
    max-height: 300px;
    padding: 8px;
    background: #0d1117;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.4;
    resize: vertical;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: hidden;
    overflow-y: auto;
}
.skill-form-textarea:focus, .skill-form-input:focus {
    border-color: #ffd600;
    outline: none;
}

.model-settings-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
    max-width: 100%;
    overflow: visible;
    flex-wrap: wrap;
}
.model-settings-row select {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 60px);
    padding: 5px 6px;
    font-family: 'Press Start 2P', monospace;
    font-size: 6px;
    background: #0d0d1a;
    color: #ccc;
    border: 1px solid #333;
    border-radius: 3px;
    appearance: auto;
    text-overflow: ellipsis;
    box-sizing: border-box;
}
.model-settings-row button {
    flex-shrink: 0;
    padding: 5px 6px;
    font-family: 'Press Start 2P', monospace;
    font-size: 6px;
    background: #e6a800;
    color: #000;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
}
.model-settings-row button:hover { background: #ffc107; }
.model-status-msg {
    font-size: 6px;
    margin-top: 3px;
    color: #888;
    min-height: 10px;
}

.chat-model-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 8px;
    color: #aaa;
    font-family: 'Press Start 2P', monospace;
    letter-spacing: 0.3px;
    line-height: 1.4;
}
.chat-model-bar #chat-model-name {
    color: #7ecfff;
}
.chat-model-bar #chat-context-info {
    color: #bbb;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--ui-border); border-radius: 3px; }

.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { justify-content: flex-start; }
.chat-msg.system { justify-content: center; }

.chat-bubble {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}
.chat-msg.user .chat-bubble {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg.assistant .chat-bubble {
    background: rgba(255,255,255,0.08);
    color: var(--ui-text);
    border: 1px solid var(--ui-border);
    border-bottom-left-radius: 4px;
}
.chat-msg.system .chat-bubble.system-bubble {
    background: rgba(255,152,0,0.15);
    color: #ffb74d;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 8px;
}

.chat-bubble a {
    color: #fff;
    font-weight: bold;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.chat-bubble a:hover {
    opacity: 0.8;
}
.chat-bubble code {
    background: rgba(0,0,0,0.3);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 12px;
}
.chat-bubble .chat-time {
    display: block;
    font-size: 9px;
    opacity: 0.5;
    margin-top: 4px;
    text-align: right;
}

.chat-bubble.streaming .cursor {
    animation: blink 0.8s infinite;
    color: var(--gold);
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.chat-bubble.typing {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 11px;
    font-style: italic;
}
.typing-dots span {
    animation: dotBounce 1.2s infinite;
    font-size: 16px;
    line-height: 1;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

.chat-input-row {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid var(--ui-border);
    background: rgba(0,0,0,0.3);
}
.chat-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--ui-border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--ui-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    resize: none;
    outline: none;
    min-height: 36px;
    max-height: none;
    overflow-y: auto;
    transition: height 0.1s ease;
}
.chat-input:focus { border-color: var(--gold); }
.chat-input::placeholder { color: #666; }
.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold);
    border: none;
    color: #000;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    box-shadow: none;
}
.chat-send-btn:hover { background: #ffea00; }
.chat-attach-btn {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}
.chat-attach-btn:hover { color: #fff; }
.chat-mic-btn {
    width: 36px;
    height: 36px;
    background: none;
    border: 2px solid #555;
    border-radius: 4px;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.chat-mic-btn:hover { color: #fff; border-color: #888; }
.chat-mic-btn.recording {
    color: #ff3333;
    border-color: #ff3333;
    animation: rec-blink 0.8s infinite;
    box-shadow: 0 0 8px rgba(255, 50, 50, 0.4);
}
.chat-stop-btn {
    width: 36px;
    height: 36px;
    background: none;
    border: 2px solid #744;
    border-radius: 4px;
    color: #d88;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.chat-stop-btn:hover {
    color: #fff;
    border-color: #c66;
    background: rgba(160, 40, 40, 0.2);
}
@keyframes rec-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.chat-attachments-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 10px;
    max-height: 120px;
    overflow-y: auto;
}
.chat-attachments-preview:empty { display: none; }
.chat-attach-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--ui-border);
    background: rgba(255,255,255,0.05);
}
.chat-attach-item img {
    max-width: 80px;
    max-height: 60px;
    display: block;
}
.chat-attach-item .file-name {
    font-size: 10px;
    color: #aaa;
    padding: 2px 6px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-attach-remove {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #f44336;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    box-shadow: none;
}

/* --- Chat responsive --- */
@media (max-width: 480px) {
    .chat-panel { width: 100%; height: 70vh; z-index: 10010; }
    .chat-toggle-btn { bottom: 12px; right: 12px; width: 48px; height: 48px; font-size: 20px; }
    .chat-panel.open ~ .chat-toggle-btn,
    .chat-toggle-btn.active { display: none !important; }
}
/* --- SMS responsive --- */
@media (max-width: 900px) {
    .sms-panel { right: 0; width: 100%; height: 60vh; }
}

/* Extra small phones */
@media (max-width: 480px) {
    .brand h2 { font-size: 9px; }
    .brand h3 { font-size: 7px; letter-spacing: 2px; }
    .branch-section h4 { font-size: 7px; }
    .agent-entry { font-size: 6px; }
    .status-panel { font-size: 7px; }
    .activity-feed { font-size: 6px; }
    .controls button { font-size: 6px; padding: 5px 4px; }
    .modal-content { padding: 10px; }
    .modal-section h3 { font-size: 7px; }
    .modal-section p { font-size: 7px; }
    .io-box { font-size: 7px; max-height: 120px; }
}

/* Markdown table styling in chat */
.chat-bubble table { border-collapse: collapse; margin: 8px 0; width: 100%; font-size: 13px; }
.chat-bubble th, .chat-bubble td { border: 1px solid rgba(255,255,255,0.2); padding: 4px 8px; text-align: left; }
.chat-bubble th { background: rgba(255,255,255,0.1); font-weight: bold; }
.chat-bubble h1, .chat-bubble h2, .chat-bubble h3 { margin: 8px 0 4px; }
.chat-bubble h3 { font-size: 14px; }
.chat-bubble ul, .chat-bubble ol { margin: 4px 0; padding-left: 20px; }
.chat-bubble p { margin: 4px 0; }
.chat-bubble pre { background: rgba(0,0,0,0.3); padding: 8px; border-radius: 4px; overflow-x: auto; }

/* Chat images */
.chat-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.chat-image-thumb {
    max-width: 180px;
    max-height: 160px;
    border-radius: 8px;
    cursor: pointer;
    object-fit: cover;
    transition: opacity 0.15s;
}
.chat-image-thumb:hover {
    opacity: 0.85;
}
/* Markdown-rendered images inside bubbles */
.chat-bubble .chat-image-clickable {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    margin: 4px 0;
}

/* Image Lightbox */
.image-lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.image-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}
.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: 16px; right: 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Tool activity feed */
.chat-activity {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  padding: 1px 10px;
  font-size: 10px;
  color: #888;
  font-style: italic;
  opacity: 0.8;
}
.activity-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.activity-time {
  color: #aaa;
  font-size: 9px;
  flex-shrink: 0;
}

/* === BROWSER PANEL === */
.browser-toggle-btn {
  background: linear-gradient(135deg, #1b5e20, #388e3c) !important;
  border-color: #4caf50 !important;
}
.browser-toggle-btn:hover {
  background: linear-gradient(135deg, #2e7d32, #43a047) !important;
}
.browser-toggle-btn.active {
  background: linear-gradient(135deg, #43a047, #66bb6a) !important;
  box-shadow: 0 0 12px rgba(76,175,80,0.5);
}

.browser-panel {
  position: fixed;
  width: 60vw;
  height: 60vh;
  min-width: 400px;
  min-height: 200px;
  background: var(--ui-bg);
  z-index: 1500;
  display: none;
  flex-direction: column;
  border: 2px solid #4caf50;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 20px rgba(76,175,80,0.2);
  resize: none;
  overflow: hidden;
  /* default centered position set by JS */
}

/* Custom resize handles — all edges and corners */
.browser-resize-handle {
  position: absolute;
  z-index: 10;
}
.browser-resize-handle.top    { top: -4px; left: 8px; right: 8px; height: 8px; cursor: n-resize; }
.browser-resize-handle.bottom { bottom: -4px; left: 8px; right: 8px; height: 8px; cursor: s-resize; }
.browser-resize-handle.left   { left: -4px; top: 8px; bottom: 8px; width: 8px; cursor: w-resize; }
.browser-resize-handle.right  { right: -4px; top: 8px; bottom: 8px; width: 8px; cursor: e-resize; }
.browser-resize-handle.top-left     { top: -4px; left: -4px; width: 12px; height: 12px; cursor: nw-resize; }
.browser-resize-handle.top-right    { top: -4px; right: -4px; width: 12px; height: 12px; cursor: ne-resize; }
.browser-resize-handle.bottom-left  { bottom: -4px; left: -4px; width: 12px; height: 12px; cursor: sw-resize; }
.browser-resize-handle.bottom-right { bottom: -4px; right: -4px; width: 12px; height: 12px; cursor: se-resize; }
.browser-panel.open {
  display: flex;
}
.browser-panel.minimized {
  height: auto !important;
  min-height: 0 !important;
  resize: none;
}
.browser-panel.minimized .browser-url-bar,
.browser-panel.minimized .browser-frame-container {
  display: none;
}
.browser-panel.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0;
  resize: none;
}

.browser-header {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background: linear-gradient(135deg, #1a1a2e, #1b5e20);
  border-bottom: 2px solid #4caf50;
  gap: 10px;
  min-height: 40px;
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
}
.browser-header:active {
  cursor: grabbing;
}
.browser-title {
  font-size: 10px;
  color: #4caf50;
  font-weight: bold;
  white-space: nowrap;
}
.browser-status {
  font-size: 8px;
  color: #888;
  flex-shrink: 0;
}
.browser-status.ai-active {
  color: #4caf50;
  animation: pulse-green 1.5s infinite;
}
.browser-status.ai-control {
  color: #4caf50;
}
.browser-status.user-control {
  color: #ffc107;
}
@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.browser-controls {
  display: flex;
  gap: 6px;
  margin-left: auto;
  align-items: center;
}
.browser-ctrl-btn {
  background: linear-gradient(135deg, #1a1a2e, #2a2a3e);
  border: 1px solid #4caf50;
  color: #e8e8f0;
  font-size: 8px;
  font-family: 'Press Start 2P', cursive;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.browser-ctrl-btn:hover {
  background: linear-gradient(135deg, #2a2a3e, #3a3a4e);
  border-color: #66bb6a;
}
.browser-release-btn {
  border-color: #ffc107;
}
.browser-release-btn:hover {
  border-color: #ffca28;
}
.browser-close {
  background: none;
  border: 1px solid #555;
  color: #e8e8f0;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1;
}
.browser-close:hover {
  background: rgba(244,67,54,0.3);
  border-color: #f44336;
}
.browser-minimize,
.browser-maximize {
  background: none;
  border: 1px solid #555;
  color: #e8e8f0;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1;
  font-family: 'Press Start 2P', cursive;
  font-size: 10px;
}
.browser-minimize:hover {
  background: rgba(76,175,80,0.2);
  border-color: #4caf50;
}
.browser-maximize:hover {
  background: rgba(76,175,80,0.2);
  border-color: #4caf50;
}
.browser-maximize.is-maximized {
  color: #4caf50;
  border-color: #4caf50;
}

.browser-url-bar {
  background: #111;
  padding: 4px 12px;
  border-bottom: 1px solid #333;
  font-size: 8px;
  color: #aaa;
  font-family: monospace;
  min-height: 22px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.browser-current-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-frame-container {
  flex: 1;
  overflow: hidden;
  background: #000;
}
.browser-neko-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
  object-fit: contain;
}

@keyframes browser-flash-border {
  0%   { box-shadow: 0 0 0 3px rgba(255, 215, 0, 0); }
  25%  { box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.9); }
  50%  { box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3); }
  75%  { box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.9); }
  100% { box-shadow: 0 0 0 3px rgba(255, 215, 0, 0); }
}

.browser-panel.auto-open-flash {
  animation: browser-flash-border 1.5s ease-out;
}

/* ─── Snap zone buttons ─────────────────────────────────────── */
.browser-snap-group {
  display: flex;
  gap: 2px;
  margin-right: 6px;
  border-right: 1px solid #333;
  padding-right: 6px;
}
.browser-snap-btn {
  background: linear-gradient(135deg, #1a1a2e, #2a2a3e);
  border: 1px solid #555;
  color: #aaa;
  font-size: 7px;
  font-family: 'Press Start 2P', cursive;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.browser-snap-btn:hover {
  border-color: #4caf50;
  color: #4caf50;
}
.browser-snap-btn.active {
  border-color: #4caf50;
  color: #4caf50;
  background: linear-gradient(135deg, #1b3a1b, #2a4a2a);
}

/* ─── FURNITURE CATALOG PANEL ─────────────────────────────── */
.furniture-catalog {
  position: absolute;
  left: -230px;
  top: 0;
  bottom: 0;
  width: 220px;
  background: #1a1a2e;
  border-right: 2px solid #2a2a4e;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: left 0.25s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,0.6);
}
.furniture-catalog.visible {
  left: 0;
}
.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #0d0d1e;
  border-bottom: 1px solid #2a2a4e;
  color: #ffd600;
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.catalog-close-btn {
  background: none;
  border: 1px solid #444;
  color: #aaa;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 3px;
  font-family: 'Press Start 2P', cursive;
  transition: all 0.15s;
}
.catalog-close-btn:hover {
  border-color: #ffd600;
  color: #ffd600;
}
.catalog-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: #2a2a4e #1a1a2e;
}
.catalog-body::-webkit-scrollbar { width: 5px; }
.catalog-body::-webkit-scrollbar-track { background: #1a1a2e; }
.catalog-body::-webkit-scrollbar-thumb { background: #2a2a4e; border-radius: 3px; }
.catalog-section {
  margin-bottom: 2px;
}
.catalog-cat-header {
  padding: 7px 12px;
  background: #12122a;
  color: #ffd600;
  font-family: 'Press Start 2P', cursive;
  font-size: 7px;
  cursor: pointer;
  user-select: none;
  border-left: 3px solid #ffd600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.1s;
}
.catalog-cat-header:hover { background: #1c1c3a; }
.cat-arrow { font-size: 8px; }
.catalog-items { padding: 2px 0; }
.catalog-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  color: #bbb;
  font-family: 'Press Start 2P', cursive;
  font-size: 6px;
  line-height: 1.4;
  border-left: 3px solid transparent;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.catalog-item:hover {
  background: #22224a;
  color: #eee;
  border-left-color: #555;
}
.catalog-item.selected {
  background: rgba(255, 214, 0, 0.12);
  color: #ffd600;
  border-left-color: #ffd600;
}
.catalog-icon { font-size: 16px; flex-shrink: 0; }
.catalog-label { line-height: 1.5; }
.catalog-snap-section {
  padding: 6px 10px;
  border-top: 1px solid #2a2a4e;
  flex-shrink: 0;
}
.snap-zone-select {
  width: 100%;
  padding: 5px 8px;
  font-size: 7px;
  font-family: 'Press Start 2P', cursive;
  background: #151520;
  color: #e8e8f0;
  border: 1px solid #2a2a4e;
  border-radius: 3px;
  margin-top: 4px;
  cursor: pointer;
}
.snap-zone-select:focus { border-color: #ffd700; outline: none; }
.catalog-instructions {
  padding: 8px 12px;
  color: #555;
  font-size: 6px;
  font-family: 'Press Start 2P', cursive;
  border-top: 1px solid #2a2a4e;
  line-height: 1.8;
  flex-shrink: 0;
}

/* ─── FURNITURE FLOATING TOOLBAR ─────────────────────────── */
.furniture-floating-toolbar {
  position: fixed;
  display: flex;
  gap: 4px;
  background: #1a1a2e;
  border: 1px solid #ffd600;
  border-radius: 6px;
  padding: 4px 6px;
  z-index: 300;
  box-shadow: 0 4px 16px rgba(0,0,0,0.7);
  pointer-events: all;
}
.ftb-btn {
  background: #2a2a4e;
  border: 1px solid #3a3a5e;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.1s;
  line-height: 1;
}
.ftb-btn:hover { background: #3a3a6e; }
.ftb-btn.delete-btn:hover { background: rgba(244, 67, 54, 0.4); border-color: #f44336; }

/* ─── AGENT CREATOR PANEL ─────────────────────────────────── */
.agent-panel {
  position: absolute;
  left: -330px;
  top: 0;
  bottom: 0;
  width: 320px;
  background: #1a1a2e;
  border-right: 2px solid #ffd600;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 4px 0 20px rgba(0,0,0,0.7);
  transition: left 0.25s ease;
  font-family: Arial, sans-serif;
}
.agent-panel.visible { left: 0; }
.agent-panel-header {
  background: #0d0d1e;
  padding: 10px 12px;
  border-bottom: 1px solid #2a2a4e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.agent-panel-title {
  color: #ffd600;
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
  letter-spacing: 0.5px;
}
.agent-panel-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2a2a4e #1a1a2e;
  padding-bottom: 20px;
}
.agent-panel-body::-webkit-scrollbar { width: 5px; }
.agent-panel-body::-webkit-scrollbar-track { background: #1a1a2e; }
.agent-panel-body::-webkit-scrollbar-thumb { background: #2a2a4e; border-radius: 3px; }
.agent-panel-body::-webkit-scrollbar-thumb:hover { background: #ffd600; }
.agent-add-btn {
  width: 100%;
  background: #1e3a1e;
  border: none;
  border-bottom: 1px solid #2a2a4e;
  color: #4caf50;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  font-weight: bold;
  display: block;
}
.agent-add-btn:hover { background: #263a26; }
.agent-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #1a1a3e;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 0.1s;
}
.agent-card:hover { background: #1e1e3a; }
.agent-card.selected {
  background: #12122a;
  border-left-color: #ffd600;
}
.agent-card-emoji { font-size: 18px; flex-shrink: 0; }
.agent-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  min-width: 0;
}
.agent-card-name {
  color: #e8e8f0;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-card-role {
  color: #888;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-panel-sep {
  height: 1px;
  background: #2a2a4e;
  margin: 6px 0;
}
.agent-preview-wrap {
  background: #0f0f1f;
  border-bottom: 1px solid #2a2a4e;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.agent-preview-canvas {
  image-rendering: pixelated;
  border: 1px solid #2a2a4e;
  background: #1a1a2e;
  flex-shrink: 0;
}
.agent-preview-info { flex: 1; }
.agent-preview-name { color: #ffd600; font-weight: bold; font-size: 13px; }
.agent-preview-role { color: #aaa; font-size: 10px; margin-top: 4px; }
.agent-preview-emoji { font-size: 20px; margin-top: 4px; }
.agent-sections-wrap {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agent-edit-section {
  background: #12122a;
  border: 1px solid #2a2a4e;
  border-radius: 4px;
  overflow: hidden;
}
.agent-section-header {
  background: #0f0f20;
  padding: 6px 10px;
  color: #ffd600;
  font-size: 10px;
  font-weight: bold;
  border-bottom: 1px solid #2a2a4e;
  letter-spacing: 0.5px;
}
.agent-field-row {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid #1a1a3e;
  gap: 8px;
  flex-wrap: wrap;
}
.agent-field-row:last-child { border-bottom: none; }
.agent-field-label {
  color: #aaa;
  font-size: 10px;
  width: 68px;
  flex-shrink: 0;
}
.agent-panel input[type=text] {
  background: #1a1a3e;
  border: 1px solid #2a2a4e;
  color: #e8e8f0;
  padding: 4px 6px;
  font-size: 11px;
  flex: 1;
  border-radius: 2px;
  min-width: 0;
}
.agent-panel input[type=color] {
  width: 36px;
  height: 24px;
  border: 1px solid #2a2a4e;
  background: none;
  cursor: pointer;
  padding: 1px;
}
.swatch {
  width: 18px;
  height: 18px;
  border: 2px solid #333;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.swatch.selected { border-color: #ffd600 !important; }
.option-btn {
  padding: 3px 7px;
  border: 1px solid #2a2a4e;
  background: #1a1a3e;
  color: #aaa;
  cursor: pointer;
  font-size: 10px;
  border-radius: 2px;
}
.option-btn:hover { border-color: #555; color: #ccc; }
.option-btn.selected {
  border-color: #ffd600;
  background: #2a2a10;
  color: #ffd600;
}
.agent-delete-wrap { padding: 12px; }
.agent-delete-btn {
  width: 100%;
  background: #3a1a1a;
  border: 1px solid #7b1a1a;
  color: #f44336;
  padding: 8px;
  cursor: pointer;
  font-size: 11px;
  border-radius: 3px;
}
.agent-delete-btn:hover { background: #4a2020; }

/* ─── Meetings Dashboard ─── */
.meetings-modal-content { max-width: 900px; width: 90vw; min-height: 300px; max-height: 85vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mtg-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--ui-border); margin-bottom: 12px; }
.mtg-tab { background: none; border: none; color: #888; font-size: 10px; padding: 8px 16px; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; }
.mtg-tab:hover { color: #ccc; }
.mtg-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.mtg-cards { display: flex; flex-direction: column; gap: 12px; overflow-y: visible; padding-right: 4px; padding-bottom: 20px; }
.mtg-cards::-webkit-scrollbar { width: 5px; }
.mtg-cards::-webkit-scrollbar-thumb { background: var(--ui-border); border-radius: 3px; }

.mtg-card { background: #1a1a2e; border: 1px solid #2a2a4e; border-radius: 8px; padding: 0; overflow: hidden; }
.mtg-card-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 12px 14px; cursor: pointer; user-select: none; transition: background 0.2s; }
.mtg-card-header:hover { background: #1e1e36; }
.mtg-card-title { font-size: 12px; font-weight: bold; color: #eee; }
.mtg-card-toggle { font-size: 10px; color: #666; margin-right: 6px; transition: transform 0.2s; display: inline-block; }
.mtg-card-toggle.open { transform: rotate(90deg); }
.mtg-card-purpose { font-size: 9px; color: #999; margin: 2px 0 0; }
.mtg-card-body { padding: 0 14px 14px; display: none; }
.mtg-card-body.open { display: block; }
.mtg-badge { display: inline-block; font-size: 8px; padding: 2px 8px; border-radius: 10px; font-weight: bold; }
.mtg-badge-active { background: #1b4332; color: #52b788; }
.mtg-badge-completed { background: #1a2744; color: #6c9bcf; }
.mtg-badge-kind { background: #2a2a4e; color: #aaa; margin-left: 6px; }
.mtg-meta { display: flex; gap: 12px; font-size: 9px; color: #777; margin-bottom: 10px; flex-wrap: wrap; }
.mtg-meta-item { display: flex; align-items: center; gap: 4px; }

.mtg-participants { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.mtg-participant { display: flex; align-items: center; gap: 6px; background: #12121e; border: 1px solid #2a2a4e; border-radius: 6px; padding: 5px 10px; }
.mtg-participant-emoji { font-size: 16px; }
.mtg-participant-info { display: flex; flex-direction: column; gap: 1px; }
.mtg-participant-name { font-size: 9px; font-weight: bold; color: #ddd; line-height: 1.2; }
.mtg-participant-role { font-size: 7px; color: #888; line-height: 1.2; }
.mtg-participant-actions { font-size: 8px; color: #52b788; margin-top: 2px; }

.mtg-responses { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.mtg-response { background: #12121e; border: 1px solid #2a2a4e; border-radius: 6px; padding: 10px; }
.mtg-response-header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.mtg-response-emoji { font-size: 14px; }
.mtg-response-name { font-size: 9px; font-weight: bold; color: #ddd; }
.mtg-response-role { font-size: 8px; color: #666; margin-left: 4px; }
.mtg-response-text { font-size: 9px; color: #bbb; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 80px; overflow-y: auto; -webkit-overflow-scrolling: touch; resize: vertical; min-height: 30px; transition: max-height 0.3s; }
.mtg-response-text.expanded { max-height: none; }
.mtg-response-text::-webkit-scrollbar { width: 4px; }
.mtg-response-text::-webkit-scrollbar-thumb { background: #2a2a4e; border-radius: 2px; }
.mtg-response-expand { font-size: 8px; color: var(--gold); cursor: pointer; margin-top: 3px; display: inline-block; }
.mtg-response-expand:hover { text-decoration: underline; }
.mtg-response-none { font-size: 8px; color: #555; font-style: italic; }

.mtg-section { margin-top: 10px; }
.mtg-section-title { font-size: 8px; color: var(--gold); text-transform: uppercase; margin-bottom: 4px; font-weight: bold; }
.mtg-section-text { font-size: 9px; color: #bbb; line-height: 1.5; white-space: pre-wrap; }

.mtg-actions-bar { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.mtg-btn { font-size: 9px; padding: 5px 12px; border: 1px solid #2a2a4e; background: #12121e; color: #ccc; border-radius: 4px; cursor: pointer; }
.mtg-btn:hover { background: #1a1a2e; color: #fff; }
.mtg-btn-end { background: #1b4332; color: #52b788; border-color: #2d6a4f; }
.mtg-btn-end:hover { background: #2d6a4f; color: #fff; }
.mtg-btn-delete { background: #3a1a1a; color: #e74c3c; border-color: #5a2a2a; }
.mtg-btn-delete:hover { background: #5a2a2a; color: #fff; }

.mtg-form { display: flex; flex-direction: column; gap: 8px; }
.mtg-label { font-size: 9px; color: var(--gold); font-weight: bold; }
.mtg-textarea { background: #12121e; border: 1px solid #2a2a4e; color: #ddd; font-size: 10px; padding: 8px; border-radius: 4px; resize: vertical; font-family: inherit; }
.mtg-textarea:focus { border-color: var(--gold); outline: none; }

.sidebar-bulk-actions { display: flex; gap: 6px; padding: 4px 10px; }
.sidebar-bulk-btn { font-size: 8px; padding: 3px 8px; background: #12121e; border: 1px solid #2a2a4e; color: #888; border-radius: 3px; cursor: pointer; flex: 1; text-align: center; }
.sidebar-bulk-btn:hover { color: var(--gold); border-color: var(--gold); }

.mtg-bulk-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.mtg-empty { text-align: center; padding: 40px 20px; color: #555; font-size: 11px; }
.mtg-timestamp { font-size: 8px; color: #666; }

/* Sidebar meetings widget */
.meetings-sidebar h4 { cursor: pointer; font-size: 10px; color: var(--gold); padding: 8px 12px; margin: 0; }
.skills-library-sidebar h4 { cursor: pointer; font-size: 10px; color: var(--gold); padding: 8px 12px; margin: 0; }
.projects-sidebar h4 { cursor: pointer; font-size: 10px; color: var(--gold); padding: 8px 12px; margin: 0; }
.projects-leaderboard h4 { cursor: pointer; font-size: 10px; color: var(--gold); padding: 8px 12px; margin: 0; }
.sidebar-mtg-list { padding: 0 8px; }
.sidebar-mtg-item { background: #1a1a2e; border: 1px solid #2a2a4e; border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; transition: border-color 0.2s; }
.sidebar-mtg-item:hover { border-color: var(--gold); }
.sidebar-mtg-item-title { font-size: 9px; font-weight: bold; color: #eee; }
.sidebar-mtg-item-meta { font-size: 8px; color: #888; margin-top: 2px; }
.sidebar-mtg-item-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #52b788; margin-right: 4px; vertical-align: middle; }
.sidebar-mtg-none { font-size: 9px; color: #555; padding: 4px 8px; }
.sidebar-mtg-btn { display: block; width: calc(100% - 16px); margin: 6px 8px; padding: 6px; font-size: 9px; background: #12121e; border: 1px solid #2a2a4e; color: var(--gold); border-radius: 4px; cursor: pointer; text-align: center; }
.sidebar-mtg-btn:hover { background: #1a1a2e; border-color: var(--gold); }

/* === Skills Library === */
.skills-library-modal { max-width: 520px; width: calc(100vw - 20px); min-height: 200px; max-height: 90vh; max-height: 90dvh; overflow-y: auto; }
.skl-topbar { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--ui-border); }
.skl-topbar button, .skl-upload-label { font-size: 10px; padding: 4px 10px; }
.skl-upload-label { cursor: pointer; }
.skl-cards { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; }
.skl-card { background: #1a1a2e; border: 1px solid #2a2a4e; border-radius: 6px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.skl-card-top { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.skl-card-name { font-size: 11px; font-weight: bold; color: #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skl-card-desc { display: none; }
.skl-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.skl-card-actions button { font-size: 9px; padding: 3px 7px; background: #12121e; border: 1px solid #2a2a4e; color: #ccc; border-radius: 4px; cursor: pointer; }
.skl-card-actions button:hover { background: #1e1e36; border-color: var(--gold); color: var(--gold); }
.skl-apply-dropdown { margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; width: 100%; }
.skl-apply-dropdown select { background: #12121e; border: 1px solid #2a2a4e; color: #ccc; border-radius: 4px; padding: 4px 8px; font-size: 10px; flex: 1; min-width: 0; }
.skl-apply-dropdown button { font-size: 9px; padding: 4px 10px; background: #1b5e20; border: 1px solid #66bb6a; color: #66bb6a; border-radius: 4px; cursor: pointer; }
.skl-editor-body { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.skl-field-label { font-size: 10px; color: #888; }
.skl-input { background: #12121e; border: 1px solid #2a2a4e; color: #eee; border-radius: 6px; padding: 8px 10px; font-size: 11px; width: 100%; box-sizing: border-box; }
.skl-textarea { background: #12121e; border: 1px solid #2a2a4e; color: #eee; border-radius: 6px; padding: 10px; font-size: 11px; font-family: 'Courier New', monospace; min-height: 320px; resize: vertical; white-space: pre; width: 100%; box-sizing: border-box; }
.skl-editor-actions { display: flex; gap: 8px; }
