:root {
  color-scheme: light dark;
  --accent: #004c97;        /* FernUni-Blau */
  --accent-2: #4a90d9;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --bg: #ffffff;
  --card: #ffffff;
  --text: #1a1a1a;
  --border: #e2e4e8;
  --muted: #6b7280;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #5b9bd5;
    --accent-2: #6aa9e0;
    --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
    --bg: #14161a;
    --card: #1c1f26;
    --text: #e9ecf1;
    --border: #2c313b;
    --muted: #9aa3b2;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1rem 5rem;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent-2); }

/* Header */
.site-header { padding: 1.75rem 0 1rem; }
.logo-wrap {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: .9rem 1.1rem; display: inline-block; max-width: 100%;
}
.logo-wrap img { display: block; height: 22px; width: auto; max-width: 100%; }
h1 { font-size: 1.7rem; margin: 1.1rem 0 .25rem; letter-spacing: -0.02em; }
p.sub { color: var(--muted); margin-top: 0; font-size: .95rem; }
p.note {
  color: var(--muted); font-size: .82rem; margin: .6rem 0 0;
  background: var(--accent-soft); border-radius: 10px; padding: .6rem .75rem;
}
p.note strong { color: var(--text); }

/* Suche */
.search {
  width: 100%; padding: .75rem .9rem; border: 1px solid var(--border);
  border-radius: 12px; margin: 0 0 1.1rem; font-size: 1rem;
  background: var(--card); color: var(--text);
}
.search:focus { outline: none; border-color: var(--accent-2);
  box-shadow: 0 0 0 3px var(--accent-soft); }

/* Modul-Karten */
.mod {
  border: 1px solid var(--border); border-radius: 16px; background: var(--card);
  margin-bottom: .7rem; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.mod.active { border-color: var(--accent-2);
  box-shadow: 0 0 0 3px var(--accent-soft); }

.mod-head {
  display: flex; align-items: center; gap: .8rem;
  padding: .9rem 1rem; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.mod-head .toggle {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--accent-2); color: var(--accent-2);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
}
.mod-head .toggle svg { display: block; }
.mod.active .mod-head .toggle {
  background: var(--accent-2); color: #fff; border-color: var(--accent-2);
}
.mod-head .info { flex: 1; min-width: 0; }
.mod-head .title { font-weight: 600; }
.mod-head .nr { color: var(--muted); font-size: .78rem; margin-top: .12rem;
  font-variant-numeric: tabular-nums; }

.mod-body { padding: 0 1rem; max-height: 0; overflow: hidden;
  transition: max-height .22s ease; }
.mod.active .mod-body { max-height: 1600px; padding-bottom: 1rem; }
.mod-body-inner { border-top: 1px solid var(--border); padding-top: .85rem; }

.field { margin-bottom: .7rem; }
.field label { display: block; font-size: .82rem; color: var(--muted);
  margin-bottom: .3rem; font-weight: 500; }
.field select {
  width: 100%; padding: .6rem .55rem; border: 1px solid var(--border);
  border-radius: 10px; font-size: 1rem; background: var(--card); color: var(--text);
}
.checkline { display: flex; align-items: center; gap: .55rem; margin: .2rem 0 .3rem;
  font-size: .95rem; cursor: pointer; }
.checkline input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent-2); }

.actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .9rem; }
.actions a {
  text-decoration: none; border-radius: 11px; padding: .6rem 1rem;
  font-size: .92rem; font-weight: 600; transition: opacity .15s;
}
.actions a:active { opacity: .7; }
.actions a.sub { background: var(--accent-2); color: #fff; }
.actions a.dl { border: 1px solid var(--accent-2); color: var(--accent-2); }

.count-hint { font-size: .8rem; color: var(--muted); margin-top: .6rem; }
.modlink { font-size: .8rem; margin-top: .55rem; }
.modlink a { color: var(--muted); }
.warn { color: #d9534f; font-size: .85rem; margin-top: .7rem; }

.termine { margin-top: .7rem; }
.termine summary {
  cursor: pointer; font-size: .85rem; color: var(--accent-2);
  font-weight: 600; list-style: none; padding: .3rem 0;
}
.termine summary::-webkit-details-marker { display: none; }
.termine summary::before { content: "▸ "; font-size: .7rem; }
.termine details[open] summary::before { content: "▾ "; }
.termine-head { font-size: .78rem; font-weight: 600; color: var(--muted);
  margin: .55rem 0 .2rem; }
.termine-list { list-style: none; margin: 0; padding: 0;
  font-size: .82rem; font-variant-numeric: tabular-nums; }
.termine-list li { padding: .2rem 0; border-bottom: 1px solid var(--border);
  color: var(--text); }
.termine-list li:last-child { border-bottom: none; }

.empty { color: var(--muted); text-align: center; padding: 2rem 1rem; }
footer { margin-top: 2rem; font-size: .78rem; color: var(--muted);
  text-align: center; display: flex; flex-direction: column; gap: .25rem; }
.disclaimer { opacity: .8; }
.madewith { opacity: .8; margin-top: .15rem; }
