:root{
  --z-bg0:#07080a;
  --z-bg1:#0b0e12;
  --z-blood:#b0121b;
  --z-blood2:#ff2a2a;
  --z-toxic:#56f06a;
  --z-text:rgba(255,255,255,.92);
  --z-muted:rgba(255,255,255,.62);
}

html, body {
  height: 100%;
  background:
    radial-gradient(900px circle at 10% -10%, rgba(176,18,27,0.28), transparent 55%),
    radial-gradient(900px circle at 90% 0%, rgba(255,42,42,0.12), transparent 52%),
    linear-gradient(180deg, var(--z-bg1), var(--z-bg0));
  color: var(--z-text);
}

body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  mix-blend-mode: overlay;
  background: repeating-linear-gradient(to bottom,
    rgba(255,255,255,.03),
    rgba(255,255,255,.03) 1px,
    rgba(0,0,0,0) 3px,
    rgba(0,0,0,0) 6px);
  animation: z_scan 8s linear infinite;
}

body::after{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background: radial-gradient(700px circle at 40% 30%, rgba(255,255,255,0.06), transparent 55%);
  animation: z_breath 6.5s ease-in-out infinite;
}

@keyframes z_scan {
  0% { transform: translateY(0); }
  100% { transform: translateY(6px); }
}

@keyframes z_breath {
  0%,100% { opacity: .12; }
  50% { opacity: .20; }
}

/* --- command center shell layout w/ intel rail --- */
.cc-shell-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}
@media (min-width: 1100px){
  .cc-shell-grid{
    grid-template-columns: 1fr 360px;
  }
}
.cc-shell-rail{
  display:none;
}
@media (min-width: 1100px){
  .cc-shell-rail{
    display:block;
  }
}

/* --- rail scroll fix: prevent Intel Rail / Live Ops Feed cut-off --- */
.cc-shell-rail{
  position: sticky;
  top: 86px;                 /* below top nav */
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-bottom: 18px;
}

/* nicer scrollbar (safe: browsers ignore if unsupported) */
.cc-shell-rail::-webkit-scrollbar{ width: 10px; }
.cc-shell-rail::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
}

/* --- rail width/wrap fix: prevent Intel Rail / Live Ops text cut-off --- */
@media (min-width: 1100px){
  .cc-shell-grid{
    grid-template-columns: 1fr 440px;  /* wider rail */
  }
}

/* Override any .zombie-btn nowrap/ellipsis in the rail */
.cc-shell-rail .zombie-btn{
  white-space: normal !important;
  word-break: break-word !important;
  overflow: visible !important;
  text-overflow: unset !important;
  text-align: left;
}

/* Make rail cards/buttons breathe */
.cc-shell-rail button.zombie-btn{
  line-height: 1.15;
}

/* --- clipfix rail v2: stop intel/live ops clipping --- */
.cc-shell-grid > .cc-shell-main,
.cc-shell-grid > .cc-shell-rail{
  min-width: 0;
}

.cc-shell-rail{
  position: sticky;
  top: 90px;                       /* below top nav */
  height: calc(100vh - 118px);     /* FIXED height so it can scroll */
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 18px;
  overscroll-behavior: contain;
}

.cc-shell-rail *{
  min-width: 0;
}

.cc-shell-rail .zombie-btn{
  width: 100% !important;
  max-width: 100% !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow: hidden !important;
  text-overflow: unset !important;
  text-align: left;
}

/* --- hide nested rails: prevents IntelRail/LiveOps duplication/overlap when shells are nested --- */
.cc-shell-main .cc-shell-rail{
  display: none !important;
}

/* --- rail responsive override v3: NO overlap at 100% zoom --- */
/* Default: stack rail UNDER main (prevents overlap on mid-width viewports) */
.cc-shell-grid{
  grid-template-columns: minmax(0, 1fr) !important;
}
.cc-shell-rail{
  display: block !important;
  position: relative !important;
  top: auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Wide screens only: enable SIDE rail layout */
@media (min-width: 1500px){
  .cc-shell-grid{
    grid-template-columns: minmax(0, 1fr) 420px !important;
  }
  .cc-shell-rail{
    position: sticky !important;
    top: 90px !important;
    height: calc(100vh - 118px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
}
:root {
  --bg0: #040507;
  --bg1: #070915;
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.70);
  --border: rgba(255,255,255,0.14);
  --glass: rgba(10, 12, 18, 0.58);
  --glass2: rgba(8, 10, 14, 0.36);

  --zombieGreen: rgba(120, 255, 150, 0.10);
  --toxicGreen: rgba(40, 180, 110, 0.12);
  --ember: rgba(255, 95, 35, 0.10);

  --blood: rgba(150, 10, 18, 0.55);
  --blood2: rgba(255, 30, 40, 0.16);
}

.authRoot {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 55% -10%, rgba(120,255,150,0.10), transparent 55%),
    radial-gradient(900px 700px at 20% 25%, rgba(255,95,35,0.08), transparent 60%),
    radial-gradient(1000px 900px at 85% 70%, rgba(40,180,110,0.09), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  position: relative;
}

/* Video layer */
.bgVidWrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.bgVid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;

  /* make it subtle + cinematic */
  opacity: 0.32;
  filter: grayscale(30%) contrast(110%) brightness(80%) saturate(120%);
  transform: scale(1.03);
}

/* Overlays container */
.overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* Zombie tint + fog */
.zombieTint {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 500px at 35% 30%, var(--zombieGreen), transparent 60%),
    radial-gradient(900px 650px at 80% 65%, var(--ember), transparent 62%),
    linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.75));
  mix-blend-mode: screen;
  opacity: 0.55;
}

/* Subtle fog movement (stronger, layered) */
.fog {
  position: absolute;
  inset: -38%;
  background:
    radial-gradient(circle at 18% 28%, rgba(255,255,255,0.08), transparent 58%),
    radial-gradient(circle at 72% 50%, rgba(255,255,255,0.07), transparent 62%),
    radial-gradient(circle at 48% 82%, rgba(255,255,255,0.06), transparent 66%),
    linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.45));
  filter: blur(16px);
  opacity: 0.34;
  animation: fogDrift 18s ease-in-out infinite;
}

/* two extra moving fog layers using pseudo-elements */
.fog::before,
.fog::after {
  content: "";
  position: absolute;
  inset: -22%;
  background:
    radial-gradient(circle at 35% 35%, rgba(255,255,255,0.07), transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.06), transparent 64%),
    radial-gradient(circle at 50% 90%, rgba(255,255,255,0.05), transparent 70%);
  filter: blur(18px);
  opacity: 0.26;
}

.fog::before {
  animation: fogDrift2 24s ease-in-out infinite;
  transform: translate3d(0,0,0) scale(1.06);
}

.fog::after {
  animation: fogDrift3 30s ease-in-out infinite;
  transform: translate3d(0,0,0) scale(1.10);
  opacity: 0.20;
}

@keyframes fogDrift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1.04); }
  50%  { transform: translate3d(2%, 1.5%, 0) scale(1.08); }
  100% { transform: translate3d(-2%, -1%, 0) scale(1.04); }
}

@keyframes fogDrift2 {
  0%   { transform: translate3d(2%, 1%, 0) scale(1.06); }
  50%  { transform: translate3d(-2.5%, -1.5%, 0) scale(1.10); }
  100% { transform: translate3d(2%, 1%, 0) scale(1.06); }
}

@keyframes fogDrift3 {
  0%   { transform: translate3d(-1%, 2%, 0) scale(1.10); }
  50%  { transform: translate3d(2%, -2%, 0) scale(1.14); }
  100% { transform: translate3d(-1%, 2%, 0) scale(1.10); }
}

/* Film grain + vignette */
.grain {
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(closest-side at 50% 50%, transparent 0%, rgba(0,0,0,0.68) 120%),
    repeating-radial-gradient(circle at 30% 20%,
      rgba(255,255,255,0.012) 0px,
      rgba(255,255,255,0.012) 1px,
      rgba(0,0,0,0.012) 2px,
      rgba(0,0,0,0.012) 3px);
  opacity: 0.70;
  filter: contrast(120%) brightness(105%);
  transform: rotate(6deg);
}

/* Flicker (errie) */
.flicker {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.22);
  opacity: 0.10;
  mix-blend-mode: multiply;
  animation: flicker 4.9s infinite;
}

/* More cinematic flicker spikes (brief dark dips + occasional bright snap) */
@keyframes flicker {
  0%   { opacity: .07; }
  2%   { opacity: .20; }
  3%   { opacity: .06; }
  6%   { opacity: .16; }
  7%   { opacity: .08; }
  12%  { opacity: .26; }
  13%  { opacity: .09; }
  28%  { opacity: .12; }
  29%  { opacity: .30; }
  30%  { opacity: .10; }
  44%  { opacity: .14; }
  45%  { opacity: .34; }
  46%  { opacity: .10; }
  60%  { opacity: .16; }
  61%  { opacity: .38; }
  62%  { opacity: .11; }
  76%  { opacity: .13; }
  77%  { opacity: .32; }
  78%  { opacity: .09; }
  92%  { opacity: .18; }
  93%  { opacity: .42; }
  94%  { opacity: .12; }
  100% { opacity: .09; }
}

/* Stylized blood drips at top */
.bloodDrips {
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 34vh;
  opacity: 0.55;
  filter: blur(0.2px);
  background:
    /* glossy smear */
    linear-gradient(180deg, rgba(255,30,40,0.08), transparent 55%),
    /* drips */
    radial-gradient(22px 60px at 8% 0%, var(--blood), transparent 70%),
    radial-gradient(16px 90px at 16% 0%, var(--blood), transparent 70%),
    radial-gradient(26px 120px at 26% 0%, var(--blood), transparent 72%),
    radial-gradient(14px 80px at 39% 0%, var(--blood), transparent 70%),
    radial-gradient(24px 140px at 52% 0%, var(--blood), transparent 72%),
    radial-gradient(18px 110px at 63% 0%, var(--blood), transparent 72%),
    radial-gradient(28px 150px at 74% 0%, var(--blood), transparent 72%),
    radial-gradient(14px 80px at 86% 0%, var(--blood), transparent 70%),
    radial-gradient(20px 120px at 93% 0%, var(--blood), transparent 72%);
  transform: translateY(-10px);
  animation: drip 10s ease-in-out infinite;
  mix-blend-mode: screen;
}
@keyframes drip {
  0%   { transform: translateY(-18px); opacity: 0.45; }
  50%  { transform: translateY(2px); opacity: 0.60; }
  100% { transform: translateY(-18px); opacity: 0.45; }
}

/* Foreground content */
.authShell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  position: relative;
  z-index: 2;
}

@media (max-width: 900px) {
  .authShell { grid-template-columns: 1fr; }
}

.hero {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  box-shadow:
    0 30px 80px rgba(0,0,0,0.60),
    0 0 0 1px rgba(255,255,255,0.06) inset;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.brandRow {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brandMark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background:
    radial-gradient(circle at 30% 30%, rgba(120,255,150,0.35), rgba(0,0,0,0.0) 55%),
    linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02));
  box-shadow: 0 18px 45px rgba(0,0,0,0.45);
}

.brandTitle {
  font-size: 28px;
  letter-spacing: 0.2px;
  margin: 0;
  line-height: 1.05;
}

.brandSub {
  margin: 6px 0 0 0;
  opacity: 0.80;
  line-height: 1.35;
}

.tagline {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.35;
}

.heroGrid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 520px) {
  .heroGrid { grid-template-columns: 1fr; }
}

.pill {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 12px;
  background: rgba(0,0,0,0.20);
}

.pillLabel {
  font-size: 12px;
  opacity: 0.75;
  margin: 0 0 6px 0;
}

.pillValue {
  font-weight: 800;
  margin: 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  background: linear-gradient(180deg, var(--glass), var(--glass2));
  box-shadow:
    0 30px 80px rgba(0,0,0,0.60),
    0 0 0 1px rgba(255,255,255,0.05) inset;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.cardTitle {
  margin: 0 0 6px 0;
  font-size: 16px;
  opacity: 0.95;
}

.cardText {
  margin: 0 0 14px 0;
  font-size: 13px;
  opacity: 0.75;
  line-height: 1.4;
}

.btnCol { display: grid; gap: 10px; }

.btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.2px;
  transition: transform 120ms ease, background 120ms ease, border 120ms ease, box-shadow 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.24);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.btn:active { transform: translateY(0px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.icon { width: 18px; height: 18px; display: inline-block; }

.msg {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.22);
  font-size: 13px;
  line-height: 1.35;
}

.msgError { border-color: rgba(255,80,80,0.40); }

.finePrint {
  margin-top: 12px;
  font-size: 12px;
  opacity: 0.65;
  line-height: 1.35;
}

@media (prefers-reduced-motion: reduce) {
  .fog, .flicker, .bloodDrips { animation: none !important; }
  .btn { transition: none; }
}

html, body, #root {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: #050505;
  color: #d0ffd0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

a {
  color: #7cff00;
}

a:hover {
  color: #baff66;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-thumb {
  background: #1a1a1a;
}
::-webkit-scrollbar-track {
  background: #050505;
}
:root {
  --bg-main: #0b0f0c;
  --bg-panel: #111814;
  --bg-panel-alt: #161f19;

  --border-muted: #1f2a22;

  --text-primary: #e6f2ea;
  --text-muted: #9bb3a5;

  --accent-toxic: #4cff4c;
  --accent-blood: #b11226;
  --accent-warning: #ffb020;

  --glow-toxic: 0 0 8px rgba(76, 255, 76, 0.6);
  --glow-blood: 0 0 8px rgba(177, 18, 38, 0.6);

  --radius-sm: 6px;
  --radius-md: 10px;

  --font-main: 'Inter', system-ui, sans-serif;
}
:root {
  --bg-main: transparent;
  --bg-panel: rgba(17, 24, 20, 0.92);
  --bg-panel-alt: rgba(22, 31, 25, 0.92);

  --border-muted: #1f2a22;

  --text-primary: #e6f2ea;
  --text-muted: #9bb3a5;

  --accent-toxic: #4cff4c;
  --accent-blood: #b11226;
  --accent-warning: #ffb020;

  --glow-toxic: 0 0 8px rgba(76, 255, 76, 0.6);
  --glow-blood: 0 0 8px rgba(177, 18, 38, 0.6);

  --radius-sm: 6px;
  --radius-md: 10px;

  --font-main: 'Inter', system-ui, sans-serif;
}

/* RESET */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: transparent !important;
  color: var(--text-primary);
  font-family: var(--font-main);
}

/* 🧟 ZOMBIE BACKGROUND — BULLETPROOF */
html::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('/zombie-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(4px) brightness(0.45) contrast(1.1);
  opacity: 1;
  z-index: -10;
  pointer-events: none;
}

/* PANELS FLOAT ABOVE */
.panel {
  background: rgba(17, 24, 20, 0.68);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  padding: 1rem;
}

/* --- Make panels slightly transparent so background shows --- */
.panel {
  background: rgba(17, 24, 20, 0.68) !important;
}
@keyframes scannerSweep {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes quarantinePulse {
  0% {
    box-shadow: 0 0 0 rgba(255, 176, 32, 0.0);
  }
  50% {
    box-shadow: 0 0 12px rgba(255, 176, 32, 0.8);
  }
  100% {
    box-shadow: 0 0 0 rgba(255, 176, 32, 0.0);
  }
}

@keyframes toxicSpin {
  0% {
    transform: rotate(0deg);
    box-shadow: 0 0 6px rgba(76,255,76,0.4);
  }
  100% {
    transform: rotate(360deg);
    box-shadow: 0 0 14px rgba(76,255,76,0.8);
  }
}
/* 🧟 Scanner Glow Panel */
.panel.scanner {
  position: relative;
  overflow: hidden;
}

.panel.scanner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(76,255,76,0.12) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  animation: scannerSweep 4s linear infinite;
  pointer-events: none;
}

/* ☣️ Quarantine Badge */
.quarantine-badge {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-panel-alt);
  color: var(--accent-warning);
  border: 1px solid var(--accent-warning);
  font-weight: 600;
  animation: quarantinePulse 2s infinite;
}

/* 🧪 Zombie Spinner */
.zombie-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(76,255,76,0.2);
  border-top-color: var(--accent-toxic);
  animation: toxicSpin 1.1s linear infinite;
}
@keyframes bloodDrip {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(0); }
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 90px;
  background: linear-gradient(
    to bottom,
    rgba(140, 20, 20, 0.55),
    rgba(140, 20, 20, 0.28),
    rgba(140, 20, 20, 0.12),
    transparent
  );
  animation: bloodDrip 2.2s ease-out forwards;
  pointer-events: none;
  z-index: 2147483647;
}
/* --- Dashboard Layout --- */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  background: transparent !important;
}

.dashboard-sidebar {
  width: 280px;
  padding: 16px 14px;
  background: rgba(10, 14, 12, 0.65);
  border-right: 1px solid rgba(76, 255, 76, 0.15);
  backdrop-filter: blur(8px);
}

.sidebar-title {
  margin: 0 0 14px 0;
  font-size: 24px;
  color: rgba(230, 242, 234, 0.95);
  text-shadow: 0 0 8px rgba(76, 255, 76, 0.35);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-section h4 {
  margin: 12px 0 8px 0;
  font-size: 14px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(155, 179, 165, 0.9);
}

/* Make links stacked + clickable */
.sidebar-nav a {
  display: block;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid rgba(76, 255, 76, 0.10);
  background: rgba(17, 24, 20, 0.55);
  color: rgba(230, 242, 234, 0.92);
  text-decoration: none;
  margin-bottom: 8px;
}

.sidebar-nav a:hover {
  border-color: rgba(76, 255, 76, 0.55);
  box-shadow: 0 0 10px rgba(76, 255, 76, 0.25);
}

/* NavLink active class (React Router adds "active" in v5; in v6 it uses aria-current) */
.sidebar-nav a[aria-current='page'] {
  border-color: rgba(76, 255, 76, 0.8);
  box-shadow: 0 0 14px rgba(76, 255, 76, 0.35);
}

/* Main content */
.dashboard-main {
  flex: 1;
  padding: 18px;
  background: transparent !important;
}
.dashboard-root {
  display: flex;
  min-height: 100vh;
  background: radial-gradient(circle at top, #0b0f0c, #000);
  color: #c7ffb6;
  font-family: 'Courier New', monospace;
}

.dashboard-sidebar {
  width: 220px;
  background: #050805;
  border-right: 1px solid #1e2a1e;
  padding: 20px;
}

.sidebar-title {
  margin-bottom: 20px;
  text-shadow: 0 0 8px #66ff66;
}

.dashboard-sidebar a {
  display: block;
  color: #9dff9d;
  text-decoration: none;
  margin: 10px 0;
}

.dashboard-sidebar a:hover {
  color: #ffffff;
  text-shadow: 0 0 6px #66ff66;
}

.dashboard-main {
  flex: 1;
  padding: 30px;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* redeploy 2026-02-10 01:09:21Z */
.dashboard-shell {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.dashboard-sidebar {
  width: 260px;
  min-width: 260px;
  background: linear-gradient(to bottom, #220000, #000);
  padding: 16px;
  box-sizing: border-box;
}

.dashboard-main {
  flex: 1;
  position: relative;
  overflow: auto;
  padding: 24px;
}
.hq-map-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(rgba(0,255,0,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,0,.08) 1px, transparent 1px);
  background-size: 40px 40px;
  box-shadow: inset 0 0 40px rgba(0,255,0,.15);
}

.hq-slot {
  position: absolute;
  width: 36px;
  height: 36px;
  background: rgba(120,255,120,.15);
  border: 1px solid rgba(120,255,120,.6);
  box-shadow: 0 0 12px rgba(120,255,120,.7);
  font-size: 10px;
  text-align: center;
  cursor: pointer;
}

.hq-slot:hover {
  box-shadow: 0 0 20px red;
  transform: scale(1.05);
}

/* === ZOMBIE POLISH === */
.dashboard-shell {
  display: flex;
  height: 100vh;
}

.dashboard-main {
  flex: 1;
  padding: 24px;
  overflow: auto;
}

.zombie-glow {
  text-shadow: 0 0 8px crimson;
}

.zombie-blood-drip {
  position: absolute;
  top: 0;
  width: 100%;
  height: 18px;
  background: linear-gradient(to bottom, darkred, transparent);
}
/* ===================== */
.hq-slot {
  border: 1px solid rgba(0,255,0,0.4);
  box-shadow: 0 0 12px rgba(0,255,0,0.25);
}

.hq-slot:hover {
  box-shadow: 0 0 18px rgba(0,255,0,0.6);
}

/* ===== HQ MAP VISUAL SAFE OVERRIDE ===== */

.dashboard-main div[style*="gridTemplateColumns"] {
  gap: 14px !important;
  padding: 30px !important;
}

.dashboard-main div[style*="border: 2px solid rgba(0,255,0"] {
  width: 120px !important;
  height: 120px !important;
  padding: 14px !important;
  font-size: 11px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: center !important;
  text-align: center !important;
  overflow: hidden !important;
  word-break: break-word !important;
}

.dashboard-main div[style*="fontWeight: 700"] {
  font-size: 12px !important;
  line-height: 14px !important;
  max-height: 60px !important;
  overflow: hidden !important;
}

.dashboard-main div[style*="opacity: 0.8"] {
  font-size: 11px !important;
}

/* COMMAND CENTER THEME — Bloody Emergency Broadcast (scoped)
   Wrap page root with: className="cc-theme"
*/
.cc-theme{
  min-height:100vh;
  max-width:1280px;
  margin:0 auto;
  padding:18px;
  color:rgba(240,238,232,.92);
  background:
    radial-gradient(1200px 520px at 15% 0%, rgba(90,10,20,.18), transparent 60%),
    radial-gradient(900px 420px at 85% 10%, rgba(35,30,25,.20), transparent 62%),
    linear-gradient(rgba(6,7,8,.90), rgba(6,7,8,.90));
  position:relative;
}
.cc-theme::before{
  content:"";
  position:fixed; inset:0;
  pointer-events:none;
  background:
    radial-gradient(1200px 900px at 50% 30%, transparent 60%, rgba(0,0,0,.60)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.015) 0 1px, transparent 1px 6px);
  mix-blend-mode:overlay;
  opacity:.35;
}
.cc-header{
  position:sticky; top:0; z-index:30;
  border-radius:14px;
  border:1px solid rgba(120,20,30,.55);
  box-shadow:0 18px 40px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.05);
  background:linear-gradient(180deg, rgba(28,10,12,.95), rgba(12,12,12,.92));
  backdrop-filter:blur(6px);
  overflow:hidden;
}
.cc-header::after{
  content:"";
  position:absolute; left:0; right:0; bottom:0;
  height:3px;
  background:linear-gradient(90deg, transparent, rgba(176,21,38,.85), rgba(107,15,26,.90), transparent);
  opacity:.85;
}
.cc-header-inner{
  display:flex; gap:14px; flex-wrap:wrap;
  align-items:center; justify-content:space-between;
  padding:14px 14px 12px 14px;
}
.cc-badge{display:inline-flex; align-items:baseline; gap:10px; flex-wrap:wrap;}
.cc-state{font-weight:950; letter-spacing:.10em; font-size:12px; opacity:.85;}
.cc-title{font-weight:950; font-size:18px;}
.cc-sub{opacity:.75; font-size:12px; letter-spacing:.03em; margin-top:4px;}
.cc-led{
  width:10px; height:10px; border-radius:999px;
  background:rgba(120,255,120,.90);
  box-shadow:0 0 10px rgba(120,255,120,.45);
  animation:ccPulse 1.8s ease-in-out infinite;
  display:inline-block;
}
@keyframes ccPulse{0%,100%{opacity:.55; transform:scale(.92)} 50%{opacity:1; transform:scale(1.06)}}
.cc-threat{
  display:inline-flex; gap:8px; align-items:center;
  padding:6px 10px; border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.25);
  font-size:12px; font-weight:850;
}
.cc-dot{width:8px; height:8px; border-radius:999px; display:inline-block;}
.cc-threat[data-level="watch"] .cc-dot{background:rgba(210,150,40,.95); box-shadow:0 0 10px rgba(210,150,40,.35);}
.cc-threat[data-level="critical"] .cc-dot{background:rgba(176,21,38,.95); box-shadow:0 0 12px rgba(176,21,38,.45);}
.cc-threat[data-level="clear"] .cc-dot{background:rgba(90,210,120,.95); box-shadow:0 0 10px rgba(90,210,120,.35);}
.cc-actions{display:flex; gap:10px; flex-wrap:wrap; align-items:center;}

.cc-strip{
  margin-top:12px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(0,0,0,.35);
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
  gap:10px;
}
.cc-strip-item{
  padding:10px 10px; border-radius:12px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(10,10,10,.55);
}
.cc-strip-label{opacity:.70; font-size:11px; letter-spacing:.10em; font-weight:900;}
.cc-strip-value{margin-top:6px; font-weight:950; font-size:16px;}
.cc-stamp{
  display:inline-block; margin-left:8px;
  padding:3px 8px; font-size:11px; font-weight:950; letter-spacing:.12em;
  border-radius:999px;
  border:1px dashed rgba(176,21,38,.65);
  color:rgba(255,210,210,.95);
  background:rgba(60,10,15,.35);
}

/* Make existing zombie cards look like console bays inside cc-theme */
.cc-theme .zombie-card{
  border-radius:14px;
  border:1px solid rgba(120,20,30,.45);
  background:linear-gradient(180deg, rgba(18,18,18,.92), rgba(10,10,10,.92));
  box-shadow:0 18px 40px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.04);
  position:relative;
}
.cc-theme .zombie-card::before,.cc-theme .zombie-card::after{
  content:""; position:absolute; width:12px; height:12px;
  border-top:2px solid rgba(176,21,38,.55);
  border-left:2px solid rgba(176,21,38,.55);
  opacity:.85;
}
.cc-theme .zombie-card::before{top:10px; left:10px;}
.cc-theme .zombie-card::after{bottom:10px; right:10px; transform:rotate(180deg);}
.cc-theme .zombie-btn{
  background:linear-gradient(180deg, rgba(35,12,14,.90), rgba(12,12,12,.92));
  border:1px solid rgba(176,21,38,.65);
  color:rgba(245,235,235,.95);
  border-radius:10px;
}
.cc-theme .zombie-btn:hover{box-shadow:0 0 18px rgba(176,21,38,.22); transform:translateY(-1px);}
.cc-theme .zombie-input{
  background:rgba(0,0,0,.45);
  border:1px solid rgba(255,255,255,.12);
  color:rgba(240,238,232,.92);
  border-radius:10px;
}

/* --- Metrics row --- */
.cc-metrics{
  margin-top: 12px;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.cc-tile{
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(18,18,18,0.92), rgba(10,10,10,0.92));
  box-shadow:
    0 18px 40px rgba(0,0,0,0.50),
    inset 0 0 0 1px rgba(255,255,255,0.04);
  position: relative;
  overflow:hidden;
}
.cc-tile::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height:3px;
  background: linear-gradient(90deg, transparent, rgba(176,21,38,0.75), transparent);
  opacity: 0.65;
}
.cc-tile-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.cc-tile-label{
  opacity: 0.75;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
}
.cc-tile-value{
  margin-top: 8px;
  font-size: 28px;
  font-weight: 950;
  letter-spacing: 0.02em;
}
.cc-tile-sub{
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.70;
}

/* Tone */
.cc-tile[data-tone="critical"]{ border-color: rgba(176,21,38,0.55); }
.cc-tile[data-tone="watch"]{ border-color: rgba(210,150,40,0.45); }
.cc-tile[data-tone="clear"]{ border-color: rgba(90,210,120,0.35); }

/* --- 2-column command grid --- */
.cc-grid2{
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 12px;
}
@media (max-width: 980px){
  .cc-grid2{ grid-template-columns: 1fr; }
}
.cc-rail{
  display: grid;
  gap: 12px;
}

/* --- Achievements Control Strip --- */
.cc-controlbar{
  margin-top: 12px;
  position: sticky;
  top: 92px;           /* sits under sticky broadcast header */
  z-index: 25;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.45);
}
@media (max-width: 720px){
  .cc-controlbar{ top: 110px; }
}
.cc-control-row{
  padding: 12px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  align-items: end;
}
.cc-control-label{
  opacity: 0.72;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.cc-control-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
}
.cc-mini-note{
  opacity: 0.70;
  font-size: 12px;
  margin-top: 8px;
}





/* COMMAND CENTER LAYOUT — Shell + Sidebar (Phase 3) */
.cc-shell{
  display:flex;
  gap:14px;
  align-items:flex-start;
  min-height:calc(100vh - 180px);
}
.cc-side{
  width:280px;
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,0.08);
  background:linear-gradient(rgba(10,10,10,.72), rgba(10,10,10,.52));
  box-shadow:0 0 0 1px rgba(140,30,35,.08), 0 16px 60px rgba(0,0,0,.45);
  position:sticky;
  top:12px;
}
.cc-step-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:12px;
}
.cc-step-link{
  display:block;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(0,0,0,0.25);
  color:rgba(240,238,232,.92);
  text-decoration:none;
}
.cc-step-link:hover{
  border-color:rgba(140,30,35,.45);
  box-shadow:0 0 0 1px rgba(140,30,35,.25), 0 0 22px rgba(140,30,35,.18);
}
.cc-step-active{
  border-color:rgba(255,70,70,.55);
  box-shadow:0 0 0 1px rgba(255,70,70,.28), 0 0 26px rgba(255,70,70,.20);
  background:linear-gradient(rgba(120,10,20,.22), rgba(0,0,0,.18));
}
.cc-main{
  flex:1;
  min-width:0;
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,0.08);
  background:linear-gradient(rgba(8,8,9,.58), rgba(8,8,9,.40));
  box-shadow:0 0 0 1px rgba(140,30,35,.06), 0 18px 70px rgba(0,0,0,.50);
}
@media (max-width: 980px){
  .cc-shell{ flex-direction:column; }
  .cc-side{ width:100%; position:relative; top:auto; }
}
.hq-map-canvas {
  position: relative;
  width: 100%;
  height: 800px;
  border: 1px solid rgba(0,255,0,0.3);
  margin-top: 20px;
}

.hq-slot {
  position: absolute;
  min-width: 120px;
  padding: 8px;
  background: rgba(0,0,0,0.85);
  border: 1px solid #00ff66;
  border-radius: 6px;
  color: #ccffdd;
  font-size: 12px;
}
:root {
  /* Helps with safe areas on iPhone notch devices */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

/* Global sanity */
*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; }
body { overflow-x: hidden; }

/* Media should never overflow */
img, video, canvas, svg { max-width: 100%; height: auto; }

/* Default touch targets */
button, a, input, select, textarea {
  touch-action: manipulation;
}

/* Make sure input font-size prevents iOS zoom */
input, select, textarea { font-size: 16px; }

/* Common utility: safe padding container (optional use later) */
.sad-safe-pad {
  padding-left: calc(12px + var(--safe-left));
  padding-right: calc(12px + var(--safe-right));
  padding-top: calc(12px + var(--safe-top));
  padding-bottom: calc(12px + var(--safe-bottom));
}

/* --- Mobile tweaks (additive, desktop unaffected) --- */
@media (max-width: 860px) {
  /* Slightly smaller default paddings */
  body { font-size: 15px; }

  /* Buttons & inputs: bigger tap targets */
  button, input, select, textarea {
    min-height: 44px;
  }

  /* Prevent cramped card layouts */
  .zombie-card {
    width: 100% !important;
  }

  /* Any grids that are true CSS grids should stack */
  .sad-grid-2, .sad-grid-3, .sad-grid-4 {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Horizontal scrolling helper for wide content (tables/lists) */
  .sad-scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 520px) {
  /* Even tighter spacing for small phones */
  .zombie-card {
    padding: 12px !important;
  }
}

/* =========================================================
   Phase 2: Mobile Sidebar Drawer (Alliance dashboards)
   Requires DashboardLayout sidebar/main to have:
   - data-sad-sidebar="1"
   - data-sad-main="1"
   And html class toggle: "sad-nav-open"
   ========================================================= */

.sad-mobile-nav-toggle {
  display: none; /* desktop hidden */
}

.sad-mobile-scrim {
  display: none; /* desktop hidden */
}

@media (max-width: 860px) {
  /* Hamburger button */
  .sad-mobile-nav-toggle {
    display: flex;
    position: fixed;
    top: calc(12px + var(--safe-top));
    left: calc(12px + var(--safe-left));
    z-index: 2147483647;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.55);
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    backdrop-filter: blur(8px);
  }

  /* Scrim overlay */
  .sad-mobile-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background: rgba(0,0,0,0.55);
  }

  /* Sidebar becomes a drawer */
  [data-sad-sidebar="1"] {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(320px, 86vw) !important;
    transform: translateX(-110%);
    transition: transform 180ms ease;
    z-index: 2147483647;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: calc(12px + var(--safe-top));
    padding-bottom: calc(12px + var(--safe-bottom));
  }

  /* Main content should not be pushed by sidebar */
  [data-sad-main="1"] {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* Open drawer when html has class */
  html.sad-nav-open [data-sad-sidebar="1"] {
    transform: translateX(0);
  }
}

/* =========================================================
   Phase 3: Mobile UX Utilities (SAFE, additive)
   Use these classes in pages/components without refactors.
   ========================================================= */

/* Generic flex helpers */
.sad-row { display: flex; gap: 12px; align-items: center; }
.sad-col { display: flex; flex-direction: column; gap: 10px; }
.sad-wrap { flex-wrap: wrap; }
.sad-grow { flex: 1; min-width: 0; }

/* Card grids (opt-in) */
.sad-card-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sad-card-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* Scroll containers (opt-in) */
.sad-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.sad-scroll-y {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Better text wrapping for long content */
.sad-break {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Form spacing (opt-in) */
.sad-form {
  display: grid;
  gap: 10px;
}
.sad-form input,
.sad-form select,
.sad-form textarea {
  width: 100%;
}

/* Button row (opt-in) */
.sad-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Mobile-only visibility helpers (opt-in) */
.sad-hide-mobile { display: inherit; }
.sad-show-mobile { display: none; }

@media (max-width: 860px) {
  /* Stack common horizontal rows */
  .sad-row { flex-direction: column; align-items: stretch; }

  /* Make multi-column grids stack */
  .sad-card-grid-2, .sad-card-grid-3 { grid-template-columns: 1fr; }

  /* Mobile visibility helpers */
  .sad-hide-mobile { display: none !important; }
  .sad-show-mobile { display: block !important; }

  /* Bigger/touch-friendly controls (opt-in works globally too) */
  .sad-actions > button { min-height: 44px; }
}

/* Extra-small phones */
@media (max-width: 520px) {
  .sad-actions { gap: 6px; }
}

/* =========================================================
   Phase X: Compact Topbar (mobile)
   Goal: top command bar stays 1-line and scrolls horizontally
   ========================================================= */
@media (max-width: 860px) {
  .sad-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  /* Keep children from wrapping and shrinking weirdly */
  .sad-topbar > * {
    flex: 0 0 auto;
  }

  /* Compact controls, still tappable */
  .sad-topbar button,
  .sad-topbar select,
  .sad-topbar a,
  .sad-topbar input {
    min-height: 36px !important;
    height: 36px !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
  }

  /* If the bar uses big headings/labels, keep them small */
  .sad-topbar h1, .sad-topbar h2, .sad-topbar h3 {
    font-size: 14px !important;
    margin: 0 !important;
  }
}

/* =========================================================
   Phase X2: Force Compact Topbar + Visible Hamburger (mobile)
   - data-sad-topbar="1" -> forces 1-line scrollable topbar
   - sad-mobile-nav-toggle -> bottom-left so it can't get covered
   ========================================================= */
@media (max-width: 860px) {
  /* Put hamburger bottom-left above language switcher area */
  .sad-mobile-nav-toggle {
    display: flex !important;
    position: fixed !important;
    top: auto !important;
    bottom: calc(12px + var(--safe-bottom) + 56px) !important;
    left: calc(12px + var(--safe-left)) !important;
    z-index: 2147483647 !important;
    width: 44px !important;
    height: 44px !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255,255,255,0.22) !important;
    background: rgba(0,0,0,0.60) !important;
    font-size: 18px !important;
  }

  .sad-mobile-scrim {
    z-index: 2147483646 !important;
  }

  /* FORCE the topbar to a single compact scrolling row */
  [data-sad-topbar="1"] {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 6px !important;
    max-height: 56px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  [data-sad-topbar="1"] * {
    flex-wrap: nowrap !important;
  }
  [data-sad-topbar="1"] > * {
    flex: 0 0 auto !important;
  }

  /* Make controls smaller (still tappable enough) */
  [data-sad-topbar="1"] button,
  [data-sad-topbar="1"] select,
  [data-sad-topbar="1"] a,
  [data-sad-topbar="1"] input {
    min-height: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
    padding: 4px 8px !important;
  }

  /* Hide big labels if they exist (keeps controls visible) */
  [data-sad-topbar="1"] .sad-topbar-label {
    display: none !important;
  }
}

/* =========================================================
   Phase X3: Collapsible Topbar + Hamburger (mobile)
   - Topbar container must have data-sad-topbar="1"
   - Default collapsed to 56px; expands when html has class sad-topbar-open
   - Hamburger stays fixed top-left
   ========================================================= */
@media (max-width: 860px) {
  /* Hamburger fixed top-left */
  .sad-mobile-nav-toggle {
    display: flex !important;
    position: fixed !important;
    top: calc(12px + var(--safe-top)) !important;
    left: calc(12px + var(--safe-left)) !important;
    z-index: 2147483647 !important;
    width: 44px !important;
    height: 44px !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255,255,255,0.22) !important;
    background: rgba(0,0,0,0.60) !important;
    font-size: 18px !important;
  }

  /* Topbar "controls" toggle fixed top-right */
  .sad-mobile-topbar-toggle {
    display: flex !important;
    position: fixed !important;
    top: calc(12px + var(--safe-top)) !important;
    right: calc(12px + var(--safe-right)) !important;
    z-index: 2147483647 !important;
    width: 44px !important;
    height: 44px !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255,255,255,0.22) !important;
    background: rgba(0,0,0,0.60) !important;
    font-size: 18px !important;
  }

  .sad-mobile-topbar-scrim {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background: rgba(0,0,0,0.45);
  }

  /* Collapse topbar by default */
  [data-sad-topbar="1"] {
    max-height: 56px !important;
    overflow: hidden !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 2147483000 !important;
  }

  /* Expand when toggle is open */
  html.sad-topbar-open [data-sad-topbar="1"] {
    max-height: 70vh !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Compact topbar controls (still usable) */
  [data-sad-topbar="1"] button,
  [data-sad-topbar="1"] select,
  [data-sad-topbar="1"] a,
  [data-sad-topbar="1"] input {
    min-height: 32px !important;
    height: 32px !important;
    font-size: 12px !important;
    padding: 4px 8px !important;
  }
}

/* =========================================================
   Phase X4: Runtime-tagged Collapsible Topbar (mobile)
   The JS toggle tags the real topbar container with:
   - class .sad-topbar-root
   - attribute [data-sad-topbar="1"]
   ========================================================= */
@media (max-width: 860px) {
  /* Controls toggle button */
  .sad-mobile-topbar-toggle {
    display: flex !important;
    position: fixed !important;
    top: calc(12px + var(--safe-top)) !important;
    right: calc(12px + var(--safe-right)) !important;
    z-index: 2147483647 !important;
    width: 44px !important;
    height: 44px !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255,255,255,0.22) !important;
    background: rgba(0,0,0,0.60) !important;
    font-size: 18px !important;
  }

  .sad-mobile-topbar-scrim {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background: rgba(0,0,0,0.45);
  }

  /* COLLAPSE the actual topbar container */
  .sad-topbar-root,
  [data-sad-topbar="1"] {
    max-height: 56px !important;
    overflow: hidden !important;
  }

  /* EXPAND when user taps ⚙︎ */
  html.sad-topbar-open .sad-topbar-root,
  html.sad-topbar-open [data-sad-topbar="1"] {
    max-height: 70vh !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Shrink controls inside topbar */
  .sad-topbar-root button,
  .sad-topbar-root select,
  .sad-topbar-root a,
  .sad-topbar-root input,
  [data-sad-topbar="1"] button,
  [data-sad-topbar="1"] select,
  [data-sad-topbar="1"] a,
  [data-sad-topbar="1"] input {
    min-height: 30px !important;
    height: 30px !important;
    font-size: 12px !important;
    padding: 4px 8px !important;
  }
}
/* Zombie Ambience (CSS-only): animated grit + blood + subtle flicker */
/* Safe overlay: pointer-events none, low opacity, respects reduced motion */

:root{
  --z-ink: rgba(0,0,0,0.85);
  --z-red: rgba(176,18,27,0.85);
  --z-red2: rgba(210,20,33,0.55);
  --z-grit: rgba(255,255,255,0.06);
  --z-grit2: rgba(0,0,0,0.22);
  --z-flicker: 0.06;
}

/* Make sure main app can sit above overlays */
#root{
  position: relative;
  z-index: 1;
}

body{
  background-color: #06060a;
}

/* Grit + scanline + vignette */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  /* layered grit using gradients (no external assets) */
  background-image:
    radial-gradient(1200px 900px at 20% 10%, rgba(176,18,27,0.08), transparent 60%),
    radial-gradient(900px 700px at 80% 30%, rgba(210,20,33,0.05), transparent 55%),
    radial-gradient(1200px 900px at 50% 80%, rgba(0,0,0,0.45), transparent 60%),
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.02) 0px,
      rgba(255,255,255,0.02) 1px,
      rgba(0,0,0,0.02) 2px,
      rgba(0,0,0,0.02) 4px
    ),
    radial-gradient(900px 650px at 50% 50%, transparent 55%, rgba(0,0,0,0.55) 100%);

  mix-blend-mode: screen;
  opacity: 0.85;
  animation: z-grit-shift 12s linear infinite;
}

/* Blood mist + drip band (subtle) */
body::after{
  content:"";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background-image:
    radial-gradient(1000px 600px at 50% 0%, rgba(176,18,27,0.25), transparent 70%),
    radial-gradient(900px 500px at 10% 0%, rgba(210,20,33,0.18), transparent 72%),
    radial-gradient(900px 500px at 90% 0%, rgba(210,20,33,0.14), transparent 72%),
    linear-gradient(to bottom, rgba(176,18,27,0.20), rgba(176,18,27,0.00) 22%);

  opacity: 0.55;
  filter: blur(0.6px);
  animation: z-blood-pulse 9s ease-in-out infinite;
}

/* Subtle flicker hook (used by command-center screens if desired) */
.z-flicker{
  animation: z-flicker 4.6s infinite;
}

@keyframes z-grit-shift{
  0%   { transform: translate3d(0,0,0); filter: contrast(1.02) brightness(1.00); }
  25%  { transform: translate3d(-0.6px,0.4px,0); filter: contrast(1.05) brightness(1.01); }
  50%  { transform: translate3d(0.8px,-0.5px,0); filter: contrast(1.03) brightness(0.99); }
  75%  { transform: translate3d(-0.4px,-0.6px,0); filter: contrast(1.06) brightness(1.02); }
  100% { transform: translate3d(0,0,0); filter: contrast(1.02) brightness(1.00); }
}

@keyframes z-blood-pulse{
  0%,100% { opacity: 0.48; }
  50%     { opacity: 0.62; }
}

@keyframes z-flicker{
  0%, 100% { opacity: 1; }
  45%      { opacity: 1; }
  46%      { opacity: calc(1 - var(--z-flicker)); }
  48%      { opacity: 1; }
  85%      { opacity: 1; }
  86%      { opacity: calc(1 - var(--z-flicker)); }
  88%      { opacity: 1; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  body::before, body::after, .z-flicker{ animation: none !important; }
}
