/* Dit sind die Regeln – Stylesheet
   Referenz-Lock: „Dein Lernen“ (helles Papier, weiße Flächen, Radius .5rem, keine Schatten, Inter).
   Eigene Identität: EU-Tiefblau als einzige Akzentfarbe, Gold nur als Ornament, Violett nur für Änderungen 2026. */

@font-face { font-family: "Inter"; src: url("/fonts/inter-latin.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-latin.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-italic-latin.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #151b26;
  --ink-soft: #4d5b70;
  --paper: #f6f6f4;
  --white: #ffffff;
  --line: #e3e3df;
  --line-strong: #c8c8c2;
  --accent: #1f3a93;
  --accent-strong: #16296b;
  --accent-wash: #eef1fb;
  --accent-line: #c9d3f1;
  --gold: #d9a520;
  --gold-ink: #7a5a00;
  --gold-wash: #fbf3dc;
  --green: #0b7a4b;
  --green-wash: #e6f4ec;
  --red: #b42318;
  --red-wash: #fdeceb;
  --amber: #8f5300;
  --amber-wash: #fff1d9;
  --m1: #6d35ad;
  --m1-wash: #f3ebfc;
  --radius: .5rem;
  --radius-large: .75rem;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --gutter: 1rem;
  --tabbar: 4.25rem;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--paper); }
body { color: var(--ink); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: clamp(1.75rem, 5.4vw, 2.75rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 750; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
kbd { font: 600 .7rem/1 var(--font); padding: .15rem .35rem; border: 1px solid currentColor; border-radius: .3rem; opacity: .7; margin-left: .4rem; }
mark { background: #ffe89a; color: inherit; border-radius: .15rem; padding: 0 .1rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: .3rem; }
.sr-only { position: fixed; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.center { text-align: center; }
.accent { color: var(--accent); }
.eyebrow { font-size: .72rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin-bottom: .35rem; }
.lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 42rem; margin-top: .75rem; }
.fineprint { font-size: .78rem; color: var(--ink-soft); margin: 1.5rem 0 .5rem; }
.svg-icon { width: 1.2rem; height: 1.2rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon { display: inline-flex; }

/* ---------- Marke ---------- */
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; }
.brand-mark { width: 2rem; height: 2rem; border-radius: .55rem; background: var(--accent-strong); position: relative; flex: none; }
.brand-mark::before { content: ""; position: absolute; left: 22%; top: 27%; width: 56%; height: 9%; border-radius: 1rem; background: #fff; box-shadow: 0 .45rem 0 -0rem #fff; }
.brand-mark::after { content: ""; position: absolute; left: 22%; top: 64%; width: 28%; height: 9%; border-radius: 1rem; background: #fff; }
.brand-mark { background-image: radial-gradient(circle at 71% 69%, var(--gold) 0 11%, transparent 12%); }
.brand-text { display: flex; flex-direction: column; line-height: 1; font-size: .95rem; }
.brand-text span { font-weight: 650; }
.brand-text strong { font-weight: 800; color: var(--accent); font-size: 1.05rem; }
.brand--large .brand-mark { width: 2.75rem; height: 2.75rem; border-radius: .7rem; }
.brand--large .brand-text { font-size: 1.1rem; }
.brand--large .brand-text strong { font-size: 1.3rem; }

/* ---------- Knöpfe und Felder ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.75rem; padding: .55rem 1.1rem; border: 1px solid var(--line-strong); border-radius: 100vw; background: var(--white); color: var(--ink); font-weight: 650; font-size: .95rem; text-decoration: none; cursor: pointer; transition: background .15s var(--ease), border-color .15s var(--ease); white-space: nowrap; }
.button:hover { border-color: var(--accent); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button--primary:hover { background: var(--accent-strong); }
.button--ghost { background: transparent; }
.button--danger { color: var(--red); border-color: #efb8b3; }
.button--block { width: 100%; }
.button .svg-icon { width: 1.05rem; height: 1.05rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.link-button { display: inline-flex; align-items: center; gap: .35rem; background: none; border: 0; padding: .35rem 0; color: var(--accent); font-weight: 650; font-size: .9rem; cursor: pointer; text-decoration: none; }
.link-button .svg-icon { width: 1rem; height: 1rem; }
.icon-button { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid var(--line); border-radius: 100vw; background: var(--white); color: var(--ink); cursor: pointer; flex: none; text-decoration: none; }
.icon-button.is-active { background: var(--accent-wash); border-color: var(--accent-line); color: var(--accent); }
.icon-button.is-active .svg-icon { fill: currentColor; }
.icon-button--small { width: 2rem; height: 2rem; border: 0; background: transparent; }
.stack { display: grid; gap: .9rem; }
.field { display: grid; gap: .35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend { font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); padding: 0; }
.field input, .field select, .field textarea { width: 100%; min-height: 2.9rem; padding: .6rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--white); font-size: 1rem; }
.field textarea { resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field--inline { grid-template-columns: auto 1fr; align-items: center; gap: .75rem; }
.form-message { min-height: 1.2rem; color: var(--red); font-size: .9rem; }
.check { display: flex; gap: .6rem; align-items: center; font-weight: 550; }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }

/* ---------- Anmeldung ---------- */
.auth { height: 100dvh; overflow-y: auto; overscroll-behavior: contain; display: grid; place-items: center; padding: 1.5rem var(--gutter); }
.auth-card { width: min(100%, 26rem); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-large); padding: 1.75rem; display: grid; gap: .9rem; }
.auth-card h1 { font-size: 1.75rem; }
.auth-card .brand { margin-bottom: .5rem; }

/* ---------- App-Hülle ---------- */
.app { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem var(--gutter); padding-top: max(.7rem, env(safe-area-inset-top)); background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-actions { display: flex; align-items: center; gap: .45rem; }
.pill { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.5rem; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 100vw; background: var(--white); color: var(--ink); font-size: .82rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.pill .svg-icon { width: 1rem; height: 1rem; }
.pill-level { color: var(--accent); }
.pill--level .pill-label { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
.pill--tutor { color: var(--accent); border-color: var(--accent-line); background: var(--accent-wash); }
.pill.is-active { border-color: var(--accent); }
.sidenav { display: none; }
.view { min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 1.25rem var(--gutter) 2rem; outline: none; }
.view > * { max-width: 56rem; margin-left: auto; margin-right: auto; }
.view { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.view input, .view textarea, .view .article-nr, .view .norm, .view .button { hyphens: manual; }
.view > * + * { margin-top: 1rem; }
.tabbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: .25rem; padding: .35rem .5rem; padding-bottom: max(.35rem, env(safe-area-inset-bottom)); background: var(--white); border-top: 1px solid var(--line); }
.tabbar a { display: grid; justify-items: center; gap: .15rem; padding: .45rem .2rem; border-radius: .6rem; color: var(--ink-soft); font-size: .72rem; font-weight: 700; text-decoration: none; }
.tabbar a .svg-icon { width: 1.35rem; height: 1.35rem; }
.tabbar a.is-active { color: var(--accent); background: var(--accent-wash); }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 1rem + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(92vw, 28rem); padding: .75rem 1.1rem; border-radius: 100vw; background: var(--ink); color: #fff; font-weight: 600; font-size: .9rem; z-index: 20; text-align: center; }
.toast[data-tone="bad"] { background: var(--red); }

@media (max-width: 420px) {
  .pill--level .pill-label, .pill--tutor .pill-label { display: none; }
  .brand-text { font-size: .85rem; }
}

@media (min-width: 960px) {
  :root { --gutter: 2rem; }
  .app { grid-template-columns: 15rem minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .tabbar { display: none; }
  .sidenav { display: flex; flex-direction: column; gap: .2rem; padding: 1.25rem .9rem; border-right: 1px solid var(--line); overflow-y: auto; }
  .sidenav-label { font-size: .72rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); padding: 0 .75rem .5rem; }
  .sidenav a { display: flex; align-items: center; gap: .75rem; padding: .7rem .75rem; border-radius: .6rem; color: var(--ink); font-weight: 650; text-decoration: none; }
  .sidenav a:hover { background: var(--white); }
  .sidenav a.is-active { background: var(--accent-wash); color: var(--accent); }
  .sidenav a[data-nav="einstellungen"] { margin-top: auto; }
  .view { padding-top: 2rem; }
  .toast { bottom: 2rem; }
}

/* ---------- Grundbausteine ---------- */
.page-head { padding: .5rem 0 .5rem; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-large); padding: 1.25rem; }
.panel--tight { padding: .75rem; }
.panel--final { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-wash), var(--white) 70%); }
.panel h2 + * { margin-top: .6rem; }
.panel > .button { margin-top: 1rem; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .75rem; }
.status { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; border-radius: 100vw; font-size: .75rem; font-weight: 750; white-space: nowrap; background: var(--paper); color: var(--ink-soft); border: 1px solid var(--line); }
.status .svg-icon { width: .9rem; height: .9rem; }
.status--in-arbeit { background: var(--accent-wash); color: var(--accent); border-color: var(--accent-line); }
.status--pruefungsreif { background: var(--amber-wash); color: var(--amber); border-color: #f0d3a0; }
.status--bestanden { background: var(--green-wash); color: var(--green); border-color: #b9dfc9; }
.status--locked { background: transparent; }
.meter-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; margin-top: .75rem; }
.meter-label { font-size: .8rem; color: var(--ink-soft); font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { display: block; height: .5rem; border-radius: 100vw; background: #e9e9e5; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: var(--pct, 0%); background: var(--accent); border-radius: inherit; transition: width .4s var(--ease); }
.fold { border-top: 1px solid var(--line); margin-top: 1rem; }
.fold > summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 0 .35rem; cursor: pointer; font-weight: 700; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "+"; font-weight: 500; color: var(--ink-soft); font-size: 1.2rem; margin-left: .5rem; }
.fold[open] > summary::after { content: "–"; }
.fold-meta { margin-left: auto; font-size: .8rem; color: var(--ink-soft); font-weight: 600; }
.panel.fold { margin-top: 1rem; border-top: 1px solid var(--line); }
.panel.fold > summary { padding: 0; }
.objectives { list-style: none; display: grid; gap: .5rem; margin-top: .5rem; }
.objectives li { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) auto; gap: .6rem; align-items: start; font-size: .95rem; }
.objective-mark { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; margin-top: .05rem; }
.objective-mark .svg-icon { width: .9rem; height: .9rem; stroke-width: 2.6; }
.objectives li.is-reached .objective-mark { background: var(--green); border-color: var(--green); color: #fff; }
.objective-meta { font-size: .78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.keypoints { list-style: none; display: grid; gap: .55rem; margin-top: .5rem; }
.keypoints li { display: grid; gap: .1rem; padding-left: .8rem; border-left: 3px solid var(--gold); }
.keypoint-norm { font-size: .78rem; color: var(--ink-soft); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: 1rem; }
.chips-label { font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-right: .2rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 100vw; background: var(--white); color: var(--ink); font-size: .8rem; font-weight: 650; text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip--button { text-align: left; white-space: normal; line-height: 1.3; }
.empty { text-align: center; padding: 2rem 1rem; display: grid; gap: .4rem; justify-items: center; }
.empty-title { font-weight: 750; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: 100vw; background: var(--paper); border: 1px solid var(--line); font-size: .72rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; letter-spacing: .02em; }
.badge--d1, .badge--d2, .badge--d3, .badge--d4 { color: var(--accent); letter-spacing: .05em; }
.badge-text { letter-spacing: 0; color: var(--ink-soft); }
.badge--m1 { background: var(--m1-wash); border-color: #dcc7f2; color: var(--m1); }
.badge--next { background: var(--accent); border-color: var(--accent); color: #fff; }
.module-tag { font-size: .72rem; font-weight: 700; color: var(--ink-soft); }
.table { width: 100%; border-collapse: collapse; margin-top: .75rem; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); padding: .4rem .3rem; border-bottom: 1px solid var(--line); }
.table td { padding: .55rem .3rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td:last-child, .table th:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.is-ok { color: var(--green); }
.is-bad { color: var(--red); }

/* ---------- Heute ---------- */
.hero-card { background: var(--accent-strong); color: #fff; border-radius: var(--radius-large); padding: 1.4rem; position: relative; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; right: -2.5rem; top: -2.5rem; width: 9rem; height: 9rem; border-radius: 50%; border: 1.5rem solid rgba(217, 165, 32, .14); pointer-events: none; z-index: 0; }
.hero-card > * { position: relative; z-index: 1; }
.hero-card .eyebrow { color: #c9d3f1; }
.hero-card h2 { font-size: 1.5rem; margin-bottom: .35rem; }
.hero-card .muted { color: #d6ddf3; }
.hero-card .meter-label { color: #d6ddf3; }
.hero-card .bar { background: rgba(255, 255, 255, .18); }
.hero-card .bar-fill { background: var(--gold); }
.hero-card .button { border-color: rgba(255, 255, 255, .35); background: transparent; color: #fff; }
.hero-card .button--primary { background: #fff; color: var(--accent-strong); border-color: #fff; }
.hero-card .status { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); }
.hero-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.daily { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.25rem; border: 1px solid var(--accent-line); background: var(--accent-wash); border-radius: var(--radius-large); }
.daily-title { font-size: 1.15rem; font-weight: 800; }
.stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.stat { display: grid; gap: .1rem; padding: .9rem .8rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-large); color: var(--ink); text-decoration: none; min-width: 0; }
.stat-value { display: inline-flex; align-items: center; gap: .25rem; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-value .svg-icon { color: #d9731a; width: 1.2rem; height: 1.2rem; }
.stat-label { font-size: .75rem; color: var(--ink-soft); font-weight: 650; }
.stat-note { font-size: .72rem; color: var(--ink-soft); }
.stat-note.is-ok { color: var(--green); font-weight: 700; }
.stat-note.is-bad { color: var(--red); font-weight: 700; }
.row-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .9rem; align-items: center; }
.row-panel > .button, .row-panel > .status { grid-column: 2; justify-self: start; }
.row-icon { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); }
.row-icon--gold { background: var(--gold-wash); color: var(--gold-ink); }
.row-title { font-weight: 750; }
.quick-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.quick { display: grid; justify-items: center; gap: .35rem; padding: 1rem .5rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-large); color: var(--ink); font-size: .82rem; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; }
.quick .svg-icon { color: var(--accent); width: 1.4rem; height: 1.4rem; }
@media (min-width: 700px) {
  .row-panel { grid-template-columns: auto minmax(0, 1fr) auto; }
  .row-panel > .button, .row-panel > .status { grid-column: auto; }
}

/* ---------- Lernen ---------- */
.lernzettel h2 { font-size: 1.4rem; }
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.mode { display: grid; align-content: start; gap: .3rem; text-align: left; padding: 1rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-large); cursor: pointer; min-width: 0; }
.mode:hover:not(:disabled) { border-color: var(--accent); }
.mode:disabled { opacity: .5; cursor: default; }
.mode-icon { width: 2.2rem; height: 2.2rem; border-radius: .6rem; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); }
.mode-title { font-weight: 800; font-size: 1rem; }
.mode-text { font-size: .8rem; color: var(--ink-soft); line-height: 1.35; }
.mode-count { font-size: .75rem; font-weight: 700; color: var(--accent); margin-top: .2rem; }
@media (min-width: 700px) { .modes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.session-head { display: flex; align-items: center; gap: .75rem; }
.session-title { flex: 1; min-width: 0; }
.session-title .eyebrow { margin: 0; }
.session-title .meter-row { margin-top: .35rem; }
.flashcard, .case { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-large); padding: 1.25rem; display: grid; gap: 1rem; }
.flashcard.is-revealed { border-color: var(--accent-line); }
.card-meta { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.topic { font-size: .8rem; font-weight: 650; color: var(--ink-soft); }
.card-question { font-size: 1.2rem; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
.explain { display: grid; gap: .6rem; padding: 1rem; border-radius: var(--radius); background: var(--accent-wash); }
.explain-answer { font-size: 1rem; }
.explain-why { font-size: .9rem; color: var(--ink-soft); }
.explain-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.norm { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 700; color: var(--accent); text-decoration: none; }
.norm .svg-icon { width: .95rem; height: .95rem; }
.norm--minor { font-weight: 600; color: var(--ink-soft); }
.rate { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; position: sticky; bottom: -2rem; padding: .6rem 0 2rem; margin-bottom: -2rem; background: linear-gradient(180deg, rgba(246, 246, 244, 0), var(--paper) 25%); }
.rate-button { display: grid; gap: .05rem; justify-items: center; padding: .7rem .3rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--white); cursor: pointer; }
.rate-button strong { font-size: .9rem; }
.rate-button span { font-size: .7rem; color: var(--ink-soft); }
.rate--again { border-color: #efb8b3; color: var(--red); }
.rate--hard { border-color: #f0d3a0; color: var(--amber); }
.rate--good { border-color: var(--accent-line); color: var(--accent); }
.rate--easy { border-color: #b9dfc9; color: var(--green); }
.choices { list-style: none; display: grid; gap: .5rem; }
.choice { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .7rem; align-items: center; text-align: left; padding: .8rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--white); cursor: pointer; line-height: 1.35; }
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice:disabled { cursor: default; color: var(--ink); opacity: 1; }
.choice-key { width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: var(--paper); font-size: .78rem; font-weight: 800; color: var(--ink-soft); }
.choice.is-chosen { border-color: var(--accent); background: var(--accent-wash); }
.choice.is-chosen .choice-key { background: var(--accent); color: #fff; }
.choice.is-correct { border-color: var(--green); background: var(--green-wash); }
.choice.is-correct .choice-key { background: var(--green); color: #fff; }
.choice.is-wrong { border-color: var(--red); background: var(--red-wash); }
.choice.is-wrong .choice-key { background: var(--red); color: #fff; }
.choice-icon { color: var(--green); }
.shake { animation: shake .35s var(--ease); }
@keyframes shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
.verdict { font-weight: 800; font-size: 1.05rem; }
.result.is-passed { border-color: #b9dfc9; }
.result.is-failed { border-color: #efb8b3; }
.result h2 { font-size: 1.6rem; }
.result-score { margin: .5rem 0 .75rem; }
.xp-gain { margin-top: .75rem; font-weight: 800; color: var(--gold-ink); }
.mini-list { display: grid; gap: .5rem; margin: .6rem 0 0 1.1rem; font-size: .92rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.search { flex: 1 1 14rem; display: flex; align-items: center; gap: .5rem; padding: 0 .8rem; min-height: 2.9rem; border: 1px solid var(--line-strong); border-radius: 100vw; background: var(--white); color: var(--ink-soft); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 1rem; color: var(--ink); min-height: 2.7rem; }
.search:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); }
.term-list { list-style: none; display: grid; gap: .5rem; }
.term details { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: .1rem 1rem; }
.term summary { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: .75rem 0; cursor: pointer; list-style: none; }
.term summary::-webkit-details-marker { display: none; }
.term-name { font-weight: 750; }
.term-norm { font-size: .78rem; color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
.term details p { margin-bottom: .6rem; }
.term-memory { display: flex; gap: .5rem; align-items: flex-start; font-size: .9rem; color: var(--gold-ink); }
.term details .explain-foot { padding-bottom: .8rem; }
.term.is-mastered .term-name::after { content: " ✓"; color: var(--green); }
.case-list { list-style: none; display: grid; gap: .5rem; }
.case-item { width: 100%; display: grid; gap: .35rem; text-align: left; padding: 1rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-large); cursor: pointer; }
.case-item:hover { border-color: var(--accent); }
.case-top { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.case-title { font-weight: 750; }
.done { display: inline-flex; align-items: center; gap: .25rem; color: var(--green); font-size: .75rem; font-weight: 750; }
.done .svg-icon { width: .9rem; height: .9rem; }
.case h2 { font-size: 1.3rem; }
.case-situation { font-size: 1rem; line-height: 1.6; }
.case-task { padding: .8rem 1rem; background: var(--paper); border-radius: var(--radius); }
.solution { display: grid; gap: .6rem; padding-left: 1.3rem; }
.solution li { padding-left: .3rem; }
.solution li::marker { font-weight: 800; color: var(--accent); }
.case-result { padding: 1rem; border-radius: var(--radius); background: var(--green-wash); display: grid; gap: .5rem; }
.sequence-placed { display: grid; gap: .45rem; padding-left: 1.4rem; }
.sequence-placed li { padding: .6rem .75rem; background: var(--green-wash); border-radius: var(--radius); }
.sequence-placed li::marker { font-weight: 800; color: var(--green); }
.sequence-placed .placeholder { background: transparent; border: 1px dashed var(--line-strong); color: var(--ink-soft); list-style: none; margin-left: -1.4rem; }
.sequence-pool { display: grid; gap: .5rem; }
.sequence-pool .choice { grid-template-columns: 1fr; }

/* ---------- Prüfen ---------- */
.exam-list { list-style: none; display: grid; gap: .5rem; }
.exam-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; padding: .85rem 0; border-top: 1px solid var(--line); }
.exam-row:first-child { border-top: 0; padding-top: 0; }
.exam-main { display: grid; gap: .15rem; }
.exam-title { font-weight: 750; }
.exam-side { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.exam-row.is-locked .exam-title { color: var(--ink-soft); }
@media (min-width: 700px) {
  .exam-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .exam-side { justify-content: flex-end; }
}
.rule-list { display: grid; gap: .6rem; padding-left: 1.1rem; margin-top: .75rem; font-size: .92rem; }
.exam-head { position: sticky; top: -1.25rem; z-index: 2; background: var(--paper); padding: .5rem 0; }
.exam-clock { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .8rem; border-radius: 100vw; background: var(--white); border: 1px solid var(--line); font-weight: 800; font-variant-numeric: tabular-nums; }
.exam-clock.is-low { color: var(--red); border-color: var(--red); }
.flag { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--ink-soft); }
.flag input { accent-color: var(--amber); width: 1.1rem; height: 1.1rem; }
.exam-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .6rem; align-items: center; }
.exam-dots { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; }
.dot { width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--white); font-size: .7rem; font-weight: 700; cursor: pointer; color: var(--ink-soft); padding: 0; }
.dot.is-answered { background: var(--accent-wash); border-color: var(--accent-line); color: var(--accent); }
.dot.is-flagged { border-color: var(--amber); border-width: 2px; }
.dot.is-current { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (max-width: 600px) {
  .exam-nav { grid-template-columns: 1fr 1fr; }
  .exam-dots { grid-column: 1 / -1; grid-row: 1; }
}
.review { display: grid; gap: 1.25rem; padding-left: 1.2rem; margin-top: .75rem; }
.review-q { font-weight: 700; margin-bottom: .35rem; }
.review-a { font-size: .9rem; }
.review .explain { margin-top: .5rem; }
.certificate { background: var(--white); border: 2px solid var(--gold); border-radius: var(--radius-large); padding: 2.5rem 1.5rem; text-align: center; display: grid; gap: 1rem; background-image: radial-gradient(circle at 50% 0, var(--gold-wash), transparent 60%); }
.certificate h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.certificate-name { font-family: var(--serif); font-size: 2rem; font-style: italic; color: var(--accent-strong); }

/* ---------- Plan ---------- */
.timeline { list-style: none; display: grid; gap: 0; }
.timeline-stage { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: .9rem; position: relative; padding-bottom: 1.5rem; }
.timeline-stage::before { content: ""; position: absolute; left: 1.3rem; top: 2.6rem; bottom: 0; width: 2px; background: var(--line-strong); }
.timeline-stage:last-child::before { display: none; }
.stage-mark { width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent-strong); color: #fff; font-weight: 800; font-size: .9rem; position: relative; }
.timeline-final .stage-mark { background: var(--gold); color: var(--ink); }
.stage-body { min-width: 0; }
.stage-body > .muted { margin-top: .35rem; }
.plan-modules { list-style: none; display: grid; gap: .5rem; margin-top: 1rem; }
.plan-module details { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-large); }
.plan-module.is-now details { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.plan-module summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; align-items: start; padding: .9rem 1rem; cursor: pointer; list-style: none; }
.plan-module summary::-webkit-details-marker { display: none; }
.plan-module summary .status { grid-column: 2; justify-self: start; }
.plan-num { width: 2rem; height: 2rem; border-radius: .5rem; display: grid; place-items: center; background: var(--paper); font-weight: 800; font-size: .85rem; }
.status-bestanden .plan-num { background: var(--green); color: #fff; }
.plan-main { display: grid; gap: .25rem; min-width: 0; }
.plan-title { font-weight: 750; }
.plan-main .bar { margin-top: .35rem; }
.plan-detail { padding: 0 1rem 1rem; border-top: 1px solid var(--line); padding-top: .9rem; display: grid; gap: .6rem; }
.plan-detail .chips { margin-top: .25rem; }
.plan-exam { display: flex; gap: .6rem; align-items: center; padding: .8rem 1rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-large); font-size: .9rem; }
.plan-exam.is-passed { border-style: solid; border-color: #b9dfc9; background: var(--green-wash); }
.plan-exam .svg-icon { color: var(--accent); }
.plan-exam.is-passed .svg-icon { color: var(--green); }
@media (min-width: 700px) {
  .plan-module summary { grid-template-columns: auto minmax(0, 1fr) auto; }
  .plan-module summary .status { grid-column: auto; }
}

/* ---------- Wissen ---------- */
.tabs { display: flex; gap: .3rem; overflow-x: auto; padding: .25rem; background: var(--white); border: 1px solid var(--line); border-radius: 100vw; scrollbar-width: none; }
.tab { flex: 1 1 auto; padding: .55rem .6rem; border: 0; border-radius: 100vw; background: transparent; font-weight: 700; font-size: .88rem; color: var(--ink-soft); cursor: pointer; }
.tab.is-active { background: var(--accent); color: #fff; }
.law-meta { padding: 0 .25rem; }
.chapter { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-large); margin-top: .5rem; overflow: hidden; }
.chapter > summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .75rem; padding: .9rem 1rem; cursor: pointer; list-style: none; }
.chapter > summary::-webkit-details-marker { display: none; }
.chapter-nr { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); grid-column: 1 / -1; }
.chapter-title { font-weight: 750; grid-column: 1; }
.chapter-count { font-size: .78rem; color: var(--ink-soft); font-weight: 650; grid-column: 2; justify-self: end; align-self: end; }
.section-title { padding: .6rem 1rem .3rem; font-size: .8rem; font-weight: 750; color: var(--ink-soft); border-top: 1px solid var(--line); }
.article-list { list-style: none; }
.article-row { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) auto auto auto; gap: .6rem; align-items: center; padding: .65rem 1rem; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .92rem; }
.article-row:hover { background: var(--accent-wash); }
.panel .article-list .article-row:first-child { border-top: 0; }
.article-nr { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.article-title { min-width: 0; }
.dot-m1 { width: .55rem; height: .55rem; border-radius: 50%; background: var(--m1); }
.svg-icon.is-marked { color: var(--gold-ink); fill: var(--gold); width: 1rem; height: 1rem; }
.article-cards { font-size: .7rem; font-weight: 800; padding: .1rem .45rem; border-radius: 100vw; background: var(--accent-wash); color: var(--accent); }
.note-preview { grid-column: 2 / -1; font-size: .8rem; color: var(--ink-soft); }
.search-hits { list-style: none; display: grid; gap: .5rem; margin-top: .5rem; }
.hit { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .2rem .7rem; padding: .85rem 1rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.hit:hover { border-color: var(--accent); }
.hit-ref { font-weight: 800; color: var(--accent); white-space: nowrap; }
.hit-title { font-weight: 700; }
.hit-snippet { grid-column: 1 / -1; font-family: var(--serif); font-size: .92rem; color: var(--ink-soft); }
.hit-count { grid-column: 1 / -1; font-size: .72rem; font-weight: 700; color: var(--ink-soft); }
.norm-text { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-large); padding: 1.5rem 1.25rem; font-family: var(--serif); font-size: 1.07rem; line-height: 1.65; }
.norm-text header { font-family: var(--font); margin-bottom: 1.25rem; display: grid; gap: .4rem; justify-items: start; }
.norm-ref { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.norm-text h1 { font-size: clamp(1.4rem, 4vw, 1.9rem); }
.norm-text p { margin: 0 0 .7rem; position: relative; }
.norm-text .b-point { padding-left: 1.6rem; }
.norm-text .b-sub { padding-left: 3rem; }
.norm-text .b-num { padding-left: 1.6rem; }
.b-label { font-family: var(--font); font-weight: 800; font-size: .9em; color: var(--accent); }
.b-point .b-label, .b-num .b-label { position: absolute; left: 0; }
.b-sub .b-label { position: absolute; left: 1.4rem; }
.norm-text .is-m1 { background: var(--m1-wash); border-left: 3px solid var(--m1); margin-left: -1.25rem; padding-right: .5rem; padding-top: .15rem; padding-bottom: .15rem; }
.norm-text .is-m1.b-text, .norm-text .is-m1.b-para { padding-left: calc(1.25rem - 3px); }
.norm-text .is-m1.b-point, .norm-text .is-m1.b-num { padding-left: calc(2.85rem - 3px); }
.norm-text .is-m1.b-point .b-label, .norm-text .is-m1.b-num .b-label { left: calc(1.25rem - 3px); }
.norm-text .is-m1.b-sub { padding-left: calc(4.25rem - 3px); }
.norm-text .is-m1.b-sub .b-label { left: calc(2.65rem - 3px); }
.m1-tag { float: right; margin: .1rem 0 .2rem .5rem; font-family: var(--font); font-size: .65rem; font-weight: 800; color: var(--m1); letter-spacing: .05em; }
.xref { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: .15em; }
.study-panel p + p { margin-top: .35rem; }
.study-panel .field { margin-top: 1rem; }
.pager { display: flex; justify-content: space-between; gap: .6rem; }
.deadlines { list-style: none; display: grid; gap: 0; margin-top: .5rem; }
.deadline { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; padding: .9rem 0; border-top: 1px solid var(--line); }
@media (min-width: 600px) { .deadline { grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; } }
.deadline-date { font-weight: 800; font-variant-numeric: tabular-nums; font-size: .9rem; }
.deadline-body { min-width: 0; display: grid; gap: .25rem; justify-items: start; }
.deadline-title { font-weight: 750; }
.deadline-body > * { max-width: 100%; }
.deadline.is-past .deadline-date, .deadline.is-past .deadline-title { color: var(--ink-soft); }
.deadline.is-next { background: var(--accent-wash); border-radius: var(--radius); padding: .9rem .75rem; border-top-color: transparent; }
.deadline.kind-geltung .deadline-date { color: var(--accent); }

/* ---------- Tutor ---------- */
.ask { display: grid; gap: .75rem; }
.context-chip { display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem .4rem .8rem; border-radius: var(--radius); background: var(--accent-wash); color: var(--accent); font-size: .85rem; font-weight: 650; }
.context-chip span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-row { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: .2rem; border: 1px solid var(--line-strong); border-radius: 100vw; background: var(--paper); }
.segmented button { border: 0; background: transparent; padding: .45rem .9rem; border-radius: 100vw; font-weight: 700; font-size: .85rem; color: var(--ink-soft); cursor: pointer; }
.segmented button.is-active { background: var(--white); color: var(--accent); }
.segmented--wide { display: grid; grid-template-columns: 1fr; gap: .4rem; border-radius: var(--radius); background: transparent; border: 0; padding: 0; }
.seg-option { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem; border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; }
.seg-option input { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; margin-top: .15rem; }
.seg-option span { display: grid; }
.seg-option small { color: var(--ink-soft); font-size: .82rem; }
.seg-option:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
@media (min-width: 700px) { .segmented--wide { grid-template-columns: repeat(3, 1fr); } }
.conversation { display: grid; gap: 1rem; }
.turn { display: grid; gap: .6rem; }
.question { justify-self: end; max-width: 85%; padding: .75rem 1rem; border-radius: 1rem 1rem .25rem 1rem; background: var(--accent); color: #fff; font-weight: 550; }
.answer { background: var(--white); border: 1px solid var(--line); border-radius: 1rem 1rem 1rem .25rem; padding: 1.1rem; display: grid; gap: .8rem; }
.answer.is-error { border-color: #efb8b3; color: var(--red); }
.answer.is-pending { display: flex; align-items: center; gap: .75rem; }
.answer-text p + p { margin-top: .7rem; }
.answer-points { display: grid; gap: .35rem; padding-left: 1.1rem; font-size: .95rem; }
.cite { display: inline-block; padding: 0 .35rem; margin: 0 .1rem; border-radius: .3rem; background: var(--accent-wash); color: var(--accent); font-size: .78rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.notice { padding: .6rem .8rem; border-radius: var(--radius); background: var(--amber-wash); color: var(--amber); font-weight: 650; font-size: .9rem; }
.sources > summary { cursor: pointer; font-weight: 750; font-size: .9rem; }
.sources ol { display: grid; gap: .75rem; padding-left: 1.2rem; margin-top: .6rem; }
.sources li { display: grid; gap: .2rem; }
.sources blockquote { margin: .2rem 0 0; padding: .5rem .75rem; border-left: 3px solid var(--accent-line); font-family: var(--serif); font-size: .9rem; color: var(--ink-soft); }
.answer-meta { border-top: 1px solid var(--line); padding-top: .6rem; }
.spinner { width: 1.2rem; height: 1.2rem; border-radius: 50%; border: 2.5px solid var(--accent-line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.examples { display: grid; gap: .5rem; justify-items: start; }
.history { list-style: none; display: grid; gap: .25rem; margin-top: .5rem; }
.history li { display: flex; align-items: center; gap: .25rem; }
.history-item { flex: 1; min-width: 0; display: flex; justify-content: space-between; gap: .75rem; text-align: left; padding: .6rem .5rem; border: 0; background: transparent; border-radius: var(--radius); cursor: pointer; }
.history-item:hover { background: var(--accent-wash); }
.history-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Pass ---------- */
.heatmap { display: grid; grid-template-rows: repeat(7, .85rem); grid-auto-flow: column; grid-auto-columns: .85rem; gap: .22rem; overflow-x: auto; padding-bottom: .25rem; }
.heat { border-radius: .2rem; background: #ecece8; }
.heat--1 { background: #c9d3f1; }
.heat--2 { background: #8ea2e0; }
.heat--3 { background: #4f69c0; }
.heat--4 { background: var(--accent-strong); }
.badges { display: grid; gap: 1rem; }
.badge-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.medal { width: 2.9rem; height: 2.9rem; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--line-strong); color: var(--ink-soft); font-weight: 800; font-size: .85rem; }
.medal.is-earned { border: 0; background: var(--accent-strong); color: #fff; box-shadow: inset 0 0 0 3px var(--gold); }
.medal--stage.is-earned, .medal--final.is-earned { background: var(--gold); color: var(--ink); box-shadow: inset 0 0 0 3px var(--accent-strong); }
.ladder { list-style: none; display: grid; gap: .25rem; margin-top: .75rem; }
.ladder li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .6rem; align-items: center; padding: .45rem .6rem; border-radius: var(--radius); color: var(--ink-soft); }
.ladder li span:first-child { font-weight: 800; }
.ladder li.is-reached { color: var(--ink); }
.ladder li.is-current { background: var(--accent-wash); color: var(--accent); font-weight: 750; }

/* ---------- Einstellungen ---------- */
.day-picker { display: flex; flex-wrap: wrap; gap: .4rem; }
.day { position: relative; }
.day input { position: absolute; opacity: 0; inset: 0; }
.day span { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 50%; border: 1px solid var(--line-strong); font-weight: 700; font-size: .85rem; cursor: pointer; background: var(--white); }
.day input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.day input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  .topbar, .sidenav, .tabbar, .no-print, .toast { display: none !important; }
  .app { display: block; height: auto; }
  .view { overflow: visible; padding: 0; }
  .certificate { border-width: 3px; margin-top: 3cm; }
}

/* ---------- Konten (Admin) ---------- */
.account-list { list-style: none; display: grid; gap: 0; margin-top: .75rem; }
.account-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .85rem 0; border-top: 1px solid var(--line); }
.account-list li:first-child { border-top: 0; }
.account-list li > div { min-width: 0; flex: 1 1 14rem; }
