/* Уравнения и матрицы в новом виде: решение уравнений, квадратные уравнения, системы уравнений, метод Гаусса, метод Крамера, калькулятор матриц. Разметка, id, подписи и скрипты прежние */
/* Общая основа — rd-geometriya.css, здесь только то, чего у площадей нет. Файл подключается после rd-geometriya.css и раньше calc.css, redesign.css и rd.css, поэтому селекторы начинаются с .rd #simple-calc */

/* Скрытое атрибутом hidden остаётся скрытым: общее .form-group { display: block } иначе показывало поле «Округлить, знаков» при точном ответе */
.rd #simple-calc [hidden] { display: none !important; }
/* Квадратные уравнения и матрицы показывают ошибку классом is-visible, а при скрытии текст не стирают */
.rd #simple-calc #wc-error:not(.is-visible) { display: none; }

/* Подсказка к способу решения */
.rd #simple-calc .mode-hint b { font-weight: 600; color: var(--ink); }
.rd #simple-calc .mode-hint:empty { display: none; }

/* Обычные поля и списки без обёртки: квадратные уравнения и матрицы */
.rd #simple-calc .form-group > :is(select, input[type="text"], input[type="number"]) { display: block; -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 100%; height: 48px; margin: 0; padding: 0 16px; background-color: var(--tile); border: 1px solid var(--line); border-radius: 14px; box-shadow: none; outline: none; font: 500 16px/46px var(--f-ui); color: var(--ink); text-align: left; }
.rd #simple-calc .form-group > :is(select, input):focus { border-color: var(--accent); }
.rd #simple-calc .form-group > input::placeholder { font-weight: 400; color: var(--mute); opacity: 1; }
.rd #simple-calc :is(.form-group > select, .mx-size select) { padding-right: 42px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230D0D0D' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; cursor: pointer; }
.rd #simple-calc .form-group > select:hover { border-color: var(--accent-mid); }

/* Решение уравнений */
/* Коэффициенты по три в ряд, как в записи уравнения; подписи разной длины, поэтому поля выравниваются по нижнему краю */
.rd #simple-calc .form-group__wrapper { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.rd #simple-calc .form-group__wrapper > :only-child { grid-column: auto; }
.rd #simple-calc .eq-form-view { margin: 0; padding: 12px 16px; border-radius: 14px; background: var(--tile); font: 500 15px/1.5 var(--f-mono); color: var(--ink); overflow-wrap: anywhere; }
.rd #simple-calc .eq-form-view:empty { display: none; }
.rd #simple-calc .eq-line { margin: 0 0 8px; font: 400 14px/1.5 var(--f-ui); letter-spacing: 0; color: var(--mute); overflow-wrap: anywhere; }
.rd #simple-calc .eq-answer { font: 600 26px/1.3 var(--f-ui); letter-spacing: -.2px; color: var(--ink); }
.rd #simple-calc :is(.eq-frac, .eq-note) { font-size: .7em; font-weight: 400; letter-spacing: 0; color: var(--mute); white-space: nowrap; }
.rd #simple-calc .calc-extra__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); font: 400 14px/1.45 var(--f-ui); }
.rd #simple-calc .calc-extra__row:first-child { border-top: 0; padding-top: 0; }
.rd #simple-calc .calc-extra__row > span { flex: 0 0 auto; color: var(--mute); }
.rd #simple-calc .calc-extra__row > b { flex: 1 1 auto; font-weight: 500; text-align: right; overflow-wrap: anywhere; }

/* Системы уравнений, метод Гаусса, метод Крамера */
.rd #simple-calc .slau-area { display: block; box-sizing: border-box; width: 100%; min-height: 116px; margin: 0; padding: 12px 16px; background: var(--tile); border: 1px solid var(--line); border-radius: 14px; box-shadow: none; outline: none; resize: vertical; font: 400 16px/1.7 var(--f-mono); color: var(--ink); }
.rd #simple-calc .slau-area:focus { border-color: var(--accent); }
/* Таблица коэффициентов листается вбок внутри карточки */
.rd #simple-calc #gridHost { margin: 16px 0 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rd #simple-calc .slau-grid { width: 100%; margin: 0; border-collapse: separate; border-spacing: 4px 6px; }
.rd #simple-calc .slau-grid td { padding: 0; border: 0; background: none; vertical-align: middle; }
.rd #simple-calc .slau-grid .slau-cell { min-width: 52px; height: 44px; padding: 0 6px; border-radius: 12px; line-height: 42px; text-align: center; font-variant-numeric: tabular-nums; }
.rd #simple-calc .slau-varname { padding: 0 2px; font: 400 13px/1.3 var(--f-mono); color: var(--mute); white-space: nowrap; }

/* Рисунок системы: без двух неизвестных вместо графика пояснение с кнопкой примера */
.rd #simple-calc .slau-nodraw { padding: 16px 14px; border: 1px dashed var(--accent-mid); border-radius: 12px; font: 400 13px/1.5 var(--f-ui); color: var(--mute); text-align: center; }
.rd #simple-calc .slau-nodraw b { font-weight: 600; color: var(--ink); }
.rd #simple-calc .slau-nodraw .slau-nodraw__btn { display: flex; width: 100%; margin: 12px 0 0; white-space: normal; }
.rd #simple-calc .slau-legend { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0; font: 400 13px/1.3 var(--f-ui); color: var(--ink); }
.rd #simple-calc .slau-legend__row { display: flex; align-items: center; gap: 8px; }
.rd #simple-calc .slau-legend__row i { flex: 0 0 16px; height: 3px; border-radius: 2px; }
.rd #simple-calc .slau-caption { margin: 8px 0 0; font: 400 12px/1.45 var(--f-ui); color: var(--mute); }

/* Ответ системы: по неизвестной в строке */
.rd #simple-calc .slau-answer { display: flex; flex-direction: column; gap: 4px; }
.rd #simple-calc .slau-var { font: 600 24px/1.3 var(--f-ui); letter-spacing: -.2px; }
.rd #simple-calc .slau-dec { margin-left: 6px; font: 400 14px/1.3 var(--f-ui); letter-spacing: 0; color: var(--mute); }
.rd #simple-calc .slau-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); font: 400 14px/1.45 var(--f-ui); }
.rd #simple-calc .slau-row:first-child { border-top: 0; padding-top: 0; }
.rd #simple-calc .slau-row > span { color: var(--mute); }
.rd #simple-calc .slau-row > b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.rd #simple-calc .slau-note { margin: 0 0 12px; padding: 10px 14px; border-left: 3px solid var(--accent); border-radius: 0 12px 12px 0; background: var(--card); font: 400 13px/1.55 var(--f-ui); color: var(--ink); }
.rd #simple-calc .slau-note b { font-weight: 600; color: var(--ink); }

/* Дробь с чертой */
.rd #simple-calc .fr { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; line-height: 1; }
.rd #simple-calc :is(.fr-sign, .fr-int) { font-weight: inherit; }
.rd #simple-calc .fr-box { display: inline-flex; flex-direction: column; align-items: center; font-size: .78em; line-height: 1.05; }
.rd #simple-calc .fr-n { padding: 0 3px 1px; border-bottom: 1.2px solid currentColor; }
.rd #simple-calc .fr-d { padding: 1px 3px 0; }

/* Матрицы в ходе решения: скобки рисуются рамками, определитель — прямыми чертами */
.rd #simple-calc .slau-matrix { display: inline-flex; align-items: stretch; max-width: 100%; margin: 4px 0; vertical-align: middle; }
.rd #simple-calc .slau-matrix::before, .rd #simple-calc .slau-matrix::after { content: ""; flex: 0 0 6px; border: 1.4px solid var(--ink); border-radius: 2px; }
.rd #simple-calc .slau-matrix::before { border-right: 0; }
.rd #simple-calc .slau-matrix::after { border-left: 0; }
.rd #simple-calc .slau-matrix--det::before, .rd #simple-calc .slau-matrix--det::after { flex-basis: 0; margin: 0 4px; border: 0; border-left: 1.4px solid var(--ink); border-radius: 0; }
.rd #simple-calc .mx-grid { display: inline-grid; align-items: center; }
.rd #simple-calc .mx-c { padding: 3px 9px; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd #simple-calc .mx-bar { border-left: 1.2px solid var(--mute); }
.rd #simple-calc .mx-hi { border-radius: 3px; background: var(--accent-soft); font-weight: 600; }
.rd #simple-calc #res-steps .slau-matrix { max-width: 100%; }
.rd #simple-calc #res-steps { overflow-x: auto; }

/* Готовые примеры — чипами */
.rd #simple-calc .slau-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; }
.rd #simple-calc :is(.slau-presets__label, .mx-examples__label) { flex: 0 0 100%; margin: 0 0 2px; font: 400 11px/1.3 var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--mute); }
.rd #simple-calc .slau-preset { display: inline-flex; align-items: center; justify-content: center; flex: none; box-sizing: border-box; width: auto; min-width: 0; max-width: none; height: auto; min-height: 38px; margin: 0; padding: 8px 16px; border: 0; border-radius: 999px; background: var(--pill); box-shadow: none; font: 500 13px/1.2 var(--f-ui); letter-spacing: 0; text-transform: none; color: var(--ink); text-align: center; cursor: pointer; opacity: 1; transition: background-color .15s; }
.rd #simple-calc .slau-preset:hover { background: var(--accent-soft); opacity: 1; }
.rd #simple-calc .slau-preset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Квадратные уравнения: коэффициенты в записи уравнения */
.rd #simple-calc .qe-input { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 0; padding: 20px 16px; border: 1px solid var(--line); border-radius: 18px; }
.rd #simple-calc .qe-formula { font: 500 18px/1.4 var(--f-mono); color: var(--ink); }
.rd #simple-calc .qe-coefs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; }
.rd #simple-calc .qe-coef { display: inline-flex; align-items: center; gap: 8px; font: 500 15px/1 var(--f-mono); }
.rd #simple-calc .qe-coef label { margin: 0; font: 500 15px/1 var(--f-mono); color: var(--ink); }
.rd #simple-calc .qe-coef input { box-sizing: border-box; width: 72px; height: 52px; margin: 0; padding: 0 8px; background: var(--tile); border: 1px solid var(--line); border-radius: 14px; box-shadow: none; outline: none; font: 500 16px/50px var(--f-ui); color: var(--ink); text-align: center; }
.rd #simple-calc .qe-coef input:focus { border-color: var(--accent); }
.rd #simple-calc .qe-coef input::placeholder { color: var(--mute); opacity: .7; }
.rd #simple-calc .qe-eq { min-height: 1.5em; font: 500 18px/1.5 var(--f-ui); color: var(--ink); text-align: center; overflow-wrap: anywhere; }
.rd #simple-calc .qe-note { font: 400 12px/1.45 var(--f-ui); color: var(--mute); text-align: center; }
.rd #simple-calc .qe-row2 { display: flex; flex-wrap: wrap; gap: 16px; }
.rd #simple-calc .qe-row2 > .form-group { flex: 1 1 240px; }

/* Результат квадратных уравнений и матриц: крупная строка у корней, у матриц обычный текст */
.rd #simple-calc #wc-result .result-text { font: 400 16px/1.5 var(--f-ui); letter-spacing: 0; }
.rd #simple-calc .wc__result-main { font: 600 28px/1.25 var(--f-ui); letter-spacing: -.2px; color: var(--ink); overflow-wrap: anywhere; }
.rd #simple-calc .wc__result-main + .wc__result-main { margin-top: 6px; }
.rd #simple-calc #res-roots { margin: 0 0 4px; }
.rd #simple-calc .wc__hint { font: 400 13px/1.5 var(--f-ui); color: var(--mute); }
.rd #simple-calc .qe-facts { display: flex; flex-direction: column; margin: 16px 0 0; }
.rd #simple-calc .qe-fact { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); font: 400 14px/1.45 var(--f-ui); }
.rd #simple-calc .qe-fact:first-child { border-top: 0; }
.rd #simple-calc .qe-fact > span:first-child { flex: 0 0 auto; color: var(--mute); }
.rd #simple-calc .qe-fact > b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.rd #simple-calc #res-graph { margin: 16px 0 0; }
.rd #simple-calc #res-graph:empty { display: none; }
.rd #simple-calc .qe-toggle { margin: 16px 0 0; }
.rd #simple-calc .qe-steps { box-sizing: border-box; width: 100%; margin: 16px 0 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; }
.rd #simple-calc .qe-steps .label-text { margin-bottom: 12px; }
.rd #simple-calc .qe-steps #res-steps ol { margin: 6px 0 0; padding-left: 22px; list-style: decimal outside; }
.rd #simple-calc .qe-steps #res-steps li { margin: 12px 0; padding: 0; }
.rd #simple-calc .qe-steps #res-steps li::before { display: none; }
.rd #simple-calc .qe-line { margin: 8px 0; }
.rd #simple-calc .step-eq { font-size: 13px; }
.rd #simple-calc .wc-rad { padding: 0 2px; border-top: 1px solid currentColor; }
.rd #simple-calc .wc-frac { display: inline-flex; flex-direction: column; align-items: center; margin: 0 3px; vertical-align: middle; }
.rd #simple-calc .wc-frac > span { display: block; padding: 0 4px; line-height: 1.2; }
.rd #simple-calc .wc-frac > span:first-child { border-bottom: 1px solid currentColor; }
.rd #simple-calc .wc-frac .wc-rad { display: inline; }
.rd #simple-calc .mono { white-space: nowrap; }
/* График параболы в палитре сайта */
.rd #simple-calc .wc-graph { display: block; width: 100%; max-width: 340px; height: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--tile); }
.rd #simple-calc .wc-axis { stroke: var(--mute); stroke-opacity: .45; }
.rd #simple-calc .wc-curve { fill: none; stroke: var(--accent); stroke-width: 2; }
.rd #simple-calc .wc-pt { stroke: var(--tile); stroke-width: 1; }
.rd #simple-calc .wc-pt--root { fill: var(--bad); }
.rd #simple-calc .wc-pt--vx { fill: var(--accent); }
.rd #simple-calc .wc-pt--y { fill: var(--mute); }

/* Калькулятор матриц: строки параметров операции */
.rd #simple-calc .mx-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; }
.rd #simple-calc .mx-row > .form-group { flex: 1 1 240px; }
.rd #simple-calc .mx-row2 { display: flex; flex-wrap: wrap; gap: 16px; width: 100%; }
.rd #simple-calc .mx-row2 > .form-group { flex: 1 1 200px; }
.rd #simple-calc .mx-row2 > .form-group.mx-num { flex: 1 1 130px; }
.rd #simple-calc #row-elem .mx-row2 > .form-group:first-child { flex: 1 1 100%; }
.rd #simple-calc :is(.mx-hint, .mx-row > .wc__hint) { flex: 1 1 100%; font: 400 12px/1.5 var(--f-ui); color: var(--mute); }
/* Методы решения — галочками */
.rd #simple-calc .mx-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; flex: 1 1 100%; box-sizing: border-box; margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; }
.rd #simple-calc .mx-checks__title { flex: 0 0 100%; font: 400 11px/1.3 var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--mute); }
.rd #simple-calc .mx-check { display: flex; align-items: center; gap: 8px; margin: 0; font: 400 14px/1.35 var(--f-ui); color: var(--ink); cursor: pointer; }
.rd #simple-calc .mx-check input[type="checkbox"] { position: relative; flex: none; -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin: 0; padding: 0; border: 1.5px solid var(--ink); border-radius: 5px; background: var(--tile); cursor: pointer; }
.rd #simple-calc .mx-check input[type="checkbox"]::after { content: ""; position: absolute; left: 5px; top: 1px; width: 4px; height: 9px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); opacity: 0; }
.rd #simple-calc .mx-check input[type="checkbox"]:checked { background: var(--ink); }
.rd #simple-calc .mx-check input[type="checkbox"]:checked::after { opacity: 1; }
.rd #simple-calc .mx-check input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Матрицы A и B: ячейки в скобках, размер и заполнение под ними */
.rd #simple-calc .mx-wrap { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 18px 24px; margin: 4px 0; }
.rd #simple-calc .mx-block { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; max-width: 100%; }
.rd #simple-calc .mx-title { margin: 0 0 10px; font: 400 11px/1.3 var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--mute); }
.rd #simple-calc .mx-brackets { position: relative; display: inline-block; max-width: 100%; padding: 8px 14px; box-sizing: border-box; overflow-x: auto; }
.rd #simple-calc :is(.mx-brackets, .mx)::before, .rd #simple-calc :is(.mx-brackets, .mx)::after { content: ""; position: absolute; top: 0; bottom: 0; width: 6px; border: 1px solid var(--ink); }
.rd #simple-calc :is(.mx-brackets, .mx)::before { left: 0; border-right: 0; border-radius: 3px 0 0 3px; }
.rd #simple-calc :is(.mx-brackets, .mx)::after { right: 0; border-left: 0; border-radius: 0 3px 3px 0; }
.rd #simple-calc .wc-matrix { display: inline-grid; gap: 6px; }
.rd #simple-calc .wc-matrix input { box-sizing: border-box; width: 52px; height: 40px; margin: 0; padding: 0 4px; background: var(--tile); border: 1px solid var(--line); border-radius: 10px; box-shadow: none; outline: none; font: 500 15px/38px var(--f-ui); color: var(--ink); text-align: center; font-variant-numeric: tabular-nums; }
.rd #simple-calc .wc-matrix input:focus { border-color: var(--accent); }
.rd #simple-calc .mx-size { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 0; }
.rd #simple-calc .mx-size select { -webkit-appearance: none; appearance: none; box-sizing: border-box; min-width: 64px; height: 36px; margin: 0; padding: 0 26px 0 12px; background-color: var(--tile); background-position: right 9px center; background-size: 10px auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: none; outline: none; font: 500 14px/34px var(--f-ui); color: var(--ink); }
.rd #simple-calc .mx-size select:focus { border-color: var(--accent); }
.rd #simple-calc .mx-size__x { font: 400 14px/1 var(--f-ui); color: var(--mute); }
.rd #simple-calc .mx-fill { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; margin: 8px 0 0; }
.rd #simple-calc .mx-fill button { margin: 0; padding: 2px 0; border: 0; border-bottom: 1px dashed var(--mute); border-radius: 0; background: none; box-shadow: none; font: 400 12px/1.4 var(--f-ui); color: var(--mute); cursor: pointer; }
.rd #simple-calc .mx-fill button:hover { color: var(--ink); border-bottom-color: var(--ink); }
.rd #simple-calc .mx-swap { display: inline-flex; align-items: center; justify-content: center; flex: none; box-sizing: border-box; width: 40px; height: 40px; margin: 22px 0 0; padding: 0; border: 0; border-radius: 999px; background: var(--pill); box-shadow: none; font: 400 17px/1 var(--f-ui); color: var(--ink); cursor: pointer; transition: background-color .15s; }
.rd #simple-calc .mx-swap:hover { background: var(--accent-soft); }
.rd #simple-calc .mx-swap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd #simple-calc .mx-paste-hint { margin: 0; font: 400 12px/1.5 var(--f-ui); color: var(--mute); text-align: center; }
.rd #simple-calc .mx-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }

/* Ответ калькулятора матриц */
.rd #simple-calc .mx { position: relative; display: inline-grid; gap: 5px 14px; margin: 6px 8px; padding: 7px 14px; vertical-align: middle; }
.rd #simple-calc .mx-cell { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; padding: 1px 3px; font: 400 14px/1.4 var(--f-ui); font-variant-numeric: tabular-nums; }
.rd #simple-calc .mx-cell--sep { margin-left: 3px; padding-left: 10px; border-left: 1px dashed var(--mute); }
.rd #simple-calc .mx--sm .mx-cell { min-width: 22px; font-size: 13px; }
.rd #simple-calc .mx-frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.1; }
.rd #simple-calc .mx-frac__n { padding: 0 3px; border-bottom: 1px solid currentColor; }
.rd #simple-calc .mx-frac__d { padding: 0 3px; }
.rd #simple-calc :is(.mx-steps, .mx-answer) .mx-frac { font-size: .85em; }
.rd #simple-calc .mx-op { display: inline-block; margin: 0 6px; font: 400 15px/1 var(--f-ui); vertical-align: middle; }
.rd #simple-calc .mx-main { margin: 2px 0 6px; font: 400 15px/1.5 var(--f-ui); overflow-x: auto; }
.rd #simple-calc .mx-scalar { font: 600 28px/1.25 var(--f-ui); letter-spacing: -.2px; }
.rd #simple-calc .mx-answer { font: 400 15px/1.6 var(--f-ui); }
.rd #simple-calc .mx-answer > b { display: block; margin: 0 0 8px; font-weight: 600; }
.rd #simple-calc .mx-answer ul { display: inline-block; margin: 0; padding-left: 20px; text-align: left; }
/* Ход решения матриц */
.rd #simple-calc :is(.wc__steps, .mx-steps) { margin: 18px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); font: 400 14px/1.6 var(--f-ui); color: var(--ink); text-align: left; overflow-x: auto; }
.rd #simple-calc :is(.wc__steps, .mx-steps) h4 { margin: 18px 0 8px; padding: 0; font: 600 13px/1.4 var(--f-ui); letter-spacing: 0; text-transform: none; color: var(--mute); }
.rd #simple-calc :is(.wc__steps, .mx-steps) h4:first-child { margin-top: 0; }
.rd #simple-calc :is(.wc__steps, .mx-steps) p { margin: 8px 0; }
.rd #simple-calc :is(.wc__steps, .mx-steps) ol { margin: 8px 0; padding-left: 22px; list-style: decimal outside; }
.rd #simple-calc :is(.wc__steps, .mx-steps) li { margin: 10px 0; padding: 0; }
.rd #simple-calc :is(.wc__steps, .mx-steps) li::before { display: none; }
.rd #simple-calc :is(.wc__steps, .mx-steps) :is(p, li, .mx-formula) { line-height: 2; }
.rd #simple-calc .mx-formula { margin: 6px 0; }
.rd #simple-calc :is(.mx-mul, .mx-sol) { padding-left: 0; list-style: none; }
.rd #simple-calc :is(.mx-mul, .mx-sol) li { margin: 5px 0; }
.rd #simple-calc .mx-mul li { margin: 8px 0; }
/* Кнопки под ответом */
.rd #simple-calc .mx-toggle { display: flex; width: fit-content; max-width: 100%; align-items: center; justify-content: center; box-sizing: border-box; min-height: 42px; margin: 16px 0 0; padding: 8px 20px; border: 0; border-radius: 21px; background: var(--pill); box-shadow: none; font: 500 14px/1.2 var(--f-ui); text-align: center; color: var(--ink); cursor: pointer; transition: background-color .15s; }
.rd #simple-calc .mx-toggle:hover { background: var(--accent-soft); }
/* СЛАУ на матрицах: кнопки остальных методов столбцом, между ними скрытые разборы */
.rd #simple-calc .mx-steps[hidden] + .mx-toggle { margin-top: 10px; }
.rd #simple-calc .mx-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd #simple-calc :is(.mx-copy, .mx-insert) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 0; }
.rd #simple-calc .mx-insert { padding: 16px 0 0; border-top: 1px solid var(--line); }
.rd #simple-calc .mx-insert__note { flex: 0 0 100%; font: 400 13px/1.45 var(--f-ui); color: var(--mute); }
.rd #simple-calc :is(.mx-copy, .mx-insert) .calculator__buttons { height: 40px; padding: 0 18px; font-size: 13px; }

/* Узкая карточка: у систем рисунок под формой — он показывает уже найденное решение, у решения уравнений график над формой, как у площадей */
@container (max-width: 539px) {
    .rd #simple-calc .calc-layout:has(#gridHost) .calc-visual { order: 2; width: 100%; max-width: 280px; }
}

@media (max-width: 639px) {
    .rd #simple-calc .form-group__wrapper { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .rd #simple-calc .eq-answer { font-size: 22px; }
    .rd #simple-calc :is(.calc-extra__row, .qe-fact) { flex-direction: column; gap: 2px; }
    .rd #simple-calc :is(.calc-extra__row, .qe-fact) > b { text-align: left; }
    .rd #simple-calc .slau-area { min-height: 104px; line-height: 1.6; }
    .rd #simple-calc .slau-grid .slau-cell { min-width: 40px; height: 40px; padding: 0 2px; font-size: 15px; line-height: 38px; }
    .rd #simple-calc .slau-varname { font-size: 11px; }
    .rd #simple-calc .slau-var { font-size: 20px; }
    .rd #simple-calc .qe-input { padding: 16px 10px; }
    .rd #simple-calc .qe-coefs { gap: 10px 8px; }
    .rd #simple-calc .qe-coef { gap: 5px; font-size: 14px; }
    .rd #simple-calc .qe-coef input { width: 60px; }
    .rd #simple-calc .wc__result-main, .rd #simple-calc .mx-scalar { font-size: 22px; }
    .rd #simple-calc .qe-steps { padding: 16px; }
    .rd #simple-calc .mx-block { flex: 1 0 100%; }
    .rd #simple-calc .mx-brackets { padding: 6px 11px; }
    .rd #simple-calc .wc-matrix { gap: 4px; }
    .rd #simple-calc .wc-matrix input { width: 44px; height: 40px; border-radius: 8px; font-size: 16px; }
    .rd #simple-calc .mx-swap { width: auto; min-width: 120px; height: 36px; margin: 0 auto; padding: 0 16px; }
    .rd #simple-calc .mx-swap::after { content: " A и B"; margin-left: 6px; font-size: 13px; }
    .rd #simple-calc .mx-paste-hint { display: none; }
    .rd #simple-calc .mx-cell { min-width: 24px; }
    .rd #simple-calc :is(.mx-copy, .mx-insert) .calculator__buttons { flex: 1 1 auto; }
}

@media (max-width: 360px) {
    .rd #simple-calc .form-group__wrapper { grid-template-columns: minmax(0, 1fr); }
}

@media print {
    .rd #simple-calc :is(.slau-presets, .mx-examples, .mx-fill, .mx-swap, .mx-copy, .mx-insert, .mx-toggle, .qe-toggle) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .rd #simple-calc :is(.slau-preset, .mx-swap, .mx-toggle) { transition: none; }
}
