/* ======================================================================
   Mathebuch — playful, bright, kid-friendly.
   Type: Fredoka (display, rounded) + Nunito (UI, rounded sans) + Geist Mono.
   Palette: cream paper, deep navy ink, vivid rainbow tints, coral accent.
   ====================================================================== */

:root {
  /* paper & ink */
  --paper:    oklch(98% 0.025 95);       /* sunshine cream */
  --paper-2:  oklch(95% 0.04 80);        /* soft peach band */
  --paper-3:  oklch(92% 0.05 75);        /* warm divider */
  --ink:      oklch(28% 0.05 270);       /* deep navy */
  --ink-2:    oklch(48% 0.04 270);       /* slate */
  --ink-3:    oklch(64% 0.03 270);       /* light slate */
  --rule:     oklch(89% 0.03 80);
  --rule-2:   oklch(82% 0.04 80);

  /* accent — bright cheerful coral for links, marks, focus */
  --accent:   oklch(63% 0.20 25);
  --accent-2: oklch(70% 0.20 25);

  /* topic tints — vivid, distinct hues; bg used for soft chapter wash */
  --t-sage:    oklch(70% 0.16 150);  --t-sage-bg:  oklch(95% 0.07 150);
  --t-slate:   oklch(67% 0.16 235);  --t-slate-bg: oklch(95% 0.07 235);
  --t-plum:    oklch(62% 0.20 305);  --t-plum-bg:  oklch(95% 0.08 305);
  --t-rose:    oklch(67% 0.20 15);   --t-rose-bg:  oklch(95% 0.08 15);
  --t-earth:   oklch(72% 0.18 60);   --t-earth-bg: oklch(95% 0.08 60);
  /* vertiefte Tints fuer Fuellungen mit weisser Schrift (Pillen, Kapitel-
     Nummern, Tags): selbe Hues, dunkler -> weisser Text erreicht WCAG AA
     (4,6-4,8:1). Helle --t-*-bg-Flaechen und Tint-als-Text bleiben unberuehrt. */
  --t-sage-deep:  oklch(54% 0.15 150);
  --t-slate-deep: oklch(55% 0.12 235);
  --t-plum-deep:  oklch(58% 0.20 305);
  --t-rose-deep:  oklch(58% 0.20 15);
  --t-earth-deep: oklch(57% 0.13 60);

  --display: 'Baloo 2', 'Fredoka', 'Quicksand', system-ui, sans-serif;
  --mark:    oklch(87% 0.16 92);   /* sonniges Gelb: Marker, Eyebrow, Header */
  --sans:    'Nunito', ui-sans-serif, system-ui, sans-serif;
  --mono:    'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --w: 1180px;
  --w-narrow: 880px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Page background — fixed, behind all content. Soft warm corner washes
   for a calm and friendly appearance. */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(1200px 800px at 12% -8%, oklch(96% 0.06 80 / 0.55), transparent 60%),
    radial-gradient(900px 700px at 110% 18%, oklch(95% 0.07 25 / 0.45), transparent 55%);
}

a { color: inherit; text-decoration: none; }
em {
  font-style: normal;
  color: var(--accent);
  font-weight: 700;
  background: linear-gradient(transparent 62%, oklch(95% 0.13 25 / 0.85) 62%);
  padding: 0 4px;
  border-radius: 4px;
}

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px) { .wrap { padding: 0 20px; } }

/* ======================= Top bar ======================= */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 2px solid var(--rule);
}
.topbar .inner {
  max-width: var(--w); margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.topbar .logo {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
}
.topbar .logo .glyph {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid color-mix(in oklab, var(--accent) 55%, var(--paper));
  overflow: hidden;
  box-shadow: 0 2px 0 oklch(60% 0.18 30);
}
.topbar .logo .glyph img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 3px;
}
.topbar .nav-wrap {
  display: flex; align-items: center; gap: 20px;
}
.topbar .nav {
  display: flex; align-items: center; gap: 24px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px; color: var(--ink-2);
}
.topbar .lang-switch {
  display: inline-flex; align-items: center; gap: 2px;
  font-family: var(--display); font-weight: 600; font-size: 13px;
  border: 2px solid var(--rule); border-radius: 999px;
  padding: 2px; background: var(--paper);
}
.topbar .lang-switch a {
  padding: 3px 9px; border-radius: 999px; color: var(--ink-2);
  line-height: 1; transition: background .15s, color .15s;
}
.topbar .lang-switch a:hover { color: var(--accent); }
.topbar .lang-switch a.active {
  background: var(--accent); color: var(--paper);
}
.topbar .nav a { position: relative; padding: 4px 0; transition: color .15s; }
.topbar .nav a:hover { color: var(--accent); }
.topbar .nav a.active { color: var(--accent); }
.topbar .nav a.coming { opacity: 0.55; }
.topbar .nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -16px; height: 3px;
  border-radius: 3px;
  background: var(--accent);
}
/* Toggle-Checkbox: im Desktop-Layout komplett aus, weil das Menü dort immer
   offen ist (sonst wäre sie ein unsichtbarer, funktionsloser Tab-Stopp). Im
   Mobil-Layout (Media-Query unten) wird sie visuell versteckt, bleibt aber
   fokussierbar (Tastatur/Screenreader) statt via hidden/display:none aus dem
   Accessibility-Tree zu fallen. */
.topbar .nav-toggle { display: none; }
/* Sichtbarer Fokus-Indikator auf dem Burger, wenn die Checkbox per Tastatur
   fokussiert ist (Geschwister-Selektor, kein :has()). */
.topbar .nav-toggle:focus-visible ~ .nav-burger {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Hamburger-Schalter: nur im Mobil-Layout sichtbar (siehe Media-Query). */
.topbar .nav-burger {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  cursor: pointer;
  border-radius: 12px;
  border: 2px solid var(--rule);
  background: var(--paper);
  -webkit-tap-highlight-color: transparent;
}
.topbar .nav-burger-bars,
.topbar .nav-burger-bars::before,
.topbar .nav-burger-bars::after {
  content: ""; display: block;
  width: 22px; height: 2.5px; border-radius: 2px;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.topbar .nav-burger-bars::before { transform: translateY(-7px); }
.topbar .nav-burger-bars::after  { transform: translateY(7px); }
/* Geöffnet: Balken werden zum X (Geschwister-Selektor statt :has()). */
.topbar .nav-toggle:checked ~ .nav-burger .nav-burger-bars { background: transparent; }
.topbar .nav-toggle:checked ~ .nav-burger .nav-burger-bars::before { transform: rotate(45deg); }
.topbar .nav-toggle:checked ~ .nav-burger .nav-burger-bars::after  { transform: rotate(-45deg); }

@media (max-width: 640px) {
  .topbar .inner {
    flex-wrap: wrap; row-gap: 0; column-gap: 12px;
    padding: 12px 20px;
  }
  .topbar .nav-burger { display: inline-flex; }
  /* Im Mobil-Layout sr-only: unsichtbar, aber fokussierbar. */
  .topbar .nav-toggle {
    display: block;
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px; border: 0;
    overflow: hidden; white-space: nowrap;
    clip: rect(0, 0, 0, 0);
  }
  /* Menü standardmäßig zugeklappt; nur bei aktivem Schalter ausklappen. */
  .topbar .nav-wrap {
    display: none;
    flex-basis: 100%; width: 100%;
    flex-direction: column; gap: 14px;
    align-items: center;
    padding-top: 12px;
  }
  .topbar .nav-toggle:checked ~ .nav-wrap { display: flex; }
  .topbar .nav {
    gap: 12px 16px; font-size: 15px;
    flex-direction: column; align-items: center;
  }
  .topbar .nav a { white-space: nowrap; }
  .topbar .nav a.active::after { bottom: -6px; }
  .topbar .nav a[href*="github"] { display: none; }
}

/* ======================= Hero (landing) ======================= */
.hero {
  padding: 64px 0 56px;
  border-bottom: 2px dashed var(--rule);
}
.hero .inner {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 900px) { .hero .inner { grid-template-columns: 1fr; gap: 32px; } }

.hero-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.hero-mascots {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: end;
}
.hero-mascots img {
  height: 136px; width: auto; flex-shrink: 0;
  filter: drop-shadow(0 6px 8px color-mix(in oklab, var(--ink) 18%, transparent));
}
.hero-mascots .mascot-euli   { transform: rotate(-5deg); }
.hero-mascots .mascot-wizard { transform: rotate(4deg); }
@media (max-width: 900px) {
  .hero-mascots img { height: 108px; }
}

.hero-mascots img { cursor: pointer; will-change: transform; }

@keyframes mascot-euli-wiggle {
  0%   { transform: rotate(-5deg)  translateY(0)     scale(1);    }
  15%  { transform: rotate(-13deg) translateY(-12px) scale(1.05); }
  30%  { transform: rotate(3deg)   translateY(0)     scale(1);    }
  45%  { transform: rotate(-11deg) translateY(-8px)  scale(1.03); }
  60%  { transform: rotate(1deg)   translateY(0)     scale(1);    }
  75%  { transform: rotate(-8deg)  translateY(-4px)  scale(1.01); }
  100% { transform: rotate(-5deg)  translateY(0)     scale(1);    }
}
@keyframes mascot-wizard-twirl {
  0%   { transform: rotate(4deg)   translateY(0)     scale(1);    }
  25%  { transform: rotate(94deg)  translateY(-8px)  scale(1.04); }
  50%  { transform: rotate(184deg) translateY(-10px) scale(1.06); }
  75%  { transform: rotate(274deg) translateY(-8px)  scale(1.04); }
  100% { transform: rotate(364deg) translateY(0)     scale(1);    }
}
.hero-mascots .mascot-euli.is-tapped   { animation: mascot-euli-wiggle 0.8s ease-in-out; }
.hero-mascots .mascot-wizard.is-tapped { animation: mascot-wizard-twirl 0.9s ease-in-out; }

@media (prefers-reduced-motion: reduce) {
  .hero-mascots .mascot-euli.is-tapped,
  .hero-mascots .mascot-wizard.is-tapped { animation: none; }
}

/* Eyebrow als gelbes Sticker-Pill mit Ink-Kontur und leichter Drehung.
   Site-weite Basis (frueher nur ``body.home``), damit Unterseiten wie
   /uebungsblaetter denselben Marken-Look tragen wie die Startseite. */
.eyebrow {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--mark);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 1.5px 1.5px 0 var(--ink);
  padding: 7px 16px;
  margin-bottom: 24px;
  transform: rotate(-1.5deg);
}
.display {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(56px, 9vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
.display em {
  background: linear-gradient(transparent 70%, var(--t-earth-bg) 70%);
  font-weight: 700;
  color: var(--accent);
  padding: 0 8px;
  border-radius: 8px;
}
.lede {
  margin: 28px 0 0;
  max-width: 44ch;
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

.hero-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.meta-cell {
  background: var(--paper);
  padding: 16px 18px;
  border: 2px solid var(--rule);
  border-radius: 18px;
  transition: transform .25s ease, border-color .25s;
}
.meta-cell:nth-child(1) { border-color: color-mix(in oklab, var(--t-sage) 45%, var(--rule)); background: var(--t-sage-bg); }
.meta-cell:nth-child(2) { border-color: color-mix(in oklab, var(--t-slate) 45%, var(--rule)); background: var(--t-slate-bg); }
.meta-cell:nth-child(3) { border-color: color-mix(in oklab, var(--t-rose) 45%, var(--rule)); background: var(--t-rose-bg); }
.meta-cell:nth-child(4) { border-color: color-mix(in oklab, var(--t-plum) 45%, var(--rule)); background: var(--t-plum-bg); }
.meta-cell:hover { transform: translateY(-2px) rotate(-0.5deg); }
.meta-cell .k {
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-2);
}
.meta-cell .v {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  margin-top: 6px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* ======================= Class cards ======================= */
.classes { padding: 72px 0 56px; }
.classes-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: baseline;
  margin-bottom: 36px;
  padding-bottom: 18px;
  border-bottom: 2px dashed var(--rule);
}
@media (max-width: 720px) { .classes-head { grid-template-columns: 1fr; gap: 8px; } }

.section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 42px);
  letter-spacing: -0.02em;
  margin: 0;
}
.section-sub {
  margin: 0;
  color: var(--ink-2);
  font-size: 16px;
  max-width: 58ch;
}

.class-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 820px) { .class-grid { grid-template-columns: 1fr; } }

.class-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.class-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 14px;
  padding: 28px 36px 26px;
  background: var(--tint-bg);
  border: 3px solid var(--tint);
  border-radius: 28px;
  min-height: 320px;
  transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .25s;
  overflow: hidden;
  box-shadow: 0 6px 0 color-mix(in oklab, var(--tint) 60%, var(--ink) 8%);
}
.class-card::before {
  content: "";
  position: absolute;
  top: -30px; right: -30px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, color-mix(in oklab, var(--tint) 28%, transparent) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.class-card > * { position: relative; z-index: 1; }
.class-card:hover {
  transform: translateY(-4px) rotate(-0.6deg);
  box-shadow: 0 12px 0 color-mix(in oklab, var(--tint) 60%, var(--ink) 8%);
}

.class-card .num {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(80px, 12vw, 140px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--tint);
  margin-bottom: 4px;
  text-shadow: 0 4px 0 color-mix(in oklab, var(--tint) 35%, var(--paper));
}
.class-card .num sup {
  font-size: 0.22em;
  font-family: var(--display);
  font-weight: 600;
  vertical-align: top;
  margin-left: 6px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  top: 1.2em;
  position: relative;
  text-shadow: none;
}
.class-card .title {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.class-card .kicker {
  font-size: 15px;
  color: var(--ink-2);
  max-width: 42ch;
  text-wrap: pretty;
  line-height: 1.5;
}
.class-card .stats {
  display: flex;
  gap: 18px;
  padding-top: 16px;
  border-top: 2px dashed color-mix(in oklab, var(--tint) 50%, transparent);
  margin-top: 6px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-2);
  align-self: end;
}
.class-card .stats b {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  color: var(--tint);
  margin-right: 4px;
}
.class-card .arrow {
  position: absolute;
  right: 22px;
  top: 22px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--paper);
  color: var(--tint);
  border-radius: 50%;
  border: 2px solid var(--tint);
  transition: transform .3s cubic-bezier(.2,.7,.2,1), background .2s, color .2s;
  z-index: 2;
}
.class-card:hover .arrow {
  transform: translateX(4px) rotate(-12deg);
  background: var(--tint-deep, var(--tint));
  color: var(--paper);
}

/* "Bald verfügbar"-Karten: gedämpft, ohne Pfeil/Statistik */
.class-card-wrap.coming .class-card { opacity: 0.82; }
.class-card-wrap.coming .class-card:hover {
  transform: translateY(-2px);
}
.class-card .soon-badge {
  align-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--paper);
  border: 2px dashed var(--tint);
  color: var(--ink-2);
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  width: fit-content;
}
.class-card .soon-badge::before {
  content: "✏️";
  font-size: 15px;
}

/* ======================= Notes strip ======================= */
.notes { padding: 24px 0 88px; }
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  border-top: 2px dashed var(--rule);
  padding-top: 36px;
}
@media (max-width: 820px) { .notes-grid { grid-template-columns: 1fr; gap: 24px; } }
.note .k {
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 12px;
}
.note h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  text-wrap: balance;
}
.note p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  text-wrap: pretty;
  max-width: 36ch;
}

/* Hand-drawn icon in a sticker-style rotating bubble on each note. */
.note { position: relative; }
.note-icon {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 2.5px solid var(--rule);
  border-radius: 50%;
  margin-bottom: 14px;
  box-shadow: 3px 3px 0 color-mix(in oklab, var(--ink) 10%, transparent);
  transform: rotate(-4deg);
  color: var(--accent);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.note-icon svg { width: 28px; height: 28px; }
.note:nth-child(2) .note-icon {
  border-color: color-mix(in oklab, var(--t-slate) 60%, var(--rule));
  color: var(--t-slate);
  transform: rotate(3deg);
}
.note:nth-child(3) .note-icon {
  border-color: color-mix(in oklab, var(--t-plum) 60%, var(--rule));
  color: var(--t-plum);
  transform: rotate(-2deg);
}
.note:hover .note-icon { transform: rotate(0deg) scale(1.06); }
.note .k { margin-bottom: 6px; }

/* ======================= Class page head ======================= */
.page-head {
  padding: 44px 0 40px;
  border-bottom: 2px dashed var(--rule);
}
.page-head .wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
}
@media (max-width: 820px) {
  .page-head .wrap { grid-template-columns: 1fr; }
}
.page-head .mascots {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: flex-end;
}
.page-head .mascots img {
  height: 112px; width: auto; flex-shrink: 0;
  filter: drop-shadow(0 4px 6px color-mix(in oklab, var(--ink) 14%, transparent));
}
.page-head .mascots .mascot-euli   { transform: rotate(-4deg); }
.page-head .mascots .mascot-wizard { transform: rotate(3deg); }
@media (max-width: 820px) {
  .page-head .mascots { justify-content: flex-start; }
  .page-head .mascots img { height: 90px; }
}
.crumbs {
  font-family: var(--display);
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 22px;
}
.crumbs a { color: var(--ink-3); transition: color .15s; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 10px; opacity: 0.6; }
.page-head h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
/* Sonniger Marken-Marker (gelb, Tinte als Schrift) wie auf der Startseite,
   statt des frueheren blassen Pfirsich-Gradients mit Coral-Schrift. */
.page-head h1 em {
  background: linear-gradient(transparent 68%, var(--mark) 68%);
  color: var(--ink);
  font-weight: 700;
  padding: 0 8px;
  border-radius: 8px;
}
.page-head .sub {
  margin: 18px 0 0;
  max-width: 56ch;
  font-size: 17px;
  color: var(--ink-2);
  text-wrap: pretty;
}
.hint {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 22px;
  padding: 8px 16px;
  background: var(--paper);
  border: 2px solid color-mix(in oklab, var(--accent) 35%, var(--rule));
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-2);
}
.hint .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 40%, transparent); }
  50%      { box-shadow: 0 0 0 8px transparent; }
}

/* ======================= Layout: TOC + solutions ======================= */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  padding: 48px 32px 88px;
  align-items: start;
}
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 28px; padding: 28px 20px 56px; }
}

/* ---- TOC ---- */
aside.toc {
  position: sticky;
  top: 80px;
  font-size: 14px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 12px;
}
@media (max-width: 960px) {
  aside.toc {
    position: static; max-height: none; padding: 20px;
    background: var(--paper-2); border: 2px solid var(--rule);
    border-radius: 18px;
  }
}
.toc-head {
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 14px;
}
.search {
  width: 100%;
  padding: 12px 16px;
  font: 14px/1.3 var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--rule);
  border-radius: 999px;
  margin-bottom: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 16%, transparent);
}
.search::placeholder { color: var(--ink-3); }

aside.toc ol {
  list-style: none;
  counter-reset: chp;
  padding: 0; margin: 0;
}
aside.toc li {
  counter-increment: chp;
  border-top: 1px solid var(--rule);
}
aside.toc li:last-child { border-bottom: 1px solid var(--rule); }
aside.toc li.hidden { display: none; }
aside.toc a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 10px 0;
  color: var(--ink-2);
  transition: color .2s;
  line-height: 1.3;
}
aside.toc a::before {
  content: counter(chp, decimal-leading-zero);
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-3);
  padding-top: 3px;
}
aside.toc a.toc-chapter {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
}
aside.toc a:hover { color: var(--accent); }
aside.toc a.active { color: var(--accent); }
aside.toc a.active::before { color: var(--accent); }

/* Nested section list inside each TOC chapter */
aside.toc ol.toc-sections {
  counter-reset: none;
  padding: 4px 0 8px 28px;
  margin: 0;
  border-top: none;
}
aside.toc ol.toc-sections li {
  counter-increment: none;
  border-top: none;
  border-bottom: none;
}
aside.toc ol.toc-sections li:last-child { border-bottom: none; }
aside.toc ol.toc-sections a {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  font-family: var(--sans);
  color: var(--ink-3);
}
aside.toc ol.toc-sections .toc-label {
  color: var(--ink-2);
  text-wrap: pretty;
}
aside.toc ol.toc-sections a::before { content: none; }
aside.toc ol.toc-sections a:hover { color: var(--accent); }
aside.toc ol.toc-sections a.active { color: var(--accent); }
.toc-page {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  text-align: right;
  white-space: nowrap;
  padding-top: 1px;
}
.toc-marker {
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
}
.toc-label { text-wrap: pretty; }

/* ---- Solutions list ---- */
main.solutions { min-width: 0; }
.chapter {
  padding: 40px 0 44px;
  border-bottom: 2px dashed var(--rule);
  scroll-margin-top: 80px;
}
.chapter:first-child { padding-top: 0; }
.chapter-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}
.chapter-num {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--tint-deep, var(--tint));
  color: var(--paper);
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
}
.chapter-head h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 2.8vw, 38px);
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
.chapter-tag {
  font-family: var(--display);
  font-weight: 600;
  font-size: 12px;
  color: var(--paper);
  padding: 4px 14px;
  background: var(--tint-deep, var(--tint));
  border-radius: 999px;
  white-space: nowrap;
}
.chapter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chapter-toggle-all {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--tint);
  background: var(--paper);
  color: var(--tint);
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}
.chapter-toggle-all:hover {
  background: var(--tint-deep, var(--tint));
  color: var(--paper);
}
.chapter-toggle-all.open {
  background: var(--tint-deep, var(--tint));
  color: var(--paper);
  transform: rotate(45deg);
}

/* ---- Task (details/summary) ---- */
.tasks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task {
  background: var(--paper);
  border: 2px solid color-mix(in oklab, var(--tint) 35%, var(--rule));
  border-radius: 14px;
  transition: border-color .25s, transform .25s;
}
.task[open] {
  border-color: var(--tint);
}
.task > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 12px;
  transition: background .2s;
  position: relative;
}
.task:hover > summary { background: var(--tint-bg); }

/* Page group header above all sections that share a printed page.
   .seiten-anker = versions-stabiler QR-Sprunganker (#p-N), ein leeres Element
   direkt vor der .page-group. Er teilt deren Sticky-Header-Offset, sonst
   verschwindet die erste Aufgabe beim Scannen unter dem Header. */
.page-group,
.seiten-anker { scroll-margin-top: 84px; }
.page-group + .page-group { margin-top: 22px; }
.page-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 0 10px;
  margin-top: 16px;
}
.page-group-num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  color: var(--paper);
  background: var(--tint-deep, var(--tint));
  padding: 4px 12px;
  border-radius: 999px;
}
.page-group-topic {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  color: var(--ink);
}
.page-group:first-of-type .page-group-head {
  margin-top: 0;
}
.task > summary::-webkit-details-marker { display: none; }

.task .marker {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--tint-bg);
  color: var(--tint);
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}
.task[open] .marker { background: var(--tint-deep, var(--tint)); color: var(--paper); }
.task .label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.005em;
  text-wrap: pretty;
}
.task .reveal {
  font-family: var(--display);
  font-weight: 500;
  font-size: 13px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color .2s;
}
.task .reveal::after {
  content: "+";
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  transition: transform .25s, color .2s, background .2s;
  display: inline-grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--t-earth-bg);
}
.task[open] .reveal::after {
  content: "−";
  background: var(--accent);
  color: var(--paper);
}

/* ---- Answer body ---- */
.task .body {
  padding: 4px 18px 22px 70px;
  color: var(--ink);
  animation: slideIn .28s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.task-hilfe {
  margin: 14px 0 0;
}
.task-hilfe .page-head-link {
  font-size: 13px;
  padding: 6px 12px;
}
@media (max-width: 560px) {
  .task .body { padding-left: 18px; }
}

/* answers rendered as ul — chips layout */
.task .body ul {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
  max-width: 640px;
}
.task .body ul li {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 16px;
  background: var(--tint-bg);
  color: var(--tint);
  padding: 10px 10px;
  text-align: center;
  border-radius: 12px;
  border: 2px solid color-mix(in oklab, var(--tint) 35%, transparent);
  min-height: 40px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1.3;
}
.task .body ul li[data-long] {
  grid-column: span 3;
  text-align: left;
  justify-content: flex-start;
  font-size: 14px;
  padding: 10px 14px;
}
@media (max-width: 560px) {
  .task .body ul { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
  .task .body ul li[data-long] { grid-column: 1 / -1; }
}

/* numbered ol answers */
.task .body ol {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: ans;
}
.task .body ol li {
  counter-increment: ans;
  padding: 12px 16px;
  background: var(--tint-bg);
  border-left: 4px solid var(--tint);
  border-radius: 0 12px 12px 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
}
.task .body ol li strong {
  font-family: var(--display);
  font-weight: 700;
  color: var(--tint);
  margin-right: 8px;
  font-size: 16px;
}

/* tables */
.task .body table {
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 14px;
  margin: 6px 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}
.task .body table th,
.task .body table td {
  padding: 8px 12px;
  border: 1px solid var(--rule);
  text-align: center;
  min-width: 44px;
}
.task .body table thead th,
.task .body table tbody tr th {
  background: var(--tint-bg);
  color: var(--ink);
  font-weight: 600;
  font-family: var(--display);
}
.task .body table thead th:first-child {
  background: var(--tint-deep, var(--tint));
  color: var(--paper);
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
}

/* ===================================================================
   Klasse-Loesungsseite: Lesbarkeit & Bedienung
   Alle Regeln unter ``body.klasse-loesungen`` gescoped, damit andere
   Seiten (Statistik, Checks, Eltern, ...) unberuehrt bleiben.
   =================================================================== */

/* Kopf-Aktionen: klare Hierarchie statt fuenf gleich lauter Coral-Pills.
   Primaer (Zurueck) gefuellt, Ressourcen als ruhige Outline-Chips,
   Meta-Links (Statistik/Audit) als leise Text-Links. */
body.klasse-loesungen .page-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
body.klasse-loesungen .page-head-link {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--rule-2);
}
body.klasse-loesungen .page-head-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  filter: none;
}
body.klasse-loesungen .page-head-link.primary {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
body.klasse-loesungen .page-head-link.primary:hover { color: var(--paper); }
body.klasse-loesungen .page-head-link.ghost {
  background: none;
  border: none;
  color: var(--ink-3);
  padding: 8px 4px;
}
body.klasse-loesungen .page-head-link.ghost:hover { color: var(--accent); background: none; }

/* Sticky Seiten-Anker: beim Scrollen bleibt sichtbar, welche Buch-Seite
   man gerade liest (Kern-Use-Case "zeig mir Seite N"). */
body.klasse-loesungen .page-group-head {
  position: sticky;
  top: 70px;
  z-index: 5;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: saturate(150%) blur(6px);
  -webkit-backdrop-filter: saturate(150%) blur(6px);
  margin: 0 -10px 12px;
  padding: 9px 10px;
  border-radius: 10px;
  border-bottom: 2px solid color-mix(in oklab, var(--tint) 45%, var(--rule));
}
body.klasse-loesungen .page-group,
body.klasse-loesungen .seiten-anker { scroll-margin-top: 118px; }
body.klasse-loesungen .chapter { scroll-margin-top: 70px; }

/* Aufgaben-Zeilen: kompakter, klarere Beschriftung, ruhiger Marker. */
body.klasse-loesungen .task > summary {
  grid-template-columns: 24px 1fr auto;
  gap: 14px;
  padding: 12px 16px;
}
body.klasse-loesungen .task .marker {
  width: 22px; height: 22px;
  background: none;
  border: 2px solid color-mix(in oklab, var(--tint) 50%, var(--rule));
  color: var(--tint);
  font-size: 12px;
}
body.klasse-loesungen .task[open] .marker {
  background: var(--tint-deep, var(--tint));
  border-color: var(--tint);
}
body.klasse-loesungen .task .label { font-size: 16px; }
body.klasse-loesungen .task .body { padding-left: 54px; }
@media (max-width: 560px) {
  body.klasse-loesungen .task .body { padding-left: 16px; }
}

/* TOC-Suchfeld: kraeftigerer Rahmen, dunklerer Placeholder und Lupen-Icon
   fuer klaren Kontrast auf dem cremefarbenen Hintergrund. */
body.klasse-loesungen .search {
  border: 2px solid color-mix(in oklab, var(--ink) 24%, var(--rule-2));
  color: var(--ink);
  padding-left: 42px;
  background-image: url('data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%235b5b73" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Ccircle cx="11" cy="11" r="7"/%3E%3Cline x1="20" y1="20" x2="16.65" y2="16.65"/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: 15px center;
}
body.klasse-loesungen .search::placeholder { color: var(--ink-2); opacity: 1; }

/* TOC: aktives Element als sauber gerundete Markierung (kein harter Balken,
   der die Kapitelnummer anschneidet). */
body.klasse-loesungen aside.toc a { border-radius: 8px; }
body.klasse-loesungen aside.toc a.active {
  background: color-mix(in oklab, var(--accent) 10%, var(--paper));
}
body.klasse-loesungen aside.toc a.toc-chapter.active {
  background: color-mix(in oklab, var(--accent) 14%, var(--paper));
}

/* Farb-Semantik & Kontrast: Coral bleibt der EINEN Aktion vorbehalten
   (Loesung aufdecken) und nutzt die dunklere, AA-konforme Variante. Die
   "Seite N" ist eine Buch-Koordinate (Referenz, keine Aktion) und steht
   ruhig im Tinten-Grau (6,2:1) statt in zu hellem Coral (3,6:1). */
body.klasse-loesungen .toc-page { color: var(--ink-2); }
/* "Loesung"-Aktion an die Kapitelfarbe gekoppelt statt Coral: ruhiges
   Grau-Label (6,2:1), der +/--Schalter traegt die vertiefte Kapitelfarbe
   mit weisser Schrift (WCAG AA). Kein "Fehler-Rot" auf jeder Zeile, dezente
   Farbcodierung; die ganze Zeile bleibt klickbar. */
body.klasse-loesungen .task .reveal { color: var(--ink-2); }
body.klasse-loesungen .task .reveal::after {
  color: var(--paper);
  background: var(--tint-deep, var(--tint));
}
body.klasse-loesungen .task[open] .reveal::after {
  background: var(--tint-deep, var(--tint));
  color: var(--paper);
}

/* ======================= Footer ======================= */
.foot {
  border-top: 2px dashed var(--rule);
  padding: 32px 0;
  margin-top: 24px;
}
.foot .inner {
  max-width: var(--w); margin: 0 auto; padding: 0 32px;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-family: var(--display);
  font-weight: 500;
  font-size: 13px; color: var(--ink-3);
}
.foot a {
  color: var(--ink-2);
  border-bottom: 2px solid var(--rule-2);
  transition: color .2s, border-color .2s;
}
.foot a:hover { color: var(--accent); border-color: var(--accent); }
.foot-links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.foot-brand { color: var(--ink-3); font-size: 0.9em; }
mark.platzhalter {
  background: oklch(95% 0.10 75);
  color: oklch(45% 0.16 65);
  border-radius: 4px;
  padding: 1px 6px;
  font-style: italic;
}

/* ======================= Figures (SVG solutions) ======================= */
.figure-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  padding: 4px 0;
}
/* Festes Spalten-Raster (z. B. Rechenquadrate: 5 je Reihe, wie im Buch).
   --fig-cols steuert die Spaltenzahl; auf schmalen Schirmen scrollbar. */
.figure-grid.grid-cols {
  display: grid;
  grid-template-columns: repeat(var(--fig-cols, 5), max-content);
  justify-content: start;
  gap: 8px;
  overflow-x: auto;
}
.figure-grid.grid-cols .fig { padding: 6px; }
/* Spaltenweise befüllte Variante (--fig-rows feste Zeilenzahl), wenn das Buch
   spaltenweise auslegt (z. B. bilder_addieren: col = i // per_col). */
.figure-grid.grid-cols-cm {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(var(--fig-rows, 1), auto);
  grid-auto-columns: max-content;
  justify-content: start;
  gap: 8px;
  overflow-x: auto;
}
.figure-grid.grid-cols-cm .fig { padding: 6px; }
/* Lösungs-Raster für Text-Antworten (z. B. Einkaufen): N Spalten, zeilenweise. */
.sol-grid {
  display: grid;
  grid-template-columns: repeat(var(--sol-cols, 2), max-content);
  gap: 8px 28px;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 15px;
}
.sol-grid .sol-idx { color: var(--ink-2); font-weight: 600; margin-right: 5px; }
.sol-grid .solution { color: var(--accent); font-weight: 700; }
/* Bild-Boss: Lösungen wie die Ställe – 2 Spalten, letzte mittig. */
.boss-grid {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 10px 32px;
  justify-content: center;
  font-family: var(--mono);
  font-size: 16px;
}
.boss-grid .boss-wide { grid-column: 1 / -1; justify-self: center; }
.boss-grid .solution { color: var(--accent); font-weight: 700; }
/* Spaltenweise befüllte Variante (z. B. Kalender: links/rechts gruppiert). */
.sol-grid.cm {
  grid-auto-flow: column;
  grid-template-columns: none;
  grid-auto-columns: max-content;
  grid-template-rows: repeat(var(--sol-rows, 1), auto);
}
.figure-grid .fig {
  margin: 0;
  padding: 12px;
  background: var(--paper);
  border: 2px solid color-mix(in oklab, var(--tint) 25%, var(--rule));
  border-radius: 14px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.figure-grid .fig-svg {
  display: block;
  max-width: 100%;
  height: auto;
}
.figure-grid figcaption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  text-align: center;
}

/* SVG element styles */
.fig-svg .given,
.fig-svg .cell-num.given,
.fig-svg .node-num.given,
.fig-svg .roof-num,
.fig-svg .hub-num.given,
.fig-svg .clock-num,
.fig-svg .coin-text,
.fig-svg .card-num,
.fig-svg .parity-num {
  font-family: var(--mono);
  font-weight: 500;
  fill: var(--ink);
  font-size: 16px;
}
.fig-svg .solution,
.fig-svg .cell-num.solution,
.fig-svg .node-num.solution {
  font-family: var(--mono);
  font-weight: 700;
  fill: var(--accent);
  font-size: 16px;
}
.fig-svg .numline-num {
  font-family: var(--mono);
  font-size: 13px;
}
.fig-svg .numline-num.solution {
  font-weight: 700;
  fill: var(--accent);
}
.fig-svg .axis,
.fig-svg .tick {
  stroke: var(--ink-2);
  stroke-width: 1.4;
  fill: none;
}
.fig-svg polygon.axis { fill: var(--ink-2); stroke: none; }

.fig-svg .cell.given {
  fill: var(--tint-bg);
  stroke: color-mix(in oklab, var(--tint) 35%, transparent);
  stroke-width: 1;
}
.fig-svg .cell.solution {
  fill: color-mix(in oklab, var(--accent) 14%, var(--paper));
  stroke: var(--accent);
  stroke-width: 1.4;
}

/* Kalender (Hilfe-Beispiel): Wochentag-Kopf, Raster, markierter Tag */
.fig-svg .kal-header { fill: var(--tint, var(--accent)); }
.fig-svg .kal-wd {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  fill: var(--paper);
}
.fig-svg .kal-grid {
  stroke: color-mix(in oklab, var(--tint) 30%, var(--rule));
  stroke-width: 1;
}
.fig-svg .kal-mark { fill: var(--tint, var(--accent)); }
.fig-svg .cell-num.today { fill: var(--paper); }
.kal-fig .kal-fragen {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
  text-align: center;
}
.kal-fig .kal-fragen li { margin: 2px 0; }
.kal-fig .kal-fragen .solution { color: var(--accent); font-weight: 700; }

/* Rechen-Labyrinth (Hilfe-Beispiel): Knoten + Verbindungslinien + Lösungsweg */
/* Magisches Quadrat (Hilfe/Lösung): durchgestrichene Pool-Zahl (alle platziert) */
.fig-svg .pool-strike { stroke: #2e8e44; stroke-width: 2; stroke-linecap: round; }

.fig-svg .laby-line { stroke: color-mix(in oklab, var(--ink-2) 35%, var(--rule)); stroke-width: 1.2; }
.fig-svg .laby-sol { stroke: #2e8e44; stroke-width: 3.2; stroke-linecap: round; }
.fig-svg .laby-node { stroke: none; }
.fig-svg .laby-num { font-family: var(--mono); font-weight: 700; font-size: 15px; fill: #fff; }
.fig-svg .laby-ziel { font-family: var(--mono); font-size: 12px; fill: var(--ink-2); }

/* Schatzsuche (Hilfe-Beispiel): Ziel-Zahl im Kessel-Bauch */
.fig-svg .schatz-kessel-num { font-family: 'Baloo 2', var(--mono); font-weight: 800; fill: #44413a; }

.fig-svg .roof {
  fill: var(--tint-bg, oklch(95% 0.08 60));
  stroke: var(--tint, oklch(72% 0.18 60));
  stroke-width: 1.2;
}
.fig-svg .plus {
  font-family: var(--mono);
  fill: var(--ink-2);
  font-size: 18px;
  font-weight: 500;
}

.fig-svg .connector {
  stroke: var(--ink-3);
  stroke-width: 1;
  fill: none;
}

.fig-svg .ring {
  stroke: var(--rule-2);
  stroke-width: 1.4;
  fill: none;
}
.fig-svg .ring-label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  fill: var(--ink-3);
}
.fig-svg .ring-arrow {
  stroke: var(--accent);
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
}
.fig-svg .ring-arrow-head {
  fill: var(--accent);
  stroke: none;
}
.fig-svg .ring-step {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  fill: var(--accent);
}
.fig-svg .node-bg.given {
  fill: var(--tint-bg);
  stroke: color-mix(in oklab, var(--tint) 35%, transparent);
}
.fig-svg .node-bg.solution {
  fill: color-mix(in oklab, var(--accent) 14%, var(--paper));
  stroke: var(--accent);
  stroke-width: 1.4;
}

.fig-svg .dot-cell {
  fill: none;
  stroke: var(--rule-2);
  stroke-width: 1;
}
.fig-svg .dot-fill {
  fill: var(--accent);
}

.fig-svg .caption {
  font-family: var(--mono);
  font-size: 13px;
  fill: var(--ink-2);
}
.fig-svg .caption.strong { font-weight: 600; fill: var(--ink); }

.fig-svg .sum-cell {
  fill: var(--paper-2);
  stroke: var(--rule-2);
}
.fig-svg .triangle {
  stroke: var(--ink-3);
  stroke-width: 1.5;
  fill: none;
}
.fig-svg .hub {
  fill: var(--tint-bg);
  stroke: var(--tint);
  stroke-width: 1.2;
}
.fig-svg .hub-num.given { font-size: 14px; }
.fig-svg .leg {
  stroke: var(--rule-2);
  stroke-width: 1;
  fill: none;
}

.fig-svg .cube {
  fill: color-mix(in oklab, var(--tint) 25%, var(--paper));
  stroke: var(--tint);
  stroke-width: 0.8;
}
.fig-svg .op {
  font-family: var(--mono);
  font-size: 16px;
  fill: var(--ink-2);
}
.fig-svg .op-text { fill: var(--ink-2); }

.fig-svg .clock-face {
  fill: var(--paper);
  stroke: var(--ink-2);
  stroke-width: 1.4;
}
.fig-svg .clock-tick {
  stroke: var(--ink-2);
  stroke-width: 1;
}
.fig-svg .clock-num {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--ink-2);
}
.fig-svg .hand-min {
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.fig-svg .hand-hour {
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
}
.fig-svg .hand-pivot {
  fill: var(--accent);
}

.fig-svg .coin {
  fill: #e3c98a;
  stroke: #b08c4a;
  stroke-width: 0.8;
}
.fig-svg .note {
  fill: #cfe0d2;
  stroke: #6a8a72;
  stroke-width: 0.8;
}
.fig-svg .coin-text {
  font-size: 9px;
  fill: var(--ink);
}

.fig-svg .die {
  fill: var(--paper);
  stroke: var(--ink-2);
  stroke-width: 1.2;
}
.fig-svg .pip {
  fill: var(--ink);
}

.fig-svg .step-op {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  fill: var(--ink-2);
}
.fig-svg .step-line {
  stroke: var(--rule-2);
  stroke-width: 1.4;
}
.fig-svg .kessel-zahl {
  font-weight: 700;
  font-size: 30px;
  fill: var(--ink);
}

.fig-svg .dungeon-cell {
  fill: var(--paper);
  stroke: var(--rule);
}
.fig-svg .dungeon-cell.on-path {
  fill: color-mix(in oklab, var(--accent) 16%, var(--paper));
  stroke: var(--accent);
  stroke-width: 1.4;
}
.fig-svg .dungeon-path {
  stroke: var(--accent);
  stroke-width: 2.4;
  opacity: 0.55;
}
.fig-svg .dungeon-arrow {
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
}
.fig-svg .dungeon-arrow-head { fill: var(--ink); }
.fig-svg .dungeon-op {
  fill: var(--ink);
  font-weight: 700;
  font-size: 14px;
}

.fig-svg .sym-cell.empty {
  fill: var(--paper);
  stroke: var(--rule-2);
}
.fig-svg .sym-cell.fill.given {
  fill: var(--ink);
}
.fig-svg .sym-cell.fill.solution {
  fill: var(--accent);
}
.fig-svg .sym-axis {
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-dasharray: 3 3;
}

.fig-svg .parity-circle.even {
  fill: color-mix(in oklab, var(--t-slate) 18%, var(--paper));
  stroke: var(--t-slate);
}
.fig-svg .parity-circle.odd {
  fill: color-mix(in oklab, var(--t-rose) 18%, var(--paper));
  stroke: var(--t-rose);
}
.fig-svg .parity-legend {
  font-family: var(--mono);
  font-size: 11px;
}
.fig-svg .parity-legend.even { fill: var(--t-slate); }
.fig-svg .parity-legend.odd { fill: var(--t-rose); }

.fig-svg .card {
  fill: var(--paper);
  stroke: var(--ink-3);
  stroke-width: 1;
}
.fig-svg .card.highlight {
  fill: color-mix(in oklab, var(--accent) 14%, var(--paper));
  stroke: var(--accent);
  stroke-width: 1.4;
}

.fig-svg .solution-halo {
  fill: color-mix(in oklab, var(--accent) 16%, var(--paper));
  stroke: var(--accent);
  stroke-width: 1;
}

/* -- Equation rows (rechenaufgabe, vergleiche, fehlersuche, ...) -- */
.eq-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--mono);
  font-size: 15px;
}
/* Mehrspaltige Variante: spaltenweise befüllt (wie im Buch), feste Zeilenzahl
   über --eq-rows. Auf schmalen Schirmen horizontal scrollbar. */
.eq-grid.cols {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(var(--eq-rows, 1), auto);
  grid-auto-columns: max-content;
  column-gap: 18px;
  row-gap: 8px;
  overflow-x: auto;
}
/* Zeilenweise Variante (row-major), z. B. verdoppeln/verdreifachen. */
.eq-grid.rmcols {
  display: grid;
  grid-template-columns: repeat(var(--eq-cols, 2), max-content);
  column-gap: 18px;
  row-gap: 8px;
  overflow-x: auto;
}
.eq-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 14px;
  background: var(--tint-bg);
  border-left: 4px solid var(--tint);
  border-radius: 0 10px 10px 0;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
}
.eq-row .given  { color: var(--ink); }
.eq-row .solution { color: var(--accent); font-weight: 700; }
.eq-row .eq-op  { color: var(--ink-2); font-weight: 500; }

/* Zauberstab-Code: Legende (Symbol = Zahl) über den entschlüsselten Gleichungen. */
.zauber-legende {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-bottom: 12px;
  padding: 8px 14px;
  background: var(--tint-bg);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
}
.zauber-leg { display: inline-flex; align-items: center; }
.zauber-leg .given { color: var(--ink); font-weight: 700; }
.zauber-leg .eq-op { color: var(--ink-2); }
.zauber-sym { font-size: 18px; line-height: 1; }

/* Hilfe-Beispiel: Symbol-Gleichung mit der eingesetzten Zahlen-Gleichung
   direkt darunter (Schritt-für-Schritt-Einsetzen). */
.zauber-schritt { display: flex; flex-direction: column; gap: 6px; }

/* comparison circle (vergleiche) */
.cmp-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: color-mix(in oklab, var(--accent) 12%, var(--paper));
}

/* fehlersuche — wrong answer strikethrough */
.fehler-wrong { text-decoration: line-through; color: var(--ink-3); }
.fehler-arrow { color: var(--ink-3); }

/* tauschaufgaben — commutative pair */
.tausch-row { gap: 18px; }
.tausch-eq  { display: inline-flex; align-items: center; gap: 8px; }
.tausch-sep { color: var(--ink-3); font-size: 18px; }

/* tally marks (strichliste) */
.fig-svg .tally-stroke {
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.fig-svg .tally-cross {
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* Umkehraufgaben — laid out as text rows */
.umkehr-grid {
  display: grid;
  grid-template-columns: repeat(var(--umkehr-cols, 3), max-content);
  gap: 8px 16px;
  font-family: var(--mono);
  font-size: 14px;
  overflow-x: auto;
}
.umkehr-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  background: var(--tint-bg);
  border-left: 4px solid var(--tint);
  border-radius: 0 12px 12px 0;
}
.umkehr-orig { color: var(--ink); font-weight: 600; }
.umkehr-inv { color: var(--ink-2); }
.umkehr-grid .given { color: var(--ink); }
.umkehr-grid .solution {
  color: var(--accent);
  font-weight: 700;
}

/* Zehnerübergang — text rows */
.zue-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--mono);
  font-size: 14px;
}
/* Mehrspaltige Variante (spaltenweise, --zue-rows feste Zeilenzahl). */
.zue-grid.cols {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(var(--zue-rows, 1), auto);
  grid-auto-columns: max-content;
  gap: 8px 26px;
  overflow-x: auto;
}
.zue-row {
  padding: 10px 14px;
  background: var(--tint-bg);
  border-left: 4px solid var(--tint);
  border-radius: 0 12px 12px 0;
}
.zue-row .solution { color: var(--accent); font-weight: 600; }
.zue-row .given { color: var(--ink); font-weight: 600; }

/* Formen — figcaption */
.formen-ans {
  display: inline-block;
  padding: 0 6px;
}

/* ======================= Hilfe (Erklärungen) ======================= */
.hilfe-list { padding: 24px 0 80px; }
.hilfe-kategorie { margin-bottom: 36px; }
.hilfe-kategorie h2 {
  font-family: var(--display);
  font-size: 22px;
  margin: 0 0 14px;
  color: var(--ink);
}
.hilfe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.hilfe-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.hilfe-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.hilfe-card .title { font-weight: 600; font-family: var(--display); }
.hilfe-card .arrow { color: var(--ink-3); font-weight: 600; }

.hilfe-detail { padding: 24px 0 80px; max-width: 760px; }
.hilfe-erklaerung p { line-height: 1.6; margin: 0 0 12px; }
.hilfe-beispiel-box {
  /* Figures (.fig-svg .cell.given, .roof, ...) read --tint/--tint-bg for their
     fills. On Hilfe-Seiten there is no .chapter/.page-head ancestor that sets
     these, so without a value here fills resolve to "invalid" -> schwarz, und
     gegebene Werte werden unleserlich. Default-Tint hier setzen, damit jede
     Beispiel-Figur unabhängig vom Kontext lesbar bleibt. */
  --tint: var(--t-earth);
  --tint-bg: var(--t-earth-bg);
  margin-top: 28px;
  padding: 20px 22px;
  background: var(--paper, #FAF6F0);
  border-radius: 14px;
  border: 1px solid var(--rule);
}
.hilfe-beispiel-box h2 {
  font-family: var(--display);
  font-size: 18px;
  margin: 0 0 12px;
  color: var(--ink-2);
}
.hilfe-beispiel { line-height: 1.6; }

/* Eltern-Bereich: optisch abgesetzte Karte unter dem Kind-Teil
   (Erklaerung + Beispiel), damit der Wechsel der Zielgruppe sichtbar ist. */
.hilfe-zusatz {
  margin-top: 38px;
  padding: 22px 24px 10px;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: 14px;
  background: color-mix(in oklab, var(--paper-2) 45%, var(--paper));
}
.hilfe-eltern-titel {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hilfe-eltern-titel::before { content: "👪"; font-size: 18px; }
.hilfe-box h3 {
  font-family: var(--display);
  font-size: 18px;
  margin: 18px 0 6px;
  color: var(--ink);
}
.hilfe-box:first-of-type h3 { margin-top: 0; }
.hilfe-box p { line-height: 1.6; margin: 0 0 4px; color: var(--ink-2); }

.hilfe-equations {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  font-family: var(--mono, "Geist Mono", monospace);
  font-size: 17px;
}
.hilfe-equations li { background: var(--paper); padding: 8px 12px; border-radius: 6px; }
.hilfe-equations strong { color: var(--accent); }
.hilfe-back {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.hilfe-back a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ======================= Print ======================= */
@media print {
  body::before { display: none; }
  .topbar, aside.toc, .hint, .foot, .class-card .arrow,
  .hero-mascots, .page-head .mascots { display: none; }
  .task .body { display: block !important; }
  .task[open] .body { display: block; }
  .layout { grid-template-columns: 1fr; padding: 0; }
}

/* open all tasks in print */
@media print {
  details { page-break-inside: avoid; }
  details > .body { display: block; padding-left: 0; }
}

/* ======================= Statistik-Seite ======================= */
.page-head-actions { margin: 12px 0 4px; }
.page-head-link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}
.page-head-link:hover { filter: brightness(0.92); }

.stat-section { margin: 28px 0 40px; }
.stat-section h2 {
  font-family: var(--display);
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--ink);
}
.stat-lede { color: var(--ink-2); margin: 0 0 14px; }

.stat-table-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 8px;
}
.copy-table-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.copy-table-btn:hover { background: var(--tint-bg, #f3f3f6); }
.copy-table-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.copy-table-btn[data-copied="true"] { color: var(--accent); border-color: var(--accent); }
.copy-table-btn[data-copied="error"] { color: #b00020; border-color: #b00020; }
.copy-table-btn .copy-icon { font-size: 15px; line-height: 1; }

.stat-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper);
}
.stat-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 16px;
}
.stat-table th, .stat-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}
.stat-table th:last-child, .stat-table td:last-child {
  border-right: none;
}
.stat-table thead th {
  background: var(--tint-bg, #f3f3f6);
  font-weight: 600;
  color: var(--ink);
  position: sticky;
  top: 0;
}
.stat-table th.sortable { cursor: pointer; user-select: none; }
.stat-table th.sortable:hover { background: var(--rule); }
.stat-table th.sortable .sort-ind {
  display: inline-block;
  width: 0.7em;
  margin-left: 4px;
  color: var(--ink-3);
}
.stat-table th.sort-asc .sort-ind::after { content: "▲"; color: var(--accent); }
.stat-table th.sort-desc .sort-ind::after { content: "▼"; color: var(--accent); }
.stat-table th.row-label {
  text-align: left;
  font-weight: 600;
}
.stat-table td.zero { color: var(--ink-3); }
.stat-table td.row-total {
  font-weight: 700;
  color: var(--accent);
}
.stat-table tfoot td, .stat-table tfoot th {
  background: var(--tint-bg, #f7f7fa);
  font-weight: 700;
  border-top: 2px solid var(--rule);
}

.stat-chart {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px;
}

.stat-pies {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 16px;
}
.stat-pie {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px;
}
.stat-pie figcaption {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 8px;
  color: var(--ink);
}
.stat-chart .stat-label {
  font-size: 12px;
  fill: var(--ink);
  font-family: var(--display);
}
.stat-chart .stat-value {
  font-size: 12px;
  fill: var(--ink-2);
  font-family: var(--mono);
}

.zauberbild-loesungen {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.zauberbild-loesung {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.zauberbild-loesung .zauberbild-svg {
  height: 130px;
  width: auto;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 4px;
}

/* -- Audit-/Checks-Seite -- */
.check-status {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}
.check-status.ok    { color: #2E8E44; }
.check-status.warn  { color: #C25A22; }
.check-status.skip  { color: #888; font-style: italic; }
.check-count {
  display: inline-block;
  min-width: 2.4rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: center;
}
.check-count.zero { color: #888; }
.check-count.warn { background: #fbe6dc; color: #C25A22; }
.check-num { text-align: right; }
.check-overview td, .check-overview th { vertical-align: middle; }

.check-block {
  margin: 0.6rem 0;
  border: 1px solid var(--rule, #e5e5e5);
  border-radius: 8px;
  background: #fff;
  scroll-margin-top: 80px;
}
.check-block > summary {
  cursor: pointer;
  padding: 0.7rem 0.9rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.check-block > summary::-webkit-details-marker { display: none; }
.check-block > summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.15s ease;
  color: #888;
}
.check-block[open] > summary::before { transform: rotate(90deg); }
.check-block .check-name { font-weight: 600; }
.check-block.warn { border-color: #f0c8b3; background: #fff8f3; }
.check-block.skip { background: #fafafa; }
.check-list {
  list-style: none;
  margin: 0;
  padding: 0 0.9rem 0.8rem 1.6rem;
}
.check-list li {
  margin: 0.25rem 0;
  font-size: 0.92rem;
  word-break: break-word;
}
.check-list li code {
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, monospace;
  background: #fafafa;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #eee;
}
.check-list li.check-group {
  list-style: none;
  margin: 0.9rem 0 0.35rem -0.9rem;
  padding: 0.2rem 0 0.25rem 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: #444;
  border-bottom: 1px solid #e6d8c8;
}
.check-list li.check-group:first-child {
  margin-top: 0.2rem;
}
.check-skip, .check-ok {
  margin: 0;
  padding: 0 0.9rem 0.8rem 2rem;
  color: #555;
  font-size: 0.92rem;
}

/* ======================================================================
   Startseite (body.home): kräftigere "Bolder & playful"-Variante.
   Bewusst nur auf die Startseite begrenzt, damit die geteilten
   .class-card-/.meta-cell-Komponenten auf Hilfe-/Eltern-Seiten unberührt
   bleiben. Hier: Hero-CTA-Buttons, kompakter/schmaler Stat-Block und
   Comic-Outline-Karten (dicke Ink-Kontur + harter Offset-Schatten,
   Strichlisten-Ziffern mit Ink-Kontur).
   ====================================================================== */

/* Hero-Buttons: "Lösungen ansehen" scrollt zum Klassen-Wähler (#klassen),
   "So geht's" geht auf die Hilfe-Startseite. */
#klassen { scroll-margin-top: 96px; }
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  padding: 14px 26px;
  border-radius: 16px;
  border: 3px solid var(--ink);
  box-shadow: 1.5px 1.5px 0 var(--ink);
  transition: transform .18s cubic-bezier(.2,.7,.2,1), box-shadow .18s;
}
.hero-btn:hover { transform: translate(-2px, -2px); box-shadow: 2px 2px 0 var(--ink); }
.hero-btn.primary { background: var(--accent); color: var(--paper); }
.hero-btn.primary::after { content: " \2192"; }
.hero-btn.ghost { background: var(--paper); color: var(--ink); }

/* Kompakter, schmalerer Stat-Block, unter den Maskottchen zentriert. */
body.home .hero-meta {
  width: 100%;
  max-width: 320px;
  align-self: center;
  gap: 10px;
}
body.home .meta-cell { padding: 10px 14px; }
body.home .meta-cell .k { font-size: 11px; }
body.home .meta-cell .v { font-size: 26px; margin-top: 2px; }

/* Comic-Outline-Karten: Ink-Kontur statt Tint, diagonaler Hartschatten. */
body.home .class-card {
  border-color: var(--ink);
  box-shadow: 1.5px 1.5px 0 var(--ink);   /* sehr dezenter Hartschatten */
  min-height: 0;            /* keine erzwungene Riesenhöhe -> kompakt */
  padding: 22px 28px;
  gap: 12px;
}
/* Hebeeffekt beim Hover: die Karte hebt sich sichtbar an, der Pfeil
   wandert nur mit (kein eigener Sprung mehr). */
body.home .class-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 10px 10px 0 var(--ink);
}
body.home .class-card .num {
  font-size: clamp(3rem, 5vw, 3.8rem);   /* kleiner als das Riesenformat */
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: none;
  letter-spacing: 3px;
  margin-bottom: 0;
}
/* "X. Klasse" hochgestellt: in einer Zeile halten. */
body.home .class-card .num sup {
  white-space: nowrap;
  -webkit-text-stroke: 0;   /* sonst verschluckt die Ink-Kontur den kleinen Text */
  letter-spacing: normal;
}
/* Pfeil-Button: dickerer Strich und sichtbarer Schatten; beim Hover wird
   er dicker (Skalierung + dickerer Strich), ohne nach oben zu wandern. */
body.home .class-card .arrow {
  border: 2.5px solid var(--ink);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
body.home .class-card .arrow svg { stroke-width: 2.8; }
body.home .class-card:hover .arrow {
  background: var(--mark);
  color: var(--ink);
  transform: scale(1.12);
}
body.home .class-card:hover .arrow svg { stroke-width: 3.4; }
/* Dunkle Stat-Zahlen in den Karten (statt Tint), wie im Entwurf. */
body.home .class-card .stats b { color: var(--ink); }

/* ----------------------------------------------------------------------
   Demo-Angleichung: Baloo-Headlines, gelber Marker, Eyebrow-Pill und
   kräftigerer Header (das "zu blasse" Original-Topbar wird gefüllt).
   ---------------------------------------------------------------------- */
body.home {
  --display: 'Baloo 2', 'Fredoka', 'Quicksand', system-ui, sans-serif;
  --mark: oklch(87% 0.16 92);   /* sonniges Gelb für Marker und Eyebrow */
}

/* Eyebrow-Sticker ist jetzt site-weite Basis (siehe ``.eyebrow`` oben);
   kein eigener ``body.home``-Override mehr noetig. */

/* Kompaktere Headline: der Entwurf ist deutlich kleiner als das
   Original-Riesenformat und passt dadurch in zwei Zeilen. */
body.home .display {
  font-size: clamp(2.6rem, 5.6vw, 4.6rem);
  line-height: 1.02;
  position: relative;
  z-index: 0;
}

/* Gelber Marker als leicht gedrehter Balken hinter "Schritt"
   (statt Gradient, der bei großer Schrift klobig wirkt). */
body.home .display em {
  position: relative;
  color: var(--ink);
  background: none;
  padding: 0 4px;
}
body.home .display em::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.04em;
  right: -0.04em;
  bottom: 0.1em;
  height: 0.4em;
  background: var(--mark);
  border-radius: 6px;
  transform: rotate(-1.6deg);
}

/* Kräftigerer Header: fette Navigation, dunkel gefülltes aktives Pill,
   gelbes quadratisches Logo-Glyph. */
.topbar .nav { font-weight: 700; gap: 16px; }
.topbar .nav a { color: var(--ink); white-space: nowrap; }
.topbar .nav a:hover { color: var(--accent); }
.topbar .nav a.active {
  background: var(--ink); color: var(--paper);
  padding: 6px 14px; border-radius: 10px;
}
.topbar .nav a.active::after { display: none; }
.topbar .nav a.coming { opacity: .5; }
.topbar .logo .glyph {
  border-radius: 11px;
  background: var(--mark);
  border: 2.5px solid var(--ink);
  box-shadow: none;
}
.topbar .lang-switch { border-color: var(--ink); }
.topbar .lang-switch a.active { background: var(--ink); color: var(--paper); }

/* "Wähle eine Klassenstufe" zentriert (wie im Prototyp), gestapelt statt
   links/rechts aufgeteilt und ohne Trennlinie direkt unter dem Kopf. */
body.home .classes-head {
  display: block;
  text-align: center;
  max-width: 62ch;
  margin: 0 auto 32px;
  padding-bottom: 0;
  border-bottom: none;
}
body.home .classes-head .section-sub { margin: 8px auto 0; }

/* Note-Links unten: fett mit dickem gelbem Unterstrich (wie im Prototyp). */
body.home .note a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--mark);
  text-decoration-thickness: 4px;
  text-underline-offset: 2px;
}
