* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #222;
  background: #fff;
}

body { display: flex; }

#panel {
  width: 320px;
  flex: none;
  overflow-y: auto;
  padding: 14px 14px 10px;
  border-right: 1px solid #ddd;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#map { flex: 1; height: 100%; }

h1 { font-size: 15px; margin: 0 0 2px; }

#description { margin: -6px 0 0; color: #555; font-size: 12px; }
#description a { color: inherit; }

#controls { display: flex; flex-direction: column; gap: 12px; }
#panel[hidden], #controls[hidden], [hidden] { display: none; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-weight: 600; color: #444; }

select, input[type=number] {
  font: inherit;
  padding: 3px 4px;
  border: 1px solid #bbb;
  border-radius: 3px;
  background: #fff;
}

.pair { display: flex; align-items: center; gap: 8px; }
.pair input[type=range] { flex: 1; min-width: 0; }
.pair input[type=number] { width: 64px; }

input[type=range] { width: 100%; margin: 0; }

.legend { margin-top: -4px; }
#legend-bar { height: 12px; border: 1px solid #bbb; border-radius: 2px; }
.legend-labels { display: flex; justify-content: space-between; color: #555; font-size: 11px; }

.hint { margin: 0; color: #666; font-size: 12px; }

/* ---- point values chart ---- */
#point { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid #ddd; padding-top: 10px; }
#point[hidden] { display: none; }
.point-head { display: flex; justify-content: space-between; align-items: center; }
.point-title { font-weight: 600; color: #444; }
#point-close {
  border: 0; background: none; padding: 0 2px; cursor: pointer;
  font: inherit; font-size: 17px; line-height: 1; color: #777;
}
#point-close:hover { color: #222; }
.point-sub { margin-top: -4px; color: #666; font-size: 11px; }
#point-body { transition: opacity .15s; }
#point-body.loading { opacity: .4; }
#point-status { margin: 0; color: #666; font-size: 11px; }
#point-status:empty { display: none; }
#point-status.error { color: #b00020; }

.chart-svg { display: block; cursor: crosshair; touch-action: pan-y; }
.chart-svg:focus { outline: none; }
.chart-svg:focus-visible { outline: 2px solid #2a78d6; outline-offset: 2px; border-radius: 2px; }
.chart-svg text { font-size: 10px; fill: #898781; font-variant-numeric: tabular-nums; }
.chart-svg .grid { stroke: #e1e0d9; }
.chart-svg .axis { stroke: #c3c2b7; }
.chart-svg .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .crosshair { stroke: #898781; }
.chart-svg .hover-dot { stroke: #fafafa; stroke-width: 2; }

.readout { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 12px; }
.readout-head { font-weight: 600; color: #444; }
.readout-row { display: flex; align-items: center; gap: 6px; }
.readout-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.readout-name { flex: 1; min-width: 0; color: #555; }
.readout-value { font-weight: 600; color: #222; font-variant-numeric: tabular-nums; }

#status { margin: 0; min-height: 1.4em; color: #666; font-size: 12px; }
#status.error { color: #b00020; }
