/* Quizkoenig - Komponenten-Styles (ergaenzt topics-design.css) */
/* Variablen werden von topics-design.css definiert */
/* Version: 3.0.0 - CSS Cleanup + Design Improvements */

/* ============================================================
   DARK MODE - Lokale Variablen (Accent-Farben, Schatten)
   ============================================================ */
body.dark-mode {
    --accent-blue: #4da6ff;
    --accent-blue-hover: #66b3ff;
    --accent-purple: #b388dd;
    --accent-purple-hover: #c9a0e8;
    --accent-green: #5ddb8d;
    --accent-green-hover: #7ae3a3;
    --btn-bg: #3a3a3a;
    --btn-text: #e0e0e0;
    --btn-border: #555555;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.4);
}

/* Lokale Variablen (Light Mode) */
body {
    --accent-blue: #0066cc;
    --accent-blue-hover: #0052a3;
    --accent-purple: #9b59b6;
    --accent-purple-hover: #8e44ad;
    --accent-green: #27ae60;
    --accent-green-hover: #219a52;
    --btn-bg: #ffffff;
    --btn-text: #333333;
    --btn-border: #e0e0e0;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
}

/* ============================================================
   DARK MODE - Unique Element Overrides
   ============================================================ */

body.dark-mode .kontext {
    background: #2d2d2d !important;
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}

body.dark-mode .frage-hinweis {
    background: #1a3353;
    border-color: #2a4a6a;
    color: #9ec5fe;
}

body.dark-mode .hd-hint {
    color: #666;
}

body.dark-mode .hd-hint-block {
    background: #2a2a2a;
    color: #666;
}

body.dark-mode .session-box {
    background: var(--color-surface);
}

body.dark-mode .session-box h3 {
    color: var(--color-text);
}

body.dark-mode .session-box p {
    color: var(--color-text-secondary);
}

body.dark-mode .session-box input[type="text"] {
    background: var(--color-background);
    color: var(--color-text);
    border-color: #555;
}

body.dark-mode .session-box .btn-secondary {
    background: #444;
    color: #ddd;
}

body.dark-mode .validation-warnings-banner {
    background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
    border-color: #b45309;
}

body.dark-mode .validation-warnings-header,
body.dark-mode .validation-warnings-list,
body.dark-mode .validation-warnings-close {
    color: #fbbf24;
}

body.dark-mode .failsafe-content {
    background: var(--color-surface);
}

body.dark-mode .failsafe-content h3 {
    color: var(--color-text);
}

body.dark-mode .failsafe-text {
    color: var(--color-text-secondary);
}

body.dark-mode .frage-quellen {
    background: #2d2d2d;
}

body.dark-mode .frage-quellen a {
    color: #6ea8fe;
}

/* ============================================================
   KEYFRAMES
   ============================================================ */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pulse-eigene {
    0%, 100% { box-shadow: 0 0 10px rgba(23, 162, 184, 0.5); }
    50% { box-shadow: 0 0 20px rgba(23, 162, 184, 0.8); }
}

@keyframes pulse-red {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 15px rgba(220, 53, 69, 0.8); }
}

@keyframes statusbar-loading {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@keyframes testModePulse {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes progress-animate {
    0% { width: 0%; margin-left: 0; }
    50% { width: 60%; margin-left: 20%; }
    100% { width: 0%; margin-left: 100%; }
}

/* ============================================================
   UTILITY
   ============================================================ */

.card.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

/* ============================================================
   HEADER
   ============================================================ */

.header {
    text-align: center;
    padding: 30px 0;
}

.header h1 {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.subtitle {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
}

/* ============================================================
   DARK MODE TOGGLE & TEST MODE TOGGLE
   ============================================================ */

.dark-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.dark-mode-toggle .toggle-icon {
    font-size: 1rem;
    transition: transform 0.3s;
}

body.dark-mode .dark-mode-toggle .toggle-icon {
    transform: rotate(180deg);
}

.dark-mode-toggle .toggle-label {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.test-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.test-mode-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.test-mode-toggle.active {
    background: rgba(255, 193, 7, 0.3);
    border: 1px solid #ffc107;
}

.test-mode-toggle .toggle-icon {
    font-size: 1rem;
}

.test-mode-toggle .toggle-label {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.test-mode-toggle.active .toggle-label {
    color: #ffc107;
    font-weight: bold;
}

/* Testmodus Banner */
.test-mode-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #ff6b6b 0%, #ffc107 50%, #ff6b6b 100%);
    background-size: 200% 100%;
    animation: testModePulse 2s ease-in-out infinite;
    color: #000;
    text-align: center;
    padding: 8px 15px;
    font-size: 0.9rem;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

body.test-mode-active {
    padding-top: 40px;
}

body.test-mode-active .navbar {
    top: 40px;
}

/* Logo als Dark Mode Toggle */
.nav-center-logo,
.nav-logo-mobile {
    cursor: pointer;
    transition: filter 0.3s, transform 0.2s;
}

.nav-center-logo:hover,
.nav-logo-mobile:hover {
    transform: scale(1.05);
}

body.dark-mode .nav-center-logo,
body.dark-mode .nav-logo-mobile {
    filter: brightness(0.8) contrast(1.1);
}

/* ============================================================
   STATION CARDS - Disabled State (topics hat Basis)
   ============================================================ */

.station-card.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

.station-card.disabled .station-check {
    color: var(--color-primary);
    opacity: 1;
}

/* ============================================================
   BUTTONS - Spezielle Varianten
   ============================================================ */

/* Transition Upgrade - alle Buttons */
.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

/* Eigene Fragen Container */
body.llm-offline #eigene-fragen-container {
    display: flex !important;
    justify-content: center !important;
    margin-bottom: 15px;
}

.btn-small {
    padding: 6px 10px;
    font-size: 0.9rem;
}

.btn-info {
    background: #17a2b8;
    color: white;
    border: none;
}

.btn-info:hover {
    background: #138496;
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    background: #999 !important;
}

.btn-disabled:hover {
    background: #999 !important;
    transform: none !important;
}

.btn-disabled-grey {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    background: #ccc !important;
    border-color: #ccc !important;
    color: #888 !important;
}

.frage-actions .btn-disabled-grey {
    background: #e0e0e0 !important;
    border-color: #d0d0d0 !important;
    color: #999 !important;
}

/* Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--btn-bg);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-back:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-1px);
}

/* Step Actions */
.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

/* Accept Button */
.btn-accept {
    padding: 6px 12px;
    border: 1px solid var(--color-success);
    border-radius: 6px;
    background: white;
    color: var(--color-success);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-accept:hover {
    background: var(--color-success);
    color: white;
    transform: translateY(-1px);
}

.btn-accept.accepted {
    background: var(--color-success);
    color: white;
}

/* Reject Button */
.btn-reject {
    padding: 6px 12px;
    border: 1px solid var(--color-danger);
    border-radius: 6px;
    background: white;
    color: var(--color-danger);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-reject:hover {
    background: var(--color-danger);
    color: white;
    transform: translateY(-1px);
}

.btn-reject.active {
    background: var(--color-danger);
    color: white;
}

/* Feedback Button */
.btn-feedback {
    padding: 6px 12px;
    border: 1px solid var(--accent-blue);
    border-radius: 6px;
    background: var(--btn-bg);
    color: var(--accent-blue);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-feedback:hover {
    background: var(--accent-blue);
    color: white;
    transform: translateY(-1px);
}

.btn-feedback.used {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.btn-feedback.used:hover {
    background: var(--accent-blue-hover);
    border-color: var(--accent-blue-hover);
}

/* Translate Button */
.btn-translate {
    padding: 6px 12px;
    border: 1px solid #2196f3;
    border-radius: 6px;
    background: var(--btn-bg);
    color: #2196f3;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-translate:hover {
    background: #2196f3;
    color: white;
    transform: translateY(-1px);
}

.btn-translate.translated {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.btn-translate.translated:hover {
    background: #388e3c;
    border-color: #388e3c;
}

/* Learn Button */
.btn-learn {
    padding: 6px 12px;
    border: 1px solid #6c757d;
    border-radius: 6px;
    background: white;
    color: #6c757d;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-learn:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-1px);
}

.btn-learn.learned {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
    cursor: default;
}

.btn-learn.learned:hover {
    transform: none;
}

/* Eigene Button */
.btn-eigene {
    padding: 6px 12px;
    border: 1px solid #17a2b8;
    border-radius: 6px;
    background: white;
    color: #17a2b8;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto;
}

.btn-eigene:hover {
    background: #17a2b8;
    color: white;
    transform: translateY(-1px);
}

.btn-eigene.used {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.btn-eigene.used:hover {
    background: #138496;
    border-color: #138496;
}

/* Offline-Modus: Eigene hervorheben */
body.llm-offline .btn-eigene {
    background: #17a2b8 !important;
    color: white !important;
    border-color: #17a2b8 !important;
    box-shadow: 0 0 10px rgba(23, 162, 184, 0.5);
    animation: pulse-eigene 2s infinite;
}

/* Thema Button */
.btn-thema {
    padding: 6px 12px;
    border: 1px solid var(--accent-purple);
    border-radius: 6px;
    background: var(--btn-bg);
    color: var(--accent-purple);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-thema:hover:not(:disabled) {
    background: var(--accent-purple);
    color: white;
    transform: translateY(-1px);
}

.btn-thema:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Nav Button (Pfeile) */
.btn-nav {
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-nav:hover:not(:disabled) {
    background: var(--color-background);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.btn-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Refresh Button */
.btn-refresh {
    width: 32px;
    height: 28px;
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-refresh:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
    transform: translateY(-1px);
}

.btn-refresh:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* Quellen Suchen Button */
.btn-quellen-suchen {
    background: white;
    color: #856404;
    border: 2px solid #c9a227;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-quellen-suchen:hover {
    background: #ffc107;
    color: #664d03;
    border-color: #b89a1e;
    transform: translateY(-1px);
}

.btn-quellen-suchen:disabled {
    background: #e9ecef;
    color: #6c757d;
    border-color: #adb5bd;
    cursor: wait;
    transform: none;
}

/* Apply KI Button */
.btn-apply-ki {
    background: linear-gradient(135deg, var(--color-success) 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
}

.btn-apply-ki:hover {
    background: linear-gradient(135deg, #218838 0%, #1db388 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.btn-apply-ki:active {
    transform: translateY(0) scale(0.98);
}

/* KI Loading State */
.btn-ki-loading {
    position: relative;
    color: transparent !important;
}

.btn-ki-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Quick Jump Button */
.btn-quick-jump {
    background: transparent;
    border: 2px solid #4a7cc9;
    color: #4a7cc9;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-quick-jump:hover {
    background: #4a7cc9;
    color: white;
    transform: translateY(-1px);
}

/* Toggle Lokal Button */
.btn-toggle-lokal {
    padding: 6px 12px;
    border: 2px solid #ccc;
    border-radius: 6px;
    background: #f5f5f5;
    color: #666;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-toggle-lokal.active {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

.btn-toggle-lokal:hover {
    opacity: 0.9;
}

/* Add Lokal Button */
.btn-add-lokal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
}

/* Lokal Sender Button */
.lokal-sender-btn {
    padding: 5px 10px;
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    background: white;
    color: var(--color-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.lokal-sender-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-1px);
}

.lokal-sender-btn.other {
    border-color: #6c757d;
    color: #6c757d;
}

.lokal-sender-btn.other:hover {
    background: #6c757d;
    color: white;
}

/* Dialekt Button */
.dialekt-btn {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dialekt-btn:hover {
    border-color: #007bff;
    background: #f0f7ff;
    transform: translateY(-1px);
}

.dialekt-btn.active {
    border-color: #007bff;
    background: #007bff;
    color: white;
}

.dialekt-btn[data-dialekt="ezh"].active {
    background: #e31937;
    border-color: #e31937;
}

.dialekt-btn[data-dialekt="ebe"].active {
    background: #ff6600;
    border-color: #ff6600;
}

.dialekt-btn[data-dialekt="ebs"].active {
    background: #009933;
    border-color: #009933;
}

/* Reject Option Buttons */
.reject-option {
    padding: 6px 12px;
    border: 2px solid var(--color-danger);
    border-radius: 6px;
    background: white;
    color: var(--color-danger);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.reject-option:hover {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
    transform: translateY(-1px);
}

.reject-option.selected {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

/* Replace Button */
.replace-btn {
    padding: 6px 12px;
    border: 2px solid #4a90d9;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #4a90d9;
}

.replace-btn:hover {
    background: #f0f7ff;
    transform: translateY(-1px);
}

.replace-btn.active {
    background: #4a90d9;
    border-color: #4a90d9;
    color: white;
}

/* Basis-Frage Button */
.basis-frage-btn {
    padding: 10px 16px;
    border: 2px solid #4a90d9;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #4a90d9;
}

.basis-frage-btn:hover {
    background: #f0f7ff;
    transform: translateY(-1px);
}

.basis-frage-btn.active {
    background: #4a90d9;
    border-color: #4a90d9;
    color: white;
}

/* Outline Buttons */
.btn-outline-secondary {
    background: transparent;
    border: 2px solid var(--color-text-secondary);
    color: var(--color-text-secondary);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-outline-secondary:hover {
    background: var(--color-text-secondary);
    color: white;
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-outline-primary:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid #ddd;
    color: #666;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-outline:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

/* Close Button */
.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.btn-close:hover {
    color: var(--color-primary);
}

/* Reject Submit */
.btn-reject-submit {
    padding: 8px 16px;
    background: var(--color-danger);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-reject-submit:hover {
    background: #b02a37;
    transform: translateY(-1px);
}

/* Failsafe Buttons */
.failsafe-btn-thema {
    background: var(--color-primary) !important;
    color: white !important;
    padding: 14px 20px !important;
    border-radius: 10px !important;
    font-size: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    border: none !important;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.failsafe-btn-thema:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.failsafe-btn-eigene {
    background: #17a2b8 !important;
    color: white !important;
    padding: 14px 20px !important;
    border-radius: 10px !important;
    font-size: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    border: none !important;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.failsafe-btn-eigene:hover {
    background: #138496 !important;
    transform: translateY(-1px);
}

.failsafe-btn-cancel {
    background: transparent !important;
    color: var(--color-text-secondary) !important;
    padding: 10px !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.failsafe-btn-cancel:hover {
    background: var(--color-background) !important;
}

/* Special Button */
.btn-special {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-special:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Button Groups */
.btn-group {
    display: flex;
    gap: 8px;
}

/* ============================================================
   INPUTS & FORMS
   ============================================================ */

/* Focus glow - Teal (aus var(--color-primary)) */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(10, 166, 146, 0.15);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--color-text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.checkbox-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-inline label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
}

/* ============================================================
   ACTIONS
   ============================================================ */

.actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* ============================================================
   LOG
   ============================================================ */

#log {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 8px;
}

.log-entry {
    padding: 4px 0;
    border-bottom: 1px solid #333;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-success { color: var(--color-success); }
.log-warning { color: var(--color-warning); }
.log-error { color: var(--color-danger); }

/* ============================================================
   HINT
   ============================================================ */

.hint {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

/* ============================================================
   CARD HEADER
   ============================================================ */

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h2 {
    margin: 0;
}

/* Search in card header */
.card-header input[type="text"] {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.95rem;
    width: 200px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ============================================================
   TABLES
   ============================================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    background: var(--color-background);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.table tbody tr:hover {
    background: #fafafa;
}

.table code {
    background: var(--color-background);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-primary);
    color: white;
    margin-right: 4px;
}

/* ============================================================
   MODALS
   ============================================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: fadeIn 0.25s ease, slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(16px); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-content form {
    padding: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

/* Warning Modal */
.warning-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.warning-modal.hidden {
    display: none;
}

.warning-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    text-align: center;
    animation: fadeIn 0.25s ease, slideUp 0.25s ease;
}

.warning-content h3 {
    color: #f0ad4e;
    margin-bottom: 16px;
}

.warning-stations {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 16px 0;
}

.warning-station-badge {
    background: #f0ad4e;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
}

.warning-hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
}

.warning-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

/* Error Overlay */
.error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.error-overlay.hidden {
    display: none;
}

.error-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.error-message {
    margin-bottom: 20px;
    color: var(--color-text);
}

.error-text {
    color: var(--color-danger);
    font-size: 0.9rem;
}

/* Alert Overlay */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.alert-overlay.hidden {
    display: none;
}

.alert-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 450px;
    min-width: 300px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: fadeIn 0.25s ease, slideUp 0.25s ease;
}

.alert-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.alert-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text);
}

.alert-message {
    margin-bottom: 20px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    white-space: pre-line;
}

.alert-content.alert-warning .alert-icon { color: #f59e0b; }
.alert-content.alert-error .alert-icon { color: var(--color-danger); }
.alert-content.alert-success .alert-icon { color: var(--color-success); }
.alert-content.alert-info .alert-icon { color: #3b82f6; }

/* Feedback Modal */
.feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.feedback-modal.hidden {
    display: none;
}

.feedback-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: fadeIn 0.25s ease, slideUp 0.25s ease;
}

.feedback-content h3 {
    margin-bottom: 16px;
    color: var(--color-text);
}

.feedback-frage-preview {
    background: #f0f4ff;
    border: 1px solid #d0d8ff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.feedback-frage-preview .preview-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.feedback-frage-preview .preview-text {
    font-size: 1rem;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
}

.feedback-frage-preview .preview-antwort {
    font-size: 0.9rem;
    color: #555;
}

.feedback-frage-preview .preview-antwort strong {
    color: var(--color-primary);
}

.feedback-frage-preview .preview-kontext {
    font-size: 0.85rem;
    color: #666;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--color-border);
    font-style: italic;
}

.feedback-content label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    margin-top: 12px;
}

.feedback-content textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.dialekt-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.feedback-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* Special Modal */
.special-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.special-modal.hidden {
    display: none;
}

.special-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    animation: fadeIn 0.25s ease, slideUp 0.25s ease;
}

.special-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    border-radius: 16px 16px 0 0;
}

.special-header h3 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
}

.special-header .btn-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.special-header .btn-close:hover {
    background: rgba(255,255,255,0.3);
}

.special-form {
    padding: 25px;
}

.special-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 16px;
    color: #333;
}

.special-label:first-child {
    margin-top: 0;
}

.special-form textarea,
.special-form input[type="text"],
.special-form input[type="url"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.special-form textarea:focus,
.special-form input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.special-form textarea {
    resize: vertical;
    min-height: 100px;
}

.special-sources {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-top: 8px;
}

.source-option {
    margin-bottom: 12px;
}

.source-option:last-of-type {
    margin-bottom: 0;
}

.source-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: #555;
}

.source-option input[type="file"] {
    font-size: 0.9rem;
}

.source-option input[type="url"] {
    width: calc(100% - 120px);
    display: inline-block;
}

.source-option .btn-small {
    padding: 8px 12px;
    font-size: 0.85rem;
    margin-left: 8px;
    vertical-align: top;
}

.source-list {
    margin-top: 10px;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.source-item .url {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #666;
}

.source-item .btn-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1rem;
}

.source-item .btn-remove:hover {
    color: var(--color-danger);
}

.special-existing {
    padding: 15px 25px;
    background: #f5f3ff;
    border-bottom: 1px solid #e9e5ff;
}

.special-existing select {
    width: 100%;
    padding: 10px;
    border: 2px solid #d4c8ff;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-top: 6px;
}

.special-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 25px;
    border-top: 1px solid #eee;
    background: #fafafa;
    border-radius: 0 0 16px 16px;
}

.special-progress {
    padding: 25px;
    text-align: center;
}

.special-progress .progress-header {
    font-weight: 600;
    margin-bottom: 15px;
    color: #8b5cf6;
}

.special-progress .progress-bar {
    height: 8px;
    background: #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.special-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #a855f7);
    width: 0%;
    transition: width 0.3s ease;
}

.special-progress .progress-steps {
    text-align: left;
    font-size: 0.9rem;
}

.special-progress .step {
    padding: 6px 0;
    color: #666;
}

.special-progress .step.active {
    color: #8b5cf6;
    font-weight: 500;
}

.special-progress .step.done {
    color: #22c55e;
}

.special-summary {
    padding: 25px;
    text-align: center;
}

.special-summary h4 {
    color: #22c55e;
    margin-bottom: 15px;
}

.summary-content {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 15px;
    text-align: left;
    margin-bottom: 20px;
    font-size: 0.9rem;
    max-height: 250px;
    overflow-y: scroll;
}

.summary-content::-webkit-scrollbar { width: 8px; }
.summary-content::-webkit-scrollbar-track { background: #d1fae5; border-radius: 4px; }
.summary-content::-webkit-scrollbar-thumb { background: #86efac; border-radius: 4px; }
.summary-content::-webkit-scrollbar-thumb:hover { background: #4ade80; }

.summary-content ul { margin: 0; padding-left: 20px; }
.summary-content li { margin-bottom: 6px; }

/* Failsafe Modal */
.failsafe-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.failsafe-overlay.hidden {
    display: none;
}

.failsafe-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.25s ease, slideUp 0.25s ease;
}

.failsafe-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.failsafe-content h3 {
    margin-bottom: 10px;
    color: var(--color-text);
    font-size: 1.3rem;
}

.failsafe-text {
    color: var(--color-text-secondary);
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.failsafe-hint {
    font-size: 0.85rem;
    opacity: 0.8;
}

.failsafe-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.failsafe-buttons .btn-hint {
    font-size: 0.8rem;
    opacity: 0.8;
}

.failsafe-debug {
    margin-top: 20px;
    text-align: left;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.failsafe-debug summary { cursor: pointer; padding: 5px 0; }
.failsafe-debug ul { margin-top: 10px; padding-left: 20px; }
.failsafe-debug li { margin-bottom: 3px; }

/* ============================================================
   LOADING
   ============================================================ */

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading.hidden {
    display: none;
}

.loading-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 360px;
    max-width: 420px;
    animation: fadeIn 0.25s ease, slideUp 0.25s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e5e5;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

#loading-text {
    margin-top: 16px;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e5e5;
    border-radius: 3px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), #0cc9b0);
    border-radius: 3px;
    animation: progress-animate 2s ease-in-out infinite;
}

.loading-steps {
    width: 100%;
    margin-top: 20px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.85rem;
    text-align: left;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
    animation: fadeIn 0.3s ease;
}

.loading-step:last-child {
    border-bottom: none;
    color: #333;
    font-weight: 500;
}

.loading-step .step-icon { width: 18px; text-align: center; }
.loading-step.done .step-icon { color: #22c55e; }
.loading-step.active .step-icon { color: var(--color-primary); }
.loading-step.error .step-icon { color: #ef4444; }

/* ============================================================
   FRAGEN EDITOR
   ============================================================ */

.frage-editor {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s ease;
}

.frage-editor:focus-within {
    box-shadow: 0 0 0 3px rgba(10, 166, 146, 0.1);
}

.frage-editor h3 {
    color: var(--color-primary);
    font-size: 1rem;
    margin-bottom: 12px;
}

.frage-editor textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.frage-editor input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    margin-top: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Frage Group */
.frage-group {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.frage-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.frage-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text);
}

/* Loading Frage */
.frage-group.loading-frage {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.frage-group.loading-frage::after {
    content: 'Generiere neue Frage...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.9);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    color: var(--color-primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Rejected Frage */
.frage-group.rejected {
    opacity: 0.5;
    background: #ffebee;
    border-left: 3px solid var(--color-danger);
    padding-left: 12px;
}

.frage-group.rejected::before {
    content: 'Abgelehnt';
    display: block;
    color: var(--color-danger);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

/* Accepted Frage */
.frage-group.accepted {
    background: rgba(10, 166, 146, 0.08);
    border-left: 4px solid var(--color-primary);
    padding-left: 12px;
    border-radius: 8px;
}

.frage-group.accepted::before {
    content: 'Angenommen';
    display: block;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

/* Frage Header & Nav */
.frage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.frage-header label {
    margin: 0;
}

.frage-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.frage-counter {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    min-width: 30px;
    text-align: center;
}

/* Frage Actions */
.frage-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--color-border);
}

/* Antwort Row */
.antwort-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.antwort-row label {
    margin: 0;
    white-space: nowrap;
    font-weight: 500;
}

.antwort-row input {
    flex: 1;
    margin: 0 !important;
}

.einheit {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

/* Kontext */
.kontext {
    margin-top: 8px;
    width: 100%;
    padding: 10px 12px;
    background: #f0f7ff;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #0066cc;
    border: 1px solid #cce0ff;
    border-left: 3px solid #0066cc;
    font-family: inherit;
    resize: none;
    overflow: hidden;
    min-height: 40px;
    field-sizing: content;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kontext:focus {
    outline: none;
    border-color: #0066cc;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.kontext-label {
    font-size: 0.8rem;
    color: #0066cc;
    margin-top: 8px;
    margin-bottom: 4px;
}

/* Schaetzfrage */
.schaetzfrage {
    background: #fff9e6;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
}

.schaetzfrage label {
    color: #996600;
}

/* Hinweis */
.frage-hinweis {
    background: #e7f3ff;
    border: 1px solid #b3d7ff;
    border-left: 4px solid #007bff;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 8px 0;
    font-size: 0.85em;
    color: #004085;
    display: flex;
    align-items: center;
    gap: 8px;
}

.frage-hinweis .hinweis-icon {
    font-size: 1.1em;
}

/* Quellen */
.frage-quellen {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--color-border);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.frage-quellen .quelle,
.frage-quellen .faktencheck {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.frage-quellen .quelle.primaer a { color: #0066cc; }
.frage-quellen .quelle.sekundaer a { color: #6600cc; }
.frage-quellen .faktencheck a { color: #006633; }

.frage-quellen a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.15s;
}

.frage-quellen a:hover { text-decoration: underline; }
.frage-quellen .no-source { color: #999; font-style: italic; }
.frage-quellen .no-url { color: #666; }
.frage-quellen .url-missing { color: var(--color-danger); font-size: 0.75rem; font-style: italic; }

/* Dialekt Row */
.frage-dialekt-row {
    margin-top: 6px;
    padding: 8px;
    background: #e8f5e9;
    border-left: 3px solid #4caf50;
    border-radius: 4px;
}

.frage-dialekt-row.hidden { display: none; }

.frage-dialekt-row.low-confidence {
    background: #fff3e0;
    border-left-color: #ff9800;
}

.frage-dialekt-row .dialekt-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2e7d32;
    margin-bottom: 4px;
}

.frage-dialekt-row.low-confidence .dialekt-label { color: #e65100; }

.frage-dialekt-row textarea {
    width: 100%;
    border: 1px solid #a5d6a7;
    border-radius: 4px;
    padding: 8px;
    font-size: 0.95rem;
    background: white;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.frage-dialekt-row.low-confidence textarea { border-color: #ffcc80; }

/* HD Readonly */
textarea.frage-hd-readonly,
textarea[readonly] {
    background: #f5f5f5;
    color: #666;
}

/* HD Hints */
.hd-hint {
    font-size: 0.75rem;
    color: #999;
    font-weight: normal;
    margin-left: 4px;
}

.hd-hint-block {
    font-size: 0.75rem;
    color: #999;
    padding: 4px 8px;
    margin-top: 4px;
    background: #f8f8f8;
    border-radius: 4px;
    line-height: 1.3;
}

/* ============================================================
   NATIONALE & LOKALE FRAGEN
   ============================================================ */

.nationale-fragen {
    border-left: 4px solid var(--color-primary);
}

.nationale-fragen h3 {
    color: var(--color-primary);
}

.lokale-frage {
    border-left: 4px solid #0066cc;
    background: #f8fbff;
}

.lokale-frage h3 {
    color: #0066cc;
}

.lokal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.lokal-header h3 { margin: 0; }

/* Lokale Frage disabled */
.lokale-frage.disabled {
    border-left-color: #ccc;
    background: #f5f5f5;
}

.lokale-frage.disabled h3 { color: #999; }

.lokale-frage.disabled .frage-group,
.lokale-frage.disabled .lokal-content,
.lokale-frage.disabled .frage-content {
    opacity: 0.35;
    pointer-events: none;
}

.lokale-frage.disabled button:not(.btn-toggle-lokal),
.lokale-frage.disabled .btn:not(.btn-toggle-lokal),
.lokale-frage.disabled .replace-btn {
    opacity: 0.35 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    filter: grayscale(100%);
}

.lokale-frage.disabled input,
.lokale-frage.disabled textarea,
.lokale-frage.disabled select {
    opacity: 0.35;
    pointer-events: none;
    background: #e9ecef !important;
}

.lokale-frage.disabled .lokal-header {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.lokale-frage.disabled .btn-toggle-lokal {
    opacity: 1 !important;
    pointer-events: auto !important;
    background: #17a2b8;
    border-color: #17a2b8;
    color: white;
    cursor: pointer;
    filter: none !important;
}

.lokale-frage.disabled .btn-toggle-lokal:hover {
    background: #138496;
    border-color: #138496;
}

.lokal-disabled-hint {
    padding: 12px;
    background: #e9ecef;
    border-radius: 6px;
    color: #666;
    font-style: italic;
    text-align: center;
}

.lokal-disabled-hint.hidden { display: none; }

.lokal-options {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.lokal-options.hidden { display: none; }

.lokal-hint {
    font-size: 0.8rem;
    color: #666;
    margin-right: 8px;
}

/* Add Lokal Container */
.add-lokal-container {
    text-align: center;
    padding: 16px 0;
    margin-top: 8px;
    border-top: 1px dashed var(--color-border);
}

/* Replace Hints */
.replace-hint {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
}

.replace-select {
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.85rem;
    margin-left: 8px;
}

.replace-buttons {
    display: flex;
    gap: 8px;
}

.replace-buttons.highlight-error {
    background: #fff3cd;
    border-radius: 8px;
    padding: 5px;
}

.replace-btn.pulse-error {
    animation: pulse-red 0.5s ease-in-out 3;
    border-color: var(--color-danger) !important;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

/* Reject Options */
.reject-options {
    display: none;
    gap: 8px;
    margin-top: 10px;
    justify-content: flex-end;
}

.reject-options.show { display: flex; }

/* Reject Feedback Input */
.reject-feedback-input,
.reject-confirm {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: flex-end;
    align-items: center;
}

.reject-feedback-input.hidden,
.reject-confirm.hidden { display: none; }

.reject-feedback-input input,
.reject-confirm input {
    flex: 1;
    max-width: 400px;
    padding: 8px 12px;
    border: 2px solid var(--color-danger);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reject-feedback-input input.error,
.reject-confirm input.error {
    background: #ffebee;
    animation: shake 0.3s ease;
}

.reject-feedback {
    background: #fff3cd !important;
    border-color: #ffc107 !important;
    color: #856404 !important;
}

.reject-feedback:hover {
    background: #ffc107 !important;
    color: #000 !important;
}

/* Schaetzfrage Auswahl */
.schaetzfrage-auswahl {
    background: #f8f9fa;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.schaetzfrage-info {
    margin-bottom: 20px;
}

.schaetzfrage-info p {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin: 0;
}

.schaetzfrage-select-row {
    margin-bottom: 24px;
}

.basis-frage-select {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.schaetzfrage-actions {
    display: flex;
    justify-content: center;
}

.basis-frage-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

/* ============================================================
   VORSCHAU
   ============================================================ */

.vorschau-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.vorschau-block {
    background: white;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.vorschau-block:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.vorschau-block.pdf-ready {
    border-color: var(--color-success);
    background: linear-gradient(135deg, #f0fff4 0%, white 100%);
}

.vorschau-block.pdf-error {
    border-color: var(--color-danger);
    background: linear-gradient(135deg, #fff5f5 0%, white 100%);
}

.vorschau-block h3 {
    font-size: 1.1rem;
    margin: 0 0 8px 0;
    color: var(--color-text);
}

.vorschau-info {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin: 0 0 16px 0;
}

.vorschau-fragen {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.vorschau-frage {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--color-border);
}

.vorschau-frage:last-child { border-bottom: none; }

.vorschau-frage.lokal {
    background: #e8f4fd;
    margin: -6px -8px;
    padding: 8px;
    border-radius: 6px;
    border-bottom: none;
}

.vorschau-num {
    font-weight: 700;
    color: var(--color-primary);
    min-width: 24px;
}

.vorschau-text {
    font-size: 0.95rem;
    color: var(--color-text);
}

.vorschau-block .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
}

.pdf-summary {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-success);
    margin: 16px 0 0 0;
    padding: 12px;
    background: #f0fff4;
    border-radius: 8px;
}

/* ============================================================
   SUCCESS
   ============================================================ */

.success-content {
    text-align: center;
    padding: 30px 20px;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.success-content h2 {
    color: var(--color-success);
    margin-bottom: 20px;
}

.success-details {
    background: #f0fff4;
    border: 2px solid var(--color-success);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.success-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #d4edda;
}

.success-item:last-child { border-bottom: none; }
.success-item .icon { font-size: 1.2rem; }
.success-item .name { flex: 1; font-weight: 500; }
.success-item .status { color: var(--color-success); font-weight: 600; }

.success-pdfs {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--color-border);
}

.success-pdfs h4 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.success-pdfs .pdf-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ============================================================
   KONTAKT / VORSCHLAEGE
   ============================================================ */

.kontakt-stationen {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    background: var(--color-background);
    padding: 4px 8px;
    border-radius: 4px;
}

.vorschlag-item {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.vorschlag-item:hover {
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.vorschlag-item.selected {
    border-color: var(--color-primary);
    background: rgba(10, 166, 146, 0.04);
}

.vorschlag-item input {
    margin-right: 12px;
    margin-top: 4px;
}

.vorschlag-content { flex: 1; }

.vorschlag-thema {
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 4px;
}

.vorschlag-frage {
    font-weight: 500;
    margin-bottom: 4px;
}

.vorschlag-antwort {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* ============================================================
   STATUS DISPLAY
   ============================================================ */

.status-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.status-header:hover { opacity: 0.8; }

.status-toggle {
    margin-left: auto;
    color: var(--color-text-secondary);
    transition: transform 0.3s ease;
}

#status-card.collapsed .status-toggle { transform: rotate(-90deg); }
#status-card.collapsed .status-steps { display: none; }
#status-card.collapsed .status-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.status-icon { font-size: 2rem; line-height: 1; }

.status-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text);
}

.status-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--color-background);
    transition: all 0.3s ease;
}

.status-step.active {
    background: #e8f4fd;
    border-left: 3px solid #0066cc;
}

.status-step.done {
    background: #e8f8e8;
    border-left: 3px solid var(--color-success);
}

.status-step.error {
    background: #fde8e8;
    border-left: 3px solid var(--color-danger);
}

.step-icon { font-size: 1.2rem; width: 24px; text-align: center; }
.step-text { flex: 1; font-size: 0.95rem; }
.step-time { font-size: 0.8rem; color: var(--color-text-secondary); }

.status-step.active .step-icon {
    animation: pulse 1.5s infinite;
}

#status-card { transition: all 0.3s ease; }

/* ============================================================
   STATUS BADGES
   ============================================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.online {
    background: rgba(40, 167, 69, 0.15);
    color: var(--color-success);
    animation: pulse 3s infinite;
}

.status-badge.offline {
    background: rgba(220, 53, 69, 0.15);
    color: var(--color-danger);
}

.status-badge.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #d4a106;
}

.status-badge.error {
    background: rgba(220, 53, 69, 0.2);
    color: var(--color-danger);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ============================================================
   FOOTER DETAILS (topics hat .footer-wrapper / .app-footer Basis)
   ============================================================ */

.footer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #333;
}

.footer-item .icon { font-size: 1rem; }
.footer-item .label { color: #666; font-size: 0.75rem; }
.footer-item .value { font-weight: 600; color: #333; }

.footer-copyright {
    font-size: 0.7rem;
    color: #888;
}

.footer-version {
    background: var(--color-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.footer-divider {
    width: 1px;
    height: 14px;
    background: rgba(0,0,0,0.15);
}

.token-footer { display: none; }

/* ============================================================
   LLM CONTEXT MENU
   ============================================================ */

.llm-context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 10000;
    min-width: 200px;
    display: none;
}

.llm-context-menu.visible { display: block; }

.llm-context-menu-header {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
}

.llm-context-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.llm-context-menu-item:hover { background: #f5f5f5; }
.llm-context-menu-item.active { background: #e8f5e9; font-weight: 600; }

.llm-context-menu-item .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.llm-context-menu-item .status-indicator.green { background: var(--color-success); }
.llm-context-menu-item .status-indicator.yellow { background: #ffc107; }
.llm-context-menu-item .status-indicator.red { background: var(--color-danger); }

/* KI Disabled / Offline */
.ki-disabled {
    opacity: 0.4 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
    position: relative;
}

.ki-offline-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.ki-offline-notice .icon { font-size: 1.2rem; }

/* ============================================================
   STATUSBAR
   ============================================================ */

.statusbar-wrapper {
    position: sticky;
    bottom: 0;
    z-index: 500;
    padding: 0 20px 15px 20px;
    pointer-events: none;
}

.statusbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.15);
    padding: 12px 24px;
    width: fit-content;
    margin: 0 auto;
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.statusbar-icon { font-size: 1.3rem; }

.statusbar-text {
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.95rem;
}

.statusbar-detail {
    color: #666;
    font-size: 0.85rem;
}

.statusbar-detail:empty { display: none; }

.statusbar.loading {
    background: linear-gradient(90deg, #fff 0%, #f0f9ff 50%, #fff 100%);
    background-size: 200% 100%;
    animation: statusbar-loading 1.5s ease infinite;
}

.statusbar.success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
}

.statusbar.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
}

.statusbar.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
}

/* ============================================================
   KI VERBESSERUNG
   ============================================================ */

.ki-improve-section {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
}

.ki-improve-section.hidden { display: none; }

.ki-improve-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 12px;
    font-size: 1rem;
}

.ki-icon { font-size: 1.3rem; }

.ki-improve-result {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.ki-improve-result > div { margin-bottom: 8px; }
.ki-improve-result > div:last-child { margin-bottom: 0; }

.ki-frage span,
.ki-antwort span { color: var(--color-text); }

.ki-aenderungen {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    font-style: italic;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
}

.ki-improve-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

/* ============================================================
   VALIDATION WARNINGS BANNER
   ============================================================ */

.validation-warnings-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.validation-warnings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 8px;
}

.validation-warnings-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #92400e;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.validation-warnings-close:hover { color: #78350f; }

.validation-warnings-list {
    margin: 0;
    padding-left: 20px;
    color: #92400e;
    font-size: 0.9rem;
}

.validation-warnings-list li { margin-bottom: 4px; }

/* ============================================================
   PLACEHOLDER-FRAGE (Massnahme C: Partial Results)
   ============================================================ */

.placeholder-frage {
    border: 2px solid #f59e0b;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.placeholder-frage-hinweis {
    background: #fef3c7;
    border-top: 1px solid #f59e0b;
    border-radius: 0 0 8px 8px;
    color: #92400e;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    margin-top: 4px;
}

body.dark-mode .placeholder-frage {
    background: linear-gradient(135deg, #3b2a00 0%, #4a3500 100%);
    border-color: #d97706;
}

body.dark-mode .placeholder-frage-hinweis {
    background: #3b2a00;
    border-color: #d97706;
    color: #fcd34d;
}

/* ============================================================
   FALLBACK-BANNER (Massnahme D: Kompletter KI-Ausfall)
   ============================================================ */

.fallback-banner {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #ef4444;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.fallback-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: #991b1b;
    margin-bottom: 6px;
    font-size: 1rem;
}

.fallback-banner-text {
    color: #7f1d1d;
    font-size: 0.88rem;
    margin: 0;
    line-height: 1.5;
}

body.dark-mode .fallback-banner {
    background: linear-gradient(135deg, #3b0a0a 0%, #4a0f0f 100%);
    border-color: #dc2626;
}

body.dark-mode .fallback-banner-header { color: #fca5a5; }
body.dark-mode .fallback-banner-text { color: #fca5a5; }

/* ============================================================
   SESSION OVERLAY
   ============================================================ */

.session-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.session-box {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.25s ease, slideUp 0.25s ease;
}

.session-box h3 {
    margin: 0 0 8px 0;
    font-size: 1.4rem;
    color: #1a1a1a;
}

.session-box p {
    margin: 0 0 16px 0;
    color: #666;
    font-size: 0.95rem;
}

.session-box input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.session-box input[type="text"]:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 166, 146, 0.15);
}

.session-box button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.session-box .btn-primary:hover {
    transform: translateY(-1px);
}

.session-box .btn-secondary {
    background: #f0f0f0;
    color: #333;
    margin-right: 8px;
}

.session-box .btn-secondary:hover {
    background: #e0e0e0;
}

.session-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.session-box strong { color: var(--color-primary); }

/* Read-Only Modus */
body.session-readonly .container input:not(#session-name),
body.session-readonly .container select,
body.session-readonly .container button:not(.session-overlay button):not(.nav-toggle),
body.session-readonly .container textarea {
    pointer-events: none;
    opacity: 0.5;
}

body.session-readonly .nav,
body.session-readonly .nav-wrapper {
    pointer-events: auto;
    opacity: 1;
}

/* ============================================================
   QUIZ STATUS CARD
   ============================================================ */

.quiz-status-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
}

.quiz-status-card.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #f59e0b;
}

.quiz-status-message {
    max-width: 500px;
    margin: 0 auto;
}

.quiz-status-message .status-icon { font-size: 4rem; margin-bottom: 20px; }
.quiz-status-message h3 { font-size: 1.5rem; color: var(--color-text); margin-bottom: 15px; }
.quiz-status-message p { color: var(--color-text-secondary); margin-bottom: 25px; }

.quiz-status-message .status-details {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.quiz-status-message .status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.quiz-status-message .status-item:last-child { border-bottom: none; }

.quiz-status-message .status-item .icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.quiz-status-message .status-item.done { color: var(--color-success); }
.quiz-status-message .status-item.done .icon { color: var(--color-success); }
.quiz-status-message .status-item.pending { color: var(--color-warning); }
.quiz-status-message .status-item.pending .icon { color: #f59e0b; }
.quiz-status-message .status-item.not-done { color: var(--color-text-secondary); }

.quiz-status-message .btn-large {
    font-size: 1.2rem;
    padding: 15px 40px;
    display: inline-block;
}

.quiz-status-message .hint {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-top: 15px;
    margin-bottom: 0;
}

/* ============================================================
   OFFLINE-MODUS
   ============================================================ */

body.llm-offline .btn-refresh,
body.llm-offline .btn-neue-frage,
body.llm-offline button[onclick*="refreshFrage"],
body.llm-offline button[onclick*="sucheQuellen"],
body.llm-offline button[onclick*="generiereSchaetzfrage"],
body.llm-offline .ki-button,
body.llm-offline [data-requires-ki="true"] {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: #ccc !important;
    border-color: #999 !important;
    color: #666 !important;
}

body.llm-offline button:has(svg),
body.llm-offline .frage-nav button:not(:disabled) {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

body.llm-offline .frage-nav .btn-refresh,
body.llm-offline .frage-header button[onclick*="refresh"] {
    opacity: 0.4 !important;
    pointer-events: none !important;
}

/* NavBar im Offline-Modus */
body.llm-offline .nav {
    background: var(--color-primary) !important;
    border-color: #088a78 !important;
    margin-top: 28px !important;
}

body.llm-offline .nav-links a {
    color: white !important;
}

body.llm-offline .nav-links a:hover {
    color: var(--color-primary) !important;
    background: white !important;
}

body.llm-offline .nav-links a.active {
    background: white !important;
    color: var(--color-primary) !important;
}

body.llm-offline .nav-label {
    color: rgba(255, 255, 255, 0.7) !important;
}

body.llm-offline .nav-logo {
    background: white;
    border-radius: 8px;
    padding: 5px;
}

body.llm-offline .nav::before {
    content: "OFFLINE-MODUS";
    position: absolute;
    top: -26px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 20px;
    border-radius: 0 0 8px 8px;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    z-index: 10;
}

body.llm-offline .statusbar {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
}

body.llm-offline .frage-editor::before {
    content: "KI nicht verfügbar - Manuelle Eingabe";
    display: block;
    background: #fff3cd;
    color: #856404;
    padding: 8px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    text-align: center;
}

/* ============================================================
   MODUS TOGGLE DETAILS (topics hat Basis)
   ============================================================ */

.modus-toggle-global {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.modus-toggle-global.hidden { display: none; }

.modus-slider-bg {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: var(--color-primary);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(10, 166, 146, 0.4);
}

.modus-toggle-slider.pro-active .modus-slider-bg {
    left: calc(50% + 0px);
    background: var(--color-success);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.modus-slider-btn[data-modus="anfaenger"] {
    padding-left: 16px;
    padding-right: 32px;
}

/* Anfänger-Modus: Diese Elemente verstecken */
body.modus-anfaenger .btn-learn,
body.modus-anfaenger .btn-feedback,
body.modus-anfaenger .btn-reject,
body.modus-anfaenger .btn-quellen-suchen,
body.modus-anfaenger .lokal-options,
body.modus-anfaenger .reject-options,
body.modus-anfaenger .reject-confirm,
body.modus-anfaenger .btn-nav,
body.modus-anfaenger .frage-counter,
body.modus-anfaenger .quellen-warning {
    display: none !important;
}

/* Anfänger-Modus: Refresh-Button umstilen */
body.modus-anfaenger .btn-refresh {
    width: auto;
    padding: 6px 12px;
    white-space: nowrap;
    border: 1px solid var(--color-danger);
    border-radius: 6px;
    background: white;
    color: var(--color-danger);
    font-size: 0.8rem;
}

body.modus-anfaenger .btn-refresh:hover:not(:disabled) {
    background: var(--color-danger);
    color: white;
}

/* ============================================================
   CODE EDITOR
   ============================================================ */

.editor-container {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.editor-tabs {
    display: flex;
    background: var(--color-background);
    border-bottom: 1px solid var(--color-border);
}

.tab {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
}

.tab:hover { background: white; }

.tab.active {
    background: white;
    color: var(--color-primary);
    font-weight: 500;
}

.tab-content { padding: 0; }
.tab-content.hidden { display: none; }

.code-editor {
    width: 100%;
    min-height: 400px;
    padding: 16px;
    border: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    background: #1e1e1e;
    color: #d4d4d4;
}

.code-editor:focus { outline: none; }

.markdown-preview {
    padding: 20px;
    min-height: 400px;
    background: white;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.markdown-preview ul { margin-left: 20px; }

/* ============================================================
   QUICK REFERENCE
   ============================================================ */

.quick-ref {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.quick-ref-section {
    padding: 16px;
    background: var(--color-background);
    border-radius: 8px;
}

.quick-ref-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--color-text);
}

.quick-ref-section ul { list-style: none; padding: 0; margin: 0; }
.quick-ref-section li { padding: 4px 0; font-size: 0.9rem; color: var(--color-text-secondary); }

/* ============================================================
   DIALEKT TABS
   ============================================================ */

.dialekt-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dialekt-tab {
    padding: 10px 20px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dialekt-tab:hover {
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.dialekt-tab.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ============================================================
   FEHLER GRID
   ============================================================ */

.fehler-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.fehler-card {
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff5f5;
    text-align: center;
}

.fehler-wrong { color: var(--color-danger); font-weight: 500; text-decoration: line-through; }
.fehler-arrow { color: var(--color-text-secondary); margin: 4px 0; }
.fehler-correct { color: var(--color-success); font-weight: 600; }
.fehler-dialekt { margin-top: 8px; font-size: 0.75rem; color: var(--color-text-secondary); }

/* ============================================================
   PDF PROGRESS
   ============================================================ */

.pdf-progress-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 0 auto;
}

.pdf-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pdf-progress-title { font-weight: 700; font-size: 1.1rem; color: var(--color-text); }
.pdf-progress-count { font-weight: 600; color: var(--color-primary); font-size: 0.95rem; }

.pdf-progress-bar {
    height: 8px;
    background: var(--color-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.pdf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), #0cc9b0);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.pdf-progress-status {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 16px;
    min-height: 1.2em;
}

.pdf-progress-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
}

.pdf-step {
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--color-background);
}

.pdf-step.done { background: rgba(10, 166, 146, 0.1); color: var(--color-success); }
.pdf-step.error { background: rgba(220, 53, 69, 0.1); color: var(--color-danger); }

/* ============================================================
   DIVIDER "ODER"
   ============================================================ */

.divider-or {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.divider-or::before,
.divider-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
    margin: 0 16px;
}

/* ============================================================
   INFO BOX (Dashed variant)
   ============================================================ */

.info-box.dashed {
    background: #f8f9fa;
    border: 2px dashed var(--color-border);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin: 16px 0;
}

.info-box .info-icon { font-size: 2.5rem; margin-bottom: 12px; }
.info-box p { margin: 8px 0; color: var(--color-text-secondary); }
.info-box p strong { color: var(--color-text); }
.info-box .btn { margin-top: 16px; }

/* ============================================================
   RESPONSIVE - Non-Navigation Elements
   ============================================================ */

@media (max-width: 768px) {
    .statusbar-wrapper {
        padding: 0 15px 10px 15px;
    }

    .statusbar {
        padding: 10px 16px;
        border-radius: 12px;
        gap: 8px;
        width: 100%;
        max-width: 100%;
    }

    .statusbar-text { font-size: 0.85rem; }
    .statusbar-detail { font-size: 0.75rem; }

    .footer-row {
        gap: 8px;
        padding: 10px 12px;
    }

    .footer-row:first-child {
        flex-direction: column;
        gap: 6px;
    }

    .footer-item { font-size: 0.8rem; }
    .footer-item .label { font-size: 0.7rem; }
    .footer-divider { display: none; }
    .footer-row:last-child { padding: 6px 12px; }
    .footer-copyright { font-size: 0.65rem; }
}

@media (max-width: 600px) {
    .options { grid-template-columns: 1fr; }
    .stations { flex-direction: column; gap: 10px; }
    .actions { flex-direction: column; }
    .btn-large { width: 100%; }
    .form-row { grid-template-columns: 1fr; }

    .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .card-header input[type="text"] { width: 100%; }
}

@media (max-width: 480px) {
    .footer-row:first-child {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .footer-item {
        justify-content: center;
        font-size: 0.75rem;
    }
}

/* ============================================================
   PRESENCE WIDGET (QKHub)
   Zeigt verbundene Nutzer als farbige Initialen-Dots in der Navbar
   ============================================================ */

.presence-widget {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    margin-right: 8px;
    flex-shrink: 0;
}

.presence-dot {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    cursor: default;
    user-select: none;
    border: 2px solid rgba(255,255,255,0.25);
    transition: transform 0.15s ease;
    letter-spacing: 0;
}

.presence-dot:hover {
    transform: scale(1.15);
    z-index: 10;
}

/* Tooltip */
.presence-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 5px;
    pointer-events: none;
    z-index: 100;
}

.presence-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
}

.presence-dot:hover .presence-tooltip {
    display: block;
}

/* Mobile: Widget kleinhalten */
@media (max-width: 768px) {
    .presence-widget {
        display: none;
    }
}

/* ============================================================
   MISSION CONTROL BAR
   ============================================================ */
.mission-control {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: top 0.3s ease;
}
.scrolled .mission-control {
    top: 38px;
}
.mc-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 6px 20px 6px 120px;
    max-width: var(--content-width, 1200px);
    margin: 0 auto;
    font-size: 0.82rem;
}
.mc-segment {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.mc-segment:hover {
    background: rgba(0, 0, 0, 0.05);
}
.mc-segment.mc-done-seg {
    opacity: 0.7;
}
.mc-icon {
    font-size: 1rem;
}
.mc-label {
    font-weight: 500;
    color: #525252;
}
.mc-status {
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}
.mc-status.mc-done {
    background: #dcfce7;
    color: #166534;
}
.mc-status.mc-progress {
    background: #fef3c7;
    color: #92400e;
}
.mc-status.mc-pending {
    background: #fee2e2;
    color: #991b1b;
}
.mc-status.mc-info {
    background: transparent;
    color: #6b7280;
    font-weight: 400;
    font-size: 0.75rem;
}
.mc-divider {
    width: 1px;
    height: 20px;
    background: rgba(0, 0, 0, 0.12);
    margin: 0 2px;
}
.mc-segment-king {
    margin-left: auto;
}
.mc-workflow-trigger {
    margin-left: 8px;
}
.mc-btn {
    background: var(--color-primary, #0AA692);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.mc-btn:hover {
    opacity: 0.85;
}

/* Workflow Stepper */
.mc-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 16px 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.mc-step {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    transition: all 0.3s;
}
.mc-step-num {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    background: #e5e7eb;
    color: #6b7280;
}
.mc-step-label {
    color: #6b7280;
}
.mc-step-arrow {
    color: #d1d5db;
    font-size: 0.8rem;
}
.mc-step.mc-step-done .mc-step-num {
    background: #16a34a;
    color: white;
}
.mc-step.mc-step-done .mc-step-label {
    color: #16a34a;
}
.mc-step.mc-step-active .mc-step-num {
    background: var(--color-primary, #0AA692);
    color: white;
    animation: mc-pulse 2s infinite;
}
.mc-step.mc-step-active .mc-step-label {
    color: var(--color-primary, #0AA692);
    font-weight: 600;
}
@keyframes mc-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(10, 166, 146, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(10, 166, 146, 0); }
}

/* Dark Mode */
body.dark-mode .mission-control {
    background: rgba(30, 30, 50, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}
body.dark-mode .mc-label {
    color: #d1d5db;
}
body.dark-mode .mc-segment:hover {
    background: rgba(255, 255, 255, 0.05);
}
body.dark-mode .mc-divider {
    background: rgba(255, 255, 255, 0.12);
}
body.dark-mode .mc-status.mc-done {
    background: rgba(22, 163, 74, 0.2);
    color: #4ade80;
}
body.dark-mode .mc-status.mc-progress {
    background: rgba(217, 119, 6, 0.2);
    color: #fbbf24;
}
body.dark-mode .mc-status.mc-pending {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}
body.dark-mode .mc-status.mc-info {
    color: #9ca3af;
}
body.dark-mode .mc-step-num {
    background: #374151;
    color: #9ca3af;
}
body.dark-mode .mc-step-label {
    color: #9ca3af;
}
body.dark-mode .mc-step-arrow {
    color: #4b5563;
}
body.dark-mode .mc-stepper {
    border-top-color: rgba(255, 255, 255, 0.06);
}

/* Mobile: kompakte Bar */
@media (max-width: 768px) {
    .mc-bar {
        font-size: 0.72rem;
        padding: 4px 8px;
        gap: 2px;
    }
    .mc-label {
        display: none;
    }
    .mc-segment-king .mc-label {
        display: inline;
    }
    .mc-workflow-trigger {
        display: none;
    }
    .mc-stepper {
        font-size: 0.7rem;
    }
    .mc-step-label {
        display: none;
    }
}
