/* Mathe-Hilfe auf f97.be
   Gestaltung: Schulheft. Karopapier für die Graphen, Königsblau für die eigene Kurve,
   Rotstift für typische Fehler am Rand, Ergebnisse doppelt unterstrichen.
   Alles ist unter #mathe gekapselt, damit die gemeinsamen f97-Leisten unberührt bleiben. */

@font-face{font-family:"Atkinson Hyperlegible";font-style:normal;font-weight:400;font-display:swap;src:url("./fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2")}
@font-face{font-family:"Atkinson Hyperlegible";font-style:normal;font-weight:700;font-display:swap;src:url("./fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2")}
@font-face{font-family:"STIX Two Text";font-style:normal;font-weight:400;font-display:swap;src:url("./fonts/stix-two-text-latin-400-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"STIX Two Text";font-style:italic;font-weight:400;font-display:swap;src:url("./fonts/stix-two-text-latin-400-italic.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"STIX Two Text";font-style:normal;font-weight:400;font-display:swap;src:url("./fonts/stix-two-text-greek-400-normal.woff2") format("woff2");unicode-range:U+0370-03FF}
@font-face{font-family:"STIX Two Text";font-style:italic;font-weight:400;font-display:swap;src:url("./fonts/stix-two-text-greek-400-italic.woff2") format("woff2");unicode-range:U+0370-03FF}

/* Der Schreibtisch um das Heft nimmt die zentrale Farbpalette von f97.be an (eCMS: palette.css, --ecms-*).
   Sprachleiste, Teilen-Knopf und Fußzeile von eCMS passen dadurch von selbst dazu. Ohne Palette gilt das kühle Weiß. */
html{color-scheme:light;background:var(--ecms-paper,#f3f6fb);scroll-behavior:smooth}
html{--paper:#f3f6fb;--line:#cfdcec;--quiet:#5a6475}   /* Rückfall für die zentrale Fußzeile (visitor.css), falls keine Palette geladen ist */
body{margin:0;background:var(--ecms-paper,#f3f6fb)}

#mathe{
  --mh-papier:var(--ecms-paper,#f3f6fb);     /* Schreibtisch: Papierfarbe der Website */
  --mh-linie:var(--ecms-line,#a9bfdb);        /* Linien außerhalb des Hefts */
  --mh-leise:var(--ecms-muted,#5a6475);       /* Nebentext außerhalb des Hefts */
  --mh-reiter:var(--ecms-soft,#e4ecf6);       /* Reiter, die gerade nicht offen sind */
  --mh-reiter-hell:var(--ecms-panel,#eef3fa);
  --mh-blatt:#ffffff;         /* Heftseite */
  --mh-kaestchen:#cfdcec;     /* Linien des Karopapiers */
  --mh-kaestchen-stark:#a9bfdb;
  --mh-tinte:#16224a;         /* Text: dunkle Tinte */
  --mh-fueller:#1d3fa8;       /* Königsblau: die eigene Kurve, Knöpfe */
  --mh-bleistift:#5a6475;     /* Nebentext, Vergleichskurven */
  --mh-rot:#c42b36;           /* Rotstift */
  --mh-rot-hell:#f1b9bd;
  --mh-marker:#ffe24a;        /* Textmarker */
  --mh-gruen:#1a7a45;
  --mh-violett:#6f3cab;
  --mh-orange:#b95f06;
  --mh-text:"Atkinson Hyperlegible",-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  --mh-formel:"STIX Two Text","STIX Two Math","Cambria Math","Times New Roman",serif;
  box-sizing:border-box;max-width:1180px;margin:0 auto;padding:0 36px 48px;
  background:var(--mh-papier);color:var(--mh-tinte);
  font:17px/1.6 var(--mh-text);-webkit-text-size-adjust:100%;
}
#mathe *,#mathe *::before,#mathe *::after{box-sizing:border-box}
#mathe [hidden]{display:none!important}
#mathe h1,#mathe h2,#mathe h3,#mathe h4,#mathe p,#mathe ul,#mathe ol,#mathe dl,#mathe dd,#mathe figure{margin:0}
#mathe a{color:var(--mh-fueller);text-underline-offset:3px}
#mathe button,#mathe input,#mathe select{font:inherit;color:inherit}
#mathe button{cursor:pointer;touch-action:manipulation}
#mathe :focus-visible{outline:3px solid var(--mh-fueller);outline-offset:3px;border-radius:4px}

/* ---------- Kopf und Auftakt ---------- */
#mathe .mh-sprung{position:absolute;left:16px;top:-80px;background:var(--mh-tinte);color:#fff;padding:10px 14px;z-index:20}
#mathe .mh-sprung:focus{top:10px}
#mathe .mh-kopf{display:flex;align-items:baseline;gap:14px;padding:22px 0 18px;border-bottom:1.5px solid var(--mh-linie)}
#mathe .mh-marke{font-size:29px;line-height:1;font-weight:700;letter-spacing:-1.4px;color:var(--mh-tinte);text-decoration:none}
#mathe .mh-marke span{color:var(--mh-fueller)}
#mathe .mh-ort{font-size:1.05rem;color:var(--mh-leise);padding-left:14px;border-left:1.5px solid var(--mh-linie)}
#mathe .mh-kopf nav{margin-left:auto;display:flex;gap:22px;font-size:.95rem}
#mathe .mh-kopf nav a{color:var(--mh-tinte);text-decoration:none;padding:6px 0}
#mathe .mh-kopf nav a:hover{text-decoration:underline}

#mathe .mh-auftakt{padding:38px 0 30px;max-width:46rem}
#mathe h1{font-size:clamp(2rem,4.7vw,3.15rem);line-height:1.08;letter-spacing:-.02em;font-weight:700}
#mathe .mh-auftakt p{margin-top:16px;font-size:1.1rem;line-height:1.55;color:var(--mh-leise);max-width:40rem}

/* ---------- Register (Reiter) ---------- */
#mathe .mh-register{display:flex;gap:5px;overflow-x:auto;scrollbar-width:thin;padding:4px 2px 0;margin:0 -2px;position:relative;z-index:1}
#mathe .mh-register button{flex:0 0 auto;min-height:46px;padding:9px 16px 8px;border:1.5px solid var(--mh-kaestchen-stark);border-bottom:0;border-radius:9px 9px 0 0;background:var(--mh-reiter);font-weight:700;font-size:.98rem;white-space:nowrap;margin-bottom:-1.5px;box-shadow:inset 0 5px 0 var(--mh-reg,transparent)}
#mathe .mh-register button:hover{background:var(--mh-reiter-hell)}
#mathe .mh-register button[aria-selected="true"]{background:var(--mh-blatt);border-bottom:1.5px solid var(--mh-blatt)}
#mathe #tab-sinus{--mh-reg:var(--mh-fueller)}
#mathe #tab-kreis{--mh-reg:var(--mh-violett)}
#mathe #tab-textaufgabe{--mh-reg:var(--mh-orange)}
#mathe #tab-funktion{--mh-reg:var(--mh-gruen)}
#mathe #tab-nullstellen{--mh-reg:var(--mh-rot)}
#mathe #tab-spickzettel{--mh-reg:var(--mh-marker)}

/* ---------- Heftseite ---------- */
#mathe .mh-blatt{background:var(--mh-blatt);border:1.5px solid var(--mh-kaestchen-stark);border-radius:0 10px 10px 10px;padding:30px 34px 38px}
#mathe h2{font-size:1.55rem;line-height:1.2;letter-spacing:-.01em;font-weight:700}
#mathe h3{font-size:1.08rem;line-height:1.3;font-weight:700;margin:0 0 10px}
#mathe h4{font-size:1rem;line-height:1.35;font-weight:700}
#mathe .mh-kurz{margin-top:8px;max-width:44rem;color:var(--mh-bleistift)}
#mathe .mh-klein{font-size:.9rem;color:var(--mh-bleistift);margin-top:8px}
#mathe .mh-arbeit{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(280px,1fr);gap:30px;align-items:start;margin-top:24px}
#mathe .mh-arbeit.umgekehrt{grid-template-columns:minmax(0,1.4fr) minmax(280px,1fr)}

/* ---------- Zeichnung (Karopapier) ---------- */
#mathe .mh-zeichnung{position:relative;min-width:0}
#mathe .mh-zeichnung canvas{display:block;width:100%;height:clamp(300px,44vw,470px);background:#fff;border:1.5px solid var(--mh-kaestchen-stark);border-radius:6px;touch-action:pan-y;cursor:crosshair}
#mathe .mh-zeichnung.flach canvas{height:clamp(250px,34vw,360px);cursor:default}
#mathe .mh-zeichnung.klein canvas{height:210px;margin:14px 0 4px}
#mathe .mh-zoom{position:absolute;top:10px;right:10px;display:flex;gap:4px}
#mathe .mh-zoom button{width:38px;height:38px;border:1.5px solid var(--mh-kaestchen-stark);border-radius:8px;background:rgba(255,255,255,.94);font-size:1.25rem;line-height:1;font-weight:700;color:var(--mh-tinte)}
#mathe .mh-zoom button:hover{background:#eaf0f9}
#mathe .mh-bildhinweis{font-size:.88rem;color:var(--mh-bleistift);margin-top:6px}

/* ---------- Formeln ---------- */
#mathe .m,#mathe .mh-formel,#mathe .mh-rechnung,#mathe .mh-ergebnis{font-family:var(--mh-formel);font-variant-numeric:lining-nums}
#mathe .m{font-size:1.07em;white-space:nowrap}
#mathe .mh-formel{font-size:clamp(1.4rem,2.5vw,1.85rem);line-height:1.5;margin-bottom:14px}
#mathe .mh-formel.klein{font-size:1.3rem;margin-bottom:10px}
#mathe sup,#mathe sub{font-size:.68em;line-height:0}
#mathe .bruch{display:inline-flex;flex-direction:column;vertical-align:middle;text-align:center;font-size:.8em;line-height:1.2;margin:0 .12em}
#mathe .bruch>span{padding:0 .25em}
#mathe .bruch>span:first-child{border-bottom:1.3px solid currentColor}
#mathe .wurzel{border-top:1.3px solid currentColor;padding:0 .18em 0 .08em}
#mathe .pa{--mh-p:var(--mh-rot)} #mathe .pb{--mh-p:var(--mh-gruen)} #mathe .pc{--mh-p:var(--mh-violett)} #mathe .pd{--mh-p:var(--mh-orange)}
#mathe span.pa,#mathe span.pb,#mathe span.pc,#mathe span.pd{color:var(--mh-p);font-weight:700}

/* ---------- Regler und Eingaben ---------- */
#mathe .mh-regler{min-width:0}
#mathe .mh-schieber{display:grid;grid-template-columns:minmax(0,1fr) 5.2em;align-items:center;column-gap:12px;padding:5px 0}
#mathe .mh-schieber label{grid-column:1/-1;font-size:.95rem;color:var(--mh-bleistift)}
#mathe .mh-schieber label b{display:inline-block;min-width:1.5em;font:italic 400 1.25rem/1 var(--mh-formel);color:var(--mh-p,var(--mh-tinte))}
#mathe .mh-schieber input[type=range]{width:100%;height:34px;margin:0;accent-color:var(--mh-p,var(--mh-fueller));cursor:pointer}
#mathe .mh-schieber output{font:400 1.2rem/1.2 var(--mh-formel);text-align:right;color:var(--mh-p,var(--mh-tinte));font-variant-numeric:tabular-nums lining-nums}
#mathe .mh-chips{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:6px 0 10px}
#mathe .mh-chips>span{font-size:.9rem;color:var(--mh-bleistift);margin-right:2px}
#mathe .mh-chips button{min-height:38px;padding:5px 13px;border:1.5px solid var(--mh-kaestchen-stark);border-radius:999px;background:#fff;font:400 1.02rem/1.2 var(--mh-formel)}
#mathe .mh-chips button:hover{background:#eaf0f9}
#mathe .mh-chips button[aria-pressed="true"]{background:var(--mh-tinte);border-color:var(--mh-tinte);color:#fff}
#mathe .mh-chips.pb button[aria-pressed="true"]{background:var(--mh-gruen);border-color:var(--mh-gruen)}
#mathe .mh-wahl{border:0;padding:0;margin:14px 0 0;display:flex;flex-wrap:wrap;gap:4px 18px;font-size:.95rem}
#mathe .mh-wahl legend{padding:0;color:var(--mh-bleistift);font-size:.9rem;margin-bottom:2px}
#mathe .mh-wahl label,#mathe .mh-haken label{display:flex;align-items:center;gap:8px;min-height:34px;cursor:pointer}
#mathe .mh-haken{margin:8px 0 14px;font-size:.95rem}
#mathe input[type=checkbox],#mathe input[type=radio]{width:19px;height:19px;accent-color:var(--mh-fueller);flex:0 0 auto;margin:0}
#mathe .mh-knopf{min-height:44px;padding:9px 18px;border:1.5px solid var(--mh-fueller);border-radius:8px;background:var(--mh-fueller);color:#fff;font-weight:700}
#mathe .mh-knopf:hover{background:#17338a}
#mathe .mh-knopf.leise{background:transparent;color:var(--mh-fueller)}
#mathe .mh-knopf.leise:hover{background:#e9eefb}
#mathe input[type=text],#mathe select{min-height:44px;padding:8px 12px;border:1.5px solid var(--mh-kaestchen-stark);border-radius:8px;background:#fff;max-width:100%}
#mathe input[type=text]{font-family:var(--mh-formel);font-size:1.12rem}
#mathe .mh-eingabe{display:flex;align-items:center;gap:12px;margin-top:22px}
#mathe .mh-eingabe label{font-size:1.45rem;flex:0 0 auto}
#mathe .mh-eingabe input{flex:1 1 auto;min-width:0;font-size:1.4rem;padding:10px 14px;border-color:var(--mh-fueller);border-width:2px}
#mathe .mh-feld{display:grid;gap:3px;margin-bottom:11px}
#mathe .mh-feld label{font-size:.93rem;color:var(--mh-bleistift)}
#mathe .mh-feldpaar{display:grid;grid-template-columns:1fr 1fr;gap:12px}
#mathe .mh-zeile{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:10px 0}
#mathe .mh-fehler{margin:12px 0 0;padding:10px 14px;border-left:4px solid var(--mh-rot);background:#fdf1f1;color:#8a1720;border-radius:0 6px 6px 0}

/* ---------- Heftteil unter der Zeichnung ---------- */
#mathe .mh-heft{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:30px 40px;margin-top:34px;padding-top:26px;border-top:1.5px solid var(--mh-kaestchen)}
#mathe .mh-steckbrief{display:grid;grid-template-columns:minmax(0,auto) minmax(0,1fr);column-gap:18px}
#mathe .mh-steckbrief dt,#mathe .mh-steckbrief dd{padding:7px 0;border-bottom:1px solid var(--mh-kaestchen)}
#mathe .mh-steckbrief dt{color:var(--mh-bleistift);font-size:.95rem}
#mathe .mh-steckbrief dd{font-family:var(--mh-formel);font-size:1.08rem}
#mathe .mh-steckbrief dd small{font-family:var(--mh-text);font-size:.86rem;color:var(--mh-bleistift);display:block;line-height:1.4}
#mathe .mh-worte{padding-left:1.2em;margin-bottom:22px}
#mathe .mh-worte li{margin:3px 0}
#mathe .mh-tabelle{overflow-x:auto}
#mathe table{border-collapse:collapse;font-size:.97rem;width:100%}
#mathe caption{text-align:left;font-weight:700;padding-bottom:6px}
#mathe th,#mathe td{border:1px solid var(--mh-kaestchen-stark);padding:7px 10px;text-align:left;vertical-align:top}
#mathe thead th{background:#eef3fa}
#mathe tbody th{font-weight:700;background:#f6f9fd;white-space:nowrap}
#mathe #sinus-punkte td,#mathe #sinus-punkte th{text-align:center;font-family:var(--mh-formel);font-size:1.05rem}
#mathe #sinus-punkte th{font-family:var(--mh-text);font-size:.9rem}

/* ---------- Rechenweg: Heftzeilen mit rotem Korrekturrand ---------- */
#mathe .mh-weg{list-style:none;padding:0;counter-reset:schritt;container-type:inline-size}
#mathe .mh-weg>li{counter-increment:schritt;display:grid;grid-template-columns:minmax(0,1fr) minmax(130px,11.5rem);border-bottom:1px solid var(--mh-kaestchen)}
#mathe .mh-weg>li:first-child{border-top:1px solid var(--mh-kaestchen)}
#mathe .mh-schritt{padding:13px 18px 14px 2.3em;position:relative;min-width:0}
#mathe .mh-schritt::before{content:counter(schritt) ".";position:absolute;left:0;top:13px;font-weight:700;color:var(--mh-fueller)}
#mathe .mh-schritt h4{margin-bottom:4px}
#mathe .mh-schritt p{margin:3px 0;overflow-wrap:anywhere}
#mathe .mh-schritt .m{white-space:normal}
#mathe .mh-rand{border-left:2px solid var(--mh-rot-hell);padding:13px 0 12px 14px;color:var(--mh-rot);font-size:.92rem;line-height:1.4}
/* In schmalen Spalten rutscht die Randnotiz unter den Schritt */
@container (max-width:480px){
  #mathe .mh-weg>li{grid-template-columns:minmax(0,1fr)}
  #mathe .mh-rand{border-left:3px solid var(--mh-rot-hell);margin:0 0 12px 2.3em;padding:2px 0 2px 12px}
  #mathe .mh-schritt{padding-right:0;padding-bottom:8px}
}
#mathe .op{font-family:var(--mh-text);font-size:.84rem;color:var(--mh-bleistift);border-left:1.5px solid var(--mh-bleistift);padding-left:.55em;margin-left:.9em;white-space:nowrap}
#mathe .mh-methode{margin:4px 0 14px}
#mathe .mh-methode b{background:linear-gradient(transparent 46%,var(--mh-marker) 46%,var(--mh-marker) 92%,transparent 92%);padding:0 .15em}
#mathe .mh-ergebnis{font-size:1.3rem;margin-top:18px;line-height:1.7}
#mathe .mh-ergebnis b{font-weight:400;text-decoration:underline double var(--mh-tinte);text-underline-offset:5px}
#mathe .mh-ergebnis small{display:block;font-family:var(--mh-text);font-size:.9rem;color:var(--mh-bleistift);line-height:1.5;margin-top:6px}
#mathe .mh-rechnung{font-size:1.1rem;margin-top:8px;line-height:1.7}
#mathe .mh-rechnung b{font-weight:400;text-decoration:underline double var(--mh-tinte);text-underline-offset:4px}
#mathe .mh-rechnung small{font-family:var(--mh-text);font-size:.88rem;color:var(--mh-bleistift)}
#mathe .mh-frage{padding:12px 0;border-bottom:1px solid var(--mh-kaestchen)}
#mathe .mh-frage label{margin-right:8px}
#mathe .mh-rechenblatt{min-width:0}

/* ---------- Rotstift, Übung, Klappen ---------- */
#mathe .mh-rotstift{margin-top:34px;padding:2px 0 2px 20px;border-left:3px solid var(--mh-rot)}
#mathe .mh-rotstift h3{color:var(--mh-rot)}
#mathe .mh-rotstift ul{padding-left:1.15em;max-width:48rem}
#mathe .mh-rotstift li{margin:5px 0}
#mathe .mh-uebung{margin-top:34px;padding:18px 22px 20px;border:2px dashed var(--mh-orange);border-radius:8px}
#mathe .mh-urteil{font-weight:700;min-height:1.6em}
#mathe .mh-urteil.gut{color:var(--mh-gruen)}
#mathe .mh-klappe{border:1.5px solid var(--mh-kaestchen-stark);border-radius:8px;padding:0 18px;align-self:start}
#mathe .mh-klappe[open]{padding-bottom:18px}
#mathe .mh-klappe summary{cursor:pointer;font-weight:700;padding:13px 0;min-height:46px}
#mathe .mh-klappe>p{margin:2px 0 10px}

/* ---------- Spickzettel als Karteikarten ---------- */
#mathe .mh-zettel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;margin-top:24px}
#mathe .mh-zettel article{border:1.5px solid var(--mh-kaestchen-stark);border-radius:4px;padding:16px 20px 20px;background:linear-gradient(#fff,#fff) padding-box}
#mathe .mh-zettel h3{font-size:1.2rem;padding-bottom:8px;margin-bottom:12px;border-bottom:2.5px solid var(--mh-rot-hell)}
#mathe .mh-zettel ul{padding-left:1.15em}
#mathe .mh-zettel li,#mathe .mh-zettel p{margin:6px 0}
#mathe .mh-zettel .mh-tabelle{margin:12px 0}
#mathe .mh-zettel .m{white-space:normal}

/* ---------- Werbeplatz: den Inhalt setzt eCMS ein und bringt sein eigenes Aussehen mit ---------- */
#mathe .mh-werbung .ecms-ad-slot{margin:30px 0 0}
#mathe .mh-werbung .ecms-ad a{color:inherit}

/* ---------- Fuß ---------- */
#mathe .mh-fuss{margin-top:46px;padding-top:26px;border-top:1.5px solid var(--mh-linie);max-width:46rem}
#mathe .mh-fuss h2{font-size:1.2rem;margin-bottom:10px}
#mathe .mh-fuss p{margin:10px 0;color:var(--mh-leise)}
#mathe .mh-fusslinks{display:flex;flex-wrap:wrap;gap:6px 22px}

/* ---------- schmale Bildschirme ---------- */
@media (max-width:860px){
  #mathe{padding:0 16px 36px;font-size:16.5px}
  #mathe .mh-kopf{padding:16px 0 13px;flex-wrap:wrap;row-gap:4px}
  #mathe .mh-kopf nav{gap:16px;font-size:.9rem}
  #mathe .mh-auftakt{padding:24px 0 20px}
  #mathe .mh-auftakt p{font-size:1rem}
  #mathe .mh-blatt{padding:20px 16px 28px;border-radius:0 8px 8px 8px}
  #mathe .mh-arbeit,#mathe .mh-arbeit.umgekehrt{grid-template-columns:minmax(0,1fr);gap:16px}
  /* Der Graph bleibt beim Scrollen oben stehen, damit man ihn beim Ziehen der Regler sieht */
  #mathe .mh-arbeit:not(.umgekehrt)>.mh-zeichnung{position:sticky;top:0;z-index:5;background:var(--mh-blatt);padding:6px 0 4px;margin:0 -4px;box-shadow:0 8px 10px -10px rgba(22,34,74,.45)}
  #mathe .mh-zeichnung canvas{height:min(44vh,360px);min-height:230px}
  #mathe .mh-zeichnung.flach canvas{height:min(40vh,300px);min-height:220px}
  #mathe .mh-arbeit:not(.umgekehrt)>.mh-zeichnung .mh-bildhinweis{display:none}
  #mathe .mh-zoom{top:14px;right:8px}
  #mathe .mh-heft{grid-template-columns:minmax(0,1fr);gap:26px;margin-top:26px;padding-top:20px}
  #mathe .mh-weg>li{grid-template-columns:minmax(0,1fr)}
  #mathe .mh-rand{border-left:3px solid var(--mh-rot-hell);margin:0 0 12px 2.3em;padding:2px 0 2px 12px}
  #mathe .mh-schritt{padding-right:0;padding-bottom:8px}
  #mathe .mh-zettel{grid-template-columns:minmax(0,1fr)}
  #mathe .mh-eingabe label{font-size:1.2rem}
  #mathe .mh-eingabe input{font-size:1.2rem}
  #mathe .op{display:block;margin:2px 0 4px;width:max-content}
}
@media (max-width:600px){
  #mathe .mh-zeichnung.flach #kreis-bild{height:224px;min-height:0}
}
@media (max-width:420px){
  #mathe .mh-ort{border-left:0;padding-left:0}
  #mathe .mh-kopf nav{width:100%;margin-left:0}
}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* ---------- Drucken: nur das offene Blatt ---------- */
@media print{
  html,body,#mathe{background:#fff}
  #mathe{padding:0;max-width:none}
  #mathe .mh-register,#mathe .mh-kopf nav,#mathe .mh-zoom,#mathe .mh-chips,#mathe .mh-uebung,#mathe .mh-bildhinweis,#mathe .mh-knopf,#mathe .mh-sprung{display:none!important}
  #mathe .mh-blatt{border:0;padding:0}
  #mathe .mh-auftakt p{display:none}
  #mathe h1{font-size:1.4rem}
  #mathe .mh-weg>li,#mathe .mh-zettel>*,#mathe .mh-rotstift,#mathe .mh-zeichnung{break-inside:avoid}
  /* Der Graph behält beim Drucken sein Seitenverhältnis */
  #mathe .mh-zeichnung canvas,#mathe .mh-zeichnung.flach canvas,#mathe .mh-zeichnung.klein canvas{width:auto!important;height:auto!important;min-height:0;max-width:100%;max-height:9.5cm}
  #mathe .mh-arbeit>.mh-zeichnung{position:static;box-shadow:none}
  #mathe .mh-fuss{display:none}
}

/* =====================================================================
   Themenseiten, Startseite, Übungen (ab Fassung 2)
   ===================================================================== */
#mathe a.mh-ort{text-decoration:none}
#mathe a.mh-ort:hover{text-decoration:underline}
#mathe .mh-auftakt .mh-pfad{margin:0 0 12px;font-size:.95rem}
#mathe .mh-pfad a{color:inherit}
#mathe .mh-stufe{display:inline-block;font:700 .74rem/1 var(--mh-text);letter-spacing:.02em;padding:4px 6px 3px;border:1.5px solid currentColor;border-radius:5px;margin-left:6px;vertical-align:.12em;color:var(--mh-fueller);background:#fff}
#mathe .mh-stufe.q{color:var(--mh-gruen)}
#mathe .mh-stufe.lk{color:var(--mh-violett)}
#mathe .mh-sprungleiste{display:flex;flex-wrap:wrap;gap:6px;margin-top:20px}
#mathe .mh-sprungleiste a{display:inline-flex;align-items:center;min-height:40px;padding:5px 14px;border:1.5px solid var(--mh-linie);border-radius:999px;background:#fff;color:var(--mh-tinte);text-decoration:none;font-size:.95rem}
#mathe .mh-sprungleiste a:hover{border-color:var(--mh-fueller)}
#mathe main>.mh-blatt,#mathe main>.mh-gebiete{margin-top:18px}
#mathe main>.mh-blatt{border-radius:10px;scroll-margin-top:12px}
#mathe .mh-blatt>h2+p.mh-kurz{margin-bottom:6px}

/* Erklärtext */
#mathe .mh-text{max-width:44rem}
#mathe .mh-text p,#mathe .mh-text ul,#mathe .mh-text ol{margin:12px 0}
#mathe .mh-text ul,#mathe .mh-text ol{padding-left:1.3em}
#mathe .mh-text li{margin:6px 0}
#mathe .mh-text h3{margin:28px 0 6px;font-size:1.16rem}
#mathe .mh-text .m,#mathe .mh-leben .m,#mathe .mh-bsp .m,#mathe .mh-merk .m,#mathe .mh-aufgabe .m{white-space:normal}
#mathe .mh-leben{margin:20px 0;padding:14px 20px 16px;border-left:6px solid var(--mh-marker);background:#fffbe0;border-radius:0 8px 8px 0;max-width:44rem}
#mathe .mh-leben h3{margin:0 0 6px;font-size:1.02rem}
#mathe .mh-leben p{margin:8px 0}
#mathe .mh-bsp{margin:20px 0;padding:14px 20px 16px;border:1.5px solid var(--mh-kaestchen-stark);border-radius:8px;max-width:46rem;background:linear-gradient(var(--mh-kaestchen) 1px,transparent 1px) 0 -1px/100% 28px,#fff;background-color:#fff}
#mathe .mh-bsp{background:#fff}
#mathe .mh-bsp h3{margin:0 0 8px;font-size:1.02rem;color:var(--mh-fueller)}
#mathe .mh-bsp p{margin:7px 0}
#mathe .mh-bsp ol,#mathe .mh-bsp ul{margin:7px 0;padding-left:1.3em}
#mathe .mh-bsp li{margin:6px 0}
#mathe .mh-merk{margin:20px 0;padding:14px 20px 16px;background:#fff7bf;border-radius:3px;box-shadow:0 2px 0 #e9dc8a;max-width:44rem}
#mathe .mh-merk h3{margin:0 0 6px;font-size:1.02rem}
#mathe .mh-merk p{margin:7px 0}
#mathe .mh-merk ul{margin:6px 0;padding-left:1.2em}
#mathe .mh-merk li{margin:5px 0}
#mathe .mh-wozu{margin:20px 0 0;padding:16px 20px 18px;border:1.5px solid var(--mh-linie);border-radius:8px;max-width:44rem;background:var(--mh-papier)}
#mathe .mh-wozu h3{margin:0 0 6px;font-size:1.02rem}
#mathe .mh-wozu p{margin:8px 0}
#mathe .mh-wozu .mh-buch{font-size:.93rem;color:var(--mh-leise);border-top:1px solid var(--mh-linie);padding-top:9px;margin-top:12px}
#mathe .mh-formelzeile{font-family:var(--mh-formel);font-size:1.22rem;line-height:1.7;margin:10px 0;overflow-x:auto;overflow-y:hidden;padding-bottom:2px}
#mathe .mh-zwei{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:26px 36px;align-items:start}

/* Eingabefelder der Rechner */
#mathe .mh-felder{display:grid;grid-template-columns:repeat(auto-fit,minmax(118px,1fr));gap:10px 14px;margin:14px 0;max-width:46rem;align-items:end}
#mathe .mh-felder label{display:grid;gap:3px;font-size:.93rem;color:var(--mh-bleistift)}
#mathe .mh-felder input,#mathe .mh-felder select,#mathe .mh-stufenwahl select,#mathe .mh-suche input{font:inherit;color:var(--mh-tinte);padding:8px 10px;border:1.5px solid var(--mh-kaestchen-stark);border-radius:7px;background:#fff;min-height:44px;width:100%;min-width:0}
#mathe .mh-felder input{font-family:var(--mh-formel);font-size:1.1rem}
#mathe .mh-felder input:focus,#mathe .mh-felder select:focus{border-color:var(--mh-fueller)}
#mathe .mh-felder.eng{grid-template-columns:repeat(auto-fit,minmax(84px,1fr))}
#mathe .mh-vekfeld{display:inline-grid;gap:4px;vertical-align:middle;padding:4px 8px;border-left:2px solid var(--mh-tinte);border-right:2px solid var(--mh-tinte);border-radius:12px/50%;margin:0 4px}
#mathe .mh-vekfeld input{width:3.6em;min-height:38px;padding:4px 6px;text-align:center;font:400 1.05rem var(--mh-formel);border:1.5px solid var(--mh-kaestchen-stark);border-radius:6px;background:#fff;color:var(--mh-tinte)}
#mathe .mh-vekzeile{display:flex;flex-wrap:wrap;align-items:center;gap:6px 4px;margin:12px 0;font-family:var(--mh-formel);font-size:1.15rem}
#mathe .mh-vekzeile b{font-weight:400;font-style:italic}
#mathe .mh-fehler{color:var(--mh-rot);font-weight:700;margin:8px 0}

/* Vektoren und Gleichungssysteme in Formeln */
#mathe .vek{display:inline-flex;flex-direction:column;vertical-align:middle;text-align:center;line-height:1.3;padding:2px .5em;margin:2px .12em;border-left:1.5px solid currentColor;border-right:1.5px solid currentColor;border-radius:.7em/50%}
#mathe .vek .bruch{font-size:.72em}
#mathe .mh-lgs{display:inline-grid;gap:2px;padding:6px 0 6px 12px;border-left:2px solid var(--mh-kaestchen-stark);margin:4px 0}
#mathe .mh-lgs>span{display:block;white-space:nowrap}
#mathe .mh-lgs i{display:inline-block;min-width:2.1em;font-style:normal;font-size:.85rem;color:var(--mh-bleistift)}
#mathe .mh-schritt{overflow-x:auto}

/* Übungs-Baustein */
#mathe .mh-uebung>h3{margin-bottom:6px}
#mathe .mh-aufgabe{font-size:1.08rem;margin:6px 0 12px;max-width:46rem}
#mathe .mh-aufgabe p{margin:6px 0}
#mathe .mh-knoepfe{display:flex;flex-wrap:wrap;gap:8px}
#mathe .mh-loesung{margin-top:16px}
#mathe .mh-stufenwahl{margin:4px 0 10px}
#mathe .mh-stufenwahl select{width:auto;margin-left:8px}

/* Tabellen im Text */
#mathe .mh-tab{width:auto;max-width:100%;margin:12px 0}
#mathe .mh-tab th,#mathe .mh-tab td{border:1px solid var(--mh-kaestchen-stark);padding:7px 11px;text-align:left;vertical-align:top}
#mathe .mh-tab th{background:#eef3fa;font-weight:700}
#mathe .mh-tab td.z,#mathe .mh-tab th.z{text-align:center;font-family:var(--mh-formel)}

/* Zurück und Weiter */
#mathe .mh-weiter{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:12px;align-items:stretch;margin-top:34px}
#mathe .mh-weiter a{display:block;min-width:0;overflow-wrap:anywhere;hyphens:auto;padding:11px 16px;border:1.5px solid var(--mh-linie);border-radius:8px;background:#fff;color:var(--mh-tinte);text-decoration:none;font-weight:700}
#mathe .mh-weiter a:hover{border-color:var(--mh-fueller)}
#mathe .mh-weiter a small{display:block;font-weight:400;font-size:.85rem;color:var(--mh-bleistift)}
#mathe .mh-weiter a[rel=next]{text-align:right}
#mathe .mh-weiter a.mitte{align-self:center;font-weight:400;border-color:transparent;background:transparent;text-decoration:underline;text-underline-offset:3px}

/* Startseite */
#mathe .mh-suche{display:grid;gap:5px;margin-top:22px;max-width:34rem}
#mathe .mh-auftakt .mh-suche label{font-size:.95rem;color:var(--mh-leise)}
#mathe .mh-suche input{font-size:1.15rem;border-width:2px;border-color:var(--mh-fueller)}
#mathe .mh-gebiete{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;align-items:start}
#mathe .mh-gebiet{padding:22px 24px 14px;border-radius:10px}
#mathe .mh-gebiet h2 a{color:inherit;text-decoration:none}
#mathe .mh-gebiet h2 a:hover{text-decoration:underline}
#mathe .mh-gebiet .mh-kurz{font-size:.95rem;min-height:3.1em}
#mathe .mh-themen{list-style:none;padding:0;margin-top:10px}
#mathe .mh-themen li{border-top:1px solid var(--mh-kaestchen)}
#mathe .mh-themen a{display:block;padding:10px 0 11px;text-decoration:none;color:var(--mh-tinte);font-weight:700}
#mathe .mh-themen a:hover{color:var(--mh-fueller)}
#mathe .mh-themen a small{display:block;font-weight:400;font-size:.9rem;color:var(--mh-bleistift);line-height:1.4;margin-top:2px}
#mathe .mh-themen.quer{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 28px}
#mathe .mh-quer{margin-top:18px}
#mathe .mh-legende{margin-top:16px}
#mathe .mh-legende .mh-stufe{margin-left:0}

@media (max-width:860px){
  #mathe main>.mh-blatt{border-radius:8px}
  #mathe .mh-gebiete,#mathe .mh-themen.quer,#mathe .mh-zwei{grid-template-columns:minmax(0,1fr)}
  #mathe .mh-gebiet{padding:18px 16px 8px}
  #mathe .mh-gebiet .mh-kurz{min-height:0}
  #mathe .mh-weiter{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  #mathe .mh-weiter a.mitte{grid-column:1/-1;grid-row:2;text-align:center}
  #mathe .mh-leben,#mathe .mh-bsp,#mathe .mh-merk,#mathe .mh-wozu{padding-left:14px;padding-right:14px}
}
@media print{
  #mathe .mh-sprungleiste,#mathe .mh-weiter,#mathe .mh-knoepfe,#mathe .mh-suche,#mathe .mh-pfad{display:none!important}
  #mathe .mh-leben,#mathe .mh-bsp,#mathe .mh-merk,#mathe .mh-wozu{break-inside:avoid}
  #mathe main>.mh-blatt{border:0;padding:0;margin-top:14px}
}
#mathe a.mh-knopf{display:inline-flex;align-items:center;text-decoration:none}
#mathe a.mh-knopf.leise{color:var(--mh-fueller)}
@media (max-width:860px){
  #mathe .mh-tab{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
  #mathe .mh-text,#mathe .mh-leben,#mathe .mh-bsp,#mathe .mh-merk,#mathe .mh-wozu{overflow-wrap:break-word}
}
/* Vektorpfeil über einem Buchstaben */
#mathe .pf{display:inline-block;position:relative;padding-top:.3em;line-height:1}
#mathe .pf::before{content:"→";position:absolute;top:-.34em;left:-.1em;right:-.1em;text-align:center;font:400 .72em/1 Arial,sans-serif}
#mathe .mh-zeichnung.raum canvas{cursor:grab;height:clamp(320px,46vw,480px)}
@media (max-width:860px){ #mathe .mh-zeichnung.raum canvas{height:min(52vh,380px);min-height:260px} }

/* Stochastik: Binomialkoeffizient, Baumdiagramm, Vierfeldertafel */
#mathe .binom{display:inline-flex;flex-direction:column;vertical-align:middle;text-align:center;line-height:1.15;font-size:.86em;padding:1px .45em;margin:0 .1em;border-left:1.5px solid currentColor;border-right:1.5px solid currentColor;border-radius:.7em/50%}
#mathe .mh-baum{background:#fff;border:1px solid var(--mh-kaestchen-stark);border-radius:10px;padding:8px}
#mathe .mh-baum svg{display:block;width:100%;height:auto;max-width:470px}
#mathe .mh-baum line{stroke:var(--mh-tinte);stroke-width:1.8}
#mathe .mh-baum line.an{stroke:var(--mh-rot);stroke-width:3.4}
#mathe .mh-baum circle{fill:#fff;stroke:var(--mh-tinte);stroke-width:1.8}
#mathe .mh-baum circle.an{stroke:var(--mh-rot);stroke-width:3}
#mathe .mh-baum circle.start{fill:var(--mh-tinte)}
#mathe .mh-baum rect.schild{fill:#fff;opacity:.94}
#mathe .mh-baum text{font-family:var(--mh-text);fill:var(--mh-tinte)}
#mathe .mh-baum text.k{font-weight:700;font-size:16px}
#mathe .mh-baum text.p{font-family:var(--mh-formel);font-size:17px}
#mathe .mh-baum text.e{font-family:var(--mh-formel);font-size:17px}
#mathe .mh-baum text.an{fill:var(--mh-rot)}
#mathe .mh-vft td,#mathe .mh-vft th{text-align:center}
#mathe .mh-vft td.summe,#mathe .mh-vft th.summe{background:#f6f8fc;font-weight:700}
#mathe .mh-vft td.an{background:#fdeeee;outline:2px solid var(--mh-rot);outline-offset:-2px}
#mathe .mh-vft small{display:block;color:var(--mh-bleistift);font-family:var(--mh-text);font-size:.8rem}
#mathe .mh-wahl{display:flex;flex-wrap:wrap;gap:8px 18px;margin:10px 0}
#mathe .mh-wahl label{display:inline-flex;align-items:center;gap:6px}
#mathe .mh-zeilen{display:grid;gap:8px;margin:12px 0}
#mathe .mh-zeilen .z{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
#mathe .mh-zeilen input[type=text]{width:5.2em}
#mathe .mh-zeilen select{max-width:100%}
#mathe .mh-lgsfeld{display:grid;gap:8px;margin:12px 0}
#mathe .mh-lgsfeld .z{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;font-family:var(--mh-formel)}
#mathe .mh-lgsfeld input{width:3.6em;text-align:center}

/* Skizzen und aufklappbare Lösungen */
#mathe .mh-skizze svg{display:block;width:100%;max-width:360px;height:auto;margin:0 auto 8px}
#mathe .mh-skizze text{font-family:var(--mh-text);font-size:13px;fill:var(--mh-bleistift)}
#mathe .mh-skizze text.x{font-family:var(--mh-formel);font-style:italic;font-size:17px;fill:var(--mh-rot)}
#mathe .mh-skizze .wand{fill:var(--mh-bleistift)}
#mathe .mh-skizze .flaeche{fill:#dff0e6}
#mathe .mh-skizze .zaun{fill:none;stroke:var(--mh-fueller);stroke-width:3;stroke-linejoin:round}
#mathe .mh-skizze .karton{fill:#f1e4cf;stroke:var(--mh-tinte);stroke-width:1.5}
#mathe .mh-skizze .weg{fill:#fff;stroke:var(--mh-rot);stroke-width:1.5;stroke-dasharray:4 3}
#mathe .mh-skizze .falz{fill:none;stroke:var(--mh-tinte);stroke-width:1.2;stroke-dasharray:6 4}
#mathe .mh-klapp{margin-top:22px;border-top:1px solid var(--mh-kaestchen-stark);padding-top:12px}
#mathe .mh-klapp summary{cursor:pointer;font-weight:700;color:var(--mh-fueller);min-height:44px;display:flex;align-items:center;gap:8px}
#mathe .mh-klapp summary::before{content:"▸";display:inline-block;transition:transform .15s}
#mathe .mh-klapp[open] summary::before{transform:rotate(90deg)}
#mathe .mh-klapp summary::-webkit-details-marker{display:none}
@media (prefers-reduced-motion:reduce){ #mathe .mh-klapp summary::before{transition:none} }
#mathe .mh-int{font-family:var(--mh-formel);font-size:1.5em;line-height:1;vertical-align:-.12em}
#mathe .mh-int sub,#mathe .mh-int sup{font-size:.5em;line-height:1}
#mathe .mh-int sup{vertical-align:1.1em;margin-left:-.15em}
#mathe .mh-int sub{vertical-align:-.7em}
#mathe .mh-lgsfeld .nr{min-width:1.9em;font-family:var(--mh-text);font-size:.85rem;color:var(--mh-bleistift)}
#mathe .mh-aufgabe .mh-frage{margin:6px 0}
#mathe .mh-aufgabe .mh-frage .mh-tab{font-size:1rem}
#mathe .wurzel.hoch,#mathe .wurzel:has(.bruch){display:inline-block;vertical-align:middle;padding-top:2px}
#mathe .mh-felder label.breit{grid-column:span 2}
@media (max-width:420px){ #mathe .mh-felder label.breit{grid-column:1/-1} }
#mathe .mh-baum{max-width:500px;margin:16px 0}
#mathe .mh-check ul{list-style:none;padding-left:0}
#mathe .mh-check label{display:flex;align-items:flex-start;gap:10px;min-height:36px;padding:3px 0}
#mathe .mh-check input{width:20px;height:20px;flex:0 0 auto;margin-top:3px;accent-color:var(--mh-fueller)}
@media (max-width:480px){
  #mathe .mh-lgsfeld .z{gap:3px 4px;flex-wrap:nowrap}
  #mathe .mh-lgsfeld input{width:2.55em;padding-left:2px;padding-right:2px;min-width:0;flex:1 1 2.2em}
  #mathe .mh-lgsfeld .nr{min-width:1.5em}
  #mathe .mh-vft th,#mathe .mh-vft td{padding:6px 7px;font-size:.92rem}
  #mathe .mh-zeilen input[type=text]{width:4.4em}
}
#mathe .mh-felder label{min-width:0;grid-template-columns:minmax(0,1fr);overflow-wrap:break-word}
@media (max-width:860px){ #mathe .mh-tab tbody th{white-space:normal} }
@media (max-width:480px){
  #mathe .mh-tab{font-size:.95rem}
  #mathe .mh-tab th,#mathe .mh-tab td{padding:6px 8px}
}
@media (max-width:480px){
  #mathe main tbody th{white-space:normal}
  #mathe main table th,#mathe main table td{overflow-wrap:anywhere;hyphens:auto}
  #mathe .mh-zettel table th,#mathe .mh-zettel table td{padding-left:7px;padding-right:7px}
}
