:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7f8;
  color: #1d252b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #f5f7f8;
}

button, select, input { font: inherit; }

button {
  touch-action: manipulation;
}

.shell {
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #62707b;
  font-size: 14px;
  font-weight: 700;
}

h1, h2 { margin: 0; letter-spacing: 0; }

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #cfd8df;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.segmented button {
  min-width: 82px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #4d5d68;
  cursor: pointer;
}

.segmented button.active {
  background: #263238;
  color: #fff;
  font-weight: 800;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #cfd8df;
  border-radius: 8px;
  background: #fff;
  color: #34434d;
  font-weight: 700;
}

.zoom-controls {
  display: grid;
  grid-template-columns: 40px 40px 72px;
  border: 1px solid #cfd8df;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.zoom-controls button {
  height: 40px;
  border: 0;
  border-right: 1px solid #dce4e9;
  background: transparent;
  color: #34434d;
  cursor: pointer;
  font-weight: 800;
}

.zoom-controls button:last-child {
  border-right: 0;
  font-size: 13px;
}

.zoom-controls button:hover {
  background: #edf2f5;
}

.dashboard {
  min-height: calc(100vh - 116px);
}

.map-panel {
  position: relative;
  min-height: calc(100vh - 116px);
  border: 1px solid #dde5ea;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

#map {
  display: block;
  width: 100%;
  height: calc(100vh - 116px);
  min-height: 760px;
  cursor: grab;
  touch-action: none;
}

#map:active {
  cursor: grabbing;
}

.region {
  fill: #eef2f4;
  stroke: #ffffff;
  stroke-width: 0.75;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 160ms ease, opacity 160ms ease;
}

.region:hover, .region.selected {
  fill: #ffd166;
}

.label {
  pointer-events: none;
  fill: #172026;
  font-size: 8px;
  font-weight: 800;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 2px;
  stroke-linejoin: round;
}

.label-small { font-size: 5px; }

.status {
  margin: 8px 0 0;
  color: #64737f;
  font-size: 12px;
}

.tooltip {
  position: fixed;
  z-index: 5;
  max-width: 240px;
  padding: 10px 12px;
  border: 1px solid #cfd8df;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(16, 24, 32, 0.16);
  font-size: 13px;
  pointer-events: none;
}

.tooltip strong {
  display: block;
  margin-bottom: 4px;
}

@media (max-width: 980px) {
  .shell { padding: 12px; }
  .topbar { align-items: start; flex-direction: column; }
  .dashboard { min-height: calc(100vh - 148px); }
  .map-panel { min-height: calc(100vh - 148px); }
  .label-small { font-size: 7px; }
  #map {
    height: calc(100vh - 148px);
    min-height: 620px;
  }
}

@media (max-width: 560px) {
  h1 { font-size: 22px; }
  .controls { width: 100%; }
  .segmented { flex: 1; }
  .segmented button { min-width: 0; }
}
