.tr_box{
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.tr_top{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.tr_levels{
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tr_level{
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 8px;
    border: solid 1px var(--calc_num_border);
    background: var(--calc_num_background);
    color: var(--calc_text);
    font-size: 1em;
}
.tr_level[aria-pressed="true"]{
    background: var(--calc_button);
    border-color: var(--calc_button);
    color: var(--calc_button_text);
}
.tr_text{
    font-size: 1.15em;
    line-height: 1.6;
    text-align: center;
    overflow-wrap: anywhere;
}
.tr_eq{
    font-size: 1.25em;
    font-weight: 600;
    white-space: nowrap;
}
.tr_fields{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}
.tr_field{
    display: flex;
    align-items: center;
    gap: 8px;
}
.tr_field input{
    width: 130px;
    max-width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: solid 2px var(--calc_num_border);
    background: var(--calc_num_background);
    color: var(--calc_text);
    font-size: 1.1em;
    text-align: center;
}
.tr_field select{
    min-width: 70px;
    padding: 10px;
    border-radius: 8px;
    border: solid 2px var(--calc_num_border);
    background: var(--calc_num_background);
    color: var(--calc_text);
    font-size: 1.1em;
}
.tr_field.tr_good input, .tr_field.tr_good select{ border-color: #16a34a; }
.tr_field.tr_bad input, .tr_field.tr_bad select{ border-color: #dc2626; }
.tr_none{
    display: block;
    margin-top: 12px;
    text-align: center;
    cursor: pointer;
}
.tr_buttons{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}
.tr_second{
    background: transparent;
    color: var(--calc_text);
    border: solid 1px var(--calc_num_border);
}
.tr_result{
    padding: 12px 16px;
    border-radius: 8px;
    border-left: solid 5px #dc2626;
    background: var(--calc_num_background);
    line-height: 1.5;
}
.tr_result.tr_result_ok{ border-left-color: #16a34a; font-weight: 600; }
.tr_formula{
    margin-top: 8px;
}
.trainer_link{
    margin: 12px 0;
    text-align: center;
}
.trainer_link a{
    display: inline-block;
    padding: 12px 24px;
    border-radius: 10px;
    background: var(--modal_button);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}
.trainer_link a:hover{ background: var(--modal_button_hover); }
.tr_frac{
    display: inline-flex;
    flex-direction: column;
    vertical-align: middle;
    text-align: center;
    line-height: 1.2;
}
.tr_frac span:first-child{
    border-bottom: solid 2px currentColor;
    padding: 0 4px;
}
/* общий .hidden только прячет блок, а место оставляет */
.tr_box .hidden, #tr_solution_box.hidden{ display: none; }
.trainer_after{
    margin-top: 20px;
    padding-top: 16px;
    border-top: solid 1px var(--calc_num_border);
    text-align: center;
}
.trainer_after p{ margin: 0 0 12px; }
/* ошибка ввода тоже открывает блок ответа, но приглашение нужно только после решения */
#calculator_answer:empty + link + .trainer_after{ display: none; }
.tr_matrices{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}
.tr_matrix{
    border-left: solid 2px currentColor;
    border-right: solid 2px currentColor;
    border-collapse: separate;
    border-spacing: 8px 2px;
    border-radius: 6px;
}
.tr_q{ opacity: 0.6; margin-right: 2px; }
