:root {
  --bg-main: #080c14;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --bg-input: rgba(15, 23, 42, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(16, 185, 129, 0.4);
  
  --primary: #10b981;
  --primary-glow: rgba(16, 185, 129, 0.25);
  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;
  --danger: #ef4444;
  --warning: #f59e0b;

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

  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body.dark-theme {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.07) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(6, 182, 212, 0.04) 0px, transparent 60%);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  background: rgba(8, 12, 20, 0.8);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  position: relative;
}

.pulse-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.02em;
}

.badge-tag {
  font-size: 0.68rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.brand-sub span {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.session-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status-indicator.ready {
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.status-indicator.live {
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  animation: pulseLive 1.5s infinite;
}

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

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

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* Layout */
.app-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  flex: 1;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
}

/* Stage Card (Left Column) */
.call-stage-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.avatar-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.ai-avatar {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-core {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 2;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ring-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.4);
  opacity: 0;
  pointer-events: none;
}

.ai-avatar.active-speaking .avatar-core {
  transform: scale(1.08);
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.6);
}

.ai-avatar.active-speaking .r1 {
  animation: ripple 2s infinite cubic-bezier(0, 0.2, 0.8, 1);
}

.ai-avatar.active-speaking .r2 {
  animation: ripple 2s infinite 0.7s cubic-bezier(0, 0.2, 0.8, 1);
}

@keyframes ripple {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.companion-meta h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.companion-role {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.speaking-state-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border-radius: 20px;
  margin-top: 0.6rem;
  transition: all 0.3s;
}

.speaking-state-pill.speaking {
  background: rgba(16, 185, 129, 0.18);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.speaking-state-pill.listening {
  background: rgba(6, 182, 212, 0.18);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.call-timer {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* Waveform Canvas */
.waveform-container {
  margin: 2rem 0;
  height: 140px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

#waveformCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.waveform-labels {
  position: absolute;
  bottom: 8px;
  right: 12px;
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.stream-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.mic-dot { background: var(--accent-cyan); }
.ai-dot { background: var(--primary); }

/* Controls Toolbar */
.controls-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.btn {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.8rem 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
  flex: 1;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.4);
}

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

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

.btn-icon-round {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  flex: 1;
}

.btn-danger:hover {
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.hidden {
  display: none !important;
}

/* Architectural Pill */
.architecture-pill {
  margin-top: 2rem;
  padding: 0.9rem 1.1rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.45;
}

.arch-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a5b4fc;
  margin-bottom: 0.3rem;
}

.arch-text {
  color: var(--text-muted);
}

.arch-text strong {
  color: var(--text-main);
}

/* Insights Panel (Right Column) */
.insights-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.25);
}

.tab-btn {
  flex: 1;
  padding: 1rem 1.2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(16, 185, 129, 0.04);
}

.count-bubble {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.45rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.transcript-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 600px;
}

/* Transcript Top Bar */
.transcript-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.25);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text-main);
}

.panel-heading h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.panel-heading svg {
  color: var(--primary);
}

.action-row {
  display: flex;
  gap: 0.6rem;
}

.btn-xs {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-xs:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Transcript Feed */
.transcript-feed {
  flex: 1;
  padding: 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-height: 480px;
  max-height: 650px;
}

.turn-message {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  line-height: 1.5;
  animation: fadeIn 0.25s ease forwards;
}

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

.turn-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  font-size: 0.76rem;
}

.turn-speaker {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.speaker-patient {
  border-left: 3px solid var(--accent-cyan);
  background: rgba(6, 182, 212, 0.04);
}
.speaker-patient .turn-speaker { color: var(--accent-cyan); }

.speaker-ai {
  border-left: 3px solid var(--primary);
  background: rgba(16, 185, 129, 0.04);
}
.speaker-ai .turn-speaker { color: var(--primary); }

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

.turn-text {
  font-size: 0.92rem;
  color: var(--text-main);
}

.streaming-cursor {
  display: inline-block;
  width: 6px;
  height: 14px;
  background: var(--primary);
  margin-left: 3px;
  animation: blink 0.9s infinite;
  vertical-align: middle;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--text-dim);
  max-width: 420px;
  margin: auto;
}

.empty-icon {
  font-size: 2.8rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.86rem;
  line-height: 1.5;
}

/* Clinical Measures Dashboard */
.clinical-dashboard {
  padding: 1.2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-height: 580px;
}

.triage-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.4rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.triage-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.triage-val {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

.triage-badge {
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.triage-badge.emergency {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.triage-badge.urgent {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

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

.measures-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.measure-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
}

.measure-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.measure-val {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 0.3rem;
}

.pain-val {
  color: var(--warning);
  font-family: var(--font-mono);
  font-size: 1.15rem;
}

.section-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
}

.section-card h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
}

.placeholder-tag {
  color: var(--text-dim);
  font-size: 0.82rem;
  font-style: italic;
}

.double-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.reasoning-summary-card {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.reasoning-summary-card h4 {
  color: #a5b4fc;
}

.reasoning-summary-card p {
  font-size: 0.88rem;
  line-height: 1.5;
  color: #cbd5e1;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

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

.help-text code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  color: var(--accent-cyan);
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  background: rgba(0, 0, 0, 0.2);
}

/* =============================================================
   GAMEPLAN SANDY POC: ESCALATIONS, TABS & STRUCTURED INSPECTOR
   ============================================================= */

/* Emergency Escalation Banner */
.escalation-banner {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.95), rgba(185, 28, 28, 0.95));
  border-bottom: 2px solid #f87171;
  box-shadow: 0 4px 24px rgba(239, 68, 68, 0.4);
  padding: 0.85rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  animation: pulse-emergency 2s infinite ease-in-out;
}

@keyframes pulse-emergency {
  0%, 100% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.85); }
}

.escalation-content {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.escalation-icon {
  font-size: 1.8rem;
  animation: bounce-icon 1s infinite alternate;
}

@keyframes bounce-icon {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

.escalation-text {
  flex: 1;
  color: #fff;
}

.escalation-text strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.escalation-text p {
  font-size: 0.85rem;
  opacity: 0.95;
  margin-top: 0.2rem;
}

.btn-dismiss {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
}

/* Participant & Security Card on Left Stage */
.participant-card {
  margin-top: 0.8rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.badge-status {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

.badge-status.verified {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-source {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 500;
}

.participant-details {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.participant-details strong {
  color: var(--text-main);
}

/* Panel Tab Bar */
.panel-tab-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem 0 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 15, 29, 0.5);
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

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

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(16, 185, 129, 0.06);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
}

.tab-content.hidden {
  display: none;
}

/* Structured Inspector Feed */
.structured-inspector-feed {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: calc(100vh - 230px);
}

.inspector-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.5rem;
}

.card-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.card-badge.badge-accent {
  background: rgba(99, 102, 241, 0.18);
  color: #818cf8;
}

.card-badge.badge-safety {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.card-header h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

/* PROMIS-10 Grid */
.promis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.promis-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-title {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.item-val {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.item-val.pending {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
}

.item-val.done {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* What Matters Survey Blocks */
.what-matters-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.what-matters-block label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 28px;
  align-items: center;
}

.tag-empty {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
}

.tag-pill {
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  animation: fadeIn 0.3s ease;
}

.caller-quote {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(99, 102, 241, 0.4);
  margin-top: 0.2rem;
}

.escalations-feed {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.escalation-log-item {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.4rem;
}

.escalation-log-item strong {
  color: #f87171;
}

/* Navigation Prompt Editor Button */
.nav-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.nav-action-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.55);
  color: #fff;
  transform: translateY(-1px);
}

.nav-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.custom-badge-dot {
  width: 7px;
  height: 7px;
  background: #f59e0b;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
  display: inline-block;
}

/* Prompt Modal */
.modal-card-xl {
  max-width: 900px;
  width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.modal-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.modal-body-prompt {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  padding: 1.25rem 1.5rem;
  flex: 1;
}

.prompt-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.prompt-status-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-main);
}

.status-dot.dot-idle {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.status-dot.dot-locked {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.prompt-meta-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.prompt-stat-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.badge-custom-active {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.prompt-field-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
}

.prompt-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.prompt-textarea {
  flex: 1;
  min-height: 380px;
  max-height: 52vh;
  resize: vertical;
  background: rgba(10, 14, 26, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #e2e8f0;
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 1rem;
  outline: none;
  transition: border-color 0.2s;
  overflow-y: auto;
  white-space: pre-wrap;
}

.prompt-textarea:focus {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.prompt-textarea:read-only {
  background: rgba(15, 23, 42, 0.5);
  color: var(--text-dim);
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.06);
}

.prompt-footer-hint {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

.prompt-footer-hint svg {
  color: var(--primary);
  flex-shrink: 0;
}

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

.modal-footer-right {
  display: flex;
  gap: 0.6rem;
}

.btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-dim);
}

.btn-reset:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

