:root {
    color-scheme: light dark;
    --bg: #eef4fb;
    --bg-gradient: radial-gradient(circle at top left, rgba(118, 188, 255, 0.38), transparent 38%), linear-gradient(180deg, #eef7ff 0%, #e4edf8 52%, #dfe7f2 100%);
    --card: rgba(255, 255, 255, 0.6);
    --card-strong: rgba(255, 255, 255, 0.74);
    --card-border: rgba(255, 255, 255, 0.58);
    --text: #112138;
    --muted: #5f718d;
    --accent: #1683ff;
    --accent-2: #18c6b9;
    --warning: #ff7d48;
    --danger: #f04f65;
    --shadow: 0 24px 70px rgba(14, 33, 61, 0.16);
    --radius-lg: 24px;
    --radius-xl: 34px;
    --space-1: 0.35rem;
    --space-2: 0.65rem;
    --space-3: 0.9rem;
    --space-4: 1.2rem;
    --space-5: 1.6rem;
    --space-6: 2rem;
    --space-7: 2.8rem;
    --max-width: 1440px;
    --top-safe: max(1rem, env(safe-area-inset-top));
    --bottom-safe: max(1rem, env(safe-area-inset-bottom));
    --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --transition: 240ms ease;
}

[data-theme="dark"] {
    --bg: #091321;
    --bg-gradient: radial-gradient(circle at top left, rgba(28, 122, 255, 0.28), transparent 40%), linear-gradient(180deg, #0d1828 0%, #101d30 50%, #0a1320 100%);
    --card: rgba(14, 26, 42, 0.68);
    --card-strong: rgba(18, 31, 48, 0.8);
    --card-border: rgba(110, 148, 190, 0.2);
    --text: #ecf3ff;
    --muted: #8ea2bf;
    --accent: #52bcff;
    --accent-2: #42d8c8;
    --warning: #ff9161;
    --danger: #ff6c7c;
    --shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    background: var(--bg);
    background-image: var(--bg-gradient);
    color: var(--text);
    transition: background-color var(--transition), color var(--transition);
}

img,
svg {
    display: block;
    max-width: 100%;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
    color: inherit;
}

.app-shell {
    position: relative;
    width: min(100%, calc(var(--max-width) + 3rem));
    margin: 0 auto;
    padding: var(--top-safe) 1rem calc(6rem + var(--bottom-safe));
}

.atmosphere,
.atmosphere__gradient,
.atmosphere__glow,
.atmosphere__particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.atmosphere {
    z-index: -1;
    overflow: hidden;
}

.atmosphere__glow {
    inset: auto auto 8% 50%;
    width: 30rem;
    height: 30rem;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(255, 212, 126, 0.24), transparent 65%);
    filter: blur(18px);
    opacity: 0.7;
}

.atmosphere__particles {
    overflow: hidden;
}

.particle {
    position: absolute;
    top: -8vh;
    width: 2px;
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(152, 210, 255, 0.7));
    opacity: 0.4;
    animation: particleFall linear infinite;
}

.particle--snow {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.78);
    filter: blur(0.2px);
    animation-name: particleDrift;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 0.9rem 0 1rem;
    backdrop-filter: blur(14px);
}

.topbar__location,
.topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.topbar__location-button {
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.topbar__location-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 6px;
    border-radius: 14px;
}

.topbar h1,
.card h2 {
    margin: 0;
    letter-spacing: -0.03em;
}

.topbar h1 {
    font-size: clamp(1.45rem, 4vw, 2.1rem);
}

.card-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 700;
}

.card-link:hover,
.card-link:focus-visible {
    text-decoration: underline;
}

.card-link--button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.7rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.history-chart {
    display: grid;
    gap: 1rem;
}

.history-chart__svg {
    width: 100%;
    height: 200px;
    overflow: visible;
}

.history-chart__line {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.history-chart__line--air {
    stroke: var(--accent);
}

.history-chart__line--pool {
    stroke: var(--accent-2);
}

.history-chart__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.history-chart__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.history-chart__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.history-chart__dot--air {
    background: var(--accent);
}

.history-chart__dot--pool {
    background: var(--accent-2);
}

.eyebrow {
    margin: 0 0 0.15rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.muted {
    margin: 0;
    color: var(--muted);
}

.icon-button,
.theme-toggle {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--card-border);
    background: var(--card);
    border-radius: 999px;
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.language-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.28rem;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.language-switch__button {
    min-width: 2.6rem;
    min-height: 2.2rem;
    padding: 0 0.7rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 750;
    cursor: pointer;
}

.language-switch__button--active {
    background: rgba(22, 131, 255, 0.18);
    color: var(--accent);
}

.icon-button {
    display: grid;
    place-items: center;
    padding: 0;
}

.icon-button__glyph {
    font-size: 1.05rem;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.55rem;
}

.theme-toggle__track {
    position: relative;
    width: 2.8rem;
    height: 1.6rem;
    border-radius: 999px;
    background: rgba(104, 130, 171, 0.25);
}

.theme-toggle__thumb {
    position: absolute;
    top: 0.14rem;
    left: 0.14rem;
    width: 1.32rem;
    height: 1.32rem;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffffff, #d7e9ff);
    transition: transform var(--transition);
}

[data-theme="dark"] .theme-toggle__thumb {
    transform: translateX(1.2rem);
    background: linear-gradient(180deg, #a3dfff, #56a7ff);
}

.theme-toggle__label {
    font-size: 0.88rem;
    font-weight: 650;
}

.dashboard {
    display: grid;
    gap: 1rem;
}

.dashboard__rail,
.dashboard__main {
    display: grid;
    gap: 1rem;
}

.card {
    position: relative;
    overflow: hidden;
    padding: 1.15rem;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    transition: transform var(--transition), border-color var(--transition), background-color var(--transition);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 35%);
    opacity: 0.8;
    pointer-events: none;
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hero-card {
    padding: 1.25rem;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at top right, rgba(255, 211, 113, 0.2), transparent 34%),
        linear-gradient(160deg, rgba(18, 131, 255, 0.22), rgba(24, 198, 185, 0.12)),
        var(--card-strong);
}

.hero-card__meta,
.hero-card__content,
.hero-card__summary,
.hero-card__temp-row,
.hero-card__details {
    display: grid;
    gap: 1rem;
}

.hero-card__meta {
    grid-template-columns: 1fr auto;
    align-items: center;
    margin-bottom: 1rem;
}

.weather-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.3rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 700;
}

.hero-card__icon {
    width: 5.5rem;
    height: 5.5rem;
}

.hero-card__temp-row {
    align-items: end;
}

.hero-card__temp-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
}

.hero-card__temp {
    font-size: clamp(4rem, 16vw, 7rem);
    line-height: 0.92;
    letter-spacing: -0.08em;
    font-weight: 750;
}

.hero-card__unit {
    margin-top: 0.65rem;
    font-size: clamp(1.35rem, 4vw, 2rem);
    color: var(--muted);
}

.hero-card__range {
    display: grid;
    gap: 0.25rem;
    font-size: 0.95rem;
}

.hero-card__description {
    margin: 0.35rem 0 0;
    max-width: 42ch;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.5;
}

.detail-pill {
    display: grid;
    gap: 0.2rem;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.14);
}

.detail-pill__label {
    color: var(--muted);
    font-size: 0.78rem;
}

.hourly-scroller {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(120px, 1fr);
    gap: 0.8rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scroll-snap-type: x mandatory;
}

.hourly-scroller::-webkit-scrollbar {
    height: 8px;
}

.hourly-scroller::-webkit-scrollbar-thumb {
    background: rgba(110, 135, 168, 0.35);
    border-radius: 999px;
}

.hour-card {
    scroll-snap-align: start;
    display: grid;
    gap: 0.65rem;
    padding: 1rem 0.9rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.hour-card__time,
.metric-card__label,
.daily-row__desc,
.support-list span,
.aqi-scale__label,
.sun-track__time {
    color: var(--muted);
}

.hour-card__icon,
.daily-row__icon,
.metric-card__icon,
.daypart__icon,
.aqi-scale__dot,
.mini-compass__needle {
    width: 2rem;
    height: 2rem;
}

.hour-card__temp {
    font-size: 1.35rem;
    font-weight: 700;
}

.hour-card__rain {
    font-size: 0.88rem;
    color: var(--accent);
}

.metrics-grid,
.dayparts-grid,
.favorites-list,
.support-list {
    display: grid;
    gap: 0.8rem;
}

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

.metric-card,
.daypart {
    display: grid;
    gap: 0.55rem;
    padding: 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.metric-card__value {
    font-size: 1.2rem;
    font-weight: 700;
}

.daily-list {
    display: grid;
    gap: 0.75rem;
}

.daily-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(128, 148, 177, 0.16);
}

.daily-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.daily-row__main {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.75rem;
}

.daily-row__name {
    font-weight: 700;
}

.daily-row__range {
    min-width: 7rem;
    display: grid;
    gap: 0.35rem;
}

.temp-bar {
    position: relative;
    height: 0.45rem;
    border-radius: 999px;
    background: rgba(104, 132, 168, 0.18);
    overflow: hidden;
}

.temp-bar__fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), #f7c76c);
    animation: barGrow 900ms ease forwards;
    transform-origin: left;
}

.daily-row__temps {
    font-weight: 650;
    text-align: right;
}

.alert {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 126, 76, 0.16), rgba(240, 79, 101, 0.1));
    border: 1px solid rgba(255, 125, 72, 0.3);
}

.alert__headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-weight: 700;
}

.alert__severity {
    color: var(--warning);
    font-size: 0.82rem;
}

.alerts-page,
.alerts-detail-list,
.alert-detail-card,
.alert-detail-card__content {
    display: grid;
    gap: 1rem;
}

.alert-detail-card {
    padding: 1.15rem;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

.alert-detail--extreme {
    background: linear-gradient(180deg, rgba(240, 79, 101, 0.2), rgba(188, 31, 65, 0.16));
    border-color: rgba(240, 79, 101, 0.4);
}

.alert-detail--severe {
    background: linear-gradient(180deg, rgba(255, 125, 72, 0.18), rgba(240, 79, 101, 0.1));
    border-color: rgba(255, 125, 72, 0.34);
}

.alert-detail--moderate {
    background: linear-gradient(180deg, rgba(240, 190, 79, 0.16), rgba(255, 125, 72, 0.08));
    border-color: rgba(240, 190, 79, 0.32);
}

.alert-detail--minor {
    background: linear-gradient(180deg, rgba(82, 188, 255, 0.12), rgba(66, 216, 200, 0.08));
    border-color: rgba(82, 188, 255, 0.22);
}

.alert-detail-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.alert-detail-card__header h3 {
    margin: 0;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
}

.alert-detail-card__severity {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.82rem;
    font-weight: 700;
}

.alert-detail-card__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
}

.alert-detail-card__text,
.alert-detail-card__instruction {
    margin: 0;
    line-height: 1.6;
}

.aqi-card,
.sunmoon-wrap,
.radar-placeholder,
.pollen-list,
.favorite-city,
.lightning-card__grid,
.lightning-card__empty {
    display: grid;
    gap: 0.9rem;
}

.aqi-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(66, 216, 200, 0.14);
    color: var(--accent-2);
    font-weight: 700;
}

.aqi-scale {
    display: grid;
    gap: 0.55rem;
}

.aqi-scale__bar {
    height: 0.55rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #33d087, #bfd93b, #f0be4f, #f98557, #dc4e68);
    position: relative;
}

.aqi-scale__dot {
    position: absolute;
    top: 50%;
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 50%;
    background: white;
    border: 2px solid rgba(17, 33, 56, 0.12);
    transform: translate(-50%, -50%);
}

.sunmoon-wrap {
    grid-template-columns: 1fr;
}

.sun-track {
    position: relative;
    height: 8rem;
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% 120%, rgba(255, 211, 113, 0.22), transparent 48%),
        rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.sun-track__arc {
    position: absolute;
    inset: auto 8% 1rem;
    height: 5rem;
    border-top: 2px dashed rgba(122, 149, 183, 0.4);
    border-left: 2px solid transparent;
    border-right: 2px solid transparent;
    border-radius: 50% 50% 0 0;
}

.sun-track__sun {
    position: absolute;
    top: 1.2rem;
    left: var(--sun-position, 50%);
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: radial-gradient(circle, #ffe6a3, #ffc857 60%, #ff9b44);
    box-shadow: 0 0 18px rgba(255, 187, 95, 0.6);
    transform: translateX(-50%);
}

.sun-track__times {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem 0.9rem;
}

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

.support-item {
    display: grid;
    gap: 0.2rem;
}

.support-item strong {
    font-size: 1rem;
}

.favorite-city {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.favorite-city__temp {
    font-size: 1.35rem;
    font-weight: 700;
}

.favorite-city__meta {
    display: grid;
    gap: 0.15rem;
}

.pollen-list {
    gap: 0.75rem;
}

.pollen-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.pollen-bar {
    flex: 1;
    height: 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.pollen-bar__fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #59ca8a, #e0b94c, #f26c55);
}

.radar-placeholder {
    min-height: 18rem;
    border-radius: 22px;
    background:
        linear-gradient(90deg, rgba(84, 139, 214, 0.12) 1px, transparent 1px),
        linear-gradient(rgba(84, 139, 214, 0.12) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, rgba(44, 182, 255, 0.12), transparent 52%),
        rgba(255, 255, 255, 0.05);
    background-size: 28px 28px, 28px 28px, auto, auto;
    background-position: center;
    place-items: center;
}

.radar-widget,
.radar-widget__meta {
    display: grid;
    gap: 0.9rem;
}

.radar-widget__image-wrap {
    position: relative;
    overflow: hidden;
    min-height: 15rem;
    aspect-ratio: 1 / 1;
    border-radius: 22px;
    background:
        linear-gradient(90deg, rgba(84, 139, 214, 0.12) 1px, transparent 1px),
        linear-gradient(rgba(84, 139, 214, 0.12) 1px, transparent 1px),
        rgba(255, 255, 255, 0.05);
    background-size: 28px 28px, 28px 28px, auto;
    isolation: isolate;
}

.radar-widget__expand {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 4;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(9, 19, 33, 0.72);
    color: #f3f8ff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px);
}

.radar-widget__expand-glyph {
    font-size: 1.1rem;
    line-height: 1;
}

.radar-widget__tile-stage {
    position: absolute;
    width: 300%;
    height: 300%;
}

.radar-widget__tile {
    position: absolute;
    width: 33.3334%;
    height: 33.3334%;
    object-fit: cover;
    filter: saturate(1.08) contrast(1.04);
}

.radar-widget__tile--map {
    filter: saturate(0.45) contrast(1.08) brightness(0.7);
}

.radar-widget__tile--radar {
    mix-blend-mode: screen;
    opacity: 0.98;
    filter: saturate(1.45) contrast(1.24) brightness(1.08);
}

.radar-widget__image-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 50%, transparent 0%, transparent 58%, rgba(6, 14, 25, 0.14) 100%),
        linear-gradient(180deg, rgba(5, 12, 22, 0.04), rgba(5, 12, 22, 0.2));
}

.radar-widget__marker {
    position: absolute;
    z-index: 3;
    transform: translate(-50%, -100%);
    display: grid;
    gap: 0.35rem;
    place-items: center;
}

.radar-widget__marker-dot {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #ff5f4d;
    border: 3px solid rgba(255, 255, 255, 0.96);
    box-shadow: 0 0 0 8px rgba(255, 95, 77, 0.18);
}

.radar-widget__marker-label {
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(9, 19, 33, 0.78);
    color: #f5f8ff;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.radar-widget__overlay {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 3;
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
    background: linear-gradient(180deg, transparent, rgba(9, 19, 33, 0.82));
    color: #f3f8ff;
}

.radar-widget__badge {
    width: fit-content;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: rgba(82, 188, 255, 0.2);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.radar-widget__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.radar-widget__links a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    text-decoration: none;
    font-weight: 650;
}

.radar-widget__links a:hover,
.radar-widget__links a:focus-visible {
    border-color: rgba(82, 188, 255, 0.34);
}

.radar-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
}

.radar-modal[hidden] {
    display: none;
}

.radar-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 10, 18, 0.72);
    backdrop-filter: blur(10px);
}

.radar-modal__panel {
    position: relative;
    z-index: 1;
    width: min(92vw, 1180px);
    height: min(88vh, 900px);
    margin: min(6vh, 3rem) auto;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    background: rgba(10, 18, 29, 0.92);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.4);
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 1rem;
}

.radar-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.radar-modal__toolbar {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.radar-modal__tool,
.radar-modal__close {
    min-width: 2.8rem;
    min-height: 2.8rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #f3f8ff;
}

.radar-modal__tool--label {
    min-width: auto;
    font-weight: 700;
}

.radar-modal__viewport {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    min-height: 0;
    background: rgba(255, 255, 255, 0.04);
}

.radar-widget__image-wrap--modal {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
    border-radius: 24px;
}

.radar-widget__image-wrap--modal .radar-widget__tile-stage {
    cursor: grab;
    touch-action: none;
}

.radar-widget__image-wrap--modal .radar-widget__tile-stage.is-dragging {
    cursor: grabbing;
}

@media (max-width: 760px) {
    .radar-modal__panel {
        width: calc(100vw - 1rem);
        height: calc(100vh - 1rem);
        margin: 0.5rem auto;
        border-radius: 22px;
    }

    .radar-modal__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .radar-modal__toolbar {
        width: 100%;
        flex-wrap: wrap;
    }
}

.radar-placeholder__center {
    display: grid;
    gap: 0.5rem;
    text-align: center;
}

.radar-placeholder__pulse {
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    border: 1px solid rgba(95, 196, 255, 0.3);
    box-shadow: inset 0 0 0 18px rgba(59, 185, 255, 0.08), 0 0 0 22px rgba(59, 185, 255, 0.05);
}

.bottom-nav {
    position: fixed;
    inset: auto 1rem calc(0.7rem + var(--bottom-safe)) 1rem;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--card-border);
    border-radius: 24px;
    background: rgba(17, 27, 42, 0.7);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.bottom-nav__item {
    min-height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #f1f6ff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 650;
}

.bottom-nav__item:hover,
.bottom-nav__item:focus-visible {
    background: rgba(255, 255, 255, 0.12);
}

.mobile-only {
    display: grid;
}

.tablet-up,
.desktop-only {
    display: none;
}

.weather-icon,
.weather-icon-image {
    width: 100%;
    height: 100%;
}

.weather-icon-image {
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(7, 21, 41, 0.18));
}

.weather-icon .stroke {
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.weather-icon .fill {
    fill: currentColor;
}

.weather-icon--sun {
    color: #f8b83e;
}

.weather-icon--cloud,
.weather-icon--fog {
    color: #b0bfd7;
}

.weather-icon--rain,
.weather-icon--storm {
    color: #61b9ff;
}

.weather-icon--snow {
    color: #dff5ff;
}

.weather-icon--moon,
.weather-icon--wind {
    color: #8fd9ff;
}

@media (min-width: 768px) {
    .app-shell {
        padding: var(--top-safe) 1.2rem 2rem;
    }

    .dashboard {
        grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.95fr);
        align-items: start;
    }

    .dashboard__main {
        grid-column: 1;
    }

    .dashboard__rail--right {
        grid-column: 2;
        position: sticky;
        top: 5.75rem;
    }

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

    .dayparts-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .hero-card__content {
        grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.8fr);
        align-items: stretch;
    }

    .tablet-up {
        display: grid;
    }

    .mobile-only {
        display: none;
    }
}

@media (min-width: 1200px) {
    .app-shell {
        padding-inline: 1.5rem;
    }

    .dashboard {
        grid-template-columns: 280px minmax(0, 1fr) 340px;
    }

    .dashboard__rail--left {
        grid-column: 1;
        position: sticky;
        top: 5.75rem;
    }

    .dashboard__main {
        grid-column: 2;
    }

    .dashboard__rail--right {
        grid-column: 3;
    }

    .desktop-only {
        display: grid;
    }

    .hourly-scroller {
        grid-auto-columns: minmax(132px, 1fr);
    }

    .daily-row {
        grid-template-columns: 1.2fr 1fr auto auto;
    }
}

@media (min-width: 1536px) {
    .hero-card {
        min-height: 24rem;
    }

    .hero-card__temp {
        font-size: clamp(5.5rem, 9vw, 7.5rem);
    }
}

@media (hover: hover) and (pointer: fine) {
    .card:hover {
        border-color: rgba(111, 164, 229, 0.32);
        box-shadow: 0 18px 36px rgba(7, 22, 45, 0.16);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@keyframes floatIcon {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-7px);
    }
}

@keyframes barGrow {
    from {
        transform: scaleX(0.15);
        opacity: 0.2;
    }
    to {
        transform: scaleX(1);
        opacity: 1;
    }
}

@keyframes particleFall {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(0, 110vh, 0);
    }
}

@keyframes particleDrift {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(18px, 110vh, 0);
    }
}
