/* =========================================================
   ESA — Emergency Support AI  |  Clean Modern White Theme
   - Default Background: #FFFFFF / #F8FAFC (Clean White / Soft Slate)
   - Primary Accent: #2563EB (Electric Royal Blue)
   - Typography: #0F172A (Deep Slate), #334155 (Charcoal Body), #64748B (Muted)
   - Borders: #E2E8F0, #CBD5E1
   - Clean glassmorphism & soft ambient shadows
   ========================================================= */

:root {
  /* Surfaces — White Theme */
  --bg:          #FFFFFF;
  --bg-subtle:   #F8FAFC;
  --bg-gradient: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  --bg-card:     #FFFFFF;
  --bg-card-h:   #F8FAFC;
  --bg-input:    #FFFFFF;
  --bg-modal:    #FFFFFF;

  /* Borders & Dividers */
  --border:        #E2E8F0;
  --border-subtle: #F1F5F9;
  --border-act:    #2563EB;

  /* Typography */
  --t1: #0F172A;
  --t2: #334155;
  --t3: #64748B;
  --t-muted: #94A3B8;

  /* Accents */
  --blue-main:  #2563EB;
  --blue-light: #3B82F6;
  --blue-glow:  rgba(37, 99, 235, 0.16);

  --purple-main:  #6366F1;
  --purple-dark:  #4338CA;
  --purple-light: rgba(99, 102, 241, 0.08);
  --purple-glow:  rgba(99, 102, 241, 0.2);

  --teal:  #0D9488;
  --sky:   #0284C7;
  --amber: #D97706;
  --red:   #DC2626;

  --r-sm:   10px;
  --r-md:   16px;
  --r-lg:   20px;
  --r-pill: 999px;

  --shadow-glass: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 10px 25px -3px rgba(37, 99, 235, 0.12), 0 4px 6px -2px rgba(37, 99, 235, 0.05);
  --font: 'Inter', 'Noto Sans Devanagari', system-ui, -apple-system, sans-serif;
  --font-display: 'Sora', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --bg:          #08090D;
  --bg-subtle:   #08090D;
  --bg-gradient: #08090D;
  --bg-card:     rgba(255, 255, 255, 0.03);
  --bg-card-h:   rgba(255, 255, 255, 0.06);
  --bg-input:    #151826;
  --bg-modal:    #111422;

  --border:        #1F2331;
  --border-subtle: #1F2331;
  --border-act:    #4A7CF7;

  --t1: #EEF0F6;
  --t2: #9AA1B2;
  --t3: #7E8596;
  --t-muted: #7E8596;

  --blue-main:  #4A7CF7;
  --blue-light: #7FA2FF;
  --blue-glow:  rgba(74, 124, 247, 0.35);

  --purple-main:  #4A7CF7;
  --purple-dark:  #16224F;
  --purple-light: rgba(74, 124, 247, 0.16);
  --purple-glow:  rgba(74, 124, 247, 0.35);

  --shadow-glass: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 15px 40px rgba(74, 124, 247, 0.2);
}

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

@keyframes ring {
  0% { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.15); opacity: 0; }
}

.breathe { animation: breathe 6s ease-in-out infinite; }
.ring { animation: ring 2s ease-out infinite; }
.ring2 { animation-delay: 1s; }

@media (prefers-reduced-motion: reduce) {
  .breathe, .ring { animation: none; }
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  background-color: var(--bg);
  color: var(--t1);
  font-family: var(--font);
  min-height: 100vh;
  padding: 0;
  line-height: 1.55;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Subtle ambient ambient background glow */
body::before {
  content: '';
  position: absolute;
  top: -120px; right: -100px;
  width: 450px; height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, rgba(99, 102, 241, 0.03) 55%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}
body::after {
  content: '';
  position: absolute;
  bottom: 50px; left: -100px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, rgba(59, 130, 246, 0.03) 55%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
}

/* =========================================================
   HEADER
   ========================================================= */
.app-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-glass);
  margin-bottom: 28px;
  position: relative;
  z-index: 100;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
  flex-wrap: wrap;
}

.header-nav-row {
  width: 100%;
}

.brand { display: flex; align-items: center; }
.brand-logo-wrap { height: 56px; display: flex; align-items: center; }
.esa-header-logo {
  height: 56px; width: auto;
  filter: drop-shadow(0 4px 12px rgba(168,85,247,.22));
  transition: filter .3s, transform .3s;
}
.esa-header-logo:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 6px 18px rgba(168,85,247,.35));
}

/* Tab navigation (full width row) */
.tab-nav {
  display: flex;
  gap: 8px;
  background: rgba(233, 213, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--r-pill);
  padding: 6px;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--t2);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all .25s ease;
  white-space: nowrap;
  position: relative;
  z-index: 10;
  pointer-events: auto;
  text-align: center;
}
.tab-btn.active {
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.35);
}
.tab-btn:hover:not(.active) { color: var(--t1); background: rgba(255,255,255,.5); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.status-indicator {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: var(--t2);
  background: rgba(243, 232, 255, 0.7);
  padding: 7px 14px; border-radius: var(--r-pill);
  border: 1px solid rgba(168, 85, 247, 0.2);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-dot.green { background: #10b981; box-shadow: 0 0 8px rgba(16,185,129,.5); }

/* =========================================================
   TAB PANELS
   ========================================================= */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* =========================================================
   CARD + GROMMET KEYRING HOLE MOTIF
   ========================================================= */
.card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 26px;
  box-shadow: var(--shadow-glass);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.card:hover {
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow: var(--shadow-hover);
}

.grommet-hole {
  position: absolute;
  top: 16px; right: 18px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #f3e8ff;
  border: 2px solid #c084fc;
  box-shadow: inset 0 1px 3px rgba(126, 34, 206, 0.25);
  pointer-events: none;
}
.grommet-hole::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff, transparent 70%);
}

/* =========================================================
   3D SWIRLING LIQUID VIOLET ORB (Signature Graphic)
   ========================================================= */
.orb-container {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-glow-layer {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.45) 0%, rgba(192, 132, 252, 0.2) 55%, transparent 75%);
  filter: blur(14px);
  animation: orbGlowPulse 3s ease-in-out infinite;
}

.liquid-orb {
  position: relative;
  width: 135px;
  height: 135px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f3e8ff 0%, #d8b4fe 25%, #a855f7 55%, #7e22ce 80%, #581c87 100%);
  box-shadow: 
    0 18px 45px rgba(126, 34, 206, 0.42),
    inset 0 -14px 28px rgba(88, 28, 135, 0.85),
    inset 0 14px 22px rgba(255, 255, 255, 0.85);
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.orb-swirl-texture {
  position: absolute;
  inset: -20%;
  border-radius: 42%;
  background: conic-gradient(from 0deg, rgba(243, 232, 255, 0.75), rgba(168, 85, 247, 0.9), rgba(126, 34, 206, 0.85), rgba(88, 28, 135, 0.95), rgba(243, 232, 255, 0.75));
  filter: blur(12px);
  mix-blend-mode: overlay;
  animation: orbRotate 7s linear infinite;
}

.orb-highlight {
  position: absolute;
  top: 8%;
  left: 14%;
  width: 45%;
  height: 35%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, transparent 70%);
  transform: rotate(-30deg);
  pointer-events: none;
}

@keyframes orbRotate {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.06); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes orbGlowPulse {
  0%, 100% { transform: scale(1); opacity: 0.65; }
  50% { transform: scale(1.16); opacity: 0.95; }
}

.liquid-orb.active-speaking {
  animation: orbSpeak 1.2s ease-in-out infinite alternate;
  box-shadow: 0 22px 55px rgba(168, 85, 247, 0.65), inset 0 -14px 28px rgba(126, 34, 206, 0.9);
}

@keyframes orbSpeak {
  0% { transform: scale(1); }
  100% { transform: scale(1.14); }
}

/* =========================================================
   HERO SECTION
   ========================================================= */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 44px 40px;
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-glass);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.hero-eyebrow { margin-bottom: 14px; }
.hero-title {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--t1);
  margin-bottom: 18px;
}
.hero-subtitle {
  font-size: 15px;
  color: var(--t2);
  line-height: 1.65;
  max-width: 480px;
  margin-bottom: 28px;
}
.hero-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-pill {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(243, 232, 255, 0.6);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--r-md);
  padding: 12px 20px;
  min-width: 95px;
}
.stat-num { font-size: 24px; font-weight: 800; color: var(--purple-dark); }
.stat-label { font-size: 11px; color: var(--t3); font-weight: 700; margin-top: 2px; }

/* How It Works */
.how-it-works {
  display: flex;
  flex-direction: column;
  gap: 0;
  justify-content: center;
}
.how-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 16px;
  box-shadow: 0 4px 14px rgba(126, 34, 206, 0.04);
}
.how-step strong { display: block; color: var(--t1); font-size: 13px; margin-bottom: 4px; }
.how-step p { font-size: 12px; color: var(--t2); line-height: 1.5; }
.how-icon { font-size: 24px; flex-shrink: 0; }
.how-arrow {
  text-align: center;
  color: #c084fc;
  font-size: 18px;
  padding: 4px 0;
}

/* =========================================================
   SECTION HEADERS
   ========================================================= */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.section-title { font-size: 18px; font-weight: 800; color: var(--t1); }

/* =========================================================
   INTEGRATION CARDS GRID
   ========================================================= */
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.integration-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px;
  box-shadow: var(--shadow-glass);
  transition: transform .25s, border-color .25s, box-shadow .25s;
  overflow: hidden;
}
.integration-card:hover {
  transform: translateY(-3px);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: var(--shadow-hover);
}

.integration-card::before {
  content: '';
  position: absolute;
  top: 14px; right: 16px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #f3e8ff;
  border: 1.8px solid #c084fc;
  box-shadow: inset 0 1px 2px rgba(126, 34, 206, 0.2);
}

.integration-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.integration-icon {
  width: 48px; height: 48px;
  border-radius: var(--r-sm);
  background: rgba(243, 232, 255, 0.8);
  border: 1px solid rgba(168, 85, 247, 0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.integration-name { font-size: 16px; font-weight: 800; color: var(--t1); }
.integration-status-row { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.integration-status-dot { width: 6px; height: 6px; border-radius: 50%; }
.integration-status-dot.live     { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,.5); }
.integration-status-dot.connected{ background: #a855f7;  box-shadow: 0 0 6px rgba(168,85,247,.5); }
.integration-status-dot.idle     { background: #94a3b8; }
.integration-status-label { font-size: 11px; color: var(--t3); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }

.integration-desc {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.5;
  margin-bottom: 16px;
}

.integration-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(168, 85, 247, 0.12);
}
.integration-call-count {
  font-size: 12px;
  color: var(--t2);
}
.integration-call-count span {
  font-family: var(--mono);
  font-weight: 800;
  color: var(--purple-dark);
  font-size: 14px;
}

.btn-docs {
  font-size: 12px;
  font-weight: 700;
  color: #7e22ce;
  background: rgba(243, 232, 255, 0.8);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--r-pill);
  padding: 5px 14px;
  cursor: pointer;
  transition: all .2s;
}
.btn-docs:hover { background: rgba(168, 85, 247, 0.2); }

/* Inline curl snippet in card */
.curl-snippet {
  display: none;
  margin-top: 12px;
}
.curl-snippet.visible { display: block; }

/* Integration card skeleton */
.integration-card-skeleton {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  height: 180px;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  0%,100% { opacity: .5; }
  50%      { opacity: .85; }
}

/* =========================================================
   API REFERENCE ACCORDION
   ========================================================= */
.api-ref-card { margin-bottom: 24px; }

.api-endpoints-list { display: flex; flex-direction: column; gap: 0; }

.api-endpoint-item {
  border-bottom: 1px solid rgba(168, 85, 247, 0.12);
}
.api-endpoint-item:last-child { border-bottom: none; }

.api-endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.api-endpoint-header:hover { background: rgba(243, 232, 255, 0.4); border-radius: 8px; }

.api-method-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
  letter-spacing: .5px;
}
.method-post { background: linear-gradient(135deg, #a855f7, #7e22ce); color: #ffffff; }
.method-get  { background: rgba(2,132,199,.12); color: var(--sky); }
.method-del  { background: var(--red-bg); color: var(--red); }

.api-path { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--t1); }
.api-desc { font-size: 13px; color: var(--t2); flex: 1; }
.api-chevron { font-size: 18px; color: #a855f7; transition: transform .2s; margin-left: auto; }
.api-chevron.open { transform: rotate(90deg); }

.api-endpoint-body {
  display: none;
  padding-bottom: 16px;
}
.api-endpoint-body.open { display: block; }
.api-schema-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* =========================================================
   CODE BLOCKS
   ========================================================= */
.code-block {
  background: #1e1b4b;
  border: 1px solid #312e81;
  border-radius: var(--r-sm);
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: #c084fc;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.25);
}
.code-block-inline {
  background: rgba(243, 232, 255, 0.8);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 6px;
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--purple-dark);
}
.api-schema-label { font-size: 11px; font-weight: 800; color: var(--t3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }

/* =========================================================
   WORKSPACE GRID (Triage Studio)
   ========================================================= */
.workspace-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 1024px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .hero-section    { grid-template-columns: 1fr; }
  .api-schema-cols { grid-template-columns: 1fr; }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.panel-header h2 { font-size: 16px; font-weight: 800; color: var(--t1); }

/* =========================================================
   FORM ELEMENTS
   ========================================================= */
.form-group { margin-bottom: 18px; }

.form-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800;
  color: var(--t2); margin-bottom: 7px;
  text-transform: uppercase; letter-spacing: .5px;
}
.form-label-sm { font-size: 12px; color: var(--t2); font-weight: 700; display: block; margin-bottom: 4px; }

.step-num {
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  color: #ffffff;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800;
  box-shadow: 0 2px 8px rgba(168,85,247,.35);
}

.form-select, .form-control, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--t1);
  padding: 11px 16px;
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
  box-shadow: 0 2px 6px rgba(126, 34, 206, 0.03);
}
.form-select:focus, .form-control:focus, .form-textarea:focus {
  border-color: var(--purple-main);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}
.form-textarea { resize: vertical; min-height: 80px; }

.form-range { width: 100%; accent-color: var(--purple-main); cursor: pointer; }

.location-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.input-sublabel { font-size: 11px; color: var(--t3); font-weight: 700; display: block; margin-bottom: 4px; }

.source-selector { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.radio-chip { cursor: pointer; }
.radio-chip input { display: none; }
.radio-chip span {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 12px; color: var(--t2); font-weight: 600;
  transition: all .2s;
}
.radio-chip input:checked + span {
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  border-color: transparent;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.3);
}

/* Info Card */
.info-card {
  background: rgba(243, 232, 255, 0.5);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  margin-bottom: 18px;
}
.info-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 13px;
}
.info-label { color: var(--t2); }
.info-value  { color: var(--t1); font-weight: 700; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  font-family: var(--font); font-size: 14px; font-weight: 700;
  border-radius: var(--r-pill); border: none;
  cursor: pointer; transition: all .25s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(168, 85, 247, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--t1);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(126, 34, 206, 0.04);
}
.btn-secondary:hover { background: #ffffff; border-color: rgba(168, 85, 247, 0.3); }

.btn-call-live {
  background: linear-gradient(135deg, #a855f7 0%, #6b21a8 100%);
  color: #ffffff;
  font-size: 14px; font-weight: 800;
  padding: 15px 24px;
  border-radius: var(--r-pill);
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
}
.btn-call-live:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(168, 85, 247, 0.55);
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(220,38,38,.3);
  border-radius: var(--r-pill);
}
.btn-danger:hover { background: rgba(220,38,38,.18); }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-mic {
  background: linear-gradient(135deg, #c084fc, #9333ea);
  color: #ffffff;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.3);
  cursor: pointer; transition: all .2s;
}
.btn-mic:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(168, 85, 247, 0.45); }
.btn-mic.recording {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
  animation: pulseMic 1.1s ease-in-out infinite;
}
@keyframes pulseMic { 0%,100%{opacity:1} 50%{opacity:.6} }

.action-buttons-group { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }

/* =========================================================
   QUICK SCENARIO PILLS & ICON CARDS (with ➔ arrow)
   ========================================================= */
.scenario-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn-scenario {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 12px; font-weight: 700;
  text-align: left;
  cursor: pointer; transition: all .2s;
  box-shadow: 0 2px 8px rgba(126, 34, 206, 0.03);
}
.btn-scenario::after {
  content: '➔';
  font-size: 14px;
  margin-left: 8px;
  transition: transform .2s;
}
.btn-scenario:hover::after { transform: translateX(3px); }

.scenario-danger {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid rgba(217,119,6,.3);
}
.scenario-danger:hover { background: rgba(217,119,6,.18); transform: translateY(-1px); }
.scenario-normal {
  background: rgba(243, 232, 255, 0.6);
  color: var(--purple-dark);
  border: 1px solid rgba(168, 85, 247, 0.25);
}
.scenario-normal:hover { background: rgba(243, 232, 255, 0.95); transform: translateY(-1px); }

/* =========================================================
   LIVE CALL BANNER
   ========================================================= */
.live-call-card {
  background: rgba(243, 232, 255, 0.7);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.12);
  text-align: center;
}
.live-call-card.hidden { display: none; }
.live-call-header { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--purple-dark); margin-bottom: 10px; }
.call-pulse-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--purple-main); box-shadow: 0 0 12px var(--purple-main);
  animation: pd 1s ease-in-out infinite;
}
@keyframes pd { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.3);opacity:.6} }
.call-speech-text { font-size: 14px; font-style: italic; color: var(--t1); font-weight: 500; margin-bottom: 10px; }

.input-tabs-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* =========================================================
   PIPELINE FLOW TRACKER
   ========================================================= */
.flow-tracker-card { margin-bottom: 20px; }
.flow-steps { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; }
.flow-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  opacity: 0.4;
  transition: opacity .3s, transform .3s;
}
.flow-step.active { opacity: 1; transform: scale(1.06); }
.step-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(243, 232, 255, 0.8); border: 1px solid rgba(168, 85, 247, 0.25);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.flow-step.active .step-icon {
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(168,85,247,.4);
}
.step-label { font-size: 11px; font-weight: 800; color: var(--t2); }
.flow-arrow { color: #c084fc; font-size: 13px; }

/* =========================================================
   BADGES
   ========================================================= */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 10px; font-weight: 800;
  letter-spacing: .4px; text-transform: uppercase;
}
.badge-info        { background: rgba(2,132,199,.1); color: var(--sky); border: 1px solid rgba(2,132,199,.25); }
.badge-dark        { background: rgba(243, 232, 255, 0.8); color: var(--t2); border: 1px solid rgba(168, 85, 247, 0.2); }
.badge-neutral     { background: rgba(243, 232, 255, 0.6); color: var(--t2); }
.badge-teal-outline{ background: transparent; color: var(--purple-dark); border: 1px solid rgba(168, 85, 247, 0.4); }

.badge-emergency {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid rgba(217,119,6,.4);
  box-shadow: 0 0 10px rgba(217,119,6,.15);
}
.badge-non-emergency { background: rgba(5,150,105,.1); color: var(--green); border: 1px solid rgba(5,150,105,.28); }

/* =========================================================
   OUTCOME CARD
   ========================================================= */
.outcome-card { margin-bottom: 20px; }
.outcome-metric-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.metric-box {
  background: rgba(243, 232, 255, 0.5);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.metric-label { font-size: 10px; color: var(--t3); font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.metric-value { font-size: 14px; font-weight: 800; color: var(--t1); }

.keywords-wrap, .summary-wrap { margin-top: 12px; }
.keywords-label, .summary-label { font-size: 11px; font-weight: 800; color: var(--t2); display: block; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }
.kw-tag {
  display: inline-block;
  background: rgba(168, 85, 247, 0.1);
  color: var(--purple-dark);
  border: 1px solid rgba(168, 85, 247, 0.25);
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; margin-right: 5px; margin-bottom: 4px;
}
.summary-text {
  font-size: 13px; color: var(--t1);
  background: rgba(243, 232, 255, 0.5);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--r-sm);
  padding: 12px;
}

/* =========================================================
   TELEPHONY EVENTS CONSOLE
   ========================================================= */
.telephony-events-list { display: flex; flex-direction: column; gap: 10px; max-height: 260px; overflow-y: auto; }
.event-box {
  background: rgba(243, 232, 255, 0.5);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-left: 4px solid var(--purple-main);
  border-radius: var(--r-sm);
  padding: 11px 14px;
}
.event-box.event-sms, .event-box.event-place_call { border-left-color: var(--amber); }
.event-box-header { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; margin-bottom: 5px; }
.event-type-label { color: var(--t1); }
.event-target { color: var(--t2); font-family: var(--mono); }
.event-content { font-size: 13px; color: var(--t2); line-height: 1.4; }
.maps-btn { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; font-size: 12px; color: var(--sky); text-decoration: none; font-weight: 700; }
.maps-btn:hover { text-decoration: underline; }
.empty-state { text-align: center; padding: 24px; color: var(--t3); }
.empty-icon { font-size: 26px; margin-bottom: 8px; }

/* =========================================================
   HISTORY TABLE
   ========================================================= */
.history-section { margin-top: 0; }
.table-responsive { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.history-table th {
  text-align: left; padding: 10px 14px;
  color: var(--t3); font-weight: 800;
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
  font-size: 11px; text-transform: uppercase; letter-spacing: .4px;
  background: rgba(243, 232, 255, 0.5);
}
.history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.1);
  color: var(--t2);
}
.history-table tr:hover td { background: rgba(243, 232, 255, 0.4); color: var(--t1); }

.sys-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700;
  background: rgba(168, 85, 247, 0.1);
  color: var(--purple-dark);
  border: 1px solid rgba(168, 85, 247, 0.22);
}

/* =========================================================
   MODALS
   ========================================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30, 27, 75, 0.45);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-card {
  background: var(--bg-card);
  backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  width: 90%; max-width: 560px;
  padding: 26px;
  box-shadow: 0 25px 60px rgba(126, 34, 206, 0.25);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { font-size: 17px; font-weight: 800; color: var(--t1); }
.btn-close { background: none; border: none; color: var(--t3); font-size: 18px; cursor: pointer; }
.btn-close:hover { color: var(--t1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.db-records-list { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.db-record-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: rgba(243, 232, 255, 0.5);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--r-sm);
  font-size: 13px;
}
.db-record-id { font-family: var(--mono); font-weight: 800; color: var(--purple-dark); }
.db-record-nums { font-size: 11px; color: var(--t2); }

/* =========================================================
   TOGGLE SWITCH
   ========================================================= */
.form-group-checkbox { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #cbd5e1;
  border: 1px solid var(--border);
  transition: .25s; border-radius: 20px;
}
.switch-slider::before {
  content: ''; position: absolute;
  height: 18px; width: 18px;
  left: 2px; bottom: 2px;
  background: #ffffff; transition: .25s; border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
input:checked + .switch-slider { background: linear-gradient(135deg, #a855f7, #7e22ce); border-color: transparent; }
input:checked + .switch-slider::before { transform: translateX(18px); background: #ffffff; }
.checkbox-label { font-size: 13px; color: var(--t2); font-weight: 600; }

/* =========================================================
   MIC INDICATORS
   ========================================================= */
.mic-listening-bar {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(243, 232, 255, 0.8);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--r-pill);
  padding: 10px 16px; margin-top: 12px;
  animation: mbPulse 1.5s ease-in-out infinite;
}
.mic-listening-bar.hidden { display: none; }
.mic-wave-text { color: var(--purple-dark); font-size: 12px; font-weight: 800; letter-spacing: .04em; margin: 0 8px; }
.mic-wave-dot {
  display: inline-block; width: 5px; border-radius: 3px;
  background: var(--purple-main); animation: mw .8s ease-in-out infinite;
}
.mic-wave-dot:nth-child(1) { height:10px; animation-delay:0s; }
.mic-wave-dot:nth-child(2) { height:16px; animation-delay:.1s; }
.mic-wave-dot:nth-child(3) { height:22px; animation-delay:.2s; }
.mic-wave-dot:nth-child(5) { height:22px; animation-delay:.2s; }
.mic-wave-dot:nth-child(6) { height:16px; animation-delay:.1s; }
.mic-wave-dot:nth-child(7) { height:10px; animation-delay:0s; }
@keyframes mw { 0%,100%{transform:scaleY(1);opacity:.7} 50%{transform:scaleY(1.6);opacity:1} }
@keyframes mbPulse {
  0%,100% { border-color: rgba(168, 85, 247, 0.35); }
  50% { border-color: rgba(168, 85, 247, 0.8); box-shadow: 0 0 14px rgba(168, 85, 247, 0.25); }
}

.mic-alert-banner {
  background: var(--amber-bg);
  border: 1px solid rgba(217,119,6,.28);
  border-radius: var(--r-sm);
  padding: 9px 14px; margin-bottom: 10px; font-size: 12px;
}
.mic-alert-header { color: var(--amber); font-weight: 800; margin-bottom: 3px; }
.mic-alert-text { color: var(--t2); line-height: 1.4; }

/* =========================================================
   UTILITIES
   ========================================================= */
.text-mono    { font-family: var(--mono); }
.text-muted   { color: var(--t3); }
.text-secondary { color: var(--t2); }
.text-center  { text-align: center; }
.text-teal    { color: var(--purple-dark); font-weight: 800; }
.text-amber   { color: var(--amber); font-weight: 800; }
.text-sm      { font-size: 13px; }
.hidden       { display: none !important; }
.mt-3         { margin-top: 12px; }
.mt-4         { margin-top: 16px; }
.mb-0         { margin-bottom: 0 !important; }
.mb-2         { margin-bottom: 8px; }

/* =========================================================
   STANDALONE LOGIN PAGE VIEW
   ========================================================= */
.login-page-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 10;
}

.login-card-container {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 36px 32px;
  box-shadow: 0 25px 60px rgba(126, 34, 206, 0.22);
  transition: transform .3s ease;
}

.login-brand-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.login-brand-subtitle {
  font-size: 13px;
  color: var(--t3);
  font-weight: 600;
}

.login-info-box {
  background: rgba(243, 232, 255, 0.6);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--r-sm);
  padding: 12px;
}

/* =========================================================
   MOBILE RESPONSIVENESS & TOUCH OPTIMIZATION
   ========================================================= */
@media (max-width: 768px) {
  body {
    padding: 12px 14px 30px;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px 14px;
    margin-bottom: 20px;
  }

  .brand {
    justify-content: center;
  }

  .tab-nav {
    max-width: 100%;
    width: 100%;
  }

  .tab-btn {
    padding: 10px 12px;
    font-size: 13px;
  }

  .header-actions {
    margin-left: 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .hero-section {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 20px;
  }

  .hero-title {
    font-size: 26px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-pill {
    min-width: 0;
    padding: 10px 12px;
  }

  .stat-num {
    font-size: 20px;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .scenario-buttons {
    grid-template-columns: 1fr;
  }

  .outcome-metric-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .location-inputs {
    grid-template-columns: 1fr;
  }

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

  .btn {
    min-height: 44px; /* Touch target accessibility */
  }

  .modal-card {
    padding: 20px 16px;
    width: 95%;
  }
}

@media (max-width: 480px) {
  .orb-container {
    width: 110px;
    height: 110px;
  }

  .liquid-orb {
    width: 100px;
    height: 100px;
  }

  .hero-title {
    font-size: 22px;
  }

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

/* =========================================================
   LIVE CONVERSATION DIALOGUE STREAM
   ========================================================= */
.chat-dialogue-stream {
  width: 100%;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--r-md);
  padding: 14px;
  backdrop-filter: blur(16px);
  text-align: left;
}

.chat-stream-header {
  font-size: 11px;
  font-weight: 800;
  color: var(--t2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.15);
  padding-bottom: 6px;
}

.chat-messages-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
}

.chat-bubble.agent {
  align-self: flex-start;
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
  color: var(--t1);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

.chat-bubble-sender {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.8;
  margin-bottom: 3px;
  display: block;
}

/* =========================================================
   PHONE DIALPAD SIMULATOR
   ========================================================= */
.phone-dialpad-card {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  backdrop-filter: blur(16px);
}

.phone-display-screen {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e1b4b;
  border: 1px solid #312e81;
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
}

.phone-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.phone-number-input {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 16px;
  font-weight: 700;
  width: 100%;
  outline: none;
}

.phone-call-timer {
  font-family: var(--mono);
  font-size: 12px;
  color: #a855f7;
  font-weight: 700;
}

.dialpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.btn-dial {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  padding: 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--t1);
  cursor: pointer;
  transition: all .15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.btn-dial:hover {
  background: #ffffff;
  border-color: #a855f7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
}

.btn-dial:active {
  transform: translateY(1px);
}

.sub-letters {
  font-size: 9px;
  font-weight: 600;
  color: var(--t3);
  letter-spacing: 1px;
}

/* =========================================================
   DEDICATED AGENT STUDIO PAGE
   ========================================================= */
.agent-studio-container {
  max-width: 1200px;
  margin: 0 auto;
}

.studio-badge-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.studio-hero-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.5px;
}

.studio-hero-subtitle {
  font-size: 14px;
  max-width: 680px;
  margin: 0 auto;
}

.studio-orb-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.studio-orb-container {
  width: 180px;
  height: 180px;
}

.studio-liquid-orb {
  width: 160px;
  height: 160px;
}

.studio-agent-status-box {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 20px;
  max-width: 600px;
  margin: 0 auto;
}

.studio-speech-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--t2);
  line-height: 1.5;
  margin-top: 6px;
}

.studio-controls-bar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(243, 232, 255, 0.6);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--r-md);
  padding: 16px;
}

.studio-control-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 180px;
}

.studio-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .studio-main-grid {
    grid-template-columns: 1fr;
  }
}

.studio-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
}

.telemetry-metrics-box {
  background: rgba(243, 232, 255, 0.5);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--r-sm);
  padding: 14px;
}

.telemetry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.telemetry-label {
  color: var(--t3);
  font-weight: 600;
}

.telemetry-val {
  color: var(--t1);
  font-weight: 700;
}

/* =========================================================
   MISSING CSS VARIABLES (referenced in badges/components)
   ========================================================= */
:root {
  --green:    #059669;
  --amber:    #d97706;
  --red-bg:   rgba(220, 38, 38, 0.10);
  --amber-bg: rgba(217, 119, 6, 0.10);
}

/* status dot colors */
.call-pulse-dot.green { background: #10b981; box-shadow: 0 0 10px rgba(16,185,129,.5); }
.call-pulse-dot.red   { background: #ef4444; box-shadow: 0 0 10px rgba(239,68,68,.5); }

.badge-success  { background: rgba(5,150,105,.1);  color: #059669; border: 1px solid rgba(5,150,105,.28); }
.badge-danger   { background: rgba(220,38,38,.1);  color: #dc2626; border: 1px solid rgba(220,38,38,.28); }
.badge-purple   { background: rgba(168,85,247,.1); color: #7e22ce; border: 1px solid rgba(168,85,247,.25); }
.status-pulse-indicator { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.status-label-text { font-size:13px; font-weight:700; color:var(--t2); }

/* mb-3 utility */
.mb-3 { margin-bottom: 12px !important; }
.my-4 { margin-top:16px; margin-bottom:16px; }
.p-3  { padding:12px; }
.text-left { text-align:left; }
.font-bold { font-weight:700; }
.justify-center { justify-content:center; }
.block { display:block; }
.tracking-wider { letter-spacing:.08em; }
.uppercase { text-transform:uppercase; }
.text-xs { font-size:11px; }

/* =========================================================
   FLOATING BANNER AI CHAT WIDGET
   ========================================================= */
.floating-ai-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9990;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(126, 34, 206, 0.55), 0 0 0 0 rgba(168,85,247,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s, box-shadow .25s;
  animation: floatPulse 3s ease-in-out infinite;
}
.floating-ai-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 36px rgba(126,34,206,.7);
}
.floating-ai-btn .fab-orb {
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f3e8ff 0%, #d8b4fe 30%, #a855f7 65%, #7e22ce 100%);
  box-shadow: inset 0 -6px 12px rgba(88,28,135,.7), inset 0 6px 10px rgba(255,255,255,.7);
  overflow: hidden;
  position: relative;
}
.floating-ai-btn .fab-orb-swirl {
  position: absolute; inset: -20%;
  border-radius: 42%;
  background: conic-gradient(from 0deg, rgba(243,232,255,.75), rgba(168,85,247,.9), rgba(126,34,206,.85), rgba(88,28,135,.95), rgba(243,232,255,.75));
  filter: blur(6px);
  mix-blend-mode: overlay;
  animation: orbRotate 5s linear infinite;
}
.floating-ai-btn .fab-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 18px; height: 18px;
  background: #10b981;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(16,185,129,.6);
  animation: pd 1.2s ease-in-out infinite;
}

@keyframes floatPulse {
  0%,100% { box-shadow: 0 8px 28px rgba(126,34,206,.55), 0 0 0 0 rgba(168,85,247,.4); }
  50%      { box-shadow: 0 10px 32px rgba(126,34,206,.65), 0 0 0 12px rgba(168,85,247,0); }
}

/* Floating chat panel */
.floating-chat-panel {
  position: fixed;
  bottom: 105px;
  right: 28px;
  z-index: 9991;
  width: 340px;
  max-height: 520px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(168,85,247,.35);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(126,34,206,.25), 0 4px 12px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.34,1.56,.64,1), opacity .22s ease;
}
.floating-chat-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.fcp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(168,85,247,.12) 0%, rgba(126,34,206,.06) 100%);
  border-bottom: 1px solid rgba(168,85,247,.15);
  flex-shrink: 0;
}
.fcp-header-orb {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f3e8ff, #a855f7 70%, #581c87);
  box-shadow: inset 0 -4px 8px rgba(88,28,135,.7), inset 0 4px 6px rgba(255,255,255,.7);
  overflow: hidden; position: relative; flex-shrink: 0;
  animation: orbSpeak 1.4s ease-in-out infinite alternate;
}
.fcp-header-info { flex: 1; min-width: 0; }
.fcp-header-title { font-size: 14px; font-weight: 800; color: var(--t1); line-height: 1.2; }
.fcp-header-subtitle { font-size: 11px; color: var(--t3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcp-memory-pill {
  font-size: 10px; font-weight: 700; color: #7e22ce;
  background: rgba(243,232,255,.8);
  border: 1px solid rgba(168,85,247,.25);
  border-radius: 999px; padding: 2px 8px;
  white-space: nowrap;
}
.fcp-close-btn {
  background: none; border: none; cursor: pointer;
  color: var(--t3); font-size: 16px; padding: 4px;
  border-radius: 6px; transition: color .15s, background .15s;
}
.fcp-close-btn:hover { color: var(--t1); background: rgba(168,85,247,.1); }

.fcp-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 160px;
  max-height: 300px;
}
.fcp-messages .chat-bubble { max-width: 92%; }

.fcp-mic-bar {
  margin: 0 14px 8px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(243,232,255,.8);
  border: 1px solid rgba(168,85,247,.35);
  border-radius: 999px;
  padding: 8px 14px;
  animation: mbPulse 1.5s ease-in-out infinite;
}
.fcp-mic-bar.active { display: flex; }
.fcp-mic-bar .mic-wave-dot { width: 4px; }

.fcp-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(168,85,247,.15);
  flex-shrink: 0;
  background: rgba(255,255,255,.95);
}
.fcp-text-input {
  flex: 1;
  background: rgba(243,232,255,.5);
  border: 1px solid rgba(168,85,247,.25);
  border-radius: 20px;
  padding: 9px 14px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--t1);
  outline: none;
  transition: border-color .2s;
}
.fcp-text-input:focus { border-color: var(--purple-main); box-shadow: 0 0 0 3px rgba(168,85,247,.15); }
.fcp-text-input::placeholder { color: var(--t3); }

.fcp-mic-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(168,85,247,.35);
  transition: transform .2s, box-shadow .2s;
}
.fcp-mic-btn:hover { transform: scale(1.08); box-shadow: 0 6px 18px rgba(168,85,247,.45); }
.fcp-mic-btn.recording {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  animation: pulseMic 1.1s ease-in-out infinite;
}
.fcp-send-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(168,85,247,.35);
  transition: transform .2s;
}
.fcp-send-btn:hover { transform: scale(1.08); }

/* Mobile adjustment for floating panel */
@media (max-width: 480px) {
  .floating-chat-panel {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 90px;
  }
  .floating-ai-btn {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }
}

