/**
 * THE 88TH FLOOR: SMART TOWER LOCKDOWN
 * Production-Ready Responsive CSS & Cyber-Luxury Design System
 * Supports: Panoramic Desktop (1440px+), Standard Laptop (1024-1439px),
 * Tablet Landscape/Portrait (768-1023px), Smartphones (<768px), Safe Area Insets.
 */

/* ============================================================================
   1. CSS VARIABLES & DESIGN TOKENS
   ============================================================================ */
:root {
  /* Color Palette: Calibrated Ultra-Luxury Noir */
  --color-void: #040711;
  --color-bg-primary: #040711;
  --color-bg-secondary: #0D1017;
  --color-bg-panel: #0F121A;
  --color-bg-card: rgba(15, 18, 26, 0.85);
  --color-bg-glass: rgba(15, 18, 26, 0.85);

  /* Accent Restraint */
  --color-cyan: #00e5ff;
  --color-cyan-glow: rgba(0, 229, 255, 0.35);
  --color-cyan-dim: rgba(0, 229, 255, 0.08);
  --color-cyan-highlight: #7df9ff;

  --color-gold: #FFB800;
  --color-gold-champagne: #FFD074;
  --color-gold-glow: rgba(255, 184, 0, 0.3);
  --color-crimson: #FF0055;
  --color-crimson-glow: rgba(255, 0, 85, 0.35);
  --color-emerald-acid: #00ff88;
  --color-emerald-glow: rgba(0, 255, 136, 0.4);

  --color-text-main: #f8fafc;
  --color-text-dim: #94a3b8;
  --color-text-muted: #52637a;

  /* Subtle Monochrome Smoke Borders (Cure Cyan Fatigue) */
  --border-glass: 1px solid rgba(255, 255, 255, 0.07);
  --border-subtle: 1px solid rgba(255, 255, 255, 0.07);
  --border-smoke: 1px solid rgba(255, 255, 255, 0.07);
  --border-active: 1px solid rgba(0, 242, 255, 0.7);
  --border-gold: 1px solid rgba(255, 184, 0, 0.4);
  --border-crimson: 1px solid rgba(255, 0, 85, 0.5);

  /* Typography */
  --font-display: 'Orbitron', 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, monospace;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

  /* Ergonomics */
  --touch-min: 44px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Layout Dimensions */
  --header-height: 52px;
  --command-bar-height: 48px;
  --tab-nav-height: 60px;

  /* Transitions */
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================================
   2. RESET & BASE RULES
   ============================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  background-color: var(--color-bg-primary);
  color: var(--color-text-main);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(0, 229, 255, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(255, 170, 0, 0.04) 0%, transparent 40%),
    linear-gradient(180deg, #040711 0%, #020408 100%);
  background-attachment: fixed;
}

/* Custom Cyber Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(4, 7, 17, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.25);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.6);
}

/* ============================================================================
   3. APP CONTAINER & HEADER BAR
   ============================================================================ */
.lockdown-app {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}

.app-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 1.25rem;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--color-bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: var(--border-glass);
  z-index: 50;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--color-cyan);
  box-shadow: 0 0 12px var(--color-cyan-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 229, 255, 0.08);
  flex-shrink: 0;
}

.brand-icon svg {
  width: 24px;
  height: 24px;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  text-transform: uppercase;
}

.brand-title span {
  color: var(--color-cyan);
  text-shadow: 0 0 8px var(--color-cyan-glow);
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--color-gold);
  text-transform: uppercase;
}

/* Header Telemetry & Quick Action Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.telemetry-timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(4, 7, 17, 0.8);
  border: 1px solid rgba(255, 170, 0, 0.4);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-gold);
}

.telemetry-timer.warning {
  border-color: var(--color-crimson);
  color: var(--color-crimson);
  animation: pulse-border 1.5s infinite;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 0.4rem 0.85rem;
  background: rgba(0, 229, 255, 0.06);
  border: var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--color-cyan);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-btn:hover, .header-btn:focus-visible {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--color-cyan);
  box-shadow: 0 0 10px var(--color-cyan-glow);
  outline: none;
}

.header-btn:active {
  transform: scale(0.97);
}

/* ============================================================================
   ROW 2: TACTICAL COMMAND BAR (DIRECTLY BELOW ROW 1)
   ============================================================================ */
.tactical-command-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--command-bar-height);
  padding: 0 1.25rem;
  background: rgba(10, 13, 22, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  z-index: 45;
  gap: 1rem;
}

.command-bar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.command-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dark-glass-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.38rem 0.9rem;
  border-radius: var(--radius-sm, 6px);
  background: rgba(15, 20, 32, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  user-select: none;
}

.dark-glass-btn:hover {
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.5);
  color: #fff;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.3);
  transform: translateY(-1px);
}

.dark-glass-btn.dossier-btn {
  border-left: 2px solid var(--color-gold);
  color: var(--color-gold);
  background: rgba(255, 184, 0, 0.08);
}

.dark-glass-btn.dossier-btn:hover {
  background: rgba(255, 184, 0, 0.16);
  border-color: rgba(255, 184, 0, 0.6);
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 184, 0, 0.3);
}

.dark-glass-btn.funnel-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.dark-glass-btn.funnel-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.funnel-badge-counter {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-gold);
  background: rgba(255, 184, 0, 0.12);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 184, 0, 0.25);
}

.command-odometer-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(6, 11, 24, 0.9);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
}

.odometer-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--color-cyan);
  letter-spacing: 0.08em;
  font-weight: 700;
}

.command-odometer-wrap .odometer-digits {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--color-gold-champagne);
  text-shadow: 0 0 12px var(--color-gold-champagne-glow);
  letter-spacing: 0.05em;
}

.odometer-total {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--color-text-muted);
}

.command-status-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  background: rgba(255, 0, 127, 0.1);
  border: 1px solid rgba(255, 0, 127, 0.35);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
}

/* ============================================================================
   4. 2-SECTION WORKSPACE WITH FULL-HEIGHT VERTICAL TOWER FRAME (44% TOWER / 56% SUSPECTS)
   ============================================================================ */
.lockdown-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 44fr 56fr;
  gap: 14px;
  padding: 8px 1.25rem 12px 1.25rem;
  height: calc(100vh - 110px);
  min-height: 820px;
  overflow: hidden;
  position: relative;
  background: transparent;
}

.panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: rgba(15, 18, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  position: relative;
}

.panel-matrix {
  background: #08090D;
}

.panel-dossier,
.panel-suspects {
  background: rgba(15, 18, 26, 0.88);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.panel-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(10, 13, 20, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  text-transform: uppercase;
}

.panel-title svg {
  color: var(--color-cyan);
}

.panel-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-cyan-dim);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: var(--color-cyan);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ============================================================================
   5. PANEL 1: SECURITY TERMINAL & CLUES (LEFT RAIL)
   ============================================================================ */
.funnel-pipeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(4, 7, 17, 0.5);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: var(--border-glass);
}

.funnel-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.funnel-step.completed {
  border-left-color: var(--color-cyan);
  background: rgba(0, 229, 255, 0.06);
}

.funnel-step.current {
  border-left-color: var(--color-gold);
  background: rgba(255, 170, 0, 0.08);
  font-weight: bold;
}

.clue-card {
  background: var(--color-bg-card);
  border: var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: all var(--transition-smooth);
  position: relative;
}

.clue-card.active {
  border-color: var(--color-cyan);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.15);
}

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

.clue-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-gold);
  text-transform: uppercase;
}

.clue-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: #fff;
  font-weight: 700;
}

.clue-desc {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  line-height: 1.4;
}

.clue-toggle-btn {
  align-self: flex-start;
  min-height: var(--touch-min);
  padding: 0.4rem 0.9rem;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid var(--color-cyan);
  border-radius: var(--radius-sm);
  color: var(--color-cyan);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.clue-toggle-btn:hover {
  background: var(--color-cyan);
  color: var(--color-bg-primary);
}

/* ============================================================================
   6. PANEL 2: SUSPECT GRID MATRIX (CENTER PANEL)
   ============================================================================ */
.matrix-toolbar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--color-bg-secondary);
  border-bottom: var(--border-glass);
}

.search-input-wrap {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  height: 42px;
  background: rgba(4, 7, 17, 0.8);
  border: var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0 1rem 0 2.5rem;
  color: var(--color-text-main);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: border-color var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-cyan);
  box-shadow: 0 0 10px var(--color-cyan-glow);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-dim);
  pointer-events: none;
}

.filter-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.filter-chip {
  min-height: 32px;
  padding: 0.2rem 0.75rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition-fast);
}

.filter-chip.active {
  background: var(--color-cyan-dim);
  border-color: var(--color-cyan);
  color: var(--color-cyan);
}

/* Suspect Matrix Grid */
.suspect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
  align-content: start;
}

.suspect-card {
  background: var(--color-bg-card);
  border: 1px solid rgba(0, 229, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.suspect-card:hover {
  border-color: var(--color-cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.15);
}

.suspect-card.selected {
  border-color: var(--color-cyan);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 12px var(--color-cyan-glow);
}

.suspect-card.eliminated {
  opacity: 0.35;
  filter: grayscale(80%);
  border-color: rgba(255, 42, 85, 0.2);
  background: rgba(20, 10, 15, 0.4);
}

.suspect-card.eliminated:hover {
  opacity: 0.6;
}

.suspect-badge-id {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-cyan);
}

.suspect-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

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

.suspect-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.suspect-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  color: var(--color-text-dim);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================================================
   7. PANEL 3: DOSSIER & VERDICT (RIGHT RAIL)
   ============================================================================ */
.dossier-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--color-text-muted);
  gap: 1rem;
  padding: 2rem;
}

.dossier-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dossier-avatar-box {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.1) 0%, rgba(4, 7, 17, 0.9) 100%);
  border: var(--border-glass);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.dossier-avatar-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-cyan);
  box-shadow: 0 0 10px var(--color-cyan);
  animation: scan-line 3s linear infinite;
}

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

.attr-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  background: rgba(4, 7, 17, 0.6);
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.attr-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
}

.attr-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-cyan);
  font-weight: 600;
}

.btn-accuse {
  margin-top: 1rem;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(90deg, #ff2a55 0%, #ff5577 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--color-crimson-glow);
  transition: all var(--transition-fast);
}

.btn-accuse:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 42, 85, 0.6);
}

.btn-accuse:active {
  transform: scale(0.98);
}

/* ============================================================================
   8. MOBILE BOTTOM TAB NAVIGATION
   ============================================================================ */
.mobile-tab-nav {
  display: none; /* Desktop default */
  flex-shrink: 0;
  height: var(--tab-nav-height);
  background: var(--color-bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: var(--border-glass);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 50;
}

.mobile-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: var(--touch-min);
  background: none;
  border: none;
  color: var(--color-text-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.mobile-tab-btn.active {
  color: var(--color-cyan);
}

.mobile-tab-btn.active svg {
  filter: drop-shadow(0 0 6px var(--color-cyan-glow));
}

/* ============================================================================
   9. RESPONSIVE BREAKPOINTS
   ============================================================================ */

/* ----------------------------------------------------------------------------
   A. WIDESCREEN & PANORAMIC (>= 1440px)
   ---------------------------------------------------------------------------- */
@media screen and (min-width: 1440px) {
  :root {
    --panel-terminal-width: 380px;
    --panel-dossier-width: 440px;
  }

  .suspect-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
  }
}

/* ----------------------------------------------------------------------------
   B. STANDARD LAPTOP & DESKTOP (1024px to 1439px)
   ---------------------------------------------------------------------------- */
@media screen and (min-width: 1024px) and (max-width: 1439px) {
  :root {
    --panel-terminal-width: 310px;
    --panel-dossier-width: 350px;
  }

  .suspect-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* ----------------------------------------------------------------------------
   C. IPAD / TABLET LANDSCAPE (768px to 1023px, orientation: landscape)
   ---------------------------------------------------------------------------- */
@media screen and (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
  :root {
    --panel-terminal-width: 270px;
    --panel-dossier-width: 300px;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .suspect-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.65rem;
  }

  .panel-body {
    padding: 0.85rem;
  }
}

/* ----------------------------------------------------------------------------
   D. IPAD / TABLET PORTRAIT (768px to 1023px, orientation: portrait)
   ---------------------------------------------------------------------------- */
@media screen and (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
  .lockdown-workspace {
    grid-template-columns: 55fr 45fr;
  }

  /* Slide-over drawer for Dossier in tablet portrait */
  .panel-dossier {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: 380px;
    z-index: 40;
    transform: translateX(100%);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.8);
    transition: transform var(--transition-smooth);
    border-left: var(--border-glass);
  }

  .panel-dossier.drawer-open {
    transform: translateX(0);
  }

  /* Drawer Backdrop */
  .drawer-backdrop {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 4, 8, 0.7);
    backdrop-filter: blur(4px);
    z-index: 39;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
  }

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

/* ----------------------------------------------------------------------------
   E. SMARTPHONES & MOBILE COMPACT (< 768px)
   ---------------------------------------------------------------------------- */
@media screen and (max-width: 767px) {
  :root {
    --header-height: 56px;
    --touch-min: 44px;
  }

  .lockdown-app {
    height: 100dvh;
  }

  .lockdown-workspace {
    display: block;
    height: calc(100dvh - var(--header-height) - var(--tab-nav-height));
    overflow: hidden;
    position: relative;
  }

  /* Single active panel on mobile */
  .panel {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }

  .panel.mobile-active {
    display: flex;
    animation: fadeIn 0.2s ease-in-out;
  }

  .mobile-tab-nav {
    display: flex;
  }

  .app-header {
    padding: 0 0.85rem;
  }

  .brand-title {
    font-size: 0.9rem;
  }

  .brand-subtitle {
    display: none;
  }

  .telemetry-timer {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .panel-body {
    padding: 1rem 0.85rem;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
  }

  .suspect-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  /* Touch-friendly clue disclosures */
  .clue-card {
    padding: 0.85rem;
  }

  .clue-toggle-btn {
    width: 100%;
    text-align: center;
  }
}

/* ----------------------------------------------------------------------------
   F. ULTRA-COMPACT SMARTPHONES (< 380px)
   ---------------------------------------------------------------------------- */
@media screen and (max-width: 380px) {
  .header-actions .btn-label {
    display: none;
  }

  .filter-chip {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }
}

/* ============================================================================
   10. ANIMATIONS & ACCESSIBILITY PREFERENCES
   ============================================================================ */
@keyframes scan-line {
  0% { transform: translateY(0); opacity: 0.8; }
  50% { opacity: 1; }
  100% { transform: translateY(140px); opacity: 0.2; }
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(255, 42, 85, 0.4); }
  50% { border-color: rgba(255, 42, 85, 1); box-shadow: 0 0 12px var(--color-crimson-glow); }
}

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

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .dossier-avatar-box::after {
    display: none;
  }
}

/* ============================================================================
   11. TOUCH ERGONOMICS & POINTER ACCESSIBILITY (@media hover: none)
   ============================================================================ */
@media (hover: none) and (pointer: coarse) {
  /* Enforce minimum 44x44px touch target hitbox across all touchscreens */
  .header-btn,
  .dark-glass-btn,
  .hud-expand-btn,
  .airlock-close-btn,
  .drawer-close-btn,
  .mobile-tab-btn,
  .filter-chip,
  .accordion-header,
  .lightbox-btn,
  .cctv-btn-chan,
  .cctv-action-btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Prevent inadvertent page scroll during tactile drag */
  .m1-grid,
  .m1-cell,
  .m3-canvas-wrap,
  .m4-grid,
  .circuit-tile,
  .lightbox-viewport,
  .cctv-canvas {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
  }

  /* Safe area padding for bottom tabs on modern iOS devices */
  .mobile-tab-nav {
    padding-bottom: max(6px, env(safe-area-inset-bottom, 6px));
    height: calc(var(--tab-nav-height, 60px) + env(safe-area-inset-bottom, 0px));
  }

  .slide-drawer-panel {
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  }
}

/* ============================================================================
   12. ULTRA-COMPACT VIEWPORTS (< 360px - iPhone SE / Galaxy Z Flip cover)
   ============================================================================ */
@media screen and (max-width: 359px) {
  .brand-title {
    font-size: 0.8rem;
  }
  
  .header-btn,
  .dark-glass-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem;
  }

  .victim-meta-grid {
    grid-template-columns: 1fr !important;
  }

  .victim-meta-pill {
    grid-column: span 1 !important;
  }

  .autopsy-data-grid {
    grid-template-columns: 1fr !important;
  }

  .funnel-pipeline {
    padding: 8px;
  }
}
