html, body { margin: 0; padding: 0; height: 100%; }
#map { width: 100%; height: 100vh; }

/* Mode control — top right */
.am-mode-control {
  position: absolute; top: 10px; right: 10px;
  background: rgba(20,20,28,0.88); color: #e8e8e8;
  padding: 10px 14px; border-radius: 6px; z-index: 10;
  font-size: 13px; backdrop-filter: blur(4px); min-width: 180px;
}
.am-mode-title { font-weight:600; font-size:11px; text-transform:uppercase;
  letter-spacing:.05em; color:#999; margin-bottom:6px; }
.am-mode-control select {
  width: 100%; background: rgba(255,255,255,0.08); color: #e8e8e8;
  border: 1px solid rgba(255,255,255,0.2); border-radius: 4px;
  padding: 4px 6px; font-size: 13px; cursor: pointer; margin-bottom: 8px;
}
.am-basemap-btns { display:flex; gap:6px; }
.am-basemap-btns button {
  flex:1; background: rgba(255,255,255,0.08); color: #e8e8e8;
  border: 1px solid rgba(255,255,255,0.2); border-radius: 4px;
  padding: 4px; font-size: 12px; cursor: pointer;
}
.am-basemap-btns button.active { background: rgba(255,255,255,0.25); }

/* Legend — bottom left */
.am-legend {
  position:absolute; bottom:36px; left:10px;
  background: rgba(20,20,28,0.88); color:#e8e8e8;
  padding:10px 14px; border-radius:6px; z-index:10;
  font-size:12px; max-height:55vh; overflow-y:auto;
  backdrop-filter:blur(4px);
}
.am-legend-title { font-weight:600; margin-bottom:8px; }
.am-swatch { display:flex; align-items:center; margin:3px 0; }
.am-swatch span { display:inline-block; width:13px; height:13px;
  border-radius:2px; margin-right:7px; flex-shrink:0; }

/* MapLibre popup overrides */
.maplibregl-popup-content {
  background: rgba(20,20,28,0.95); color: #e8e8e8;
  border-radius: 6px; padding: 12px 14px; font-size: 13px;
  line-height: 1.6; max-height: 70vh; overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6); min-width: 380px;
}
.maplibregl-popup-close-button { color: #aaa; font-size: 16px; }
.maplibregl-popup-close-button:hover { color: #fff; }
.maplibregl-popup-tip { border-top-color: rgba(20,20,28,0.95) !important; }

/* Popup content */
.am-popup h5 { margin: 6px 0 2px; font-size: 13px; color: #7fcdbb; }
.am-year-range { font-size: 11px; color: #777; margin: 0 0 6px; }
.am-popup ul { margin: 0 0 8px; padding-left: 16px; }
.am-popup li { margin: 2px 0; }
.am-more-btn {
  display: block; margin-top: 8px; width: 100%;
  background: rgba(65,182,196,0.2); color: #41b6c4;
  border: 1px solid rgba(65,182,196,0.4); border-radius: 4px;
  padding: 5px; font-size: 12px; cursor: pointer;
}
.am-more-btn:hover { background: rgba(65,182,196,0.35); }

/* Tax roster table */
.am-roster { width:100%; border-collapse:collapse; font-size:11px; margin-top:6px; }
.am-roster th { color:#999; font-weight:600; border-bottom:1px solid rgba(255,255,255,0.1);
  padding:2px 4px; text-align:left; }
.am-roster td { padding:2px 4px; border-bottom:1px solid rgba(255,255,255,0.05); }

/* Chart */
.am-chart-controls { display:flex; gap:4px; margin:8px 0 4px; }
.am-chart-btn {
  flex:1; background: rgba(255,255,255,0.07); color:#bbb;
  border: 1px solid rgba(255,255,255,0.18); border-radius:4px;
  padding: 3px 0; font-size:11px; cursor:pointer;
}
.am-chart-btn:hover { background: rgba(255,255,255,0.14); }
.am-chart-btn.active { background: rgba(65,182,196,0.25); color:#41b6c4;
  border-color: rgba(65,182,196,0.5); }
.am-chart { margin:4px 0 0; }
.am-chart-legend { display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  font-size:11px; color:#aaa; margin-top:5px; }
.am-chart-legend-item { display:flex; align-items:center; gap:5px; }
.am-chart-legend-item span { display:inline-block; width:11px; height:11px;
  border-radius:2px; flex-shrink:0; }
.am-chart-legend-years { color:#777; font-size:10px; }

/* Hover tooltip for chart bars / dots */
.am-chart-tip {
  position: fixed;
  background: rgba(20,20,28,0.97);
  color: #e8e8e8;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.4;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
  display: none;
}

/* Mode control: allow scrolling if filters make it tall */
.am-mode-control { max-height: calc(100vh - 30px); overflow-y: auto; }

/* Separator */
.am-sep { border: none; border-top: 1px solid rgba(255,255,255,0.12); margin: 8px 0; }

/* Filter header row */
.am-filter-header { display: flex; justify-content: space-between; align-items: center; }
.am-filter-badge { color: #41b6c4; font-size: 10px; margin-left: 5px; vertical-align: middle; }
.am-filter-toggle {
  background: none; border: none; color: #999; cursor: pointer;
  font-size: 11px; padding: 0 2px; line-height: 1;
}
.am-filter-toggle:hover { color: #e8e8e8; }

/* Collapsible filter panel */
.am-filter-panel { margin-top: 6px; }
.am-filter-collapsed { display: none; }

/* Preset buttons */
.am-preset-btns { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.am-preset-btn {
  background: rgba(255,255,255,0.07); color: #ccc;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 3px;
  padding: 3px 7px; font-size: 11px; cursor: pointer;
}
.am-preset-btn:hover { background: rgba(255,255,255,0.14); }
.am-preset-btn.active {
  background: rgba(65,182,196,0.25); color: #41b6c4;
  border-color: rgba(65,182,196,0.5);
}

/* Individual filter rows */
.am-filter-row { margin-bottom: 7px; }
.am-filter-row label { display: block; font-size: 11px; color: #888; margin-bottom: 3px; }
.am-filter-row select,
.am-filter-row input[type="text"],
.am-filter-row input[type="number"] {
  background: rgba(255,255,255,0.07); color: #e8e8e8;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 3px;
  padding: 3px 5px; font-size: 12px;
}
.am-filter-row select { width: 100%; cursor: pointer; }
.am-filter-row input[type="text"] { width: 100%; box-sizing: border-box; }

/* Range inputs (min – max) */
.am-filter-range { display: flex; align-items: center; gap: 4px; }
.am-filter-range input[type="number"] { flex: 1; min-width: 0; width: 0; }
.am-filter-range span { color: #555; font-size: 11px; flex-shrink: 0; }
