:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #222222;
  --text-soft: #666666;
  --primary: #0d3d8b;
  --primary-text: #ffffff;
  --border: #d8dee8;
  --table-head: #f2f5fa;
  --link: #0d3d8b;
  --input-bg: #f7fafd;
  --input-text: #0d3d8b;
  --map-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #121a2a;
    --text: #e7eaf0;
    --text-soft: #a8b0bd;
    --primary: #0d3d8b;
    --primary-text: #ffffff;
    --border: #313845;
    --table-head: #1b2230;
    --link: #8eb4ff;
    --input-bg: #1a2230;
    --input-text: #d7e4ff;
    --map-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  }
}

/* Global Styles */
html,
body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1em;
}

.banner img {
  max-width: 100%;
  display: block;
  margin: 0 auto 1em;
  border-radius: 4px;
  box-shadow: none;
}

.section {
  margin-bottom: 2em;
}

.section-header {
  background-color: var(--primary);
  color: var(--primary-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5em;
  border-radius: 4px;
  box-shadow: none;
}

.section-header h2 {
  margin: 0;
  font-size: 1.2em;
  flex: 1;
}

.section-header img {
  max-width: 50px;
  margin-left: 0.5em;
  border-radius: 4px;
}

.section-content {
  color: var(--text);
}

.section-content p {
  margin: 0 0 0.7em 0;
  line-height: 1.55;
  white-space: pre-line;
}

/* DWD */
.dwd-import-wrapper {
  font-family: inherit;
  line-height: 1.55;
  color: inherit;
}

.dwd-block {
  margin-bottom: 1.15em;
}

.dwd-block:last-child {
  margin-bottom: 0;
}

.dwd-import-wrapper p {
  margin: 0 0 0.7em 0;
  line-height: 1.55;
}

.dwd-import-wrapper p:last-child {
  margin-bottom: 0;
}

.dwd-highlight {
  margin-bottom: 0.75em;
}

.dwd-highlight strong {
  color: var(--text);
}

.dwd-intro {
  margin: 0 0 0.7em 0;
  color: var(--text-soft);
}

/* Footer / Links */
.last-update {
  text-align: center;
  font-size: 0.9em;
  color: var(--text-soft);
  margin-top: 1em;
}

.footer {
  text-align: center;
  margin-top: 0.5em;
  font-size: 0.9em;
}

.footer a,
.source-note,
.source-note a {
  color: var(--link);
  text-decoration: none;
}

.source-note {
  font-size: 0.70em;
}

.footer a:hover,
.source-note a:hover {
  text-decoration: underline;
}

/* Forecast titles / notes */
.forecast-24h .forecast-title,
.forecast-24h .generated-note,
.forecast-24h .source-note,
.forecast-10d .forecast-title,
.forecast-10d .generated-note,
.forecast-10d .source-note {
  text-align: center;
}

.forecast-24h .forecast-title,
.forecast-10d .forecast-title {
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 0.2em;
  color: var(--text);
}

.generated-note {
  font-size: 0.8em;
  color: var(--text-soft);
  margin-bottom: 1em;
}

/* Forecast rows */
.forecast-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.8em;
  padding: 0.35em 0;
}

.icon-cell {
  background-color: var(--primary);
  width: 71px;
  height: 71px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: none;
}

.icon-cell img {
  width: 55px;
  height: 55px;
}

.content-cell {
  display: flex;
  flex-direction: column;
  margin-left: 0.8em;
}

.time-details {
  color: var(--text);
  margin-bottom: 0.2em;
}

.more-details {
  font-size: 0.9em;
  color: var(--text);
}

/* Forecast-10d confidence */
.forecast-10d .more-details span.vorhersage-sicherheit-high { color: #2f9e44; }
.forecast-10d .more-details span.vorhersage-sicherheit-medium { color: #e08a00; }
.forecast-10d .more-details span.vorhersage-sicherheit-low { color: #d94841; }

/* Table */
.forecast-table {
  width: 100%;
  max-width: 600px;
  border-collapse: collapse;
  font-size: 1em;
  margin: 1em 0;
  background: var(--surface);
}

.forecast-table th,
.forecast-table td {
  border: 1px solid var(--border);
  padding: 4px 6px;
  text-align: center;
  color: var(--text);
}

.forecast-table th {
  background: var(--table-head);
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Dropdowns */
.city-select-row {
  margin: 1em 0 0.5em 0;
  display: flex;
  gap: 0.5em;
  align-items: center;
}

.dropdown-center {
  display: flex;
  justify-content: center;
  margin: 1.5em 0 2em 0;
}

.city-dropdown,
.navi-dropdown {
  font-size: 1em;
  padding: 0.4em 1.4em 0.4em 1em;
  border-radius: 5px;
  border: 1px solid var(--primary);
  min-width: 180px;
  background: var(--input-bg);
  color: var(--input-text);
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
}

/* Map */
#map {
  width: 100%;
  max-width: 600px;
  height: 70vh;
  min-height: 350px;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: var(--map-shadow);
  position: relative;
  z-index: 1;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 0.75em;
  }

  .section-header {
    flex-direction: column;
    text-align: center;
  }

  .section-header img {
    margin: 0.5em auto 0 auto;
    max-width: 100%;
  }

  .forecast-table {
    font-size: 0.95em;
  }

  .section-content p {
    margin-bottom: 0.62em;
    line-height: 1.5;
  }

  .dwd-block {
    margin-bottom: 1.05em;
  }

  .dwd-import-wrapper p,
  .dwd-intro,
  .dwd-highlight {
    margin-bottom: 0.62em;
    line-height: 1.5;
  }
}