.bwf-module,
.bwf-module * {
    box-sizing: border-box;
    letter-spacing: 0;
}

.bwf-module {
    --bwf-bg: #f4f5f6;
    --bwf-panel: #ffffff;
    --bwf-card: #ffffff;
    --bwf-heading: #20252b;
    --bwf-text: #20252b;
    --bwf-muted: #697178;
    --bwf-accent: #0e6e7a;
    --bwf-border: #dfe3e6;
    --bwf-select-bg: #ffffff;
    --bwf-radius: 4px;
    --bwf-gap: 12px;
    --bwf-padding: 18px;
    --bwf-icon: 34px;

    width: 100%;
    padding: var(--bwf-padding);
    border: 1px solid var(--bwf-border);
    border-radius: var(--bwf-radius);
    background: var(--bwf-bg);
    color: var(--bwf-text);
    font-family: var(--annasher-font, "Segoe UI", Tahoma, Arial, sans-serif);
}

.bwf-shell {
    display: grid;
    gap: var(--bwf-gap);
    width: 100%;
    padding: clamp(14px, 1.8vw, 22px);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.bwf-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.bwf-title-block {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.bwf-title-mark {
    position: relative;
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 4px;
    height: 30px;
    border-radius: 0;
    background: var(--bwf-accent);
}

.bwf-title-mark::before {
    content: none;
}

.bwf-heading {
    margin: 0;
    color: var(--bwf-heading);
    font-size: clamp(22px, 1.7vw, 28px);
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: 0;
}

.bwf-location-name {
    display: block;
    margin-top: 3px;
    color: var(--bwf-muted);
    font-size: 13px;
    line-height: 1.25;
    font-weight: 700;
}

.bwf-select-wrap {
    position: relative;
    display: inline-block;
    flex: 0 0 min(320px, 42%);
}

.bwf-select-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    inset-inline-end: 14px;
    width: 9px;
    height: 9px;
    border-inline-end: 2px solid var(--bwf-muted);
    border-bottom: 2px solid var(--bwf-muted);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.bwf-location-select {
    width: 100%;
    min-height: 44px;
    padding: 0 18px;
    padding-inline-end: 40px;
    border: 1px solid var(--bwf-border);
    border-radius: var(--bwf-radius);
    appearance: none;
    background: var(--bwf-select-bg);
    color: var(--bwf-text);
    box-shadow: none;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0;
    outline: none;
}

.bwf-location-select:focus-visible {
    border-color: var(--bwf-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bwf-accent) 26%, transparent);
}

.bwf-forecast {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
    gap: var(--bwf-gap);
    align-items: stretch;
}

.bwf-current,
.bwf-day {
    position: relative;
    display: grid;
    align-content: center;
    min-width: 0;
    border: 1px solid var(--bwf-border);
    border-radius: var(--bwf-radius);
    background: var(--bwf-card);
}

.bwf-current {
    width: min(190px, 24vw);
    min-height: 134px;
    padding: 18px;
    overflow: hidden;
    border-inline-start: 3px solid var(--bwf-accent);
}

.bwf-current::after {
    content: none;
}

.bwf-current-label,
.bwf-current-state,
.bwf-condition,
.bwf-temp-min,
.bwf-day-name {
    color: var(--bwf-muted);
}

.bwf-current-label {
    font-size: 12px;
    line-height: 1.2;
    font-weight: 800;
}

.bwf-current-temp {
    display: block;
    margin-top: 8px;
    color: var(--bwf-text);
    font-size: clamp(25px, 2.2vw, 36px);
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
}

.bwf-current-state {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 800;
}

.bwf-current .bwf-weather-icon {
    position: absolute;
    inset-inline-end: 16px;
    top: 18px;
}

.bwf-days {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(105px, 100%), 1fr));
    gap: var(--bwf-gap);
    min-width: 0;
}

.bwf-day {
    min-height: 134px;
    padding: 16px 14px;
    text-align: center;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.bwf-day.is-today {
    border-color: var(--bwf-accent);
    box-shadow: inset 0 3px 0 var(--bwf-accent);
}

.bwf-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(24, 29, 34, 0.08);
}

.bwf-day-name {
    display: block;
    min-height: 18px;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 800;
}

.bwf-day .bwf-weather-icon {
    margin: 10px auto 8px;
}

.bwf-temp-max {
    display: block;
    color: var(--bwf-text);
    font-size: clamp(18px, 1.3vw, 23px);
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0;
}

.bwf-temp-min {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 800;
}

.bwf-condition {
    display: block;
    overflow: hidden;
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bwf-weather-icon {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: var(--bwf-icon);
    height: var(--bwf-icon);
    overflow: visible;
}

.bwf-weather-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 8px rgba(24, 29, 34, 0.14));
}

.bwf-sun {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48%;
    height: 48%;
    border: 2px solid var(--bwf-accent);
    border-radius: 999px;
    transform: translate(-50%, -50%);
    box-shadow:
        0 calc(var(--bwf-icon) * -0.42) 0 -8px var(--bwf-accent),
        0 calc(var(--bwf-icon) * 0.42) 0 -8px var(--bwf-accent),
        calc(var(--bwf-icon) * -0.42) 0 0 -8px var(--bwf-accent),
        calc(var(--bwf-icon) * 0.42) 0 0 -8px var(--bwf-accent);
}

.bwf-cloud {
    position: absolute;
    right: 4%;
    bottom: 15%;
    display: none;
    width: 72%;
    height: 38%;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bwf-muted) 70%, #ffffff 30%);
}

.bwf-cloud::before {
    content: "";
    position: absolute;
    right: 12%;
    bottom: 24%;
    width: 42%;
    height: 92%;
    border-radius: 999px;
    background: inherit;
}

.bwf-rain-drops {
    position: absolute;
    right: 23%;
    bottom: -1px;
    display: none;
    width: 48%;
    height: 18%;
    background:
        linear-gradient(var(--bwf-accent), var(--bwf-accent)) 0 0 / 2px 100% no-repeat,
        linear-gradient(var(--bwf-accent), var(--bwf-accent)) 50% 0 / 2px 100% no-repeat,
        linear-gradient(var(--bwf-accent), var(--bwf-accent)) 100% 0 / 2px 100% no-repeat;
    transform: skewX(-12deg);
}

.bwf-weather-partly .bwf-cloud,
.bwf-weather-cloudy .bwf-cloud,
.bwf-weather-fog .bwf-cloud,
.bwf-weather-rain .bwf-cloud,
.bwf-weather-snow .bwf-cloud,
.bwf-weather-storm .bwf-cloud {
    display: block;
}

.bwf-weather-cloudy .bwf-sun,
.bwf-weather-fog .bwf-sun,
.bwf-weather-rain .bwf-sun,
.bwf-weather-snow .bwf-sun,
.bwf-weather-storm .bwf-sun {
    opacity: 0;
}

.bwf-weather-rain .bwf-rain-drops,
.bwf-weather-snow .bwf-rain-drops,
.bwf-weather-storm .bwf-rain-drops {
    display: block;
}

.bwf-weather-snow .bwf-rain-drops {
    background:
        radial-gradient(circle, var(--bwf-accent) 0 2px, transparent 2.5px) 0 0 / 9px 8px repeat-x;
    transform: none;
}

.bwf-weather-storm .bwf-rain-drops::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 9px;
    height: 18px;
    clip-path: polygon(40% 0, 100% 0, 62% 44%, 100% 44%, 25% 100%, 48% 54%, 12% 54%);
    background: var(--bwf-accent);
    transform: translateX(-50%);
}

.bwf-weather-fog .bwf-cloud::after {
    content: "";
    position: absolute;
    right: -4px;
    bottom: -9px;
    width: 112%;
    height: 2px;
    background: var(--bwf-muted);
    box-shadow: 0 6px 0 var(--bwf-muted);
    opacity: 0.7;
}

.bwf-source {
    justify-self: end;
    color: var(--bwf-muted);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}

.bwf-unavailable {
    grid-column: 1 / -1;
    padding: 18px;
    border: 1px dashed var(--bwf-border);
    border-radius: max(8px, calc(var(--bwf-radius) - 2px));
    color: var(--bwf-muted);
    background: var(--bwf-card);
    text-align: center;
    font-weight: 800;
}

.bwf-module.is-loading .bwf-forecast {
    opacity: 0.55;
    pointer-events: none;
}

@media (max-width: 980px) {
    .bwf-top,
    .bwf-forecast {
        grid-template-columns: 1fr;
    }

    .bwf-top {
        display: grid;
    }

    .bwf-select-wrap,
    .bwf-current {
        width: 100%;
        flex-basis: auto;
    }

    .bwf-days {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .bwf-module {
        padding: 12px;
    }

    .bwf-shell {
        padding: 14px;
    }

    .bwf-days {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
