html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: #263238;
}

* {
  box-sizing: border-box;
}

#app {
  display: flex;
  width: 100%;
  height: 100%;
  background: #f5f5f5;
}

.sidebar {
  width: 420px;
  max-width: 34vw;
  min-width: 320px;
  background: #f1f1f1;
  border-right: 1px solid #d3d3d3;
  overflow-y: auto;
}

.sidebar-header {
  background: #a7aaad;
  color: #fff;
  padding: 28px 26px 22px;
}

.sidebar-header h1 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 700;
}

.sidebar-header div {
  font-size: 14px;
}

.sidebar-section {
  padding: 22px 26px;
  background: #fff;
  border-bottom: 1px solid #e1e1e1;
}

.sidebar-section h2 {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 700;
  color: #37474f;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.summary-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #607d8b;
  margin-bottom: 6px;
}

.summary-value {
  font-size: 28px;
  font-weight: 700;
}

.summary-text {
  font-size: 14px;
  line-height: 1.4;
}

.top-gap {
  margin-top: 18px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
}

.legend-swatch {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.18);
  flex: 0 0 auto;
}

.ward-info.empty {
  color: #607d8b;
  font-style: italic;
}

.ward-info-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.ward-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
  background: #eceff1;
  color: #37474f;
}

.ward-status.declared {
  background: #dcedc8;
  color: #33691e;
}

.ward-meta {
  font-size: 14px;
  margin-bottom: 12px;
}

.vote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.vote-table th,
.vote-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #eceff1;
  text-align: left;
}

.vote-table td:last-child,
.vote-table th:last-child {
  text-align: right;
}

.map-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

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

.ol-popup {
  position: absolute;
  background-color: white;
  padding: 20px 20px 16px;
  border-radius: 12px;
  border: 1px solid #d5d5d5;
  bottom: auto;
  top: 16px;
  left: -50px;
  min-width: 320px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  max-height: 55vh;
  overflow-y: auto;
}

.ol-popup:after, .ol-popup:before {
  top: 100%;
  border: solid transparent;
  content: " ";
  height: 0;
  width: 0;
  position: absolute;
  pointer-events: none;
}

.ol-popup:after {
  border-top-color: white;
  border-width: 12px;
  left: 44px;
  margin-left: -12px;
}

.ol-popup:before {
  border-top-color: #d5d5d5;
  border-width: 13px;
  left: 44px;
  margin-left: -13px;
}

.popup-closer {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #9e9e9e;
}

.popup-title {
  font-size: 20px;
  font-weight: 700;
  padding-right: 24px;
  margin-bottom: 14px;
}

.popup-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid #dcdcdc;
  font-size: 15px;
}

.popup-small {
  margin-top: 12px;
  color: #607d8b;
  font-size: 13px;
}

@media (max-width: 950px) {
  #app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 44%;
  }

  .map-wrap {
    height: 56%;
  }
}

.ward-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ward-item {
  padding: 8px 10px;
  border-radius: 6px;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 14px;
}

.ward-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ward-item:hover {
  background: #e0e0e0;
}

.ward-item.selected {
  background: #cfd8dc;
  font-weight: 600;
}

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

.map-wrap {
  position: relative;
}

#map {
  position: relative;
  z-index: 1;
}


#lastChecked {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 4px;
}