.weather-provider-switcher {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    margin: 0 0 1rem;
}

.weather-provider-switcher__item {
    --weather-switcher-accent: #2187ff;
    --weather-switcher-accent-rgb: 33, 135, 255;
    display: inline-flex;
    min-height: 2.35rem;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.72rem;
    border: 1px solid rgba(var(--weather-switcher-accent-rgb), 0.3);
    border-radius: 0.7rem;
    background: rgba(var(--weather-switcher-accent-rgb), 0.07);
    color: #31475b;
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.15;
    text-decoration: none;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.weather-provider-switcher__item--windy {
    --weather-switcher-accent: #dc3f4a;
    --weather-switcher-accent-rgb: 220, 63, 74;
}

.weather-provider-switcher__item--windguru {
    --weather-switcher-accent: #0f8c91;
    --weather-switcher-accent-rgb: 15, 140, 145;
}

.weather-provider-switcher__item--yr {
    --weather-switcher-accent: #176fbd;
    --weather-switcher-accent-rgb: 23, 111, 189;
}

.weather-provider-switcher__item--snowforecast {
    --weather-switcher-accent: #397bb8;
    --weather-switcher-accent-rgb: 57, 123, 184;
}

.weather-provider-switcher__item--meteoblue {
    --weather-switcher-accent: #315eaa;
    --weather-switcher-accent-rgb: 49, 94, 170;
}

.weather-provider-switcher__item--sunrise {
    --weather-switcher-accent: #c87408;
    --weather-switcher-accent-rgb: 200, 116, 8;
}

.weather-provider-switcher__item--davis {
    --weather-switcher-accent: #587f45;
    --weather-switcher-accent-rgb: 88, 127, 69;
}

.weather-provider-switcher .weather-provider-switcher__icon {
    display: grid;
    width: 1.65rem;
    height: 1.65rem;
    flex: 0 0 auto;
    padding: 0;
    place-items: center;
    border-radius: 0.42rem;
    background: rgba(var(--weather-switcher-accent-rgb), 0.14);
    color: var(--weather-switcher-accent);
}

.weather-provider-switcher .weather-provider-switcher__icon svg {
    display: block;
    width: 1.1rem;
    height: 1.1rem;
    padding: 0;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3.5;
}

.weather-provider-switcher .weather-provider-switcher__icon path,
.weather-provider-switcher .weather-provider-switcher__icon circle {
    display: inline;
}

.weather-provider-switcher .weather-provider-switcher__label {
    padding: 0;
}

.weather-provider-switcher__item[aria-current="page"] {
    border-color: var(--weather-switcher-accent);
    background: var(--weather-switcher-accent);
    box-shadow: 0 7px 16px rgba(var(--weather-switcher-accent-rgb), 0.24);
    color: #fff;
    pointer-events: none;
}

.weather-provider-switcher__item[aria-current="page"] .weather-provider-switcher__icon {
    background: rgba(255, 255, 255, 0.18);
    color: inherit;
}

.weather-provider-switcher__item:focus-visible {
    outline: 3px solid rgba(var(--weather-switcher-accent-rgb), 0.28);
    outline-offset: 2px;
}

body.dark .weather-provider-switcher__item {
    border-color: rgba(var(--weather-switcher-accent-rgb), 0.42);
    background: rgba(var(--weather-switcher-accent-rgb), 0.13);
    color: #e4edf5;
}

body.dark .weather-provider-switcher__item[aria-current="page"] {
    border-color: var(--weather-switcher-accent);
    background: var(--weather-switcher-accent);
    color: #fff;
}

@media (hover: hover) and (pointer: fine) {
    .weather-provider-switcher__item:hover {
        transform: translateY(-2px);
        border-color: rgba(var(--weather-switcher-accent-rgb), 0.6);
        background: rgba(var(--weather-switcher-accent-rgb), 0.14);
        box-shadow: 0 6px 14px rgba(var(--weather-switcher-accent-rgb), 0.13);
    }
}

@media (max-width: 30rem) {
    .weather-provider-switcher {
        gap: 0.35rem;
    }

    .weather-provider-switcher__item {
        min-height: 2.2rem;
        padding: 0.35rem 0.58rem;
        font-size: 0.76rem;
    }

    .weather-provider-switcher .weather-provider-switcher__icon {
        width: 1.5rem;
        height: 1.5rem;
    }

    .weather-provider-switcher .weather-provider-switcher__icon svg {
        width: 1rem;
        height: 1rem;
    }
}

@media (max-width: 40rem) {
    .weather-provider-switcher--scroll {
        width: calc(100% + 2rem);
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.45rem;
        margin-right: -1rem;
        margin-left: -1rem;
        padding: 0.2rem 3rem 0.65rem 1rem;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-padding-inline: 1rem;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 2.25rem), transparent 100%);
        mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 2.25rem), transparent 100%);
    }

    .weather-provider-switcher--scroll::-webkit-scrollbar {
        display: none;
    }

    .weather-provider-switcher--scroll .weather-provider-switcher__item {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .weather-provider-switcher__item {
        transition: none;
    }
}
