/* ==========================================================================
   SOLARPUNK / BIOTECH PROTO-SYSTEM STYLESHEET
   Aesthetic: Warm cream, moss green, terracotta, and soft bioluminescent glows.
   ========================================================================== */
 
:root { 
  /* Core Color System */
  --bg-primary: #030704;
  --bg-secondary: rgba(8, 24, 14, 0.58);
  --bg-tertiary: rgba(3, 12, 8, 0.72);
  --bg-glass: rgba(3, 12, 8, 0.72);
  --border-color: rgba(167, 255, 92, 0.25);
  --border-focus: #a7ff5c; /* Bright green for accessibility focus */
  
  /* Text Color Tokens */
  --text-main: #f3ffe8;       /* Light Sage Text */
  --text-secondary: #a7ff5c;  /* Bright Green */
  --text-dim: #b6c9a7;        /* Sage Slate */
  --text-inverse: #030704;
  
  /* Bioluminescent Glow / Status Accents */
  --glow-emerald: #34D399;   /* Optimal growth */
  --glow-cyan: #22D3EE;      /* High water/mycelium */
  --glow-gold: #FBBF24;      /* Solar reserves */
  --glow-peach: #F87171;     /* Metabolic demand / heat */
  --glow-purple: #C084FC;    /* Fungal/spore cycle */
  --glow-stress: #EF4444;    /* Critical interruption */
  
  /* Font Families */
  --font-sans: 'Outfit', sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Transitions & Spacing */
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --spacing-base: 1rem;
  
  /* Layout density overrides (modified dynamically by sandbox) */
  --card-padding: 1.5rem;
  --card-gap: 1.5rem;
}

/* ==========================================================================
   RESET & BASE ELEMENTS
   ========================================================================== */

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

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at 20% 20%, rgba(74, 255, 128, 0.11), transparent 32%), radial-gradient(circle at 80% 10%, rgba(127, 255, 233, 0.10), transparent 32%), linear-gradient(180deg, #020302, #06110a 55%, #010201);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(167, 255, 92, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(167, 255, 92, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 80%);
  pointer-events: none;
}

/* Base Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

/* Screen reader utility for accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   AESTHETIC EFFECTS & ATMOSPHERE
   ========================================================================== */

/* Sunlight dappling simulation overlay */
.dappled-light {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 10% 20%, rgba(167, 255, 92, 0.04) 0%, transparent 50%),
              radial-gradient(circle at 90% 80%, rgba(127, 255, 233, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 100;
}

/* Ambient shadow filter for organic feel */
.ambient-glow {
  position: fixed;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.015' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 99;
}

/* ==========================================================================
   LAYOUT CONTAINERS (SHELL GRID)
   ========================================================================== */

.shell-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
}

/* Header Telemetry */
.system-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background-color: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  margin-bottom: 1rem;
  gap: 1.5rem;
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.system-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.system-subtitle a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px dashed rgba(167, 255, 92, 0.4);
  padding-bottom: 1px;
  transition: var(--transition-smooth);
}

.system-subtitle a:hover {
  color: var(--text-main);
  border-bottom-style: solid;
  border-bottom-color: var(--text-secondary);
}

.header-telemetry {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.telemetry-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.telemetry-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.telemetry-value {
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Solar Grid Progress Telemetry */
.solar-bar-container {
  width: 80px;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
}

.solar-bar-fill {
  height: 100%;
  background-color: var(--glow-gold);
  box-shadow: 0 0 6px var(--glow-gold);
}

.telemetry-clock {
  font-family: var(--font-mono);
  font-weight: 500;
  background: var(--bg-tertiary);
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

/* Main Workspace Body Split */
.workspace-body {
  display: flex;
  flex: 1;
  gap: 1rem;
  min-height: 0; /* Important for flex scrolling */
}

/* Sidebar Navigation (Leaves) */
.sidebar-nav {
  width: 280px;
  padding-right: 0.25rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-tab {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: var(--transition-bounce);
  font-family: var(--font-sans);
}

/* Leaf border-radius effect for natural Solarpunk feel */
.nav-tab {
  border-top-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.nav-tab:hover, .nav-tab:focus {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

.nav-tab.active {
  background: var(--text-main);
  color: var(--bg-primary);
  border-color: var(--text-main);
  box-shadow: 0 4px 15px rgba(167, 255, 92, 0.2);
}

.nav-tab.active .tab-desc {
  color: var(--bg-tertiary);
}

.tab-icon {
  font-size: 1.5rem;
}

.tab-label {
  display: flex;
  flex-direction: column;
}

.tab-title {
  font-weight: 600;
  font-size: 0.95rem;
}

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

/* Viewport Main Panel Frame */
.main-viewport {
  flex: 1;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 1.5rem;
  min-height: 0;
  position: relative;
}

/* ==========================================================================
   MODULE CARDS & GLOBAL DESIGN SYSTEM
   ========================================================================== */

/* Header Bars inside viewport */
.module-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.proto-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px dashed var(--text-dim);
  border-radius: 8px;
  color: var(--text-secondary);
}

/* Screen sections hidden by default */
.module-section {
  display: none;
  animation: fadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.module-section.active {
  display: block;
}

/* Glass Panels */
.glass-panel {
  background: linear-gradient(135deg, rgba(8, 24, 14, 0.65), rgba(3, 12, 8, 0.75));
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: var(--card-padding);
  box-shadow: 0 4px 20px rgba(167, 255, 92, 0.04), inset 0 0 12px rgba(167, 255, 92, 0.02);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.glass-panel:hover {
  transform: translateY(-3px);
  border-color: rgba(167, 255, 92, 0.45);
  box-shadow: 0 10px 30px rgba(167, 255, 92, 0.09), inset 0 0 15px rgba(167, 255, 92, 0.04);
}

/* Layout Grids & Flex */
.grid-layout {
  display: grid;
  gap: var(--card-gap);
}

.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

.flex-layout {
  display: flex;
}

.flex-column { display: flex; flex-direction: column; }
.flex-row { display: flex; flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.flex-grow-1 { flex: 1; }
.flex-grow-2 { flex: 2; }

/* Width/Height Utilities */
.width-100 { width: 100%; }
.width-300 { width: 300px; }
.min-h-300 { min-height: 300px; }
.min-h-400 { min-height: 400px; }
.min-h-500 { min-height: 500px; }
.relative-container { position: relative; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.p-6 { padding: 1.5rem; }

/* Text Utilities */
.text-sm { font-size: 0.85rem; }
.text-xl { font-size: 1.25rem; }
.font-bold { font-weight: 600; }
.text-dim { color: var(--text-dim); }

/* Color overrides mapping to glows */
.text-emerald { color: var(--text-secondary); }
.text-cyan { color: var(--glow-cyan); }
.text-amber { color: var(--glow-gold); }
.text-peach { color: var(--glow-peach); }

/* Buttons & Interactive Elements */
button {
  font-family: var(--font-sans);
  font-weight: 600;
  transition: var(--transition-smooth);
  outline: none;
}

.btn-accent {
  background: var(--text-main);
  color: var(--bg-primary);
  border: 1px solid var(--text-main);
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  cursor: pointer;
}

.btn-accent:hover, .btn-accent:focus {
  background: var(--text-secondary);
  border-color: var(--text-secondary);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  cursor: pointer;
}

.btn-secondary:hover, .btn-secondary:focus {
  background: var(--bg-tertiary);
  border-color: var(--text-main);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--border-focus);
  color: var(--bg-primary);
  border: 1px solid var(--border-focus);
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  cursor: pointer;
}

.btn-danger:hover {
  background: #9a3412;
}

.btn-small {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.25rem;
}

.btn-icon:hover {
  color: var(--text-main);
}

/* Card layout blocks */
.layout-card {
  display: flex;
  flex-direction: column;
  min-width: 0; /* Prevents flex overflow */
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

.card-body {
  flex: 1;
}

/* Form Fields */
.input-select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-main);
  border-radius: 10px;
  font-family: var(--font-sans);
  outline: none;
}

.input-select-small {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-main);
  border-radius: 8px;
  font-size: 0.8rem;
  outline: none;
}

.input-text-small {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-main);
  border-radius: 8px;
  font-size: 0.8rem;
  outline: none;
}

.input-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  outline: none;
}

.input-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-main);
  border: 2px solid var(--bg-primary);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(167, 255, 92, 0.25);
  transition: transform 0.1s ease;
}

.input-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-weight: 500;
}

.badge-emerald {
  background: rgba(52, 211, 153, 0.15);
  color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-cyan {
  background: rgba(34, 211, 230, 0.15);
  color: #bae6fd;
  border: 1px solid rgba(34, 211, 230, 0.3);
}

.badge-amber {
  background: rgba(251, 191, 36, 0.15);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-peach {
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.badge-purple {
  background: rgba(192, 132, 252, 0.15);
  color: #f3e8ff;
  border: 1px solid rgba(192, 132, 252, 0.3);
}

.badge-stress {
  background: rgba(239, 68, 68, 0.15);
  color: #fee2e2;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Description / Paragraphs */
.description-text {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* Common States: Empty, Loading, Error */
.empty-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-dim);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  filter: grayscale(0.5) opacity(0.7);
}

.empty-state p {
  font-size: 0.95rem;
  max-width: 250px;
}

.loading-pulse-text {
  animation: pulse-op 1.5s infinite ease-in-out;
}

/* ==========================================================================
   MODULE 1: BIOSPHERE OVERVIEW SPECIFICS
   ========================================================================== */

.growth-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.metric-block {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.metric-num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
}

.metric-num-small {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
}

.metric-name {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(167, 255, 92, 0.15);
  font-size: 0.85rem;
}

.status-row:last-child {
  border-bottom: none;
}

/* Priority Lanes */
.priority-lanes {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.priority-lane {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
}

.lane-header {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-weight: 600;
}

.lane-critical .lane-header {
  background: rgba(248, 113, 113, 0.15);
  color: #9a3412;
  border-bottom: 1px solid rgba(248, 113, 113, 0.25);
}

.lane-stable .lane-header {
  background: rgba(52, 211, 153, 0.15);
  color: #065f46;
  border-bottom: 1px solid rgba(52, 211, 153, 0.25);
}

.lane-items {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lane-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

/* Alerts and activity logs */
.alerts-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}

.filter-bar {
  display: flex;
  justify-content: flex-end;
}

.alerts-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  overflow-y: auto;
}

.alert-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-primary);
  border-left: 3px solid var(--glow-emerald);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  gap: 0.5rem;
}

.alert-item.alert-critical {
  border-left-color: var(--glow-peach);
}

.alert-item-label {
  display: flex;
  flex-direction: column;
}

.btn-ack {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.feed-log {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem;
  height: 280px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.feed-row {
  display: flex;
  gap: 0.5rem;
  color: var(--text-dim);
}

.feed-row .feed-time {
  color: var(--text-secondary);
}

/* ==========================================================================
   MODULE 2: MYCELIAL PATH WEAVER
   ========================================================================== */

.mycelial-canvas-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.mycelial-connections-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.connection-line {
  stroke: var(--text-dim);
  stroke-width: 2px;
  stroke-dasharray: 4 4;
  fill: none;
  opacity: 0.4;
  transition: var(--transition-smooth);
}

.connection-line.pulse-active {
  stroke: var(--glow-emerald);
  stroke-width: 3px;
  stroke-dasharray: none;
  opacity: 0.9;
  animation: svgDash 20s linear infinite;
}

.mycelial-nodes-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.spore-node {
  position: absolute;
  background: var(--bg-primary);
  border: 2px solid var(--text-main);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  width: 140px;
  text-align: center;
  cursor: pointer;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 10px rgba(167, 255, 92, 0.1);
  transition: var(--transition-bounce);
  user-select: none;
}

/* Leaf-like shape for Spore nodes */
.spore-node {
  border-top-left-radius: 18px;
  border-bottom-right-radius: 18px;
}

.spore-node:hover, .spore-node:focus-visible {
  border-color: var(--glow-emerald);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
  transform: translate(-50%, -50%) scale(1.05);
}

.spore-node.dragging {
  cursor: grabbing !important;
  opacity: 0.8;
  border-color: var(--glow-cyan) !important;
  box-shadow: 0 0 18px var(--glow-cyan) !important;
  transform: translate(-50%, -50%) scale(1.08) !important;
  z-index: 100 !important;
  transition: none !important; /* disable transitions during drag for fluid movement */
}

.spore-node.selected-node {
  background: var(--text-main);
  color: var(--bg-primary);
  border-color: var(--text-main);
}

.spore-node-title {
  font-size: 0.85rem;
  font-weight: 600;
  display: block;
}

.spore-node-state {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.selected-node .spore-node-state {
  color: var(--bg-tertiary);
}

/* ==========================================================================
   MODULE 3: BIOPHONIC TELEMETRY MAP (RADAR GRID)
   ========================================================================== */

.radar-container {
  width: 380px;
  height: 380px;
  max-width: 100%;
}

.radar-grid {
  width: 100%;
  height: 100%;
}

.radar-ring {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 1px;
}

.radar-axis {
  stroke: var(--border-color);
  stroke-width: 1px;
  stroke-dasharray: 2 4;
}

.radar-sweep {
  stroke: rgba(167, 255, 92, 0.25);
  stroke-width: 2px;
  transform-origin: 200px 200px;
  /* Removed standard animation, driven dynamically by JS loop */
}

/* Signal dots */
.signal-dot {
  cursor: pointer;
  outline: none;
  transition: var(--transition-smooth);
}

.signal-circle {
  transition: var(--transition-bounce);
}

.signal-dot:hover .signal-circle, .signal-dot:focus-visible .signal-circle {
  r: 10 !important;
  stroke: var(--border-focus);
  stroke-width: 3px;
}

.signal-pulse-ring {
  fill: none;
  stroke-width: 1.5px;
  transform-origin: center;
  animation: signalPulseAni 2.5s infinite ease-out;
}

/* Dynamic Sonar Swept Flare Echo */
.signal-dot.swept .signal-circle {
  animation: signalSweepFlare 2s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.signal-dot.swept .signal-pulse-ring {
  animation: signalSweepPulse 2s cubic-bezier(0.1, 0.8, 0.2, 1);
}

@keyframes signalSweepFlare {
  0% {
    r: 15px;
    opacity: 1;
    filter: drop-shadow(0 0 14px currentColor);
  }
  40% {
    r: 8px;
    opacity: 0.95;
    filter: drop-shadow(0 0 6px currentColor);
  }
  100% {
    r: 5px;
    opacity: 0.85;
    filter: none;
  }
}

@keyframes signalSweepPulse {
  0% {
    r: 6px;
    stroke-width: 4px;
    opacity: 1;
  }
  100% {
    r: 50px;
    stroke-width: 1px;
    opacity: 0;
  }
}

/* ==========================================================================
   MODULE 4: PERMACULTURE BOARD
   ========================================================================== */

.board-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-radius: 16px;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  align-items: start;
}

.kanban-col {
  background: rgba(8, 24, 14, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 350px;
}

.col-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.col-header h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
}

.col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

..col-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
}

.add-task-col-btn {
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.add-task-col-btn:hover {
  color: var(--text-secondary);
  background: rgba(167, 255, 92, 0.1);
  border-color: rgba(167, 255, 92, 0.2);
}

.col-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 250px; /* Allow drop zone */
}

/* Kanban Cards */
.kanban-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem;
  cursor: grab;
  user-select: none;
  transition: var(--transition-smooth);
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(167, 255, 92, 0.1);
}

.kanban-card:active {
  cursor: grabbing;
}

.card-title-row {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.card-details-row {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-navigator-btn {
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  cursor: pointer;
}

.card-navigator-btn:hover {
  background: var(--bg-tertiary);
}

/* ==========================================================================
   MODULE 5: TIMELINE SIMULATOR
   ========================================================================== */

.slider-group {
  margin-bottom: 1.25rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.slider-value {
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Timeline Milestones list */
.timeline-container {
  position: relative;
  padding-left: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  left: 6px;
  width: 2px;
  height: calc(100% - 1rem);
  background: var(--border-color);
}

.timeline-milestone {
  position: relative;
}

.milestone-dot {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--text-main);
  box-shadow: 0 0 0 3px var(--bg-primary);
  z-index: 2;
  transition: var(--transition-smooth);
}

.timeline-milestone.milestone-complete .milestone-dot {
  border-color: var(--text-secondary);
  background: var(--text-secondary);
}

.timeline-milestone.milestone-stress .milestone-dot {
  border-color: var(--border-focus);
}

.milestone-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

.milestone-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.milestone-date {
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.milestone-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* ==========================================================================
   MODULE 6: DATA CONSTELLATION MAP
   ========================================================================== */

.constellation-wrapper {
  width: 580px;
  height: 480px;
  max-width: 100%;
}

.constellation-svg {
  width: 100%;
  height: 100%;
}

.node-link {
  stroke: var(--text-dim);
  stroke-width: 1.5px;
  opacity: 0.25;
  transition: var(--transition-smooth);
}

.node-link.link-highlight {
  stroke: var(--glow-emerald);
  stroke-width: 3px;
  opacity: 0.9;
}

.constellation-node {
  cursor: pointer;
}

.constellation-node-circle {
  stroke: var(--text-main);
  stroke-width: 2px;
  transition: var(--transition-bounce);
}

.constellation-node:hover .constellation-node-circle,
.constellation-node:focus-visible .constellation-node-circle {
  r: 14px;
  stroke-color: var(--glow-emerald);
}

.constellation-node.active-node .constellation-node-circle {
  fill: var(--text-main);
}

.constellation-node-text {
  font-family: var(--font-sans);
  font-size: 11px;
  fill: var(--text-main);
  font-weight: 500;
  text-anchor: middle;
  pointer-events: none;
}

/* ==========================================================================
   MODULE 7: SYSTEM HEALTH (PHOTOSYNTHESIS ENGINE)
   ========================================================================== */

.radial-ring-box {
  width: 180px;
  height: 180px;
}

.svg-health-ring {
  width: 100%;
  height: 100%;
}

.ring-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 4px;
}

.ring-fill {
  fill: none;
  stroke-width: 6px;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.8s ease-in-out;
}

.ring-solar { stroke: var(--glow-gold); }
.ring-water { stroke: var(--glow-cyan); }
.ring-fungal { stroke: var(--glow-emerald); }

.ring-telemetry-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.legend-row {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
}

.legend-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.legend-row strong {
  margin-left: auto;
  font-family: var(--font-mono);
}

.auxin-canvas {
  width: 100%;
  height: 180px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.health-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.check-item, .check-item-disabled {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.check-item-disabled {
  color: var(--text-dim);
  cursor: not-allowed;
}

/* ==========================================================================
   MODULE 8: DECISION CONSOLE
   ========================================================================== */

.decision-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.decision-card-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
}

.decision-card-btn:hover {
  background: var(--bg-tertiary);
}

.decision-card-btn.active-decision {
  border-color: var(--text-main);
  background: var(--bg-tertiary);
  box-shadow: 0 0 0 2px var(--text-main);
}

.decision-card-title {
  font-weight: 600;
  font-size: 0.85rem;
}

.decision-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* Decision detail core view */
.decision-comparison-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.decision-header-area {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.decision-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.options-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.option-panel {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.option-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.option-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

.option-metric-row {
  display: flex;
  justify-content: space-between;
}

.decision-actions-row {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* ==========================================================================
   MODULE 9: SANDBOX
   ========================================================================== */

.density-toggles {
  display: flex;
  gap: 0.5rem;
}

.sandbox-widget {
  background: var(--bg-glass);
  border-radius: 16px;
  transition: var(--transition-smooth);
}

/* Sandbox widgets dynamic state styles */
.sandbox-widget.state-loading {
  position: relative;
  opacity: 0.75;
  pointer-events: none;
}

.sandbox-widget.state-loading::before {
  content: '🧬 Processing Biosynthesis...';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(3, 12, 8, 0.8);
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  color: var(--text-main);
  animation: pulse-op 1.5s infinite ease-in-out;
}

.sandbox-widget.state-success {
  border-color: var(--glow-emerald);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.2);
}

.sandbox-widget.state-warning {
  border-color: var(--glow-gold);
}

.sandbox-widget.state-error {
  border-color: var(--glow-stress);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

.sandbox-widget.state-disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Empty representation styling inside sandbox widget */
.sandbox-widget.state-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 1rem !important;
}

.sandbox-widget.state-empty * {
  display: none;
}

.sandbox-widget.state-empty::after {
  content: '🍂 Pod Defoliated • No active tissue segments';
  display: block;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.widget-metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.widget-val-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   MODULE 10: SCENARIO PLAYBACK ROOM
   ========================================================================== */

.scrubber-timeline-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.time-readout {
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
}

.time-readout strong {
  font-family: var(--font-mono);
}

.scrubber-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
  padding: 0 0.25rem;
}

.scenario-timeline-logs {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  height: 200px;
  overflow-y: auto;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.log-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  color: var(--text-dim);
}

.log-row.highlighted-log {
  color: var(--text-main);
  background: var(--bg-secondary);
  border-left: 2px solid var(--text-main);
  padding-left: 0.25rem;
}

.log-time {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.playback-outcome-box {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.outcome-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(167, 255, 92, 0.15);
}

/* ==========================================================================
   SHARED MODAL DIALOGS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 12, 8, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-box {
  background: var(--bg-primary);
  border: 2px solid var(--text-main);
  width: 500px;
  max-width: 90%;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(167, 255, 92, 0.25);
  animation: modalScaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-body {
  padding: 1.5rem;
  font-size: 0.95rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   COMMAND PALETTE STYLING
   ========================================================================== */

.command-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 12, 8, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
}

.command-palette-box {
  width: 600px;
  max-width: 95%;
  background: linear-gradient(135deg, rgba(8, 24, 14, 0.95), rgba(3, 12, 8, 0.98));
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(167, 255, 92, 0.15), 0 0 0 1px rgba(167, 255, 92, 0.1);
  overflow: hidden;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.command-palette-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
}

.cmd-icon {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  outline: none;
}

#cmd-input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

.esc-kbd {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.command-palette-body {
  max-height: 360px;
  overflow-y: auto;
  padding: 0.5rem;
}

#cmd-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 0.9rem;
}

.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cmd-item-icon {
  font-size: 1.1rem;
}

.cmd-item-text {
  font-weight: 500;
}

.cmd-item-shortcut {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.7;
}

.cmd-item:hover, .cmd-item.selected {
  background: rgba(167, 255, 92, 0.12);
  color: var(--text-secondary);
}

.cmd-item.selected {
  border: 1px solid rgba(167, 255, 92, 0.3);
}

.cmd-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.header-search-btn {
  margin-left: 0.5rem;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  transition: var(--transition-smooth);
}

.header-search-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
}

/* ==========================================================================
   PERSISTENT FOOTER DISCLAIMER
   ========================================================================== */

.system-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  margin-top: 1rem;
  gap: 1.5rem;
  font-size: 0.75rem;
}

.footer-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(52, 211, 153, 0.15);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  flex-shrink: 0;
}

.footer-disclaimer {
  color: var(--text-dim);
  line-height: 1.4;
  text-align: center;
}

.footer-version {
  font-family: var(--font-mono);
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ==========================================================================
   ACCESSIBILITY & KEYBOARD NAVIGATION FOCUS
   ========================================================================== */

/* High-visibility outlines for focus-visible events */
:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}

.nav-tab:focus-visible {
  outline-offset: -4px;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */

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

@keyframes pulse-op {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes svgDash {
  from { stroke-dashoffset: 400; }
  to { stroke-dashoffset: 0; }
}

@keyframes radarRotation {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

@keyframes modalScaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Bioluminescent status pulses */
.pulse-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.pulse-indicator::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  opacity: 0.4;
  animation: pulse-op 2s infinite ease-in-out;
}

.pulse-emerald { background-color: var(--glow-emerald); }
.pulse-emerald::after { background-color: var(--glow-emerald); }

.pulse-cyan { background-color: var(--glow-cyan); }
.pulse-cyan::after { background-color: var(--glow-cyan); }

.pulse-amber { background-color: var(--glow-gold); }
.pulse-amber::after { background-color: var(--glow-gold); }

/* dot legends */
.dot-emerald { background-color: var(--glow-emerald); }
.dot-cyan { background-color: var(--glow-cyan); }
.dot-gold { background-color: var(--glow-gold); }
.dot-peach { background-color: var(--glow-peach); }
.dot-purple { background-color: var(--glow-purple); }

/* ==========================================================================
   HIGH-DENSITY LAYOUT OVERRIDES (MOCK LAB FEATURE)
   ========================================================================== */

body.density-compact {
  --card-padding: 0.75rem;
  --card-gap: 0.75rem;
}

body.density-compact .main-viewport {
  padding: 1rem;
}

body.density-compact h2 {
  font-size: 1.25rem;
}

body.density-compact .glass-panel {
  border-radius: 12px;
}

/* ==========================================================================
   MEDIA QUERIES - RESPONSIVE LAYOUTS
   ========================================================================== */

/* Tablets & Small Laptops */
@media (max-width: 1100px) {
  .cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .col-span-2 {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .system-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }
  .header-telemetry {
    width: 100%;
    justify-content: space-between;
  }
  .workspace-body {
    flex-direction: column;
    overflow: visible;
  }
  .sidebar-nav {
    width: 100%;
  }
  .nav-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.8rem;
    padding-left: 24px;
    padding-right: 24px;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent);
    scrollbar-width: none; /* Firefox */
  }
  .nav-list::-webkit-scrollbar {
    display: none;
  }
  .nav-tab {
    flex-shrink: 0;
    width: auto;
    padding: 0.75rem;
  }
  .main-viewport {
    overflow-y: visible;
  }
}

/* Mobile Devices */
@media (max-width: 768px) {
  .cols-3, .cols-2 {
    grid-template-columns: 1fr;
  }
  .col-span-2, .col-span-3 {
    grid-column: span 1;
  }
  .flex-layout {
    flex-direction: column;
  }
  .width-300 {
    width: 100%;
  }
  .kanban-board {
    grid-template-columns: 1fr;
  }
  .kanban-col {
    min-height: auto;
  }
  .system-footer {
    flex-direction: column;
    padding: 1rem;
  }
  .options-row {
    grid-template-columns: 1fr;
  }
  .card-navigator-btn {
    font-size: 0.95rem;
    padding: 0.4rem 0.8rem;
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ==========================================================================
   ACCESSIBILITY: REDUCED MOTION PREFERENCE
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-delay: 0s !important;
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
  .radar-sweep, .pulse-indicator::after, .connection-line.pulse-active {
    animation: none !important;
  }
}

/* Retrace Family Footer Custom Variables */
.family-footer {
  --line: rgba(167, 255, 92, 0.25);
  --muted: #b6c9a7;
  --lime: #9bef7f;
  --soft: #d8e1de;
  --text: #f3ffe8;
  --max: 1568px;
}

.family-footer .family-footer__inner {
  width: min(var(--max), calc(100% - 2rem));
}

/* ==========================================================================
   CUSTOM SOLARPUNK SCROLLBARS
   ========================================================================== */

/* Firefox scrollbars formatting */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 255, 92, 0.22) var(--bg-primary);
}

/* Webkit scrollbars formatting (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb {
  background: rgba(167, 255, 92, 0.22);
  border: 2px solid var(--bg-primary);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ==========================================================================
   WELCOME OVERLAY / ENTRY NOTICE STYLING
   ========================================================================== */

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999; /* overlay above everything */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 3, 2, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.welcome-overlay.active {
  opacity: 1;
  visibility: visible;
}

.welcome-card {
  width: min(560px, 92vw);
  border: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(6, 16, 10, 0.95), rgba(2, 4, 3, 0.98));
  box-shadow: 0 0 100px rgba(92, 255, 130, 0.16), inset 0 0 60px rgba(167, 255, 92, 0.05);
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.welcome-overlay.active .welcome-card {
  transform: scale(1) translateY(0);
}

.welcome-card h2 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  line-height: 1.1;
  margin: 10px 0 20px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text-main);
  font-family: var(--font-serif);
}

.welcome-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 16px;
}

.welcome-card p.highlight-text {
  color: var(--text-secondary);
  font-weight: 500;
  border-top: 1px dashed rgba(167, 255, 92, 0.25);
  border-bottom: 1px dashed rgba(167, 255, 92, 0.25);
  padding: 12px 0;
  margin: 20px 0;
}

.welcome-card p.kbd-tip {
  font-size: 0.82rem;
  color: var(--text-dim);
  opacity: 0.85;
  margin-bottom: 28px;
}

.welcome-card kbd {
  background: rgba(167, 255, 92, 0.12);
  border: 1px solid rgba(167, 255, 92, 0.35);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.welcome-card .eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.overlay-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

@media (min-width: 480px) {
  .overlay-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }
}

.welcome-card .btn {
  border: 1px solid var(--border-color);
  background: rgba(167, 255, 92, 0.1);
  color: var(--text-main);
  padding: 13px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.welcome-card .btn:hover {
  background: rgba(167, 255, 92, 0.22);
  box-shadow: 0 0 24px rgba(167, 255, 92, 0.18);
  border-color: var(--text-secondary);
}

.welcome-card .btn.primary {
  background: linear-gradient(90deg, rgba(167, 255, 92, 0.35), rgba(127, 255, 233, 0.18));
}

/* ==========================================================================
   SKELETON SCANNING OVERLAY
   ========================================================================== */

.glass-panel.scanning-active {
  position: relative;
  pointer-events: none;
}

.glass-panel.scanning-active .card-body {
  opacity: 0.12 !important;
  transition: opacity 0.3s ease;
}

.glass-panel.scanning-active::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  margin-left: -24px;
  border: 3px solid rgba(167, 255, 92, 0.15);
  border-top-color: var(--text-secondary);
  border-radius: 50%;
  animation: spin 0.8s infinite linear;
  z-index: 5;
}

.glass-panel.scanning-active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(167, 255, 92, 0.06), transparent);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite linear;
  pointer-events: none;
  z-index: 4;
  border-radius: inherit;
}

@keyframes skeletonShimmer {
  0% { background-position: -150% 0; }
  100% { background-position: 150% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


