:root {
  /* ── BRAND TOKENS FROM OFFICIAL KIT ── */
  /* Backgrounds */
  --abyss: #030C18;
  --navy: #071428;
  --navy-mid: #0A1E3A;
  --navy-soft: #122540;
  --steel: #1E3352;
  
  /* Primary Hero Accent */
  --neon: #39FF14;
  --neon-glow: rgba(57, 255, 20, 0.25);
  
  /* Secondary UI Accent */
  --cyan: #00D4FF;
  --cyan-hi: #00F0FF;
  --cyan-dim: #0095CC;
  --cyan-glow: rgba(0, 212, 255, 0.15);
  --cyan-faint: rgba(0, 212, 255, 0.06);
  
  /* Red / Danger */
  --red: #FF2D4A;
  --red-soft: rgba(255, 45, 74, 0.12);
  
  /* Green / Success */
  --green: #00E596;
  --green-soft: rgba(0, 229, 150, 0.1);
  
  /* Neutral Tones */
  --warm-white: #F4F1EB;
  --warm-mid: #9de88a;
  --warm-dim: #96b7df;
  --amber: #FFB800;
  
  /* ── LEGACY ALIASES (For backward compatibility) ── */
  --bg: var(--abyss);
  --panel: rgba(7, 20, 40, 0.65);
  --panel-soft: rgba(7, 30, 56, 0.7);
  --text: var(--warm-white);
  --muted: var(--warm-dim);
  --accent: var(--neon);
  --accent-strong: var(--cyan);
  --good: var(--green);
  --warn: var(--cyan);
  --degraded: var(--red);
  --risk: var(--red);
  --critical: var(--red);
  --border: var(--cyan-glow);
  --shadow: 0 20px 62px rgba(0, 0, 0, 0.45);
  --bg-gradient-a: rgba(57, 255, 20, 0.08);
  --bg-gradient-b: rgba(0, 212, 255, 0.08);
  --bg-base-top: var(--abyss);
  --bg-base-bottom: var(--navy-mid);
}

body[data-theme='day'] {
  --bg: #f8fafc;
  --panel: rgba(255, 255, 255, 0.95);
  --panel-soft: rgba(248, 251, 255, 0.92);
  --text: #1a2332;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-strong: #0891b2;
  --good: #16a34a;
  --warn: #b8860b;
  --degraded: #ea580c;
  --risk: #dc2626;
  --critical: #be123c;
  --border: rgba(203, 213, 225, 0.5);
  --shadow: 0 10px 25px rgba(26, 43, 66, 0.08);
  --bg-gradient-a: rgba(37, 99, 235, 0.08);
  --bg-gradient-b: rgba(8, 145, 178, 0.06);
  --bg-base-top: #f8fafc;
  --bg-base-bottom: #f1f5f9;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top right, var(--bg-gradient-a), transparent 22%),
    radial-gradient(circle at bottom left, var(--bg-gradient-b), transparent 18%),
    linear-gradient(180deg, var(--bg-base-top) 0%, var(--bg-base-bottom) 100%);
  color: var(--text);
  font-family: "DM Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-text-size='normal'] {
  font-size: 16px;
}

body[data-text-size='large'] {
  font-size: 18px;
}

body[data-text-size='xlarge'] {
  font-size: 19px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--accent);
  color: #07101f;
  font-weight: 600;
  z-index: 1000;
}

.skip-link:focus {
  left: 8px;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

/* ── Topbar right cluster ── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-control {
  display: grid;
  gap: 4px;
}

/* ── Mode Switcher ── */
.mode-switcher {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
}

.mode-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s ease;
  background: transparent;
  color: var(--muted);
}

.mode-btn-live.active {
  background: linear-gradient(135deg, var(--accent-strong) 0%, #0078b8 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.mode-btn-demo.active {
  background: linear-gradient(135deg, var(--accent) 0%, #1f7f3e 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.mode-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0);
  color: var(--text);
}

.mode-experience-banner {
  margin: 0 28px 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.mode-experience-banner.demo {
  color: #0b7f4f;
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.25);
}

.mode-experience-banner.live {
  color: #0b5f8e;
  background: rgba(8, 145, 178, 0.1);
  border-color: rgba(8, 145, 178, 0.3);
}

.plain-language-shell {
  margin: 0 0 12px;
}

.plain-language-card {
  border-left: 4px solid var(--accent-strong);
}

.plain-toggle-control {
  min-width: 180px;
}

#plainNow {
  font-size: 0.96rem;
  line-height: 1.55;
}

#plainViewSummary,
#plainMetricSummary {
  font-size: 0.92rem;
  line-height: 1.5;
}

.plain-glossary h4 {
  margin: 0 0 8px;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.06em;
}

body[data-theme='day'] .plain-language-card {
  border-left-color: #0891b2;
}

body[data-app-mode='live'] #demoVoiceControls,
body[data-app-mode='live'] #demoPresetControl,
body[data-app-mode='live'] #runDemoBtn,
body[data-app-mode='live'] #demoProgressBanner {
  display: none !important;
}

body[data-app-mode='demo'] #refreshLiveBtn {
  opacity: 0.65;
}

.toolbar-control label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toolbar-control select {
  background: color-mix(in srgb, var(--panel-soft) 82%, transparent);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 140px;
}

/* ── Run Demo call-to-action button ── */
.btn.demo-cta {
  background: linear-gradient(135deg, var(--neon) 0%, var(--cyan) 100%);
  color: #03111f;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 8px 18px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  box-shadow: 0 0 22px rgba(57, 255, 20, 0.32), 0 0 36px rgba(0, 212, 255, 0.18);
  transition: opacity 0.2s, box-shadow 0.2s;
}
.btn.demo-cta:hover {
  opacity: 0.94;
  box-shadow: 0 0 32px rgba(57, 255, 20, 0.45), 0 0 46px rgba(0, 212, 255, 0.22);
}
.btn.demo-cta:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Autoplay demo progress banner ── */
.demo-banner {
  margin: 0 28px 0;
  padding: 10px 20px;
  background: linear-gradient(90deg, rgba(57, 255, 20, 0.08), rgba(0, 212, 255, 0.08));
  border: 1px solid rgba(49, 228, 18, 0.28);
  border-radius: 8px;
  font-size: 0.87rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: bannerPulse 2s ease-in-out infinite;
}
.demo-step-label {
  background: linear-gradient(135deg, var(--neon), var(--cyan));
  color: #07101f;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
@keyframes bannerPulse {
  0%, 100% { border-color: rgba(57, 255, 20, 0.28); }
  50% { border-color: rgba(0, 212, 255, 0.52); }
}

.sidebar {
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  backdrop-filter: blur(20px) saturate(1.15);
  padding: 24px 18px;
}

.brand {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(133, 169, 212, 0.28);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(14, 27, 46, 0.42));
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: 
    0 20px 48px rgba(8, 18, 33, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 48px rgba(57, 255, 20, 0.08),
    0 0 72px rgba(0, 212, 255, 0.06);
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
}

.brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 15% 20%, rgba(57, 255, 20, 0.12), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(0, 212, 255, 0.08), transparent 28%);
  pointer-events: none;
  border-radius: 20px;
}

.brand-mark {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 20%, rgba(130, 236, 255, 0.52), rgba(9, 22, 39, 0.88));
  border: 1.5px solid rgba(104, 227, 255, 0.62);
  box-shadow: 
    0 0 48px rgba(71, 214, 255, 0.32),
    inset 0 0 32px rgba(151, 244, 255, 0.22),
    inset 0 -12px 24px rgba(6, 13, 22, 0.4),
    0 0 64px rgba(57, 255, 20, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  transform: translateZ(16px) rotateX(6deg) rotateY(-6deg);
  flex-shrink: 0;
  z-index: 2;
}

/* Protective shield layers */
.shield-outer {
  position: absolute;
  inset: -8px;
  border-radius: 20px;
  border: 1.5px solid rgba(57, 255, 20, 0.35);
  background: radial-gradient(circle at 30% 20%, rgba(57, 255, 20, 0.08), transparent);
  animation: shieldPulse 3.2s ease-in-out infinite;
  box-shadow: 0 0 28px rgba(57, 255, 20, 0.15);
  z-index: 0;
}

.shield-inner {
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  border: 1px solid rgba(0, 212, 255, 0.45);
  background: none;
  animation: shieldRotate 4.8s linear infinite;
  z-index: 1;
  box-shadow: inset 0 0 20px rgba(0, 212, 255, 0.1);
}

/* Detection scanning effect - represents early detection */
.detection-scan {
  position: absolute;
  inset: -12px;
  border-radius: 20px;
  background: conic-gradient(
    from 0deg,
    rgba(57, 255, 20, 0.4),
    rgba(0, 212, 255, 0.3),
    rgba(57, 255, 20, 0.2),
    rgba(57, 255, 20, 0)
  );
  animation: scanDetection 6s linear infinite;
  z-index: 0;
  opacity: 0.6;
  filter: blur(2px);
}

/* Logo glow and highlight */
.logo-glow {
  position: absolute;
  inset: 4px;
  border-radius: 14px;
  background: radial-gradient(circle at 35% 25%, rgba(57, 255, 20, 0.25), transparent);
  animation: logoPulseGlow 2.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

.brand-mark img {
  width: 48px;
  height: 48px;
  display: block;
  filter: 
    drop-shadow(0 0 12px rgba(133, 231, 255, 0.7))
    drop-shadow(0 0 24px rgba(57, 255, 20, 0.3));
  position: relative;
  z-index: 3;
  animation: logoFloat 4s ease-in-out infinite;
}

.brand-text {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  z-index: 3;
}

.brand-prefix {
  font-size: 0.7rem;
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  opacity: 0.9;
  animation: textGlow 2.6s ease-in-out infinite;
}

.brand-text h1 {
  font-size: 1.68rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  color: #e8f5ff;
  text-shadow: 
    0 2px 16px rgba(88, 205, 255, 0.32),
    0 0 24px rgba(57, 255, 20, 0.12);
  margin: 0;
  animation: titleBreathe 3.2s ease-in-out infinite;
}

.brand h1,
.topbar h2,
.card h3 {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.08em;
  margin: 0;
}

.brand p,
.muted,
.metric-subtext,
.topbar-subtitle {
  color: var(--muted);
}

.brand p,
.nav-item,
.role-box label,
.form-grid label,
.metric-label,
.legend-row,
.health-pill,
.voice-status,
.region-meta,
.region-severity,
.data-table th,
.demo-step-label {
  font-family: "IBM Plex Mono", monospace;
}

.brand p {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(150, 183, 223, 0.88);
  animation: subTitleGlow 2.8s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* BRAND ANIMATIONS - Dynamic, Eye-Catching, Protection & Detection Themed     */
/* ═══════════════════════════════════════════════════════════════════════════ */

@keyframes shieldPulse {
  0%, 100% {
    transform: scale(1);
    border-color: rgba(57, 255, 20, 0.35);
    box-shadow: 0 0 28px rgba(57, 255, 20, 0.15);
  }
  50% {
    transform: scale(1.08);
    border-color: rgba(57, 255, 20, 0.55);
    box-shadow: 0 0 48px rgba(57, 255, 20, 0.28);
  }
}

@keyframes shieldRotate {
  0% {
    transform: rotate(0deg) scaleY(1);
    border-color: rgba(0, 212, 255, 0.45);
  }
  50% {
    border-color: rgba(57, 255, 20, 0.45);
    transform: rotate(180deg) scaleY(1.02);
  }
  100% {
    transform: rotate(360deg) scaleY(1);
    border-color: rgba(0, 212, 255, 0.45);
  }
}

@keyframes scanDetection {
  0% {
    transform: rotate(0deg);
    opacity: 0.4;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    transform: rotate(360deg);
    opacity: 0.4;
  }
}

@keyframes logoPulseGlow {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.95);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.02);
  }
}

@keyframes titleBreathe {
  0%, 100% {
    opacity: 1;
    text-shadow: 
      0 2px 16px rgba(88, 205, 255, 0.32),
      0 0 24px rgba(57, 255, 20, 0.12);
  }
  50% {
    opacity: 0.95;
    text-shadow: 
      0 2px 20px rgba(88, 205, 255, 0.42),
      0 0 32px rgba(57, 255, 20, 0.18);
  }
}

@keyframes textGlow {
  0%, 100% {
    color: var(--accent);
    opacity: 0.85;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.2);
  }
  50% {
    color: var(--accent-strong);
    opacity: 1;
    text-shadow: 0 0 16px rgba(0, 212, 255, 0.3);
  }
}

@keyframes subTitleGlow {
  0%, 100% {
    color: rgba(150, 183, 223, 0.88);
    opacity: 0.9;
  }
  50% {
    color: rgba(150, 183, 223, 1);
    opacity: 1;
  }
}

body[data-theme='day'] .brand {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(239, 248, 255, 0.82));
  border-color: rgba(122, 156, 192, 0.35);
  box-shadow: 
    0 20px 48px rgba(26, 45, 70, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 0 48px rgba(39, 179, 95, 0.12),
    0 0 72px rgba(31, 140, 200, 0.08);
}

body[data-theme='day'] .brand::before {
  background: 
    radial-gradient(circle at 15% 20%, rgba(39, 179, 95, 0.15), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(31, 140, 200, 0.12), transparent 28%);
}

body[data-theme='day'] .brand-mark {
  background: radial-gradient(circle at 30% 20%, rgba(137, 213, 255, 0.68), rgba(167, 237, 255, 0.48));
  border-color: rgba(96, 160, 210, 0.52);
  box-shadow: 
    0 0 48px rgba(116, 184, 236, 0.4),
    inset 0 0 32px rgba(255, 255, 255, 0.62),
    inset 0 -12px 24px rgba(100, 160, 210, 0.15),
    0 0 64px rgba(39, 179, 95, 0.18);
}

body[data-theme='day'] .shield-outer {
  border-color: rgba(39, 179, 95, 0.42);
  box-shadow: 0 0 28px rgba(39, 179, 95, 0.22);
}

body[data-theme='day'] .shield-inner {
  border-color: rgba(31, 140, 200, 0.55);
  box-shadow: inset 0 0 20px rgba(31, 140, 200, 0.15);
}

body[data-theme='day'] .detection-scan {
  background: conic-gradient(
    from 0deg,
    rgba(39, 179, 95, 0.4),
    rgba(31, 140, 200, 0.3),
    rgba(39, 179, 95, 0.2),
    rgba(39, 179, 95, 0)
  );
}

body[data-theme='day'] .logo-glow {
  background: radial-gradient(circle at 35% 25%, rgba(39, 179, 95, 0.3), transparent);
}

body[data-theme='day'] .brand-mark img {
  filter: 
    drop-shadow(0 0 12px rgba(116, 184, 236, 0.8))
    drop-shadow(0 0 24px rgba(39, 179, 95, 0.4));
}

body[data-theme='day'] .brand-prefix {
  color: #27b35f;
}

body[data-theme='day'] .brand-text h1 {
  color: #10223a;
  text-shadow: 
    0 2px 16px rgba(93, 179, 238, 0.35),
    0 0 24px rgba(39, 179, 95, 0.15);
}

body[data-theme='day'] .brand p {
  color: rgba(61, 99, 142, 0.85);
}

body[data-theme='day'] .brand-prefix {
  animation: textGlowDay 2.6s ease-in-out infinite;
}

@keyframes textGlowDay {
  0%, 100% {
    color: #27b35f;
    opacity: 0.9;
    text-shadow: 0 0 8px rgba(39, 179, 95, 0.25);
  }
  50% {
    color: #1f8cc8;
    opacity: 1;
    text-shadow: 0 0 16px rgba(31, 140, 200, 0.35);
  }
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item,
.btn {
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--panel-soft) 60%, transparent);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  transition: 150ms ease;
}

.nav-item {
  text-align: left;
  padding: 11px 12px;
}

.nav-item:hover,
.nav-item.active,
.btn:hover {
  border-color: var(--border);
  background: color-mix(in srgb, var(--panel-soft) 88%, transparent);
  box-shadow: inset 0 0 0 1px rgba(57, 255, 20, 0.08), 0 0 18px rgba(0, 212, 255, 0.08);
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sidebar-note {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(18, 29, 56, 0.7);
  font-size: 12px;
  line-height: 1.45;
}

.sidebar-note p {
  margin: 6px 0 0;
  color: var(--muted);
}

.role-box {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voice-actions {
  display: grid;
  gap: 8px;
}

.voice-status {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(6, 20, 40, 0.52);
  color: var(--warm-mid);
  font-size: 10px;
  line-height: 1.5;
  min-height: 38px;
}

.voice-status.ready {
  color: var(--neon);
  border-color: rgba(57, 255, 20, 0.22);
  box-shadow: inset 0 0 18px rgba(57, 255, 20, 0.05);
}

.voice-status.speaking {
  color: var(--cyan-hi);
  border-color: rgba(0, 212, 255, 0.28);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.08), inset 0 0 18px rgba(0, 212, 255, 0.05);
}

.voice-status.error {
  color: #ffd2d8;
  border-color: rgba(255, 45, 74, 0.25);
}

.input-hint {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(6, 20, 40, 0.52);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.input-hint.ok {
  color: var(--neon);
  border-color: rgba(57, 255, 20, 0.22);
  box-shadow: inset 0 0 18px rgba(57, 255, 20, 0.05);
}

.input-hint.error {
  color: #ffd2d8;
  border-color: rgba(255, 45, 74, 0.25);
}

.voice-tip {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.voice-tip strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 12px;
}

.voice-tip code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--cyan);
  background: rgba(0, 212, 255, 0.08);
  padding: 1px 4px;
  border-radius: 3px;
}

.demo-tip {
  margin-top: 10px;
  font-size: 0.8rem;
}

body[data-theme='day'] .voice-tip {
  background: rgba(0, 140, 200, 0.07);
  border-color: rgba(0, 140, 200, 0.2);
}

.role-box label,
.form-grid label,
.metric-label {
  font-size: 12px;
  color: var(--muted);
}

.role-box select,
.role-box input,
.role-box textarea,
.form-grid select,
.form-grid input[type="range"] {
  background: rgba(16, 29, 59, 0.92);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  width: 100%;
}

.role-box textarea {
  resize: vertical;
}

.main {
  padding: 24px;
  display: grid;
  gap: 12px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 16px;
}

.topbar-subtitle {
  margin: 6px 0 0;
}

.health-pill {
  background: rgba(64, 213, 156, 0.12);
  color: var(--good);
  border: 1px solid rgba(64, 213, 156, 0.28);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.grid {
  display: grid;
  gap: 16px;
}

.two-col {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: stretch;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.metric-card,
.card {
  background:
    linear-gradient(155deg, rgba(57, 255, 20, 0.05), rgba(3, 12, 24, 0.66) 24%, rgba(2, 10, 20, 0.78) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow), inset 0 0 24px rgba(57, 255, 20, 0.04), inset 0 0 42px rgba(0, 212, 255, 0.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
}

.metric-card {
  padding: 16px;
}

.metric-value {
  display: block;
  font-size: 29px;
  margin: 8px 0;
  color: var(--accent);
  text-shadow: 0 0 16px rgba(57, 255, 20, 0.22), 0 0 24px rgba(0, 212, 255, 0.16);
}

.card {
  padding: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.visualization-shell {
  border: 1px solid rgba(112, 152, 255, 0.14);
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 212, 255, 0.12), transparent 34%),
    radial-gradient(circle at 20% 15%, rgba(57, 255, 20, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(7, 20, 40, 0.94), rgba(3, 12, 24, 0.96));
  position: relative;
}

.visualization-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(57, 255, 20, 0.12), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(0, 212, 255, 0.09), transparent 24%),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  opacity: 0.52;
}

.visualization-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 52%, rgba(0, 0, 0, 0.28) 100%);
}

.preview-shell {
  height: 360px;
}

.graph-shell,
.map-shell {
  height: 690px;
}

.map-preview {
  height: 420px;
}

.region-list {
  height: 100%;
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: flex-start;
  overflow-y: auto;
}

.region-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  background: linear-gradient(145deg, rgba(57, 255, 20, 0.04), rgba(7, 20, 38, 0.72));
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  backdrop-filter: blur(16px) saturate(1.08);
  box-shadow: inset 0 0 16px rgba(0, 212, 255, 0.04);
}

.region-pulse {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 0 currentColor;
  animation: regionPulse 1.7s ease-in-out infinite;
}

.region-meta {
  font-size: 12px;
  color: var(--muted);
}

.region-severity {
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}

@keyframes regionPulse {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70% { box-shadow: 0 0 0 10px color-mix(in srgb, currentColor 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 0%, transparent); }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* Flat Map Region Label Styling                                              */
/* ─────────────────────────────────────────────────────────────────────────── */

.region-label-marker {
  pointer-events: none;
}

.region-label-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(7, 20, 40, 0.92), rgba(7, 20, 40, 0.88));
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border: 1.5px solid;
  border-radius: 10px;
  padding: 6px 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  letter-spacing: 0.04em;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.35),
    inset 0 0 12px rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.region-label-text strong {
  font-family: "Bebas Neue", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.label-status {
  font-size: 9px;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-top: 2px;
}

/* Day mode adjustments for region labels */
body[data-theme='day'] .region-label-text {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(248, 251, 255, 0.85));
  color: #10223a;
  border-color: rgba(100, 150, 200, 0.4);
  box-shadow: 
    0 4px 16px rgba(26, 45, 70, 0.2),
    inset 0 0 12px rgba(255, 255, 255, 0.5);
}

.panel {
  min-height: 138px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(57, 255, 20, 0.04), rgba(7, 20, 38, 0.72));
  -webkit-backdrop-filter: blur(14px) saturate(1.12);
  backdrop-filter: blur(14px) saturate(1.12);
}

.stack,
.audit,
.timeline {
  display: grid;
  gap: 10px;
}

.signature,
.plan,
.audit-item,
.timeline-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(145deg, rgba(57, 255, 20, 0.035), rgba(7, 20, 38, 0.7));
  -webkit-backdrop-filter: blur(14px) saturate(1.12);
  backdrop-filter: blur(14px) saturate(1.12);
  box-shadow: inset 0 0 16px rgba(0, 212, 255, 0.05);
}

.signature p,
.plan p,
.audit-item,
.timeline-item {
  margin: 6px 0 0;
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  margin-left: 8px;
}

.badge.high {
  background: rgba(255, 45, 74, 0.2);
  color: var(--risk);
}

.badge.medium {
  background: rgba(0, 212, 255, 0.16);
  color: var(--warn);
}

.actions {
  display: flex;
  gap: 10px;
  margin: 14px 0 0;
  flex-wrap: wrap;
}

.compact-actions {
  margin-top: 0;
}

.btn {
  padding: 10px 13px;
}

.btn.primary {
  border-color: rgba(57, 255, 20, 0.35);
  background: linear-gradient(135deg, var(--neon), var(--cyan));
  color: #03111f;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(57, 255, 20, 0.28), 0 0 28px rgba(0, 212, 255, 0.14);
}

.btn {
  -webkit-backdrop-filter: blur(10px) saturate(1.12);
  backdrop-filter: blur(10px) saturate(1.12);
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.spaced-top {
  margin-top: 16px;
}

.copilot-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.legend-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.legend-dot.healthy { background: #4f7fc9; box-shadow: 0 0 10px rgba(79, 127, 201, 0.45); }
.legend-dot.warning { background: #4e94df; box-shadow: 0 0 8px rgba(78, 148, 223, 0.42); }
.legend-dot.degraded { background: #e8a94a; box-shadow: 0 0 8px rgba(232, 169, 74, 0.38); }
.legend-dot.critical { background: #e45858; box-shadow: 0 0 8px rgba(228, 88, 88, 0.42); }

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 11px 10px;
  text-align: left;
  font-size: 14px;
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
}

.plan.selected {
  border-color: rgba(110, 209, 255, 0.934);
  box-shadow: 0 0 0 1px rgba(110, 208, 255, 0.16) inset;
}

.alert-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.alert-summary-grid > div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: rgba(7, 20, 38, 0.58);
  display: grid;
  gap: 2px;
}

.alert-stat {
  font-family: "Bebas Neue", sans-serif;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.alert-row {
  display: grid;
  gap: 6px;
}

.alert-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.alert-row-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--muted);
}

.alert-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
  border: 1px solid var(--border);
}

.alert-status.queued {
  color: #95d5ff;
  border-color: rgba(149, 213, 255, 0.35);
  background: rgba(0, 212, 255, 0.12);
}

.alert-status.simulated {
  color: #b9f8d6;
  border-color: rgba(185, 248, 214, 0.35);
  background: rgba(0, 229, 150, 0.12);
}

.alert-status.delivered {
  color: #aef7d0;
  border-color: rgba(0, 229, 150, 0.4);
  background: rgba(0, 229, 150, 0.18);
}

.alert-status.failed {
  color: #ffd2d8;
  border-color: rgba(255, 45, 74, 0.35);
  background: rgba(255, 45, 74, 0.16);
}

.hidden {
  display: none;
}

.leaflet-container {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 30% 25%, rgba(148, 198, 246, 0.14), transparent 28%),
    radial-gradient(circle at 65% 48%, rgba(203, 222, 239, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(8, 16, 32, 0.94), rgba(9, 18, 35, 0.96));
  filter: saturate(1.04) contrast(1.05) brightness(0.92);
}

body[data-theme='day'] .leaflet-container {
  filter: saturate(1.06) contrast(1.02) brightness(1.03);
}

.leaflet-tile {
  opacity: 0.52;
  mix-blend-mode: screen;
}

#flatMapContainer .leaflet-tile {
  opacity: 0.92;
  mix-blend-mode: normal;
  filter: none;
}

.world-flat-video-overlay {
  object-fit: contain;
  filter: saturate(1.15) contrast(1.04) brightness(0.92);
}

body[data-theme='day'] .world-flat-video-overlay {
  filter: saturate(1.02) contrast(1.03) brightness(1.02);
}

#flatMapContainer .leaflet-tile-pane {
  filter: saturate(1.05) contrast(1.02) brightness(0.98);
}

#riskMapPreview .leaflet-tile-pane {
  filter: saturate(0.88) contrast(1.05) brightness(0.86);
}

#graphDetail,
#dependencyGraphPreview {
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 213, 255, 0.778), transparent 36%),
    radial-gradient(circle at 18% 20%, rgba(57, 255, 20, 0.06), transparent 24%),
    linear-gradient(180deg, rgba(4, 12, 24, 0.98), rgba(8, 18, 35, 0.98));
}

#flatMapContainer {
  background:
    radial-gradient(circle at 20% 35%, rgba(121, 171, 226, 0.22), transparent 26%),
    radial-gradient(circle at 74% 48%, rgba(209, 224, 240, 0.15), transparent 24%),
    linear-gradient(180deg, #081326, #0b172c);
}

#flatMapContainer::after,
#riskMapPreview::after {
  background: radial-gradient(circle at center, transparent 70%, rgba(0, 0, 0, 0.1) 100%);
}

#globeContainer {
  background:
    radial-gradient(circle at center, rgba(150, 194, 230, 0.16), transparent 34%),
    radial-gradient(circle at 50% 80%, rgba(170, 201, 230, 0.08), transparent 32%),
    linear-gradient(180deg, #060d1b, #0b1528);
}

#globeContainer::before {
  background:
    radial-gradient(circle at 50% 45%, rgba(196, 219, 240, 0.18), transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(150, 194, 230, 0.08), transparent 44%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  opacity: 0.5;
}

#globeContainer canvas {
  filter: drop-shadow(0 0 16px rgba(148, 190, 230, 0.34)) drop-shadow(0 0 34px rgba(110, 156, 204, 0.22));
}

.tech-globe-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#globeContainer.simulation-surge,
#flatMapContainer.simulation-surge,
#riskMapPreview.simulation-surge {
  animation: simulationSurge 2.3s ease-out;
}

#globeContainer.mitigation-surge,
#flatMapContainer.mitigation-surge,
#riskMapPreview.mitigation-surge {
  animation: mitigationSurge 1.6s ease-out;
}

@keyframes simulationSurge {
  0% {
    transform: scale(0.985);
    filter: saturate(1) brightness(1);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
  22% {
    transform: scale(1.01);
    filter: saturate(1.36) brightness(1.08);
    box-shadow: 0 0 42px rgba(255, 72, 72, 0.28), 0 0 72px rgba(255, 170, 72, 0.18);
  }
  65% {
    transform: scale(1.004);
    filter: saturate(1.2) brightness(1.04);
  }
  100% {
    transform: scale(1);
    filter: saturate(1) brightness(1);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
}

@keyframes mitigationSurge {
  0% {
    transform: scale(0.99);
    filter: saturate(1.15) brightness(1.02);
  }
  35% {
    transform: scale(1.008);
    filter: saturate(1.35) brightness(1.08);
    box-shadow: 0 0 36px rgba(57, 255, 140, 0.32), 0 0 58px rgba(120, 255, 180, 0.22);
  }
  100% {
    transform: scale(1);
    filter: saturate(1) brightness(1);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: color-mix(in srgb, var(--panel-soft) 84%, transparent);
  color: var(--text);
}

.map-region-tooltip {
  background: linear-gradient(135deg, rgba(16, 27, 47, 0.8), rgba(16, 27, 47, 0.66));
  border: 1px solid rgba(170, 196, 222, 0.4);
  border-radius: 999px;
  color: #e5edf6;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  box-shadow: 0 8px 24px rgba(7, 13, 24, 0.38), inset 0 0 10px rgba(196, 219, 240, 0.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.08);
  backdrop-filter: blur(10px) saturate(1.08);
}

.map-region-tooltip::before {
  border-top-color: rgba(170, 196, 222, 0.4) !important;
}

.leaflet-interactive {
  filter: drop-shadow(0 0 8px rgba(0, 213, 255, 0.494));
}

body[data-theme='day'] .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 251, 255, 0.92));
  -webkit-backdrop-filter: blur(12px) saturate(1.02);
  backdrop-filter: blur(12px) saturate(1.02);
  border-right: 1px solid rgba(203, 213, 225, 0.3);
}

body[data-theme='day'] .metric-card,
body[data-theme='day'] .card,
body[data-theme='day'] .panel,
body[data-theme='day'] .signature,
body[data-theme='day'] .plan,
body[data-theme='day'] .audit-item,
body[data-theme='day'] .timeline-item,
body[data-theme='day'] .region-item,
body[data-theme='day'] .voice-status {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(248, 251, 255, 0.88));
  border-color: rgba(203, 213, 225, 0.4);
  box-shadow: 0 4px 12px rgba(22, 42, 68, 0.06), inset 0 0 12px rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(12px) saturate(1.03);
  backdrop-filter: blur(12px) saturate(1.03);
}

body[data-theme='day'] .visualization-shell {
  background:
    radial-gradient(circle at 50% 0%, rgba(90, 180, 255, 0.18), transparent 36%),
    radial-gradient(circle at 20% 15%, rgba(39, 179, 95, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(250, 253, 255, 0.9), rgba(239, 247, 255, 0.84));
  border-color: rgba(117, 149, 185, 0.24);
}

body[data-theme='day'] .visualization-shell::before {
  opacity: 0.36;
}

body[data-theme='day'] .visualization-shell::after {
  background: radial-gradient(circle at center, transparent 65%, rgba(199, 219, 245, 0.24) 100%);
}

body[data-theme='day'] .role-box select,
body[data-theme='day'] .role-box input,
body[data-theme='day'] .role-box textarea,
body[data-theme='day'] .form-grid select,
body[data-theme='day'] .form-grid input[type="range"],
body[data-theme='day'] .toolbar-control select {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(203, 213, 225, 0.4);
  color: #1a2332;
  font-weight: 500;
}

body[data-theme='day'] .btn {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(118, 151, 188, 0.28);
  color: #10233a;
}

body[data-theme='day'] .btn.primary,
body[data-theme='day'] .btn.demo-cta {
  background: linear-gradient(135deg, #2563eb, #0891b2);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15), 0 8px 20px rgba(8, 145, 178, 0.1);
  border: none;
  font-weight: 600;
}

body[data-theme='day'] .metric-value {
  color: #0891b2;
  text-shadow: none;
}

body[data-theme='day'] .health-pill {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
}

body[data-theme='day'] #flatMapContainer,
body[data-theme='day'] #globeContainer,
body[data-theme='day'] #graphDetail,
body[data-theme='day'] #dependencyGraphPreview {
  background:
    radial-gradient(circle at 20% 30%, rgba(106, 190, 255, 0.16), transparent 26%),
    radial-gradient(circle at 74% 48%, rgba(66, 198, 231, 0.12), transparent 24%),
    linear-gradient(180deg, #f9fcff, #edf5ff);
}

body[data-contrast='high'] {
  --panel: rgba(0, 0, 0, 0.86);
  --panel-soft: rgba(0, 0, 0, 0.92);
  --text: #ffffff;
  --muted: #dce8ff;
  --accent: #7dff4f;
  --accent-strong: #59d5ff;
  --good: #5dffbe;
  --warn: #ffe169;
  --degraded: #ff7e7e;
  --risk: #ff6f87;
  --critical: #ff5873;
  --border: rgba(180, 225, 255, 0.55);
  --shadow: 0 20px 58px rgba(0, 0, 0, 0.7);
}

body[data-contrast='high'] .leaflet-container,
body[data-contrast='high'] #flatMapContainer .leaflet-tile-pane,
body[data-contrast='high'] #riskMapPreview .leaflet-tile-pane {
  filter: saturate(1.16) contrast(1.24) brightness(0.96) !important;
}

body[data-contrast='high'] .region-label-text,
body[data-contrast='high'] .voice-status,
body[data-contrast='high'] .health-pill {
  border-width: 2px;
}

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation: none !important;
  transition-duration: 0.01ms !important;
}

@media (pointer: coarse) {
  .btn,
  .nav-item,
  .role-box select,
  .role-box input,
  .role-box textarea,
  .toolbar-control select,
  .chat-input {
    min-height: 44px;
  }
}


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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 18px 16px;
  }

  .topbar,
  .topbar-right {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-right {
    width: 100%;
  }

  .toolbar-control select,
  .btn.demo-cta {
    width: 100%;
  }

  .metrics-row,
  .two-col,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .graph-shell,
  .map-shell {
    height: 520px;
  }

  .main {
    padding: 18px;
  }

  .demo-banner {
    margin: 0 0 12px;
  }
}

@media (max-width: 900px) {
  .brand {
    margin-bottom: 16px;
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: left;
    gap: 14px;
  }

  .brand-mark {
    transform: translateZ(14px) rotateX(4deg) rotateY(-4deg);
    width: 62px;
    height: 62px;
  }

  .brand-mark img {
    width: 42px;
    height: 42px;
  }

  .brand-text h1 {
    font-size: 1.48rem;
  }

  .brand-prefix {
    font-size: 0.65rem;
  }

  .brand p {
    font-size: 10px;
  }

  .nav-menu {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 1fr);
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
  }

  .nav-item {
    min-height: 42px;
    white-space: nowrap;
  }

  .sidebar-note {
    margin-top: 12px;
  }

  .role-box {
    margin-top: 14px;
  }

  .health-pill {
    width: 100%;
    text-align: center;
  }

  .metric-value {
    font-size: 25px;
  }

  .preview-shell {
    height: 300px;
  }

  .graph-shell,
  .map-shell {
    height: 440px;
  }
}

@media (max-width: 680px) {
  .main {
    padding: 14px;
  }

  .topbar {
    margin-bottom: 12px;
    gap: 10px;
  }

  .topbar h2 {
    font-size: 1.5rem;
  }

  .topbar-subtitle {
    font-size: 13px;
    line-height: 1.45;
  }

  .card,
  .metric-card,
  .panel,
  .signature,
  .plan,
  .audit-item,
  .timeline-item {
    padding: 12px;
  }

  .btn,
  .btn.demo-cta,
  .role-box select,
  .role-box input,
  .role-box textarea,
  .form-grid select,
  .form-grid input[type="range"] {
    min-height: 42px;
  }

  .actions {
    gap: 8px;
  }

  .actions .btn {
    flex: 1 1 100%;
  }

  .demo-banner {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .demo-step-label {
    font-size: 0.64rem;
  }

  .region-item {
    grid-template-columns: auto 1fr;
    row-gap: 6px;
  }

  .region-severity {
    justify-self: start;
    grid-column: 2;
  }

  .data-table th,
  .data-table td {
    padding: 8px 6px;
    font-size: 12px;
  }

  .preview-shell {
    height: 260px;
  }

  .graph-shell,
  .map-shell {
    height: 360px;
  }
}

@media (min-width: 1440px) {
  .app-shell {
    grid-template-columns: 330px minmax(0, 1fr);
  }

  .main {
    padding: 28px;
  }
}
