/* ═══════════════════════════════════════════════════════════════
   ORBITAL SENTINEL AI — Mission Control CSS
   NASA Sci-Fi Dashboard Theme
═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --bg-void:        #010812;
  --bg-deep:        #030d1a;
  --bg-panel:       rgba(2, 18, 38, 0.75);
  --bg-panel-hover: rgba(0, 30, 60, 0.85);
  --bg-card:        rgba(0, 20, 45, 0.8);

  --cyan:           #00f0ff;
  --cyan-dim:       #00a8b5;
  --cyan-glow:      rgba(0, 240, 255, 0.15);
  --cyan-glow-str:  rgba(0, 240, 255, 0.4);
  --blue:           #0066ff;
  --blue-dim:       #003d99;
  --green:          #00ff88;
  --green-dim:      #00994d;
  --yellow:         #ffcc00;
  --orange:         #ff8800;
  --red:            #ff2244;
  --red-dim:        #990022;
  --red-glow:       rgba(255, 34, 68, 0.25);

  --text-primary:   #c8e8ff;
  --text-secondary: #5a8aaa;
  --text-bright:    #ffffff;
  --text-dim:       #2a4a6a;

  --border:         rgba(0, 240, 255, 0.15);
  --border-bright:  rgba(0, 240, 255, 0.4);

  --font-display:   'Orbitron', monospace;
  --font-mono:      'Share Tech Mono', monospace;
  --font-body:      'Exo 2', sans-serif;

  --panel-w:        320px;
  --header-h:       58px;
  --ctrl-bar-h:     56px;
  --radius:         4px;
  --radius-lg:      8px;

  --glow-cyan:      0 0 8px rgba(0,240,255,0.6), 0 0 20px rgba(0,240,255,0.2);
  --glow-red:       0 0 8px rgba(255,34,68,0.7), 0 0 20px rgba(255,34,68,0.3);
  --glow-green:     0 0 8px rgba(0,255,136,0.6), 0 0 20px rgba(0,255,136,0.2);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
}

/* ── Star Field Canvas ──────────────────────────────────────── */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Scanline Overlay ───────────────────────────────────────── */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════════ */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(1, 8, 18, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border), 0 4px 20px rgba(0,0,0,0.5);
}

/* Logo */
.top-bar__logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-icon svg {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 6px var(--cyan));
  animation: logo-spin 20s linear infinite;
}
@keyframes logo-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.logo-text { display: flex; flex-direction: column; }
.logo-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 3px;
  text-shadow: var(--glow-cyan);
}
.logo-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  letter-spacing: 2px;
}

/* Status items */
.top-bar__status {
  display: flex;
  align-items: center;
  gap: 20px;
}
.status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 1px;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
}
.status-dot--active {
  background: var(--green);
  box-shadow: var(--glow-green);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.status-label {
  color: var(--text-dim);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.status-value {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--cyan);
  font-weight: 600;
}
.status-value--danger { color: var(--red); text-shadow: var(--glow-red); }
.status-divider {
  width: 1px; height: 20px;
  background: var(--border);
}

/* Clock */
.top-bar__clock { text-align: right; }
.clock-utc {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--cyan);
  font-weight: 600;
  letter-spacing: 2px;
  text-shadow: var(--glow-cyan);
}
.clock-date {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  letter-spacing: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD GRID
═══════════════════════════════════════════════════════════════ */
.dashboard {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: var(--panel-w) 1fr var(--panel-w);
  z-index: 10;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   PANEL BASE
═══════════════════════════════════════════════════════════════ */
.panel {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel--right {
  border-right: none;
  border-left: 1px solid var(--border);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 240, 255, 0.03);
  flex-shrink: 0;
}
.panel__title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 2.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel__title-icon { font-size: 14px; opacity: 0.8; }
.panel__badge {
  background: rgba(0,240,255,0.15);
  border: 1px solid var(--border-bright);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 28px;
  text-align: center;
}
.panel__badge--alert {
  background: rgba(255,34,68,0.15);
  border-color: var(--red);
  color: var(--red);
}

.panel__section {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.panel__section-title {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ═══════════════════════════════════════════════════════════════
   FILTER TABS
═══════════════════════════════════════════════════════════════ */
.filter-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.filter-tab {
  flex: 1;
  padding: 5px 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.2s;
}
.filter-tab:hover {
  color: var(--cyan);
  border-color: var(--border);
}
.filter-tab--active {
  background: var(--cyan-glow);
  border-color: var(--border-bright);
  color: var(--cyan);
  text-shadow: 0 0 8px var(--cyan);
}

/* ═══════════════════════════════════════════════════════════════
   OBJECT LIST
═══════════════════════════════════════════════════════════════ */
.object-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  scroll-behavior: smooth;
}
.object-list::-webkit-scrollbar { width: 4px; }
.object-list::-webkit-scrollbar-track { background: transparent; }
.object-list::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 2px;
}

.object-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  overflow: hidden;
}
.object-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}
.object-card--satellite::before { background: var(--cyan); }
.object-card--debris::before   { background: var(--orange); }
.object-card:hover {
  background: var(--bg-panel-hover);
  border-color: var(--border-bright);
  transform: translateX(3px);
  box-shadow: -3px 0 12px var(--cyan-glow);
}
.object-card--selected {
  border-color: var(--cyan);
  background: var(--bg-panel-hover);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 5px;
}
.card-id {
  font-family: var(--font-display);
  font-size: 9px;
  color: var(--cyan-dim);
  letter-spacing: 1.5px;
}
.card-name {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}
.card-type {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.card-alt {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
}

/* Risk badges */
.risk-badge {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid;
  text-transform: uppercase;
}
.risk-badge--low    { color: var(--green);  border-color: var(--green);  background: rgba(0,255,136,0.1); }
.risk-badge--medium { color: var(--yellow); border-color: var(--yellow); background: rgba(255,204,0,0.1); }
.risk-badge--high   {
  color: var(--red); border-color: var(--red); background: rgba(255,34,68,0.15);
  animation: risk-pulse 1.5s infinite;
}
@keyframes risk-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(255,34,68,0.4); }
  50%       { box-shadow: 0 0 10px rgba(255,34,68,0.8); }
}

/* ═══════════════════════════════════════════════════════════════
   ADD OBJECT FORM
═══════════════════════════════════════════════════════════════ */
.add-object-section {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.add-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: slide-down 0.3s ease;
}
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.form-row { display: flex; gap: 6px; }
.form-row .form-input { flex: 1; }

.form-input {
  width: 100%;
  background: rgba(0, 15, 35, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}
.form-input::placeholder { color: var(--text-dim); }
.form-select { cursor: pointer; }
.form-select option { background: #021226; color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════ */
.btn {
  padding: 8px 14px;
  border: 1px solid;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn--primary {
  background: var(--cyan-glow);
  border-color: var(--cyan);
  color: var(--cyan);
  width: 100%;
  justify-content: center;
}
.btn--primary:hover {
  background: rgba(0,240,255,0.25);
  box-shadow: var(--glow-cyan);
}
.btn--confirm {
  background: rgba(0,102,255,0.2);
  border-color: var(--blue);
  color: #88aaff;
  width: 100%;
  justify-content: center;
  font-size: 9px;
}
.btn--confirm:hover {
  background: rgba(0,102,255,0.35);
  box-shadow: 0 0 10px rgba(0,102,255,0.5);
}
.btn--sim {
  background: linear-gradient(135deg, rgba(255,34,68,0.15), rgba(255,136,0,0.1));
  border-color: var(--red);
  color: #ff6677;
  padding: 10px 22px;
  font-size: 11px;
  position: relative;
}
.btn--sim:hover {
  background: linear-gradient(135deg, rgba(255,34,68,0.3), rgba(255,136,0,0.2));
  box-shadow: var(--glow-red);
  color: #ff99aa;
}
.btn--sim.running {
  border-color: var(--orange);
  color: var(--orange);
  animation: btn-running 0.5s infinite alternate;
}
@keyframes btn-running {
  from { box-shadow: 0 0 8px rgba(255,136,0,0.4); }
  to   { box-shadow: 0 0 20px rgba(255,136,0,0.8); }
}
.btn--secondary {
  background: rgba(0,240,255,0.05);
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn--secondary:hover {
  border-color: var(--cyan-dim);
  color: var(--cyan);
}

.sim-pulse {
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: var(--glow-red);
  animation: blink 1.2s infinite;
}
.btn--sim.running .sim-pulse {
  background: var(--orange);
  animation: blink 0.3s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* ═══════════════════════════════════════════════════════════════
   CENTER VIEW
═══════════════════════════════════════════════════════════════ */
.center-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #010f22 0%, var(--bg-void) 70%);
  position: relative;
}

.earth-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}
#earth-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* HUD Overlay */
.hud-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Corner brackets */
.hud-corner {
  position: absolute;
  width: 28px; height: 28px;
}
.hud-corner--tl { top: 16px; left: 16px; border-top: 2px solid var(--cyan); border-left: 2px solid var(--cyan); }
.hud-corner--tr { top: 16px; right: 16px; border-top: 2px solid var(--cyan); border-right: 2px solid var(--cyan); }
.hud-corner--bl { bottom: 68px; left: 16px; border-bottom: 2px solid var(--cyan); border-left: 2px solid var(--cyan); }
.hud-corner--br { bottom: 68px; right: 16px; border-bottom: 2px solid var(--cyan); border-right: 2px solid var(--cyan); }

/* Crosshair */
.hud-crosshair {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.crosshair-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0,240,255,0.2);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: ring-pulse 3s ease-in-out infinite;
}
.crosshair-ring--1 { width: 40px; height: 40px; animation-delay: 0s; }
.crosshair-ring--2 { width: 80px; height: 80px; animation-delay: 0.5s; border-style: dashed; }
@keyframes ring-pulse {
  0%, 100% { opacity: 0.3; transform: translate(-50%,-50%) scale(1); }
  50%       { opacity: 0.6; transform: translate(-50%,-50%) scale(1.05); }
}

/* Scan line */
.hud-scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--cyan), transparent);
  opacity: 0;
  pointer-events: none;
}
.hud-scan-line.active {
  opacity: 0.6;
  animation: scan 3s linear;
}
@keyframes scan {
  from { top: 0; opacity: 0.6; }
  to   { top: 100%; opacity: 0; }
}

/* Object Tooltip */
.obj-tooltip {
  position: absolute;
  background: rgba(0, 10, 25, 0.92);
  border: 1px solid var(--cyan);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  min-width: 140px;
  pointer-events: none;
  box-shadow: 0 0 20px var(--cyan-glow), inset 0 0 10px rgba(0,240,255,0.05);
  backdrop-filter: blur(8px);
  z-index: 50;
}
.tooltip-id {
  font-family: var(--font-display);
  font-size: 9px;
  color: var(--cyan-dim);
  letter-spacing: 2px;
  margin-bottom: 2px;
}
.tooltip-name {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-bright);
  margin-bottom: 6px;
}
.tooltip-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.tooltip-row span:last-child { color: var(--text-primary); }
.tt-risk { font-weight: 700; }

/* Globe readouts */
.globe-readouts {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 54px;
  display: flex;
  align-items: stretch;
  background: rgba(1, 8, 18, 0.85);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.readout {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
  gap: 2px;
  transition: background 0.2s;
}
.readout:last-child { border-right: none; }
.readout:hover { background: var(--cyan-glow); }
.readout-label {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}
.readout-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: var(--glow-cyan);
  line-height: 1;
}
.readout-val--danger { color: var(--red); text-shadow: var(--glow-red); }

/* ═══════════════════════════════════════════════════════════════
   CONTROL BAR
═══════════════════════════════════════════════════════════════ */
.control-bar {
  height: var(--ctrl-bar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: rgba(1, 8, 18, 0.9);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}
.control-divider {
  width: 1px; height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

/* Toggles */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  transition: color 0.2s;
  user-select: none;
  white-space: nowrap;
}
.toggle-label:hover { color: var(--cyan); }
.toggle-label input { display: none; }
.toggle-switch {
  width: 32px; height: 16px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  border-radius: 8px;
  position: relative;
  transition: all 0.2s;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 10px; height: 10px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: all 0.2s;
}
.toggle-label input:checked + .toggle-switch {
  background: var(--cyan-glow);
  border-color: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}
.toggle-label input:checked + .toggle-switch::after {
  left: 18px;
  background: var(--cyan);
  box-shadow: 0 0 4px var(--cyan);
}

/* Speed Control */
.speed-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.speed-label {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.speed-slider {
  -webkit-appearance: none;
  width: 80px; height: 4px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--cyan);
  cursor: pointer;
}
.speed-val {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--cyan);
  width: 24px;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   ALERT CARDS
═══════════════════════════════════════════════════════════════ */
.alert-summary {
  display: flex;
  gap: 1px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.alert-summary-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px;
  gap: 3px;
  transition: background 0.2s;
}
.alert-summary-item--high  { background: rgba(255,34,68,0.07); }
.alert-summary-item--med   { background: rgba(255,204,0,0.05); }
.alert-summary-item--low   { background: rgba(0,255,136,0.04); }
.summary-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.alert-summary-item--high  .summary-num { color: var(--red);    text-shadow: var(--glow-red); }
.alert-summary-item--med   .summary-num { color: var(--yellow); }
.alert-summary-item--low   .summary-num { color: var(--green);  text-shadow: var(--glow-green); }
.summary-label {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.alerts-feed {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.alerts-feed::-webkit-scrollbar { width: 4px; }
.alerts-feed::-webkit-scrollbar-thumb { background: var(--red-dim); border-radius: 2px; }

.alerts-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
}
.empty-icon {
  font-size: 32px;
  color: var(--border-bright);
  animation: pulse-opacity 3s infinite;
}
@keyframes pulse-opacity {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

.alert-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 6px;
  border: 1px solid;
  position: relative;
  overflow: hidden;
  animation: alert-in 0.4s ease;
  cursor: default;
}
@keyframes alert-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.alert-card::before {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 3px;
}
.alert-card--high   { border-color: rgba(255,34,68,0.4);   background: rgba(255,34,68,0.06); }
.alert-card--high::before   { background: var(--red); box-shadow: var(--glow-red); }
.alert-card--medium { border-color: rgba(255,204,0,0.3);  background: rgba(255,204,0,0.04); }
.alert-card--medium::before { background: var(--yellow); }
.alert-card--low    { border-color: rgba(0,255,136,0.2);  background: rgba(0,255,136,0.03); }
.alert-card--low::before    { background: var(--green); }

.alert-card--high { animation: alert-in 0.4s ease, alert-flash 3s 0.4s infinite; }
@keyframes alert-flash {
  0%, 90%, 100% { border-color: rgba(255,34,68,0.4); }
  95% { border-color: rgba(255,34,68,0.9); box-shadow: 0 0 15px rgba(255,34,68,0.3); }
}

.alert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}
.alert-level {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 2px 8px;
  border-radius: 3px;
}
.alert-card--high   .alert-level { color: var(--red);    background: rgba(255,34,68,0.15); }
.alert-card--medium .alert-level { color: var(--yellow); background: rgba(255,204,0,0.15); }
.alert-card--low    .alert-level { color: var(--green);  background: rgba(0,255,136,0.1); }

.alert-prob {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}
.alert-card--high   .alert-prob { color: var(--red); }
.alert-card--medium .alert-prob { color: var(--yellow); }
.alert-card--low    .alert-prob { color: var(--green); }

.alert-objects {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.alert-objects span { color: var(--cyan); }
.alert-distance {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}
.alert-rec {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 5px;
  line-height: 1.4;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 5px;
}

/* Probability bar */
.prob-bar-wrap {
  margin-top: 6px;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.prob-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 1s ease;
}
.alert-card--high   .prob-bar { background: linear-gradient(to right, var(--red-dim), var(--red)); }
.alert-card--medium .prob-bar { background: linear-gradient(to right, #aa8800, var(--yellow)); }
.alert-card--low    .prob-bar { background: linear-gradient(to right, var(--green-dim), var(--green)); }

/* ═══════════════════════════════════════════════════════════════
   SYSTEM LOG
═══════════════════════════════════════════════════════════════ */
.log-blink {
  color: var(--green);
  animation: blink 1.5s infinite;
  font-size: 10px;
}
.sys-log {
  height: 90px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  line-height: 1.8;
}
.sys-log::-webkit-scrollbar { width: 3px; }
.sys-log::-webkit-scrollbar-thumb { background: var(--border); }
.log-line { display: block; }
.log-line--info    { color: var(--cyan-dim); }
.log-line--warn    { color: var(--yellow); }
.log-line--danger  { color: var(--red); }
.log-line--success { color: var(--green); }
.log-time { color: var(--text-dim); margin-right: 6px; }

/* ═══════════════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,5,15,0.85);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  animation: fade-in 0.3s ease;
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal {
  background: rgba(2, 14, 32, 0.98);
  border: 1px solid var(--cyan);
  border-radius: var(--radius-lg);
  width: min(600px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 0 40px var(--cyan-glow-str), inset 0 0 30px rgba(0,240,255,0.03);
  animation: modal-in 0.35s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.92) translateY(-20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,240,255,0.04);
}
.modal__title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 3px;
  text-shadow: var(--glow-cyan);
}
.modal__close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 28px; height: 28px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}
.modal__close:hover { border-color: var(--red); color: var(--red); }
.modal__body { padding: 20px; }

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.modal-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.modal-stat-val {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.modal-stat-val--high   { color: var(--red);    text-shadow: var(--glow-red); }
.modal-stat-val--med    { color: var(--yellow); }
.modal-stat-val--total  { color: var(--cyan);   text-shadow: var(--glow-cyan); }
.modal-stat-label {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--text-dim);
}
.modal-summary {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(0,240,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  line-height: 1.7;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   CHART AREA
═══════════════════════════════════════════════════════════════ */
canvas { display: block; }

/* ═══════════════════════════════════════════════════════════════
   UTILITY ANIMATIONS
═══════════════════════════════════════════════════════════════ */
.fade-in  { animation: fade-in  0.4s ease forwards; }
.slide-up { animation: slide-up 0.4s ease forwards; }
@keyframes slide-up {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar global */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE (for smaller screens during demo)
═══════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  :root { --panel-w: 270px; }
}
@media (max-width: 900px) {
  .dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    overflow-y: auto;
  }
  .panel--left, .panel--right {
    max-height: 300px;
  }
  .top-bar__status { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   GEMINI AI ANALYST — Drawer + API Key Modal
═══════════════════════════════════════════════════════════════ */

/* ── Header Gemini Button ─────────────────────────────────────── */
.top-bar__right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.btn-gemini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: linear-gradient(135deg, rgba(0,240,255,0.08), rgba(168,85,247,0.12));
  border: 1px solid rgba(168,85,247,0.45);
  border-radius: var(--radius);
  color: #c084fc;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  white-space: nowrap;
}
.btn-gemini:hover {
  background: linear-gradient(135deg, rgba(0,240,255,0.15), rgba(168,85,247,0.22));
  border-color: rgba(168,85,247,0.8);
  box-shadow: 0 0 18px rgba(168,85,247,0.35);
  color: #e0aaff;
}
.btn-gemini.active {
  background: linear-gradient(135deg, rgba(0,240,255,0.18), rgba(168,85,247,0.28));
  border-color: #a855f7;
  box-shadow: 0 0 22px rgba(168,85,247,0.5);
  color: #f0d0ff;
}

.gemini-icon { width: 18px; height: 18px; flex-shrink: 0; }
.gemini-icon--lg { width: 32px; height: 32px; }

.gemini-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.3s;
  margin-left: 2px;
}
.gemini-status-dot.connected {
  background: #a855f7;
  box-shadow: 0 0 8px rgba(168,85,247,0.8);
  animation: gemini-pulse 2s infinite;
}
@keyframes gemini-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}

/* ── Gemini Backdrop ──────────────────────────────────────────── */
.gemini-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 149;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(2px);
}
.gemini-backdrop.visible { display: block; }

/* ── Gemini Drawer ────────────────────────────────────────────── */
.gemini-drawer {
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  width: 420px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  background: rgba(4, 8, 22, 0.97);
  border-left: 1px solid rgba(168,85,247,0.35);
  backdrop-filter: blur(20px);
  box-shadow: -8px 0 40px rgba(168,85,247,0.15), -2px 0 0 rgba(168,85,247,0.1);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.gemini-drawer.open {
  transform: translateX(0);
}

/* Drawer decorative top gradient line */
.gemini-drawer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(0,240,255,0.6), #a855f7, transparent);
}

/* ── Drawer Header ────────────────────────────────────────────── */
.gemini-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(168,85,247,0.2);
  background: linear-gradient(135deg, rgba(0,240,255,0.03), rgba(168,85,247,0.05));
  flex-shrink: 0;
}
.gemini-drawer__title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gemini-drawer__name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #00f0ff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gemini-drawer__sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  margin-top: 1px;
}
.gemini-drawer__controls {
  display: flex;
  gap: 6px;
}
.gemini-ctrl-btn {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.gemini-ctrl-btn:hover {
  background: rgba(168,85,247,0.15);
  border-color: rgba(168,85,247,0.5);
  color: #c084fc;
}
.gemini-ctrl-btn--close:hover { border-color: var(--red); color: var(--red); }

/* ── Context Bar ──────────────────────────────────────────────── */
.gemini-context-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(168,85,247,0.1);
  background: rgba(168,85,247,0.04);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.context-pill {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 1.5px;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid;
  font-weight: 600;
}
.context-pill--objects { color: var(--cyan);   border-color: rgba(0,240,255,0.3);  background: rgba(0,240,255,0.08); }
.context-pill--alerts  { color: var(--red);    border-color: rgba(255,34,68,0.3);  background: rgba(255,34,68,0.08); }
.context-pill--sim     { color: #a855f7;       border-color: rgba(168,85,247,0.3); background: rgba(168,85,247,0.08); }
.context-info {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-left: auto;
}

/* ── Quick Prompt Chips ───────────────────────────────────────── */
.gemini-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(168,85,247,0.1);
  flex-shrink: 0;
}
.gemini-chip {
  padding: 4px 10px;
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: 20px;
  color: #b794f4;
  font-family: var(--font-body);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.gemini-chip:hover {
  background: rgba(168,85,247,0.2);
  border-color: rgba(168,85,247,0.6);
  color: #e0aaff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(168,85,247,0.2);
}

/* ── Messages ─────────────────────────────────────────────────── */
.gemini-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}
.gemini-messages::-webkit-scrollbar { width: 4px; }
.gemini-messages::-webkit-scrollbar-thumb {
  background: rgba(168,85,247,0.3);
  border-radius: 2px;
}

/* Message bubbles */
.gmsg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  animation: msg-in 0.3s ease;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gmsg--user  { align-self: flex-end; align-items: flex-end; }
.gmsg--gemini { align-self: flex-start; align-items: flex-start; }

.gmsg__label {
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.gmsg--user   .gmsg__label { color: var(--cyan-dim); }
.gmsg--gemini .gmsg__label { color: #9f7aea; }

.gmsg__bubble {
  padding: 11px 14px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-primary);
}
.gmsg--user .gmsg__bubble {
  background: linear-gradient(135deg, rgba(0,100,200,0.25), rgba(0,60,140,0.3));
  border: 1px solid rgba(0,150,255,0.25);
  border-bottom-right-radius: 3px;
}
.gmsg--gemini .gmsg__bubble {
  background: linear-gradient(135deg, rgba(168,85,247,0.1), rgba(100,50,160,0.12));
  border: 1px solid rgba(168,85,247,0.25);
  border-bottom-left-radius: 3px;
}

/* Gemini markdown rendering */
.gmsg__bubble h1, .gmsg__bubble h2, .gmsg__bubble h3 {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #c084fc;
  margin: 10px 0 5px;
  text-transform: uppercase;
}
.gmsg__bubble h1 { font-size: 12px; color: var(--cyan); }
.gmsg__bubble p  { margin-bottom: 8px; }
.gmsg__bubble p:last-child { margin-bottom: 0; }
.gmsg__bubble strong { color: var(--text-bright); }
.gmsg__bubble em     { color: #c084fc; font-style: normal; }
.gmsg__bubble ul, .gmsg__bubble ol {
  padding-left: 16px;
  margin: 6px 0;
}
.gmsg__bubble li {
  margin-bottom: 4px;
  color: var(--text-primary);
}
.gmsg__bubble code {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(0,240,255,0.08);
  border: 1px solid rgba(0,240,255,0.15);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--cyan);
}
.gmsg__bubble blockquote {
  border-left: 2px solid #a855f7;
  margin: 8px 0;
  padding: 6px 12px;
  background: rgba(168,85,247,0.06);
  border-radius: 0 4px 4px 0;
  color: var(--text-secondary);
}
.gmsg__bubble hr {
  border: none;
  border-top: 1px solid rgba(168,85,247,0.2);
  margin: 10px 0;
}

/* Gemini welcome message */
.gmsg--welcome .gmsg__bubble {
  background: linear-gradient(135deg, rgba(0,240,255,0.05), rgba(168,85,247,0.08));
  border-color: rgba(168,85,247,0.3);
  text-align: center;
}
.welcome-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
}
.welcome-title {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #00f0ff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.welcome-body {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Typing Indicator ─────────────────────────────────────────── */
.gemini-typing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  flex-shrink: 0;
}
.typing-dots {
  display: flex;
  gap: 4px;
}
.typing-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #a855f7;
  animation: typing-bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.30s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.4; }
  30%           { transform: translateY(-5px);  opacity: 1; }
}
.typing-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #9f7aea;
  letter-spacing: 1px;
  animation: pulse-opacity 1.5s infinite;
}

/* ── Input Bar ────────────────────────────────────────────────── */
.gemini-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(168,85,247,0.2);
  background: rgba(168,85,247,0.04);
  flex-shrink: 0;
}
.gemini-input {
  flex: 1;
  background: rgba(0, 5, 20, 0.8);
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.5;
  resize: none;
  outline: none;
  max-height: 100px;
  overflow-y: auto;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gemini-input:focus {
  border-color: rgba(168,85,247,0.7);
  box-shadow: 0 0 12px rgba(168,85,247,0.2);
}
.gemini-input::placeholder { color: var(--text-dim); }

.gemini-send-btn {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, rgba(0,240,255,0.2), rgba(168,85,247,0.3));
  border: 1px solid rgba(168,85,247,0.5);
  border-radius: 10px;
  color: #c084fc;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.gemini-send-btn svg { width: 16px; height: 16px; }
.gemini-send-btn:hover {
  background: linear-gradient(135deg, rgba(0,240,255,0.3), rgba(168,85,247,0.45));
  box-shadow: 0 0 14px rgba(168,85,247,0.4);
  transform: scale(1.05);
}
.gemini-send-btn:active { transform: scale(0.97); }
.gemini-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ── API Key Modal ────────────────────────────────────────────── */
.apikey-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,5,15,0.88);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  animation: fade-in 0.25s ease;
}
.apikey-modal {
  background: rgba(4, 8, 28, 0.99);
  border: 1px solid rgba(168,85,247,0.5);
  border-radius: var(--radius-lg);
  width: min(480px, 92vw);
  padding: 28px;
  box-shadow: 0 0 50px rgba(168,85,247,0.25), inset 0 0 30px rgba(168,85,247,0.04);
  animation: modal-in 0.3s ease;
  position: relative;
  overflow: hidden;
}
.apikey-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(0,240,255,0.5), #a855f7, transparent);
}
.apikey-modal__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.apikey-modal__title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #00f0ff, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.apikey-modal__sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  margin-top: 3px;
}

.apikey-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px;
  background: rgba(168,85,247,0.05);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: var(--radius);
}
.apikey-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.step-num {
  width: 20px; height: 20px;
  background: rgba(168,85,247,0.2);
  border: 1px solid rgba(168,85,247,0.4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 9px;
  color: #c084fc;
  flex-shrink: 0;
}
.apikey-link {
  color: #c084fc;
  text-decoration: none;
  border-bottom: 1px solid rgba(168,85,247,0.4);
  transition: color 0.2s;
}
.apikey-link:hover { color: #e0aaff; }

.apikey-input-wrap {
  position: relative;
  margin-bottom: 12px;
}
.apikey-input {
  width: 100%;
  padding-right: 42px !important;
  font-family: var(--font-mono) !important;
  font-size: 12px !important;
  border-color: rgba(168,85,247,0.35) !important;
}
.apikey-input:focus {
  border-color: rgba(168,85,247,0.7) !important;
  box-shadow: 0 0 12px rgba(168,85,247,0.2) !important;
}
.apikey-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  transition: color 0.2s;
}
.apikey-toggle:hover { color: #c084fc; }

.apikey-error {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--red);
  background: rgba(255,34,68,0.1);
  border: 1px solid rgba(255,34,68,0.3);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 12px;
}
.apikey-modal__actions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.apikey-modal__actions .btn { flex: 1; justify-content: center; }
.apikey-confirm-btn {
  background: linear-gradient(135deg, rgba(0,240,255,0.1), rgba(168,85,247,0.2)) !important;
  border-color: #a855f7 !important;
  color: #e0aaff !important;
}
.apikey-confirm-btn:hover {
  background: linear-gradient(135deg, rgba(0,240,255,0.2), rgba(168,85,247,0.35)) !important;
  box-shadow: 0 0 16px rgba(168,85,247,0.4) !important;
}
.apikey-note {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.5px;
  line-height: 1.5;
}

/* Responsive drawer */
@media (max-width: 900px) {
  .gemini-drawer { width: 100%; }
  .btn-gemini span:not(.gemini-icon):not(.gemini-status-dot) { display: none; }
}
