/* =========================================================
   Tamara lernt – gemeinsames Stylesheet für die ganze Website
   ========================================================= */

:root {
  /* Farben */
  --green: #5a9e2f;
  --green-dark: #3f7520;
  --green-deep: #2c5516;
  --green-light: #e6f2dd;
  --green-pale: #f4f9f0;
  --ink: #1f2d1b;
  --muted: #5d6c58;
  --border: #d5e4cc;
  --bg: #eef4ea;
  --surface: #ffffff;
  --warn-bg: #fff7e0;
  --warn-line: #e0b23c;
  --info-bg: #edf5fc;
  --info-line: #8bb6de;

  /* Fächerfarben (Startseite) */
  --geografie: #2f9e7a;
  --gschicht: #b5651d;
  --zeichne: #d6457a;
  --chemie: #7b4fd6;
  --physik: #2b6cd6;
  --biologie: #5a9e2f;

  /* Formen & Abstände */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 28px rgba(44, 85, 22, 0.08);
  --shadow-hover: 0 14px 34px rgba(44, 85, 22, 0.16);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
}

/* ---------- Grundlagen ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: var(--space-4) 16px var(--space-5);
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

h1, h2, h3, h4, h5 {
  margin: 0 0 0.6em;
  line-height: 1.25;
  color: var(--green-deep);
}

h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3.5vw, 1.7rem); }
h3 { font-size: 1.2rem; margin-top: 1.8em; }
h4 { font-size: 1.07rem; margin-top: 1.5em; }
h5 { font-size: 1rem; }

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.4em;
  padding-left: 0.2em;
}

li::marker {
  color: var(--green);
  font-weight: 700;
}

li > ul,
li > ol {
  margin-top: 0.4em;
}

a {
  color: var(--green-dark);
  text-underline-offset: 3px;
}

strong, b {
  color: var(--green-deep);
}

img {
  max-width: 100%;
}

sub, sup {
  line-height: 0;
}

:focus-visible {
  outline: 3px solid #e6a700;
  outline-offset: 3px;
}

/* ---------- Layout ---------- */
.container {
  max-width: 920px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 3px solid var(--green);
}

.page-header h1 {
  margin: 0;
}

.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: background 0.15s, color 0.15s;
}

.back:hover {
  background: var(--green);
  color: #fff;
}

.content {
  min-width: 0;
}

/* ---------- Startseite ---------- */
.container > h1 {
  text-align: center;
  margin-bottom: 0.3em;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 1.15rem;
  margin-bottom: var(--space-4);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 34px 20px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.btn .icon { font-size: 2.6rem; }
.geografie { background: var(--geografie); }
.gschicht  { background: var(--gschicht); }
.zeichne   { background: var(--zeichne); }
.chemie    { background: var(--chemie); }
.physik    { background: var(--physik); }
.biologie  { background: var(--biologie); }

/* ---------- Karten & Bereiche ---------- */
.intro-card,
.bereich,
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.intro-card {
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  border-left: 6px solid var(--green);
  background: linear-gradient(135deg, var(--green-pale), var(--surface) 60%);
}

.intro-card h2 {
  margin-top: 0;
}

.intro-card > :last-child {
  margin-bottom: 0;
}

.eyebrow,
.section-kicker {
  display: block;
  margin: 0 0 0.35rem;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  color: var(--muted);
  font-size: 1.08rem;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: var(--space-2);
}

.status-pill,
.section-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--green-light);
  border: 1px solid var(--border);
  color: var(--green-dark);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.section-badge.soon {
  background: #f1f3ef;
  color: #66705f;
}

.bereich {
  --pad: var(--space-4);
  padding: var(--pad);
  margin: var(--space-5) 0;
  scroll-margin-top: 90px;
  overflow: hidden;
}

/* Kopfband jedes Themas */
.bereich-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: calc(var(--pad) * -1) calc(var(--pad) * -1) var(--space-3);
  padding: var(--space-3) var(--pad);
  background:
    radial-gradient(circle at 92% -20%, rgba(255, 255, 255, 0.22) 0, rgba(255, 255, 255, 0) 45%),
    linear-gradient(135deg, var(--green-deep), var(--green));
  color: #fff;
}

.bereich-header h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.4rem, 3.6vw, 1.85rem);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.bereich-header .section-kicker {
  display: inline-block;
  margin-bottom: 0.55rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #eaf6e0;
}

.future-section .bereich-header {
  background: linear-gradient(135deg, #6b7a64, #95a38d);
}

/* Zwischenüberschriften im Text */
.details-body > h3 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--green-light);
}

.details-body > h4 {
  color: var(--green-dark);
}

/* Auswahlseite Biologie */
.bereich-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: var(--space-3);
}

.bereich-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 6px solid var(--green);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.bereich-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.bereich-card h2 {
  margin: 0;
  font-size: 1.3rem;
}

.bereich-card p {
  flex-grow: 1;
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.bereich-card-icon {
  font-size: 2.3rem;
}

/* Inhaltsverzeichnis / Schnellnavigation */
.toc {
  padding: var(--space-2) var(--space-3);
  margin: var(--space-3) 0;
  border-left: 6px solid var(--green);
}

.toc h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.toc ol {
  margin: 0;
}

.toc:has(> a) {
  position: sticky;
  top: 10px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.75rem;
  border-left-width: 1px;
}

.toc > a {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.toc > a:hover {
  background: var(--green);
  color: #fff;
}

/* ---------- Aufklappbare Lernabschnitte ---------- */
.lernabschnitt,
.future-section details {
  margin: var(--space-2) 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.lernabschnitt > summary,
.future-section details > summary {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 60px;
  padding: 0.9rem 1.2rem;
  background: linear-gradient(90deg, var(--green-pale), var(--surface));
  color: var(--green-deep);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.lernabschnitt > summary::-webkit-details-marker,
.future-section details > summary::-webkit-details-marker {
  display: none;
}

.lernabschnitt > summary::after,
.future-section details > summary::after {
  content: "⌄";
  margin-left: auto;
  color: var(--green-dark);
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.2s;
}

.lernabschnitt[open] > summary::after,
.future-section details[open] > summary::after {
  transform: rotate(180deg);
}

.lernabschnitt > summary:hover,
.future-section details > summary:hover {
  background: var(--green-light);
}

.summary-icon {
  display: none; /* Pfeil kommt jetzt aus ::after */
}

.summary-number {
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
}

.details-body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  border-top: 1px solid var(--border);
}

.details-body > :first-child {
  margin-top: 0;
}

/* ---------- Info-Boxen ---------- */
.learning-goals,
.alltagsbox,
.formula-box,
.summary-box,
.exam-box,
.glossary,
.sources,
.exam-subtask,
.coming-soon {
  margin: var(--space-3) 0;
  padding: var(--space-3);
  border-radius: 12px;
}

.learning-goals > :last-child,
.alltagsbox > :last-child,
.summary-box > :last-child,
.exam-box > :last-child,
.glossary > :last-child,
.sources > :last-child,
.exam-subtask > :last-child {
  margin-bottom: 0;
}

.learning-goals h3,
.summary-box h3,
.exam-box h3,
.glossary h3,
.sources h3 {
  margin-top: 0;
}

.learning-goals {
  background: var(--green-pale);
  border: 1px solid var(--border);
}

.alltagsbox {
  background: var(--warn-bg);
  border-left: 5px solid var(--warn-line);
}

.formula-box {
  background: var(--info-bg);
  border: 1px solid var(--info-line);
  text-align: center;
}

.formula-label {
  display: block;
  margin-bottom: 0.4rem;
  color: #285d91;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.formula {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.summary-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--green);
}

.exam-box {
  background: #fffaf0;
  border: 1px solid #e6d3a3;
}

.exam-questions {
  margin-bottom: 0;
}

.exam-questions > li {
  margin-bottom: 1.1em;
}

.exam-questions details,
.exam-subtask details,
details.exam-subtask {
  margin-top: 0.5rem;
  border: 1px solid #e3d5ae;
  border-radius: var(--radius-sm);
  background: #fff;
}

details.exam-subtask {
  padding: 0 1rem;
}

details.exam-subtask[open] {
  padding-bottom: 0.8rem;
}

.exam-questions summary,
.exam-subtask summary {
  padding: 0.6rem 0;
  color: var(--green-dark);
  font-weight: 800;
  cursor: pointer;
}

.exam-questions details > :not(summary),
.exam-subtask details > :not(summary) {
  margin: 0 1rem 0.8rem;
}

.exam-questions details:not(.exam-subtask) > summary,
.exam-subtask details > summary {
  padding: 0.6rem 1rem;
}

.exam-subtask:not(details) {
  background: var(--green-pale);
  border: 1px solid var(--border);
}

.exam-subtask h4 {
  margin-top: 0;
}

.glossary {
  background: var(--surface);
  border: 1px solid var(--border);
}

.glossary dl {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr;
  margin: 0;
}

.glossary dl > div {
  display: contents;
}

.glossary dt,
.glossary dd {
  margin: 0;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
}

.glossary dt {
  padding-right: 1rem;
  color: var(--green-dark);
  font-weight: 800;
}

.glossary dl > dt:first-of-type,
.glossary dl > dt:first-of-type + dd,
.glossary dl > div:first-child > dt,
.glossary dl > div:first-child > dd {
  border-top: 0;
}

.sources {
  background: var(--green-pale);
  border: 1px solid var(--border);
}

.sources a {
  overflow-wrap: anywhere;
}

.coming-soon {
  background: #f1f3ef;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.step-list li,
.phase-list li {
  margin-bottom: 0.6em;
}

/* ---------- Raster ---------- */
.image-grid,
.compare-grid,
.concept-grid,
.mutation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-3) 0;
}

.compare-grid > div,
.concept-card {
  padding: var(--space-3);
  background: var(--green-pale);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.compare-grid h5,
.concept-card h3,
.concept-card h5 {
  margin-top: 0;
  color: var(--green-dark);
}

.compare-grid ul,
.concept-card > :last-child {
  margin-bottom: 0;
}

.flow-diagram {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: var(--space-3) 0;
  padding: var(--space-3);
  background: var(--green-pale);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}

.flow-diagram div {
  padding: 0.55rem 1rem;
  background: #fff;
  border: 2px solid var(--green);
  border-radius: 10px;
  color: var(--green-dark);
  font-weight: 800;
}

.flow-diagram span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Bilder ---------- */
figure {
  margin: var(--space-3) 0;
  min-width: 0;
}

.image-grid figure {
  margin: 0;
}

figure img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: zoom-in;
  transition: box-shadow 0.15s;
}

figure img:hover {
  box-shadow: var(--shadow-hover);
}

figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

figcaption span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.85;
}

.bild-platzhalter {
  display: grid;
  place-items: center;
  min-height: 140px;
  margin: var(--space-3) 0;
  padding: var(--space-2);
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--green-pale);
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

/* ---------- Tabellen ---------- */
.mini-table-wrap,
.punnett-wrapper,
.di-hybrid {
  margin: var(--space-3) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mini-table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.mini-table-wrap th,
.mini-table-wrap td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.mini-table-wrap thead th {
  background: var(--green-dark);
  color: #fff;
  font-weight: 700;
}

.mini-table-wrap tbody tr:nth-child(even) {
  background: var(--green-pale);
}

.mini-table-wrap tbody tr:last-child > * {
  border-bottom: 0;
}

.mini-table-wrap td:first-child {
  font-weight: 700;
  color: var(--green-deep);
}

.punnett {
  width: auto;
  min-width: 300px;
  margin: 0 auto;
}

.punnett th,
.punnett td {
  min-width: 3.4rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  text-align: center;
}

.punnett th {
  background: var(--green-light);
  color: var(--green-dark);
}

.punnett-4 {
  min-width: 520px;
}

.table-note {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- Bedienelemente (biologie.js) ---------- */
.bio-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 100%;
  height: 4px;
}

.bio-progress-bar {
  width: 0;
  height: 100%;
  background: var(--green);
}

.bio-top-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 1.3rem;
  box-shadow: var(--shadow-hover);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.bio-top-button.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.bio-progress-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin: var(--space-3) 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.bio-progress-controls button,
.bio-button {
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border: 0;
  border-radius: 10px;
  background: var(--green-dark);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.bio-progress-controls button:hover,
.bio-button:hover {
  background: var(--green);
}

.bio-learned {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  margin: 0 0 var(--space-1);
  padding: 0.35rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--green-pale);
  font-weight: 700;
  cursor: pointer;
}

.bio-learned input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--green-dark);
}

/* Lightbox */
.bio-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 60px 16px 20px;
  background: rgba(12, 20, 9, 0.93);
  cursor: zoom-out;
}

.bio-lightbox.is-open {
  display: flex;
}

.bio-lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  padding: 10px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  cursor: default;
}

.bio-lightbox-caption {
  max-width: 800px;
  margin: 0;
  color: #e8f0e4;
  font-size: 0.92rem;
  text-align: center;
}

.bio-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

body.bio-noscroll {
  overflow: hidden;
}

/* ---------- Fusszeile ---------- */
.page-footer {
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-meta {
  font-size: 0.85rem;
}

/* ---------- Tablet ---------- */
@media (max-width: 760px) {
  .bereich-grid,
  .image-grid,
  .compare-grid,
  .concept-grid,
  .mutation-grid {
    grid-template-columns: 1fr;
  }

  .bereich {
    --pad: var(--space-2);
  }

  .details-body {
    padding: var(--space-2) var(--space-2) var(--space-3);
  }

  .toc:has(> a) {
    position: static;
  }
}

/* ---------- Handy ---------- */
@media (max-width: 640px) {
  body {
    font-size: 16px;
    padding: var(--space-3) 12px var(--space-5);
  }

  .bereich {
    --pad: 14px;
  }

  .details-body {
    padding: var(--space-2) 12px var(--space-3);
  }

  .intro-card {
    padding: var(--space-3) var(--space-2);
  }

  .lernabschnitt > summary {
    padding: 0.8rem 1rem;
  }

  .learning-goals,
  .alltagsbox,
  .formula-box,
  .summary-box,
  .exam-box,
  .glossary,
  .sources,
  .exam-subtask:not(details) {
    padding: var(--space-2);
  }

  .glossary dl {
    grid-template-columns: 1fr;
  }

  .glossary dd {
    padding-top: 0;
    border-top: 0;
  }

  /* Tabellen werden zu Karten (Spaltennamen setzt biologie.js) */
  .mini-table-wrap {
    overflow: visible;
    border: 0;
  }

  table.is-stacked thead {
    display: none;
  }

  table.is-stacked,
  table.is-stacked tbody,
  table.is-stacked tr,
  table.is-stacked td {
    display: block;
    width: 100%;
  }

  /* Jede Zeile = kompakte Karte, Kopf hell (nicht wie ein Themen-Titel) */
  table.is-stacked {
    border-left: 3px solid var(--green);
    padding-left: 0.6rem;
  }

  table.is-stacked tr {
    margin-bottom: 0.6rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
  }

  .mini-table-wrap table.is-stacked tbody tr:nth-child(even) {
    background: #fff;
  }

  table.is-stacked td {
    padding: 0.4rem 0.8rem;
    border-bottom: 1px dashed var(--border);
    font-size: 0.92rem;
  }

  table.is-stacked td:last-child {
    border-bottom: 0;
  }

  table.is-stacked td:first-child {
    padding: 0.5rem 0.8rem;
    background: var(--green-pale);
    border-bottom: 1px solid var(--border);
    color: var(--green-deep);
    font-size: 0.98rem;
  }

  table.is-stacked td[data-label] {
    display: grid;
    grid-template-columns: minmax(84px, 36%) 1fr;
    gap: 0.6rem;
    align-items: baseline;
  }

  table.is-stacked td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  table.is-stacked td:first-child {
    display: block;
  }

  table.is-stacked td:first-child::before {
    display: none;
  }
}

/* ---------- Druck ---------- */
@media print {
  body {
    background: #fff;
    padding: 0;
  }

  .bio-progress,
  .bio-top-button,
  .bio-progress-controls,
  .bio-lightbox,
  .toc,
  .back {
    display: none !important;
  }

  details > *:not(summary) {
    display: block !important;
  }

  .intro-card,
  .bereich,
  .bereich-card {
    box-shadow: none;
  }

  figure,
  tr {
    break-inside: avoid;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
