/* ==========================================================================
   Magnet Meister - PHYSIK-SAMMLUNG / EXPERIMENTIERTISCH
   Welt: die Wand der Physik-Sammlung einer Mittelschule. Holzregal mit
   Hufeisen- und Stabmagneten, angepinnter Feldlinien-Bogen, Eisenfeilspulen-
   Glas, Kompass im Messinggehaeuse, Klemmen und ein Kontrolllaempchen.
   Buehne  = Versuchsbogen (Millimeterpapier mit Messingklemmen)
   HUD     = Messprotokoll (Papierformular mit Randlochung)
   Karten  = Karteikarten, Ergebnis = Versuchsprotokoll mit Stempel.
   Alles haengt an body.jupi.mm_body - die Paket-Kopie von jupi.css bleibt
   unberuehrt (nur ueberschrieben). Doppel-Praefix noetig, weil
   html[data-theme="dark"] body.jupi / .jupi_header spezifischer sind.
   ========================================================================== */

/* ---------- Grundflaeche: eine gestreckte Szene (3.13.7, Weg A) ---------- */
body.jupi.mm_body {
  background-color: #6b4b2d;
  background-image: url("kulisse.svg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center top;
  background-attachment: fixed;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: #2b1c0d;
}

/* Das Plattform-Grid verteilte die freie Hoehe auf eine leere erste Zeile
   (bypass) - dadurch sass die Kopfleiste 78 px zu tief. Feste Zeilen. */
body.jupi.mm_body .jupi_container {
  display: grid;
  grid-template-rows: 0 min-content 1fr auto;
  align-content: normal;
  min-height: 100dvh;
  background: transparent;
}
body.jupi.mm_body .jupi_container > .jupi_main { background: transparent; }
body.jupi.mm_body .jupi_main { padding-top: 1.1rem; display: flex; flex-direction: column; justify-content: center; }

/* ---------- Kopfleiste: Nussholz mit Messingkante ---------- */
body.jupi.mm_body .mm_header {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: .55rem 1rem;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.10) 0 1px, rgba(255,255,255,.04) 1px 3px),
    linear-gradient(180deg, #7a5330 0%, #67452a 48%, #55381f 100%);
  border-bottom: 3px solid #b78d3f;
  box-shadow: 0 6px 18px rgba(28, 16, 6, .38), inset 0 1px 0 rgba(255, 226, 170, .32);
  backdrop-filter: none;
  color: #fbefd8;
}
body.jupi.mm_body .mm_header .jupi_nav_back {
  justify-self: start;
  position: static;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .4rem .9rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 800;
  color: #33220a;
  background: linear-gradient(180deg, #f4dfae 0%, #dcbb74 55%, #c9a355 100%);
  border: 1px solid #8a6a28;
  box-shadow: 0 2px 0 rgba(255, 240, 205, .5) inset, 0 2px 8px rgba(0, 0, 0, .3);
}
body.jupi.mm_body .mm_header .jupi_nav_back:hover {
  background: linear-gradient(180deg, #fdf0cd 0%, #e6c882 55%, #d1ad60 100%);
  transform: translateY(-1px);
}
body.jupi.mm_body .mm_brand {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 0;
}
body.jupi.mm_body .mm_brand img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  box-shadow: 0 0 0 2px #b78d3f, 0 2px 8px rgba(0, 0, 0, .35);
}
body.jupi.mm_body .mm_brand h1 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
  color: #fdf3e0;
  letter-spacing: -.01em;
  text-shadow: 0 1px 2px rgba(31, 17, 5, .55);
  white-space: nowrap;
}
body.jupi.mm_body .mm_header .jupi_werkzeuge {
  position: static;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: .55rem;
}
body.jupi.mm_body .mm_header .jupi_sprachen_select {
  color: #fbefd8;
  background: rgba(255, 240, 210, .14);
  border: 1px solid rgba(255, 226, 168, .55);
  min-height: 34px;
}
body.jupi.mm_body .mm_header .jupi_sprachen_select:hover { background: rgba(255, 240, 210, .26); }
body.jupi.mm_body .mm_header .jupi_sprachen_select option { color: #2b1c0d; background: #f6ecd4; }
body.jupi.mm_body .mm_header .jupi_theme_switch {
  width: 74px;
  height: 40px;
  background: rgba(38, 22, 9, .55);
  border-color: rgba(255, 226, 168, .5);
}
/* 74x40-Pille wie auf dem Dashboard (Bedienziel >= 40 px, Regel 3.13.5) */
body.jupi.mm_body .mm_header .jupi_theme_switch .jts_thumb {
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 32px;
  border-radius: 999px;
}
body.jupi.mm_body .mm_header .jupi_theme_switch .jts_sun { left: 9px; }
body.jupi.mm_body .mm_header .jupi_theme_switch .jts_moon { right: 9px; }
html[data-theme="dark"] body.jupi.mm_body .mm_header .jupi_theme_switch .jts_thumb {
  left: calc(100% - 36px);
}

@media (max-width: 680px) {
  body.jupi.mm_body .mm_header {
    grid-template-columns: 1fr auto;
    gap: .45rem;
    padding: .5rem .6rem;
  }
  body.jupi.mm_body .mm_brand {
    grid-row: 1;
    grid-column: 1 / -1;
    justify-content: center;
  }
  body.jupi.mm_body .mm_brand h1 { font-size: 1.1rem; }
  body.jupi.mm_body .mm_brand img { width: 30px; height: 30px; }
  body.jupi.mm_body .mm_header .jupi_nav_back {
    grid-row: 2;
    grid-column: 1;
    font-size: .82rem;
    padding: .35rem .6rem;
  }
  body.jupi.mm_body .mm_header .jupi_werkzeuge {
    grid-row: 2;
    grid-column: 2;
    gap: .35rem;
  }
  body.jupi.mm_body .mm_header .jupi_sprachen_select {
    max-width: 7.6rem;
    font-size: .74rem;
    padding: .18rem .35rem;
  }
}

/* ---------- HUD: Messprotokoll (Papierformular mit Randlochung) ---------- */
body.jupi.mm_body .mm_panel {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .9rem;
  align-items: center;
  margin: 0 0 .8rem;
  padding: .8rem 1rem .8rem 2.1rem;
  border-radius: .55rem;
  border: 1px solid #cbb78f;
  border-top: 3px solid #b78d3f;
  background-color: #f7efdb;
  background-image:
    repeating-linear-gradient(0deg, rgba(120, 145, 168, .16) 0 1px, transparent 1px 20px);
  box-shadow: 0 4px 14px rgba(32, 20, 8, .3), inset 0 0 0 1px rgba(255, 255, 255, .6);
  color: #3b2a15;
}
/* Randlochung links wie auf einem Laborblock */
body.jupi.mm_body .mm_panel::before {
  content: "";
  position: absolute;
  inset: .5rem auto .5rem .6rem;
  width: .9rem;
  background-image: radial-gradient(circle at 50% 50%, #cbb78f 0 3px, transparent 3.5px);
  background-size: .9rem 1.4rem;
  background-repeat: repeat-y;
  opacity: .9;
  pointer-events: none;
}
body.jupi.mm_body .mm_stat {
  text-align: center;
  min-width: 3.6rem;
}
body.jupi.mm_body .mm_stat label {
  display: block;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #8a7248;
  font-weight: 700;
}
body.jupi.mm_body .mm_stat span {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: #2f3f4d;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
body.jupi.mm_body .mm_controls {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .5rem;
  align-items: center;
  margin-left: auto;
}
body.jupi.mm_body .mm_controls label {
  font-size: .84rem;
  font-weight: 700;
  color: #5c452a;
}
body.jupi.mm_body .mm_controls select,
body.jupi.mm_body .jupi_select {
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  padding: .3rem .55rem;
  border-radius: .4rem;
  border: 1px solid #b09a70;
  background: #fffdf6;
  color: #33251a;
  min-height: 40px;
  box-sizing: border-box;
}
body.jupi.mm_body .mm_controls select:focus,
body.jupi.mm_body .jupi_select:focus {
  outline: none;
  border-color: #b78d3f;
  box-shadow: 0 0 0 3px rgba(183, 141, 63, .3);
}

/* ---------- Knoepfe: Messing (Haupt) und Stahl (Neben) ---------- */
body.jupi.mm_body .jupi_btn {
  font-size: .95rem;
  font-weight: 800;
  padding: .55rem 1.1rem;
  min-height: 40px;
  border: 1px solid #8a6a28;
  border-radius: .5rem;
  cursor: pointer;
  color: #33220a;
  background: linear-gradient(180deg, #f0d79f 0%, #d6b069 55%, #c19a4c 100%);
  box-shadow: 0 2px 0 rgba(255, 245, 220, .55) inset, 0 3px 8px rgba(40, 25, 8, .28);
  transition: transform .12s, box-shadow .12s, background .12s;
  letter-spacing: .01em;
}
body.jupi.mm_body .jupi_btn:hover {
  background: linear-gradient(180deg, #fbe9bd 0%, #e2bf78 55%, #cda759 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 0 rgba(255, 245, 220, .6) inset, 0 5px 12px rgba(40, 25, 8, .32);
}
body.jupi.mm_body .jupi_btn:active { transform: translateY(0); }
body.jupi.mm_body .jupi_btn_alt {
  color: #1e2b34;
  background: linear-gradient(180deg, #eef3f6 0%, #cfd9e0 55%, #b3c0c9 100%);
  border-color: #7d8b95;
  box-shadow: 0 2px 0 rgba(255, 255, 255, .6) inset, 0 3px 8px rgba(30, 20, 10, .22);
}
body.jupi.mm_body .jupi_btn_alt:hover {
  background: linear-gradient(180deg, #f7fafb 0%, #dbe4ea 55%, #c0ccd4 100%);
}
body.jupi.mm_body .jupi_btn:disabled {
  opacity: .55;
  cursor: default;
  transform: none;
}

/* ---------- Buehne: Versuchsbogen auf der Werkbank ---------- */
body.jupi.mm_body .mm_stage {
  position: relative;
  flex: 0 0 auto;
  margin: 0 0 0;
  padding: 1.15rem 1.3rem 1.25rem;
  min-height: 22rem;
  border-radius: .35rem;
  border: 1px solid #d3c19a;
  background-color: #fbf4e4;
  background-image:
    repeating-linear-gradient(0deg, rgba(116, 146, 172, .17) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(116, 146, 172, .17) 0 1px, transparent 1px 24px);
  box-shadow: 0 8px 22px rgba(30, 18, 6, .34), inset 0 0 0 1px rgba(255, 255, 255, .7);
  color: #2f2417;
}
/* Zwei Messingklemmen halten den Bogen auf der Tischplatte */
body.jupi.mm_body .mm_stage::before,
body.jupi.mm_body .mm_stage::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 44px;
  height: 17px;
  border-radius: 4px;
  background: linear-gradient(180deg, #e8cb8d 0%, #c19a4c 60%, #93702c 100%);
  border: 1px solid #7a5c22;
  box-shadow: 0 2px 5px rgba(20, 12, 3, .4);
  z-index: 3;
  pointer-events: none;
}
body.jupi.mm_body .mm_stage::before { left: 26px; }
body.jupi.mm_body .mm_stage::after { right: 26px; }

body.jupi.mm_body .mm_task_label {
  display: inline-block;
  align-self: flex-start;
  margin: .1rem 0 .55rem;
  padding: .16rem .6rem;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #4a3a1d;
  background: #f0e2c2;
  border: 1px solid #c9b48a;
  border-left: 4px solid #b78d3f;
  border-radius: .2rem;
}
body.jupi.mm_body .mm_aufgabe {
  margin: .2rem 0 .85rem;
  font-size: 1.08rem;
  line-height: 1.6;
  color: #33251a;
}
body.jupi.mm_body .mm_aufgabe b { color: #7d2f18; }
body.jupi.mm_body .mm_buehne {
  text-align: center;
  margin: .2rem 0 .9rem;
}
body.jupi.mm_body .mm_buehne svg { max-width: 100%; height: auto; }

/* Probierstueck-Etikett unter dem Magneten */
body.jupi.mm_body .mm_karte {
  display: inline-block;
  margin: .6rem 0 0;
  padding: .5rem 1.1rem;
  font-size: 1.12rem;
  font-weight: 800;
  color: #3a2a14;
  background: #fffdf4;
  border: 1px solid #c9b48a;
  border-radius: .2rem;
  box-shadow: 0 3px 8px rgba(30, 18, 6, .22), inset 0 -2px 0 rgba(183, 141, 63, .35);
  transform: rotate(-.8deg);
}

/* ---------- Antworten: Karteikarten mit farbigem Reiter ---------- */
body.jupi.mm_body .mm_antworten {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: .6rem;
  margin: .5rem 0 .2rem;
}
body.jupi.mm_body .mm_ant {
  position: relative;
  padding: .75rem .85rem .75rem 1.1rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #2b2118;
  background: #fffdf5;
  border: 1px solid #cbb78f;
  border-radius: .3rem;
  box-shadow: 0 3px 9px rgba(30, 18, 6, .22);
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  transition: transform .12s, box-shadow .12s, border-color .12s, background .12s;
}
/* Reiter links (Karteikarten-Register) */
body.jupi.mm_body .mm_ant::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: 4px;
  border-radius: 2px;
  background: #3d6a92;
}
body.jupi.mm_body .mm_ant:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #b78d3f;
  box-shadow: 0 6px 14px rgba(30, 18, 6, .3);
}
body.jupi.mm_body .mm_ant:focus-visible {
  outline: 3px solid #b78d3f;
  outline-offset: 2px;
}
body.jupi.mm_body .mm_ant:disabled { cursor: default; opacity: .92; }
body.jupi.mm_body .mm_ant.mm_ok {
  background: #eaf3e4;
  border-color: #5b8f4a;
  color: #1d4a20;
}
body.jupi.mm_body .mm_ant.mm_ok::before { background: #3f7a33; }
body.jupi.mm_body .mm_ant.mm_err {
  background: #fbeae6;
  border-color: #b5544a;
  color: #7d211a;
}
body.jupi.mm_body .mm_ant.mm_err::before { background: #a8453a; }

body.jupi.mm_body .mm_btns_row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .9rem;
}
body.jupi.mm_body .mm_btns_row button { min-height: 40px; }

/* Ergebnis-Notiz unter den Karten */
body.jupi.mm_body .mm_msg {
  min-height: 2.3rem;
  margin-top: .75rem;
  padding-left: .7rem;
  border-left: 3px solid #c9b48a;
  font-weight: 700;
  line-height: 1.5;
  color: #3b2a15;
}
body.jupi.mm_body .mm_msg_ok { border-left-color: #4f8a3f; color: #245620; }
body.jupi.mm_body .mm_msg_err { border-left-color: #b5544a; color: #8d241c; }

/* ---------- Startkarte (Versuchskarte) ---------- */
body.jupi.mm_body .mm_stage.jupi_start_stage { position: relative; }
body.jupi.mm_body .jupi_startoverlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  border-radius: .35rem;
  color: #2f2417;
  background:
    repeating-linear-gradient(0deg, rgba(116, 146, 172, .2) 0 1px, transparent 1px 24px),
    linear-gradient(160deg, #fdf7e8 0%, #f6ecd4 60%, #efe0c0 100%);
  border: 1px solid #cbb78f;
  box-shadow: inset 0 0 0 6px #fbf4e4, inset 0 0 0 7px #cdb98f;
  backdrop-filter: none;
}
body.jupi.mm_body .jupi_startoverlay[hidden] { display: none !important; }
body.jupi.mm_body .jupi_startoverlay h3 {
  font-size: 1.55rem;
  margin: 0 0 .5rem;
  color: #6d4a18;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
}
body.jupi.mm_body .jupi_startoverlay p {
  max-width: 28rem;
  font-size: 1.02rem;
  line-height: 1.55;
  margin: 0 0 1.2rem;
  color: #4a3a22;
}
body.jupi.mm_body .jupi_startoverlay .jupi_btn { font-size: 1.05rem; padding: .6rem 1.5rem; min-height: 44px; }
body.jupi.mm_body .jupi_startoverlay_btns {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Rundenende: Versuchsprotokoll mit Stempel ---------- */
body.jupi.mm_body .mm_done {
  position: relative;
  margin: 0 0 1rem;
  padding: 1.5rem 1.2rem 1.4rem;
  border-radius: .35rem;
  border: 1px solid #cbb78f;
  border-top: 4px solid #b78d3f;
  background:
    repeating-linear-gradient(0deg, rgba(116, 146, 172, .14) 0 1px, transparent 1px 26px),
    #fbf4e4;
  box-shadow: 0 8px 22px rgba(30, 18, 6, .32);
  text-align: center;
  color: #33251a;
}
/* Roter Pruef-Stempel schief in der Ecke */
body.jupi.mm_body .mm_done::after {
  content: "✓";
  position: absolute;
  top: .7rem;
  right: .9rem;
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  font-weight: 900;
  color: rgba(150, 52, 40, .62);
  border: 3px solid rgba(150, 52, 40, .5);
  border-radius: 50%;
  transform: rotate(-14deg);
  pointer-events: none;
}
body.jupi.mm_body .mm_done h3 {
  margin: .2rem 0 .5rem;
  font-size: 1.45rem;
  color: #6d4a18;
}
body.jupi.mm_body .mm_done p {
  margin: .3rem 0 .85rem;
  font-size: 1.02rem;
  color: #3f2f1c;
}
body.jupi.mm_body .mm_sterne {
  font-size: 1.9rem;
  letter-spacing: .1em;
  margin-bottom: 1rem;
}

/* ---------- Hilfe-Fenster: Versuchsanleitung auf Papier ---------- */
body.jupi.mm_body .mm_modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(24, 14, 4, .62);
  backdrop-filter: blur(2px);
}
body.jupi.mm_body .mm_modal[hidden] { display: none !important; }
body.jupi.mm_body .mm_modal_inhalt {
  width: 100%;
  max-width: 36rem;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: .4rem;
  border: 1px solid #cbb78f;
  border-top: 4px solid #b78d3f;
  background: #fbf4e4;
  color: #33251a;
  box-shadow: 0 18px 44px rgba(12, 7, 2, .5);
}
body.jupi.mm_body .mm_modal_kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .75rem 1.1rem;
  border-bottom: 1px solid #d9c8a2;
  background: #f3e8cf;
}
body.jupi.mm_body .mm_modal_kopf h3 { margin: 0; font-size: 1.1rem; color: #6d4a18; }
body.jupi.mm_body .mm_modal_x {
  background: none;
  border: 1px solid transparent;
  font-size: 1.15rem;
  cursor: pointer;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .35rem;
  color: #4a3a22;
  font-family: inherit;
}
body.jupi.mm_body .mm_modal_x:hover { background: rgba(120, 90, 40, .14); border-color: #d9c8a2; }
body.jupi.mm_body .mm_modal_body {
  padding: .95rem 1.15rem;
  overflow-y: auto;
  font-size: .93rem;
  line-height: 1.58;
  color: #3a2c1b;
}
body.jupi.mm_body .mm_modal_body h4 {
  margin: .8rem 0 .3rem;
  font-size: .98rem;
  color: #6d4a18;
}
body.jupi.mm_body .mm_modal_body h4:first-child { margin-top: 0; }
body.jupi.mm_body .mm_modal_body ul { margin: .2rem 0 .6rem; padding-left: 1.2rem; }
body.jupi.mm_body .mm_modal_body li { margin: .25rem 0; }
body.jupi.mm_body .mm_modal_body b { color: #7d2f18; }
body.jupi.mm_body .mm_lernziel {
  margin-top: .6rem;
  padding: .55rem .75rem;
  border-left: 4px solid #b78d3f;
  border-radius: .2rem;
  background: #f6ecd6;
  color: #3a2c1b;
}
body.jupi.mm_body .mm_modal_fuss {
  display: flex;
  justify-content: flex-end;
  padding: .7rem 1.1rem;
  border-top: 1px solid #d9c8a2;
  background: #f3e8cf;
}

/* ---------- Fusszeile: alter Bogen Papier, ganz unten ---------- */
body.jupi.mm_body .jupi_footer {
  margin-top: auto;
  background: #f3e8d2;
  border-top: 3px solid #b78d3f;
  box-shadow: 0 -4px 14px rgba(28, 16, 6, .25);
  border-radius: 0;
}
body.jupi.mm_body .jupi_footer_text { color: #5c452a; }
body.jupi.mm_body .jupi_footer_text a { color: #7d4a13; }
body.jupi.mm_body .jupi_footer_text a:hover { color: #a8641a; }

/* ==========================================================================
   DARK MODE - dieselbe Welt bei Nacht: die Sammlung ist abgedunkelt, das
   Kontrolllaempchen leuchtet, Papiere (Bogen, Protokoll, Karten) bleiben hell.
   ========================================================================== */
html[data-theme="dark"] body.jupi.mm_body {
  background-color: #14100b;
  background-image:
    radial-gradient(820px 460px at 78% 62%, rgba(255, 186, 92, .26), transparent 62%),
    radial-gradient(1000px 560px at 50% 2%, rgba(255, 214, 150, .14), transparent 66%),
    linear-gradient(rgba(12, 8, 4, .74), rgba(10, 7, 3, .82)),
    url("kulisse.svg");
  background-size: cover, cover, cover, cover;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-position: center top, center top, center top, center top;
  background-attachment: fixed, fixed, fixed, fixed;
  color: #e8ddc9;
}
html[data-theme="dark"] body.jupi.mm_body .mm_header {
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 1px, rgba(255,255,255,.03) 1px 3px),
    linear-gradient(180deg, #45301c 0%, #33220f 52%, #241708 100%);
  border-bottom-color: #a8823a;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 226, 170, .18);
  color: #f6e9d2;
}
html[data-theme="dark"] body.jupi.mm_body .mm_header .jupi_nav_back {
  color: #f7dca6;
  background: #241a0d;
  border-color: #b78d3f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
html[data-theme="dark"] body.jupi.mm_body .mm_header .jupi_nav_back:hover {
  background: #322412;
  transform: translateY(-1px);
}
html[data-theme="dark"] body.jupi.mm_body .mm_brand h1 {
  color: #fdf1d8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
}
html[data-theme="dark"] body.jupi.mm_body .mm_header .jupi_sprachen_select {
  color: #f6e9d2;
  background: rgba(255, 236, 200, .12);
  border-color: rgba(255, 226, 168, .45);
}

/* HUD-Protokoll: Papiere bleiben hell (Muster Fake-News/Phishing) */
html[data-theme="dark"] body.jupi.mm_body .mm_panel {
  background-color: #efe4c9;
  border-color: #9c8a63;
  border-top-color: #a8823a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .45);
  color: #3b2a15;
}
html[data-theme="dark"] body.jupi.mm_body .mm_stat span { color: #2b3945; }
html[data-theme="dark"] body.jupi.mm_body .mm_stat label { color: #7a6540; }
html[data-theme="dark"] body.jupi.mm_body .mm_controls label { color: #52401f; }
html[data-theme="dark"] body.jupi.mm_body .mm_controls select,
html[data-theme="dark"] body.jupi.mm_body .jupi_select {
  background: #fffaee;
  color: #33251a;
  border-color: #a3906a;
}
html[data-theme="dark"] body.jupi.mm_body .jupi_btn {
  color: #2a1b06;
  background: linear-gradient(180deg, #e8cd94 0%, #c9a458 55%, #b1893c 100%);
  border-color: #7d5f24;
}
html[data-theme="dark"] body.jupi.mm_body .jupi_btn:hover {
  background: linear-gradient(180deg, #f4dfae 0%, #d6b269 55%, #bd9648 100%);
}
html[data-theme="dark"] body.jupi.mm_body .jupi_btn_alt {
  color: #e7eef3;
  background: linear-gradient(180deg, #4a5860 0%, #37434a 55%, #2b353b 100%);
  border-color: #6c7b85;
  box-shadow: 0 2px 0 rgba(255, 255, 255, .12) inset, 0 3px 8px rgba(0, 0, 0, .45);
}
html[data-theme="dark"] body.jupi.mm_body .jupi_btn_alt:hover {
  background: linear-gradient(180deg, #586770 0%, #43505a 55%, #343f47 100%);
}
/* Der Versuchsbogen bleibt ein helles Blatt - nur etwas gedaempft. */
html[data-theme="dark"] body.jupi.mm_body .mm_stage {
  background-color: #f2e9d4;
  border-color: #b6a684;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .5);
  color: #2f2417;
}
html[data-theme="dark"] body.jupi.mm_body .mm_aufgabe { color: #2f2417; }
html[data-theme="dark"] body.jupi.mm_body .mm_aufgabe b { color: #7d2f18; }
html[data-theme="dark"] body.jupi.mm_body .mm_task_label {
  background: #eadcbc;
  border-color: #b9a67e;
  color: #4a3a1d;
}
html[data-theme="dark"] body.jupi.mm_body .mm_karte {
  background: #fffdf4;
  color: #3a2a14;
  border-color: #c0ac80;
}
html[data-theme="dark"] body.jupi.mm_body .mm_ant {
  background: #fffdf5;
  color: #2b2118;
  border-color: #c0ac80;
}
html[data-theme="dark"] body.jupi.mm_body .mm_ant.mm_ok {
  background: #e6f0df;
  border-color: #5b8f4a;
  color: #1d4a20;
}
html[data-theme="dark"] body.jupi.mm_body .mm_ant.mm_err {
  background: #f8e4df;
  border-color: #b5544a;
  color: #7d211a;
}
/* Der Bogen bleibt hell - die Notiz also dunkel auf hell. */
html[data-theme="dark"] body.jupi.mm_body .mm_msg { color: #3a2c1b; border-left-color: #b6a684; }
html[data-theme="dark"] body.jupi.mm_body .mm_msg_ok { color: #23571f; border-left-color: #4f8a3f; }
html[data-theme="dark"] body.jupi.mm_body .mm_msg_err { color: #8d241c; border-left-color: #b5544a; }
html[data-theme="dark"] body.jupi.mm_body .jupi_startoverlay {
  background:
    repeating-linear-gradient(0deg, rgba(116, 146, 172, .18) 0 1px, transparent 1px 24px),
    linear-gradient(160deg, #f7efdb 0%, #efe3c8 60%, #e6d7b6 100%);
  border-color: #b6a684;
  box-shadow: inset 0 0 0 6px #f2e8d2, inset 0 0 0 7px #bda886;
  color: #2f2417;
}
html[data-theme="dark"] body.jupi.mm_body .jupi_startoverlay h3 { color: #6d4a18; }
html[data-theme="dark"] body.jupi.mm_body .jupi_startoverlay p { color: #4a3a22; }
html[data-theme="dark"] body.jupi.mm_body .mm_done {
  background:
    repeating-linear-gradient(0deg, rgba(116, 146, 172, .12) 0 1px, transparent 1px 26px),
    #f4ead4;
  border-color: #b6a684;
  color: #33251a;
}
html[data-theme="dark"] body.jupi.mm_body .mm_done h3 { color: #6d4a18; }
html[data-theme="dark"] body.jupi.mm_body .mm_done p { color: #3f2f1c; }
html[data-theme="dark"] body.jupi.mm_body .mm_modal_inhalt {
  background: #f4ead4;
  border-color: #b6a684;
  color: #33251a;
}
html[data-theme="dark"] body.jupi.mm_body .mm_modal_kopf {
  background: #eaddc0;
  border-bottom-color: #c7b591;
}
html[data-theme="dark"] body.jupi.mm_body .mm_modal_kopf h3 { color: #6d4a18; }
html[data-theme="dark"] body.jupi.mm_body .mm_modal_body { color: #3a2c1b; }
html[data-theme="dark"] body.jupi.mm_body .mm_modal_body h4 { color: #6d4a18; }
html[data-theme="dark"] body.jupi.mm_body .mm_modal_fuss {
  background: #eaddc0;
  border-top-color: #c7b591;
}
html[data-theme="dark"] body.jupi.mm_body .mm_lernziel {
  background: #ece0c2;
  border-left-color: #a8823a;
  color: #3a2c1b;
}
html[data-theme="dark"] body.jupi.mm_body .mm_modal_x { color: #4a3a22; }
html[data-theme="dark"] body.jupi.mm_body .mm_modal_x:hover { background: rgba(120, 90, 40, .16); }
html[data-theme="dark"] body.jupi.mm_body .jupi_footer {
  background: #22180d;
  border-top-color: #a8823a;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, .6);
}
html[data-theme="dark"] body.jupi.mm_body .jupi_footer_text { color: #d9c9a8; }
html[data-theme="dark"] body.jupi.mm_body .jupi_footer_text a { color: #f0c274; }

/* ---------- Responsiv ---------- */
@media (max-width: 600px) {
  body.jupi.mm_body .mm_panel { padding: .7rem .7rem .7rem 1.9rem; }
  body.jupi.mm_body .mm_controls { margin-left: 0; }
  body.jupi.mm_body .mm_aufgabe { font-size: 1rem; }
  body.jupi.mm_body .mm_stage { padding: 1rem .85rem 1.1rem; }
  body.jupi.mm_body .mm_antworten { grid-template-columns: 1fr; }
  body.jupi.mm_body .mm_stat { min-width: 3.2rem; }
  body.jupi.mm_body .mm_stat span { font-size: 1.1rem; }
  body.jupi.mm_body .mm_done::after { width: 48px; height: 48px; font-size: 1.5rem; }
}

/* ---------- Pol-Duell-Aufloesung: Magnete ruecken zusammen/weichen ---------- */
.mm_l_zus { transform: translateX(20px); animation: mm_l_zus_a .45s ease-out; }
.mm_r_zus { transform: translateX(-20px); animation: mm_r_zus_a .45s ease-out; }
.mm_l_weg { transform: translateX(-16px); animation: mm_l_weg_a .45s ease-out; }
.mm_r_weg { transform: translateX(16px); animation: mm_r_weg_a .45s ease-out; }
@keyframes mm_l_zus_a { from { transform: translateX(-16px); } to { transform: translateX(20px); } }
@keyframes mm_r_zus_a { from { transform: translateX(16px); } to { transform: translateX(-20px); } }
@keyframes mm_l_weg_a { from { transform: translateX(20px); } to { transform: translateX(-16px); } }
@keyframes mm_r_weg_a { from { transform: translateX(-20px); } to { transform: translateX(16px); } }
@media (prefers-reduced-motion: reduce) {
  .mm_l_zus, .mm_r_zus, .mm_l_weg, .mm_r_weg { animation: none; }
  body.jupi.mm_body .mm_ant { transition: none; }
}
