:root {
  --panel-bg: rgba(255, 255, 255, 0.96);
  --border: rgba(0, 0, 0, 0.12);
  --muted: rgba(0, 0, 0, 0.6);
  --btn-bg: #111;
  --btn-fg: #fff;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

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

#panel {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 420px;
  max-width: calc(100vw - 20px);
  height: 70vh;
  max-height: calc(100vh - 20px);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}

.panelHeader {
  padding: 10px 12px 8px 12px;
  border-bottom: 1px solid var(--border);
}

#panelHandle {
  width: 60px;
  height: 6px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.2);
  margin: 2px auto 10px auto;
  touch-action: none;
}

.titleRow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.title {
  font-weight: 800;
  font-size: 18px;
}

.status {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.btn {
  border: 2px solid #1e5bff;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f7f9ff;
  color: #111;
  font-weight: 700;
  font-size: 13px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.btn:hover {
  background: #eef3ff;
}

.chk {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #1e5bff;
  border-radius: 4px;
  background: #fff;
  display: inline-grid;
  place-content: center;
}

.chk:checked::after {
  content: "";
  width: 8px;
  height: 8px;
  background: #1e5bff;
  border-radius: 2px;
}

.hours {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

#hours {
  border-radius: 8px;
  padding: 4px 6px;
}

.searchRow input {
  width: 100%;
  padding: 10px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
}

.mapLabel {
  position: absolute;
  transform: translate(-50%, -100%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 700;
  color: #111;
  white-space: nowrap;
  pointer-events: none;
}

.mapLabel--wind {
  color: #0047ff;
  border-color: rgba(0, 71, 255, 0.5);
}

.zoneTree {
  padding: 10px 10px 14px 10px;
  overflow: auto;
  flex: 1;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.parentRow,
.childRow {
  display: grid;
  grid-template-columns: 22px 26px 1fr;
  align-items: center;
  gap: 8px;
  padding: 7px 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.expBtn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  width: 26px;
  height: 26px;
  font-weight: 800;
  cursor: pointer;
}

.parentName {
  font-weight: 800;
  font-size: 14px;
}

.parentMeta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.parentDetails,
.childDetails {
  margin: 6px 0 10px 26px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
}

.jsonBlock {
  margin: 0;
  font-size: 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.childTime {
  font-weight: 700;
  font-size: 13px;
}

.childMeta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Mobile: bottom sheet */
@media (max-width: 700px) {
  #panel {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    width: auto;
    height: 55vh;
    border-radius: 18px;
  }

  .parentRow,
  .childRow {
    padding: 6px 6px;
    gap: 6px;
  }

  .parentName {
    font-size: 13px;
  }

  .childTime {
    font-size: 12px;
  }

  .btn {
    padding: 8px 10px;
  }
}
