/* ── Variables ── */
:root {
  --accent: #25ae7c;
  --accent-dark: #1d9268;
  --accent-light: #e8f8f2;
  --accent-xlight: #f0fdf8;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e2e6ea;
  --text-1: #1a2332;
  --text-2: #5a6677;
  --text-3: #9aa3b0;
  --red: #e74c3c;
  --red-light: #fde8e8;
  --orange: #f39c12;
  --orange-light: #fff3d6;
  --sidebar-w: 280px;
  --header-h: 64px;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(0,0,0,0.08);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Header ── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  font-size: 16px; /* Anker: skaliert nicht mit der Root-Schriftgröße */
}
.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 20px;
  gap: 16px;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 100%;
  min-width: 18px;
  height: 2px;
  min-height: 2px;
  background: #1a2332;
  background: var(--text-1, #1a2332);
  border-radius: 2px;
  transition: all 0.3s;
  flex: 0 0 auto;
}
.hamburger span + span { margin-top: 5px; }
.hamburger:hover { background: var(--accent-light); }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-1) !important;
  text-decoration: none !important;
  min-width: 0;
}
.logo-img {
  display: block;
  width: 174px;
  max-width: 34vw;
  height: auto;
  flex-shrink: 0;
}
.logo-sub { font-weight: 700; color: var(--text-2); font-size: 0.85em; white-space: nowrap; }

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  min-width: 0;
}
.font-size-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
}
.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.acting-switch {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-shrink: 1;
  padding: 10px 12px 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(37, 174, 124, 0.14);
  background:
    radial-gradient(circle at top left, rgba(37, 174, 124, 0.14), transparent 45%),
    linear-gradient(135deg, #f7fbf9 0%, #eef7f3 100%);
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.08);
}
.acting-switch.is-active {
  border-color: rgba(37, 174, 124, 0.3);
  background:
    radial-gradient(circle at top left, rgba(37, 174, 124, 0.2), transparent 50%),
    linear-gradient(135deg, #eefaf4 0%, #e2f6ec 100%);
}
.acting-switch-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.acting-switch-kicker {
  font-size: 0.68rem;
  font-weight: 900;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.acting-switch-state {
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--text-1);
  white-space: nowrap;
}
.acting-switch-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.acting-switch-controls select {
  min-width: 240px;
  max-width: 280px;
  padding: 9px 12px;
  border: 1px solid rgba(20, 79, 58, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-1);
  font-size: 0.84rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.acting-switch-end {
  border: 1px solid rgba(231, 76, 60, 0.18);
  border-radius: 12px;
  background: #fff;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 9px 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
}
.acting-switch-end:hover {
  background: var(--red-light);
  border-color: rgba(231, 76, 60, 0.3);
}
.acting-sync-btn {
  border: 1px solid rgba(37, 174, 124, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 9px 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
}
.acting-sync-btn:hover {
  background: var(--accent-light);
  border-color: rgba(37, 174, 124, 0.34);
}
.acting-sync-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.user-name {
  font-weight: 700;
  font-size: 0.88em;
  color: var(--text-2);
}
.btn-header-link {
  font-size: 0.82em;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  padding: 5px 12px;
  border-radius: 6px;
  text-decoration: none !important;
  transition: background .15s;
}
.btn-header-link:hover { background: #c8f0e0; }
.btn-header-logout {
  font-size: 0.82em;
  font-weight: 700;
  color: var(--text-2);
  background: none;
  border: 1.5px solid var(--border);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.btn-header-logout:hover { border-color: var(--red); color: var(--red); }
.fs-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-weight: 800;
  font-size: 0.88em;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}
.fs-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.fs-btn:disabled { opacity: 0.35; cursor: default; }

/* ── Wortarten neue UI ── */
.wa-progress {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.wa-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
  flex-shrink: 0;
}
.wa-dot.done { background: var(--accent); }
.wa-dot.active { background: var(--accent); box-shadow: 0 0 0 3px rgba(37,174,124,0.25); }
.wa-prog-text { font-size: 0.85rem; color: var(--text-3); font-weight: 600; margin-left: 4px; }
.wa-timer-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--orange-light);
  color: var(--orange);
  font-size: 0.8rem;
  font-weight: 800;
}
.wa-timer-badge.is-expired {
  background: var(--red-light);
  color: var(--red);
}

.wa-inline-result {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  vertical-align: middle;
}
.wa-inline-richtig { background: var(--accent-light); color: var(--accent-dark); }
.wa-inline-falsch  { background: var(--red-light); color: var(--red); }

.wa-hinweis {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--orange-light);
  border-left: 3px solid var(--orange);
  border-radius: 8px;
  font-size: 0.9rem;
}
.wa-hinweis-titel { font-weight: 700; color: var(--text-1); margin-bottom: 4px; }
.wa-hinweis-detail { color: var(--text-2); line-height: 1.5; }

/* ── Layout ── */
.layout {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

body.focus-exercise-mode .header,
body.focus-exercise-mode .sidebar,
body.focus-exercise-mode .sidebar-overlay,
body.focus-exercise-mode .site-footer {
  display: none !important;
}

body.focus-exercise-mode .layout {
  padding-top: 0;
}

body.focus-exercise-mode .main {
  margin-left: 0;
  min-height: 100vh;
}

body.focus-exercise-mode .content-area {
  padding-top: 28px;
  padding-bottom: 56px;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  overflow: hidden;
  z-index: 90;
  transition: transform 0.3s ease;
  font-size: 16px;
  display: flex;
  flex-direction: column;
}
.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 8px 16px;
}
.sidebar-footer {
  flex-shrink: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.sf-user { display: flex; flex-direction: column; gap: 6px; }
.sf-name { font-size: 0.88em; font-weight: 700; color: var(--text-2); padding: 2px 0; }
.sf-admin-link {
  display: block;
  font-size: 0.82em; font-weight: 700;
  color: var(--accent); background: var(--accent-light);
  padding: 6px 12px; border-radius: 6px;
  text-align: center; text-decoration: none !important;
  transition: background .15s;
}
.sf-admin-link:hover { background: #c8f0e0; }
.sf-nav-link {
  display: block;
  font-size: 0.82em;
  font-weight: 700;
  color: var(--text-2);
  background: #f5f7fa;
  padding: 6px 12px;
  border-radius: 6px;
  text-align: center;
  text-decoration: none !important;
}
.sf-nav-link:hover { color: var(--accent); background: var(--accent-light); }
.sf-acting-card {
  display: none;
  gap: 10px;
  margin-top: 4px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(37, 174, 124, 0.14);
  background:
    radial-gradient(circle at top left, rgba(37, 174, 124, 0.16), transparent 45%),
    linear-gradient(135deg, #f8fbfa 0%, #f1f8f4 100%);
}
.sf-acting-card.is-active {
  border-color: rgba(37, 174, 124, 0.28);
  background:
    radial-gradient(circle at top left, rgba(37, 174, 124, 0.2), transparent 48%),
    linear-gradient(135deg, #effaf4 0%, #e3f6ec 100%);
}
.sf-acting-copy {
  display: grid;
  gap: 2px;
}
.sf-acting-kicker {
  font-size: 0.68rem;
  font-weight: 900;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sf-acting-state {
  font-size: 0.92rem;
  color: var(--text-1);
}
.sf-acting-controls {
  display: grid;
  gap: 8px;
}
.sf-acting-controls select {
  width: 100%;
  border: 1px solid rgba(20, 79, 58, 0.12);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-1);
  font-size: 0.84em;
  font-weight: 800;
}
.sf-acting-sync {
  border: 1px solid rgba(37, 174, 124, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent-dark);
  font-size: 0.82em;
  font-weight: 800;
  padding: 8px 10px;
  font-family: inherit;
  cursor: pointer;
}
.sf-acting-sync:hover {
  background: var(--accent-light);
}
.sf-acting-sync:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.sf-acting-end {
  border: 1px solid rgba(231, 76, 60, 0.18);
  border-radius: 10px;
  background: #fff;
  color: var(--red);
  font-size: 0.82em;
  font-weight: 800;
  padding: 8px 10px;
}
.sf-acting-end:hover {
  background: var(--red-light);
}
.sf-logout {
  font-size: 0.82em; font-weight: 700;
  color: var(--text-2); background: none;
  border: 1.5px solid var(--border);
  padding: 6px 12px; border-radius: 6px;
  cursor: pointer; font-family: inherit;
  transition: all .15s; text-align: center;
}
.sf-logout:hover { border-color: var(--red); color: var(--red); }
.sf-login {
  display: block; width: 100%;
  padding: 8px 12px;
  background: var(--accent); color: white;
  border: none; border-radius: 8px;
  font-size: 0.88em; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.sf-login:hover { background: var(--accent-dark); }
.sf-impressum {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-size: 0.78em;
  font-weight: 700;
  color: var(--text-3);
  text-decoration: none !important;
}
.sf-impressum:hover { color: var(--accent); }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 89;
}
.sidebar-overlay.show { display: block; }

/* ── Nav Tree ── */
.nav-tree { display: flex; flex-direction: column; gap: 4px; }

.nav-fach { }
.nav-fach-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95em;
  color: var(--text-1);
  text-align: left;
  transition: background 0.15s;
}
.nav-fach-btn:hover { background: var(--accent-light); }
.nav-fach-icon { font-size: 1.1em; flex-shrink: 0; }
.nav-fach-titel { flex: 1; }
.nav-chevron { font-size: 0.75em; color: var(--text-3); transition: transform 0.2s; }

.nav-themen { padding-left: 8px; margin-top: 2px; }
.nav-thema { margin-bottom: 2px; }
.nav-thema-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  font-size: 0.88em;
  font-weight: 600;
  color: var(--text-2);
  text-align: left;
  transition: background 0.15s;
}
.nav-thema-btn:hover { background: var(--bg); }
.nav-thema-btn span:first-child { flex: 1; }

.nav-seiten { padding-left: 12px; margin-top: 2px; }
.nav-seite-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.84em;
  font-weight: 500;
  color: var(--text-2);
  transition: all 0.15s;
  position: relative;
}
.nav-seite-link:hover {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}
.nav-seite-link.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
}
.nav-seite-icon { font-size: 0.8em; flex-shrink: 0; }
.nav-done-badge {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.8em;
  margin-left: auto;
}

/* ── Main content ── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
}
.content-area {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 32px 100px;
  width: 100%;
  flex: 1;
}
.site-footer {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px 28px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-3);
}
.site-footer a {
  color: var(--text-3);
  text-decoration: none;
}
.site-footer a:hover { color: var(--accent); text-decoration: underline; }

/* ── Spinner ── */
.spinner-wrap {
  display: flex;
  justify-content: center;
  padding: 100px 0;
}
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-3);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }

/* ── Page header ── */
.page-header { margin-bottom: 36px; }
.page-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-1);
  line-height: 1.2;
  margin-bottom: 10px;
}
.page-info {
  color: var(--text-2);
  margin-top: 10px;
  font-size: 0.97rem;
}
.badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

/* ── Prose (Lernseite) ── */
.lernseite { }
.prose { max-width: 720px; }
.prose h1 { font-size: 1.85rem; font-weight: 900; margin: 0 0 24px; color: var(--accent-dark); }
.prose h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 40px 0 16px;
  color: var(--text-1);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-light);
}
.prose h3 { font-size: 1.1rem; font-weight: 700; margin: 28px 0 12px; color: var(--text-2); }
.prose p { margin-bottom: 16px; line-height: 1.8; }
.prose ul, .prose ol { margin: 16px 0 16px 24px; }
.prose li { margin-bottom: 8px; line-height: 1.7; }
.prose strong { color: var(--text-1); font-weight: 700; }
.prose em { color: var(--accent-dark); font-style: italic; }
.prose code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.88em;
}
.prose table { width: 100%; border-collapse: collapse; margin: 20px 0; border-radius: var(--radius); overflow: hidden; }
.prose th { background: var(--accent-light); padding: 12px 16px; text-align: left; font-weight: 700; color: var(--accent-dark); }
.prose td { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.prose tr:last-child td { border-bottom: none; }
.prose blockquote { border-left: 4px solid var(--accent); padding-left: 16px; color: var(--text-2); font-style: italic; margin: 16px 0; }

/* ── Callout boxes ── */
.callout {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  border-left: 4px solid;
}
.callout-title {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 0.95rem;
  letter-spacing: 0.2px;
}
.callout-body {
  font-size: 0.93rem;
  line-height: 1.7;
}
.callout-body p { margin: 0; }
.callout-info { background: #ebf5fb; border-color: #3498db; }
.callout-info .callout-title { color: #1a6fa8; }
.callout-example { background: #eafaf1; border-color: #27ae60; }
.callout-example .callout-title { color: #1e8449; }
.callout-tip { background: #fef9e7; border-color: #f39c12; }
.callout-tip .callout-title { color: #b7770d; }
.callout-wichtig { background: #fdedec; border-color: #e74c3c; }
.callout-wichtig .callout-title { color: #c0392b; }
.callout-merkregel { background: #f5eef8; border-color: #9b59b6; }
.callout-merkregel .callout-title { color: #6c3483; }
.callout-definition { background: var(--accent-xlight); border-color: var(--accent); }
.callout-definition .callout-title { color: var(--accent-dark); }

/* ── Home ── */
.home-hero {
  text-align: center;
  padding: 56px 0 44px;
}
.home-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--text-1);
  margin-bottom: 14px;
}
.home-title strong { color: var(--accent); }
.home-subtitle { font-size: 1.15rem; color: var(--text-2); }

.fach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 36px;
}
.fach-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.2s;
  color: var(--text-1);
  text-decoration: none !important;
  box-shadow: var(--shadow);
}
.fach-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37,174,124,0.15);
}
.fach-card-icon { font-size: 2.6rem; flex-shrink: 0; }
.fach-card-content { flex: 1; min-width: 0; }
.fach-card-titel { font-size: 1.25rem; font-weight: 800; margin-bottom: 6px; }
.fach-card-desc { font-size: 0.87rem; color: var(--text-2); margin-bottom: 10px; line-height: 1.5; }
.fach-card-stats { font-size: 0.8rem; color: var(--text-3); font-weight: 600; }
.fach-card-arrow { color: var(--accent); font-size: 1.4rem; font-weight: 700; align-self: center; flex-shrink: 0; }

/* ── Fachansichten ── */
.subject-shell {
  display: grid;
  gap: 22px;
  margin-bottom: 40px;
}

.subject-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  padding: 24px 26px;
  border: 1px solid rgba(37, 174, 124, 0.16);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(37, 174, 124, 0.15), transparent 34%),
    linear-gradient(135deg, #f8fcfa 0%, #eef8f3 100%);
}

.subject-hero-compact {
  padding: 20px 22px;
}

.subject-hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(37, 174, 124, 0.14);
  box-shadow: 0 10px 26px rgba(37, 174, 124, 0.12);
}

.subject-hero-copy {
  min-width: 0;
}

.subject-kicker {
  margin-bottom: 8px;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.subject-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.subject-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(37, 174, 124, 0.14);
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 800;
}

.subject-switch {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  width: fit-content;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.subject-switch-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  color: var(--text-2);
  font-weight: 800;
  text-decoration: none !important;
  transition: all .15s ease;
}

.subject-switch-link:hover {
  color: var(--accent-dark);
  background: var(--accent-xlight);
}

.subject-switch-link.is-active {
  background: var(--accent);
  color: #fff;
}

.subject-panel {
  display: grid;
  gap: 18px;
}

.subject-panel-head {
  display: grid;
  gap: 6px;
}

.subject-panel-head h2 {
  margin: 0;
  font-size: 1.18rem;
}

.subject-panel-head p {
  margin: 0;
  color: var(--text-2);
}

.subject-filter-bar {
  display: flex;
  justify-content: flex-start;
}

.subject-filter {
  display: grid;
  gap: 6px;
  min-width: min(260px, 100%);
  font-weight: 800;
  color: var(--text-1);
}

.subject-filter span {
  font-size: 0.9rem;
}

.subject-filter select {
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(20, 79, 58, 0.12);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-1);
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.subject-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.subject-topic-card,
.subject-content-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  text-decoration: none !important;
  color: var(--text-1);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.subject-topic-card {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.subject-topic-card:hover,
.subject-content-row:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 174, 124, 0.42);
  box-shadow: 0 14px 30px rgba(37, 174, 124, 0.12);
}

.subject-topic-meta {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.subject-topic-card h3,
.subject-list-group-head h3 {
  margin: 0;
  font-size: 1.08rem;
}

.subject-topic-card p {
  margin: 0;
  color: var(--text-2);
  line-height: 1.55;
}

.subject-topic-link {
  color: var(--accent);
  font-weight: 800;
}

.subject-list-groups {
  display: grid;
  gap: 18px;
}

.subject-list-group {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
}

.subject-list-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.subject-list-group-head a {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.subject-list {
  display: grid;
  gap: 12px;
}

.subject-content-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.subject-content-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.subject-content-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.subject-content-icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}

.subject-content-copy strong {
  font-size: 0.98rem;
}

.subject-content-copy span {
  color: var(--text-2);
  font-size: 0.88rem;
}

.subject-type-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-xlight);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 900;
}

.subject-filter-empty {
  margin: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.history-list {
  display: grid;
  gap: 16px;
}

.history-list-section {
  display: grid;
  gap: 18px;
}

.history-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border: 1px solid rgba(37, 174, 124, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(37, 174, 124, 0.14), transparent 42%),
    linear-gradient(135deg, #f8fcfa 0%, #eef8f3 100%);
}

.history-list-copy {
  display: grid;
  gap: 6px;
  max-width: 560px;
}

.history-list-copy h2 {
  margin: 0;
  font-size: 1.08rem;
}

.history-list-copy p {
  margin: 0;
  color: var(--text-2);
  font-size: .95rem;
}

.history-list-tools {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.history-list-count {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(37, 174, 124, 0.16);
  color: var(--accent-dark);
  font-size: .92rem;
  font-weight: 800;
  white-space: nowrap;
}

.history-list-filter {
  display: grid;
  gap: 6px;
  min-width: min(280px, 100%);
  font-weight: 700;
  color: var(--text-1);
}

.history-list-filter span {
  font-size: .9rem;
}

.history-list-filter select {
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(20, 79, 58, 0.12);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-1);
  font-size: .95rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.history-list-empty {
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: var(--accent-xlight);
  color: var(--text-2);
  text-align: center;
  font-weight: 700;
}

.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.history-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.history-card-copy {
  min-width: 0;
}

.history-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.history-card-topline {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.history-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .02em;
}

.history-card h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.history-meta,
.history-preview,
.history-preview-ok {
  color: var(--text-2);
  font-size: .95rem;
}

.history-score {
  margin: 12px 0;
  font-weight: 700;
}

.history-settings {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: .92rem;
  line-height: 1.45;
}

.history-preview ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

.history-preview .history-context {
  list-style: none;
  margin-left: -20px;
  font-weight: 700;
  color: var(--text);
}

.history-more {
  margin-top: 8px;
}

.history-more summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 700;
}

.history-more[open] summary {
  margin-bottom: 6px;
}

.history-wrong-list-extra {
  margin-top: 0;
}

.history-analytics-panel {
  margin-bottom: 18px;
}

.analytics-panel {
  display: grid;
  gap: 18px;
}

.analytics-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.analytics-filter {
  display: grid;
  gap: 6px;
  min-width: min(260px, 100%);
  font-weight: 700;
  color: var(--text);
}

.analytics-filter span {
  font-size: .92rem;
}

.analytics-filter select {
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.analytics-kpi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.analytics-kpi span {
  display: block;
  color: var(--text-2);
  font-size: .82rem;
  margin-bottom: 4px;
}

.analytics-kpi strong {
  font-size: 1.05rem;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.analytics-chart-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 18px 16px;
  background: #fff;
}

.analytics-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
}

.analytics-chart-head h3,
.analytics-chart-head h4 {
  margin: 0;
  font-size: 1.05rem;
}

.analytics-chart-head span,
.analytics-note,
.analytics-empty,
.analytics-loading {
  color: var(--text-2);
  font-size: .92rem;
}

.analytics-chart-shell {
  position: relative;
  padding-top: 4px;
}

.analytics-chart-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, calc(-100% - 14px));
  min-width: 180px;
  max-width: min(320px, calc(100% - 8px));
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(18, 26, 38, 0.94);
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  pointer-events: none;
  z-index: 2;
}

.analytics-chart-tooltip[hidden] {
  display: none !important;
}

.analytics-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.analytics-grid-line {
  stroke: color-mix(in srgb, var(--border) 80%, white);
  stroke-width: 1;
}

.analytics-axis-line {
  stroke: var(--border);
  stroke-width: 1.2;
}

.analytics-axis-label {
  fill: var(--text-2);
  font-size: 12px;
}

.analytics-point-dot {
  transition: opacity .15s ease;
}

.analytics-point-hit {
  cursor: pointer;
}

.analytics-point-hit:focus {
  outline: none;
}

.analytics-point-hit.is-active + .analytics-point-dot,
.analytics-point-hit.is-active {
  opacity: 1;
}

.analytics-active-line {
  stroke: color-mix(in srgb, var(--chart-accent) 50%, var(--border));
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
  opacity: .9;
}

.analytics-active-dot {
  fill: #fff;
  stroke: var(--chart-accent);
  stroke-width: 3;
  filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.18));
}

@media (max-width: 640px) {
  .analytics-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .analytics-chart-card {
    padding: 16px 14px 14px;
  }
  .analytics-chart-tooltip {
    min-width: 150px;
    max-width: min(260px, calc(100% - 8px));
    font-size: .78rem;
  }
  .history-list-toolbar {
    padding: 16px;
  }
  .history-list-tools,
  .history-list-filter {
    width: 100%;
  }
  .history-list-count {
    min-height: 40px;
  }
  .history-card-head {
    flex-direction: column;
  }
  .history-card-actions {
    width: 100%;
    align-items: stretch;
  }
}
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }

/* ── Exercise base ── */
.exercise { position: relative; }
.exercise-hint {
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: 20px;
  font-style: italic;
  background: var(--bg);
  padding: 10px 14px;
  border-radius: 8px;
}
.zf-settings-note.is-error {
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fda29b;
}
.exercise-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.exercise-actions > .btn[id*="settings"]:not(:only-child) {
  margin-left: auto;
}
@media (max-width: 420px) {
  .exercise-actions {
    gap: 8px;
    margin-top: 20px;
  }
  .exercise-actions .btn {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}
@media (max-width: 360px) {
  .exercise-actions {
    gap: 6px;
  }
  .exercise-actions .btn {
    padding: 7px 10px;
    font-size: 0.86rem;
  }
}

/* ── Result cards ── */
.result-card {
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-top: 28px;
  text-align: center;
  border: 2px solid;
}
.result-perfect {
  background: linear-gradient(135deg, var(--accent-light), #c8f0e0);
  border-color: var(--accent);
}
.result-good { background: var(--orange-light); border-color: var(--orange); }
.result-retry { background: var(--red-light); border-color: var(--red); }
.result-score { font-size: 1.7rem; font-weight: 900; margin-bottom: 8px; }
.result-msg { font-size: 1.05rem; color: var(--text-2); }

/* ── Lösungspanel ── */
.btn-loes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-2);
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-loes:hover { border-color: var(--orange); color: var(--orange); }

.loesung-panel {
  margin-top: 12px;
  background: #fffdf5;
  border: 1.5px solid var(--orange);
  border-radius: var(--radius);
  padding: 20px;
  animation: fadeSlide 0.2s ease;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.loesung-kopf {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.loesung-liste { display: flex; flex-direction: column; gap: 6px; }
.loes-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 9px 12px;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.loes-top { display: flex; align-items: center; gap: 10px; }
.loes-detail {
  font-size: 0.83rem;
  color: var(--text-2);
  line-height: 1.5;
  padding: 6px 0 0 30px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}
.loes-nr { font-size: 0.8rem; font-weight: 700; color: var(--text-3); min-width: 22px; }
.loes-wort { font-weight: 800; font-size: 1rem; color: var(--accent-dark); min-width: 90px; }
.loes-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 10px;
  white-space: nowrap;
}
.loes-gross { background: #dbeafe; color: #1e40af; }
.loes-klein { background: #f1f5f9; color: #475569; }
.loes-erkl {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--orange-light);
  border-left: 3px solid var(--orange);
  border-radius: 0 8px 8px 0;
  font-size: 0.88rem;
  color: var(--text-1);
  line-height: 1.55;
}

/* ── Lückentext ── */
.luecken-body { font-size: 1.1rem; line-height: 2.4; }
.luecken-body p { margin-bottom: 16px; }
.luecken-input {
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 1em;
  font-family: inherit;
  width: 130px;
  outline: none;
  transition: all 0.2s;
  background: white;
}
.luecken-input:focus { box-shadow: 0 0 0 3px rgba(37,174,124,0.2); }
.luecken-input.richtig { background: var(--accent-light); border-color: var(--accent); }
.luecken-input.falsch { background: var(--red-light); border-color: var(--red); }

.luecken-select {
  border: 2px solid var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 1em;
  font-family: inherit;
  background: white;
  outline: none;
  cursor: pointer;
}
.luecken-select.richtig { background: var(--accent-light); border-color: var(--accent); }
.luecken-select.falsch { background: var(--red-light); border-color: var(--red); }

/* ── Wortbank ── */
.wb-bank {
  background: var(--accent-xlight);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
}
.wb-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wb-chips, .ldd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wb-chip {
  display: inline-block;
  padding: 6px 14px;
  background: white;
  border: 2px solid var(--accent);
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  font-size: 0.95rem;
}
.wb-chip:hover:not(.used) { background: var(--accent-light); transform: translateY(-1px); }
.wb-chip.used {
  text-decoration: line-through;
  opacity: 0.4;
  border-color: var(--border);
  background: var(--bg);
}

/* ── Lücken-Drag-Drop ── */
.ldd-text .ldd-slot {
  display: inline-block;
  min-width: 72px;
  border-bottom: 2.5px solid var(--accent);
  padding: 1px 10px;
  margin: 0 3px;
  border-radius: 4px 4px 0 0;
  text-align: center;
  color: var(--text-3);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  vertical-align: baseline;
}
.ldd-text .ldd-slot:hover { background: var(--accent-light); }
.ldd-text .ldd-slot.filled {
  border: 2px solid var(--accent);
  border-radius: 6px;
  color: var(--text-1);
  background: var(--accent-xlight);
}
.ldd-text .ldd-slot.slot-richtig { border-color: var(--accent) !important; background: var(--accent-light) !important; color: var(--accent-dark); }
.ldd-text .ldd-slot.slot-falsch  { border-color: var(--red) !important; background: var(--red-light) !important; color: var(--red); }

.ldd-bank {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 20px;
  margin-bottom: 8px;
}
.ldd-chip {
  display: inline-block;
  padding: 7px 16px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  font-size: 0.95rem;
}
.ldd-chip:hover:not(.placed) { border-color: var(--accent); transform: translateY(-1px); }
.ldd-chip.picked {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37,174,124,0.2);
}
.ldd-chip.placed { opacity: 0.28; cursor: default; text-decoration: line-through; }

/* ── Wortarten ── */
.wort-sentences { margin-bottom: 24px; display: flex; flex-direction: column; gap: 12px; }
.wort-satz {
  font-size: 1.2rem;
  line-height: 3;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
}
.wort-chip {
  display: inline-block;
  padding: 6px 14px;
  margin: 3px;
  border-radius: 20px;
  border: 2px solid var(--border);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
  user-select: none;
  background: white;
}
.wort-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.wort-chip.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,174,124,0.25);
  transform: translateY(-1px);
}
.wort-chip.chip-richtig { outline: 3px solid rgba(37,174,124,0.5) !important; }
.wort-chip.chip-falsch { outline: 3px solid rgba(231,76,60,0.6) !important; }
.wort-plain { display: inline; margin: 0 2px; font-size: 1.2rem; color: var(--text-3); }

.gkg-chip.selected {
  background: var(--accent-light);
  color: var(--accent-dark);
}
.gkg-chip.gkg-missed {
  outline: 3px solid rgba(243,156,18,0.7) !important;
  background: var(--orange-light);
}
#gkg-check.gkg-check-waiting,
#gkg-check:disabled.gkg-check-waiting,
#wa-check.wa-check-waiting,
#wa-check:disabled.wa-check-waiting {
  opacity: 0.45;
  filter: grayscale(0.35);
  cursor: default;
}
.gkg-duration-control,
.wa-duration-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 600;
}
.gkg-duration-control input,
.wa-duration-control input {
  width: 58px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  text-align: center;
}
.gkg-duration-control input:disabled,
.wa-duration-control input:disabled {
  opacity: 0.45;
  cursor: default;
}
.gkg-check-confirm,
.wa-check-confirm {
  margin-top: 14px;
  padding: 12px 14px;
  border: 2px solid rgba(243,156,18,0.75);
  border-radius: 8px;
  background: var(--orange-light);
  color: var(--text);
  font-weight: 900;
  text-transform: uppercase;
}
.gkg-solution {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-2);
  font-weight: 700;
}
.gkg-solution-word {
  display: inline-block;
  color: var(--accent-dark);
  margin-right: 6px;
}

/* Reime erkennen */
.reim-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.reim-word-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.reim-word-row span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  padding: 12px;
  background: var(--accent-xlight);
  border: 2px solid var(--accent-light);
  border-radius: 10px;
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-1);
  line-height: 1.1;
}
.reim-question {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-2);
  margin-bottom: 18px;
}
.reim-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
}
.reim-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  transition: transform .15s, opacity .15s;
}
.reim-btn:hover:not(:disabled) { transform: translateY(-2px); }
.reim-btn:disabled { opacity: .55; cursor: default; }
.reim-yes { background: var(--accent); }
.reim-no { background: var(--red); }

/* Lesesilben trennen */
.silb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.silb-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e9f6ef;
  color: #1f7a46;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.silb-instruction {
  text-align: center;
  font-weight: 800;
  color: var(--text-2);
  margin-bottom: 20px;
}
.silb-word {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 18px;
  font-size: clamp(1.8rem, 4.4vw, 3rem);
}
.silb-letter {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 1em;
  line-height: 1.05;
  color: var(--text-1);
}
.silb-letter.is-vowel-marked {
  color: #946200;
  background: #fff2bf;
  border-radius: 10px;
  box-shadow: inset 0 -0.18em 0 rgba(255, 207, 72, 0.55);
}
.silb-letter.is-vowel-marked.is-mehrgraph {
  color: #6b4a00;
  background: linear-gradient(180deg, #dfeeff 0%, #dfeeff 52%, #fff2bf 52%, #fff2bf 100%);
}
.silb-letter.is-mehrgraph {
  color: #0b5394;
  background: #dfeeff;
}
.silb-letter.is-mehrgraph-start {
  border-radius: 10px 0 0 10px;
  padding-left: 0.05em;
}
.silb-letter.is-mehrgraph-middle {
  border-radius: 0;
}
.silb-letter.is-mehrgraph-end {
  border-radius: 0 10px 10px 0;
  padding-right: 0.05em;
}
.silb-vokal-btn {
  min-height: 1.08em;
  padding: 0 0.06em;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  transition: transform .15s, background .15s, color .15s, box-shadow .15s;
}
.silb-vokal-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #fff6d9;
  box-shadow: inset 0 -0.18em 0 rgba(255, 207, 72, 0.5);
}
.silb-vokal-btn:disabled {
  cursor: default;
}
.silb-vokal-btn.is-active {
  color: #946200;
  background: #fff2bf;
  border-radius: 10px;
  box-shadow: inset 0 -0.18em 0 rgba(255, 207, 72, 0.55);
}
.silb-vokal-btn.is-correct {
  color: var(--accent-dark);
  background: var(--accent-light);
  border-radius: 10px;
}
.silb-vokal-btn.is-wrong {
  color: var(--red);
  background: var(--red-light);
  border-radius: 10px;
}
.silb-vokal-btn.is-missed {
  color: #b9770e;
  background: #fff1d6;
  border-radius: 10px;
}
.silb-slot {
  font-family: inherit;
  width: 0.3em;
  height: 0.9em;
  margin: 0 0.015em;
  border: 0.04em solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: transparent;
  font-size: 1em;
  font-weight: 900;
  line-height: 0.9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform .15s, border-color .15s, background .15s, color .15s;
}
.silb-slot:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--accent-light);
}
.silb-slot.is-active {
  color: var(--accent-dark);
  border-color: var(--accent);
  background: var(--accent-light);
}
.silb-slot.is-correct {
  color: var(--accent-dark);
  border-color: var(--accent);
  background: var(--accent-light);
}
.silb-slot.is-wrong {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-light);
}
.silb-slot.is-missed {
  border-color: #f39c12;
  background: #fff1d6;
  color: #d68910;
}
.silb-preview {
  text-align: center;
  font-weight: 700;
  color: var(--text-2);
}
.silb-settings .exercise-hint {
  margin-bottom: 18px;
}

/* Kurze oder lange Vokale */
.klv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.klv-instruction {
  text-align: center;
  font-weight: 800;
  color: var(--text-2);
  margin-bottom: 20px;
}
.klv-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.klv-word-option {
  min-height: 92px;
  padding: 18px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-1);
  font-family: inherit;
  font-size: clamp(1.45rem, 4vw, 2.4rem);
  font-weight: 900;
  line-height: 1.15;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.klv-word-option:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-xlight);
  transform: translateY(-1px);
}
.klv-word-option:disabled { cursor: default; }
.klv-word-option.is-correct {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
}
.klv-word-option.is-wrong {
  border-color: var(--red);
  background: var(--red-light);
  color: var(--red);
}
.klv-letter {
  display: inline-block;
  position: relative;
  letter-spacing: 0;
}
.klv-silbe-a { color: var(--text-1); }
.klv-silbe-b { color: #b77900; }
.klv-vokal-kurz::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.18em;
  width: 0.16em;
  height: 0.16em;
  border-radius: 50%;
  background: currentColor;
  transform: translateX(-50%);
}
.klv-vokal-lang {
  text-decoration: underline;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

/* Morphem-Stamm-Trainer */
.mst-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.mst-info {
  margin-bottom: 18px;
}
.mst-sentence-box {
  border: 2px solid color-mix(in srgb, var(--accent) 24%, white);
  background: linear-gradient(180deg, #fffef8 0%, #fffdf2 100%);
  border-radius: 18px;
  padding: 26px 22px;
  margin-bottom: 18px;
}
.mst-sentence-text {
  margin: 0;
  text-align: center;
  font-size: clamp(1.28rem, 2.8vw, 1.72rem);
  font-weight: 700;
  line-height: 1.7;
  color: var(--text-1);
}
.mst-word-focus {
  display: inline-flex;
  align-items: center;
  gap: 0.08em;
  margin: 0 0.08em;
  padding: 0.08em 0.22em;
  border-radius: 12px;
  background: rgba(255,255,255,0.82);
  box-shadow: inset 0 0 0 1px rgba(37,174,124,0.12);
}
.mst-grapheme-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0.08em;
}
.mst-grapheme-btn,
.mst-root-btn {
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text-1);
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.mst-grapheme-btn {
  min-width: 3.1rem;
  min-height: 3.1rem;
  padding: 0 12px;
  font-size: 1.1rem;
}
.mst-root-btn {
  min-height: 4.1rem;
  padding: 14px 16px;
  font-size: 1.02rem;
  text-align: center;
}
.mst-grapheme-btn:hover:not(:disabled),
.mst-root-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-xlight);
  transform: translateY(-1px);
}
.mst-grapheme-btn.is-selected,
.mst-root-btn.is-selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(37,174,124,0.12);
}
.mst-grapheme-btn:disabled,
.mst-root-btn:disabled {
  cursor: default;
}
.mst-reserved {
  min-height: 168px;
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed color-mix(in srgb, var(--accent) 42%, var(--border));
  background: color-mix(in srgb, var(--accent-light) 38%, white);
  display: grid;
  align-content: start;
  gap: 12px;
}
.mst-step-label {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-1);
}
.mst-placeholder {
  font-weight: 600;
  color: var(--text-2);
}
.mst-reset-hint {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff4d6;
  color: #8a5a00;
  font-weight: 700;
}
.mst-root-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.mst-root-grid.is-hidden {
  display: none;
}

.mseg-card {
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 18px 40px rgba(26, 54, 93, 0.12);
}
.mseg-info {
  text-align: center;
  margin-bottom: 18px;
}
.mseg-word-shell {
  border: 1px solid rgba(31, 78, 121, 0.12);
  border-radius: 22px;
  padding: 20px 18px;
  background: linear-gradient(180deg, rgba(244, 249, 255, 0.95), rgba(255, 255, 255, 0.98));
}
.mseg-word-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}
.mseg-letter {
  min-width: 30px;
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: #16324f;
}
.mseg-cut {
  width: 28px;
  height: 44px;
  border-radius: 16px;
  border: 1px dashed rgba(44, 92, 135, 0.32);
  background: rgba(255, 255, 255, 0.9);
  color: #2c5c87;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.mseg-cut:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(44, 92, 135, 0.6);
  box-shadow: 0 8px 18px rgba(22, 50, 79, 0.12);
}
.mseg-cut.is-selected {
  border-style: solid;
  border-color: #d96b2b;
  background: #d96b2b;
  color: #fff;
}
.mseg-cut.is-edge {
  background: rgba(22, 50, 79, 0.06);
}
.mseg-cut:disabled {
  cursor: default;
}
.mseg-word-note {
  margin-top: 12px;
  text-align: center;
  color: #4f6073;
  font-size: .98rem;
}
.mseg-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.mseg-preview-cell {
  border-radius: 20px;
  padding: 16px;
  background: #f7fafc;
  border: 1px solid rgba(22, 50, 79, 0.08);
  text-align: center;
}
.mseg-preview-cell span {
  display: block;
  color: #5b6875;
  font-size: .92rem;
  margin-bottom: 8px;
}
.mseg-preview-cell strong {
  display: block;
  font-size: 1.35rem;
  color: #16324f;
  min-height: 1.5em;
}

.wortart-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.wortart-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.88rem;
  color: white;
  transition: all 0.15s;
  font-family: inherit;
  cursor: pointer;
}
.wortart-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.wortart-btn.active {
  box-shadow: 0 0 0 3px rgba(37,174,124,0.3);
  transform: translateY(-1px);
  opacity: 1;
}

/* ── Quiz ── */
.quiz-question { margin-bottom: 36px; }
.quiz-q-text {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-1);
}
.quiz-q-meta {
  margin: -6px 0 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-dark);
}
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option {
  display: block;
  width: 100%;
  padding: 13px 18px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  background: white;
  transition: all 0.15s;
  font-family: inherit;
  cursor: pointer;
}
.quiz-option:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-light); }
.quiz-option.selected { border-color: var(--accent); background: var(--accent-light); font-weight: 700; }
.quiz-option.richtig { border-color: var(--accent) !important; background: var(--accent-light) !important; color: var(--accent-dark) !important; font-weight: 700; }
.quiz-option.falsch { border-color: var(--red) !important; background: var(--red-light) !important; color: var(--red) !important; }
.zkg-card {
  display: grid;
  gap: 16px;
}
.zkg-header {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 12px;
}
.zkg-verb-box,
.zkg-zeitform-box {
  padding: 16px 18px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: var(--surface);
}
.zkg-verb-box strong,
.zkg-zeitform-box strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
}
.zkg-meta-label {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}
.zkg-zeitform-box.is-praesens {
  background: #eef8e8;
  border-color: #78b157;
  color: #365d21;
}
.zkg-zeitform-box.is-praeteritum {
  background: #fff2e4;
  border-color: #e69a43;
  color: #8f4f10;
}
.zkg-zeitform-box.is-perfekt {
  background: #e7f2ff;
  border-color: #4f90d9;
  color: #1f4f86;
}
.zkg-zeitform-box.is-plusquamperfekt {
  background: #e5f6f3;
  border-color: #2c9c8f;
  color: #17645b;
}
.zkg-zeitform-box.is-futur1 {
  background: #fff6d9;
  border-color: #d5a51f;
  color: #7d5f09;
}
.zkg-zeitform-box.is-futur2 {
  background: #fdeaea;
  border-color: #d86b6b;
  color: #8a2d2d;
}
.zkg-hinweis {
  display: grid;
  gap: 10px;
}
.zkg-hinweis-toggle {
  justify-self: start;
}
.zkg-hinweis-panel {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-1);
}
.zkg-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.zkg-table th,
.zkg-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.zkg-table tr:last-child th,
.zkg-table tr:last-child td {
  border-bottom: none;
}
.zkg-table th {
  width: 28%;
  text-align: left;
  background: color-mix(in srgb, var(--accent-light) 70%, white);
  color: var(--text-1);
  font-weight: 800;
}
.zkg-input {
  width: 100%;
  min-height: 46px;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text-1);
  background: var(--surface);
}
.zkg-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.zkg-input-richtig {
  border-color: var(--accent) !important;
  background: var(--accent-light) !important;
}
.zkg-input-falsch {
  border-color: var(--red) !important;
  background: var(--red-light) !important;
}
.zkg-loesung {
  margin-top: 14px;
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
@media (max-width: 640px) {
  .zkg-header {
    grid-template-columns: 1fr;
  }
  .zkg-table,
  .zkg-table tbody,
  .zkg-table tr,
  .zkg-table th,
  .zkg-table td {
    display: block;
    width: 100%;
  }
  .zkg-table tr {
    padding: 12px;
    border-bottom: 1px solid var(--border);
  }
  .zkg-table tr:last-child {
    border-bottom: none;
  }
  .zkg-table th,
  .zkg-table td {
    border: 0;
    padding: 0;
  }
  .zkg-table th {
    background: transparent;
    margin-bottom: 8px;
  }
}
.dhg-card { gap: 14px; }
.dhg-options {
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.dhg-option {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quiz-explanation {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-2);
  border-left: 3px solid var(--accent);
}

/* ── Blitzlesen ── */
.blitz-display {
  background: var(--text-1);
  color: white;
  border-radius: 16px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  padding: 32px;
}
.exercise.blitzlesen.blitz-sync-word-only > *:not(.blitz-display) {
  display: none !important;
}
.blitz-sync-wordlist {
  margin: -8px 0 16px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.blitz-sync-wordlist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.blitz-sync-wordlist-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.blitz-sync-copy-btn {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}
.blitz-sync-wordlist-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.blitz-sync-word-chip {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
}
.blitz-sync-word-chip-active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}
.blitz-sync-word-chip-correct {
  background: #ecfdf3;
  border-color: #6cd8a0;
  color: #067647;
  font-weight: 800;
}
.blitz-sync-word-chip-wrong {
  background: #fef3f2;
  border-color: #f9a5a5;
  color: #b42318;
  font-weight: 800;
}
.blitz-sync-wordlist-empty {
  font-size: 0.82rem;
  color: var(--text-3);
}
#blitz-word {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -1px;
  text-align: center;
}
.blitz-silbe {
  display: inline-block;
  letter-spacing: 0;
  text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}
.blitz-progress {
  text-align: center;
  color: var(--text-3);
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 0.9rem;
}
.blitz-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.blitz-speed-wrap {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.blitz-speed-wrap label {
  font-weight: 600;
  color: var(--text-2);
  display: block;
  margin-bottom: 12px;
}
.blitz-speed-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.blitz-step-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-2);
  transition: background 0.15s;
}
.blitz-step-btn:hover { background: var(--border); }
.blitz-speed-input {
  width: 90px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 6px 8px;
  color: var(--text-1);
}
.blitz-speed-unit {
  font-weight: 600;
  color: var(--text-3);
  font-size: 0.9rem;
}
.blitz-auto-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 16px;
}
.blitz-auto-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.blitz-auto-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}
.blitz-pause-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-2);
}
.blitz-settings {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--accent-xlight);
  border: 1px solid var(--accent-light);
  border-radius: var(--radius);
  padding: 12px 20px;
  margin-bottom: 20px;
}
.blitz-settings-label {
  font-weight: 700;
  color: var(--text-2);
  font-size: 0.9rem;
  white-space: nowrap;
}
.blitz-count-opts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.blitz-count-lbl {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  user-select: none;
}
.blitz-count-lbl:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.blitz-count-lbl input[type="radio"],
.blitz-count-lbl input[type="checkbox"] { display: none; }

/* Fortschritt-Zeile mit Falsch-Badge */
.blitz-progress-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.blitz-missed-badge {
  background: var(--red-light);
  color: var(--red);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 2px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--red);
}

/* Falsch-Button */
.btn-falsch {
  background: var(--red);
  color: #fff;
  border: 2px solid var(--red);
  padding: 8px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.btn-falsch:hover { background: #c0392b; border-color: #c0392b; }

/* Download-Karte am Ende */
.blitz-download-row {
  margin-top: 24px;
  background: var(--orange-light);
  border: 1.5px solid var(--orange);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}
.blitz-download-info {
  font-size: 0.95rem;
  color: var(--text-1);
  line-height: 1.5;
}
.blitz-download-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
}
.blitz-download-list span {
  background: #fff;
  border: 1px solid var(--orange);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-1);
}

/* ── Zahlen zerlegen ── */
.weg-puzzles { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.weg-puzzle {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}
.weg-ziel-box {
  min-width: 52px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-dark);
  background: var(--accent-light);
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 6px 12px;
  flex-shrink: 0;
}
.weg-zahlen { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.weg-zahl {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.weg-zahl:hover:not(.markiert) { border-color: var(--accent); background: var(--accent-xlight); }
.weg-zahl.markiert {
  color: var(--accent-dark);
  background: #fff;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3px rgba(243,156,18,0.24);
  border-radius: 999px;
  cursor: pointer;
}
.weg-check-btn { flex-shrink: 0; padding: 5px 14px !important; font-size: 13px !important; }
.weg-result { font-size: 1.5rem; font-weight: 800; flex-shrink: 0; min-width: 1.5rem; text-align: center; }
.weg-richtig { color: var(--accent); }
.weg-falsch  { color: var(--red); }

/* ── Mathe ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.mathe-settings h3 { font-size: 1.35rem; font-weight: 800; margin-bottom: 28px; }
.mathe-settings-grid { display: grid; gap: 28px; margin-bottom: 32px; }
.setting-label { font-weight: 700; color: var(--text-1); display: block; margin-bottom: 12px; }
.setting-options { display: flex; flex-wrap: wrap; gap: 10px; }
.einmaleins-grid .muted { margin: 12px 0 0; }
.einmaleins-row-selection .setting-check { min-width: 132px; justify-content: center; }
.setting-radio, .setting-check {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
  background: white;
  user-select: none;
}
.setting-radio:hover, .setting-check:hover { border-color: var(--accent); background: var(--accent-light); }
.setting-radio input, .setting-check input { accent-color: var(--accent); }
.runmode-panel[hidden] { display: none !important; }

.mathe-aufgabe-display { text-align: center; padding: 40px 20px 24px; }
.mathe-aufgabe-text {
  font-size: 3.8rem;
  font-weight: 900;
  color: var(--text-1);
  margin-bottom: 28px;
  letter-spacing: -2px;
}
.mathe-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.einmaleins-family {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.einmaleins-family-row {
  flex-wrap: wrap;
}
.einmaleins-connector {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-3);
}
.mathe-eq { font-size: 2rem; font-weight: 700; color: var(--text-3); }
.mathe-answer-input {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  border: 3px solid var(--accent);
  border-radius: 12px;
  padding: 12px 24px;
  width: 170px;
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
  background: white;
}
.mathe-answer-input:focus { box-shadow: 0 0 0 4px rgba(37,174,124,0.2); }
.mathe-answer-input.richtig { border-color: var(--accent); background: var(--accent-light); }
.mathe-answer-input.falsch { border-color: var(--red); background: var(--red-light); animation: shake 0.4s; }
.mathe-feedback { font-size: 1.1rem; font-weight: 700; min-height: 32px; }
.feedback-richtig { color: var(--accent); }
.feedback-falsch { color: var(--red); }
.mathe-controls { display: flex; gap: 12px; justify-content: center; margin-bottom: 24px; }
.mathe-progress-bar-wrap {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.mathe-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.mathe-progress-text { text-align: center; font-size: 0.88rem; color: var(--text-3); font-weight: 600; }

/* ── Drag & Drop ── */
.dd-item { margin-bottom: 28px; }
.dd-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 52px;
  padding: 10px;
  background: var(--bg);
  border-radius: 10px;
  border: 2px dashed var(--border);
  margin-bottom: 12px;
  align-items: center;
}
.dd-slot {
  min-width: 80px;
  min-height: 40px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  padding: 6px 14px;
  background: white;
  font-size: 0.95rem;
}
.dd-slot:hover { border-color: var(--accent); background: var(--accent-light); }
.dd-slot.filled { border-style: solid; border-color: var(--accent); background: var(--accent-xlight); }
.dd-slot.slot-richtig { border-color: var(--accent) !important; background: var(--accent-light) !important; color: var(--accent-dark); }
.dd-slot.slot-falsch { border-color: var(--red) !important; background: var(--red-light) !important; color: var(--red); }
.dd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dd-chip {
  padding: 8px 16px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  font-size: 0.95rem;
}
.dd-chip:hover { border-color: var(--accent); }
.dd-chip.picked {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37,174,124,0.2);
}

/* ── Error card ── */
.error-card {
  background: var(--surface);
  border: 2px solid var(--red);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
  max-width: 480px;
  margin: 40px auto;
}
.error-card h2 { margin-bottom: 12px; color: var(--red); }
.error-card p { color: var(--text-2); margin-bottom: 12px; }
.error-card code {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.88em;
  margin-top: 4px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text-1);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 1000;
  transition: transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Celebration / Confetti ── */
.celebration {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
  border-radius: var(--radius);
}
.confetti-piece {
  position: absolute;
  top: -10px;
  border-radius: 3px;
  animation: confetti-fall 2.5s ease-in forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(700px) rotate(720deg); opacity: 0; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ──────────── Sortierspiel ──────────────────────────────────── */
.sort-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sort-anleitung {
  text-align: center;
  color: var(--text-2);
  margin: 0;
}
.sort-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  min-height: 80px;
  padding: 16px;
  border: 2px dashed #cfd9df;
  border-radius: 16px;
  background: #f8fafb;
}
.sort-objekt {
  font-size: 3rem;
  line-height: 1;
  padding: 8px;
  border-radius: 12px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  transition: transform .15s, box-shadow .15s;
}
.sort-objekt:hover { transform: scale(1.12); box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.sort-objekt.sort-gezogen { opacity: .25; cursor: grabbing; }
.sort-objekt.sort-platziert { cursor: default; box-shadow: none; }
.sort-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 3rem;
  line-height: 1;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
  opacity: .92;
  transform: scale(1.12) rotate(4deg);
  user-select: none;
}
.sort-eimer {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.sort-bereich {
  flex: 1;
  min-width: 140px;
  border: 3px solid var(--kat-farbe, #cfd9df);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
  transition: box-shadow .15s, transform .15s, background .15s;
}
.sort-bereich.sort-hovered {
  background: var(--accent-xlight);
  box-shadow: 0 0 0 4px var(--accent);
  transform: scale(1.02);
}
.sort-bereich-label {
  font-weight: 700;
  font-size: 1rem;
  color: var(--kat-farbe, #555);
  text-align: center;
  margin-bottom: 10px;
}
.sort-bereich-inhalt {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 64px;
  justify-content: center;
  align-items: flex-start;
  align-content: flex-start;
}
@keyframes sort-richtig {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); background: var(--accent-light); }
  100% { transform: scale(1); }
}
.sort-richtig-anim { animation: sort-richtig .55s ease; }
.sort-falsch-anim  { animation: shake .45s ease; }
.sort-ergebnis {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-dark);
  padding: 16px;
  border-radius: 12px;
  background: var(--accent-light);
}
.sort-ergebnis-text { margin-bottom: 12px; }
.sort-ergebnis-aktionen { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 500px) {
  .sort-eimer { flex-direction: column; }
  .sort-objekt, .sort-ghost { font-size: 2.5rem; }
}

/* ──────────── Mengen-Match ──────────────────────────────────── */
.mengen-match { max-width: 540px; margin: 0 auto; }
.mm-frage-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: 20px; }
.mm-menge {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  max-width: 380px;
  padding: 20px;
  border: 2px solid #e8ecef;
  border-radius: 20px;
  background: #f8fafb;
  min-height: 90px;
  align-content: center;
}
.mm-symbol-layer {
  position: relative;
  z-index: 0;
  display: flex;
  flex-wrap: wrap;
  gap: inherit;
  justify-content: inherit;
  align-content: inherit;
  width: 100%;
  min-height: inherit;
}
.mm-pop-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}
.mm-item { font-size: var(--mm-fs, 2.4rem); line-height: 1.1; user-select: none; }
.mm-frage-text { font-size: 1.1rem; font-weight: 600; color: var(--text-2); margin: 0; }
.mm-optionen {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}
.mm-option {
  font-size: 2rem;
  font-weight: 900;
  padding: 18px 10px;
  border-radius: 14px;
  border-width: 2px;
  transition: transform .1s, background .15s;
}
.mm-option:hover:not(:disabled) { transform: scale(1.06); }
.mm-option:active:not(:disabled) { transform: scale(.96); }
.mm-option.richtig { border-color: var(--accent) !important; background: var(--accent-light) !important; color: var(--accent-dark) !important; }
.mm-option.falsch  { border-color: var(--red) !important; background: var(--red-light) !important; color: var(--red) !important; animation: shake .4s; }
.mm-menge-gestreut {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 210px;
  flex-shrink: 0;
}
.mm-menge-gestreut .mm-symbol-layer {
  position: absolute;
  inset: 0;
}
.mm-item-gestreut {
  position: absolute;
  transform: translate(-50%, -50%);
  line-height: 1;
  user-select: none;
}
.mm-feedback {
  display: block;
  font-size: 1.05rem;
  padding: 12px 18px;
  border-radius: 10px;
  margin: 0;
  text-align: center;
}
@media (max-width: 480px) {
  .mm-option { font-size: 1.6rem; padding: 14px 8px; }
  .mm-optionen { max-width: 100%; }
  .mm-menge { padding: 14px; }
}

/* ──────────── Zählen und Tippen ────────────────────────────────── */
.zaehlen-tippen { max-width: 540px; margin: 0 auto; }
.zt-kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 0 10px;
}
.zt-anleitung { font-size: 1rem; color: var(--text-2); }
.zt-zaehler {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent);
  white-space: nowrap;
}
.zt-feld {
  position: relative;
  width: 100%;
  height: 230px;
  border: 2px solid #e8ecef;
  border-radius: 20px;
  background: #f8fafb;
  overflow: hidden;
}
.zt-objekt {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  line-height: 1;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  transition: transform .12s;
}
.zt-objekt:hover:not(.zt-getippt) { transform: translate(-50%, -50%) scale(1.25); }
@keyframes zt-pop {
  0%   { transform: translate(-50%, -50%) scale(1); }
  35%  { transform: translate(-50%, -50%) scale(1.5); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
.zt-objekt.zt-getippt {
  opacity: .35;
  cursor: default;
  pointer-events: none;
  animation: zt-pop .3s ease;
}
.zt-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 900;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}
.zt-antwort-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}
.zt-frage {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
  text-align: center;
}
@media (max-width: 480px) {
  .zt-feld { height: 190px; }
  .zt-zaehler { font-size: 1.15rem; }
}

/* ──────────── Waage ──────────────────────────────────── */
.waage { max-width: 580px; margin: 0 auto; }

/* Szene: relativer Anker für alle absolut positionierten Kinder */
.waage-szene {
  position: relative;
  width: 100%;
  height: 230px;
  margin: 20px 0 10px;
}

/* Stativ: Pivot + Mast + Sockel — dreht sich NICHT mit */
.waage-stativ {
  position: absolute;
  top: calc(50% - 11px);   /* Pivot-Dot-Mitte auf 50% Scene-Höhe */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 1;
}
.waage-pivot-dot {
  width: 22px;
  height: 22px;
  background: #5d6d7e;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  flex-shrink: 0;
}
.waage-mast-stab {
  width: 8px;
  height: 55px;
  background: linear-gradient(to bottom, #7f8c8d, #95a5a6);
}
.waage-mast-sockel {
  width: 90px;
  height: 12px;
  background: #7f8c8d;
  border-radius: 0 0 8px 8px;
}

/*
  Assembly: Schale-links | Balken-Bar | Schale-rechts als Flex-Row.
  Das ganze dreht sich als eine Einheit (Seesaw).
  top: 50% + translateY(-50%) → vertical zentriert; Pivot bei 50% 50%.
*/
.waage-assembly {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  transform-origin: 50% 50%;
  display: flex;
  align-items: stretch;
  z-index: 2;
}
/* Kein transition am Base-Element — rAF-Idle muss sofort wirken */
.waage-assembly.waage-kippen {
  transform: translateY(-50%) rotate(var(--waage-rot, 0deg));
  transition: transform 1.2s cubic-bezier(.34, 1.7, .64, 1);
}

/* Horizontaler Balken zwischen den Schalen (visuelle Stange) */
.waage-balken-bar {
  flex: 1;
  height: 11px;
  align-self: center;
  background: linear-gradient(to right, #bdc3c7, #7f8c8d, #bdc3c7);
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  min-width: 60px;
}

/* Schalen: direkte Flex-Kinder des Assembly → drehen sich mit */
.waage-schale {
  flex: 0 0 148px;
  min-height: 100px;
  background: #fff;
  border: 2px solid #d5dce3;
  border-radius: 12px;
  padding: 10px 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  position: relative;
  transition: border-color .55s, background .55s, box-shadow .55s;
}
.waage-schale.waage-schale-schwer {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(37,174,124,.2), 0 4px 16px rgba(0,0,0,.1);
}
.waage-schale.waage-schale-gleich {
  border-color: var(--orange);
  background: var(--orange-light);
}
.waage-schale-obj {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  align-content: flex-start;
  flex: 1;
  min-height: 68px;
  width: 100%;
}
.waage-obj { line-height: 1.2; user-select: none; }
.waage-schale-label {
  font-size: .74rem;
  font-weight: 800;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* Frage + Buttons */
.waage-frage {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 14px 0 10px;
}
.waage-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.waage-btn {
  font-size: .95rem;
  font-weight: 700;
  padding: 14px 16px;
  border-radius: 12px;
  border-width: 2px;
  flex: 1;
  min-width: 100px;
  max-width: 170px;
  transition: transform .1s, background .15s;
}
.waage-btn:hover:not(:disabled) { transform: scale(1.05); }
.waage-btn:active:not(:disabled) { transform: scale(.96); }
.waage-btn.richtig { border-color: var(--accent) !important; background: var(--accent-light) !important; color: var(--accent-dark) !important; }
.waage-btn.falsch  { border-color: var(--red) !important; background: var(--red-light) !important; color: var(--red) !important; animation: shake .4s; }

@media (max-width: 500px) {
  .waage-szene { height: 200px; }
  .waage-schale { flex-basis: 118px; min-height: 85px; }
  .waage-btn { font-size: .85rem; padding: 12px 10px; min-width: 80px; }
}

/* ──────────── Frosch-Hüpfen (Zahlenstrahl) ───────────── */
.frosch-hupfen { max-width: 580px; margin: 0 auto; }

/* Gleichung-Anzeige oben */
.fh-gleichung-wrap {
  text-align: center;
  margin: 12px 0 18px;
}
.fh-gleichung {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 18px;
  padding: 10px 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.fh-operand {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  min-width: 1.4ch;
  text-align: center;
}
.fh-operator {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-2);
}
.fh-fragezeichen {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent);
}

/* Bogen-Ebene (liegt hinter Frosch im DOM, Frosch malt darüber) */
.fh-arcs-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}
/* Ein einzelner Halbkreis-Bogen über dem Zahlenstrahl */
.fh-arc {
  position: absolute;
  border: 2.5px solid var(--accent);
  border-bottom: none;
  border-radius: 50% 50% 0 0;
  pointer-events: none;
  transform-origin: bottom center;
  animation: fh-arc-pop 0.18s ease-out forwards;
  opacity: 0;
}
@keyframes fh-arc-pop {
  from { opacity: 0; transform: scaleY(0.15); }
  to   { opacity: 0.85; transform: scaleY(1); }
}

/* Zahlen-Buttons kurz aufleuchten beim Landen */
.fh-num.fh-num-besucht {
  background: var(--accent-light) !important;
  border-color: var(--accent) !important;
  transform: scale(1.25) translateY(-2px) !important;
  transition: none !important;
}

/* Szene: äußerer Scroll-Wrapper + innerer Container */
.fh-szene-outer {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 6px;
  /* hide scrollbar on desktop, still scrollable on mobile */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.fh-szene {
  position: relative;
  padding: 0 8px;
  margin: 6px 0 10px;
}

/* Frog-Track: gleiche Breite wie die Zahlenreihe darunter */
.fh-frog-track {
  position: relative;
  height: 76px;
}

/* Der Frosch selbst — JS steuert transform komplett */
.fh-frog {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 2.2rem;
  line-height: 1;
  z-index: 10;  /* über den Bogen-Arcs */
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
}

/* Zahlenstrahl */
.fh-linie-wrap { position: relative; }

.fh-nums-row {
  display: flex;
  justify-content: space-between;
  position: relative;
}

/* Horizontale Linie durch alle Ticks */
.fh-nums-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, #b2bec3, #636e72 30%, #636e72 70%, #b2bec3);
  border-radius: 2px;
  pointer-events: none;
}

.fh-num-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fh-tick {
  width: 2px;
  height: 8px;
  background: #636e72;
  flex-shrink: 0;
}

/* Zahl-Buttons */
.fh-num {
  margin-top: 4px;
  width: 34px;
  height: 34px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font);
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  flex-shrink: 0;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fh-num:hover:not(:disabled) {
  background: var(--accent-light);
  border-color: var(--accent);
  transform: scale(1.18) translateY(-2px);
  box-shadow: 0 4px 10px rgba(37,174,124,.25);
}
.fh-num:active:not(:disabled) { transform: scale(1.06); }
.fh-num:disabled { cursor: default; }

.fh-num.richtig {
  background: #d4f5e2 !important;
  border-color: #27ae60 !important;
  color: #1a7a40 !important;
  box-shadow: 0 0 0 3px rgba(39,174,96,.2);
}
.fh-num.falsch {
  background: #fde8ea !important;
  border-color: #e74c3c !important;
  color: #922b21 !important;
  animation: shake 0.4s ease;
}

/* Kompaktere Buttons für Zahlenraum 1–20 (21 Zahlen) */
.fh-raum-20 .fh-num {
  width: 26px;
  height: 28px;
  font-size: 0.75rem;
  border-radius: 6px;
}

.fh-hinweis {
  text-align: center;
  color: var(--text-2);
  font-size: 0.88rem;
  margin: 2px 0 14px;
}

@media (max-width: 480px) {
  .fh-num        { width: 28px; height: 30px; font-size: 0.8rem; }
  .fh-raum-20 .fh-num { width: 22px; height: 26px; font-size: 0.68rem; }
  .fh-operand    { font-size: 1.6rem; }
  .fh-fragezeichen { font-size: 1.8rem; }
  .fh-frog       { font-size: 1.9rem; }
  .fh-frog-track { height: 64px; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .content-area { padding: 32px 24px 80px; }
}

@media (max-width: 1240px) {
  .header-right { gap: 10px; }
  .user-area { gap: 8px; }
  .acting-switch {
    gap: 10px;
    padding: 8px 10px 8px 12px;
    border-radius: 14px;
  }
  .acting-switch-kicker {
    display: none;
  }
  .acting-switch-state {
    font-size: 0.86rem;
  }
  .acting-switch-controls select {
    min-width: 180px;
    max-width: 220px;
    padding: 8px 10px;
  }
}

@media (max-width: 1040px) {
  .hamburger { display: flex; }
  #user-area { display: none !important; }
  .logo-img { width: 138px; max-width: 42vw; }
  .logo-sub { display: none; }

  .sidebar {
    transform: translateX(-100%);
    width: 288px;
    z-index: 200;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }
  .sidebar-overlay.show { display: block; z-index: 199; }

  .main { margin-left: 0; }
  .content-area { padding: 24px 16px 60px; }
  .site-footer { padding: 0 16px 24px; }
  .sf-acting-card { display: grid; }

  .home-title { font-size: 1.8rem; }
  .page-title { font-size: 1.6rem; }
  .fach-grid { grid-template-columns: 1fr; }
  .subject-hero {
    grid-template-columns: 1fr;
    padding: 22px 20px;
  }
  .subject-hero-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    font-size: 1.9rem;
  }
  .subject-switch {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .subject-switch-link {
    width: 100%;
  }
  .subject-content-row {
    padding: 14px 16px;
  }

  #blitz-word { font-size: 2.6rem; }
  .mathe-aufgabe-text { font-size: 2.8rem; }
  .mathe-answer-input { width: 140px; font-size: 1.8rem; }

  .wort-satz { font-size: 1rem; line-height: 2.8; }
  .klv-options { grid-template-columns: 1fr; }
  .mst-root-grid { grid-template-columns: 1fr; }
  .mst-grapheme-group { gap: 6px; }
  .mst-sentence-box { padding: 22px 16px; }
  .mseg-card { padding: 20px 14px; }
  .mseg-preview-grid { grid-template-columns: 1fr; }
  .mseg-letter { min-width: 22px; font-size: 1.6rem; }
  .mseg-cut { width: 24px; height: 38px; }
}

@media (max-width: 480px) {
  #blitz-word { font-size: 2rem; }
  .mathe-aufgabe-text { font-size: 2.2rem; }
  .result-score { font-size: 1.3rem; }
  .subject-list-group,
  .subject-topic-card {
    padding: 16px;
  }
  .subject-content-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .subject-type-pill {
    min-height: 30px;
  }
}

/* ── Login Modal ─────────────────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 48, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  transition: opacity .25s;
}
.login-overlay.hidden { display: none; }

.login-box {
  background: var(--surface);
  border-radius: 20px;
  padding: 40px 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: loginIn .25s ease;
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}
.login-logo-img {
  display: block;
  width: 230px;
  max-width: 100%;
  height: auto;
}
.login-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 22px; }

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-form input {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .15s;
  outline: none;
}
.login-form input:focus { border-color: var(--accent); }

.login-error {
  font-size: 0.88rem;
  color: var(--red);
  font-weight: 600;
  min-height: 20px;
}

.btn-login {
  padding: 13px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
  margin-top: 4px;
}
.btn-login:hover { background: var(--accent-dark); }
.btn-login:disabled { opacity: .6; cursor: default; }

.btn-guest {
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
  transition: color .15s;
}
.btn-guest:hover { color: var(--text-2); }

.login-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-3);
  text-align: center;
  line-height: 1.5;
}
.login-impressum {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-3);
  text-decoration: none;
}
.login-impressum:hover { color: var(--accent); text-decoration: underline; }

/* ── Home: Empfehlungen & Lesezeichen ────────────────────────────── */
.home-welcome {
  font-size: 1.1rem;
  color: var(--text-2);
  margin-bottom: 8px;
}
.home-section {
  margin-bottom: 36px;
}
.home-section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 14px;
}
.empfehlung-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.empfehlung-card {
  background: #fff9e6;
  border: 2px solid #f5c518;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.empfehlung-icon { font-size: 1.5rem; flex-shrink: 0; }
.empfehlung-body { flex: 1; }
.empfehlung-titel { font-weight: 700; font-size: 0.95rem; }
.empfehlung-msg   { font-size: 0.85rem; color: var(--text-2); margin-top: 2px; }
.empfehlung-link  { font-size: 0.82rem; font-weight: 700; color: var(--accent); margin-top: 6px; display: inline-block; }
.section-more-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 800;
}
.student-panel { margin-bottom: 40px; }
.empfehlung-card-list { margin-bottom: 12px; }
.empfehlung-meta {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 1px;
  font-weight: 700;
}
.empfehlung-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.empfehlung-done-btn {
  border: 1.5px solid var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  font-family: inherit;
}
.empfehlung-done-btn:hover { background: #c8f0e0; }
.empty-state {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--text-2);
  font-weight: 700;
}
.done-recs {
  margin-top: 24px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.done-recs summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text-2);
}
.done-rec-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.done-rec-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
}
.done-rec-row span { color: var(--text-3); font-weight: 700; white-space: nowrap; }
.done-subject {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.done-subject h2 {
  font-size: 1.1rem;
  margin-bottom: 14px;
}
.done-topic {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}
.done-topic:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.done-topic h3 {
  font-size: 0.92rem;
  color: var(--text-2);
  margin-bottom: 8px;
}
.done-topic ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.done-topic li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
}
.done-topic li span {
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.bookmark-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bookmark-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-1);
  text-decoration: none !important;
  transition: all .15s;
}
.bookmark-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ── Lesezeichen-Button auf Seiten ──────────────────────────────── */
.bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  margin-top: 8px;
}
.bookmark-btn:hover       { border-color: var(--accent); color: var(--accent); }

#exercise-back-slot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
#exercise-back-slot .btn {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  border-width: 1.5px;
  margin-top: 0;
}

/* ── Rechenmauer ────────────────────────────────────────────────── */
.rm-mauern {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
  margin-bottom: 24px;
}
.rm-mauer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.rm-mauer-titel {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-2);
}
.rm-pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.rm-row {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.rm-cell {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.15rem;
  font-weight: 700;
}
.rm-given {
  background: var(--accent-light);
  border: 2px solid var(--accent);
  color: var(--text-1);
}
.rm-input {
  background: var(--surface);
  border: 2px solid var(--border);
  text-align: center;
  color: var(--text-1);
  transition: border-color .15s;
  padding: 0;
  -moz-appearance: textfield;
}
.rm-input::-webkit-outer-spin-button,
.rm-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.rm-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.rm-check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.rm-result {
  font-size: 0.95rem;
  font-weight: 700;
}
.rm-richtig { color: var(--accent); }
.rm-falsch  { color: var(--red); }
#rm-global-result { margin-top: 12px; }
.rm-settings-error {
  color: var(--red);
  font-weight: 700;
  margin-top: 12px;
  min-height: 24px;
}

/* —— Schriftlich rechnen —— */
.srg-note {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--text-3);
  font-weight: 600;
}
.srg-headline {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.srg-task-wrap {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  margin: 22px 0 26px;
  align-items: start;
}
.srg-written-card,
.srg-steps-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.srg-written {
  font-family: "Courier New", monospace;
  width: fit-content;
  margin: 0 auto;
  min-width: 180px;
}
.srg-written-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 10px;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-1);
}
.srg-op { text-align: center; color: var(--text-2); }
.srg-number { text-align: right; white-space: pre; letter-spacing: 0.08em; }
.srg-line {
  height: 3px;
  background: var(--text-1);
  margin: 10px 0 12px 34px;
  border-radius: 999px;
}
.srg-written-blank { color: var(--text-3); }
.srg-steps-title {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 14px;
}
.srg-step-table,
.srg-multi-rows {
  display: grid;
  gap: 10px;
}
.srg-step-row {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) minmax(110px, 1fr) 86px 86px;
  gap: 10px;
  align-items: center;
}
.srg-step-head {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.srg-step-place,
.srg-step-expression {
  font-weight: 700;
  color: var(--text-1);
}
.srg-input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 800;
  background: white;
  color: var(--text-1);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.srg-small-input {
  text-align: center;
  font-size: 1.05rem;
}
.srg-result-input {
  font-size: 1.2rem;
  letter-spacing: 0.03em;
}
.srg-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.srg-input.richtig {
  border-color: var(--accent);
  background: var(--accent-light);
}
.srg-input.falsch {
  border-color: var(--red);
  background: var(--red-light);
}
.srg-final-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 220px);
  gap: 12px;
  align-items: center;
}
.srg-final-label {
  font-weight: 700;
  color: var(--text-1);
}

@media (max-width: 860px) {
  .srg-task-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .srg-written-row { font-size: 1.7rem; }
  .srg-step-row {
    grid-template-columns: 1fr 1fr;
  }
  .srg-step-head { display: none; }
  .srg-step-row > span:nth-child(1),
  .srg-step-row > span:nth-child(2) {
    grid-column: span 1;
  }
  .srg-final-row {
    grid-template-columns: 1fr;
  }
}

/* ── Textaufgaben ───────────────────────────────────────────────── */
.srg-helper-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
}
.srg-workbook-shell {
  display: flex;
  justify-content: center;
  margin: 26px 0 18px;
}
.srg-workbook-card {
  width: min(100%, 760px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.srg-workbook {
  padding: 26px 22px;
  border-radius: 18px;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(130, 174, 221, 0.15) 0,
      rgba(130, 174, 221, 0.15) 1px,
      transparent 1px,
      transparent 46px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(130, 174, 221, 0.12) 0,
      rgba(130, 174, 221, 0.12) 1px,
      transparent 1px,
      transparent 46px
    ),
    linear-gradient(180deg, #fcfeff 0%, #f3f8ff 100%);
}
.srg-operation-row {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: end;
  gap: 10px;
}
.srg-operator-cell {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-2);
}
.srg-grid-row {
  display: grid;
  grid-template-columns: repeat(var(--srg-cols), minmax(44px, 54px));
  justify-content: end;
  gap: 6px;
}
.srg-grid-row-small {
  margin-bottom: 4px;
}
.srg-grid-row-carry {
  margin-top: 4px;
  margin-bottom: 6px;
}
.srg-cell,
.srg-cell-input {
  min-height: 54px;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
}
.srg-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(88, 132, 181, 0.38);
  background: rgba(255, 255, 255, 0.58);
  color: var(--text-1);
}
.srg-cell.is-given {
  background: rgba(255, 255, 255, 0.82);
}
.srg-cell.is-blank {
  background: transparent;
  border-color: transparent;
}
.srg-cell-input {
  width: 100%;
  border: 2px solid rgba(88, 132, 181, 0.55);
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-1);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  padding: 4px 6px;
}
.srg-cell-input.is-small {
  min-height: 28px;
  font-size: 0.98rem;
  font-weight: 900;
  padding: 2px 4px;
}
.srg-cell-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.srg-cell-input.richtig {
  border-color: var(--accent);
  background: var(--accent-light);
}
.srg-cell-input.falsch {
  border-color: var(--red);
  background: var(--red-light);
}
.srg-separator {
  height: 4px;
  background: #435a79;
  border-radius: 999px;
  margin: 8px 0 10px 56px;
}
.srg-separator-thin {
  height: 3px;
  margin-top: 10px;
}
.srg-partial-rows {
  display: grid;
  gap: 8px;
}
.srg-division-formula {
  display: grid;
  grid-template-columns: 26px auto auto auto auto auto;
  gap: 10px;
  align-items: center;
  justify-content: start;
}
.srg-division-formula-spacer {
  width: 26px;
}
.srg-division-symbol,
.srg-division-inline-value {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", monospace;
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-1);
}
.srg-division-quotient {
  align-items: end;
}
.srg-division-grid {
  justify-content: start;
}
.srg-division-steps {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  justify-items: start;
}
.srg-division-step-row {
  display: grid;
  grid-template-columns: 26px auto;
  gap: 8px;
  align-items: center;
  justify-content: start;
}
.srg-division-minus {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", monospace;
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--text-2);
}
.srg-division-minus-empty {
  visibility: hidden;
}
.srg-division-separator-row {
  margin-top: -2px;
  margin-bottom: -2px;
}
.srg-division-separator-cell {
  min-height: 5px;
  border-radius: 999px;
}
.srg-division-separator-cell.is-active {
  background: #435a79;
}
.srg-division-step-separator {
  margin-left: 0;
  margin-top: 0;
  margin-bottom: 0;
}
.srg-add-row-btn {
  margin-top: 14px;
  margin-left: 34px;
  border: 2px dashed rgba(88, 132, 181, 0.65);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-2);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}
.srg-add-row-btn:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: var(--accent-light);
}

@media (max-width: 640px) {
  .srg-workbook-card {
    padding: 12px;
  }
  .srg-workbook {
    padding: 18px 12px;
  }
  .srg-operation-row {
    grid-template-columns: 34px 1fr;
    gap: 8px;
  }
  .srg-operator-cell {
    min-height: 46px;
    font-size: 1.8rem;
  }
  .srg-grid-row {
    grid-template-columns: repeat(var(--srg-cols), minmax(34px, 1fr));
    gap: 4px;
  }
  .srg-cell,
  .srg-cell-input {
    min-height: 42px;
    font-size: 1.5rem;
  }
  .srg-cell-input.is-small {
    min-height: 24px;
    font-size: 0.9rem;
  }
  .srg-separator {
    margin-left: 42px;
  }
  .srg-division-formula {
    grid-template-columns: 20px minmax(0, auto) auto auto auto minmax(0, auto);
    gap: 6px;
  }
  .srg-division-formula-spacer {
    width: 20px;
  }
  .srg-division-symbol,
  .srg-division-inline-value {
    min-height: 34px;
    font-size: 1.45rem;
  }
  .srg-division-step-row {
    grid-template-columns: 20px 1fr;
    gap: 6px;
  }
  .srg-division-minus {
    min-height: 32px;
    font-size: 1.35rem;
  }
  .srg-add-row-btn {
    margin-left: 26px;
  }
}

.exercise.textaufgaben { max-width: 640px; }
.ta-aufgabe {
  background: var(--accent-xlight);
  border: 2px solid var(--accent-light);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 20px;
  display: grid;
  gap: 14px;
}
.ta-titel {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  margin-bottom: 2px;
}
.ta-block,
.ta-loesung {
  display: grid;
  gap: 10px;
}
.ta-block {
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff;
  border: 2px solid #d9e9e2;
}
.ta-block-story {
  background: #ffffff;
  border-color: #9fd8c2;
}
.ta-block-question {
  background: #f4fbff;
  border-color: #a9d5ef;
}
.ta-loesung {
  margin-top: 14px;
}
.ta-block-solution,
.ta-block-answer,
.ta-block-hint {
  box-shadow: none;
}
.ta-block-solution {
  border-color: #f0c27a;
  background: #fff8ea;
}
.ta-block-answer {
  border-color: #86d0ad;
  background: #eefaf4;
}
.ta-block-hint {
  border-color: #a9d5ef;
  background: #f4fbff;
}
.ta-block-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.ta-block-text {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text-1);
  white-space: pre-wrap;
}
.ta-eingabe-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ta-rechnung-row {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.ta-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-2);
}
.ta-rechnung-input {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 2px solid #cfd9df;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  line-height: 1.5;
  color: var(--text-1);
  background: #fff;
}
.ta-rechnung-input:focus {
  outline: none;
  border-color: #25ae7c;
  box-shadow: 0 0 0 3px rgba(37, 174, 124, 0.14);
}
.ta-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ta-einheit {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-2);
}
.ta-inline-hint {
  margin: -4px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid #f0c27a;
  background: #fff8ea;
  color: var(--text-1);
  font-weight: 600;
}
@media (max-width: 640px) {
  .ta-aufgabe {
    padding: 16px;
  }
  .ta-block {
    padding: 12px 14px;
  }
  .ta-block-text {
    font-size: 0.98rem;
  }
}
@media (max-width: 640px) {
  .silb-card {
    padding: 22px 16px;
  }
}
.bookmark-btn.is-saved    { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
