:root {
            /* Case Colors */
            --nom: #3b82f6;
            --acc: #ef4444;
            --dat: #10b981;
            --gen: #8b5cf6;
            /* Gender Colors */
            --masc: #06b6d4;
            --fem: #ec4899;
            --neut: #f59e0b;
            --plural: #6366f1;
            /* UI Colors */
            --primary: #1e40af;
            --secondary: #64748b;
            --success: #22c55e;
            --error: #ef4444;
            --warning: #f59e0b;
            --bg: #f8fafc;
            --card: #ffffff;
            --text: #1e293b;
            --text-light: #64748b;
            --border: #e2e8f0;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: var(--bg);
            color: var(--text);
            line-height: 1.6;
        }

        /* Header */
        .chapter-header {
            background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
            color: white;
            padding: 2rem 1rem;
            text-align: center;
        }

        .chapter-badge {
            display: inline-block;
            background: rgba(255,255,255,0.2);
            padding: 0.5rem 1rem;
            border-radius: 20px;
            font-size: 0.875rem;
            margin-bottom: 1rem;
        }

        .chapter-header h1 {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }

        .chapter-header p {
            opacity: 0.9;
            max-width: 600px;
            margin: 0 auto;
        }

        /* Navigation */
        .chapter-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem;
            background: var(--card);
            border-bottom: 1px solid var(--border);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .chapter-nav a {
            color: var(--primary);
            text-decoration: none;
            padding: 0.5rem 1rem;
            border-radius: 8px;
            transition: all 0.2s;
        }

        .chapter-nav a:hover {
            background: #eff6ff;
        }

        .progress-bar {
            font-size: 0.875rem;
            color: var(--text-light);
        }

        /* Container */
        .container {
            max-width: 900px;
            margin: 0 auto;
            padding: 2rem 1rem;
        }

        /* Theory Cards */
        .theory-card {
            background: var(--card);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

        .theory-card h2 {
            color: var(--primary);
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .theory-card h3 {
            color: var(--text);
            margin: 1.5rem 0 0.75rem;
            font-size: 1.1rem;
        }

        .theory-card p {
            margin-bottom: 1rem;
            color: var(--text);
        }

        /* Example Box */
        .example-box {
            background: #f1f5f9;
            border-left: 4px solid var(--primary);
            padding: 1rem;
            margin: 1rem 0;
            border-radius: 0 8px 8px 0;
        }

        .example-box .de {
            font-weight: 600;
            color: var(--primary);
        }

        .example-box .en {
            color: var(--text-light);
            font-size: 0.95rem;
        }

        /* Audio Button */
        .audio-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 1.2rem;
            padding: 0.25rem;
            margin-left: 0.5rem;
            opacity: 0.7;
            transition: opacity 0.2s;
        }

        .audio-btn:hover {
            opacity: 1;
        }

        /* Tables */
        .table-container {
            overflow-x: auto;
            margin: 1.5rem 0;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.95rem;
        }

        th, td {
            padding: 0.75rem;
            text-align: left;
            border: 1px solid var(--border);
        }

        th {
            background: #f8fafc;
            font-weight: 600;
        }

        /* Case color coding */
        .case-nom { color: var(--nom); font-weight: 600; }
        .case-acc { color: var(--acc); font-weight: 600; }
        .case-dat { color: var(--dat); font-weight: 600; }
        .case-gen { color: var(--gen); font-weight: 600; }

        /* Gender color coding */
        .gender-masc { color: var(--masc); font-weight: 600; }
        .gender-fem { color: var(--fem); font-weight: 600; }
        .gender-neut { color: var(--neut); font-weight: 600; }
        .gender-plural { color: var(--plural); font-weight: 600; }

        /* Ending highlight */
        .ending {
            font-weight: 700;
            text-decoration: underline;
        }

        /* Exercise Section */
        .exercise-section {
            background: var(--card);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

        .exercise-section h2 {
            color: var(--primary);
            margin-bottom: 0.5rem;
        }

        .exercise-intro {
            color: var(--text-light);
            margin-bottom: 1.5rem;
            font-style: italic;
        }

        /* Exercise Items */
        .exercise-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 1rem;
            background: #f8fafc;
            border-radius: 8px;
            margin-bottom: 0.75rem;
            flex-wrap: wrap;
        }

        .exercise-number {
            background: var(--primary);
            color: white;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.875rem;
            font-weight: 600;
            flex-shrink: 0;
        }

        .exercise-text {
            flex: 1;
            min-width: 200px;
        }

        .exercise-input {
            width: 80px;
            padding: 0.5rem;
            border: 2px solid var(--border);
            border-radius: 6px;
            font-size: 1rem;
            text-align: center;
        }

        .exercise-input:focus {
            outline: none;
            border-color: var(--primary);
        }

        .exercise-input.correct {
            border-color: var(--success);
            background: #f0fdf4;
        }

        .exercise-input.incorrect {
            border-color: var(--error);
            background: #fef2f2;
        }

        .hint {
            font-size: 0.8rem;
            color: var(--text-light);
            margin-left: 0.5rem;
        }

        .feedback {
            font-size: 0.875rem;
            margin-left: 0.5rem;
            display: none;
        }

        .feedback.show {
            display: inline;
        }

        .feedback.correct {
            color: var(--success);
        }

        .feedback.incorrect {
            color: var(--error);
        }

        /* Translation exercise */
        .translation-item {
            padding: 1rem;
            background: #f8fafc;
            border-radius: 8px;
            margin-bottom: 0.75rem;
        }

        .translation-en {
            font-weight: 600;
            margin-bottom: 0.5rem;
        }

        .translation-input {
            width: 100%;
            max-width: 400px;
            padding: 0.75rem;
            border: 2px solid var(--border);
            border-radius: 6px;
            font-size: 1rem;
        }

        /* Buttons */
        .btn {
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.2s;
            margin-top: 1rem;
        }

        .btn-primary {
            background: var(--primary);
            color: white;
        }

        .btn-primary:hover {
            background: #1e3a8a;
        }

        .btn-secondary {
            background: var(--secondary);
            color: white;
        }

        .btn-secondary:hover {
            background: #475569;
        }

        /* Checklist */
        .checklist {
            background: var(--card);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .checklist h2 {
            color: var(--primary);
            margin-bottom: 1rem;
        }

        .checklist-item {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            padding: 0.75rem 0;
            border-bottom: 1px solid var(--border);
        }

        .checklist-item:last-child {
            border-bottom: none;
        }

        .checklist-item input[type="checkbox"] {
            width: 20px;
            height: 20px;
            margin-top: 2px;
            cursor: pointer;
        }

        /* Bridge Section */
        .connectivity {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.5rem;
            margin: 2rem 0;
        }

        .from-prev, .to-next {
            background: var(--card);
            border-radius: 12px;
            padding: 1.5rem;
        }

        .from-prev {
            border-left: 4px solid var(--success);
        }

        .to-next {
            border-right: 4px solid var(--warning);
        }

        .from-prev h4, .to-next h4 {
            margin-bottom: 0.5rem;
        }

        .from-prev h4 {
            color: var(--success);
        }

        .to-next h4 {
            color: var(--warning);
        }

        /* Streak Counter */
        .streak-counter {
            position: fixed;
            top: 80px;
            right: 20px;
            background: var(--card);
            padding: 0.75rem 1rem;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
        }

        .streak-counter .flame {
            font-size: 1.5rem;
        }

        /* Progress indicator */
        .progress-indicator {
            position: fixed;
            top: 0;
            left: 0;
            height: 4px;
            background: var(--success);
            transition: width 0.3s;
            z-index: 101;
        }

        /* Key points box */
        .key-points {
            background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
            border-radius: 8px;
            padding: 1rem;
            margin: 1rem 0;
        }

        .key-points h4 {
            color: var(--primary);
            margin-bottom: 0.5rem;
        }

        .key-points ul {
            margin-left: 1.5rem;
        }

        .key-points li {
            margin-bottom: 0.25rem;
        }

        /* Pattern note */
        .pattern-note {
            background: #fef3c7;
            border-left: 4px solid var(--warning);
            padding: 1rem;
            margin: 1rem 0;
            border-radius: 0 8px 8px 0;
        }

        .pattern-note strong {
            color: #92400e;
        }

        /* Mobile responsive */
        @media (max-width: 768px) {
            .chapter-header h1 {
                font-size: 1.5rem;
            }

            .chapter-nav {
                flex-direction: column;
                gap: 0.5rem;
            }

            .chapter-nav a {
                font-size: 0.875rem;
            }

            .connectivity {
                grid-template-columns: 1fr;
            }

            .streak-counter {
                position: static;
                margin: 1rem;
                justify-content: center;
            }

            table {
                font-size: 0.8rem;
            }

            th, td {
                padding: 0.5rem;
            }
        }
