* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: system-ui, sans-serif; }
#map { position: absolute; inset: 0; }

#panel {
  position: absolute; top: 12px; left: 12px; z-index: 10;
  width: 280px; padding: 16px;
  background: rgba(20, 24, 28, 0.92); color: #e8eaed;
  border-radius: 10px; box-shadow: 0 4px 18px rgba(0,0,0,.4);
  font-size: 13px;
}
#panel h1 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.hint { margin: 0 0 12px; color: #9aa0a6; }

label { display: block; margin-bottom: 12px; font-weight: 500; }
.row { display: flex; gap: 6px; margin-top: 4px; }
input[type="number"], input[type="text"], select {
  width: 100%; padding: 6px 8px; border-radius: 6px;
  border: 1px solid #3c4043; background: #202124; color: #e8eaed;
  font-size: 13px;
}
select { width: auto; }
input[type="range"] { width: 100%; margin-top: 6px; }

button {
  width: 100%; padding: 9px; margin-bottom: 12px;
  border: 0; border-radius: 6px; cursor: pointer;
  background: #2e7dd1; color: #fff; font-size: 14px; font-weight: 600;
}
button:disabled { background: #3c4043; color: #80868b; cursor: default; }

#status { min-height: 18px; color: #fbbc04; margin-bottom: 6px; }
#status.error { color: #f28b82; }
#stats { color: #9aa0a6; line-height: 1.5; white-space: pre-line; }

.legend { display: flex; gap: 14px; margin-top: 10px; color: #bdc1c6; }
.legend .sw {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  margin-right: 5px; vertical-align: -2px;
}
.sw.visible { background: rgba(46, 204, 113, .8); }
.sw.blocked { background: rgba(192, 57, 43, .7); }

.signal-scale { width: 100%; }
.signal-bar {
  height: 10px; border-radius: 5px;
  background: linear-gradient(to right,
    #2ecc71 0%, #2ecc71 25%, #f1c40f 32%, #e67e22 60%, #c0392b 90%);
}
.elev-bar {
  height: 10px; border-radius: 5px;
  background: linear-gradient(to right,
    #c0392b 0%, #c0392b 10%, #e67e22 36.7%, #f1c40f 63.3%, #2ecc71 90%, #2ecc71 100%);
}
.signal-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: #9aa0a6; margin-top: 3px;
}

#probe {
  position: absolute; display: none; z-index: 11; pointer-events: none;
  background: rgba(20, 24, 28, 0.94); color: #e8eaed;
  padding: 7px 10px; border-radius: 7px; font-size: 12px; line-height: 1.55;
  box-shadow: 0 3px 10px rgba(0,0,0,.4); white-space: nowrap;
}
#probe b { color: #fff; }
#probe .dbm { color: #8ab4f8; font-weight: 600; }

.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; margin: 0; }

.sw.lc-tree { background: rgba(34, 139, 34, .85); }
.sw.lc-shrub { background: rgba(154, 205, 50, .8); }
.sw.lc-built { background: rgba(110, 110, 120, .9); }

#toggle3d {
  background: #455a64; font-size: 15px; font-weight: 700;
  letter-spacing: 1px; padding: 10px;
}
#toggle3d:hover { background: #546e7a; }

.peak {
  font-size: 18px; line-height: 1; cursor: pointer;
  color: #f6b93b; -webkit-text-stroke: 1px #5d4210;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.peak:hover { transform: scale(1.3); }

.peak-popup { font: 13px/1.5 system-ui, sans-serif; color: #202124; }
.peak-popup button {
  margin-top: 6px; padding: 5px 10px; width: auto;
  border: 0; border-radius: 5px; cursor: pointer;
  background: #2e7dd1; color: #fff; font-size: 12px; font-weight: 600;
}
