/* ==========================================================================
   Quantisierung verstehen — Design-System
   Angelehnt ans smartKMU Design System (Open Design, design-tokens.json):
   Blau-Rampe #0279B6/#024E74/#5EA9D0/#BADAEB, Ubuntu, System-Mono.
   Dark-Mode ist eine eigene Ableitung (das DS definiert keinen); Werte, die
   im DS AA verfehlen würden (success, ink.3 als Text), sind abgedunkelt.
   Rückroll-Punkt: git-Tag v1-design-petrol.
   ========================================================================== */

@font-face {
  font-family: 'Ubuntu';
  src: url('../assets/fonts/ubuntu-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Ubuntu';
  src: url('../assets/fonts/ubuntu-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Ubuntu';
  src: url('../assets/fonts/ubuntu-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Ubuntu';
  src: url('../assets/fonts/ubuntu-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --bg: #f7fafc;
  --surface: #ffffff;
  --surface-2: #e6edf3;
  --ink: #1a2733;
  --ink-soft: #434343;
  --muted: #68707e;
  --line: #c9d2dd;
  --accent: #0279b6;
  --accent-strong: #024e74;
  --accent-soft: #deedf6;
  --error: #c0392b;
  --error-soft: #f8e5e1;
  --ok: #187c46;
  --ok-soft: #dff0e6;
  --shadow: 0 1px 3px rgba(2, 46, 74, 0.08), 0 6px 24px rgba(2, 46, 74, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: 'Ubuntu', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Ubuntu', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1620;
    --surface: #142230;
    --surface-2: #1b2c3c;
    --ink: #e6edf3;
    --ink-soft: #c3cfda;
    --muted: #93a3b4;
    --line: #2b3c4e;
    --accent: #5ea9d0;
    --accent-strong: #97c4de;
    --accent-soft: #013a58;
    --error: #ff8f76;
    --error-soft: #3c2019;
    --ok: #74cf9c;
    --ok-soft: #14301f;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

/* --------------------------------------------------------------- Basis --- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); font-weight: 700; }
h2 { font-size: clamp(1.45rem, 3.5vw, 1.8rem); font-weight: 700; margin-top: 2.2em; }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.3rem); font-weight: 700; margin-top: 1.8em; }

p { margin: 0 0 1.1em; max-width: 68ch; }
ul, ol { padding-left: 1.4em; max-width: 66ch; }
li { margin-bottom: 0.45em; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }

strong { color: var(--ink); }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

figure { margin: 1.5em 0; }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.5em; }

img, video { max-width: 100%; height: auto; border-radius: var(--radius); }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff;
  padding: 0.6em 1em; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* -------------------------------------------------------------- Header --- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: 980px; margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.02rem; color: var(--ink); text-decoration: none;
  letter-spacing: -0.01em;
}
.brand svg { display: block; }
.brand:hover { color: var(--accent); }

.progress-nav { margin-left: auto; }
.progress-nav ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 0.4rem; align-items: center;
}
.progress-nav a {
  display: grid; place-items: center;
  width: 1.9rem; height: 1.9rem;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono); font-size: 0.8rem;
  text-decoration: none;
}
.progress-nav a:hover { border-color: var(--accent); color: var(--accent); }
.progress-nav a[aria-current="page"] {
  border-color: var(--accent); background: var(--accent); color: #fff;
  font-weight: 700;
}
@media (prefers-color-scheme: dark) {
  .progress-nav a[aria-current="page"] { color: #0c1620; }
}
.progress-nav a.is-done { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.progress-nav a.is-done[aria-current="page"] { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) {
  .progress-nav a.is-done[aria-current="page"] { color: #0c1620; }
}

/* -------------------------------------------------------------- Layout --- */

main { display: block; }

.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.2rem 1.25rem 4rem;
}
.shell-wide { max-width: 980px; margin: 0 auto; padding: 0 1.25rem; }

.lesson-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.lesson-lead {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 62ch;
}

.lesson-hero-img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 1.4rem 0 0.5rem;
  background: var(--surface-2);
}

/* ---------------------------------------------------------------- Boxen --- */

.box {
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 1.6em 0;
  background: var(--surface);
  border: 1px solid var(--line);
}
.box > :last-child { margin-bottom: 0; }
.box-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 0.98rem;
  display: flex; align-items: center; gap: 0.5em;
  margin-bottom: 0.5em;
}

.box-analogie { background: var(--accent-soft); border-color: transparent; }
.box-analogie .box-title { color: var(--accent-strong); }
.box-limit {
  margin-top: 0.9em; padding-top: 0.8em;
  border-top: 1px dashed color-mix(in srgb, var(--accent) 35%, transparent);
  font-size: 0.95rem; color: var(--ink-soft);
}
.box-limit strong { font-family: var(--font-display); font-size: 0.9rem; }

.box-merke { border-left: 4px solid var(--accent); }
.box-merke .box-title { color: var(--accent); }

.box-exkurs { background: var(--surface-2); border-color: transparent; }

.box-warnung { border-left: 4px solid var(--error); }
.box-warnung .box-title { color: var(--error); }

details.neugier {
  margin: 1.4em 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
details.neugier > summary {
  cursor: pointer;
  padding: 0.75rem 1.1rem;
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  color: var(--accent);
  list-style-position: inside;
}
details.neugier > summary:hover { color: var(--accent-strong); }
details.neugier > .neugier-body { padding: 0.2rem 1.1rem 1rem; }
details.neugier > .neugier-body > :last-child { margin-bottom: 0; }

.quelle {
  font-size: 0.82rem;
  color: var(--muted);
}
.quelle a { color: var(--muted); }
.quelle a:hover { color: var(--accent); }

/* -------------------------------------------------------------- Widgets --- */

.widget {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.4rem 1.4rem;
  margin: 2em 0;
}
.widget-head {
  display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap;
  margin-bottom: 0.3rem;
}
.widget-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.08rem;
  margin: 0;
}
.widget-task {
  font-size: 0.92rem; color: var(--muted); margin: 0 0 1rem;
}
.widget-task::before { content: '→ '; color: var(--accent); }
.widget-reset {
  margin-left: auto;
  font-size: 0.82rem;
}

.controls {
  display: flex; flex-wrap: wrap; gap: 0.9rem 1.6rem;
  align-items: center;
  margin: 0.8rem 0;
}
.control {
  display: flex; flex-direction: column; gap: 0.25rem;
  min-width: 180px; flex: 1 1 200px; max-width: 340px;
}
.control > label {
  font-size: 0.85rem; font-weight: 500; color: var(--ink-soft);
  font-family: var(--font-display);
}
.control output, .readout {
  font-family: var(--font-mono); font-size: 0.9rem; color: var(--ink);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 1.6rem;
  margin: 0;
}

select, input[type="text"] {
  font: inherit;
  padding: 0.4em 0.6em;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  max-width: 100%;
}

.btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  padding: 0.55em 1.3em;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: transform 80ms ease, background 120ms ease;
}
@media (prefers-color-scheme: dark) {
  .btn { color: #0c1620; }
}
.btn:hover { background: var(--accent-strong); }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-strong); }
.btn-small { font-size: 0.82rem; padding: 0.4em 1em; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.stat-row { display: flex; flex-wrap: wrap; gap: 1.2rem 2.4rem; margin: 1rem 0; }
.stat { min-width: 130px; }
.stat .stat-label { font-size: 0.8rem; color: var(--muted); font-family: var(--font-display); font-weight: 500; }
.stat .stat-value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.stat .stat-value.is-accent { color: var(--accent); }
.stat .stat-value.is-error { color: var(--error); }
.stat .stat-sub { font-size: 0.8rem; color: var(--muted); }

.fit-list { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.35rem; max-width: none; }
.fit-list li {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.92rem; margin: 0;
  padding: 0.35rem 0.6rem; border-radius: var(--radius-sm);
}
.fit-list .fit-icon { font-family: var(--font-mono); font-weight: 700; width: 1.2em; text-align: center; }
.fit-list li.fits { background: var(--ok-soft); color: var(--ok); }
.fit-list li.fits-not { background: var(--error-soft); color: var(--error); }
.fit-list .fit-mem { margin-left: auto; font-family: var(--font-mono); font-size: 0.85rem; opacity: 0.85; }

canvas.widget-canvas { width: 100%; height: auto; border-radius: var(--radius-sm); background: var(--surface-2); touch-action: none; }
svg.widget-svg { width: 100%; height: auto; display: block; }

.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.3rem; font-size: 0.83rem; color: var(--muted); margin-top: 0.6rem; }
.legend .swatch { display: inline-block; width: 0.85em; height: 0.85em; border-radius: 3px; margin-right: 0.4em; vertical-align: -0.08em; }

/* ------------------------------------------------------- Karten-Galerie --- */

.card-grid {
  display: grid; gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin: 1.5em 0;
}
.method-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.method-card > button {
  all: unset;
  display: block; width: 100%; box-sizing: border-box;
  padding: 0.95rem 1.1rem;
  cursor: pointer;
}
.method-card > button:hover { background: var(--surface-2); }
.method-card > button:focus-visible { outline: 2.5px solid var(--accent); outline-offset: -3px; }
.method-card .mc-name { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; display: flex; align-items: center; gap: 0.5rem; }
.method-card .mc-name::after { content: '+'; margin-left: auto; font-family: var(--font-mono); color: var(--accent); font-size: 1.1rem; }
.method-card.is-open .mc-name::after { content: '−'; }
.method-card .mc-meta { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); margin-top: 0.2rem; }
.method-card .mc-body { padding: 0 1.1rem 1rem; font-size: 0.93rem; display: none; }
.method-card.is-open .mc-body { display: block; }
.method-card .mc-body p { margin-bottom: 0.6em; }

/* ------------------------------------------------------------ Zeitstrahl --- */

.timeline { list-style: none; margin: 1.5em 0; padding: 0; position: relative; max-width: none; }
.timeline::before {
  content: ''; position: absolute; left: 0.55rem; top: 0.4rem; bottom: 0.4rem;
  width: 2px; background: var(--line);
}
.timeline > li { position: relative; padding: 0 0 0.4rem 2.2rem; margin: 0 0 0.6rem; }
.timeline > li::before {
  content: ''; position: absolute; left: 0.15rem; top: 0.5rem;
  width: 0.85rem; height: 0.85rem; border-radius: 3px;
  background: var(--accent); border: 2px solid var(--bg);
}
.timeline .tl-year { font-family: var(--font-mono); font-weight: 700; color: var(--accent); font-size: 0.85rem; }
.timeline details summary {
  cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  padding: 0.15rem 0;
}
.timeline details summary:hover { color: var(--accent); }
.timeline .tl-body { font-size: 0.93rem; color: var(--ink-soft); padding: 0.3rem 0 0.5rem; max-width: 60ch; }
.timeline .tl-body p { margin-bottom: 0.5em; }

/* ----------------------------------------------------------------- Quiz --- */

.quiz {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin: 2.5em 0 1em;
}
.quiz-header { display: flex; align-items: baseline; gap: 0.8rem; margin-bottom: 1rem; }
.quiz-header h2, .quiz-header h3 { margin: 0; font-size: 1.25rem; }
.quiz-count { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); }

.quiz fieldset {
  border: 0; padding: 1.1rem 0; margin: 0;
  border-top: 1px solid var(--line);
}
.quiz fieldset:first-of-type { border-top: 0; padding-top: 0.3rem; }
.quiz legend, .q-question {
  font-family: var(--font-display); font-weight: 700; font-size: 1.02rem;
  padding: 0 0 0.6rem; color: var(--ink);
  max-width: 62ch;
}
.q-options { display: grid; gap: 0.45rem; margin: 0.2rem 0 0.8rem; }
.q-option {
  display: flex; gap: 0.65rem; align-items: flex-start;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.97rem;
  transition: border-color 100ms ease;
}
.q-option:hover { border-color: var(--accent); }
.q-option input { margin-top: 0.3em; accent-color: var(--accent); flex-shrink: 0; }
.q-option.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.q-option.is-wrong { border-color: var(--error); background: var(--error-soft); }
.q-option.is-missed { border-color: var(--ok); border-style: dashed; }
.q-option input:disabled { cursor: default; }
.q-option:has(input:disabled) { cursor: default; }
.q-option:has(input:disabled):hover { border-color: var(--line); }
.q-option.is-correct:hover { border-color: var(--ok); }
.q-option.is-wrong:hover { border-color: var(--error); }

.q-why { display: grid; gap: 0.4rem; margin: 0.6rem 0 0.2rem; }
.q-why > div {
  font-size: 0.9rem; padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink-soft);
}
.q-why > div.why-correct { background: var(--ok-soft); color: var(--ok); }
.q-why > div strong { color: inherit; }

.q-feedback { font-weight: 500; font-size: 0.95rem; margin: 0.4rem 0; }
.q-feedback.is-ok { color: var(--ok); }
.q-feedback.is-nope { color: var(--error); }

.quiz-summary {
  margin-top: 1.2rem; padding: 1rem 1.2rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-family: var(--font-display); font-weight: 700;
}
.quiz-summary .qs-links { font-family: var(--font-body); font-weight: 400; font-size: 0.92rem; margin-top: 0.4rem; }

/* --------------------------------------------------------------- Karten --- */

.lesson-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin: 2rem 0; }
.lesson-card {
  display: flex; flex-direction: column; gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem 1.2rem;
  text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 120ms ease, border-color 120ms ease;
}
.lesson-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.lesson-card .lc-number {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent);
  display: flex; align-items: center; gap: 0.5rem;
}
.lesson-card .lc-done { color: var(--ok); font-weight: 700; }
.lesson-card .lc-title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; line-height: 1.3; }
.lesson-card .lc-desc { font-size: 0.9rem; color: var(--muted); }

/* ------------------------------------------------------------ Audio-Box --- */

.audio-box {
  display: flex; flex-direction: column; gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 1.5rem 0 2rem;
}
.audio-box .ab-label {
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
  color: var(--accent);
}
.audio-box audio { width: 100%; }
.audio-box details { font-size: 0.9rem; }
.audio-box summary { cursor: pointer; color: var(--muted); }
.audio-box .transcript { color: var(--ink-soft); padding-top: 0.5rem; max-width: 65ch; }

.video-figure video { width: 100%; border-radius: var(--radius); background: #000; }

/* ------------------------------------------------------------ Navigation --- */

.lesson-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.lesson-nav a {
  display: flex; flex-direction: column; gap: 0.15rem;
  text-decoration: none;
  max-width: 46%;
}
.lesson-nav .ln-dir { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.lesson-nav .ln-title { font-family: var(--font-display); font-weight: 700; color: var(--accent); }
.lesson-nav a:hover .ln-title { color: var(--accent-strong); text-decoration: underline; }
.lesson-nav .ln-next { margin-left: auto; text-align: right; }

/* ---------------------------------------------------------------- Badge --- */

.badge-panel {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: var(--radius);
  background: var(--accent-soft);
  margin: 2rem 0;
}
.badge-panel .badge-icon { margin: 0 auto 1rem; width: 96px; }
.badge-panel h3 { margin-top: 0; }

/* --------------------------------------------------------------- Tabellen --- */

table { border-collapse: collapse; width: 100%; margin: 1.4em 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.55em 0.8em; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-display); font-weight: 700; font-size: 0.88rem; color: var(--ink-soft); }
td:first-child { white-space: nowrap; }

/* ---------------------------------------------------------------- Footer --- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.25rem 3rem;
  text-align: center;
  font-size: 0.85rem; color: var(--muted);
}
.site-footer p { margin: 0 auto 0.4em; max-width: none; }
.site-footer .footer-nav {
  display: flex; justify-content: center; align-items: center;
  gap: 0.7em; flex-wrap: wrap;
  margin-bottom: 1.4em;
  font-family: var(--font-display); font-size: 0.9rem;
}
.site-footer .footer-nav a { text-decoration: none; }
.site-footer .footer-nav a:hover { text-decoration: underline; }
.site-footer .footer-nav span { color: var(--line); }
.site-footer .footer-logo { display: inline-block; margin-bottom: 0.6em; }
.site-footer .footer-logo img { width: 28px; height: 28px; display: block; border-radius: 0; }
.site-footer .footer-logo:hover { opacity: 0.75; }
.site-footer .footer-brand {
  font-family: var(--font-display);
  font-size: 0.95rem; font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 0.8em;
}
.site-footer .footer-brand a { font-weight: 700; text-decoration: none; }
.site-footer .footer-brand a:hover { text-decoration: underline; }

/* ---------------------------------------- Quellen / Glossar / Settings --- */

.chip {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.72rem;
  background: var(--accent-soft); color: var(--accent-strong);
  border-radius: 999px; padding: 0.1em 0.7em;
  text-decoration: none; white-space: nowrap;
}
.chip:hover { background: var(--accent); color: #fff; }

.quellen-hinweis { color: var(--muted); font-size: 0.92rem; margin-top: -0.4em; }
.quellen-liste { list-style: none; padding: 0; max-width: none; }
.quellen-liste li {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0.85rem 1.1rem; margin-bottom: 0.7rem;
}
.quellen-liste li > a { font-weight: 700; font-family: var(--font-display); }
.quellen-jahr { color: var(--muted); font-size: 0.9rem; }
.quellen-liste li p { margin: 0.3em 0 0; max-width: none; font-size: 0.95rem; }
.quellen-liste .quellen-chips { margin-top: 0.5em; }
.quellen-chips { display: inline-flex; gap: 0.35em; flex-wrap: wrap; }

.glossar { max-width: 68ch; }
.glossar dt {
  font-family: var(--font-display); font-weight: 700;
  margin-top: 1.3em; color: var(--ink);
}
.glossar dd { margin: 0.25em 0 0; color: var(--ink-soft); }
.glossar dd .quellen-chips { margin-left: 0.3em; }

.settings-status {
  list-style: none; padding: 1rem 1.2rem; max-width: none;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
}
.settings-status li { margin-bottom: 0.4em; }
.settings-status li:last-child { margin-bottom: 0; }
.settings-reset { display: flex; align-items: center; gap: 0.8em; flex-wrap: wrap; }
.settings-confirm { display: inline-flex; align-items: center; gap: 0.6em; flex-wrap: wrap; }
.settings-confirm[hidden], .settings-reset .btn[hidden] { display: none; }

.prompt-quote {
  margin: 1.2em 0; padding: 1rem 1.3rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface);
  color: var(--ink-soft);
  font-style: italic;
  max-width: none;
}
.prompt-pre {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.82rem; line-height: 1.55;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  max-height: 65vh; overflow: auto;
}
.settings-feedback { color: var(--ok); font-weight: 500; min-height: 1.4em; }

/* ------------------------------------------------------------- Diverses --- */

.decoder-name {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  font-family: var(--font-mono); font-size: clamp(0.85rem, 2.4vw, 1.05rem);
  margin: 1rem 0;
}
.decoder-name button {
  all: unset;
  padding: 0.35em 0.5em;
  border-radius: 6px;
  background: var(--surface-2);
  cursor: pointer;
  border: 1.5px solid transparent;
}
.decoder-name button:hover { border-color: var(--accent); }
.decoder-name button:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 1px; }
.decoder-name button.is-active { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) {
  .decoder-name button.is-active { color: #0c1620; }
}
.decoder-panel {
  min-height: 4.5em;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.94rem;
}
.decoder-panel > :last-child { margin-bottom: 0; }

.example-output {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  margin: 0.8rem 0;
  font-size: 0.93rem;
  background: var(--surface-2);
}
.example-output .eo-label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); display: block; margin-bottom: 0.3rem; }

.anim-controls { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.8rem 0; }
.anim-caption {
  min-height: 3.2em;
  font-size: 0.95rem; color: var(--ink-soft);
  padding: 0.6rem 0.9rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-top: 0.8rem;
}

/* Skalierung kleiner Screens */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .site-header-inner { padding: 0.5rem 0.9rem; gap: 0.5rem; }
  .progress-nav a { width: 1.65rem; height: 1.65rem; font-size: 0.72rem; }
  .shell { padding: 1.6rem 1rem 3rem; }
  .widget { padding: 1rem 1rem 1.1rem; margin-left: -0.25rem; margin-right: -0.25rem; }
  .lesson-nav a { max-width: 48%; }
  td:first-child { white-space: normal; }
  table { display: block; overflow-x: auto; }
}

/* Reduzierte Bewegung: alles Wesentliche bleibt ohne Animation nutzbar */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
