:root {
            --sage-green: #9CAF88;
            --sage-light: #B8C5A8;
            --sage-dark: #7A8F6A;
            --warm-beige: #F5F1E8;
            --beige-medium: #E8E0D0;
            --beige-dark: #D4C8B8;
            --off-white: #FDFCF8;
            --text-dark: #2C3E2D;
            --text-medium: #4A5D4B;
            --text-light: #6B7D6C;
            --success: #6B8E6B;
            --error: #C67B7B;
            --warning: #D4A373;
            --shadow: rgba(44, 62, 45, 0.08);
        }

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

        body {
            font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background-color: var(--off-white);
            color: var(--text-dark);
            line-height: 1.6;
            font-size: 16px;
        }

        /* Toast Notifications */
        .toast-container {
            position: fixed;
            top: 1rem;
            right: 1rem;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            max-width: 400px;
        }

        .toast {
            background: var(--success);
            color: white;
            padding: 1rem 1.5rem;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            font-weight: 500;
            animation: slideIn 0.3s ease;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .toast.error {
            background: var(--error);
        }

        .toast.warning {
            background: var(--warning);
            color: var(--text-dark);
        }

        .toast.info {
            background: var(--sage-dark);
        }

        @keyframes slideIn {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }

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

        @keyframes slideOut {
            to { transform: translateX(100%); opacity: 0; }
        }

        /* Header & Navigation */
        .header {
            background: linear-gradient(135deg, var(--sage-green) 0%, var(--sage-dark) 100%);
            color: white;
            padding: 1.5rem 1rem;
            box-shadow: 0 2px 12px var(--shadow);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-content {
            max-width: 800px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .header h1 {
            font-size: 1.25rem;
            font-weight: 600;
            letter-spacing: -0.02em;
        }

        .progress-indicator {
            background: rgba(255,255,255,0.2);
            padding: 0.5rem 1rem;
            border-radius: 20px;
            font-size: 0.875rem;
            font-weight: 500;
        }

        .nav-buttons {
            display: flex;
            gap: 0.75rem;
            width: 100%;
            justify-content: space-between;
        }

        .nav-btn {
            background: rgba(255,255,255,0.9);
            color: var(--sage-dark);
            border: none;
            padding: 0.625rem 1.25rem;
            border-radius: 8px;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }

        .nav-btn:hover {
            background: white;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }

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

        /* Section Styling */
        .section {
            background: white;
            border-radius: 16px;
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: 0 4px 20px var(--shadow);
            border: 1px solid var(--beige-medium);
        }

        .section-title {
            font-size: 1.75rem;
            color: var(--sage-dark);
            margin-bottom: 1.5rem;
            padding-bottom: 0.75rem;
            border-bottom: 3px solid var(--sage-light);
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .section-title::before {
            content: '';
            width: 6px;
            height: 1.75rem;
            background: var(--sage-green);
            border-radius: 3px;
        }

        h3 {
            color: var(--text-medium);
            margin: 1.5rem 0 0.75rem;
            font-size: 1.25rem;
        }

        h4 {
            color: var(--text-medium);
            margin: 1.25rem 0 0.5rem;
            font-size: 1.1rem;
        }

        p {
            margin-bottom: 1rem;
            color: var(--text-medium);
        }

        .german-term {
            color: var(--sage-dark);
            font-weight: 600;
        }

        .translation {
            color: var(--text-light);
            font-style: italic;
            font-size: 0.95em;
        }

        /* Conjugation Table */
        .conjugation-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            margin: 1.5rem 0;
            background: var(--warm-beige);
            border-radius: 12px;
            overflow: hidden;
        }

        .conjugation-table th,
        .conjugation-table td {
            padding: 1rem;
            text-align: left;
            border-bottom: 1px solid var(--beige-medium);
        }

        .conjugation-table th {
            background: var(--sage-green);
            color: white;
            font-weight: 600;
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .conjugation-table tr:last-child td {
            border-bottom: none;
        }

        .conjugation-table tr:hover td {
            background: rgba(156, 175, 136, 0.1);
        }

        .pronoun-cell {
            font-weight: 600;
            color: var(--sage-dark);
        }

        .ending-highlight {
            background: var(--sage-light);
            color: white;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-weight: 600;
            font-size: 0.9em;
        }

        /* Example Boxes */
        .example-box {
            background: var(--warm-beige);
            border-left: 4px solid var(--sage-green);
            padding: 1rem 1.25rem;
            margin: 1rem 0;
            border-radius: 0 8px 8px 0;
        }

        .example-sentence {
            margin: 0.5rem 0;
            padding: 0.5rem 0;
            border-bottom: 1px dashed var(--beige-dark);
        }

        .example-sentence:last-child {
            border-bottom: none;
        }

        /* Exercise Styling */
        .exercise-container {
            margin: 2rem 0;
        }

        .exercise-header {
            background: var(--sage-green);
            color: white;
            padding: 1rem 1.5rem;
            border-radius: 12px 12px 0 0;
            font-weight: 600;
            font-size: 1.1rem;
        }

        .exercise-content {
            background: white;
            border: 2px solid var(--sage-light);
            border-top: none;
            border-radius: 0 0 12px 12px;
            padding: 1.5rem;
        }

        .exercise-instruction {
            background: var(--warm-beige);
            padding: 1rem;
            border-radius: 8px;
            margin-bottom: 1.5rem;
            color: var(--text-medium);
            font-size: 0.95rem;
        }

        /* Input Styling */
        .input-row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.75rem;
            margin: 1rem 0;
            padding: 0.75rem;
            background: var(--off-white);
            border-radius: 8px;
            transition: all 0.2s ease;
            border: 2px solid transparent;
        }

        .input-row:focus-within {
            background: white;
            border-color: var(--sage-light);
            box-shadow: 0 0 0 3px rgba(156, 175, 136, 0.1);
        }

        .input-row.incorrect {
            border-color: var(--error);
            background: rgba(198, 123, 123, 0.05);
        }

        .input-row.correct {
            border-color: var(--success);
            background: rgba(107, 142, 107, 0.05);
        }

        .input-label {
            font-weight: 500;
            color: var(--text-dark);
            min-width: 120px;
        }

        .input-field {
            flex: 1;
            min-width: 200px;
            padding: 0.625rem 1rem;
            border: 2px solid var(--beige-medium);
            border-radius: 8px;
            font-size: 1rem;
            transition: all 0.2s ease;
            background: white;
        }

        .input-field:focus {
            outline: none;
            border-color: var(--sage-green);
            box-shadow: 0 0 0 3px rgba(156, 175, 136, 0.1);
        }

        .input-field.correct {
            border-color: var(--success);
            background: rgba(107, 142, 107, 0.05);
        }

        .input-field.incorrect {
            border-color: var(--error);
            background: rgba(198, 123, 123, 0.05);
        }

        .input-field.warning {
            border-color: var(--warning);
            animation: shake 0.4s ease-in-out;
        }

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

        .feedback {
            font-size: 0.875rem;
            margin-top: 0.25rem;
            width: 100%;
            min-height: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

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

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

        .feedback:empty {
            display: none;
        }

        .correct-answer {
            color: var(--success);
            font-weight: 600;
        }

        /* Button Groups - Accessible Radio Buttons */
        .ending-options {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin: 0.5rem 0;
        }

        .ending-radio {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

        .ending-label {
            background: white;
            border: 2px solid var(--beige-medium);
            padding: 0.5rem 1rem;
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.2s ease;
            font-weight: 500;
            color: var(--text-medium);
            user-select: none;
            display: inline-block;
        }

        .ending-label:hover {
            border-color: var(--sage-green);
            background: var(--warm-beige);
        }

        .ending-radio:focus + .ending-label {
            outline: 3px solid var(--sage-green);
            outline-offset: 2px;
        }

        .ending-radio:checked + .ending-label {
            background: var(--sage-green);
            color: white;
            border-color: var(--sage-green);
        }

        .ending-radio:checked + .ending-label.correct-state {
            background: var(--success);
            border-color: var(--success);
        }

        .ending-radio:checked + .ending-label.incorrect-state {
            background: var(--error);
            border-color: var(--error);
        }

        .ending-label.correct-state {
            background: rgba(107, 142, 107, 0.2);
            border-color: var(--success);
            color: var(--success);
        }

        .ending-label.incorrect-state {
            background: rgba(198, 123, 123, 0.2);
            border-color: var(--error);
            color: var(--error);
        }

        /* Action Buttons */
        .action-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            margin-top: 2rem;
            padding-top: 1.5rem;
            border-top: 2px solid var(--beige-medium);
        }

        .btn {
            padding: 0.875rem 1.5rem;
            border: none;
            border-radius: 10px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            position: relative;
        }

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

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

        .btn-primary:hover:not(:disabled) {
            background: var(--sage-dark);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(156, 175, 136, 0.3);
        }

        .btn-secondary {
            background: var(--warm-beige);
            color: var(--text-medium);
            border: 2px solid var(--beige-medium);
        }

        .btn-secondary:hover:not(:disabled) {
            background: var(--beige-medium);
            border-color: var(--beige-dark);
        }

        .btn-warning {
            background: #E8D5B8;
            color: #8B7355;
        }

        .btn-warning:hover:not(:disabled) {
            background: #D4C8B8;
        }

        .btn .icon {
            width: 1.25rem;
            height: 1.25rem;
        }

        /* Info Boxes */
        .info-box {
            background: linear-gradient(135deg, var(--warm-beige) 0%, var(--beige-medium) 100%);
            border-radius: 12px;
            padding: 1.25rem;
            margin: 1.5rem 0;
            border-left: 4px solid var(--sage-green);
        }

        .info-box h4 {
            color: var(--sage-dark);
            margin-top: 0;
        }

        .checklist {
            list-style: none;
            padding: 0;
        }

        .checklist li {
            padding: 0.5rem 0;
            padding-left: 1.75rem;
            position: relative;
            color: var(--text-medium);
        }

        .checklist li::before {
            content: '✓';
            position: absolute;
            left: 0;
            color: var(--sage-green);
            font-weight: bold;
        }

        /* Progress Bar */
        .progress-container {
            background: var(--warm-beige);
            padding: 1rem;
            border-radius: 8px;
            margin-bottom: 1rem;
        }

        .progress-bar {
            height: 8px;
            background: var(--beige-medium);
            border-radius: 4px;
            overflow: hidden;
            margin-top: 0.5rem;
        }

        .progress-fill {
            height: 100%;
            background: var(--sage-green);
            width: 0%;
            transition: width 0.3s ease;
        }

        .progress-text {
            font-size: 0.875rem;
            color: var(--text-medium);
            font-weight: 500;
        }

        /* Status Indicator */
        .save-status {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.875rem;
            color: var(--text-light);
            margin-left: auto;
        }

        .save-status.saved::before {
            content: '✓';
            color: var(--success);
        }

        .save-status.saving::before {
            content: '○';
            animation: spin 1s linear infinite;
        }

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

        /* Footer */
        .footer {
            background: var(--warm-beige);
            padding: 2rem 1rem;
            margin-top: 3rem;
            border-top: 2px solid var(--beige-medium);
        }

        .footer-content {
            max-width: 800px;
            margin: 0 auto;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
        }

        .footer a {
            color: var(--sage-dark);
            text-decoration: none;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }

        .footer a:hover {
            color: var(--text-dark);
            text-decoration: underline;
        }

        /* Smooth Scroll */
        html {
            scroll-behavior: smooth;
        }

        /* Accessibility */
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border-width: 0;
        }

        /* Focus visible for keyboard navigation */
        *:focus-visible {
            outline: 3px solid var(--sage-green);
            outline-offset: 2px;
        }

        button:focus-visible,
        .ending-label:focus-visible,
        input:focus-visible {
            outline: 3px solid var(--sage-green);
            outline-offset: 2px;
        }

        /* Skip link */
        .skip-link {
            position: absolute;
            top: -40px;
            left: 0;
            background: var(--sage-dark);
            color: white;
            padding: 8px;
            text-decoration: none;
            z-index: 100;
        }

        .skip-link:focus {
            top: 0;
        }

        /* Responsive */
        @media (max-width: 640px) {
            .header h1 {
                font-size: 1.1rem;
            }

            .section {
                padding: 1.5rem 1rem;
            }

            .section-title {
                font-size: 1.4rem;
            }

            .conjugation-table th,
            .conjugation-table td {
                padding: 0.75rem 0.5rem;
                font-size: 0.9rem;
            }

            .input-row {
                flex-direction: column;
                align-items: stretch;
            }

            .input-label {
                min-width: auto;
            }

            .action-buttons {
                flex-direction: column;
            }

            .btn {
                width: 100%;
                justify-content: center;
            }

            .toast-container {
                left: 1rem;
                right: 1rem;
                max-width: none;
            }
        }

        /* Print styles */
        @media print {
            .header, .action-buttons, .footer, .toast-container, .ending-label {
                display: none;
            }
            
            .section {
                break-inside: avoid;
                box-shadow: none;
                border: 1px solid #ccc;
                page-break-inside: avoid;
            }

            .input-field {
                border: 1px solid #ccc;
                background: white !important;
            }

            .feedback {
                display: block !important;
                color: black !important;
            }

            .ending-radio:checked + .ending-label {
                background: #ddd;
                color: black;
                border: 2px solid black;
            }
        }
