@import url(location.css);

:root {
    --bg-deep: #050a14;
    --cyan: #00d4ff;
    --cyan-dim: #5eb8e5;
    --cyan-glow: rgba(0, 212, 255, 0.3);
    --text-primary: #f4f8ff;
    --text-muted: #8aa4c4;
    --card-bg: rgba(8, 20, 44, 0.78);
    --card-border: rgba(0, 190, 255, 0.22);
    --sunrise: #ffd54f;
    --sunset: #ff8c2a;
    --scrollbar-track: rgba(0, 15, 35, 0.9);
    --scrollbar-border: rgba(0, 190, 255, 0.28);
}

/* Neon pill scrollbars */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--cyan) var(--scrollbar-track);
}

*::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 999px;
    border: 1px solid var(--scrollbar-border);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.35);
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #5ce9ff 0%, var(--cyan) 42%, #00a8d6 100%);
    border-radius: 999px;
    border: 1px solid rgba(190, 245, 255, 0.45);
    box-shadow:
        0 0 12px rgba(0, 212, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7ff0ff 0%, #33ddff 50%, var(--cyan) 100%);
    box-shadow:
        0 0 16px rgba(0, 212, 255, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

*::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, var(--cyan) 0%, #0099c4 100%);
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    min-height: 100vh;
    background: var(--bg-deep);
    background-image:
        radial-gradient(ellipse at 12% -5%, rgba(0, 110, 210, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 88% 105%, rgba(0, 180, 255, 0.07) 0%, transparent 45%);
    color: var(--text-primary);
    overflow-x: hidden;
}

.grid-overlay {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(0, 150, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 150, 255, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    z-index: 0;
    pointer-events: none;
}

.glow-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.5) 100%);
    z-index: 1;
    pointer-events: none;
}

.app {
    position: relative;
    z-index: 2;
    width: min(96%, 1360px);
    margin: 0 auto;
    padding: 20px 20px 32px;
}

/* App download banner */
.app-banner {
    position: relative;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 40, 80, 0.55), rgba(6, 18, 42, 0.85));
    border: 1px solid rgba(0, 212, 255, 0.25);
    box-shadow: 0 4px 20px rgba(0, 100, 200, 0.1);
    transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
    overflow: hidden;
    max-height: 320px;
}

.app-banner.guide-open {
    max-height: 520px;
}

.app-banner.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    pointer-events: none;
}

.banner-dismiss {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.banner-dismiss:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.app-banner-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-right: 28px;
}

.app-banner-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.banner-icon,
.logo-img,
.prompt-logo {
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.app-banner-tag {
    font-family: 'Rajdhani', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--cyan);
    text-transform: uppercase;
}

.app-banner-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.15;
}

.app-banner-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 8px 0 0;
    max-width: 100%;
}

/* Header */
.top-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand search clock";
    align-items: center;
    gap: 16px 20px;
    margin-bottom: 18px;
}

.logo-section {
    grid-area: brand;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.logo-section > div {
    min-width: 0;
}

.logo-section h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.logo-section p {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.search-row {
    grid-area: search;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.search-box {
    display: flex;
    align-items: center;
    position: relative;
    flex: 1;
    background: rgba(4, 12, 28, 0.9);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    padding: 13px 12px 13px 40px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    flex: 1;
    min-width: 0;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-submit {
    background: var(--cyan);
    border: none;
    color: #041018;
    min-width: 50px;
    min-height: 50px;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
}

.icon-btn {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(4, 12, 28, 0.9);
    color: var(--cyan-dim);
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.icon-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(0, 212, 255, 0.08);
}

.icon-btn.active,
.notify-btn.active {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(0, 212, 255, 0.12);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.2);
}

.time-display {
    grid-area: clock;
    text-align: right;
}

.time-display .date {
    font-size: 13px;
    color: var(--text-muted);
}

.time-display .time {
    font-family: 'Rajdhani', sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
}

.time-display .day {
    font-size: 13px;
    color: var(--cyan-dim);
}

/* Intro blurb */
.app-intro {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 720px;
    margin: -6px 0 18px;
    padding: 0 2px;
}

.notify-hint {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 180, 0, 0.1);
    border: 1px solid rgba(255, 200, 0, 0.25);
    color: #ffd88a;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
}

.app-actions.hidden {
    display: none;
}

/* Update banner — fixed at top so installed users always see it */
.update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 14px;
    margin: 0;
    padding: max(10px, env(safe-area-inset-top)) 16px 12px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(0, 212, 255, 0.45);
    background: rgba(4, 10, 24, 0.98);
    font-size: 14px;
    color: #f4f8ff;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
}

.update-banner.hidden {
    display: none;
}

body.has-update-prompt {
    --update-banner-offset: 52px;
}

body.has-update-prompt .app {
    padding-top: calc(20px + var(--update-banner-offset, 52px));
}

.update-banner-icon {
    color: var(--cyan);
    font-size: 15px;
    animation: update-spin 2.4s linear infinite;
}

@keyframes update-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.update-banner-text {
    text-align: center;
}

.update-banner-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 999px;
    background: var(--cyan);
    color: #041018;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    min-height: 36px;
}

/* Saved locations */
.saved-locations-wrap {
    margin-bottom: 20px;
}

.saved-locations {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0 6px;
}

.saved-empty {
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 0;
    white-space: normal;
}

.saved-empty strong {
    color: var(--cyan-dim);
    font-weight: 600;
}

.location-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px 8px 8px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: rgba(4, 12, 28, 0.7);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.pill-grip {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    opacity: 0.45;
    cursor: grab;
    padding: 0 2px;
    font-size: 10px;
}

.location-pill.dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.location-pill.dragging .pill-grip {
    cursor: grabbing;
}

.location-pill.drag-over {
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.25);
}

.location-pill .pill-icon {
    color: var(--cyan-dim);
    font-size: 11px;
}

.location-pill.home .pill-icon {
    color: #ffd54f;
}

.location-pill.active {
    border-color: var(--cyan);
    background: rgba(0, 212, 255, 0.1);
    color: var(--text-primary);
}

.location-pill.home {
    border-color: rgba(255, 213, 79, 0.45);
    background: rgba(255, 213, 79, 0.08);
}

.location-pill.home.active {
    border-color: var(--cyan);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(255, 213, 79, 0.1));
}

.location-pill:hover {
    border-color: rgba(0, 212, 255, 0.45);
}

.pill-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    opacity: 0.4;
    color: #ffd54f;
}

.pill-home:hover,
.pill-home.is-home {
    opacity: 1;
    background: rgba(255, 213, 79, 0.18);
}

.pill-remove {
    margin-left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    opacity: 0.55;
}

.pill-remove:hover {
    opacity: 1;
    background: rgba(255, 100, 100, 0.2);
    color: #ff8a8a;
}

/* Content */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 20px;
}

.weather-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 22px 24px;
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 40px rgba(0, 80, 160, 0.08);
}

.card-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--cyan-dim);
    margin-bottom: 0;
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.card-header-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.unit-toggle-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.unit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: rgba(0, 25, 55, 0.45);
    color: var(--cyan-dim);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 32px;
}

.unit-toggle:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(0, 212, 255, 0.08);
}

.unit-toggle i {
    font-size: 10px;
}

.location {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.location i {
    color: var(--cyan);
    font-size: 14px;
}

.weather-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 4px;
}

.temp-main {
    font-family: 'Rajdhani', sans-serif;
    font-size: 80px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -2px;
}

.weather-visual-wrap {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-visual {
    width: 100%;
    height: 100%;
}

.weather-visual svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

/* Looping weather animations */
.sun-rays {
    transform-origin: 100px 100px;
    animation: spin 12s linear infinite;
}

.cloud-drift {
    animation: drift 5s ease-in-out infinite alternate;
}

.cloud-drift.slow {
    animation-duration: 7s;
}

.rain-drops {
    animation: rain 1.1s linear infinite;
}

.rain-drops.light {
    animation-duration: 1.4s;
}

.rain-drops.fast {
    animation-duration: 0.75s;
}

.snow-flakes {
    animation: snow 2.5s ease-in-out infinite;
}

.fog-lines {
    animation: fog 4s ease-in-out infinite alternate;
}

.lightning-bolt {
    animation: flash 2.2s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes drift {
    from { transform: translateX(-6px); }
    to { transform: translateX(6px); }
}

@keyframes rain {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(10px); opacity: 0.5; }
}

@keyframes snow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(12px); }
}

@keyframes fog {
    from { opacity: 0.45; }
    to { opacity: 0.95; }
}

@keyframes flash {
    0%, 88%, 100% { opacity: 1; }
    90%, 96% { opacity: 0.15; }
}

.condition {
    text-align: center;
    font-size: 17px;
    font-weight: 500;
    color: var(--cyan);
    margin-bottom: 22px;
}

.current-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 20px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 25, 55, 0.35);
    border-radius: 10px;
    border: 1px solid rgba(0, 180, 255, 0.08);
}

.detail-item i {
    color: var(--cyan);
    width: 20px;
    text-align: center;
}

.detail-label {
    font-size: 12px;
    color: var(--text-muted);
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
}

.sun-times {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border-top: 1px solid rgba(0, 180, 255, 0.12);
    padding-top: 16px;
}

.sun-block {
    text-align: center;
    padding: 12px;
    background: rgba(0, 20, 45, 0.45);
    border: 1px solid rgba(0, 180, 255, 0.1);
    border-radius: 12px;
}

.sun-visual {
    font-size: 26px;
    margin-bottom: 4px;
}

.sunrise-block .sun-visual i {
    color: var(--sunrise);
}

.sunset-block .sun-visual i {
    color: var(--sunset);
    transform: rotate(180deg);
    display: inline-block;
}

.sun-block .label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sun-block .value {
    font-size: 16px;
    font-weight: 600;
    margin-top: 2px;
}

/* Forecast */
.forecast-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 520px;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
    border-radius: 10px;
}

.forecast-table {
    width: 100%;
    min-width: 580px;
    border-collapse: collapse;
}

.forecast-table th {
    text-align: left;
    padding: 10px 12px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--cyan-dim);
    border-bottom: 1px solid rgba(0, 180, 255, 0.15);
}

.forecast-table td {
    padding: 14px 12px;
    font-size: 15px;
    border-bottom: 1px solid rgba(0, 180, 255, 0.08);
}

.forecast-table tbody tr:last-child td {
    border-bottom: none;
}

.forecast-condition {
    display: flex;
    align-items: center;
    gap: 8px;
}

.forecast-icon {
    font-size: 22px;
    width: 28px;
    text-align: center;
}

.forecast-icon.fa-sun { color: #ffd54f; }
.forecast-icon.fa-cloud-sun { color: #90caf9; }
.forecast-icon.fa-cloud { color: #b0bec5; }
.forecast-icon.fa-cloud-rain,
.forecast-icon.fa-cloud-showers-heavy { color: #64b5f6; }
.forecast-icon.fa-snowflake { color: #e3f2fd; }
.forecast-icon.fa-bolt { color: #ffeb3b; }

.forecast-temp {
    font-weight: 600;
    white-space: nowrap;
}

.forecast-sun {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 14px;
    white-space: nowrap;
}

.forecast-sun .fa-sun { color: var(--sunrise); font-size: 13px; }

.forecast-sun .sunset-icon {
    color: var(--sunset);
    font-size: 13px;
    transform: rotate(180deg);
    display: inline-block;
}

/* Actions */
.app-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    min-height: 36px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: rgba(0, 20, 45, 0.55);
    color: var(--cyan-dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn-primary {
    background: var(--cyan);
    border-color: var(--cyan);
    color: #041018;
}

.action-btn:hover {
    border-color: rgba(0, 212, 255, 0.45);
    color: var(--text-primary);
}

.action-btn.active {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(0, 212, 255, 0.1);
}

.action-btn.hidden {
    display: none;
}

.install-guide {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 180, 255, 0.12);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.install-guide p {
    margin-bottom: 5px;
}

.install-guide em {
    color: var(--cyan-dim);
    font-style: normal;
}

/* Footer */
.footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-top: 28px;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-copy {
    justify-self: start;
}

.footer-data {
    justify-self: end;
    text-align: right;
}

.footer-data i {
    color: var(--cyan);
}

@media (max-width: 1100px) {
    .top-bar {
        grid-template-columns: 1fr;
        grid-template-areas:
            "brand"
            "search"
            "clock";
        text-align: center;
    }

    .logo-section {
        justify-content: center;
    }

    .time-display {
        text-align: center;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100vw;
        padding: 0;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        overflow-x: hidden;
    }

    .app-banner {
        order: 99;
        margin: 10px 12px 0;
        padding: 14px 36px 14px 14px;
        border-radius: 14px;
    }

    .app-banner.collapsed {
        margin: 0;
        padding: 0;
    }

    .app-banner-desc {
        font-size: 12px;
        margin-bottom: 0;
    }

    .app-banner-title {
        font-size: 16px;
    }

    .banner-icon {
        width: 36px;
        height: 36px;
    }

    .top-bar {
        order: 1;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand clock"
            "search search";
        gap: 10px 12px;
        margin: 0;
        padding: max(10px, env(safe-area-inset-top)) 12px 12px;
        background: rgba(4, 12, 28, 0.85);
        border-bottom: 1px solid rgba(0, 180, 255, 0.1);
    }

    .logo-section {
        justify-content: flex-start;
        gap: 8px;
    }

    .logo-img {
        width: 38px;
        height: 38px;
    }

    .logo-section h1 {
        font-size: 17px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .logo-section p {
        display: none;
    }

    .time-display {
        text-align: right;
        min-width: 0;
    }

    .time-display .time {
        font-size: 20px;
        white-space: nowrap;
    }

    .time-display .date,
    .time-display .day {
        font-size: 10px;
        white-space: nowrap;
    }

    .search-row {
        width: 100%;
        flex-wrap: nowrap;
    }

    .search-box {
        flex: 1;
        min-width: 0;
    }

    .search-box input {
        padding: 12px 10px 12px 36px;
        font-size: 16px;
    }

    .search-submit,
    .icon-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        flex-shrink: 0;
    }

    .saved-locations-wrap {
        order: 3;
        margin: 0;
        padding: 0 12px 10px;
    }

    body.has-update-prompt .app {
        padding-top: calc(max(10px, env(safe-area-inset-top)) + 44px);
    }

    .update-banner {
        font-size: 13px;
        gap: 6px 10px;
    }

    .app-intro {
        display: none;
    }

    .saved-empty {
        font-size: 11px;
        padding: 2px 0;
    }

    .content-grid {
        order: 4;
        gap: 10px;
        padding: 0 12px;
    }

    .weather-card {
        padding: 16px 14px;
        border-radius: 14px;
    }

    .location {
        font-size: 15px;
        gap: 5px;
    }

    .location i:last-child {
        display: none;
    }

    .weather-hero {
        flex-direction: column;
        gap: 2px;
    }

    .temp-main {
        font-size: 64px;
    }

    .weather-visual-wrap {
        width: 100px;
        height: 100px;
    }

    .current-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .detail-item {
        padding: 10px 8px;
        min-width: 0;
    }

    .detail-value {
        font-size: 15px;
        word-break: break-word;
    }

    .sun-times {
        gap: 8px;
        padding-top: 12px;
    }

    .forecast-wrapper {
        overflow: visible;
    }

    .forecast-table {
        min-width: 0;
    }

    .forecast-table thead {
        display: none;
    }

    .forecast-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 10px;
        margin-bottom: 8px;
        padding: 12px;
        background: rgba(0, 25, 55, 0.45);
        border: 1px solid rgba(0, 180, 255, 0.1);
        border-radius: 12px;
    }

    .forecast-table td {
        display: block;
        padding: 0;
        border: none;
        font-size: 13px;
        min-width: 0;
    }

    .forecast-table td::before {
        display: block;
        content: attr(data-label);
        font-size: 9px;
        font-weight: 700;
        color: var(--cyan-dim);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 3px;
    }

    .forecast-table td[data-label="Day"] {
        grid-column: 1 / -1;
        text-align: center;
        padding-bottom: 8px;
        margin-bottom: 4px;
        border-bottom: 1px solid rgba(0, 180, 255, 0.1);
    }

    .forecast-table td[data-label="Day"]::before {
        display: none;
    }

    .forecast-table td[data-label="Condition"] {
        grid-column: 1 / -1;
    }

    .forecast-condition {
        flex-wrap: wrap;
        gap: 6px;
    }

    .footer {
        order: 5;
        margin-top: 12px;
        padding: 0 12px 8px;
    }

    .notify-hint {
        font-size: 12px;
        margin-top: 8px;
    }

    .grid-overlay {
        background-size: 32px 32px;
    }

    .location-prompt {
        padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
        align-items: flex-end;
    }

    .live-badge {
        max-width: min(100%, 160px);
        font-size: 9px;
        padding: 4px 8px;
    }

    .card-header-meta {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .radar-note {
        display: none;
    }

    .radar-card .card-header-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .radar-timestamp {
        font-size: 10px;
        max-width: 50%;
        text-align: right;
        line-height: 1.35;
    }

    .radar-toolbar {
        gap: 8px;
    }

    .radar-layer-toggle {
        flex: 1;
        min-width: 0;
    }

    .radar-layer-btn {
        flex: 1;
        justify-content: center;
        min-height: 44px;
        padding: 10px 8px;
        font-size: 11px;
    }

    .radar-tool-btn {
        width: 44px;
        height: 44px;
    }

    .radar-playback {
        padding: 10px 12px;
        gap: 6px;
    }

    .radar-time-main {
        font-size: 14px;
        line-height: 1.35;
    }

    .radar-time-edge {
        font-size: 9px;
    }

    .radar-controls-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .radar-now-btn {
        min-height: 44px;
    }

    .radar-ctrl-btn {
        width: 44px;
        height: 44px;
    }

    .radar-slider {
        flex: 1 1 100%;
        min-width: 0;
        min-height: 28px;
        margin-top: 2px;
    }

    .radar-legend {
        flex-wrap: wrap;
        gap: 6px;
    }

    .legend-hint {
        display: none;
    }

    .radar-map {
        height: min(46vh, 340px);
        min-height: 220px;
    }

    .hourly-chart {
        height: 140px;
    }

    .hourly-chart-labels {
        padding: 0 24px;
        font-size: 9px;
    }
}

@media (max-width: 380px) {
    .logo-section h1 {
        font-size: 15px;
        max-width: 140px;
    }

    .time-display .time {
        font-size: 18px;
    }

    .temp-main {
        font-size: 56px;
    }

    .search-row {
        gap: 6px;
    }

    .search-submit,
    .icon-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .radar-layer-btn {
        font-size: 10px;
        padding: 8px 6px;
    }

    .radar-time-main {
        font-size: 13px;
    }
}

/* Full-width grid rows */
.full-span {
    grid-column: 1 / -1;
}

.card-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7dffb0;
    background: rgba(40, 180, 100, 0.15);
    border: 1px solid rgba(80, 220, 140, 0.35);
    border-radius: 999px;
    padding: 4px 10px;
    white-space: nowrap;
    max-width: min(100%, 220px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-badge::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: #7dffb0;
    box-shadow: 0 0 8px #7dffb0;
    animation: live-pulse 1.8s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* Radar */
.radar-card .card-header-row {
    margin-bottom: 8px;
}

.radar-note {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.radar-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.radar-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.radar-tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(0, 25, 55, 0.55);
    color: var(--cyan);
    cursor: pointer;
}

.radar-tool-btn:hover {
    background: rgba(0, 212, 255, 0.12);
}

.radar-opacity {
    display: none;
}

/* Hourly chart */
.hourly-card .card-header-row {
    margin-bottom: 8px;
}

.hourly-legend {
    display: flex;
    gap: 14px;
    font-size: 11px;
    color: var(--text-muted);
}

.hourly-legend i {
    margin-right: 4px;
    font-size: 8px;
}

.hourly-chart {
    width: 100%;
    height: 160px;
    display: block;
    border-radius: 10px;
    background: rgba(0, 15, 35, 0.35);
}

.hourly-chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding: 0 36px 0 36px;
    font-size: 10px;
    color: var(--text-muted);
}

.forecast-precip {
    color: var(--cyan);
    font-weight: 600;
}

.radar-card.radar-fullscreen,
.radar-card:fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9000;
    margin: 0;
    border-radius: 0;
    max-width: none;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    padding: 16px;
}

.radar-card.radar-fullscreen .radar-map,
.radar-card:fullscreen .radar-map {
    height: min(62vh, calc(100vh - 240px));
    min-height: 320px;
}

.smooth-heatmap-layer {
    pointer-events: none;
    filter: blur(18px);
    transform: scale(1.08);
    transform-origin: center;
}

.city-temp-marker {
    background: transparent !important;
    border: none !important;
}

.city-temp-label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(5, 12, 28, 0.82);
    border: 1px solid rgba(0, 212, 255, 0.35);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
    transform: translate(-50%, -100%);
    white-space: nowrap;
    pointer-events: none;
}

.city-temp-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #f4f8ff;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.city-temp-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--cyan);
    line-height: 1;
}

.legend-hint {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 8px;
    font-style: italic;
}

.radar-layer-toggle {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.radar-layer-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: rgba(0, 25, 55, 0.45);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.radar-layer-btn:hover,
.radar-layer-btn.active {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(0, 212, 255, 0.1);
}

.radar-playback {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(0, 190, 255, 0.15);
    background: rgba(0, 20, 45, 0.35);
}

.radar-time-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
}

.radar-time-edge {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.radar-time-edge:first-child {
    text-align: left;
}

.radar-time-edge:last-child {
    text-align: right;
}

.radar-time-main {
    font-family: 'Rajdhani', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--cyan);
    text-align: center;
    letter-spacing: 0.3px;
}

.radar-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radar-now-btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(0, 212, 255, 0.1);
    color: var(--cyan);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    flex-shrink: 0;
}

.radar-now-btn:hover {
    background: rgba(0, 212, 255, 0.2);
}

.radar-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
}

.legend-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.legend-bar {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-rain {
    background: linear-gradient(90deg, rgba(0, 60, 120, 0.2), #00d4ff, #ffe600, #ff4500);
}

.legend-temp {
    background: linear-gradient(90deg, #1e4fd9, #00d4ff, #ffe600, #ff4500);
}

.legend-cloud {
    background: linear-gradient(90deg, rgba(5, 15, 35, 0.3), #8aa4c4, #e8eef8);
}

.radar-ctrl-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(0, 25, 55, 0.55);
    color: var(--cyan);
    cursor: pointer;
    flex-shrink: 0;
}

.radar-ctrl-btn:hover {
    background: rgba(0, 212, 255, 0.12);
}

.radar-play-btn {
    width: 40px;
}

.radar-slider {
    flex: 1;
    min-width: 0;
    accent-color: var(--cyan);
    height: 6px;
}

.radar-timestamp {
    font-size: 12px;
    color: var(--text-muted);
}

.radar-map {
    width: 100%;
    height: min(52vh, 360px);
    min-height: 240px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 190, 255, 0.2);
    z-index: 0;
}

.radar-map .maplibregl-ctrl-attrib {
    font-size: 10px;
    background: rgba(5, 10, 20, 0.75) !important;
    color: #8aa4c4 !important;
}

.maptiler-setup {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 240px;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.maptiler-setup code {
    color: var(--cyan);
    font-size: 12px;
}

.maptiler-setup a {
    color: var(--cyan);
}

.radar-location-pin {
    background: transparent !important;
    border: none !important;
    position: relative !important;
    width: 24px !important;
    height: 24px !important;
}

.radar-dot-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    background: var(--cyan);
    border: 2px solid #fff;
    box-shadow: 0 0 12px var(--cyan);
    z-index: 2;
}

.radar-dot-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border-radius: 50%;
    border: 2px solid rgba(0, 212, 255, 0.55);
    animation: radar-ping 2s ease-out infinite;
    z-index: 1;
}

@keyframes radar-ping {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Official warnings */
.alerts-panel .card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffb347;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.alert-item {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 120, 40, 0.08);
    border: 1px solid rgba(255, 140, 60, 0.35);
}

.alert-item.alert-extreme,
.alert-item.alert-severe {
    background: rgba(220, 40, 40, 0.12);
    border-color: rgba(255, 80, 80, 0.45);
}

.alert-source {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cyan);
    margin-bottom: 4px;
}

.alert-headline {
    font-family: Rajdhani, sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.alert-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.install-guide a {
    color: var(--cyan);
}
