:root {
  --bg: #0e1420;
  --panel: #161d2c;
  --panel-light: #1f2740;
  --text: #eef1f8;
  --muted: #9aa4bd;
  --accent: #4da3ff;
  --accent2: #ffb454;
  --border: #2a3350;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  height: 100%;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  gap: 10px;
  flex-wrap: wrap;
}

header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
}

nav {
  display: flex;
  gap: 6px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

nav a.active, nav a:hover {
  color: var(--text);
  background: var(--panel-light);
}

#locationBar {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

#locationLabel {
  font-size: 13px;
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button, input {
  font-family: inherit;
}

.btn {
  background: var(--panel-light);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
}

.btn:hover { border-color: var(--accent); }

#searchBox {
  position: absolute;
  top: 40px;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  width: 260px;
  display: none;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

#searchBox.open { display: block; }

#searchInput {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

#searchResults {
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
}

#searchResults div {
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

#searchResults div:hover { background: var(--panel-light); }

#mapWrap {
  position: relative;
  width: 100%;
  height: calc(100vh - 260px);
  min-height: 320px;
}

#map {
  width: 100%;
  height: 100%;
  background: #000;
}

.leaflet-tile-pane {
  transition: filter 0.4s linear;
}

.night-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #050a1f, #0a1230);
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 450;
  transition: opacity 0.4s linear;
}

#radarNote {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 16px;
  background: var(--panel);
}

#radarStatus {
  display: block;
  margin-top: 4px;
  font-weight: 600;
  color: var(--accent);
}

#controls {
  background: var(--panel);
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
}

#timeLabel {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#timeLabel span.sub {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

#slider {
  width: 100%;
  accent-color: var(--accent);
}

.playbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

#popupPanel {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  gap: 18px;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 900;
  flex-wrap: wrap;
  max-width: 92vw;
}

.pp-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pp-icon { font-size: 34px; }

.pp-temp { font-size: 26px; font-weight: 700; }

.pp-hl { font-size: 12px; color: var(--muted); }

.pp-grid {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 2px 16px;
  font-size: 12px;
  color: var(--muted);
}

.pp-grid b { color: var(--text); }

.loading, .error {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.error { color: #ff8080; }

/* daily page */
#dailyList {
  padding: 16px;
  display: grid;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}

.day-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
}

.day-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-card-head .left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.day-name { font-weight: 700; font-size: 15px; width: 90px; }

.day-icon { font-size: 26px; }

.day-hl { font-size: 14px; }

.day-hl .lo { color: var(--muted); margin-left: 8px; }

.day-precip { font-size: 12px; color: var(--accent); width: 60px; text-align: right; }

.day-details {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 16px;
  font-size: 13px;
  color: var(--muted);
}

.day-details b { color: var(--text); }

.day-card.open .day-details { display: grid; }
