html, body {
  margin: 0;
  height: 100%;
  font-family: "PingFang SC", "Helvetica Neue", sans-serif;
}

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

.panel {
  position: absolute;
  z-index: 1100;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.96);
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
  width: min(400px, 92vw);
  font-size: 13px;
  line-height: 1.45;
  color: #222;
  max-height: calc(100vh - 24px);
}

.panel-body {
  overflow-y: auto;
  min-height: 0;
}

.panel h1 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.privacy {
  font-size: 11px;
  color: #666;
  margin: 0 0 10px;
}

.row {
  margin: 6px 0;
}

.row label {
  display: block;
  font-size: 12px;
  color: #555;
  margin-bottom: 2px;
}

.row input[type="file"],
.row input[type="date"],
.row input[type="time"],
.row input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

.check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #444;
}

.check input {
  margin: 0;
}

.dt-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.dt-row .date-field { flex: 1.4; }
.dt-row .time-field { flex: 1; }

.hint {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
  flex-wrap: wrap;
}

button {
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
}

button.primary {
  background: #1a73e8;
  color: #fff;
}

button.secondary {
  background: #eef3fb;
  color: #1a73e8;
}

button.danger {
  background: #fdecea;
  color: #b00020;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#status {
  font-size: 12px;
  color: #444;
  margin-top: 8px;
  white-space: pre-wrap;
}

#status.warn { color: #a65c00; }
#status.err { color: #b00020; }

.file-name {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
  word-break: break-all;
}

.stats {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e5e5e5;
  font-size: 12px;
}

.stats p { margin: 3px 0; }

.section-title {
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

th, td {
  border-bottom: 1px solid #eee;
  padding: 3px 4px;
  text-align: left;
  white-space: nowrap;
}

td.num, th.num { text-align: right; }

.map-legend {
  position: fixed;
  z-index: 1000;
  top: 12px;
  /* Leaflet zoom is 26px + 10px margin at topright; keep a gap. */
  right: 56px;
  width: 220px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
  padding: 8px 10px;
  color: #222;
  pointer-events: none;
  box-sizing: border-box;
}

.leaflet-top.leaflet-right {
  z-index: 1101;
}

@media (max-width: 859px) {
  .map-legend {
    position: static;
    width: auto;
    margin-top: 10px;
    padding: 8px 0 0;
    border-top: 1px solid #e5e5e5;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    pointer-events: auto;
  }
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  font-size: 12px;
}

.swatch {
  width: 22px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot.hollow {
  background: transparent;
  border: 2px solid #888;
  box-sizing: border-box;
}

.note {
  margin-top: 8px;
  color: #666;
  font-size: 11px;
}

.hidden { display: none !important; }

.pick-bar {
  position: absolute;
  z-index: 1100;
  left: 12px;
  right: 12px;
  bottom: 28px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
  padding: 10px 12px;
  color: #222;
  font-size: 13px;
}

@media (min-width: 860px) {
  .pick-bar {
    left: 428px;
  }
}

.pick-idle {
  font-size: 12px;
  color: #555;
}

.pick-active {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
}

.pick-nav,
.pick-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.pick-info {
  flex: 1 1 180px;
  min-width: 160px;
  font-size: 12px;
  color: #444;
  white-space: pre-wrap;
  line-height: 1.4;
}

.pick-coords {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pick-coords label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: #555;
}

.pick-coords input {
  width: 132px;
  box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  padding: 5px 7px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
}
