.weather-page { --wx-accent: #1565d8; --wx-line: #dbe3ea; --wx-soft: #eef3f7; --wx-dim: #5b6877; --wx-cloud: #b7c6d2; margin-block: 28px 40px; }
.weather-page [hidden] { display: none !important; }
.weather-page button:not(.leaflet-control button) { font: inherit; }
.weather-page h2 { letter-spacing: -.02em; }

/* Title and search */
.weather-top { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px 32px; margin-bottom: 18px; }
.weather-intro { position: static; background: transparent; border: 0; margin: 0; }
.weather-intro h1, .weather-page h1 { font-size: clamp(34px, 4.4vw, 56px); letter-spacing: -.05em; line-height: 1; margin: 0 0 .22em; }
.weather-intro p { color: var(--wx-dim); max-width: 60ch; margin: 0; }
.weather-search { flex: 0 1 560px; min-width: min(100%, 300px); }
.weather-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.weather-search-row { display: flex; gap: 8px; }
.weather-search input { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 0 16px 0 44px; font: inherit; color: inherit; border: 1px solid var(--wx-line); border-radius: 999px; box-shadow: 0 1px 2px #1019230d;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6877' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 15px 50% / 18px no-repeat;
  transition: border-color .15s, box-shadow .15s; }
.weather-search input:focus { outline: 0; border-color: var(--wx-accent); box-shadow: 0 0 0 4px #1565d826; }
.weather-search button, .weather-page button.secondary { display: inline-flex; align-items: center; gap: 7px; min-height: 48px; padding: 0 20px; border: 1px solid transparent; border-radius: 999px; background: var(--wx-accent); color: #fff; font-weight: 650; cursor: pointer; white-space: nowrap; transition: background .15s, transform .15s, box-shadow .15s; }
.weather-search button:hover { background: #0f52b8; }
.weather-page button.secondary { background: #fff; color: #17324d; border-color: var(--wx-line); }
.weather-page button.secondary:hover { background: var(--wx-soft); border-color: #c3cfd9; }
.weather-search button:active, .weather-page button.secondary:active { transform: scale(.97); }
.weather-search button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.weather-page :is(button, a):focus-visible { outline: 3px solid #1565d859; outline-offset: 2px; }
.weather-page [data-search-status]:empty, .weather-page [data-forecast-status]:empty, .weather-places:empty { display: none; }
.weather-page [data-search-status] { margin: 0 0 10px; color: var(--wx-dim); }
.weather-places { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; animation: wx-in .25s both; }
.weather-places :is(a, button) { padding: 8px 14px; border: 1px solid var(--wx-line); border-radius: 999px; background: #fff; color: #17324d; font-size: .93rem; text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.weather-places :is(a, button):hover { border-color: var(--wx-accent); background: #f1f6fe; transform: translateY(-1px); }

/* Map and current conditions */
.weather-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.weather-map-box { display: flex; flex-direction: column; min-width: 0; }
.weather-map { flex: 1 1 auto; min-height: clamp(300px, 32vw, 420px); border: 1px solid var(--wx-line); border-radius: 20px; background: #e2ecf0; isolation: isolate; z-index: 0; overflow: hidden; box-shadow: 0 8px 24px -16px #10192340; }
.weather-map .leaflet-control-attribution { padding: 0 5px; font-size: 9px; line-height: 1.5; color: #7d8894; background: #ffffff8c; border-top-left-radius: 6px; }
.weather-map .leaflet-control-attribution a { color: inherit; text-decoration: none; }
.weather-map .leaflet-control-attribution a:hover { text-decoration: underline; }
.weather-pin { border: 3px solid #fff; border-radius: 50%; background: #e5484d; box-shadow: 0 2px 6px #0006; }
.weather-pin::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid #e5484d; animation: wx-pulse 2s ease-out infinite; }
.weather-caption { font-size: 12.5px; color: var(--wx-dim); margin: 8px 2px 0; }
.weather-current { position: relative; overflow: hidden; align-self: stretch; padding: clamp(20px, 2.6vw, 32px); border-radius: 20px; color: #fff; --wx-cloud: #fff;
  background: linear-gradient(140deg, #12334c, #1b5571); box-shadow: 0 18px 40px -24px #0d2b45cc; transition: background .4s; }
.weather-current::before { content: ''; position: absolute; inset: -40% -20% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, #ffffff2e, #fff0); pointer-events: none; }
.weather-current > * { position: relative; }
.weather-current[data-sky=day] { background: linear-gradient(140deg, #0f4fae, #1f7ad1); }
.weather-current[data-sky=night] { background: linear-gradient(140deg, #0e1838, #2b3272); }
.weather-current[data-sky=cloud] { background: linear-gradient(140deg, #31465a, #55708a); }
.weather-current[data-sky=rain] { background: linear-gradient(140deg, #1f3147, #3b5a76); }
.weather-current[data-sky=snow] { background: linear-gradient(140deg, #2f5279, #4c78a3); }
.weather-current h2 { margin: 0; font-size: clamp(21px, 2.4vw, 30px); line-height: 1.15; letter-spacing: -.03em; color: inherit; }
.weather-current a, .weather-current .weather-caption { color: #d5e8f5; }
.weather-current [data-city-permalink] { display: inline-block; margin-top: 6px; font-size: .88rem; }
.weather-current [data-forecast-status] { margin: 14px 0 0; color: #d5e8f5; }
.weather-current button.secondary { margin-top: 12px; }
.weather-current [data-current] { animation: wx-in .45s both; }
.weather-now { display: flex; align-items: center; gap: 14px; margin-block: 14px 6px; }
.weather-now .weather-icon { width: clamp(64px, 7vw, 92px); filter: drop-shadow(0 6px 12px #0003); }
.weather-big { display: block; font-size: clamp(56px, 6.4vw, 88px); font-weight: 650; letter-spacing: -.06em; line-height: 1; font-variant-numeric: tabular-nums; }
.weather-icon { display: inline-block; width: 28px; aspect-ratio: 1; flex-shrink: 0; }
.weather-icon svg { display: block; width: 100%; height: 100%; overflow: visible; }
.weather-cloud { fill: var(--wx-cloud); }
.weather-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(132px, 100%), 1fr)); gap: 8px; margin-block: 18px 14px; }
.weather-metrics div { padding: 10px 12px; border-radius: 12px; background: #ffffff1c; backdrop-filter: blur(6px); transition: background .15s; }
.weather-metrics div:hover { background: #ffffff2e; }
.weather-metrics dt { font-size: .76rem; line-height: 1.3; color: #d5e8f5; }
.weather-metrics dd { margin: 4px 0 0; font-size: 1.05rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.weather-arrow { display: inline-block; margin-inline-start: 6px; transition: transform .5s; }

/* Hourly chart */
.weather-section-heading { display: flex; gap: 16px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; margin: 30px 0 12px; }
.weather-section-heading h2, .weather-directory h2 { margin: 0; }
.weather-section-heading h2 small { margin-inline-start: 8px; font-size: .62em; font-weight: 500; letter-spacing: 0; color: var(--wx-dim); }
.weather-section-heading a { color: var(--wx-dim); font-size: .8rem; text-decoration: underline; text-underline-offset: .16em; }
.weather-chart { overflow-x: auto; border: 1px solid var(--wx-line); border-radius: 18px 18px 0 0; background: #fff; scrollbar-width: thin; }
.weather-hours { --plot: 84px; position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(62px, 1fr); width: max-content; min-width: 100%; padding: 6px; animation: wx-in .35s both; }
.weather-curve { position: absolute; inset: 70px 6px auto; height: var(--plot); pointer-events: none; }
.weather-curve svg { display: block; width: 100%; height: 100%; }
.weather-curve .line { fill: none; stroke: var(--wx-accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.weather-hour { position: relative; display: grid; grid-template-rows: 18px 30px var(--plot) 18px 15px; gap: 4px; justify-items: center; padding: 8px 2px; border: 0; border-radius: 12px; background: none; color: inherit; cursor: pointer; transition: background .15s; }
.weather-hour:hover { background: #1565d80f; }
.weather-hour[aria-pressed=true] { background: #1565d81c; }
.weather-hour time { font-size: .78rem; color: var(--wx-dim); font-variant-numeric: tabular-nums; }
.weather-hour .plot { position: relative; width: 100%; }
.weather-hour .plot::after { content: ''; position: absolute; left: 50%; bottom: calc(var(--level) * 100%); width: 9px; height: 9px; border: 2px solid var(--wx-accent); border-radius: 50%; background: #fff; transform: translate(-50%, 50%); transition: transform .15s, background .15s; }
.weather-hour[aria-pressed=true] .plot::after { background: var(--wx-accent); transform: translate(-50%, 50%) scale(1.35); }
.weather-hour .plot b { position: absolute; left: 50%; bottom: calc(var(--level) * 100% + 9px); transform: translateX(-50%); font-size: 1rem; font-weight: 700; color: #14283b; font-variant-numeric: tabular-nums; }
.weather-hour .rain { display: flex; align-items: flex-end; width: 100%; height: 100%; padding-inline: 30%; }
.weather-hour .rain i { flex: 1; min-height: 2px; border-radius: 4px 4px 1px 1px; background: linear-gradient(#5db6f7, #2f8be0); }
.weather-hour small { font-size: .68rem; line-height: 15px; color: #2f7fcf; white-space: nowrap; font-variant-numeric: tabular-nums; }
.weather-hour-detail { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline; min-height: 46px; margin: 0; padding: 11px 18px; border: 1px solid var(--wx-line); border-top: 0; border-radius: 0 0 18px 18px; background: #f8fafc; font-variant-numeric: tabular-nums; }
.weather-hour-detail span { display: inline-flex; gap: 6px; align-items: baseline; font-weight: 650; color: #14283b; }
.weather-hour-detail small { font-size: .78rem; font-weight: 400; color: var(--wx-dim); }
.weather-hour-detail span:first-child { font-size: 1.05rem; color: var(--wx-accent); }

/* Week */
.weather-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.weather-day { display: grid; gap: 6px; justify-items: center; padding: 14px 12px; border: 1px solid var(--wx-line); border-radius: 16px; background: #fff; color: inherit; cursor: pointer; text-align: center; transition: transform .15s, box-shadow .15s, border-color .15s, background .15s; }
.weather-day:hover { transform: translateY(-2px); border-color: #b9c9d8; box-shadow: 0 10px 22px -14px #10192359; }
.weather-day[aria-pressed=true] { border-color: var(--wx-accent); background: #f1f6fe; box-shadow: 0 0 0 1px var(--wx-accent); }
.weather-day .day { font-size: .82rem; color: var(--wx-dim); }
.weather-day .weather-icon { width: 38px; }
.weather-day .temps { display: flex; gap: 8px; align-items: baseline; font-variant-numeric: tabular-nums; }
.weather-day .temps strong { font-size: 1.35rem; color: #14283b; }
.weather-day .temps span { color: var(--wx-dim); }
.weather-day .bar { position: relative; width: 100%; height: 6px; border-radius: 3px; background: var(--wx-soft); }
.weather-day .bar i { position: absolute; inset-block: 0; border-radius: 3px; background: linear-gradient(90deg, #58b4ff, #ffb53d); }
.weather-day .wet { min-height: 1.2em; font-size: .76rem; color: #2f7fcf; font-variant-numeric: tabular-nums; }

/* Space weather */
.space-readings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 12px; margin: 0; }
.space-readings > div { padding: 18px 20px; border-radius: 18px; color: #e7ecfb; background: radial-gradient(120% 140% at 100% 0, #3a2f7a 0, #101633 62%); }
.space-readings dt { font-size: .86rem; color: #b6c0e6; }
.space-readings dd { margin: 6px 0 10px; }
.space-readings dd b { font-weight: 600; color: #b6c0e6; }
.space-readings strong { font-size: 2.1rem; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.space-readings small { color: #b6c0e6; }
.space-meter { position: relative; display: block; height: 6px; margin-bottom: 12px; border-radius: 3px; background: linear-gradient(90deg, #35d08a, #e9d84a 45%, #ff9f3d 62%, #ff4d5e); }
.space-meter i { position: absolute; top: 50%; left: calc(var(--at, 0) * 100%); width: 14px; height: 14px; border: 3px solid #101633; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); transition: left .8s cubic-bezier(.2, .8, .2, 1); }
.space-readings [data-storm-level] { display: block; font-weight: 650; }
.space-readings time { display: block; margin-top: 2px; font-size: .76rem; color: #98a3cc; }

/* City list and credits */
.weather-directory { margin-top: 30px; }
.weather-directory ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 12px 0 0; padding: 0; }
.weather-directory li a { display: block; padding: 7px 14px; border: 1px solid var(--wx-line); border-radius: 999px; background: #fff; color: #17324d; font-size: .92rem; text-decoration: none; transition: border-color .15s, background .15s, transform .15s; }
.weather-directory li a:hover { border-color: var(--wx-accent); background: #f1f6fe; transform: translateY(-1px); }
.weather-credit { margin: 22px 0 0; font-size: 10.5px; letter-spacing: .01em; color: #a3adb8; }
.weather-credit a { color: inherit; text-decoration: none; }
.weather-credit a:hover { color: var(--wx-dim); text-decoration: underline; }

/* City forecast page */
.city-forecast a:not(.weather-credit a), [data-city-permalink] { text-decoration: underline; text-underline-offset: .16em; }
.city-forecast .weather-current { margin-block: 20px; }
.forecast-tables { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.forecast-tables table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.forecast-tables caption { font-size: 1.35rem; font-weight: 700; text-align: start; padding-block: 12px; }
.forecast-tables th, .forecast-tables td { text-align: start; padding: 8px 5px; border-bottom: 1px solid #ced6dc; }
.forecast-tables tbody tr:hover { background: var(--wx-soft); }

@keyframes wx-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes wx-pulse { to { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .weather-page *, .weather-page *::after { animation: none !important; transition: none !important; } }
@media (max-width: 760px) { .forecast-tables { grid-template-columns: minmax(0, 1fr); font-size: .88rem; } }
@media (max-width: 700px) {
  .weather-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .weather-current { grid-row: 1; }
  .weather-map { min-height: 280px; }
  .weather-search { flex-basis: 100%; }
  .weather-search-row { flex-wrap: wrap; }
  .weather-search input { flex-basis: 100%; }
  .weather-search button { flex: 1 1 0; justify-content: center; padding-inline: 12px; }
  .weather-days { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .weather-day { grid-template-columns: 6.2em 30px minmax(40px, 1fr) auto 4.4em; align-items: center; justify-items: start; gap: 10px; padding: 9px 14px; text-align: start; }
  .weather-day .weather-icon { width: 30px; }
  .weather-day .bar { order: 1; }
  .weather-day .temps { order: 2; }
  .weather-day .temps strong { font-size: 1.1rem; }
  .weather-day .wet { order: 3; justify-self: end; min-height: 0; }
}
