:root {
  --bg: #04070c;
  --ink: #e8f2f8;
  --dim: #8ea3b5;
  --faint: #566b7c;
  --line: rgba(126, 176, 205, .16);
  --cyan: #35e0ff;
  --green: #35d07f;
  --yellow: #ffd93d;
  --orange: #ffa63d;
  --red: #ff4d5e;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --top: 76px;
}
* { box-sizing: border-box }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); overflow: hidden }
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(1200px 640px at 42% -8%, rgba(53,224,255,.09), transparent 65%);
}

/* ------------------------------------------------------------------ header */
.bar {
  height: var(--top); display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; border-bottom: 1px solid var(--line); position: relative; z-index: 5;
  background: linear-gradient(180deg, rgba(4,7,12,.96), rgba(4,7,12,.55));
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 13px }
.glyph { font-size: 30px; line-height: 1; filter: drop-shadow(0 0 14px rgba(53,224,255,.55)) }
h1 { margin: 0; font-family: var(--mono); font-size: 25px; letter-spacing: .28em; font-weight: 600 }
h1 span { color: var(--cyan) }
.brand p { margin: 2px 0 0; font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--faint) }
.hud { display: flex; align-items: center; gap: 22px }
.hud__cell { display: flex; flex-direction: column; align-items: flex-end; line-height: 1 }
.hud__cell b { font-family: var(--mono); font-size: 25px; font-weight: 500 }
.hud__cell small { font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--faint); margin-top: 5px }
.hud__clock b { color: var(--cyan) }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 11px var(--green) }
.dot.bad { background: var(--red); box-shadow: 0 0 11px var(--red) }

/* ------------------------------------------------------------------ layout */
main {
  height: calc(100% - var(--top));
  display: grid; gap: 14px; padding: 14px 22px 18px;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-rows: minmax(0, 1.55fr) minmax(0, 1fr);
  grid-template-areas: "map side" "regions side";
}
.panel {
  border: 1px solid var(--line); border-radius: 12px; background: rgba(7, 12, 19, .78);
  backdrop-filter: blur(14px); display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  box-shadow: 0 18px 46px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.03);
}
.map { grid-area: map }
.side { grid-area: side; display: grid; grid-template-rows: minmax(0,1fr) minmax(0,1.15fr); gap: 14px; min-height: 0 }
.panel--regions { grid-area: regions }
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 13px 8px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.panel__head h2 {
  margin: 0; font-family: var(--mono); font-size: 11.5px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--dim); font-weight: 500;
}
.panel__head small { font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: .1em }

#map { flex: 1; width: 100%; min-height: 0; display: block }

.legend { display: flex; gap: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .04em }
.legend .muted { color: var(--faint) }

/* -------------------------------------------------------------------- rows */
.rows { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 8px; display: flex; flex-direction: column; gap: 1px }
.rows::-webkit-scrollbar { width: 8px }
.rows::-webkit-scrollbar-thumb { background: rgba(53,224,255,.32); border-radius: 99px; border: 2px solid transparent; background-clip: content-box }
.row {
  display: grid; grid-template-columns: 14px minmax(0,1fr) auto auto; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 7px; text-decoration: none; color: inherit;
}
.row:hover { background: rgba(255,255,255,.04) }
.row .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px }
.row .n b { font-weight: 600 }
.row .n small { display: block; color: var(--faint); font-size: 11px; letter-spacing: .03em; margin-top: 2px }
.row .v { font-family: var(--mono); font-size: 12px; color: var(--dim); text-align: right; white-space: nowrap }
.row .w { font-size: 16px; text-align: center; line-height: 1 }

.pip { width: 8px; height: 8px; border-radius: 50%; display: inline-block }
.pip.green { background: var(--green); box-shadow: 0 0 8px rgba(53,208,127,.75) }
.pip.yellow { background: var(--yellow); box-shadow: 0 0 8px rgba(255,217,61,.75) }
.pip.red { background: var(--red); box-shadow: 0 0 9px rgba(255,77,94,.85) }
.pip.grey { background: var(--faint); opacity: .7 }

.s-clear { color: var(--green) }
.s-fair { color: #9fe870 }
.s-cloudy { color: var(--yellow) }
.s-rain { color: var(--orange) }
.s-storm { color: var(--red) }

@media (max-width: 1150px) {
  main { grid-template-columns: 1fr; grid-template-rows: 55vh auto auto; grid-template-areas: "map" "side" "regions"; overflow: auto }
  html, body { overflow: auto }
}

.spark { flex: 0 0 auto; opacity: .9 }
.hist { display: block; opacity: .9 }
.bar { display: block; height: 3px; margin-top: 5px; background: rgba(126,176,205,.12); border-radius: 2px; overflow: hidden }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, rgba(53,224,255,.55), rgba(53,224,255,.9)) }
.muted { color: var(--faint) }
