* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
}

body {
    display: flex;
}

#sidebar {
    width: 320px;
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
    padding: 12px;
    background: #fafafa;
    border-right: 1px solid #ddd;
}

#sidebar h1 {
    font-size: 16px;
    margin: 0 0 12px 0;
}

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

.section {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
}

.section label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.section select {
    width: 100%;
    padding: 4px;
}

.section input[type="range"] {
    width: 80%;
    vertical-align: middle;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 6px;
}

.section-header button {
    font-size: 12px;
    padding: 2px 8px;
    cursor: pointer;
}

.filter-row {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    padding: 6px;
    margin-bottom: 8px;
}

.filter-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.filter-row-header select {
    flex-grow: 1;
    padding: 2px;
}

.filter-row-header button {
    font-size: 12px;
    cursor: pointer;
}

.filter-values {
    max-height: 160px;
    overflow-y: auto;
}

.filter-values label {
    display: block;
    font-weight: normal;
    margin: 0;
    padding: 1px 0;
    cursor: pointer;
}

.goto-row {
    display: flex;
    gap: 6px;
}

.goto-row input {
    flex-grow: 1;
    min-width: 0;
    padding: 3px 5px;
}

.goto-row input.invalid {
    border: 1px solid #d00;
    outline-color: #d00;
}

.goto-row button {
    cursor: pointer;
}

.date-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.date-row-label {
    width: 36px;
    flex-shrink: 0;
    font-weight: 600;
}

.date-row input {
    flex-grow: 1;
    min-width: 0;
    padding: 2px 3px;
    font-size: 12px;
}

.legend-entry {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1px 0;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border: 1px solid #999;
}

.legend-gradient {
    width: 140px;
    height: 14px;
    flex-shrink: 0;
    border: 1px solid #999;
    background: linear-gradient(to right, #000, #fff);
}

#basemap-note {
    font-size: 12px;
    color: #666;
}

.section .checkbox-label {
    font-weight: normal;
    margin-top: 6px;
    cursor: pointer;
}

.section-note {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.point-popup {
    font-size: 13px;
    line-height: 1.5;
}

/* user-select: all makes one click select the whole "lat, lng" string for
   copying into Google Earth or similar. */
.point-popup-coords {
    font-family: monospace;
    user-select: all;
    margin-bottom: 4px;
}

.point-popup-nodata {
    color: #666;
}
