:root {
  --armanino-blue: #009cde;
  --armanino-orange: #CF7F00;
  --oz2-urban: #cf7f00;
  --oz2-rural: #949300;
  --panel-bg: rgba(255, 255, 255, 0.94);
  --panel-border: rgba(20, 28, 38, 0.18);
  --text: #17202a;
  --muted: #5d6875;
  --shadow: 0 12px 30px rgba(18, 28, 38, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  margin: 0;
}

body {
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.oz-map-app {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

button,
input {
  font: inherit;
}

.toolbar {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(240px, 420px);
  gap: 12px;
  align-items: start;
  pointer-events: none;
}

.brand,
.search,
.map-legend,
.info-panel {
  pointer-events: auto;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 12px;
}

.title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
}

.subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.search {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px;
}

.search[hidden] {
  display: none;
}

.search input {
  min-width: 0;
  height: 45px;
  border: 1px solid #b9c2cc;
  border-radius: 4px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
}

.search button {
  height: 45px;
  border: 0;
  border-radius: 4px;
  padding: 0 14px;
  color: #fff;
  background: var(--armanino-orange);
  cursor: pointer;
  height: 45px;
  border: 0;
  border-radius: 4px;
  padding: 0 14px;
  color: #fff;
  background: var(--armanino-orange);
  cursor: pointer;
  margin: 2px;
}

.search button:disabled {
  cursor: default;
  opacity: 0.55;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.search-results.is-open {
  display: block;
}

.search-result {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e3e7eb;
  border-radius: 0;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.search-result:hover,
.search-result:focus {
  background: #DA720F;
  color: #fff;
  opacity: .8;
  transition: opacity .2s,color .2s;
}

.search-result-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.search-result-note {
  padding: 8px 12px;
  color: var(--muted);
  background: #f6f8fa;
  border-top: 1px solid #e3e7eb;
  font-size: 11px;
}

.map-legend {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
}

.legend-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

.legend-row {
  display: grid;
  grid-template-columns: 16px 18px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 24px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.legend-row + .legend-row {
  margin-top: 6px;
}

.legend-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--armanino-blue);
}

.legend-swatch {
  display: block;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(0, 0, 0, 0.22);
}

.legend-swatch-oz1 {
  background: #009cde;
}

.legend-swatch-rural {
  background: #949300;
}

.legend-swatch-urban {
  background: #cf7f00;
}

.info-panel {
  position: absolute;
  right: 16px;
  bottom: 24px;
  z-index: 3;
  width: min(360px, calc(100vw - 32px));
  padding: 16px;
}

.info-panel:not(.is-open) {
  display: none;
}

.close-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus {
  color: var(--text);
  background: #edf1f4;
}

.panel-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.info-panel h1 {
  margin: 5px 32px 14px 0;
  font-size: 19px;
  line-height: 1.25;
}

.info-panel dl {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  gap: 9px 14px;
  margin: 0;
}

.info-panel dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.info-panel dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.maplibregl-popup-content {
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.map-logo {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  width: 200px;
  height: 200px;
  pointer-events: none;
}

.map-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.8;
}

@media (max-width: 760px) {
  .toolbar {
    grid-template-columns: 1fr;
    right: 12px;
    left: 12px;
    top: 12px;
  }

  .brand {
    min-height: 48px;
  }

  .search {
    grid-template-columns: 1fr 82px;
  }

  .map-legend {
    top: auto;
    right: 12px;
    bottom: 116px;
    width: calc(100vw - 24px);
  }

  .info-panel {
    right: 12px;
    bottom: 16px;
    width: calc(100vw - 24px);
  }

  .map-logo {
    width: 96px;
    height: 96px;
  }
}
