:root {
  --primary: #1e293b;
  --accent: #38b6ff;
  --storm: #ff8800;
  --bg: #101827;
  --text: #f1f5f9;
  --sidebar-bg: #20304aee;
  --error-bg: #ffe8e8cc;
  --error-border: #c00;
}
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
}
header {
  background: var(--primary);
  color: var(--accent);
  padding: 0.8em 1.5em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
h1 { margin: 0; font-size: 1.4em; }
#toggle-sidebar {
  background: none;
  border: none;
  font-size: 1.7em;
  color: var(--accent);
  cursor: pointer;
}
#container {
  display: flex;
  height: calc(100vh - 54px);
}
#sidebar {
  width: 320px;
  background: var(--sidebar-bg);
  overflow-y: auto;
  padding: 1em;
  transition: transform 0.3s;
  z-index: 10;
  min-width: 200px;
  max-width: 100vw;
}
#sidebar.hidden { transform: translateX(-100%); }
#map {
  flex: 1;
  min-width: 0;
  position: relative;
  background: #222; /* fallback in case map doesn't load */
  height: 100%;
}
.popup {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: #18273d;
  color: #fff;
  border-radius: 12px;
  padding: 1em 1.3em;
  box-shadow: 0 8px 24px #000a;
  min-width: 250px;
  max-width: 320px;
  z-index: 999;
  pointer-events: auto;
}
.popup.hidden { display: none; }
.storm-list-item {
  margin-bottom: 1em;
  padding: 0.7em 0.5em;
  border-radius: 8px;
  transition: background 0.15s;
  cursor: pointer;
}
.storm-list-item:hover {
  background: #2d3d5b;
}
.storm-name { font-weight: bold; color: var(--accent); }
.storm-cat { font-size: 0.95em; opacity: 0.85; }
#error-section {
  background: var(--error-bg);
  color: #600;
  border: 1px solid var(--error-border);
  border-radius: 7px;
  margin-bottom: 1em;
  padding: 0.5em 0.8em;
}
#error-section h2 {
  font-size: 1.1em;
  margin: 0 0 0.4em;
}
#error-list {
  margin: 0;
  padding-left: 1.1em;
}
#error-list li {
  font-size: 0.98em;
}
@media (max-width: 700px) {
  #container { flex-direction: column; }
  #sidebar { width: 100vw; position: absolute; left: 0; top: 54px; height: 50vh; }
  #sidebar.hidden { transform: translateY(-100%); }
  #map { height: 50vh; }
}