* {
  box-sizing: border-box;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  margin: 0;
  background: #f4f6f8;
  color: #222;
}

.week-header {
  padding: 16px;
  background: #111;
  color: #fff;
}

.week-header h1 {
  margin: 0 0 4px;
}

.week-nav {
  margin-top: 8px;
}

.week-nav a {
  color: #fff;
  margin-right: 12px;
  text-decoration: none;
  font-weight: 600;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

@media (min-width: 700px) {
  .week-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

.day-box {
  border-radius: 12px;
  padding: 10px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  overflow: hidden;  
}

.day-head {
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
}

/* Belastungsfarben */
.level-0 { background: #e9ecef; }
.level-1 { background: #d4edda; }
.level-2 { background: #fff3cd; }
.level-3 { background: #ffe0b2; }
.level-4 { background: #f8d7da; }

.holiday {
  font-size: 0.8rem;
  margin-top: 6px;
}

.load {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 6px;
}

.events-mini {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  font-size: 0.75rem;
}

.events-mini li {
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.events-mini .more {
  opacity: 0.7;
}

.back-link {
  display: inline-block;
  margin-bottom: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  opacity: 0.85;
}

.back-link:hover {
  opacity: 1;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.75rem;
  background: #f1f3f5;
}

.legend div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-box {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

/* Farben kommen von den bestehenden Levels */
.legend-box.level-0 { background: #e9ecef; }
.legend-box.level-1 { background: #d4edda; }
.legend-box.level-2 { background: #fff3cd; }
.legend-box.level-3 { background: #ffe0b2; }
.legend-box.level-4 { background: #f8d7da; }

/* ---------- Legende ---------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.75rem;
  background: #f1f3f5;
}

.legend > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* FARBPUNKTE */
.legend-box {
  display: inline-block;   /* WICHTIG */
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;          /* verhindert Wegquetschen */
}

/* Farben */
.legend-box.level-0 { background: #e9ecef; }
.legend-box.level-1 { background: #d4edda; }
.legend-box.level-2 { background: #fff3cd; }
.legend-box.level-3 { background: #ffe0b2; }
.legend-box.level-4 { background: #f8d7da; }

.events-mini {
  list-style: none;
  padding: 0;
  margin: 0;
}

.events-mini li {
  font-size: 0.7rem;
  line-height: 1.2;
  padding-top: 4px;
  margin-top: 4px;
  border-top: 1px solid rgba(0,0,0,0.3);
}

.events-mini li:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}