* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #212121;
  background: #fff;
}

#app {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: 100vh;
}

@media (max-width: 720px) {
  #app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  #sidebar { max-height: 50vh; overflow-y: auto; }
}

#sidebar {
  background: #fafafa;
  border-right: 1px solid #e0e0e0;
  padding: 20px;
  overflow-y: auto;
}

h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.subtitle {
  color: #666;
  font-size: 13px;
  margin: 0 0 20px 0;
}

fieldset {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 12px;
  margin: 0 0 14px 0;
}

legend {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  padding: 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
  font-family: inherit;
}

.row {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 8px;
}

.check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
  font-size: 14px;
}

.check input {
  margin: 0;
}

.btn {
  display: block;
  width: 100%;
  padding: 9px;
  margin: 0 0 8px 0;
  border: 1px solid #1976d2;
  border-radius: 3px;
  background: #1976d2;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  background: #1565c0;
  border-color: #1565c0;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.secondary {
  background: #fff;
  color: #1976d2;
}

.btn.secondary:hover:not(:disabled) {
  background: #e3f2fd;
}

.status {
  background: #f0f0f0;
  border-radius: 4px;
  padding: 10px 12px;
  margin-top: 16px;
  font-size: 13px;
  white-space: pre-wrap;
}

.counts {
  color: #666;
  font-size: 12px;
  margin-top: 6px;
  white-space: pre-wrap;
}

.help {
  font-size: 11px;
  color: #888;
  margin: 4px 0 0 0;
}

#map { width: 100%; height: 100%; }
