.eco-mode-widget {
    --eco-accent: #00e5e2;
    --eco-gap: clamp(0.5vh, 0.9vh, 1vh);
    --eco-pad: clamp(0.6vh, 1.2vh, 1.4vh);
    --eco-font: clamp(86%, 1.3vw, 98%);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--eco-gap);
    width: 100%;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    padding: var(--eco-pad) calc(var(--eco-pad) * 1.4) var(--eco-pad) var(--eco-pad);
    color: white;
    font-size: var(--eco-font);
    line-height: 1.15;
    overflow-y: auto;
}

.eco-mode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(var(--eco-gap) * 1.1);
    width: 100%;
    flex-wrap: wrap;
}

.eco-title {
    display: flex;
    align-items: center;
    gap: calc(var(--eco-gap) * 1.05);
    min-width: 0;
}

.eco-title-icon {
    display: inline-flex;
    width: 0.9vh;
    height: 0.9vh;
    border-radius: 999px;
    background: color-mix(in srgb, var(--eco-accent) 75%, transparent);
    box-shadow: 0 0 0.5vh color-mix(in srgb, var(--eco-accent) 40%, transparent);
}

.eco-title-text {
    font-size: 95%;
    font-weight: 600;
    word-break: break-word;
}

.eco-status-group {
    display: flex;
    align-items: center;
    gap: var(--eco-gap);
    flex-wrap: wrap;
}

.eco-pill {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: calc(var(--eco-gap) * 0.5);
    min-width: 11vh;
    padding: calc(var(--eco-pad) * 0.55) calc(var(--eco-pad) * 1.1);
    border-radius: 0.9vh;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
    color: white;
    font-size: 75%;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.eco-pill .pill-label {
    opacity: 0.7;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 75%;
}

.eco-pill .pill-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.eco-toggle {
    cursor: pointer;
}

.eco-toggle:not(:disabled):hover {
    border-color: color-mix(in srgb, var(--eco-accent) 50%, rgba(255, 255, 255, 0.16));
    box-shadow: 0 0 1.4vh color-mix(in srgb, var(--eco-accent) 35%, transparent);
}

.eco-toggle:not(:disabled):active {
    transform: translateY(1px) scale(0.99);
}

.eco-toggle:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.eco-toggle.active {
    background: color-mix(in srgb, var(--eco-accent) 30%, rgba(255, 255, 255, 0.08));
    border-color: color-mix(in srgb, var(--eco-accent) 70%, rgba(255, 255, 255, 0.16));
    box-shadow: 0 0 1.8vh color-mix(in srgb, var(--eco-accent) 45%, transparent);
}

.eco-limit {
    background: rgba(255, 255, 255, 0.04);
}

.eco-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12vh, 1fr));
    gap: calc(var(--eco-gap) * 0.9);
    width: 100%;
}

.eco-summary-card {
    padding: calc(var(--eco-pad) * 0.65);
    border-radius: 0.9vh;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: calc(var(--eco-gap) * 0.6);
}

.summary-label {
    font-size: 76%;
    opacity: 0.75;
}

.summary-label.with-icon {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--eco-gap) * 0.6);
}

.summary-icon {
    display: inline-flex;
    width: 1.3vh;
    height: 1.3vh;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0.4vh rgba(0, 0, 0, 0.15) inset;
}

.summary-icon.sun {
    background: radial-gradient(circle at 30% 30%, #fff 0%, #fff 35%, rgba(255, 255, 255, 0.15) 60%, rgba(0, 229, 226, 0.4) 100%);
    box-shadow: 0 0 0.4vh rgba(0, 229, 226, 0.35);
}

.summary-icon.amp {
    background: linear-gradient(135deg, rgba(0, 229, 226, 0.8), rgba(0, 229, 226, 0.35));
    box-shadow: 0 0 0.4vh rgba(0, 229, 226, 0.35);
}

.summary-value {
    font-size: 120%;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.summary-value-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(var(--eco-gap) * 0.9);
}

.limit-quick {
    display: inline-flex;
    align-items: center;
    gap: 0.6vh;
}

.limit-btn {
    width: 3vh;
    height: 3vh;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: white;
    font-size: 120%;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.limit-btn:active {
    transform: translateY(1px) scale(0.98);
}

.limit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.limit-btn.large {
    width: 100%;
    height: 100%;
    min-height: 3vh;
    font-size: 150%;
}

.limit-split {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    align-items: stretch;
    text-align: center;
    min-height: 6vh;
}

.preview-card {
    opacity: 0.95;
}

.limit-cell {
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-height: 100%;
}

.limit-cell.center {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6vh;
}

.summary-sub {
    font-size: 75%;
    opacity: 0.6;
}

.eco-lights-list {
    display: flex;
    flex-direction: column;
    gap: 0.4vh;
    width: 100%;
    font-size: 88%;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.4vh;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.lights-head,
.light-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: calc(var(--eco-gap) * 1);
    padding: 0.6vh 0.7vh;
    border-radius: 0.7vh;
}

.lights-head {
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 80%;
}

.light-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.light-row.no-sensor .col-current {
    opacity: 0.6;
    font-style: italic;
}

.col-name {
    min-width: 0;
    word-break: break-word;
    font-weight: 600;
    text-align: left;
}

.col-bright,
.col-current {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-weight: 600;
}

.col-bright {
    opacity: 0.9;
}

.col-current {
    opacity: 0.8;
}

.widget-template.light-eco-mode {
    width: 36vmin;
    height: 24vmin;
}





/* === MEDIA === */

/* Mobile  */

@media (max-width: 699px) {
    .eco-title {
        gap: 0.5rem;
    }

    .eco-title-icon {
        width: 0.5rem;
        height: 0.5rem;
    }

    .eco-title-text {
        font-size: 0.95rem;
    }

    .eco-status-group {
        gap: 0.5rem;
    }

    .eco-summary-grid {
        display: flex;
        align-items: center;
        justify-content: start;
        flex-wrap: wrap;
    }

    .eco-pill {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .eco-summary-card {
        width: 100%;
    }

    .limit-cell {
        width: 100%;
    }

    .limit-btn.large {
        width: 80%;
        font-size: 2rem;
    }

    .summary-label {
        font-size: 0.85rem;
        text-align: left;
    }

    .summary-label.with-icon {
        gap: 0.5rem;
    }

    .summary-value {
        font-size: 0.95rem;
    }

    .summary-sub {
        font-size: 0.75rem;
    }
}

/* WVGA / WVGA-Narrow (720x480, 800x480) */

@media (min-width: 700px) and (max-width: 880px) {
}

/* WSVGA / XGA (1024x600, 1024x768) */

@media (min-width: 881px) and (max-width: 1150px) {
    .eco-title {
        gap: 0.5rem;
    }

    .eco-title-icon {
        width: 0.5rem;
        height: 0.5rem;
    }

    .eco-title-text {
        font-size: 0.95rem;
    }

    .eco-status-group {
        gap: 0.5rem;
    }

    .eco-pill {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .limit-btn.large {
        font-size: 2rem;
    }

    .summary-label {
        font-size: 0.85rem;
        text-align: left;
    }

    .summary-label.with-icon {
        gap: 0.5rem;
    }

    .summary-value {
        font-size: 0.95rem;
    }

    .summary-sub {
        font-size: 0.75rem;
    }
}

/* WXGA / HD720 / SXGA (1280x720/800/1024) */

@media (min-width: 1151px) and (max-width: 1600px) {
    .eco-title {
        gap: 0.5rem;
    }

    .eco-title-icon {
        width: 0.5rem;
        height: 0.5rem;
    }

    .eco-title-text {
        font-size: 0.95rem;
    }

    .eco-status-group {
        gap: 0.5rem;
    }

    .eco-pill {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .limit-btn.large {
        font-size: 2rem;
    }

    .summary-label {
        font-size: 0.85rem;
        text-align: left;
    }

    .summary-label.with-icon {
        gap: 0.5rem;
    }

    .summary-value {
        font-size: 0.95rem;
    }

    .summary-sub {
        font-size: 0.75rem;
    }
}

/* HD / WUXGA (1920x1080, 1920x1200) */

@media (min-width: 1601px) and (max-width: 2879px) {
    /* standard styles */
}

/* 4K (3840x2160) */

@media (min-width: 2880px) {

    .eco-title {
        gap: 1rem;
    }

    .eco-title-icon {
        width: 1rem;
        height: 1rem;
    }

    .eco-title-text {
        font-size: 2rem;
    }

    .eco-status-group {
        gap: 1rem;
    }

    .eco-pill {
        padding: 0.5rem 1rem;
        font-size: 1.75rem; 
    }

    .limit-btn.large {
        font-size: 3rem;
    }

    .summary-label {
        font-size: 1.75rem;
        text-align: left;
    }

    .summary-label.with-icon {
        gap: 1rem;
    }

    .summary-value {
        font-size: 1.75rem;
    }

    .summary-sub {
        font-size: 1.25rem;
    }
}