button#downloadRainCsv {
    margin-left: 5px;
}

button#downloadObsCsv {
    margin-left: 5px;
}

button#obsSettings {
    margin-right: 5px;
}

#rainGaugeSpinner {
    margin-top: -45px;
}

#obsFilterMode {
    border-radius: 5px;
}

#filtersettings {
    border-radius: 5px;
    max-width: 60%;
}

/* Chrome, Safari, Edge, Opera */
#filtersettings::-webkit-outer-spin-button,
#filtersettings::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
#filtersettings[type="number"] {
    -moz-appearance: textfield;
}


#weatherObsSpinner {
    margin-top: -66px;
}

#weatherObsInfo {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    font-size: 14px;
}

.model_legend {
    grid-column: 13;
    grid-row: 7/16;
    place-self: center end;
    /* vertical center, right-aligned horizontally */
    z-index: 5000;

    width: auto;
    /* fixed width or auto */
    max-height: 70vh;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(44, 66, 94, 0.75);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    color: #eef3ff;
    font: 600 12px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    user-select: none;
    backdrop-filter: blur(2px);
    display: none;
    margin-right: 10px;
    padding: 10px;
}

.model_legend__title,
.model_legend__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
}

#LegendClose {
    appearance: none;
    border: 0;
    background: transparent;
    color: #cfe0ff;
    font-size: 16px;
    cursor: pointer;
}

/* .model_legend__grid {
    display: grid;
    grid-template-columns: auto 24px 24px auto;
    gap: 4px 6px;
    padding: 10px 10px 8px 10px;
    align-items: center;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.model_legend__grid::-webkit-scrollbar {
    display: none;
}

.model_legend__row {
    display: contents;
}

.model_legend__label,
.model_legend__label--right {
    position: relative;
    top: -9px;
    margin-top: 0;
    display: block;
}


.model_legend__label,
.model_legend__label--right {
    white-space: nowrap;
    font-weight: 400;
    font-size: 11px;
}

.model_legend__label {
    text-align: right;
    color: #d7e5ff;
    opacity: .85;
    font-weight: 400;
}

.model_legend__label--right {
    text-align: left;
}

.model_legend__swatch {
    width: 24px;
    height: 14px;
    border-radius: 3px;
} */

/* highlight for hover-matched bin (both columns) */
/* .model_legend__swatch.is-hot {
    outline: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .5), 0 0 10px rgba(255, 255, 255, .35) inset;
}

.model_legend__label.is-hot {
    color: #fff;
    text-shadow: 0 0 4px rgba(255, 255, 255, .35);
} */


/* existing grid (default two-column split = 4 cells/row) */
.model_legend__grid {
    display: grid;
    grid-template-columns: auto 24px 24px auto;
    gap: 0px 6px;
    padding: 10px 10px 8px 10px;
    align-items: center;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.model_legend__grid::-webkit-scrollbar {
    display: none;
}

/* NEW: single-column mode (applied to wrapper) */
.model_legend--single .model_legend__grid {
    grid-template-columns: 24px auto;
    /* swatch, label */
}

/* label styling (shared) */
.model_legend__label,
.model_legend__label--right {
    position: relative;
    /* old was top: -9px for 14px swatches; new height is 7px, so adjust: 7/2 + 4/2 ≈ 6 */
    top: -6px;
    display: block;
    white-space: nowrap;
    font-weight: 400;
    font-size: 11px;
}

.model_legend__label {
    text-align: right;
    color: #ffffff;
    opacity: .85;
}

/* right label aligns left in both modes */
.model_legend__label--right {
    text-align: left;
}

/* swatch size: HALF HEIGHT */
.model_legend__swatch {
    width: 24px;
    height: 14px;
    /* was 14px */
    /* border-radius: 3px; */
}

/* highlight stays the same */
.model_legend__swatch.is-hot {
    outline: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .5), 0 0 10px rgba(255, 255, 255, .35) inset;
    z-index: 2;
}

.model_legend__label.is-hot {
    color: #fff;
    text-shadow: 0 0 4px rgba(255, 255, 255, .35);
}

.slider-wrap {
    position: relative;
    display: inline-block;
}

#weather-time-slider {
    position: relative;
    z-index: 2;
    /* keep the thumb above everything */
}

#date-ticks {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 50%;
    /* push ticks down so baseline aligns with track */
    height: 24px;
    pointer-events: none;
    z-index: 2;
    /* above track, below thumb */
}


#date-ticks-svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* simple classes so you can theme later */
.range__tick {
    fill: rgba(255, 255, 255, 0.8);
}

/* long tick */
.range__tick--major {
    height: 14px;
    fill: rgba(255, 255, 255, 0.9);
}

.range__label {
    font-size: 10px;
    fill: rgba(255, 255, 255, 0.9);
    dominant-baseline: middle;
    pointer-events: none;
}

/* short tick */
.range__tick--minor {
    height: 8px;
    fill: rgba(255, 255, 255, 0.6);
}

.modelsDiv #models-close {
    position: absolute;
    top: 4px;
    right: 8px;
    line-height: 1;
}

.modelsDiv {
    top: 10px;
    height: 96px;
    z-index: 3;
    display: none;
    width: 760px;
    grid-column: 6;
    grid-row: 3;
}

.model-buttons-container {
    /* display: flex; */
    flex-wrap: wrap;
    /* gap: 8px; */
    /* space between buttons */
    margin: 12px;
    /* space before the “sliders” row */
}

/* --- ICON BUTTONS (top row) --- */
.model-buttons-container .ModelBut {
    flex: 0 1 120px;
    /* basis:120px, shrink allowed */
    padding: 5px 15px;
    white-space: nowrap;
    /* keep icon centered */
    background-color: rgb(29, 52, 76);
    border: none;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    width: 62px;
    /* icon size */
}

.model-buttons-container .ModelBut:hover {
    background-color: rgb(229, 132, 17);
}

/* container for each dropdown */
.DropdownModels {
    position: relative;
    display: inline-block;
    margin: 4px;
}

/* --- DROPDOWN PANEL --- */
.DropdownModels .Dropdown-Content {
    display: none;
    position: absolute;
    top: 100%;
    /* sit flush below icon */
    left: 0;
    background: #20527c;
    /* match blue */
    border-radius: 6px;
    z-index: 1000;
    overflow: visible;
    min-width: 180px;
    width: max-content;
    max-width: 280px;
    padding: 0;
    /* no inner padding */
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

.DropdownModels:hover .Dropdown-Content {
    display: block;
}

/* --- DROPDOWN ITEMS --- */
.ModelButDrop {
    display: block;
    width: 100%;
    background: none;
    border: 0;
    color: #fff;
    text-align: left;
    padding: 8px 12px;
    cursor: pointer;
    white-space: normal;
    /* allow wrapping */
    line-height: 1.3;
}

.ModelButDrop:hover {
    background: #1a4366;
    /* hover colour same as Overlays */
}

.ModelButDrop:disabled {
    opacity: .6;
    cursor: default;
}

/* --- SLIDER + INFO ROW --- */
.model-sliders-container {
    display: flex;
    gap: 8px;
    min-height: 40px;
    /* adjust to taste */
}

#time-container {
    font-family: Arial, sans-serif;
    margin-left: 10px;
}

#model-pointer-data {
    width: 120px;
    font-weight: 400;
    color: #fff;
    text-shadow: 0px 0px 10px #0007;
    pointer-events: none;
    text-align: left;
    padding-left: 20px;
    font-size: 16px;
}

.ModelsSettingsPopup {
    display: none;
    overflow: auto;
    z-index: 15;
    /* bottom: 100px; */
    background-color: rgba(29, 52, 76, 1);
    transition-duration: 2s;
    text-align: left;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

#modelrun {
    width: 150px;
}

#weather-time-slider {
    width: 380px;
}

#model-time-text {
    font-size: 16px;
    font-weight: 600;
    width: 150px;
    text-align: left;
}

#models-top-section {
    display: flex;
    /* justify-content: space-around; */
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

#weather-play-pause-bt {
    width: 70px;
}

#WeatherSettingsPopup {
    position: fixed;
    /* not absolute */
    display: none;
    z-index: 2000;
    font-size: 14px;
    padding: 5px 8px;
    /* 5px top/bottom, 8px left/right */
    box-sizing: border-box;
    /* ensure padding doesn’t shrink content */
}


.setting-row {
    display: flex;
    flex-direction: column;
    /* force label above control */
}

.setting-row .popupDesc {
    margin-bottom: 2px;
    /* tighter gap between label and input */
}

/* Highlighted (active) state for main buttons */
.ModelBut.is-selected,
#ForecastLayerBut.is-selected {
    background-color: rgb(229, 132, 17);
    border-color: rgb(229, 132, 17);
    color: #fff;
    /* optional, keeps text readable */
}

/* Highlighted (active) state for submenu items */
.ModelButDrop.is-active {
    background-color: rgb(229, 132, 17);
    border-color: rgb(229, 132, 17);
    color: #fff;
}