:root {
    --bg: #f2f6fb;
    --bg-soft: #e8eff8;
    --text: #132235;
    --text-muted: #52657c;
    --brand: #1f4d7f;
    --brand-dark: #16375b;
    --card: #ffffff;
    --border: #d9e4f0;
    --shadow: 0 16px 35px rgba(16, 34, 56, 0.1);
    color-scheme: light dark;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    background: radial-gradient(circle at top right, #f9fcff 0%, var(--bg) 45%, #edf3fa 100%);
    color: var(--text);
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-wrap: break-word;
}

/* Follow the operating-system theme without requiring a separate preference.
   These tokens keep controls, data tables, and chart surrounds at accessible
   contrast while leaving the photographic header/navigation intentionally dark. */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1b1b1b;
        --bg-soft: #222222;
        --text: #f1f1f1;
        --text-muted: #b9b9b9;
        --brand: #78a9d4;
        --brand-dark: #a9c7e2;
        --card: #252525;
        --border: #3d3d3d;
        --shadow: 0 16px 35px rgba(0, 0, 0, 0.34);
    }

    body {
        background: #1b1b1b;
    }

    .breadcrumb-wrap {
        background: #242424;
        border-color: #3d3d3d;
    }

    .breadcrumb,
    .breadcrumb a,
    .breadcrumb-sep,
    .current-dam p,
    .current-elevation-label,
    .graph-explainer,
    .chart-note,
    .lake-level-caption,
    .energy-target-compare-controls label {
        color: var(--text-muted);
    }

    .lake-background::after {
        background: linear-gradient(to bottom, rgba(27, 27, 27, 0.38) 0%, rgba(27, 27, 27, 0.82) 55%, #1b1b1b 100%);
    }

    .lake-background .current-dam,
    .lake-background .card {
        background: rgba(37, 37, 37, 0.94);
    }

    .ad-zone {
        border-color: #3b3b3b;
        background: rgba(36, 36, 36, 0.55);
    }

    .current-dam {
        background: #252525;
        box-shadow: var(--shadow);
    }

    .card {
        box-shadow: var(--shadow);
    }

    .chart {
        background: #242424;
        border-color: var(--border);
    }

    .range-btn,
    select,
    input,
    .g3-day-nav {
        background-color: #2b2b2b;
        border-color: #4a4a4a;
        color: var(--text);
    }

    .range-btn:hover {
        background: #353535;
    }

    .range-btn.active {
        background: linear-gradient(120deg, #245b8b, #347fbd);
        color: #ffffff;
        border-color: #67ade7;
    }

    .g3-day-nav:disabled,
    #g3-date:disabled,
    #g4-date:disabled {
        color: #8293a6;
        background: #222222;
        border-color: #3a3a3a;
    }

    .energy-unit-table,
    .energy-target-table {
        background: #222222;
    }

    .energy-unit-table th,
    .energy-unit-table td,
    .energy-target-table th,
    .energy-target-table td {
        border-color: #424242;
        color: var(--text);
    }

    .energy-unit-table thead th,
    .energy-unit-table tbody th,
    .energy-target-table thead th {
        background: #2d2d2d;
    }

    .energy-target-month-total td {
        background: #333333;
    }
}

/* Reclamation-style hourly release schedule. */
.release-schedule-card {
    overflow: hidden;
}

.card .chart.release-unit-schedule {
    --release-accent: #073cc8;
    height: auto;
    min-height: 280px;
    overflow: hidden;
    background: #ffffff;
}

.card .chart.release-unit-schedule--parker {
    --release-accent: #a40b13;
}

.release-schedule-heading {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(170px, 1fr) minmax(240px, 1.4fr);
    align-items: center;
    min-height: 88px;
    border-bottom: 1px solid #d5deea;
}

.release-schedule-date,
.release-schedule-dam {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    padding: 10px 14px;
    text-align: center;
}

.release-schedule-date {
    border-right: 1px solid #d5deea;
}

.release-schedule-date strong,
.release-schedule-dam strong {
    color: #152b45;
    font-size: clamp(1rem, 2vw, 1.35rem);
    line-height: 1.15;
}

.release-schedule-date span,
.release-schedule-dam span {
    color: var(--release-accent);
    font-size: 0.9rem;
    font-weight: 800;
}

.release-unit-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 10px 14px;
    color: #455a72;
    font-size: 0.78rem;
    font-weight: 700;
}

.release-unit-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.release-unit-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.release-unit-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    table-layout: fixed;
    color: #132235;
    font-variant-numeric: tabular-nums;
}

.release-unit-table th,
.release-unit-table td {
    border: 0;
    padding: 5px 8px;
    vertical-align: middle;
}

.release-unit-table thead th {
    padding-top: 11px;
    padding-bottom: 8px;
    color: #152b45;
    border-bottom: 1px solid #d5deea;
    font-size: 0.9rem;
    line-height: 1.15;
    text-align: center;
}

.release-unit-table thead small {
    display: block;
    margin-top: 2px;
    font-size: 0.7rem;
}

.release-time-column {
    width: 30%;
    border-right: 1px solid #d5deea !important;
}

.release-cfs-column {
    width: 20%;
}

.release-time-period {
    width: 30%;
    color: #263a50;
    border-right: 1px solid #d5deea !important;
    font-size: clamp(0.76rem, 1.5vw, 0.9rem);
    font-weight: 750;
    text-align: center;
    white-space: nowrap;
}

.release-unit-count {
    width: 12%;
    color: var(--release-accent);
    font-size: 0.95rem;
    font-weight: 850;
    text-align: right;
}

.release-unit-markers {
    width: 38%;
    color: #8a97a7;
    white-space: nowrap;
}

.release-unit-marker {
    display: inline-block;
    width: 19px;
    height: 19px;
    margin-right: 5px;
    border: 1.5px solid #111820;
    border-radius: 50%;
    background: var(--release-accent);
    vertical-align: middle;
}

.release-unit-marker--half {
    width: 10px;
    border-radius: 19px 0 0 19px;
}

.release-cfs-value {
    width: 20%;
    padding-right: 16px !important;
    color: var(--release-accent);
    font-size: 0.95rem;
    font-weight: 850;
    text-align: right;
}

.release-unit-table tbody tr:nth-child(even) {
    background: #f5f8fc;
}

.release-unit-table tbody tr:hover {
    background: #eaf2fb;
}

@media (max-width: 700px) {
    .release-schedule-heading {
        grid-template-columns: 1fr 1.2fr;
    }

    .release-unit-table {
        min-width: 0;
    }

    .release-unit-legend {
        grid-column: 1 / -1;
        border-top: 1px solid #d5deea;
    }

    .release-unit-table th,
    .release-unit-table td {
        padding-left: 4px;
        padding-right: 4px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .release-cfs-value {
        padding-right: 8px !important;
    }

    .release-unit-marker {
        width: 16px;
        height: 16px;
        margin-right: 3px;
    }

    .release-unit-marker--half {
        width: 8px;
        border-radius: 16px 0 0 16px;
    }
}

@media (prefers-color-scheme: dark) {
    .card .chart.release-unit-schedule {
        background: #14171b;
    }

    .release-schedule-heading,
    .release-schedule-date,
    .release-unit-table thead th,
    .release-time-column,
    .release-time-period,
    .release-unit-legend {
        border-color: #30353d !important;
    }

    .release-schedule-date strong,
    .release-schedule-dam strong,
    .release-unit-table,
    .release-unit-table thead th,
    .release-time-period {
        color: #edf2f7;
    }

    .release-unit-legend {
        color: #b8c0ca;
    }

    .release-unit-table tbody tr:nth-child(even) {
        background: #191d23;
    }

    .release-unit-table tbody tr:hover {
        background: #222933;
    }

    .release-unit-marker {
        border-color: #e0e5eb;
    }
}

/* Dark theme finishing layer.
   Keep the interface deliberately neutral: one near-black canvas, two surface
   elevations, and a single blue accent. Chart series retain their colors only
   where color carries meaning. */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1115;
        --bg-soft: #15181d;
        --text: #f3f5f7;
        --text-muted: #b8c0ca;
        --brand: #8fc5f4;
        --brand-dark: #b4d9f8;
        --card: #181b20;
        --border: #30353d;
        --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    }

    body {
        background: var(--bg);
    }

    .site-title-band::before {
        background: linear-gradient(100deg, rgba(13, 16, 21, 0.9), rgba(22, 28, 35, 0.84)), url("../images/Hoover.jpg");
        filter: saturate(0.18);
        opacity: 1;
    }

    .weather-widget {
        background: rgba(15, 17, 21, 0.72);
        border-color: rgba(255, 255, 255, 0.2);
    }

    .weather-condition,
    .weather-metrics {
        color: #d7dce2;
    }

    .lake-background {
        background: var(--bg-soft);
        border: 1px solid #252a31;
    }

    .lake-background::before,
    .lake-background::after {
        display: none;
    }

    .lake-background .current-dam,
    .lake-background .card,
    .current-dam,
    .card {
        background: var(--card);
        border-color: var(--border);
        box-shadow: var(--shadow);
        backdrop-filter: none;
    }

    .current-dam p,
    .current-elevation-label,
    .card p,
    .graph-explainer,
    .chart-note,
    .lake-level-caption,
    .energy-target-compare-controls label {
        color: var(--text-muted);
    }

    .card h2,
    .card h3,
    .current-elevation {
        color: var(--brand-dark);
    }

    .chart {
        background: #14171b;
        border-color: var(--border);
    }

    #about-elevation-asof,
    #g3-daily-asof,
    #g4-daily-asof,
    #g3-date,
    #g4-date,
    .g3-day-nav,
    .range-btn,
    select,
    input {
        background-color: #1d2127;
        border-color: #424954;
        color: var(--text);
    }

    .range-btn:hover,
    .g3-day-nav:hover:not(:disabled) {
        background: #292f38;
    }

    .range-btn.active {
        background: #8fc5f4;
        border-color: #8fc5f4;
        color: #0b1721;
        box-shadow: none;
    }

    .energy-unit-table,
    .energy-target-table {
        background: #15181d;
    }

    .energy-unit-table th,
    .energy-unit-table td,
    .energy-target-table th,
    .energy-target-table td {
        border-color: var(--border);
        color: var(--text);
    }

    .energy-unit-table thead th,
    .energy-unit-table tbody th,
    .energy-target-table thead th {
        background: #20242b;
    }

    .energy-target-month-total td {
        background: #242a32;
    }

    :focus-visible {
        outline: 2px solid #8fc5f4;
        outline-offset: 2px;
    }
}

.site-title-band {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    padding: 24px 28px;
    text-align: left;
    box-shadow: 0 10px 24px rgba(6, 20, 36, 0.28);
}

.site-title-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(10, 25, 40, 0.7), rgba(17, 52, 88, 0.55) 60%, rgba(30, 75, 119, 0.55)), url("../images/Hoover.jpg");
    background-size: cover;
    background-position: center;
    opacity: 0.92;
    z-index: 0;
}

.site-title-band h1 {
    margin: 0;
    font-size: clamp(1.8rem, 2vw, 2.25rem);
    letter-spacing: 0.01em;
}

.site-title-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-title-band > * {
    position: relative;
    z-index: 1;
}

.weather-widget {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 9px 14px;
    border: 1px solid rgba(206, 227, 248, 0.4);
    border-radius: 14px;
    background: rgba(13, 29, 47, 0.42);
    backdrop-filter: blur(4px);
    font-size: 13px;
    min-width: 280px;
    margin-left: auto;
}

.weather-main,
.weather-detail {
    display: flex;
    align-items: center;
    gap: 8px;
}

.weather-city {
    font-weight: 700;
}

.weather-condition {
    color: #d5e1ef;
    font-weight: 600;
}

.weather-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.weather-metrics {
    color: #d5e1ef;
    opacity: 0.92;
    font-size: 12px;
}

.weather-temp {
    display: none;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
}

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

.site-nav {
    background: linear-gradient(180deg, #0b2d52 0%, #123e6f 62%, rgba(18, 62, 111, 0.82) 100%);
    padding: 6px 20px;
    position: relative;
    overflow: visible;
    z-index: 50;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.nav-toggle {
    display: none;
    border: 1px solid #49617a;
    background: #1b2734;
    color: #fff;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
}

.site-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-start;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    color: #ecf4ff;
    text-decoration: none;
    padding: 12px 16px;
    min-height: 42px;
    box-sizing: border-box;
    border-radius: 0;
    background: transparent;
    line-height: 18px;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.site-nav-list > .nav-item:first-child .nav-link {
    border-left: none;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active,
.nav-item.active-top > .nav-lake-row .nav-link {
    background: rgba(7, 22, 40, 0.34);
    color: #ffffff;
}

.nav-lake-row {
    display: flex;
}

.nav-lake-row .nav-link {
    width: 100%;
}

.lake-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lake-nav-caret {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.95;
}

.nav-lake-row:hover .nav-link,
.nav-lake-row:focus-within .nav-link {
    background: rgba(7, 22, 40, 0.34);
    color: #ffffff;
}

.dropdown-menu {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 240px;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    background: #082a4b;
    border: 1px solid rgba(151, 187, 225, 0.35);
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 18px 28px rgba(4, 19, 34, 0.35);
    z-index: 100;
}

.dropdown-link {
    display: block;
    color: #f1f7ff;
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 0;
    font-weight: 600;
}

.dropdown-link:hover,
.dropdown-link:focus-visible,
.dropdown-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.nav-item.has-dropdown:hover > .dropdown-menu,
.nav-item.has-dropdown:focus-within > .dropdown-menu,
.nav-item.has-dropdown.open > .dropdown-menu {
    display: block;
}

.breadcrumb-wrap {
    background: linear-gradient(0deg, #edf3fa, #f6f9fe);
    border-top: 1px solid #cfddeb;
    border-bottom: 1px solid #d8e3ef;
    padding: 6px 26px;
}

.breadcrumb {
    font-size: 13px;
    color: #667789;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
}

.breadcrumb a {
    color: #4d627a;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    color: #9caabc;
}

.main-content-shell {
    max-width: 1840px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 220px;
    gap: 24px;
    padding: 30px 26px;
}

.main-content-container {
    max-width: 1320px;
    width: 100%;
    margin: 0;
    min-width: 0;
}

.lake-background {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 18px;
}

.lake-background::before {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    opacity: 0.28;
    z-index: 0;
}

.lake-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.72) 55%, #ffffff 100%);
    z-index: 1;
}

.lake-background .main-content {
    position: relative;
    z-index: 2;
}

.lake-background-lake-mead::before {
    background-image: url("../images/Penstocks.jpg");
}

.lake-background-lake-havasu::before {
    background-image: url("../images/Parker.jpg");
}

.lake-background .current-dam,
.lake-background .card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(1px);
}

.main-content {
    min-width: 0;
}

.ad-zone {
    min-height: 100%;
    border: 1px dashed #cfdae8;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(247, 251, 255, 0.2));
}

.current-dam {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    background: linear-gradient(130deg, #f9fcff, #edf4fb);
    border: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(20, 48, 79, 0.06);
}

.current-dam h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.05;
}

.current-dam-meta {
    min-width: 0;
}

.current-dam p {
    margin: 2px 0 0;
    font-size: 14px;
    line-height: 1.2;
    color: #5f6b7a;
}

.current-elevation {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 110px;
    color: var(--brand-dark);
}

.current-elevation-value {
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    line-height: 1;
    font-weight: 800;
}

.current-elevation-label {
    margin-top: 2px;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5f6b7a;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dashboard-grid.single-column {
    grid-template-columns: 1fr;
    gap: 12px;
}

.card {
    background-color: var(--card);
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(15, 37, 63, 0.08);
    min-width: 0;
}

.card h2,
.card h3 {
    margin: 0;
    line-height: 1.15;
    color: var(--brand-dark);
}

.card p {
    color: var(--text-muted);
}

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

.card-header h3 {
    font-size: clamp(1.15rem, 2.7vw, 1.55rem);
    letter-spacing: 0;
}

.graph-explainer {
    margin: 0;
    font-size: 14px;
    color: #3f516d;
    line-height: 1.6;
}

.range-buttons {
    display: flex;
    gap: 6px;
}

.range-btn {
    padding: 6px 10px;
    border: 1px solid #c5d4e5;
    cursor: pointer;
    background: #ffffff;
    border-radius: 999px;
    font-size: 13px;
    color: #28415d;
    transition: all 0.2s ease;
}

.range-btn:hover {
    background: #eef5fc;
}

.range-btn.active {
    background: linear-gradient(120deg, var(--brand-dark), var(--brand));
    color: white;
    border-color: var(--brand-dark);
}

.chart {
    height: 280px;
    margin-top: 8px;
    background: linear-gradient(180deg, #f8fbff, #f0f6fd);
    border-radius: 10px;
    border: 1px solid #dbe6f3;
}

.chart--elevation-stretched {
    height: 560px;
}


.about-grid {
    gap: 10px;
}

.chart--about-elevation {
    height: 322px;
    margin-top: 6px;
}

.about-elevation-card {
    padding: 10px 14px;
}

#about-elevation-asof {
    padding: 6px 8px;
    border: 1px solid #c4d3e4;
    border-radius: 8px;
    font-size: 13px;
    background-color: #fff;
    max-width: 280px;
}

.graph-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.graph-controls-daily {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#g3-daily-asof,
#g4-daily-asof {
    padding: 6px 8px;
    border: 1px solid #c4d3e4;
    border-radius: 8px;
    font-size: 13px;
    background-color: #fff;
    max-width: 280px;
}

.g3-day-nav {
    width: 28px;
    height: 28px;
    border: 1px solid #c7d6e6;
    border-radius: 8px;
    background: #ffffff;
    color: #2d4662;
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
}

.g3-day-nav:disabled {
    cursor: not-allowed;
    color: #9aa4b2;
    background: #edf1f6;
    border-color: #d8dee7;
}

#g3-date,
#g4-date {
    padding: 6px 8px;
    border: 1px solid #c4d3e4;
    border-radius: 8px;
    font-size: 13px;
    background-color: #fff;
}

#g3-date:disabled,
#g4-date:disabled {
    background-color: #e9edf2;
    color: #808080;
}

.chart-note {
    margin-top: 12px;
    min-height: 18px;
    color: #4e637c;
    font-size: 13px;
}

.lake-level-visual-card {
    overflow: hidden;
}

.lake-level-visual {
    position: relative;
    margin-top: 10px;
    border: 1px solid #d5e1ef;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1 / 2;
    background: #d8d8d8;
    --water-level: 0%;
    --lake-level-bottom-offset: 14.2%;
    --lake-level-scale: 0.492;
    --profile-crop-top: 0%;
}

.lake-level-image {
    position: absolute;
    display: block;
    width: 100%;
    height: calc(100% + var(--profile-crop-top));
    top: calc(-1 * var(--profile-crop-top));
    left: 0;
    object-fit: fill;
}

.lake-level-water {
    position: absolute;
    left: 0;
    /* Calibrated to Hoover_Profile pixels: bedrock top -> full-capacity black line. */
    width: 62.5%;
    bottom: calc(var(--lake-level-bottom-offset) - 2px);
    height: calc(var(--water-level) * var(--lake-level-scale));
    min-height: 0;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(36, 125, 222, 0.68), rgba(18, 86, 175, 0.76));
    border-top: 2px solid rgba(145, 220, 255, 0.75);
    pointer-events: none;
    transition: height 700ms ease;
}

.lake-level-current-marker {
    position: absolute;
    left: 8px;
    bottom: calc(var(--lake-level-bottom-offset) + (var(--water-level) * var(--lake-level-scale)) + 6px);
    transform: translateY(50%);
    z-index: 2;
    font-size: 12px;
    font-weight: 700;
    color: #042247;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(7, 49, 93, 0.35);
    border-radius: 12px;
    padding: 2px 8px;
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.lake-level-reference-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.lake-level-reference-label {
    position: absolute;
    left: 8px;
    bottom: var(--label-bottom, 0%);
    transform: translateY(50%);
    font-size: 11px;
    font-weight: 700;
    color: #1f2328;
    background: rgba(255, 255, 255, 0.86);
    border-radius: 10px;
    padding: 1px 6px;
    line-height: 1.2;
}

.lake-level-wave {
    position: absolute;
    top: -18px;
    left: -8%;
    width: 116%;
    height: 34px;
    background:
        radial-gradient(24px 12px at 12px 22px, rgba(197, 243, 255, 0.95) 55%, rgba(197, 243, 255, 0) 57%) 0 0 / 42px 26px repeat-x,
        radial-gradient(24px 11px at 30px 16px, rgba(128, 210, 255, 0.85) 52%, rgba(128, 210, 255, 0) 56%) 0 8px / 42px 24px repeat-x,
        linear-gradient(180deg, rgba(209, 245, 255, 0.68), rgba(110, 192, 244, 0));
    border-top-left-radius: 45% 85%;
    border-top-right-radius: 45% 85%;
    animation: lake-wave-drift 3.8s ease-in-out infinite;
    opacity: 0.96;
}

.lake-level-wave::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(20px 9px at 16px 20px, rgba(238, 251, 255, 0.86) 56%, rgba(238, 251, 255, 0) 59%) 12px 1px / 40px 23px repeat-x;
    opacity: 0.85;
    animation: lake-wave-drift-reverse 5.4s ease-in-out infinite;
}

.lake-level-caption {
    margin: 10px 0 0;
    font-size: 13px;
    color: #375472;
}

@keyframes lake-wave-drift {
    0% {
        transform: translateX(0) translateY(0) scaleY(1);
    }
    50% {
        transform: translateX(-30px) translateY(-2px) scaleY(1.06);
    }
    100% {
        transform: translateX(-60px) translateY(0) scaleY(1);
    }
}

@keyframes lake-wave-drift-reverse {
    0% {
        transform: translateX(0) translateY(0);
    }
    50% {
        transform: translateX(22px) translateY(1px);
    }
    100% {
        transform: translateX(44px) translateY(0);
    }
}

.energy-unit-table-chart {
    height: auto;
    min-height: 0;
    padding: 10px;
}

.energy-unit-table-wrapper {
    width: 100%;
    overflow-x: hidden;
}

.energy-unit-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
}

.energy-unit-table th,
.energy-unit-table td {
    border: 1px solid #dbe6f3;
    padding: 5px 3px;
    text-align: center;
    font-size: 11px;
    color: #173150;
    white-space: normal;
}

.energy-unit-table thead th,
.energy-unit-table tbody th {
    background: #f4f8fd;
    font-weight: 700;
}

.energy-unit-table thead th:first-child,
.energy-unit-table tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
}

.energy-unit-table thead th:first-child {
    z-index: 2;
}


.energy-target-table-wrapper {
    width: 100%;
    padding: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.energy-target-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.energy-target-table th,
.energy-target-table td {
    border: 1px solid #dbe6f3;
    padding: 8px 10px;
    text-align: left;
    font-size: 12px;
    color: #173150;
}

.energy-target-table thead th {
    background: #f4f8fd;
    font-weight: 700;
}



.energy-target-month-total td {
    font-weight: 700;
    background: #eef5ff;
}

.energy-target-compare-controls {
    display: grid;
    grid-template-columns: 140px minmax(220px, 1fr) 140px minmax(220px, 1fr);
    align-items: center;
    gap: 8px 12px;
    padding: 0 10px 10px 10px;
}

.energy-target-compare-controls label {
    font-size: 12px;
    color: #173150;
    font-weight: 600;
}

.energy-target-compare-controls select {
    min-height: 34px;
}

.energy-email-signup-card {
    gap: 12px;
}

.energy-email-signup-note {
    padding: 0 12px;
    margin: 0;
}

.energy-email-signup-form {
    display: flex;
    gap: 10px;
    padding: 0 12px 10px 12px;
}

.energy-email-signup-form input[type="email"] {
    flex: 1;
    min-height: 36px;
    padding: 8px 10px;
    border: 1px solid #c7d8ee;
    border-radius: 8px;
}

/* Keep the content readable until there is genuinely room for both ad rails.
   This also avoids the abrupt squeeze at common Mac fullscreen widths. */
@media (max-width: 1799px) {
    .main-content-shell {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 24px;
    }

    .ad-zone {
        display: none;
    }
}

@media (max-width: 900px) {
    .energy-target-compare-controls {
        grid-template-columns: 1fr;
    }

    .site-title-band {
        text-align: left;
        flex-wrap: wrap;
        padding: 16px 14px;
        gap: 10px;
    }

    .site-title-band h1 {
        font-size: clamp(1.65rem, 7vw, 2rem);
    }

    .weather-widget {
        min-width: 0;
        padding: 6px 10px;
        border-radius: 999px;
        gap: 6px;
    }

    .weather-main {
        display: none;
    }

    .weather-metrics {
        display: none;
    }

    .weather-temp {
        display: inline;
        font-size: 1.2rem;
    }

    .site-nav {
        padding: 8px 12px;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    .site-nav-list {
        flex-direction: row;
        align-items: stretch;
        flex-wrap: nowrap;
        padding-bottom: 2px;
        gap: 0;
        min-width: max-content;
    }

    .site-nav-list > .nav-item:first-child {
        flex: 0 0 64px;
    }

    .nav-item {
        flex: 0 0 auto;
        min-width: 0;
    }

    .nav-link {
        padding: 8px 11px;
        min-height: 34px;
        line-height: 16px;
        font-size: 13px;
        white-space: nowrap;
    }

    .nav-lake-row {
        display: grid;
        grid-template-columns: 1fr auto;
    }

    .dropdown-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: auto;
        min-width: 170px;
        max-width: min(260px, calc(100vw - 16px));
        box-shadow: 0 18px 28px rgba(4, 19, 34, 0.35);
        margin-top: 0;
        width: auto;
        box-sizing: border-box;
        z-index: 1000;
    }

    .nav-item.has-dropdown:hover > .dropdown-menu,
    .nav-item.has-dropdown:focus-within > .dropdown-menu {
        display: none;
    }

    .nav-item.has-dropdown.open > .dropdown-menu {
        display: block;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .main-content-shell {
        padding: 12px;
    }

    .lake-background {
        padding: 10px;
        border-radius: 12px;
    }

    .current-dam {
        padding: 8px 10px;
        margin-bottom: 10px;
        align-items: center;
    }

    .current-dam h2 {
        font-size: 18px;
    }

    .current-dam p {
        font-size: 12px;
    }

    .dashboard-grid.single-column {
        gap: 12px;
    }

    .card {
        padding: 12px;
    }

    .current-elevation {
        min-width: 95px;
    }

    .current-elevation-value {
        font-size: 1.8rem;
    }

    .card .chart {
        margin-top: 12px;
        margin-left: -12px;
        margin-right: -12px;
        width: calc(100% + 24px);
        border-left: none;
        border-right: none;
        border-radius: 0;
        box-sizing: border-box;
    }

    .card .chart.energy-unit-table-chart {
        padding-left: 14px;
        padding-right: 14px;
    }

    .graph-explainer {
        margin: 0 2px;
    }
}

@media (max-width: 600px) {
    .site-title-band,
    .breadcrumb-wrap {
        padding-left: 10px;
        padding-right: 10px;
    }

    .site-title-band {
        padding-top: 12px;
        padding-bottom: 12px;
        gap: 8px;
    }

    .site-title-band h1 {
        font-size: 1.85rem;
    }

    .weather-widget {
        padding: 5px 8px;
        gap: 5px;
    }

    .weather-temp {
        font-size: 1.05rem;
    }

    .weather-icon {
        font-size: 1rem;
    }

    .site-nav {
        padding: 6px 8px;
    }

    .site-nav-list > .nav-item:first-child {
        flex-basis: 52px;
    }

    .nav-link {
        padding: 6px 8px;
        min-height: 30px;
        border-radius: 0;
        font-size: 12px;
    }

    .nav-item {
        flex: 0 0 auto;
    }

    .lake-nav-caret {
        font-size: 10px;
    }

    .breadcrumb-wrap {
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .breadcrumb {
        font-size: 12px;
        gap: 6px;
    }

    .main-content-shell {
        padding: 6px;
    }

    .lake-background {
        padding: 6px;
        border-radius: 8px;
    }

    .card {
        padding: 10px;
        border-radius: 10px;
    }

    .card-header h3 {
        font-size: 1.05rem;
    }

    .current-dam {
        align-items: flex-start;
    }

    .current-elevation {
        min-width: 82px;
    }

    .current-elevation-value {
        font-size: 1.45rem;
    }

    .card .chart {
        margin-left: -10px;
        margin-right: -10px;
        width: calc(100% + 20px);
    }

    .card .chart.energy-unit-table-chart {
        padding-left: 10px;
        padding-right: 10px;
    }

    .energy-unit-table th,
    .energy-unit-table td {
        font-size: 10px;
        padding: 4px 2px;
    }

    .energy-unit-table thead th:first-child,
    .energy-unit-table tbody th {
        position: static;
    }
}

/* This block intentionally comes after component rules so native form-control
   colors and table/chart surfaces cannot be reset by their light defaults. */
@media (prefers-color-scheme: dark) {
    .lake-background .current-dam,
    .lake-background .card {
        background: rgba(37, 37, 37, 0.94);
    }

    .graph-explainer,
    .current-dam p,
    .current-elevation-label,
    .chart-note,
    .lake-level-caption,
    .energy-target-compare-controls label {
        color: #b9b9b9;
    }

    #about-elevation-asof,
    #g3-daily-asof,
    #g4-daily-asof,
    #g3-date,
    #g4-date,
    .g3-day-nav,
    .range-btn,
    select,
    input {
        background-color: #2b2b2b;
        border-color: #4a4a4a;
        color: #f1f1f1;
    }

    .chart {
        background: #242424;
        border-color: #3d3d3d;
    }

    .energy-unit-table,
    .energy-target-table {
        background: #222222;
    }

    .energy-unit-table th,
    .energy-unit-table td,
    .energy-target-table th,
    .energy-target-table td {
        border-color: #424242;
        color: #f1f1f1;
    }

    .energy-unit-table thead th,
    .energy-unit-table tbody th,
    .energy-target-table thead th {
        background: #2d2d2d;
    }

    .energy-target-month-total td {
        background: #333333;
    }
}

/* These structural colors must remain last because their light component
   declarations appear after the main theme tokens above. */
@media (prefers-color-scheme: dark) {
    .site-nav,
    .dropdown-menu {
        background: #141820;
        border-color: #30353d;
        box-shadow: none;
    }

    .nav-link,
    .dropdown-link {
        color: #dce2e8;
    }

    .nav-link:hover,
    .nav-link:focus-visible,
    .nav-link.active,
    .nav-item.active-top > .nav-lake-row .nav-link,
    .dropdown-link:hover,
    .dropdown-link:focus-visible,
    .dropdown-link.active {
        background: #232933;
        color: #ffffff;
    }

    .breadcrumb-wrap {
        background: #12151a;
        border-color: #30353d;
    }

    .breadcrumb,
    .breadcrumb a,
    .breadcrumb-sep {
        color: #b8c0ca;
    }
}
