.test {
    position: relative;
}

.test h3 {
    font-size: 23px;
    margin-bottom: 20px;
    margin-top: 0;
}

.widget {
    margin-top: 10px;
}


.show_answer {
    cursor: pointer;
    display: flex;
    align-items: center;
    align-self: stretch;
    margin-left: 7px;
    padding: 0 8px;
    border: var(--border);
    border-radius: 12px;
}

.test_content .show_answer img {
    background-color: transparent;
    border-radius: 0 !important;
    height: 22px !important;
}

.total_explanation {
    margin-top: 24px;
    padding-left: 24px;
    border-left: var(--border);
}


/*
KATEX
*/
.katex .accent {
    color: var(--main) !important;
}

.katex>.katex-html {
    white-space: normal;
}

.katex .base {
    margin-top: 2px;
    margin-bottom: 2px;
}

.katex {
    font-size: 1.3em !important;
}

.katex *[style*="color: coral;"] {
    color: var(--coral) !important;
}

.katex *[style*="color: lightblue;"] {
    color: var(--blue3) !important;
}

.katex *[style*="color: blue;"] {
    color: var(--accent) !important;
}

.katex *[style*="color: green;"] {
    color: var(--green) !important;
}

.katex *[style*="color: gray;"] {
    color: var(--secondary) !important;
}

.katex *[style*="color: darkgreen;"] {
    color: var(--darkgreen) !important;
}

.katex *[style*="color: orange;"] {
    color: var(--orange3) !important;
}

.katex *[style*="color: purple;"] {
    color: var(--progress) !important;
}


/** 
* Choice
*/

.test .explanation {
    display: none;
    color: var(--secondary);
    margin: 15px 0 0 47px;
    font-size: 90%;
}

.hints_wrapper {
    display: none;
    padding: 24px 0 0 0;
}

.hint_report_bar {
    border-top: 1px solid var(--lightgray);
    padding-top: 16px;
    margin-top: 24px !important;
}

.use_hint {
    display: none;
}

.hints div {
    display: flex;
}

.hintIndex {
    display: inline-block;
    color: var(--accent);
    font-weight: var(--main_bold_weight);
    white-space: nowrap;
    padding: 0 16px 10px 5px;
    margin-right: 16px;
    text-align: center;
    border-right: 3px solid var(--lightgray);
}

.hints div p {
    margin: 0 0 16px 0;
}

.difficult,
.show_solution {
    display: none;
    font-size: 14px;
    font-weight: var(--main_bolder_weight);
}

.difficult span,
.show_solution span {
    cursor: pointer;
}

.more_hint {
    cursor: pointer;
    display: inline-block;
    margin-top: 16px;
    color: var(--green);
}

.option {
    padding: 8px 0;
    position: relative;
}

.option_content {
    display: flex;
    align-items: center;
}

.option input {
    visibility: hidden;
    position: absolute;
    right: 0;
    bottom: 0;
}

.option:active .check,
.option input:checked~.check {
    border-color: var(--accent);
}


/** 
* Checkbox
*/

.multiple_choice .check,
.single_choice .check {
    cursor: pointer;
    position: relative;
    min-width: 32px;
    min-height: 32px;
    border-radius: 7px;
    /* background-color: var(--secondary_background1); */
    border: var(--border);
    border-bottom-width: 4px;
    margin-right: 15px;
    transition: all 250ms cubic-bezier(.4, .0, .23, 1);
}

.multiple_choice input:checked~.check,
.single_choice input:checked~.check {
    border: 16px solid var(--accent);
    animation: shrink-bounce 200ms cubic-bezier(.4, .0, .23, 1), border-color 200ms;
}

.multiple_choice.correct_answered input:checked~.check,
.single_choice.correct_answered input:checked~.check {
    border-color: var(--green);
}

.multiple_choice input:checked~.check:before,
.single_choice input:checked~.check:before {
    content: "";
    position: absolute;
    top: -2.5px;
    left: -7.23px;
    border-right: 3px solid transparent;
    border-bottom: 3px solid transparent;
    transform: rotate(45deg);
    transform-origin: 0% 100%;
    animation: checkbox-check 125ms 250ms cubic-bezier(.4, .0, .23, 1) forwards;
}

@keyframes shrink-bounce {
    0% {
        transform: scale(1);
    }
    33% {
        transform: scale(.85);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes checkbox-check {
    0% {
        width: 0;
        height: 0;
        border-color: var(--white);
        transform: translate3d(0, 0, 0) rotate(45deg);
    }
    33% {
        width: 4px;
        height: 0;
        transform: translate3d(0, 0, 0) rotate(45deg);
    }
    100% {
        width: 4px;
        height: 10px;
        border-color: var(--white);
        transform: translate3d(0, -10px, 0) rotate(45deg);
    }
}

.sign {
    display: block;
    font-size: 13px;
    color: var(--red);
}

.sign.correct {
    color: var(--green);
}


/** 
* Text
*/

.text {
    margin-top: 16px;
}

.text input {
    font-size: inherit;
}

.with_unit {
    display: flex;
}

.with_unit input,
.with_unit .correct_val {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.with_unit .unit {
    border: var(--border);
    padding: 0 9px 0 7px;
    display: flex;
    align-items: center;
    align-self: stretch;
    border-bottom-right-radius: var(--radius);
    border-top-right-radius: var(--radius);
    border-left-width: 0 !important;
}

.input_inline_wrapper {
    display: inline-block;
}

.input-inline {
    display: inline-block;
    background-color: var(--white);
    color: var(--main);
    font-size: inherit;
    border-radius: 12px;
    border: var(--border);
    outline: none;
    text-align: center;
    padding: 3px 10px !important;
    margin: 3px 0;
    min-width: 30px;
}

.input_inline_wrapper .show_answer {
    margin-top: 3px;
    margin-bottom: 3px;
    padding: 0 5px;
}

.input_inline_wrapper .show_answer img {
    height: 20px !important;
}

.question_text svg {
    margin-top: 15px;
}


/** 
* Checkbox
*/

.fill_choice {
    display: inline-block;
    position: relative;
}

.fill_choice .current_selected {
    display: inline-block;
    cursor: pointer;
    border: var(--border);
    border-bottom-width: 4px;
    padding: 3px 10px !important;
    margin: 3px 0;
    border-radius: 12px;
}

.fill_choice.letters .current_selected {
    border: none;
    font-weight: var(--main_bold_weight);
    padding: 0 !important;
    border-bottom: var(--border);
    border-radius: 0;
}

.fill_choice.letters.correct_answered .current_selected,
.fill_choice.letters.correct_answered {
    background-color: transparent !important;
    border: none !important;
}

.fill_choice .dropdown {
    display: none;
    background-color: var(--white);
    border: var(--border);
    border-radius: 12px;
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    transform: translate(-50%, 0);
    overflow: hidden;
}

.fill_choice.opened .dropdown {
    display: block;
    z-index: 7;
}

.fill_choice.left .dropdown {
    left: 0;
    transform: none;
}

.fill_choice.right .dropdown {
    right: 0;
    left: auto;
    transform: none;
}

.fill_choice .dropdown div {
    text-align: center;
    cursor: pointer;
    padding: 5px 10px;
}

.fill_choice .dropdown div:hover {
    background-color: var(--secondary_background);
}

.fill_choice .dropdown div.active {
    background-color: var(--accent);
    color: var(--white);
}

.fill_choice .dropdown div:not(:first-child) {
    border-top: var(--border);
}


/*
fill_choice_big
*/

.placeholder {
    display: inline-block;
    color: transparent;
    border-bottom: var(--border);
    max-width: 90%;
}

.fill_choice_big {
    display: grid;
}

.fill_choice_big button {
    display: block;
    margin-top: 8px;
    width: 100%;
    padding: 10px;
    text-align: center;
    color: var(--main) !important;
    font-weight: var(--main_bold_weight);
}

.fill_choice_big button:disabled,
.img_choice button:disabled {
    color: var(--secondary) !important;
    pointer-events: none;
}

.fill_choice_big button.active,
.img_choice button.active {
    color: var(--blue_text) !important;
}

.fill_choice_big button.active:hover,
.img_choice button.active:hover {
    filter: none;
}

.fill_choice_big button.active::before,
.img_choice button.active::before {
    background-color: var(--lightblue);
    border-color: var(--blue_border);
    box-shadow: 0 2px 0 var(--blue_border);
}

.fill_choice_big.small {
    grid-template-columns: repeat(2, 1fr);
    grid-column-gap: 8px;
}

/* IMG CHOICE */
.img_choice,
.imgs {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.img_choice .btn,
.imgs .box {
    flex-grow: 1;
    flex-basis: 0;
}

.img_choice p {
    margin: 10px 0 0 0 !important;
}

.img_choice button img,
.imgs div img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    min-width: 70px;
    background-color: transparent;
}

/* IMG MATCH */

.imgs {
    align-items: flex-end;
}

.imgs .box {
    overflow: hidden;
    padding: 0 0 10px 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.imgs .drop {
    margin: 10px 10px 0 10px;
}

.imgs .show_answer {
    margin: 10px 10px 0 10px;
}

.imgs div img {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/** 
* Graph
*/

.y {
    position: absolute;
    margin-left: 8px;
    top: -3px;
    z-index: 3;
}

.y span {
    vertical-align: bottom;
}

.x {
    position: absolute;
    z-index: 3;
}

.correct_answered .graph_wrapper circle[fill="#32bf4c"] {
    fill: #7290e9;
}

.graph_wrapper {
    text-align: center;
    position: relative;
    flex-grow: 1;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

@media(max-width: 442px) {
    .graph_wrapper {
        margin-left: -15px;
        margin-right: -15px;
    }
    .graph {
        text-align: center;
    }
}

@media (min-width: 492px) {
    .x,
    .graph_wrapper text,
    .y {
        font-size: 21px !important;
    }
    .fill_choice_big.med {
        grid-template-columns: repeat(2, 1fr);
        grid-column-gap: 8px;
    }
}

.test_image {
    display: block;
    margin: auto;
    border-radius: 5px;
    margin-top: 16px;
    margin-bottom: 16px;
    width: 100%;
    height: auto;
    max-height: 70vh;
}

.darkmode .test_image {
    background-color: var(--lightblue);
}


/* CALCULATOR */

.calculator {
    display: none;
    max-width: 433px;
    margin-top: 24px;
}

.calc_shown .calculator {
    display: block;
}

.calculator section .btn {
    min-width: 55px;
    height: 40px;
    padding: 0;
    text-align: center;
    margin-right: 6px;
}

.calculator section div .btn:last-child {
    margin-right: 0;
}

.calculator .secondary {
    color: var(--main);
}

.calculator section div {
    display: flex;
    margin-top: 6px;
}

.calculator section {
    display: inline-block;
}

.functions {
    margin-right: 12px;
}

.calculator .ops {
    color: var(--main);
}

.ops[data-func="asin("],
.ops[data-func="acos("],
.ops[data-func="atan("] {
    font-size: 16px;
}

.darkmode .ops {
    color: var(--white);
}

.calcbar {
    width: 100%;
    border-radius: 10px;
    border: var(--border);
    height: 110px;
    padding: 0 9px;
}

.calcbar .history_wrapper {
    height: 80px;
    position: relative;
}

.calcbar .history {
    width: 100%;
    max-height: 80px;
    position: absolute;
    bottom: 0;
    overflow-y: auto;
}

.calcbar .history p {
    margin: 0;
    color: var(--secondary);
}

.calcBar {
    text-align: right;
    overflow-x: auto;
    white-space: nowrap;
}

.expand_calc {
    display: none;
}

.mobile_funcs {
    display: none;
}

.show_calc {
    display: block;
    margin-top: 9px;
}

@media(max-width: 530px) {
    .bottom_calc {
        display: none !important;
    }
    .mobile_funcs {
        display: inline-block;
    }
    .calculator section {
        width: 100%;
    }
    .calculator section .btn {
        width: calc(25% - 3px)
    }
    .calculator .functions .btn {
        width: calc(33.33% - 4px)
    }
    .calculator .functions {
        display: none !important;
        margin: auto;
    }
    .calculator.calc_expanded .functions {
        display: block !important;
    }
    .expand_calc {
        display: block;
    }
    .imgs .box {
        min-width: calc(50% - 24px);
        max-width: calc(50% - 24px);
    }
}


/* SORTER */

.sorter_wrapper {
    display: block;
    margin-top: 0;
    margin-bottom: -10px;
}

.sorter {
    display: inline-block;
    padding: 5px 0;
}

.sorter.horizontal {
    margin-right: -10px;
    margin-left: -7px;
    display: inline-flex;
    flex-wrap: nowrap;
    max-width: calc(100% + 14px);
    overflow-x: auto;
}

.sorter .ui-sortable-handle {
    background-color: var(--white);
}

.sorter.horizontal .ui-sortable-handle,
.sorter.horizontal .sorter_placeholder {
    cursor: ew-resize;
    margin-right: 7px;
    margin-left: 7px;
}

.ui-sortable-handle,
.item,
.sorter_placeholder {
    display: block;
    cursor: ns-resize;
    border: var(--border);
    padding: 10px 16px !important;
    margin: 10px 0;
    border-radius: var(--radius);
}

.ui-sortable-handle,
.sorter_placeholder {
    border-width: 5px 2px 5px;
}

.sorter.horizontal .ui-sortable-handle,
.sorter.horizontal .sorter_placeholder {
    border-width: 2px 5px 2px;
}

.btn.secondary.item {
    color: var(--main);
    font-weight: var(--main_weight);
}

.btn.secondary.item:hover {
    filter: none;
}

.sorter_placeholder {
    background-color: var(--lightgray);
}


/* matcher */

.matcher .label,
.grouper .label {
    margin-top: 16px;
    border: var(--border);
    border-radius: var(--radius);
}

.label .show_answer {
    border: none;
    border-left: var(--border);
    border-radius: 0;
}

.label .show_answer img {
    min-width: 21px;
}

.matcher .col,
.grouper .col {
    padding: 15px;
    width: 100%;
    max-width: 60%;
    overflow: auto;
    word-break: break-word;
}

.grouper .col.key,
.matcher .col.key {
    max-width: 40%;
}

.items {
    margin-top: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.item {
    cursor: move;
    margin: 0 7px 7px 0;
}

.drop .item {
    width: 100%;
    text-align: center;
    margin: 0;
}

.drop .item:not(.dragging):before {
    border: none;
    box-shadow: none;
}

.item.dragging {
    z-index: 7;
}

.drop {
    border-radius: var(--radius);
    border: 2px dashed var(--lightgray);
    min-height: 30px;
}

.drop.hovered {
    background-color: var(--lightgray);
}


/* sentence */

.sentence .items {
    min-height: 85px;
}

.sentence_lines {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    min-height: 120px;
    position: relative;
    border-top: var(--border);
}

.sentence_lines::before {
    content: "";
    height: 2px;
    width: 100%;
    position: absolute;
    top: 57px;
    background-color: var(--lightgray);
}

.sentence_lines::after {
    content: "";
    height: 2px;
    width: 100%;
    position: absolute;
    top: 117px;
    background-color: var(--lightgray);
}

.sentence_lines .item {
    height: 47px;
    margin: 5px 8px 7px 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: flex;
    align-items: center;
}

/* word spell widget */

.word_frame,
.letters_list {
    gap: 7px;
}

.letter_placeholder,
.spell .item {
    min-width: 48px;
    max-width: 48px;
    min-height: 48px;
    max-height: 48px;
    line-height: 22px;
}

.spell .item {
    padding-bottom: 14px !important;
}

.letter_placeholder {
    border-radius: var(--radius);
    background-color: var(--secondary_background1);
}

.spell .item {
    margin: 0;
    cursor: pointer;
}


/* speech */

.speech {
    margin-top: 16px;
    margin-bottom: -16px;
    border-bottom: var(--border);
}

.msg {
    border: var(--border);
    border-radius: var(--radius);
    padding: 16px;
    position: relative;
    margin-left: 10px;
    background-color: var(--white);
}

.msg::before {
    content: "";
    position: absolute;
    left: 0;
    top: 15px;
    bottom: 15px;
    width: 5px;
    background-color: var(--white);
    z-index: 3;
}

.msg::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: 50%;
    left: -15px;
    height: 14px;
    width: 14px;
    background-color: var(--white);
    border-left: var(--border);
    border-bottom: var(--border);
    border-radius: 2px;
    transform: rotate(45deg) translate(0, -50%);
}

.speech .eng_play {
    margin-right: 8px;
}

.test_content .speech img {
    background-color: transparent;
    border-radius: 0 !important;
    width: 150px;
    max-width: 37% !important;
}

.alb {
    align-items: end;
}

.pronounce_box:not(.slow) {
    padding: 24px;
    margin-left: 15px;
}


/* RAY */

input[type=range] {
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    appearance: none;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    appearance: none;
    border: var(--border);
    height: 25px;
    width: 25px;
    border-radius: 50%;
    margin-top: -11px;
    background: var(--accent);
    cursor: move;
    z-index: 2;
    position: relative;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 3px;
    background: var(--lightgray);
    border-radius: 50vh;
}

.datalist {
    margin-top: 10px;
}

.tick {
    width: 40px;
    text-align: center;
    position: relative;
}

.tick::before {
    content: "";
    left: 0;
    right: 0;
    margin: auto;
    width: 2px;
    background: var(--main);
    height: 16px;
    top: -24px;
    z-index: 1;
    position: absolute;
}


/* PROGRESS */

.progress span {
    display: inline-block;
    vertical-align: middle;
    min-width: 8px;
    min-height: 8px;
    border-radius: 50%;
    border: 2px solid var(--lightgray);
    margin-right: 8px;
}

.progress span.active {
    width: 12px;
    height: 12px;
}

.progress span.correct {
    background-color: var(--green);
    border-color: var(--green);
}

.progress span.wrong {
    background-color: var(--secondary);
    border-color: var(--secondary);
}

.test[hint_status="has_hint"] .use_hint,
.test[hint_status="has_hint"] .difficult {
    display: unset;
}


/* 

*/

.test[hint_status="show_hint"] .use_hint {
    display: inline;
}

.test[hint_status="show_hint"] .hints_wrapper {
    display: block;
}

.test[hint_status="show_hint"] .difficult {
    display: none;
}


/* 

*/

.test[hint_status="hints_shown"] .hints_wrapper {
    display: block;
}

.test[hint_status="hints_shown"] .use_hint {
    display: none;
}


/* 

*/

.test[hint_status="step_by_step"] .difficult {
    display: none;
}

.test[hint_status="step_by_step"] .show_solution {
    display: unset;
}


/* 

*/

.test[hint_status="step_by_step_started"] .difficult,
.test[hint_status="step_by_step_started"] .more_hint {
    display: none;
}

.test[hint_status="step_by_step_started"] .hints_wrapper {
    display: block;
}

.test[hint_status="step_by_step_started"] .show_solution {
    display: unset;
}

.correct_answered .show_answer {
    display: none;
}

.correct_answered .sorter,
.correct_answered .matcher,
.correct_answered .sentence,
.correct_answered .grouper,
.correct_answered .fill_choice,
.correct_answered .graph_wrapper,
.correct_answered .fill_choice_big,
.correct_answered .word_frame,
.correct_answered .img_choice {
    pointer-events: none !important;
}

.current_selected.correct_answered,
.input-inline.correct_answered,
.correct_answered .drop,
.correct_answered .current_selected,
.correct_val,
.correct_val+.unit,
.correct_answered .fill_choice_big .active,
.sorter .ui-sortable-handle.correct_answered {
    pointer-events: none;
    color: var(--green) !important;
    border: 2px solid var(--transp_green) !important;
    background: var(--transp_green) !important;
}

.correct_answered .item {
    color: var(--green) !important;
}

.correct_answered .item::before,
.item.correct_answered::before {
    border: 2px solid var(--transp_green) !important;
    background: var(--transp_green) !important;
    box-shadow: none;
}

.correct_answered .fill_choice_big .active::before {
    border-color: var(--transp_green) !important;
    background-color: var(--transp_green) !important;
    box-shadow: 0 2px 0 transparent !important;
}

.correct_answered .drop .item::before {
    background: transparent !important;
    border-color: transparent !important;
}

.correct_answered .drop {
    border-style: solid;
    overflow: hidden;
}

.text.correct_answered .unit {
    border-left-width: 0 !important;
}

.correct_val+.unit {
    border-left: none !important;
}

.correct_val {
    display: inline-block;
    padding: 9px 16px;
    border-radius: var(--radius);
}

@media (max-width: 680px) {
    .grouper,
    .matcher {
        margin-left: -15px;
        margin-right: -15px;
    }
    .lesson_content .grouper,
    .lesson_content .matcher {
        margin-left: -16px;
        margin-right: -16px;
    }
    .matcher .items,
    .grouper .items {
        padding-left: 15px;
        padding-right: 15px;
    }
    .grouper .label,
    .matcher .label {
        border-left-width: 0;
        border-right-width: 0;
        border-radius: 0;
    }
}