/* ==============================================================================
   DRAGA 1.0 — Unified Voice Calling & Dating Companion Suite
   Design System & Glassmorphic Styling
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette - Deep Dark Space with Glass Overlays */
  --bg-primary: #0a0d16;
  --bg-secondary: #0f1523;
  --bg-tertiary: #151d30;
  --bg-card: rgba(18, 25, 43, 0.72);
  --bg-card-hover: rgba(28, 38, 64, 0.85);
  --bg-glass: rgba(15, 21, 35, 0.78);
  --bg-modal: rgba(13, 17, 30, 0.95);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-focus: rgba(99, 102, 241, 0.55);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  /* Theme Accents */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.38);
  --primary-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);

  --female-primary: #ff4382;
  --female-gradient: linear-gradient(135deg, #ff4382, #ff758c);
  --female-glow: rgba(255, 67, 130, 0.38);

  --accent-cyan: #00f2fe;
  --accent-emerald: #10b981;
  --accent-purple: #a855f7;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 1px 1px rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 24px var(--primary-glow);

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.theme-wife {
  --primary: #ff4382;
  --primary-hover: #ff2a73;
  --primary-glow: rgba(255, 67, 130, 0.38);
  --primary-gradient: linear-gradient(135deg, #ff4382, #ff758c);
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* Atmospheric Glow Background */
body::before {
  content: '';
  position: fixed;
  top: -15%;
  left: 20%;
  width: 65vw;
  height: 60vh;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, rgba(6, 182, 212, 0.03) 60%, transparent 80%);
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -15%;
  right: 15%;
  width: 55vw;
  height: 55vh;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.07) 0%, transparent 70%);
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
}

/* App Root Container */
.app-root {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: transparent;
}

/* ==============================================================================
   HEADER & NAVIGATION
   ============================================================================== */

.main-header {
  height: 68px;
  min-height: 68px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

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

.brand-icon-pulse {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 0 16px var(--primary-glow);
  animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.05); filter: brightness(1.2); }
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.version-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Active Companion Chip in Header */
.active-companion-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-medium);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.active-companion-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
}

.comp-avatar {
  font-size: 1.2rem;
}

.comp-info {
  display: flex;
  flex-direction: column;
}

.comp-name-line {
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.comp-meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}

.meta-pill {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: capitalize;
}

.tone-pill {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.stage-pill {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.voice-pill {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.switch-comp-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  margin-left: 2px;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  background: rgba(18, 25, 43, 0.8);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #ffffff;
  background: var(--primary-gradient);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.tab-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  position: absolute;
  top: 8px;
  right: 8px;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Header Right Buttons */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-call-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-call-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

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

.btn-glass {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-glass:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-medium);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon-only:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-medium);
}

.btn-primary-sm, .btn-secondary-sm, .btn-glass-sm, .btn-danger-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-primary-sm {
  background: var(--primary-gradient);
  color: #fff;
}

.btn-secondary-sm {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-glass-sm {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-danger-sm {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.btn-danger-sm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-link {
  background: none;
  border: none;
  color: #60a5fa;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* ==============================================================================
   MAIN WORKSPACE & TAB PANES
   ============================================================================== */

.main-workspace {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
}

.tab-pane {
  display: none;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

/* ==============================================================================
   TAB 1: DATING CHAT OVERLAY STYLING
   ============================================================================== */

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px 20px;
  gap: 12px;
}

.chat-hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  backdrop-filter: blur(14px);
}

.hero-companion-summary {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-avatar-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.hero-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.hero-title-row h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.hero-date-badge {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.hero-status-pill.online {
  font-size: 0.72rem;
  color: #34d399;
  font-weight: 600;
}

.hero-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-tone {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-stage {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.badge-voice {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-memory {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

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

.btn-glow-call {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.45);
  transition: var(--transition-fast);
}

.btn-glow-call:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 26px rgba(16, 185, 129, 0.65);
}

/* Living Memory Sync Banner */
.memory-sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
}

.sync-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-sparkle {
  font-size: 1rem;
  animation: pulse-dot 2s infinite;
}

.sync-text {
  font-size: 0.78rem;
  color: #d8b4fe;
  font-weight: 500;
}

/* Chat Messages Scroll Container */
.chat-messages-area {
  flex: 1;
  overflow-y: auto;
  background: rgba(12, 17, 30, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-bubble-row {
  display: flex;
  gap: 12px;
  max-width: 85%;
}

.chat-bubble-row.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

.bubble-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.bubble-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-bubble-row.user .bubble-body {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  border-radius: 18px 18px 4px 18px;
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.chat-bubble-row.partner .bubble-body {
  background: rgba(22, 31, 52, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: 18px 18px 18px 4px;
  padding: 14px 18px;
  font-size: 0.9rem;
  line-height: 1.55;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.bubble-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.chat-bubble-row.user .bubble-meta {
  justify-content: flex-end;
}

.btn-copy-bubble {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-copy-bubble:hover {
  color: #60a5fa;
}

/* Quick Chips */
.quick-chips-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
}

.chips-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.chips-scroll-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
}

.chips-scroll-track::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chip-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.28);
}

/* Chat Input Bar */
.chat-input-bar {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  align-items: flex-end;
}

.chat-textarea-box {
  flex: 1;
  position: relative;
}

.chat-input-textarea {
  width: 100%;
  background: rgba(10, 14, 25, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 36px 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  resize: none;
  outline: none;
  line-height: 1.45;
  transition: var(--transition-fast);
}

.chat-input-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.textarea-corner-actions {
  position: absolute;
  top: 8px;
  right: 10px;
}

.corner-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
}

.corner-btn:hover {
  color: var(--text-muted);
}

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

/* ==============================================================================
   TAB 2: VOICE CALL STUDIO STYLING
   ============================================================================== */

.call-studio-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  height: 100%;
  width: 100%;
  gap: 16px;
  padding: 16px 20px 20px;
  overflow: hidden;
}

.call-main-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  overflow-y: auto;
  padding-right: 4px;
}

.call-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.call-target-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.call-avatar-pill {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 16px var(--primary-glow);
}

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

.call-title-row h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.call-date-tag {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.call-status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.call-status-badge.idle {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.call-status-badge.calling {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  animation: pulse-dot 1.2s infinite;
}

.call-status-badge.active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.call-voice-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}

.voice-name-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #60a5fa;
}

.tone-badge-sm, .stage-badge-sm {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.call-timer {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.call-stage-top-actions {
  display: flex;
  gap: 8px;
}

/* Visualizer Wrapper */
.visualizer-wrapper {
  position: relative;
  height: 250px;
  min-height: 250px;
  background: radial-gradient(circle at center, rgba(18, 25, 45, 0.9) 0%, rgba(10, 13, 22, 0.98) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}

.visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.visualizer-overlay-info {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.voice-state-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 20, 35, 0.75);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  backdrop-filter: blur(8px);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 8px #3b82f6;
}

.visualizer-mode-picker {
  display: flex;
  gap: 4px;
  background: rgba(15, 20, 35, 0.75);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  pointer-events: auto;
}

.viz-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.viz-btn.active {
  background: var(--primary);
  color: #fff;
}

/* Live Extraction Toast */
.live-extraction-banner {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.78rem;
  color: #6ee7b7;
  font-weight: 600;
  animation: fadeIn 0.3s;
}

/* Call Controls Bar */
.call-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  gap: 16px;
}

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

.btn-call-round {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-start-call {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.btn-start-call.in-call {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.btn-mute-mic {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-mute-mic.muted {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-call-round:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.controls-center {
  flex: 1;
}

.call-device-routing {
  display: flex;
  gap: 12px;
}

.device-select-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.device-select-group label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.device-select {
  width: 100%;
  background: rgba(10, 14, 25, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 0.78rem;
  outline: none;
}

/* Stealth Live Director Co-Pilot */
.director-copilot-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.director-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.director-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

.active-directive-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.director-chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.directive-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.directive-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.director-custom-input-row {
  display: flex;
  gap: 8px;
}

.directive-input {
  flex: 1;
  background: rgba(10, 14, 25, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 7px 12px;
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
}

/* Dialogue Section */
.call-dialogue-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
  flex: 1;
}

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

.dialogue-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
}

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

.call-dialogue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 280px;
}

.dialogue-placeholder {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  padding: 24px 0;
}

.call-turn-bubble {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.call-turn-bubble.user {
  background: rgba(99, 102, 241, 0.15);
  border-left: 3px solid #6366f1;
}

.call-turn-bubble.agent {
  background: rgba(16, 185, 129, 0.15);
  border-left: 3px solid #10b981;
}

.call-turn-speaker {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.call-turn-text {
  color: var(--text-primary);
  line-height: 1.4;
}

/* Call Studio Sidebar */
.call-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  overflow-y: auto;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.card-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.linked-comp-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.linked-avatar {
  font-size: 1.8rem;
}

.date-label {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.linked-personalization-preview {
  background: rgba(10, 14, 25, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
}

.preview-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}

.preview-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 4px;
}

.linked-memory-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mem-stat-box {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-xs);
  padding: 6px;
  text-align: center;
}

.stat-num {
  font-size: 1rem;
  font-weight: 800;
  display: block;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.virtual-mic-guide .guide-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.virtual-mic-guide .guide-steps {
  font-size: 0.74rem;
  color: var(--text-muted);
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.call-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.call-history-item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition-fast);
}

.call-history-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.history-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-item-name {
  font-size: 0.78rem;
  font-weight: 600;
}

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

.history-item-dur {
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* ==============================================================================
   TAB 3: CENTRAL MEMORY HUB STYLING
   ============================================================================== */

.memory-hub-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
  height: 100%;
  padding: 16px 20px 20px;
  overflow: hidden;
}

.memory-companions-col {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  overflow-y: auto;
}

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

.col-header-row h3 {
  font-size: 1rem;
  font-weight: 700;
}

.hub-companions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hub-comp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.hub-comp-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-medium);
}

.hub-comp-item.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}

.hub-comp-avatar {
  font-size: 1.4rem;
}

.hub-comp-details {
  display: flex;
  flex-direction: column;
}

.hub-comp-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.hub-comp-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.memory-editor-col {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  overflow-y: auto;
}

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

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

.editor-avatar-big {
  font-size: 2.2rem;
}

.editor-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-name-row h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
}

.editor-date-pill {
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.editor-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
}

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

.editor-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea, .form-textarea-tall {
  background: rgba(10, 14, 25, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.82rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus, .form-textarea-tall:focus {
  border-color: var(--border-focus);
}

.form-textarea-tall {
  width: 100%;
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.editor-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.memory-logs-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.memory-log-card {
  background: rgba(10, 14, 25, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.log-title {
  font-size: 0.8rem;
  font-weight: 700;
}

.log-scroll {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-item {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  line-height: 1.4;
}

/* ==============================================================================
   TAB 4: EXPORT CENTER STYLING
   ============================================================================== */

.export-center-container {
  max-width: 1050px;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.export-hero-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.export-hero-banner h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
}

.export-hero-banner p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.export-companion-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.export-companion-picker label {
  font-size: 0.82rem;
  font-weight: 600;
}

.form-select-sm {
  background: rgba(10, 14, 25, 0.85);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  padding: 6px 12px;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
}

.export-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.export-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition-fast);
}

.export-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.export-card-icon {
  font-size: 2rem;
}

.export-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.export-card-body h3 {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #60a5fa;
}

.export-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.export-card-features {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}

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

.export-card-actions .btn {
  flex: 1;
  padding: 8px;
  font-size: 0.78rem;
}

.export-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.preview-title {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #a5b4fc;
}

.export-preview-code {
  background: rgba(10, 13, 22, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 14px;
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  max-height: 250px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ==============================================================================
   MODAL DIALOGS
   ============================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-modal);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-title-row {
  display: flex;
  gap: 14px;
}

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

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 4px;
  max-width: 580px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

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

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(10, 14, 25, 0.4);
}

/* Modal 1: Select Chat For Call Specifics */
.modal-select-call {
  width: 720px;
  max-width: 95vw;
}

.companion-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.call-select-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.call-select-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

.card-avatar {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.card-date-partner {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

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

.card-personalization-snippet {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.card-memory-count {
  font-size: 0.72rem;
  color: #a5b4fc;
}

/* Modal 2: New Conversation Form */
.modal-new-conversation {
  width: 640px;
  max-width: 95vw;
}

.new-comp-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Modal 3: Settings */
.modal-settings {
  width: 620px;
  max-width: 95vw;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.settings-section h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #a5b4fc;
}

.field-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.25s ease-out;
  pointer-events: auto;
}

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

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(6, 40, 28, 0.95);
}

.toast.toast-info {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(10, 25, 55, 0.95);
}

/* Compact Note Badge Mode (Collapsible Minimal Mode) */
body.compact-mode .main-header {
  height: 48px;
  min-height: 48px;
  padding: 0 12px;
}

body.compact-mode .brand-sub,
body.compact-mode .nav-tabs,
body.compact-mode #btnNewCallHeader,
body.compact-mode #btnNewConversationHeader {
  display: none !important;
}

body.compact-mode .chat-container {
  padding: 8px;
  gap: 8px;
}

body.compact-mode .chat-hero-bar {
  padding: 8px 12px;
}

body.compact-mode .hero-pills-row,
body.compact-mode .memory-sync-banner {
  display: none;
}

/* ==============================================================================
   ROBERT VOICE REALISM & EMOTION AUDITION STYLING
   ============================================================================== */

.voice-realism-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.realism-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.realism-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
}

.realism-icon {
  font-size: 1.1rem;
}

.realism-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.realism-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.realism-card {
  background: rgba(10, 14, 25, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition-fast);
}

.realism-card:hover {
  border-color: var(--border-medium);
  background: rgba(18, 25, 45, 0.85);
  transform: translateY(-1px);
}

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

.tone-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.tone-tag.playful {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.tone-tag.romantic {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
}

.tone-tag.supportive {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.tone-tag.flirty {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.btn-listen-sample {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
  transition: var(--transition-fast);
}

.btn-listen-sample:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.55);
}

.sample-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  font-style: italic;
}

.audition-emotion-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  margin-bottom: 6px;
}

.audition-emotion-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.audition-emotion-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.emotion-chip {
  background: rgba(18, 25, 45, 0.75);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.emotion-chip:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
  background: rgba(30, 41, 69, 0.9);
  transform: translateY(-1px);
}

.emotion-chip.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(99, 102, 241, 0.25));
  border-color: #3b82f6;
  color: #93c5fd;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
  font-weight: 700;
}

.realism-custom-tester {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.custom-speak-input {
  flex: 1;
  background: rgba(10, 14, 25, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
}

.custom-speak-input:focus {
  border-color: var(--border-focus);
}

.realism-helper-row {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: var(--radius-xs);
}

.realism-helper-row .helper-text {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.caller-speech-input-row {
  display: flex;
  gap: 10px;
  margin: 10px 0 14px 0;
  align-items: center;
}

.caller-live-input {
  flex: 1;
  background: rgba(10, 14, 25, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.86rem;
  outline: none;
  transition: all 0.2s ease;
}

.caller-live-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.35);
}

.voice-speed-meter-box {
  background: rgba(10, 14, 25, 0.75);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 10px 0 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.speed-meter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.speed-meter-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.speed-icon {
  font-size: 0.9rem;
}

.speed-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.speed-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.speed-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.speed-preset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.speed-preset-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: var(--border-medium);
}

.speed-preset-btn.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(99, 102, 241, 0.3));
  border-color: #3b82f6;
  color: #93c5fd;
  font-weight: 700;
}

.speed-slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-boundary-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.speed-slider-input {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.speed-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
  transition: transform 0.1s ease;
}

.speed-slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

optgroup {
  background: #0d121f;
  color: #60a5fa;
  font-weight: 700;
  padding: 4px;
}

optgroup option {
  background: #0a0e19;
  color: var(--text-primary);
  font-weight: 400;
  padding: 6px;
}

/* Live On-Screen Speech-to-Text & Audio Telemetry HUD */
.live-stt-hud {
  margin-top: 10px;
  background: rgba(10, 15, 29, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(59, 130, 246, 0.08);
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
}

.stt-hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 7px;
  margin-bottom: 8px;
}

.stt-hud-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stt-hud-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
}

.stt-badge-idle {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.stt-badge-active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.stt-badge-speaking {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.stt-badge-info {
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stt-hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  animation: sttPulse 1.5s infinite;
}

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

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

.stt-silence-countdown {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: #94a3b8;
}

.btn-stt-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-stt-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.stt-hud-caption-body {
  padding: 4px 0 2px 0;
}

.stt-speaker-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.stt-speaker-name {
  color: #38bdf8;
  letter-spacing: 0.02em;
}

.stt-live-indicator {
  font-size: 0.65rem;
  color: #10b981;
  font-weight: 500;
  font-style: italic;
  display: none;
}

.stt-caption-text {
  font-size: 1rem;
  line-height: 1.45;
  color: #f1f5f9;
  font-weight: 500;
  min-height: 28px;
  word-break: break-word;
  transition: color 0.15s ease;
}

.stt-caption-text.interim {
  color: #34d399;
  font-style: italic;
}

.stt-caption-text.agent {
  color: #93c5fd;
}

/* Stage Autopilot Button Pill */
.btn-autopilot-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-autopilot-pill:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.75);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.btn-autopilot-pill.off {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: #94a3b8;
}

.btn-autopilot-pill.off:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: none;
}

.autopilot-dot {
  font-size: 0.75rem;
  line-height: 1;
  color: #10b981;
  animation: pulseAutopilot 2s infinite;
}

.btn-autopilot-pill.off .autopilot-dot {
  animation: none;
  color: #64748b;
}

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



/* ==============================================================================
   EMERGENCY BRAKE & MANUAL OVERRIDE BUTTON
   ============================================================================== */
.btn-override-brake {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  padding: 8px 15px;
  border-radius: var(--radius-sm, 8px);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-override-brake:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.28);
  border-color: rgba(245, 158, 11, 0.8);
  color: #fef3c7;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

.btn-override-brake:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-override-brake:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
  color: #64748b;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: none;
  transform: none;
}

.btn-override-brake.holding {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.32), rgba(245, 158, 11, 0.4));
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.6);
  animation: pulseBrake 1.4s infinite ease-in-out;
}

@keyframes pulseBrake {
  0% {
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    border-color: #ef4444;
  }
  50% {
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.85);
    border-color: #f87171;
  }
  100% {
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    border-color: #ef4444;
  }
}


/* Live Question Gap Alert & Director Stalling Panel */
.director-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-warning-sm {
  padding: 5px 11px;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-warning-sm:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #fbbf24;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.director-gap-alert {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(245, 158, 11, 0.18) 100%);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: pulseGlitchBorder 2.5s infinite ease-in-out;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

@keyframes pulseGlitchBorder {
  0%, 100% { border-color: rgba(245, 158, 11, 0.45); box-shadow: 0 0 10px rgba(245, 158, 11, 0.12); }
  50% { border-color: rgba(239, 68, 68, 0.85); box-shadow: 0 0 22px rgba(239, 68, 68, 0.25); }
}

.gap-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.gap-alert-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #fbbf24;
  letter-spacing: 0.5px;
}

.gap-pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: blinkFast 1s infinite;
}

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

.gap-stall-phrase {
  font-size: 0.72rem;
  font-style: italic;
  color: #93c5fd;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(147, 197, 253, 0.25);
}

.gap-question-box {
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-xs);
  padding: 7px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-left: 3px solid #f59e0b;
}

.gap-q-label {
  font-size: 0.7rem;
  color: #9ca3af;
  font-weight: 700;
  text-transform: uppercase;
}

.gap-q-text {
  font-size: 0.82rem;
  color: #f3f4f6;
  font-weight: 600;
}

.gap-suggestions-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gap-suggestions-label {
  font-size: 0.7rem;
  color: #fbbf24;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.gap-quick-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gap-quick-chip {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fef08a;
  padding: 5px 11px;
  border-radius: var(--radius-xs);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gap-quick-chip:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #fbbf24;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}


/* ==============================================================================
   SWAPPED SIDEBAR TRANSCRIPT & MAIN STAGE MEMORY CARD STYLES
   ============================================================================== */

.main-stage-history-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.main-stage-history-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.sidebar-transcript-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 380px;
}

.sidebar-transcript-box .call-dialogue-list {
  flex: 1;
  max-height: calc(100vh - 360px);
  min-height: 280px;
  overflow-y: auto;
  border-radius: var(--radius-xs);
  padding: 8px;
  background: rgba(10, 14, 25, 0.7);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==============================================================================
   CLOUDFLARE ADMIN SECURITY GATEKEEPER STYLES
   ============================================================================== */

.admin-security-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 9, 18, 0.92);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.admin-gate-card {
  background: linear-gradient(135deg, rgba(18, 25, 45, 0.95) 0%, rgba(10, 14, 25, 0.98) 100%);
  border: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 50px rgba(59, 130, 246, 0.25), 0 25px 60px rgba(0, 0, 0, 0.85);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.admin-gate-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
}

.admin-gate-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.gate-icon-pulse {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.35);
  animation: pulse-glow 2.5s infinite alternate;
}

.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  color: #93c5fd;
  letter-spacing: 0.6px;
}

.gate-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 6px #3b82f6;
  animation: blinkFast 1.5s infinite;
}

.admin-gate-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.admin-gate-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: -6px;
}

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

.admin-passcode-field {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.admin-passcode-input {
  width: 100%;
  background: rgba(8, 12, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  padding: 12px 44px 12px 16px;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 2px;
  outline: none;
  transition: var(--transition-fast);
}

.admin-passcode-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.4);
}

.btn-toggle-eye {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.btn-toggle-eye:hover {
  color: #ffffff;
}

.admin-gate-options {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.remember-device-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.admin-gate-error {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 600;
  animation: shakeError 0.4s ease;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.btn-unlock-gate {
  width: 100%;
  padding: 12px;
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--primary-glow);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-unlock-gate:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.55);
}

.admin-gate-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.footer-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.admin-lock-btn {
  border-color: rgba(59, 130, 246, 0.4) !important;
  color: #93c5fd !important;
}

.admin-lock-btn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
}

/* ==============================================================================
   COMPREHENSIVE LAPTOP & MOBILE RESPONSIVENESS (Media Queries)
   ============================================================================== */

/* 1. Standard Laptop Viewports (1024px - 1366px) */
@media (max-width: 1366px) {
  .call-studio-grid {
    grid-template-columns: 1fr 340px;
    gap: 14px;
    padding: 14px 18px;
  }

  .memory-hub-grid {
    grid-template-columns: 250px 1fr;
    gap: 14px;
    padding: 14px 18px;
  }

  .editor-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .realism-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 2. Small Laptops & Large Tablets (861px - 1024px) */
@media (max-width: 1024px) {
  .main-header {
    padding: 0 16px;
    gap: 12px;
  }

  .brand-sub {
    display: none;
  }

  .nav-tab {
    padding: 7px 12px;
    font-size: 0.8rem;
  }

  .call-studio-grid {
    grid-template-columns: 1fr 310px;
    gap: 12px;
    padding: 12px 14px;
  }

  .memory-hub-grid {
    grid-template-columns: 220px 1fr;
    gap: 12px;
    padding: 12px 14px;
  }
}

/* 3. Tablets & Mobile Landscape (<= 860px) */
@media (max-width: 860px) {
  html, body, .app-root {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .main-header {
    height: auto;
    min-height: 56px;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
  }

  .header-left {
    gap: 10px;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .meta-pill {
    display: none; /* Keep avatar & name compact on tablet/mobile */
  }

  .nav-tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding: 4px;
    border-radius: var(--radius-sm);
    justify-content: flex-start;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex-shrink: 0;
    padding: 7px 12px;
    font-size: 0.78rem;
  }

  .main-workspace {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: calc(100dvh - 105px);
  }

  .tab-pane {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Voice Call Studio Mobile Stacking */
  .call-studio-grid {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100%;
    overflow-y: visible;
    padding: 10px 12px 24px;
    gap: 16px;
  }

  .call-main-stage {
    overflow-y: visible;
    height: auto;
    gap: 14px;
  }

  .call-sidebar {
    width: 100%;
    height: auto;
    overflow-y: visible;
    gap: 14px;
  }

  .sidebar-transcript-box {
    min-height: 340px;
  }

  .sidebar-transcript-box .call-dialogue-list {
    max-height: 320px;
    min-height: 240px;
  }

  /* Central Memory Hub Mobile Stacking */
  .memory-hub-grid {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100%;
    overflow-y: visible;
    padding: 10px 12px 24px;
    gap: 16px;
  }

  .memory-companions-col {
    width: 100%;
    max-height: 160px;
    flex-shrink: 0;
    overflow-y: auto;
  }

  .hub-companions-list {
    flex-direction: row;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 4px;
  }

  .hub-comp-item {
    flex-shrink: 0;
    min-width: 170px;
  }

  .memory-editor-col {
    width: 100%;
    height: auto;
    overflow-y: visible;
    padding: 16px;
  }

  .editor-header-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .editor-header-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .editor-header-actions .btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }

  .editor-form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Export Center Mobile */
  .export-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Modals Mobile */
  .modal-card {
    max-width: 95vw;
    width: 95vw;
    max-height: 88vh;
    padding: 16px;
    margin: auto;
    overflow-y: auto;
  }
}

/* 4. Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  .brand-title {
    font-size: 1rem;
  }

  .active-companion-chip {
    padding: 4px 8px;
  }

  .comp-avatar {
    font-size: 1rem;
  }

  .comp-name-line {
    font-size: 0.78rem;
  }

  .date-tag {
    display: none;
  }

  .call-actions-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .call-actions-row .btn {
    flex: 1 1 calc(50% - 4px);
    padding: 7px 8px;
    font-size: 0.74rem;
  }

  .realism-cards-grid {
    grid-template-columns: 1fr;
  }

  .chat-hero-bar {
    padding: 8px 10px;
  }

  .chat-input-bar {
    padding: 8px 10px;
  }

  .admin-gate-card {
    padding: 24px 18px;
  }

  .admin-gate-title {
    font-size: 1.15rem;
  }
}


/* ==============================================================================
   HEADER COMPACT / LAPTOP ARRANGE FIXES (Zero Cut-Off)
   ============================================================================== */

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-header-action {
  padding: 7px 13px;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-text-short {
  display: none;
}

@media (max-width: 1440px) {
  .main-header {
    padding: 0 16px;
    gap: 12px;
  }

  .header-left {
    gap: 12px;
  }

  .brand-sub {
    display: none !important;
  }

  .comp-meta-line {
    display: none !important;
  }

  .active-companion-chip {
    padding: 4px 10px;
  }

  .nav-tabs {
    padding: 3px;
    gap: 3px;
  }

  .nav-tab {
    padding: 6px 11px;
    font-size: 0.8rem;
    gap: 6px;
  }

  .btn-text-full {
    display: none;
  }

  .btn-text-short {
    display: inline;
  }

  .admin-lock-btn {
    padding: 6px 10px;
  }
}
