/* ============================================================
   Crashkurs — geführte Einführung mit Lexi
   Eigene Datei statt style.css: style.css wird ohne ?v= ausgeliefert
   und hinge damit am Browser-Cache.

   Zwei Bühnen:
   1. .ck-stage  — Figur + Sprechblase WÄHREND der Tour. Liegt im
      #nodesLayer in Layout-Koordinaten (wie .schema-quiz-popup) und
      klebt dadurch beim Zoomen/Verschieben am Knoten.
   2. .ck-ask    — die Einstiegsfrage, fixiert unten rechts.
   ============================================================ */

/* ---------- Menüpunkt "Crashkurs" im Optionen-Menü ----------
   Gleiche Ein-/Ausklapp-Mechanik wie die übrigen Einträge (Keyframes in
   style.css, Abschnitt .bottom-right-dock). Sitzt zwischen KI-Chat und
   Nur Fälle; Staffelung entsprechend dazwischen.
   Bewusst NICHT über .admin-only gelöst: deren display:flex !important
   würde den Eintrag auch im eingeklappten Dock stehen lassen. */
.floating-controls .crashkurs-container {
    display: none;
}

.bottom-right-dock.is-open .crashkurs-container {
    display: flex;
    animation: mode-option-in 0.13s cubic-bezier(0.22, 1.1, 0.36, 1) both;
    animation-delay: 0.038s;
}

.bottom-right-dock.is-closing .crashkurs-container {
    display: flex;
    pointer-events: none;
    animation: mode-option-out 0.16s ease both;
    animation-delay: 0.082s;
}

/* Kein Drehbuch für diese Map oder Testphase: Eintrag komplett weg */
.floating-controls .crashkurs-container.ck-disabled {
    display: none !important;
}

i.toggle-icon.fa-graduation-cap {
    -webkit-mask-image: url('images/icons/graduation-cap.svg');
    mask-image: url('images/icons/graduation-cap.svg');
}

/* ---------- Figur ---------- */
.ck-lexi {
    width: 100px;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
}

/* > statt Nachfahre: Lexi mit Augen (lexi-avatar.js) besteht selbst aus
   mehreren Bildern, die nicht einzeln schweben dürfen */
.ck-lexi > img,
.ck-lexi > .lexi-avatar {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 18px rgba(68, 95, 242, 0.35));
    animation: ck-float 3.2s ease-in-out infinite;
}

/* Schweben: Auf-und-Ab mit minimalem Kippen, Schatten atmet mit
   (gleiche Bewegung wie Lexi im KI-Chat, dort @keyframes ai-bot-float) */
@keyframes ck-float {
    0%, 100% { transform: translateY(0) rotate(-1deg); filter: drop-shadow(0 10px 18px rgba(68, 95, 242, 0.35)); }
    50%      { transform: translateY(-9px) rotate(1.2deg); filter: drop-shadow(0 18px 22px rgba(68, 95, 242, 0.22)); }
}

/* ---------- Warp: Lexi beamt sich von Station zu Station ----------
   Die Bühne wird pro Station neu gebaut (renderCrashkurs), deshalb läuft
   das Einwarpen automatisch bei jedem Erscheinen — auch bei der
   Einstiegsfrage. Das Auswarpen setzt crashkursGo() per Klasse, bevor
   die Kamera weiterfährt. Liegt am Wrapper, damit das Schweben (auf dem
   img) ungestört weiterläuft. */
.ck-stage .ck-lexi,
.ck-ask .ck-lexi {
    animation: ck-warp-in 0.38s cubic-bezier(0.22, 1.25, 0.36, 1) both;
}

.ck-stage .ck-bubble {
    animation: ck-bubble-in 0.26s ease-out both;
    animation-delay: 0.14s;
}

.ck-stage.ck-warp-out .ck-lexi {
    animation: ck-warp-out 0.2s ease-in forwards;
}

.ck-stage.ck-warp-out .ck-bubble {
    animation: ck-bubble-out 0.16s ease-in forwards;
}

@keyframes ck-warp-in {
    0%   { opacity: 0; transform: scale(0.12) translateY(14px); filter: blur(10px) brightness(2.4); }
    55%  { opacity: 1; transform: scale(1.14) translateY(-3px); filter: blur(0) brightness(1.5); }
    100% { opacity: 1; transform: none; filter: none; }
}

@keyframes ck-warp-out {
    0%   { opacity: 1; transform: none; filter: none; }
    100% { opacity: 0; transform: scale(0.12) translateY(-14px); filter: blur(10px) brightness(2.4); }
}

@keyframes ck-bubble-in {
    from { opacity: 0; transform: translateX(-10px) scale(0.96); }
    to   { opacity: 1; transform: none; }
}

@keyframes ck-bubble-out {
    to { opacity: 0; transform: scale(0.96); }
}

/* ---------- Bühne am Knoten ---------- */
.ck-stage {
    position: absolute;
    z-index: 60;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.22s ease;
    /* Der Container umschließt Figur UND Blase und ist dadurch deutlich
       größer als das, was man sieht. Ohne pointer-events:none würde er das
       Ziehen der Mindmap in einem breiten Streifen um Lexi blockieren
       (sein mousedown-Handler stoppt die Weitergabe ans Canvas).
       Klickbar ist deshalb nur die Blase selbst. */
    pointer-events: none;
}

.ck-stage.visible {
    opacity: 1;
}

.ck-bubble {
    position: relative;
    pointer-events: auto;
    width: 400px;
    max-width: 60vw;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    text-align: left;
    cursor: default;
}

/* Spitze nach links, zur Figur hin */
.ck-bubble::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 28px;
    width: 12px;
    height: 12px;
    background: inherit;
    transform: rotate(45deg);
    border-left: 1px solid rgba(99, 102, 241, 0.25);
    border-bottom: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 2px;
}

.ck-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
}

.ck-title {
    font-family: var(--font-display, inherit);
    font-size: 15px;
    font-weight: 700;
    color: var(--slate-800, #1e293b);
    letter-spacing: -0.01em;
    margin-bottom: 0;
}

.ck-audio-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    margin: -3px -4px 0 0;
    border-radius: 999px;
    border: 1px solid var(--slate-200, #e2e8f0);
    background: var(--slate-50, #f8fafc);
    color: var(--indigo-600, #4f46e5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ck-audio-btn:hover {
    border-color: var(--indigo-400, #818cf8);
    background: #eef2ff;
}

.ck-audio-btn.is-playing {
    background: #eef2ff;
    border-color: var(--indigo-400, #818cf8);
    color: var(--indigo-600, #4f46e5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.ck-audio-btn.is-muted {
    color: var(--slate-400, #94a3b8);
}

.ck-audio-btn .ck-audio-icon-off {
    display: none;
}

.ck-audio-btn.is-muted .ck-audio-icon-on {
    display: none;
}

.ck-audio-btn.is-muted .ck-audio-icon-off {
    display: block;
}

.ck-audio-btn.is-playing .ck-wave-1,
.ck-audio-btn.is-playing .ck-wave-2 {
    animation: ck-audio-pulse 1.1s ease-in-out infinite;
}

.ck-audio-btn.is-playing .ck-wave-2 {
    animation-delay: 0.25s;
}

@keyframes ck-audio-pulse {
    0%, 100% { opacity: 0.35; }
    50%      { opacity: 1; }
}

.ck-text {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--slate-600, #475569);
}

.ck-text p {
    margin: 0 0 8px;
}

.ck-text p:last-child,
.ck-text ul:last-child {
    margin-bottom: 0;
}

.ck-text ul {
    margin: 0 0 8px;
    padding-left: 18px;
    list-style: disc;
}

.ck-text li {
    margin-bottom: 4px;
}

.ck-text li:last-child {
    margin-bottom: 0;
}

.ck-text b {
    color: var(--slate-800, #1e293b);
}

.ck-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.ck-progress {
    font-size: 12px;
    font-weight: 600;
    color: var(--slate-400, #94a3b8);
    margin-right: auto;
    font-variant-numeric: tabular-nums;
}

.ck-btn {
    padding: 6px 15px;
    border-radius: 999px;
    border: 1px solid var(--slate-200, #e2e8f0);
    background: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--slate-600, #475569);
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s ease);
}

.ck-btn:hover:not(:disabled) {
    border-color: var(--indigo-400, #818cf8);
    color: var(--indigo-600, #4f46e5);
}

.ck-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.ck-btn.ck-primary {
    background: var(--grad-indigo, linear-gradient(135deg, #6366f1, #8b5cf6));
    border-color: transparent;
    color: #fff;
}

.ck-btn.ck-primary:hover {
    filter: brightness(1.08);
    color: #fff;
}

/* ---------- Einstiegsfrage (fixiert unten rechts) ---------- */
.ck-ask {
    position: fixed;
    right: 24px;
    bottom: 96px;
    z-index: 9400;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    pointer-events: none;   /* nur die Blase ist klickbar, siehe .ck-stage */
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1.1, 0.36, 1);
}

.ck-ask.visible {
    opacity: 1;
    transform: none;
}

.ck-ask .ck-bubble {
    width: 290px;
}

/* Auswahl der Teilkurse (Drehbuch mit "courses", z.B. Gesamtüberblick):
   eine Liste untereinander statt Ja/Nein. */
.ck-choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.ck-btn.ck-choice {
    width: 100%;
    text-align: left;
    padding: 8px 14px;
}

.ck-btn.ck-choice::before {
    content: '›';
    display: inline-block;
    width: 14px;
    color: var(--indigo-500, #6366f1);
    font-weight: 800;
}

/* ---------- Stopp-Knopf unten links ---------- */
.ck-stop {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 9400;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--slate-200, #e2e8f0);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--slate-600, #475569);
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s ease);
}

.ck-stop:hover {
    color: var(--rose-600, #e11d48);
    border-color: var(--rose-300, #fda4af);
}

/* ---------- Dark Mode ---------- */
body.glass-theme .ck-bubble {
    background: rgba(30, 27, 58, 0.95);
    border-color: rgba(203, 80, 247, 0.35);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

body.glass-theme .ck-bubble::before {
    border-left-color: rgba(203, 80, 247, 0.35);
    border-bottom-color: rgba(203, 80, 247, 0.35);
}

body.glass-theme .ck-title,
body.glass-theme .ck-text b {
    color: #f1f5f9;
}

body.glass-theme .ck-text {
    color: rgba(226, 232, 240, 0.86);
}

body.glass-theme .ck-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: #e2e8f0;
}

body.glass-theme .ck-audio-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: #c4b5fd;
}

body.glass-theme .ck-audio-btn.is-playing {
    background: rgba(168, 85, 247, 0.22);
    border-color: rgba(203, 80, 247, 0.55);
    color: #f3e8ff;
}

body.glass-theme .ck-audio-btn.is-muted {
    color: rgba(226, 232, 240, 0.45);
}

body.glass-theme .ck-btn.ck-primary {
    background: var(--grad-purple, linear-gradient(135deg, #a855f7, #6366f1));
    border-color: transparent;
}

body.glass-theme .ck-lexi > img,
body.glass-theme .ck-lexi > .lexi-avatar {
    filter: drop-shadow(0 10px 20px rgba(203, 80, 247, 0.4));
}

body.glass-theme .ck-stop {
    background: rgba(30, 27, 58, 0.9);
    border-color: rgba(255, 255, 255, 0.16);
    color: #e2e8f0;
}

/* ---------- Klein & barrierearm ---------- */
@media (max-width: 640px) {
    .ck-lexi { width: 72px; }
    .ck-bubble { width: 260px; }
    .ck-ask { right: 14px; bottom: 88px; }
    .ck-ask .ck-bubble { width: 220px; }
    .ck-stop { left: 14px; bottom: 14px; padding: 9px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .ck-lexi > img, .ck-lexi > .lexi-avatar { animation: none; }
    .ck-stage .ck-lexi, .ck-ask .ck-lexi, .ck-stage .ck-bubble,
    .ck-stage.ck-warp-out .ck-lexi, .ck-stage.ck-warp-out .ck-bubble { animation: none; }
    .ck-stage, .ck-ask { transition: opacity 0.2s ease; transform: translateX(-50%); }
    .ck-ask { transform: none; }
}

/* ---------- Button "Crashkurs starten" im Gesamtüberblick ----------
   Nur im ersten Überblick (_overview), nicht in den Themenüberblicken. */
.overview-crashkurs {
    display: flex;
    justify-content: center;
    margin: -6px 0 22px;
}

.overview-crashkurs-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 24px;
    border: none;
    border-radius: 999px;
    background: var(--grad-indigo, linear-gradient(135deg, #6366f1, #8b5cf6));
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.32);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.overview-crashkurs-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.07);
    box-shadow: 0 12px 26px rgba(99, 102, 241, 0.4);
}

.overview-crashkurs-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

body.glass-theme .overview-crashkurs-btn {
    background: var(--grad-purple, linear-gradient(135deg, #a855f7, #6366f1));
    box-shadow: 0 8px 22px rgba(168, 85, 247, 0.35);
}

/* =================================================================
   Einsteiger-Fälle: Lexi-Einleitung + gestufte Lösung im Fall-Modal
   (renderCaseStudyModalContent in app.js, Felder intro / steps / outro).
   Steht hier und nicht in style.css, weil style.css ohne ?v= am
   Browser-Cache hängt.
   ================================================================= */
.case-lexi {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 18px;
}

.case-lexi > img,
.case-lexi > .lexi-avatar {
    width: 64px;
    height: auto;
    flex: 0 0 auto;
}

.case-lexi-bubble {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 14px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
    text-align: left;
}

.case-lexi-bubble p,
.case-step-text p,
.case-step-tip p,
.case-outro p {
    margin: 0 0 6px;
}

.case-lexi-bubble p:last-child,
.case-step-text p:last-child,
.case-step-tip p:last-child,
.case-outro p:last-child {
    margin-bottom: 0;
}

.case-lexi-bubble ul,
.case-step-text ul,
.case-step-tip ul,
.case-outro ul {
    margin: 4px 0 6px;
    padding-left: 18px;
}

.case-steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Lösungsschritt als Karte im Stil der Light-Mode-Knoten (.mm-node in
   style.css): heller Verlauf, weiße Outline, dezenter weicher Schatten.
   Die Farbe des Bausteins trägt allein der Akzentbalken links (::before).
   --step-from/--step-to bilden den Verlauf von hell nach satt in EINEM
   Farbton. Balken und Label nutzen dieselben Stops. Die erste Deklaration
   ist jeweils der Fallback für Browser ohne color-mix (flacher Balken). */
.case-step {
    --step-color: #64748b;
    --step-from: var(--step-color);
    --step-from: color-mix(in srgb, var(--step-color) 60%, white);
    --step-to: var(--step-color);
    position: relative;
    padding: 12px 16px 12px 20px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.90) 100%);
    /* bewusst schwächer als beim Knoten: die Karten sollen sich im Modal
       nur leicht vom Hintergrund abheben */
    box-shadow:
        0 4px 12px -6px rgba(15, 23, 42, 0.10),
        0 1px 3px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    text-align: left;
    animation: case-answers-in 0.35s ease;
}

/* Akzentbalken wie .mm-node::before: Overlay über die ganze Karte, gemalt
   wird nur ein 4px-Streifen links. Die geerbte Rundung schneidet ihn an den
   Ecken sauber ab, die weiße Outline läuft außen durchgehend herum. */
.case-step::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: linear-gradient(180deg, var(--step-from) 0%, var(--step-to) 100%);
    background-size: 4px 100%;
    background-position: left center;
    background-repeat: no-repeat;
    pointer-events: none;
}

.case-step[data-kind="obersatz"] { --step-color: #6366f1; }
.case-step[data-kind="definition"] { --step-color: #0ea5e9; }
.case-step[data-kind="subsumtion"] { --step-color: #f59e0b; }
.case-step[data-kind="ergebnis"] { --step-color: #10b981; }
.case-step[data-kind="problem"] { --step-color: #e11d63; }

/* Dark Mode: ruhige Glaskarte wie body.glass-theme .mm-node */
body.glass-theme .case-step {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* Dark Mode: .modal-content p (style.css) färbt jeden Absatz im Modal
   slate-600, auf dem dunklen Glas kaum lesbar. Lösungstexte, Tipps und
   Lexi-Texte bekommen dieselbe helle Farbe wie der Sachverhalt
   (body.glass-theme .case-modal-facts). */
body.glass-theme .case-study-modal-content :is(.case-step, .case-outro, .case-lexi-bubble) p {
    color: rgba(241, 245, 249, 0.9);
}

/* Sachverhalt: dieselbe Knoten-Karte wie die Lösungsschritte, Akzent im
   bisherigen neutralen Grau. Überschreibt .case-modal-facts aus style.css
   (dort noch mit border-left). */
.case-modal-section .case-modal-facts {
    position: relative;
    padding: 15px 18px 15px 22px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.90) 100%);
    /* bewusst schwächer als beim Knoten: die Karten sollen sich im Modal
       nur leicht vom Hintergrund abheben */
    box-shadow:
        0 4px 12px -6px rgba(15, 23, 42, 0.10),
        0 1px 3px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.case-modal-section .case-modal-facts::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
    background-size: 4px 100%;
    background-position: left center;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* !important, weil die Dark-Regeln für .case-modal-facts in style.css damit
   arbeiten */
body.glass-theme .case-modal-section .case-modal-facts {
    background: rgba(255, 255, 255, 0.045) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35) !important;
}

body.glass-theme .case-modal-section .case-modal-facts::before {
    background-image: linear-gradient(180deg, #c4b5fd 0%, #a78bfa 100%);
}

/* Alte "Antworten"-Liste (Fälle ohne ausformulierte Lösung): dieselbe
   Knoten-Karte, Akzent im Lila der Liste. Überschreibt .opinion-item aus
   style.css (dort noch mit border-left). */
.case-modal-opinions .opinion-item {
    position: relative;
    padding: 14px 18px 14px 22px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.90) 100%);
    /* bewusst schwächer als beim Knoten: die Karten sollen sich im Modal
       nur leicht vom Hintergrund abheben */
    box-shadow:
        0 4px 12px -6px rgba(15, 23, 42, 0.10),
        0 1px 3px rgba(15, 23, 42, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.case-modal-opinions .opinion-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: linear-gradient(180deg, #9d7cff 0%, #5c24ff 100%);
    background-size: 4px 100%;
    background-position: left center;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* !important, weil die Dark-Regeln für .opinion-item in style.css damit
   arbeiten */
body.glass-theme .case-modal-opinions .opinion-item {
    background: rgba(255, 255, 255, 0.045) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35) !important;
}

body.glass-theme .case-modal-opinions .opinion-item::before {
    background-image: linear-gradient(180deg, #c4b5fd 0%, #a78bfa 100%);
}

/* Ausformulierte Lösung der normalen Fälle: Meinungsstreit im Schritt */
.case-step-views {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.case-step-view {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(100, 116, 139, 0.08);
}

.case-step-view > .badge {
    margin: 0 0 6px;
}

.case-step-decision {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(100, 116, 139, 0.35);
}

.case-step-decision-label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.7;
}

.case-step-label {
    display: inline-block;
    margin-bottom: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    /* derselbe Verlauf wie der Akzentbalken der Karte */
    background: var(--step-color);
    background: linear-gradient(135deg, var(--step-from) 0%, var(--step-to) 100%);
    color: #fff;
    /* hält die weiße Schrift auf dem hellen Verlaufsanfang lesbar */
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.18);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.case-step-prompt {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.case-step.revealed .case-step-prompt {
    margin-bottom: 8px;
}

.case-step-text {
    font-size: 15px;
    line-height: 1.6;
}

.case-step-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.08);
    font-size: 13.5px;
    line-height: 1.5;
}

.case-step-tip > img,
.case-step-tip > .lexi-avatar {
    width: 30px;
    height: auto;
    flex: 0 0 auto;
}

.case-outro {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 14.5px;
    line-height: 1.55;
    text-align: left;
    animation: case-answers-in 0.35s ease;
}

.case-outro > b {
    display: block;
    margin-bottom: 4px;
}

@media (max-width: 600px) {
    .case-lexi > img,
    .case-lexi > .lexi-avatar {
        width: 46px;
    }
}

/* ---------- Lexi im "Schema/Definition gewusst?"-Popup ----------
   Steht hier statt in style.css (dort ohne ?v=, also am Browser-Cache).
   Nach der Antwort reagiert Lexi kurz, bevor das Popup ausblendet. */
.schema-quiz-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.schema-quiz-lexi {
    width: 40px;
    flex: 0 0 auto;
    filter: drop-shadow(0 4px 8px rgba(68, 95, 242, 0.25));
}

.schema-quiz-popup.reacting .schema-quiz-actions,
.schema-quiz-popup.reacting .schema-quiz-hint {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Anklickbarer Text im Mindmap-Knoten ({{link:/pfad}}Text{{/link}}) */
.mm-node a.node-text-link {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.mm-node a.node-text-link:hover {
    color: #1d4ed8;
}

/* Kachelübersicht: "Bald verfügbar" ohne Freischaltung so grau wie die
   gesperrten Kacheln (.dashboard-card.locked in style.css), aber ohne Schloss. */
.dashboard-card.soon-locked .card-center-icon {
    filter: grayscale(1) blur(2px);
    opacity: 0.4;
}

.dashboard-card.soon-locked .card-hero-img {
    filter: grayscale(0.85) blur(1.5px);
    opacity: 0.55;
}

/* Übersichtsfenster: Untertitel ("in 2 Minuten", "im Überblick", …) als
   eigene, kleinere Zeile unter dem animierten Titel */
.overview-modal-content .overview-title .overview-title-sub {
    display: block;
    margin-top: 6px;
    font-size: 0.5em;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0;
    opacity: 0.85;
}

/* ---- "Problem melden" im Fall-Modal ---- */
.case-report-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
}

.case-report-link:hover {
    color: #e11d63;
    text-decoration: underline;
}

.case-report-form {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(100, 116, 139, 0.25);
    border-radius: 12px;
    text-align: left;
}

.case-report-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
}

.case-report-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.case-report-cats input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.case-report-cats span {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid rgba(100, 116, 139, 0.35);
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
}

.case-report-cats input:checked + span {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
    font-weight: 600;
}

.case-report-cats input:focus-visible + span {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.case-report-text {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid rgba(100, 116, 139, 0.35);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

.case-report-msg {
    min-height: 1.2em;
    margin: 6px 0 0;
    font-size: 13px;
    color: #e11d63;
}

.case-report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}

.case-report-actions button {
    padding: 6px 14px;
    border: 1px solid rgba(100, 116, 139, 0.35);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.case-report-actions .case-report-send {
    border-color: #6366f1;
    background: #6366f1;
    color: #fff;
}

.case-report-actions button:disabled {
    opacity: 0.6;
    cursor: default;
}

.case-report-done {
    margin: 0;
    font-size: 14px;
}

/* ---- Internes Merkmal "Lösung geprüft" (nur Admins, siehe app.js) ---- */
.case-reviewed-check {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.45);
    pointer-events: none;
    user-select: none;
    z-index: 40;
}

.case-reviewed-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #059669;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
    pointer-events: none;
}

body.glass-theme .case-reviewed-badge {
    background: rgba(6, 78, 59, 0.75);
    border-color: rgba(52, 211, 153, 0.6);
    color: #6ee7b7;
}
