/* ===================== Reset & Base ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f7f8fa; color: #1a1a2e; line-height: 1.6; }
a { color: #4a90d9; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===================== Navbar ===================== */
.navbar {
  background: #1b1f24;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 2rem;
  position: sticky; top: 0; z-index: 100;
}
.nav-brand a { color: #fff; font-size: 1.2rem; font-weight: 700; }
/* Logo "Informatik.book": Farben wie im Logo-Zeichen (static/img/logo-mark.svg) */
.brand-logo { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none !important; }
.brand-mark { display: block; width: 34px; height: 34px; }
.brand-text { font-size: 1.35rem; letter-spacing: -.01em; line-height: 1; white-space: nowrap; }
.brand-name { color: #fff; font-weight: 800; }
.brand-dot { color: #4fe0dc; font-weight: 800; }
.brand-book { color: #c3ccd4; font-weight: 400; }
.nav-links a {
  color: #ccd; margin-left: 1.5rem; font-size: .95rem;
}
.nav-links a:hover { color: #fff; }

/* ===================== Main ===================== */
.main-content { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; }

/* Sections embedding the BFS widget need much more horizontal room than plain text/exercises. */
.wide-page .main-content { max-width: 1900px; }

/* ===================== Flash Messages ===================== */
.flash-messages { margin-bottom: 1rem; }
.alert {
  padding: .75rem 1rem; border-radius: 6px; margin-bottom: .5rem;
  font-size: .95rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }

/* ===================== Buttons ===================== */
.btn {
  display: inline-block; padding: .55rem 1.2rem; border-radius: 6px;
  font-size: .95rem; font-weight: 600; border: none; cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn-primary   { background: #4a90d9; color: #fff; }
.btn-primary:hover { background: #3578c7; color: #fff; }
.btn-secondary { background: #e2e6ea; color: #333; }
.btn-secondary:hover { background: #cdd3da; }
.btn-hint      { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.btn-hint:hover { background: #ffe69c; }
.btn-sm { padding: .35rem .85rem; font-size: .85rem; }
.btn-loeschen { background: #fff; color: #b42318; border: 1px solid #e4a3a0; }
.btn-loeschen:hover { background: #fdecec; color: #8f1c13; }
.btn-gefahr { background: #c62828; color: #fff; }
.btn-gefahr:hover { background: #a11d1d; color: #fff; }
.btn-gefahr:disabled { background: #e8a5a5; cursor: not-allowed; transform: none; }
.geloeschte-schueler { margin: 1rem 0; border: 1px solid #ddd; border-radius: 8px; padding: .5rem .9rem; background: #fafafa; }
.geloeschte-schueler summary { cursor: pointer; font-weight: 600; }
.geloeschte-schueler form { margin: 0; }

/* ===================== Hero ===================== */
.hero {
  text-align: center; padding: 4rem 1rem;
  background: linear-gradient(135deg, #1b1f24 0%, #1e2a3a 55%, #16404a 100%);
  border-radius: 12px; color: #fff; margin-bottom: 2rem;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 1rem; }
.hero-sub { font-size: 1.1rem; color: #b0c4de; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-oopventure {
  display: inline-flex; align-items: center; gap: .9rem; margin-top: 2rem; padding: .7rem 1.4rem .7rem .8rem;
  border-radius: 999px; color: #fff; text-align: left;
  background: linear-gradient(120deg, #a3c02a 0%, #7f9a0f 55%, #5d7209 100%);
  box-shadow: 0 6px 18px rgba(127,154,15,.45), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-oopventure:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(127,154,15,.55), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-oopventure:focus-visible { outline: 3px solid #fde68a; outline-offset: 3px; }
.btn-oopventure-held { width: 52px; height: 52px; background: rgba(255,255,255,.18); border-radius: 50%; padding: 4px; object-fit: contain; }
.btn-oopventure-text { display: grid; line-height: 1.25; }
.btn-oopventure-titel { font-size: 1.25rem; font-weight: 800; letter-spacing: .01em; }
.btn-oopventure-sub { font-size: .88rem; color: #eef5d2; }
.btn-oopventure-coin { width: 30px; height: 30px; transition: transform .4s ease; }
.btn-oopventure:hover .btn-oopventure-coin { transform: rotateY(180deg); }
.hero-abenteuer { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1rem; }
.btn-codeventure {
  background: linear-gradient(120deg, #2bb3a3 0%, #13867a 55%, #0b5f57 100%);
  box-shadow: 0 6px 18px rgba(19,134,122,.45), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-codeventure:hover { box-shadow: 0 10px 24px rgba(19,134,122,.55), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-codeventure .btn-oopventure-sub { color: #d6f3ef; }
@media (max-width: 480px) {
  .btn-oopventure { gap: .6rem; padding: .55rem 1rem .55rem .55rem; }
  .btn-oopventure-held { width: 42px; height: 42px; }
  .btn-oopventure-titel { font-size: 1.05rem; }
  .btn-oopventure-sub { font-size: .78rem; }
  .btn-oopventure-coin { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-oopventure, .btn-oopventure-coin { transition: none; }
  .btn-oopventure:hover { transform: none; }
  .btn-oopventure:hover .btn-oopventure-coin { transform: none; }
}

/* Banner: Logo gross (Farben wie .brand-* in der Kopfzeile) */
.hero-logo { display: inline-flex; align-items: center; gap: 1.1rem; margin-bottom: 1.2rem; max-width: 100%; }
.hero-logo-mark { width: 96px; height: 96px; flex: none; }
.hero-logo-text { font-size: 3.6rem; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
@media (max-width: 600px) {
  .hero { padding: 2.5rem 1rem; }
  .hero-logo { gap: .6rem; }
  .hero-logo-mark { width: 54px; height: 54px; }
  .hero-logo-text { font-size: 2.1rem; }
}

/* Kacheln je Klassenstufe (Startseite) und je Themenfeld (Stufenseite), Motive: static/img/themen/ */
.stufen-kacheln, .feld-kacheln {
  display: grid; gap: 1.1rem; margin: 1rem 0 2.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}
.stufen-kachel, .feld-kachel {
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: .35rem;
  min-height: 150px; padding: 1.2rem 1.3rem; border-radius: 14px; color: #fff; text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .18); transition: transform .15s ease, box-shadow .15s ease;
}
.stufen-kachel::after, .feld-kachel::after {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--motive); opacity: .22;
}
a.stufen-kachel:hover, a.feld-kachel:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15, 23, 42, .28); }
a.stufen-kachel:focus-visible, a.feld-kachel:focus-visible { outline: 3px solid #4fe0dc; outline-offset: 3px; }
.stufen-kachel { min-height: 170px; background: linear-gradient(135deg, #1b1f24 0%, #1e3348 60%, #135e66 100%); }
.stufen-kachel::after { opacity: .2; }
.stufen-kachel-titel { font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; }
.stufen-kachel-sub { color: #c3ccd4; font-size: .92rem; }
.stufen-kachel-zahl {
  margin-top: auto; align-self: flex-start; font-size: .8rem; font-weight: 600; color: #1b1f24;
  background: #4fe0dc; border-radius: 999px; padding: .15rem .65rem;
}
.feld-kachel-bereich { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.feld-kachel-titel { font-size: 1.2rem; font-weight: 800; line-height: 1.25; max-width: 85%; }
.feld-kachel-text { font-size: .9rem; opacity: .92; max-width: 80%; }
.feld-kachel-marke {
  margin-top: auto; align-self: flex-start; font-size: .78rem; font-weight: 700;
  background: rgba(255, 255, 255, .22); border-radius: 999px; padding: .15rem .65rem;
}
.feld-kachel-links { display: grid; gap: .25rem; margin-top: auto; }
/* Abiturtraining freigegeben: zwei Wege auf der Kachel (Heft bzw. Lernwelt und Abiturtraining) */
.feld-kachel-wege { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; }
.feld-kachel-weg {
  display: inline-flex; align-items: center; min-height: 44px; padding: .2rem .9rem; border-radius: 999px;
  background: rgba(255, 255, 255, .22); color: #fff !important; font-weight: 700; font-size: .9rem; text-decoration: none !important;
}
.feld-kachel-weg:hover, .feld-kachel-weg:focus-visible { background: rgba(255, 255, 255, .38); }
.feld-kachel-weg.ist-abitur { background: #fff; color: #1b1f24 !important; }
.feld-kachel-links a { color: #fff; font-weight: 700; }
.bereich-daten { background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.bereich-systeme { background: linear-gradient(135deg, #4c1d95, #7c3aed); }
.bereich-algorithmen { background: linear-gradient(135deg, #115e59, #0d9488); }
.bereich-ki { background: linear-gradient(135deg, #9a3412, #ea580c); }
.bereich-sicherheit { background: linear-gradient(135deg, #7f1d1d, #dc2626); }
.bereich-theorie { background: linear-gradient(135deg, #312e81, #4f46e5); }
.bereich-allgemein { background: linear-gradient(135deg, #1b1f24, #334155); }
/* Themenfeld ohne Inhalt: sichtbar, aber ausgegraut und nicht anklickbar */
.feld-kachel.ist-leer { background: linear-gradient(135deg, #8a94a3, #aab3bf); box-shadow: none; cursor: default; color: #f4f6f8; }
.feld-kachel.ist-leer::after { opacity: .14; }
@media (prefers-reduced-motion: reduce) {
  .stufen-kachel, .feld-kachel { transition: none; }
  a.stufen-kachel:hover, a.feld-kachel:hover { transform: none; }
}

/* ===================== Auth Forms ===================== */
.auth-intro {
  background: #eef7f7; border-left: 4px solid #4fe0dc; border-radius: 6px;
  padding: .7rem .9rem; margin: .25rem 0 1.1rem; font-size: .92rem; color: #334155;
}
.auth-container {
  max-width: 480px; margin: 2rem auto; background: #fff;
  border-radius: 10px; padding: 2rem; box-shadow: 0 4px 20px rgba(0,0,0,.1);
}
.auth-container h2 { margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .3rem; font-weight: 600; font-size: .9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: .6rem .85rem; border: 1.5px solid #dee2e6;
  border-radius: 6px; font-size: 1rem;
}
.form-group input:focus, .form-group select:focus { border-color: #4a90d9; outline: none; }
.form-hint { font-size: .85rem; color: #666; margin-top: .75rem; }
.form-check { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; cursor: pointer; }
.form-check .form-hint { margin: 0; }

.tab-nav { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
.tab-btn {
  padding: .4rem 1rem; border: 1.5px solid #dee2e6; background: #f8f9fa;
  border-radius: 6px; cursor: pointer; font-size: .9rem;
}
.tab-btn.active { background: #4a90d9; color: #fff; border-color: #4a90d9; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.code-result { text-align: center; }
.login-code-display {
  font-size: 2.5rem; font-weight: 800; letter-spacing: .2em;
  background: #e8f4fd; padding: 1rem; border-radius: 8px;
  margin: 1rem 0; color: #1a1a2e;
}

/* ===================== Dashboard ===================== */
.page-header { margin-bottom: 1.5rem; }
.oopventure-kachel {
  display: grid; gap: .2rem; margin-bottom: 1.5rem; padding: 1rem 1.25rem; border-radius: 12px;
  background: linear-gradient(120deg, #7f9a0f, #5d7209); color: #fff; box-shadow: 0 4px 14px rgba(60,80,0,.18);
}
.oopventure-kachel:hover { text-decoration: none; filter: brightness(1.05); }
.oopventure-kachel-titel { font-size: 1.3rem; font-weight: 800; }
.codeventure-kachel { background: linear-gradient(120deg, #1f8a70, #146152); box-shadow: 0 4px 14px rgba(0,70,55,.18); }
.page-header h1 { font-size: 1.8rem; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
}
.card {
  background: #fff; border-radius: 10px; padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.card h3 { margin-bottom: .4rem; }
.code-badge {
  display: inline-block; background: #e8f4fd; color: #1a73e8;
  padding: .2rem .6rem; border-radius: 4px; font-size: .9rem;
}
.empty-state { text-align: center; padding: 3rem; color: #666; }

/* ===================== Teacher Group Detail ===================== */
.shift-bar {
  background: #f0f7ff; padding: .75rem 1rem; border-radius: 8px;
  margin-bottom: 1.5rem; display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap;
}
.topic-unlock-card {
  background: #fff; border-radius: 10px; padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.07); margin-bottom: 1.5rem;
}
.topic-unlock-card h3 { margin-bottom: 1rem; color: #1a1a2e; }
.unlock-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.unlock-table th, .unlock-table td {
  padding: .5rem .75rem; border-bottom: 1px solid #eee; text-align: left;
}
.unlock-table th { background: #f8f9fa; font-weight: 600; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  padding: .6rem .75rem; border-bottom: 1px solid #eee; text-align: left;
}
.data-table th { background: #f8f9fa; font-weight: 600; }

/* ===================== Student Topics ===================== */
/* Verschachtelte Klappbereiche bleiben ungefasst und auf kleinen Displays bedienbar. */
.grade-list { margin: 1rem 0 2rem; }
.grade-group { border-bottom: 1px solid #d8dee6; }
.grade-group > summary, .topic-group > summary {
  padding: .9rem .5rem; cursor: pointer; font-weight: 600;
  overflow-wrap: anywhere;
}
.grade-group > summary { font-size: 1.1rem; }
.grade-group > summary:hover, .topic-group > summary:hover { background: #edf2f7; }
.grade-group > summary:focus-visible, .topic-group > summary:focus-visible {
  outline: 2px solid #3578c7; outline-offset: -2px;
}
.grade-group[open] > summary { color: #2466a8; }
.topic-count { font-size: .85rem; color: #666; font-weight: 400; margin-left: .6rem; white-space: nowrap; }
.grade-content { padding: 0 .5rem .75rem 1.25rem; min-width: 0; }
.topic-group { border-top: 1px solid #e2e6ea; }
.topic-content { padding: .25rem .5rem 1rem; overflow-wrap: anywhere; }
.topic-content p { margin-bottom: 1rem; color: #555; }
.grade-empty { padding: .5rem; color: #666; }
.grade-settings { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin-bottom: 1.5rem; }
.grade-settings .form-group { margin: 0; flex: 0 1 260px; min-width: 0; }
.grade-settings .venture-settings { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
.venture-settings legend { font-weight: 600; margin-bottom: .3rem; padding: 0; width: 100%; }
.venture-settings label { display: inline-flex; align-items: center; gap: .35rem; margin: 0; font-weight: normal; font-size: 1rem; white-space: nowrap; }
.venture-settings input[type=checkbox] { width: auto; padding: 0; }
.group-kind { border: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.grade-settings .group-kind { flex: 0 1 340px; }
.group-kind legend { font-weight: 600; margin-bottom: .3rem; padding: 0; }
.group-kind label { display: inline-flex; align-items: center; gap: .35rem; margin: 0; font-weight: normal; }
.group-kind input[type=radio] { width: auto; padding: 0; }
.topic-solutions { display: flex; align-items: center; gap: .4rem; margin: .5rem 0 .6rem; font-weight: normal; font-size: .95rem; }
.topic-solutions input { width: auto; padding: 0; }
.venture-settings-hint { margin: -.75rem 0 1.5rem; color: #6c757d; font-size: .9rem; }
.lesson-slots { margin-bottom: 1.5rem; }
.lesson-slots .venture-settings-hint { margin: .5rem 0 0; }
.lesson-slot-list { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: .3rem; }
.lesson-slot-list li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.lesson-slot-list .inline-form, .lesson-slot-form { display: inline-flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin: .3rem 0; }
.lesson-slot-form select { width: auto; }
.table-scroll { max-width: 100%; overflow-x: auto; margin-bottom: 1rem; }
.table-scroll .unlock-table { min-width: 440px; }
@media (max-width: 600px) {
  .grade-content { padding-left: .5rem; }
}

.topics-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.topic-card {
  background: linear-gradient(135deg, #fff 0%, #f0f7ff 100%);
  border-radius: 12px; padding: 2rem; box-shadow: 0 4px 15px rgba(74,144,217,.12);
  border: 1px solid #d0e8f8;
}
.topic-card h2 { margin-bottom: .75rem; color: #1a1a2e; font-size: 1.3rem; }
.topic-card p { color: #555; margin-bottom: 1.2rem; font-size: .95rem; }

/* ===================== Learning Layout ===================== */
.learning-layout {
  display: grid; grid-template-columns: 260px 1fr;
  gap: 2rem; align-items: start;
}
@media (max-width: 768px) {
  .learning-layout { grid-template-columns: 1fr; }
}

/* Sidebar Nav */
.section-nav {
  background: #fff; border-radius: 10px; padding: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.07); position: sticky; top: 80px;
  /* Hoeher als das Fenster? Dann eigener Scrollbalken statt Mitscrollen mit dem Inhalt. */
  max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain;
}
.section-nav-header { display: flex; gap: .5rem; align-items: flex-start; }
.section-nav-header h3 { font-size: 1rem; margin-bottom: .75rem; color: #666; }
/* Einklappen: Leiste schrumpft zu einem schmalen Streifen (Handy: nur die Kopfzeile) */
.nav-klappe { flex: 0 0 auto; min-width: 40px; min-height: 40px; margin: -.4rem 0 0 -.4rem; border: 1px solid #d0d7de;
  border-radius: 8px; background: #f6f8fa; color: #444; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.nav-klappe:hover { background: #eaeef2; }
.nav-klappe-auf { display: none; }
.learning-layout.nav-zu { grid-template-columns: 56px 1fr; gap: 1rem; }
.nav-zu .section-nav { padding: .7rem .5rem; overflow: visible; }
.nav-zu .section-nav > :not(.section-nav-header), .nav-zu .section-nav-header h3 { display: none; }
.nav-zu .nav-klappe { margin: 0; }
.nav-zu .nav-klappe-zu { display: none; }
.nav-zu .nav-klappe-auf { display: inline; }
@media (max-width: 768px) {
  .learning-layout.nav-zu { grid-template-columns: 1fr; }
  .nav-zu .section-nav { position: static; }
  .nav-zu .section-nav-header h3 { display: block; margin: .55rem 0 0; }
  .nav-klappe-zu { display: inline-block; transform: rotate(90deg); }
}
.section-nav ul { list-style: none; }
.section-nav li a {
  display: block; padding: .5rem .75rem; border-radius: 6px;
  color: #333; font-size: .9rem; margin-bottom: .2rem;
}
.section-nav li.active a { background: #4a90d9; color: #fff; font-weight: 600; }
.section-nav li a:hover:not(.active a) { background: #f0f0f0; text-decoration: none; }
.back-link { display: block; margin-top: 1rem; font-size: .85rem; color: #666; }
.section-nav li.kapitel-gesperrt span { display: block; padding: .5rem .75rem; color: #9aa3ad; font-size: .9rem; }
.kapitel-ok { color: #28a745; font-weight: 700; }
.section-nav li.active .kapitel-ok { color: #fff; }

/* Schrittweise Kapitel (wie die Hefte der Lernwelten) */
.schritt-band { display: flex; gap: 3px; margin-bottom: .3rem; }
.schritt-band span { flex: 1; height: 6px; border-radius: 2px; background: #e3e8ef; }
.schritt-band span.ist-ok { background: #28a745; }
.schritt-band span.ist-uebersprungen { background: #f0ad4e; }
.schritt-band span.ist-jetzt { background: #4a90d9; }
.schritt-zaehler { font-size: .85rem; color: #666; margin-bottom: 1rem; }
.zusatz-zaehler { color: #999; }
.content-block.ist-jetzt { box-shadow: 0 0 0 2px #4a90d9, 0 2px 8px rgba(0,0,0,.06); position: relative; }
.jetzt-marke {
  position: absolute; top: -.7rem; right: 1rem; background: #4a90d9; color: #fff;
  font-size: .75rem; font-weight: 700; padding: .1rem .6rem; border-radius: 10px;
}
#jetzt { scroll-margin-top: 90px; }
.schritt-leiste { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .75rem; }
.status-badge.uebersprungen { background: #fff3cd; color: #664d03; }
.schritt-verdeckt { text-align: center; color: #777; font-style: italic; margin: 1rem 0 2rem; }
.kapitel-fertig { border-left: 4px solid #28a745; }
.kapitel-fertig h3 { margin-bottom: .5rem; }
.kapitel-fertig-knoepfe { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .75rem; }
@media (max-width: 600px) { .kapitel-fertig-knoepfe .btn { flex: 1 1 100%; text-align: center; } }

/* Kapitel und Uebungen auf getrennten Seiten (buch_teile.py) */
.section-nav .kapitel-teile { margin: .1rem 0 .4rem 1rem; padding-left: .5rem; border-left: 2px solid #d6e4f5; }
.section-nav li.active .kapitel-teile a { background: none; color: #333; font-weight: 400; padding: .4rem .6rem; }
.section-nav li.active .kapitel-teile li.active a { background: #e8f1fb; color: #1f4f86; font-weight: 600; }
.section-nav .kapitel-teile span { display: block; padding: .4rem .6rem; color: #9aa3ad; font-size: .9rem; }
.kapitel-teil-stand { float: right; color: #718096; font-size: .8rem; }
.section-nav .nav-zwischentitel { margin: .9rem 0 .3rem; padding: .3rem .75rem 0; border-top: 1px solid #e2e8f0;
  font-size: .8rem; font-weight: 700; color: #92400e; }
.zurueck-zum-kapitel { display: inline-block; margin-bottom: .3rem; font-size: .9rem; color: #4a5568; }
.uebung-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem;
  color: #4a5568; margin-bottom: .5rem; }
.uebung-kopf p { margin: 0; }
.uebung-stand { font-weight: 600; color: #276749; }
.uebung-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.5rem; }
.uebung-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  padding: 0 .7rem; border: 1px solid #cbd5e0; border-radius: 22px; background: #fff; color: #2d3748; font-weight: 600; }
.uebung-chip:hover { background: #f0f4f8; text-decoration: none; }
.uebung-chip.ist-fertig { border-color: #9ae6b4; background: #f0fff4; color: #276749; }
.uebungen-angebot { border-left: 4px solid #fcd34d; background: #fffbeb; }
.uebungen-angebot h3 { margin-bottom: .3rem; }
.btn.disabled { opacity: .6; pointer-events: none; }
/* Konfetti aus ventures_kern/oop-konfetti.js (dort steht die Regel in ventures.css) */
.ov-konfetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* Section Content */
.section-content { background: transparent; }
.section-title { font-size: 1.7rem; margin-bottom: 1.5rem; color: #1a1a2e; }

/* Content Blocks */
.content-block {
  background: #fff; border-radius: 10px; padding: 1.5rem;
  margin-bottom: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.block-info { border-left: 4px solid #4a90d9; }
.block-multiple_choice { border-left: 4px solid #28a745; }
.block-free_text { border-left: 4px solid #fd7e14; }
.block-fill_blank { border-left: 4px solid #6f42c1; }
.block-drag_words { border-left: 4px solid #e05c5c; }
.block-python_editor { border-left: 4px solid #334155; }
.block-section-feedback { border-left: 4px solid #64748b; }
.feedback-anonym { display: flex; align-items: center; gap: .45rem; font-size: .9rem; margin: .4rem 0 0; }

.info-content h3, .info-content h4 { margin: .75rem 0 .4rem; }
.info-content p, .info-content li { margin-bottom: .5rem; }
.info-content ul, .info-content ol { padding-left: 1.5rem; margin-bottom: .75rem; }
.info-content pre { white-space: pre-wrap; }
.info-content code { background: #f4f4f4; padding: .1em .3em; border-radius: 3px; }
.info-content figure { margin: 1rem 0; }
.info-content figcaption { font-size: .85rem; color: #666; margin-top: .3rem; }
/* Tabellen in Infotexten: Linien immer, nicht erst wenn sql.css/turing.css geladen sind (Schrittmodus liefert spaetere Bloecke nicht aus) */
.info-content .material-table { border-collapse: collapse; margin: .8rem 0; font-size: .92rem; }
.info-content .material-table th, .info-content .material-table td { border: 1px solid #cbd5dd; padding: .25rem .6rem; text-align: left; }
.info-content .material-table th { background: #f4f7f8; }

/* Exercise */
.exercise-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.exercise-badge {
  background: #f0f0f0; padding: .2rem .6rem; border-radius: 12px;
  font-size: .8rem; font-weight: 600; color: #555;
}
.status-badge {
  padding: .2rem .6rem; border-radius: 12px; font-size: .8rem; font-weight: 600;
}
.status-badge.correct  { background: #d4edda; color: #155724; }
.status-badge.incorrect { background: #f8d7da; color: #721c24; }
.status-badge.saved    { background: #d1ecf1; color: #0c5460; }

.exercise-question { font-weight: 600; margin-bottom: 1rem; font-size: 1rem; }

/* Multiple Choice */
.mc-options { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.mc-option {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem 1rem; border-radius: 6px; border: 1.5px solid #dee2e6;
  cursor: pointer; transition: background .15s;
}
.mc-option:hover { background: #f0f7ff; border-color: #4a90d9; }
.mc-option input { cursor: pointer; }
.selected-correct  { background: #d4edda !important; border-color: #28a745 !important; }
.selected-incorrect { background: #f8d7da !important; border-color: #dc3545 !important; }

/* Block Actions */
.block-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

/* Hint */
.hint-box { margin-top: .75rem; }
.hint-item {
  background: #fffde7; border: 1px solid #ffe082; border-radius: 6px;
  padding: .6rem .9rem; margin-bottom: .4rem; font-size: .9rem;
}

/* Feedback */
.feedback {
  padding: .6rem .9rem; border-radius: 6px; margin-top: .5rem; font-size: .9rem;
}
.feedback.correct   { background: #d4edda; color: #155724; }
.feedback.incorrect { background: #f8d7da; color: #721c24; }
.feedback.saved     { background: #d1ecf1; color: #0c5460; }
.feedback.raten     { background: #fff3cd; color: #664d03; }
.feedback-dashboard-header { margin-top: 2rem; }
.feedback-dashboard-list { display: grid; gap: 1rem; }
.feedback-dashboard-card { margin-bottom: 0; }
.feedback-card-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: .75rem; }
.feedback-card-head p { color: #666; font-size: .9rem; }
.feedback-card-aktionen { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.feedback-card-aktionen form, .feedback-eintrag-aktionen { display: inline-flex; gap: .4rem; margin: 0; }
.feedback-filter { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-end; margin: 0 0 .9rem; }
.feedback-filter label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: #555; }
.feedback-filter select, .feedback-filter input { padding: .35rem .5rem; border: 1.5px solid #d8dee6; border-radius: 6px; font: inherit; font-size: .9rem; max-width: 16rem; }
.feedback-status { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.feedback-status a { padding: .3rem .8rem; border-radius: 999px; border: 1.5px solid #d8dee6; text-decoration: none; color: #334155; font-size: .9rem; }
.feedback-status a.aktiv { background: #1e40af; border-color: #1e40af; color: #fff; }
.feedback-eintraege { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.feedback-eintraege li { border: 1.5px solid #e2e8f0; border-radius: 6px; padding: .6rem .8rem; background: #fff; }
.feedback-eintraege li.archiviert { background: #f8fafc; color: #64748b; }
.feedback-eintrag-kopf { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; font-size: .9rem; }
.feedback-eintrag-kopf span { color: #64748b; }
.feedback-eintrag-aktionen { margin-left: auto; }
.feedback-archiv-badge { background: #e2e8f0; border-radius: 999px; padding: .05rem .5rem; font-size: .8rem; }
.feedback-text { margin: .4rem 0 0; white-space: pre-wrap; }
.feedback-copy-field {
  width: 100%; min-height: 150px; padding: .75rem; border: 1.5px solid #d8dee6;
  border-radius: 6px; resize: vertical; font: 14px/1.5 Consolas, 'Cascadia Code', 'Courier New', monospace;
  background: #f8fafc; color: #1a1a2e;
}

/* Free Text */
.free-text-area {
  width: 100%; padding: .6rem .85rem; border: 1.5px solid #dee2e6;
  border-radius: 6px; font-size: .95rem; resize: vertical;
  font-family: inherit; margin-bottom: .5rem;
}
.free-text-area:focus { border-color: #4a90d9; outline: none; }

/* Python Editor: ventures_kern/static/css/editor.css (base.html bindet sie ein) */

/* Spielwelt neben dem Editor */
.python-world-intro { margin: -.2rem 0 .8rem; color: #334155; }
.python-world-intro pre, .info-content pre.code-example { background: #0f172a; color: #e2e8f0; padding: .7rem .9rem;
  border-radius: 8px; overflow-x: auto; font: 14px/1.5 Consolas, 'Cascadia Code', 'Courier New', monospace; }
.python-world-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.python-world-layout .python-code-shell, .python-world-layout .python-code-input { min-height: 300px; }
/* minmax(0, …): Sonst drückt die Pixelbreite des Canvas die Spalte auf. */
.python-world { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; position: sticky; top: .5rem; min-width: 0; }
.python-world-canvas { display: block; width: 100%; max-width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; }
.python-world-controls { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.python-world-counter { font-size: .85rem; color: #64748b; }
.python-world-status { margin: 0; padding: .55rem .75rem; border-radius: 6px; background: #f1f5f9; color: #334155;
  min-height: 2.6rem; font-size: .95rem; }
.python-world-status.is-success { background: #eaf6ee; color: #1c6b33; font-weight: 600; }
.python-world-status.is-success::before { content: "✅ "; }
.python-world-status.is-problem { background: #fff6e0; color: #7a4d0b; }
.python-world-notes { margin: 0; padding: .4rem .75rem .4rem 1.8rem; background: #fff6e0; border-radius: 6px;
  color: #7a4d0b; font-size: .9rem; }
.python-world-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0; font-size: .85rem; color: #475569; }
.python-world-legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; margin-right: .35rem;
  vertical-align: -1px; }
@media (max-width: 900px) {
  .python-world-layout { grid-template-columns: 1fr; }
  .python-world { position: static; }
}

/* Fill Blank */
.fill-blank-container { margin-bottom: 1rem; line-height: 2.2; }
.blank-input {
  display: inline-block; border: none; border-bottom: 2px solid #4a90d9;
  background: #f0f7ff; padding: .2rem .5rem; width: 120px;
  text-align: center; font-size: .95rem; border-radius: 4px 4px 0 0;
}
.blank-input:focus { outline: none; background: #e0eeff; }

/* Drag Words */
.drag-container { margin-bottom: 1rem; }
.drag-text { line-height: 2.5; margin-bottom: 1rem; }
.drag-slot {
  display: inline-block; min-width: 100px; padding: .25rem .5rem;
  border: 2px dashed #4a90d9; border-radius: 6px; background: #f0f7ff;
  text-align: center; cursor: pointer; margin: 0 .3rem;
}
.drag-slot[data-current] { background: #d0e8f8; border-style: solid; }
.drag-words-bank { display: flex; flex-wrap: wrap; gap: .5rem; }
.drag-word {
  background: #4a90d9; color: #fff; padding: .3rem .8rem;
  border-radius: 20px; cursor: grab; font-size: .9rem; user-select: none;
}
.drag-word:hover { background: #3578c7; }
.drag-word.angetippt { box-shadow: 0 0 0 3px #1a1a2e; }

/* Tablets (iPad): Eingaben ab 16 px, sonst zoomt Safari beim Antippen; kein Doppeltipp-Zoom auf Knoepfen */
@media (pointer: coarse) {
  input, select, textarea, .blank-input { font-size: max(16px, 1em); }
  button, .btn, .drag-word, .drag-slot, [role="button"] { touch-action: manipulation; }
}

/* Section Nav Footer */
.section-nav-footer {
  display: flex; justify-content: space-between; margin-top: 2rem;
  flex-wrap: wrap; gap: .75rem;
}

/* Student Progress */
.section-progress { margin-bottom: 1.2rem; }
.section-progress h4 { color: #555; font-size: .95rem; margin: .5rem 0 .4rem; border-left: 3px solid #4a90d9; padding-left: .5rem; }
.block-progress {
  display: flex; align-items: flex-start; gap: .75rem; flex-wrap: wrap;
  padding: .4rem; border-bottom: 1px solid #f0f0f0; font-size: .85rem;
}
.block-type-badge {
  background: #e9ecef; padding: .1rem .4rem; border-radius: 4px;
  font-size: .75rem; white-space: nowrap;
}
.block-content-short { color: #555; flex: 1; }
.answer-status { font-weight: 600; }
.answer-status.correct   { color: #28a745; }
.answer-status.incorrect { color: #dc3545; }
.answer-status.neutral   { color: #6c757d; }
.answer-status.unanswered { color: #aaa; }
.attempt-info { color: #6c757d; font-size: .85rem; white-space: nowrap; }
.guess-badge { background: #fff3cd; color: #664d03; border-radius: 4px; padding: .05rem .4rem; font-size: .8rem; font-weight: 600; white-space: nowrap; }

/* ===================== Footer ===================== */
.footer { text-align: center; padding: 2rem; color: #999; font-size: .85rem; margin-top: 2rem; }
.footer a { color: inherit; }

/* Impressum und Datenschutz */
.rechtstext { max-width: 760px; margin: 0 auto; line-height: 1.6; }
.rechtstext h1 { margin-bottom: 1rem; }
.rechtstext h2 { font-size: 1.15rem; margin: 1.6rem 0 .4rem; }
.rechtstext p, .rechtstext ul { margin-bottom: .7rem; }
.rechtstext ul { padding-left: 1.4rem; }
.rechtstext-stand { color: #777; font-size: .9rem; margin-top: 1.5rem; }

/* ---------- Einladungen fuer Lehrkraefte ---------- */
.form-inline { display: flex; align-items: flex-end; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.form-inline .form-group { flex: 1; min-width: 260px; margin: 0; }
.einladungs-link { width: 100%; min-width: 280px; font: .85rem/1.4 Consolas, 'Cascadia Code', monospace; }
.data-table tr.ist-neu { background: #e8f5e9; }
.data-table form { margin: 0; }
.log-ausgabe {
  margin: 0 0 1rem; padding: .7rem .9rem; background: #0f172a; color: #dbeafe; border-radius: 8px;
  max-height: 260px; overflow: auto; white-space: pre-wrap;
  font: .82rem/1.5 Consolas, 'Cascadia Code', 'Courier New', monospace;
}

/* Lehreransicht: Fortschritt im Buch (schrittweise Kapitel) */
.buchstand-tabelle td, .buchstand-tabelle th { text-align: center; white-space: nowrap; }
.buchstand-tabelle td:first-child, .buchstand-tabelle th:first-child { text-align: left; }
.buchstand-tabelle td.buch-fertig { background: #e7f6ea; color: #155724; font-weight: 600; }
.buchstand-tabelle td.buch-begonnen { background: #eef5fc; }
.buch-skip { margin-left: .25rem; font-size: .8rem; color: #8a6d00; }
/* .btn setzt display und wuerde das hidden-Attribut sonst aufheben */
.schritt-leiste [hidden] { display: none !important; }

/* Pflicht/Zusatz, Ansichtswahl und Musterloesungen (Fortbildungsgruppen, freigegebene Themen) */
.zusatz-badge { display: inline-block; font-size: .7em; font-weight: 600; vertical-align: middle; padding: .1em .5em;
  border-radius: 999px; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.zusatz-trenner { margin: 2.5rem 0 1rem; padding: 1rem 1.25rem; border-top: 3px dashed #fcd34d; background: #fffbeb; border-radius: 8px; }
.zusatz-trenner h2 { margin: 0 0 .25rem; font-size: 1.25rem; color: #92400e; }
.zusatz-trenner p { margin: 0; color: #78350f; }
.ansicht-wahl { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 1.25rem; }
.arbeitsblatt-download, .meine-antworten-download { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.25rem; }
.ansicht-hinweis { color: #475569; font-size: .9rem; margin-left: .25rem; }
/* Fassung Gymnasium/GemS (fassung.py): Umschalter fuer Fortbildung/Vorschau, Marke an der Klasse */
.fassung-label { font-weight: 600; color: #475569; }
.schulform-marke { display: inline-block; font-size: .75rem; font-weight: 600; vertical-align: middle; padding: .1em .5em;
  border-radius: 999px; background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }
.content-block.ist-zusatz { border-left: 4px solid #fcd34d; }
.solution-bar { margin-top: .75rem; }
.solution-bar .aufgabe-link { margin-left: .25rem; }
.solution-bar .aufgabe-link:first-child { margin-left: 0; }
.content-block[id^="block-"] { scroll-margin-top: 90px; }
.content-block.link-ziel { box-shadow: 0 0 0 3px #f59e0b, 0 2px 8px rgba(0,0,0,.06); transition: box-shadow .4s; }
.link-hinweis { background: #fff3cd; color: #664d03; border-radius: 8px; padding: .6rem 1rem; margin: 0 0 1rem; scroll-margin-top: 90px; }
.btn-solution { background: #f1f5f9; border: 1px solid #94a3b8; color: #1e293b; }
.btn-solution:hover { background: #e2e8f0; }
.solution-box { margin-top: .5rem; padding: .75rem 1rem; border: 1px solid #86efac; background: #f0fdf4; border-radius: 8px; }
.solution-title { font-weight: 700; color: #166534; margin-bottom: .4rem; }
.solution-figure svg { width: 100%; max-width: 560px; height: auto; }
.solution-words { margin: 0; padding-left: 1.5rem; }
.solution-code { background: #0f172a; color: #e2e8f0; padding: .6rem .8rem; border-radius: 6px; overflow-x: auto; }
.solution-fields { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
.solution-fields dt { font-weight: 600; }
.solution-fields dd { margin: 0; }
.solution-text { margin: .4rem 0 0; white-space: pre-line; }

/* Graphen als SVG (graph_svg.py) */
.gsvg { width: 100%; height: auto; max-height: 420px; }
.gsvg .gsvg-kante { transition: stroke .15s, stroke-width .15s; }
.gsvg .gsvg-kreis { transition: fill .15s, stroke .15s; }
.gsvg .gsvg-kante.hervor { stroke: #dc2626; stroke-width: 5; }
.gsvg .gsvg-knoten-g.hervor .gsvg-kreis { fill: #fecaca; stroke: #dc2626; stroke-width: 3; }
.solution-seen { display: inline-block; font-size: .8rem; padding: .1em .5em; border-radius: 999px; background: #eef2ff; color: #3730a3; margin-left: .4rem; }

/* Abbildungen der Graphentheorie (graph_kapitel.py) */
.graph-figures { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-end; margin: .75rem 0; }
.graph-figure { margin: .5rem 0; flex: 1 1 220px; min-width: 0; }
.graph-figure img { display: block; width: 100%; height: auto; border-radius: 8px; }
.graph-figure figcaption { font-size: .9rem; color: #475569; text-align: center; margin-top: .25rem; }
.graph-figure.suchbaum svg { max-height: 520px; }
/* Suchbaum mit dem Ausgangsgraphen daneben, damit beides ohne Scrollen zu sehen ist */
.graph-figures.vergleich { align-items: center; }
.graph-figures.vergleich .graph-figure { flex: 1 1 320px; }

/* Eingeloggte Startseite: je Klassenstufe ein Banner, darunter die Themenfeld-Kacheln (lehrplan.ansicht) */
.stufen-banner-liste { display: grid; gap: 1rem; margin: 1rem 0 2.5rem; }
.stufen-gruppe > .feld-kacheln { margin: 1rem 0 .5rem; }
.stufen-banner {
  position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 1rem;
  min-height: 120px; padding: 1.2rem 1.5rem; border-radius: 14px; color: #fff; cursor: pointer; list-style: none;
  background: linear-gradient(135deg, #1b1f24 0%, #1e3348 60%, #135e66 100%);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .18); transition: transform .15s ease, box-shadow .15s ease;
}
.stufen-banner::-webkit-details-marker { display: none; }
.stufen-banner::after { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--motive); opacity: .2; }
.stufen-banner:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, .28); }
.stufen-banner:focus-visible { outline: 3px solid #4fe0dc; outline-offset: 3px; }
.stufen-banner-text { display: flex; flex-direction: column; gap: .2rem; flex: 1 1 auto; min-width: 0; }
.stufen-banner .stufen-kachel-zahl { margin-top: 0; align-self: center; }
.stufen-banner-marke { align-self: flex-start; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: #4fe0dc; color: #1b1f24; border-radius: 999px; padding: .1rem .6rem; }
.stufen-banner-pfeil { font-size: 1.6rem; transition: transform .15s ease; }
.stufen-gruppe[open] .stufen-banner-pfeil { transform: rotate(180deg); }
@media (max-width: 600px) {
  .stufen-banner { flex-wrap: wrap; }
  .stufen-banner .stufen-kachel-zahl { align-self: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .stufen-banner { transition: none; } .stufen-banner:hover { transform: none; } }
.form-group[hidden] { display: none !important; }

/* Videos mit Zustimmung (YouTube erst nach Klick, youtube-nocookie.com) */
.video-zustimmung { position: relative; aspect-ratio: 16 / 9; max-width: 720px; margin: 1rem 0; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #1b1f24, #1e3348); color: #fff; }
.video-zustimmung iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-hinweis { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: .6rem; padding: 1.5rem; }
.video-hinweis strong { font-size: 1.2rem; }
.video-hinweis p { margin: 0; color: #d6dee6; font-size: .95rem; }
.video-merken { font-size: .9rem; color: #d6dee6; display: flex; gap: .4rem; align-items: center; font-weight: normal; }
.video-merken input { width: auto; }
.video-hinweis .btn { align-self: flex-start; }
.video-unten { font-size: .85rem; color: #64748b; margin-top: -.5rem; }
.video-unten button { background: none; border: 0; color: #2563eb; cursor: pointer; padding: 0; font-size: inherit; text-decoration: underline; }

/* Lehrkraft sieht das Buch eines Schuelers (teacher.student_book): nur lesend */
.schueler-ansicht-band { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; background: #fff7e0; border: 1px solid #e6c36a; border-radius: 8px; padding: .5rem .8rem; margin: 0 0 1rem; font-size: .92rem; }
.schueler-ansicht-feld { border: 0; margin: 0; padding: 0; min-width: 0; }
.schueler-ansicht-info { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; font-size: .85rem; }

/* Geplante Unterrichtsstunde im Buch (buch_stunden.py) */
.stunde-banner { margin: .8rem 0 1rem; padding: .8rem 1rem; border-radius: 10px; border: 3px solid #2b6cb0; background: #ebf4ff; }
.stunde-banner.ist-laufend { box-shadow: 0 0 0 4px rgba(43,108,176,.2); }
.stunde-banner b { display: block; font-size: 1.1rem; color: #1a4e85; }
.stunde-banner ul { margin: .4rem 0 0; padding-left: 0; list-style: none; display: grid; gap: .2rem; }
.stunde-banner li.ist-fertig, .stunde-banner li.ist-fertig a { color: #2f855a; text-decoration: line-through; }
.stunde-planen select, .stunde-planen input[type=date] { margin: .2rem .3rem .2rem 0; }
.stunde-planen .stunde-liste li.ist-laufend { font-weight: 600; }

/* ===================== Einstellungen der Lehrkraft ===================== */
.einstellungen { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 1.25rem;
  align-items: start; }
.einstellungen-karte { background: #fff; border: 1px solid #dee2e6; border-radius: 10px; padding: 1.25rem 1.4rem; min-width: 0; }
.einstellungen-karte h2 { font-size: 1.2rem; margin-bottom: .75rem; }
.einstellungen-karte p { margin-bottom: .75rem; overflow-wrap: anywhere; }
.einstellungen-nebenform { margin-top: .75rem; }
.einstellungen-gefahr { border: 2px solid #c62828; background: #fff6f6; }
.einstellungen-gefahr h2 { color: #b42318; }
.einstellungen-sperre { color: #721c24; background: #f8d7da; border-radius: 6px; padding: .6rem .8rem; }

/* ===================== Klassenseite: Reiter ===================== */
.klassen-tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 2px solid #dee2e6; margin: 0 0 1.5rem; }
.klassen-tabs a { padding: .6rem 1rem; border-radius: 8px 8px 0 0; color: #444; font-weight: 600; margin-bottom: -2px;
  border: 2px solid transparent; text-decoration: none; }
.klassen-tabs a:hover { background: #eef3fa; text-decoration: none; }
.klassen-tabs a.active { background: #fff; color: #1a1a2e; border-color: #dee2e6 #dee2e6 #fff; }
.klassen-tab[hidden] { display: none; }
@media (max-width: 600px) { .klassen-tabs a { flex: 1 1 45%; text-align: center; padding: .55rem .5rem; } }

/* ===================== Stundenplan der Lehrkraft ===================== */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stundenplan { border-collapse: collapse; width: 100%; min-width: 520px; background: #fff; table-layout: fixed; }
.stundenplan th, .stundenplan td { border: 1px solid #e3e7eb; padding: .3rem .4rem; vertical-align: top; }
.stundenplan thead th { background: #f1f4f7; font-size: .9rem; }
.stundenplan tbody th { width: 6.5rem; text-align: left; font-size: .9rem; background: #f8f9fa; }
.stundenplan tbody th small { display: block; font-weight: 400; color: #777; font-size: .75rem; }
.stundenplan td { height: 2.4rem; }
.stundenplan-klasse { display: block; background: var(--klasse); color: #fff; border-radius: 5px; padding: .2rem .45rem;
  font-size: .85rem; font-weight: 600; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stundenplan-klasse:hover { color: #fff; filter: brightness(.92); text-decoration: none; }
.stundenplan-folge { opacity: .75; }
.mini-stundenplan { display: flex; gap: 2px; margin: .5rem 0 .75rem; }
.mini-stundenplan-tag { display: flex; flex-direction: column; gap: 2px; width: 26px; }
.mini-stundenplan-name { font-size: .6rem; color: #666; text-align: center; line-height: 1; margin-bottom: 1px; }
.mini-stundenplan-zelle { display: block; height: 7px; background: #eef0f2; border-radius: 1px; }
.mini-andere { background: #c3c9d0; }
.mini-eigen { background: var(--klasse, #4a90d9); }
.db-lerngruppe-wahl { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 .75rem; }
.db-lerngruppe-wahl select { font-size: 1rem; padding: .35rem .5rem; max-width: 100%; }

/* ===================== Klassenseite: Noten (nur Admins) ===================== */
.noten-kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.noten-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.noten-tabs a { padding: .35rem .8rem; border-radius: 999px; background: #e9edf1; color: #333; font-weight: 600; font-size: .9rem; }
.noten-tabs a.active { background: #1a1a2e; color: #fff; }
.noten-tabs a:hover { text-decoration: none; }
[data-tab-panel][hidden] { display: none; }
.noten-tabelle th small, .noten-tabelle td small { display: block; font-weight: 400; color: #777; font-size: .75rem; }
.noten-zahl { text-align: center; white-space: nowrap; }
.noten-6 { font-weight: 400; color: #555; font-size: .8rem; }
/* kompakt: moeglichst ohne Scrollen auf Full-HD und iPad */
.noten-tabelle th, .noten-tabelle td { padding: .2rem .5rem; font-size: .85rem; line-height: 1.25; }
.noten-tabelle th small, .noten-tabelle td small { display: inline; margin-left: .35rem; }
.noten-kopf { margin-bottom: .4rem; }
.noten-kopf h2 { margin: 0; }
.noten-tabs { margin-bottom: .5rem; }
.noten-tabs a { padding: .2rem .65rem; font-size: .85rem; }
.notenspiegel-paar { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: flex-start; }
.notenspiegel-paar .table-scroll { max-width: 100%; }
#noten h3, #noten h4 { margin: .4rem 0 .3rem; }
.noten-tabelle tfoot th, .noten-tabelle tfoot td { background: #eef3fa; font-weight: 600; border-top: 2px solid #cdd3da; }
.notenspiegel { width: auto; }
.notenspiegel th, .notenspiegel td { text-align: center; min-width: 2.4rem; }

/* ===================== Einstellungen: Stundenraster ===================== */
.raster-tabelle { border-collapse: collapse; margin-bottom: .5rem; width: 100%; max-width: 22rem; table-layout: fixed; }
.raster-tabelle th:first-child { width: 4rem; }
.raster-tabelle th { text-align: left; font-size: .85rem; color: #555; padding: .2rem .4rem; }
.raster-tabelle td { padding: .2rem .4rem; }
.raster-tabelle input[type=time] { width: 100%; min-width: 0; box-sizing: border-box; font-size: 1rem; padding: .3rem .4rem; border: 1.5px solid #dee2e6; border-radius: 6px; }
.raster-falsch input[type=time] { border-color: #c62828; background: #fff6f6; }
.raster-meldung { color: #721c24; background: #f8d7da; border-radius: 6px; padding: .5rem .7rem; }
.raster-knoepfe { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .9rem; }

/* ===================== Login-Code verdeckt (Auge) ===================== */
.login-code-verdeckt { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.login-code-verdeckt code { min-width: 4.5em; display: inline-block; }
.login-code-verdeckt code[hidden] { display: none; }
.code-auge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; min-height: 2rem;
  padding: .2rem; border: 1px solid #dee2e6; border-radius: 6px; background: #f8f9fa; color: #444; cursor: pointer;
}
.code-auge:hover, .code-auge:focus-visible { background: #e8f4fd; color: #1a73e8; }
.code-auge .auge-zu, .code-auge[aria-pressed="true"] .auge-offen { display: none; }
.code-auge[aria-pressed="true"] .auge-zu { display: inline; }
.code-eingabe { position: relative; }
.form-group .code-eingabe input { padding-right: 3rem; }
.code-eingabe .code-auge { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: none; background: transparent; }
.login-code-zelle { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.inline-form { display: inline; margin: 0; }

/* ===================== Weihnachtsthema (Dezember oder Lehrkraft-Vorschau, body[data-weihnacht]) =====================
   Nur Farben und Schmuck: tannengruene Kopfzeile mit Schneekante und Lichterkette, Zuckerstangen-Streifen an Karten.
   Mockup: docs/mockups/buch-weihnachten.html. Der Jubel steht in ventures_kern/static/js/oop-konfetti.js. */
body[data-weihnacht] .navbar { background: linear-gradient(#14532d, #166534); padding-bottom: 1.35rem; }
body[data-weihnacht] .brand-dot { color: #fbbf24; }
body[data-weihnacht] .navbar::after {   /* Schneekante */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 10px; pointer-events: none;
  background: radial-gradient(circle at 10px 0, #f7f8fa 7px, transparent 8px) 0 0 / 20px 10px repeat-x;
}
body[data-weihnacht] .navbar::before {  /* Lichterkette */
  content: ""; position: absolute; left: 0; right: 0; bottom: 7px; height: 8px; pointer-events: none;
  background:
    radial-gradient(circle at 10px 4px, #ef4444 3.5px, transparent 4px),
    radial-gradient(circle at 30px 4px, #fbbf24 3.5px, transparent 4px),
    radial-gradient(circle at 50px 4px, #60a5fa 3.5px, transparent 4px),
    radial-gradient(circle at 70px 4px, #34d399 3.5px, transparent 4px);
  background-size: 80px 8px; background-repeat: repeat-x;
  animation: weihnacht-blinken 2.4s ease-in-out infinite;
}
@keyframes weihnacht-blinken { 50% { opacity: .4; } }
body[data-weihnacht] .card, body[data-weihnacht] .topic-card { position: relative; overflow: hidden; }
body[data-weihnacht] .card::before, body[data-weihnacht] .topic-card::before {   /* Zuckerstangen-Streifen */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: repeating-linear-gradient(135deg, #b91c1c 0 10px, #fff 10px 20px);
}
@media (prefers-reduced-motion: reduce) { body[data-weihnacht] .navbar::before { animation: none; } }

/* Nur auf dem Arbeitsblatt (arbeitsblatt.py): z. B. Verweise auf DSimWeb/LogicTraffic statt der Werkzeuge im Buch */
.nur-auf-papier { display: none !important; }

/* Lehrervorschau: Durchtesten / Loesungen eingeblendet, Schritt fuer Schritt nur im Browser (vorschau-schritte.js) */
.vorschau-wahl .btn-link { background: none; border: none; color: #4a5568; text-decoration: underline; padding: .25rem .4rem; }
.vorschau-band { margin: -.5rem 0 1rem; }
.content-block.vorschau-verdeckt, .zusatz-trenner.vorschau-verdeckt { display: none; }
.vorschau-notiz { color: #64748b; font-size: .9rem; }

/* Klassenseite: Kopf mit Stammdaten links und Stundenplan-Karte rechts */
.klassen-kopf { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem 1.5rem; margin-bottom: 1.5rem; }
@media (min-width: 900px) { .klassen-kopf { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.stundenplan-karte { background: #fff; border: 1px solid #e3e8ef; border-radius: 10px; padding: .9rem 1rem; margin: 0; }
.stundenplan-karte h2 { font-size: 1.1rem; margin: 0 0 .25rem; }
.stundenplan-kurz { margin: 0 0 .4rem; font-weight: 600; }
.stunden-bearbeiten > summary { cursor: pointer; color: #2563eb; padding: .25rem 0; }
.stunden-bearbeiten[open] > summary { margin-bottom: .5rem; }

/* Inhaltswaehler (teacher/_inhalte_waehler.html): eine Hauptaktion je Zeile, Status als Balken */
.inhalte-waehler { margin: 1rem 0; }
.waehler-kopf { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.waehler-kopf select { font-size: 16px; width: auto; margin-left: .4rem; }
.waehler-spalten { display: flex; gap: 1rem; color: #4a5568; font-size: .9rem; }
.inhalte-waehler.mit-filter .waehler-stufe-titel { display: none; }
.waehler-stufe-titel { font-size: 1rem; margin: 1rem 0 .4rem; color: #4a5568; }
.waehler-thema { border: 1px solid #e3e8ef; border-radius: 8px; background: #fff; margin-bottom: .5rem; }
.waehler-thema > summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; padding: .6rem .9rem; cursor: pointer; font-weight: 600; }
.waehler-zahlen { font-weight: 400; color: #64748b; font-size: .9rem; }
.waehler-kapitel { list-style: none; margin: 0; padding: 0 .5rem .5rem; }
.waehler-zeile { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto auto; gap: .3rem .75rem; align-items: center; padding: .45rem .4rem; border-top: 1px solid #f1f3f6; }
.waehler-zeile.ist-gesperrt .waehler-titel, .waehler-zeile.ist-gesperrt .waehler-nr { color: #94a3b8; }
.waehler-nr { font-weight: 600; text-align: right; color: #4a5568; }
.waehler-zwischentitel { padding: .6rem .4rem .2rem; border-top: 1px solid #e2e8f0; font-weight: 600; color: #4a5568; }
.waehler-zwischentitel small { font-weight: 400; color: #718096; margin-left: .3rem; }
.waehler-stand { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: #64748b; white-space: nowrap; }
.mini-balken { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: #e3e8ef; overflow: hidden; }
.mini-balken > span { display: block; height: 100%; background: #28a745; }
.waehler-aktionen { display: inline-flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
@media (max-width: 640px) {
  .waehler-zeile { grid-template-columns: 1.6rem minmax(0, 1fr); }
  .waehler-stand, .waehler-aktionen { grid-column: 2; justify-content: flex-start; }
}
/* Umschalt-Chips: Checkbox im Label, per Antippen */
.chip { display: inline-flex; align-items: center; cursor: pointer; margin: 0; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: .3rem .75rem; border: 1px solid #cbd5e1; border-radius: 999px; font-size: .9rem; background: #fff; color: #334155; min-height: 32px; line-height: 1.5; }
.chip input:checked + span { background: #4a90d9; border-color: #4a90d9; color: #fff; }
.chip input:checked + span::before { content: '✓ '; }
.chip input:focus-visible + span { outline: 2px solid #1d4ed8; outline-offset: 2px; }
.chip-zusatz input:checked + span { background: #f0ad4e; border-color: #f0ad4e; color: #1f2937; }
/* ⓘ-Erklaerungen zum Antippen (Popover-API, sonst aufklappend) */
.info-tipp { border: none; background: none; color: #2563eb; cursor: pointer; font-size: 1rem; padding: 0 .2rem; line-height: 1; }
.info-popover { max-width: 22rem; padding: .8rem 1rem; border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); font-size: .95rem; color: #1f2937; background: #fff; }
.info-popover:popover-open { position: fixed; inset: 0; margin: auto; height: fit-content; }
.info-popover p { margin: .35rem 0 0; }
.info-ohne-popover { margin: .4rem 0; }
@media (max-width: 640px) {
  .info-popover:popover-open { position: fixed; inset: auto 0 0 0; margin: 0; max-width: none; border-radius: 14px 14px 0 0; }
}
/* Klebende Leiste unten (Stunde planen) */
.plan-leiste { position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin-top: 1rem; padding: .7rem 1rem; background: #fff; border: 1px solid #cbd5e1; border-radius: 10px 10px 0 0; box-shadow: 0 -4px 12px rgba(0,0,0,.06); }
.plan-leiste-text { flex: 1 1 16rem; }
.plan-leiste-frei { color: #92400e; font-size: .9rem; }
.plan-leiste button { margin-left: auto; }
.stunde-rest label { display: block; margin: .2rem 0; }
.stunde-planungen { margin-top: 1rem; }
.stunde-planungen > summary { cursor: pointer; font-weight: 600; }

/* Besprechungsmodus (besprechung/*.html) */
.bsp-kopf { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; padding: .6rem 1rem; margin: -.5rem 0 1rem; background: #fff; border: 1px solid #cbd5e1; border-radius: 0 0 10px 10px; box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.bsp-titel { font-weight: 700; flex: 1 1 18rem; }
.bsp-dabei { color: #334155; white-space: nowrap; }
.bsp-offen-knopf { border: 1px solid #cbd5e1; background: #fff; border-radius: 999px; padding: .25rem .7rem; cursor: pointer; font-size: .95rem; }
.bsp-offen-ul { list-style: none; padding: 0; margin: .4rem 0 0; }
.bsp-offen-ul li { padding: .2rem 0; }
.bsp-inhalt { max-width: none; }
.bsp-aufgabe { scroll-margin-top: 5rem; }
.bsp-aufgabe.ist-vorne { box-shadow: 0 0 0 3px #4a90d9, 0 2px 8px rgba(0,0,0,.06); }
.bsp-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin: -.25rem 0 .75rem; padding-bottom: .5rem; border-bottom: 1px solid #eef1f5; }
.bsp-nr { font-weight: 700; margin-right: .4rem; }
.bsp-klein { padding: .2rem .5rem; }
.bsp-rueck { display: inline-flex; align-items: center; gap: .4rem; margin-left: auto; }
.bsp-rueck[hidden] { display: none; }
.bsp-badge { display: inline-block; background: #fef3c7; color: #92400e; border-radius: 999px; padding: .1rem .55rem; font-weight: 700; }
.bsp-badge.pulsiert { animation: bsp-puls 1s ease-in-out 3; }
@keyframes bsp-puls { 50% { transform: scale(1.25); background: #fde68a; } }
.bsp-leer .block-actions, .bsp-leer .hint-box, .bsp-leer .feedback-box, .bsp-leer .raten-box { display: none !important; }
.bsp-leer, .schueler-ansicht-feld { border: 0; padding: 0; margin: 0; min-width: 0; }
.bsp-vorne { margin: 0 0 .75rem; }
.bsp-vorne-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .4rem; }
.bsp-vorne-titel { font-weight: 700; }
.bsp-vorne-knoepfe { display: inline-flex; gap: .3rem; }
.bsp-frame { width: 100%; min-height: 120px; border: 1px solid #dbe1ea; border-radius: 8px; background: #fff; }
.bsp-wahl { width: min(22rem, 92vw); }
.bsp-suche { width: 100%; font-size: 16px; padding: .45rem .6rem; border: 1px solid #cbd5e1; border-radius: 6px; }
.bsp-wahl-liste { list-style: none; padding: 0; margin: .5rem 0 0; max-height: 50vh; overflow-y: auto; }
.bsp-schueler { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .45rem .4rem; border-radius: 6px; font-size: 1rem; cursor: pointer; }
.bsp-schueler:hover, .bsp-schueler:focus-visible { background: #eef4fb; }
.bsp-schueler.ist-leer { color: #94a3b8; }
.bsp-schueler.ist-richtig .bsp-punkt { color: #16a34a; }
.bsp-schueler.ist-bearbeitet .bsp-punkt { color: #2563eb; }
.bsp-keiner { color: #64748b; padding: .4rem; }
.bsp-legende { color: #64748b; font-size: .85rem; margin: .4rem 0 0; }
.bsp-toast, .besprechung-notiz { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; display: flex; align-items: center; gap: .6rem; max-width: min(28rem, calc(100vw - 2rem)); padding: .7rem 1rem; background: #1f2937; color: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.bsp-toast[hidden] { display: none; }
.besprechung-notiz-zu { background: none; border: 0; color: #fff; font-size: 1.3rem; cursor: pointer; padding: 0 .2rem; }
.bsp-laeuft-karte { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .7rem 1rem; margin-bottom: 1rem; background: #eef4fb; border: 1px solid #bcd3ee; border-radius: 10px; }
.bsp-laeuft-karte.ist-beendet { background: #f8fafc; border-color: #e3e8ef; }
.bsp-laeuft-karte span { flex: 1 1 14rem; }
.waehler-zuletzt { color: #64748b; font-size: .85rem; white-space: nowrap; }
.inline-form { display: inline; }
/* Schueleransicht: eigene Loesung | vorne gezeigt */
.bsp-ende { position: sticky; top: 3.6rem; z-index: 29; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .6rem 1rem; margin-bottom: 1rem; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 8px; }
.bsp-ende[hidden] { display: none; }
.bsp-pille { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 40; border: 0; border-radius: 999px; padding: .55rem 1.1rem; background: #4a90d9; color: #fff; font-size: 1rem; box-shadow: 0 6px 18px rgba(0,0,0,.2); cursor: pointer; }
.bsp-pille[hidden] { display: none; }
.bsp-frage > span { display: none; align-items: center; gap: .4rem; }
.bsp-frage[data-zustand=""] .bsp-frage-neu, .bsp-frage[data-zustand="offen"] .bsp-frage-offen, .bsp-frage[data-zustand="geklaert"] .bsp-frage-geklaert { display: inline-flex; }
.bsp-frage-geklaert { color: #16a34a; font-weight: 600; }
.bsp-frage .btn-link { background: none; border: 0; color: #2563eb; text-decoration: underline; cursor: pointer; padding: 0; font: inherit; }
.bsp-spalte-titel { margin: 0 0 .4rem; font-size: .95rem; color: #475569; }
.bsp-meine .bsp-spalte-titel { display: none; }
.bsp-unbearbeitet { color: #64748b; font-style: italic; }
.bsp-umschalter { display: none; margin-left: auto; gap: .3rem; }
.bsp-aufgabe.ist-vorne .bsp-meine .bsp-spalte-titel { display: block; }
@media (min-width: 801px) {
  .bsp-aufgabe.ist-vorne .bsp-spalten { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
}
@media (max-width: 800px) {
  .bsp-aufgabe.ist-vorne .bsp-umschalter { display: inline-flex; }
  .bsp-aufgabe.ist-vorne[data-zeige="vorne"] .bsp-meine { display: none; }
  .bsp-aufgabe.ist-vorne[data-zeige="meine"] .bsp-vorne { display: none; }
}
/* Einzelblock-Seite im iframe */
.besprechung-block-seite { background: #fff; margin: 0; padding: .5rem; }
.besprechung-block-seite .content-block { margin: 0; box-shadow: none; border: 0; padding: .25rem; }
.klassenbild-kopf { font-weight: 600; margin: 0 0 .6rem; }
.klassenbild-balken, .klassenbild-luecken { list-style: none; padding: 0; margin: 0; }
.klassenbild-balken li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(4rem, 40%) 2.5rem; gap: .6rem; align-items: center; padding: .3rem 0; }
.kb-balken { display: block; height: 14px; background: #eef0f2; border-radius: 4px; overflow: hidden; }
.kb-balken > span { display: block; height: 100%; background: #4a90d9; }
.kb-zahl { text-align: right; font-weight: 600; }
.klassenbild-luecken li { padding: .3rem 0; }
.kb-haeufig { color: #475569; }
/* Bericht */
.bericht-karte { background: #fff; border: 1px solid #e3e8ef; border-radius: 10px; padding: .8rem 1rem; margin-bottom: .75rem; }
.bericht-karte h2 { font-size: 1.1rem; margin: 0 0 .3rem; }
.bericht-karte p { margin: .25rem 0; }
.bericht-frage { color: #475569; }
.bericht-ohne { color: #166534; }
.bericht-aktionen { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
/* Dashboard: Klasse gerade im Unterricht */
.card.ist-im-unterricht { box-shadow: 0 0 0 2px #4a90d9, 0 2px 8px rgba(0,0,0,.06); }
.jetzt-unterricht { display: inline-block; font-size: .75rem; font-weight: 600; color: #1d4ed8; background: #e0ecfb; border-radius: 999px; padding: .1rem .5rem; vertical-align: middle; }
.stundenplan td.ist-jetzt { background: #e0ecfb; }
.schnellstart-liste { list-style: none; padding: 0; margin: .4rem 0 0; }
.schnellstart-liste li { padding: .3rem 0; }
.schnellstart-liste .btn-link { background: none; border: 0; color: #2563eb; cursor: pointer; padding: 0; font: inherit; text-align: left; }
.bsp-meine, .bsp-vorne { min-width: 0; overflow-x: auto; }
.bsp-meine .block-actions, .bsp-meine .hint-box, .besprechung-block-seite .block-actions, .besprechung-block-seite .hint-box { display: none !important; }
/* Besprechung: die eigene Kopfleiste klebt oben statt der Navigation */
body.besprechung-seite .navbar { position: static; }
.bsp-vorne-knoepfe [hidden], .bsp-leiste [hidden] { display: none !important; }
/* Themenvorschau: Reihenfolge der Kacheln anpassen (kachel-reihenfolge.js) */
.kacheln-anpassen-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.kacheln-anpassen-hilfe { font-size: .9rem; color: #475569; }
.kacheln-status { margin-left: .5rem; font-weight: 600; }
.kachel-pfeile { display: none; }
.kacheln-anpassen .feld-kacheln[data-stufe] .feld-kachel { cursor: grab; touch-action: none; user-select: none; outline: 2px dashed rgba(255, 255, 255, .7); outline-offset: -6px; }
.kacheln-anpassen .feld-kacheln[data-stufe] .feld-kachel.ist-gezogen { cursor: grabbing; opacity: .75; transform: scale(1.03); box-shadow: 0 12px 28px rgba(15, 23, 42, .35); }
.kacheln-anpassen .kachel-pfeile { display: flex; gap: .4rem; margin-top: auto; }
.kachel-pfeile button { min-width: 44px; min-height: 40px; font-size: 1.1rem; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .9); color: #1e293b; cursor: pointer; }

/* Themenuebersicht (buch_uebersicht.py, student/thema.html) */
.buch-fokus { margin: 1rem 0 1.5rem; padding: 1rem 1.25rem; border: 2px solid #4a90d9; border-radius: 10px; background: #f0f6fd; }
.buch-fokus.ist-fertig { border-color: #9ae6b4; background: #f0fff4; }
.buch-fokus-titel { display: block; font-size: .85rem; font-weight: 700; color: #2b6cb0; margin-bottom: .4rem; }
.buch-fokus.ist-fertig .buch-fokus-titel { color: #276749; }
.buch-fokus-inhalt { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 1.25rem; }
.buch-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.buch-karte { display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.1rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.buch-karte.ist-aktuell { border-color: #4a90d9; }
.buch-karte.ist-erledigt { border-color: #9ae6b4; }
.buch-karte.ist-gesperrt { background: #f7f8fa; color: #94a3b8; }
.buch-karte h3 { margin: 0; font-size: 1.05rem; }
.buch-karte-kopf { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; }
.buch-karte-nr { font-weight: 700; color: #4a5568; }
.buch-karte-status { color: #2b6cb0; font-weight: 600; }
.buch-karte-status.ist-fertig { color: #276749; }
.buch-karte-sperre { margin: 0; font-size: .9rem; }
.buch-karte-fortschritt { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: #4a5568; }
.buch-leiste { flex: 0 0 8rem; height: 8px; border-radius: 4px; background: #e3e8ef; overflow: hidden; }
.buch-leiste i { display: block; height: 100%; background: #28a745; }
.buch-karte-aktionen { display: flex; flex-direction: column; gap: .5rem; margin-top: auto; }
.buch-kapitel-knopf { text-align: center; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.buch-modul-knopf { position: relative; display: flex; justify-content: space-between; align-items: center; gap: .5rem; min-height: 44px; padding: 0 .9rem;
  border: 1px solid #fcd34d; border-radius: 6px; color: #744210; font-weight: 600;
  background: linear-gradient(90deg, #fef3c7 var(--stand, 0%), #fffbeb var(--stand, 0%)); }
.buch-modul-knopf:hover { text-decoration: none; border-color: #f6ad55; }
.buch-modul-knopf.ist-fertig { border-color: #9ae6b4; background: #f0fff4; color: #276749; }
.buch-modul-knopf.ist-gesperrt { border-color: #e2e8f0; background: #f7f8fa; color: #94a3b8; font-weight: 400; }
.buch-zusatz-titel { margin: 1.5rem 0 .1rem; color: #92400e; }
.nav-uebersicht { display: block; margin: 0 0 .6rem; padding: .4rem .75rem; font-size: .85rem; color: #4a5568; }
.kapitel-fertig-uebersicht { margin: .6rem 0 0; font-size: .9rem; }

/* Merkkasten-Verweise (merke.py, merke-verweis.js) */
.merke-verweis { display: inline-flex; align-items: center; min-height: 32px; margin: 0 .15rem; padding: .1rem .6rem; border: 1px solid #90cdf4;
  border-radius: 16px; background: #ebf8ff; color: #2c5282; font: inherit; font-size: .9em; font-weight: 600; cursor: pointer; }
.merke-verweis:hover { background: #bee3f8; }
.merke-dialog { position: fixed; inset: 0; margin: auto; width: min(36rem, calc(100vw - 2rem)); max-height: 80vh; padding: 0; border: none; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.3); overflow: hidden; }
.merke-dialog[open] { display: flex; flex-direction: column; }
.merke-dialog::backdrop { background: rgba(0,0,0,.4); }
.merke-kopf { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem 1rem; background: #ebf8ff; border-bottom: 1px solid #bee3f8; }
.merke-zu { min-width: 44px; min-height: 44px; border: none; background: none; font-size: 1.2rem; cursor: pointer; }
.merke-inhalt { padding: 1rem; overflow-y: auto; }
.merke-inhalt .callout { margin: 0; }
.merke-fuss { margin: 0; padding: .6rem 1rem; text-align: right; border-top: 1px solid #e2e8f0; }
