/* 모바일 우선 — PC에서 좁은 패널 가운데 정렬 */
*,
*::before,
*::after {
    box-sizing: border-box;
}

.weather-page {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    justify-content: safe center;
    padding: max(0.65rem, env(safe-area-inset-top)) max(0.65rem, env(safe-area-inset-right))
        max(0.65rem, env(safe-area-inset-bottom)) max(0.65rem, env(safe-area-inset-left));
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    color: #1a1a1a;
    background: #f2f3f5;
    -webkit-font-smoothing: antialiased;
}

body.dark-mode.weather-page {
    color: #e8eaed;
    background: #121418;
}

.weather-app {
    max-width: 26.5rem;
    width: 100%;
    margin: 0;
    flex-shrink: 0;
    padding: 0.35rem 0 0.35rem;
}

@media (min-width: 480px) {
    .weather-app {
        padding: 0.5rem 0 0.5rem;
    }
}

.weather-top {
    padding: 0.15rem 0 0.65rem;
}

.weather-back {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 500;
    color: #2563eb;
    text-decoration: none;
    letter-spacing: -0.02em;
    padding: 0.25rem 0;
}

body.dark-mode .weather-back {
    color: #7cb3ff;
}

.weather-back:hover {
    text-decoration: underline;
}

.weather-main {
    width: 100%;
}

.weather-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

body.dark-mode .weather-card {
    background: #1e2228;
    border-color: #2d333b;
    box-shadow: none;
}

.weather-card--surface {
    padding: 0.85rem 0.75rem 1rem;
}

.weather-location {
    margin-bottom: 0.65rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #eee;
}

body.dark-mode .weather-location {
    border-bottom-color: #333;
}

.weather-location-title {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.weather-location-sub {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: #666;
}

body.dark-mode .weather-location-sub {
    color: #9aa0a6;
}

.weather-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 2rem 0.75rem;
    text-align: center;
    font-size: 0.88rem;
    color: #555;
}

.weather-state[hidden],
.weather-body[hidden] {
    display: none !important;
}

.weather-content-stage {
    min-height: 31rem;
}

body.dark-mode .weather-state {
    color: #9aa0a6;
}

.weather-state--error {
    background: #fff5f5;
    border-radius: 10px;
    color: #b42318;
}

.weather-state--loading {
    min-height: 31rem;
    justify-content: center;
    padding: 0.75rem;
}

body.dark-mode .weather-state--error {
    background: rgba(255, 107, 107, 0.12);
    color: #ff9b9b;
}

.weather-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #ddd;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: weather-spin 0.7s linear infinite;
}

body.dark-mode .weather-spinner {
    border-color: #444;
    border-top-color: #7cb3ff;
}

@keyframes weather-spin {
    to {
        transform: rotate(360deg);
    }
}

.weather-error-text {
    margin: 0;
}

.weather-btn {
    font: inherit;
    cursor: pointer;
    border-radius: 10px;
    padding: 0.5rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
}

.weather-btn--primary {
    background: #2563eb;
    color: #fff;
}

.weather-btn--primary:hover {
    background: #1d4ed8;
}

.weather-btn--ghost {
    background: #f4f4f5;
    color: #333;
    border: 1px solid #e5e5e5;
}

body.dark-mode .weather-btn--ghost {
    background: #2a3038;
    color: #e8eaed;
    border-color: #3d454e;
}

.weather-body {
    padding-top: 0.15rem;
}

.weather-split {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-bottom: 0.85rem;
    position: relative;
    z-index: 20;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.22s ease, padding 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    transform-origin: top center;
}

body.dark-mode .weather-split {
    background: #1e2228;
}

.weather-split.weather-split--compact {
    transform: scale(0.92);
    padding: 0.12rem 0.2rem;
    border-color: #e9e9e9;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.08);
}

.weather-split.weather-split--fixed {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 0.35rem);
    margin-bottom: 0;
    z-index: 120;
}

body.dark-mode .weather-split.weather-split--compact {
    border-color: #333b44;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.weather-split-col {
    flex: 1;
    min-width: 0;
    padding: 0.25rem 0.35rem;
    position: relative;
    z-index: 2;
    transition: padding 0.22s ease;
}

.weather-split.weather-split--compact .weather-split-col {
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
}

.weather-split-col--today {
    padding-right: 0.5rem;
}

.weather-split-col--tomorrow {
    padding-left: 0.5rem;
}

.weather-split-divider {
    width: 1px;
    background: #e8e8e8;
    flex-shrink: 0;
    align-self: stretch;
    min-height: 8rem;
    position: relative;
    z-index: 2;
}

body.dark-mode .weather-split-divider {
    background: #333;
}

.weather-split-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    background: linear-gradient(180deg, #b7ddff 0%, #e9f6ff 48%, #f6fbff 100%);
    transition: background 0.35s ease;
}

.weather-split-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(140% 90% at 50% 22%, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.1) 55%, rgba(255, 255, 255, 0) 100%);
}

.weather-split-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.36) 100%);
}

.weather-split-sun {
    position: absolute;
    top: 1rem;
    left: 50%;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fffde1 0%, #ffe689 38%, #ffc54e 68%, #ffb12f 100%);
    box-shadow: 0 0 0 0 rgba(255, 201, 64, 0.5);
    opacity: 0;
    transform: translateX(-50%) scale(0.88);
    animation: weather-sun-pulse 3.2s ease-in-out infinite;
}

.weather-split-cloud {
    position: absolute;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 22px rgba(68, 94, 123, 0.12);
    opacity: 0;
    left: 50%;
    transform: translateX(-50%);
}

.weather-split-cloud::before,
.weather-split-cloud::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: inherit;
}

.weather-split-cloud--1 {
    top: 1.45rem;
    width: 4.1rem;
    height: 1.4rem;
    animation: weather-cloud-drift-a 9s linear infinite;
}

.weather-split-cloud--1::before {
    width: 1.55rem;
    height: 1.55rem;
    left: 0.35rem;
    top: -0.75rem;
}

.weather-split-cloud--1::after {
    width: 1.15rem;
    height: 1.15rem;
    right: 0.45rem;
    top: -0.5rem;
}

.weather-split-cloud--2 {
    top: 3rem;
    width: 4.9rem;
    height: 1.55rem;
    animation: weather-cloud-drift-b 11s linear infinite;
}

.weather-split-cloud--2::before {
    width: 1.7rem;
    height: 1.7rem;
    left: 0.45rem;
    top: -0.82rem;
}

.weather-split-cloud--2::after {
    width: 1.2rem;
    height: 1.2rem;
    right: 0.4rem;
    top: -0.55rem;
}

.weather-split-rain {
    position: absolute;
    top: -120%;
    width: 2px;
    height: 130%;
    border-radius: 2px;
    background: linear-gradient(180deg, rgba(143, 199, 255, 0) 0%, rgba(143, 199, 255, 0.9) 50%, rgba(143, 199, 255, 0) 100%);
    opacity: 0;
}

.weather-split-rain--1 {
    left: 34%;
    animation: weather-rain-fall 1.05s linear infinite;
}

.weather-split-rain--2 {
    left: 72%;
    animation: weather-rain-fall 0.86s linear infinite;
    animation-delay: -0.42s;
}

.weather-split--sunny .weather-split-bg {
    background: linear-gradient(180deg, #78c4ff 0%, #bde7ff 44%, #ecf8ff 100%);
}

.weather-split--sunny .weather-split-sun,
.weather-split--sunny .weather-split-cloud {
    opacity: 1;
}

.weather-split--sunny .weather-split-rain {
    opacity: 0;
}

.weather-split--cloudy .weather-split-bg {
    background: linear-gradient(180deg, #8f9dae 0%, #b5bfcb 52%, #dde2e8 100%);
}

.weather-split--cloudy .weather-split-cloud {
    opacity: 0.82;
}

.weather-split--cloudy .weather-split-sun {
    opacity: 0;
}

.weather-split--cloudy .weather-split-rain {
    opacity: 0;
}

.weather-split--rainy .weather-split-bg {
    background: linear-gradient(180deg, #5f6d82 0%, #77879d 46%, #a6b3c0 100%);
}

.weather-split--rainy .weather-split-cloud {
    opacity: 0.9;
}

.weather-split--rainy .weather-split-sun {
    opacity: 0;
}

.weather-split--rainy .weather-split-rain {
    opacity: 0.85;
}

@keyframes weather-sun-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 201, 64, 0.45);
        transform: translateX(-50%) scale(0.9);
    }
    50% {
        box-shadow: 0 0 0 14px rgba(255, 201, 64, 0.11);
        transform: translateX(-50%) scale(1);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 201, 64, 0.45);
        transform: translateX(-50%) scale(0.9);
    }
}

@keyframes weather-cloud-drift-a {
    0% {
        transform: translateX(-50%) translateX(0%);
    }
    50% {
        transform: translateX(-50%) translateX(14%);
    }
    100% {
        transform: translateX(-50%) translateX(-14%);
    }
}

@keyframes weather-cloud-drift-b {
    0% {
        transform: translateX(-50%) translateX(0%);
    }
    50% {
        transform: translateX(-50%) translateX(-12%);
    }
    100% {
        transform: translateX(-50%) translateX(12%);
    }
}

@keyframes weather-rain-fall {
    0% {
        transform: translateY(-5%);
    }
    100% {
        transform: translateY(140%);
    }
}

.weather-split-label {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #444;
}

body.dark-mode .weather-split-label {
    color: #bdc1c6;
}

.weather-big-temp {
    margin: 0 0 0.25rem;
    font-size: 2.55rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
    transition: font-size 0.22s ease, margin 0.22s ease;
}

.weather-split.weather-split--compact .weather-big-temp {
    font-size: 1.55rem;
    margin-bottom: 0.15rem;
}

.weather-split-icon-wrap {
    margin: 0.15rem 0 0.35rem;
}

.weather-split-icon {
    display: block;
    width: 4.25rem;
    height: auto;
    transition: width 0.22s ease;
}

.weather-split.weather-split--compact .weather-split-icon {
    width: 2.9rem;
}

.weather-split.weather-split--compact .weather-split-label,
.weather-split.weather-split--compact .weather-split-desc,
.weather-split.weather-split--compact .weather-split-range,
.weather-split.weather-split--compact .weather-tomorrow-placeholder {
    font-size: 0.7rem;
}

.weather-split-desc {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    color: #333;
    line-height: 1.4;
}

body.dark-mode .weather-split-desc {
    color: #c4c7cc;
}

.weather-split-range {
    margin: 0;
    font-size: 0.78rem;
    color: #666;
}

body.dark-mode .weather-split-range {
    color: #9aa0a6;
}

.weather-split-range--muted {
    color: #888;
}

.weather-tomorrow-placeholder {
    margin: 0 0 0.5rem;
    font-size: 0.76rem;
    color: #777;
    line-height: 1.45;
}

body.dark-mode .weather-tomorrow-placeholder {
    color: #8b9098;
}

.weather-chip-scroll {
    margin: 0 -0.35rem 0.85rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.weather-chips {
    display: flex;
    gap: 0.45rem;
    list-style: none;
    margin: 0;
    padding: 0.2rem 0.35rem 0.35rem;
    width: max-content;
    min-width: 100%;
}

.weather-chip {
    flex: 0 0 auto;
    width: 5.4rem;
    padding: 0.55rem 0.45rem;
    background: #fafafa;
    border: 1px solid #ebebeb;
    border-radius: 10px;
    text-align: center;
}

body.dark-mode .weather-chip {
    background: #252a31;
    border-color: #353c45;
}

.weather-chip-k {
    display: block;
    font-size: 0.68rem;
    color: #777;
    margin-bottom: 0.25rem;
}

body.dark-mode .weather-chip-k {
    color: #9aa0a6;
}

.weather-chip-v {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #111;
    line-height: 1.35;
    word-break: keep-all;
}

body.dark-mode .weather-chip-v {
    color: #e8eaed;
}

.weather-chip-v--muted {
    font-weight: 500;
    color: #999;
}

body.dark-mode .weather-chip-v--muted {
    color: #7c8188;
}

.weather-hourly-wrap {
    margin-bottom: 0.65rem;
}

.weather-forecast-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #ebebeb;
    border-radius: 10px;
    background: #fafafa;
}

body.dark-mode .weather-forecast-list {
    border-color: #353c45;
    background: #252a31;
}

.weather-forecast-item {
    padding: 0.45rem 0.55rem;
    font-size: 0.76rem;
    color: #222;
    border-bottom: 1px solid #eee;
}

body.dark-mode .weather-forecast-item {
    color: #e8eaed;
    border-bottom-color: #353c45;
}

.weather-forecast-item:last-child {
    border-bottom: none;
}

.weather-hourly-title {
    margin: 0 0 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
}

body.dark-mode .weather-hourly-title {
    color: #9aa0a6;
}

.weather-hourly-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #ebebeb;
    border-radius: 10px;
    background: #fafafa;
}

body.dark-mode .weather-hourly-scroll {
    border-color: #353c45;
    background: #252a31;
}

.weather-hourly-table {
    width: 100%;
    min-width: 200px;
    border-collapse: collapse;
    font-size: 0.76rem;
}

.weather-hourly-table th,
.weather-hourly-table td {
    padding: 0.4rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid #eee;
}

body.dark-mode .weather-hourly-table th,
body.dark-mode .weather-hourly-table td {
    border-bottom-color: #353c45;
}

.weather-hourly-table tr:last-child td {
    border-bottom: none;
}

.weather-h-th-label {
    text-align: left !important;
    font-weight: 600;
    color: #666;
    width: 4.2rem;
}

body.dark-mode .weather-h-th-label {
    color: #9aa0a6;
}

.weather-h-th-data {
    font-weight: 600;
    color: #2563eb;
}

body.dark-mode .weather-h-th-data {
    color: #7cb3ff;
}

.weather-h-label {
    text-align: left !important;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

body.dark-mode .weather-h-label {
    color: #9aa0a6;
}

.weather-h-val {
    font-weight: 500;
    color: #111;
}

body.dark-mode .weather-h-val {
    color: #e8eaed;
}

.weather-h-val--accent {
    color: #2563eb;
}

body.dark-mode .weather-h-val--accent {
    color: #7cb3ff;
}

.weather-meta-line {
    margin: 0 0 0.65rem;
    font-size: 0.72rem;
    color: #888;
    text-align: center;
}

body.dark-mode .weather-meta-line {
    color: #7c8188;
}

.weather-toolbar {
    display: flex;
    justify-content: center;
    margin-bottom: 0.35rem;
}

.weather-disclaimer {
    margin: 0.75rem 0 0;
    padding-top: 0.65rem;
    border-top: 1px solid #eee;
    font-size: 0.68rem;
    line-height: 1.5;
    color: #888;
}

body.dark-mode .weather-disclaimer {
    border-top-color: #333;
    color: #7c8188;
}

.weather-disclaimer strong {
    font-weight: 600;
    color: #555;
}

body.dark-mode .weather-disclaimer strong {
    color: #bdc1c6;
}
