
html, body, #map { height: 100%; margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #08111d; }
body { overflow: hidden; }

#map { position: fixed; inset: 0; }

#topbar {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 10px;
  right: 10px;
  z-index: 1200;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
}
.brand, #lake, .pill {
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.brand {
  padding: 10px 12px;
  font-weight: 700;
  color: #0c1a2b;
  white-space: nowrap;
}
#lake {
  border: 0;
  padding: 10px 12px;
  font-size: 16px;
  min-width: 0;
}
.pill {
  grid-column: 1 / -1;
  padding: 8px 12px;
  font-size: 13px;
  color: #294056;
}
.pill.manual { color: #7d3800; }

#controls {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 102px);
  left: 10px;
  right: 10px;
  z-index: 1200;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.seg {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  color: #12263c;
  box-shadow: 0 8px 24px rgba(0,0,0,0.16);
  font-weight: 700;
  white-space: nowrap;
}
.seg.active {
  background: #0b63ff;
  color: white;
}

.sheet {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  z-index: 1200;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.22);
  padding: 12px 12px 10px;
}
.sheet-row { margin-bottom: 10px; }
.sheet-row.tight { margin-bottom: 8px; }
#status { color: #22384c; font-size: 13px; line-height: 1.35; white-space: pre-line; }
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.metric {
  background: rgba(245,248,252,0.95);
  border-radius: 12px;
  padding: 10px;
}
.metric-label { color: #586b80; font-size: 12px; margin-bottom: 4px; }
.metric-value { color: #10263b; font-weight: 800; font-size: 16px; }
.small { color: #4a5f75; font-size: 12px; line-height: 1.35; }
#advanced summary {
  cursor: pointer;
  font-weight: 700;
  color: #13283d;
  list-style: none;
}
#advanced summary::-webkit-details-marker { display: none; }
.advanced-grid { margin-top: 10px; display: grid; gap: 10px; }
.advanced-grid label { display: grid; gap: 6px; color: #21374d; font-size: 13px; }
.advanced-grid input[type='number'] {
  border: 1px solid #d7e0ea; border-radius: 10px; padding: 10px 12px; font-size: 16px;
}
.btnline { display: flex; gap: 8px; flex-wrap: wrap; }
.btnline button {
  border: 0; border-radius: 10px; padding: 10px 12px; background: #eef4fb; color: #11293f; font-weight: 700;
}
.hint { color: #5d6f82; font-size: 12px; line-height: 1.35; }

.pick-icon {
  color: #001c38;
  font-size: 22px;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(255,255,255,0.95);
}
.leaflet-control-scale { margin-bottom: 118px !important; }
.leaflet-control-attribution { font-size: 10px; }

@media (min-width: 920px) {
  #topbar { right: auto; width: 420px; }
  #controls { right: auto; width: 420px; }
  .sheet { right: auto; width: 420px; }
}
@media (display-mode: standalone) {
  .sheet { bottom: calc(env(safe-area-inset-bottom, 0px) + 6px); }
}
