.weather-dialog {
    width: min(900px, calc(100% - 24px));
    max-width: 900px;
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: transparent;
    color: var(--text-primary);
}

.weather-dialog::backdrop {
    background: rgba(7, 16, 31, 0.58);
    backdrop-filter: blur(6px);
}

.weather-dialog-card {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    max-height: min(92vh, 900px);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 34px 100px rgba(5, 20, 44, 0.30);
}

.weather-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px 16px;
    background:
        radial-gradient(circle at 92% 0%, rgba(92, 147, 255, 0.20), transparent 32%),
        linear-gradient(135deg, var(--wc-panel-strong), var(--wc-soft));
    border-bottom: 1px solid var(--wc-divider);
}

.weather-dialog-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.weather-location-mark {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    border: 1px solid var(--wc-divider);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 10px 22px rgba(16, 39, 75, 0.08);
    font-size: 25px;
}

.weather-eyebrow {
    margin: 0 0 4px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.weather-dialog-header h2 {
    margin: 0;
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1.05;
    letter-spacing: -.04em;
}

.weather-dialog-subtitle {
    margin: 7px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.weather-dialog-close {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-secondary);
    font: inherit;
    font-size: 25px;
    cursor: pointer;
}

.weather-dialog-close:hover,
.weather-dialog-close:focus-visible {
    color: var(--text-primary);
    border-color: rgba(47, 115, 255, .40);
    outline: none;
}

.weather-dialog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--wc-divider);
    background: var(--surface);
}

.weather-location-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
}

.weather-location-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weather-dialog-status-pill {
    flex: 0 0 auto;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 900;
}

.weather-dialog-status-pill[data-state="loading"] {
    color: var(--primary);
    border-color: rgba(47, 115, 255, .24);
}

.weather-dialog-status-pill[data-state="success"] {
    color: #067647;
    border-color: rgba(6, 118, 71, .22);
    background: rgba(6, 118, 71, .06);
}

.weather-dialog-status-pill[data-state="stale"] {
    color: #9a6700;
    border-color: rgba(154, 103, 0, .24);
    background: rgba(154, 103, 0, .07);
}

.weather-dialog-status-pill[data-state="error"] {
    color: #b42318;
    border-color: rgba(180, 35, 24, .20);
    background: rgba(180, 35, 24, .06);
}

.weather-dialog-scroll {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    padding: 16px 18px 20px;
    background: var(--background);
}

.weather-dialog-scroll:focus-visible {
    outline: 3px solid rgba(47, 115, 255, .18);
    outline-offset: -3px;
}

.weather-hero-card,
.weather-section {
    border: 1px solid var(--wc-divider);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(20, 43, 78, 0.05);
}

.weather-hero-card {
    padding: 18px;
    background:
        radial-gradient(circle at 88% 10%, rgba(47, 115, 255, .11), transparent 34%),
        var(--surface);
}

.weather-section {
    margin-top: 12px;
    padding: 17px;
}

.weather-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.weather-section-heading.compact {
    margin-bottom: 10px;
}

.weather-section-heading h3 {
    margin: 0;
    font-size: 17px;
    letter-spacing: -.025em;
}

.weather-data-state {
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 800;
}

.weather-current-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    gap: 14px;
}

.weather-current-main {
    min-height: 188px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--wc-divider);
    border-radius: 16px;
    background: var(--wc-soft);
}

.weather-big-icon {
    width: 88px;
    height: 88px;
    flex: 0 0 88px;
    display: grid;
    place-items: center;
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(47,115,255,.15), rgba(47,115,255,.05));
    font-size: 42px;
}

.weather-big-icon.is-ready {
    background: rgba(47,115,255,.10);
}

.weather-temperature {
    transform: translateY(-7px);
    font-size: clamp(38px, 6vw, 58px);
    font-weight: 950;
    line-height: .95;
    letter-spacing: -.075em;
}

.weather-temperature small {
    margin-left: 2px;
    font-size: .40em;
    vertical-align: 12px;
    letter-spacing: 0;
}

.weather-condition {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 800;
}

.weather-current-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.weather-metric-card,
.weather-detail-values > div,
.weather-condition-grid > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--wc-divider);
    border-radius: 13px;
    background: var(--wc-soft);
}

.weather-metric-card span,
.weather-detail-values span,
.weather-condition-grid span {
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 800;
}

.weather-metric-card strong,
.weather-detail-values strong,
.weather-condition-grid strong {
    font-size: 15px;
    font-weight: 900;
}

.weather-daily-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(92px, 1fr));
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.weather-day-card {
    min-width: 92px;
    padding: 11px 9px;
    border: 1px solid var(--wc-divider);
    border-radius: 13px;
    background: var(--wc-soft);
    text-align: center;
}

.weather-day-card strong,
.weather-day-card span {
    display: block;
}

.weather-day-card strong {
    font-size: 11px;
}

.weather-day-card .weather-day-icon {
    margin: 10px 0;
    font-size: 23px;
}

.weather-day-card .weather-day-temp {
    display: flex;
    justify-content: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 900;
}

.weather-day-card .weather-day-temp span:last-child {
    color: var(--text-secondary);
}

.weather-day-card small {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 9px;
}

.weather-hourly-wrap {
    overflow-x: auto;
    scrollbar-width: thin;
}

.weather-hourly-grid {
    min-width: max-content;
    display: grid;
    grid-template-columns: repeat(12, 82px);
    gap: 8px;
}

.weather-hour-card {
    padding: 11px 8px;
    border: 1px solid var(--wc-divider);
    border-radius: 13px;
    background: var(--wc-soft);
    text-align: center;
}

.weather-hour-card strong,
.weather-hour-card span {
    display: block;
}

.weather-hour-card strong {
    font-size: 10px;
}

.weather-hour-card .weather-hour-icon {
    margin: 9px 0 8px;
    font-size: 20px;
}

.weather-hour-card .weather-hour-temp {
    font-size: 14px;
    font-weight: 900;
}

.weather-hour-card small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 9px;
}

.weather-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.weather-detail-grid .weather-section {
    margin-top: 12px;
}

.weather-detail-values,
.weather-condition-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

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

.weather-provider-state {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 14px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.weather-provider-state[data-state="stale"] {
    border-color: rgba(154, 103, 0, .24);
    background: rgba(154, 103, 0, .045);
}

.weather-provider-state[data-state="error"] {
    border-color: rgba(180, 35, 24, .24);
    background: rgba(180, 35, 24, .035);
}

.weather-provider-state[data-state="success"] {
    border-style: solid;
    border-color: rgba(6, 118, 71, .24);
    background: rgba(6, 118, 71, .035);
}

.weather-provider-state-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--wc-soft);
    color: var(--primary);
    font-size: 18px;
}

.weather-provider-state strong {
    display: block;
    font-size: 12px;
}

.weather-provider-state p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.5;
}

.weather-retry-button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 11px;
}

.weather-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 18px;
    border-top: 1px solid var(--wc-divider);
    background: var(--surface);
}

.weather-source-copy {
    min-width: 0;
}

.weather-source-copy strong {
    display: block;
    margin-top: 2px;
    font-size: 12px;
}
.weather-source-copy small {
    display: block;
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 9px;
    line-height: 1.4;
}

.weather-yahoo-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-soft);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.weather-yahoo-link:hover,
.weather-yahoo-link:focus-visible {
    border-color: rgba(47,115,255,.34);
    outline: none;
}

.weather-yahoo-link.is-disabled {
    cursor: not-allowed;
    opacity: .55;
}

.weather-skeleton-line,
.weather-skeleton-block {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, var(--wc-soft), var(--surface), var(--wc-soft));
    background-size: 220% 100%;
    animation: weather-skeleton-pulse 1.45s linear infinite;
}

.weather-skeleton-line {
    width: 170px;
    height: 18px;
    border-radius: 8px;
}

.weather-skeleton-line.short {
    width: 110px;
    height: 12px;
    margin-top: 10px;
}

.weather-skeleton-block {
    width: 88px;
    height: 88px;
    border-radius: 28px;
}

@keyframes weather-skeleton-pulse {
    from { background-position: 200% 0; }
    to { background-position: -20% 0; }
}

.weather-empty-card {
    padding: 18px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    color: var(--text-secondary);
    font-size: 11px;
    text-align: center;
}

@media (max-width: 760px) {
    .weather-dialog {
        width: min(100% - 12px, 900px);
        max-height: calc(100vh - 12px);
        border-radius: 18px;
    }

    .weather-dialog-card {
        max-height: calc(100vh - 12px);
        border-radius: 18px;
    }

    .weather-dialog-header,
    .weather-dialog-toolbar {
        padding-left: 16px;
        padding-right: 16px;
    }

    .weather-dialog-title-wrap {
        gap: 10px;
    }

    .weather-location-mark {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .weather-dialog-scroll {
        padding: 12px;
    }

    .weather-current-grid,
    .weather-detail-grid {
        grid-template-columns: 1fr;
    }

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

    .weather-current-main {
        min-height: 150px;
    }

    .weather-current-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .weather-dialog-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .weather-yahoo-link {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .weather-skeleton-line,
    .weather-skeleton-block {
        animation: none;
    }

    .weather-dialog-scroll {
        scroll-behavior: auto;
    }
}

.weather-provider-attribution {
    margin: 6px 0 0;
    color: var(--muted, #667085);
    font-size: .76rem;
    line-height: 1.6;
}
