:root {
  --txt: #fff;
  --txt-2: rgba(255, 255, 255, .74);
  --txt-3: rgba(255, 255, 255, .52);
  --stroke: rgba(255, 255, 255, .24);
  --line: rgba(255, 255, 255, .12);
  --tile: rgba(255, 255, 255, .08);
  --rain: #8fd3ff;
  --shadow: 0 24px 60px -24px rgba(4, 14, 44, .6);
  --r-xl: 30px;
  --r-l: 22px;
  --r-m: 16px;
  --f-display: 'Rubik', system-ui, sans-serif;
  --f-body: 'Heebo', system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100dvh;
  background: #2767b3;
  color: var(--txt);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 1.6s var(--ease);
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
b { font-weight: 500; }

/* ---------- sky ---------- */
.sky { position: fixed; inset: 0; z-index: -3; opacity: 0; transition: opacity 1.8s var(--ease); }
#sky-canvas { position: fixed; inset: 0; z-index: -2; width: 100%; height: 100%; pointer-events: none; }
.sky-vignette { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(120% 90% at 50% 0%, transparent 45%, rgba(0, 8, 30, .28)); }

/* ---------- shell ---------- */
.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding-inline: 16px; }
main.wrap { padding-bottom: 40px; min-height: 70vh; }

.glass {
  position: relative;
  background: linear-gradient(150deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .07) 60%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .4);
}

.tilt {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .6s var(--ease), box-shadow .4s;
  transform-style: preserve-3d;
}
.tilt::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .22), transparent 45%);
  opacity: 0;
  transition: opacity .4s;
}
.tilt:hover::after { opacity: 1; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; padding-top: env(safe-area-inset-top); transition: background .4s, backdrop-filter .4s; }
.topbar.scrolled { background: rgba(10, 24, 56, .22); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--f-display); font-weight: 500; font-size: 24px; letter-spacing: -.02em; }
.brand span { background: linear-gradient(180deg, #fff 30%, #cfe6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo { width: 44px; height: 44px; overflow: visible; }
.logo-cloud { animation: bob 5s ease-in-out infinite; }
.logo-drop { animation: logoDrop 2.4s cubic-bezier(.5, 0, .75, 0) infinite; }
@keyframes logoDrop { 0%, 30% { transform: translateY(-4px) scale(.4); opacity: 0; } 45% { opacity: 1; transform: translateY(0) scale(1); } 90% { transform: translateY(14px); opacity: 1; } 100% { transform: translateY(18px); opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-2.5px); } }

.units { display: flex; position: relative; padding: 4px; border-radius: 999px; }
.units button { position: relative; z-index: 1; width: 46px; height: 34px; border-radius: 999px; font-family: var(--f-display); font-weight: 500; font-size: 14px; color: var(--txt-2); transition: color .35s; }
.units .pill { position: absolute; top: 4px; left: 4px; width: 46px; height: 34px; border-radius: 999px; background: rgba(255, 255, 255, .92); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35); transition: transform .5s var(--spring); }
.units[data-unit="F"] .pill { transform: translateX(46px); }
.units[data-unit="C"] button[data-u="C"], .units[data-unit="F"] button[data-u="F"] { color: #15365f; }

/* ---------- views ---------- */
.view { opacity: 0; transform: translateY(18px) scale(.985); transition: opacity .45s var(--ease), transform .55s var(--ease); }
.view.active { opacity: 1; transform: none; }
.view.leaving { opacity: 0; transform: translateY(-12px) scale(.985); transition-duration: .22s; }

/* ---------- ui icons ---------- */
.ui { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ui-wind .w1 { animation: gust 3s ease-in-out infinite; }
.ui-wind .w2 { animation: gust 3s ease-in-out .3s infinite; }
.ui-wind .w3 { animation: gust 3s ease-in-out .6s infinite; }
@keyframes gust { 50% { transform: translateX(1.5px); } }
.ui-drop, .ui-humidity { animation: bob 2.8s ease-in-out infinite; }
.ui-clock .hand { transform-origin: 12px 12px; animation: spin 8s linear infinite; }
.ui-locate { animation: spin 14s linear infinite; }
.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); opacity: .75; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- weather icons ---------- */
.wi { display: block; width: 48px; height: 48px; overflow: visible; }
.wi .a-spin, .wi .a-glow, .wi .a-rock, .wi .a-tw, .wi .a-snow { transform-box: fill-box; transform-origin: center; }
.wi .a-spin { animation: spin 24s linear infinite; }
.wi .a-glow { animation: glow 4s ease-in-out infinite; }
.wi .a-drift { animation: drift 6s ease-in-out infinite; }
.wi .a-drift2 { animation: drift 8s ease-in-out infinite reverse; }
.wi .a-rock { animation: rock 7s ease-in-out infinite; }
.wi .a-tw { animation: tw 2.4s ease-in-out infinite; }
.wi .a-tw.d2 { animation-delay: 1.1s; }
.wi .a-fall { animation: fall 1.15s linear infinite; }
.wi .a-fall.fast { animation-duration: .8s; }
.wi .a-snow { animation: snowfall 2.8s linear infinite; }
.wi .a-flash { animation: flash 3.4s ease-out infinite; }
.wi .a-fog { animation: fogslide 5s ease-in-out infinite; }
.wi .a-fog.d2 { animation-delay: -2.5s; }
@keyframes glow { 50% { transform: scale(1.12); opacity: .75; } }
@keyframes drift { 50% { transform: translateX(2.5px); } }
@keyframes rock { 50% { transform: rotate(-8deg); } }
@keyframes tw { 0%, 100% { transform: scale(.4); opacity: .3; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes fall { 0% { transform: translateY(-3px); opacity: 0; } 15%, 80% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
@keyframes snowfall { 0% { transform: translateY(-3px) rotate(0); opacity: 0; } 15%, 80% { opacity: 1; } 100% { transform: translateY(13px) rotate(180deg); opacity: 0; } }
@keyframes flash { 0%, 62%, 72%, 100% { opacity: .15; } 64%, 70% { opacity: 1; } 67% { opacity: .4; } }
@keyframes fogslide { 50% { transform: translateX(5px); } }
.float { animation: float 6s ease-in-out infinite; filter: drop-shadow(0 18px 24px rgba(0, 20, 60, .28)); }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-1.5deg); } }

/* ---------- section titles ---------- */
.sec-title { display: flex; align-items: center; gap: 8px; margin: 30px 4px 12px; font-family: var(--f-display); font-size: 12.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--txt-2); }
.sec-title .ui { width: 16px; height: 16px; }
.sec-title .mini { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--txt-2); transition: background .25s, color .25s, transform .3s var(--spring); }
.sec-title .mini:hover { background: rgba(255, 255, 255, .14); color: #fff; transform: rotate(90deg); }

/* ---------- search ---------- */
.search { position: relative; z-index: 30; margin-top: 10px; }
.search-box { display: flex; align-items: center; gap: 6px; height: 64px; padding: 0 8px 0 20px; border-radius: 24px; transition: box-shadow .35s, transform .35s var(--ease); }
.search.focus .search-box { box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .4), 0 0 0 4px rgba(160, 215, 255, .28); transform: translateY(-1px); }
.search-ic .ui { width: 22px; height: 22px; color: var(--txt-2); transition: transform .4s var(--spring), color .3s; }
.search.focus .search-ic .ui { transform: scale(1.15) rotate(-10deg); color: #fff; }
#q { flex: 1; min-width: 0; height: 100%; padding-left: 8px; background: none; border: 0; outline: 0; font-family: var(--f-display); font-size: 18px; font-weight: 400; }
#q::placeholder { color: var(--txt-3); }
.icon-btn { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; color: var(--txt-2); transition: background .25s, color .25s, transform .35s var(--spring), opacity .3s; }
.icon-btn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.icon-btn:active { transform: scale(.9); }
.icon-btn .ui { width: 22px; height: 22px; }
.clear-q { opacity: 0; pointer-events: none; transform: scale(.6); }
.search.has .clear-q { opacity: 1; pointer-events: auto; transform: none; }
.locate { background: rgba(255, 255, 255, .14); color: #fff; }
.locate.busy .ui { animation: spin 1s linear infinite; }

.suggest {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0;
  padding: 6px; border-radius: 24px;
  background: rgba(14, 28, 60, .84);
  -webkit-backdrop-filter: blur(26px) saturate(160%); backdrop-filter: blur(26px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .55);
  transform-origin: top center;
  opacity: 0; transform: translateY(-8px) scale(.97); pointer-events: none;
  transition: opacity .3s var(--ease), transform .4s var(--ease);
  max-height: min(420px, 60vh); overflow-y: auto;
}
.suggest.open { opacity: 1; transform: none; pointer-events: auto; }
.sug { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 16px; text-align: left; animation: rise .45s var(--ease) both; animation-delay: calc(var(--i) * 35ms); transition: background .2s; }
.sug:hover, .sug.active { background: rgba(255, 255, 255, .12); }
.sug-ic { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); }
.sug-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sug-t b { font-family: var(--f-display); font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-t b mark { background: none; color: #bfe6ff; }
.sug-t small { font-size: 13px; color: var(--txt-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug > .ui { color: var(--txt-3); transition: transform .3s var(--ease); }
.sug:hover > .ui, .sug.active > .ui { transform: translateX(3px); color: #fff; }
.sug-msg { display: flex; align-items: center; gap: 12px; padding: 14px; color: var(--txt-2); font-size: 14px; animation: rise .4s var(--ease) both; }
.sug-msg .dots { display: inline-flex; gap: 4px; }
.sug-msg .dots i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: dot 1s ease-in-out infinite; }
.sug-msg .dots i:nth-child(2) { animation-delay: .15s; }
.sug-msg .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-5px); opacity: .5; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- here card ---------- */
#here { margin-top: 18px; }
.here { width: 100%; display: block; padding: 22px 26px; border-radius: var(--r-xl); text-align: left; animation: cardIn .8s var(--ease) both; }
@keyframes cardIn { from { opacity: 0; transform: perspective(1000px) translateY(28px) rotateX(-14deg); } }
.here-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.here-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--txt-2); }
.here-label .ui { width: 15px; height: 15px; }
.here-place { width: 100%; font-family: var(--f-display); font-size: 26px; font-weight: 500; letter-spacing: -.01em; }
.here-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 6px; }
.temp-xl { display: flex; align-items: flex-start; font-family: var(--f-display); font-weight: 300; line-height: .9; letter-spacing: -.05em; }
.temp-xl .big { font-size: clamp(84px, 19vw, 136px); }
.temp-xl .deg { font-size: clamp(40px, 8vw, 64px); margin-top: .12em; opacity: .85; }
.here .hero-icon, .now .hero-icon { width: clamp(118px, 26vw, 170px); height: clamp(118px, 26vw, 170px); margin-right: -8px; }
.here-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 15px; color: var(--txt-2); }
.here-foot .cond-l { color: #fff; font-family: var(--f-display); font-weight: 500; font-size: 18px; }
.here-foot .go { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 7px 10px 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; font-size: 14px; transition: background .25s, gap .3s var(--ease); }
.here:hover .go { background: rgba(255, 255, 255, .26); gap: 8px; }
.here-off { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 22px 24px; border-radius: var(--r-xl); animation: cardIn .8s var(--ease) both; }
.here-off > .ui { width: 40px; height: 40px; stroke-width: 1.4; animation: bob 3s ease-in-out infinite; }
.here-off div { flex: 1; min-width: 200px; }
.here-off h3 { font-family: var(--f-display); font-weight: 500; font-size: 19px; }
.here-off p { color: var(--txt-2); font-size: 14px; }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #14335a; font-family: var(--f-display); font-weight: 500; transition: transform .35s var(--spring), box-shadow .3s; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .4); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(.95); }

/* ---------- skeleton ---------- */
.sk { display: block; border-radius: 12px; background: linear-gradient(100deg, rgba(255, 255, 255, .08) 20%, rgba(255, 255, 255, .24) 40%, rgba(255, 255, 255, .08) 60%); background-size: 250% 100%; animation: shimmer 1.5s linear infinite; }
.sk.round { border-radius: 50%; }
@keyframes shimmer { from { background-position: 125% 0; } to { background-position: -125% 0; } }

/* ---------- favorites ---------- */
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.fav { display: flex; flex-direction: column; gap: 2px; padding: 16px 16px 14px; border-radius: var(--r-l); text-align: left; animation: cardIn .7s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
.fav-top { display: flex; align-items: center; gap: 6px; }
.fav-top .ui { width: 14px; height: 14px; color: #ffd66b; fill: #ffd66b; }
.fav-name { font-family: var(--f-display); font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-sub { font-size: 12.5px; color: var(--txt-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-mid { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.fav-mid .temp { font-family: var(--f-display); font-weight: 300; font-size: 38px; letter-spacing: -.04em; line-height: 1; }
.fav-mid .wi { width: 54px; height: 54px; }
.fav-cond { font-size: 13px; color: var(--txt-2); }
.empty { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--r-l); color: var(--txt-2); font-size: 14px; animation: cardIn .7s var(--ease) both; }
.empty .ui { width: 28px; height: 28px; color: #ffd66b; animation: twinkleStar 3s ease-in-out infinite; }
@keyframes twinkleStar { 50% { transform: rotate(18deg) scale(1.15); } }

/* ---------- recents ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; height: 42px; border-radius: 999px; animation: chipIn .5s var(--spring) both; animation-delay: calc(var(--i) * 40ms); overflow: hidden; }
@keyframes chipIn { from { opacity: 0; transform: scale(.7); } }
.chip-go { display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 6px 0 14px; font-size: 14.5px; max-width: 240px; }
.chip-go span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-go .ui { width: 16px; height: 16px; color: var(--txt-2); }
.chip-x { width: 34px; height: 100%; display: grid; place-items: center; color: var(--txt-3); transition: color .2s, transform .3s var(--spring); }
.chip-x .ui { width: 14px; height: 14px; }
.chip-x:hover { color: #fff; transform: rotate(90deg); }
.chip.gone { animation: chipOut .3s var(--ease) forwards; }
@keyframes chipOut { to { opacity: 0; transform: scale(.6); } }
.chip:hover { background: linear-gradient(150deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .12)); }

/* ---------- forecast header ---------- */
.fc-top { display: flex; align-items: center; gap: 12px; margin-top: 8px; animation: rise .5s var(--ease) both; }
.round-btn { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 50%; transition: transform .35s var(--spring), background .25s; }
.round-btn:hover { transform: scale(1.07); }
.round-btn:active { transform: scale(.9); }
.round-btn .ui { width: 22px; height: 22px; }
.back-btn:hover .ui { animation: nudge .6s var(--ease); }
@keyframes nudge { 50% { transform: translateX(-3px); } }
.fc-title { flex: 1; min-width: 0; }
.fc-title h1 { font-family: var(--f-display); font-weight: 500; font-size: clamp(22px, 4.6vw, 32px); letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-title p { color: var(--txt-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star-btn .ui { transition: fill .3s, color .3s; }
.star-btn.on .ui { fill: #ffd66b; color: #ffd66b; }
.star-btn.star-pop .ui { animation: starPop .6s var(--spring); }
@keyframes starPop { 0% { transform: scale(1); } 40% { transform: scale(1.5) rotate(20deg); } 100% { transform: scale(1); } }
.refresh-btn.spin .ui { animation: spin .9s linear infinite; }
.fc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 4px 0; font-size: 13px; color: var(--txt-2); animation: rise .5s var(--ease) .08s both; }
.fc-meta span { display: inline-flex; align-items: center; gap: 6px; }
.fc-meta .ui { width: 15px; height: 15px; }
.src-chip { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); }

/* ---------- now card ---------- */
.now { margin-top: 16px; padding: 22px 26px; border-radius: var(--r-xl); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; animation: cardIn .8s var(--ease) .05s both; }
.now-cond { font-family: var(--f-display); font-size: 19px; font-weight: 500; }
.now-hl { color: var(--txt-2); font-size: 15px; }
.now .hero-icon { grid-row: 1 / 2; grid-column: 2; align-self: center; }
.now-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.now-stats div { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; animation: rise .5s var(--ease) both; animation-delay: calc(.2s + var(--k) * 60ms); }
.now-stats .ui { grid-row: span 2; width: 22px; height: 22px; color: var(--txt-2); }
.now-stats b { font-family: var(--f-display); font-size: 17px; font-weight: 500; }
.now-stats div > span { font-size: 12px; color: var(--txt-2); }

/* ---------- days ---------- */
.days { display: flex; flex-direction: column; gap: 10px; perspective: 1400px; }
.day { border-radius: var(--r-l); scroll-margin-top: 84px; animation: dayIn .75s var(--ease) both; animation-delay: calc(.1s + var(--i) * 45ms); transition: background .35s, box-shadow .35s; }
@keyframes dayIn { from { opacity: 0; transform: translateY(26px) rotateX(-28deg); } }
.day.open { background: linear-gradient(150deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, .1) 60%); }
.day-head { width: 100%; display: grid; grid-template-columns: 96px 56px minmax(0, 1fr) minmax(170px, 250px) 24px; align-items: center; gap: 14px; padding: 12px 16px; text-align: left; border-radius: var(--r-l); }
.d-date { display: flex; flex-direction: column; line-height: 1.2; }
.d-date b { font-family: var(--f-display); font-weight: 500; font-size: 17px; }
.d-date small { font-size: 13px; color: var(--txt-2); }
.d-icon .wi { width: 52px; height: 52px; transition: transform .5s var(--spring); }
.day-head:hover .d-icon .wi { transform: scale(1.14) translateY(-2px); }
.d-cond { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.d-cond b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--rain); }
.pop .ui { width: 14px; height: 14px; }
.pop.low { color: var(--txt-3); }
.pop.low .ui { animation: none; }
.d-range { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 17px; }
.d-range .lo { color: var(--txt-2); text-align: right; }
.d-range .hi { font-weight: 500; }
.bar { position: relative; height: 7px; border-radius: 7px; background: rgba(255, 255, 255, .14); }
.bar i { position: absolute; top: 0; bottom: 0; border-radius: 7px; animation: barIn 1s var(--ease) both; animation-delay: calc(.35s + var(--i) * 45ms); transform-origin: left; box-shadow: 0 0 12px -2px rgba(255, 255, 255, .35); }
@keyframes barIn { from { transform: scaleX(0); opacity: 0; } }
.now-dot { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: #fff; border: 2px solid rgba(20, 50, 90, .55); animation: pulse 2s ease-in-out infinite; }
.d-chev { color: var(--txt-2); transition: transform .5s var(--spring); display: grid; place-items: center; }
.day.open .d-chev { transform: rotate(180deg); color: #fff; }
.day-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.day.open .day-body { grid-template-rows: 1fr; }
.day-inner { overflow: hidden; min-height: 0; }
.detail { padding: 2px 16px 18px; opacity: 0; transform: translateY(-8px); transition: opacity .45s var(--ease) .1s, transform .55s var(--ease) .1s; }
.day.open .detail { opacity: 1; transform: none; }

.agree { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; font-size: 13px; color: var(--txt-2); }
.agree .ui { width: 16px; height: 16px; }
.agree .dot { width: 8px; height: 8px; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }

/* hourly */
.h-wrap { position: relative; margin: 0 -16px; }
.h-wrap::before, .h-wrap::after { content: ''; position: absolute; top: 0; bottom: 0; width: 22px; z-index: 2; pointer-events: none; }
.h-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 0 16px 4px; cursor: grab; }
.h-scroll::-webkit-scrollbar { display: none; }
.h-track { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 58px; }
.h-chart { position: absolute; left: 0; top: 74px; overflow: visible; pointer-events: none; }
.h-line { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s var(--ease) .25s forwards; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25)); }
.h-area { opacity: 0; animation: fadeIn 1s var(--ease) .7s forwards; }
.h-pt { fill: #fff; opacity: 0; animation: fadeIn .4s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }
.h-col { position: relative; height: 212px; display: flex; flex-direction: column; align-items: center; animation: rise .5s var(--ease) both; animation-delay: calc(var(--j) * 18ms); }
.h-time { height: 18px; font-size: 12.5px; color: var(--txt-2); }
.h-col.is-now .h-time { color: #fff; font-weight: 600; }
.h-col .wi { width: 36px; height: 36px; margin-top: 6px; }
.h-t { position: absolute; top: calc(74px + var(--y) - 22px); font-family: var(--f-display); font-size: 14.5px; font-weight: 500; text-shadow: 0 1px 6px rgba(0, 0, 0, .25); }
.h-pop { margin-top: auto; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.h-pop i { width: 6px; height: calc(max(2px, var(--p) * .3px)); border-radius: 4px; background: linear-gradient(180deg, #b6e5ff, #3b9bff); transform-origin: bottom; animation: grow .8s var(--spring) both; animation-delay: calc(.4s + var(--j) * 20ms); }
.h-pop small { font-size: 11.5px; color: var(--rain); }
.h-pop.low small { color: var(--txt-3); }
.h-pop.low i { background: rgba(255, 255, 255, .2); }
@keyframes grow { from { transform: scaleY(0); } }
.h-wind { display: flex; align-items: center; gap: 2px; margin-top: 4px; font-size: 11.5px; color: var(--txt-2); }
.h-wind .ui { width: 12px; height: 12px; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 18px; background: var(--tile); border: 1px solid var(--line); animation: tileIn .6s var(--ease) both; animation-delay: calc(.2s + var(--k) * 60ms); transition: background .3s, transform .4s var(--ease); }
.tile:hover { background: rgba(255, 255, 255, .13); transform: translateY(-3px); }
@keyframes tileIn { from { opacity: 0; transform: perspective(800px) translateY(16px) rotateX(-20deg); } }
.tile-h { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--txt-2); }
.tile-h .ui { width: 15px; height: 15px; }
.tile-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-v { font-family: var(--f-display); font-size: 30px; font-weight: 400; letter-spacing: -.02em; line-height: 1.15; }
.tile-v small { font-size: 15px; font-weight: 400; color: var(--txt-2); margin-left: 2px; }
.tile-s { font-size: 14px; }
.tile-f { font-size: 12.5px; color: var(--txt-2); margin-top: auto; }
.vis { flex: none; overflow: visible; }
.drop-g, .tank { width: 44px; height: 56px; }
.fill-rise { animation: fillRise 1.6s var(--ease) .3s both; }
@keyframes fillRise { from { transform: translateY(58px); } }
.fill-rise > g { transform: translateY(var(--to)); }
.wave { animation: wave 2.4s linear infinite; }
@keyframes wave { to { transform: translateX(22px); } }
.compass { width: 58px; height: 58px; }
.needle { transform-origin: 29px 29px; transform: rotate(var(--r)); animation: needleIn 1.4s var(--spring) .3s both; }
.needle > g { transform-origin: 29px 29px; animation: wobble 3s ease-in-out infinite; }
@keyframes needleIn { from { transform: rotate(calc(var(--r) - 220deg)); } }
@keyframes wobble { 50% { transform: rotate(7deg); } }
.gauge { width: 60px; height: 38px; }
.gauge-v { fill: none; stroke: url(#g-uv); stroke-width: 6; stroke-linecap: round; stroke-dasharray: var(--f) 1; stroke-dashoffset: var(--f); animation: gauge 1.4s var(--ease) .3s forwards; }
@keyframes gauge { to { stroke-dashoffset: 0; } }
.thermo-v { width: 30px; height: 58px; }
.thermo-fill { transform-box: fill-box; transform-origin: bottom; animation: grow 1.3s var(--spring) .35s both; }
.sun-arc { width: 72px; height: 46px; }
.sun-path { fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 1.6; stroke-dasharray: 3 4; }
.sun-dot { animation: fadeIn .6s ease 1s both; }
.sun-dot circle { animation: pulse 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.sun-times { display: flex; gap: 14px; font-family: var(--f-display); font-size: 19px; }
.sun-times span { display: inline-flex; align-items: center; gap: 5px; }
.sun-times .ui { width: 17px; height: 17px; color: #ffd27a; }

/* wear */
.wear { display: grid; grid-template-columns: 58px 1fr; gap: 14px; margin-top: 12px; padding: 16px 18px; border-radius: 18px; background: linear-gradient(135deg, rgba(255, 214, 120, .2), rgba(255, 130, 180, .12)); border: 1px solid rgba(255, 230, 190, .22); animation: tileIn .6s var(--ease) .5s both; }
.wear-ic { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); }
.wear-ic .ui { width: 32px; height: 32px; transform-origin: 12px 3px; animation: swing 3.2s ease-in-out infinite; }
@keyframes swing { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.wear h4 { font-family: var(--f-display); font-weight: 500; font-size: 17px; margin-bottom: 4px; }
.wear p { font-size: 14.5px; color: rgba(255, 255, 255, .9); }
.wear-items { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wear-items span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 9px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 13.5px; animation: chipIn .5s var(--spring) both; animation-delay: calc(.65s + var(--k) * 70ms); }
.wear-items .ui { width: 18px; height: 18px; animation: bob 2.6s ease-in-out infinite; animation-delay: calc(var(--k) * -.4s); }

/* models */
.models { margin-top: 18px; }
.sub-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 0 2px 8px; font-family: var(--f-display); font-weight: 500; font-size: 16px; }
.sub-title .ui { width: 19px; height: 19px; }
.sub-title small { width: 100%; font-family: var(--f-body); font-weight: 400; font-size: 12.5px; color: var(--txt-2); }
.model { display: grid; grid-template-columns: 34px minmax(0, 1.2fr) 44px 86px minmax(0, 1.3fr) 96px; align-items: center; gap: 12px; margin-top: 8px; padding: 10px 14px; border-radius: 16px; background: var(--tile); border: 1px solid var(--line); animation: modelIn .6s var(--ease) both; animation-delay: calc(.55s + var(--k) * 80ms); transition: background .3s, transform .4s var(--ease); }
.model:hover { background: rgba(255, 255, 255, .13); transform: translateX(4px); }
@keyframes modelIn { from { opacity: 0; transform: translateX(-24px); } }
.rank { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-weight: 600; font-size: 15px; color: #3a2a00; box-shadow: inset 0 2px 3px rgba(255, 255, 255, .7), inset 0 -3px 5px rgba(0, 0, 0, .2), 0 6px 12px -6px rgba(0, 0, 0, .5); }
.rank.r1 { background: radial-gradient(circle at 35% 30%, #fff6c4, #ffd23f 45%, #d99a00); }
.rank.r2 { background: radial-gradient(circle at 35% 30%, #ffffff, #d7dde6 45%, #8e98a8); color: #2a3240; }
.rank.r3 { background: radial-gradient(circle at 35% 30%, #ffe3c8, #e39a5c 45%, #9b5a26); color: #3a1a00; }
.rank.r4 { background: radial-gradient(circle at 35% 30%, #e0f0ff, #8fb8e6 45%, #4a6f9c); color: #0f2540; }
.m-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.m-name b { font-family: var(--f-display); font-size: 15.5px; }
.m-name small { font-size: 12px; color: var(--txt-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-icon .wi { width: 42px; height: 42px; }
.m-temps { display: flex; gap: 8px; align-items: baseline; font-family: var(--f-display); font-size: 17px; }
.m-temps span { color: var(--txt-2); font-size: 15px; }
.m-stats { display: flex; flex-direction: column; gap: 1px; font-size: 13px; color: var(--txt-2); }
.m-stats span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.m-stats .ui { width: 14px; height: 14px; }
.spark { width: 96px; height: 34px; overflow: visible; }
.spark path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s var(--ease) forwards; animation-delay: calc(.8s + var(--k) * 100ms); }
.model.off { grid-template-columns: 34px minmax(0, 1.2fr) minmax(0, 2.6fr); opacity: .62; }
.m-off { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--txt-2); }
.m-off .ui { width: 16px; height: 16px; }

/* states */
.loading-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 34px 20px; margin-top: 16px; border-radius: var(--r-xl); text-align: center; animation: cardIn .6s var(--ease) both; }
.loading-card .logo { width: 80px; height: 80px; }
.loading-card p { color: var(--txt-2); font-size: 14px; }
.loading-card .src-names { font-size: 12.5px; color: var(--txt-3); max-width: 460px; }
.sk-day { height: 76px; border-radius: var(--r-l); animation-delay: calc(var(--i) * 80ms); }
.err { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 34px 22px; margin-top: 16px; border-radius: var(--r-xl); text-align: center; animation: cardIn .6s var(--ease) both; }
.err .wi { width: 110px; height: 110px; }
.err h3 { font-family: var(--f-display); font-weight: 500; font-size: 21px; }
.err p { color: var(--txt-2); max-width: 420px; }
.err .btn { margin-top: 6px; }

/* unit swap */
.t.swap { animation: swap .5s var(--ease); display: inline-block; }
@keyframes swap { 0% { opacity: 0; transform: translateY(40%) scale(.9); filter: blur(4px); } 100% { opacity: 1; transform: none; filter: none; } }

/* toasts */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast { display: flex; flex-direction: row; align-items: center; max-width: 520px; gap: 10px; padding: 12px 16px 12px 14px; border-radius: 18px; background: rgba(12, 24, 52, .72); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .6); font-size: 14px; animation: toastIn .55s var(--spring) both; pointer-events: auto; }
.toast .ui { width: 20px; height: 20px; flex: none; }
.toast.ok .ui { color: #7ff0b4; }
.toast.warn .ui { color: #ffcf6b; }
.toast.fav .ui { color: #ffd66b; fill: #ffd66b; }
.toast.out { animation: toastOut .35s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(24px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px) scale(.94); } }

.foot { padding-block: 10px 28px; font-size: 12px; color: var(--txt-3); text-align: center; }
.foot a { color: var(--txt-2); }

/* ---------- mobile ---------- */
@media (max-width: 700px) {
  #q { font-size: 16px; }
  .search-box { padding-left: 16px; }
  .day-head { grid-template-columns: 58px 44px minmax(0, 1fr) auto 18px; gap: 10px; padding: 10px 12px; }
  .d-icon .wi { width: 44px; height: 44px; }
  .d-date b { font-size: 16px; }
  .d-date small { font-size: 12px; }
  .d-cond b { font-size: 14px; }
  .d-range { grid-template-columns: auto auto; gap: 8px; font-size: 16px; }
  .d-range .bar { display: none; }
  .d-range .lo { order: 2; }
  .d-range .hi { order: 1; }
  .d-chev .ui { width: 16px; height: 16px; }
  .detail { padding: 2px 12px 16px; }
  .h-wrap { margin: 0 -12px; }
  .h-scroll { padding: 0 12px 4px; }
  .now-stats { grid-template-columns: repeat(2, 1fr); }
  .here, .now { padding: 18px 18px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding: 12px; }
  .tile-v { font-size: 24px; }
  .tile { position: relative; }
  .tile .vis { position: absolute; top: 8px; right: 8px; transform: scale(.6); transform-origin: top right; }
  .sun-times { flex-direction: column; gap: 0; font-size: 17px; }
  .tile-s { font-size: 13px; }
  .model { grid-template-columns: 32px minmax(0, 1fr) 40px auto; grid-template-areas: 'r n i t' 'r s s k'; row-gap: 4px; padding: 10px 12px; }
  .rank { grid-area: r; align-self: start; }
  .m-name { grid-area: n; }
  .m-icon { grid-area: i; }
  .m-temps { grid-area: t; }
  .m-stats { grid-area: s; flex-direction: row; gap: 12px; }
  .spark { grid-area: k; width: 72px; justify-self: end; }
  .model.off { grid-template-columns: 32px minmax(0, 1fr); grid-template-areas: 'r n' 'r o'; }
  .model.off .m-off { grid-area: o; }
  .wear { grid-template-columns: 44px 1fr; gap: 12px; padding: 14px; }
  .wear-ic { width: 44px; height: 44px; border-radius: 14px; }
  .wear-ic .ui { width: 26px; height: 26px; }
  .fav-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fav-mid .temp { font-size: 32px; }
  .fav-mid .wi { width: 46px; height: 46px; }
}
@media (max-width: 380px) {
  .here-foot .go { margin-left: 0; }
}
