* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body, #viewDiv {
    padding: 0;
    margin: 0;
    height: 100%;
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#map-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
}

#sidebar {
    width: 318px;
    max-width: 100%;
    background-color: #f4f2ee;
    border-right: 1px solid #d8d4cc;
    overflow-y: auto;
    z-index: 200;
    padding: 12px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

#sidebar-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #d8d4cc;
}

.sidebar-title-block {
    min-width: 0;
}

#sidebar-header h1 {
    font-size: 17px;
    line-height: 1.25;
    margin: 0 0 10px;
    color: #1e1c18;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

.map-embed-widgets--top-left {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.map-embed-widgets--top-left > * {
    pointer-events: auto;
}

/* Matches ArcGIS / Calcite widget chrome (home, zoom) — compact square + flyout */
.map-basemap-picker {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.map-basemap-picker__trigger {
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0px solid rgba(110, 110, 110, 0.35);
    border-radius: 2px;
    background: #fff;
    color: #6e6e6e;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.map-basemap-picker__trigger:hover {
    color: #2e2e2e;
    background: #f3f3f3;
    border-color: rgba(110, 110, 110, 0.55);
}

.map-basemap-picker__trigger:focus-visible {
    outline: 2px solid #0079c1;
    outline-offset: 2px;
}

.map-basemap-picker__trigger .esri-icon {
    font-size: 16px;
    line-height: 1;
    display: block;
}

.map-basemap-picker__menu {
    position: absolute;
    left: calc(100% + 8px);
    top: 0;
    z-index: 70;
    min-width: 232px;
    max-height: min(70vh, 360px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
    background: #fff;
    border: 1px solid rgba(110, 110, 110, 0.35);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* `[hidden]` alone loses to `display: flex` above — mirror flood-ramp-picker */
.map-basemap-picker__menu[hidden] {
    display: none !important;
}

.map-basemap-picker__option {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: none;
    border-radius: 2px;
    background: transparent;
    font: inherit;
    font-size: 12px;
    line-height: 1.35;
    text-align: left;
    color: #2e2e2e;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.map-basemap-picker__option:hover {
    background: #f3f3f3;
}

.map-basemap-picker__option[aria-selected="true"] {
    background: #e2f1fb;
    font-weight: 600;
}

.sidebar-title-block .watershed-picker {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.watershed-btn {
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding: 8px 10px;
    border: 2px solid #d8d4cc;
    border-radius: 6px;
    background: #faf9f6;
    color: #1e1c18;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.watershed-btn:hover {
    border-color: #b8a99a;
    background: #fff;
}

.watershed-btn.is-active {
    border-color: #2d6a8f;
    background: #f0f8fc;
    box-shadow: 0 0 0 1px rgba(45, 106, 143, 0.25);
}

#viewDiv {
    width: 100%;
    height: 100%;
    border-radius: 0;
    position: relative;
    z-index: 0;
}

.homes-hover-popup {
    position: absolute;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 168px;
    max-width: 220px;
    padding: 10px 12px;
    font-size: 11px;
    line-height: 1.45;
    color: #2c2820;
    background: rgba(255, 254, 251, 0.97);
    border: 1px solid #d8d4cc;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.04);
    pointer-events: none;
    left: 0;
    top: 0;
}

.homes-hover-popup[hidden] {
    display: none !important;
}

.homes-hover-popup__title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b6358;
    padding-bottom: 6px;
    margin-bottom: 2px;
    border-bottom: 1px solid #e8e4dc;
}

.homes-hover-popup__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.homes-hover-popup__label {
    color: #5c564a;
    font-weight: 600;
}

.homes-hover-popup__value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #1e1c18;
}

/* Leaflet specific adjustments */
.leaflet-container {
    background-color: #f0f0f0;
}

.leaflet-control-attribution {
    font-size: 11px;
}

.leaflet-bottom.leaflet-right {
    z-index: 999;
}

.leaflet-control-zoom {
    z-index: 999 !important;
}

.leaflet-control-home {
    background-color: white;
    border: 2px solid #ccc;
    cursor: pointer;
    transition: background-color 0.2s;
}

.leaflet-control-home:hover {
    background-color: #f4f4f4;
}

.leaflet-control-home:active {
    background-color: #e8e8e8;
}

.sidebar-body {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.panel-details {
    background: #fffefb;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.panel-details-summary {
    cursor: pointer;
    list-style: none;
    font-size: 12px;
    font-weight: 700;
    color: #2c2820;
    padding: 9px 12px;
    user-select: none;
    border-radius: 7px;
}

.panel-details-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.panel-details-summary__text {
    min-width: 0;
}

.panel-details-summary__arrow {
    flex-shrink: 0;
    font-size: 10px;
    line-height: 1;
    font-weight: 600;
    color: #5c564a;
}

.panel-details-summary__arrow::before {
    content: "▲";
}

.panel-details[open] > .panel-details-summary .panel-details-summary__arrow::before {
    content: "▼";
}

@keyframes about-comparison-summary-attention {
    0% {
        outline: 2px solid transparent;
        outline-offset: 2px;
    }
    40% {
        outline: 2px solid #c45c26;
        outline-offset: 2px;
    }
    100% {
        outline: 2px solid transparent;
        outline-offset: 2px;
    }
}

.panel-details-summary--attention {
    animation: about-comparison-summary-attention 0.7s ease-in-out 2;
}

@media (prefers-reduced-motion: reduce) {
    .panel-details-summary--attention {
        animation: none;
    }
}

.panel-details-summary::-webkit-details-marker {
    display: none;
}

.panel-details[open] > .panel-details-summary {
    border-bottom: 1px solid #e8e4dc;
}

.panel-details-body {
    padding: 10px 12px 11px;
}

.narrative-heading {
    font-size: 13px;
    font-weight: 700;
    color: #2c2820;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}

.narrative-lede {
    font-size: 12px;
    line-height: 1.5;
    color: #454038;
    margin: 0 0 10px;
}

.narrative-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    line-height: 1.5;
    color: #5c564a;
}

.narrative-list li {
    margin-bottom: 8px;
}

.narrative-list li:last-child {
    margin-bottom: 0;
}

.narrative-term {
    font-weight: 700;
    color: #2c2820;
}

.narrative-step {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    padding: 14px;
}

.narrative-step--tight {
    padding: 10px 11px 11px;
}

.narrative-step--compact {
    padding-bottom: 12px;
}

.step-header-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.step-header-row .step-title {
    margin-bottom: 0;
}

.homes-step-header {
    justify-content: space-between;
}

.homes-step-header__title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.homes-step-header__title-group .step-title--inline {
    flex: 0 1 auto;
}

.step-title--inline {
    flex: 1;
    min-width: 0;
}

.tip-wrap {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.tip-wrap:hover,
.tip-wrap.has-open-tip {
    z-index: 300;
}

.tip-trigger {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid #c9c2b6;
    border-radius: 50%;
    background: #faf9f6;
    color: #5c564a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.tip-trigger:hover,
.tip-trigger:focus-visible {
    border-color: #a69d8f;
    background: #fff;
    color: #2c2820;
    outline: none;
}

.tip-bubble {
    position: fixed;
    left: -9999px;
    top: -9999px;
    width: 252px;
    max-width: calc(100vw - 16px);
    max-height: min(220px, 42vh);
    overflow-x: hidden;
    overflow-y: auto;
    font-size: 11px;
    line-height: 1.45;
    color: #454038;
    background: #fffefb;
    border: 1px solid #d8d4cc;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.04);
    padding: 10px 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-3px);
    transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
    z-index: 400;
}

.tip-bubble strong {
    color: #2c2820;
    font-weight: 700;
}

.tip-wrap:hover .tip-bubble,
.tip-wrap:focus-within .tip-bubble,
.tip-wrap.has-open-tip .tip-bubble {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.step-title {
    font-size: 12px;
    font-weight: 700;
    color: #2c2820;
    margin: 0 0 8px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.step-title--plain {
    margin-bottom: 10px;
}

.step-copy {
    font-size: 12px;
    line-height: 1.45;
    color: #5c564a;
    margin: 0 0 12px;
}

.scenario-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scenario-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    padding: 9px 12px;
    border: 2px solid #d8d4cc;
    border-radius: 8px;
    background: #faf9f6;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.scenario-btn:hover {
    border-color: #b8a99a;
    background: #fff;
}

.scenario-btn.is-active {
    border-color: #c45c26;
    background: #fff8f3;
    box-shadow: 0 0 0 1px rgba(196, 92, 38, 0.25);
}

.scenario-btn-title {
    font-size: 12px;
    font-weight: 700;
    color: #1e1c18;
}

.homes-control-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.homes-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    background: #f7f4ef;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    font-size: 11px;
    color: #454038;
}

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

.homes-legend-item--with-count {
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.homes-legend-lead {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.homes-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid #a69d8f;
    flex-shrink: 0;
}

.homes-legend-swatch--flooded {
    background: #ff8c00;
}

.homes-legend-label {
    line-height: 1.2;
}

.homes-flooded-stat__value {
    flex-shrink: 0;
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #c45c26;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.homes-flooded-stat__value--pending {
    color: #9a948a;
    opacity: 0.55;
}

.homes-visibility-switch {
    position: relative;
    box-sizing: border-box;
    width: 40px;
    height: 22px;
    padding: 0;
    border: 2px solid #c9c2b6;
    border-radius: 11px;
    background: #e8e4dc;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s, background 0.2s;
}

.homes-visibility-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #9a9a9a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, background 0.2s ease;
    pointer-events: none;
}

.homes-visibility-switch:hover {
    border-color: #b8a99a;
    background: #f0ebe3;
}

.homes-visibility-switch:focus-visible {
    outline: 2px solid #2f7ed8;
    outline-offset: 2px;
}

.homes-visibility-switch.is-active::after {
    transform: translateX(18px);
    background: #2f7ed8;
}

.scenario-hint {
    margin: 8px 0 0;
    font-size: 11px;
    line-height: 1.35;
    color: #5c564a;
    padding: 6px 9px;
    background: #f7f4ef;
    border-radius: 6px;
    border-left: 3px solid #c45c26;
    cursor: help;
}

.scenario-hint--compact {
    margin-top: 6px;
    font-style: normal;
}

.narrative-search {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    padding: 14px;
}

.narrative-search--tight {
    padding: 10px 11px 11px;
}

.search-heading-row__title {
    font-size: 12px;
    font-weight: 700;
    color: #2c2820;
    margin: 0;
    flex: 1;
    min-width: 0;
}

#search-widget-container {
    width: 100%;
    min-height: 40px;
}

#search-widget-container arcgis-search {
    display: block;
    width: 100%;
    font-family: inherit;
}

#search-widget-container .esri-search {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-shadow: none;
    background: #fff;
    font-family: inherit;
}

#search-widget-container .esri-search__input {
    font-size: 12px;
    font-family: inherit;
    color: #333;
}

#search-widget-container .esri-search__input::placeholder {
    color: #888;
}

#search-widget-container .esri-search__input:focus {
    outline: none;
}

#search-widget-container .esri-search__submit-button,
#search-widget-container .esri-search__sources-button {
    border-radius: 0 1px 1px 0;
    border-color: #ccc;
    background-color: #fff;
    color: #333;
}

#search-widget-container .esri-search__submit-button:hover,
#search-widget-container .esri-search__sources-button:hover {
    background-color: #f5f5f5;
    color: #2c2820;
}

#search-widget-container .esri-search__input {
    border-radius: 0;
}

#search-widget-container .esri-search:focus-within {
    border-color: #0099ff;
    box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.1);
}

#search-widget-container .esri-menu {
    font-size: 12px;
    font-family: inherit;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

#opacity-control,
#depth-filter-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

#opacity-control label,
#depth-filter-control label {
    font-weight: 600;
    color: #333;
    font-size: 12px;
}

.depth-filter-hint {
    margin: 0;
    font-size: 10px;
    line-height: 1.4;
    color: #6b6358;
}

#opacity-container,
#depth-filter-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

#opacity-slider,
#depth-filter-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#opacity-slider::-webkit-slider-thumb,
#depth-filter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0099ff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
}

#opacity-slider::-webkit-slider-thumb:hover,
#depth-filter-slider::-webkit-slider-thumb:hover {
    background: #0079c1;
}

#opacity-slider::-moz-range-thumb,
#depth-filter-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0099ff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
}

#opacity-slider::-moz-range-thumb:hover,
#depth-filter-slider::-moz-range-thumb:hover {
    background: #0079c1;
}

#opacity-value {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    min-width: 30px;
    text-align: right;
}

#depth-filter-value {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    min-width: 42px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

#flood-legend {
    position: absolute;
    left: calc(318px + 14px);
    right: auto;
    bottom: 25px;
    transform: none;
    background-color: rgba(255, 255, 255, 0.92);
    padding: 10px 12px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 150;
    width: auto;
    min-width: 148px;
    max-width: min(200px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    pointer-events: auto;
    overflow: visible;
}

/* Color ramp picker (gradient bars only) — bottom of flood legend */
.flood-ramp-picker-root {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.flood-ramp-picker {
    position: relative;
    width: 100%;
}

.flood-ramp-picker__trigger {
    display: block;
    width: 100%;
    padding: 3px;
    margin: 0;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.flood-ramp-picker__trigger:hover {
    border-color: rgba(0, 121, 193, 0.45);
}

.flood-ramp-picker__trigger:focus {
    outline: none;
    border-color: #0079c1;
    box-shadow: 0 0 0 2px rgba(0, 121, 193, 0.2);
}

.flood-ramp-picker__trigger[aria-expanded="true"] {
    border-color: #0079c1;
}

.flood-ramp-picker__trigger-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.flood-ramp-picker__trigger-bar {
    display: block;
    flex: 1;
    min-width: 0;
    height: 14px;
    border-radius: 2px;
    background-color: #ccc;
    background-size: 100% 100%;
}

/* Points right when closed (menu opens to the right of the legend); flips when open */
.flood-ramp-picker__chevron {
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid rgba(44, 40, 32, 0.72);
    transition: transform 0.18s ease;
    transform-origin: 40% 50%;
}

.flood-ramp-picker__trigger[aria-expanded="true"] .flood-ramp-picker__chevron {
    transform: rotate(180deg);
}

.flood-ramp-picker__menu {
    position: absolute;
    left: calc(100% + 20px);
    right: auto;
    top: auto;
    bottom: 0;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: none;
    z-index: 220;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.14);
    max-height: min(70vh, 340px);
    overflow-y: auto;
}

.flood-ramp-picker__menu[hidden] {
    display: none !important;
}

.flood-ramp-picker__option {
    display: block;
    width: 100%;
    padding: 2px;
    margin: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.12s;
}

.flood-ramp-picker__option:hover,
.flood-ramp-picker__option:focus {
    outline: none;
    border-color: rgba(0, 121, 193, 0.35);
}

.flood-ramp-picker__option[aria-selected="true"] {
    border-color: #0079c1;
}

.flood-ramp-picker__option-bar {
    display: block;
    width: 100%;
    height: 10px;
    border-radius: 2px;
    background-color: #ddd;
    background-size: 100% 100%;
}

#flood-legend .flood-legend-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 0 2px;
    padding: 0 0 8px;
    border-bottom: 2px solid #c45c26;
}

#flood-legend h3 {
    font-size: 12px;
    margin: 0;
    padding: 0;
    color: #2c2820;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    text-align: center;
    border: none;
}

/* Flood legend help: open only via click, not hover */
.tip-wrap.tip-wrap--click-only:hover .tip-bubble,
.tip-wrap.tip-wrap--click-only:focus-within .tip-bubble {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-3px);
}

.tip-wrap.tip-wrap--click-only.has-open-tip .tip-bubble {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.tip-bubble.tip-bubble--long {
    max-height: min(72vh, 560px);
}

.tip-flood-legend-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tip-flood-legend-body p {
    margin: 0;
}

.legend-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    margin: 0;
    border-radius: 0;
}

.legend-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid #999;
}

.legend-text {
    display: flex;
    flex-direction: column;
    font-size: 12px;
}

.legend-label {
    font-weight: 500;
    color: #333;
}

.legend-depth {
    color: #666;
    font-size: 11px;
}

/* Sidebar scrollbar styling */
#sidebar::-webkit-scrollbar {
    width: 8px;
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive design */
@media (max-width: 768px) {
    #sidebar {
        width: min(320px, 92vw);
    }

    #flood-legend {
        left: calc(min(320px, 92vw) + 36px);
        right: auto;
        bottom: 25px;
        max-width: min(180px, calc(100vw - min(320px, 92vw) - 24px));
    }
}
