/* ==========================================================================
   cognivio-common.css
   Gemeinsame Design-Tokens und Basisstile für alle cognivio-Projekte
   (cognivio.ch, cogniviolabs.com, KompetenzSpider, Labs/Simulationen)

   Version:     1.1 (2026-10-28), Datei: cognivio-common.v1.css
                1.1: Leitton "mathe" (Lindengrün); Schriftpfade korrigiert
                (Patrick Hand, Raleway normal), Raleway kursiv ergänzt;
                Reiter (.tabs) und Umschalter (aria-pressed/-checked) ergänzt.
   Einbindung:  <link rel="stylesheet"
                 href="https://assets.cogniviolabs.com/css/cognivio-common.v1.css">
   Projektspezifische Stile gehören in die jeweilige Projektdatei,
   nicht hierhin. Änderungen hier wirken auf alle Projekte.

   DREI-EBENEN-MODELL
   Ebene 1, UI:    Papier und Tinte. Fast farblos, Haarlinien statt Schatten,
                   genau eine Signalfarbe (Zinnober), nur für Interaktion.
   Ebene 2, Szene: Grafiken und Animationen tragen die Farbe. Jedes Lab hat
                   einen Leitton (--lab-accent), gesetzt über data-lab="...".
   Ebene 3, Lehrpersonen: gleiche Farben, aber ruhige Serif-Titel und keine
                   verspielten Elemente. Schalter: data-audience="teacher".

   Beispiel:  <body data-lab="licht" data-audience="teacher">
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Schriften (selbst gehostet, WOFF2)
   Dateien aus Google Fonts laden (z. B. via google-webfonts-helper)
   und unter /fonts/ ablegen. Pfade bei Bedarf anpassen.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Patrick Hand";
  src: url("/fonts/patrick-hand-v25-latin_latin-ext-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Source Serif 4: Variable Font, alle Gewichte in einer Datei */
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

/* Raleway: Variable Font */
@font-face {
  font-family: "Raleway";
  src: url("/fonts/raleway-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Raleway";
  src: url("/fonts/raleway-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}


/* --------------------------------------------------------------------------
   2. Design-Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Schriften */
  --font-title: "Patrick Hand", "Comic Neue", cursive;
  --font-body:  "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-ui:    "Raleway", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Titel-Feintuning (Patrick Hand hat nur 400; Ebene 3 überschreibt) */
  --title-weight:   400;
  --title-tracking: 0.01em;

  /* Schriftgrössen (fluid, skalieren zwischen Handy und Beamer) */
  --text-xs:   clamp(0.75rem, 0.73rem + 0.1vw, 0.8125rem);  /* Mikro-Beschriftungen */
  --text-sm:   clamp(0.875rem, 0.85rem + 0.1vw, 0.95rem);
  --text-base: clamp(1.125rem, 1.08rem + 0.2vw, 1.25rem);   /* ab 18 px */
  --text-lg:   clamp(1.25rem, 1.2rem + 0.3vw, 1.4rem);
  --h3: clamp(1.5rem, 1.4rem + 0.5vw, 1.75rem);
  --h2: clamp(1.9rem, 1.7rem + 1vw, 2.4rem);
  --h1: clamp(2.4rem, 2rem + 2vw, 3.4rem);
  --h-display: clamp(2.5rem, 2rem + 4vw, 5rem);             /* Lab-Titel */

  /* Zeilenabstände */
  --leading-body:  1.55;
  --leading-title: 1.2;
  --leading-ui:    1.3;

  /* ---- Ebene 1: UI (Papier und Tinte) ---- */
  --color-bg:        #f3f2ee;   /* Papier */
  --color-surface:   #fbfaf7;
  --color-surface-2: #eae8e1;
  --color-text:      #1d1f1e;   /* Tinte */
  --color-text-soft: #5b5e5c;
  --color-border:    #d9d8d2;   /* Haarlinie */
  --color-line:      #3a3d3c;   /* Tuschelinie für Grafik (Sprechblasen, Rahmen) */

  /* Signalfarbe: ausschliesslich für Interaktion (Buttons, aktiver Zustand, Fokus) */
  --color-signal:       #c23d22;   /* Zinnober, ca. 4.7:1 auf Papier */
  --color-signal-hover: #a3321b;
  --color-signal-text:  #ffffff;   /* ca. 5.3:1 auf Signal */

  /* Rückwärtskompatible Namen aus v1 */
  --color-primary:       var(--color-signal);
  --color-primary-hover: var(--color-signal-hover);
  --color-primary-text:  var(--color-signal-text);
  --color-accent:        var(--lab-accent);

  /* Statusfarben: Fehler immer mit Icon und Text kennzeichnen,
     Rot liegt nah an der Signalfarbe */
  --color-success: #4a6b3a;
  --color-warning: #9a6b12;
  --color-error:   #b3261e;

  /* ---- Ebene 2: Szene (Farbe in Grafik und Animation) ---- */
  --lab-accent: #c23d22;           /* Standard-Leitton: Zinnober */
  --skin:       #f0d9c3;           /* Hautton für Figuren */

  /* Datenfarben (Diagramme, KompetenzSpider): erdig und gut unterscheidbar */
  --data-1: #c23d22;   /* Zinnober */
  --data-2: #c9922e;   /* Safran/Ocker */
  --data-3: #6b7a3a;   /* Olive */
  --data-4: #6a3d5c;   /* Pflaume */
  --data-5: #4a5560;   /* Schiefer */

  /* Abstände (8-px-Raster) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  /* Form: Haarlinien statt Schatten */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow-sm: none;
  --shadow-md: 0 8px 24px rgb(0 0 0 / 0.06);   /* nur für Overlays */

  /* Layout */
  --measure: 68ch;            /* ideale Zeilenlänge für Fliesstext */
  --container: 72rem;
  --focus-ring: 0 0 0 3px rgb(194 61 34 / 0.35);
}

/* Lab-Leittöne: <body data-lab="licht"> oder auf einzelnen Bereichen */
[data-lab="elektrizitaet"] { --lab-accent: #c23d22; }  /* Zinnober */
[data-lab="licht"]         { --lab-accent: #e0a526; }  /* Safran */
[data-lab="biologie"]      { --lab-accent: #7d9a4a; }  /* Matcha */
[data-lab="wasser"]        { --lab-accent: #2f4a8a; }  /* Indigo */
[data-lab="chemie"]        { --lab-accent: #7a3f5e; }  /* Pflaume */
[data-lab="mathe"]         { --lab-accent: #5b931a; }  /* Lindengrün */

/* Dunkelmodus: nur Farben überschreiben */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg:        #161716;
    --color-surface:   #202221;
    --color-surface-2: #2a2d2b;
    --color-text:      #ece9e2;
    --color-text-soft: #a4a6a3;
    --color-border:    #343735;
    --color-line:      #ece9e2;

    --color-signal:       #e8654a;
    --color-signal-hover: #f07d65;
    --color-signal-text:  #161716;

    --color-success: #8fb27a;
    --color-warning: #d6a64a;
    --color-error:   #ef7b70;

    --lab-accent: #e8654a;
    --data-2: #dfae4d;
    --data-3: #9bb05c;
    --data-4: #c27aa0;
    --data-5: #8d9aa6;

    --shadow-md: 0 8px 24px rgb(0 0 0 / 0.4);
    --focus-ring: 0 0 0 3px rgb(232 101 74 / 0.45);
  }
  :root:not([data-theme="light"]) [data-lab="elektrizitaet"] { --lab-accent: #e8654a; }
  :root:not([data-theme="light"]) [data-lab="licht"]         { --lab-accent: #e8b84a; }
  :root:not([data-theme="light"]) [data-lab="biologie"]      { --lab-accent: #9bb866; }
  :root:not([data-theme="light"]) [data-lab="wasser"]        { --lab-accent: #7f9be0; }
  :root:not([data-theme="light"]) [data-lab="chemie"]        { --lab-accent: #c27aa0; }
  :root:not([data-theme="light"]) [data-lab="mathe"]         { --lab-accent: #84bf40; }
}
:root[data-theme="dark"] {
  --color-bg:        #161716;
  --color-surface:   #202221;
  --color-surface-2: #2a2d2b;
  --color-text:      #ece9e2;
  --color-text-soft: #a4a6a3;
  --color-border:    #343735;
  --color-line:      #ece9e2;

  --color-signal:       #e8654a;
  --color-signal-hover: #f07d65;
  --color-signal-text:  #161716;

  --color-success: #8fb27a;
  --color-warning: #d6a64a;
  --color-error:   #ef7b70;

  --lab-accent: #e8654a;
  --data-2: #dfae4d;
  --data-3: #9bb05c;
  --data-4: #c27aa0;
  --data-5: #8d9aa6;

  --shadow-md: 0 8px 24px rgb(0 0 0 / 0.4);
  --focus-ring: 0 0 0 3px rgb(232 101 74 / 0.45);
}
:root[data-theme="dark"] [data-lab="elektrizitaet"] { --lab-accent: #e8654a; }
:root[data-theme="dark"] [data-lab="licht"]         { --lab-accent: #e8b84a; }
:root[data-theme="dark"] [data-lab="biologie"]      { --lab-accent: #9bb866; }
:root[data-theme="dark"] [data-lab="wasser"]        { --lab-accent: #7f9be0; }
:root[data-theme="dark"] [data-lab="chemie"]        { --lab-accent: #c27aa0; }
:root[data-theme="dark"] [data-lab="mathe"]         { --lab-accent: #84bf40; }


/* --------------------------------------------------------------------------
   3. Basis
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video, canvas { max-width: 100%; height: auto; }

/* Links im Fliesstext: Tinte mit Signal-Unterstreichung, Farbe erst beim Hover */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--color-signal);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--color-signal); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

::selection { background: color-mix(in srgb, var(--color-signal) 22%, transparent); }


/* --------------------------------------------------------------------------
   4. Typografie
   Patrick Hand hat nur einen Schnitt: font-weight bleibt 400,
   Hierarchie läuft über Grösse und Farbe.
   -------------------------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: var(--title-weight);
  line-height: var(--leading-title);
  margin: var(--space-6) 0 var(--space-3);
  letter-spacing: var(--title-tracking);
}
h1 { font-size: var(--h1); margin-top: 0; }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }

/* Kleine Zwischentitel: Raleway statt Patrick Hand (wird sonst unruhig) */
h4, h5, h6 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-feature-settings: "lnum";
  line-height: var(--leading-ui);
  margin: var(--space-5) 0 var(--space-2);
}
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.06em; }

p, ul, ol, dl, blockquote, figure { margin: 0 0 var(--space-4); }

.prose { max-width: var(--measure); }

strong, b { font-weight: 650; }

blockquote {
  padding-left: var(--space-4);
  border-left: 3px solid var(--lab-accent);
  font-style: italic;
  color: var(--color-text-soft);
}

figcaption, .caption {
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--color-text-soft);
}

/* Akzente im Text: Kursiv oder Kapitälchen statt dritter Schrift */
.smallcaps { font-variant-caps: all-small-caps; letter-spacing: 0.05em; }

code, kbd, pre, samp {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}
code { background: var(--color-surface-2); padding: 0.1em 0.35em; border-radius: var(--radius-sm); }
pre  { background: var(--color-surface-2); padding: var(--space-4); border-radius: var(--radius-md); overflow-x: auto; }
pre code { background: none; padding: 0; }

/* Tabellen: normale Ziffern, tabellarisch ausgerichtet */
table { border-collapse: collapse; width: 100%; }
th, td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
th { font-family: var(--font-ui); font-weight: 600; font-size: var(--text-sm); }
th, td { font-feature-settings: "lnum", "tnum"; }


/* --------------------------------------------------------------------------
   5. UI-Elemente (Raleway), Ebene 1
   -------------------------------------------------------------------------- */

button, input, select, textarea, label, nav, .ui {
  font-family: var(--font-ui);
  font-feature-settings: "lnum";
  line-height: var(--leading-ui);
}

.ui-label {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-soft);
}

/* Mikro-Beschriftung wie «01 / 08», Kapitelzähler, Metainfos */
.meta {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  font-feature-settings: "lnum", "tnum";
  color: var(--color-text-soft);
}

/* Buttons: Signalfarbe, rund */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.65em 1.3em;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-signal-text);
  background: var(--color-signal);
  border: 1.5px solid var(--color-signal);
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover {
  background: var(--color-signal-hover);
  border-color: var(--color-signal-hover);
  color: var(--color-signal-text);
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

/* Sekundär: Tinte, nur Linie */
.btn--secondary {
  color: var(--color-text);
  background: transparent;
  border-color: var(--color-text);
}
.btn--secondary:hover {
  color: var(--color-bg);
  background: var(--color-text);
  border-color: var(--color-text);
}

/* Formulare */
input[type="text"], input[type="email"], input[type="number"],
input[type="search"], select, textarea {
  width: 100%;
  padding: 0.6em 0.8em;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-signal);
  box-shadow: var(--focus-ring);
}

/* Regler: Signalfarbe als einzige Farbe im Interface */
input[type="range"] { accent-color: var(--color-signal); width: 100%; }

/* Navigation */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
}
.nav a {
  text-decoration: none;
  color: var(--color-text);
  padding: var(--space-1) 0;
  border-bottom: 1.5px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] {
  color: var(--color-signal);
  border-bottom-color: var(--color-signal);
}

/* Reiter: role="tablist" mit role="tab" und aria-selected.
   Aktiv = Signalfarbe plus 2-px-Unterstrich (zweite Information neben der Farbe). */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-border);
}
.tabs [role="tab"] {
  appearance: none;
  min-height: 2.75rem;                  /* Touch-Ziel ab 44 px */
  padding: var(--space-2) var(--space-4);
  margin-bottom: -1px;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.tabs [role="tab"]:hover { color: var(--color-signal); }
.tabs [role="tab"][aria-selected="true"] {
  color: var(--color-signal);
  border-bottom-color: var(--color-signal);
}

/* Umschalter: Gruppe von .btn--secondary (z. B. Modus, Vorzeichen +/-).
   Aktiv (aria-pressed oder aria-checked) = gefüllt statt nur Linie. */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.segmented .btn--secondary { min-height: 2.75rem; justify-content: center; }
.btn--secondary[aria-pressed="true"],
.btn--secondary[aria-checked="true"] {
  color: var(--color-signal-text);
  background: var(--color-signal);
  border-color: var(--color-signal);
}
.btn--secondary[aria-pressed="true"]:hover,
.btn--secondary[aria-checked="true"]:hover {
  background: var(--color-signal-hover);
  border-color: var(--color-signal-hover);
}

/* Karten und Hinweisboxen: Haarlinie statt Schatten */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.callout {
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--lab-accent);
  background: var(--color-surface-2);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.callout--warning { border-left-color: var(--color-warning); }
.callout--error   { border-left-color: var(--color-error); }
.callout--success { border-left-color: var(--color-success); }

.badge {
  display: inline-block;
  padding: 0.15em 0.6em;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
}

.hairline { border: 0; border-top: 1px solid var(--color-border); margin: var(--space-6) 0; }


/* --------------------------------------------------------------------------
   6. Szene, Ebene 2 (hier kommt die Farbe herein)
   Leitton über data-lab am body oder am Lab-Container setzen.
   -------------------------------------------------------------------------- */

/* Rahmen für Canvas, SVG, Animation */
.scene {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

/* Rasterton (Manga-Punkte) statt Verläufen */
.screentone { position: relative; isolation: isolate; }
.screentone::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle, var(--lab-accent) 1.2px, transparent 1.4px);
  background-size: 6px 6px;
  opacity: 0.3;
  pointer-events: none;
}

/* Lab-Titel: gross, leicht schräg, mit Textmarker-Strich in der Lab-Farbe */
.lab-title {
  font-family: var(--font-title);
  font-weight: var(--title-weight);
  font-size: var(--h-display);
  line-height: 1.05;
  letter-spacing: var(--title-tracking);
  margin: 0 0 var(--space-4);
  transform: rotate(-1.5deg);
  transform-origin: left bottom;
}
.lab-title mark {
  color: inherit;
  padding: 0 0.1em;
  background: linear-gradient(
    transparent 62%,
    var(--lab-accent) 62%,
    var(--lab-accent) 92%,
    transparent 92%
  );
}

/* Sprechblase (Patrick Hand) */
.bubble {
  position: relative;
  display: inline-block;
  max-width: 28ch;
  padding: 0.6em 0.9em;
  font-family: var(--font-title);
  font-size: var(--text-lg);
  line-height: 1.25;
  color: var(--color-text);
  background: var(--color-surface);
  border: 2px solid var(--color-line);
  border-radius: 1.2em;
}
.bubble::after {
  content: "";
  position: absolute;
  left: 1.4em;
  bottom: -0.46em;
  width: 0.8em;
  height: 0.8em;
  background: var(--color-surface);
  border-right: 2px solid var(--color-line);
  border-bottom: 2px solid var(--color-line);
  transform: rotate(45deg);
}

/* Soundwort («ZACK!», «BZZZT!») */
.sfx {
  display: inline-block;
  font-family: var(--font-title);
  font-size: clamp(2rem, 1.6rem + 2vw, 3.5rem);
  line-height: 1;
  text-transform: uppercase;
  color: var(--lab-accent);
  text-shadow: 2px 2px 0 var(--color-line);
  transform: rotate(-4deg);
}


/* --------------------------------------------------------------------------
   7. Ebene 3: Lehrpersonen
   Gleiche Farben, Linien, Buttons und Navigation wie bei den Lernenden.
   Geändert werden nur die Titelschrift und die verspielten Elemente.
   Schalter: <body data-audience="teacher"> (kombinierbar mit data-lab)
   -------------------------------------------------------------------------- */

[data-audience="teacher"] {
  --font-title:     var(--font-body);   /* Source Serif 4 statt Patrick Hand */
  --title-weight:   600;
  --title-tracking: -0.01em;
  --h1: clamp(2rem, 1.7rem + 1.5vw, 2.75rem);
  --h2: clamp(1.6rem, 1.45rem + 0.8vw, 2rem);
  --h3: clamp(1.3rem, 1.2rem + 0.4vw, 1.5rem);
  --measure: 72ch;
}

/* Lab-Titel: nicht schräg, Marker-Strich wird zur ruhigen Unterstreichung */
[data-audience="teacher"] .lab-title {
  transform: none;
  font-size: var(--h1);
  line-height: var(--leading-title);
}
[data-audience="teacher"] .lab-title mark {
  background: none;
  padding: 0;
  border-bottom: 2px solid var(--lab-accent);
}

/* Verspielte Szenen-Elemente aus */
[data-audience="teacher"] .screentone::before,
[data-audience="teacher"] .sfx { display: none; }


/* --------------------------------------------------------------------------
   8. Layout-Helfer
   -------------------------------------------------------------------------- */

.container {
  width: min(100% - 2 * var(--space-4), var(--container));
  margin-inline: auto;
}
.stack > * + * { margin-top: var(--space-4); }
.grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}


/* --------------------------------------------------------------------------
   9. Barrierefreiheit und Druck
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .lab-title, .sfx { transform: none; }
}

@media print {
  :root {
    --color-bg: #fff;
    --color-text: #000;
    --color-text-soft: #333;
  }
  body { font-size: 11pt; line-height: 1.45; background: #fff; }
  h1, h2, h3, h4 { break-after: avoid; }
  img, table, pre, blockquote { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
  .nav, .btn, .no-print { display: none !important; }
  .screentone::before { display: none; }
}
