:root { color-scheme: light dark; --akzent: #0b6b3a; --warn: #b3261e; --rand: #8884; }
body { margin: 0; font-family: system-ui, sans-serif; line-height: 1.45; }
.wrap { max-width: 40rem; margin: 1.25rem auto; padding: 0 1rem; }

.topbar { display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--rand); }
.brand { font-weight: 700; text-decoration: none; color: inherit; }
.nav { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.nav a { text-decoration: none; color: inherit; }

.card { border: 1px solid var(--rand); border-radius: 0.6rem;
  padding: 1rem; margin: 0 0 1rem; }
.card.danger { border-color: var(--warn); }
.card h2 { margin: 0 0 0.5rem; font-size: 1.05rem; }

form label { display: block; margin: 0.6rem 0; font-size: 0.95rem; }
input { display: block; width: 100%; box-sizing: border-box; margin-top: 0.25rem;
  padding: 0.55rem; font-size: 1rem; border: 1px solid var(--rand);
  border-radius: 0.4rem; background: transparent; color: inherit; }
button { margin-top: 0.5rem; padding: 0.55rem 1rem; font-size: 1rem; border: 0;
  border-radius: 0.4rem; background: var(--akzent); color: #fff; cursor: pointer; }
button.warn { background: var(--warn); }
button.linklike { background: none; color: inherit; text-decoration: underline;
  padding: 0; margin: 0; font-size: 1rem; }

.inline { display: inline; }
.row { display: flex; justify-content: space-between; align-items: center;
  gap: 0.75rem; flex-wrap: wrap; padding: 0.45rem 0; border-top: 1px solid var(--rand); }
.row:first-of-type { border-top: 0; }
.aktionen { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.aktionen button { margin-top: 0; padding: 0.35rem 0.7rem; font-size: 0.9rem; }

.jetzt h2 { margin: 0 0 0.3rem; }
.plan { width: 100%; border-collapse: collapse; }
.plan td { padding: 0.35rem 0.4rem; border-top: 1px solid var(--rand); vertical-align: top; }
.plan tr:first-child td { border-top: 0; }
.plan .nr { width: 2rem; opacity: 0.7; }
.plan .zeit { width: 6.5rem; white-space: nowrap; opacity: 0.8; font-size: 0.9rem; }
.plan tr.pause td { opacity: 0.6; font-size: 0.85rem; font-style: italic; }

.tabwrap { overflow-x: auto; }
.woche { border-collapse: collapse; width: 100%; min-width: 32rem; }
.woche th, .woche td { border: 1px solid var(--rand); padding: 0.35rem 0.3rem;
  text-align: center; vertical-align: top; font-size: 0.85rem; }
.woche thead th { background: color-mix(in srgb, var(--akzent) 12%, transparent); }
.woche .std { white-space: nowrap; opacity: 0.75; }
.woche tr.pause td { opacity: 0.55; font-style: italic; }
.woche small { opacity: 0.7; }
/* Farbige Fach-Zellen: Farbe je Fach über eine feste Palette (CSP-konform, kein Inline-Style).
   Der Rand/Ton kommt aus --fc; --fc wird pro Palette-Klasse gesetzt. */
.woche td.zelle { border-left: 3px solid var(--fc, transparent);
  background: color-mix(in srgb, var(--fc, transparent) 13%, transparent); }
.woche td.zelle .fach { font-weight: 700; }
.fc0 { --fc: #7c5cff; } .fc1 { --fc: #0891b2; } .fc2 { --fc: #d97706; } .fc3 { --fc: #16a34a; }
.fc4 { --fc: #db2777; } .fc5 { --fc: #2563eb; } .fc6 { --fc: #dc2626; } .fc7 { --fc: #0d9488; }

.adminnav { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; margin: 0 0 1rem;
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--rand); }
.adminnav a { text-decoration: none; color: inherit; font-size: 0.95rem; }

.rowform { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0; }
.rowform input, .rowform select { width: auto; flex: 1 1 6rem; min-width: 4rem; margin-top: 0; }
.rowform input[type="date"] { flex: 0 0 auto; }
.rowform button { margin-top: 0; }
.numin { flex: 0 0 5rem !important; }
.chk { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.9rem; }
.chk input { width: auto; margin: 0; }
.editrow { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center;
  padding: 0.5rem 0; border-top: 1px solid var(--rand); }
button.mini { padding: 0.1rem 0.4rem; font-size: 0.8rem; margin: 0.2rem 0 0; }

.badge { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 0.3rem;
  font-size: 0.72rem; font-weight: 700; color: #fff; vertical-align: middle; }
.badge-klausur, .badge-pruefung { background: var(--warn); }
.badge-hausaufgabe { background: #2f6da3; }
.badge-termin { background: #6b7885; }
.abo code { display: inline-block; word-break: break-all; padding: 0.4rem 0.6rem;
  border: 1px solid var(--rand); border-radius: 0.4rem; font-size: 0.9rem; }

.flash { border: 1px solid var(--akzent); border-radius: 0.4rem; padding: 0.6rem 0.8rem; }
.err { border: 1px solid var(--warn); border-radius: 0.4rem; padding: 0.6rem 0.8rem; }
.muted { opacity: 0.72; font-size: 0.9rem; }
code { font-size: 1.05em; }
