/* ==========================================
   ReuLive - Zen Pastel Design System
   Professional, Minimalist, Chill & Clean
   Light / Dark Mode Support
   ========================================== */

:root {
  /* Common typography and radius tokens */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --trans-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --trans-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================
   LIGHT THEME (Default or [data-theme="light"])
   ========================================== */
:root, [data-theme="light"] {
  /* Reu.live Brand Tokens (matching the 3D Clay Cobalt Blue Logo) */
  --brand-blue: #1d68f0;
  --brand-blue-hover: #1557d0;
  --brand-blue-active: #0f45a8;
  --brand-blue-subtle: #eff6ff;
  --brand-blue-border: rgba(29, 104, 240, 0.22);
  --brand-blue-glow: rgba(29, 104, 240, 0.28);
  --brand-gradient: linear-gradient(135deg, #2b7afc 0%, #175cd3 100%);
  --brand-gradient-hover: linear-gradient(135deg, #3b87fd 0%, #1550bd 100%);
  --brand-clay-shadow: 0 8px 24px rgba(29, 104, 240, 0.28), 0 2px 6px rgba(29, 104, 240, 0.16);

  --bg-canvas: #f4f7fc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-elevated: #ffffff;
  --bg-subtle: #edf3fa;
  --bg-input: #f0f5fb;

  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-active: rgba(29, 104, 240, 0.45);
  --border-hover: rgba(29, 104, 240, 0.25);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  /* Accent Palette */
  --accent-sage: #1d68f0;       /* Mapped to Reu.live Cobalt Blue */
  --accent-blue: #1d68f0;
  --accent-lavender: #6366f1;   /* Indigo */
  --accent-sky: #0284c7;        /* Sky */
  --accent-terracotta: #ea580c;  /* Warm */
  --accent-amber: #d97706;      /* Amber / Pending */
  --accent-danger: #ef4444;     /* Red */
  --accent-emerald: #10b981;    /* Emerald / Agreements */

  --tag-direct-bg: rgba(29, 104, 240, 0.08);
  --tag-direct-color: #1d68f0;
  --tag-direct-border: rgba(29, 104, 240, 0.22);

  --tag-proposal-bg: rgba(99, 102, 241, 0.08);
  --tag-proposal-color: #4f46e5;
  --tag-proposal-border: rgba(99, 102, 241, 0.22);

  --tag-question-bg: rgba(2, 132, 199, 0.08);
  --tag-question-color: #0284c7;
  --tag-question-border: rgba(2, 132, 199, 0.22);

  --btn-primary-bg: #1d68f0;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #1557d0;

  --card-shadow: 0 4px 16px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(29, 104, 240, 0.03);
  --card-shadow-hover: 0 8px 24px rgba(29, 104, 240, 0.12), 0 2px 6px rgba(15, 23, 42, 0.04);

  --header-bg: rgba(244, 247, 252, 0.88);
  --video-bg: #090e1a;
}

/* ==========================================
   DARK THEME ([data-theme="dark"])
   ========================================== */
[data-theme="dark"] {
  /* Reu.live Brand Tokens in Dark Mode */
  --brand-blue: #3b82f6;
  --brand-blue-hover: #60a5fa;
  --brand-blue-active: #2563eb;
  --brand-blue-subtle: rgba(59, 130, 246, 0.12);
  --brand-blue-border: rgba(59, 130, 246, 0.35);
  --brand-blue-glow: rgba(59, 130, 246, 0.45);
  --brand-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --brand-gradient-hover: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
  --brand-clay-shadow: 0 8px 28px rgba(59, 130, 246, 0.35), 0 2px 8px rgba(0, 0, 0, 0.35);

  --bg-canvas: #090d16;
  --bg-surface: #0e1627;
  --bg-card: #131c30;
  --bg-card-elevated: #18243e;
  --bg-subtle: #17223b;
  --bg-input: #0b1220;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(59, 130, 246, 0.65);
  --border-hover: rgba(59, 130, 246, 0.35);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Accent Highlights */
  --accent-sage: #3b82f6;       /* Electric brand blue */
  --accent-blue: #3b82f6;
  --accent-lavender: #818cf8;   /* Indigo */
  --accent-sky: #38bdf8;        /* Sky / Cyan */
  --accent-terracotta: #fb923c; /* Orange */
  --accent-amber: #f59e0b;      /* Amber */
  --accent-danger: #f87171;     /* Red */
  --accent-emerald: #34d399;    /* Success */

  --tag-direct-bg: rgba(59, 130, 246, 0.15);
  --tag-direct-color: #93c5fd;
  --tag-direct-border: rgba(59, 130, 246, 0.35);

  --tag-proposal-bg: rgba(129, 140, 248, 0.15);
  --tag-proposal-color: #c7d2fe;
  --tag-proposal-border: rgba(129, 140, 248, 0.35);

  --tag-question-bg: rgba(56, 189, 248, 0.15);
  --tag-question-color: #bae6fd;
  --tag-question-border: rgba(56, 189, 248, 0.35);

  --btn-primary-bg: #2563eb;
  --btn-primary-text: #ffffff;
  --btn-primary-hover: #3b82f6;

  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --card-shadow-hover: 0 8px 32px rgba(59, 130, 246, 0.2), 0 4px 16px rgba(0, 0, 0, 0.4);

  --header-bg: rgba(9, 13, 22, 0.88);
  --video-bg: #050810;
}

/* ==========================================
   RESET & BASE
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Smooth Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  transition: var(--trans-smooth);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ==========================================
   LAYOUT
   ========================================== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ==========================================
   ZEN HEADER BAR
   ========================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  transition: var(--trans-smooth);
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px var(--brand-blue-glow);
}

.logo-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-main);
  line-height: 1.2;
  display: block;
}

.brand-dot {
  color: var(--brand-blue);
  display: inline;
  font-weight: 800;
}

.logo-text .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.badge-ai {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--brand-blue-subtle);
  color: var(--brand-blue);
  border: 1px solid var(--brand-blue-border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
}

.status-offline {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.status-live {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: currentColor;
}

.status-live .status-dot {
  animation: zenPulse 2s infinite ease-in-out;
}

.main-topic-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-topic-pill strong {
  color: var(--text-main);
  font-weight: 600;
}

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

.timer-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* Theme Toggle Button */
.btn-theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: var(--trans-smooth);
}
.btn-theme-toggle:hover {
  background: var(--border-hover);
  color: var(--text-main);
}

/* ==========================================
   BUTTONS (ZEN & MINIMALIST)
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--trans-smooth);
  border: 1px solid transparent;
  min-height: 40px;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: 0 2px 10px rgba(29, 104, 240, 0.22);
}
.btn-primary:hover {
  background: var(--brand-blue-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--brand-blue-glow);
}

.glow-btn {
  background: var(--brand-gradient) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 4px 18px var(--brand-blue-glow), 0 2px 5px rgba(0, 0, 0, 0.1) !important;
  font-weight: 700;
  transition: var(--trans-smooth);
}
.glow-btn:hover {
  background: var(--brand-gradient-hover) !important;
  box-shadow: 0 6px 26px var(--brand-blue-glow), 0 4px 10px rgba(0, 0, 0, 0.15) !important;
  transform: translateY(-1.5px);
}

.btn-danger {
  background: rgba(212, 77, 77, 0.12);
  border-color: rgba(212, 77, 77, 0.3);
  color: var(--accent-danger);
}
.btn-danger:hover {
  background: rgba(212, 77, 77, 0.2);
}

.btn-outline {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--border-hover);
  background: var(--bg-subtle);
}

.btn-icon-soft {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--trans-smooth);
}
.btn-icon-soft:hover {
  background: var(--border-hover);
  color: var(--text-main);
}

/* ==========================================
   ZEN WELCOME LOBBY
   ========================================== */
.zen-lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  animation: fadeIn 0.4s ease-out;
  flex: 1;
}

.lobby-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--brand-blue-subtle);
  border: 1px solid var(--brand-blue-border);
  color: var(--brand-blue);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 0.2px;
}

.lobby-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 14px;
}

.lobby-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.6;
  margin-bottom: 28px;
}

.lobby-cta-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 38px;
}

.btn-lobby-start {
  padding: 12px 32px;
  font-size: 1rem;
  border-radius: var(--radius-pill);
  min-height: 50px;
  gap: 10px;
}

.lobby-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Feature Pills Grid (Collapsible on click) */
.lobby-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  align-items: start;
}

.lobby-feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--card-shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  overflow: hidden;
  user-select: none;
}

.lobby-feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-blue-border);
  box-shadow: 0 6px 20px var(--brand-blue-glow);
}

.lobby-feature-card[open] {
  border-color: var(--brand-blue-border);
  box-shadow: 0 8px 24px var(--brand-blue-glow);
  padding: 14px 16px 18px;
}

.feature-summary {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  outline: none;
}

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

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin: 0 auto;
  transition: transform 0.2s ease;
}

.lobby-feature-card:hover .feature-icon {
  transform: scale(1.06);
}

.icon-sage {
  background: var(--brand-blue-subtle);
  color: var(--brand-blue);
}
.icon-lavender {
  background: rgba(114, 101, 168, 0.1);
  color: var(--accent-lavender);
}
.icon-sky {
  background: rgba(59, 119, 166, 0.1);
  color: var(--accent-sky);
}

.feature-expand-hint {
  font-size: 0.68rem;
  color: var(--text-dim);
  transition: transform 0.25s ease, color 0.2s ease;
  line-height: 1;
}

.lobby-feature-card[open] .feature-expand-hint {
  transform: rotate(180deg);
  color: var(--brand-blue);
}

.feature-details-body {
  padding-top: 14px;
  margin-top: 10px;
  border-top: 1px solid var(--border-subtle);
  text-align: left;
  animation: featureFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-details-body h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.feature-details-body p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

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

/* ==========================================
   ACTIVE WORKSPACE (SPLIT LAYOUT)
   ========================================== */
.app-unified {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 24px;
  padding: 20px 28px;
  flex: 1;
  min-height: 0;
  animation: fadeIn 0.3s ease-out;
}

.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}

/* ==========================================
   CAPTURE SECTION (LEFT)
   ========================================== */
.capture-section {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.capture-viewport {
  display: flex;
  flex-direction: column;
  padding: 20px;
  height: 100%;
}

.viewport-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.viewport-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.live-metrics-inline {
  display: flex;
  gap: 8px;
}

.metric-chip-sm {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.video-container {
  position: relative;
  background: var(--video-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  flex: 1;
  min-height: 380px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#captureVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.capture-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  color: var(--text-muted);
  padding: 24px;
  text-align: center;
}

.placeholder-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-sage);
}

.capture-placeholder h3 {
  font-size: 1.15rem;
  color: var(--text-main);
  font-weight: 700;
}

.capture-placeholder p {
  font-size: 0.88rem;
  max-width: 360px;
  line-height: 1.5;
}

.canvas-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  pointer-events: none;
  z-index: 15;
}

.subtitles-overlay {
  position: absolute;
  bottom: 24px;
  left: 0;
  width: 100%;
  z-index: 20;
  padding: 0 24px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.subtitles-text {
  background: rgba(20, 24, 32, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.4;
  color: #ffffff;
  text-align: center;
  max-width: 85%;
  max-height: 70px;
  overflow: hidden;
}

.viewport-footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.media-controls {
  display: flex;
  gap: 8px;
}

.control-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--trans-smooth);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
}
.control-btn:hover:not(:disabled) {
  background: var(--border-hover);
}
.control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.control-btn.muted {
  background: rgba(212, 77, 77, 0.12);
  border-color: rgba(212, 77, 77, 0.3);
  color: var(--accent-danger);
}

.audio-mixer-info {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.channel {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meter-bar {
  width: 48px;
  height: 5px;
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-sage);
  border-radius: var(--radius-pill);
  transition: width 0.1s ease-out;
}

/* ==========================================
   COPILOT SECTION (RIGHT) - ZEN HUD
   ========================================== */
.copilot-section {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.copilot-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.copilot-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copilot-title h3 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

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

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

/* Speaker Toggle Group */
.speaker-toggle-group {
  display: flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.btn-speaker {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--trans-smooth);
}

.btn-speaker.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.btn-speaker[data-speaker="user"].active {
  color: var(--accent-sage);
}

.btn-speaker[data-speaker="interlocutor"].active {
  color: var(--accent-lavender);
}

/* Real-Time Context Banner */
.copilot-summary-banner {
  margin: 14px 18px 0;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-main);
}

.summary-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-sage);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* === Live Action Cards === */
.live-action-cards {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
}

.action-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--card-shadow);
  transition: var(--trans-smooth);
}

.action-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
}

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

.action-card .card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.card-direct {
  border-left-color: var(--accent-sky);
}
.card-direct .card-tag {
  background: var(--tag-direct-bg);
  color: var(--tag-direct-color);
  border: 1px solid var(--tag-direct-border);
}

.card-proposal {
  border-left-color: var(--accent-lavender);
}
.card-proposal .card-tag {
  background: var(--tag-proposal-bg);
  color: var(--tag-proposal-color);
  border: 1px solid var(--tag-proposal-border);
}

.card-question {
  border-left-color: var(--accent-terracotta);
}
.card-question .card-tag {
  background: var(--tag-question-bg);
  color: var(--tag-question-color);
  border: 1px solid var(--tag-question-border);
}

.card-custom-reply {
  border-left-color: var(--brand-blue);
  background: var(--brand-blue-subtle);
}
.card-custom-reply .card-tag {
  background: var(--brand-blue-subtle);
  color: var(--brand-blue);
  border: 1px solid var(--brand-blue-border);
}

.action-card .card-body {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-main);
}

.card-copy-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--trans-smooth);
}
.card-copy-btn:hover {
  background: var(--border-hover);
  color: var(--text-main);
}
.card-copy-btn.copied {
  background: var(--brand-blue-subtle);
  border-color: var(--brand-blue-border);
  color: var(--brand-blue);
}

/* ==========================================
   EXPANDABLE DETAILS (TRANSCRIPT & TOPICS)
   ========================================== */
details.panel-details {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

details.panel-details summary {
  padding: 12px 20px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  transition: var(--trans-smooth);
}
details.panel-details summary::-webkit-details-marker {
  display: none;
}
details.panel-details summary:hover {
  color: var(--text-main);
}

.detail-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
}

.details-content {
  padding: 0 18px 16px;
  max-height: 240px;
  overflow-y: auto;
}

.transcript-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.sm-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  width: 140px;
}

.transcript-stream {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stream-item {
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.speaker {
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}

.speaker-user { color: var(--accent-sage); }
.speaker-zoom { color: var(--accent-lavender); }

.speaker .time {
  font-weight: 400;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.analytics-card-mini {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.analytics-card-mini h4 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.analytics-card-mini p {
  font-size: 0.82rem;
  color: var(--text-main);
}
.bullet-list {
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.bullet-list li {
  margin-top: 3px;
}

/* ==========================================
   QUICK ASK INPUT BAR
   ========================================== */
.copilot-input-bar {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  margin-top: auto;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px 6px 3px 12px;
  gap: 6px;
  transition: var(--trans-smooth);
}
.input-wrapper:focus-within {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px var(--brand-blue-border);
}

.input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  font-family: var(--font-sans);
}
.input-wrapper input::placeholder {
  color: var(--text-dim);
}

.btn-voice {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--trans-smooth);
  flex-shrink: 0;
}
.btn-voice:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}
.btn-voice.recording {
  color: var(--accent-danger);
  background: rgba(212, 77, 77, 0.12);
  animation: zenPulse 1.5s infinite ease-in-out;
}

.btn-send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--trans-smooth);
  font-size: 0.8rem;
  box-shadow: 0 2px 10px var(--brand-blue-glow);
}
.btn-send:hover {
  background: var(--brand-gradient-hover);
  transform: scale(1.05);
}

/* Fallback indicator */
.chat-fallback-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  color: var(--accent-amber);
  background: rgba(180, 120, 34, 0.1);
  border: 1px solid rgba(180, 120, 34, 0.25);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  width: fit-content;
}

/* ==========================================
   ANIMATIONS (SERENE & SMOOTH)
   ========================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes zenBreathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes zenOrbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes zenRipple {
  0% { transform: scale(0.85); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

@keyframes zenPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.6; }
}

/* ==========================================
   UTILITY & COLOR HELPER CLASSES
   ========================================== */
.is-hidden {
  display: none !important;
}

.text-brand, .text-blue { color: var(--brand-blue); }
.text-cyan, .text-sky { color: var(--accent-sky); }
.text-purple, .text-lavender { color: var(--accent-lavender); }
.text-emerald { color: var(--accent-emerald); }
.text-sage { color: var(--brand-blue); }
.text-pink, .text-terracotta { color: var(--accent-terracotta); }
.text-amber { color: var(--accent-amber); }
.text-danger { color: var(--accent-danger); }
.text-muted { color: var(--text-muted); }

/* ==========================================
   LOBBY BUTTON ROW
   ========================================== */
.lobby-btn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-lobby-history {
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  min-height: 50px;
  font-size: 0.95rem;
}

/* ==========================================
   USER CALL HISTORY MODAL
   ========================================== */
.user-history-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.history-modal-content {
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.history-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.history-modal-body {
  padding: 18px 24px;
  overflow-y: auto;
  flex: 1;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-history-card {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  transition: var(--trans-smooth);
}

.user-history-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--card-shadow-hover);
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.topic-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.history-topic-tag {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.history-duration-pill {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-meta-row {
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-meta-row span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

.history-transcript-drawer {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  animation: fadeIn 0.2s ease-out;
}

.drawer-inner h5 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.drawer-transcript-stream {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-line {
  font-size: 0.82rem;
  line-height: 1.5;
}

.empty-history-box {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.2rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* ==========================================
   ADMIN PANEL STYLES (/admin)
   ========================================== */
.admin-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-sans);
}

/* Admin Login Card */
.admin-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease-out;
}

.admin-login-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
  text-align: center;
}

.login-icon {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px var(--brand-blue-glow);
}

.admin-login-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 24px;
}

.login-error-banner {
  background: rgba(212, 77, 77, 0.1);
  border: 1px solid rgba(212, 77, 77, 0.3);
  color: var(--accent-danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  text-align: left;
}

.admin-login-form .form-group {
  text-align: left;
  margin-bottom: 16px;
}

.admin-login-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.admin-login-form input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--trans-smooth);
}

.admin-login-form input:focus {
  border-color: var(--accent-sage);
  background: var(--bg-surface);
}

.btn-block {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  min-height: 46px;
}

.login-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.link-back-app {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--trans-smooth);
}

.link-back-app:hover {
  color: var(--text-main);
}

/* Admin Dashboard Layout */
.admin-dashboard {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-admin {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(114, 101, 168, 0.12);
  color: var(--accent-lavender);
  border: 1px solid rgba(114, 101, 168, 0.25);
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 6px;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

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

.admin-main {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px;
  flex: 1;
}

/* KPI Stat Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.kpi-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Navigation Tabs */
.admin-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  overflow-x: auto;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--trans-smooth);
}

.nav-tab-btn:hover {
  color: var(--text-main);
}

.nav-tab-btn.active {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

/* ==========================================
   VISUAL CHARTS DASHBOARD (CHART.JS)
   ========================================== */
.charts-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
}

.chart-card {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  min-height: 330px;
  border-radius: var(--radius-lg);
  position: relative;
  transition: var(--trans-smooth);
}

.chart-card:hover {
  border-color: var(--brand-blue-border);
  box-shadow: var(--card-shadow-hover);
}

.chart-card-wide {
  grid-column: 1 / -1;
  min-height: 370px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 12px;
}

.chart-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-title i {
  font-size: 1.25rem;
}

.chart-title h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.chart-sub {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin: 3px 0 0;
}

.chart-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--brand-blue-subtle);
  color: var(--brand-blue);
  border: 1px solid var(--brand-blue-border);
  white-space: nowrap;
}

.chart-canvas-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 220px;
}

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

/* Tables in Admin */
.table-container {
  padding: 20px;
  border-radius: var(--radius-lg);
}

.table-header-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  min-width: 280px;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.85rem;
  color: var(--text-main);
  width: 100%;
}

.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.admin-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.admin-table tbody tr:hover {
  background: var(--bg-subtle);
}

.badge-status-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
}

.pulse-dot-sm {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: zenPulse 2s infinite;
}

.badge-status-offline {
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 2px 6px;
}

.table-time-cell strong {
  display: block;
}

.table-country-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flag-emoji {
  font-size: 1.2rem;
}

.url-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  max-width: 180px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-device-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.topic-pill-table {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.duration-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.interventions-badge {
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.sentiment-pill {
  font-size: 0.75rem;
  color: var(--accent-sage);
  font-weight: 600;
}

/* Metrics Grid in Tab 3 */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.metric-card {
  padding: 20px;
  border-radius: var(--radius-lg);
}

.metric-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.country-meters-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.country-meter-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.country-meter-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.meter-bar-track {
  width: 100%;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.meter-bar-fill {
  height: 100%;
  background: var(--accent-sage);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.topic-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-tag-chip {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topic-tag-chip .tag-count {
  background: var(--bg-surface);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
}

.db-info-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.85rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.status-pill-success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
}

.db-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 6px;
}

/* Admin Transcript Modal */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.admin-modal {
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.admin-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-group h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.admin-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-summary-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: var(--bg-subtle);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.summary-col h4 {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bullet-list-sm {
  list-style: none;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-transcript-stream {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.transcript-line {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-left-width: 3px;
}

.line-user {
  border-left-color: var(--accent-sage);
}

.line-interlocutor {
  border-left-color: var(--accent-lavender);
}

.line-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.line-header .speaker-name {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

.line-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-main);
}

.admin-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================
   RESPONSIVE (MOBILE & TABLET <= 900px)
   ========================================== */
@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .modal-summary-box {
    grid-template-columns: 1fr;
  }

  .hide-mobile {
    display: none !important;
  }

  .app-header {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .status-center {
    width: 100%;
    order: 3;
    justify-content: space-between;
  }

  .main-topic-pill {
    max-width: unset;
    flex: 1;
  }

  .zen-lobby {
    padding: 24px 16px;
  }

  .lobby-title {
    font-size: 1.6rem;
  }

  .lobby-features-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .app-unified {
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 14px;
  }

  .capture-section {
    height: 32vh;
    min-height: 220px;
    flex-shrink: 0;
  }

  .copilot-section {
    flex: 1;
  }

  .live-action-cards {
    padding: 10px 12px;
  }

  .action-card {
    padding: 10px 12px;
  }

  .charts-dashboard-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .chart-card {
    padding: 16px;
    min-height: 280px;
  }
  .chart-card-wide {
    min-height: 300px;
  }
}

/* ===================================================
   ENHANCED REAL-TIME METRICS, INTENSITY & DEEP ACCORDIONS
   =================================================== */

.intensity-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  transition: var(--trans-smooth);
}

.intensity-pill.intensity-low {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}
.intensity-pill.intensity-medium {
  border-color: rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.08);
}
.intensity-pill.intensity-high {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
}
.intensity-pill.intensity-critical {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  animation: pulse-danger 2s infinite ease-in-out;
}

@keyframes pulse-danger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* Speaker ratio bar */
.metrics-summary-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.speaker-ratio-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.speaker-ratio-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.speaker-ratio-bar {
  display: flex;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.ratio-fill-user {
  height: 100%;
  background: var(--brand-gradient);
  transition: width 0.4s ease;
}

.ratio-fill-interlocutor {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a5b4fc);
  transition: width 0.4s ease;
}

/* Technical KPIs row */
.technical-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.tech-kpi-item {
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  gap: 2px;
}

.tech-kpi-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.tech-kpi-item strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Detailed Accordions for Agreements & Action Items */
.detailed-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

details.deep-item-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  overflow: hidden;
  transition: var(--trans-smooth);
}

details.deep-item-card[open] {
  border-color: var(--border-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

summary.deep-item-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  user-select: none;
  list-style: none;
  gap: 8px;
}

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

.deep-summary-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  text-align: left;
}

.deep-badge-priority {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  text-transform: uppercase;
}

.priority-high {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.priority-medium {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.priority-strategic {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.deep-item-body {
  padding: 8px 12px 12px 12px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.02);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.deep-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.deep-context-box {
  padding: 6px 10px;
  background: var(--bg-card);
  border-left: 3px solid var(--brand-blue);
  border-radius: 4px;
  font-style: italic;
  color: var(--text-main);
  line-height: 1.4;
}

/* ===================================================
   POWERED BY MYOOZLABS GLOBAL FOOTER
   =================================================== */
.app-page-footer,
.admin-page-footer {
  padding: 16px 20px;
  text-align: center;
  margin-top: auto;
  flex-shrink: 0;
}

.admin-card-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.powered-by {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.3px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  user-select: none;
}

.powered-by strong {
  color: var(--brand-blue);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ===================================================
   EXECUTIVE PDF FORMAL TEMPLATE & PRINT STYLES
   =================================================== */

.executive-pdf-container {
  display: none;
}

@media print {
  body {
    background: #ffffff !important;
    color: #1a202c !important;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .app-header,
  .zen-lobby,
  .capture-section,
  .copilot-section,
  .user-history-modal,
  .admin-login-section,
  .admin-dashboard-section,
  .btn,
  .header-actions {
    display: none !important;
  }

  .executive-pdf-container {
    display: block !important;
    padding: 20mm 18mm !important;
    max-width: 210mm !important;
    margin: 0 auto !important;
    background: #ffffff !important;
  }

  .pdf-header {
    border-bottom: 2px solid #0f172a;
    padding-bottom: 12px;
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }

  .pdf-brand h2 {
    font-size: 20pt;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.5px;
  }

  .pdf-brand p {
    font-size: 8.5pt;
    color: #64748b;
    margin: 3px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  .pdf-meta-box {
    text-align: right;
    font-size: 8.5pt;
    color: #475569;
    line-height: 1.5;
  }

  .pdf-title-banner {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #1d68f0;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 18px;
  }

  .pdf-title-banner h3 {
    margin: 0 0 4px 0;
    font-size: 13pt;
    color: #0f172a;
  }

  .pdf-title-banner p {
    margin: 0;
    font-size: 9pt;
    color: #475569;
  }

  .pdf-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }

  .pdf-kpi-card {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    background: #ffffff;
  }

  .pdf-kpi-card span {
    font-size: 7.5pt;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    display: block;
    margin-bottom: 4px;
  }

  .pdf-kpi-card strong {
    font-size: 10.5pt;
    font-weight: 700;
    color: #0f172a;
  }

  .pdf-section-title {
    font-size: 11pt;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
    margin: 18px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    page-break-after: avoid;
  }

  .pdf-agreement-item {
    border: 1px solid #e2e8f0;
    border-left: 4px solid #10b981;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 8px;
    page-break-inside: avoid;
    background: #fafafa;
  }

  .pdf-agreement-item.task {
    border-left-color: #f59e0b;
  }

  .pdf-item-title {
    font-size: 9pt;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
  }

  .pdf-item-meta {
    font-size: 8pt;
    color: #64748b;
    display: flex;
    gap: 15px;
  }

  .pdf-transcript-line {
    font-size: 8.5pt;
    line-height: 1.5;
    padding: 5px 0;
    border-bottom: 1px solid #f1f5f9;
    page-break-inside: avoid;
  }

  .pdf-transcript-line .time {
    color: #94a3b8;
    font-family: monospace;
    margin-right: 8px;
    font-size: 7.5pt;
  }

  .pdf-transcript-line .speaker {
    font-weight: 700;
    color: #0f172a;
    margin-right: 6px;
  }

  .pdf-footer {
    margin-top: 25px;
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
    font-size: 7.5pt;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

/* ==========================================
   IDIOMAS, GUÍA, EXPORTACIÓN Y SUGERENCIA PRINCIPAL
   ========================================== */
.lobby-quick-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.lobby-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--trans-smooth);
}
.lobby-chip:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}

.modal-sm { max-width: 460px; }

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}
.settings-field select {
  font: inherit;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-main);
}
.settings-field small {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
}
.settings-toggle input { width: 18px; height: 18px; accent-color: var(--brand-blue); }
.settings-save { align-self: flex-end; }

/* Guía */
.guide-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.guide-tab {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: pointer;
}
.guide-tab.active {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}
.guide-steps {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-main);
}

/* Sugerencia principal grande */
.card-main {
  padding: 16px 18px;
}
.card-main .card-main-text {
  font-size: 1.15rem;
  line-height: 1.5;
  font-weight: 600;
}
.card-header-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-answer-now {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--brand-blue);
  color: #fff;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--trans-smooth);
}
.btn-answer-now:hover { filter: brightness(1.1); }
.btn-answer-now:disabled { opacity: 0.6; cursor: wait; }
.card-their-lang {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-main);
}
.their-lang-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-sky);
}
.secondary-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.card-compact {
  padding: 10px 12px;
  gap: 6px;
}
.card-compact .card-body {
  font-size: 0.8rem;
  line-height: 1.5;
}

/* Traducción en la transcripción */
.stream-item .translation {
  margin-top: 4px;
  padding-left: 8px;
  border-left: 2px solid var(--accent-sky);
  font-size: 0.85em;
  color: var(--text-muted);
}
.stream-item .lang-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--bg-subtle);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
}
.subtitles-text .subtitle-original {
  display: block;
  font-size: 0.75em;
  opacity: 0.75;
}

/* Exportación */
.export-file-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.export-file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  font-size: 0.85rem;
}
.export-file-list li i { width: 18px; text-align: center; }
.export-file-list .file-name { flex: 1; font-weight: 600; color: var(--text-main); word-break: break-all; }
.export-file-list .file-size { color: var(--text-dim); font-size: 0.75rem; white-space: nowrap; }
.export-file-list a { font-size: 0.75rem; font-weight: 600; color: var(--brand-blue); text-decoration: none; white-space: nowrap; }
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.export-hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.export-summary {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.export-summary h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--text-main);
}
.export-summary ul { margin: 4px 0 10px; padding-left: 20px; font-size: 0.85rem; line-height: 1.5; color: var(--text-main); }
.export-summary p { font-size: 0.88rem; line-height: 1.55; color: var(--text-main); margin: 0 0 8px; }
.export-summary h5 { margin: 10px 0 2px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }

@media (max-width: 640px) {
  .header-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
  .audio-mixer-info { flex-wrap: wrap; gap: 8px; min-width: 0; }
  .viewport-footer { flex-wrap: wrap; }
  .secondary-cards-row { grid-template-columns: 1fr; }
  .card-main .card-main-text { font-size: 1.05rem; }
  .export-actions .btn { flex: 1 1 100%; justify-content: center; }
}
