:root {
    color-scheme: light;
    --ink: #1d2b45;
    --muted: #8b97aa;
    --blue: #4778e8;
    --blue-dark: #3565d4;
    --line: #edf0f5;
    --paper: #ffffff;
    --canvas: #f4f7fb;
    font-family: "DM Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
}

button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
}

.sidebar {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 34px 22px 24px;
    background: var(--paper);
    border-right: 1px solid #e9edf4;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin: 0 0 62px 5px;
    color: var(--ink);
    font: 800 20px/1 "Manrope", sans-serif;
    letter-spacing: -1px;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #ffc968, #f8a547);
    font: 700 25px/1 "Segoe UI", sans-serif;
}

.sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 4px 19px;
}

.eyebrow {
    margin: 0 0 8px;
    color: #a0a9b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.6px;
}

.sidebar-heading h1 {
    margin: 0;
    font: 700 19px/1.3 "Manrope", sans-serif;
    letter-spacing: -.5px;
}

.city-count {
    display: grid;
    min-width: 27px;
    height: 27px;
    padding: 0 7px;
    place-items: center;
    border-radius: 9px;
    color: #718099;
    background: #f3f5f9;
    font-size: 12px;
    font-weight: 700;
}

.city-search {
    display: flex;
    align-items: center;
    height: 46px;
    padding: 0 8px 0 13px;
    border: 1px solid #e8ecf2;
    border-radius: 12px;
    background: #fbfcfe;
    transition: border-color .2s, box-shadow .2s;
}

.city-search:focus-within {
    border-color: #9ab6f6;
    box-shadow: 0 0 0 3px #4778e81a;
}

.search-icon { color: #9aa5b7; font: 26px/1 "Segoe UI", sans-serif; transform: rotate(-20deg); }

.city-search input {
    width: 100%;
    min-width: 0;
    padding: 0 9px;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-size: 13px;
}

.city-search input::placeholder { color: #aab3c1; }

.city-search button {
    display: grid;
    flex: 0 0 29px;
    height: 29px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: #76849a;
    background: #eef1f6;
    font-size: 17px;
}

.city-search button:hover { color: white; background: var(--blue); }
.search-hint { margin: 10px 4px 24px; color: #a0a9b8; font-size: 11px; line-height: 1.5; }

.suggestions {
    display: grid;
    gap: 5px;
    margin: -17px 0 20px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    box-shadow: 0 10px 26px #26375712;
}

.suggestions[hidden] { display: none; }

.suggestion-button {
    display: block;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 8px;
    color: var(--ink);
    background: transparent;
    text-align: left;
}

.suggestion-button:hover, .suggestion-button:focus-visible { background: #f3f6fc; outline: 0; }
.suggestion-name { display: block; font-size: 12px; font-weight: 700; }
.suggestion-detail { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }

.city-list { display: grid; gap: 8px; }

.city-button {
    display: grid;
    grid-template-columns: 41px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: var(--ink);
    background: transparent;
    text-align: left;
    transition: background .18s, border-color .18s;
}

.city-button:hover { background: #f8f9fc; }
.city-button.active { border-color: #e6edfc; background: #f1f5ff; }

.city-weather-icon {
    display: grid;
    width: 41px;
    height: 41px;
    place-items: center;
    border-radius: 12px;
    background: #fff7e8;
    font-size: 21px;
}

.city-copy { min-width: 0; }
.city-name { display: block; overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.city-country { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.city-temperature { font: 700 14px/1 "Manrope", sans-serif; }
.city-loading { color: var(--muted); font-size: 10px; }

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding: 17px 5px 0;
    border-top: 1px solid var(--line);
    color: #909bad;
    font-size: 10px;
}

.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #63c99a; box-shadow: 0 0 0 3px #63c99a20; }

.main-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0 48px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 83px;
    border-bottom: 1px solid #e9edf4;
}

.topbar-actions { display: flex; align-items: center; gap: 18px; }
.breadcrumb { display: flex; align-items: center; gap: 11px; color: #9aa4b4; font-size: 12px; }
.breadcrumb span:last-child { color: #52617a; font-weight: 600; }
.breadcrumb-slash { color: #d3d9e3; }
.updated-label { display: flex; align-items: center; gap: 7px; color: #8591a5; font-size: 11px; }
.refresh-icon { color: var(--blue); font-size: 17px; }

.language-switch {
    display: flex;
    gap: 3px;
    padding: 3px;
    border: 1px solid #e8ecf2;
    border-radius: 9px;
    background: #fff;
}

.language-button {
    min-width: 33px;
    padding: 6px 7px;
    border: 0;
    border-radius: 6px;
    color: #8793a7;
    background: transparent;
    font-size: 10px;
    font-weight: 700;
}

.language-button.active { color: #3565d4; background: #edf3ff; }

.dashboard { width: 100%; max-width: 1100px; margin: 0 auto; padding: 37px 0 28px; }

.notice {
    margin: 18px 0 -18px;
    padding: 12px 15px;
    border: 1px solid #f3d9ad;
    border-radius: 11px;
    color: #795822;
    background: #fff8e9;
    font-size: 12px;
    line-height: 1.5;
}

.notice[hidden] { display: none; }
.notice.error { border-color: #f2c7c7; color: #8f3939; background: #fff3f2; }

.welcome-card {
    position: relative;
    overflow: hidden;
    min-height: 470px;
    padding: 65px;
    border: 1px solid #e8eef9;
    border-radius: 22px;
    background: linear-gradient(115deg, #fff 5%, #f8faff 64%, #eef4ff);
}

.welcome-card > :not(.welcome-orb) { position: relative; z-index: 1; }
.welcome-card .eyebrow { margin-bottom: 17px; color: #7f9fe0; }
.welcome-card h2 { margin: 0; font: 800 clamp(38px, 5vw, 58px)/1.13 "Manrope", sans-serif; letter-spacing: -2.7px; }
.welcome-copy { max-width: 390px; margin: 18px 0 23px; color: #8490a3; font-size: 14px; line-height: 1.8; }
.welcome-link { color: var(--blue); font-size: 13px; font-weight: 700; text-decoration: none; }
.welcome-link span { margin-left: 5px; }
.welcome-link:hover { color: var(--blue-dark); }

.welcome-orb {
    position: absolute;
    top: 58px;
    right: 9%;
    display: grid;
    width: 215px;
    height: 215px;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle, #ffdc8c 0 31%, #ffe9ba 32% 45%, #fff6e3 46% 65%, #fffaf0 66%);
    color: #f4a940;
    font: 100px/1 "Segoe UI", sans-serif;
    opacity: .9;
}

.weather-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 23px;
}

.location-eyebrow { margin: 0 0 8px; color: #98a2b2; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.weather-heading h2 { margin: 0; font: 800 clamp(28px, 4vw, 39px)/1.2 "Manrope", sans-serif; letter-spacing: -1.5px; }
.weather-date { margin: 8px 0 0; color: #8b97aa; font-size: 12px; }
.city-time { flex: 0 0 auto; margin-top: 5px; padding: 9px 13px; border: 1px solid #e6eaf1; border-radius: 9px; color: #65738a; background: #fff; font-size: 11px; }

.current-card {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
    min-height: 230px;
    padding: 30px 36px;
    border-radius: 20px;
    color: white;
    background:
        radial-gradient(ellipse at 86% 9%, #ffffff32 0, transparent 31%),
        linear-gradient(115deg, #4d80ee 0%, #5b8bed 57%, #7da8f5 100%);
    box-shadow: 0 16px 35px #4778e829;
}

.current-summary { display: flex; align-items: center; gap: 18px; }
.current-icon { font-size: 61px; line-height: 1; filter: drop-shadow(0 5px 10px #244e9b33); }
.current-condition { margin: 0 0 5px; color: #e3ecff; font-size: 13px; }
.current-temp { margin: 0; font: 700 clamp(46px, 6vw, 67px)/1 "Manrope", sans-serif; letter-spacing: -4px; }
.current-temp small { margin-left: 6px; font-size: 22px; font-weight: 500; vertical-align: 21px; letter-spacing: 0; }
.feels-like { margin: 8px 0 0; color: #e3ecff; font-size: 11px; }

.current-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding-left: 28px; border-left: 1px solid #ffffff45; }
.detail-item { min-width: 0; }
.detail-label { display: block; margin-bottom: 5px; color: #e1eaff; font-size: 10px; }
.detail-value { font: 700 15px/1.3 "Manrope", sans-serif; }

.section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 32px 0 14px;
}

.section-title h3 { margin: 0; font: 700 17px/1.3 "Manrope", sans-serif; letter-spacing: -.4px; }
.section-title span { color: #98a2b2; font-size: 11px; }
.forecast-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }

.forecast-tabs {
    display: flex;
    gap: 7px;
    width: fit-content;
    margin-top: 30px;
    padding: 4px;
    border: 1px solid #e9edf3;
    border-radius: 11px;
    background: #fff;
}

.forecast-tab {
    padding: 9px 14px;
    border: 0;
    border-radius: 8px;
    color: #8591a5;
    background: transparent;
    font-size: 11px;
    font-weight: 600;
}

.forecast-tab.active { color: #3565d4; background: #edf3ff; }
.forecast-tab:focus-visible, .language-button:focus-visible { outline: 2px solid #7fa2ef; outline-offset: 2px; }

.forecast-day {
    min-width: 0;
    padding: 15px 8px 14px;
    border: 1px solid #e9edf3;
    border-radius: 14px;
    background: #fff;
    text-align: center;
    transition: transform .18s, box-shadow .18s;
}

.forecast-day:hover { transform: translateY(-3px); box-shadow: 0 10px 22px #283e6710; }
.forecast-day.today { border-color: #cddafa; background: #f6f8ff; }
.forecast-name { display: block; overflow: hidden; color: #718098; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.forecast-day.today .forecast-name { color: var(--blue); }
.forecast-icon { display: block; margin: 10px 0 8px; font-size: 25px; }
.forecast-description { display: block; min-height: 27px; color: #97a1b0; font-size: 9px; line-height: 1.35; }
.forecast-temps { display: flex; justify-content: center; gap: 7px; margin-top: 10px; font: 700 11px/1.3 "Manrope", sans-serif; white-space: nowrap; }
.forecast-low { color: #a4adbb; font-weight: 500; }
.rain-chance { display: block; margin-top: 8px; color: #6f9cec; font-size: 9px; }

.hourly-grid {
    display: grid;
    grid-auto-columns: 78px;
    grid-auto-flow: column;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 2px 12px;
    cursor: grab;
    touch-action: pan-x pan-y;
    scrollbar-color: #cbd6e8 transparent;
    scrollbar-width: thin;
}

.hourly-grid.is-dragging { cursor: grabbing; user-select: none; }
.hourly-grid.is-dragging .hourly-item { pointer-events: none; }

.hourly-item {
    display: grid;
    min-height: 132px;
    justify-items: center;
    align-content: center;
    gap: 10px;
    border: 1px solid #e9edf3;
    border-radius: 14px;
    background: #fff;
}

.hourly-time { color: #718098; font-size: 10px; font-weight: 600; }
.hourly-icon { font-size: 23px; }
.hourly-temp { color: var(--ink); font: 700 15px/1 "Manrope", sans-serif; }
.hourly-rain { color: #6f9cec; font-size: 9px; }

.loading-card, .empty-state {
    padding: 50px 20px;
    border: 1px dashed #dce3ee;
    border-radius: 17px;
    color: #8793a7;
    background: #fff;
    text-align: center;
    font-size: 13px;
}

.loading-spinner { display: inline-block; width: 17px; height: 17px; margin-right: 8px; border: 2px solid #dce6fb; border-top-color: var(--blue); border-radius: 50%; vertical-align: -4px; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: 1100px;
    margin: auto auto 0;
    padding: 19px 0 24px;
    border-top: 1px solid #e9edf4;
    color: #a0a9b7;
    font-size: 10px;
}

.page-footer a { color: #7186aa; text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }
.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; padding: 0; border: 0; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 980px) {
    .main-content { padding: 0 28px; }
    .forecast-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .welcome-card { padding: 53px 40px; }
    .welcome-orb { right: 4%; width: 170px; height: 170px; font-size: 80px; }
}

@media (max-width: 700px) {
    .app-shell { display: block; }
    .sidebar { min-height: 0; padding: 18px 18px 14px; border-right: 0; border-bottom: 1px solid #e9edf4; }
    .brand { margin: 0 0 20px 2px; font-size: 18px; }
    .brand-mark { width: 31px; height: 31px; border-radius: 10px; font-size: 22px; }
    .sidebar-heading { margin-bottom: 13px; }
    .sidebar-heading h1 { font-size: 17px; }
    .search-hint { margin: 7px 4px 12px; }
    .city-list { display: flex; overflow-x: auto; gap: 7px; padding: 1px 0 5px; }
    .city-button { flex: 0 0 175px; padding: 8px; }
    .sidebar-footer { display: none; }
    .suggestions { margin: 7px 0 10px; }
    .main-content { min-height: calc(100vh - 250px); padding: 0 18px; }
    .topbar { min-height: 61px; }
    .dashboard { padding: 24px 0; }
    .welcome-card { min-height: 390px; padding: 40px 27px; }
    .welcome-orb { top: auto; right: 18px; bottom: 20px; width: 130px; height: 130px; font-size: 62px; opacity: .55; }
    .welcome-card h2 { font-size: 43px; }
    .welcome-copy { max-width: 310px; font-size: 13px; }
    .weather-heading { align-items: center; }
    .topbar-actions { gap: 8px; }
    .updated-label { font-size: 10px; }
    .city-time { padding: 8px; font-size: 10px; }
    .current-card { grid-template-columns: 1fr; gap: 24px; padding: 26px 23px; }
    .current-details { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 17px 0 0; border-top: 1px solid #ffffff45; border-left: 0; }
    .detail-value { font-size: 12px; }
    .detail-label { font-size: 9px; }
    .forecast-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .forecast-day:nth-child(n+5) { display: block; }
    .forecast-day:last-child { grid-column: span 2; }
    .forecast-tabs { margin-top: 25px; }
    .forecast-tab { padding: 9px 11px; font-size: 10px; }
    .section-title { align-items: flex-start; gap: 9px; }
    .section-title span { text-align: right; }
    .page-footer { flex-wrap: wrap; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
