    * { box-sizing: border-box; margin: 0; padding: 0; }
    body { font-family: Arial, sans-serif; background: #1a1a2e; color: #eee; display: flex; flex-direction: column; height: 100vh; }

    header {
      padding: 8px 14px; background: #12122a;
      display: flex; align-items: center; gap: 10px;
      flex-wrap: wrap; border-bottom: 1px solid #333; z-index: 1000;
    }
    header h1 { font-size: 17px; font-weight: 700; color: #60a5fa; white-space: nowrap; }

    .coord-group { display: flex; align-items: center; gap: 5px; }
    .coord-group label { font-size: 12px; color: #aaa; }
    .coord-group input[type="number"] {
      width: 105px; padding: 5px 7px; border-radius: 5px;
      border: 1px solid #444; background: #2a2a4a; color: #eee; font-size: 13px;
    }
    .radius-group { display: flex; align-items: center; gap: 5px; }
    .radius-group label { font-size: 12px; color: #aaa; white-space: nowrap; }
    .radius-group input[type="range"] { width: 90px; }
    .radius-group span { font-size: 13px; color: #eee; }

    button { padding: 5px 12px; border-radius: 5px; border: none; cursor: pointer; font-size: 13px; font-weight: 500; }
    .btn-primary { background: #3b82f6; color: #fff; }
    .btn-primary:hover { background: #2563eb; }
    .btn-secondary { background: #374151; color: #ddd; }
    .btn-secondary:hover { background: #4b5563; }

    .layer-toggles { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
    .layer-btn {
      padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
      border: 1px solid #555; background: #2a2a4a; color: #aaa; cursor: pointer; user-select: none;
    }
    .layer-btn.active { background: #3b82f6; border-color: #3b82f6; color: #fff; }

    .key-wrapper { position: relative; display: inline-block; }
    .key-btn {
      padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
      border: 1px solid #555; background: #2a2a4a; color: #aaa; cursor: pointer;
    }
    .key-btn:hover { background: #374151; color: #eee; }
    .key-dropdown {
      display: none; position: fixed;
      background: #1e1e3a; border: 1px solid #444; border-radius: 10px;
      padding: 12px 14px; z-index: 3000; width: 270px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.7);
      max-height: 80vh; overflow-y: auto;
    }
    .key-wrapper:hover .key-dropdown { display: block; }
    .key-dropdown h4 { font-size: 12px; color: #60a5fa; margin-bottom: 8px; letter-spacing: 0.5px; }
    .key-section { margin-bottom: 10px; }
    .key-section h5 { font-size: 11px; color: #888; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.4px; }
    .key-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #ccc; margin-bottom: 4px; }
    .key-swatch { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.2); }
    .key-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
    .key-line { width: 18px; height: 3px; border-radius: 2px; flex-shrink: 0; }

    .mode-toggle { display: flex; gap: 4px; background: #1a1a2e; border-radius: 20px; padding: 2px; border: 1px solid #444; }
    .mode-btn { padding: 3px 10px; border-radius: 18px; font-size: 11px; font-weight: 500; border: none; background: transparent; color: #aaa; cursor: pointer; }
    .mode-btn.active { background: #3b82f6; color: #fff; }

    .opacity-group { display: flex; align-items: center; gap: 5px; }
    .opacity-group label { font-size: 11px; color: #aaa; white-space: nowrap; }
    .opacity-group input[type="range"] { width: 70px; }

    #map { flex: 1; z-index: 1; position: relative; }

    /* Map base layer filter — contrast/invert control */
    .leaflet-tile-pane { transition: filter 0.4s ease; }

    /* Alerts panel — collapsible */
    #alerts-panel {
      position: absolute; bottom: 16px; right: 16px;
      width: 310px;
      background: rgba(18,18,42,0.95); border: 1px solid #333;
      border-radius: 10px; z-index: 1000; overflow: hidden;
      display: flex; flex-direction: column;
      transition: height 0.3s ease;
    }
    #alerts-panel.collapsed { height: auto; }
    #alerts-panel.expanded  { height: 360px; }

    #alerts-header {
      padding: 9px 13px; border-bottom: 1px solid #333;
      font-size: 13px; font-weight: 600; cursor: pointer;
      display: flex; align-items: center; justify-content: space-between;
      user-select: none;
    }
    #alerts-header:hover { background: rgba(255,255,255,0.04); }
    #alerts-header .hdr-left { display: flex; align-items: center; gap: 8px; }
    #alerts-header .hdr-chevron { font-size: 10px; opacity: 0.5; transition: transform 0.25s; }
    #alerts-panel.expanded .hdr-chevron { transform: rotate(180deg); }

    #alerts-body-wrapper {
      flex: 1; overflow: hidden; position: relative; min-height: 0;
    }
    .alerts-body-layer {
      position: absolute; top: 0; left: 0; right: 0; bottom: 0;
      overflow-y: auto; padding: 7px;
      transition: opacity 0.5s ease;
    }

    /* Alert cards — expand/collapse */
    .alert-card {
      border-radius: 6px; padding: 0; margin-bottom: 6px;
      border-left: 3px solid #ccc; font-size: 12px; overflow: hidden;
    }
    .alert-card-header {
      padding: 8px 10px; cursor: pointer; display: flex;
      align-items: center; justify-content: space-between; gap: 6px;
    }
    .alert-card-header:hover { filter: brightness(1.2); }
    .alert-card-header .ev-title { font-weight: 600; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; flex: 1; }
    .alert-card-header .ev-title .pin-icon { font-size: 10px; background: rgba(255,255,255,0.2); padding: 1px 5px; border-radius: 10px; cursor: pointer; }
    .alert-card-header .ev-meta { font-size: 10px; opacity: 0.55; white-space: nowrap; }
    .alert-card-header .chevron { font-size: 10px; opacity: 0.5; transition: transform 0.25s; flex-shrink: 0; }
    .alert-card.expanded .chevron { transform: rotate(180deg); }
    .alert-card-body {
      max-height: 0; overflow: hidden;
      transition: max-height 0.35s ease, padding 0.25s ease;
      padding: 0 10px;
    }
    .alert-card.expanded .alert-card-body { max-height: 300px; padding: 0 10px 10px; }
    .alert-card-body .hl   { opacity: 0.9; line-height: 1.5; margin-bottom: 6px; }
    .alert-card-body .desc { font-size: 11px; opacity: 0.75; line-height: 1.5; margin-bottom: 6px; }
    .alert-card-body .meta { font-size: 11px; opacity: 0.55; }
    .alert-card-body .map-link {
      display: inline-block; margin-top: 6px; font-size: 11px;
      background: rgba(255,255,255,0.12); padding: 2px 8px;
      border-radius: 10px; cursor: pointer;
    }
    .alert-card-body .map-link:hover { background: rgba(255,255,255,0.22); }

    .sev-Extreme  { background: rgba(226,75,74,0.2);   border-color: #e24b4a; color: #fca5a5; }
    .sev-Severe   { background: rgba(239,159,39,0.2);  border-color: #ef9f27; color: #fcd34d; }
    .sev-Moderate { background: rgba(55,138,221,0.2);  border-color: #378add; color: #93c5fd; }
    .sev-Minor    { background: rgba(99,153,34,0.2);   border-color: #639922; color: #86efac; }
    .sev-Unknown  { background: rgba(136,135,128,0.2); border-color: #888780; color: #d1d5db; }

    .no-alerts { color: #6b7280; font-size: 12px; text-align: center; padding: 16px; }

    #radar-controls {
      position: absolute; bottom: 16px; left: 16px;
      background: rgba(18,18,42,0.92); border: 1px solid #333;
      border-radius: 8px; padding: 7px 11px; z-index: 1000;
      font-size: 12px; color: #aaa; display: flex; align-items: center; gap: 8px;
    }
    #radar-controls button {
      background: #374151; color: #eee; border: none;
      border-radius: 4px; padding: 3px 7px; font-size: 12px; cursor: pointer;
    }
    #radar-controls button:hover { background: #4b5563; }
    #radar-time { font-size: 11px; color: #60a5fa; min-width: 110px; transition: color 0.4s; }

    #owm-notice {
      position: absolute; top: 70px; right: 16px;
      background: rgba(18,18,42,0.9); border: 1px solid #f59e0b;
      border-radius: 8px; padding: 10px 14px; z-index: 1001;
      font-size: 12px; color: #fcd34d; max-width: 260px; display: none;
    }
    #owm-notice a { color: #93c5fd; }

    #drag-toast {
      position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
      background: rgba(18,18,42,0.92); border: 1px solid #60a5fa;
      border-radius: 8px; padding: 7px 16px; z-index: 1001;
      font-size: 12px; color: #93c5fd; display: none; white-space: nowrap;
    }

    /* Lightning strike marker */
    .lightning-icon { background: transparent; border: none; font-size: 16px; line-height: 1; filter: drop-shadow(0 0 4px #ffe066); }

    .spinner { display: inline-block; width: 10px; height: 10px; border: 2px solid #555; border-top-color: #60a5fa; border-radius: 50%; animation: spin 0.8s linear infinite; }

    /* Ruler */
    #ruler-display {
      position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
      background: rgba(18,18,42,0.92); border: 1px solid #a78bfa;
      border-radius: 8px; padding: 7px 16px; z-index: 1001;
      font-size: 13px; color: #c4b5fd; display: none; white-space: nowrap;
      pointer-events: none;
    }
    .ruler-marker { background: transparent; border: none; }
    #btn-ruler.active { background: #7c3aed; border-color: #7c3aed; color: #fff; }
    @keyframes spin { to { transform: rotate(360deg); } }
    .alert-marker-label { background: transparent; border: none; font-size: 18px; line-height: 1; }
    #btn-drag-pin.dragging { background: #7c3aed; border-color: #7c3aed; color: #fff; }

    /* ── Fullscreen / UI toggle ── */
    header {
      transition: opacity 0.35s ease, max-height 0.35s ease, padding 0.35s ease;
      overflow: hidden;
      max-height: 200px;
    }
    #radar-controls, #alerts-panel {
      transition: opacity 0.35s ease, transform 0.35s ease;
    }
    body.ui-hidden header {
      opacity: 0; pointer-events: none;
      max-height: 0 !important; padding: 0 !important;
      border: none !important;
    }
    body.ui-hidden #radar-controls {
      opacity: 0; pointer-events: none;
      transform: translateY(80px);
    }
    body.ui-hidden #alerts-panel {
      opacity: 0; pointer-events: none;
      transform: translateY(80px);
    }
    /* Hint shown briefly */
    #ui-hint {
      position: absolute; top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      background: rgba(0,0,0,0.6); color: rgba(255,255,255,0.85);
      font-size: 14px; padding: 10px 22px; border-radius: 24px;
      z-index: 2000; pointer-events: none;
      opacity: 0; transition: opacity 0.4s ease;
      white-space: nowrap;
    }
    #ui-hint.show { opacity: 1; }

/* ── MOBILE DRAWER ─────────────────────────────────────────── */
.mob-sec { border-bottom: 0.5px solid #1e2a3f; }
.mob-sec-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; cursor: pointer; user-select: none;
  -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  font-size: 13px; font-weight: 500; color: #e2e8f0;
}
.mob-sec-hdr:active { background: #12122a; }
.mob-sec-hdr > span:first-child { flex: 1; }
.mob-meta { font-size: 11px; color: #475569; }
.mob-chev { font-size: 10px; color: #475569; flex-shrink: 0; }
.mob-sec-body {
  overflow: hidden; max-height: 700px;
  padding: 0 14px 4px; transition: max-height 0.35s ease, padding 0.3s ease;
}
.mob-sec-body.mob-closed { max-height: 0; padding: 0 14px; }

/* Hamburger hidden on desktop, shown on mobile via media query */
#mob-menu-btn { display: none; }

/* ── Right-side panels (UV, Precip) — desktop ───────────────── */
#uv-panel, #precip-panel {
  position: absolute;
  right: 10px;
  z-index: 1000;
  min-width: 200px;
  max-width: 300px;
  background: #1a1a2e;
  border: 1px solid #1e3a5f;
  border-radius: 8px;
  padding: 12px 16px;
  color: #eee;
  font-size: 13px;
}

/* ── Mobile layer grid — categorized horizontal scroll rows ── */
.mob-layer-grid-wrap {
  padding: 4px 0 10px;
}
.mob-layer-cat-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  padding: 8px 0 4px;
}
.mob-layer-cat-label:first-child {
  padding-top: 2px;
}
.mob-layer-scroll-row {
  display: flex;
  flex-direction: row;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: 4px;
  /* Hide scrollbar on mobile but keep scrollable */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.mob-layer-scroll-row::-webkit-scrollbar { display: none; }
/* Fade indicator on right to hint scrollability */
.mob-layer-scroll-row::after {
  content: '';
  flex-shrink: 0;
  width: 10px;
}

#mob-layer-grid .mob-layer-tile,
.mob-layer-scroll-row .mob-layer-tile {
  padding: 10px 4px; background: #1a1a2e; border: 1px solid #1e3a5f;
  border-radius: 8px; text-align: center; color: #94a3b8;
  font-size: 11px; cursor: pointer; min-height: 46px;
  display: flex; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.mob-layer-pill {
  /* Fixed width so pills are uniform and row scrolls smoothly */
  flex: 0 0 74px;
  min-width: 74px;
  scroll-snap-align: start;
  white-space: nowrap;
  font-size: 11px;
}
#mob-layer-grid .mob-layer-tile.mob-active,
.mob-layer-scroll-row .mob-layer-tile.mob-active {
  background: #1a3a5f; border-color: #3b82f6; color: #93c5fd;
}

/* ── Show hamburger + hide header controls on mobile ────────── */
@media (max-width: 700px) {
  #mob-menu-btn { display: block !important; }

  /* Clock — move below header on mobile so it doesn't overlap hamburger */
  #main-clock-widget {
    top: 50px !important;
    right: 8px !important;
    z-index: 1999 !important;
  }

  /* Hide all header children except h1 and hamburger */
  header > *:not(h1):not(#mob-menu-btn) { display: none !important; }

  header {
    flex-wrap: nowrap; align-items: center;
    padding: 8px 12px; gap: 8px;
    justify-content: space-between;
  }
  header h1 { font-size: 16px; flex: 1; }

  /* Panels slide up from bottom on mobile — !important overrides inline styles */
  #precip-panel, #uv-panel {
    position: fixed !important;
    bottom: 0 !important; top: auto !important;
    left: 0 !important; right: 0 !important;
    max-height: 65vh; overflow-y: auto;
    border-radius: 14px 14px 0 0 !important;
    z-index: 2000 !important;
    min-width: unset !important;
    max-width: unset !important;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
  }

  #alerts-panel { max-height: 40vh; }

  /* Hide desktop drag done button on mobile - we use floating mob-pin-done instead */
  #drag-done-btn { display: none !important; }
  #drag-toast    { display: none !important; }
}

/* ── MOBILE DRAWER STYLES ───────────────────────────────────── */
.mob-sec { border-bottom: 0.5px solid #1e2a3f; }
.mob-sec-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; cursor: pointer;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-size: 13px; font-weight: 500; color: #e2e8f0;
}
.mob-sec-hdr:active { background: #12122a; }
.mob-sec-hdr > span:first-child { flex: 1; }
.mob-meta { font-size: 11px; color: #475569; }
.mob-chev { font-size: 10px; color: #475569; flex-shrink: 0; }
.mob-sec-body {
  overflow: hidden; max-height: 700px;
  padding: 0 14px 4px;
  transition: max-height 0.35s ease, padding 0.3s ease;
}
.mob-sec-body.mob-closed { max-height: 0; padding: 0 14px; }

/* Layer tiles — in media query section, handled by base styles above */

/* ─── WIND ARROW ANIMATION ───────────────────────────────────── */
@keyframes wsWindPulse {
  0%   { opacity: 0.65; transform-origin: center; }
  50%  { opacity: 1.0;  }
  100% { opacity: 0.65; }
}
/* Override: the rotation is set inline; animation targets opacity only */
.ws-wind-arrow div {
  transform-origin: center;
}

/* ─── ALERT TRANSLATION ───────────────────────────────────── */
.ws-translate-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ws-lang-select {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  border-radius: 4px;
  font-size: 11px;
  padding: 3px 6px;
  cursor: pointer;
  outline: none;
  max-width: 140px;
}
.ws-lang-select:hover { border-color: #3b82f6; color: #e2e8f0; }
