/**
 * chatbot/static/css/white_command.css
 * Enterprise Light Mode / White Background Cyber Command Center
 * High-Readability Daylight Law Enforcement Intelligence Deck
 */

:root {
  --bg-main: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-hover: #e2e8f0;
  
  --border-light: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-accent: #3b82f6;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --navy-brand: #0a192f;
  --navy-header: #0f294a;
  --blue-primary: #1d4ed8;
  --blue-soft: #eff6ff;
  
  --green-online: #10b981;
  --green-soft: #ecfdf5;
  --amber-alert: #f59e0b;
  --amber-soft: #fffbeb;
  --red-critical: #ef4444;
  --red-soft: #fef2f2;
  --purple-intel: #8b5cf6;
  --purple-soft: #f5f3ff;
  --cyan-radar: #0284c7;
  
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-float: 0 12px 30px -4px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.06);

  --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-xl: 20px;
  --radius-full: 9999px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================================
   Top Header Bar
   ========================================================================= */

.white-header {
  height: 58px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

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

.brand-crest {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--navy-header);
}

.brand-title span {
  color: var(--text-muted);
  font-weight: 400;
}

.brand-subtitle {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--cyan-radar);
  text-transform: uppercase;
}

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

/* Radar Badge */
.radar-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green-soft);
  border: 1px solid #a7f3d0;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.radar-badge:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.radar-dot-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-online);
  position: relative;
}

.radar-dot-pulse::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 2px solid var(--green-online);
  animation: radarWave 1.8s infinite;
}

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

.radar-text {
  font-size: 12px;
  font-weight: 600;
  color: #065f46;
}

/* Metric & Alert Badges */
.metric-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--blue-soft);
  border: 1px solid #bfdbfe;
  color: var(--blue-primary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-full);
}

.alert-banner-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--red-soft);
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  animation: alertPulse 2s infinite ease-in-out;
}

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

/* District Pills */
.district-pill-group {
  display: flex;
  gap: 4px;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.district-btn {
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.district-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.district-btn.active {
  background: var(--navy-header);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.auto-detected-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.auto-detected-pill:hover {
  background: #d1fae5;
}

.auto-detected-pill.active {
  background: #059669 !important;
  color: #ffffff !important;
  border-color: #047857 !important;
}

.gps-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: gpsPulse 1.6s infinite ease-in-out;
}

@keyframes gpsPulse {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(0.9); opacity: 1; }
}

.district-select-wrapper {
  display: flex;
  align-items: center;
  padding: 0;
}

.district-select-dropdown {
  background: #ffffff;
  border: 1px solid var(--border-strong, #cbd5e1);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-header);
  padding: 5px 12px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.district-select-dropdown:hover, .district-select-dropdown:focus {
  border-color: var(--blue-primary);
  color: var(--blue-primary);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

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

.header-action-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.header-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.clock-box {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 4px 8px;
}

/* =========================================================================
   App Main Layout (3-Column Grid)
   ========================================================================= */

.white-deck-container {
  display: flex;
  height: calc(100vh - 58px);
  width: 100%;
  overflow: hidden;
}

/* Column 1: Left Navigation & Query Inspector */
.left-rail {
  width: 220px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 10px;
  flex-shrink: 0;
  overflow-y: auto;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.nav-item-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.nav-item-btn.active {
  background: var(--blue-soft);
  color: var(--blue-primary);
  border-color: #bfdbfe;
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* SQL Query Inspection Card */
.sql-inspect-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-top: 12px;
}

.sql-inspect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.sql-code-box {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #0f172a;
  line-height: 1.4;
  overflow-x: auto;
  white-space: pre;
}

.sql-status-row {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 600;
  color: #059669;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Column 2: Center Main Copilot Investigation Workspace */
.center-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  position: relative;
  overflow: hidden;
  min-width: 460px;
}

/* Top Mini Bar in Center */
.center-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  font-size: 11.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.meta-url {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-weight: 500;
}

.meta-actions {
  display: flex;
  gap: 6px;
}

.meta-action-btn {
  padding: 3px 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.meta-action-btn.primary {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}

/* Chat Messages Scrollable Area */
.chat-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 100px; /* 100px padding bottom to float above search bar */
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Message Bubbles */
.chat-message-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 100%;
}

.chat-message-row.user {
  align-self: flex-end;
  max-width: 80%;
}

.chat-message-row.assistant {
  align-self: flex-start;
  width: 100%;
}

.bubble-user {
  background: var(--navy-header);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 18px 18px 4px 18px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}

.bubble-assistant {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 4px 18px 18px 18px;
  padding: 16px 20px;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Dossier Cards Inside Assistant Bubble */
.dossier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

/* Suspect Card */
.suspect-profile-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.suspect-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.suspect-mugshot {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 2px solid #e2e8f0;
}

.suspect-meta h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.suspect-meta span {
  font-size: 11px;
  color: var(--text-muted);
}

.risk-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: var(--red-critical);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 2px;
}

.suspect-details-list {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  border-top: 1px solid var(--border-light);
  padding-top: 6px;
}

/* Incident Event Card */
.incident-event-card {
  background: var(--amber-soft);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  box-sizing: border-box;
}

.incident-event-card h5 {
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.incident-short-box {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.incident-short-box .incident-title-sm {
  font-size: 12px;
  font-weight: 700;
  color: #78350f;
  margin-bottom: 4px;
  line-height: 1.35;
}

.incident-short-box .incident-summary-p {
  font-size: 11.5px;
  line-height: 1.45;
  color: #92400e;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.incident-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #92400e;
  margin-top: 2px;
}

.btn-incident-details {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 7px 12px;
  background: #ffffff;
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius-sm);
  color: #b45309;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.12);
}

.btn-incident-details:hover {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.25);
  transform: translateY(-1px);
}

/* =========================================================================
   Officer Case Intelligence Modal (Complete Details Popup)
   ========================================================================= */
.intel-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.intel-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.intel-modal-container {
  background: #ffffff;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--border-strong, #cbd5e1);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 0.22s ease-out;
}

@keyframes modalSlideUp {
  from { transform: translateY(12px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.intel-modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.intel-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--navy-header, #0f172a);
}

.intel-modal-close-btn {
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.intel-modal-close-btn:hover {
  background: var(--red-soft, #fee2e2);
  color: var(--red-critical, #dc2626);
  border-color: #fca5a5;
}

.intel-modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  font-family: var(--font-sans);
  color: var(--text-primary, #1e293b);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.intel-section-box {
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  padding: 12px 16px;
}

.intel-section-box.alert-amber {
  background: #fffbeb;
  border-color: #fde68a;
}

.intel-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-header, #0f172a);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.intel-bullet-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #334155;
}

.intel-bullet-list li {
  margin-bottom: 5px;
}

.intel-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.intel-mini-card {
  background: #ffffff;
  border: 1px solid var(--border-light, #e2e8f0);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
}

.intel-mini-card h6 {
  margin: 0 0 6px 0;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--blue-primary);
}

.intel-quote-card {
  background: #ffffff;
  border-left: 3px solid #0284c7;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  font-size: 11.5px;
  margin-top: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.intel-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light, #e2e8f0);
  background: var(--bg-subtle, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Connected Entities Pill */
.entity-linkage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--blue-soft);
  border: 1px solid #bfdbfe;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-primary);
}

/* Verified Evidence Card */
.verified-evidence-card {
  background: var(--green-soft);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 12px;
}

.verified-evidence-card h5 {
  font-size: 12px;
  font-weight: 700;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 6px;
}

.verified-evidence-card p {
  font-size: 11.5px;
  color: #047857;
  margin-top: 4px;
}

/* Quick Prompt Suggestions */
.quick-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.prompt-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.prompt-chip:hover {
  background: var(--blue-soft);
  border-color: #bfdbfe;
  color: var(--blue-primary);
}

/* Floating Bottom Search Capsule & Mic */
.floating-bottom-dock {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 50;
}

.search-capsule-wrap {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  padding: 6px 8px 6px 18px;
  transition: all 0.2s ease;
}

.search-capsule-wrap:focus-within {
  border-color: var(--blue-primary);
  box-shadow: 0 10px 25px -3px rgba(29, 78, 216, 0.15);
}

.search-input-field {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text-primary);
}

.search-input-field::placeholder {
  color: var(--text-muted);
}

/* Audio Visualizer Waves around Mic */
.mic-spectrum-container {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-right: 6px;
}

.soundwave-bar {
  width: 3px;
  height: 12px;
  background: #cbd5e1;
  border-radius: 2px;
  transition: height 0.2s ease;
}

.mic-btn-main {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mic-btn-main:hover {
  background: var(--bg-hover);
  transform: scale(1.05);
}

.mic-btn-main.recording {
  background: var(--red-critical) !important;
  color: #fff !important;
  border-color: #dc2626 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
  animation: micPulseLight 1.3s infinite ease-in-out;
}

.send-btn-main {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--navy-header);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 6px;
  flex-shrink: 0;
}

.send-btn-main:hover {
  background: #000000;
  transform: scale(1.05);
}

/* Capsule Sub-Tags */
.capsule-sub-tags {
  display: flex;
  gap: 6px;
}

.sub-tag-pill {
  padding: 3px 10px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s;
}

.sub-tag-pill:hover {
  border-color: var(--border-accent);
  color: var(--blue-primary);
}

/* Column 3: Right Telemetry & Geo-Intelligence Deck */
.right-telemetry-deck {
  width: 380px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 12px;
  overflow-y: auto;
  flex-shrink: 0;
}

.telemetry-tile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
}

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

.tile-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy-header);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tile-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: #b45309;
}

/* Map Canvas Container */
.map-canvas-tile {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  position: relative;
}

/* Radial Sentiment Gauges */
.sentiment-meters-row {
  display: flex;
  justify-content: space-around;
  margin: 10px 0;
  padding: 8px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.radial-meter-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.meter-val {
  font-size: 16px;
  font-weight: 800;
}

.meter-val.neg { color: var(--red-critical); }
.meter-val.neu { color: var(--amber-alert); }
.meter-val.pos { color: var(--green-online); }

.meter-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* D3 Graph Canvas & Hover Tooltip */
.graph-canvas-tile {
  width: 100%;
  height: 270px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  overflow: hidden;
  position: relative;
}

.network-node-tooltip {
  position: fixed;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  max-width: 320px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
  font-family: var(--font-sans);
  pointer-events: none;
  z-index: 99999;
  transition: opacity 0.12s ease;
  line-height: 1.4;
}

.network-node-tooltip .tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}

.network-node-tooltip .tooltip-author {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-header);
}

.network-node-tooltip .tooltip-handle {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.network-node-tooltip .tooltip-text {
  font-size: 11.5px;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: 6px;
  max-height: 110px;
  overflow-y: hidden;
  background: var(--bg-subtle);
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.network-node-tooltip .tooltip-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  border-top: 1px dashed var(--border-light);
  padding-top: 4px;
}

/* Slide-out Drawers (Enterprise White Theme) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  top: 58px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  position: fixed;
  top: 58px;
  right: -520px;
  width: 500px;
  height: calc(100vh - 58px);
  background: #ffffff !important;
  border-left: 1px solid var(--border-strong);
  box-shadow: -10px 0 35px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  z-index: 1200 !important;
  transition: right 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.drawer-panel.open {
  right: 0 !important;
}

.drawer-header {
  padding: 14px 18px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.drawer-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--navy-header);
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.drawer-close-btn:hover {
  background: #fee2e2;
  color: var(--red-critical);
}

/* ── History Panel Elements ─────────────────── */
.history-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin: 14px 4px 6px;
}

.history-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
}

.history-card:hover {
  background: #f8fafc;
  border-color: var(--blue-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.08);
}

.history-card.active {
  background: var(--blue-soft) !important;
  border-color: var(--blue-primary) !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.12);
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.history-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy-header);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.history-del-btn {
  background: #f1f5f9;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: all 0.15s;
}

.history-card:hover .history-del-btn {
  opacity: 1;
}

.history-del-btn:hover {
  background: #fee2e2;
  color: var(--red-critical);
}

.history-card-preview {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-light);
}

/* ── Feed Panel Elements ────────────────────── */
.feed-filter-bar {
  padding: 10px 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.feed-filter-btn {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.feed-filter-btn:hover {
  border-color: var(--blue-primary);
  color: var(--blue-primary);
}

.feed-filter-btn.active {
  background: var(--blue-primary);
  color: #ffffff;
  border-color: var(--blue-primary);
}

.feed-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.18s;
}

.feed-card:hover, .feed-card.selected {
  border-color: var(--blue-primary);
  background: #f0f9ff;
}

.feed-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.feed-source-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.feed-platform {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy-header);
}

.feed-author {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.feed-time {
  font-size: 10.5px;
  color: var(--text-muted);
}

.feed-card-text {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feed-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.feed-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.feed-badge.negative { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.feed-badge.positive { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.feed-badge.neutral { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.feed-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue-primary);
  text-decoration: none;
}

.feed-bulk-action-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--blue-soft);
  border-top: 1px solid var(--blue-primary);
  flex-shrink: 0;
}

.feed-bulk-btn {
  background: var(--blue-primary);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 11.5px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.feed-bulk-btn:hover {
  background: #026ba3;
}

/* ── Trace Panel Elements ───────────────────── */
.trace-flow-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.trace-step-node {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 4px 0;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.trace-step-node:hover {
  background: #f8fafc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.trace-connector-line {
  width: 2px;
  height: 12px;
  background: var(--border-strong);
  margin: 0 auto;
}

.trace-start-node, .trace-end-node {
  text-align: center;
  margin: 6px 0;
}

.trace-pill {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
}

.trace-inspector-drawer {
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: #ffffff;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: right 0.25s ease;
  z-index: 10;
}

.trace-inspector-drawer.open {
  right: 0;
}

.trace-section-box {
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.trace-box-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ── Network Panel Elements ─────────────────── */
.topic-bar-row {
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.topic-bar-row:hover {
  background: var(--bg-subtle);
}

.network-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
  z-index: 10;
}

.net-btn {
  width: 28px;
  height: 28px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.15s;
}

.net-btn:hover {
  background: var(--blue-primary);
  color: #ffffff;
  border-color: var(--blue-primary);
}

/* =========================================================================
   Mobile Deck Segment Switcher Tabs (Only visible on <= 992px)
   ========================================================================= */
.mobile-deck-tabs {
  display: none;
}

.mobile-menu-btn {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong, #cbd5e1);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 15px;
  cursor: pointer;
  color: var(--navy-header);
  line-height: 1;
}

/* Mobile Slide-Out Drawer Navigation */
.mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.mobile-drawer-backdrop.active {
  display: block;
  opacity: 1;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: -290px;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  height: 100dvh;
  background: #ffffff;
  z-index: 9999;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transition: left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}
.mobile-nav-drawer.open {
  left: 0;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  background: #fafafa;
}
.mobile-drawer-close {
  background: none;
  border: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}
.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  flex: 1;
}

/* =========================================================================
   Responsive Breakpoints
   ========================================================================= */

@media (max-width: 1200px) and (min-width: 993px) {
  .right-telemetry-deck {
    width: 320px;
  }
}

@media (max-width: 992px) {
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    width: 100% !important;
  }

  .header-desk-title {
    display: none !important;
  }

  /* Header clean single-row mobile layout */
  .white-header {
    height: 52px !important;
    min-height: 52px !important;
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  .white-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
  }
  .brand-crest {
    font-size: 18px !important;
  }
  .brand-title {
    font-size: 13px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    color: var(--navy-header) !important;
  }
  .brand-title span {
    display: none !important;
  }
  .brand-subtitle {
    display: none !important;
  }

  /* HIDE bloated desktop badge pills from mobile header */
  .white-header-center .radar-badge,
  .white-header-center .metric-pill,
  .white-header-center .alert-banner-pill {
    display: none !important;
  }

  /* Show district dropdown cleanly on the right of header */
  .white-header-center {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    flex: 1 !important;
    max-width: 175px !important;
  }

  .district-pill-group {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .district-select-wrapper {
    width: 100% !important;
  }

  .district-select-dropdown {
    width: 100% !important;
    padding: 5px 8px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    background: #f8fafc !important;
    text-overflow: ellipsis;
  }

  /* Hide header right buttons on mobile — they live cleanly inside the ☰ menu! */
  .white-header-right {
    display: none !important;
  }

  /* Mobile Deck Tab Bar */
  .mobile-deck-tabs {
    display: flex !important;
    height: 38px !important;
    width: 100% !important;
    max-width: 100vw !important;
    background: #ffffff !important;
    border-bottom: 1px solid var(--border-light) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 90 !important;
    box-sizing: border-box !important;
  }

  .mobile-deck-tab {
    flex: 1;
    padding: 8px 4px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    white-space: nowrap;
  }

  .mobile-deck-tab.active {
    color: var(--blue-primary);
    border-bottom-color: var(--blue-primary);
    font-weight: 800;
    background: #f0f9ff;
  }

  /* Layout container on mobile: CRITICAL reset min-width */
  .white-deck-container {
    height: calc(100vh - 90px) !important;
    height: calc(100dvh - 90px) !important;
    flex-direction: column;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
  }

  .left-rail {
    display: none !important;
  }

  /* Center Workspace: remove 460px min-width on mobile */
  .center-workspace {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Dynamic Segment Switching on Mobile */
  body:not([data-mobile-deck="telemetry"]):not([data-mobile-deck="network"]) .center-workspace {
    display: flex !important;
    width: 100% !important;
    flex: 1;
  }
  body:not([data-mobile-deck="telemetry"]):not([data-mobile-deck="network"]) .right-telemetry-deck {
    display: none !important;
  }

  body[data-mobile-deck="telemetry"] .center-workspace {
    display: none !important;
  }
  body[data-mobile-deck="telemetry"] .right-telemetry-deck {
    display: flex !important;
    width: 100% !important;
    flex: 1;
    overflow-y: auto;
    border-left: none;
  }

  body[data-mobile-deck="network"] .center-workspace {
    display: none !important;
  }
  body[data-mobile-deck="network"] .right-telemetry-deck {
    display: flex !important;
    width: 100% !important;
    flex: 1;
    overflow-y: auto;
    border-left: none;
  }
  body[data-mobile-deck="network"] #tileNetworkGraph {
    order: -1;
  }

  /* Center Workspace Adjustments */
  .center-meta-bar {
    padding: 6px 12px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }
  .center-meta-bar .meta-url {
    display: none !important; /* Hide useless url text on mobile to avoid squishing buttons */
  }
  .meta-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    justify-content: flex-end !important;
  }
  .meta-action-btn {
    padding: 5px 12px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }
  
  /* Give 125px bottom padding so messages never get hidden behind floating dock */
  .chat-scroll-area {
    padding: 10px 12px 125px !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  /* Floating Bottom Dock on Mobile */
  .floating-bottom-dock {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    bottom: max(10px, env(safe-area-inset-bottom, 10px)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .capsule-sub-tags {
    width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 2px 0 4px !important;
    display: flex !important;
    justify-content: flex-start !important;
    gap: 6px !important;
  }
  .sub-tag-pill {
    flex-shrink: 0 !important;
  }

  /* Drawer panels full screen */
  .drawer-panel {
    width: 100vw !important;
    right: -100vw !important;
  }

  /* Modals on mobile */
  .intel-modal-container {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    margin: 5vh auto !important;
    padding: 14px !important;
  }

  .bubble-user, .bubble-assistant {
    max-width: 96% !important;
    font-size: 13px !important;
  }
}
