.teach-container {
    padding: 0;
    min-height: 100vh;
    background: #f5f3ef;
}

.teach-app {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.teach-app.active {
    display: flex;
}

.teach-container .header {
    gap: 16px;
    align-items: center;
}

.teach-container .header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.teach-container .progress-chip {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.teach-container .header-title-container h1 {
    font-size: 1.7rem;
}

.teach-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.teach-chat .chat-area {
    background: #f5f3ef;
}

.horizontal-menu {
    border-bottom: 1px solid rgba(26, 85, 99, 0.08);
}

.horizontal-menu-item.active {
    background: rgba(26, 85, 99, 0.08);
}

.horizontal-menu-item.active::after {
    opacity: 1;
}

.horizontal-menu-empty {
    padding: 16px;
    font-size: 0.9rem;
    color: #5a6a72;
    text-align: center;
}

.teach-section-message .message-content {
    width: 100%;
    max-width: 680px;
}

.teach-section-message .message-text p {
    margin-bottom: 1em;
}

.teach-section-message .message-text ul,
.teach-section-message .message-text ol {
    margin: 0 0 1em 1.25em;
    padding-left: 0.6em;
}

.teach-section-message .message-text li {
    margin-bottom: 0.4em;
}

.teach-message-actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.teach-next-button {
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, #1e6a7a, #1a5563);
    color: #ffffff;
    transition: background 0.2s ease, transform 0.15s ease;
}

.teach-next-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #227b8d, #1e6a7a);
}

.teach-next-button:disabled {
    opacity: 0.7;
    cursor: default;
}

.teach-task-controls {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(26, 85, 99, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.teach-task-controls-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.teach-task-badge {
    background: rgba(26, 85, 99, 0.1);
    color: #1a5563;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.teach-task-label {
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(26, 85, 99, 0.65);
}

.teach-task-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #1a5563;
    position: relative;
}

.teach-task-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.teach-task-toggle-indicator {
    width: 42px;
    height: 24px;
    background: rgba(26, 85, 99, 0.2);
    border-radius: 999px;
    position: relative;
    transition: background 0.2s ease;
}

.teach-task-toggle-indicator::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.teach-task-toggle input:checked + .teach-task-toggle-indicator {
    background: linear-gradient(135deg, #1e6a7a, #1a5563);
}

.teach-task-toggle input:checked + .teach-task-toggle-indicator::after {
    transform: translateX(18px);
}

.teach-task-toggle-text {
    min-width: 110px;
}

.teach-task-message-completed .teach-task-toggle-text {
    font-weight: 600;
    color: #1a5563;
}

.teach-task-message-completed .teach-task-controls {
    border-top-color: rgba(30, 106, 122, 0.3);
}

.teach-notes-message .message-content {
    max-width: 680px;
    background: #ffffff;
    border: 1px solid rgba(26, 85, 99, 0.15);
}

.teach-notes-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.teach-notes-wrapper textarea {
    width: 100%;
    min-height: 150px;
    border-radius: 12px;
    border: 1px solid rgba(26, 85, 99, 0.2);
    padding: 14px;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    background: rgba(26, 85, 99, 0.05);
    color: #1a5563;
    font-family: 'Inter', sans-serif;
}

.teach-notes-wrapper textarea:focus {
    outline: none;
    border-color: rgba(30, 106, 122, 0.6);
    box-shadow: 0 0 0 2px rgba(30, 106, 122, 0.2);
    background: rgba(255, 255, 255, 0.95);
}

.teach-notes-status {
    font-size: 0.8rem;
    text-align: right;
    color: rgba(26, 85, 99, 0.6);
}

.teach-match-words {
    margin-top: 18px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid rgba(26, 85, 99, 0.15);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(26, 85, 99, 0.08);
}

.teach-match-words-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 16px;
}

.teach-match-words-column {
    flex: 1 1 260px;
}

.teach-match-words-item {
    margin-bottom: 14px;
}

.teach-match-words-item label {
    display: block;
    font-weight: 600;
    color: #1a5563;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.teach-match-words-number {
    display: inline-block;
    width: 24px;
}

.teach-match-words-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(26, 85, 99, 0.2);
    background: rgba(26, 85, 99, 0.05);
    color: #1a5563;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.teach-match-words-select:focus {
    outline: none;
    border-color: rgba(30, 106, 122, 0.6);
    box-shadow: 0 0 0 2px rgba(30, 106, 122, 0.2);
    background: #ffffff;
}

.teach-match-words-select.correct {
    border-color: rgba(46, 125, 50, 0.7);
    background: rgba(46, 125, 50, 0.12);
}

.teach-match-words-select.incorrect {
    border-color: rgba(198, 40, 40, 0.7);
    background: rgba(198, 40, 40, 0.12);
}

.teach-match-words-feedback {
    font-size: 0.85rem;
    margin-top: 6px;
    min-height: 20px;
    color: rgba(26, 85, 99, 0.8);
}

.teach-match-words-feedback.correct {
    color: #2e7d32;
}

.teach-match-words-feedback.incorrect {
    color: #c62828;
}

.teach-match-words-subheading {
    margin: 0 0 8px;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(26, 85, 99, 0.75);
}

.teach-match-words-definitions {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.teach-match-words-definitions li {
    background: rgba(26, 85, 99, 0.08);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.95rem;
    color: #1a5563;
    display: flex;
    align-items: center;
    gap: 10px;
}

.teach-match-words-definitions strong {
    font-weight: 700;
    display: inline-block;
    min-width: 22px;
}

.teach-match-words-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.teach-match-words-button {
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.teach-match-words-button.primary {
    background: linear-gradient(135deg, #1e6a7a, #1a5563);
    color: #ffffff;
}

.teach-match-words-button.primary:hover {
    background: linear-gradient(135deg, #227b8d, #1e6a7a);
}

.teach-match-words-button.secondary {
    background: rgba(26, 85, 99, 0.12);
    color: #1a5563;
}

.teach-match-words-button.secondary:hover {
    background: rgba(26, 85, 99, 0.18);
}

.teach-match-words-result {
    margin-top: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a5563;
}

.teach-match-words-result.success {
    color: #2e7d32;
}

.teach-match-words-result.error {
    color: #c62828;
}

.teach-match-words-result.warning {
    color: #d35400;
}

.teach-sentence-exercise {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.teach-sentence-item {
    background: #ffffff;
    border: 1px solid rgba(26, 85, 99, 0.14);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 26px rgba(26, 85, 99, 0.08);
}

.teach-sentence-item label {
    display: block;
    font-weight: 600;
    color: #1a5563;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.teach-sentence-number {
    display: inline-block;
    width: 24px;
}

.teach-sentence-input {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(26, 85, 99, 0.25);
    padding: 12px 14px;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 70px;
    color: #1a5563;
    background: rgba(26, 85, 99, 0.05);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.teach-sentence-input:focus {
    outline: none;
    border-color: rgba(30, 106, 122, 0.6);
    box-shadow: 0 0 0 2px rgba(30, 106, 122, 0.2);
    background: #ffffff;
}

.teach-sentence-input:disabled {
    background: rgba(26, 85, 99, 0.08);
    color: rgba(26, 85, 99, 0.8);
}

.teach-sentence-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.teach-sentence-send {
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #1e6a7a, #1a5563);
    color: #ffffff;
    transition: background 0.2s ease, transform 0.15s ease;
}

.teach-sentence-send:hover:not(:disabled) {
    background: linear-gradient(135deg, #227b8d, #1e6a7a);
}

.teach-sentence-send:disabled {
    opacity: 0.6;
    cursor: default;
}

.teach-sentence-feedback {
    font-size: 0.85rem;
    margin-top: 10px;
    min-height: 22px;
    color: rgba(26, 85, 99, 0.85);
}

.teach-sentence-feedback.success {
    color: #2e7d32;
    font-weight: 600;
}

.teach-sentence-feedback.error {
    color: #c62828;
}

.teach-sentence-example {
    margin-top: 8px;
    font-size: 0.85rem;
    color: rgba(26, 85, 99, 0.75);
    background: rgba(26, 85, 99, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
}

.teach-sentence-example span {
    font-weight: 600;
    margin-right: 4px;
    color: #1a5563;
}

.teach-sentence-overall {
    text-align: right;
    font-size: 0.85rem;
    color: rgba(26, 85, 99, 0.75);
    font-weight: 600;
}

.teach-sentence-overall.teach-sentence-overall-complete {
    color: #2e7d32;
}

.burger-button {
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.teach-logout-button {
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.teach-logout-button:hover {
    background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 900px) {
    .teach-container .header {
        padding: 16px 20px;
    }

    .teach-container .progress-chip {
        font-size: 0.8rem;
    }

    .teach-task-toggle-text {
        min-width: auto;
    }

    .teach-match-words {
        padding: 16px;
    }

    .teach-match-words-grid {
        flex-direction: column;
        gap: 18px;
    }

    .teach-match-words-column {
        flex: 1 1 auto;
    }

    .teach-match-words-actions {
        justify-content: flex-start;
    }

    .teach-sentence-item {
        padding: 14px;
    }

    .teach-sentence-actions {
        justify-content: flex-start;
    }

    .teach-sentence-overall {
        text-align: left;
    }

    .teach-blank-input {
        min-width: 120px;
        font-size: 0.9rem;
    }

    .teach-fill-blanks-grammar .teach-blank-input {
        min-width: 40px;
        width: 70px;
        max-width: 100px;
        padding: 2px 4px;
        font-size: 0.85rem;
    }

    .teach-choice-button {
        padding: 3px 6px;
        font-size: 0.9rem;
    }

    .teach-choice-feedback {
        font-size: 0.8rem;
        margin-left: 6px;
    }

    .teach-fill-blanks-actions {
        justify-content: flex-start;
    }
}

/* Fill-in-the-blanks exercise styles */
.teach-fill-blanks {
    margin-top: 18px;
}

.teach-blank-input {
    display: inline-block;
    min-width: 120px;
    padding: 6px 10px;
    margin: 0 4px;
    border-radius: 8px;
    border: 1px solid rgba(26, 85, 99, 0.25);
    background: rgba(26, 85, 99, 0.05);
    color: #1a5563;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    vertical-align: baseline;
}

/* Grammar exercises: smaller inline inputs that don't break lines */
.teach-fill-blanks-grammar .teach-blank-input {
    display: inline-block;
    width: 20px;
    max-width: 120px;
    padding: 3px 6px;
    margin: 0 2px;
    font-size: 0.9rem;
    vertical-align: baseline;
    line-height: 1.4;
}

/* Clickable choice buttons in "Choose and Write" exercises */
.teach-choices-wrapper {
    display: inline;
    margin: 0 4px;
}

.teach-choices-container {
    display: inline;
}

.teach-choice-button {
    display: inline;
    padding: 4px 8px;
    margin: 0 2px;
    border-radius: 6px;
    border: 2px solid rgba(26, 85, 99, 0.3);
    background: rgba(26, 85, 99, 0.08);
    color: #1a5563;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: baseline;
}

.teach-choice-button:hover:not(.disabled) {
    border-color: rgba(30, 106, 122, 0.6);
    background: rgba(30, 106, 122, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(26, 85, 99, 0.2);
}

.teach-choice-button:active:not(.disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(26, 85, 99, 0.15);
}

.teach-choice-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Correct choice button */
.teach-choice-button.correct {
    border-color: rgba(46, 125, 50, 0.8);
    background: rgba(46, 125, 50, 0.15);
    color: #2e7d32;
    font-weight: 600;
}

.teach-choice-button.correct.disabled {
    border-color: rgba(46, 125, 50, 0.7);
    background: rgba(46, 125, 50, 0.12);
}

/* Incorrect choice button */
.teach-choice-button.incorrect {
    border-color: rgba(198, 40, 40, 0.8);
    background: rgba(198, 40, 40, 0.15);
    color: #c62828;
    font-weight: 600;
}

.teach-choice-button.incorrect.disabled {
    border-color: rgba(198, 40, 40, 0.7);
    background: rgba(198, 40, 40, 0.12);
}

/* Feedback for choice buttons */
.teach-choice-feedback {
    display: inline;
    font-size: 0.85rem;
    margin-left: 8px;
    font-weight: 500;
    vertical-align: middle;
}

.teach-choice-feedback.correct {
    color: #2e7d32;
}

.teach-choice-feedback.incorrect {
    color: #c62828;
}

/* Answer display for "Choose and Write" exercises */
.teach-blank-answer {
    display: inline-block;
    min-width: 100px;
    padding: 4px 8px;
    margin: 0 4px;
    border-radius: 6px;
    border: 2px solid rgba(26, 85, 99, 0.25);
    background: rgba(26, 85, 99, 0.05);
    color: #1a5563;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    vertical-align: baseline;
    transition: all 0.2s ease;
}

/* Grammar exercises: smaller inline answer displays */
.teach-fill-blanks-grammar .teach-blank-answer {
    min-width: 80px;
    padding: 3px 6px;
    margin: 0 2px;
    font-size: 0.9rem;
}

.teach-blank-input:focus {
    outline: none;
    border-color: rgba(30, 106, 122, 0.6);
    box-shadow: 0 0 0 2px rgba(30, 106, 122, 0.2);
    background: #ffffff;
}

.teach-blank-input.correct,
.teach-blank-answer.correct {
    border-color: rgba(46, 125, 50, 0.7);
    background: rgba(46, 125, 50, 0.12);
    color: #2e7d32;
    font-weight: 600;
}

.teach-blank-input.incorrect,
.teach-blank-answer.incorrect {
    border-color: rgba(198, 40, 40, 0.7);
    background: rgba(198, 40, 40, 0.12);
    color: #c62828;
    font-weight: 600;
}

.teach-blank-feedback {
    display: inline;
    font-size: 0.85rem;
    margin-left: 6px;
    color: rgba(26, 85, 99, 0.8);
    vertical-align: middle;
}

/* Grammar exercises: smaller feedback */
.teach-fill-blanks-grammar .teach-blank-feedback {
    margin-left: 4px;
    font-size: 0.8rem;
}

.teach-blank-feedback.correct {
    color: #2e7d32;
    font-weight: 600;
}

.teach-blank-feedback.incorrect {
    color: #c62828;
}

.teach-fill-blanks-actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.teach-fill-blanks-button {
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.teach-fill-blanks-button.primary {
    background: linear-gradient(135deg, #1e6a7a, #1a5563);
    color: #ffffff;
}

.teach-fill-blanks-button.primary:hover {
    background: linear-gradient(135deg, #227b8d, #1e6a7a);
}

.teach-fill-blanks-button.secondary {
    background: rgba(26, 85, 99, 0.12);
    color: #1a5563;
}

.teach-fill-blanks-button.secondary:hover {
    background: rgba(26, 85, 99, 0.18);
}

.teach-fill-blanks-result {
    margin-top: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a5563;
}

.teach-fill-blanks-result.success {
    color: #2e7d32;
}

.teach-fill-blanks-result.error {
    color: #c62828;
}

.teach-fill-blanks-result.warning {
    color: #d35400;
}

