* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b1115; color: #e8edf1; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; }
#map { position: absolute; inset: 0; }

.hud {
  position: absolute; top: 16px; left: 16px; z-index: 5;
  max-width: 380px; background: rgba(11, 17, 21, 0.86); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 14px 16px;
}
.hud h1 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.01em; }
.hud p { margin: 0; font-size: 12.5px; line-height: 1.45; color: #b7c2ca; }
.status { margin-top: 8px; font-size: 11.5px; color: #7fd0e0; font-variant-numeric: tabular-nums; }
.case-btn {
  margin-top: 10px; width: 100%; text-align: left; background: rgba(127,208,224,0.1);
  border: 1px solid rgba(127,208,224,0.3); color: #7fd0e0; font-size: 11px; padding: 7px 9px;
  border-radius: 8px; cursor: pointer;
}
.case-btn:hover { background: rgba(127,208,224,0.18); }

.case {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 10;
  width: min(560px, 90vw); max-height: 82vh; overflow-y: auto;
  background: rgba(9, 13, 16, 0.97); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 16px; padding: 22px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.case h2 { margin: 0 0 12px; font-size: 17px; }
.case p { font-size: 12.5px; line-height: 1.55; color: #c3ccd1; margin: 0 0 12px; }
.case a { color: #7fd0e0; }
.case b { color: #e8edf1; }
.case .case-limit { color: #8b98a1; font-size: 11.5px; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 10px; }
.case .case-jump { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.case .case-jump button {
  background: rgba(127,208,224,0.12); border: 1px solid rgba(127,208,224,0.35); color: #7fd0e0;
  font-size: 11px; padding: 5px 10px; border-radius: 7px; cursor: pointer;
}
.case .case-jump button:hover { background: rgba(127,208,224,0.22); }
.case .close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: #8b98a1; font-size: 14px; cursor: pointer; }

@media (max-width: 900px) {
  .case { width: 92vw; padding: 18px; }
}

.panel {
  position: absolute; bottom: 16px; left: 16px; z-index: 5; width: 340px;
  background: rgba(11, 17, 21, 0.86); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 14px 16px;
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.panel-head h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: #8b98a1; }
#totalKm { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cbar-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-size: 11.5px; }
.cbar-label { width: 22px; text-align: right; color: #b7c2ca; font-variant-numeric: tabular-nums; }
.cbar-track { flex: 1; height: 7px; border-radius: 4px; background: rgba(255,255,255,0.06); overflow: hidden; }
.cbar-fill { height: 100%; }
.cbar-km { width: 62px; text-align: right; color: #b7c2ca; font-variant-numeric: tabular-nums; }
.hint { margin: 10px 0 0; font-size: 11px; color: #6c7982; line-height: 1.4; }
.nodata { margin: 8px 0 0; font-size: 10.5px; color: #6c7982; }

.legend {
  position: absolute; top: 16px; right: 16px; z-index: 5; width: 230px;
  background: rgba(11, 17, 21, 0.86); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 12px 14px;
}
.legend h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #8b98a1; }
.lg-row { display: flex; align-items: center; gap: 8px; font-size: 11px; margin: 3px 0; color: #d3dade; }
.sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }

.limits {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 4;
  background: rgba(6, 9, 11, 0.92); color: #8b98a1; font-size: 10.5px; line-height: 1.5;
  padding: 8px 16px 8px 372px; border-top: 1px solid rgba(255,255,255,0.06);
}
.limits a { color: #7fd0e0; }
.limits b { color: #d3dade; }

.detail {
  position: absolute; top: 16px; right: 262px; z-index: 6; width: 280px;
  background: rgba(11, 17, 21, 0.94); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 14px; padding: 14px 16px;
}
.detail h3 { margin: 0 4px 4px 0; font-size: 15px; padding-right: 22px; }
.detail .place { margin: 0 0 8px; font-size: 11.5px; color: #7fd0e0; }
.detail .corridor-km { margin: 0 0 8px; font-size: 12.5px; color: #d3dade; font-variant-numeric: tabular-nums; }
.detail .verdict { margin: 10px 0 0; font-size: 11px; color: #b7c2ca; line-height: 1.4; }
.detail .close { position: absolute; top: 10px; right: 10px; background: none; border: none; color: #8b98a1; font-size: 13px; cursor: pointer; }
.detail .loading { margin: 0; font-size: 12px; color: #8b98a1; }

@media (max-width: 900px) {
  .detail { position: static; width: auto; margin: 8px; }
}

@media (max-width: 900px) {
  .hud, .panel, .legend { position: static; width: auto; max-width: none; margin: 8px; }
  .limits { position: static; padding-left: 16px; }
  #map { position: relative; height: 60vh; }
}
