/* ==========================================================================
   VISITOR TELEMETRY & DIGITAL FOOTPRINT SHOWCASE - CSS
   Matching kumstat.com design system with cyber-glassmorphism
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-header: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Dark Theme (Default) */
  --bg-color: #06060c;
  --bg-secondary: #0b0b14;
  --text-color: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-primary: #38bdf8; /* Cyan / Sky */
  --accent-secondary: #a855f7; /* Purple */
  --accent-tertiary: #10b981; /* Emerald */
  --accent-warning: #f59e0b; /* Amber */
  --accent-danger: #ef4444; /* Rose */

  --accent-glow: rgba(56, 189, 248, 0.18);
  --accent-glow-sec: rgba(168, 85, 247, 0.18);
  
  --card-bg: rgba(15, 23, 42, 0.45);
  --card-bg-hover: rgba(15, 23, 42, 0.65);
  --card-border: rgba(56, 189, 248, 0.14);
  --card-border-hover: rgba(168, 85, 247, 0.35);
  --card-inner-bg: rgba(2, 6, 23, 0.4);

  --badge-bg: rgba(56, 189, 248, 0.1);
  --badge-border: rgba(56, 189, 248, 0.2);
  --badge-text: #38bdf8;

  --nav-bg: rgba(6, 6, 12, 0.85);
  --map-filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.15);

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;

  --transition-fast: 0.2s ease;
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Overrides */
:root[data-theme="light"] {
  --bg-color: #f8fafc;
  --bg-secondary: #f1f5f9;
  --text-color: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --accent-primary: #0284c7;
  --accent-secondary: #7c3aed;
  --accent-tertiary: #059669;
  --accent-warning: #d97706;
  --accent-danger: #dc2626;

  --accent-glow: rgba(2, 132, 199, 0.12);
  --accent-glow-sec: rgba(124, 58, 237, 0.1);

  --card-bg: rgba(255, 255, 255, 0.8);
  --card-bg-hover: rgba(255, 255, 255, 0.95);
  --card-border: rgba(148, 163, 184, 0.25);
  --card-border-hover: rgba(2, 132, 199, 0.4);
  --card-inner-bg: rgba(241, 245, 249, 0.6);

  --badge-bg: rgba(2, 132, 199, 0.08);
  --badge-border: rgba(2, 132, 199, 0.2);
  --badge-text: #0284c7;

  --nav-bg: rgba(248, 250, 252, 0.9);
  --map-filter: none;

  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.09);
  --shadow-glow: 0 0 25px rgba(2, 132, 199, 0.12);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
}

/* Background Gradients & Ambient Glow */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  transition: transform 0.5s ease-out;
}

.blob-1 {
  top: -10%;
  left: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
}

.blob-2 {
  top: 40%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
}

.blob-3 {
  bottom: -15%;
  left: 20%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, var(--accent-tertiary) 0%, transparent 70%);
  opacity: 0.25;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(var(--card-border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--card-border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

/* Container */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Header & Top Bar */
.top-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--card-border);
  padding: 0.85rem 0;
  margin-bottom: 2rem;
  transition: all var(--transition-normal);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-color);
}

.nav-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-md);
  background: var(--card-inner-bg);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.nav-back-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: var(--card-bg-hover);
  transform: translateX(-2px);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  background: var(--card-inner-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-color);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.live-pill.is-offline {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.08);
}

.live-pill-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.live-last-seen {
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-tertiary);
  box-shadow: 0 0 10px var(--accent-tertiary);
  animation: pulse-glow 2s infinite;
  flex-shrink: 0;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.pulse-dot.offline {
  background-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
  animation: none;
}

.pulse-dot.reconnecting {
  background-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
  animation: pulse-glow 0.6s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px var(--accent-tertiary); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Theme Toggle Button (Circular & Sleek matching kumstat.com) */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-inner-bg);
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  padding: 0;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--card-bg-hover);
  border-color: var(--accent-primary);
  transform: scale(1.08);
  box-shadow: 0 0 14px var(--accent-glow);
}

.theme-toggle svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

/* In Dark Mode: Show Amber Sun */
:root:not([data-theme="light"]) .theme-toggle .theme-icon-sun {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
  color: #f59e0b;
}
:root:not([data-theme="light"]) .theme-toggle .theme-icon-moon {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4) rotate(-90deg);
  pointer-events: none;
}

/* In Light Mode: Show Lavender Moon */
:root[data-theme="light"] .theme-toggle .theme-icon-sun {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4) rotate(90deg);
  pointer-events: none;
}
:root[data-theme="light"] .theme-toggle .theme-icon-moon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
  color: #7c3aed;
}

/* Hero Banner / Digital Footprint Score */
.hero-banner {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
}

.hero-content h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text-color), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 620px;
}

.hero-stats {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.hero-stat-card {
  background: var(--card-inner-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  min-width: 125px;
  text-align: center;
  transition: transform var(--transition-fast);
}

.hero-stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }

/* Cards Styling */
.telemetry-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all var(--transition-normal);
}

.telemetry-card:hover {
  border-color: var(--card-border-hover);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--badge-bg);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--accent-tertiary);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--accent-warning);
}

/* Info Row Lists */
.info-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.85rem;
  background: var(--card-inner-bg);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.info-row:hover {
  border-color: var(--card-border);
  background: var(--card-bg-hover);
}

.info-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.info-value {
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-color);
  text-align: right;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition-fast);
  font-size: 0.75rem;
}

.copy-btn:hover {
  color: var(--accent-primary);
  background: var(--card-bg);
}

/* Tactical Map Mode Switcher */
.map-view-switcher {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-top: 1rem;
  background: var(--card-inner-bg);
  border: 1px solid var(--card-border);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  width: 100%;
  box-sizing: border-box;
}

.map-mode-btn {
  min-width: 0;
  padding: 0.4rem 0.2rem;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-mode-btn:hover {
  color: var(--text-color);
  background: var(--card-bg);
}

.map-mode-btn.active {
  background: var(--card-bg);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Interactive Map & 3D Globe Section */
.map-stage-wrapper {
  position: relative;
  width: 100%;
  margin-top: 0.65rem;
}

.map-container {
  height: 380px;
  min-height: 340px;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--card-border);
  position: relative;
  z-index: 10;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.25);
}

.globe-canvas {
  height: 380px;
  min-height: 340px;
  width: 100%;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at center, #0a1128 0%, #030712 85%);
  border: 1px solid var(--accent-primary);
  display: block;
  cursor: grab !important;
  box-shadow: 0 0 25px var(--accent-glow);
}

.globe-canvas:active {
  cursor: grabbing !important;
}

/* Enforce moving grab hand on entire map */
.leaflet-container,
.leaflet-container .leaflet-pane,
.leaflet-container .leaflet-tile-pane,
.leaflet-container .leaflet-tile-container,
.leaflet-grab,
.leaflet-touch .leaflet-grab {
  cursor: grab !important;
}

.leaflet-container:active,
.leaflet-container .leaflet-pane:active,
.leaflet-dragging .leaflet-grab,
.leaflet-grab:active {
  cursor: grabbing !important;
}

.map-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.action-btn {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
  background: var(--card-inner-bg);
  border: 1px solid var(--card-border);
  color: var(--text-color);
}

.action-btn:hover {
  background: var(--card-bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.action-btn.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.action-btn.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* Weather Component & Location Banner */
.weather-location-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-inner-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.weather-location-text {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-color);
}

.weather-location-text svg {
  color: var(--accent-primary);
}

.weather-station-tag {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--card-bg);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}

.weather-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(168, 85, 247, 0.12));
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.weather-temp-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.weather-big-icon {
  font-size: 3rem;
  line-height: 1;
}

.weather-temp {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
  color: var(--text-color);
}

.weather-condition {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

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

.weather-subcard {
  background: var(--card-inner-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.weather-subcard-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.weather-subcard-val {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-primary);
}

/* 5-Day Weather Forecast Component */
.weather-forecast-container {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--card-border);
}

.weather-forecast-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
}

.forecast-cards-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
}

.forecast-card {
  background: var(--card-inner-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  transition: all var(--transition-fast);
}

.forecast-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  background: var(--card-bg-hover);
}

.forecast-day {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-color);
  text-transform: uppercase;
}

.forecast-icon {
  font-size: 1.35rem;
  line-height: 1;
  margin: 0.1rem 0;
}

.forecast-temps {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.forecast-temp-max {
  font-size: 0.82rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-color);
}

.forecast-temp-min {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.forecast-rain {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  margin-top: 0.1rem;
}

.forecast-card-skeleton {
  grid-column: span 5;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 1rem;
}

/* Battery & Gauge Meters */
.battery-visual-container {
  margin: 1rem 0;
}

.battery-case {
  width: 100%;
  height: 26px;
  background: var(--card-inner-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-sm);
  position: relative;
  padding: 3px;
  display: flex;
}

.battery-case::after {
  content: '';
  position: absolute;
  right: -7px;
  top: 6px;
  width: 4px;
  height: 10px;
  background: var(--card-border);
  border-radius: 0 2px 2px 0;
}

.battery-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-tertiary), var(--accent-primary));
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease;
}

.battery-fill.low {
  background: linear-gradient(90deg, var(--accent-danger), var(--accent-warning));
}

.battery-fill.charging {
  animation: charging-pulse 1.5s infinite alternate;
}

@keyframes charging-pulse {
  from { opacity: 0.8; filter: brightness(1); }
  to { opacity: 1; filter: brightness(1.3); }
}

/* Mobile 3D Gyroscope & Compass Dual Stage */
.sensors-dual-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.gyro-stage-box, .compass-stage-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card-inner-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1rem 0.5rem;
  min-height: 210px;
}

.sensor-sub-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 0.6rem;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Compass Widget */
.compass-widget {
  width: 120px;
  height: 120px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compass-dial {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, rgba(10, 17, 40, 0.6) 80%);
  position: relative;
  transition: transform 0.12s ease-out;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.12), inset 0 0 10px rgba(0, 0, 0, 0.4);
}

:root[data-theme="light"] .compass-dial {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, rgba(241, 245, 249, 0.8) 80%);
}

.compass-letter {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  transform: translate(-50%, -50%);
}

.letter-n { top: 12px; left: 50%; color: #ef4444; }
.letter-e { top: 50%; right: 4px; transform: translate(50%, -50%); color: var(--text-muted); }
.letter-s { bottom: 3px; left: 50%; color: var(--text-muted); }
.letter-w { top: 50%; left: 12px; color: var(--text-muted); }

.compass-needle-pointer {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 68px;
  margin-left: -2px;
  margin-top: -34px;
  background: linear-gradient(to bottom, #ef4444 50%, #64748b 50%);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.compass-pivot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  margin-top: -5px;
  background: #ffffff;
  border: 2px solid #0f172a;
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-primary);
}

.compass-heading-display {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.compass-deg {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-primary);
}

.compass-cardinal {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-color);
}

.gyro-stage {
  perspective: 900px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.25rem;
  height: 140px;
}

.gyro-device {
  width: 95px;
  height: 135px;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 2px solid var(--accent-primary);
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  transition: transform 0.08s ease-out;
}

:root[data-theme="light"] .gyro-device {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.9));
}

.gyro-screen {
  width: 80px;
  height: 110px;
  background: var(--card-inner-bg);
  border-radius: 10px;
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.gyro-notch {
  width: 24px;
  height: 4px;
  background: var(--card-border);
  border-radius: var(--radius-full);
  position: absolute;
  top: 5px;
}

.gyro-crosshair {
  width: 100%;
  height: 100%;
  position: absolute;
  background:
    linear-gradient(to right, transparent 49%, var(--card-border) 50%, transparent 51%),
    linear-gradient(to bottom, transparent 49%, var(--card-border) 50%, transparent 51%);
  opacity: 0.3;
}

.gyro-ball {
  width: 16px;
  height: 16px;
  background: radial-gradient(circle at 30% 30%, #38bdf8, #0284c7);
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-primary);
  position: absolute;
  transition: transform 0.05s ease-out;
}

.gyro-grid-values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}

.gyro-val-box {
  background: var(--card-inner-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.4rem;
  text-align: center;
}

.gyro-axis {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.gyro-deg {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-primary);
}

/* Compact Export Button in Header */
.action-btn-compact {
  padding: 0.35rem 0.65rem;
}

/* Audio Frequency / Sound Check */
.audio-tester-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--card-inner-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  margin-top: 0.75rem;
}

.audio-waves {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 26px;
}

.wave-bar {
  width: 4px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 2px;
  transition: height 0.15s ease;
}

.audio-waves.playing .wave-bar:nth-child(1) { animation: wave-anim 0.6s infinite ease-in-out 0.1s; }
.audio-waves.playing .wave-bar:nth-child(2) { animation: wave-anim 0.6s infinite ease-in-out 0.25s; }
.audio-waves.playing .wave-bar:nth-child(3) { animation: wave-anim 0.6s infinite ease-in-out 0.15s; }
.audio-waves.playing .wave-bar:nth-child(4) { animation: wave-anim 0.6s infinite ease-in-out 0.35s; }
.audio-waves.playing .wave-bar:nth-child(5) { animation: wave-anim 0.6s infinite ease-in-out 0.05s; }

@keyframes wave-anim {
  0%, 100% { height: 6px; }
  50% { height: 24px; }
}

/* Privacy & Fingerprint Signals */
.privacy-badge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.privacy-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  background: var(--card-inner-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
}

.privacy-pill-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-active { background-color: var(--accent-tertiary); box-shadow: 0 0 8px var(--accent-tertiary); }
.status-inactive { background-color: var(--text-dim); }
.status-alert { background-color: var(--accent-warning); box-shadow: 0 0 8px var(--accent-warning); }

.privacy-pill-text {
  font-size: 0.8rem;
  font-weight: 600;
}

/* Real-time FPS Meter */
.fps-counter {
  font-size: 1.85rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}

.fps-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Explanatory Callout */
.tech-explainer {
  background: rgba(56, 189, 248, 0.06);
  border-left: 3px solid var(--accent-primary);
  padding: 0.75rem 0.9rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--accent-primary);
  color: var(--text-color);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* Clean Centered Footer */
footer {
  border-top: 1px solid var(--card-border);
  padding: 2.5rem 0;
  margin-top: 3.5rem;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.footer-inner-clean {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .col-8, .col-7, .col-6, .col-5, .col-4 {
    grid-column: span 12;
  }

  .hero-banner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-stats {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }

  .top-header .header-inner {
    gap: 0.5rem;
  }

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

  .brand-text span {
    display: none;
  }

  .header-actions {
    gap: 0.4rem;
  }

  .header-actions .live-pill {
    display: inline-flex !important;
    padding: 0.28rem 0.55rem;
    font-size: 0.68rem;
    gap: 0.35rem;
  }

  .action-btn-compact .btn-text {
    display: none;
  }

  .action-btn-compact {
    padding: 0.35rem 0.45rem;
  }

  .hero-content h2 {
    font-size: 1.4rem;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
  }

  .hero-stat-card {
    min-width: unset;
  }

  .privacy-badge-grid {
    grid-template-columns: 1fr;
  }

  .weather-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .map-view-switcher {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 420px) {
  .sensors-dual-stage {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   WebGL GPU Profiler & 3D Cyber Canvas (M5)
   ========================================================================== */
.gpu-profiler-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  align-items: stretch;
}

.gpu-info-pane,
.gpu-canvas-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Deep WebGL Specs Drawer */
.gpu-specs-drawer {
  background: var(--card-inner-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.gpu-specs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: 0.02em;
}

.gpu-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 0.85rem;
}

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

.gpu-spec-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gpu-spec-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3D WebGL Canvas Stage */
.gpu-stage-container {
  position: relative;
  background: radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.webgl-cube-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

.webgl-cube-canvas:active {
  cursor: grabbing;
}

.gpu-hud-overlay {
  position: absolute;
  top: 0.6rem;
  left: 0.75rem;
  display: flex;
  gap: 0.75rem;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.55rem;
}

.gpu-hud-kpi {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}

.gpu-hud-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  color: #38bdf8;
}

.gpu-hud-lbl {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.gpu-canvas-toolbar {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  right: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  pointer-events: auto;
}

.gpu-mode-pills {
  display: flex;
  gap: 0.25rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full, 999px);
  padding: 0.2rem;
}

.gpu-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full, 999px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gpu-mode-btn:hover {
  color: var(--text-color);
}

.gpu-mode-btn.active {
  background: var(--accent-primary);
  color: #0f172a;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.gpu-bench-btn {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid var(--accent-tertiary);
  color: var(--accent-tertiary);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full, 999px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.gpu-bench-btn:hover {
  background: var(--accent-tertiary);
  color: #0f172a;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.5);
}

.gpu-bench-btn.active-stress {
  background: #f43f5e;
  border-color: #f43f5e;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.6);
}

@media (max-width: 900px) {
  .gpu-profiler-layout {
    grid-template-columns: 1fr;
  }
  .gpu-specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
