:root {
  color-scheme: dark;
  --bg: #18202a;
  --bg-soft: #212c38;
  --panel: rgba(248, 250, 252, 0.93);
  --panel-muted: rgba(226, 232, 240, 0.94);
  --text: #f8fafc;
  --ink: #17202a;
  --muted: #667085;
  --accent: #15aabf;
  --accent-strong: #0b7285;
  --warm: #f59f00;
  --line: rgba(255, 255, 255, 0.18);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(21, 170, 191, 0.28), transparent 28rem),
    linear-gradient(135deg, #18202a 0%, #243241 52%, #34495d 100%);
  color: var(--text);
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.screen {
  height: 100dvh;
  padding: clamp(14px, 2.1vw, 34px);
  padding-bottom: 74px;
  overflow: hidden;
}

.search-view {
  height: 100%;
  display: grid;
  place-items: center;
}

.search-panel {
  width: min(760px, 100%);
  display: grid;
  gap: clamp(16px, 2.3vh, 26px);
  padding: clamp(22px, 4vh, 46px);
  background: var(--panel);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: #8ee7f1;
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search-panel .eyebrow {
  color: var(--accent-strong);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.search-label {
  color: var(--muted);
  font-weight: 800;
}

.search-row,
.compact-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input {
  min-width: 0;
  width: 100%;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 12px 18px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--accent);
}

button {
  min-height: 48px;
  border-radius: 8px;
  padding: 0 24px;
  background: var(--accent);
  color: #04242b;
  font-weight: 900;
}

button:focus-visible {
  outline: 3px solid #99e9f2;
  outline-offset: 3px;
}

.weather-view {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: clamp(8px, 1.4vh, 18px);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 440px);
  gap: 24px;
  align-items: end;
}

.compact-search input {
  background: rgba(255, 255, 255, 0.93);
}

.status {
  min-height: 24px;
  color: #d8f7fb;
  font-size: clamp(0.9rem, 1.7vh, 1.12rem);
  font-weight: 700;
}

.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  min-height: 0;
  gap: clamp(10px, 1.4vw, 20px);
  align-items: stretch;
}

.card {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: clamp(7px, 1.15vh, 16px);
  padding: clamp(12px, 1.35vw, 22px);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  border: 5px solid var(--temperature-color, rgba(255, 255, 255, 0.56));
  box-shadow: var(--shadow), 0 0 22px var(--temperature-color, rgba(255, 255, 255, 0.2));
}

.card.today {
  background: linear-gradient(180deg, #fff8e6 0%, rgba(255, 255, 255, 0.94) 42%, rgba(232, 250, 252, 0.96) 100%);
  border-color: var(--temperature-color, rgba(245, 159, 0, 0.55));
}

.day-name {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: clamp(0.78rem, 1.55vh, 1rem);
  font-weight: 850;
}

.weather-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: clamp(92px, 21vh, 205px);
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(21, 170, 191, 0.17), rgba(245, 159, 0, 0.16));
}

.weather-icon span,
.weather-icon::before,
.weather-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.weather-icon span {
  width: clamp(70px, 9vw, 132px);
  height: clamp(70px, 9vw, 132px);
}

.icon-sun span {
  border-radius: 999px;
  background: #f59f00;
  box-shadow: 0 0 0 14px rgba(245, 159, 0, 0.18), 0 0 38px rgba(245, 159, 0, 0.42);
}

.icon-cloud span,
.icon-partly span,
.icon-rain span,
.icon-drizzle span,
.icon-snow span,
.icon-storm span {
  width: clamp(92px, 11vw, 168px);
  height: clamp(44px, 5.2vw, 76px);
  margin-top: clamp(18px, 3vh, 34px);
  border-radius: 999px;
  background: #f8fafc;
  box-shadow: -34px 3px 0 -8px #e2e8f0, 34px 5px 0 -10px #d8eef2, 0 16px 28px rgba(23, 32, 42, 0.16);
}

.icon-cloud span::before,
.icon-partly span::before,
.icon-rain span::before,
.icon-drizzle span::before,
.icon-snow span::before,
.icon-storm span::before {
  content: "";
  position: absolute;
  left: 18%;
  bottom: 34%;
  width: 44%;
  height: 90%;
  border-radius: 999px;
  background: #f8fafc;
}

.icon-cloud span::after,
.icon-partly span::after,
.icon-rain span::after,
.icon-drizzle span::after,
.icon-snow span::after,
.icon-storm span::after {
  content: "";
  position: absolute;
  right: 16%;
  bottom: 28%;
  width: 36%;
  height: 76%;
  border-radius: 999px;
  background: #eef6f8;
}

.icon-partly::before {
  width: clamp(58px, 7vw, 108px);
  height: clamp(58px, 7vw, 108px);
  transform: translate(-44%, -28%);
  border-radius: 999px;
  background: #f59f00;
  box-shadow: 0 0 0 11px rgba(245, 159, 0, 0.18);
}

.icon-rain::after,
.icon-drizzle::after {
  left: 50%;
  bottom: 11%;
  width: clamp(74px, 8vw, 118px);
  height: clamp(28px, 3.4vh, 44px);
  transform: translateX(-50%);
  background: repeating-linear-gradient(115deg, transparent 0 12px, #15aabf 12px 17px, transparent 17px 28px);
}

.icon-drizzle::after {
  opacity: 0.65;
  width: clamp(58px, 6.6vw, 96px);
}

.icon-snow::after {
  left: 50%;
  bottom: 10%;
  width: clamp(86px, 8vw, 122px);
  height: clamp(30px, 3.4vh, 46px);
  transform: translateX(-50%);
  background: radial-gradient(circle, #9bdcf2 0 4px, transparent 5px);
  background-size: 28px 24px;
}

.icon-fog span {
  width: clamp(112px, 13vw, 184px);
  height: clamp(70px, 9vh, 112px);
  background: repeating-linear-gradient(180deg, transparent 0 17px, #e2e8f0 17px 27px, transparent 27px 40px);
}

.icon-storm::after {
  left: 50%;
  bottom: 6%;
  width: clamp(38px, 4vw, 58px);
  height: clamp(58px, 7vh, 84px);
  transform: translateX(-42%) skewX(-10deg);
  clip-path: polygon(45% 0, 100% 0, 63% 43%, 94% 43%, 28% 100%, 45% 55%, 8% 55%);
  background: #f59f00;
}

.summary {
  align-self: start;
  display: grid;
  align-content: start;
  gap: clamp(4px, 0.7vh, 8px);
}

.condition {
  min-height: 2.2em;
  color: #263241;
  font-size: clamp(1rem, 2.25vh, 1.6rem);
  font-weight: 900;
  line-height: 1.08;
}

.temp {
  align-self: start;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.temp strong {
  color: #0b7285;
  font-size: 2.15rem;
  line-height: 0.95;
}

.temp span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
}

.facts {
  align-self: stretch;
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: clamp(4px, 0.85vh, 9px);
  margin: 0;
  min-height: 0;
}

.fact {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding-top: 0;
  border-top: 1px solid rgba(23, 32, 42, 0.13);
  color: #2f3e4f;
  font-size: clamp(0.76rem, 1.5vh, 0.98rem);
  font-weight: 750;
}

.fact dt,
.fact dd {
  margin: 0;
}

.fact dt {
  color: var(--muted);
}

.fact dd {
  text-align: right;
}

.place-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-top: 1px solid var(--line);
  background: rgba(13, 19, 26, 0.88);
  color: #edf8fa;
  backdrop-filter: blur(12px);
  font-size: clamp(1rem, 1.5vw, 1.45rem);
  font-weight: 850;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .cards {
    grid-template-columns: repeat(5, minmax(148px, 1fr));
  }
}

@media (max-width: 900px) {
  body {
    overflow-y: auto;
  }

  .screen {
    min-height: 100dvh;
    height: auto;
    overflow: visible;
  }

  .weather-view {
    height: auto;
  }

  .now-panel {
    grid-template-columns: 1fr;
  }

  .now-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .card {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .screen {
    padding: 18px;
    padding-bottom: 92px;
  }

  .search-row,
  .compact-search {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }
}

.now-panel {
  --temperature-color: #15aabf;
  min-height: clamp(78px, 12vh, 132px);
  display: grid;
  grid-template-columns: clamp(88px, 10vw, 142px) minmax(180px, 0.7fr) minmax(420px, 1.3fr);
  gap: clamp(12px, 1.6vw, 24px);
  align-items: center;
  padding: clamp(10px, 1.25vw, 18px);
  border: 5px solid var(--temperature-color);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.93);
  color: var(--ink);
  box-shadow: var(--shadow), 0 0 22px var(--temperature-color);
}

.now-icon {
  min-height: clamp(62px, 8vh, 96px);
  height: 100%;
}

.now-icon span {
  transform: scale(0.62);
}

.now-main {
  display: grid;
  gap: 2px;
  align-content: center;
}

.now-main span {
  color: var(--muted);
  font-size: clamp(0.78rem, 1.2vw, 1rem);
  font-weight: 900;
  text-transform: uppercase;
}

.now-main strong {
  color: var(--temperature-color);
  font-size: clamp(2.1rem, 4.4vw, 4.3rem);
  line-height: 0.95;
  font-weight: 950;
}

.now-main em {
  color: #263241;
  font-size: clamp(1rem, 1.55vw, 1.55rem);
  font-style: normal;
  font-weight: 900;
  line-height: 1.05;
}

.now-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(4px, 0.55vw, 8px);
  margin: 0;
}

.now-facts div {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding-left: clamp(8px, 0.8vw, 14px);
  border-left: 1px solid rgba(23, 32, 42, 0.16);
}

.now-facts dt,
.now-facts dd {
  margin: 0;
}

.now-facts dt {
  color: var(--muted);
  font-size: clamp(0.72rem, 0.95vw, 0.9rem);
  font-weight: 850;
}

.now-facts dd {
  color: #263241;
  font-size: clamp(1rem, 1.45vw, 1.45rem);
  font-weight: 950;
  line-height: 1;
}

@media (max-width: 900px) {
  .now-panel {
    grid-template-columns: 1fr;
  }

  .now-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .now-facts {
    grid-template-columns: 1fr;
  }
}

.hourly-view {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.hourly-chart {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding: clamp(8px, 0.9vw, 14px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.94);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}

.chart-head div {
  display: grid;
  gap: 2px;
}

.chart-head div:last-child {
  text-align: right;
}

.chart-head span {
  color: var(--muted);
  font-size: clamp(0.8rem, 1vw, 1rem);
  font-weight: 850;
  text-transform: uppercase;
}

.chart-head strong {
  color: #263241;
  font-size: clamp(1.1rem, 1.8vw, 2rem);
  font-weight: 950;
}

.chart-wrap {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(6px, 0.9vh, 12px);
}

.weather-graph {
  width: 100%;
  height: 100%;
  min-height: clamp(410px, 52vh, 720px);
  display: block;
}

.plot-bg {
  fill: rgba(21, 170, 191, 0.06);
}

.grid-line {
  stroke: rgba(38, 50, 65, 0.14);
  stroke-width: 1;
}

.axis,
.sun-marker {
  stroke: rgba(38, 50, 65, 0.26);
  stroke-width: 2;
}

.sun-marker {
  stroke: #f59f00;
  stroke-dasharray: 8 8;
  opacity: 0.72;
}

.sun-label,
.axis-label,
.hour-label,
.temp-label {
  fill: #667085;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 850;
}

.sun-label {
  fill: #b76e00;
  font-size: 22px;
}

.axis-label,
.hour-label {
  font-size: 22px;
}

.temp-label {
  fill: #263241;
  font-size: 20px;
}

.temp-area {
  fill: url(#tempFill);
}

.temp-line {
  fill: none;
  stroke: #0b7285;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.temp-dot {
  fill: #fff;
  stroke: #0b7285;
  stroke-width: 4;
}

.rain-bar {
  fill: #15aabf;
  opacity: 0.58;
}


.chart-empty {
  display: grid;
  place-items: center;
  min-height: 320px;
  color: #263241;
  font-size: clamp(1.2rem, 2vw, 2rem);
  font-weight: 900;
}

.hourly-chart {
  position: relative;
}

.chart-head {
  position: absolute;
  left: clamp(16px, 1.6vw, 28px);
  right: clamp(16px, 1.6vw, 28px);
  top: clamp(12px, 1.2vw, 20px);
  z-index: 2;
  pointer-events: none;
}

.chart-head span {
  font-size: clamp(0.7rem, 0.85vw, 0.86rem);
}

.chart-head strong {
  font-size: clamp(0.95rem, 1.35vw, 1.55rem);
}

/* Full graph layout overrides */
.hourly-view {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.hourly-chart {
  min-height: 0;
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding: clamp(6px, 0.75vw, 12px);
}

.chart-wrap.full-chart {
  height: 100%;
  grid-template-rows: minmax(0, 1fr);
}

.weather-graph {
  min-height: clamp(560px, 68vh, 900px);
}

.chart-head {
  position: absolute;
  left: clamp(16px, 1.6vw, 28px);
  right: clamp(16px, 1.6vw, 28px);
  top: clamp(12px, 1.2vw, 20px);
  z-index: 2;
  pointer-events: none;
}

.chart-head span {
  font-size: clamp(0.68rem, 0.82vw, 0.84rem);
}

.chart-head strong {
  font-size: clamp(0.9rem, 1.25vw, 1.45rem);
}

.plot-bg {
  fill: #eaf8fb;
}

.night-band {
  fill: #172435;
  opacity: 0.88;
}

.hour-band {
  fill: rgba(255, 255, 255, 0.08);
}


.grid-line {
  stroke: rgba(38, 50, 65, 0.16);
}

.temp-line {
  stroke-width: 9;
}

.temp-label {
  font-size: 21px;
  paint-order: stroke;
  stroke: rgba(248, 250, 252, 0.82);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.rain-label {
  fill: #0b7285;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
  font-weight: 900;
}

.svg-weather .sun-main {
  fill: #f59f00;
}

.svg-weather .sun-glow {
  fill: none;
  stroke: rgba(245, 159, 0, 0.24);
  stroke-width: 9;
}

.svg-weather .moon-main {
  fill: #f7d774;
}

.svg-weather .moon-cut {
  fill: #172435;
}

.svg-weather .cloud-main {
  fill: #f8fafc;
  stroke: rgba(38, 50, 65, 0.14);
  stroke-width: 1;
}

.svg-weather .rain-lines {
  stroke: #15aabf;
  stroke-width: 5;
  stroke-linecap: round;
}

.svg-weather .rain-lines.soft {
  opacity: 0.62;
}

.svg-weather .snow-dot {
  fill: #9bdcf2;
}

.svg-weather .storm-bolt {
  fill: #f59f00;
}

.svg-weather .fog-lines {
  stroke: #cbdde3;
  stroke-width: 6;
  stroke-linecap: round;
}

.hour-label {
  font-size: 19px;
  fill: #4b5563;
}

.sun-label {
  font-size: 18px;
  paint-order: stroke;
  stroke: rgba(248, 250, 252, 0.82);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.axis-label {
  paint-order: stroke;
  stroke: rgba(248, 250, 252, 0.75);
  stroke-width: 4px;
  stroke-linejoin: round;
}

@media (max-width: 900px) {
  .weather-graph {
    min-height: 720px;
  }
}

.chart-head {
  display: none;
}




/* Label-Kontrast ohne Rahmen/Kontur. */
.hour-label,
.rain-label,
.temp-label,
.axis-label,
.sun-label {
  paint-order: normal !important;
  stroke: none !important;
  stroke-width: 0 !important;
}

.temp-label {
  fill: #263241;
}

.rain-label {
  fill: #0b7285;
}

.hour-label.day-hour {
  fill: #4b5563;
}

.hour-label.night-hour {
  fill: #f8fafc;
}

.rain-label.day-hour {
  fill: #0b7285;
}

.rain-label.night-hour {
  fill: #f8fafc;
}

.temp-label.day-hour {
  fill: #263241;
}

.temp-label.night-hour {
  fill: #f8fafc;
}

.hour-band {
  opacity: 1;
}

.hour-band.day-even {
  fill: #f4fbfc;
}

.hour-band.day-odd {
  fill: #e7f5f8;
}

.hour-band.night-even {
  fill: #223248;
}

.hour-band.night-odd {
  fill: #172435;
}
