:root {
  --bg0: #d7e8e2;
  --bg1: #f3f7f2;
  --ink: #10241f;
  --mut: #4a635c;
  --line: rgba(16, 36, 31, 0.12);
  --panel: rgba(255, 255, 255, 0.62);
  --panel-strong: rgba(255, 255, 255, 0.82);
  --acc: #0f6a5a;
  --acc-2: #1f8f7a;
  --warn: #b85b12;
  --bad: #b42318;
  --good: #1f7a3a;
  --flow: #1769aa;
  --misch: #6b4f1d;
  --klaer: #9a6b12;
  --shadow: 0 18px 50px rgba(16, 36, 31, 0.08);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  font: 16px/1.5 var(--font-body);
  background: var(--bg1);
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1000px 500px at 10% -10%, #9fd0c4 0%, transparent 55%),
    radial-gradient(900px 480px at 90% 0%, #f0d9a8 0%, transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 40%, #e8f1ec);
}
.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='80' viewBox='0 0 160 80'%3E%3Cpath d='M0 40c20 0 20-12 40-12s20 12 40 12 20-12 40-12 20 12 40 12' fill='none' stroke='%2310241f' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 160px 80px;
  animation: drift 28s linear infinite;
}
@keyframes drift {
  from { background-position: 0 0; }
  to { background-position: 160px 0; }
}

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

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.brand-mark {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  animation: rise 0.7s ease both;
}
.brand-place {
  margin: 8px 0 0;
  color: var(--mut);
  font-size: 0.95rem;
}
.tick {
  margin: 0;
  color: var(--mut);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.trend-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 14px 16px 12px;
  margin-bottom: 16px;
  animation: rise 0.75s ease both;
}
.trend-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}
.trend-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}
.trend-note {
  margin: 0;
  color: var(--mut);
  font-size: 0.82rem;
}

.chart-box {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.chart-box--trend { height: 200px; }
.chart-box--rain { height: 200px; }
.chart-box canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.hero-row {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin-bottom: 18px;
  align-items: start;
}
@media (min-width: 920px) {
  .hero-row { grid-template-columns: 0.95fr 1.05fr; }
}

.hero-right {
  display: grid;
  gap: 16px;
}

.index-block, .rain-block, .pills-block, .stations {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.index-block {
  padding: 22px 24px 20px;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.78), rgba(255,255,255,0.45)),
    var(--panel);
  animation: rise 0.8s ease 0.05s both;
}
.index-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mut);
}

.station-select {
  display: block;
  width: min(100%, 320px);
  margin: 12px auto 0;
}
.station-select select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  margin: 0;
  padding: 11px 36px 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234a635c' d='M1.2 1.2 6 6l4.8-4.8'/%3E%3C/svg%3E")
      right 12px center / 12px no-repeat,
    linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,252,250,0.9));
  color: var(--ink);
  font: 600 0.95rem/1.25 var(--font-body);
  font-variant-numeric: tabular-nums;
  text-align: center;
  text-align-last: center;
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.station-select select:hover {
  border-color: rgba(15, 106, 90, 0.45);
}
.station-select select:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(15, 106, 90, 0.16);
}
.index-score {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(5rem, 12vw, 7rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
  animation: pop 0.55s cubic-bezier(.2,1.4,.3,1) 0.15s both;
}
.index-headline {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.index-detail {
  margin: 6px auto 0;
  color: var(--mut);
  font-size: 1rem;
  max-width: 34ch;
}
.index-meta {
  margin: 12px auto 0;
  font-size: 0.82rem;
  color: var(--mut);
  max-width: 42ch;
}
.sample-age {
  margin: 4px auto 0;
  font-size: 0.72rem;
  color: var(--mut);
  opacity: 0.85;
  max-width: 42ch;
}
.badberlin-note {
  margin: 8px auto 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--mut);
  max-width: 42ch;
}
.badberlin-note a {
  color: var(--acc);
  font-weight: 600;
  text-decoration: none;
}
.badberlin-note a:hover { text-decoration: underline; }
.badberlin-note.is-bad { color: #8a3a12; }
.badberlin-note.is-warn { color: #8a6a10; }
.index-block .parts {
  text-align: left;
}
.parts { margin-top: 16px; display: grid; gap: 8px; }
.part {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  font-size: 0.86rem;
}
.part b { font-variant-numeric: tabular-nums; }
.part .bar {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 99px;
  background: rgba(16,36,31,0.08);
  overflow: hidden;
}
.part .bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--acc), var(--acc-2));
}
.part .txt {
  grid-column: 1 / -1;
  color: var(--mut);
  font-size: 0.78rem;
}

.rain-block {
  padding: 18px 18px 14px;
  animation: rise 0.8s ease 0.12s both;
}
.rain-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 6px;
}
.rain-head h2, .map-head h2, .stations h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}
.rain-note, .map-head p {
  margin: 0;
  color: var(--mut);
  font-size: 0.82rem;
}
.rain-facts {
  margin: 8px 0 0;
  color: var(--mut);
  font-size: 0.82rem;
}
.rain-facts b { color: var(--ink); }

.pills-block {
  padding: 16px 16px 14px;
  animation: rise 0.8s ease 0.16s both;
}
.pills-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}
.pills-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}
.pills-note {
  margin: 0;
  color: var(--mut);
  font-size: 0.82rem;
}
.station-pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
  margin-top: 0;
}
.pill {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 1px;
  align-items: baseline;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.pill:hover {
  border-color: rgba(15, 106, 90, 0.35);
  transform: translateY(-1px);
}
.pill strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}
.pill.is-focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 2px rgba(15,106,90,0.14);
  background: rgba(255,255,255,0.92);
}
.pill .pill-label {
  grid-column: 1;
  grid-row: 1;
  color: var(--mut);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.pill .pill-name {
  grid-column: 1 / -1;
  grid-row: 2;
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.25;
}
.pill .pill-head {
  grid-column: 1 / -1;
  grid-row: 3;
  color: var(--mut);
  font-size: 0.75rem;
}

.help {
  cursor: help;
  border-bottom: 1px dotted rgba(16,36,31,0.45);
}
.help:focus { outline: 2px solid var(--acc); outline-offset: 2px; }
.tip-bubble {
  position: fixed;
  z-index: 10000;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(16, 36, 31, 0.94);
  color: #f4faf7;
  font-size: 0.8rem;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(16, 36, 31, 0.28);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
}
.tip-bubble[hidden] { display: none !important; }

.part-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.map-section {
  padding: 16px;
  margin-bottom: 18px;
  animation: rise 0.85s ease 0.18s both;
}
.map-section--bare {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  border-radius: 0 !important;
  position: relative;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
  max-width: 100vw;
}
.map-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  gap: 8px;
}
.map-tool-btn,
.map-fullscreen-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: 600 0.82rem var(--font-body);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 36, 31, 0.12);
}
.map-tool-btn:hover,
.map-fullscreen-btn:hover { background: #fff; }
.map-tool-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
.map-geo-banner {
  position: absolute;
  left: 50%;
  top: 56px;
  transform: translateX(-50%);
  z-index: 1001;
  max-width: min(520px, calc(100% - 24px));
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(16, 36, 31, 0.92);
  color: #f3f7f2;
  font: 600 0.92rem/1.35 var(--font-body);
  text-align: center;
  box-shadow: 0 10px 28px rgba(16, 36, 31, 0.28);
  pointer-events: none;
}
.map-geo-banner.is-dream {
  background: rgba(180, 35, 24, 0.94);
}
.map-section--bare:fullscreen,
.map-section--bare:-webkit-full-screen {
  background: #e8f1ec;
  padding: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}
.map-section--bare:fullscreen .map-layout,
.map-section--bare:-webkit-full-screen .map-layout {
  height: 100%;
}
.map-section--bare:fullscreen #map,
.map-section--bare:-webkit-full-screen #map {
  height: 100%;
  min-height: 100%;
  border-radius: 0;
  border: 0;
}
.map-head {
  display: none;
}
#map {
  height: min(70vh, 640px);
  min-height: 420px;
  border-radius: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.legend {
  margin-top: 10px;
  color: var(--mut);
  font-size: 0.82rem;
  line-height: 1.65;
}
.legend b { color: var(--ink); }

.stations {
  padding: 18px;
  margin-bottom: 18px;
}
.station-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
@media (min-width: 700px) {
  .station-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .station-grid { grid-template-columns: repeat(3, 1fr); }
}
.station {
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}
.station h3 {
  margin: 0;
  font-size: 1rem;
  font-family: var(--font-display);
}
.station-idx {
  margin: 0 0 10px;
  font-size: 0.95rem;
}
.station-idx strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-right: 6px;
}
.station .role {
  margin: 2px 0 10px;
  color: var(--mut);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.station table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.station td {
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.station td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.station-val {
  display: block;
}
.station-when {
  display: block;
  margin-top: 1px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--mut);
  line-height: 1.2;
}
.station a {
  display: inline-block;
  margin-top: 10px;
  color: var(--acc);
  font-size: 0.82rem;
}

.glossary {
  padding: 18px 20px 16px;
  margin-bottom: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.glossary h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}
.glossary-list {
  margin: 0;
  display: grid;
  gap: 12px;
}
@media (min-width: 800px) {
  .glossary-list { grid-template-columns: 1fr 1fr; gap: 14px 22px; }
}
.glossary-list dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  margin: 0 0 2px;
}
.glossary-list dd {
  margin: 0;
  color: var(--mut);
  font-size: 0.86rem;
  line-height: 1.45;
}
.glossary-list a {
  color: var(--acc);
  white-space: nowrap;
}

.foot {
  color: var(--mut);
  font-size: 0.8rem;
  line-height: 1.7;
}
.foot a { color: var(--acc); }

.score-0, .score-1 { color: var(--bad); }
.score-2 { color: var(--warn); }
.score-3 { color: #8a6a10; }
.score-4 { color: var(--acc-2); }
.score-5 { color: var(--good); }

.leaflet-container { font: 13px/1.4 var(--font-body); }
.map-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  font-variant-numeric: tabular-nums;
}
.arrow-icon {
  background: transparent !important;
  border: 0 !important;
}
.arrow {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #0d4f82;
  text-shadow: 0 0 3px #fff, 0 1px 2px rgba(255,255,255,.9);
  transform-origin: 50% 50%;
  line-height: 1;
  pointer-events: none;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: none; }
}

.top-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
}
.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mut);
  font: 700 0.72rem/1 var(--font-body);
  letter-spacing: 0.04em;
  padding: 6px 10px;
  cursor: pointer;
}
.lang-btn.is-active,
.lang-btn[aria-pressed="true"] {
  background: var(--ink);
  color: #f3f7f2;
}
.pills-note-mob { display: none; }
.pills-note-desk { display: inline; }
@media (max-width: 820px) {
  .pills-note-mob { display: inline; }
  .pills-note-desk { display: none; }
}
.nav {
  display: flex;
  gap: 14px;
  font-size: 0.9rem;
  font-weight: 600;
}
.nav a {
  color: var(--mut);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] {
  color: var(--acc);
  border-bottom-color: var(--acc);
}
.brand-link {
  color: inherit;
  text-decoration: none;
}

.map-layout {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
  position: relative;
}
.map-layout:has(#pointPanel:not([hidden])) {
  /* panel overlays on the right of the map */
}
.point-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 900;
  width: min(340px, calc(100% - 24px));
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px 12px;
  max-height: calc(100% - 24px);
  overflow: auto;
  box-shadow: 0 12px 36px rgba(16, 36, 31, 0.16);
}
.map-section--bare .legend {
  width: min(1180px, calc(100% - 28px));
  margin: 10px auto 0;
}
.point-panel[hidden] { display: none !important; }
.point-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.point-panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.point-close {
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--mut);
  padding: 0 4px;
}
.point-hint { margin: 6px 0 0; color: var(--mut); font-size: 0.85rem; }
.point-score { font-size: clamp(2.8rem, 6vw, 3.6rem) !important; margin-top: 4px !important; }
.point-near { margin: 10px 0 0; font-size: 0.8rem; color: var(--mut); line-height: 1.5; }

.stauraum-mark {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  border-radius: 6px;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(16, 36, 31, 0.35);
  text-shadow: none;
}
.stauraum-mark.is-betrieb {
  color: #fff;
  background: #0f6a5a;
}
.stauraum-mark.is-bau {
  color: #fff;
  background: #b85b12;
}
.regen-mark {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #1a5c8a;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(16, 36, 31, 0.35);
}
.outlet-misch, .outlet-regen {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.outlet-misch { background: #8b2e1a; transform: rotate(45deg); }
.outlet-regen { background: #2a6f8f; border-radius: 50%; }

/* Erklärseite */
.prose .doc {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 32px);
  margin-bottom: 40px;
}
.prose h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
}
.prose h2 {
  margin: 1.6em 0 0.5em;
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.prose h3 {
  margin: 1.2em 0 0.4em;
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.prose .lead { color: var(--mut); font-size: 1.05rem; max-width: 62ch; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: 0.35em 0; }
.prose pre {
  background: rgba(16,36,31,0.06);
  border-radius: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.45;
}
.prose a { color: var(--acc); }
.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 12px 0;
}
.doc-table th, .doc-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.doc-table th { color: var(--mut); font-weight: 600; }
.quellen-list {
  padding-left: 1.2em;
  max-width: 72ch;
}
.quellen-list li { margin: 0.55em 0; word-break: break-word; }
.back { margin-top: 2em; }
.contact-list {
  list-style: none;
  padding-left: 0;
  margin: 0.6em 0 0;
}
.contact-list li { margin: 0.25em 0; }
