/* PoliceTrust Design Language — 1930 Cyber Crime Helpline Web Caller */
:root {
  /* Core High-Contrast GovTech Palette */
  --ink: #0F172A;              /* Primary text / deep slate 900 */
  --ink-secondary: #334155;    /* Secondary text / slate 700 */
  --signal: #2563EB;           /* Brand electric blue 600 */
  --signal-hover: #1D4ED8;     /* Electric blue 700 */
  --signal-light: #EFF6FF;     /* Blue 50 */
  --cyan: #06B6D4;             /* Accent teal cyan */
  --surface: #FFFFFF;          /* Pure white card surface */
  --panel: #F8FAFC;            /* Subtle slate-50 panel */
  --panel-muted: #F1F5F9;      /* Slate-100 hover/aux */
  --success: #16A34A;          /* Verification green 600 */
  --success-light: #F0FDF4;    /* Green 50 */
  --warning: #F59E0B;          /* Advisory amber 500 */
  --warning-light: #FFFBEB;    /* Amber 50 */
  --danger: #DC2626;           /* End call crimson 600 */
  --danger-hover: #B91C1C;     /* Crimson 700 */
  --border: #E2E8F0;           /* Clean 1px border */
  --border-strong: #CBD5E1;    /* Focused/strong border */
  --muted: #64748B;            /* Secondary/muted text slate 500 */

  /* Fonts */
  --font-display: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  /* Layout & Safe Areas */
  --header-height: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Modern Executive Shadows */
  --shadow-subtle: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-raised: 0 12px 36px -4px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 0 1px rgba(37, 99, 235, 0.15), 0 8px 30px -4px rgba(37, 99, 235, 0.35);
}

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
  width: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* PoliceTrust signature faint grid + radial fade — STRICTLY PRESERVED */
  background-image:
    radial-gradient(60% 60% at 50% 0%, rgba(37, 99, 235, 0.07) 0%, rgba(37, 99, 235, 0) 70%),
    linear-gradient(to right, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ==========================================================================
   EXECUTIVE STICKY NAVBAR
   ========================================================================== */
header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.75rem 2rem;
  transition: all 0.2s ease;
}

.header-container {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  text-decoration: none;
}

.brand-badge-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-svg {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.2));
}

.brand-gov-tag {
  position: absolute;
  bottom: -6px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
}

.brand-title h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-1930 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #DC2626;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.brand-title p {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 0.1rem;
}

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

/* Duplex Indicator Pill */
.duplex-indicator {
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--success-light);
  border: 1px solid #BBF7D0;
  color: var(--success);
  letter-spacing: 0.03em;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.1);
}

.duplex-indicator.active {
  display: inline-flex;
}

/* Call Timer Pill */
.call-timer-badge {
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--danger);
  letter-spacing: 0.03em;
}

.call-timer-badge.active {
  display: inline-flex;
}

.rec-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger);
  animation: pulse-dot-anim 1.5s infinite;
}

/* Readiness Status Pill */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.95rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--ink);
  box-shadow: var(--shadow-subtle);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.ready {
  background: var(--success);
  box-shadow: 0 0 8px rgba(22, 163, 74, 0.5);
}

.status-dot.connecting {
  background: var(--warning);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
  animation: pulse-dot 1.2s infinite;
}

.status-dot.active {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.6);
  animation: pulse-dot 0.9s infinite;
}

/* Header Action Buttons */
.header-button {
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 9999px;
  padding: 0.38rem 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-subtle);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.header-button:hover {
  background: var(--panel);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

/* ==========================================================================
   GOLDEN HOUR EMERGENCY PROTOCOL BANNER
   ========================================================================== */
.emergency-top-banner {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  padding: 0.6rem 2rem;
}

.emergency-banner-inner {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.emergency-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.lightning-icon {
  font-size: 0.85rem;
}

.emergency-text {
  color: #475569;
  font-weight: 500;
  flex: 1;
  min-width: 280px;
}

.emergency-reqs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.emergency-reqs span:first-child {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.req-chip {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink);
}

.req-chip.highlight {
  background: var(--signal-light);
  border-color: #BFDBFE;
  color: var(--signal);
  font-weight: 700;
}

/* ==========================================================================
   MAIN WORKSPACE DUPLEX LAYOUT
   ========================================================================== */
main, .duplex-layout {
  max-width: 1560px;
  margin: 1.5rem auto;
  padding: 0 2rem;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1.75rem;
  width: 100%;
  align-items: start;
}

.duplex-layout.call-live {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
}

/* ==========================================================================
   POLICETRUST CARD PRIMITIVES
   ========================================================================== */
.pt-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all 0.2s ease;
}

.pt-card:hover {
  box-shadow: 0 8px 28px -4px rgba(15, 23, 42, 0.08), 0 2px 8px -2px rgba(15, 23, 42, 0.04);
}

.pt-card-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: #FFFFFF;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

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

.header-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--signal-light);
  color: var(--signal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}

.header-icon-box.call-icon {
  background: rgba(37, 99, 235, 0.1);
  color: var(--signal);
}

.header-icon-box.case-icon {
  background: var(--success-light);
  color: var(--success);
}

.pt-card-header h2 {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
}

.header-sub {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.pt-card-body {
  padding: 1.5rem;
}

/* Officer Badge */
.officer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--signal-light);
  border: 1px solid #BFDBFE;
  color: var(--signal);
}

.officer-duty-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.6);
  animation: pulse-dot 1.5s infinite;
}

/* ==========================================================================
   LEFT PANEL: REAL-TIME CONVERSATION STREAM
   ========================================================================== */
.left-conversation-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 165px);
  min-height: 720px;
}

.left-conversation-panel .conversation-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
}

.transcript-header-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-stream-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--signal-light);
  border: 1px solid #BFDBFE;
  color: var(--signal);
  letter-spacing: 0.02em;
}

.word-counter {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
}

.transcript-scroll {
  flex: 1;
  min-height: 480px;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: #F8FAFC;
}

.transcript-scroll::-webkit-scrollbar {
  width: 6px;
}

.transcript-scroll::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

/* Empty State Illustration */
.empty-state-text {
  text-align: center;
  color: var(--muted);
  margin: auto;
  max-width: 400px;
  padding: 2.5rem 1rem;
}

.empty-state-illustration {
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: center;
}

.agent-avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #BFDBFE;
  color: var(--signal);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.18);
  position: relative;
}

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

.empty-state-text p {
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.empty-state-pills {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
  background: #FFFFFF;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-subtle);
  font-size: 0.8rem;
  color: #475569;
}

/* Speech Bubbles */
.speech-bubble {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: bubble-fade 0.2s ease-in;
}

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

.speech-bubble.agent {
  align-self: flex-start;
}

.speech-bubble.caller {
  align-self: flex-end;
}

.speech-author {
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.speech-bubble.agent .speech-author {
  color: var(--signal);
}

.speech-bubble.caller .speech-author {
  color: var(--muted);
  justify-content: flex-end;
}

.speech-content {
  padding: 0.95rem 1.25rem;
  border-radius: 1.15rem;
  font-size: 0.94rem;
  line-height: 1.6;
  word-break: break-word;
}

.speech-bubble.agent .speech-content {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-left: 3.5px solid var(--signal);
  color: var(--ink);
  border-top-left-radius: 0.25rem;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
}

.speech-bubble.caller .speech-content {
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%);
  color: #FFFFFF;
  border-top-right-radius: 0.25rem;
  box-shadow: 0 4px 14px -3px rgba(37, 99, 235, 0.35);
}

/* In-flight Live Interim Speech Bubble */
.speech-bubble.caller.interim .speech-content {
  background: rgba(37, 99, 235, 0.06);
  border: 1.5px dashed var(--signal);
  color: var(--ink);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.speech-bubble.caller.interim .speech-author {
  color: var(--signal);
}

.stream-cursor {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  background-color: var(--signal);
  vertical-align: text-bottom;
  margin-left: 3px;
  border-radius: 1px;
  animation: blink-cursor 0.75s infinite;
}

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

/* Chat Input Dock */
.chat-dock {
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #FFFFFF;
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.chat-dock input {
  flex: 1;
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--ink);
  font-size: 0.88rem;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

.chat-dock input:focus {
  outline: none;
  border-color: var(--signal);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.chat-dock button {
  background: var(--signal);
  color: #FFFFFF;
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem 1.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chat-dock button:hover {
  background: var(--signal-hover);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.35);
}

/* ==========================================================================
   RIGHT PANEL: COMMAND STATION & FORM 1930 DOSSIER
   ========================================================================== */
.right-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 2-Way Voice Call Station */
.hero-call-station {
  overflow: hidden;
}

.hero-caller {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.75rem 1.5rem 1.5rem;
  position: relative;
  text-align: center;
}

/* Officer Profile Hero Card (Idle State) */
.officer-profile-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-subtle);
  margin-bottom: 1.25rem;
  text-align: left;
}

.officer-avatar-box {
  position: relative;
  flex-shrink: 0;
}

.officer-avatar-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--signal-light);
  color: var(--signal);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #BFDBFE;
}

.officer-status-ring {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.6);
}

.officer-profile-meta {
  flex: 1;
}

.officer-meta-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.officer-meta-row h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}

.officer-designation {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--signal);
  background: var(--signal-light);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid #BFDBFE;
}

.officer-profile-meta p {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Primary Start Call Button */
.start-call-banner {
  width: 100%;
  margin-bottom: 1.15rem;
}

.primary-start-call-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.6rem;
  border-radius: 1.15rem;
  border: 2px solid #2563EB;
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 55%, #3B82F6 100%);
  color: #FFFFFF;
  box-shadow: 0 10px 28px -4px rgba(37, 99, 235, 0.42), 0 4px 12px -2px rgba(37, 99, 235, 0.25);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.primary-start-call-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-25deg);
  transition: left 0.8s ease;
}

.primary-start-call-btn:hover::after {
  left: 140%;
}

.primary-start-call-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -4px rgba(37, 99, 235, 0.55), 0 6px 16px -2px rgba(37, 99, 235, 0.35);
  border-color: #93C5FD;
}

.primary-start-call-btn:active {
  transform: translateY(0);
}

.primary-start-call-btn .btn-icon-wrapper {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.4);
  transition: transform 0.2s ease;
}

.primary-start-call-btn:hover .btn-icon-wrapper {
  transform: scale(1.08);
}

.primary-start-call-btn .btn-text-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.primary-start-call-btn .btn-main-label {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-transform: uppercase;
}

.primary-start-call-btn .btn-sub-label {
  font-size: 0.82rem;
  opacity: 0.95;
  font-weight: 500;
}

.btn-arrow-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.primary-start-call-btn:hover .btn-arrow-icon {
  transform: translateX(4px);
  opacity: 1;
}

/* Connecting State */
.primary-start-call-btn.connecting {
  background: linear-gradient(135deg, #B45309 0%, #D97706 55%, #F59E0B 100%);
  border-color: #FBBF24;
  cursor: wait;
  box-shadow: 0 10px 25px -4px rgba(217, 119, 6, 0.45);
}

/* In-Call Active State */
.primary-start-call-btn.in-call {
  background: linear-gradient(135deg, #991B1B 0%, #DC2626 55%, #EF4444 100%);
  border-color: #F87171;
  box-shadow: 0 10px 25px -4px rgba(220, 38, 38, 0.48), 0 0 0 4px rgba(220, 38, 38, 0.15);
}

/* Idle Call Container */
.idle-call-container {
  width: 100%;
}

.idle-features-badge {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.idle-features-badge span:not(:contains('•')) {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

/* Live Activity Box Container */
.live-activity-box {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 1.15rem;
  padding: 1.4rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-card);
}

.active-call-badge-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.active-call-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--success-light);
  border: 1px solid #BBF7D0;
  color: var(--success);
}

.speaker-state-caption {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  margin-top: 0.4rem;
  margin-bottom: 0.25rem;
}

.speaker-subtext {
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* Soundwave Meter (28 Bars) */
.soundwave-meter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 48px;
  width: 100%;
  max-width: 360px;
  margin: 0.5rem auto 1.25rem;
  padding: 0 0.5rem;
}

.soundwave-bar {
  flex: 1;
  background: var(--border-strong);
  border-radius: 3px;
  min-height: 4px;
  max-height: 44px;
  height: 4px;
  transition: height 0.08s ease, background-color 0.15s ease;
}

.soundwave-meter.active-agent .soundwave-bar {
  background: var(--cyan);
}

.soundwave-meter.active-caller .soundwave-bar {
  background: var(--signal);
}

/* Real-Time Speech Stream Ticker in Hero Box */
.hero-live-speech-box {
  width: 100%;
  background: #F8FAFC;
  border: 1.5px dashed rgba(37, 99, 235, 0.35);
  border-radius: 0.85rem;
  padding: 0.65rem 0.95rem;
  margin: 0.85rem 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
  min-height: 42px;
}

.speech-ticker-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--signal);
  letter-spacing: 0.05em;
  white-space: nowrap;
  background: var(--signal-light);
  border: 1px solid #BFDBFE;
  padding: 0.18rem 0.5rem;
  border-radius: 0.35rem;
}

.speech-ticker-content {
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-body);
  flex: 1;
  text-align: left;
}

/* In-Call Actions Row */
.in-call-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.95rem;
  width: 100%;
}

.aux-btn {
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  color: var(--ink);
  border-radius: 9999px;
  padding: 0.65rem 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
}

.aux-btn:hover:not(:disabled) {
  background: var(--panel);
  border-color: var(--border-strong);
}

.aux-btn.active {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.3);
  color: var(--danger);
}

.primary-end-call-btn {
  flex: 1.35;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.65rem 1.4rem;
  border-radius: 9999px;
  border: 2px solid #DC2626;
  background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
  color: #FFFFFF;
  font-size: 0.9rem;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-end-call-btn:hover {
  background: linear-gradient(135deg, #B91C1C 0%, #DC2626 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.48);
}

/* ==========================================================================
   FORM 1930 CASE FILE CARD: OFFICIAL NCRP DOSSIER
   ========================================================================== */
.case-file-card {
  overflow: hidden;
}

.case-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.case-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--success);
  background: var(--success-light);
  border: 1px solid #BBF7D0;
  border-radius: 9999px;
  padding: 0.2rem 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-completion-badge {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--ink-secondary);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.25rem 0.65rem;
}

.case-progress-wrap {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 1.35rem;
}

.case-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--signal), #16A34A);
  transition: width 0.4s ease;
}

.case-section-block {
  margin-bottom: 1.35rem;
}

.case-section-block:last-of-type {
  margin-bottom: 0.85rem;
}

.case-section-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.6rem;
}

.section-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--signal-light);
  color: var(--signal);
  border: 1px solid #BFDBFE;
  padding: 0.15rem 0.5rem;
  border-radius: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.case-field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.field-cell {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 0.75rem 0.95rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.field-cell:hover {
  background: #FFFFFF;
  border-color: var(--border-strong);
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.06);
}

.field-cell.full-span {
  grid-column: span 2;
}

.field-cell.critical-field {
  border-left: 4px solid var(--signal);
  background: #F8FAFC;
}

.field-cell.critical-field:hover {
  border-left-color: var(--signal-hover);
  background: #FFFFFF;
}

.field-cell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.field-cell-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.slot-badge {
  font-size: 0.64rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 0.35rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.slot-badge.pending {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #E2E8F0;
}

.slot-badge.detected {
  background: var(--signal-light);
  color: var(--signal);
  border: 1px solid #BFDBFE;
}

.slot-badge.verified {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #BBF7D0;
}

.field-cell-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
  line-height: 1.35;
  margin-top: 0.15rem;
}

.field-cell-value.highlight {
  color: var(--signal);
}

.field-cell-value.pending {
  color: #94A3B8;
  font-weight: 500;
  font-style: normal;
  font-size: 0.85rem;
}

/* Real-Time Live Fill Pulse Glow Animation */
@keyframes slot-pulse {
  0% {
    border-color: var(--signal);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    background: rgba(37, 99, 235, 0.06);
  }
  50% {
    border-color: #16A34A;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.2);
    background: rgba(22, 163, 74, 0.05);
  }
  100% {
    border-color: var(--border);
    box-shadow: none;
    background: #F8FAFC;
  }
}

.field-cell.just-filled {
  animation: slot-pulse 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Ticket Verification Banner */
.ticket-card-banner {
  background: #F0FDF4;
  border: 1.5px solid #86EFAC;
  border-radius: 0.95rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  box-shadow: 0 3px 12px rgba(22, 163, 74, 0.1);
}

.ticket-banner-info p {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #15803D;
}

.ticket-banner-info h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.pt-btn-action {
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  color: var(--ink);
  border-radius: 0.65rem;
  padding: 0.55rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.pt-btn-action:hover {
  background: var(--panel);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.case-btn-row {
  display: flex;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.open {
  display: flex;
}

.modal-surface {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  width: 90%;
  max-width: 540px;
  padding: 2rem;
  box-shadow: var(--shadow-raised);
}

.modal-surface h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
}

.modal-close-x {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}

.modal-close-x:hover {
  color: var(--ink);
}

.input-group {
  margin-bottom: 1.15rem;
}

.input-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.input-group input, .input-group select {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border-radius: 0.65rem;
  background: var(--panel);
  border: 1.5px solid var(--border);
  color: var(--ink);
  font-size: 0.88rem;
  font-family: var(--font-body);
}

.input-group input:focus, .input-group select:focus {
  outline: none;
  border-color: var(--signal);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.primary-btn {
  width: 100%;
  padding: 0.85rem;
  background: var(--signal);
  color: #FFFFFF;
  border: none;
  border-radius: 0.65rem;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.primary-btn:hover {
  background: var(--signal-hover);
}

/* Ledger Table */
.pt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

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

.pt-table th {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  background: var(--panel);
  font-size: 0.72rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem calc(1.5rem + var(--safe-bottom));
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  background: #FFFFFF;
  width: 100%;
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-brand strong {
  color: var(--ink);
}

/* ==========================================================================
   MOBILE & RESPONSIVE BREAKPOINTS
   ========================================================================== */
.mobile-tab-nav {
  display: none;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--header-height, 64px);
  z-index: 40;
  gap: 0.65rem;
  width: 100%;
}

.mobile-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 0.95rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.mobile-tab-btn.active {
  background: var(--signal);
  border-color: var(--signal);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.mobile-tab-dot {
  display: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
}

.mobile-tab-dot.active {
  display: inline-block;
  animation: pulse-dot-anim 1.5s infinite;
}

.mobile-tab-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  background: rgba(148, 163, 184, 0.2);
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
}

.mobile-tab-btn.active .mobile-tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.mobile-in-call-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
  width: 100%;
}

.mobile-in-call-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.mobile-in-call-timer {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--danger);
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
}

.mobile-in-call-status {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-in-call-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.mobile-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  border: 1px solid var(--border);
}

.mobile-action-btn.mute {
  background: var(--panel);
  color: var(--ink);
}

.mobile-action-btn.mute.active {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.35);
}

.mobile-action-btn.end {
  background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
  color: #FFFFFF;
  border-color: #DC2626;
}

/* TABLETS & SMALL LAPTOPS (<= 1120px) */
@media (max-width: 1120px) {
  .mobile-tab-nav {
    display: flex;
  }

  main, .duplex-layout {
    grid-template-columns: 1fr;
    padding: 0 1rem;
    margin: 1rem auto;
  }

  .duplex-layout.view-call .left-conversation-panel {
    display: none !important;
  }
  .duplex-layout.view-call .right-controls-panel {
    display: flex !important;
    width: 100%;
  }

  .duplex-layout.view-transcript .left-conversation-panel {
    display: flex !important;
    width: 100%;
    height: calc(100dvh - var(--header-height, 64px) - 66px - var(--safe-bottom, 0px));
    min-height: 480px;
  }
  .duplex-layout.view-transcript .right-controls-panel {
    display: none !important;
  }
}

/* PHONES (<= 768px) */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  header {
    padding: 0.5rem 1rem;
  }

  .brand-title p {
    display: none;
  }

  .header-actions .btn-label-text {
    display: none;
  }

  .emergency-top-banner {
    padding: 0.5rem 1rem;
  }

  .emergency-text {
    display: none;
  }

  .case-field-grid {
    grid-template-columns: 1fr !important;
  }

  .field-cell.full-span {
    grid-column: span 1 !important;
  }

  .chat-dock input {
    font-size: 16px !important;
  }
}

/* KEYFRAMES */
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}

@keyframes pulse-dot-anim {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Call History Records Table & Modal Components */
.records-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.records-table th {
  background: var(--panel);
  padding: 0.75rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.records-table td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--ink);
}

.records-table tr:hover {
  background: var(--panel);
}

.ticket-mono {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--signal);
}

