.input-container {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    width: 100%;
    flex-grow: 1;

    input {
        width: 100%;
        height: 2.75rem;
        border-radius: 6.25rem;
        border: .0625rem solid var(--gray-25);
        background-color: var(--gray-0);
        padding: .75rem 1rem;
        font-family: "Onest", sans-serif;
        font-optical-sizing: auto;
        font-style: normal;
        font-weight: 400;
        font-size: 1rem;
        color: var(--gray-800);

        &::placeholder {
            color: var(--gray-300);
            font-family: "Onest", sans-serif;
            font-optical-sizing: auto;
            font-style: normal;
            font-weight: 400;
            font-size: 1rem;
        }

        &:focus {
            outline: none;
            border: .0625rem solid var(--orange);
        }
    }

    .hint {
        display: none;
        font-family: "Onest", sans-serif;
        font-optical-sizing: auto;
        font-style: normal;
        font-weight: 400;
        font-size: .875rem;
        color: var(--action-red);
    }

    &.error {
        input {
            border-color: var(--action-red);
        }

        .hint {
            display: block;
        }
    }

    &.success {
        input {
            border-color: var(--action-green);
        }
    }
}


.button-fill {
    background-color: #F85628;
    border-radius: 6.25rem;
    color: var(--gray-0);
    font-family: "Onest", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-weight: 500;
    font-size: 1rem;
    padding: .75rem 1rem;
    display: flex;
    gap: .5rem;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
    width: 100%;
    height: 2.75rem;
    flex-grow: 1;
    transition: 0.4s ease;

    &:disabled {
        opacity: 0.3;
        pointer-events: none;
    }

    &:hover {
        background-color: #C7360D;
    }

    &.icon {
        max-width: fit-content;
        height: 100%;
        aspect-ratio: 1/1;
        padding: .625rem;
    }
}

.button-outline {
    background-color: var(--gray-0);
    border-radius: 6.25rem;
    color: #F85628;
    font-family: "Onest", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    font-weight: 500;
    font-size: 1rem;
    padding: calc(.75rem - .0625rem) 1rem;
    display: flex;
    gap: .5rem;
    justify-content: center;
    align-items: center;
    border: .0625rem solid var(--gray-25);
    cursor: pointer;
    width: 100%;
    height: 2.75rem;
    flex-grow: 1;
    transition-property: border, color;
    transition-duration: .2s;
    transition-timing-function: ease-in-out;

    &:hover {
        border: .0625rem solid #C7360D;
        color: #C7360D;
    }

    &:disabled {
        opacity: 0.5;
        pointer-events: none;
    }

    &.icon {
        width: 2.75rem;
        height: 2.75rem;
        aspect-ratio: 1/1;
        padding: .625rem;
        flex-grow: 0;
    }
}


.exercises-option {
    max-width: 77.875rem;
    margin: 0 auto;
    box-sizing: content-box;

    .header:not(.exercise-header) {
        display: flex;
        align-items: end;
        justify-content: space-between;
        margin-bottom: 1.5rem;
        gap: 1rem;

        .title {
            font-size: 2rem;
            font-weight: 700;
            color: #2A1C14;
            font-family: "Source Serif 4", serif;
            min-width: 0;

            span {
                font-family: "Source Serif 4", serif;
                color: #F85628;
            }
        }

        .top-bar {
            width: fit-content;
            height: 5.75rem;
            flex-grow: 1;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-direction: row;
            gap: 1.5rem;
            flex-grow: 0;

            .button-prev {
                color: #919292;
                padding: .875rem;

                &:hover {
                    color: #C7360D;
                }
            }
        }
    }

    .task-wrapper {
        display: flex;
        flex-direction: column;
        gap: 3rem;

        .questions-wrapper {
            display: flex;
            gap: 1rem;

            .questions-section {
                flex: 1;
                width: 100%;
                font-size: 20px;
                font-weight: 400;
                line-height: 1.2;

                .scroll-container {
                    height: auto;
                    overflow: auto;

                    &::-webkit-scrollbar {
                        width: .25rem;
                        background-color: transparent;
                        border-radius: .1875rem;
                    }

                    &::-webkit-scrollbar-thumb {
                        width: .25rem;
                        background-color: var(--gray-100);
                        border-radius: .1875rem;
                    }

                    .title {
                        display: block;
                        margin-bottom: 12px;
                        font-size: 24px;
                        font-weight: 600;
                    }

                    .paragraph {
                        margin-bottom: 20px;
                    }

                    .list {
                        padding-left: 30px;
                    }
                }
            }

            .answer-section {
                .answer-wrapper {
                    position: relative;
                    height: 100%;
                    display: flex;
                    flex-direction: column;
                    gap: 12px;

                    .answer-default-state {
                        height: 100%;
                        display: flex;
                        flex-direction: column;
                        gap: 12px;

                        .answer-head {
                            display: flex;
                            align-items: center;
                            justify-content: space-between;
                            gap: 16px;

                            .questions-title {
                                font-size: 24px;
                                line-height: 1.2;
                                font-weight: 600;
                            }

                            .answer-meta {
                                display: flex;
                                align-items: center;
                                gap: 18px;
                                flex-wrap: wrap;

                                .answer-meta-item {
                                    display: inline-flex;
                                    align-items: center;
                                    gap: 6px;
                                    font-size: 16px;
                                    font-weight: 500;
                                    line-height: 1.2;
                                    white-space: nowrap;

                                    .answer-meta-icon {
                                        display: inline-flex;
                                        flex-shrink: 0;

                                        svg {
                                            width: 18px;
                                            height: 18px;
                                        }
                                    }
                                }
                            }
                        }

                        .scroll-container {
                            height: 100%;
                            padding-right: 0;

                            .writing-answer-form {
                                .textarea-container {
                                    width: 100%;

                                    .textarea {
                                        display: block;
                                        width: 100%;
                                        height: 333px;
                                        resize: none;
                                        border: 1px solid #EBEDEF;
                                        border-radius: 12px;
                                        background: #fff;
                                        padding: 12px 16px;
                                        font-size: 16px;
                                        font-weight: 400;
                                        line-height: 1.2;
                                        color: var(--text);
                                        outline: none;
                                        box-sizing: border-box;

                                        &::placeholder {
                                            color: #A7A8A8;
                                        }

                                        &:focus {
                                            border-color: #505151;
                                        }
                                    }
                                }
                            }

                            .writing-answer-footer {
                                margin-top: 12px;
                                text-align: right;

                                p {
                                    font-size: 16px;
                                    font-weight: 400;
                                    line-height: 1.2;

                                    .current-words {
                                        color: var(--orange);
                                        font-weight: 500;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        .flex-box {
            display: flex;
            gap: 1rem;
        }

        .reading-passage {
            font-size: 1rem;
            color: #2A1C14;
            font-weight: 400;

            ul {
                list-style: none;
                margin-left: .5rem;
                padding-left: .5rem;

                li {
                    list-style: none;
                    position: relative;
                }

                li::before {
                    content: "•";
                    font-size: 1.125rem;
                    position: absolute;
                    left: -0.625rem;
                }
            }

            span {
                font-weight: 600;
            }

            .divider {
                width: 100%;
                height: .0625rem;
                background-color: var(--gray-25);
                margin: 1rem 0;
            }

            .pb-big {
                list-style: none;
                padding-bottom: 1.25rem;
            }

            .pb-small {
                padding-bottom: .25rem;
            }

            .pl-big {
                padding-left: 5rem;
            }

            .chat {
                padding: 2.1875rem 1.5rem 1.5rem;
                border-radius: 1rem;
                background-color: var(--gray-15);
                display: flex;
                flex-direction: column;
                gap: .6875rem;

                .message-text {
                    border-radius: 1rem;
                    padding: 1.5rem;
                    color: #000000;
                    font-size: 1.25rem;
                    font-weight: 400;
                    background-color: var(--gray-25);
                    margin-right: auto;
                    position: relative;

                    &::after {
                        content: "";
                        position: absolute;
                        top: -0.875rem;
                        left: 2rem;
                        border-right: .75rem solid transparent;
                        border-bottom: 1.125rem solid var(--gray-25);
                    }
                }

                .reply-message-text {
                    border-radius: 1rem;
                    padding: 1.5rem;
                    color: #000000;
                    font-size: 1.25rem;
                    font-weight: 400;
                    margin-left: auto;
                    background-color: #F9ECE9;
                    position: relative;

                    &::after {
                        content: "";
                        position: absolute;
                        top: -0.875rem;
                        right: 2rem;
                        border-left: .75rem solid transparent;
                        border-bottom: 1.125rem solid #F9ECE9;
                    }
                }
            }
        }

        .task {
            padding: 1.5rem 1.5rem 1.5rem 1.5rem;
            height: auto;
            min-height: 20rem;
            max-height: 30rem;
            position: relative;
            overflow: hidden;

            &::after {
                content: "";
                position: absolute;
                bottom: 0;
                left: 0;
                width: calc(100% - .875rem);
                height: 100%;
                pointer-events: none;
                box-shadow: inset 0rem -5rem 1.6875rem -2rem #fff;
            }

            .scroll-container {
                height: 100%;
                overflow-y: scroll;
                padding: 0 .5rem 1.875rem 0;

                &::-webkit-scrollbar {
                    width: .25rem;
                    background-color: transparent;
                    border-radius: .1875rem;
                }

                &::-webkit-scrollbar-thumb {
                    width: .25rem;
                    background-color: var(--gray-100);
                    border-radius: .1875rem;
                }

                p,
                .p {
                    font-size: 1.25rem;
                    color: #2A1C14;
                    font-weight: 400;
                }

                span {
                    font-weight: 600;
                }

                .divider {
                    width: 100%;
                    height: .0625rem;
                    background-color: var(--gray-25);
                    margin: 1rem 0;
                }

                p:last-child {
                    padding-bottom: 0;
                }

                .pb-big {
                    padding-bottom: 1.25rem;
                }

                .pb-small {
                    padding-bottom: .25rem;
                }

                .pl-big {
                    padding-left: 5rem;
                }
            }
        }

        .answer {
            max-width: 31.875rem;
            flex-grow: 1;
            height: auto;
            min-height: 30rem;
            max-height: 36rem;
            padding: 0;
            overflow: hidden;
            padding: 1.5rem .625rem 1rem 1.5rem;
            position: relative;

            .answer-scroll-region {
                position: absolute;
                top: 1.5rem;
                right: .625rem;
                bottom: 4.75rem;
                left: 1.5rem;
                min-height: 0;
            }

            .scroll-container {
                height: 100%;
                overflow: auto;
                padding: 0 .5rem .5rem 0;

                &::-webkit-scrollbar {
                    width: .25rem;
                    background-color: transparent;
                    border-radius: .1875rem;
                }

                &::-webkit-scrollbar-thumb {
                    width: .25rem;
                    background-color: var(--gray-100);
                    border-radius: .1875rem;
                }

                .questions-title {
                    color: #000000;
                    font-size: 1.125rem;
                    font-weight: 600;
                    margin-bottom: 1rem;
                }

                .questions {
                    display: flex;
                    flex-direction: column;
                    height: fit-content;
                    flex-shrink: 0;

                    .question-wrapper {
                        margin-bottom: .75rem;

                        .question {
                            display: flex;
                            gap: .5rem;

                            .question-number {
                                background-color: #F85628;
                                border-radius: .875rem;
                                width: 1.75rem;
                                height: 1.75rem;
                                display: flex;
                                align-items: center;
                                justify-content: center;
                                color: #FFFFFF;
                                font-size: .875rem;
                                font-weight: 500;
                                flex-shrink: 0;
                            }

                            .question-content {
                                width: 100%;

                                .question-title {
                                    color: #000000;
                                    font-size: 1.2rem;
                                    font-weight: 500;
                                    margin-bottom: .5rem;
                                }

                                .radio-list {
                                    display: flex;
                                    gap: 1rem;
                                }

                                .input-list {
                                    display: flex;
                                    flex-direction: column;
                                    gap: .5rem;

                                    .input-container {
                                        max-width: 100%;
                                        width: 100%;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            .buttons {
                position: absolute;
                bottom: 0;
                left: 0;
                width: 100%;
                border-top: .0625rem solid var(--gray-25);
                padding: .75rem 1rem 1rem;
                background-color: #FFFFFF;
            }
        }    }
}

@media (max-width: 64rem) {
    .exercises-option.option-13-ai .task-wrapper {
        gap: 1rem;
    }
    .exercises-option {
        .task-wrapper {
            flex-direction: column;
            align-items: center;
            gap: 1rem;

            .questions-wrapper {
                width: 100vw;
                flex-direction: column;
                border-bottom: .0625rem solid var(--gray-25);

                .questions-section {
                    border-radius: 0;
                    padding-bottom: .75rem;
                    border-bottom: .0625rem solid var(--gray-25);
                    padding: 0 1rem 1.5rem;
                    font-size: 18px;

                    .scroll-container {
                        max-height: 315px;

                        .title {
                            font-size: 18px;
                        }
                    }
                }

                .answer-section {
                    padding: 1rem;

                    .answer-wrapper {
                        .answer-default-state {
                            .answer-head {
                                .questions-title {
                                    font-size: 18px;
                                }

                                .answer-meta {
                                    gap: 16px;

                                    .answer-meta-item {
                                        .label {
                                            display: none;
                                        }
                                    }
                                }
                            }

                            .scroll-container {
                                .writing-answer-form {
                                    .textarea-container {
                                        .textarea {
                                            height: 240px;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            .flex-box {
                flex-direction: column;
                align-items: center;
                gap: 1.5rem;
            }

            .paper {
                border: none;
                padding: 0;
                height: auto;
                min-height: auto;
                max-height: 100%;
            }

            .reading-passage {
                width: 100vw;
                border-bottom: .0625rem solid var(--gray-25);
                border-radius: 0;
                padding: 0 1rem 1.5rem;
                margin-bottom: 1.5rem;

                .pl-big {
                    padding-left: 1.5rem;
                }

                .chat {
                    padding: 1.6875rem 1rem 1rem;
                    gap: 1.1875rem;

                    .message-text {
                        padding: 1rem;
                        font-size: 1rem;
                    }

                    .reply-message-text {
                        padding: .75rem;
                        font-size: 1rem;
                    }
                }
            }

            .task {
                padding-bottom: 1.5rem;
                border-bottom: .0625rem solid var(--gray-25);
                height: fit-content;
                border-radius: 0;

                &::after {
                    display: none;
                }

                .scroll-container {
                    overflow: visible;
                    padding: 0 .5rem 0 0;

                    p,
                    .p {
                        font-size: 1.125rem;
                        line-height: 1.625rem;
                    }
                }
            }

            .answer {
                max-width: 100%;
                height: fit-content;
                border-radius: 0;

                .answer-scroll-region {
                    position: relative;
                    inset: auto;
                }

                &::after {
                    display: none;
                }

                .scroll-container {
                    overflow: visible;
                    padding: 0;

                    .questions {
                        padding: 0;
                        gap: 1rem;

                        .question-wrapper {
                            .question {
                                .question-content {
                                    .question-title {
                                        font-size: 1.075rem;
                                    }
                                }
                            }
                        }
                    }
                }

                .buttons {
                    position: static;
                    display: flex;
                    padding: 1rem 0 0;
                }
            }        
        }
    }
}

@media (max-width: 48rem) {
    .exercises-option {
    .header:not(.exercise-header) {
            flex-direction: column-reverse;
            align-items: start;
            margin-bottom: 2rem;

            .title {
                font-family: "Onest", sans-serif;
                font-size: 1.5rem;
                font-weight: 600;
            }

            .top-bar {
                justify-content: start;
                border: none;
                padding: 0;
                gap: 1rem;
                height: fit-content;
            }
        }
    }
}

.exercises-option.option-13-ai .questions-wrapper {
    align-items: stretch;
}

.exercises-option.option-13-ai .questions-section,
.exercises-option.option-13-ai .answer-section {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    height: auto;
    min-height: 20rem;
    max-height: 30rem;
}

.exercises-option.option-13-ai .questions-section {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.exercises-option.option-13-ai--disabled .questions-section {
    flex: 0 0 100%;
    width: 100%;
    height: fit-content;
    min-height: 0;
    max-height: none;
}

.exercises-option.option-13-ai--disabled .questions-wrapper {
    align-items: flex-start;
}

.exercises-option.option-13-ai--disabled .task-wrapper .questions-wrapper .questions-section .scroll-container {
    flex: none;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
}

.exercises-option.option-13-ai .questions-section .scroll-container {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    padding-right: .5rem;
}

.exercises-option.option-13-ai .answer-section {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.exercises-option.option-13-ai .answer-section .answer {
    max-width: none;
    height: 100%;
    padding: 0;
    min-height: 0;
    max-height: 100%;
}

.exercises-option.option-13-ai .option-13-profile {
    align-items: stretch;
}

.exercises-option.option-13-ai .option-13-ai-results {
    gap: 1.5rem;
    margin-top: 0;
}

.exercises-option.option-13-ai .option-13-ai-results .result-answer {
    margin-top: 0;
}

.exercises-option.option-13-ai #result_answer_conversation {
    white-space: pre-wrap;
    font-size: 1rem;
    line-height: 1.5;
}

.exercises-option.option-13-ai .option-13-profile .questions-title {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

@media (max-width: 64rem) {
    .exercises-option.option-13-ai .exercise-header__explanation {
        margin-bottom: .75rem;
    }

    .exercises-option.option-13-ai .questions-wrapper {
        gap: 0;
    }

    .exercises-option.option-13-ai .questions-section,
    .exercises-option.option-13-ai .answer-section {
        flex: none;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        border-radius: 0;
    }

    .exercises-option.option-13-ai .questions-section {
        height: fit-content;
        padding: 0 1rem 1.5rem;
    }

    .exercises-option.option-13-ai .task-wrapper .questions-wrapper .questions-section .scroll-container {
        flex: none;
        height: fit-content;
        max-height: none;
        overflow: visible;
        padding: 0;
    }

    .exercises-option.option-13-ai .answer-section {
        padding: 1.5rem 1rem;
    }

    .exercises-option.option-13-ai .answer-section .answer,
    .exercises-option.option-13-ai .answer-default-state,
    .exercises-option.option-13-ai .answer-listening-state,
    .exercises-option.option-13-ai .answer-record-state,
    .exercises-option.option-13-ai .answer-loading-state,
    .exercises-option.option-13-ai .answer-forbidden-state {
        height: auto;
        min-height: 0;
    }

    .exercises-option.option-13-ai .option-13-profile {
        width: 100%;
    }

    .exercises-option.option-13-ai .option-13-profile > .task {
        align-self: start;
        width: 100%;
        height: fit-content;
        min-height: 0;
    }
}
