/* ======================================================================
   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);

  --display: 'Fredoka', 'Quicksand', system-ui, sans-serif;
  --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);
}
@media (max-width: 640px) {
  .topbar .inner { flex-direction: column; gap: 10px; padding: 12px 20px; }
  .topbar .nav-wrap { flex-direction: column; gap: 10px; }
  .topbar .nav {
    gap: 12px 16px; font-size: 14px;
    flex-wrap: wrap; justify-content: 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 {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--t-earth-bg);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.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);
  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(46px, 7vw, 84px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
.page-head h1 em {
  background: linear-gradient(transparent 70%, var(--t-earth-bg) 70%);
  color: var(--accent);
  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);
  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);
  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);
  color: var(--paper);
}
.chapter-toggle-all.open {
  background: 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 */
.page-group { 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);
  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); 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);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
}

/* ======================= 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;
}
.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;
}

.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 .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 .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 .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;
}
.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; }

/* 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: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--mono);
  font-size: 14px;
}
.umkehr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 14px;
  background: var(--tint-bg);
  border-left: 4px solid var(--tint);
  border-radius: 0 12px 12px 0;
  align-items: baseline;
}
.umkehr-orig { color: var(--ink); }
.umkehr-arrow { color: var(--ink-3); }
.umkehr-inv { color: var(--ink); }
.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;
}
.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; }
.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;
}
