/* Gemeinsames Aussehen der Übersichtsseiten (Startseite und Kapitel) */
:root {
  --bg: #14161a;
  --surface: #1d2026;
  --surface-hover: #252a32;
  --line: #2f343d;
  --text: #eef0f3;
  --muted: #9aa3b0;
  --accent: #f2b705;
  --radius: 16px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f2ee;
    --surface: #ffffff;
    --surface-hover: #fbfaf8;
    --line: #dedad2;
    --text: #1b1d21;
    --muted: #666d78;
    --accent: #c99700;
  }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 40px 16px 40px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 15px; margin-bottom: 18px; }
.back:hover { color: var(--text); }
header { margin: 16px 0 40px; }
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.kicker::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.05; margin: 12px 0 10px; letter-spacing: -.02em; }
header p { margin: 0; color: var(--muted); max-width: 56ch; font-size: 17px; }

.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  list-style: none; padding: 0; margin: 0;
}
.card {
  display: flex; gap: 16px; align-items: flex-start;
  height: 100%; padding: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit; text-decoration: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.card:hover { background: var(--surface-hover); border-color: var(--accent); transform: translateY(-2px); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.icon {
  flex: none; width: 64px; height: 64px; border-radius: 14px; overflow: hidden;
  background: var(--line); display: grid; place-items: center;
}
.icon img { width: 100%; height: 100%; display: block; object-fit: cover; }
.icon.letter { font-size: 30px; font-weight: 800; color: #1b1d21; background: var(--accent); }
.body { min-width: 0; }
.name { font-size: 19px; font-weight: 700; margin: 2px 0 4px; letter-spacing: -.01em; }
.desc { margin: 0 0 10px; color: var(--muted); font-size: 14.5px; }
.tag {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Kapitelseite: ein Abschnitt pro Test, darin Lernen und Testen */
.test { margin-bottom: 48px; }
.test-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 18px; }
.test-head h2 { font-size: 28px; margin: 0; letter-spacing: -.01em; }
.date { color: var(--muted); font-size: 15px; }
.badge { font-size: 12px; font-weight: 700; letter-spacing: .06em; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: #1b1d21; }
.badge.done { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.test > p { margin: -6px 0 18px; color: var(--muted); max-width: 64ch; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.col h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; font-weight: 700; }
.col h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.col.test-col h3::before { border-radius: 2px; }
.col .grid { grid-template-columns: 1fr; }
/* Karten gleich gross und Zeile für Zeile ausgerichtet, auch über beide Spalten */
.cols { grid-template-rows: auto repeat(2, minmax(0, 1fr)); grid-auto-flow: column; column-gap: 24px; row-gap: 14px; }
.col, .col .grid { display: contents; }
.col h3 { margin-bottom: 0; }
.col .grid > li { display: flex; min-height: 0; }
.col .grid > li > .card { flex: 1; align-items: flex-start; }
@media (max-width: 720px) {
  .cols { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; row-gap: 14px; }
  .col h3 { margin-top: 10px; }
}

footer { margin-top: 20px; color: var(--muted); font-size: 13px; }
.version { margin-top: 6px; text-align: right; color: var(--muted); font-size: 11px; opacity: .8; }
.version a { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.version a:hover, .version a:focus-visible { color: var(--text); }

/* Änderungsprotokoll (Dialog auf der Startseite) */
#changelog {
  width: min(640px, calc(100% - 32px)); max-height: 85vh; overflow: auto;
  padding: 32px 36px; border: 1px solid var(--line); border-radius: 24px;
  background: var(--surface); color: var(--text);
}
#changelog::backdrop { background: rgba(0, 0, 0, .5); }
#changelog h2 { margin: 0 0 20px; font-size: 30px; letter-spacing: -.01em; }
.cl-item { margin-bottom: 18px; }
.cl-item strong { font-size: 19px; }
.cl-date { margin-left: 10px; color: var(--muted); font-size: 15px; }
.cl-item p { margin: 4px 0 0; color: var(--muted); font-size: 17px; }
#changelog form { margin: 24px 0 0; }
.close {
  font: inherit; font-weight: 600; color: var(--text); background: transparent; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 24px;
}
.close:hover { background: var(--surface-hover); }
.close:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }

/* Prüfungsplanung */
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 22px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 24px; }
.plan h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; font-weight: 700; }
.plan h3::before { content: ""; width: 8px; height: 8px; background: var(--accent); transform: rotate(45deg); }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.countdown { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1; margin: 0 0 14px; }
.countdown small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; padding: 0 0 12px 7.4em; font-size: 14.5px; }
.timeline li::before { content: ""; position: absolute; left: 5.6em; top: 5px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); background: var(--surface); z-index: 1; box-sizing: border-box; }
.timeline li::after { content: ""; position: absolute; left: calc(5.6em + 4px); top: 15px; bottom: -5px; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .d { position: absolute; left: 0; top: 0; }
.timeline .d { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline .past { opacity: .55; }
.timeline .now::before { background: var(--accent); border-color: var(--accent); }
.timeline .exam::before { background: var(--text); border-color: var(--text); border-radius: 2px; }
.timeline .exam { font-weight: 700; }
.timeline .sub { display: block; color: var(--muted); font-weight: 400; font-size: 13.5px; }
@media (max-width: 720px) { .plan { grid-template-columns: 1fr; } }

.test > p.note-link, .note-link { margin: 26px 0 0; font-size: 14px; color: var(--muted); }
.note-link a { color: var(--text); }

/* Suchfeld auf den Modulseiten (suche.js) */
.suche { margin: 0 0 32px; }
.suche input {
  width: 100%; font: inherit; font-size: 17px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 12px 20px;
}
.suche input::placeholder { color: var(--muted); }
.suche input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.suche-info { margin: 8px 20px 0; min-height: 1.4em; color: var(--muted); font-size: 14px; }
.suche-aus { display: none !important; }

/* Wörter unter dem Suchfeld der Vocab Tests (suche.js, data-vocab) */
.suche-woerter { margin: 14px 0 0; }
.suche-woerter[hidden] { display: none; }
.suche-woerter-kopf { margin: 0 0 8px 4px; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.suche-woerter .wort {
  display: flex; justify-content: space-between; gap: 16px; padding: 10px 14px; margin: 0 0 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none;
}
.suche-woerter .wort:hover { background: var(--surface-hover); }
.suche-woerter .wort:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.suche-woerter .wort-l, .suche-woerter .wort-r { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.suche-woerter .wort-r { text-align: right; flex: 0 1 45%; }
.suche-woerter .wort-d, .suche-woerter .wort-u { color: var(--muted); font-size: 13px; }
.suche-woerter .wort-de { font-weight: 600; }
.suche-woerter .wort-mehr { margin: 8px 4px 0; color: var(--muted); font-size: 13.5px; }
@media (max-width: 560px) { .suche-woerter .wort { flex-direction: column; gap: 4px; } .suche-woerter .wort-r { text-align: left; flex: none; } }
