/* RTL Support */
[dir="rtl"] { direction: rtl; text-align: right; }
[dir="rtl"] .header-left { float: right; }
[dir="rtl"] .header-right { float: left; }
[dir="rtl"] .step-indicator { flex-direction: row-reverse; }
[dir="rtl"] .mobile-step-nav { flex-direction: row-reverse; }

/* ===================================================
   WindAlgeria H2 & NH3 — Premium UI Design System
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;700&display=swap');

/* ── PWA / Desktop app overrides ── */
@media(display-mode:standalone){
  body{padding-top:32px;cursor:default;user-select:none}
  body::before{content:'';position:fixed;top:0;left:0;right:0;height:32px;background:var(--bg-deep);z-index:9999;-webkit-app-region:drag}
  .app{margin-top:0}
  input,textarea,select,[contenteditable],.btn,.btn-icon,.btn-primary,.btn-secondary,.btn-ghost,.btn-ghost-danger,.theme-btn{-webkit-app-region:no-drag}
  ::-webkit-scrollbar{width:8px}
  a{cursor:pointer}
  button{cursor:default}
  button:hover{cursor:pointer}
}

/* ── Custom Scrollbar (Windows 11 style) ── */
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border-mid);border-radius:3px}
::-webkit-scrollbar-thumb:hover{background:var(--border-bright)}

/* ── Text selection ── */
::selection{background:rgba(13,152,186,.25);color:var(--text-primary)}

/* ── Root Design Tokens — Dark Theme (default) ── */
:root, html[data-theme="dark"] {
  --bg-deep:        #0d1a20;
  --bg-surface:     #12242b;
  --bg-elevated:    #1a2d36;
  --bg-card:        rgba(26, 45, 54, 0.55);
  --bg-card-hover:  rgba(32, 54, 65, 0.75);
  --bg-glass:       rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.07);
  --bg-input:       rgba(0, 0, 0, 0.25);

  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-mid:     rgba(255, 255, 255, 0.12);
  --border-bright:  rgba(255, 255, 255, 0.22);

  --wind:           #0D98BA;
  --wind-dim:       #0a7a96;
  --wind-glow:      rgba(13, 152, 186, 0.20);
  --wind-glow-sm:   rgba(13, 152, 186, 0.10);

  --h2:             #2ECC71;
  --h2-dim:         #25a05a;
  --h2-glow:        rgba(46, 204, 113, 0.18);
  --h2-glow-sm:     rgba(46, 204, 113, 0.10);

  --nh3:            #E8833A;
  --nh3-dim:        #cc6a2e;
  --nh3-glow:       rgba(232, 131, 58, 0.18);
  --nh3-glow-sm:    rgba(232, 131, 58, 0.10);

  --energy:         #F59E0B;
  --energy-dim:     #d4880a;
  --energy-glow:    rgba(245, 158, 11, 0.18);
  --energy-glow-sm: rgba(245, 158, 11, 0.10);

  --solar:          #ff6b35;
  --solar-glow:     rgba(255, 107, 53, 0.18);

  --text-primary:   #f0f6ff;
  --text-secondary: #8ba4c8;
  --text-tertiary:  #4e6a8f;
  --text-accent-w:  var(--wind);
  --text-accent-h:  var(--h2);
  --text-accent-n:  var(--nh3);

  --shadow-card:    0 8px 40px -6px rgba(0, 0, 0, 0.55);
  --shadow-glow-w:  0 0 30px rgba(13, 152, 186, 0.22);
  --shadow-glow-h:  0 0 30px rgba(46, 204, 113, 0.22);
  --shadow-glow-n:  0 0 30px rgba(232, 131, 58, 0.22);
  --shadow-glow-e:  0 0 30px rgba(245, 158, 11, 0.22);

  --sidebar-width:  280px;
  --radius-xl:      24px;
  --radius-lg:      16px;
  --radius-md:      10px;
  --radius-sm:      6px;

  --ease:           cubic-bezier(0.4, 0, 0.2, 1);
  --trans:          all 0.3s var(--ease);
  --trans-fast:     all 0.15s var(--ease);

  --font-main:      'Outfit', sans-serif;
  --font-code:      'Space Grotesk', monospace;
}

/* ── Light Theme Override ── */
html[data-theme="light"] {
  --bg-deep:        #eaf0f2;
  --bg-surface:     #f0f6f8;
  --bg-elevated:    #ffffff;
  --bg-card:        rgba(255, 255, 255, 0.92);
  --bg-card-hover:  rgba(255, 255, 255, 1.00);
  --bg-glass:       rgba(0, 0, 0, 0.04);
  --bg-glass-hover: rgba(0, 0, 0, 0.07);
  --bg-input:       rgba(0, 0, 0, 0.08);

  --border-subtle:  rgba(0, 0, 0, 0.12);
  --border-mid:     rgba(0, 0, 0, 0.20);
  --border-bright:  rgba(0, 0, 0, 0.30);

  --wind:           #0D98BA;
  --wind-dim:       #0a7a96;
  --wind-glow:      rgba(13, 152, 186, 0.20);
  --wind-glow-sm:   rgba(13, 152, 186, 0.10);

  --h2:             #27AE60;
  --h2-dim:         #1e8b4c;
  --h2-glow:        rgba(39, 174, 96, 0.20);
  --h2-glow-sm:     rgba(39, 174, 96, 0.10);

  --nh3:            #D4783A;
  --nh3-dim:        #b06028;
  --nh3-glow:       rgba(212, 120, 58, 0.20);
  --nh3-glow-sm:    rgba(212, 120, 58, 0.10);

  --energy:         #D4880A;
  --energy-dim:     #b07008;
  --energy-glow:    rgba(212, 136, 10, 0.20);
  --energy-glow-sm: rgba(212, 136, 10, 0.10);

  --solar:          #cc5522;
  --solar-glow:     rgba(204, 85, 34, 0.20);

  --text-primary:   #000c1a;
  --text-secondary: #1f3a5c;
  --text-tertiary:  #4a6a8a;
  --text-accent-w:  var(--wind);
  --text-accent-h:  var(--h2);
  --text-accent-n:  var(--nh3);

  --shadow-card:    0 6px 32px -8px rgba(0, 20, 50, 0.18);
  --shadow-glow-w:  0 0 24px rgba(13, 152, 186, 0.15);
  --shadow-glow-h:  0 0 24px rgba(39, 174, 96, 0.15);
  --shadow-glow-n:  0 0 24px rgba(212, 120, 58, 0.15);
  --shadow-glow-e:  0 0 24px rgba(212, 136, 10, 0.15);

  --sidebar-width:  240px;
  --radius-xl:      20px;
  --radius-lg:      14px;
  --radius-md:      8px;
  --radius-sm:      5px;
}

/* ── Reset & Base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.3s var(--ease);
}
html[data-theme="light"] body {
  font-size: 14px;
}

/* ── Animated Aurora Background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 50% at 20% 0%, rgba(13, 152, 186, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 80% 100%, rgba(232, 131, 58, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 60% 40%, rgba(46, 204, 113, 0.07) 0%, transparent 50%);
  pointer-events: none;
  animation: aurora-shift 20s ease-in-out infinite alternate;
}
html[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 90% 50% at 20% 0%, rgba(13, 152, 186, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 80% 100%, rgba(232, 131, 58, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 60% 40%, rgba(46, 204, 113, 0.05) 0%, transparent 50%);
}

@keyframes aurora-shift {
  0%   { opacity: 1; transform: scale(1) rotate(0deg); }
  50%  { opacity: 0.7; transform: scale(1.05) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ── App Layout ── */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* ══════════════════════════════════
   SIDEBAR NAVIGATION
══════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(6, 12, 26, 0.80);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.4);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  height: 100vh;
  z-index: 200;
  transition: var(--trans);
  box-shadow: 4px 0 24px rgba(0, 30, 70, 0.08);
  padding: 0;
  overflow: hidden;
}
html[data-theme="light"] .sidebar {
  width: 240px;
  background: rgba(234, 240, 242, 0.90);
  box-shadow: 4px 0 24px rgba(0, 30, 70, 0.08);
}

/* Sidebar top gradient bar */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--wind), var(--h2), var(--nh3));
  z-index: 1;
}

/* Sidebar inner scroll container */
.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2rem 1.25rem 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Logo */
.logo-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2.75rem;
  padding: 0.25rem 0.5rem;
}

.logo-icon-wrap {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,212,255,0.25), rgba(0,255,179,0.25));
  border: 1px solid rgba(0, 212, 255, 0.35);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(0,212,255,0.20);
  flex-shrink: 0;
}

.logo-icon-wrap svg {
  color: var(--wind);
  animation: spin 10s linear infinite;
}

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

.logo-text-wrap { display: flex; flex-direction: column; }

.logo-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(125deg, var(--wind) 0%, var(--h2) 60%, var(--nh3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.logo-sub {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Nav section label */
.nav-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0.25rem 0.75rem;
  margin: 0.5rem 0 0.25rem;
}

/* Nav Links */
.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--trans);
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  border-radius: 0 4px 4px 0;
  transition: var(--trans);
}

.nav-link:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.nav-link.active {
  background: var(--bg-glass-hover);
  color: var(--wind);
  border-color: rgba(0, 212, 255, 0.18);
}

.nav-link.active::before { background: var(--wind); }

.nav-link.active.h2-active-link { color: var(--h2); border-color: rgba(0, 255, 179, 0.18); }
.nav-link.active.h2-active-link::before { background: var(--h2); }

.nav-link.active.nh3-active-link { color: var(--nh3); border-color: rgba(176, 109, 255, 0.18); }
.nav-link.active.nh3-active-link::before { background: var(--nh3); }

.nav-icon { flex-shrink: 0; width: 18px; height: 18px; }

.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(0,212,255,0.15);
  color: var(--wind);
  border: 1px solid rgba(0,212,255,0.25);
}

/* Station Quick Info */
.station-quick {
  margin: 1.5rem 0 0;
  padding: 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.station-quick-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-tertiary);
  margin-bottom: 0.6rem;
}

.station-quick-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--wind);
}

.station-quick-coords {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-family: var(--font-code);
}

/* Theme Toggle & Footer */
.sidebar-footer {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--trans);
}

.theme-toggle:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-mid);
  color: var(--text-primary);
}

/* ══════════════════════════════════
   MAIN CONTENT AREA
══════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Sticky Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 12, 26, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar-left { display: flex; flex-direction: column; gap: 2px; }

.topbar-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1;
}

.topbar-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.topbar-right { display: flex; align-items: center;   gap: 1rem;
}
html[data-theme="light"] .topbar {
  background: rgba(240, 246, 248, 0.85);
  padding: 0.7rem 1.5rem;
}

/* Station badge in topbar */
.station-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-mid);
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--trans);
}
.station-badge:hover {
  border-color: var(--wind);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.10);
}

.station-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--wind);
  box-shadow: 0 0 8px var(--wind);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(1.4); }
}

.period-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Content Padding */
.content-pad {
  padding: 1.75rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ══════════════════════════════════
   TAB PANELS
══════════════════════════════════ */
.tab-panel { display: none; }
.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeUp 0.4s var(--ease) forwards;
}

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

/* ══════════════════════════════════
   GRID LAYOUTS
══════════════════════════════════ */
.grid-4  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.grid-3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-2  { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-21 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }
.grid-12 { display: grid; grid-template-columns: 1fr 2fr; gap: 1.25rem; }

/* ══════════════════════════════════
   GLASS CARDS
══════════════════════════════════ */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  transition: all 0.35s var(--ease);
  position: relative;
  overflow: hidden;
}
.glass-card:active {
  transform: scale(0.995);
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.glass-card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border-subtle), 0 0 40px rgba(0,212,255,0.06);
  transform: translateY(-2px);
}

.glass-card:hover::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 60%);
  pointer-events: none;
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ══════════════════════════════════
   METRIC / KPI CARDS
══════════════════════════════════ */
.metric-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.metric-value {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
  font-family: var(--font-code);
  color: var(--wind);
}
.metric-unit {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 0.25rem;
  letter-spacing: 0;
  font-family: var(--font-body);
}
.metric-sub {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: -0.3rem;
}
.metric-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.metric-row-label {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}
.metric-row-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-code);
  color: var(--text-primary);
}
.metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: var(--trans);
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card), var(--mc-glow);
}

/* Metric card variants */
.mc-wind {
  --mc-glow: var(--shadow-glow-w);
  border-color: rgba(0, 212, 255, 0.16);
}
.mc-wind::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 0%, rgba(0,212,255,0.10) 0%, transparent 70%);
  pointer-events: none;
}

.mc-energy {
  --mc-glow: var(--shadow-glow-e);
  border-color: rgba(79, 144, 255, 0.16);
}
.mc-energy::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 0%, rgba(79,144,255,0.10) 0%, transparent 70%);
  pointer-events: none;
}

.mc-h2 {
  --mc-glow: var(--shadow-glow-h);
  border-color: rgba(0, 255, 179, 0.16);
}
.mc-h2::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 0%, rgba(0,255,179,0.10) 0%, transparent 70%);
  pointer-events: none;
}

.mc-nh3 {
  --mc-glow: var(--shadow-glow-n);
  border-color: rgba(176, 109, 255, 0.16);
}
.mc-nh3::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 0%, rgba(176,109,255,0.10) 0%, transparent 70%);
  pointer-events: none;
}

.mc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mc-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.mc-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}

.icon-wind  { background: var(--wind-glow);   color: var(--wind);   }
.icon-energy{ background: var(--energy-glow);  color: var(--energy); }
.icon-h2    { background: var(--h2-glow);      color: var(--h2);     }
.icon-nh3   { background: var(--nh3-glow);     color: var(--nh3);    }

.mc-value {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
  font-family: var(--font-code);
}

.mc-value.wind-val  { color: var(--wind);   }
.mc-value.energy-val{ color: var(--energy); }
.mc-value.h2-val    { color: var(--h2);     }
.mc-value.nh3-val   { color: var(--nh3);    }

.mc-unit {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 0.25rem;
  letter-spacing: 0;
}

.mc-bottom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.mc-trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.trend-up   { background: rgba(0,255,179,0.12); color: var(--h2); }
.trend-down { background: rgba(255,80,80,0.12); color: #ff5050;  }
.trend-flat { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

/* ══════════════════════════════════
   CHART CONTAINERS
══════════════════════════════════ */
.chart-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.chart-wrap canvas {
  display: block;
  max-width: 100%;
}

/* ══════════════════════════════════
   TABS / BUTTON GROUPS
══════════════════════════════════ */
.btn-group {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.btn-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 0.82rem;
  padding: 0.4rem 0.85rem;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: var(--trans-fast);
  white-space: nowrap;
}

.btn-tab:hover { color: var(--text-primary); }

.btn-tab.active {
  background: rgba(0, 212, 255, 0.15);
  color: var(--wind);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* ══════════════════════════════════
   FORMS — Selects & Inputs
══════════════════════════════════ */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: var(--trans-fast);
  width: 100%;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--wind);
  box-shadow: 0 0 0 3px var(--wind-glow-sm);
}

/* ── Sliders ── */
.slider-row { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.25rem; }

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-label { font-size: 0.82rem; color: var(--text-secondary); font-weight: 500; }

.slider-val-badge {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  background: rgba(0,212,255,0.12);
  color: var(--wind);
  font-family: var(--font-code);
}

.slider-val-badge.h2-badge  { background: rgba(0,255,179,0.12); color: var(--h2);  }
.slider-val-badge.nh3-badge { background: rgba(176,109,255,0.12); color: var(--nh3); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 4px;
   background: rgba(0,0,0,0.08);
   outline: none;
   cursor: pointer;
   transition: background 0.3s;
 }
 
 input[type="range"]:hover {
   background: rgba(0,0,0,0.12);
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 4px;
}

input[type="range"].wind-range::-webkit-slider-thumb { background: var(--wind); box-shadow: 0 0 12px var(--wind); }
input[type="range"].h2-range::-webkit-slider-thumb   { background: var(--h2);  box-shadow: 0 0 12px var(--h2); }
input[type="range"].nh3-range::-webkit-slider-thumb  { background: var(--nh3); box-shadow: 0 0 12px var(--nh3); }

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--wind);
  cursor: pointer;
  border: 3px solid var(--bg-deep);
  box-shadow: 0 0 12px var(--wind);
  transition: var(--trans-fast);
  margin-top: -7px;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  box-shadow: 0 0 20px var(--wind);
}

/* Firefox */
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: none;
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--wind);
  cursor: pointer;
  border: 3px solid var(--bg-deep);
  box-shadow: 0 0 12px var(--wind);
}

/* ══════════════════════════════════
   RESULT PANELS (Computed Value)
══════════════════════════════════ */
.result-panel {
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
  transition: var(--trans);
}
.result-panel:hover {
  transform: translateY(-1px);
}

.rp-wind  { background: var(--wind-glow-sm);  border: 1px solid rgba(0,212,255,0.25); }
.rp-h2    { background: var(--h2-glow-sm);    border: 1px solid rgba(0,255,179,0.25); }
.rp-nh3   { background: var(--nh3-glow-sm);   border: 1px solid rgba(176,109,255,0.25); }
.rp-energy{ background: var(--energy-glow-sm); border: 1px solid rgba(79,144,255,0.25); }

.rp-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-secondary); font-weight: 600; }

.rp-value {
  font-size: 1.9rem;
  font-weight: 800;
  font-family: var(--font-code);
  letter-spacing: -1px;
  line-height: 1;
}

.rp-wind .rp-value   { color: var(--wind); }
.rp-h2 .rp-value     { color: var(--h2);  }
.rp-nh3 .rp-value    { color: var(--nh3); }
.rp-energy .rp-value { color: var(--energy); }

.rp-unit { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); }

/* ══════════════════════════════════
   DATA TABLE
══════════════════════════════════ */
.table-wrap { overflow-x: auto; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data-table th {
  text-align: left;
  padding: 0.65rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-mid);
}

table.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.9rem;
  vertical-align: middle;
}

table.data-table tr:last-child td { border-bottom: none; }

table.data-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.015);
}

table.data-table tbody tr:hover td {
  background: var(--bg-glass);
}

table.data-table tbody tr:hover td:first-child {
  border-left: 2px solid var(--wind);
  padding-left: calc(1rem - 2px);
}

.td-number {
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 1rem;
}

/* ══════════════════════════════════
   SVG MAP
══════════════════════════════════ */
.map-card {
  display: flex;
  flex-direction: column;
}

.map-svg-container {
  width: 100%;
  height: 480px;
  min-height: 480px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(6, 18, 42, 0.6);
  position: relative;
}

.map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.map-outline {
  fill: rgba(0, 152, 200, 0.04);
  stroke: rgba(0, 152, 200, 0.20);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.map-dot {
  cursor: pointer;
  transition: r 0.2s ease;
}

.map-dot circle {
  stroke: #fff;
  stroke-width: 1.5;
}

.map-dot:hover circle {
  stroke-width: 2.5;
}

.map-dot text {
  font-family: 'Outfit', sans-serif;
  font-size: 8px;
  fill: var(--text-tertiary);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.map-dot:hover text {
  opacity: 1;
}

.map-dot.active text {
  opacity: 1;
  fill: var(--text-primary);
  font-weight: 600;
  font-size: 9px;
}

/* Map legend */
.map-legend {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 0.5rem 0.25rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg-glass);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  transition: var(--trans-fast);
}
/* Wilaya SVG paths */
.wilaya-path {
  cursor: pointer;
  stroke: rgba(255,255,255,0.15);
  stroke-width: 0.8;
  transition: fill 0.25s ease, stroke 0.25s ease, stroke-width 0.25s ease;
}
.wilaya-path.real { fill: rgba(0,212,255,0.18); }
.wilaya-path.real:hover { fill: rgba(0,212,255,0.45); stroke: rgba(0,212,255,0.6); stroke-width: 1.5; }
.wilaya-path.real.active { fill: rgba(0,212,255,0.5); stroke: #00d4ff; stroke-width: 2; }
.wilaya-path.simulated { fill: rgba(255,140,66,0.18); }
.wilaya-path.simulated:hover { fill: rgba(255,140,66,0.45); stroke: rgba(255,140,66,0.6); stroke-width: 1.5; }
.wilaya-path.simulated.active { fill: rgba(255,140,66,0.5); stroke: #ff8c42; stroke-width: 2; }

.legend-item:hover {
  border-color: var(--border-mid);
  color: var(--text-primary);
}

.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  flex-shrink: 0;
}

/* ══════════════════════════════════
   BUTTONS
══════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: var(--trans);
  text-decoration: none;
}

.btn-wind {
  background: linear-gradient(135deg, var(--wind-dim), var(--wind));
  color: #040e1e;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.30);
}
.btn-wind:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0, 212, 255, 0.40); }

.btn-h2 {
  background: linear-gradient(135deg, var(--h2-dim), var(--h2));
  color: #040e1e;
  box-shadow: 0 4px 15px rgba(0, 255, 179, 0.30);
}
.btn-h2:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0, 255, 179, 0.40); }

.btn-nh3 {
  background: linear-gradient(135deg, var(--nh3-dim), var(--nh3));
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(176, 109, 255, 0.30);
}
.btn-nh3:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(176, 109, 255, 0.40); }

.btn-ghost {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-mid);
}
.btn-ghost:hover { background: var(--bg-glass-hover); border-color: var(--border-bright); }

.btn-primary {
  background: var(--wind);
  color: #fff;
  box-shadow: 0 4px 15px rgba(13, 152, 186, 0.30);
}
.btn-primary:hover { background: var(--wind-dim); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(13, 152, 186, 0.40); }

/* ══════════════════════════════════
   DIVIDERS & MISC
══════════════════════════════════ */
.divider { height: 1px; background: var(--border-subtle); margin: 1rem 0; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.tag-wind   { background: var(--wind-glow-sm);   color: var(--wind);   border: 1px solid rgba(0,212,255,0.2); }
.tag-h2     { background: var(--h2-glow-sm);     color: var(--h2);     border: 1px solid rgba(0,255,179,0.2); }
.tag-nh3    { background: var(--nh3-glow-sm);    color: var(--nh3);    border: 1px solid rgba(176,109,255,0.2); }
.tag-energy { background: var(--energy-glow-sm); color: var(--energy); border: 1px solid rgba(79,144,255,0.2); }

/* Gradient headings */
.grad-wind  { background: linear-gradient(90deg, var(--wind), #40e0ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.grad-h2    { background: linear-gradient(90deg, var(--h2), #80ffdd);   -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.grad-nh3   { background: linear-gradient(90deg, var(--nh3), #d090ff);  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ── Info boxes ── */
.info-box {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.5;
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.info-box-wind { background: var(--wind-glow-sm); border-left: 3px solid var(--wind); color: rgba(0,212,255,0.9); }
.info-box-h2   { background: var(--h2-glow-sm);   border-left: 3px solid var(--h2);   color: rgba(0,255,179,0.9); }

/* ── Stat row (small horizontal indicator) ── */
.stat-list { display: flex; flex-direction: column; gap: 0.6rem; }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
}

.stat-row-label { font-size: 0.82rem; color: var(--text-secondary); }
.stat-row-value { font-size: 0.9rem; font-weight: 700; font-family: var(--font-code); }

/* ── Progress bar ── */
.progress-bar-wrap { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s var(--ease);
}

.pb-wind   { background: linear-gradient(90deg, var(--wind-dim), var(--wind)); }
.pb-h2     { background: linear-gradient(90deg, var(--h2-dim), var(--h2));     }
.pb-nh3    { background: linear-gradient(90deg, var(--nh3-dim), var(--nh3));   }
.pb-energy { background: linear-gradient(90deg, #2255bb, var(--energy));        }

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.25rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 600px; }

@media (max-width: 1400px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1100px) {
  .grid-21, .grid-12 { grid-template-columns: 1fr; }
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile sidebar overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

/* ── Mobile sidebar toggle button ── */
.mobile-toggle {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 300;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wind-dim), var(--wind));
  border: none;
  color: #040e1e;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.40);
  transition: all 0.3s var(--ease);
}
.mobile-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(0, 212, 255, 0.55);
}
.mobile-toggle.open {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  box-shadow: 0 4px 20px rgba(255, 71, 87, 0.40);
}

@media (max-width: 1024px) {
  .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .chart-wrap, .chart-wrap-lg { height: 330px !important; }
  .chart-wrap-md, .chart-wrap-sm { height: 250px !important; }
  .rp-value { font-size: 1.5rem; }
  .metric-value { font-size: 1.7rem; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 0px; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.35s var(--ease);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content { margin-left: 0; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .mobile-toggle { display: flex; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .topbar { padding: 0.7rem 1rem; }
  .topbar .header-sub { display: none; }
  .content-pad { padding: 1rem; }
  .chart-wrap, .chart-wrap-lg { height: 280px !important; }
  .chart-wrap-md, .chart-wrap-sm { height: 220px !important; }
  .metric-value { font-size: 1.4rem; }
  .metric-card { padding: 1rem 1.2rem; }
  .rp-value { font-size: 1.3rem; }
  .step-nav { flex-wrap: wrap; gap: 0.5rem; }
  .step-nav .btn-back, .step-nav .btn-next,
  .step-nav .btn-ghost, .step-nav .btn-wind { flex: 1; text-align: center; min-width: 120px; }
  .wilaya-nav { order: -1; width: 100%; justify-content: center; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .hero-stat-value { font-size: 1.1rem; }
  .control-range { width: 100%; }
  .control-group { flex-direction: column; align-items: stretch; }
  .result-panel { padding: 0.9rem 1rem; }
}

@media (max-width: 480px) {
  .content-pad { padding: 0.75rem; }
  .topbar { padding: 0.6rem 0.75rem; }
  .topbar .station-badge { display: none; }
  .chart-wrap, .chart-wrap-lg { height: 240px !important; }
  .chart-wrap-md, .chart-wrap-sm { height: 200px !important; }
  .metric-value { font-size: 1.2rem; }
  .metric-card { padding: 0.8rem 1rem; }
  .metric-label { font-size: 0.7rem; }
  .rp-value { font-size: 1.1rem; }
  .rp-label { font-size: 0.65rem; }
  table.data-table { font-size: 0.75rem; }
  table.data-table th, table.data-table td { padding: 0.4rem 0.5rem; }
  .step-nav .btn-back, .step-nav .btn-next,
  .step-nav .btn-ghost, .step-nav .btn-wind { font-size: 0.8rem; padding: 0.45rem 0.8rem; min-width: 100px; }
  .hero-stat-value { font-size: 0.95rem; }
  .hero-stat-label { font-size: 0.65rem; }
  .mobile-toggle { width: 40px; height: 40px; bottom: 1rem; right: 1rem; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE & TABLET ENHANCEMENT
   ═══════════════════════════════════════════════════════════════ */

/* ── Safe area insets (notch phones) ── */
@supports (padding: env(safe-area-inset-bottom)) {
  :root {
    --safe-bottom: env(safe-area-inset-bottom);
    --safe-top: env(safe-area-inset-top);
  }
}

/* ── Sidebar toggle at 1100px (tablet) ── */
@media (max-width: 1100px) {
  :root { --sidebar-width: 0px; }
  .sidebar {
    position: fixed;
    z-index: 200;
    transform: translateX(-100%);
    width: 280px;
    transition: transform 0.35s var(--ease);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.visible {
    display: block;
  }
  .main-content { margin-left: 0; }
  .mobile-toggle { display: flex; }
  .topbar { padding-left: 1rem; }
}

/* ── Step bar touch improvements ── */
@media (max-width: 768px) {
  .step-bar {
    gap: 0.15rem;
  }
  .step-item {
    min-height: 44px;
    padding: 0.35rem 0.4rem;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .step-num {
    width: 24px;
    height: 24px;
    min-width: 24px;
  }
  .step-label {
    font-size: 0.55rem;
  }
}

@media (max-width: 480px) {
  .step-item {
    padding: 0.25rem 0.3rem;
  }
  .step-num {
    width: 20px;
    height: 20px;
    min-width: 20px;
    font-size: 0.55rem;
  }
  .step-label {
    font-size: 0.5rem;
  }
}

/* ── Map touch improvements ── */
@media (hover: none) and (pointer: coarse) {
  .map-dot circle {
    stroke-width: 2.5;
  }
  .map-dot:hover circle {
    stroke-width: 2.5;
  }
  .map-dot text {
    opacity: 1;
    font-size: 9px;
  }
  .wilaya-path {
    stroke-width: 1.2;
  }
  .wilaya-path.real {
    fill: rgba(0,212,255,0.25);
  }
}
@media (max-width: 768px) {
  .map-svg-container {
    height: 360px;
    min-height: 320px;
  }
  #map-tooltip {
    font-size: 0.75rem;
    padding: 0.4rem 0.65rem;
    max-width: calc(100vw - 24px);
  }
}
@media (max-width: 480px) {
  .map-svg-container {
    height: 300px;
    min-height: 260px;
  }
}

/* ── Form controls mobile ── */
@media (max-width: 768px) {
  input, select, textarea, .form-control {
    font-size: 16px !important; /* Prevent iOS zoom on focus */
  }
  .form-control {
    padding: 0.7rem 0.8rem;
  }
  select.form-control {
    padding: 0.65rem 0.75rem;
  }
  .slider-row {
    margin-bottom: 0.75rem;
  }
  input[type="range"]::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    margin-top: -9px;
  }
  input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }
  .btn {
    padding: 0.75rem 1rem;
    min-height: 44px;
  }
}

/* ── Header mobile improvements ── */
@media (max-width: 768px) {
  .header {
    padding: 0.6rem 0.8rem;
    gap: 0.5rem;
  }
  .header-left {
    gap: 0.6rem;
  }
  .header-logo {
    width: clamp(70px, 18vw, 120px);
  }
  .header-right {
    gap: 0.3rem;
  }
  .header-right .btn-icon {
    width: 36px;
    height: 36px;
  }
}
@media (max-width: 480px) {
  .header {
    padding: 0.4rem 0.5rem;
  }
  .header-left {
    gap: 0.4rem;
  }
  .header-logo {
    width: clamp(50px, 22vw, 90px);
  }
  .header-right .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
    border-radius: 7px;
  }
  .header .user-name {
    display: none;
  }
}

/* ── Modal mobile ── */
@media (max-width: 768px) {
  .modal {
    width: 92vw;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
  }
  .modal-hdr h2 {
    font-size: 0.95rem;
  }
  .modal label {
    font-size: 0.72rem;
  }
  .modal input, .modal select {
    font-size: 16px !important;
    padding: 0.45rem 0.6rem;
  }
  .modal-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  .modal-actions button {
    width: 100%;
    justify-content: center;
  }
}
@media (max-width: 480px) {
  .modal {
    width: 96vw;
    padding: 1rem;
    border-radius: var(--radius-md);
  }
  .form-row {
    flex-direction: column;
    gap: 0.4rem;
  }
}

/* ── Dashboard mobile ── */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}
@media (max-width: 480px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Toast mobile ── */
@media (max-width: 480px) {
  .toast {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 1.5rem;
    width: auto;
    font-size: 0.82rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
  }
}

/* ── Hero section mobile ── */
@media (max-width: 768px) {
  .hero-section {
    padding: 1rem;
    gap: 0.75rem;
  }
  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
}
@media (max-width: 480px) {
  .hero-section {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
  }
  .hero-stat-value {
    font-size: 0.95rem;
  }
}

/* ── Step 6 chart cards mobile ── */
@media (max-width: 768px) {
  .card .chart-wrap-sm,
  .card .chart-wrap {
    height: 220px !important;
  }
  .card .chart-wrap-sm canvas,
  .card .chart-wrap canvas {
    max-height: 220px;
  }
  .grid-2.mb-3 .card {
    padding: 0.75rem;
  }
  .grid-2.mb-3 .card-title {
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
  }
}
@media (max-width: 480px) {
  .card .chart-wrap-sm,
  .card .chart-wrap {
    height: 180px !important;
  }
  .card .chart-wrap-sm canvas,
  .card .chart-wrap canvas {
    max-height: 180px;
  }
  .grid-2.mb-3 .card {
    padding: 0.5rem;
  }
  .grid-2.mb-3 .card-title {
    font-size: 0.75rem;
  }
}

/* ── Scroll buttons mobile ── */
@media (max-width: 768px) {
  .scroll-btns {
    right: 0.5rem;
    bottom: 5rem;
  }
  .scroll-btns button {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
}

/* ── Chart canvas touch ── */
@media (pointer: coarse) {
  .chart-wrap canvas {
    touch-action: pan-y;
  }
}

/* ── Wilaya card mobile ── */
@media (max-width: 768px) {
  #wilaya-card {
    padding: 0.9rem 1rem;
  }
  #w-map-div {
    min-height: 180px;
  }
}

/* ── General mobile improvements ── */
@media (pointer: coarse) {
  * {
    -webkit-tap-highlight-color: transparent;
  }
  button, a, .clickable {
    touch-action: manipulation;
  }
}
@media (max-width: 480px) {
  .glass-card {
    padding: 1rem;
    border-radius: var(--radius-lg);
  }
  .card-header {
    margin-bottom: 0.75rem;
  }
  .card-title {
    font-size: 0.85rem;
  }
  .card-title-icon {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }
  .control-group {
    gap: 0.5rem;
  }
  .control-label {
    font-size: 0.75rem;
  }
  .control-value {
    font-size: 0.85rem;
  }
}

/* ── Loading Spinner ── */
@keyframes spin { to { transform: rotate(360deg); } }

#wind-loading svg {
  animation: spin 0.8s linear infinite;
}

#wind-loading {
  animation: pulse-glow 1.5s ease-in-out infinite;
}

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

/* Station Badge smoother pulse */
.station-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ══════════════════════════════════
   LIGHT MODE ADJUSTMENTS (inactive — now default)
══════════════════════════════════ */

/* ── Step Navigation ── */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}
.step-nav .btn-ghost {
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text-secondary);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.step-nav .btn-ghost:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}
.step-nav .btn-wind {
  background: linear-gradient(135deg, var(--wind-dim), var(--wind));
  border: none;
  color: #040e1e;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.25s;
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.25);
}
.step-nav .btn-wind:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.40);
}

/* ── Step Indicator ── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 1rem;
}
.step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  transition: all 0.3s;
}
.step-dot.active {
  background: var(--wind-glow);
  border-color: var(--wind);
  color: var(--wind);
}
.step-dot.done {
  background: rgba(0, 212, 255, 0.15);
  border-color: var(--wind-dim);
  color: var(--wind-dim);
}
.step-line {
  width: 14px;
  height: 1px;
  background: var(--border-subtle);
  margin: 0 2px;
  transition: background 0.3s;
}
.step-line.active {
  background: var(--wind-dim);
}

/* ── Nav Step Number ── */
.nav-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.65rem;
  font-weight: 700;
  margin-right: 6px;
  flex-shrink: 0;
  color: var(--text-tertiary);
}
.nav-link.active .nav-step-num {
  background: var(--wind-glow);
  border-color: var(--wind);
  color: var(--wind);
}

/* ── Responsive step indicator ── */
@media (max-width: 1100px) {
  .step-indicator { display: none; }
}
