:root {
  --bg: #0b0f14;
  --fg: #e7eef8;
  --muted: #a5b4c4;
  --card: #121a24;
  --line: #223044;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial;
}

/* Header */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #0f1620;
  border-bottom: 1px solid var(--line);
}

.title { font-size: 18px; font-weight: 700; }
.sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;        /* lets it wrap instead of overflowing */
  justify-content: flex-end;
}
.meta { font-size: 12px; color: var(--muted); line-height: 1.4; }

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #172132;
}

.pill.online { background: #0f2a1a; border-color: #1b6b3a; }
.pill.offline { background: #2a1212; border-color: #7a2d2d; }
.pill.awaiting { background: #2a2412; border-color: #7a6a2d; }

/* Main layout */
main {
  padding: 12px;
  display: grid;
  gap: 12px;
}

#map {
  width: 100%;
  height: 60vh;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

/* Desktop/tablet: 2 label/value pairs per row */
.row {
  display: grid;
  grid-template-columns: 120px 1fr 120px 1fr;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.row:last-child { border-bottom: none; }

.label { color: var(--muted); font-size: 12px; }
.value { font-weight: 700; }

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 640px) {
  /* Stack header bits instead of squashing */
  .bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .right {
    width: 100%;
    justify-content: space-between;
  }

  /* Make the map a bit shorter on phones */
  #map {
    height: 50vh;
  }

  /* Turn each row into a simple 2-column grid: label + value */
  .row {
    grid-template-columns: 110px 1fr;
    row-gap: 6px;
  }
}
