:root {
  --bg: #f4f1ea;
  --card-bg: #ffffff;
  --text: #1c1a17;
  --text-dim: #6b665c;
  --border: #e4ddd0;

  --ruhig: #1f9d55;
  --ruhig-bg: #e6f6ec;
  --mittel: #b7791f;
  --mittel-bg: #fdf3d9;
  --hoch: #d1372f;
  --hoch-bg: #fbe4e2;
  --error: #6b665c;
  --error-bg: #eae6dc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140f;
    --card-bg: #211e18;
    --text: #f2ede2;
    --text-dim: #a8a196;
    --border: #35301f;

    --ruhig-bg: #123321;
    --mittel-bg: #3a2e0d;
    --hoch-bg: #3a1512;
    --error-bg: #2a271e;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.site-head {
  text-align: center;
  margin-bottom: 20px;
}

.site-title {
  font-size: 1.7rem;
  margin: 0 0 4px;
}

.site-sub {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.hero {
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.hero-emoji { font-size: 2.6rem; line-height: 1; }

.hero h1 {
  margin: 8px 0 6px;
  font-size: 1.5rem;
}

.hero p {
  margin: 0 auto;
  max-width: 46ch;
  color: var(--text-dim);
}

.hero.level-ruhig, .day-card.level-ruhig { background: var(--ruhig-bg); }
.hero.level-mittel, .day-card.level-mittel { background: var(--mittel-bg); }
.hero.level-hoch, .day-card.level-hoch { background: var(--hoch-bg); }
.hero.level-error { background: var(--error-bg); }

.hero.level-ruhig h1 { color: var(--ruhig); }
.hero.level-mittel h1 { color: var(--mittel); }
.hero.level-hoch h1 { color: var(--hoch); }

section.today { margin-bottom: 24px; }

.forecast h2 {
  font-size: 1.05rem;
  color: var(--text-dim);
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.forecast-grid {
  display: grid;
  gap: 12px;
}

.day-card {
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border);
}

.day-card-big { padding: 20px; }

.day-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.day-label { font-weight: 700; font-size: 1.05rem; }
.day-date { color: var(--text-dim); font-size: 0.85rem; }

.day-badge {
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.9rem;
}

.day-empty {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.ev-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ev {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: baseline;
  font-size: 0.92rem;
}

.ev-time { font-variant-numeric: tabular-nums; color: var(--text-dim); }
.ev-title { font-weight: 600; }
.ev-sub { display: block; color: var(--text-dim); font-size: 0.82rem; }
.ev-type { font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; }

.subscribe {
  margin: 28px 0 8px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 16px;
}

.ics-link {
  display: inline-block;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid var(--hoch);
}

.ics-hint {
  margin: 8px 0 0;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.site-foot {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-top: 24px;
}

.site-foot p { margin: 4px 0; }
.site-foot a { color: inherit; }

@media (min-width: 560px) {
  .forecast-grid { grid-template-columns: 1fr; }
}
