body.unified-page .weather-dialog {
    position: relative;
    height: min(720px, calc(100vh - var(--app-dialog-safe-bottom, 0px) - 40px));
    height: min(720px, calc(100dvh - var(--app-dialog-safe-bottom, 0px) - 40px));
    min-height: min(560px, calc(100vh - var(--app-dialog-safe-bottom, 0px) - 40px));
    min-height: min(560px, calc(100dvh - var(--app-dialog-safe-bottom, 0px) - 40px));
}

body.unified-page .weather-dialog-state {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    box-sizing: border-box;
    color: #475569;
    text-align: center;
}

body.unified-page .weather-dialog-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #dbeafe;
    border-top-color: #1565c0;
    border-radius: 50%;
    animation: weather-dialog-loading-spin .8s linear infinite;
}

body.unified-page .weather-dialog-skeleton {
    width: min(100%, 320px);
    display: grid;
    gap: 9px;
    margin-top: 8px;
}

body.unified-page .weather-dialog-skeleton > span {
    display: block;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: weather-dialog-loading-shimmer 1.2s ease-in-out infinite;
}

body.unified-page .weather-dialog-skeleton > span:nth-child(2) { width: 88%; }
body.unified-page .weather-dialog-skeleton > span:nth-child(3) { width: 74%; }
body.unified-page .weather-dialog-skeleton > span:nth-child(4) { width: 82%; }

body.unified-page .weather-dialog-close,
body.unified-page .weather-dialog-retry,
body.unified-page #weatherHistoryLoadBtn {
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
}

body.unified-page .weather-dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

body.unified-page .weather-dialog-retry,
body.unified-page #weatherHistoryLoadBtn {
    border: 1px solid #1565c0;
    border-radius: 9px;
    padding: 0 14px;
    background: #1565c0;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

body.unified-page #weatherHistoryLoadBtn:disabled {
    border-color: #94a3b8;
    background: #e2e8f0;
    color: #475569;
    cursor: default;
}

body.unified-page .weather-dialog-body {
    min-height: 0;
}

body.unified-page .weather-history-control {
    height: 60px;
    min-height: 60px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    box-sizing: border-box;
    color: #64748b;
    font-size: .78rem;
    line-height: 1.35;
    overflow: hidden;
}

@keyframes weather-dialog-loading-spin { to { transform: rotate(360deg); } }
@keyframes weather-dialog-loading-shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    body.unified-page .weather-dialog-spinner,
    body.unified-page .weather-dialog-skeleton > span {
        animation: none;
    }
}

@media (max-width: 600px) {
    body.unified-page .weather-dialog-overlay {
        padding: 8px;
    }

    body.unified-page .weather-dialog {
        width: calc(100% - 16px);
        height: calc(100vh - var(--app-dialog-safe-bottom, 0px) - 16px);
        height: calc(100dvh - var(--app-dialog-safe-bottom, 0px) - 16px);
        min-height: 0;
        max-height: calc(100vh - var(--app-dialog-safe-bottom, 0px) - 16px);
        max-height: calc(100dvh - var(--app-dialog-safe-bottom, 0px) - 16px);
    }
}

@media (orientation: landscape) and (max-height: 650px) and (max-width: 1024px) {
    body.unified-page .weather-dialog {
        height: calc(100vh - 16px);
        height: calc(100dvh - 16px);
        min-height: 0;
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
    }
}
