:root {
  --bg-main: #090d16;
  --bg-surface: #0f172a;
  --bg-panel: #141e33;
  --bg-card: #1e293b;
  --bg-hover: #26334d;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(59, 130, 246, 0.6);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --accent-purple: #8b5cf6;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* APP SHELL */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* TOP NAVBAR */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  z-index: 50;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-orb {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

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

.panel-tagline {
  font-size: 0.7rem;
  color: #a855f7;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.nav-agent-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.select-icon {
  position: absolute;
  left: 10px;
  font-size: 0.9rem;
  pointer-events: none;
}

.select-wrapper select {
  background: var(--bg-card);
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 0.45rem 1rem 0.45rem 2.2rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.save-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent-amber);
}

.save-status.saved .status-dot {
  background: var(--accent-green);
}

.save-status.saved .status-text {
  color: var(--accent-green);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: inherit;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

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

.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: #fff;
}

.btn-link {
  background: transparent;
  color: var(--accent-primary);
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-xs {
  font-size: 0.75rem;
}

/* 3-PANEL STUDIO BODY */
.studio-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 380px;
  flex: 1;
  height: calc(100vh - 61px);
  overflow: hidden;
  background: var(--bg-main);
}

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

/* LEFT PANEL (NAV) */
.left-panel {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
}

.panel-header {
  padding: 1rem 1.25rem 0.5rem;
}

.panel-header h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.5rem 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: #fff;
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.12);
  color: #fff;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
}

.engine-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.pulse-green {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

/* CENTER PANEL (EDITOR) */
.center-panel {
  background: var(--bg-main);
  padding: 1.5rem 2rem;
  overflow-y: auto;
  position: relative;
}

.editor-section {
  display: none;
  max-width: 820px;
  margin: 0 auto;
}

.editor-section.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.section-heading h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}

.section-heading p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* FORM CONTROLS */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.col-span-2 {
  grid-column: span 2;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-control {
  background: var(--bg-surface);
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px var(--border-focus);
}

textarea.form-control {
  resize: vertical;
}

.form-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.form-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}

.section-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

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

.radio-inline {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* PROMPT EDITOR */
.prompt-meta {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.prompt-tools, .prompt-variables-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

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

.chip-btn {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.12s;
}

.chip-btn:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.chip-container {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.prompt-editor {
  width: 100%;
  background: var(--bg-surface);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  outline: none;
  resize: vertical;
}

.prompt-editor:focus {
  border-color: var(--border-focus);
}

/* VOICE CARDS */
.voice-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}

.voice-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.15s;
}

.voice-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--bg-hover);
}

.voice-card.active {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.12);
}

.voice-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.voice-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.voice-tag {
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.voice-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* RANGE SLIDERS */
.form-range {
  width: 100%;
  accent-color: var(--accent-primary);
  cursor: pointer;
  margin-top: 0.5rem;
}

.value-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-card);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* PILLS & BEHAVIOR */
.pill-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill-toggle {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.12s;
}

.pill-toggle.active {
  background: rgba(59, 130, 246, 0.2);
  color: #fff;
  border-color: var(--accent-primary);
}

.style-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}

.style-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.style-card input {
  display: none;
}

.style-card.active {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.12);
}

.style-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.style-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.checklist-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* GUARDRAILS & TAGS */
.tag-input-area {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.rule-tag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}

.rule-remove-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.rule-remove-btn:hover {
  color: var(--accent-red);
}

.input-with-btn {
  display: flex;
  gap: 0.5rem;
}

.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }

/* TABLES */
.variables-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
}

/* TOOLS */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.tool-info h4 {
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.2rem;
}

.tool-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.tool-params {
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
}

/* KNOWLEDGE */
.knowledge-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.knowledge-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
}

.kc-icon {
  font-size: 1.5rem;
}

.kc-content h4 {
  font-size: 0.9rem;
  color: #fff;
}

.kc-content p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0.2rem 0 0.5rem;
}

.badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* SWITCHES */
.switch-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.switch-item input {
  display: none;
}

.switch-slider {
  width: 38px;
  height: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  position: relative;
  transition: all 0.2s;
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--text-secondary);
  top: 2px;
  left: 2px;
  transition: all 0.2s;
}

.switch-item input:checked + .switch-slider {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.switch-item input:checked + .switch-slider::before {
  transform: translateX(18px);
  background: #fff;
}

.switch-label {
  font-size: 0.85rem;
  color: #fff;
}

/* RIGHT PANEL (LIVE CONSOLE / VOICE LAB) */
.right-panel {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1.15rem;
  gap: 0.75rem;
  overflow-y: auto;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.agent-preview-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.agent-avatar {
  font-size: 1.3rem;
}

.live-agent-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
}

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

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.state-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.state-dot.idle { background: var(--text-muted); }
.state-dot.connecting { background: var(--accent-amber); animation: pulse 1s infinite; }
.state-dot.listening { background: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan); }
.state-dot.thinking { background: var(--accent-purple); animation: pulse 0.8s infinite; }
.state-dot.speaking { background: var(--accent-green); box-shadow: 0 0 10px var(--accent-green); }
.state-dot.interrupted { background: var(--accent-red); }

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

/* CUSTOM SLIM SCROLLBARS */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* LIVE ACTION HERO */
.live-action-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  position: relative;
}

.visualizer-container {
  width: 72px;
  height: 72px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.mic-orb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 2;
  transition: all 0.2s ease;
}

.visualizer-container.speaking .mic-orb {
  border-color: var(--accent-green);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.visualizer-container.listening .mic-orb {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

.pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-primary);
  opacity: 0;
  transform: scale(0.8);
}

.visualizer-container.active .pulse-ring {
  animation: ringPulse 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.visualizer-container.active .ring-2 {
  animation-delay: 0.6s;
}

@keyframes ringPulse {
  0% { transform: scale(0.7); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.call-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.btn-call-start {
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-call-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-call-stop {
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: var(--accent-red);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-call-stop:hover {
  background: #dc2626;
}

.hint-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.6rem;
}

/* TELEMETRY BAR */
.telemetry-bar {
  display: flex;
  justify-content: space-around;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
}

.telemetry-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

/* TRANSCRIPT PANEL */
.transcript-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 130px;
  max-height: 240px;
}

.transcript-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
}

.transcript-header h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.transcript-body {
  flex: 1;
  padding: 0.75rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.msg-bubble {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.4;
  animation: fadeIn 0.15s ease;
}

.msg-bubble.user {
  align-self: flex-end;
  background: var(--accent-primary);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.msg-bubble.ai {
  align-self: flex-start;
  background: var(--bg-card);
  color: #e2e8f0;
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 2px;
}

.msg-speaker {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
  opacity: 0.8;
}

/* HISTORY PANEL */
.history-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.history-header h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 115px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.history-item:hover {
  background: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.history-agent {
  font-weight: 500;
  color: #fff;
}

.history-meta {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

/* ACTIVE INDICATOR PILL */
.active-indicator-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.status-dot-active {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.status-text-bold {
  font-size: 0.75rem;
  font-weight: 600;
  color: #10b981;
}

/* LIVE HERO IDENTITY */
.agent-live-identity {
  text-align: center;
  margin: 0.35rem 0 0.75rem 0;
}

.agent-live-identity h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.agent-live-identity p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin-top: 0.15rem;
}

.console-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  margin: 0.75rem 0;
}

/* RESPONSIVENESS */
@media (max-width: 1080px) {
  .studio-body {
    grid-template-columns: 200px 1fr 320px;
  }
}

@media (max-width: 860px) {
  .studio-body {
    grid-template-columns: 1fr;
  }
  .left-panel, .right-panel {
    display: none;
  }
  body {
    overflow: auto;
  }
}

