/* LearnIT – Design-System. Mobil zuerst. Komponenten-Klassen sind in docs/SPEC.md dokumentiert. */
:root {
  --bg: #0a0f1f; --bg-2: #0e1530; --surface: #141b38; --surface-2: #1b2449; --surface-3: #27326a;
  --border: rgba(255, 255, 255, .09); --border-strong: rgba(255, 255, 255, .18);
  --text: #eef1ff; --muted: #a2abd0; --faint: #6f78a3;
  /* Markenfarben aus dem LearnIT-Logo: Türkis (Akzent), Blau (Akzent 2), Orange (XP/Highlights) */
  --accent: #27d3c3; --accent-strong: #14b3a8; --accent-ink: #022b29; --accent-soft: rgba(39, 211, 195, .14);
  --accent-2: #4da6ff; --accent-2-soft: rgba(77, 166, 255, .16); --brand-orange: #ff9a2e;
  --ok: #4ade80; --ok-soft: rgba(74, 222, 128, .14); --bad: #fb7185; --bad-soft: rgba(251, 113, 133, .14);
  --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .14); --info: #60a5fa; --info-soft: rgba(96, 165, 250, .14); --xp: #ff9a2e;
  --radius: 20px; --radius-sm: 12px; --radius-xs: 8px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .38); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .25);
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SF Mono", Consolas, Menlo, monospace;
  --nav-h: 66px; --top-h: 58px; --side-w: 244px; --page-w: 1080px;
  --c: var(--accent); /* Fachfarbe, wird per style="--c:#…" überschrieben */
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f3f5fb; --bg-2: #e9edf7; --surface: #ffffff; --surface-2: #f2f4fb; --surface-3: #e3e8f6;
  --border: rgba(20, 30, 80, .10); --border-strong: rgba(20, 30, 80, .22);
  --text: #131a36; --muted: #556089; --faint: #8891b3;
  --accent: #0b9d96; --accent-strong: #08847e; --accent-ink: #ffffff; --accent-soft: rgba(11, 157, 150, .12);
  --accent-2: #1d74d8; --accent-2-soft: rgba(29, 116, 216, .11); --brand-orange: #f08a12;
  --ok: #15a34a; --ok-soft: rgba(21, 163, 74, .11); --bad: #e11d48; --bad-soft: rgba(225, 29, 72, .09);
  --warn: #c27803; --warn-soft: rgba(217, 139, 6, .13); --info: #2563eb; --info-soft: rgba(37, 99, 235, .09); --xp: #e07f0c;
  --shadow: 0 12px 30px rgba(30, 40, 90, .12); --shadow-sm: 0 3px 10px rgba(30, 40, 90, .08);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--bg); min-height: 100dvh; -webkit-font-smoothing: antialiased; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 500px at 85% -10%, rgba(77, 166, 255, .17), transparent 60%), radial-gradient(700px 480px at -10% 10%, rgba(39, 211, 195, .12), transparent 60%), var(--bg); }
[data-theme="light"] body::before { background: radial-gradient(900px 500px at 85% -10%, rgba(29, 116, 216, .10), transparent 60%), radial-gradient(700px 480px at -10% 10%, rgba(11, 157, 150, .10), transparent 60%), var(--bg); }
h1, h2, h3, h4, h5 { margin: 0 0 .4em; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 4.6vw, 2.05rem); } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; } h4 { font-size: 1rem; } h5 { font-size: .95rem; }
p { margin: 0 0 .8em; } a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); border: 1px solid var(--border); padding: .08em .38em; border-radius: 6px; word-break: break-word; }
mark { background: var(--warn-soft); color: inherit; padding: 0 .2em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.2em 0; }
::selection { background: var(--accent-2-soft); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
.ico { flex: none; vertical-align: -4px; } .ico-wrap { display: inline-flex; }

/* ---------- App-Hülle ---------- */
#app { min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 14px; padding-top: env(safe-area-inset-top); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; } .brand:hover { text-decoration: none; }
.brand-mark { height: 38px; width: auto; display: block; } .brand-word { font-size: 1.28rem; }
.brand i { font-style: normal; color: var(--accent); } .brand b { color: var(--brand-orange); }
.topbar .spacer { flex: 1; }
.stat-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 800; font-size: .86rem; }
.stat-pill { white-space: nowrap; text-decoration: none; flex: none; } .stat-pill:hover { text-decoration: none; }
@media (max-width: 420px) { .stat-pill { font-size: .78rem; padding: 5px 8px; gap: 3px; } .topbar { gap: 6px; padding-left: 10px; padding-right: 6px; } .brand-word { font-size: 1.12rem; } .brand-mark { height: 32px; } }
.stat-pill.xp { color: var(--xp); } .stat-pill.streak { color: #fb923c; }
.sidenav { display: none; }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; background: color-mix(in srgb, var(--bg-2) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--border); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--faint); font-size: .68rem; font-weight: 700; text-decoration: none; position: relative; }
.bottomnav a.active { color: var(--accent); } .bottomnav a.active::before { content: ""; position: absolute; top: 0; width: 34px; height: 3px; border-radius: 0 0 4px 4px; background: var(--accent); }
.view { padding-bottom: calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); min-height: calc(100dvh - var(--top-h)); }
body.no-chrome .topbar, body.no-chrome .bottomnav, body.no-chrome .sidenav, body.no-chrome .earny-fab { display: none !important; }
body.no-chrome .view { padding-bottom: 24px; min-height: 100dvh; }
.offline-banner { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: .82rem; font-weight: 700; padding: 4px 10px; }

@media (min-width: 900px) {
  .bottomnav { display: none; }
  .sidenav { display: flex; flex-direction: column; gap: 4px; position: fixed; top: var(--top-h); left: 0; bottom: 0; width: var(--side-w); padding: 18px 12px; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--bg-2) 60%, transparent); overflow-y: auto; }
  .sidenav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; color: var(--muted); font-weight: 700; text-decoration: none; }
  .sidenav a:hover { background: var(--surface); color: var(--text); }
  .sidenav a.active { background: var(--accent-soft); color: var(--accent); }
  .sidenav .side-foot { margin-top: auto; font-size: .75rem; color: var(--faint); padding: 10px 14px; }
  body:not(.no-chrome) .view { margin-left: var(--side-w); padding-bottom: 60px; }
  .topbar { padding: 0 22px; }
}

/* ---------- Layout ---------- */
.page { width: 100%; max-width: var(--page-w); margin: 0 auto; padding: 18px 14px; }
.page.narrow { max-width: 760px; } .page.wide { max-width: 1280px; }
@media (min-width: 900px) { .page { padding: 28px 30px; } }
.page-head { margin-bottom: 18px; } .page-head h1 { margin-bottom: .15em; } .page-head p { margin: 0; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 700; font-size: .88rem; margin-bottom: 8px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; } .row.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 10px; } .stack { display: flex; flex-direction: column; gap: 14px; } .stack.lg { gap: 22px; } .stack.sm { gap: 8px; }
.spacer { flex: 1; } .grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.section { margin-top: 26px; } .section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; } .section-title h2 { margin: 0; font-size: 1.15rem; }
.section-title a, .link { font-weight: 700; font-size: .88rem; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .86rem; } .tiny { font-size: .76rem; } .big { font-size: 1.15rem; } .bold { font-weight: 800; }
.center { text-align: center; } .right { text-align: right; } .mono { font-family: var(--mono); } .nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 30px; } .mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.hidden { display: none !important; }
@media (max-width: 899px) { .hide-mobile { display: none !important; } } @media (min-width: 900px) { .hide-desktop { display: none !important; } }
.c-ok { color: var(--ok); } .c-bad { color: var(--bad); } .c-warn { color: var(--warn); } .c-info { color: var(--info); } .c-accent { color: var(--accent); } .c-xp { color: var(--xp); }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); position: relative; min-width: 0; }
.card.pad { padding: 18px; } .card.pad-lg { padding: 24px; } .card.flat { box-shadow: none; } .card.soft { background: var(--surface-2); box-shadow: none; }
.card.hover { transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; cursor: pointer; color: inherit; display: block; text-decoration: none; }
.card.hover:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 55%, transparent); box-shadow: var(--shadow); text-decoration: none; }
.card.hover:active { transform: translateY(0) scale(.99); }
.card.accent { border-color: color-mix(in srgb, var(--c) 45%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 12%, var(--surface)), var(--surface)); }
.card.hero { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), color-mix(in srgb, var(--accent-2) 22%, var(--surface))); border-color: var(--border-strong); overflow: hidden; }
.card-title { font-weight: 800; font-size: 1.04rem; margin: 0 0 2px; } .card-sub { color: var(--muted); font-size: .88rem; margin: 0; }
.card-ico { width: 46px; height: 46px; flex: none; display: grid; place-items: center; font-size: 1.45rem; border-radius: 14px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.card-ico.sm { width: 36px; height: 36px; font-size: 1.1rem; border-radius: 11px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font-weight: 800; cursor: pointer; text-decoration: none; transition: transform .1s ease, filter .15s ease, background .15s ease; user-select: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); text-decoration: none; } .btn:active { transform: scale(.97); }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.violet { background: linear-gradient(180deg, #5db2ff, #2b7fe6); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(43, 127, 230, .35); }
.btn.orange { background: linear-gradient(180deg, #ffb04d, #f08a12); color: #2a1600; border-color: transparent; box-shadow: 0 6px 18px rgba(240, 138, 18, .35); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); } .btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.soft { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn.danger { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.btn.sm { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: .86rem; } .btn.lg { min-height: 54px; padding: 0 26px; font-size: 1.05rem; border-radius: 16px; }
.btn.block { display: flex; width: 100%; } .btn.icon { width: 44px; padding: 0; } .btn.icon.sm { width: 34px; }

/* ---------- Chips, Badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 800; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; } .chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; } .chip.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; } .chip.violet { background: var(--accent-2-soft); color: var(--accent-2); border-color: transparent; }
.chip.c { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); border-color: transparent; }
.dots { display: inline-flex; gap: 3px; } .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--surface-3); } .dots i.on { background: var(--warn); }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; } .field > label, .label { font-weight: 800; font-size: .86rem; color: var(--muted); }
.field .help { font-size: .78rem; color: var(--faint); } .field .error { font-size: .8rem; color: var(--bad); font-weight: 700; }
.input { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--border-strong); background: var(--bg-2); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-2-soft); }
.input.mono { font-family: var(--mono); font-size: .95rem; } .input.sm { min-height: 36px; padding: 6px 10px; border-radius: 10px; font-size: .9rem; }
.input.ok { border-color: var(--ok); background: var(--ok-soft); } .input.bad { border-color: var(--bad); background: var(--bad-soft); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; } select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 10px; font-weight: 800; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 800; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; } .switch input { appearance: none; width: 46px; height: 26px; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; } .switch input:checked { background: var(--accent); } .switch input:checked::after { transform: translateX(20px); }

/* ---------- Fortschritt ---------- */
.progress { height: 9px; border-radius: 999px; background: var(--surface-3); overflow: hidden; } .progress i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 60%, var(--accent-2))); transition: width .5s ease; min-width: 0; }
.progress.thin { height: 5px; } .progress.thick { height: 14px; }
.ring { position: relative; flex: none; display: grid; place-items: center; } .ring svg { position: absolute; inset: 0; } .ring-bg { stroke: var(--surface-3); } .ring-fg { stroke: var(--c); transition: stroke-dashoffset .6s ease; }
.ring-label { position: relative; font-size: .74rem; font-weight: 900; }
.stat { display: flex; flex-direction: column; gap: 2px; } .stat b { font-size: 1.6rem; font-weight: 900; line-height: 1.1; letter-spacing: -.02em; } .stat span { font-size: .78rem; color: var(--muted); font-weight: 700; }
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); } @media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } } .kpis .card { padding: 14px 16px; }

/* ---------- Listen, Tabellen ---------- */
.list { display: flex; flex-direction: column; } .list-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; min-width: 0; }
.list-item:last-child { border-bottom: 0; } a.list-item:hover, .list-item.click:hover { background: var(--surface-2); text-decoration: none; cursor: pointer; }
.list-item .li-main { flex: 1; min-width: 0; } .list-item .li-title { font-weight: 800; } .list-item .li-sub { font-size: .84rem; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin: .6em 0 1em; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; } .table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { background: var(--surface-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; } .table tr:last-child td { border-bottom: 0; } .table tr.click:hover td { background: var(--surface-2); cursor: pointer; }
.empty { text-align: center; color: var(--muted); padding: 34px 16px; } .empty-ico { font-size: 2.2rem; margin-bottom: 6px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 40px 16px; color: var(--muted); font-weight: 700; }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Markdown-Inhalte ---------- */
.md { font-size: 1rem; overflow-wrap: anywhere; } .md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md h3 { margin-top: 1.2em; font-size: 1.12rem; } .md h4 { margin-top: 1.1em; } .md ul, .md ol { margin: 0 0 .9em; padding-left: 1.35em; } .md li { margin: .25em 0; } .md li > ul, .md li > ol { margin: .2em 0; }
.md blockquote { margin: 0 0 .9em; padding: .4em 1em; border-left: 4px solid var(--border-strong); color: var(--muted); }
.md.compact p { margin-bottom: .4em; } .md.compact { font-size: .96rem; }
.codeblock { position: relative; margin: .6em 0 1em; border-radius: var(--radius-sm); background: #0b1022; border: 1px solid var(--border); overflow: hidden; }
[data-theme="light"] .codeblock { background: #10172f; }
.codeblock pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: .88rem; line-height: 1.55; color: #e6e9ff; tab-size: 4; }
.codeblock code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; word-break: normal; white-space: pre; }
.codeblock-lang { position: absolute; top: 6px; right: 10px; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #6f78a3; pointer-events: none; }
.tk-kw { color: #c4a7ff; font-weight: 600; } .tk-str { color: #9be9a8; } .tk-num { color: #ffcb8b; } .tk-com { color: #7c86b2; font-style: italic; } .tk-fn { color: #7cc7ff; } .tk-ty { color: #ffd580; } .tk-dec { color: #ff9cac; }
.callout { margin: .7em 0 1em; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); border-left: 5px solid var(--cc, var(--info)); }
.callout-title { display: flex; align-items: center; gap: 8px; font-weight: 900; margin-bottom: 4px; color: var(--cc, var(--info)); } .callout-body > :last-child { margin-bottom: 0; } .callout-body:empty { display: none; }
.callout.tip { --cc: var(--accent); background: var(--accent-soft); } .callout.merke { --cc: var(--accent-2); background: var(--accent-2-soft); } .callout.warn { --cc: var(--warn); background: var(--warn-soft); }
.callout.exam { --cc: var(--bad); background: var(--bad-soft); } .callout.info { --cc: var(--info); background: var(--info-soft); } .callout.earny { --cc: var(--accent); background: linear-gradient(135deg, var(--accent-soft), var(--accent-2-soft)); }
.md-diagram { margin: .7em 0 1em; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); overflow-x: auto; text-align: center; color: var(--text); }
.md-diagram svg { max-width: 100%; height: auto; } .md-diagram .md-diagram-src { display: none; } .md-diagram.raw .md-diagram-src { display: block; text-align: left; font-family: var(--mono); font-size: .82rem; margin: 0; white-space: pre; }
.md-diagram.error { border-color: var(--bad); text-align: left; font-size: .84rem; color: var(--bad); }

/* ---------- Modal, Toast, Konfetti ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(4, 7, 20, .6); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.modal.show { opacity: 1; } .modal-box { width: 100%; max-width: 560px; max-height: 92dvh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 24px 24px 0 0; box-shadow: var(--shadow); transform: translateY(24px); transition: transform .22s ease; padding-bottom: env(safe-area-inset-bottom); }
.modal.show .modal-box { transform: none; } .modal-box.wide { max-width: 900px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 6px 20px; } .modal-head h3 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: 8px 20px 18px; overflow-y: auto; } .modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@media (min-width: 700px) { .modal { align-items: center; padding: 20px; } .modal-box { border-radius: 24px; } }
#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 14px; }
.toast { background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); padding: 11px 18px; border-radius: 14px; font-weight: 700; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); transition: all .25s ease; max-width: 520px; }
.toast.show { opacity: 1; transform: none; } .toast.ok { background: #34d399; color: #032419; border-color: transparent; } .toast.bad { background: var(--bad); color: #fff; border-color: transparent; } .toast.xp { background: var(--xp); color: #2a1a00; border-color: transparent; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; } .confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { top: 105%; transform: rotate(720deg) translateX(40px); } }
@keyframes pop { 0% { transform: scale(.92); opacity: 0; } 100% { transform: none; opacity: 1; } } .pop { animation: pop .25s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } } .fade-up { animation: fade-up .35s ease both; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } } .shake { animation: shake .35s ease; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
@media print { .topbar, .bottomnav, .sidenav, .earny-fab, #toasts { display: none !important; } body:not(.no-chrome) .view { margin: 0; padding: 0; } body::before { display: none; } .card { box-shadow: none; break-inside: avoid; } }
