:root {
  --brand: #5b3fa8;
  --brand-light: #efeaf9;
  --text: #2d2a26;
  --muted: #7a726a;
  --border: #e4dfd8;
  --bg: #faf9f7;
  --topbar-h: 56px;
  --panel-w: 280px;
  font-family: "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: #fff; border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  position: relative; z-index: 2;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.logo {
  width: 30px; height: 30px; border-radius: 9px; align-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; font-size: 18px;
}
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: 0.2px; }
.brand-sub { color: var(--muted); font-size: 13px; }
.status { font-size: 13px; color: var(--muted); }
.status.error { color: #c0392b; font-weight: 600; }
.status.ok::before { content: "● "; color: #2a9d8f; }

.layout { display: flex; height: calc(100% - var(--topbar-h)); }
.panel {
  width: var(--panel-w); flex-shrink: 0; overflow-y: auto;
  padding: 16px 18px; background: #fff; border-right: 1px solid var(--border);
}
.panel section { margin-bottom: 22px; }
.panel h2 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--muted); margin: 0 0 10px; font-weight: 600;
}
.panel label { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; cursor: pointer; }
.panel input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; }
.panel select {
  width: 100%; padding: 8px 10px; font-size: 14px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.info dl { display: grid; grid-template-columns: 70px 1fr; gap: 6px 8px; margin: 0; font-size: 13px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; font-variant-numeric: tabular-nums; word-break: break-word; }
.note { font-size: 12px; color: var(--muted); line-height: 1.5; border-top: 1px solid var(--border); padding-top: 12px; }

.map { flex: 1; position: relative; }

.maplibregl-popup-content { border-radius: 10px; padding: 10px 14px; font-size: 13px; line-height: 1.5; }
.popup-title { font-weight: 600; margin-bottom: 2px; }
.popup-muted { color: var(--muted); }

/* Narrow desktop windows: panel collapses to the top */
@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .panel { width: 100%; max-height: 40%; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand-sub { display: none; }
}
