/* ═══════════════════════════════════════════════════════════
   JARVIS COCKPIT v5.0 — ULTRA · IRON MAN MARK L
   2026 Design System · Glassmorphism · Holographic HUD
═══════════════════════════════════════════════════════════ */

:root {
  --bg:         #010408;
  --bg2:        #040a10;
  --cyan:       #00e4ff;
  --cyan2:      #00b8d4;
  --green:      #00ff88;
  --purple:     #a78bfa;
  --fire:       #ff6a00;
  --amber:      #ffb84e;
  --red:        #ff4466;
  --white:      #e8f4ff;
  --dim:        #1a2a38;
  --text:       #f0f8ff;
  --text-mid:   #b8d4e8;
  --text-dim:   #7aa0bc;

  --glass:          rgba(0,228,255,0.03);
  --glass-border:   rgba(0,228,255,0.10);
  --glass-strong:   rgba(0,228,255,0.06);

  --glow-c:  0 0 20px rgba(0,228,255,0.25);
  --glow-c2: 0 0 40px rgba(0,228,255,0.15);
  --glow-p:  0 0 20px rgba(167,139,250,0.3);
  --glow-g:  0 0 20px rgba(0,255,136,0.3);

  --font-mono: 'JetBrains Mono', monospace;
  --font-orb:  'Orbitron', sans-serif;
  --font-ui:   'Inter', sans-serif;
  --ease:      cubic-bezier(0.4,0,0.2,1);
  --t:         all 0.25s var(--ease);

  --nav-h: 50px;
  --left-w: 190px;
  --right-w: 230px;
}

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

html, body {
  height: 100dvh;
  max-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  overflow: hidden;
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,228,255,0.15); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,228,255,0.3); }

/* ═══ AMBIENT BACKGROUND ═══ */
.bg-hex {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='104'%3E%3Cpath d='M30 2L2 18v34l28 16 28-16V18L30 2zM30 2' fill='none' stroke='rgba(0,228,255,0.035)' stroke-width='0.8'/%3E%3Cpath d='M2 52l28 16M58 52L30 68M30 68v36' fill='none' stroke='rgba(0,228,255,0.025)' stroke-width='0.8'/%3E%3C/svg%3E");
  background-size: 60px 104px;
}

.bg-scanlines {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.04) 2px,
    rgba(0,0,0,0.04) 4px
  );
}

.bg-glow-tl {
  position: fixed; top: -200px; left: -200px;
  width: 600px; height: 600px; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(0,100,180,0.06) 0%, transparent 70%);
}
.bg-glow-br {
  position: fixed; bottom: -200px; right: -200px;
  width: 500px; height: 500px; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(167,139,250,0.05) 0%, transparent 70%);
}

/* ═══ NAVBAR ═══ */
.navbar {
  position: relative; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h); padding: 0 20px;
  background: rgba(1,4,8,0.96);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}

.navbar-left { display: flex; align-items: center; gap: 14px; }

.nav-orb-wrap { position: relative; width: 16px; height: 16px; }
.nav-orb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan), 0 0 24px rgba(0,228,255,0.4);
  animation: orb-beat 2.5s ease-in-out infinite;
  position: absolute; top: 1px; left: 1px;
}
.nav-orb-ring {
  position: absolute; inset: -3px;
  border-radius: 50%; border: 1px solid rgba(0,228,255,0.3);
  animation: orb-ring 2.5s ease-in-out infinite;
}
@keyframes orb-beat {
  0%,100% { box-shadow: 0 0 10px var(--cyan); }
  50% { box-shadow: 0 0 20px var(--cyan), 0 0 40px rgba(0,228,255,0.3); }
}
@keyframes orb-ring {
  0%,100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.navbar-title {
  font-family: var(--font-orb);
  font-size: 15px; font-weight: 700;
  letter-spacing: 5px;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255,215,0,0.6), 0 0 40px rgba(255,180,0,0.3);
}
.navbar-sub {
  font-family: var(--font-mono);
  font-size: 9px; color: var(--text-mid);
  letter-spacing: 2px; padding: 2px 6px;
  border: 1px solid rgba(184,212,232,0.25);
  border-radius: 3px;
}

.navbar-tabs { display: flex; gap: 2px; }
.tab-btn {
  background: transparent; border: none;
  color: var(--text-mid);
  font-family: var(--font-mono); font-size: 11px;
  padding: 8px 18px; cursor: pointer;
  letter-spacing: 1px; text-transform: uppercase;
  border-bottom: 2px solid transparent;
  transition: var(--t); display: flex; align-items: center; gap: 6px;
}
.tab-icon { font-size: 10px; opacity: 0.6; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  text-shadow: 0 0 10px rgba(0,228,255,0.4);
}
.tab-btn.active .tab-icon { opacity: 1; }

.navbar-right { display: flex; align-items: center; gap: 14px; }

/* Conclave Always-On indicator */
.conclave-indicator {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid rgba(167,139,250,0.3);
  background: rgba(167,139,250,0.06);
}
.conclave-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 8px var(--purple);
  animation: c-beat 1.5s ease-in-out infinite;
}
@keyframes c-beat {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}
.conclave-label {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--purple); letter-spacing: 2px;
}

/* Lang toggle */
.lang-toggle {
  display: flex; gap: 2px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(0,228,255,0.12);
  border-radius: 6px; padding: 2px;
}
.lang-btn {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 1px; padding: 3px 10px; border-radius: 4px;
  color: var(--text-mid); transition: var(--t);
}
.lang-btn.active { background: rgba(0,228,255,0.15); color: var(--cyan); }
.lang-btn:hover:not(.active) { color: var(--text); }
#lang-br.active { background: rgba(255,184,78,0.15); color: var(--amber); }

.clock-wrap {
  border-left: 1px solid var(--glass-border);
  padding-left: 14px;
}
.clock {
  font-family: var(--font-orb);
  font-size: 12px; color: var(--text); letter-spacing: 2px;
}

/* ═══ TAB PANELS ═══ */
.tab-panel {
  display: none;
  height: calc(100dvh - var(--nav-h));
  position: relative; z-index: 1;
}
.tab-panel.active { display: flex; flex-direction: column; }

/* ═══════════════════════════════════════════
   COCKPIT GRID LAYOUT
═══════════════════════════════════════════ */
.cockpit-grid {
  display: flex;
  height: 100%;
  gap: 0;
}

/* ═══ SIDEBAR BASE ═══ */
.agents-sidebar, .metrics-sidebar {
  flex-shrink: 0;
  display: flex; flex-direction: column;
  padding: 14px 10px;
  overflow-y: auto;
  background: rgba(1,4,8,0.7);
  border-color: var(--glass-border);
  gap: 2px;
}
.agents-sidebar {
  width: var(--left-w);
  border-right: 1px solid var(--glass-border);
}
.metrics-sidebar {
  width: var(--right-w);
  border-left: 1px solid var(--glass-border);
}

.sidebar-label {
  font-family: var(--font-mono);
  font-size: 8px; color: var(--cyan);
  letter-spacing: 3px; text-transform: uppercase;
  padding: 4px 6px 8px;
  border-bottom: 1px solid rgba(0,228,255,0.1);
  margin-bottom: 6px;
  opacity: 0.7;
}
.sidebar-divider {
  height: 1px; background: rgba(0,228,255,0.06);
  margin: 8px 0;
}

/* ═══ AGENT GROUPS ═══ */
.agent-group { margin-bottom: 8px; }

.group-header {
  font-family: var(--font-mono);
  font-size: 8px; letter-spacing: 2px;
  color: var(--text-dim); text-transform: uppercase;
  display: flex; align-items: center; gap: 5px;
  padding: 4px 6px; margin-bottom: 3px;
}
.group-dot {
  width: 5px; height: 5px; border-radius: 50%;
}
.dot-cyan   { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.dot-purple { background: var(--purple); box-shadow: 0 0 6px var(--purple); }
.dot-green  { background: var(--green); box-shadow: 0 0 6px var(--green); }

/* AGENT CHIPS (sidebar vertical) */
.agent-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 6px; cursor: default;
  border: 1px solid transparent;
  transition: var(--t); margin-bottom: 2px;
  background: transparent;
}
.agent-chip:hover { background: rgba(0,228,255,0.04); }

.agent-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-dim); flex-shrink: 0;
  transition: var(--t);
}
.agent-name {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-mid); flex: 1; letter-spacing: 0.3px;
}
.agent-badge {
  font-family: var(--font-mono); font-size: 7px;
  color: var(--text-dim); letter-spacing: 0.5px;
  padding: 1px 4px; border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.06);
}

/* Model-specific chip styles */
.model-opus .agent-dot   { background: var(--cyan); box-shadow: 0 0 4px var(--cyan); }
.model-sonnet .agent-dot { background: var(--purple); box-shadow: 0 0 4px var(--purple); }
.model-haiku .agent-dot  { background: var(--green); box-shadow: 0 0 4px var(--green); }

.model-opus:hover, .model-opus.active-agent {
  border-color: rgba(0,228,255,0.25);
  background: rgba(0,228,255,0.06);
}
.model-opus:hover .agent-name,
.model-opus.active-agent .agent-name { color: var(--cyan); }

.model-sonnet:hover, .model-sonnet.active-agent {
  border-color: rgba(167,139,250,0.3);
  background: rgba(167,139,250,0.06);
}
.model-sonnet:hover .agent-name,
.model-sonnet.active-agent .agent-name { color: var(--purple); }

.model-haiku:hover, .model-haiku.active-agent {
  border-color: rgba(0,255,136,0.25);
  background: rgba(0,255,136,0.05);
}
.model-haiku:hover .agent-name,
.model-haiku.active-agent .agent-name { color: var(--green); }

/* CONCLAVE BLOCK */
.conclave-block {
  margin-top: auto; padding-top: 10px;
  border-top: 1px solid rgba(167,139,250,0.15);
}
.conclave-header {
  font-family: var(--font-mono); font-size: 8px;
  color: var(--purple); letter-spacing: 2px;
  text-transform: uppercase; padding: 4px 6px 6px;
  display: flex; align-items: center; gap: 6px;
}
.conclave-pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 8px var(--purple);
  animation: c-beat 1.5s ease-in-out infinite;
}
.conclave-agents { margin-bottom: 4px; }
.mega-chip {
  border-color: rgba(167,139,250,0.25) !important;
  background: rgba(167,139,250,0.06) !important;
}
.mega-chip .agent-name { color: var(--purple) !important; font-weight: 500; }
.dot-mega { background: var(--purple) !important; box-shadow: 0 0 6px var(--purple) !important; }
.badge-always {
  background: rgba(167,139,250,0.15);
  border-color: rgba(167,139,250,0.3) !important;
  color: var(--purple) !important; font-size: 7px;
  animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.6; }
}
/* CONCLAVE TOGGLE SWITCH */
.conclave-toggle {
  position: relative; display: inline-block;
  width: 28px; height: 15px; margin-left: auto; flex-shrink: 0; cursor: pointer;
}
.conclave-toggle input { opacity: 0; width: 0; height: 0; }
.conclave-slider {
  position: absolute; inset: 0; border-radius: 15px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(167,139,250,0.3);
  transition: background 0.3s, border-color 0.3s;
}
.conclave-slider::before {
  content: ''; position: absolute;
  width: 9px; height: 9px; border-radius: 50%;
  left: 2px; bottom: 2px;
  background: rgba(167,139,250,0.4);
  transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
}
.conclave-toggle input:checked + .conclave-slider {
  background: rgba(167,139,250,0.2);
  border-color: rgba(167,139,250,0.6);
}
.conclave-toggle input:checked + .conclave-slider::before {
  transform: translateX(13px);
  background: var(--purple);
  box-shadow: 0 0 6px var(--purple);
}
.conclave-off .agent-dot { opacity: 0.3 !important; box-shadow: none !important; animation: none !important; }
.conclave-off .agent-name { opacity: 0.5; }
.conclave-desc {
  font-family: var(--font-mono); font-size: 8px;
  color: var(--text-mid); padding: 0 6px 4px;
  line-height: 1.6;
}

/* ═══ CENTER COLUMN ═══ */
.center-col {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
}

/* ═══ REACTOR SECTION ═══ */
.reactor-section {
  flex-shrink: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 18px 0 12px;
  position: relative;
  height: 290px;
}

.reactor-scanbeam {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0,228,255,0.015) 50%,
    transparent 100%
  );
  animation: scanbeam 4s ease-in-out infinite;
}
@keyframes scanbeam {
  0%,100% { opacity: 0; transform: translateY(-20px); }
  50% { opacity: 1; transform: translateY(20px); }
}

/* AVATAR / ARC REACTOR */
.avatar-container {
  position: relative;
  width: 240px; height: 240px;
  display: flex; align-items: center; justify-content: center;
}

/* HUD corner arcs */
.hud-arc {
  position: absolute;
  width: 30px; height: 30px;
  border-color: rgba(0,228,255,0.3);
  border-style: solid;
}
.hud-arc-tl { top:  0; left:  0; border-width: 2px 0 0 2px; border-radius: 4px 0 0 0; }
.hud-arc-tr { top:  0; right: 0; border-width: 2px 2px 0 0; border-radius: 0 4px 0 0; }
.hud-arc-bl { bottom: 0; left:  0; border-width: 0 0 2px 2px; border-radius: 0 0 0 4px; }
.hud-arc-br { bottom: 0; right: 0; border-width: 0 2px 2px 0; border-radius: 0 0 4px 0; }

.hud-line {
  position: absolute; left: -60px; right: -60px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,228,255,0.15), transparent);
}
.hud-line-top    { top: -10px; }
.hud-line-bottom { bottom: -10px; }

/* Rings */
.ring {
  position: absolute; border-radius: 50%;
  border: 1px solid transparent;
}
.ring-1 {
  width: 230px; height: 230px;
  border-color: rgba(0,228,255,0.14);
  border-top-color: var(--cyan);
  border-left-color: rgba(0,228,255,0.35);
  animation: spin 9s linear infinite;
}
.ring-2 {
  width: 188px; height: 188px;
  border-color: rgba(0,228,255,0.08);
  border-right-color: rgba(0,228,255,0.45);
  border-bottom-color: rgba(0,228,255,0.2);
  animation: spin 13s linear infinite reverse;
}
.ring-3 {
  width: 148px; height: 148px;
  border-color: rgba(167,139,250,0.1);
  border-top-color: rgba(167,139,250,0.5);
  animation: spin 7s linear infinite;
}
.ring-4 {
  width: 114px; height: 114px;
  border-color: rgba(0,228,255,0.06);
  border-bottom-color: rgba(0,228,255,0.5);
  animation: spin 5s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Tick marks on outer ring */
.ring-ticks {
  position: absolute;
  width: 230px; height: 230px;
  animation: spin 9s linear infinite;
}
.tick {
  position: absolute;
  width: 2px; height: 8px;
  background: rgba(0,228,255,0.4);
  top: 0; left: 50%;
  transform-origin: 1px 115px;
  transform: rotate(calc(var(--i) * 30deg));
}
.tick:nth-child(3n) { background: var(--cyan); height: 12px; }

/* Core reactor */
.avatar-arc {
  position: relative; z-index: 5;
  width: 88px; height: 88px; border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255,255,255,0.95) 0%,
    var(--cyan) 25%,
    rgba(0,228,255,0.5) 45%,
    rgba(0,228,255,0.1) 65%,
    transparent 80%
  );
  box-shadow:
    0 0 30px var(--cyan),
    0 0 60px rgba(0,228,255,0.4),
    0 0 100px rgba(0,228,255,0.15),
    inset 0 0 20px rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  animation: reactor-beat 3s ease-in-out infinite;
}
@keyframes reactor-beat {
  0%,100% { box-shadow: 0 0 30px var(--cyan), 0 0 60px rgba(0,228,255,0.3), 0 0 100px rgba(0,228,255,0.1); }
  50%      { box-shadow: 0 0 50px var(--cyan), 0 0 90px rgba(0,228,255,0.5), 0 0 140px rgba(0,228,255,0.2); }
}

.arc-hex {
  position: absolute; width: 44px; height: 44px; opacity: 0.4;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Cpolygon points='22,2 40,12 40,32 22,42 4,32 4,12' fill='none' stroke='rgba(0,228,255,0.8)' stroke-width='1'/%3E%3Cpolygon points='22,10 34,16 34,28 22,34 10,28 10,16' fill='none' stroke='rgba(0,228,255,0.5)' stroke-width='0.8'/%3E%3C/svg%3E");
  animation: spin 12s linear infinite;
}

.arc-core {
  width: 26px; height: 26px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle, #fff 0%, rgba(200,240,255,0.9) 60%, transparent 100%);
  box-shadow: 0 0 16px #fff, 0 0 30px var(--cyan);
}

/* Pulse waves */
.arc-pulse {
  position: absolute; border-radius: 50%;
  border: 1.5px solid rgba(0,228,255,0.35);
  animation: pulse-out 3s ease-out infinite;
}
.pulse-1 { width: 88px; height: 88px; }
.pulse-2 { width: 88px; height: 88px; animation-delay: 1.5s; }
@keyframes pulse-out {
  0%   { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(3.2); opacity: 0; }
}

/* Reactor status */
.reactor-meta {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-top: 14px;
}
.avatar-status {
  font-family: var(--font-orb);
  font-size: 9px; letter-spacing: 5px;
  color: var(--text-mid); text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0,228,255,0.2);
}
.reactor-indicators { display: flex; gap: 5px; }
.ri-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-dim); transition: var(--t);
}
.ri-dot.active { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }

/* ═══ AVATAR STATES ═══ */
.avatar-container.listening .avatar-arc {
  box-shadow: 0 0 60px var(--green), 0 0 100px rgba(0,255,136,0.4);
  background: radial-gradient(circle, #fff 0%, var(--green) 25%, rgba(0,255,136,0.3) 60%, transparent 80%);
  animation: reactor-beat-listen 0.8s ease-in-out infinite;
}
@keyframes reactor-beat-listen {
  0%,100% { box-shadow: 0 0 50px var(--green), 0 0 80px rgba(0,255,136,0.3); }
  50%      { box-shadow: 0 0 80px var(--green), 0 0 120px rgba(0,255,136,0.5); }
}
.avatar-container.listening .ring-1 { animation-duration: 3s; border-top-color: var(--green); }
.avatar-container.listening .ring-2 { animation-duration: 4s; border-right-color: var(--green); }

.avatar-container.thinking .avatar-arc {
  background: radial-gradient(circle, #fff 0%, var(--amber) 25%, rgba(255,184,78,0.3) 60%, transparent 80%);
  box-shadow: 0 0 50px var(--amber), 0 0 100px rgba(255,184,78,0.3);
  animation: reactor-beat-think 0.5s ease-in-out infinite;
}
@keyframes reactor-beat-think {
  0%,100% { box-shadow: 0 0 50px var(--amber); }
  50%      { box-shadow: 0 0 80px var(--amber), 0 0 120px rgba(255,184,78,0.4); }
}
.avatar-container.thinking .ring-1 { animation-duration: 2s; }
.avatar-container.thinking .ring-2 { animation-duration: 2.5s; }
.avatar-container.thinking .ring-3 { animation-duration: 1.5s; }
.avatar-container.thinking .ring-4 { animation-duration: 1.2s; }

.avatar-container.speaking .avatar-arc {
  background: radial-gradient(circle, #fff 0%, var(--fire) 25%, rgba(255,106,0,0.3) 60%, transparent 80%);
  box-shadow: 0 0 50px var(--fire), 0 0 100px rgba(255,106,0,0.4);
  animation: reactor-beat-speak 0.4s ease-in-out infinite;
}
@keyframes reactor-beat-speak {
  0%,100% { box-shadow: 0 0 40px var(--fire); }
  50%      { box-shadow: 0 0 80px var(--fire), 0 0 120px rgba(255,106,0,0.4); }
}

/* ═══ TERMINAL ═══ */
.terminal {
  flex: 1; min-height: 0;
  margin: 0 14px 4px;
  display: flex; flex-direction: column;
  background: rgba(1,4,8,0.9);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,228,255,0.04);
}

.terminal-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: rgba(0,228,255,0.03);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.ttb-dots { display: flex; gap: 5px; }
.ttb-dot {
  width: 9px; height: 9px; border-radius: 50%;
}
.ttb-r { background: #ff5f57; }
.ttb-y { background: #febc2e; }
.ttb-g { background: #28c840; }

.ttb-title {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--text-mid); letter-spacing: 2px;
  text-transform: uppercase; flex: 1;
}
.ttb-right { display: flex; align-items: center; }
.ttb-badge {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--text-mid); letter-spacing: 1px;
  padding: 2px 6px; border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.1);
}

.terminal-output {
  flex: 1; overflow-y: auto;
  padding: 12px 16px;
  font-family: var(--font-mono); font-size: 12.5px;
  line-height: 1.65;
}

.terminal-line {
  margin-bottom: 5px;
  animation: line-in 0.2s ease;
  display: flex; gap: 8px; align-items: baseline;
}
@keyframes line-in {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}

.terminal-line .ts {
  color: var(--text-dim); font-size: 9px;
  flex-shrink: 0; padding-top: 2px;
  opacity: 0.85;
}
.terminal-line .msg { color: var(--text); word-break: break-word; flex: 1; }
.terminal-line.user-line   .msg { color: var(--green); }
.terminal-line.system-line .msg { color: var(--purple); }
.terminal-line.error-line  .msg { color: var(--red); }
.terminal-line.warn-line   .msg { color: var(--amber); }
.terminal-line.info-line   .msg { color: var(--cyan); }
.terminal-line.file-line   .msg { color: var(--green); }
.terminal-line.jarvis-line .msg { color: var(--white); }

/* Markdown in terminal */
.msg h1,.msg h2,.msg h3 {
  color: var(--cyan); margin: 10px 0 5px;
  font-family: var(--font-orb); font-size: 13px; letter-spacing: 1px;
}
.msg code {
  background: rgba(0,228,255,0.07); padding: 1px 5px;
  border-radius: 3px; font-family: var(--font-mono);
  font-size: 11.5px; color: var(--amber);
}
.msg pre {
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--glass-border);
  border-radius: 8px; padding: 12px 14px;
  margin: 8px 0; overflow-x: auto; position: relative;
}
.msg pre code { background: transparent; padding: 0; color: var(--text); font-size: 12px; }
.msg a { color: var(--cyan); text-decoration: none; }
.msg a:hover { text-decoration: underline; }
.msg ul,.msg ol { padding-left: 18px; margin: 4px 0; }
.msg li { margin-bottom: 2px; }
.msg blockquote {
  border-left: 3px solid var(--cyan);
  padding-left: 12px; margin: 6px 0;
  color: var(--text-mid);
}
.msg table {
  border-collapse: collapse; width: 100%; margin: 8px 0;
  font-size: 11px;
}
.msg th {
  background: rgba(0,228,255,0.08);
  color: var(--cyan); padding: 6px 10px;
  border: 1px solid rgba(0,228,255,0.12);
  font-size: 10px; letter-spacing: 1px;
}
.msg td {
  padding: 5px 10px; border: 1px solid rgba(255,255,255,0.05);
  color: var(--text);
}
.msg tr:nth-child(even) td { background: rgba(0,228,255,0.02); }

/* Copy button */
.code-copy-btn {
  position: absolute; top: 7px; right: 8px;
  background: rgba(0,228,255,0.08);
  border: 1px solid rgba(0,228,255,0.15);
  color: var(--text-mid); font-family: var(--font-mono);
  font-size: 9px; padding: 3px 8px; border-radius: 4px;
  cursor: pointer; transition: var(--t);
}
.code-copy-btn:hover { background: rgba(0,228,255,0.18); color: var(--cyan); }

/* Download card */
.download-card {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(0,255,136,0.04);
  border: 1px solid rgba(0,255,136,0.2);
  border-radius: 8px; padding: 8px 14px; margin: 6px 0;
}
.download-card .file-icon { color: var(--green); font-size: 16px; }
.download-card .file-name { color: var(--green); font-family: var(--font-mono); font-size: 11px; }
.download-card .file-size { color: var(--text-dim); font-size: 9px; }
.download-card .dl-btn {
  background: rgba(0,255,136,0.1);
  border: 1px solid rgba(0,255,136,0.25);
  color: var(--green); font-family: var(--font-mono);
  font-size: 9px; padding: 4px 10px; border-radius: 4px;
  cursor: pointer; text-decoration: none; transition: var(--t);
}
.download-card .dl-btn:hover { background: rgba(0,255,136,0.2); }

/* ═══ INPUT BAR ═══ */
.input-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 14px; flex-shrink: 0;
}

.mic-btn {
  position: relative;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,228,255,0.06);
  border: 2px solid rgba(0,228,255,0.4);
  color: var(--cyan); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--t); flex-shrink: 0;
}
.mic-btn svg { width: 18px; height: 18px; }
.mic-btn:hover {
  background: rgba(0,228,255,0.12);
  box-shadow: var(--glow-c);
}
.mic-ring {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid rgba(0,228,255,0.2);
  pointer-events: none;
}
.mic-btn.recording {
  border-color: var(--red); color: var(--red);
  background: rgba(255,68,102,0.08);
  animation: mic-pulse 0.9s ease-in-out infinite;
}
.mic-btn.recording .mic-ring { border-color: rgba(255,68,102,0.3); animation: mic-ring-pulse 0.9s ease-in-out infinite; }
@keyframes mic-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,68,102,0.3); }
  50%      { box-shadow: 0 0 0 10px rgba(255,68,102,0); }
}
@keyframes mic-ring-pulse {
  0%,100% { transform: scale(1); opacity: 0.5; }
  50%      { transform: scale(1.3); opacity: 0; }
}

.screen-btn {
  width: 40px; height: 40px; border-radius: 8px;
  background: none; border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-mid); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--t); flex-shrink: 0;
}
.screen-btn svg { width: 17px; height: 17px; }
.screen-btn:hover {
  border-color: rgba(0,228,255,0.3);
  color: var(--cyan); background: rgba(0,228,255,0.06);
}
.screen-btn.active {
  border-color: rgba(0,228,255,0.5); color: var(--cyan);
  background: rgba(0,228,255,0.1);
  animation: screen-glow 1.5s ease-in-out infinite;
}
@keyframes screen-glow {
  0%,100% { box-shadow: 0 0 6px rgba(0,228,255,0.2); }
  50%      { box-shadow: 0 0 18px rgba(0,228,255,0.5); }
}

.input-wrap { flex: 1; position: relative; }
.chat-input {
  width: 100%; height: 44px;
  background: rgba(0,228,255,0.03);
  border: 1px solid rgba(0,228,255,0.15);
  border-radius: 10px; padding: 0 16px;
  color: var(--text);
  font-family: var(--font-mono); font-size: 13px;
  outline: none; transition: var(--t);
}
.chat-input:focus {
  border-color: rgba(0,228,255,0.45);
  background: rgba(0,228,255,0.05);
}
.chat-input:focus ~ .input-glow { opacity: 1; }
.chat-input::placeholder { color: var(--text-dim); }
.input-glow {
  position: absolute; inset: -1px; border-radius: 11px;
  pointer-events: none; opacity: 0; transition: opacity 0.3s;
  box-shadow: 0 0 20px rgba(0,228,255,0.12);
}

.attach-btn {
  width: 40px; height: 40px; border-radius: 8px;
  background: none; border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-mid); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--t); flex-shrink: 0;
}
.attach-btn svg { width: 17px; height: 17px; }
.attach-btn:hover { border-color: rgba(255,184,78,0.4); color: var(--amber); }

.send-btn {
  position: relative;
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(0,228,255,0.1);
  border: 1px solid rgba(0,228,255,0.35);
  color: var(--cyan); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--t); overflow: hidden; flex-shrink: 0;
}
.send-btn svg { width: 17px; height: 17px; }
.send-btn:hover {
  background: rgba(0,228,255,0.18);
  box-shadow: var(--glow-c);
  transform: scale(1.05);
}
.send-btn:active { transform: scale(0.95); }
.send-ripple {
  position: absolute; border-radius: 50%;
  width: 100%; height: 100%;
  background: rgba(0,228,255,0.15);
  transform: scale(0); pointer-events: none;
  transition: transform 0.4s ease, opacity 0.4s;
}
.send-btn:active .send-ripple { transform: scale(2.5); opacity: 0; }

/* Screen preview */
.screen-preview {
  position: relative; margin-bottom: 6px;
  border: 1px solid rgba(0,228,255,0.3); border-radius: 8px;
  overflow: hidden; background: rgba(0,228,255,0.02);
}
.screen-preview img {
  width: 100%; max-height: 150px; object-fit: cover;
  display: block; opacity: 0.85;
}
.screen-preview .screen-label {
  position: absolute; top: 6px; left: 8px;
  font-family: var(--font-mono); font-size: 9px; color: var(--cyan);
  background: rgba(0,0,0,0.75); padding: 2px 6px; border-radius: 3px;
}
.screen-preview .remove-screen {
  position: absolute; top: 6px; right: 8px;
  background: rgba(0,0,0,0.75); border: none;
  color: var(--text-mid); cursor: pointer; font-size: 13px;
  width: 22px; height: 22px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
/* LIVE mode — red pulsing border and label */
.screen-preview.live {
  border-color: rgba(255,60,60,0.55);
  box-shadow: 0 0 16px rgba(255,60,60,0.25), inset 0 0 12px rgba(255,60,60,0.08);
  animation: live-pulse 1.8s ease-in-out infinite;
}
.screen-preview.live .screen-label {
  color: #ff4040; background: rgba(0,0,0,0.85);
  font-weight: bold; letter-spacing: 0.5px;
}
.screen-preview.live .screen-label::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  background: #ff3030; border-radius: 50%; margin-right: 5px;
  vertical-align: middle; animation: live-dot 1s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(255,60,60,0.25), inset 0 0 12px rgba(255,60,60,0.08); }
  50% { box-shadow: 0 0 24px rgba(255,60,60,0.45), inset 0 0 18px rgba(255,60,60,0.15); }
}
@keyframes live-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

/* Attachment preview */
.attachment-preview {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; background: rgba(255,184,78,0.04);
  border: 1px solid rgba(255,184,78,0.2); border-radius: 6px;
  margin-bottom: 6px; font-family: var(--font-mono);
  font-size: 10px; color: var(--amber);
}
.attachment-preview .remove-att {
  margin-left: auto; background: none; border: none;
  color: var(--text-dim); cursor: pointer; font-size: 13px;
}

/* ═══════════════════════════════════════════
   METRICS SIDEBAR
═══════════════════════════════════════════ */
.metric-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px; padding: 10px 12px;
  margin-bottom: 6px; transition: var(--t);
}
.metric-card:hover {
  border-color: rgba(0,228,255,0.22);
  box-shadow: var(--glow-c2);
}
.metric-label {
  font-family: var(--font-mono); font-size: 7px;
  color: var(--text-mid); letter-spacing: 2.5px;
  text-transform: uppercase; margin-bottom: 4px;
}
.metric-value {
  font-family: var(--font-mono); font-size: 16px;
  font-weight: 600; color: var(--cyan);
  text-shadow: 0 0 10px rgba(0,228,255,0.3);
}
.metric-large .metric-value {
  font-size: 20px;
  font-family: var(--font-orb);
  letter-spacing: 1px;
}
.font-orb { font-family: var(--font-orb) !important; }
.metric-plan .metric-value { color: var(--amber); text-shadow: 0 0 10px rgba(255,184,78,0.3); }

.pool-card .pool-hud {
  font-size: 13px; letter-spacing: 2px;
  transition: color 0.4s;
}

/* Model cards in sidebar */
.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 8px; padding: 10px 12px;
  margin-bottom: 6px; transition: var(--t);
  opacity: 0.45;
}
.stat-card.active-model {
  opacity: 1;
  border-color: rgba(0,228,255,0.25);
  box-shadow: 0 0 20px rgba(0,228,255,0.1);
}
.model-card { cursor: default; }

.model-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.model-dot {
  width: 7px; height: 7px; border-radius: 50%;
  animation: orb-beat 2s ease-in-out infinite;
}
.model-name {
  font-family: var(--font-mono); font-size: 11px;
  font-weight: 600; color: var(--cyan); letter-spacing: 1px;
}
#model-sonnet .model-name { color: var(--purple); }
#model-haiku  .model-name { color: var(--green); }

.model-desc {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--text-mid); letter-spacing: 0.5px;
  padding-left: 15px;
}

/* ═══════════════════════════════════════════
   FILE BROWSER
═══════════════════════════════════════════ */
.file-browser {
  padding: 24px; height: 100%; overflow-y: auto;
}
.section-title {
  font-family: var(--font-orb); font-size: 14px;
  color: var(--cyan); letter-spacing: 3px;
  margin-bottom: 20px; text-transform: uppercase;
  text-shadow: 0 0 20px rgba(0,228,255,0.3);
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 12px;
}
.file-list { display: flex; flex-direction: column; gap: 16px; }
.file-project-group { display: flex; flex-direction: column; gap: 6px; }
.file-project-header {
  font-size: 10px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--cyan);
  padding: 4px 0 6px; border-bottom: 1px solid rgba(0,228,255,0.15);
  margin-bottom: 2px;
}
.file-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border); border-radius: 8px;
  transition: var(--t);
}
.file-item:hover { border-color: rgba(0,228,255,0.3); box-shadow: var(--glow-c2); }
.file-item-icon { font-size: 20px; flex-shrink: 0; }
.file-item-info { flex: 1; min-width: 0; }
.file-item-name {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.file-item-meta { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.file-item-actions { display: flex; gap: 6px; }
.file-item-actions a, .file-item-actions button {
  background: rgba(0,228,255,0.05);
  border: 1px solid rgba(0,228,255,0.15);
  color: var(--cyan); font-family: var(--font-mono);
  font-size: 9px; padding: 4px 10px; border-radius: 4px;
  cursor: pointer; text-decoration: none; transition: var(--t);
}
.file-item-actions a:hover, .file-item-actions button:hover {
  background: rgba(0,228,255,0.15);
}
.file-empty {
  color: var(--text-dim); font-family: var(--font-mono);
  font-size: 12px; text-align: center; padding: 50px 20px;
}

/* ═══════════════════════════════════════════
   CONFIG PANEL
═══════════════════════════════════════════ */
.config-panel {
  padding: 24px; max-width: 600px;
}
.config-group { margin-bottom: 24px; }
.config-label {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-mid); letter-spacing: 1.5px;
  text-transform: uppercase; display: block; margin-bottom: 8px;
}
.config-row { display: flex; gap: 8px; }
.config-input {
  flex: 1; height: 40px;
  background: var(--glass);
  border: 1px solid var(--glass-border); border-radius: 7px;
  padding: 0 14px; color: var(--text);
  font-family: var(--font-mono); font-size: 12px; outline: none;
  transition: var(--t);
}
.config-input:focus { border-color: rgba(0,228,255,0.4); }
.config-save-btn {
  height: 40px; padding: 0 18px;
  background: rgba(0,228,255,0.08);
  border: 1px solid rgba(0,228,255,0.3); border-radius: 7px;
  color: var(--cyan); font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 1px;
  cursor: pointer; transition: var(--t);
}
.config-save-btn:hover { background: rgba(0,228,255,0.16); }
.config-select {
  width: 100%; height: 40px;
  background: var(--glass);
  border: 1px solid var(--glass-border); border-radius: 7px;
  padding: 0 14px; color: var(--text);
  font-family: var(--font-mono); font-size: 12px; outline: none;
  cursor: pointer; transition: var(--t);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2300e4ff' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.config-select:focus { border-color: rgba(0,228,255,0.4); }
.config-select option { background: #0a0e1a; color: var(--text); }
.config-hint {
  font-size: 10px; color: var(--text-dim); margin-top: 5px; display: block;
}

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 46px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(255,255,255,0.08); border-radius: 12px; transition: var(--t);
}
.toggle-slider::before {
  content: ''; position: absolute;
  height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: var(--text-mid); border-radius: 50%; transition: var(--t);
}
.toggle input:checked + .toggle-slider { background: rgba(0,228,255,0.2); }
.toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.system-info {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-dim); line-height: 2;
  padding: 12px 14px; background: var(--glass);
  border: 1px solid var(--glass-border); border-radius: 8px;
}
