/* Таблица синусов и косинусов — стили страницы. Основа — римские цифры. web-calculator.ru */

.calculator {
    font-family: 'Unbounded', sans-serif;
    font-size: 16px;
    max-width: 720px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid rgb(224, 224, 224);
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

/* Поле ввода: label в дизайн-системе плавает поверх инпута, поэтому нужен верхний отступ. */
.calculator__input {
    font-size: inherit;
    width: 100%;
    padding: 26px 16px 10px;
    border: 1px solid #ccc;
    border-radius: 16px;
    box-sizing: border-box;
    margin: 0;
    background: #fff;
}

#simple-calc .calculator__input {
    font-family: 'Unbounded', serif;
    font-size: 14px;
    letter-spacing: .04em;
    word-break: break-all;
}

#simple-calc .form-group {
    margin-bottom: 8px;
}

#simple-calc .btn-wrapper {
    margin-top: 0;
}

/* Сообщение об ошибке и о нестандартной записи. */
.calc-error {
    display: none;
    margin: 4px 0 0;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fdeced;
    color: #b3261e;
    font-size: 13px;
    line-height: 1.4;
}

.calculator__buttons-container {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.calculator__buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 300px;
    height: 48px;
    padding: 0 24px;
    font-family: 'Unbounded', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.15;
    border-radius: 16px;
    border: 1px solid #DDD;
    cursor: pointer;
    background-color: #000;
    color: #fff;
    text-align: center;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
    margin: 0;
}

.calculator__buttons:hover {
    background-color: #333;
}

.button--gray {
    background-color: #fff;
    color: #000;
}

.button--gray:hover {
    background-color: #f1f1f1;
}

/* Шаги решения. */

.calculator-wrapper .tr-steps {
    width: 100%;
    font-family: 'Unbounded', serif;
    font-size: 12px;
    line-height: 1.7;
    color: rgba(0, 0, 0, 0.7);
}

.calculator-wrapper .tr-steps .pr-step {
    display: block;
    margin: 0 0 6px;
    word-break: break-word;
}

.calculator-wrapper .tr-steps .pr-step:last-child {
    margin-bottom: 0;
}

.calculator-wrapper .tr-steps b {
    color: #000;
}

/* Чипы под результатом: копирование и очистка. */
#simple-calc .ss-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.calculator-wrapper .rz-chip {
    font-family: 'Unbounded', serif;
    font-size: 12px;
    color: #000;
    background: #fff;
    border: 1px solid #DDD;
    border-radius: 16px;
    height: 34px;
    padding: 0 14px;
    cursor: pointer;
    width: auto;
}

.calculator-wrapper .rz-chip:hover {
    background: #f3f4f6;
}

#simple-calc .ss-copy-note {
    font-size: 12px;
    color: #16a34a;
    min-height: 16px;
}

/* Таблицы в тексте. */
.ss-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ss-table th,
.ss-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.ss-table th {
    font-weight: 600;
    background: #f9fafb;
}

/* Вкладки: значения по углу и угол по значению. */
#simple-calc .rc-tabs {
    display: flex;
    gap: 6px;
    margin: 0 0 16px;
    padding: 4px;
    border-radius: 16px;
    background: #f3f4f6;
}

#simple-calc .rc-tab {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 8px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    font-family: 'Unbounded', sans-serif;
    font-size: 12px;
    color: rgba(0, 0, 0, .6);
    cursor: pointer;
    width: auto;
}

#simple-calc .rc-tab[aria-selected="true"] {
    background: #fff;
    color: #000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

#simple-calc .rc-tab:focus-visible,
#simple-calc .rc-seg:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Переключатели: единицы угла, точность, функция. */
#simple-calc .rc-segs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
}

#simple-calc .rc-seg {
    height: 36px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: #fff;
    font-family: 'Unbounded', serif;
    font-size: 12px;
    color: #000;
    cursor: pointer;
    width: auto;
}

#simple-calc .rc-seg[aria-pressed="true"] {
    background: #000;
    border-color: #000;
    color: #fff;
}

.calculator-wrapper .tr-steps small {
    display: block;
    font-size: 11px;
    color: rgba(0, 0, 0, .5);
}

#simple-calc .calculator__result {
    margin-top: 16px;
}

#simple-calc .rc-segs--sm {
    margin: 0;
}

#simple-calc .rc-segs--sm .rc-seg {
    height: 32px;
    min-width: 40px;
    padding: 0 12px;
}

#simple-calc .tr-hint {
    margin: -2px 0 10px;
    font-size: 11px;
    line-height: 1.4;
    color: rgba(0, 0, 0, .5);
}

/* Быстрый выбор табличных углов и значений. */
#simple-calc .tr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

#simple-calc .tr-chip {
    height: 32px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    font-family: 'Unbounded', serif;
    font-size: 12px;
    color: #000;
    cursor: pointer;
    width: auto;
}

#simple-calc .tr-chip:hover {
    background: #f3f4f6;
}

#simple-calc .tr-chip:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

#simple-calc .tr-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    font-size: 12px;
    color: rgba(0, 0, 0, .6);
}

/* Ответ: четыре функции столбиком, точное значение и десятичное рядом. */
.calculator-wrapper .tr-vals {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.calculator-wrapper .tr-val {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    font-family: 'Unbounded', serif;
    font-size: 18px;
    line-height: 1.3;
    color: #000;
}

.calculator-wrapper .tr-fn {
    color: rgba(0, 0, 0, .55);
    white-space: nowrap;
}

.calculator-wrapper .tr-num {
    text-align: right;
    word-break: break-word;
}

.calculator-wrapper .tr-dec {
    margin-left: 8px;
    font-size: 14px;
    color: rgba(0, 0, 0, .55);
    white-space: nowrap;
}

.calculator-wrapper .tr-none {
    font-size: 14px;
    color: #b3261e;
}

.calculator-wrapper .tr-inv-main {
    font-family: 'Unbounded', serif;
    font-size: 18px;
    line-height: 1.4;
    color: #000;
}

.calculator-wrapper .tr-inv-main .tr-fn {
    display: block;
    font-size: 12px;
    white-space: normal;
}

.calculator-wrapper .tr-extra {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

#simple-calc .tr-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-family: 'Unbounded', serif;
    font-size: 12px;
    line-height: 1.4;
}

#simple-calc .tr-row span {
    color: rgba(0, 0, 0, .5);
}

#simple-calc .tr-row b {
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

/* Единичная окружность под ответом. */
.calculator-wrapper .tr-circle {
    max-width: 390px;
    margin: 12px auto;
}

.calculator-wrapper .tr-circle svg {
    display: block;
    width: 100%;
    height: auto;
    font-family: 'Unbounded', sans-serif;
}

/* Таблицы в тексте. */
.rc-scroll {
    overflow-x: auto;
    margin: 0 0 16px;
}

.tt-center th,
.tt-center td {
    text-align: center;
    white-space: nowrap;
}

.tt-center tbody th {
    text-align: left;
}

.tt-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 10px;
}

.tt-tools .rc-segs,
.tt-tools .tt-jumps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tt-tools button {
    height: 32px;
    min-width: 40px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    font-family: 'Unbounded', serif;
    font-size: 12px;
    color: #000;
    cursor: pointer;
    width: auto;
}

.tt-tools button:hover {
    background: #f3f4f6;
}

.tt-tools .rc-seg[aria-pressed="true"] {
    background: #000;
    border-color: #000;
    color: #fff;
}

.tt-tools button:focus-visible,
.tt-scroll:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.tt-scroll {
    max-height: 520px;
    overflow: auto;
    margin: 0 0 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.tt-scroll .ss-table {
    display: table;
    overflow: visible;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.tt-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 1px 0 #e5e7eb;
}

.tt-num th,
.tt-num td {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tt-num th:first-child {
    text-align: left;
}

.tt-num tr.tt-key th,
.tt-num tr.tt-key td {
    background: #eef2ff;
}

.tt-num .tt-p {
    margin-right: 4px;
    font-weight: 600;
}

.tt-bradis th,
.tt-bradis td {
    padding: 6px 8px;
    font-size: 13px;
}

.tt-bradis tbody th {
    position: sticky;
    left: 0;
    background: #f9fafb;
    box-shadow: 1px 0 0 #e5e7eb;
    border-radius: 0;
}

.tt-scroll .tt-bradis thead th:first-child {
    left: 0;
    z-index: 2;
    box-shadow: 1px 1px 0 #e5e7eb;
}

@media (max-width: 640px) {
    .calculator {
        padding: 15px;
    }
    #simple-calc .rc-tab {
        font-size: 11px;
        padding: 0 4px;
    }
    .calculator-wrapper .tr-val,
    .calculator-wrapper .tr-inv-main {
        font-size: 16px;
    }
    .calculator-wrapper .tr-dec {
        font-size: 12px;
    }
    #simple-calc .tr-row {
        font-size: 11px;
    }
    .ss-table th,
    .ss-table td {
        padding: 6px 8px;
        font-size: 13px;
    }
    .tt-scroll {
        max-height: 440px;
    }
}
