:root {
  --kw-bg: #06121e;
  --kw-card: rgba(15, 38, 57, 0.86);
  --kw-card-strong: rgba(23, 51, 72, 0.95);
  --kw-line: rgba(159, 211, 236, 0.15);
  --kw-text: #eef8fc;
  --kw-muted: #9fb8c8;
  --kw-cyan: #61d6e8;
  --kw-blue: #62a8ff;
  --kw-yellow: #ffd46b;
  --kw-green: #62dda8;
  --kw-red: #ff8b7b;
}

* { box-sizing: border-box; }

body.koenigs-weather-page {
  margin: 0;
  color: var(--kw-text);
  background:
    radial-gradient(circle at 12% 5%, rgba(41, 137, 184, 0.25), transparent 32rem),
    radial-gradient(circle at 90% 0%, rgba(241, 181, 70, 0.14), transparent 28rem),
    linear-gradient(155deg, #071828 0%, var(--kw-bg) 50%, #071522 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

.kw-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 28px;
}

.kw-header,
.kw-hero,
.kw-card-heading,
.kw-footer,
.kw-inline-facts,
.kw-wind {
  display: flex;
  align-items: center;
}

.kw-header { justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.kw-header h1 { margin: 2px 0 4px; font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -0.055em; }
.kw-eyebrow, .kw-kicker { margin: 0; color: var(--kw-cyan); font-size: .78rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.kw-subtitle, .kw-muted { margin: 0; color: var(--kw-muted); }

.kw-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid var(--kw-line);
  border-radius: 999px;
  color: var(--kw-muted);
  background: rgba(5, 19, 31, .55);
  font-size: .88rem;
}
.kw-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #7c8790; box-shadow: 0 0 0 4px rgba(124,135,144,.12); }
.kw-status[data-weather-status="online"] .kw-status-dot { background: var(--kw-green); box-shadow: 0 0 0 4px rgba(98,221,168,.13); }
.kw-status[data-weather-status="stale"] .kw-status-dot { background: var(--kw-red); box-shadow: 0 0 0 4px rgba(255,139,123,.13); }

.kw-hero {
  position: relative;
  justify-content: space-between;
  gap: 30px;
  overflow: hidden;
  min-height: 250px;
  padding: 38px 44px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 30px;
  background: linear-gradient(120deg, rgba(23, 68, 96, .94), rgba(10, 38, 61, .94));
  box-shadow: 0 24px 80px rgba(0,0,0,.22);
}
.kw-hero::after { content: ""; position: absolute; width: 310px; height: 310px; right: -90px; top: -155px; border-radius: 50%; background: rgba(255, 209, 101, .16); filter: blur(4px); }
.kw-hero-symbol { flex: 0 0 auto; color: var(--kw-yellow); font-size: clamp(4rem, 9vw, 7rem); line-height: 1; filter: drop-shadow(0 8px 30px rgba(255,196,65,.22)); }
.kw-hero-label { margin: 0; color: var(--kw-muted); }
.kw-temperature { margin: 3px 0; font-size: clamp(3.8rem, 10vw, 7.4rem); line-height: .95; font-weight: 720; letter-spacing: -.07em; }
.kw-feels { margin: 9px 0 0; color: #c7dbe6; }
.kw-hero-facts { min-width: 205px; margin: 0; z-index: 1; }
.kw-hero-facts div { display: flex; justify-content: space-between; gap: 25px; padding: 13px 0; border-bottom: 1px solid var(--kw-line); }
.kw-hero-facts div:last-child { border-bottom: 0; }
.kw-hero-facts dt { color: var(--kw-muted); }
.kw-hero-facts dd { margin: 0; font-weight: 700; }

.kw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.kw-card { min-width: 0; padding: 26px; border: 1px solid var(--kw-line); border-radius: 24px; background: var(--kw-card); box-shadow: 0 18px 55px rgba(0,0,0,.15); backdrop-filter: blur(15px); }
.kw-card-wide { grid-column: 1 / -1; }
.kw-card h2 { margin: 5px 0 24px; font-size: 1.42rem; letter-spacing: -.025em; }
.kw-card-heading { justify-content: space-between; gap: 20px; }
.kw-card-main { text-align: right; font-size: 1.3rem; font-weight: 720; }
.kw-card-main small { display: block; margin-top: 3px; color: var(--kw-muted); font-size: .72rem; font-weight: 500; }

.kw-light-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kw-light { padding: 17px; border-radius: 18px; background: rgba(3, 17, 29, .42); }
.kw-light-title { margin-bottom: 7px; color: var(--kw-muted); font-size: .8rem; }
.kw-light strong { font-size: 1.06rem; }
.kw-meter { height: 6px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.kw-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--kw-blue), var(--kw-yellow)); transition: width .5s ease; }
.kw-inline-facts { gap: 24px; margin-top: 18px; color: var(--kw-muted); font-size: .88rem; }
.kw-inline-facts strong { margin-left: 5px; color: var(--kw-text); }

.kw-wind { gap: 25px; margin: 20px 0; }
.kw-compass { display: grid; place-items: center; width: 108px; height: 108px; flex: 0 0 auto; border: 1px solid var(--kw-line); border-radius: 50%; background: radial-gradient(circle, rgba(91,174,219,.12), transparent 68%); }
.kw-compass span { display: block; color: var(--kw-cyan); font-size: 3.7rem; line-height: 1; transform-origin: center; transition: transform .5s ease; }
.kw-wind-speed { margin: 0 0 5px; font-size: 2rem; font-weight: 720; }
.kw-wind p:last-child { margin: 0; color: var(--kw-muted); }

.kw-list { margin: 15px 0 0; }
.kw-list div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--kw-line); }
.kw-list div:last-child { border-bottom: 0; }
.kw-list dt { color: var(--kw-muted); }
.kw-list dd { margin: 0; font-weight: 680; text-align: right; }
.kw-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.kw-pill { width: fit-content; padding: 8px 11px; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--kw-muted); font-size: .78rem; font-weight: 650; }
.kw-pill.is-positive { color: #bff7df; background: rgba(48,183,126,.16); }
.kw-pill.is-warning { color: #ffd2c9; background: rgba(222,87,69,.17); }

.kw-rain-symbol { margin: 4px 0 -5px; color: var(--kw-blue); font-size: 5.5rem; line-height: 1; }
.kw-rain-state { margin: 12px 0 8px; font-size: 1.25rem; font-weight: 700; }
.kw-muted { font-size: .86rem; line-height: 1.55; }

.kw-sun-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 44% 37%, rgba(48, 113, 158, .17), transparent 35%),
    linear-gradient(135deg, rgba(14, 38, 58, .96), rgba(8, 27, 43, .96));
}
.kw-sun-card::after { content: ""; position: absolute; width: 260px; height: 260px; top: -155px; right: -80px; border-radius: 50%; background: rgba(255, 198, 77, .06); pointer-events: none; }
.kw-sun-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.kw-sun-heading h2 { margin-bottom: 0; }
.kw-sun-description { max-width: 390px; margin: 3px 0 0; color: var(--kw-muted); font-size: .84rem; line-height: 1.5; text-align: right; }
.kw-sun-layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(210px, .8fr); align-items: stretch; gap: 30px; margin-top: 14px; }
.kw-sun-visual { min-width: 0; overflow: hidden; border: 1px solid rgba(117, 190, 228, .12); border-radius: 20px; background: rgba(2, 15, 26, .24); }
.kw-sun-svg { display: block; width: 100%; height: auto; overflow: visible; }
.kw-dome-outline { fill: none; stroke: rgba(108, 199, 240, .58); stroke-width: 1.7; }
.kw-sky-grid path { fill: none; vector-effect: non-scaling-stroke; }
.kw-grid-meridian { stroke: rgba(108, 190, 230, .29); stroke-width: 1.05; stroke-dasharray: 4 6; }
.kw-grid-altitude-back { stroke: rgba(108, 190, 230, .18); stroke-width: .9; stroke-dasharray: 3 7; }
.kw-grid-altitude-front { stroke: rgba(108, 190, 230, .34); stroke-width: 1.1; stroke-dasharray: 5 5; }
.kw-horizon-plane { fill: rgba(13, 38, 59, .76); }
.kw-horizon-rim { fill: none; stroke: rgba(103, 198, 239, .72); stroke-width: 1.6; }
.kw-compass-labels { fill: #aeeaff; font-size: 24px; font-weight: 750; }
.kw-shadow { stroke: #010a13; stroke-width: 24; stroke-linecap: round; opacity: .52; filter: blur(2px); }
.kw-azimuth-line, .kw-elevation-arc { fill: none; stroke: var(--kw-yellow); stroke-width: 2.2; stroke-linecap: round; }
.kw-elevation-arc { stroke-dasharray: 8 7; }
.kw-angle-label { fill: var(--kw-yellow); font-size: 21px; font-weight: 750; paint-order: stroke; stroke: rgba(6, 18, 30, .82); stroke-width: 5; stroke-linejoin: round; }
.kw-sun-halo { fill: url(#kw-sun-glow); filter: url(#kw-sun-blur); opacity: .9; }
.kw-sun-disc { fill: #ffe07c; stroke: #fff2b3; stroke-width: 2; filter: drop-shadow(0 0 14px rgba(255, 196, 63, .82)); }
.kw-gnomon path { fill: #07131f; stroke: rgba(144, 205, 234, .22); stroke-width: 1; }
.kw-gnomon .kw-gnomon-edge { fill: #10273a; }
.kw-sun-values { display: grid; align-content: center; gap: 0; margin: 0; padding-left: 30px; border-left: 1px solid var(--kw-line); }
.kw-sun-values div { padding: 25px 0; border-bottom: 1px solid var(--kw-line); }
.kw-sun-values div:last-child { border-bottom: 0; }
.kw-sun-values dt { color: var(--kw-muted); font-size: 1rem; }
.kw-sun-values dd { margin: 7px 0 3px; font-size: clamp(2.7rem, 5vw, 4.8rem); font-weight: 740; letter-spacing: -.06em; line-height: 1; }
.kw-sun-values small { color: var(--kw-cyan); font-size: .78rem; }
.kw-sun-card[data-sun-state="night"] .kw-sun-disc { fill: #9cb3c6; stroke: #d5e4ed; filter: drop-shadow(0 0 12px rgba(150, 187, 213, .35)); opacity: .42; }
.kw-sun-card[data-sun-state="night"] .kw-sun-halo { opacity: .16; }
.kw-sun-card[data-sun-state="night"] .kw-elevation-arc { opacity: .48; }

.kw-history { margin-top: 18px; }
.kw-history-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.kw-history-header h2 { margin: 5px 0 0; }
.kw-history-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.kw-history-controls label { display: grid; gap: 5px; color: var(--kw-muted); font-size: .72rem; }
.kw-history-controls select {
  min-width: 150px;
  padding: 10px 34px 10px 12px;
  border: 1px solid var(--kw-line);
  border-radius: 10px;
  color: var(--kw-text);
  background: #0a2133;
  font: inherit;
  font-size: .84rem;
}
.kw-chart-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 18px; margin: 28px 0 12px; color: var(--kw-muted); font-size: .82rem; }
.kw-chart-summary > strong { margin-right: auto; color: var(--kw-text); font-size: 1.7rem; }
.kw-chart-summary b { margin-left: 5px; color: var(--kw-text); }
.kw-chart-wrap { position: relative; min-height: 250px; overflow: hidden; border: 1px solid var(--kw-line); border-radius: 18px; background: rgba(3, 17, 29, .42); }
.kw-chart { display: block; width: 100%; height: auto; min-height: 250px; }
.kw-chart .kw-chart-grid { stroke: rgba(159, 211, 236, .12); stroke-width: 1; }
.kw-chart .kw-chart-line { fill: none; stroke: var(--kw-cyan); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.kw-chart .kw-chart-area { fill: url(#kw-chart-gradient); }
.kw-chart .kw-chart-dot { fill: var(--kw-cyan); stroke: #082237; stroke-width: 3; vector-effect: non-scaling-stroke; }
.kw-chart text { fill: var(--kw-muted); font-size: 20px; font-family: inherit; }
.kw-chart-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; color: var(--kw-muted); text-align: center; }
.kw-chart-empty[hidden] { display: none; }
.kw-history-note { margin: 12px 2px 0; }

.kw-footer { justify-content: space-between; gap: 18px; margin-top: 24px; padding: 12px 3px; color: var(--kw-muted); font-size: .8rem; }
.kw-footer a { color: var(--kw-cyan); text-decoration: none; }
.kw-footer a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .kw-shell { width: min(100% - 20px, 1180px); padding-top: 24px; }
  .kw-header, .kw-hero { align-items: flex-start; }
  .kw-header { flex-direction: column; }
  .kw-hero { flex-wrap: wrap; padding: 28px 24px; }
  .kw-hero-symbol { font-size: 4rem; }
  .kw-hero-facts { width: 100%; }
  .kw-grid { grid-template-columns: 1fr; }
  .kw-card-wide { grid-column: auto; }
  .kw-light-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kw-inline-facts { align-items: flex-start; flex-direction: column; gap: 8px; }
  .kw-sun-heading { flex-direction: column; gap: 8px; }
  .kw-sun-description { text-align: left; }
  .kw-sun-layout { grid-template-columns: 1fr; gap: 12px; }
  .kw-sun-values { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; border-left: 0; border-top: 1px solid var(--kw-line); }
  .kw-sun-values div { padding: 18px 14px 4px 0; border-bottom: 0; }
  .kw-sun-values div + div { padding-left: 14px; border-left: 1px solid var(--kw-line); }
  .kw-sun-values dd { font-size: 2.5rem; }
  .kw-history-header { flex-direction: column; }
  .kw-history-controls { width: 100%; }
  .kw-history-controls label { flex: 1 1 150px; }
  .kw-history-controls select { width: 100%; }
}

@media (max-width: 430px) {
  .kw-light-grid { grid-template-columns: 1fr; }
  .kw-card { padding: 21px; }
  .kw-footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
