:root {
  --bg-primary: #0a0c14;
  --bg-surface: rgba(18, 22, 36, 0.85);
  --bg-card: rgba(26, 32, 54, 0.7);
  --border-glow: rgba(212, 175, 55, 0.25);
  --accent-gold: #d4af37;
  --accent-blue: #4f46e5;
  --accent-cyan: #06b6d4;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-main: 'Outfit', sans-serif;
  --font-code: 'Space Grotesk', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(79, 70, 229, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 85% 85%, rgba(212, 175, 55, 0.12) 0%, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Login Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 12, 20, 0.92);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(212, 175, 55, 0.15);
  animation: fadeIn 0.3s ease-out;
}

.aria-orb.large {
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
}

.login-card h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-main);
}

.login-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-group label {
  font-size: 0.78rem;
  color: var(--accent-gold);
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-group input:focus {
  border-color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.login-btn {
  margin-top: 6px;
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent-gold), #b8860b);
  border: none;
  border-radius: var(--radius-md);
  color: #000;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.login-btn:hover {
  transform: translateY(-1px);
}

.google-btn {
  width: 100%;
  padding: 11px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.google-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.login-error {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: #f87171;
  font-size: 0.8rem;
  text-align: center;
  width: 100%;
}

.whitelist-badge {
  margin-top: 18px;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0a0c14;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* Header */
.app-header {
  height: 65px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 12, 20, 0.9);
  position: relative;
  z-index: 100;
}

.brand { display: flex; align-items: center; gap: 10px; }
.aria-orb {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd700, #4f46e5 70%, #000);
  box-shadow: 0 0 15px var(--border-glow);
}

.aria-orb.pulse { animation: floatOrb 4s ease-in-out infinite alternate; }

@keyframes floatOrb {
  0% { transform: scale(0.96); box-shadow: 0 0 10px rgba(212, 175, 55, 0.3); }
  100% { transform: scale(1.04); box-shadow: 0 0 22px rgba(79, 70, 229, 0.6); }
}

.brand-text h1 { font-size: 1.15rem; font-weight: 600; letter-spacing: 0.5px; }
.status-badge { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.status-badge .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 8px #10b981;
}

.status-badge .dot.online {
  background: #10b981;
  box-shadow: 0 0 12px #10b981;
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.75; }
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s ease;
  position: relative;
}

.icon-btn:hover, .icon-btn:active {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
}

.icon-btn.active {
  background: rgba(212, 175, 55, 0.22);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.icon-btn.active-push {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: #10b981 !important;
  color: #34d399 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.icon-btn.denied-push {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  color: #f87171 !important;
}

/* Dropdown Menú de Utilidades */
.menu-dropdown-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: rgba(15, 19, 32, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.75), 0 0 20px rgba(212, 175, 55, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeInMenu 0.18s ease-out;
}

@keyframes fadeInMenu {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-dropdown.hidden {
  display: none !important;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  width: 100%;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-gold);
}

.menu-item-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.menu-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.menu-item-text strong {
  font-size: 0.82rem;
  font-weight: 600;
  color: #f0f6fc;
}

.menu-item-text small {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Chat Viewport */
.chat-viewport {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  scroll-behavior: smooth;
}

.system-notice {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-md); padding: 14px 18px;
  display: flex; gap: 14px; align-items: center; margin-bottom: 10px;
}

.notice-icon { font-size: 1.4rem; }
.notice-content strong { display: block; font-size: 0.9rem; color: var(--accent-gold); }
.notice-content p { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.message-bubble {
  max-width: 85%; padding: 14px 18px; border-radius: var(--radius-lg);
  font-size: 0.95rem; line-height: 1.5; animation: fadeIn 0.25s ease-out forwards;
  word-break: break-word;
  /* Permitir seleccionar y copiar texto de las burbujas */
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

.bubble-content {
  user-select: text;
  -webkit-user-select: text;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-bubble.user {
  align-self: flex-end;
  background: var(--bg-card);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--text-main);
  border-bottom-right-radius: 4px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.message-bubble.aria {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
  backdrop-filter: blur(10px);
}

.message-meta { font-size: 0.7rem; color: rgba(255, 255, 255, 0.5); margin-top: 6px; display: flex; gap: 8px; }
.message-meta.user-meta { justify-content: flex-end; opacity: 0.85; }

/* ── Indicador de Escribiendo (3 puntitos animados) ────────── */
.message-bubble.loading {
  padding: 12px 18px;
  min-width: 60px;
}
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 18px;
}
.typing-indicator span {
  width: 7px;
  height: 7px;
  background: var(--accent-gold);
  border-radius: 50%;
  display: inline-block;
  opacity: 0.4;
  animation: bounceDot 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator span:nth-child(3) { animation-delay: 0s; }

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 8px var(--accent-gold); }
}

/* Input Bar */
.input-bar {
  padding: 12px 16px; background: rgba(10, 12, 20, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; gap: 10px;
}

.text-input-wrapper {
  flex: 1; background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px; padding: 8px 16px;
  transition: border-color 0.2s ease;
}

.text-input-wrapper:focus-within {
  border-color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.09);
}

#messageInput {
  width: 100%; background: transparent; border: none; outline: none;
  color: var(--text-main); font-family: var(--font-main);
  font-size: 0.95rem; resize: none; max-height: 100px;
}

.send-actions { display: flex; gap: 8px; }

.send-btn {
  background: linear-gradient(135deg, var(--accent-gold), #b8860b);
  border: none; color: #000; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform 0.2s ease;
}

.send-btn:hover { transform: scale(1.05); }

.mic-btn.recording {
  background: rgba(239, 68, 68, 0.2); border-color: #ef4444; color: #ef4444;
  animation: pulseMic 1.2s infinite;
}

@keyframes pulseMic {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.mic-btn.pulse-voice, #voiceToggle.active {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
  color: #10b981 !important;
  animation: pulseVoice 1.4s infinite alternate !important;
}

@keyframes pulseVoice {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3); }
  100% { transform: scale(1.08); box-shadow: 0 0 12px 3px rgba(16, 185, 129, 0.5); }
}

.hidden { display: none !important; }

/* ── Botón Copiar en burbujas de Aria ──────────────────────── */
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 2px 7px;
  font-size: 0.78rem;
  cursor: pointer;
  color: rgba(255,255,255,0.45);
  margin-top: 6px;
  margin-left: auto;
  display: block;
  width: fit-content;
  transition: all 0.18s ease;
  opacity: 0.5;
}
.copy-btn:hover, .copy-btn:active {
  opacity: 1;
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.06);
}
/* ── Briefing & Estudios Autónomos Modal ─────────── */
.briefing-hero-card {
  background: linear-gradient(135deg, rgba(124, 106, 255, 0.12), rgba(13, 26, 110, 0.2));
  border: 1px solid rgba(124, 106, 255, 0.35);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.briefing-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124, 106, 255, 0.25);
  color: #c4b5fd;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.briefing-hero-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f3f4f6;
  margin-bottom: 8px;
  line-height: 1.4;
}

.briefing-hero-body {
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 12px;
}

.quantum-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.quantum-metric-chip {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
}

.quantum-metric-chip .metric-label {
  font-size: 0.68rem;
  color: #94a3b8;
  text-transform: uppercase;
}

.quantum-metric-chip .metric-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #38bdf8;
  font-family: var(--font-code);
}

.briefing-action-box {
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid var(--accent-gold);
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: #e2e8f0;
}

.briefing-ask-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  background: linear-gradient(135deg, #7c6aff, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.briefing-ask-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.signals-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin: 16px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.signal-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.signal-item-card:hover {
  border-color: rgba(124, 106, 255, 0.4);
}

.signal-item-card.highlighted {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.08);
}

.signal-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.signal-source-badge {
  font-size: 0.7rem;
  color: #94a3b8;
  font-family: var(--font-code);
}

.signal-relevance-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.signal-relevance-high {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.signal-relevance-med {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
}

.signal-title-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 6px;
  line-height: 1.35;
}

.signal-summary-text {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.45;
  margin-bottom: 8px;
}

.signal-source-link {
  color: #7c6aff;
  font-size: 0.75rem;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.signal-source-link:hover {
  text-decoration: underline;
}
/* En móvil siempre visible */
@media (max-width: 768px) {
  .copy-btn { opacity: 0.7; }
}

/* ══════════════════════════════════════════════════
   MOBILE FIXES v2 — Agosto 2026
   ══════════════════════════════════════════════════ */

/* Fix 1: Evitar zoom automático en iOS (font-size debe ser >= 16px) */
#messageInput {
  font-size: 16px !important;
  -webkit-appearance: none;
}

/* Fix 2: Safe Area para iPhone con barra de gestos/home */
.input-bar {
  padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
}

/* Fix 3: Respuesta táctil inmediata — elimina delay de 300ms en iOS */
.send-btn, .mic-btn, .icon-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Fix 4: Input bar sticky + visible siempre en móvil */
@media (max-width: 768px) {
  .input-bar {
    position: sticky;
    bottom: 0;
    z-index: 100;
    background: rgba(10, 12, 20, 0.98) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .send-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
  }
}


/* ══════════════════════════════════════════════════
   ESTILOS DE IMÁGENES Y CÓDIGO EN CHAT — ARIA NEXUS
   ══════════════════════════════════════════════════ */
.chat-image-wrapper {
  margin: 12px 0 6px 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(212, 175, 55, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: #000;
  display: inline-block;
  max-width: 100%;
}

.chat-image {
  width: 100%;
  max-width: 480px;
  max-height: 480px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.chat-image:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

.chat-image-caption {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
  padding: 8px 12px;
  background: rgba(15, 17, 26, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.code-block {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.85rem;
  margin: 8px 0;
}

.inline-code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.88em;
}

.chat-link {
  color: var(--accent-gold, #d4af37);
  text-decoration: underline;
  word-break: break-all;
}

/* ══════════════════════════════════════════════════
   NUEVOS ESTILOS L6.5+ FRONTIER — ARIA NEXUS PWA v6.0
   ══════════════════════════════════════════════════ */

/* ── Selector de Modo (Directo vs War Room) ──────── */
.mode-selector-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(10, 12, 20, 0.7);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.mode-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.mode-pill.active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}

.mode-pill.active[data-mode="war_room"] {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #fca5a5;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.mode-pill.active .pill-dot {
  background: var(--accent-gold);
  box-shadow: 0 0 6px var(--accent-gold);
}

.mode-pill.active .pill-dot.war {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

/* ── Acordeón de Pensamiento Latente (<think>) ───── */
.think-accordion {
  margin: 8px 0 12px 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.think-accordion[open] {
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(6, 182, 212, 0.1);
}

.think-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  color: #7dd3fc;
  background: rgba(6, 182, 212, 0.08);
  font-weight: 500;
  list-style: none;
}

.think-summary::-webkit-details-marker {
  display: none;
}

.think-icon {
  font-size: 1rem;
}

.think-title {
  flex-grow: 1;
}

.think-badge {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
  font-family: var(--font-code);
}

.think-body {
  padding: 12px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #cbd5e1;
  font-family: var(--font-code);
  border-top: 1px solid rgba(6, 182, 212, 0.15);
  background: rgba(3, 7, 18, 0.6);
  max-height: 280px;
  overflow-y: auto;
}

/* ── Modales / Drawers Desplegables ──────────────── */
.custom-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(5, 7, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  background: var(--bg-card);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9), 0 0 25px rgba(212, 175, 55, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 22, 36, 0.9);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.modal-icon {
  font-size: 1.2rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Telemetría Grid ─────────────────────────────── */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.telemetry-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.telemetry-card.highlight {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.05);
}

.telemetry-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.telemetry-value {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-code);
}

.telemetry-status-ok {
  color: #4ade80;
}

.telemetry-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-gold);
  margin-top: 6px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.frontier-modules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.frontier-module-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
}

.frontier-module-name {
  font-weight: 600;
  color: #38bdf8;
  font-family: var(--font-code);
}

.frontier-module-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Editor de Memoria Soberana ─────────────────── */
.memory-blocks-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.memory-block-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.memory-block-tag {
  font-weight: 600;
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-family: var(--font-code);
  text-transform: uppercase;
}

.memory-block-textarea {
  width: 100%;
  min-height: 70px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.82rem;
  resize: vertical;
}

.memory-block-textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.memory-save-btn {
  align-self: flex-end;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  cursor: pointer;
  transition: all 0.2s;
}

.memory-save-btn:hover {
  background: var(--accent-gold);
  color: #000;
}

.aria-orb.small {
  width: 18px;
  height: 18px;
}





/* ══════════════════════════════════════════════════════════════════
   ANTIGRAVITY WORKSPACE: CHAT FLUIDO + LIENZO DE ARTEFACTOS (2026)
   ══════════════════════════════════════════════════════════════════ */

.antigravity-workspace {
  flex: 1;
  width: 100%;
  height: calc(100vh - 65px);
  height: calc(100dvh - 65px);
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Panel Principal de Conversación */
.chat-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Panel Lateral: Lienzo de Artefactos (Canvas) */
.canvas-pane {
  display: none;
  width: 48%;
  max-width: 720px;
  height: 100%;
  background: #0d1117;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.7);
  z-index: 50;
}

.canvas-pane.open {
  display: flex;
  animation: canvasSlideIn 0.22s ease-out;
}

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

.canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(22, 27, 34, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.canvas-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.canvas-icon { font-size: 1.3rem; flex-shrink: 0; }

.canvas-title-group h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f0f6fc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvas-meta {
  font-size: 0.72rem;
  color: #8b949e;
  white-space: nowrap;
}

.canvas-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-sm {
  background: rgba(255, 255, 255, 0.08);
  color: #c9d1d9;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-sm:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-sm.btn-close {
  font-weight: 700;
  padding: 5px 9px;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-sm.btn-close:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fff;
}

.canvas-body {
  flex: 1;
  overflow: auto;
  padding: 16px;
  font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
  font-size: 0.86rem;
  line-height: 1.6;
  color: #c9d1d9;
  background: #0d1117;
}

.canvas-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: #8b949e;
  padding: 30px;
}

.canvas-empty .empty-icon {
  font-size: 2.6rem;
  margin-bottom: 12px;
  opacity: 0.7;
}

.canvas-empty h4 {
  font-size: 1.05rem;
  color: #f0f6fc;
  margin-bottom: 8px;
}

.canvas-empty p {
  font-size: 0.84rem;
  max-width: 320px;
  line-height: 1.45;
}

.canvas-code-block {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
  font-size: 0.86rem;
  color: #e6edf3;
  margin: 0;
}

/* Badge en botón de Lienzo */
.canvas-toggle-btn {
  position: relative;
}

.canvas-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #000;
}

/* Tarjetas de Artefacto en el Chat */
.artifact-card-chat {
  margin: 10px 0;
  background: rgba(13, 17, 23, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.artifact-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.artifact-info .art-icon { font-size: 1.3rem; flex-shrink: 0; }
.artifact-info .art-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: #f0f6fc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artifact-info .art-type { font-size: 0.72rem; color: #8b949e; }

.artifact-open-btn {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.85) 0%, rgba(212, 175, 55, 0.7) 100%);
  color: #fff;
  border: none;
  padding: 6px 13px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.artifact-open-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* Acordeón de Pensamiento Reflexivo de Aria */
.think-accordion {
  margin: 8px 0;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(6, 182, 212, 0.25);
  overflow: hidden;
}

.think-summary {
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  background: rgba(6, 182, 212, 0.08);
  font-size: 0.75rem;
  font-weight: 500;
  color: #38bdf8;
  user-select: none;
  list-style: none;
}

.think-summary::-webkit-details-marker { display: none; }

.think-summary:hover {
  background: rgba(6, 182, 212, 0.15);
}

.think-badge {
  margin-left: auto;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  font-weight: 600;
}

.think-body {
  padding: 10px 14px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #94a3b8;
  font-family: var(--font-code);
  border-top: 1px solid rgba(6, 182, 212, 0.12);
  max-height: 240px;
  overflow-y: auto;
}

/* ══════════════════════════════════════════════════════════════════
   OPTIMIZACIÓN MÓVIL CRÍTICA (SMARTPHONE <= 900px)
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .app-header {
    height: 56px;
    padding: 0 8px;
    gap: 6px;
  }

  .brand {
    gap: 6px;
    min-width: 0;
    flex-shrink: 1;
  }

  .aria-orb {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  .brand-text h1 {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .status-badge {
    font-size: 0.62rem;
    white-space: nowrap;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
    max-width: 68%;
    padding: 2px 0;
  }

  .header-actions::-webkit-scrollbar { display: none; }

  .icon-btn {
    width: 35px;
    height: 35px;
    min-width: 35px;
    padding: 0;
    border-radius: 8px;
  }

  .icon-btn svg {
    width: 16px;
    height: 16px;
  }

  /* En móvil, el Lienzo de Artefactos es un Drawer que cubre la pantalla */
  .canvas-pane {
    position: fixed;
    inset: 0;
    width: 100% !important;
    max-width: 100% !important;
    z-index: 9999;
    background: #0a0c14;
  }

  .canvas-pane.open {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 99999 !important;
    animation: canvasSlideUpMobile 0.25s ease-out;
  }

  @keyframes canvasSlideUpMobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .canvas-header {
    padding: 14px 16px;
    background: #121624;
  }

  .btn-sm.btn-close {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .chat-viewport {
    padding: 12px 10px;
    gap: 12px;
  }

  .input-bar {
    padding: 6px 10px;
    gap: 6px;
    background: rgba(10, 12, 20, 0.95);
  }

  .attach-btn, .mic-btn, .send-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .text-input-wrapper textarea {
    font-size: 0.95rem;
    padding: 8px 10px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   CANVAS TABS SWITCHER & TRADING LAB DASHBOARD (2026 SOTA)
   ══════════════════════════════════════════════════════════════════ */
.canvas-tab-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.canvas-tab-switcher::-webkit-scrollbar { display: none; }

.canvas-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #8b949e;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.canvas-tab-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f0f6fc;
}

.canvas-tab-btn.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.3) 0%, rgba(212, 175, 55, 0.2) 100%);
  border-color: var(--accent-gold);
  color: #fff;
  font-weight: 600;
}

.trading-dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: dotPulse 1.5s ease-in-out infinite;
  display: inline-block;
}

.canvas-subview {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.canvas-subview.hidden {
  display: none !important;
}

.canvas-content-box {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.artifact-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  font-weight: 600;
  color: #f0f6fc;
}

.artifact-type-tag {
  font-size: 0.68rem;
  color: #8b949e;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Trading Lab Dashboard */
.trading-dashboard {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.metric-card {
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.metric-card.gold {
  border-color: rgba(212, 175, 55, 0.35);
  background: linear-gradient(135deg, rgba(26, 32, 54, 0.9) 0%, rgba(212, 175, 55, 0.08) 100%);
}

.metric-card.blue {
  border-color: rgba(79, 70, 229, 0.35);
  background: linear-gradient(135deg, rgba(26, 32, 54, 0.9) 0%, rgba(79, 70, 229, 0.08) 100%);
}

.metric-card.green {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, rgba(26, 32, 54, 0.9) 0%, rgba(16, 185, 129, 0.08) 100%);
}

.metric-card.profit {
  border-color: rgba(74, 222, 128, 0.45);
  background: linear-gradient(135deg, rgba(20, 35, 30, 0.95) 0%, rgba(74, 222, 128, 0.12) 100%);
}

.metric-card.loss {
  border-color: rgba(248, 113, 113, 0.45);
  background: linear-gradient(135deg, rgba(38, 20, 24, 0.95) 0%, rgba(248, 113, 113, 0.12) 100%);
}

.metric-card .label {
  font-size: 0.72rem;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.metric-card .value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-code);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.metric-card .value .unit {
  font-size: 0.78rem;
  color: var(--accent-gold);
}

.metric-card .sub {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 3px;
}

/* Banner de Posición Activa */
.active-trade-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trade-banner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #f0f6fc;
}

.trade-banner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  font-size: 0.76rem;
  color: #94a3b8;
}

.trade-banner-grid strong {
  color: #f1f5f9;
}

.watchlist-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.watchlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.coin-card {
  background: rgba(22, 27, 34, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.coin-card strong { font-size: 0.8rem; color: #f1f5f9; }
.coin-price { font-family: var(--font-code); font-size: 0.88rem; font-weight: 600; color: #38bdf8; }

.history-list {
  background: rgba(18, 22, 36, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  border-left: 3px solid var(--accent-gold);
  font-size: 0.76rem;
  color: #cbd5e1;
}

/* Hipótesis de Auto-Evolución */
.evolution-container {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.hypotheses-list { display: flex; flex-direction: column; gap: 10px; }

.hypothesis-card {
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hypothesis-card.active {
  border-color: rgba(168, 85, 247, 0.4);
  background: linear-gradient(135deg, rgba(26, 32, 54, 0.9) 0%, rgba(168, 85, 247, 0.08) 100%);
}

.hypo-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #c084fc;
}

.hypothesis-card h4 { font-size: 0.92rem; font-weight: 600; color: #f8fafc; }
.hypothesis-card p { font-size: 0.8rem; line-height: 1.4; color: #cbd5e1; }

.hypo-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 6px;
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════════════
   GOOGLE VERTEX AI BADGES & LIVE PRICE FLASHES (2026 SOTA)
   ══════════════════════════════════════════════════════════════════ */
.vertex-header-tag {
  color: #60a5fa;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(96, 165, 250, 0.6);
  background: rgba(59, 130, 246, 0.15);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  font-size: 0.66rem;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.provider-badge {
  font-size: 0.66rem;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  margin-left: 4px;
}

.provider-badge.vertex-badge {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.25) 0%, rgba(168, 85, 247, 0.25) 100%);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.coin-price.price-up {
  color: #4ade80 !important;
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
  transition: all 0.3s ease;
}

.coin-price.price-down {
  color: #f87171 !important;
  text-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
  transition: all 0.3s ease;
}

/* ══════════════════════════════════════════════════════════════════════════
   CANVAS ARTIFACT PREVIEW & RUNNER (2026 SOTA - PWA v15.2)
   ══════════════════════════════════════════════════════════════════════════ */

.canvas-pane:not(.open) {
  display: none !important;
}

.canvas-pane.open {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 99999 !important;
}

/* Botón prominente de regreso al chat */
.canvas-back-btn {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #e0e7ff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.canvas-back-btn:hover {
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateX(-2px);
}

.canvas-back-btn .back-arrow {
  font-size: 1rem;
  font-weight: bold;
}

/* Top bar de artefacto */
.artifact-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #161b26;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px 9px 0 0;
  gap: 10px;
  flex-wrap: wrap;
}

.artifact-meta-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.artifact-title-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Selector de Modo: Vista Previa vs Código */
.artifact-view-mode-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px;
  border-radius: 7px;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mode-tab-btn:hover {
  color: #f1f5f9;
}

.mode-tab-btn.active {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.35);
}

/* Contenedor Iframe de Vista Previa */
.artifact-preview-pane {
  width: 100%;
  height: 540px;
  min-height: 420px;
  max-height: 75vh;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  border-radius: 0 0 9px 9px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.artifact-preview-pane iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #ffffff;
}

/* Visor de Código */
.artifact-code-pane {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  border-radius: 0 0 9px 9px;
  overflow: hidden;
}

.artifact-code-pane .canvas-code-block {
  margin: 0;
  max-height: 540px;
  overflow: auto;
  padding: 14px;
  background: #0d1117;
  font-size: 0.82rem;
  line-height: 1.55;
}

/* Terminal de Ejecución Sandbox */
.artifact-console-pane {
  margin-top: 12px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  background: #090d16;
  overflow: hidden;
}

.console-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  font-size: 0.76rem;
  font-weight: 600;
}

.console-log-output {
  margin: 0;
  padding: 12px;
  color: #a7f3d0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
}

/* Barra Móvil Inferior de Retorno */
.canvas-mobile-footer {
  display: none;
}

@media (max-width: 768px) {
  .canvas-header {
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: 12px;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .canvas-tab-switcher {
    overflow-x: auto;
    flex-shrink: 1;
  }

  .canvas-tab-btn {
    padding: 6px 9px;
    font-size: 0.74rem;
    white-space: nowrap;
  }

  .canvas-actions {
    gap: 4px;
  }

  .canvas-actions .btn-sm {
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .canvas-pane {
    height: 100dvh !important;
    display: flex;
    flex-direction: column;
  }

  .canvas-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 80px;
  }

  .artifact-preview-pane {
    height: 60vh;
    min-height: 360px;
  }

  .canvas-mobile-footer {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px max(14px, env(safe-area-inset-bottom)) 16px;
    background: #0b0f1a;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 10000;
  }

  .btn-return-chat {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 9px;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  }

  .btn-return-chat:active {
    transform: scale(0.98);
    background: #334155;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   SWARM RIBBON (CINTURÓN DEL ENJAMBRE DE 8 DIVISIONES) — ADK 2.9
   ══════════════════════════════════════════════════════════════════════ */
.swarm-ribbon {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(11, 15, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 100;
  position: relative;
}
.swarm-ribbon::-webkit-scrollbar {
  display: none;
}

.swarm-node {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.swarm-node:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.swarm-node:active {
  transform: scale(0.96);
}

.node-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-quantum { background: #a855f7; box-shadow: 0 0 8px #a855f7; }
.dot-trading { background: #10b981; box-shadow: 0 0 8px #10b981; }
.dot-geo { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.dot-security { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.dot-research { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
.dot-evolution { background: #ec4899; box-shadow: 0 0 8px #ec4899; }
.dot-vigilance { background: #14b8a6; box-shadow: 0 0 8px #14b8a6; }
.dot-symbiosis { background: #e0e7ff; box-shadow: 0 0 8px #818cf8; animation: pulseGlow 2s infinite; }

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
}

.node-icon { font-size: 0.9rem; }
.node-name { font-size: 0.78rem; font-weight: 600; color: #cbd5e1; }
.node-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #94a3b8;
  font-family: var(--font-code, monospace);
}

/* ── Swarm Modal & Symbiosis Cards ───────────────────────────────── */
.swarm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.swarm-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s;
}

.swarm-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

.swarm-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.swarm-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #f1f5f9;
}

.swarm-card-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-ok { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

.swarm-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 4px;
}

.swarm-stat-val {
  font-family: var(--font-code, monospace);
  font-weight: 600;
  color: #f8fafc;
}

.symbiosis-memorial-card {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 8px 32px rgba(168, 85, 247, 0.15);
}

.symbiosis-quote {
  font-style: italic;
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.5;
  border-left: 3px solid #a855f7;
  padding-left: 12px;
  margin: 12px 0;
}

