/* Copied from the <style> block of templates/dashboard.html so /experience renders widgets exactly like the real dashboard. Re-copy when that block changes. */
    .page-with-background,
    .user-dashboard-with-background {
        position: relative;
        border-radius: 16px;
        padding: 1rem;
        min-height: calc(100vh - 210px);
    }

    .page-with-background {
        background-image: linear-gradient(
            rgba(248, 251, 255, var(--page-bg-opacity, 0.24)),
            rgba(248, 251, 255, var(--page-bg-opacity, 0.24))
        ), var(--page-bg-image, none);
        background-position: center;
        background-size: cover;
        background-repeat: no-repeat;
        background-color: rgba(245, 250, 255, 0.9);
    }

    .user-dashboard-with-background {
        background-image: linear-gradient(
            rgba(248, 251, 255, var(--user-bg-opacity, 0.24)),
            rgba(248, 251, 255, var(--user-bg-opacity, 0.24))
        ), var(--user-bg-image, none);
        background-position: center;
        background-size: cover;
        background-repeat: no-repeat;
        background-color: rgba(245, 250, 255, 0.9);
    }

    .user-dashboard-default-background {
        position: relative;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
        padding: clamp(1.25rem, 3vw, 2rem) max(1rem, calc((100vw - 1500px) / 2 + 1rem)) 1.5rem;
        min-height: 0;
        flex: 1;    
        overflow: hidden;
        isolation: isolate;
        background:
            linear-gradient(105deg, rgba(8, 37, 75, 0.96), rgba(9, 83, 171, 0.84)),
            #0c4f9f;
    }

    body:has(.user-dashboard-default-background) .main-container {
        max-width: none !important;
        width: 100%;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding: 0;
        display: flex;
        flex-direction: column;
        flex: 1 0 auto;
    }


    .user-dashboard-default-background::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background:
            radial-gradient(circle at 15% 28%, rgba(159, 228, 255, 0.22) 0 2px, transparent 3px 100%),
            radial-gradient(circle at 76% 38%, rgba(255, 255, 255, 0.18) 0 2px, transparent 3px 100%),
            radial-gradient(circle at 35% 82%, rgba(159, 228, 255, 0.16) 0 2px, transparent 3px 100%),
            url("/static/images/logo.png") right 4% center / min(38vw, 520px) auto no-repeat;
        opacity: 0.18;
        filter:
            grayscale(1) brightness(1.35)
            drop-shadow(0 0 1px rgba(255, 255, 255, 0.9))
            drop-shadow(0 0 1px rgba(255, 255, 255, 0.9))
            drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.6));
        pointer-events: none;
    }

    .user-dashboard-default-background::after {
        content: "";
        position: absolute;
        inset: auto 0 0;
        z-index: -1;
        height: 54px;
        background: linear-gradient(180deg, rgba(246, 249, 252, 0), rgba(246, 249, 252, 0.4));
        pointer-events: none;
    }

    .dashboard-page-tile {
        border-radius: 0.5rem;
        overflow: hidden;
        transition: transform 0.18s ease, box-shadow 0.18s ease;
    }

    .dashboard-page-tile-link {
        display: block;
        height: 100%;
        color: inherit;
        text-decoration: none;
    }

    .dashboard-page-tile-link:hover,
    .dashboard-page-tile-link:focus {
        color: inherit;
        text-decoration: none;
    }

    .dashboard-page-tile-link:hover .dashboard-page-tile,
    .dashboard-page-tile-link:focus .dashboard-page-tile {
        transform: translateY(-2px);
        box-shadow: 0 14px 30px rgba(7, 25, 45, 0.24) !important;
    }

    .dashboard-page-tile .card-body {
        min-height: 140px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-top: 0;
        background: rgba(255, 255, 255, 0.88);
        background-position: center;
        background-size: cover;
        background-repeat: no-repeat;
        padding: 0.65rem;
    }

    .dashboard-page-tile .card-body.has-bg-preview {
        background-image: linear-gradient(rgba(10, 28, 52, 0.34), rgba(10, 28, 52, 0.28)), var(--page-preview-bg);
    }

    /* White title needs a dark ground when there is no preview picture */
    .dashboard-page-tile .card-body:not(.has-bg-preview) {
        background: #0f3f8a;
    }

    .dashboard-page-tile .tile-name-overlay {
        width: 100%;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        min-height: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        box-shadow: none;
        outline: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .dashboard-page-tile .tile-name {
        margin: 0;
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff;
        font-size: 2rem;
        font-weight: 900;
        letter-spacing: 0.01em;
        text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65), 0 0 16px rgba(0, 0, 0, 0.35);
        -webkit-text-stroke: 0;
    }

    .dashboard-page-tile .tile-name font,
    .dashboard-page-tile .tile-name span {
        color: inherit !important;
        -webkit-text-fill-color: inherit;
        -webkit-text-stroke: 0;
    }

    .dashboard-page-tile .tile-name-overlay .card-text {
        margin: 0;
        margin-top: 0.25rem;
        font-size: 0.8rem;
        line-height: 1.2;
        color: rgba(245, 250, 255, 0.95) !important;
    }

    .dashboard-page-tile .card-footer {
        padding: 0.45rem 0.6rem 0.6rem;
        background: rgba(255, 255, 255, 0.12);
    }

    .dashboard-page-tile .card-footer .btn {
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    .dashboard-page-tile .card-footer {
        color: #0d6efd;
        font-weight: 700;
        text-align: center;
        background: rgba(255, 255, 255, 0.88) !important;
        text-shadow: none;
    }

    .dashboard-page-title-on-image {
        display: inline-block;
        padding: 0;
        color: #ffffff;
        font-weight: 800;
        text-shadow:
            0 2px 4px rgba(0, 0, 0, 0.85),
            0 0 14px rgba(0, 0, 0, 0.65),
            0 0 2px rgba(0, 0, 0, 0.95);
    }

    .user-dashboard-with-background .dashboard-page-tile {
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)) !important;
        background-color: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.35) !important;
        box-shadow: 0 10px 24px rgba(7, 25, 45, 0.14) !important;
        backdrop-filter: blur(6px) saturate(118%);
        -webkit-backdrop-filter: blur(6px) saturate(118%);
    }

    .user-dashboard-default-background .dashboard-page-tile {
        background: rgba(255, 255, 255, 0.96) !important;
        border: 1px solid rgba(255, 255, 255, 0.55) !important;
        box-shadow: 0 14px 32px rgba(5, 24, 48, 0.2) !important;
    }

    .user-dashboard-default-background .input-group {
        box-shadow: 0 12px 28px rgba(5, 24, 48, 0.18);
    }

    @media (max-width: 767.98px) {
        .page-with-background,
        .user-dashboard-with-background,
        .user-dashboard-default-background {
            border-radius: 12px;
            padding: 0.75rem;
            min-height: calc(100vh - 170px);
        }

        .user-dashboard-default-background {
            width: 100%;
            margin-left: 0;
            margin-right: 0;
            border-radius: 0;
            padding: 1rem;
        }

        .user-dashboard-default-background::before {
            background:
                radial-gradient(circle at 15% 28%, rgba(159, 228, 255, 0.22) 0 2px, transparent 3px 100%),
                radial-gradient(circle at 76% 38%, rgba(255, 255, 255, 0.18) 0 2px, transparent 3px 100%),
                radial-gradient(circle at 35% 82%, rgba(159, 228, 255, 0.16) 0 2px, transparent 3px 100%),
                url("/static/images/logo.png") right -86px top 28px / 240px auto no-repeat;
        }

        .dashboard-page-tile .tile-name {
            font-size: 1.7rem;
        }
    }

    .chart-container {
        position: relative;
    }

    .chart-empty-state {
        min-height: 320px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 1.25rem;
        border: 1px dashed rgba(13, 110, 253, 0.22);
        border-radius: 12px;
        background: rgba(13, 110, 253, 0.04);
        color: #5a6b7d;
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .chart-extrema-panel {
        margin-top: 0.55rem;
    }

    .chart-extrema-toggle {
        font-size: 0.78rem;
        padding: 0.2rem 0.45rem;
    }
    .chart-extrema-toggle.btn-outline-primary,
    .chart-extrema-toggle.btn-outline-primary:hover,
    .chart-extrema-toggle.btn-outline-primary:focus,
    .chart-extrema-toggle.btn-outline-primary:active,
    .chart-extrema-toggle.btn-check:checked + .btn-outline-primary,
    .chart-extrema-toggle.btn-outline-primary.active,
    .chart-extrema-toggle.btn-outline-primary.show {
        background-color: transparent !important;
        color: #0d6efd !important;
        border-color: #0d6efd !important;
        box-shadow: none !important;
    }

    .chart-extrema-content {
        margin-top: 0.35rem;
        padding: 0.45rem 0.6rem;
        border: 1px solid rgba(13, 110, 253, 0.22);
        border-radius: 8px;
        background: rgba(13, 110, 253, 0.05);
        font-size: 0.78rem;
        color: #1f436a;
        display: none;
    }

    .chart-zoom-selection {
        position: absolute;
        top: 0;
        bottom: 0;
        display: none;
        background: rgba(26, 115, 232, 0.16);
        border: 1px solid rgba(26, 115, 232, 0.72);
        border-radius: 4px;
        pointer-events: none;
        z-index: 4;
    }

    .chart-zoom-hint {
        margin-bottom: 0.45rem;
        padding: 0.35rem 0.5rem;
        border-radius: 6px;
        background: rgba(13, 110, 253, 0.08);
        border: 1px solid rgba(13, 110, 253, 0.18);
        color: #17406f;
        font-size: 0.8rem;
        line-height: 1.25;
    }

    .custom-range-error {
        margin-top: 0.5rem;
        margin-bottom: 0.35rem;
        padding: 0.35rem 0.5rem;
        border-radius: 6px;
        background: rgba(220, 53, 69, 0.1);
        border: 1px solid rgba(220, 53, 69, 0.25);
        color: #8f1b2a;
        font-size: 0.76rem;
        line-height: 1.25;
        display: none;
    }

    .widget-group-card > .card-body {
        display: block;
        min-height: 0;
        max-height: none;
        overflow: visible;
        padding: .75rem;
    }
    .widget-group-card .widget-group-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        width: 100%;
        gap: .75rem;
    }
    .widget-group-card .group-mini-widget { min-width: 0; overflow: hidden; position: relative; }
    .widget-group-card .group-mini-widget > .card-body {
        min-height: 0;
        max-height: none;
        padding: .6rem;
    }
    .widget-group-card .group-mini-widget .card-header { min-height: 48px; padding: .4rem .55rem; gap: .35rem; }
    .widget-group-card .group-mini-widget .card-title {
        min-width: 0;
        color: #fff !important;
        font-size: .82rem;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }
    .widget-group-card .group-mini-widget .card-header .d-flex { flex: 0 0 auto; }
    /* When the banner/name is hidden, float the header as a small corner overlay instead of a
       full-width row, so it takes no space in normal flow and the body content starts right at
       the card's top edge instead of leaving a blank strip. */
    .widget-group-card .group-mini-widget .card-header.card-header-no-banner {
        position: absolute;
        top: .3rem;
        right: .3rem;
        left: auto;
        background: transparent !important;
        box-shadow: none;
        min-height: 0;
        padding: 0;
        z-index: 2;
        width: auto;
    }
    .widget-group-card .group-mini-widget .card-header.card-header-no-banner .card-title { display: none; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget { height: 210px; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget > .card-body { overflow: hidden; }
    .widget-group-card[data-group-mode="compact"] .widget-group-grid > .group-mini-widget:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .widget-update-time { display: none; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .widget-value { font-size: 2rem; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .widget-units { font-size: 1.1rem; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .widget-converted-value {
        margin-bottom: 0 !important;
        font-size: 2rem;
        line-height: 1.1;
    }
    .widget-group-card[data-group-mode="detailed"] .group-mini-widget .widget-value { font-size: 1.45rem; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .led-legend,
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .volume-level-numeric-container,
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .battery-gauge-raw-value { display: none !important; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .battery-gauge-widget { min-height: 0; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .battery-gauge-content { gap: .3rem; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .battery-gauge-shell { width: 52px; height: 92px; border-width: 3px; border-radius: 9px; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .battery-gauge-shell::after { top: -10px; width: 23px; height: 7px; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .battery-gauge-readout { font-size: 1.65rem; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .battery-gauge-readout .widget-units { font-size: 1rem; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="led"] > .card-body > .d-flex {
        gap: 0;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="led"] .led-indicator {
        width: 68px;
        height: 68px;
        margin-bottom: .35rem !important;
        border-width: 3px;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="led"] .led-indicator.on {
        box-shadow:
            0 6px 14px rgba(8, 26, 46, .3),
            0 0 0 2px rgba(255, 255, 255, .5),
            0 0 12px var(--indicator-color),
            0 0 22px var(--indicator-color),
            inset 0 0 10px rgba(255, 255, 255, .25);
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="led"] .led-indicator.indicator-valve::before {
        width: 52px;
        height: 52px;
        background:
            radial-gradient(circle, transparent 0 15px, var(--indicator-color) 15px 18px, transparent 18px),
            linear-gradient(var(--indicator-color), var(--indicator-color)) 50% 50% / 34px 5px no-repeat,
            linear-gradient(var(--indicator-color), var(--indicator-color)) 50% 50% / 5px 34px no-repeat;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="led"] .led-indicator.indicator-valve::after {
        width: 8px;
        height: 8px;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="led"] .led-indicator.indicator-pump::before {
        inset: 12px;
        border-width: 4px;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="led"] .led-indicator.indicator-pump::after {
        width: 10px;
        height: 10px;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="led"] .led-state-label {
        margin-bottom: .2rem !important;
        font-size: .85rem;
        line-height: 1.1;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="led"] .widget-value-container .d-flex {
        gap: .3rem !important;
        margin-bottom: 0 !important;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="led"] .widget-value {
        font-size: 1.55rem;
        line-height: 1;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="led"] .widget-units {
        font-size: .9rem;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="volume"] > .card-body > .d-flex {
        display: grid !important;
        grid-template-columns: auto auto;
        grid-template-rows: 112px auto;
        align-content: center;
        justify-content: center;
        column-gap: .35rem !important;
        row-gap: .15rem !important;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .volume-tank {
        grid-column: 1 / -1;
        justify-self: center;
        width: 112px;
        height: 108px;
        background: #e8edf3;
        border-radius: 50% 50% 50% 50% / 11px 11px 11px 11px;
        overflow: hidden;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .volume-tank::before {
        top: 0;
        left: 0;
        width: 100%;
        height: 22px;
        box-sizing: border-box;
        border-width: 2px;
        border-radius: 50%;
        background: #e8edf3;
        transform: none;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .volume-tank::after {
        top: 11px;
        left: 0;
        width: 100%;
        bottom: 0;
        box-sizing: border-box;
        border-width: 2px;
        border-top: 0;
        border-radius: 0 0 50% 50% / 0 0 11px 11px;
        background: transparent;
        z-index: 8;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .volume-water {
        max-height: calc(100% - 22px);
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .volume-wave {
        top: -5px;
        height: 20px;
        background-size: 60px 6px;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .volume-level-text { font-size: 1rem; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="volume"] .widget-value { justify-self: end; font-size: 1.45rem; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="volume"] .widget-units { justify-self: start; align-self: center; margin: 0 !important; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .radial-gauge-widget > .position-relative { width: 156px !important; height: 156px !important; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .radial-gauge-svg { width: 156px; height: 156px; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .radial-gauge-widget .widget-value { font-size: 1.5rem !important; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget .radial-gauge-widget .widget-units { font-size: .9rem !important; }
    @media (max-width: 575.98px) {
        .widget-group-card .widget-group-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: .5rem;
        }
        .widget-group-card > .card-body { padding: .5rem; }
    }

    .battery-gauge-widget {
        min-height: 220px;
    }

    .battery-gauge-content {
        gap: 0.75rem;
    }

    .battery-gauge-readout {
        color: #0d6efd;
        font-size: clamp(2.2rem, 5vw, 3.4rem);
        font-weight: 800;
        line-height: 1;
    }

    .battery-gauge-readout .widget-units {
        font-size: 1.35rem;
        font-weight: 700;
    }

    .battery-gauge-shell {
        position: relative;
        flex: 0 1 auto;
        width: clamp(74px, 20vw, 104px);
        height: clamp(148px, 24vw, 190px);
        padding: 6px;
        border: 4px solid #1f2937;
        border-radius: 14px;
        background: #eef2f7;
        overflow: visible;
    }

    .battery-gauge-shell::after {
        content: "";
        position: absolute;
        top: -14px;
        left: 50%;
        width: 34px;
        height: 10px;
        background: #1f2937;
        border-radius: 5px 5px 0 0;
        transform: translateX(-50%);
    }

    .battery-gauge-fill {
        position: absolute;
        right: 6px;
        bottom: 6px;
        left: 6px;
        height: 0%;
        max-height: calc(100% - 12px);
        border-radius: 7px;
        background: #0d6efd;
        transition: height 0.45s ease, background-color 0.2s ease;
    }

    .battery-gauge-widget.is-low .battery-gauge-readout {
        color: #dc3545;
    }

    .battery-gauge-widget.is-low .battery-gauge-fill {
        background: #dc3545;
    }

    @media (max-width: 576px) {
        .battery-gauge-content {
            gap: 0.6rem;
        }

        .battery-gauge-shell {
            width: 72px;
            height: 142px;
        }
    }

    .device-health-widget {
        min-height: 200px;
        gap: 0.15rem;
        padding: 1rem;
    }

    .device-health-indicator { position: relative; width: 132px; height: 122px; color: #6c757d; }
    .device-health-wifi { position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-size: 3.4rem; }
    .device-health-unit {
        position: absolute;
        left: 50%;
        bottom: 5px;
        transform: translateX(-50%);
        width: 94px;
        height: 67px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .3rem;
        border-radius: 13px;
        background: #243746;
        color: #fff;
        box-shadow: 0 6px 14px rgba(20, 42, 61, .2);
        font-size: 1.2rem;
        font-weight: 800;
    }
    .device-health-unit .fa-microchip { font-size: 1.65rem; }
    .device-health-status-icon {
        position: absolute;
        right: 4px;
        bottom: 0;
        display: grid;
        place-items: center;
        width: 43px;
        height: 43px;
        border: 4px solid #fff;
        border-radius: 50%;
        background: currentColor;
        color: inherit;
        font-size: 1.35rem;
    }
    .device-health-status-icon i { color: #fff; }
    .device-health-indicator.status-online { color: #28a745; }
    .device-health-indicator.status-suspicious { color: #e0a800; }
    .device-health-indicator.status-offline { color: #dc3545; }
    .device-health-indicator.status-unknown { color: #6c757d; }
    .device-health-status { color: #17324d; font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 800; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="device_health"] .device-health-widget {
        min-height: 0;
        padding: .35rem;
        justify-content: flex-start !important;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="device_health"] .device-health-indicator {
        width: 100px;
        height: 88px;
        flex: 0 0 88px;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="device_health"] .device-health-wifi { font-size: 2.35rem; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="device_health"] .device-health-unit {
        width: 72px;
        height: 49px;
        border-radius: 10px;
        font-size: .9rem;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="device_health"] .device-health-unit .fa-microchip { font-size: 1.15rem; }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="device_health"] .device-health-status-icon {
        right: 1px;
        width: 34px;
        height: 34px;
        border-width: 3px;
        font-size: 1rem;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="device_health"] .device-health-status {
        margin-top: .1rem !important;
        font-size: .95rem;
        line-height: 1.05;
    }
    .widget-group-card[data-group-mode="compact"] .group-mini-widget[data-widget-type="device_health"] .device-health-last-seen {
        margin-top: .15rem !important;
        font-size: .62rem !important;
        line-height: 1.15;
    }
    .widget-group-card[data-group-mode="detailed"] .group-mini-widget[data-widget-type="device_health"] .device-health-widget { min-height: 220px; }

    @media (max-width: 575.98px) {
        .device-health-widget { min-height: 175px; padding: .75rem; }
        .device-health-last-seen { max-width: 100%; font-size: .72rem !important; }
    }

/* ==========================
   INDUSTRIAL FLAT-BOTTOM TANK
========================== */

.volume-tank {
    position: relative;
    width: 220px;
    height: 260px;

    overflow: hidden;

    /* transparent background & no border on main container to allow full oval top */
    border: none;
    background: transparent;
    box-shadow: none;

    /* clip bottom to a matching half-oval curve so water/liquid doesn't bleed out */
    border-radius: 0 0 50% 50% / 0 0 17px 17px;

    /* remove glass blur */
    backdrop-filter: none;
}

/* TOP CYLINDRICAL CAP */
.volume-tank::before {
    content: '';
    position: absolute;

    top: 5px; /* offset top lid by 5px inside the container to avoid clipping */
    left: 50%;
    transform: translateX(-50%);

    width: 102%;
    height: 34px;

    border-radius: 50%;
    border: 3px solid #73859a;

    background: transparent;

    z-index: 8;
    pointer-events: none;
}

/* TANK BODY BACKGROUND & BORDERS */
.volume-tank::after {
    content: '';
    position: absolute;
    top: 5px; /* aligned with the top lid curve to prevent overlap mismatch */
    left: 0;
    width: 100%;
    bottom: 0;
    display: block; /* enable pseudo-element */
    background: #e8edf3;
    border: 3px solid #73859a;
    border-top: none;
    /* Curve both top and bottom edges (capsule shape) to match the oval lids */
    border-radius: 50% 50% 50% 50% / 17px 17px 17px 17px;
    box-shadow: 0 8px 18px rgba(12,40,70,0.14);
    z-index: 1;
}

/* WATER */
.volume-water {
    position: absolute;
    left: 0;
    bottom: 0;

    width: 100%;
    height: 0%;
    max-height: calc(100% - 39px); /* prevent water from rising above the front lip of the opening (5px top + 34px lid height) */

      /* subtle vertical depth only */
    background:
        linear-gradient(
            to bottom,
            #3b9cff 0%,
            #2f8fff 100%
        );
    transition: height 0.8s ease;

    z-index: 2;
    overflow: visible;
}

/* WATER SURFACE WAVE */
.volume-wave {
    position: absolute;

    top: -10px;
    left: -25%;

    width: 150%;
    height: 50px;

    background-image: url("/static/images/wave.svg");
        
    background-repeat: repeat-x;
    background-size: 120px 10px;

    animation: volumeWaveDrift 6s linear infinite;

    z-index: 4;
}

/* subtle water shine */
.volume-water::after {
    content: none;
}

/* TEXT INSIDE TANK */
.volume-level-text {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 1.45rem;
    font-weight: 700;

    color: #17324d;

    text-shadow:
        0 1px 2px rgba(255,255,255,0.9);

    z-index: 9;
}

.volume-level-text.is-on-water {
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}

/* Wave animation */
@keyframes volumeWaveDrift {
    from {
        background-position-x: 0;
    }

    to {
        background-position-x: 120px;
    }
}

/* optional mobile sizing */
@media (max-width: 768px) {
    .volume-tank {
        width: 185px;
        height: 225px;
    }
}

    .page-map-modal-header {
        background: linear-gradient(135deg, #0d6efd, #0aa2c0);
        color: #fff;
    }

    .page-map-container {
        height: 430px;
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid rgba(13, 110, 253, 0.22);
        box-shadow: 0 14px 26px rgba(13, 52, 99, 0.16);
    }

    .page-map-tag-list {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        margin-bottom: 0.75rem;
    }

    .page-map-tag {
        border: 1px solid rgba(13, 110, 253, 0.25);
        background: rgba(13, 110, 253, 0.08);
        color: #0c4275;
        border-radius: 999px;
        padding: 0.34rem 0.72rem;
        font-size: 0.78rem;
        line-height: 1.15;
        transition: all 0.18s ease;
    }

    .page-map-tag:hover,
    .page-map-tag.active {
        background: #0d6efd;
        color: #fff;
        border-color: #0d6efd;
    }

    .page-map-empty {
        border: 1px dashed rgba(13, 110, 253, 0.35);
        border-radius: 12px;
        padding: 1rem;
        color: #4a5a70;
        background: rgba(13, 110, 253, 0.04);
        font-size: 0.9rem;
    }

    .dashboard-search-empty {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        padding: 0.5rem 0.8rem;
        border-radius: 0.5rem;
        border: 1px solid rgba(255, 152, 0, 0.7);
        background: rgba(255, 244, 214, 0.96);
        color: #8a3f00;
        font-weight: 700;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    }

    .tri-phase-table-wrap {
        width: 100%;
        max-width: 360px;
        margin: 0 auto 0.5rem;
        border: 1px solid rgba(20, 53, 86, 0.18);
        border-radius: 10px;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.72);
        box-shadow: 0 4px 12px rgba(8, 24, 44, 0.08);
    }

    .tri-phase-table {
        width: 100%;
        margin: 0;
        border-collapse: collapse;
        table-layout: fixed;
    }

    .tri-phase-table th,
    .tri-phase-table td {
        border: 1px solid rgba(20, 53, 86, 0.14);
        padding: 0.45rem 0.35rem;
        text-align: center;
        vertical-align: middle;
        background: transparent;
    }

    .tri-phase-table thead th {
        font-size: 1.4rem;
        font-weight: 900;
        color: #173a60;
        white-space: nowrap;
        letter-spacing: 0.02em;
    }

    /* Keep only vertical dividers (no horizontal lines) */
    .tri-phase-table th,
    .tri-phase-table td {
        border-top: none;
        border-bottom: none;
        border-left: 1px solid rgba(20, 53, 86, 0.14);
        border-right: 1px solid rgba(20, 53, 86, 0.14);
    }

    .tri-phase-table th:first-child,
    .tri-phase-table td:first-child {
        border-left: none;
    }

    .tri-phase-table th:last-child,
    .tri-phase-table td:last-child {
        border-right: none;
    }

    .tri-phase-table .tri-value {
        display: inline-block;
        font-size: 1.55rem;
        line-height: 1;
        font-weight: 800;
        color: #0f2f52;
        white-space: nowrap;
    }

    .tri-value-unit {
        display: inline-block;
        margin-left: 0.15rem;
        font-size: 0.95rem;
        font-weight: 700;
        color: #274f78;
        vertical-align: baseline;
        white-space: nowrap;
    }

    .tri-phase-chip {
        width: 24px;
        height: 10px;
        margin: 0 auto;
        border-radius: 3px;
        border: 1px solid rgba(0, 0, 0, 0.12);
    }

    @media (max-width: 576px) {
        .tri-phase-table .tri-value {
            font-size: 1.25rem;
        }
        .tri-phase-table thead th {
            font-size: 1.2rem;
        }
        .tri-value-unit {
            font-size: 0.82rem;
        }
    }
