:root {
  --bg: #1e2430;
  --panel: #273041;
  --panel-2: #2f3a4f;
  --text: #e7ecf3;
  --muted: #9aa7bd;
  --accent: #4f9dff;
  --border: #3a465c;
  --sidebar-w: 340px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

.zoom-hint {
  position: absolute;
  top: 14px;
  left: calc(50% + var(--sidebar-w) / 2);
  transform: translateX(-50%);
  background: rgba(20, 26, 36, 0.9);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 5;
  pointer-events: none;
}
.zoom-hint[hidden] {
  display: none;
}

#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

#map {
  flex: 1;
  height: 100%;
}

.side-head {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.side-head h1 {
  font-size: 18px;
  margin: 0 0 12px;
}

.panel {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.panel h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 12px;
}

.side-foot {
  margin-top: auto;
  padding: 16px;
  font-size: 11px;
}

.muted {
  color: var(--muted);
}

.attribution {
  margin: 8px 0 0;
  line-height: 1.4;
}

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.btn:hover {
  filter: brightness(1.08);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-small {
  padding: 4px 8px;
  font-size: 12px;
  background: var(--panel-2);
}
.btn-danger {
  background: #c0433f;
}

#user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.filter-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.legend {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.legend .swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.legend .count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.legend .tag-delete {
  margin-left: 8px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 4px;
}
.legend .tag-delete:hover {
  background: #c0433f;
  color: #fff;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.detail dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  font-size: 13px;
}
.detail dt {
  color: var(--muted);
}
.detail dd {
  margin: 0;
  word-break: break-word;
}

.detail .field {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.detail label {
  color: var(--muted);
}
.detail input,
.detail textarea {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px;
  font: inherit;
}
.detail textarea {
  min-height: 60px;
  resize: vertical;
}

.detail .actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.tag-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  color: #10151f;
  font-weight: 600;
}

.maplibregl-popup-content {
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  font-size: 13px;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
  border-top-color: var(--panel);
}
