:root{
  --bg:#f7f6fc;--card:#fff;--ink:#24233a;--muted:#77768a;--line:#e7e4f0;
  --purple:#6757e8;--soft:#f0edff;--green:#176a43;--red:#a4373c;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--ink);
  font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif}
button,select,textarea{font:inherit}
button{cursor:pointer}
.app{width:min(820px,100%);margin:auto;padding:14px 14px 125px}
.top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}
.brand{display:flex;align-items:center;gap:9px;font-size:20px}
.star{width:44px;height:44px;display:grid;place-items:center;border-radius:14px;background:#fff3bf}
.top-actions{display:flex;gap:8px}
select,.square{border:1px solid var(--line);background:#fff;border-radius:13px;padding:9px 11px;color:var(--ink)}
.square{width:44px}
.subjects{display:flex;gap:8px;overflow:auto;padding:2px 0 12px;scrollbar-width:none}
.subjects::-webkit-scrollbar{display:none}
.subject{flex:0 0 auto;border:1px solid var(--line);background:#fff;padding:9px 13px;border-radius:999px;font-weight:700}
.subject.active{background:var(--soft);border-color:#d5cdfb;color:var(--purple)}
.api{width:max-content;max-width:100%;margin:0 0 12px auto;border:1px solid var(--line);background:#fff;
  padding:7px 11px;border-radius:999px;font-size:12px;font-weight:800}
.api.ok{color:var(--green);background:#effaf4;border-color:#bfe6cf}
.api.error{color:var(--red);background:#fff1f1;border-color:#efc4c5}
.api.checking{color:var(--muted)}
.hero{display:grid;grid-template-columns:66px minmax(0,1fr) auto;gap:14px;align-items:start;
  padding:20px;border-radius:24px;background:linear-gradient(135deg,#f0edff,#fff);
  border:1px solid #dfd8ff;box-shadow:0 12px 32px rgba(40,35,90,.07)}
.avatar{width:62px;height:62px;border-radius:19px;background:#fff;display:grid;place-items:center;font-size:36px}
.eyebrow{font-size:12px;font-weight:900;letter-spacing:.08em;color:var(--purple)}
h1{font-size:28px;line-height:1.07;margin:4px 0 6px}
.hero p{margin:0;color:var(--muted);line-height:1.35}
.conversation{border:1px solid #d9d3fb;background:#fff;color:var(--purple);border-radius:13px;padding:9px 12px;font-weight:800}
.conversation.on{background:#fff0f0;color:#bd3439;border-color:#efc7c8}
.visual{margin-top:15px;background:#fff;border:1px solid var(--line);border-radius:24px;padding:18px;
  box-shadow:0 12px 32px rgba(40,35,90,.07)}
.hidden{display:none!important}
.visual-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:13px}
.visual-title{font-size:20px;font-weight:900}
.quality{font-size:12px;font-weight:800;color:var(--muted);background:#f4f2f8;padding:6px 9px;border-radius:999px}
.image-wrap{border-radius:18px;overflow:hidden;background:#f7f6fb;display:grid;place-items:center;min-height:250px}
.image-wrap img{display:block;width:100%;height:auto}
.loading{min-height:300px;display:grid;place-items:center;text-align:center;padding:25px;color:var(--muted)}
.spinner{width:44px;height:44px;border:5px solid #e2def8;border-top-color:var(--purple);border-radius:50%;
  animation:spin .85s linear infinite;margin:0 auto 14px}
@keyframes spin{to{transform:rotate(360deg)}}
.chat{display:flex;flex-direction:column;gap:11px;margin-top:15px}
.msg{display:flex}.msg.user{justify-content:flex-end}
.bubble{max-width:88%;padding:13px 15px;border-radius:18px;line-height:1.5;white-space:pre-wrap}
.assistant .bubble{background:#fff;border:1px solid var(--line);border-bottom-left-radius:5px}
.user .bubble{background:var(--purple);color:#fff;border-bottom-right-radius:5px}
.actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:13px}
.actions button{border:1px solid var(--line);background:#fff;border-radius:12px;padding:9px 11px}
.status{text-align:center;min-height:20px;margin:12px 0;color:var(--muted);font-size:13px}
.composer{position:fixed;z-index:20;left:50%;transform:translateX(-50%);bottom:max(10px,env(safe-area-inset-bottom));
  width:min(792px,calc(100% - 22px));display:grid;grid-template-columns:72px 1fr 54px;gap:8px;align-items:end;
  padding:9px;background:rgba(255,255,255,.97);backdrop-filter:blur(14px);border:1px solid var(--line);
  border-radius:22px;box-shadow:0 16px 38px rgba(30,25,80,.16)}
.mic{height:54px;border:0;background:var(--purple);color:#fff;border-radius:15px;display:flex;flex-direction:column;
  align-items:center;justify-content:center;font-size:20px}
.mic span{font-size:10px;font-weight:800;margin-top:2px}
.mic.listening{background:#dc4449;animation:pulse 1s infinite}
@keyframes pulse{50%{transform:scale(.96)}}
textarea{width:100%;min-height:50px;max-height:120px;resize:none;border:0;outline:0;background:transparent;padding:14px 7px;color:var(--ink)}
.send{width:54px;height:54px;border:0;border-radius:15px;background:#24233a;color:#fff;font-size:26px}
button:disabled{opacity:.45;cursor:not-allowed}
.free-board{display:grid;gap:10px}
.step{padding:11px 13px;border:1px solid var(--line);background:#faf9fd;border-radius:13px}
.groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:9px}
.group{padding:12px;background:#f8f6ff;border:1px solid #ddd7ff;border-radius:14px;min-height:90px}
.items{font-size:24px;display:flex;flex-wrap:wrap;gap:5px}
.equation{text-align:center;font-size:22px;font-weight:900;padding:12px;background:#eff9f3;color:#17633d;border-radius:13px}
@media(max-width:600px){
  .app{padding:11px 10px 120px}
  .hero{grid-template-columns:58px minmax(0,1fr);padding:17px}
  .avatar{width:56px;height:56px}
  .conversation{grid-column:2;justify-self:start;margin-top:5px}
  h1{font-size:25px}
  .composer{grid-template-columns:58px 1fr 52px}
  .mic{width:58px}.mic span{display:none}
}

.mic.listening{
  background:#dc4449;
  box-shadow:0 0 0 5px rgba(220,68,73,.12);
}


/* ---------- Fotos ---------- */
.photo-tray{
  margin-top:12px;
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding:10px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:17px;
}
.photo-card{
  position:relative;
  flex:0 0 105px;
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  background:#faf9fd;
}
.photo-card img{
  display:block;
  width:105px;
  height:105px;
  object-fit:cover;
}
.photo-card .photo-state{
  padding:5px 7px;
  font-size:10px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.photo-remove{
  position:absolute;
  top:5px;
  right:5px;
  width:27px;
  height:27px;
  padding:0;
  border:0;
  border-radius:50%;
  background:rgba(25,25,35,.82);
  color:#fff;
  font-weight:900;
}
.photo-note{
  flex:0 0 190px;
  align-self:center;
  padding:8px;
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}

/* ---------- Druckmaterial ---------- */
.material-modal{
  position:fixed;
  inset:0;
  z-index:100;
  overflow:auto;
  background:#ecebf1;
  padding:14px;
}
.material-shell{
  width:min(900px,100%);
  margin:0 auto;
}
.material-toolbar{
  position:sticky;
  top:0;
  z-index:3;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  padding:10px;
  margin-bottom:12px;
  background:rgba(255,255,255,.96);
  border:1px solid var(--line);
  border-radius:16px;
  backdrop-filter:blur(12px);
}
.material-toolbar button{
  border:1px solid var(--line);
  background:#fff;
  border-radius:11px;
  padding:9px 11px;
}
.material-toolbar-title{font-weight:900}
.material-print-buttons{display:flex;gap:7px;flex-wrap:wrap}

.material-paper{
  width:min(210mm,100%);
  min-height:297mm;
  margin:0 auto 35px;
  background:#fff;
  padding:16mm 15mm;
  color:#17171f;
  box-shadow:0 12px 34px rgba(0,0,0,.12);
  font-family:Arial,Helvetica,sans-serif;
}
.sheet-title{
  margin:0 0 5px;
  font-size:25px;
  line-height:1.15;
}
.sheet-subtitle{
  margin:0 0 18px;
  color:#555;
  font-size:13px;
}
.student-fields{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  margin:14px 0 20px;
}
.student-line{
  border-bottom:1px solid #333;
  height:25px;
  font-size:12px;
}
.sheet-meta{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  font-size:12px;
  margin:9px 0 16px;
}
.sheet-instructions{
  padding:10px 12px;
  background:#f5f5f7;
  border-radius:8px;
  margin:12px 0 18px;
  font-size:13px;
}
.sheet-section{
  margin:18px 0;
  break-inside:avoid;
}
.sheet-section h2{
  font-size:18px;
  margin:0 0 8px;
}
.sheet-explanation{
  white-space:pre-wrap;
  line-height:1.5;
  margin:0 0 12px;
  font-size:14px;
}
.sheet-question{
  margin:13px 0 18px;
  break-inside:avoid;
}
.question-line{
  display:flex;
  gap:8px;
  align-items:flex-start;
  font-size:14px;
  line-height:1.45;
}
.question-num{font-weight:800;min-width:25px}
.question-points{margin-left:auto;white-space:nowrap;font-size:12px;color:#555}
.answer-lines{
  margin:7px 0 0 32px;
}
.answer-lines span{
  display:block;
  height:22px;
  border-bottom:1px solid #bbb;
}
.answer-key{
  margin-top:28px;
  padding-top:18px;
  border-top:2px solid #222;
}
.answer-key h2{margin:0 0 12px}
.answer-item{
  margin:8px 0;
  font-size:13px;
  line-height:1.45;
}
.material-loading{
  min-height:240px;
  display:grid;
  place-items:center;
  text-align:center;
  color:var(--muted);
}
body.hide-answer-key .answer-key{display:none}

/* Print exactly the generated A4 material. */
@media print{
  @page{size:A4;margin:11mm}
  body{background:#fff!important}
  .app{display:none!important}
  .material-modal{
    display:block!important;
    position:static!important;
    inset:auto!important;
    padding:0!important;
    overflow:visible!important;
    background:#fff!important;
  }
  .material-shell{width:auto!important;margin:0!important}
  .material-toolbar{display:none!important}
  .material-paper{
    width:auto!important;
    min-height:auto!important;
    margin:0!important;
    padding:0!important;
    box-shadow:none!important;
  }
  body.print-no-answers .answer-key{display:none!important}
  body.print-with-answers .answer-key{display:block!important}
}


/* ---------- Fachbereiche V5.4 ---------- */
.subject-panel{
  margin-top:14px;
  padding:16px;
  border:1px solid var(--line);
  border-radius:20px;
  background:#fff;
  box-shadow:0 10px 28px rgba(40,35,90,.05);
}
.subject-panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.subject-panel-title{
  font-size:18px;
  font-weight:900;
  margin:0 0 3px;
}
.subject-panel-description{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
}
.subject-class-badge{
  flex:0 0 auto;
  padding:6px 9px;
  border-radius:999px;
  background:#f4f2fb;
  color:#5e5b70;
  font-size:11px;
  font-weight:800;
}
.subject-starters{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.subject-starter{
  min-height:58px;
  padding:10px 11px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#faf9fe;
  color:var(--ink);
  text-align:left;
  line-height:1.25;
  font-weight:750;
}
.subject-starter:hover,
.subject-starter:focus{
  border-color:#cbc3ff;
  background:#f3f0ff;
}
.subject-starter .starter-icon{
  display:block;
  font-size:19px;
  margin-bottom:4px;
}
.subject-starter .starter-label{
  display:block;
  font-size:13px;
}
.subject-starter .starter-small{
  display:block;
  margin-top:2px;
  color:var(--muted);
  font-size:10px;
  font-weight:600;
}
.subject-selection-note{
  margin-top:10px;
  font-size:11px;
  color:var(--muted);
  text-align:center;
}
@media(max-width:650px){
  .subject-starters{grid-template-columns:repeat(2,minmax(0,1fr))}
  .subject-panel{padding:13px}
}


/* ---------- V5.6: anklickbare Multiple-Choice-Antworten ---------- */
.msg.assistant{
  flex-direction:column;
  align-items:flex-start;
}
.answer-options{
  width:min(88%,560px);
  display:grid;
  gap:8px;
  margin:8px 0 0 0;
}
.answer-option{
  width:100%;
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid #dcd8ef;
  border-radius:14px;
  background:#fff;
  color:var(--ink);
  text-align:left;
  box-shadow:0 3px 10px rgba(35,30,80,.04);
}
.answer-option:active{
  transform:scale(.99);
}
.answer-option.selected{
  border-color:var(--purple);
  background:#f0edff;
}
.answer-option:disabled:not(.selected){
  opacity:.52;
}
.answer-letter{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:11px;
  background:#eeeafd;
  color:var(--purple);
  font-weight:900;
  font-size:17px;
}
.answer-option.selected .answer-letter{
  background:var(--purple);
  color:#fff;
}
.answer-label{
  font-size:16px;
  line-height:1.3;
  font-weight:650;
}
@media(max-width:600px){
  .answer-options{width:92%}
  .answer-option{min-height:58px}
}


/* ---------- V5.7: saubere Mathematikdarstellung ---------- */
.math-frac{
  display:inline-grid;
  grid-template-rows:auto auto;
  vertical-align:middle;
  text-align:center;
  line-height:1.05;
  min-width:1.35em;
  margin:0 .12em;
  font-size:.96em;
}
.math-num{
  display:block;
  padding:0 .16em .08em;
  border-bottom:1.6px solid currentColor;
}
.math-den{
  display:block;
  padding:.08em .16em 0;
}
.sqrt-content{
  text-decoration:overline;
  text-decoration-thickness:1px;
}


/* ---------- V5.11: klarere Druckaufgaben ---------- */
.question-text{
  flex:1 1 auto;
  min-width:0;
}

.sheet-question-choice .question-text,
.sheet-question-matching .question-text{
  line-height:1.55;
}

.sheet-question-choice .question-text br,
.sheet-question-matching .question-text br{
  display:block;
  content:"";
  margin-top:5px;
}

.sheet-question-choice,
.sheet-question-matching{
  margin-bottom:20px;
}

@media print{
  .sheet-question-choice,
  .sheet-question-matching{
    break-inside:avoid;
    page-break-inside:avoid;
  }

  .sheet-question-choice .question-text,
  .sheet-question-matching .question-text{
    line-height:1.55;
  }
}


/* ---------- V5.12: Vorlesesteuerung + mitlaufende Markierung ---------- */
.speech-segment{
  border-radius:4px;
  transition:background .15s ease, box-shadow .15s ease;
}
.speech-segment.speech-highlight{
  background:#dbeafe;
  box-shadow:0 0 0 2px #dbeafe;
}
.speech-controls{
  position:fixed;
  left:50%;
  bottom:92px;
  transform:translateX(-50%);
  z-index:60;
  display:flex;
  gap:8px;
  padding:8px;
  border:1px solid #ddd8ef;
  border-radius:18px;
  background:rgba(255,255,255,.97);
  box-shadow:0 10px 30px rgba(35,30,80,.18);
  backdrop-filter:blur(10px);
}
.speech-controls[hidden]{display:none!important}
.speech-controls button{
  min-height:42px;
  padding:8px 13px;
  border:1px solid #ddd8ef;
  border-radius:12px;
  background:#fff;
  color:var(--ink);
  font-weight:750;
}
.image-print-actions{
  display:flex;
  justify-content:center;
  margin-top:12px;
}
.image-print-actions button{
  min-height:44px;
  padding:10px 16px;
  border:1px solid #d8d3ee;
  border-radius:14px;
  background:#fff;
  color:var(--ink);
  font-weight:800;
}


/* ---------- V5.15: Lernmaterial direkt in der App lösen ---------- */
.material-mode-buttons{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
}
.material-mode-buttons button.active{
  background:#eeeafd;
  border-color:#bdb4f3;
  color:#5145d6;
  font-weight:800;
}
.material-print-buttons.muted{
  opacity:.6;
}

.interactive-material{
  max-width:760px;
  margin:0 auto 35px;
  background:#fff;
  padding:22px;
  color:#17171f;
  border-radius:18px;
  box-shadow:0 12px 34px rgba(0,0,0,.10);
}
.interactive-title{
  margin:0 0 6px;
  font-size:25px;
}
.interactive-subtitle{
  color:#666;
  margin-bottom:8px;
}
.interactive-total{
  font-weight:800;
  margin-bottom:20px;
}
.interactive-section{
  margin:22px 0;
}
.interactive-section h2{
  margin:0 0 10px;
  font-size:19px;
}
.interactive-explanation{
  line-height:1.5;
  margin-bottom:12px;
  white-space:pre-wrap;
}
.interactive-question{
  border:1px solid #e2def0;
  border-radius:16px;
  padding:14px;
  margin:12px 0;
}
.interactive-question-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:9px;
}
.interactive-prompt{
  line-height:1.5;
  margin-bottom:12px;
}
.interactive-answer{
  width:100%;
  box-sizing:border-box;
  resize:vertical;
  min-height:70px;
  padding:11px 12px;
  border:1px solid #d7d2e8;
  border-radius:12px;
  background:#fff;
  color:#17171f;
  font:inherit;
}
.interactive-choice-list,
.interactive-check-list{
  display:grid;
  gap:8px;
}
.interactive-choice{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:10px 11px;
  border:1px solid #ded9ed;
  border-radius:12px;
}
.interactive-choice input{
  margin-top:5px;
}
.interactive-letter{
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  flex:0 0 auto;
  border-radius:8px;
  background:#eeeafd;
  color:#5549d8;
  font-weight:900;
}
.interactive-feedback{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  line-height:1.4;
}
.interactive-feedback.correct{
  background:#edf8ef;
  border:1px solid #bfe0c4;
}
.interactive-feedback.partial{
  background:#fff8e4;
  border:1px solid #ead89c;
}
.interactive-feedback.wrong{
  background:#fff0f0;
  border:1px solid #efc5c5;
}
.interactive-feedback.solution{
  background:#f1efff;
  border:1px solid #d3ccf7;
}
.interactive-feedback small{
  display:block;
  margin-top:6px;
}
.interactive-actions{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
  margin-top:20px;
}
.interactive-actions button{
  min-height:44px;
  padding:10px 14px;
  border:1px solid #d9d4e9;
  border-radius:12px;
  background:#fff;
  color:#17171f;
  font-weight:800;
}
.interactive-actions .interactive-primary{
  background:#6254e8;
  border-color:#6254e8;
  color:#fff;
}
.interactive-result{
  margin-top:14px;
}
.interactive-score{
  display:flex;
  flex-direction:column;
  gap:5px;
  padding:14px;
  border:1px solid #d4cdf8;
  border-radius:14px;
  background:#f1efff;
}
.interactive-score strong{
  font-size:1.18em;
}

@media(max-width:600px){
  .interactive-material{
    padding:14px;
    border-radius:14px;
  }
  .material-mode-buttons,
  .material-print-buttons{
    width:100%;
  }
  .material-mode-buttons button,
  .material-print-buttons button{
    flex:1 1 auto;
  }
}


/* V5.16 – Inline-Eingaben auf Linien + Mehrfachauswahl */
.interactive-inline-answers{
  display:grid;
  gap:10px;
}
.interactive-line-text{
  line-height:1.5;
}
.interactive-inline-line{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  line-height:1.8;
}
.interactive-inline-input{
  min-width:52px;
  max-width:110px;
  padding:6px 8px;
  border:0;
  border-bottom:2px solid #8e87c7;
  border-radius:0;
  background:#faf9ff;
  color:#17171f;
  font:inherit;
  text-align:center;
}
.interactive-inline-input:focus{
  outline:none;
  border-bottom-color:#5b4ddd;
  background:#f2efff;
}


/* V5.17 – Rechenfelder untereinander und kinderfreundlicher */
.interactive-inline-line-stack{
  display:grid;
  gap:8px;
  margin:8px 0 12px;
}
.interactive-inline-math-label{
  font-size:1.06rem;
  font-weight:600;
  line-height:1.45;
}
.interactive-inline-workbox{
  width:100%;
  min-height:84px;
  padding:10px 12px;
  border:2px solid #c9c2f3;
  border-radius:14px;
  background:#f7f5ff;
  color:#17171f;
  font:inherit;
  line-height:1.5;
  text-align:left;
  resize:vertical;
}
.interactive-inline-workbox:focus{
  outline:none;
  border-color:#5b4ddd;
  background:#f2efff;
}


/* V5.19 – Wieder vorlesen + Stimmenwahl */
.bubble-tools{
  display:flex;
  justify-content:flex-start;
  margin-top:12px;
  padding-top:9px;
  border-top:1px solid rgba(110,103,150,.13);
}
.replay-speech-btn{
  border:0;
  background:#f3f0ff;
  color:#5547d8;
  border-radius:999px;
  padding:7px 11px;
  font:inherit;
  font-size:.82em;
  font-weight:750;
  cursor:pointer;
}
.replay-speech-btn:active{transform:scale(.98)}
.speech-controls{flex-wrap:wrap;justify-content:center;max-width:calc(100vw - 24px)}


/* V5.20 – echte Stimmenauswahl */
.voice-picker{
  position:fixed;
  inset:0;
  z-index:100;
  display:flex;
  align-items:flex-end;
  justify-content:center;
}
.voice-picker.hidden{display:none!important}
.voice-picker-backdrop{
  position:absolute;
  inset:0;
  background:rgba(20,18,35,.36);
}
.voice-picker-sheet{
  position:relative;
  width:min(620px,100%);
  max-height:min(78vh,720px);
  overflow:auto;
  padding:18px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius:24px 24px 0 0;
  background:#fff;
  box-shadow:0 -14px 40px rgba(24,20,55,.2);
}
.voice-picker-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:10px;
}
.voice-picker-head h2{margin:2px 0 0;font-size:1.35rem}
.voice-picker-kicker{font-size:.72rem;font-weight:900;letter-spacing:.08em;color:#6557df}
#closeVoicePickerBtn{
  width:42px;height:42px;border-radius:12px;border:1px solid #dfdaed;background:#fff;font-size:1.1rem;
}
.voice-picker-info{
  padding:11px 12px;
  margin-bottom:12px;
  border-radius:13px;
  background:#f7f5ff;
  line-height:1.45;
  color:#555064;
}
.voice-list{display:grid;gap:8px}
.voice-option{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  text-align:left;
  padding:11px 12px;
  border:1px solid #ddd8ed;
  border-radius:14px;
  background:#fff;
  color:#24212e;
}
.voice-option.selected{
  border-color:#8175ec;
  background:#f1efff;
}
.voice-radio{font-size:1.15rem;color:#5d50df}
.voice-option-copy{display:flex;flex-direction:column;min-width:0}
.voice-option-copy strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.voice-option-copy small{margin-top:2px;color:#777180}
.voice-style-block{
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid #ece8f2;
}
.voice-style-buttons{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-top:9px;
}
.voice-style-buttons button,
.voice-preview-btn{
  min-height:44px;
  border:1px solid #ddd8ed;
  border-radius:13px;
  background:#fff;
  color:#292632;
  font-weight:750;
}
.voice-style-buttons button.selected{
  background:#eeeafd;
  border-color:#9d93ef;
  color:#5547d8;
}
.voice-preview-btn{
  width:100%;
  margin-top:13px;
  background:#6254e8;
  color:#fff;
  border-color:#6254e8;
}


/* V5.21 – zuverlässige Stimmenauswahl */
.voice-style-title{display:flex;justify-content:space-between;gap:10px;align-items:center}
#activeVoiceStyle{font-size:.8rem;color:#675bd8;font-weight:800}
.voice-done-btn{width:100%;min-height:44px;margin-top:9px;border:1px solid #ddd8ed;border-radius:13px;background:#fff;color:#292632;font-weight:800}
.voice-style-buttons button.selected{box-shadow:0 0 0 2px rgba(98,84,232,.15)}


/* ---------- V5.22: Lernfortschritt ---------- */
.progress-modal{
  position:fixed;
  inset:0;
  z-index:95;
  display:grid;
  align-items:end;
}
.progress-modal.hidden{display:none!important}
.progress-backdrop{
  position:absolute;
  inset:0;
  background:rgba(22,20,38,.46);
}
.progress-sheet{
  position:relative;
  z-index:1;
  width:min(720px,100%);
  max-height:88vh;
  overflow:auto;
  margin:0 auto;
  padding:22px;
  border-radius:28px 28px 0 0;
  background:#fff;
  box-shadow:0 -18px 45px rgba(23,20,55,.18);
}
.progress-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.progress-kicker{
  font-size:.78rem;
  font-weight:900;
  letter-spacing:.08em;
  color:#6658de;
}
.progress-head h2{margin:4px 0 14px;font-size:1.65rem}
.progress-head button{
  width:48px;height:48px;border-radius:15px;border:1px solid #ddd8ea;background:#fff;font-size:1.35rem;
}
.progress-note,
.usage-hint{
  padding:12px 14px;
  border-radius:14px;
  background:#f5f2ff;
  color:#5f5a70;
  line-height:1.45;
}
.progress-cards{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin:14px 0 22px;
}
.progress-card{
  padding:14px;
  border:1px solid #e1dcef;
  border-radius:16px;
  background:#fff;
}
.progress-card span,.progress-card small{display:block;color:#746f80}
.progress-card strong{display:block;font-size:1.55rem;margin:4px 0}
.progress-section-title{margin:20px 0 10px;font-size:1.05rem}
.progress-list{display:grid;gap:8px}
.progress-row{
  display:flex;justify-content:space-between;gap:12px;align-items:center;
  padding:12px;border:1px solid #e4dfef;border-radius:14px;
}
.progress-row strong,.progress-row span{display:block}
.progress-row span{margin-top:3px;color:#777184;font-size:.86rem}
.progress-row b{font-size:1.05rem;color:#5549d8}
.progress-empty{padding:14px;border:1px dashed #d8d2e8;border-radius:14px;color:#777184}
.usage-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:8px;
  margin-bottom:10px;
}
.usage-grid div{
  text-align:center;padding:10px 6px;border:1px solid #e4dfef;border-radius:14px;background:#fff;
}
.usage-grid b{display:block;font-size:1.25rem}
.usage-grid span{display:block;font-size:.75rem;color:#777184;margin-top:3px}
.progress-footer{display:flex;gap:10px;margin-top:18px;position:sticky;bottom:0;background:#fff;padding-top:12px}
.progress-footer button{
  min-height:46px;padding:10px 14px;border-radius:13px;border:1px solid #ddd8ea;background:#fff;font-weight:800;
}
.progress-footer .progress-done{margin-left:auto;background:#6254e8;border-color:#6254e8;color:#fff}
body.modal-open{overflow:hidden}

@media(max-width:560px){
  .progress-sheet{padding:18px 16px 20px}
  .usage-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}


/* ---------- V5.25: echte grafische Arbeitsblätter ---------- */
.material-photo-tools{display:flex;gap:6px;align-items:center;flex-wrap:wrap;padding:4px 0}
.material-photo-tools span{font-size:12px;font-weight:800;color:var(--muted)}
.material-photo-tools button.active{background:#eeeafd;border-color:#b8aff3;color:#5145d6;font-weight:800}
.worksheet-graphic{margin:12px 0 10px 32px;padding:10px;border:1px solid #dedbe8;border-radius:12px;background:#fcfcfe;break-inside:avoid}
.worksheet-svg{display:block;width:min(100%,620px);height:auto;margin:0 auto}
.worksheet-graphic-caption{margin-top:7px;text-align:center;font-size:12px;color:#666}
.graphic-options{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:12px}
.graphic-option{display:flex;align-items:center;gap:7px;min-width:94px;padding:8px 10px;border:1px solid #d8d4e4;border-radius:12px;background:#fff}
.graphic-option input{width:20px;height:20px}
.graphic-option svg{width:56px;height:56px}
.graphic-option-letter{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:#eeeafd;color:#5549d8;font-weight:900}
.graphic-grid-interactive{display:grid;grid-template-columns:repeat(var(--graphic-cols),minmax(24px,44px));gap:2px;justify-content:center;overflow:auto;padding:4px}
.graphic-cell{width:44px;height:44px;padding:0;border:1px solid #d4d0df;background:#fff;border-radius:5px;display:grid;place-items:center}
.graphic-cell svg{width:42px;height:42px}
.graphic-cell.editable{border:2px dashed #8f84e8;background:#f8f6ff;cursor:pointer}
.graphic-cell.editable:active{transform:scale(.96)}
.graphic-help{text-align:center;font-size:12px;color:#67627a;margin-top:8px}
.interactive-material .worksheet-graphic{margin-left:0}
@media(max-width:600px){
  .worksheet-graphic{margin-left:0;padding:8px}
  .graphic-grid-interactive{grid-template-columns:repeat(var(--graphic-cols),minmax(22px,38px))}
  .graphic-cell{width:38px;height:38px}.graphic-cell svg{width:36px;height:36px}
}
@media print{
  .worksheet-graphic{background:#fff!important;box-shadow:none!important;margin-top:8px;margin-bottom:8px}
  .graphic-option{break-inside:avoid}
  .graphic-help{display:none!important}
}


/* ---------- V5.26: hochwertige Foto-Arbeitsblätter ---------- */
.worksheet-graphic-v526{
  padding:14px 16px;
  border:1px solid #ddd8e8;
  border-radius:16px;
  background:linear-gradient(180deg,#fff 0%,#fcfbff 100%);
}
.worksheet-sequence-svg{max-height:150px}
.worksheet-grid-svg{max-height:360px}
.worksheet-tiling-svg{max-height:330px}
.worksheet-drawing-grid{max-height:430px;background:#fff}
.graphic-mini-pattern{display:block;max-width:150px;max-height:92px;width:auto;height:auto}
.graphic-options-v526{gap:12px;align-items:stretch}
.graphic-option-v526{min-width:118px;min-height:82px;justify-content:flex-start;padding:10px 12px}
.graphic-option-v526 .graphic-option-visual{display:grid;place-items:center;min-width:64px;min-height:58px}
.graphic-option-v526>input{accent-color:#6254e8}
.graphic-option-v526:has(input:checked){border-color:#776be9;background:#f3f0ff;box-shadow:0 0 0 2px rgba(98,84,232,.10)}
.graphic-workspace{display:grid;gap:12px}
.graphic-palette{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;padding-top:4px}
.graphic-palette-btn{width:48px;height:48px;padding:3px;border:1px solid #d8d3e6;border-radius:12px;background:#fff;display:grid;place-items:center}
.graphic-palette-btn svg{width:40px;height:40px}
.graphic-palette-btn.active{border:2px solid #6254e8;background:#f1efff;box-shadow:0 0 0 2px rgba(98,84,232,.10)}
.graphic-cell.editable.filled{border-style:solid;border-color:#8f84e8;background:#fff}
.sequence-interactive{gap:8px;background:#faf9ff;border-radius:14px;padding:10px}
.sheet-question:has(.worksheet-graphic-v526){padding-bottom:14px;margin-bottom:16px}
.sheet-question:has(.worksheet-graphic-v526) .question-text{font-weight:600}

@media(max-width:600px){
  .worksheet-graphic-v526{padding:10px}
  .graphic-option-v526{min-width:105px;flex:1 1 105px}
  .graphic-option-v526 .graphic-option-visual{min-width:54px}
  .worksheet-drawing-grid{max-height:360px}
}

@media print{
  *{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
  .worksheet-graphic-v526{border:1px solid #c9c6d0!important;border-radius:10px!important;padding:10px!important;background:#fff!important}
  .worksheet-sequence-svg{max-height:38mm}
  .worksheet-grid-svg,.worksheet-tiling-svg{max-height:72mm}
  .worksheet-drawing-grid{max-height:88mm}
  .graphic-option-v526{min-height:20mm;border:1px solid #c8c5cf!important;background:#fff!important}
  .graphic-palette,.graphic-help{display:none!important}
  .sheet-question:has(.worksheet-graphic-v526){break-inside:avoid-page}
}


/* ---------- V5.28: aufgeräumte Schnellaktionen ---------- */
.compact-actions .group-action{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-weight:700;
  background:#f8f6ff;
  border-color:#d8d2f6;
}
.action-chevron{
  font-size:1.3em;
  opacity:.55;
  line-height:1;
}

.quick-action-menu{
  position:fixed;
  inset:0;
  z-index:1400;
  display:flex;
  align-items:flex-end;
  justify-content:center;
}
.quick-action-backdrop{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
  border-radius:0;
  background:rgba(20,18,35,.42);
  backdrop-filter:blur(2px);
}
.quick-action-sheet{
  position:relative;
  width:min(680px,100%);
  max-height:min(78vh,720px);
  overflow:auto;
  padding:10px 18px calc(20px + env(safe-area-inset-bottom));
  border-radius:26px 26px 0 0;
  background:#fff;
  box-shadow:0 -18px 55px rgba(30,25,60,.22);
}
.quick-action-handle{
  width:44px;
  height:5px;
  border-radius:99px;
  margin:2px auto 14px;
  background:#ddd9ea;
}
.quick-action-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}
.quick-action-kicker{
  color:#6757e7;
  font-size:.76rem;
  font-weight:900;
  letter-spacing:.09em;
}
.quick-action-head h2{
  margin:4px 0 0;
  font-size:1.35rem;
}
.quick-action-close{
  width:44px;
  height:44px;
  flex:0 0 44px;
  border:1px solid #ddd8ea;
  border-radius:14px;
  background:#fff;
  font-size:1.2rem;
}
.quick-action-options{
  display:grid;
  gap:10px;
}
.quick-option{
  width:100%;
  display:flex;
  align-items:center;
  gap:13px;
  padding:14px;
  text-align:left;
  border:1px solid #e1ddef;
  border-radius:16px;
  background:#fbfaff;
  color:var(--ink);
}
.quick-option:active{
  transform:scale(.99);
  background:#f2efff;
}
.quick-option-icon{
  width:46px;
  height:46px;
  flex:0 0 46px;
  display:grid;
  place-items:center;
  border-radius:13px;
  background:#eeeafd;
  font-size:1.45rem;
}
.quick-option strong{
  display:block;
  font-size:1.03rem;
  margin-bottom:3px;
}
.quick-option small{
  display:block;
  color:#75717f;
  line-height:1.35;
  font-size:.87rem;
}
body.quick-menu-open{
  overflow:hidden;
}

@media(min-width:700px){
  .quick-action-sheet{
    margin-bottom:18px;
    border-radius:26px;
  }
}


/* ---------- V5.29: altersgerechte Lern-Darstellung Klasse 1–6 ---------- */
.lc-learning-visual{
  margin:12px 0 4px;
  padding:14px;
  border:1px solid #e0dcef;
  border-radius:18px;
  background:#faf9ff;
  overflow:hidden;
}
.lc-count-items,.lc-object-group{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:9px;
}
.lc-count-items span,.lc-object-group span{
  font-size:38px;
  line-height:1;
}
.lc-equation-pictures{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  gap:12px;
  align-items:center;
}
.lc-equation-pictures>b{font-size:30px;text-align:center;color:#6254d8}
.lc-equation-big{
  margin-top:12px;
  text-align:center;
  font-size:28px;
  font-weight:900;
  letter-spacing:.02em;
}
.lc-tenframe{
  display:grid;
  grid-template-columns:repeat(5,42px);
  width:max-content;
  gap:5px;
  margin:auto;
  padding:5px;
  border:2px solid #555;
  border-radius:8px;
  background:#fff;
}
.lc-tenframe span{width:42px;height:42px;border:1px solid #aaa;display:grid;place-items:center}
.lc-tenframe span.filled::after{content:"";width:27px;height:27px;border-radius:50%;background:#6254d8}
.lc-number-strip{display:flex;justify-content:center;flex-wrap:wrap;gap:6px}
.lc-number-strip span{
  min-width:48px;height:52px;padding:0 8px;border:2px solid #3da7e8;border-radius:8px;
  display:grid;place-items:center;background:#fff;font-size:23px;font-weight:800;
}
.lc-number-strip .missing{border-style:dashed;background:#f4f2ff;color:#6254d8}
.lc-compare{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:14px}
.lc-compare>div{display:flex;flex-wrap:wrap;gap:5px;align-items:center;justify-content:center}
.lc-compare>strong{font-size:34px;color:#6254d8}
.lc-compare small{display:block;width:100%;text-align:center;font-size:18px;font-weight:800}
.lc-dot{width:22px;height:22px;border-radius:50%;background:#4aa7e8;display:inline-block}
.lc-array{display:grid;grid-template-columns:repeat(var(--lc-cols),25px);gap:6px;width:max-content;margin:auto}
.lc-array span{width:25px;height:25px;border-radius:50%;background:#6254d8}
.lc-tens-ones{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center;
  gap:12px;
}
.lc-tens-ones-group{min-width:0;text-align:center}
.lc-tens-ones-group>small{display:block;margin-bottom:8px;font-weight:850;color:#665f79}
.lc-tens-rods,.lc-ones-blocks{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px}
.lc-ten-rod{display:grid;grid-template-columns:repeat(10,7px);gap:1px;padding:4px;border:2px solid #6254d8;border-radius:7px;background:#f1efff}
.lc-ten-rod i{display:block;width:7px;height:14px;border-radius:2px;background:#7567ea}
.lc-one-block{display:block;width:20px;height:20px;border:2px solid #2b87be;border-radius:5px;background:#dff3ff}
.lc-tens-ones-plus{font-size:30px;font-weight:900;color:#6254d8}
.lc-placevalue{display:grid;grid-template-columns:repeat(var(--lc-place-columns,3),minmax(46px,1fr));gap:6px;max-width:680px;margin:auto}
.lc-placevalue>div{display:grid;place-items:center;padding:10px 5px;border:2px solid #d5cff8;border-radius:12px;background:#fff}
.lc-placevalue small{font-weight:900;color:#6254d8}.lc-placevalue b{font-size:clamp(22px,6vw,30px)}.lc-placevalue span{font-size:clamp(9px,2.5vw,12px);color:#777;text-align:center;overflow-wrap:anywhere}
@media(max-width:430px){.lc-placevalue{gap:3px}.lc-placevalue>div{padding:8px 2px;border-radius:9px}.lc-placevalue span{writing-mode:vertical-rl;transform:rotate(180deg);max-height:92px}}
.lc-fractionbar{display:grid;grid-template-columns:repeat(var(--lc-den),1fr);height:52px;max-width:430px;margin:auto;border:2px solid #555;border-radius:8px;overflow:hidden;background:#fff}
.lc-fractionbar span{border-right:1px solid #777}.lc-fractionbar span:last-child{border-right:0}.lc-fractionbar span.filled{background:#7669e8}
.lc-visual-caption{text-align:center;margin-top:7px;font-size:13px;color:#6f6d7d;font-weight:700}
.printable-text-sheet{width:min(100%,794px);min-height:70vh;margin:16px auto;padding:clamp(24px,7vw,68px);background:#fff;border:1px solid #d8d5df;box-shadow:0 12px 35px rgba(36,31,67,.09);color:#191820;font-size:17px;line-height:1.6;text-align:left}
.printable-text-sheet h2{margin:0 0 24px;padding-bottom:14px;border-bottom:2px solid #ece9df;font-size:clamp(25px,6vw,34px);line-height:1.2}
.printable-text-sheet div{overflow-wrap:anywhere}
.printable-text-sheet::after{content:"";display:block;clear:both}
.lc-coins{display:flex;justify-content:center;align-items:center;gap:12px;flex-wrap:wrap}
.lc-coin{display:grid;place-items:center;width:58px;height:58px;border-radius:50%;border:4px solid #ba6c38;background:#dc8a52;color:#30251f;font-weight:900;font-size:15px;box-shadow:inset 0 0 0 3px rgba(255,255,255,.42),0 3px 7px rgba(50,35,20,.16)}
.lc-coin-10c,.lc-coin-20c,.lc-coin-50c{border-color:#d4a62c;background:#f1cf55}
.lc-coin-1e,.lc-coin-2e{border-color:#d4a62c;background:#d7d9d7;box-shadow:inset 0 0 0 10px #f1cf55,0 3px 7px rgba(50,35,20,.16)}
.printable-text-image{float:right;width:min(43%,280px);margin:0 0 18px 24px}
.printable-text-image img{display:block;width:100%;max-height:300px;object-fit:contain;border-radius:14px}
@media(max-width:520px){.printable-text-sheet{min-height:65vh;font-size:16px;line-height:1.55}.printable-text-image{float:none;width:100%;margin:0 0 18px}.printable-text-image img{max-height:240px}}
.lc-numberline{position:relative;height:70px;margin:12px 20px 0;border-top:4px solid #333}
.lc-numberline .start,.lc-numberline .end,.lc-numberline .mark{position:absolute;top:-13px;transform:translateX(-50%);padding-top:24px;font-weight:800}
.lc-numberline .start{left:0}.lc-numberline .end{left:100%}.lc-numberline .mark{color:#6254d8;font-size:18px}
.lc-numberline .mark::before{content:"";position:absolute;top:0;left:50%;width:16px;height:16px;border-radius:50%;background:#6254d8;transform:translate(-50%,-50%)}
.lc-shape-row{display:flex;justify-content:center;align-items:center;gap:18px;flex-wrap:wrap}
.lc-shape{display:inline-block;width:64px;height:64px;background:#4aa7e8;border:3px solid #2476aa}
.lc-shape.circle{border-radius:50%}.lc-shape.square{border-radius:8px}.lc-shape.rectangle{width:90px;height:55px;border-radius:8px}
.lc-shape.triangle{width:0;height:0;background:transparent;border-left:36px solid transparent;border-right:36px solid transparent;border-bottom:64px solid #f2b43e;border-top:0}

/* Klasse 1 und 2: großzügiger, bildhafter, leichter zu treffen. */
body[data-grade="1"] .assistant .bubble{font-size:18px;line-height:1.55}
body[data-grade="1"] .answer-option{min-height:72px;padding:14px 15px}
body[data-grade="1"] .answer-letter{width:46px;height:46px;font-size:20px}
body[data-grade="1"] .answer-label{font-size:19px}
body[data-grade="1"] .lc-learning-visual{padding:18px}
body[data-grade="1"] .lc-count-items span,body[data-grade="1"] .lc-object-group span{font-size:46px}
body[data-grade="2"] .assistant .bubble{font-size:18px;line-height:1.55;border-radius:20px}
body[data-grade="2"] .answer-option{min-height:72px;border-radius:18px;padding:13px 15px}
body[data-grade="2"] .answer-letter{width:46px;height:46px;font-size:20px;border-radius:14px}
body[data-grade="2"] .answer-label{font-size:19px;font-weight:750}
body[data-grade="2"] .lc-learning-visual{padding:17px;border-radius:20px;background:#f8f7ff}

/* Klasse 3–4: freundlich, aber bereits schulischer. */
body[data-grade="3"] .lc-learning-visual,body[data-grade="4"] .lc-learning-visual{background:#fbfbfe;border-radius:14px}

/* Klasse 5–6: weniger verspielt, kompakter und sachlicher. */
body[data-grade="5"] .lc-learning-visual,body[data-grade="6"] .lc-learning-visual{background:#fff;border-radius:10px;padding:12px}
body[data-grade="5"] .answer-option,body[data-grade="6"] .answer-option{box-shadow:none}

@media(max-width:500px){
  .lc-count-items span,.lc-object-group span{font-size:34px}
  body[data-grade="1"] .lc-count-items span,body[data-grade="1"] .lc-object-group span{font-size:41px}
  .lc-tenframe{grid-template-columns:repeat(5,36px)}
  .lc-tenframe span{width:36px;height:36px}
  .lc-equation-big{font-size:24px}
  .lc-number-strip span{min-width:43px;height:48px;font-size:20px}
  .lc-tens-ones{grid-template-columns:1fr;gap:8px}
  .lc-tens-ones-plus{font-size:24px;line-height:1}
  .lc-ten-rod{grid-template-columns:repeat(10,6px)}
  .lc-ten-rod i{width:6px;height:12px}
}


/* V5.30 – bewusstes Lerntempo: Feedback zuerst, nächste Aufgabe erst auf Weiter */
.answer-continue-wrap{
  width:min(88%,560px);
  margin:10px 0 2px;
  display:flex;
  justify-content:flex-start;
}
.answer-continue-btn{
  min-height:52px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:12px 20px;
  border:1.5px solid #cfc8f6;
  border-radius:16px;
  background:#6554e8;
  color:#fff;
  font:inherit;
  font-weight:800;
  font-size:16px;
  box-shadow:0 6px 18px rgba(80,65,190,.15);
  cursor:pointer;
}
.answer-continue-btn:active{transform:scale(.985)}
.answer-continue-btn.used,
.answer-continue-btn:disabled{opacity:.55;cursor:default}
@media(max-width:600px){
  .answer-continue-wrap{width:92%}
  .answer-continue-btn{width:100%;font-size:17px}
}

/* V5.33 – installierbare LernCoach-PWA */
.install-app-chip{
  margin:10px 0 2px auto;
  min-height:42px;
  padding:9px 14px;
  border:1.5px solid #cbc4f6;
  border-radius:999px;
  background:#fff;
  color:#5747c9;
  font:inherit;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 4px 14px rgba(74,58,175,.08);
}
.install-app-chip:active{transform:scale(.985)}
@media(max-width:600px){
  .install-app-chip{font-size:14px;margin-right:4px}
}
@media(display-mode:standalone){
  .install-app-chip{display:none!important}
  body{overscroll-behavior-y:contain}
}

.voice-language-note{margin-top:10px;font-size:.9em;line-height:1.45;opacity:.82}

/* ---------- V5.37: Lehrplan + echter Lernstand + Statistik ---------- */
.progress-tabs{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin:0 0 16px;
  padding:5px;
  border-radius:15px;
  background:#f3f0fb;
}
.progress-tabs button{
  min-height:42px;
  border:0;
  border-radius:11px;
  background:transparent;
  color:#655f70;
  font:inherit;
  font-weight:800;
}
.progress-tabs button.active{
  background:#fff;
  color:#5145cf;
  box-shadow:0 2px 8px rgba(42,35,95,.09);
}
.subject-progress-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.subject-progress-card{
  min-width:0;
  text-align:left;
  padding:14px;
  border:1px solid #e1dcef;
  border-radius:16px;
  background:#fff;
  color:#2d2935;
  font:inherit;
}
.subject-progress-card span,.subject-progress-card small{display:block}
.subject-progress-card span{font-weight:850}
.subject-progress-card strong{display:block;margin:4px 0;font-size:1.45rem;color:#5549d8}
.subject-progress-card small{color:#777184;line-height:1.35}
.recommend-list{display:grid;gap:9px}
.recommend-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  align-items:center;
  gap:10px;
  padding:12px;
  border:1px solid #e4dfef;
  border-radius:15px;
  background:#fff;
}
.recommend-row strong,.recommend-row span{display:block}
.recommend-row span{margin-top:3px;color:#777184;font-size:.82rem}
.recommend-row button,.topic-practice-btn{
  min-height:38px;
  padding:7px 11px;
  border:1px solid #cfc8f0;
  border-radius:11px;
  background:#f4f1ff;
  color:#5547d8;
  font:inherit;
  font-weight:850;
}
.mastery-pill{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  min-height:30px;
  padding:5px 8px;
  border-radius:999px;
  white-space:nowrap;
  font-size:.78rem!important;
  font-weight:850;
}
.mastery-pill.new{background:#f3f2f6;color:#77717f}
.mastery-pill.practice{background:#fff0f0;color:#a33f45}
.mastery-pill.learning{background:#fff6e4;color:#936310}
.mastery-pill.almost{background:#eaf8ef;color:#27774a}
.mastery-pill.mastered{background:#eaf8ef;color:#27774a}
.cloud-progress-hint{
  margin-top:16px;
  padding:12px 14px;
  border-radius:14px;
  border:1px dashed #d7d1e9;
  color:#6d6779;
  line-height:1.45;
  background:#fbfaff;
}
.curriculum-subject-tabs{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:12px 0 4px;
  scrollbar-width:none;
}
.curriculum-subject-tabs::-webkit-scrollbar{display:none}
.curriculum-subject-chip{
  flex:0 0 auto;
  min-height:38px;
  padding:7px 12px;
  border:1px solid #ddd8ed;
  border-radius:999px;
  background:#fff;
  color:#5e5868;
  font:inherit;
  font-weight:800;
}
.curriculum-subject-chip.active{background:#6254e8;border-color:#6254e8;color:#fff}
.curriculum-topic-list{display:grid;gap:9px;margin-top:12px}
.curriculum-topic-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  align-items:center;
  gap:10px;
  padding:12px;
  border:1px solid #e4dfef;
  border-radius:15px;
  background:#fff;
}
.curriculum-topic-copy strong,.curriculum-topic-copy span{display:block}
.curriculum-topic-copy strong{line-height:1.25}
.curriculum-topic-copy span{margin-top:4px;color:#777184;font-size:.82rem;line-height:1.3}
.weekly-chart{
  height:180px;
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  align-items:end;
  gap:8px;
  padding:14px 10px 8px;
  border:1px solid #e5e0ef;
  border-radius:16px;
  background:#fbfaff;
}
.stat-day{height:100%;display:grid;grid-template-rows:minmax(0,1fr) auto auto;gap:3px;text-align:center;align-items:end}
.stat-bar-track{
  height:100%;
  min-height:86px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  overflow:hidden;
  border-radius:9px;
  background:#eeebf7;
}
.stat-bar-fill{width:100%;min-height:2px;border-radius:9px 9px 0 0;background:linear-gradient(180deg,#7567ea,#5d50dc)}
.stat-day b{font-size:.78rem;color:#4e4858}
.stat-day span{font-size:.72rem;color:#777184}
.stats-summary-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:14px;
}
.stats-summary-grid>div{
  min-width:0;
  padding:13px;
  border:1px solid #e4dfef;
  border-radius:15px;
  background:#fff;
}
.stats-summary-grid span,.stats-summary-grid small{display:block;color:#777184}
.stats-summary-grid strong{display:block;margin:4px 0;font-size:1.08rem;overflow-wrap:anywhere}
.progress-empty-large{margin-top:14px;padding:24px;line-height:1.6;text-align:center}

@media(max-width:560px){
  .subject-progress-grid{grid-template-columns:1fr 1fr}
  .recommend-row,.curriculum-topic-row{grid-template-columns:minmax(0,1fr) auto}
  .recommend-row button,.curriculum-topic-row .topic-practice-btn{grid-column:1/-1;width:100%}
  .mastery-pill{justify-self:end}
  .weekly-chart{gap:5px;padding-left:7px;padding-right:7px}
}

/* ---------- V5.39: ehrlicher Lernstand in drei Zuständen ---------- */
.state-word{font-size:1.02rem!important;line-height:1.22!important;white-space:normal}
.state-word.new{color:#77717f}
.state-word.learning{color:#936310}
.state-word.mastered{color:#27774a}


/* ---------- V5.41: fester Weiter-Button während Rückfragen ---------- */
.continue-dock{
  position:fixed;
  z-index:24;
  left:50%;
  transform:translateX(-50%);
  bottom:calc(max(10px, env(safe-area-inset-bottom)) + 82px);
  width:min(792px,calc(100% - 22px));
  padding:0 9px;
  pointer-events:none;
}
.continue-dock.hidden{display:none!important}
.continue-dock .continue-dock-btn{
  width:100%;
  min-height:54px;
  pointer-events:auto;
  box-shadow:0 9px 24px rgba(80,65,190,.22);
}
body.has-continue-dock .app{padding-bottom:196px}
body.has-continue-dock .speech-controls{bottom:158px}
@media(max-width:600px){
  .continue-dock{
    width:calc(100% - 22px);
    bottom:calc(max(10px, env(safe-area-inset-bottom)) + 82px);
    padding:0;
  }
  body.has-continue-dock .app{padding-bottom:192px}
}

/* ---------- V5.43: unterbrochene Lernrunden ---------- */
.practice-resume-card{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:11px 12px;
  margin:12px 10px 16px;
  padding:15px;
  border:1px solid #dcd6f3;
  border-radius:19px;
  background:#fbfaff;
  box-shadow:0 7px 20px rgba(70,56,150,.08);
}
.practice-resume-icon{font-size:1.55rem;line-height:1.2}
.practice-resume-copy small,.practice-resume-copy strong,.practice-resume-copy span{display:block}
.practice-resume-copy small{color:#6658df;font-size:.7rem;font-weight:900;letter-spacing:.08em}
.practice-resume-copy strong{margin-top:2px;font-size:1.02rem}
.practice-resume-copy span{margin-top:4px;color:#6f6879;line-height:1.4;font-size:.9rem}
.practice-resume-actions{grid-column:1/-1;display:grid;grid-template-columns:2fr 1fr;gap:8px}
.practice-resume-actions button{min-height:44px;border:1px solid #d7d0f2;border-radius:12px;background:#eeeaff;color:#584bd4;font:inherit;font-weight:850}
.practice-resume-actions button:last-child{background:#fff;color:#6f6879}

/* ---------- V5.42: klare Lernrunden + Testlänge ---------- */
.practice-round-bar{
  position:sticky;
  top:8px;
  z-index:18;
  margin:10px 12px 14px;
  padding:12px 14px;
  border:1px solid #ddd7f3;
  border-radius:16px;
  background:rgba(255,255,255,.97);
  box-shadow:0 8px 24px rgba(67,54,145,.10);
  backdrop-filter:blur(10px);
}
.practice-round-topline{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.practice-round-kicker{
  display:block;
  margin-bottom:2px;
  color:#6658df;
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.08em;
}
.practice-round-title{font-weight:850}
.practice-round-actions{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.practice-round-actions>strong{font-size:.92rem;color:#3c3746;white-space:nowrap}
.practice-round-actions button{
  min-height:34px;
  padding:6px 10px;
  border:1px solid #ddd7ef;
  border-radius:10px;
  background:#faf9ff;
  color:#5f55bd;
  font:inherit;
  font-size:.82rem;
  font-weight:800;
}
.practice-round-track{
  height:7px;
  margin-top:10px;
  overflow:hidden;
  border-radius:999px;
  background:#eeeafb;
}
.practice-round-track span{
  display:block;
  width:0;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,#7567ea,#5b4add);
  transition:width .25s ease;
}
.practice-round-summary{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:12px;
  margin:14px 0;
  padding:16px;
  border:1px solid #ded8f3;
  border-radius:18px;
  background:#fbfaff;
}
.practice-round-summary-icon{font-size:1.7rem}
.practice-round-summary-copy strong,.practice-round-summary-copy span{display:block}
.practice-round-summary-copy strong{font-size:1.08rem}
.practice-round-summary-copy span{margin-top:4px;color:#6e6877;line-height:1.4}
.practice-round-summary-actions{
  grid-column:1/-1;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.practice-round-summary-actions button{
  min-height:42px;
  border:1px solid #d6cff2;
  border-radius:12px;
  background:#f3f0ff;
  color:#584bd4;
  font:inherit;
  font-weight:850;
}

.test-length-modal{
  position:fixed;
  inset:0;
  z-index:70;
  display:grid;
  align-items:end;
}
.test-length-backdrop{
  position:absolute;
  inset:0;
  border:0;
  background:rgba(28,24,41,.48);
}
.test-length-sheet{
  position:relative;
  width:min(720px,100%);
  max-height:min(86vh,760px);
  margin:0 auto;
  overflow:auto;
  padding:20px;
  border-radius:24px 24px 0 0;
  background:#fff;
  box-shadow:0 -16px 45px rgba(24,19,59,.20);
}
.test-length-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.test-length-kicker{color:#6658df;font-size:.76rem;font-weight:900;letter-spacing:.09em}
.test-length-head h2{margin:4px 0 4px;font-size:1.35rem}
.test-length-head p{margin:0;color:#716b79;line-height:1.45}
.test-length-head>button{
  width:46px;height:46px;flex:0 0 46px;
  border:1px solid #e3deed;border-radius:14px;background:#fff;
  font-size:1.25rem;
}
.test-length-options{display:grid;gap:10px;margin-top:18px}
.test-length-options button{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:3px 12px;
  padding:15px;
  text-align:left;
  border:1px solid #ded8f0;
  border-radius:16px;
  background:#fbfaff;
  color:#2e2936;
  font:inherit;
}
.test-length-options button strong{font-size:1.02rem}
.test-length-options button span{grid-row:1/3;grid-column:2;align-self:center;color:#5b4fda;font-weight:900;white-space:nowrap}
.test-length-options button small{color:#756f7d}

.interactive-test-progress{
  margin:14px 0 18px;
  padding:12px 14px;
  border:1px solid #ddd7f2;
  border-radius:15px;
  background:#faf9ff;
}
.interactive-test-progress>div:first-child{display:flex;justify-content:space-between;gap:12px;align-items:center}
.interactive-test-progress span{color:#6c6577;font-size:.88rem}
.interactive-test-progress-track{
  height:7px;
  margin-top:9px;
  overflow:hidden;
  border-radius:999px;
  background:#ebe7f8;
}
.interactive-test-progress-track span{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#7567ea,#5b4add);transition:width .2s ease}

@media(max-width:600px){
  .practice-round-bar{margin-left:10px;margin-right:10px;padding:11px 12px}
  .practice-round-topline{align-items:flex-start}
  .practice-round-actions{align-items:flex-end;flex-direction:column;gap:5px}
  .practice-round-summary-actions{grid-template-columns:1fr}
  .test-length-sheet{padding:18px 16px calc(20px + env(safe-area-inset-bottom))}
  .interactive-test-progress>div:first-child{align-items:flex-start;flex-direction:column;gap:3px}
}


/* ---------- V5.44: Vergleich bis 100 ohne falsches 20/20-Mengenbild ---------- */
.lc-compare-placevalue{align-items:center;gap:10px}
.lc-compare-placevalue>.lc-compare-number{display:block;min-width:0;text-align:center}
.lc-compare-base10{display:flex;justify-content:center;align-items:flex-end;gap:8px;min-height:68px}
.lc-compare-part{display:grid;gap:4px;justify-items:center;min-width:0}
.lc-compare-part-label{font-size:12px;font-weight:900;color:#665f79}
.lc-compare-tens,.lc-compare-ones{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-end;gap:3px;max-width:78px;min-height:46px}
.lc-compare-mini-rod{display:block;width:9px;height:44px;border:2px solid #6254d8;border-radius:4px;background:#dcd7ff}
.lc-compare-mini-one{display:block;width:13px;height:13px;border:2px solid #2b87be;border-radius:3px;background:#dff3ff}
.lc-compare-zero{font-size:17px;font-weight:850;color:#777;align-self:center}
.lc-compare-placevalue small{margin-top:7px;font-size:13px;line-height:1.2;color:#514b66}
@media(max-width:380px){
  .lc-compare-placevalue{gap:6px}
  .lc-compare-base10{gap:5px}
  .lc-compare-tens,.lc-compare-ones{max-width:62px;gap:2px}
  .lc-compare-mini-rod{width:8px;height:39px}
  .lc-compare-mini-one{width:11px;height:11px}
  .lc-compare-placevalue small{font-size:11px}
}

/* ---------- V5.47: Drei sichtbare Mengen bei Vergleichsaufgaben Klasse 1/2 ---------- */
.lc-compare3{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  align-items:stretch;
  padding:18px 12px;
}
.lc-compare3-group{
  min-width:0;
  min-height:128px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px 8px;
  border:1px solid rgba(104,86,225,.14);
  border-radius:18px;
  background:rgba(255,255,255,.72);
}
.lc-compare3-dots{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-content:center;
  gap:7px;
  max-width:108px;
}
.lc-compare3-group > small{
  font-size:22px;
  font-weight:800;
  color:#272536;
}
.lc-compare3-base10{
  gap:8px;
}
.lc-compare3-placevalue{
  padding:10px 5px;
}
.lc-compare3-placevalue .lc-compare-base10{
  transform:scale(.82);
  transform-origin:center;
  margin:-6px -10px;
}
@media (max-width:390px){
  .lc-compare3{gap:7px;padding:14px 7px}
  .lc-compare3-group{padding:9px 5px;min-height:116px}
  .lc-compare3-dots{gap:5px;max-width:92px}
  .lc-compare3 .lc-dot{width:20px;height:20px}
}

/* V5.50 – Klasse 1–4: antippen statt tippen */
.young-tap-mode .interactive-choice-list,
.young-tap-mode .interactive-check-list{
  gap:10px;
}
.young-tap-mode .interactive-choice.young-tap-choice{
  min-height:56px;
  padding:13px 14px;
  align-items:center;
  font-size:1.05rem;
  cursor:pointer;
  background:#fff;
}
.young-tap-mode .interactive-choice.young-tap-choice:has(input:checked){
  border-color:#7567ea;
  background:#f2efff;
  box-shadow:0 0 0 2px rgba(117,103,234,.10);
}
.young-tap-mode .interactive-choice.young-tap-choice input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.young-no-typing-note{
  margin-top:10px;
  padding:12px 14px;
  border-radius:12px;
  background:#fff8e7;
  border:1px solid #ead79b;
  color:#554c31;
  line-height:1.45;
}


/* V5.51 – Zahlenfolgen Klasse 1–4: Zahl antippen statt Form/Farbe einsetzen */
.young-number-sequence-wrap{padding:14px 10px!important;}
.young-number-sequence{display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap;padding:8px 2px;}
.young-number-sequence-box{min-width:52px;height:58px;padding:0 10px;border:2px solid #8fc7e6;border-radius:12px;background:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:1.5rem;font-weight:750;color:#25243a;box-sizing:border-box;}
.young-number-sequence-box.missing{border:3px dashed #8d82df;background:#f6f3ff;color:#6557d9;}
.young-number-sequence-arrow{font-size:1.25rem;color:#9d99ad;font-weight:700;}
@media(max-width:480px){.young-number-sequence{gap:5px}.young-number-sequence-box{min-width:44px;height:52px;font-size:1.3rem;padding:0 7px}.young-number-sequence-arrow{font-size:1rem}}


/* V5.53 – Zielwort in Wortart-Aufgaben muss für Kinder eindeutig sichtbar sein. */
.interactive-target-word{
  text-decoration-line: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
  font-weight: 750;
}


/* ---------- V5.55: Vorlesesteuerung rechts andocken ---------- */
.speech-controls{
  left:auto !important;
  right:max(8px, env(safe-area-inset-right)) !important;
  top:50% !important;
  bottom:auto !important;
  transform:translateY(-50%) !important;
  flex-direction:column;
  flex-wrap:nowrap;
  justify-content:center;
  align-items:stretch;
  gap:7px;
  width:88px;
  max-width:88px;
  padding:7px;
  border-radius:20px;
  z-index:66;
}
.speech-controls button{
  width:72px;
  min-width:72px;
  min-height:58px;
  padding:6px 3px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  line-height:1.05;
  text-align:center;
}
.speech-control-icon{font-size:21px;line-height:1}
.speech-control-label{font-size:11px;font-weight:800;line-height:1.1}
body.has-continue-dock .speech-controls{
  top:42% !important;
  bottom:auto !important;
}
@media(max-width:600px){
  .speech-controls{
    right:max(4px, env(safe-area-inset-right)) !important;
    width:68px;
    max-width:68px;
    padding:5px;
    gap:5px;
    border-radius:17px;
  }
  .speech-controls button{
    width:56px;
    min-width:56px;
    min-height:51px;
    padding:4px 2px;
    border-radius:11px;
  }
  .speech-control-icon{font-size:19px}
  .speech-control-label{font-size:9.5px}
}
@media(max-height:650px){
  .speech-controls{top:44% !important}
  .speech-controls button{min-height:46px}
}
