        /* ── Nur anwendungsspezifische Ergänzungen ── */

        /* Zeilennummern in Code-Blöcken */
        :root {
            --clr-line-num: #4a5568;
            --clr-code-bg: #0d1117;
            --clr-code-border: #30363d;
        }

        html[data-theme="light"] {
            --clr-code-bg: #f6f8fa;
            --clr-code-border: #d0d7de;
            --clr-line-num: #8b949e;
        }

        /* ── NAV ── */
        .app-nav {
            background: var(--panel-bg);
            border-bottom: 1px solid var(--border-color);
            padding: 0 1.5rem;
            display: flex;
            gap: 0;
            overflow-x: auto;
            box-shadow: var(--shadow-sm);
        }

        .nav-btn {
            padding: 0.85rem 1rem;
            border: none;
            background: transparent;
            color: var(--clr-muted);
            cursor: pointer;
            font-size: 0.83rem;
            font-weight: 600;
            border-bottom: 3px solid transparent;
            transition: var(--transition-fast);
            white-space: nowrap;
            font-family: inherit;
        }

        .nav-btn:hover {
            color: var(--clr-text);
            background: var(--box-bg);
        }

        .nav-btn.active {
            color: var(--clr-accent-text);
            border-bottom-color: var(--clr-accent);
        }

        .nav-btn.done-nav::after {
            content: ' ✓';
            font-size: 0.68rem;
            color: var(--success-text);
        }

        /* ── SECTION ── */
        .section {
            display: none;
        }

        .section.active {
            display: block;
        }

        /* ── PRIMM LABELS ── */
        .primm-label {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.28rem 0.8rem;
            border-radius: 999px;
            font-size: 0.74rem;
            font-weight: 700;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            margin-bottom: 0.8rem;
        }

        .primm-predict {
            background: rgba(167, 139, 250, 0.15);
            color: #a78bfa;
            border: 1px solid rgba(167, 139, 250, 0.4);
        }

        .primm-run {
            background: rgba(52, 211, 153, 0.12);
            color: var(--success-text);
            border: 1px solid rgba(52, 211, 153, 0.4);
        }

        .primm-investigate {
            background: rgba(251, 191, 36, 0.12);
            color: var(--warning-text);
            border: 1px solid rgba(251, 191, 36, 0.4);
        }

        .primm-modify {
            background: rgba(56, 189, 248, 0.12);
            color: var(--clr-accent2-text);
            border: 1px solid rgba(56, 189, 248, 0.4);
        }

        .primm-make {
            background: rgba(244, 114, 182, 0.12);
            color: #f472b6;
            border: 1px solid rgba(244, 114, 182, 0.4);
        }

        /* ── STEP INDICATOR ── */
        .step-indicator {
            display: flex;
            gap: 0.35rem;
            align-items: center;
            margin-bottom: 1.2rem;
            flex-wrap: wrap;
        }

        .step {
            display: flex;
            align-items: center;
            gap: 0.3rem;
            font-size: 0.78rem;
            color: var(--clr-muted);
        }

        .step-num {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: var(--border-color);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.68rem;
            font-weight: 700;
            flex-shrink: 0;
        }

        .step.done .step-num {
            background: var(--success);
            color: #0f172a;
        }

        .step.active .step-num {
            background: var(--clr-accent2);
            color: #0f172a;
        }

        .step.active {
            color: var(--clr-text);
        }

        .step-sep {
            color: var(--border-color);
        }

        /* ── TASK CARD (PRIMM-Karte) ── */
        .primm-card {
            background: var(--panel-bg);
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            padding: 1.5rem;
            margin-bottom: 1.25rem;
            box-shadow: var(--shadow-sm);
            transition: var(--transition-fast);
        }

        .primm-card.locked {
            opacity: 0.4;
            pointer-events: none;
        }

        .primm-card:not(.locked):hover {
            border-color: var(--clr-accent);
            box-shadow: var(--shadow);
        }

        .task-title {
            font-size: 1.05rem;
            font-weight: 700;
            margin-bottom: 0.6rem;
            color: var(--clr-text);
        }

        .difficulty {
            display: flex;
            gap: 3px;
            align-items: center;
        }

        .dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--border-color);
        }

        .dot.filled {
            background: var(--warning);
        }

        .task-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 1rem;
            flex-wrap: wrap;
            margin-bottom: 0.7rem;
        }

        /* ── CODE BLOCK (readonly, mit Zeilennummern) ── */
        .code-wrap {
            margin: 0.9rem 0;
            border: 1px solid var(--clr-code-border);
            border-radius: 8px;
            overflow: hidden;
            background: var(--clr-code-bg);
        }

        .code-inner {
            display: flex;
            overflow-x: auto;
        }

        .line-nums {
            display: flex;
            flex-direction: column;
            padding: 0.9rem 0;
            background: #090d12;
            border-right: 1px solid #21262d;
            user-select: none;
            flex-shrink: 0;
        }

        html[data-theme="light"] .line-nums {
            background: #eaeef2;
            border-right-color: #d0d7de;
        }

        .line-nums span {
            display: block;
            padding: 0 0.7rem;
            font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
            font-size: 0.82rem;
            line-height: 1.75;
            color: var(--clr-line-num);
            text-align: right;
            min-width: 2.4rem;
        }

        .code-content {
            padding: 0.9rem 1.2rem;
            font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
            font-size: 0.86rem;
            line-height: 1.75;
            color: #e6edf3;
            white-space: pre;
            flex: 1;
        }

        html[data-theme="light"] .code-content {
            color: #24292f;
        }

        /* Syntax colors */
        .kw {
            color: #ff7b72;
        }

        .tp {
            color: #79c0ff;
        }

        .fn {
            color: #d2a8ff;
        }

        .nm {
            color: #79c0ff;
        }

        .cm {
            color: #8b949e;
            font-style: italic;
        }

        .var {
            color: #ffa657;
        }

        html[data-theme="light"] .kw {
            color: #cf222e;
        }

        html[data-theme="light"] .tp {
            color: #0550ae;
        }

        html[data-theme="light"] .fn {
            color: #6639ba;
        }

        html[data-theme="light"] .nm {
            color: #0550ae;
        }

        html[data-theme="light"] .var {
            color: #953800;
        }

        /* ── CODE EDITOR (editierbar, mit Zeilennummern) ── */
        .code-editor {
            background: var(--clr-code-bg);
            border: 1px solid var(--clr-code-border);
            border-radius: 8px;
            overflow: hidden;
            margin: 0.9rem 0;
        }

        .editor-toolbar {
            background: #161b22;
            padding: 0.42rem 1rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid var(--clr-code-border);
        }

        html[data-theme="light"] .editor-toolbar {
            background: #f0f3f6;
        }

        .editor-toolbar span {
            font-size: 0.73rem;
            color: var(--clr-muted);
        }

        .editor-body {
            display: flex;
            align-items: stretch;
        }

        .editor-line-nums {
            background: #090d12;
            border-right: 1px solid #21262d;
            padding: 0.9rem 0;
            flex-shrink: 0;
            user-select: none;
            pointer-events: none;
            overflow-y: hidden;
            min-width: 2.6rem;
        }

        html[data-theme="light"] .editor-line-nums {
            background: #eaeef2;
            border-right-color: #d0d7de;
        }

        .editor-line-nums span {
            display: block;
            font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
            font-size: 0.84rem;
            line-height: 1.75;
            color: var(--clr-line-num);
            text-align: right;
            padding: 0 0.7rem;
        }

        textarea.code-textarea {
            flex: 1;
            background: var(--clr-code-bg);
            border: none;
            color: #e6edf3;
            font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
            font-size: 0.84rem;
            line-height: 1.75;
            padding: 0.9rem 1.2rem;
            resize: none;
            overflow-y: hidden;
            overflow-x: auto;
            tab-size: 4;
            box-sizing: border-box;
            white-space: pre;
            word-wrap: normal;
            height: auto;
        }

        html[data-theme="light"] textarea.code-textarea {
            color: #24292f;
        }

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

        /* ── TRACE TABLE ── */
        .trace-container {
            overflow-x: auto;
            margin: 0.9rem 0;
        }

        .trace-table {
            border-collapse: collapse;
            width: 100%;
            min-width: 340px;
            font-size: 0.83rem;
        }

        .trace-table th {
            background: rgba(56, 189, 248, 0.1);
            color: var(--clr-accent2-text);
            padding: 0.52rem 0.7rem;
            text-align: center;
            border: 1px solid var(--border-color);
            font-weight: 700;
            white-space: nowrap;
        }

        .trace-table td {
            border: 1px solid var(--border-color);
            padding: 0.33rem 0.45rem;
            text-align: center;
            background: var(--box-bg);
            font-family: monospace;
            color: var(--clr-muted);
        }

        .trace-table tr:nth-child(even) td {
            background: rgba(255, 255, 255, 0.02);
        }

        .trace-table tbody tr:hover td {
            background: rgba(52, 211, 153, 0.05);
        }

        .trace-table td.fixed {
            color: var(--clr-muted);
        }

        .trace-input {
            background: var(--clr-bg);
            border: 1px solid var(--border-color);
            border-radius: 4px;
            color: var(--clr-text);
            font-family: monospace;
            font-size: 0.83rem;
            padding: 0.22rem 0.35rem;
            width: 66px;
            text-align: center;
            transition: border-color 0.2s;
        }

        .trace-input:focus {
            outline: none;
            border-color: var(--clr-accent);
        }

        .trace-input.correct {
            border-color: var(--success);
            background: rgba(52, 211, 153, 0.08);
            color: var(--success-text);
        }

        .trace-input.wrong {
            border-color: var(--danger);
            background: rgba(248, 113, 113, 0.08);
            color: var(--danger-text);
        }

        /* ── ARRAY VISUAL ── */
        .array-visual {
            display: flex;
            gap: 0;
            align-items: stretch;
            margin: 0.7rem 0;
            flex-wrap: wrap;
            row-gap: 0.5rem;
        }

        .arr-cell {
            border: 2px solid var(--border-color);
            border-right: none;
            min-width: 54px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .arr-cell:last-child {
            border-right: 2px solid var(--border-color);
            border-radius: 0 6px 6px 0;
        }

        .arr-cell:first-child {
            border-radius: 6px 0 0 6px;
        }

        .arr-idx {
            font-size: 0.66rem;
            color: var(--clr-muted);
            background: rgba(56, 189, 248, 0.1);
            width: 100%;
            text-align: center;
            padding: 0.1rem;
            font-family: monospace;
        }

        .arr-val {
            font-family: monospace;
            font-size: 0.98rem;
            font-weight: 700;
            color: var(--clr-accent2-text);
            padding: 0.42rem 0.3rem;
            min-height: 2.3rem;
            display: flex;
            align-items: center;
        }

        .arr-cell.input-cell input {
            width: 54px;
            background: var(--clr-bg);
            border: none;
            color: var(--clr-text);
            font-family: monospace;
            font-size: 0.9rem;
            font-weight: 700;
            text-align: center;
            padding: 0.42rem 0.15rem;
            min-height: 2.3rem;
        }

        .arr-cell.input-cell input:focus {
            outline: none;
            background: var(--box-bg);
        }

        .arr-cell.input-cell input.correct {
            color: var(--success-text);
            background: rgba(52, 211, 153, 0.08);
        }

        .arr-cell.input-cell input.wrong {
            color: var(--danger-text);
            background: rgba(248, 113, 113, 0.08);
        }

        /* ── FEEDBACK ── */
        .feedback {
            padding: 0.72rem 1rem;
            border-radius: 8px;
            font-size: 0.87rem;
            margin-top: 0.75rem;
            display: none;
            animation: fadeIn 0.3s ease;
        }

        .feedback.show {
            display: flex;
            align-items: flex-start;
            gap: 0.5rem;
        }

        .feedback.ok {
            background: rgba(52, 211, 153, 0.1);
            border: 1px solid var(--success);
            color: var(--success-text);
        }

        .feedback.err {
            background: rgba(248, 113, 113, 0.1);
            border: 1px solid var(--danger);
            color: var(--danger-text);
        }

        .feedback.hint {
            background: rgba(251, 191, 36, 0.1);
            border: 1px solid var(--warning);
            color: var(--warning-text);
        }

        /* ── CHOICE BUTTONS ── */
        .choice-group {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            margin-top: 0.6rem;
        }

        .btn-choice {
            padding: 0.45rem 1rem;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            background: var(--box-bg);
            color: var(--clr-text);
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 600;
            font-family: inherit;
            transition: var(--transition-fast);
        }

        .btn-choice:hover {
            border-color: var(--clr-accent);
            background: rgba(52, 211, 153, 0.08);
            color: var(--clr-accent-text);
        }

        .btn-choice.sm {
            padding: 0.32rem 0.75rem;
            font-size: 0.77rem;
        }

        /* ── ACTION BUTTONS ── */
        .btn-action {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.55rem 1.25rem;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.86rem;
            font-weight: 700;
            font-family: inherit;
            transition: var(--transition-fast);
        }

        .btn-action.primary {
            background: var(--clr-accent2);
            color: #0f172a;
        }

        .btn-action.primary:hover {
            background: #7dd3fc;
            transform: translateY(-1px);
        }

        .btn-action.success {
            background: var(--success);
            color: #0f172a;
        }

        .btn-action.success:hover {
            background: #6ee7b7;
            transform: translateY(-1px);
        }

        .btn-action.ghost {
            background: var(--box-bg);
            color: var(--clr-muted);
            border: 1px solid var(--border-color);
        }

        .btn-action.ghost:hover {
            border-color: var(--clr-accent);
            color: var(--clr-accent-text);
        }

        .btn-action.warn {
            background: var(--warning);
            color: #0f172a;
        }

        .btn-action.sm {
            padding: 0.3rem 0.7rem;
            font-size: 0.75rem;
        }

        .btn-group {
            display: flex;
            gap: 0.55rem;
            flex-wrap: wrap;
            margin-top: 0.9rem;
        }

        /* ── HINT ── */
        .hint-btn {
            font-size: 0.76rem;
            color: var(--warning-text);
            background: none;
            border: 1px solid rgba(251, 191, 36, 0.4);
            border-radius: 6px;
            padding: 0.27rem 0.62rem;
            cursor: pointer;
            font-family: inherit;
            transition: var(--transition-fast);
        }

        .hint-btn:hover {
            background: rgba(251, 191, 36, 0.1);
        }

        .hint-box {
            background: rgba(251, 191, 36, 0.06);
            border: 1px solid rgba(251, 191, 36, 0.35);
            border-radius: 8px;
            padding: 0.72rem 1rem;
            font-size: 0.83rem;
            color: var(--warning-text);
            margin-top: 0.55rem;
            display: none;
            line-height: 1.6;
        }

        .hint-box.show {
            display: block;
            animation: fadeIn 0.25s;
        }

        /* ── BADGES ── */
        .badges-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
            gap: 0.7rem;
            margin-top: 0.7rem;
        }

        .badge-item {
            background: var(--box-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 0.8rem;
            text-align: center;
            opacity: 0.28;
            filter: grayscale(0.6);
            transition: var(--transition-fast);
            cursor: default;
        }

        .badge-item.earned {
            opacity: 1;
            filter: none;
            border-color: var(--warning);
            background: rgba(251, 191, 36, 0.06);
            box-shadow: 0 0 14px rgba(251, 191, 36, 0.15);
            animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .badge-item:not(.earned):hover {
            opacity: 0.52;
            filter: grayscale(0.2);
            border-color: var(--clr-muted);
        }

        @keyframes popIn {
            from {
                transform: scale(0.8);
                opacity: 0;
            }

            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        .badge-icon {
            font-size: 1.85rem;
            margin-bottom: 0.28rem;
        }

        .badge-name {
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--clr-text);
        }

        .badge-desc {
            font-size: 0.64rem;
            color: var(--clr-muted);
            margin-top: 0.15rem;
        }

        .badge-item:not(.earned) .badge-icon::after {
            content: ' 🔒';
            font-size: 0.6rem;
            vertical-align: super;
        }

        /* ── DASHBOARD STAT CARDS ── */
        .stat-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 0.9rem;
            margin-bottom: 1.75rem;
        }

        .stat-card {
            background: var(--panel-bg);
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            padding: 1.1rem;
            text-align: center;
            box-shadow: var(--shadow-sm);
            transition: var(--transition-fast);
        }

        .stat-card:hover {
            border-color: var(--clr-accent);
            box-shadow: var(--shadow);
        }

        .stat-card .big-num {
            font-size: 2.2rem;
            font-weight: 800;
            background: linear-gradient(135deg, var(--clr-accent), var(--clr-accent2));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .stat-card .label {
            font-size: 0.77rem;
            color: var(--clr-muted);
            margin-top: 0.15rem;
        }

        /* ── PROGRESS BAR ── */
        .progress-wrap {
            background: var(--box-bg);
            border-radius: 999px;
            height: 5px;
            overflow: hidden;
            margin: 0.3rem 0;
        }

        .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, var(--clr-accent), var(--clr-accent2));
            border-radius: 999px;
            transition: width 0.4s ease;
        }

        /* ── TOAST ── */
        .toast-container {
            position: fixed;
            top: 1.25rem;
            right: 1.25rem;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .toast {
            background: var(--panel-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 0.72rem 1.1rem;
            display: flex;
            align-items: center;
            gap: 0.55rem;
            font-size: 0.84rem;
            box-shadow: var(--shadow);
            animation: slideIn 0.3s ease;
            min-width: 220px;
            max-width: 300px;
            color: var(--clr-text);
        }

        .toast.badge-toast {
            border-color: var(--warning);
        }

        .toast.success-toast {
            border-color: var(--success);
        }

        .toast.streak-toast {
            border-color: #f97316;
        }

        @keyframes slideIn {
            from {
                transform: translateX(120%);
                opacity: 0;
            }

            to {
                transform: none;
                opacity: 1;
            }
        }

        @keyframes slideOut {
            from {
                transform: none;
                opacity: 1;
            }

            to {
                transform: translateX(120%);
                opacity: 0;
            }
        }

        .toast.hiding {
            animation: slideOut 0.3s ease forwards;
        }

        /* ── COMPLETION OVERLAY ── */
        .completion-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.75);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 9997;
        }

        .completion-overlay.show {
            display: flex;
            animation: fadeIn 0.3s;
        }

        .completion-box {
            background: var(--panel-bg);
            border: 2px solid var(--warning);
            border-radius: var(--radius-lg);
            padding: 2.4rem;
            text-align: center;
            max-width: 400px;
            width: 90%;
            box-shadow: var(--shadow-lg);
        }

        .completion-box h2 {
            font-size: 1.6rem;
            margin-bottom: 0.5rem;
            color: var(--clr-text);
        }

        .completion-box p {
            color: var(--clr-muted);
            margin-bottom: 1rem;
        }

        .xp-badge {
            display: inline-block;
            background: linear-gradient(135deg, var(--warning), #f59e0b);
            color: #0f172a;
            font-weight: 800;
            font-size: 1.1rem;
            padding: 0.35rem 1rem;
            border-radius: 999px;
            margin: 0.4rem 0;
        }

        /* ── CONFETTI ── */
        #confetti-canvas {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 9998;
        }

        /* ── HEADER STAT PILLS ── */
        .stat-pill {
            background: var(--box-bg);
            border: 1px solid var(--border-color);
            border-radius: 999px;
            padding: 0.3rem 0.85rem;
            font-size: 0.8rem;
            display: flex;
            align-items: center;
            gap: 0.35rem;
            color: var(--clr-muted);
        }

        .stat-pill .val {
            font-weight: 700;
            color: var(--clr-accent-text);
        }

        .streak-anim {
            animation: flicker 1.5s infinite alternate;
        }

        @keyframes flicker {
            from {
                filter: drop-shadow(0 0 3px #f97316);
            }

            to {
                filter: drop-shadow(0 0 10px #fb923c);
            }
        }

        .stats-bar {
            display: flex;
            gap: 0.6rem;
            flex-wrap: wrap;
            align-items: center;
        }

        /* ── RESPONSIVE ── */
        @media (max-width: 640px) {
            .trace-input {
                width: 48px;
            }

            .nav-btn {
                padding: 0.7rem 0.65rem;
                font-size: 0.74rem;
            }
        }

        /* ═══════════════════════════════════════════════════════════
           RESPONSIVE – Tablet und Smartphone
        ═══════════════════════════════════════════════════════════ */

        /* Touch: Hover deaktivieren (klebt sonst am Element) */
        @media (hover: none) {
            .primm-card:not(.locked):hover { border-color: var(--border-color); box-shadow: var(--shadow-sm); }
            .btn-choice:hover { border-color: var(--border-color); background: var(--box-bg); color: var(--clr-text); }
            .nav-btn:hover    { background: transparent; color: var(--clr-muted); }
            .btn-choice:active { border-color: var(--clr-accent); background: rgba(52,211,153,.12); color: var(--clr-accent-text); transform: scale(.97); }
            .btn-action:active { opacity: .82; transform: scale(.97); }
            .nav-btn:active    { background: var(--box-bg); }
            .hint-btn:active   { opacity: .75; }
        }

        /* Tablet bis 1024px */
        @media (max-width: 1024px) {
            main.narrow    { padding: 1.25rem 1rem; }
            .dashboard-grid, .stat-grid { grid-template-columns: repeat(2,1fr); }
            .hero          { padding: 1.75rem 1rem; }
            .primm-card    { padding: 1.25rem; }
            .code-editor, textarea.code-textarea { font-size: 0.82rem; }
            .trace-table th, .trace-table td { padding: .42rem .4rem; font-size: .8rem; }
            .trace-input   { width: 58px; min-height: 36px; font-size: .82rem; }
            .btn-action    { min-height: 44px; padding: .6rem 1.1rem; }
            .btn-choice    { min-height: 44px; padding: .55rem .9rem; }
            .btn-choice.sm { min-height: 40px; padding: .45rem .75rem; font-size: .8rem; }
            .nav-btn       { min-height: 44px; padding: .75rem .85rem; }
        }

        /* Smartphone bis 640px */
        @media (max-width: 640px) {
            .breadcrumb    { font-size: .75rem; padding: .4rem .75rem; flex-wrap: wrap; gap: .2rem; }
            .stats-bar     { gap: .4rem; padding: .45rem .75rem; flex-wrap: wrap; }
            .stat-pill     { padding: .28rem .65rem; font-size: .75rem; }
            .nav-btn       { padding: .7rem .55rem; font-size: .72rem; min-height: 44px; }
            main.narrow    { padding: .9rem .65rem; }
            .primm-card    { padding: 1rem .85rem; margin-bottom: .9rem; }
            .primm-label   { font-size: .68rem; padding: .22rem .65rem; }
            .task-title    { font-size: .95rem; }
            .hero h1       { font-size: 1.3rem; }
            .hero p        { font-size: .84rem; }
            .hero .icon    { font-size: 2.2rem; }
            .dashboard-grid { grid-template-columns: 1fr; gap: .75rem; }
            .stat-grid     { grid-template-columns: repeat(2,1fr); gap: .6rem; }
            .stat-card     { padding: .85rem .65rem; }
            .stat-card .big-num { font-size: 1.6rem; }
            .step-indicator { gap: .22rem; }
            .si-step       { padding: .22rem .55rem; font-size: .66rem; }
            .trace-container { -webkit-overflow-scrolling: touch; margin: .7rem -.5rem; padding: 0 .5rem; }
            .trace-table   { font-size: .78rem; min-width: 280px; }
            .trace-table th, .trace-table td { padding: .38rem .3rem; }
            .trace-input   { width: 52px; min-height: 40px; padding: .3rem .2rem; font-size: .8rem; border-radius: 6px; }
            textarea.code-textarea { font-size: .78rem; line-height: 1.65; padding: .75rem .9rem; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
            .editor-line-nums span { font-size: .72rem; line-height: 1.65; padding: 0 .5rem; }
            .editor-line-nums { min-width: 2.1rem; }
            .choice-group  { gap: .45rem; }
            .btn-choice    { min-height: 44px; padding: .6rem .85rem; font-size: .82rem; border-radius: 10px; }
            .btn-choice.sm { width: 100%; text-align: left; min-height: 48px; padding: .6rem .9rem; font-size: .79rem; border-radius: 10px; line-height: 1.4; }
            .btn-group     { flex-direction: column; gap: .5rem; }
            .btn-action    { width: 100%; justify-content: center; min-height: 48px; font-size: .9rem; border-radius: 10px; }
            .btn-action.ghost.sm { width: auto; }
            .hint-btn      { width: 100%; min-height: 44px; justify-content: center; }
            .info-box      { font-size: .82rem; padding: .6rem .75rem; }
            .hint-box      { font-size: .8rem; }
            .feedback      { font-size: .82rem; }
            .completion-box { max-width: calc(100vw - 2rem); padding: 1.5rem 1.25rem; }
            .code-wrap     { font-size: .78rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
            .stack-frame   { padding: .55rem .7rem; font-size: .78rem; }
            .badge-grid    { grid-template-columns: repeat(2,1fr); gap: .6rem; }
            .badge-item    { padding: .75rem .5rem; }
            .badge-icon    { font-size: 1.6rem; }
            .badge-name    { font-size: .72rem; }
            .badge-desc    { font-size: .65rem; }
        }

        /* Sehr kleine Smartphones bis 400px */
        @media (max-width: 400px) {
            .nav-btn    { padding: .65rem .42rem; font-size: .67rem; }
            .primm-card { padding: .85rem .7rem; }
            .trace-input { width: 46px; font-size: .75rem; }
            textarea.code-textarea { font-size: .72rem; }
            .btn-choice.sm { font-size: .75rem; }
            .stat-grid  { grid-template-columns: 1fr; }
            .hero h1    { font-size: 1.15rem; }
        }

        /* Landscape-Tablet 641–1024px */
        @media (min-width: 641px) and (max-width: 1024px) {
            .btn-choice.sm { flex: 1 1 calc(50% - .25rem); }
            .trace-input   { width: 62px; }
        }

    
