/* ==========================================================================
   Saudi Weather & Radar Unified Portal - Master Glassmorphism Design System
   Architecture: PWA, Hardware Accelerated, Dark Mode First, RTL Native
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-core: #060911;
  --bg-primary: var(--bg-core);
  --bg-glass-base: rgba(11, 19, 38, 0.75);
  --bg-glass-elevated: rgba(18, 29, 56, 0.85);
  --bg-glass-card: rgba(15, 23, 42, 0.65);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-bright: rgba(0, 242, 254, 0.35);
  
  /* Luminous Accents */
  --accent-cyan: #00f2fe;
  --accent-cyan-rgb: 0, 242, 254;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-crimson: #ef4444;
  --accent-purple: #8b5cf6;
  --accent-tactical: #00ff66;

  /* Typography */
  --font-arabic: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Cairo", "Tajawal", "Noto Sans Arabic", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Shadows & Glows */
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
  --cyan-glow: 0 0 20px rgba(0, 242, 254, 0.4);
  --tactical-glow: 0 0 20px rgba(0, 255, 102, 0.35);
  --purple-glow: 0 0 20px rgba(139, 92, 246, 0.4);

  /* Animation Timings */
  --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-capsule: 9999px;
  --radius-card: 16px;
  --radius-button: 12px;
}

/* ==========================================================================
   Reset & Base Standards
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-core);
  color: var(--text-main);
  font-family: var(--font-arabic);
  direction: rtl;
  text-align: right;
  line-height: 1.5;
  touch-action: manipulation;
}

/* ==========================================================================
   Master App Shell Grid
   ========================================================================== */
#app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, #0d1a33 0%, var(--bg-core) 80%);
}

/* ==========================================================================
   Top Glassmorphic Navigation Bar
   ========================================================================== */
.portal-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.85) 0%, rgba(7, 11, 20, 0.4) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* Brand Meta (Title & AST Live Clock) */
.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.radar-live-badge {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-live-badge .pulse-core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.radar-live-badge .pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1.5px solid var(--accent-cyan);
  animation: radarRipple 2.2s infinite ease-out;
  opacity: 0;
}

@keyframes radarRipple {
  0% { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

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

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title .ksa-tag {
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 1px 7px;
  border-radius: var(--radius-capsule);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-subtitle .ast-clock {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Center Glass Navigation Switcher */
.nav-switcher-wrapper {
  flex: 1;
  max-width: 640px;
  display: flex;
  justify-content: center;
}

.nav-switcher-bar {
  position: relative;
  display: flex;
  align-items: center;
  padding: 4px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-capsule);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.nav-tab-btn {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  font-family: var(--font-arabic);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-capsule);
  transition: color 0.25s var(--transition-smooth), transform 0.2s;
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: #ffffff;
}

.nav-tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.22) 0%, rgba(59, 130, 246, 0.28) 100%);
  border: 1px solid rgba(0, 242, 254, 0.4);
  box-shadow: var(--cyan-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-tab-btn .tab-icon {
  font-size: 1.05rem;
  line-height: 1;
}

/* Header Action Controls (PWA, Fullscreen, Layers, Settings) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-button);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.25s var(--transition-smooth);
}

.header-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.header-btn.btn-pwa-install {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.35) 100%);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.header-btn.btn-pwa-install:hover {
  background: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   Main Viewport Container
   ========================================================================== */
#portal-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.portal-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.portal-view.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 10;
}

/* ==========================================================================
   View 1: Saudi Sovereign Radar & Satellite Clouds
   ========================================================================== */
#view-saudi-radar {
  background: #060913;
}

.view-saudi-radar-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Map Canvas Canvas Backdrop Simulation */
#saudi-radar-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Floating Layer Selector Bar (Top Left) */
.layer-selector-dock {
  position: absolute;
  top: calc(max(10px, env(safe-area-inset-top)) + 58px);
  right: 18px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(11, 19, 38, 0.75);
  backdrop-filter: blur(20px);
  padding: 8px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-glass);
  box-shadow: var(--glass-shadow);
}

.layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.layer-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.layer-item.active {
  background: rgba(0, 242, 254, 0.12);
  border-color: rgba(0, 242, 254, 0.3);
  color: #ffffff;
}

.layer-item .layer-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.layer-item.active .layer-badge {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

/* Radar Telemetry & dBZ Legend (Top Right in RTL = Left side of screen) */
.telemetry-hud-dock {
  position: absolute;
  top: calc(max(10px, env(safe-area-inset-top)) + 58px);
  left: 18px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.telemetry-card {
  pointer-events: auto;
  background: rgba(11, 19, 38, 0.75);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-card);
  padding: 10px 14px;
  box-shadow: var(--glass-shadow);
  min-width: 170px;
}

.telemetry-header {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dbz-gradient-bar {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, 
    #00ffcc 0%, 
    #00bfff 20%, 
    #ffff00 40%, 
    #ff8000 60%, 
    #ff0000 80%, 
    #cc00ff 100%
  );
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.2);
  margin-bottom: 4px;
}

.dbz-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.64rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.lightning-counter-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
}

.lightning-counter-box .strike-val {
  font-family: var(--font-mono);
  color: #fbbf24;
  font-size: 1rem;
}

/* ==========================================================================
   View 2: Windy Style WebGL Wind Streamlines & Models
   ========================================================================== */
#view-windy-models {
  background: #030712;
}

#windy-particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.models-control-dock {
  position: absolute;
  top: calc(max(10px, env(safe-area-inset-top)) + 58px);
  right: 18px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(11, 19, 38, 0.75);
  backdrop-filter: blur(20px);
  padding: 10px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-glass);
}

.model-pill-group {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: var(--radius-capsule);
}

.model-pill {
  padding: 4px 10px;
  border-radius: var(--radius-capsule);
  font-size: 0.72rem;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.model-pill.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4) 0%, rgba(99, 102, 241, 0.5) 100%);
  color: #ffffff;
  border: 1px solid rgba(139, 92, 246, 0.5);
  box-shadow: var(--purple-glow);
}

.wind-probe-card {
  position: absolute;
  top: calc(max(10px, env(safe-area-inset-top)) + 58px);
  left: 18px;
  z-index: 50;
  background: rgba(11, 19, 38, 0.75);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-card);
  padding: 10px 14px;
  min-width: 160px;
}

/* ==========================================================================
   View 3: Dark Tactical Doppler Sweep Radar
   ========================================================================== */
#view-doppler-tactical {
  background: #020704;
}

#tactical-radar-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.tactical-hud-dock {
  position: absolute;
  top: calc(max(10px, env(safe-area-inset-top)) + 58px);
  right: 18px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(2, 26, 13, 0.85);
  border: 1px solid rgba(0, 255, 102, 0.3);
  border-radius: var(--radius-card);
  padding: 12px;
  box-shadow: var(--tactical-glow);
}

.tactical-hud-title {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--accent-tactical);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.station-select {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(0, 255, 102, 0.4);
  color: var(--accent-tactical);
  font-family: var(--font-arabic);
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}

/* ==========================================================================
   Responsive Bottom Timeline Scrubber Dock
   ========================================================================== */
.timeline-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 10px 20px max(14px, env(safe-area-inset-bottom)) 20px;
  background: linear-gradient(0deg, rgba(7, 11, 20, 0.95) 0%, rgba(7, 11, 20, 0.8) 75%, rgba(7, 11, 20, 0) 100%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-glass);
}

/* Timeline Info Bar (Time display & mode indicator) */
.timeline-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.timeline-time-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.current-frame-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-capsule);
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: var(--accent-cyan);
}

.current-frame-badge.forecast-mode {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: #c084fc;
}

.timestamp-formatted {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  font-family: var(--font-arabic);
}

.timestamp-relative {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Center Scrubber Controls (Transport Buttons) */
.timeline-transport-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transport-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--transition-smooth);
}

.transport-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.transport-btn.btn-play-pause {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.3) 0%, rgba(59, 130, 246, 0.4) 100%);
  border: 1.5px solid var(--accent-cyan);
  box-shadow: var(--cyan-glow);
}

.transport-btn.btn-play-pause:hover {
  transform: scale(1.08);
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.6);
}

.transport-btn.btn-speed {
  width: auto;
  padding: 0 10px;
  border-radius: var(--radius-capsule);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
}

.btn-jump-now {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  height: 34px;
  border-radius: var(--radius-capsule);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-jump-now:hover {
  background: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.btn-jump-now .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulseBeacon 1.4s infinite;
}

@keyframes pulseBeacon {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
  100% { transform: scale(0.9); opacity: 1; }
}

/* ==========================================================================
   Scrubber Track & Bar (Past 2h -> NOW -> Forecast 48h)
   ========================================================================== */
.scrubber-track-container {
  position: relative;
  width: 100%;
  padding: 10px 0;
  cursor: pointer;
}

.scrubber-bar-bg {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
}

/* Past Section (First 35% of width) */
.track-segment-past {
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 242, 254, 0.2) 0%, rgba(16, 185, 129, 0.4) 100%);
  border-left: 1px dashed rgba(255, 255, 255, 0.2);
}

/* Forecast Section (Remaining 65% of width) */
.track-segment-forecast {
  width: 65%;
  height: 100%;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
}

/* Progress Fill Bar */
.scrubber-progress-fill {
  position: absolute;
  top: 0;
  right: 0; /* In RTL, right is starting point */
  height: 100%;
  background: linear-gradient(270deg, rgba(0, 242, 254, 0.6) 0%, rgba(59, 130, 246, 0.7) 100%);
  pointer-events: none;
  transition: width 0.08s linear;
}

/* NOW Marker Beacon on track */
.scrubber-now-beacon {
  position: absolute;
  right: 35%; /* Fixed at separator */
  top: 50%;
  transform: translate(50%, -50%);
  width: 12px;
  height: 18px;
  background: #ef4444;
  border-radius: 2px;
  box-shadow: 0 0 10px #ef4444;
  z-index: 5;
  pointer-events: none;
}

.scrubber-now-beacon::after {
  content: 'الآن';
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: #ef4444;
  white-space: nowrap;
}

/* Floating Scrubber Thumb */
.scrubber-thumb {
  position: absolute;
  top: 50%;
  right: 0%; /* Dynamic via JS */
  transform: translate(50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--accent-cyan);
  box-shadow: var(--cyan-glow), 0 2px 8px rgba(0, 0, 0, 0.6);
  z-index: 10;
  pointer-events: none;
  transition: transform 0.1s ease;
}

.scrubber-track-container:hover .scrubber-thumb {
  transform: translate(50%, -50%) scale(1.2);
}

/* Track Axis Ticks & Time Markers */
.scrubber-axis-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 4px;
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--font-arabic);
}

.scrubber-axis-labels .axis-past {
  color: #34d399;
}

.scrubber-axis-labels .axis-now {
  color: #f87171;
  font-weight: 700;
}

.scrubber-axis-labels .axis-forecast {
  color: #a78bfa;
}

/* ==========================================================================
   Information & PWA Guide Drawer Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 15, 0.8);
  backdrop-filter: blur(16px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--transition-smooth);
}

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

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 12px;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.btn-close-modal {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-instruction-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-cyan);
  color: #000;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================================================
   Mobile & Responsive Adjustments
   ========================================================================== */
@media (max-width: 900px) {
  .portal-header {
    flex-wrap: wrap;
    padding: max(8px, env(safe-area-inset-top)) 10px 8px 10px;
    gap: 8px;
  }
  
  .brand-container {
    order: 1;
  }

  .header-actions {
    order: 2;
  }

  .nav-switcher-wrapper {
    order: 3;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-switcher-bar {
    width: 100%;
    justify-content: space-between;
  }

  .nav-tab-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .timeline-dock {
    padding: 8px 12px max(10px, env(safe-area-inset-bottom)) 12px;
  }

  .timeline-meta-bar {
    flex-wrap: wrap;
    gap: 6px;
  }

  .telemetry-hud-dock, .layer-selector-dock {
    top: calc(max(8px, env(safe-area-inset-top)) + 105px);
  }
}

@media (max-width: 768px) {
  .portal-header {
    padding: max(6px, env(safe-area-inset-top)) 8px 6px 8px;
  }
  .brand-title {
    font-size: 0.95rem;
  }
  .layer-selector-dock {
    max-width: calc(100vw - 20px);
  }
  .telemetry-hud-dock {
    max-width: calc(100vw - 20px);
  }
}

@media (max-width: 480px) {
  .portal-header {
    padding: max(4px, env(safe-area-inset-top)) 6px 4px 6px;
  }
  .brand-title {
    font-size: 0.85rem;
  }
  .nav-tab-btn {
    padding: 5px 8px;
    font-size: 0.72rem;
  }
  .timeline-btn {
    width: 32px;
    height: 32px;
  }
}

