:root {
  --accent: #d1652b;
  --accent-dark: #a94e1f;
  --ink: #1f1c17;
  --ink-soft: #55504a;
  --border: #e7e2d8;
  --cream: #faf8f4;
  --panel-width: 360px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
}

body {
  display: flex;
  flex-direction: column;
}

html.embed-mode .topbar {
  display: none;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.wordmark-accent {
  color: var(--accent);
}

.topbar-sub {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 400;
}

.map-shell {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

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

.floating-panel {
  position: absolute;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(31, 28, 23, 0.08);
}

.search-panel {
  top: 16px;
  left: 16px;
  padding: 0;
}

#search-input {
  width: 240px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  border: none;
  border-radius: 10px;
  outline: none;
  background: transparent;
}

#search-input::placeholder {
  color: #a8a29a;
}

#search-input:focus {
  box-shadow: 0 0 0 2px var(--accent);
  border-radius: 10px;
}

.counter-chip {
  top: 16px;
  right: 16px;
  padding: 9px 16px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
}

#counter-value {
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-dark);
}

.counter-label {
  color: var(--ink-soft);
}

.legend {
  bottom: 16px;
  right: 16px;
  padding: 12px 14px;
  font-size: 12px;
  min-width: 150px;
}

.legend-title {
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 8px;
  color: var(--ink);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--ink-soft);
}
.legend-row[data-category] {
  cursor: pointer;
  padding: 3px 6px;
  margin: 0 -6px 2px;
  border-radius: 6px;
}
.legend-row[data-category]:hover {
  background: rgba(0, 0, 0, 0.05);
}
.legend-row[data-category].active {
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink);
  font-weight: 600;
}
.legend-clear {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  margin-top: 4px;
  padding: 3px 6px;
  margin-left: -6px;
  border-radius: 6px;
}
.legend-clear:hover {
  background: rgba(0, 0, 0, 0.05);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.side-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: var(--panel-width);
  background: #ffffff;
  border-left: 1px solid var(--border);
  box-shadow: -6px 0 24px rgba(31, 28, 23, 0.1);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  z-index: 10;
}

.side-panel.open {
  transform: translateX(0);
}

.panel-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.panel-close:hover {
  background: var(--border);
}

.panel-content {
  padding: 56px 28px 28px;
}

.panel-name {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  color: var(--ink);
}

.panel-field {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.panel-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a8a29a;
  margin-bottom: 3px;
}

.panel-field-value {
  font-size: 14px;
  color: var(--ink);
  word-break: break-word;
}

.panel-field-value a {
  color: var(--accent);
  text-decoration: none;
}

.panel-field-value a:hover {
  text-decoration: underline;
}

.attribution {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 6px 20px;
  font-size: 11px;
  color: var(--ink-soft);
  background: #ffffff;
  border-top: 1px solid var(--border);
}

.attribution a {
  color: var(--ink-soft);
}

.maplibregl-ctrl-attrib {
  font-size: 10px;
}
