:root {
    --bg-main: #09090b;
    --bg-sidebar: #050505;
    --bg-panel: #121214;
    --bg-input: #18181b;
    
    --g4-gold: #E5B446;
    --g4-gold-dim: rgba(229, 180, 70, 0.1);
    
    --text-pure: #FFFFFF;
    --text-primary: #e4e4e7;
    --text-muted: #a1a1aa;
    
    --border-color: rgba(255, 255, 255, 0.08);
    
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    
    --glass-bg: rgba(18, 18, 20, 0.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; cursor: default; }
body { 
    background-color: var(--bg-main); 
    color: var(--text-primary); 
    overflow: hidden; 
    position: relative;
}

/* Interactive Spotlight Glow */
#spotlight {
    position: fixed; inset: 0; pointer-events: none; z-index: 1;
    background: radial-gradient(circle 400px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(229,180,70,0.045), transparent 80%);
}

/* Scrollbars Chrome/Safari */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { 
    background: var(--border-color); border-radius: 6px; 
    transition: background 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
::-webkit-scrollbar-thumb:hover { background: rgba(229,180,70,0.4); }

#glow { position: fixed; width: 600px; height: 600px; background: radial-gradient(circle, rgba(229,180,70,0.04) 0%, transparent 60%); border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 0; }

.platform-layout { display: flex; height: 100vh; position: relative; z-index: 1; }

.sidebar { width: 280px; background-color: var(--bg-sidebar); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 1.5rem; }
.brand { font-family: 'Outfit', sans-serif; font-size: 1.7rem; font-weight: 800; margin-bottom: 1.5rem; letter-spacing: -0.5px; }
.brand-text { color: var(--g4-gold); }
.brand-sub { color: var(--text-pure); font-weight: 500; }
.new-chat-btn { width: 100%; background: transparent; border: 1px solid var(--border-color); color: var(--text-pure); padding: 0.8rem; border-radius: 8px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem; transition: 0.2s; }
.new-chat-btn:hover { background: var(--bg-panel); border-color: var(--g4-gold); }

.sidebar-scrollable { flex-grow: 1; overflow-y: auto; padding: 0 0.8rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.2rem; }
.nav-separator { color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; font-weight: 700; margin: 1.2rem 0 0.4rem 0.5rem; letter-spacing: 0.5px; }
.nav-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem; border-radius: 6px; color: var(--text-primary); text-decoration: none; font-size: 0.9rem; transition: 0.2s; border: 1px solid transparent; }
.nav-item:hover { background-color: var(--bg-panel); color: var(--text-pure); }
.nav-item.active { background-color: var(--g4-gold-dim); color: var(--g4-gold); border: 1px solid rgba(229,180,70,0.2); }

.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); }
.user-profile { display: flex; align-items: center; gap: 1rem; }
.user-avatar { width: 36px; height: 36px; background: #27272a; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; font-family: 'Outfit'; }
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-pure); }
.user-plan { font-size: 0.75rem; color: var(--text-muted); }

/* Main Area Container */
.chat-container { flex-grow: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: var(--bg-main); position: relative; }

/* Sub-Sidebar consolidada (Única) */
.sub-sidebar { width: 300px; background: var(--bg-panel); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; flex-shrink: 0; }

.sub-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); font-weight: 600; font-size: 0.95rem; color: var(--text-pure); display: flex; justify-content: space-between; align-items: center; }
.sub-list { flex-grow: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.history-card { padding: 0.8rem; background: transparent; border: 1px solid transparent; border-radius: 6px; cursor: pointer; transition: 0.2s; }
.history-card h5 { font-size: 0.85rem; font-weight: 500; color: var(--text-primary); margin-bottom: 0.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-card p { font-size: 0.75rem; color: var(--text-muted); }
.history-card:hover { background: var(--bg-input); border-color: var(--border-color); }
.history-card.active { background: var(--bg-input); border-color: var(--g4-gold); }

/* Chat Core */
.chat-workspace { flex-grow: 1; display: flex; flex-direction: column; position: relative;}
.top-model-selector { 
    height: 64px; border-bottom: 1px solid var(--border-color); 
    display: flex; align-items: center; padding: 0 1.5rem; 
    background: rgba(9, 9, 11, 0.95); backdrop-filter: blur(12px); z-index: 10;
}

.agent-selector-group {
    display: flex; align-items: center; gap: 0.4rem;
    background: rgba(255,255,255,0.03); border: 1px solid var(--border-color);
    padding: 0.3rem; border-radius: 12px;
}

.mode-sep { width: 1px; height: 16px; background: var(--border-color); margin: 0 4px; }

.mode-pill-premium, .agent-pill-premium {
    display: flex; align-items: center; gap: 8px;
    padding: 0.4rem 0.8rem; border-radius: 8px;
    font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
    cursor: pointer; transition: 0.2s; border: 1px solid transparent;
}

.mode-pill-premium i { font-size: 0.85rem; }

.agent-pill-premium img {
    width: 20px; height: 20px; border-radius: 50%;
    object-fit: cover; border: 1px solid rgba(255,255,255,0.1);
    filter: grayscale(1); transition: 0.2s;
}

.mode-pill-premium:hover, .agent-pill-premium:hover {
    background: rgba(255,255,255,0.06); color: var(--text-pure);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Active States */
.mode-pill-premium.active[data-mode="auto"] {
    background: var(--g4-gold-dim); border-color: rgba(229,180,70,0.3); color: var(--g4-gold);
}

.agent-pill-premium.active[data-mode="tallis"] {
    background: rgba(96,165,250,0.1); border-color: rgba(96,165,250,0.3); color: #93c5fd;
}
.agent-pill-premium.active[data-mode="tallis"] img { filter: none; border-color: #60a5fa; }

.agent-pill-premium.active[data-mode="alfredo"] {
    background: rgba(249,115,22,0.1); border-color: rgba(249,115,22,0.3); color: #fdba74;
}
.agent-pill-premium.active[data-mode="alfredo"] img { filter: none; border-color: #f97316; }

.agent-pill-premium.active[data-mode="nardon"] {
    background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: #6ee7b7;
}
.agent-pill-premium.active[data-mode="nardon"] img { filter: none; border-color: #10b981; }

.mode-pill-premium.active.mode-thinking {
    background: linear-gradient(135deg, rgba(229,180,70,0.2), rgba(229,180,70,0.05));
    border-color: var(--g4-gold); color: var(--g4-gold);
    box-shadow: 0 0 15px rgba(229,180,70,0.15);
}

.chat-scroll-area { flex-grow: 1; overflow-y: auto; padding: 2rem 0; scroll-behavior: smooth; }

/* Chat Bubbles */
.chat-message { 
    padding: 2rem; border-bottom: 1px solid rgba(255,255,255,0.02); 
    animation: messageEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
@keyframes messageEntrance {
    from { opacity: 0; transform: translateY(12px) scale(0.99); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.chat-message.user { background: transparent; }
.chat-message.ai { background: rgba(255,255,255,0.01); backdrop-filter: blur(2px); }
.message-content { max-width: 800px; margin: 0 auto; display: flex; gap: 1.5rem; }
.message-avatar { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; font-family:'Outfit';}
.avatar-user { background: #27272a; color: white;}
.avatar-ai { background: var(--g4-gold); color: black; }
.message-text { color: var(--text-primary); line-height: 1.6; font-size: 1rem; width: 100%; padding-top: 5px;}

/* Input Area Restyled (ChatGPT premium look) */
.input-container { padding: 1.5rem; display: flex; flex-direction: column; align-items: center; background: linear-gradient(0deg, var(--bg-main) 80%, transparent 100%); }
.input-box { width: 100%; max-width: 800px; display: flex; align-items: flex-end; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 20px; padding: 0.8rem; gap: 0.8rem; box-shadow: 0 10px 40px rgba(0,0,0,0.6); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);}
.input-box:focus-within { border-color: var(--g4-gold); box-shadow: 0 0 15px rgba(229, 180, 70, 0.15), 0 15px 40px rgba(0,0,0,0.7); transform: translateY(-2px); }
.input-box textarea { flex-grow: 1; background: transparent; border: none; color: var(--text-pure); font-size: 1rem; resize: none; outline: none; max-height: 200px; line-height: 1.5; padding: 8px 4px; }
.action-btn { background: transparent; border: none; color: var(--text-muted); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: 0.2s; flex-shrink: 0;}
.action-btn:hover { background: #27272a; color: var(--text-pure); }
.action-btn.send { background: var(--text-pure); color: black; }
.action-btn.send:hover { background: var(--g4-gold); }

/* Globais para Modulos */
.module-header { padding: 2rem; border-bottom: 1px solid var(--border-color); background: rgba(9, 9, 11, 0.9); backdrop-filter: blur(10px); display: flex; justify-content: space-between; align-items: center; z-index: 10; position: sticky; top:0;}
.module-header h2 { color: var(--text-pure); font-size: 1.5rem; margin-bottom: 0.3rem; font-family:'Outfit'; font-weight: 700; letter-spacing: -0.5px;}
.module-content { padding: 2rem; overflow-y: auto; height: calc(100vh - 90px); }

/* General Cards & Grid */
.base-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.base-card { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.base-card-title { font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; display: flex; align-items: center; justify-content: space-between;}
.base-card-value { font-size: 2.2rem; font-family: 'Outfit'; font-weight: 700; color: var(--text-pure); }

/* Chart Fix (BUG INFINITY FIX) */
.chart-wrapper { position: relative; width: 100%; height: 300px; }
.chart-box { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem;}
.chart-box h3 { font-size: 1rem; color: var(--text-pure); margin-bottom: 1rem; font-weight: 500;}

/* Automation n8n Style Interface */
.n8n-canvas { background-color: #0d0d12; background-image: radial-gradient(rgba(255,255,255,0.1) 1px, transparent 1px); background-size: 20px 20px; border-radius: 12px; border: 1px solid var(--border-color); padding: 3rem 2rem; min-height: 400px; display: flex; align-items: center; gap: 1.5rem; overflow-x: auto;}
.n8n-node { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 8px; width: 220px; box-shadow: 0 10px 20px rgba(0,0,0,0.4); flex-shrink: 0; position: relative;}
.node-header { padding: 0.8rem 1rem; display: flex; align-items: center; gap: 0.8rem; border-bottom: 1px solid var(--border-color); font-weight: 600; font-size: 0.85rem; border-top-left-radius: 8px; border-top-right-radius: 8px; }
.node-header.trigger { border-top: 3px solid #6366f1; }
.node-header.ai { border-top: 3px solid var(--g4-gold); }
.node-header.action { border-top: 3px solid #10b981; }
.node-body { padding: 1rem; font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.node-connector { display: flex; align-items: center; justify-content: center; color: var(--g4-gold); font-size: 1.5rem; }

/* Tables Premium */
.g4-table { width: 100%; border-collapse: collapse; margin-top: 1rem;}
.g4-table th { text-align: left; padding: 1rem; color: var(--text-muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; border-bottom: 1px solid var(--border-color); white-space: nowrap;}
.g4-table td { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 0.9rem; }
.g4-table tr:hover { background: rgba(255,255,255,0.02); }

/* Badges */
.badge { padding: 0.25rem 0.6rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;}
.bg-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.bg-success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.bg-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.bg-gold { background: var(--g4-gold-dim); color: var(--g4-gold); border: 1px solid rgba(229, 180, 70, 0.3); }

/* Buttons & Utils */
button { border: none; font-family: 'Inter'; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;}
.btn-primary { background: var(--text-pure); color: black; padding: 0.8rem 1.2rem; border-radius: 6px; font-weight: 600; font-size: 0.9rem;}
.btn-primary:hover { background: var(--text-primary); }
.btn-gold { background: var(--g4-gold); color: black; padding: 0.8rem 1.2rem; border-radius: 6px; font-weight: 600; font-size: 0.9rem;}
.btn-gold:hover { opacity: 0.9; }
.btn-secondary { background: transparent; color: var(--text-pure); border: 1px solid var(--border-color); padding: 0.8rem 1.2rem; border-radius: 6px; font-weight: 500; font-size: 0.9rem;}
.btn-secondary:hover { background: var(--bg-panel); }

/* Toasts */
#toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 9999; display: flex; flex-direction: column; gap: 1rem;}
.g4-toast { background: var(--bg-panel); border: 1px solid var(--g4-gold); color: white; padding: 1rem 1.5rem; border-radius: 8px; display: flex; align-items: center; gap: 1rem; box-shadow: 0 10px 30px rgba(0,0,0,0.5); font-size: 0.9rem; animation: slideIn 0.3s forwards;}
.g4-toast i { color: var(--g4-gold); font-size: 1.2rem;}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0;} to { transform: translateX(0); opacity: 1;} }
.g4-toast.fadeOut { animation: fadeOut 0.3s forwards;}
@keyframes fadeOut { to { transform: translateX(100%); opacity: 0;} }

/* Empty States & Specific Widgets */
.g4-report-box { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 12px; padding: 2rem; box-shadow: 0 10px 20px rgba(0,0,0,0.2); margin-top: 1rem;}
.assist-personas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; width: 100%; max-width: 800px; margin: 0 auto 2rem auto;}
.persona-card { background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; text-align: left; cursor: pointer; transition: 0.2s;}
.persona-card:hover { border-color: var(--g4-gold); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.4);}
.persona-card h5 { color: var(--text-pure); margin-bottom: 0.5rem;}
.persona-card p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4;}

/* Empty State centering */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; padding: 2rem; animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.empty-state h3 { font-family: 'Outfit'; font-size: 2.4rem; color: var(--text-pure); margin-bottom: 0.8rem; letter-spacing: -0.5px; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* Shimmer Effect */
.shimmer-text {
    background: linear-gradient(90deg, #fff 0%, #a1a1aa 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

/* PI Profiling Badges */
.pi-badge {
    font-size: 0.55rem; font-weight: 800; text-transform: uppercase;
    padding: 2px 5px; border-radius: 3px; letter-spacing: 0.5px;
    background: rgba(255,255,255,0.05); color: var(--text-muted);
}
.p-command { background: rgba(96,165,250,0.1); color: #93c5fd; border: 1px solid rgba(96,165,250,0.2); }
.p-influencer { background: rgba(249,115,22,0.1); color: #fdba74; border: 1px solid rgba(249,115,22,0.2); }
.p-scaler { background: rgba(16,185,129,0.1); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.2); }

/* Trinity DNA Tags */
.dna-tag {
    font-size: 0.65rem; font-weight: 700; padding: 6px 14px;
    background: rgba(229,180,70,0.05); color: var(--g4-gold);
    border: 1px solid rgba(229,180,70,0.15); border-radius: 20px;
    cursor: help; white-space: nowrap; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.dna-tag:hover { background: rgba(229,180,70,0.12); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(229,180,70,0.15); border-color: rgba(229,180,70,0.4); }

/* Ring Light Intensifier */
.tallis-ring { border: 2px solid rgba(37, 99, 235, 0.4) !important; box-shadow: 0 0 12px rgba(37, 99, 235, 0.2); }
.alfredo-ring { border: 2px solid rgba(234, 88, 12, 0.4) !important; box-shadow: 0 0 12px rgba(234, 88, 12, 0.2); }
.nardon-ring { border: 2px solid rgba(16, 185, 129, 0.4) !important; box-shadow: 0 0 12px rgba(16, 185, 129, 0.2); }

/* Neural Glow for Empty State */
.neural-glow {
    position: absolute; width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(229,180,70,0.15) 0%, transparent 70%);
    filter: blur(20px); animation: pulse 4s infinite;
}

/* Agent Pill Compact Refinement */
.agent-pill-compact {
    padding: 0.4rem 0.6rem; background: rgba(255,255,255,0.01); 
    border-radius: 8px; border: 1px solid transparent; 
    transition: 0.2s; display: flex; align-items: center; gap: 8px; cursor: default;
}
.agent-pill-compact:hover { background: rgba(255,255,255,0.03); }

.agent-photo-xs {
    width: 20px; height: 20px; border-radius: 50%; object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1); flex-shrink: 0;
}
.agent-avatar-xs {
    width: 20px; height: 20px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-size: 0.55rem;
    font-weight: 800; flex-shrink: 0; color: white;
}

/* Header subtitle refinement */
.header-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* MAS Engine Badge */
.mas-engine-badge {
    background: rgba(229,180,70,0.1);
    border: 1px solid rgba(229,180,70,0.2);
    padding: 2px 6px; border-radius: 4px;
    font-size: 0.6rem; color: var(--g4-gold); font-weight: 800;
    display: inline-block;
}

/* War Room Active Glow */
.board-panel.active {
    box-shadow: 0 0 40px rgba(229,180,70,0.08);
    border-color: rgba(229,180,70,0.2);
}

/* Sidebar nav animation on load */
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
.nav-item { animation: slideInLeft 0.3s ease; }

/* Pulsing badge */
.sync-pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Gold glow border for active modules */
.module-active-border { border-left: 3px solid var(--g4-gold); }

/* Section divider */
.section-divider { border: none; border-top: 1px solid var(--border-color); margin: 2.5rem 0; }

/* Modals & Form Styles */
.g4-modal-overlay { 
    position: fixed; inset: 0; background: rgba(0,0,0,0.85); 
    backdrop-filter: blur(8px); z-index: 1000; 
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: 0.3s;
}
.g4-modal-overlay.visible { opacity: 1; pointer-events: auto; }

.g4-modal { 
    background: var(--bg-panel); border: 1px solid var(--border-color);
    width: 100%; max-width: 550px; border-radius: 16px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
    transform: translateY(20px); transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.g4-modal-overlay.visible .g4-modal { transform: translateY(0); }

.g4-modal-header { 
    padding: 1.5rem; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.g4-modal-header h3 { font-family: 'Outfit'; font-size: 1.1rem; color: var(--text-pure); }
.close-modal { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; }

.g4-modal-body { padding: 1.5rem; }
.g4-modal-footer { padding: 1.2rem 1.5rem; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 1rem; }

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; font-weight: 600; text-transform: uppercase; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 0.8rem; background: var(--bg-input); 
    border: 1px solid var(--border-color); border-radius: 8px;
    color: var(--text-pure); font-family: 'Inter'; font-size: 0.9rem;
}
.form-group textarea { height: 100px; resize: none; }
.form-group input:focus, .form-group textarea:focus { border-color: var(--g4-gold); outline: none; }


/* Evidence Panel Styling */
.evidence-panel {
    position: fixed; top: 100px; right: -280px; width: 240px;
    background: rgba(9, 9, 11, 0.85); backdrop-filter: blur(10px);
    border: 1px solid rgba(229,180,70,0.2); border-right: none;
    border-radius: 12px 0 0 12px; z-index: 1001;
    transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.4);
}
.evidence-panel.active { right: 0; }
.evidence-header {
    background: rgba(229,180,70,0.1); padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.65rem; font-weight: 800; color: var(--g4-gold); text-transform: uppercase;
    display: flex; align-items: center; gap: 8px; border-radius: 12px 0 0 0;
}
.evidence-content { padding: 12px; font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; font-family: 'Inter'; }
.source-citation { color: var(--g4-gold); font-weight: 700; display: block; margin-bottom: 4px; font-size: 0.6rem; }

/* Voice UI Pulse */
.fa-microphone.voice-active { color: var(--danger); animation: voicePulse 1.5s infinite; }
@keyframes voicePulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: 0.5; } 100% { transform: scale(1); opacity: 1; } }
/* Divergence Glow for Board Panel */
.board-panel.divergence-active { 
    border-color: var(--danger); 
    box-shadow: inset 0 0 50px rgba(239, 68, 68, 0.1); 
    animation: divergenceSteady 2s ease-in-out infinite;
}
@keyframes divergenceSteady { 0%, 100% { border-color: rgba(239, 68, 68, 0.3); } 50% { border-color: var(--danger); } }

/* Confetti Particles (Basic CSS) */
.confetti {
    position: fixed; width: 10px; height: 10px; background: var(--g4-gold);
    z-index: 2000; pointer-events: none; border-radius: 2px;
    animation: confettiFall 3s linear forwards;
}
@keyframes confettiFall {
    to { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
/* Bento Grid Premium Layout */
.bento-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, auto); gap: 1rem;
    width: 100%; max-width: 1000px; margin: 2rem auto;
}
.bento-card {
    background: rgba(255, 255, 255, 0.015);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px; padding: 1.5rem;
    text-align: left; transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between;
}
.bento-card::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(229,180,70,0.1), transparent 60%);
    opacity: 0; transition: opacity 0.4s;
}
.bento-card:hover::after { opacity: 1; }
.bento-card:hover { 
    transform: translateY(-4px) scale(1.01); 
    border-color: rgba(229, 180, 70, 0.3);
    background: rgba(255, 255, 255, 0.025);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.bento-main { grid-column: span 2; grid-row: span 2; }
.bento-side { grid-column: span 2; }
.bento-mini { grid-column: span 1; }

.bento-card h4 { font-family: 'Outfit'; font-size: 1.1rem; color: var(--text-pure); margin-bottom: 0.5rem; }
.bento-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.bento-icon { font-size: 1.5rem; color: var(--g4-gold); margin-bottom: 1rem; }
/* ==================================================== */
/* TRINITY PROTOCOL: DEEP DIVE OVERLAY STYLES */
/* ==================================================== */
.protocol-overlay {
    position: fixed; inset: 0; background: rgba(5,5,5,0.98); 
    backdrop-filter: blur(25px); z-index: 2000;
    display: none; flex-direction: column; padding: 2rem;
    opacity: 0; transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.protocol-overlay.active { display: flex; opacity: 1; }

.protocol-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(229,180,70,0.2); padding: 1.5rem 2rem;
    position: absolute; top: 0; left: 0; right: 0; background: rgba(5,5,5,0.4);
    backdrop-filter: blur(10px); z-index: 10;
}
.protocol-badge {
    background: var(--g4-gold-dim); border: 1px solid var(--g4-gold); color: #fff;
    padding: 6px 14px; border-radius: 4px; font-size: 0.7rem; font-weight: 800; letter-spacing: 2px;
}
.close-protocol {
    background: rgba(229,180,70,0.1); color: var(--g4-gold); border: 1px solid var(--g4-gold);
    padding: 8px 16px; border-radius: 6px; font-size: 0.75rem; font-weight: 700;
    letter-spacing: 1px; transition: 0.3s; cursor: pointer;
}
.close-protocol:hover { background: var(--g4-gold); color: #000; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(229,180,70,0.3); }

.protocol-layout {
    display: grid; grid-template-columns: 1fr 1.5fr; gap: 4rem; flex-grow: 1; align-items: center;
}

.protocol-info h1 { font-size: 4.5rem; font-family: 'Outfit'; margin-bottom: 0.5rem; }
.protocol-tagline { color: var(--g4-gold); font-weight: 700; text-transform: uppercase; letter-spacing: 4px; font-size: 0.75rem; margin-bottom: 3rem; }

.protocol-narrator {
    background: rgba(229,180,70,0.03); border-left: 2px solid var(--g4-gold);
    padding: 1.5rem; font-size: 1.1rem; color: var(--text-primary); line-height: 1.6;
    min-height: 160px; margin-bottom: 3rem; font-family: 'Inter';
    text-shadow: 0 0 10px rgba(229,180,70,0.2);
}

.architecture-map {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; position: relative;
    max-width: 400px;
}
.map-node {
    background: rgba(255,255,255,0.03); border: 1px solid var(--border-color);
    padding: 1rem; border-radius: 12px; font-size: 0.85rem; font-weight: 600;
    transition: 0.4s; position: relative;
}
.map-node.active { background: var(--g4-gold-dim); border-color: var(--g4-gold); color: var(--g4-gold); box-shadow: 0 0 20px rgba(229,180,70,0.1); }
.core-node {
    grid-column: span 2; background: var(--bg-panel); border: 2px solid var(--g4-gold);
    color: var(--g4-gold); padding: 1.2rem; border-radius: 12px; text-align: center;
    font-weight: 800; letter-spacing: 2px; margin-top: 1rem; position: relative;
    box-shadow: 0 0 30px rgba(229,180,70,0.2);
}

/* Visualization Canvas */
.protocol-viz {
    display: flex; flex-direction: column; gap: 2rem; height: 100%; justify-content: center;
}
.viz-canvas {
    aspect-ratio: 1; background: radial-gradient(circle at center, rgba(229,180,70,0.05) 0%, transparent 70%);
    position: relative; border: 1px solid rgba(229,180,70,0.1); border-radius: 50%;
}
#synapseSVG { width: 100%; height: 100%; }

.simulation-stage-tags {
    position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 1rem;
}
.simulation-stage-tags span {
    font-size: 0.6rem; font-weight: 800; color: var(--text-muted); opacity: 0.3; transition: 0.4s;
}
.simulation-stage-tags span.active { color: var(--g4-gold); opacity: 1; text-shadow: 0 0 10px var(--g4-gold); }

.agent-dossiers { display: flex; gap: 1rem; justify-content: center; }
.dossier-card {
    background: rgba(255,255,255,0.02); border: 1px solid var(--border-color);
    padding: 0.8rem; border-radius: 12px; display: flex; align-items: center; gap: 12px;
    width: 200px; opacity: 0.4; transition: 0.4s; filter: grayscale(1);
}
.dossier-card.active { opacity: 1; filter: none; border-color: var(--g4-gold); background: rgba(229,180,70,0.08); transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.dossier-card.thinking { border-color: #fff; animation: thinkingPulse 1.5s infinite; background: rgba(229,180,70,0.15); }

@keyframes thinkingPulse {
    0% { transform: translateY(-5px) scale(1); box-shadow: 0 10px 30px rgba(229,180,70,0.2); }
    50% { transform: translateY(-5px) scale(1.03); box-shadow: 0 10px 40px rgba(229,180,70,0.4); }
    100% { transform: translateY(-5px) scale(1); box-shadow: 0 10px 30px rgba(229,180,70,0.2); }
}

.dossier-meta h6 { font-size: 0.85rem; color: #fff; margin-bottom: 2px; font-weight: 800; }
.dossier-meta p { font-size: 0.65rem; color: #E5B446; font-weight: 800; letter-spacing: 0.8px; opacity: 1; text-shadow: 0 0 5px rgba(0,0,0,0.5); }

#protocolCanvas {
    position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.3;
}

/* Neural Line Animations */
@keyframes dashLine { to { stroke-dashoffset: 0; } }
.neural-line {
    fill: none; stroke: var(--g4-gold); stroke-width: 1.5; stroke-dasharray: 1000; stroke-dashoffset: 1000;
    opacity: 0; transition: opacity 0.5s;
}
.neural-line.active { opacity: 0.6; animation: dashLine 2s forwards ease-out; }
.neural-line.conflict { stroke: var(--danger); stroke-width: 2; opacity: 1; }
.neural-pulse-dot { fill: var(--g4-gold); }

/* ==================================================== */
/* DNA PROTOCOL: ADAPTIVE INTELLIGENCE STYLES */
/* ==================================================== */
.dna-overlay {
    position: fixed; inset: 0; background: rgba(2, 6, 23, 0.98); 
    backdrop-filter: blur(25px); z-index: 2000;
    display: none; flex-direction: column; padding: 2rem;
    opacity: 0; transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.dna-overlay.active { display: flex; opacity: 1; }

.protocol-badge.dna {
    background: rgba(16, 185, 129, 0.1); border: 1px solid #10b981; color: #10b981;
}

.cyan-shimmer-text {
    background: linear-gradient(90deg, #22d3ee 0%, #10b981 50%, #22d3ee 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 6s linear infinite;
    font-size: 4.5rem; font-family: 'Outfit'; margin-bottom: 0.5rem;
}

.dna-tagline { color: #22d3ee; font-weight: 700; text-transform: uppercase; letter-spacing: 4px; font-size: 0.75rem; margin-bottom: 3rem; }

.dna-narrator {
    background: rgba(16, 185, 129, 0.03); border-left: 2px solid #10b981;
    padding: 1.5rem; font-size: 1.1rem; color: var(--text-primary); line-height: 1.6;
    min-height: 160px; margin-bottom: 3rem;
}

/* Radar & Viz */
.dna-viz { display: flex; flex-direction: column; gap: 2rem; align-items: center; }
.radar-container {
    width: 400px; height: 400px; position: relative;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
}
.radar-labels span {
    position: absolute; font-size: 0.65rem; font-weight: 800; color: #64748b; letter-spacing: 1px;
}
.label-top { top: 0; left: 50%; transform: translateX(-50%); }
.label-right { right: 0; top: 50%; transform: translateY(-50%); }
.label-bottom { bottom: 0; left: 50%; transform: translateX(-50%); }
.label-left { left: 0; top: 50%; transform: translateY(-50%); }

.dna-attributes { width: 100%; max-width: 300px; display: flex; flex-direction: column; gap: 1rem; }
.dna-attr-row label { font-size: 0.55rem; font-weight: 800; color: #64748b; margin-bottom: 4px; display: block; }
.dna-attr-bar { height: 4px; background: rgba(255,255,255,0.05); border-radius: 2px; overflow: hidden; }
.dna-attr-fill { height: 100%; background: linear-gradient(90deg, #10b981, #22d3ee); transition: width 1s cubic-bezier(0.16, 1, 0.3, 1); }

/* Adaptation Cards */
.adaptation-grid { display: flex; gap: 1rem; }
.adapt-card {
    background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05);
    padding: 0.8rem; border-radius: 12px; display: flex; align-items: center; gap: 12px;
    width: 200px; transition: 0.4s;
}
.adapt-card h6 { font-size: 0.8rem; color: #fff; margin-bottom: 2px; }
.adapt-status span { font-size: 0.6rem; color: #10b981; font-weight: 800; letter-spacing: 0.5px; }

#dnaHelixCanvas {
    position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.2;
}

/* Radar SVG Elements */
.radar-axis { stroke: rgba(255,255,255,0.1); stroke-width: 1; }
.radar-grid { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 1; }
.radar-poly { fill: rgba(16, 185, 129, 0.2); stroke: #10b981; stroke-width: 2; transition: all 1s; }

/* ==================================================== */
/* AGENT DOSSIERS: HERO SHOWCASE STYLES */
/* ==================================================== */
.dossier-overlay {
    position: fixed; inset: 0; background: rgba(5,5,5,0.98); 
    backdrop-filter: blur(30px); z-index: 2000;
    display: none; flex-direction: column; padding: 0;
    opacity: 0; transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
.dossier-overlay.active { display: flex; opacity: 1; }

/* Hero Background & Mask */
.dossier-hero-bg {
    position: absolute; right: 0; top: 0; height: 100vh; width: 60%;
    object-fit: cover; object-position: right bottom; z-index: 0;
    opacity: 0.85; mix-blend-mode: luminosity; transition: 1s;
}
.dossier-overlay.active .dossier-hero-bg { mix-blend-mode: normal; }

.dossier-hero-fade {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(to right, rgba(5,5,5,1) 0%, rgba(5,5,5,0.9) 40%, transparent 100%),
                linear-gradient(to top, rgba(5,5,5,1) 0%, transparent 20%);
}

/* Agent Specific Themes */
.dossier-overlay.theme-tallis { --dossier-accent: #3b82f6; }
.dossier-overlay.theme-alfredo { --dossier-accent: #f97316; }
.dossier-overlay.theme-nardon { --dossier-accent: #10b981; }

.dossier-overlay .protocol-header { z-index: 100; padding: 2rem 4rem; border-bottom: none; }
.dossier-overlay .protocol-badge {
    background: rgba(var(--dossier-accent), 0.1); border: 1px solid var(--dossier-accent); color: var(--dossier-accent);
}

.dossier-split {
    z-index: 10; padding: 4rem; display: grid; grid-template-columns: 1.2fr 1fr; height: 100%; align-items: center;
}
.hero-spacer { pointer-events: none; } /* Empty space for image */

/* Left HUD Styles */
.dossier-hud { max-width: 600px; }

.dossier-overlay .shimmer-text {
    background: linear-gradient(90deg, #fff 0%, var(--dossier-accent) 50%, #fff 100%);
    background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    animation: shimmer 6s linear infinite; font-size: 5rem; line-height: 1; margin-bottom: 0px;
}

.dossier-traits-row { display: flex; gap: 2rem; margin-bottom: 3rem; margin-top: 2rem; }
.dossier-trait-box {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1);
    padding: 1rem; border-radius: 8px; flex: 1; border-left: 3px solid var(--dossier-accent);
}
.dossier-trait-box label { font-size: 0.6rem; font-weight: 800; color: #888; letter-spacing: 2px; display: block; margin-bottom: 4px; }
.dossier-trait-box span { font-size: 1rem; font-weight: 700; color: #fff; text-transform: uppercase; }

.dossier-narrator { border-left-color: var(--dossier-accent); margin-bottom: 2rem; min-height: 120px; }

.framework-title { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 2px; margin-bottom: 1rem; }
.map-column { display: flex; flex-direction: column; gap: 0.5rem; }
.map-column .map-node { padding: 0.8rem 1rem; }
.map-column .map-node.active { background: rgba(var(--dossier-accent), 0.1); border-color: var(--dossier-accent); color: var(--dossier-accent); box-shadow: none; }

#dossierCanvas {
    position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.1;
}

