:root {
  --ink: #0f1f3a;
  --ink-2: #33415c;
  --muted: #5b6780;
  --line: #d9e1ee;
  --bg: #f7f9fc;
  --card: #ffffff;
  --blue: #1f5fd1;
  --blue-d: #17489f;
  --sky: #e7f0fd;
  --sun: #f4b43c;
  --sun-l: #fff4dc;
  --green: #1d8a55;
  --green-l: #e3f5ec;
  --yellow: #a86b00;
  --yellow-l: #fff3d6;
  --red: #c0352b;
  --red-l: #fde8e6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 31, 58, .06), 0 6px 20px rgba(15, 31, 58, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-h: "Fraunces", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--blue); }
a:hover { color: var(--blue-d); }
img, svg { max-width: 100%; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* Kopf */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.brand span { color: var(--blue); }
.topnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  font-size: 14px; color: var(--ink-2); text-decoration: none; white-space: nowrap;
  padding: 6px 10px; border-radius: 999px;
}
.topnav a:hover { background: var(--sky); color: var(--ink); }

.hero {
  background: linear-gradient(160deg, #0f1f3a 0%, #17346b 60%, #1f5fd1 130%);
  color: #fff;
  padding: 56px 0 48px;
}
.hero .kicker { color: #bcd2f7; font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.hero h1 {
  font-family: var(--font-h); font-weight: 600;
  font-size: clamp(32px, 6vw, 54px); line-height: 1.08; margin: 10px 0 14px; letter-spacing: -.01em;
}
.hero p.lead { font-size: clamp(17px, 2.2vw, 20px); color: #e2ebfa; max-width: 680px; margin: 0 0 24px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: #cfdcf3; font-size: 15px; margin-bottom: 26px; }
.hero .meta b { color: #fff; font-weight: 600; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 15px;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--sun); color: #1b1300; }
.btn-primary:hover { background: #ffc65a; color: #1b1300; }
.btn-ghost { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-ghost:hover { background: rgba(255, 255, 255, .18); color: #fff; }

/* Abschnitte */
section { padding: 48px 0 8px; scroll-margin-top: 60px; }
.sec-head { margin-bottom: 18px; }
.sec-head .num { color: var(--blue); font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
h2 { font-family: var(--font-h); font-weight: 600; font-size: clamp(26px, 4vw, 34px); line-height: 1.15; margin: 4px 0 8px; letter-spacing: -.01em; }
h3 { font-size: 19px; margin: 0 0 6px; line-height: 1.3; }
.sec-head p { color: var(--ink-2); margin: 0; max-width: 760px; }
p { margin: 0 0 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card h3 { margin-top: 0; }
.card ul, .card ol { margin: 6px 0 0; padding-left: 20px; }
.card li { margin: 3px 0; }
.small { font-size: 14px; color: var(--muted); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--sky); color: var(--blue-d); }

/* Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
th { background: #f0f4fa; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
tr:last-child td { border-bottom: 0; }
td.time { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--blue-d); }
tr.pause td { background: var(--sun-l); color: #6b4b00; }

/* Prompt-Karten */
.prompt { position: relative; background: #0f1f3a; color: #e8eefb; border-radius: 12px; padding: 16px 16px 14px; margin: 10px 0 6px; }
.prompt .label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9fb8e6; margin-bottom: 6px; padding-right: 96px; }
.prompt pre { margin: 0; white-space: pre-wrap; word-wrap: break-word; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14.5px; line-height: 1.55; }
.copy {
  position: absolute; top: 10px; right: 10px;
  background: var(--sun); color: #1b1300; border: 0; border-radius: 8px;
  font: 600 13px var(--font); padding: 6px 12px; cursor: pointer;
}
.copy.ok { background: #7fd3a6; }
.ph { color: #ffd27a; }

.note { border-left: 4px solid var(--blue); background: var(--sky); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 12px 0; color: var(--ink); }
.note.warn { border-color: var(--sun); background: var(--sun-l); }
.note.stop { border-color: var(--red); background: var(--red-l); }

/* Ampel */
.ampel { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.ampel > div { border-radius: 12px; padding: 14px 16px; }
.ampel .g { background: var(--green-l); border: 1px solid #b8e3cc; }
.ampel .y { background: var(--yellow-l); border: 1px solid #f0d79a; }
.ampel .r { background: var(--red-l); border: 1px solid #f3c0bb; }
.ampel b { display: block; font-size: 14px; letter-spacing: .06em; }
.ampel .g b { color: var(--green); }
.ampel .y b { color: var(--yellow); }
.ampel .r b { color: var(--red); }

/* Quiz */
.quiz { display: grid; gap: 10px; }
.quiz details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.quiz summary { cursor: pointer; font-weight: 600; }
.quiz details p { margin: 8px 0 0; }
.verdict { font-weight: 700; }
.verdict.g { color: var(--green); }
.verdict.y { color: var(--yellow); }
.verdict.r { color: var(--red); }

/* Prompt-Baukasten */
.builder label { display: block; font-weight: 600; font-size: 14px; margin: 10px 0 4px; }
.builder input, .builder textarea {
  width: 100%; font: 15px var(--font); color: var(--ink); padding: 9px 11px;
  border: 1px solid #c4cfe0; border-radius: 9px; background: #fff;
}
.builder textarea { min-height: 64px; resize: vertical; }
.builder .k { color: var(--blue); font-weight: 800; margin-right: 6px; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.steps li { counter-increment: s; position: relative; padding: 10px 14px 10px 50px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.steps li::before { content: counter(s); position: absolute; left: 12px; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }

.write { border-bottom: 1px dashed #9aa8c0; min-height: 28px; margin: 6px 0 12px; }

footer { margin-top: 56px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 40px 0 36px; }
  .card { padding: 16px; }
  .topnav { display: none; }
}

@media print {
  .topbar, .copy, .btns { display: none !important; }
  .hero { background: none; color: var(--ink); padding: 0 0 12px; }
  .hero .kicker, .hero p.lead, .hero .meta, .hero .meta b { color: var(--ink); }
  .prompt { background: #f2f5fa; color: var(--ink); border: 1px solid var(--line); }
  .prompt .label { color: var(--blue-d); }
  .ph { color: #8a5a00; }
  section { break-inside: avoid-page; padding-top: 20px; }
  .card, .prompt, .table-wrap { box-shadow: none; break-inside: avoid; }
  .quiz details { break-inside: avoid; }
}

.kursseite {
  --ink: #0d1830;
  --ink-2: #566173;
  --blue: #0b648a;
  --blue-d: #084c69;
  --sky: #ddf4fc;
  --sun: #e8a317;
  --sun-l: #f8e8bd;
  --green: #17663d;
  --green-l: #e4f3ea;
  --yellow: #805000;
  --red: #a52d3b;
  --red-l: #f7e5e8;
  --line: #ccd5db;
}
.kursseite .hero { background: #0d1830; }
.kursseite .hero-layout { align-items: center; }
.kursseite .hero img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.kursseite .grid > *, .kursseite .topnav { min-width: 0; }
.kursseite .g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.kursseite .g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.kursseite .topbar .wrap { height: auto; min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
.kursseite .topnav { flex-wrap: wrap; overflow: visible; }
.kursseite section { scroll-margin-top: 130px; }
.kursseite .subhead { margin-top: 28px; }
.kursseite .ampel + h3, .kursseite .grid + h3 { margin-top: 28px; }
.kursseite .card + .card { margin-top: 14px; }
.kursseite .grid .card { margin-top: 0; }
.kursseite table { table-layout: fixed; overflow-wrap: anywhere; }
.kursseite #ablauf th:first-child { width: 88px; }
.kursseite th[scope="row"] { text-transform: none; letter-spacing: normal; font-size: 15px; }
.kursseite .landkarte th:first-child { width: 25%; }
.kursseite #bilder table th:first-child { width: 32%; }
.kursseite #bilder .prompt pre { overflow-wrap: anywhere; }
.kursseite .write[contenteditable] { cursor: text; font-weight: 400; }
.kursseite .transfer-label { display: block; font-weight: 600; }
.kursseite textarea.write { display: block; width: 100%; font: inherit; color: var(--ink); background: #fff; border: 0; border-bottom: 1px dashed #9aa8c0; resize: vertical; padding: 8px 0; }
.kursseite details summary { cursor: pointer; font-weight: 600; }
.kursseite details p { margin-top: 12px; }
.kursseite blockquote { margin: 0 0 16px; }
.kursseite #footer { padding-top: 0; }
.kursseite :focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.kursseite .hero :focus-visible { outline-color: var(--sun); }
.kursseite .prompt :focus-visible { outline-color: var(--sun); }
.kursseite .sr-only, .kursseite .clipboard-buffer, .kursseite .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.kursseite .skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 30; background: #fff; color: var(--ink); padding: 10px 16px; }

@media (max-width: 640px) {
  .kursseite .topbar { position: static; }
  .kursseite .topbar .wrap { flex-wrap: wrap; gap: 6px; }
  .kursseite .topnav { display: flex; width: 100%; margin-left: 0; }
  .kursseite .topnav a { padding: 6px 8px; }
  .kursseite section { scroll-margin-top: 16px; }
  .kursseite th, .kursseite td { padding: 8px 6px; }
  .kursseite th, .kursseite th[scope="row"] { font-size: 12px; }
  .kursseite table { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html:has(.kursseite) { scroll-behavior: auto; }
}

@media print {
  .kursseite { background: #fff; }
  .kursseite .hero { background: none; }
  .kursseite .hero img { max-width: 300px; }
  .kursseite .grid, .kursseite .ampel { display: block; }
  .kursseite .grid > *, .kursseite .ampel > * { margin-bottom: 10px; }
  .kursseite section { break-inside: auto; }
  .kursseite .table-wrap { overflow: visible; }
  .kursseite .prompt pre { font-size: 10pt; }
  .kursseite .prompt .label { padding-right: 0; }
  .kursseite .note, .kursseite .ampel > div { background: #fff; border: 1px solid var(--line); }
  .kursseite .note { border-left-width: 4px; }
  .kursseite details::details-content { content-visibility: visible; display: block; }
  .kursseite details > :not(summary) { display: block !important; }
  .kursseite textarea { min-height: 60px; height: auto; border-radius: 0; }
  .kursseite footer { margin-top: 20px; }
}
