/* Конвертеры в новом виде: html-ryedaktor-onlayn, kilobyte-v-byte, kilogrammy-v-grammy, konverter-dliny, konverter-obema, konverter-ploschadi, konverter-sistem-schisleniya, mili-v-kilometry, perevod-iz-dvoichnoy-v-desyatichnuyu, perevod-iz-shestnadcaterichnoy-v-desyatichnuyu, perevod-iz-vosmerichnoy-v-desyatichnuyu, perevod-v-dvoichnyj-kod, rimskie-cifry. Разметка, id, подписи и скрипты прежние */
/* Файл подключается после rd-geometriya.css и раньше calc.css, redesign.css и rd.css, поэтому селекторы начинаются с .rd #simple-calc */
.rd #simple-calc [hidden] { display: none !important; }

/* ===== общее: группы в списках, ошибки, колонки ===== */
.rd #simple-calc .custom-select__group { padding: 10px 12px 4px; font: 400 11px/1.3 var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--mute); pointer-events: none; }
.rd #simple-calc .custom-select__options > .custom-select__group:first-child { padding-top: 4px; }
/* подпись поля ввода стоит в одной колонке с подписями списков и вкладок («Из единицы», «Кодировка») — набираем её так же, а не обычным шрифтом */
.rd #simple-calc .calculator__form .calculator__label { font: 400 11px/1.3 var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--mute); }
.rd #simple-calc :is(.ld-error, .mk-error, .kp-error) { display: block; margin: 0; padding: 12px 16px; border-radius: 14px; background: var(--bad-soft); font: 500 14px/1.4 var(--f-ui); color: var(--bad); }
.rd #simple-calc :is(.ld-error, .mk-error, .kp-error):empty { display: none; }
.rd #simple-calc :is(.ld-2col, .mk-2col) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rd #simple-calc :is(.ld-2col, .mk-2col) > * { min-width: 0; }

/* ===== чипы и копирование ===== */
.rd #simple-calc :is(.ld-chips, .mk-chips) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.rd #simple-calc :is(.bin-chips, .ss-chips, .kb-copy, .kb-actions) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 0; }
.rd #simple-calc :is(.ld-chips__label, .mk-chips__label) { flex: 1 0 100%; font: 400 11px/1.3 var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--mute); }
.rd #simple-calc :is(.ld-chip, .mk-chip) { display: inline-flex; align-items: center; justify-content: center; height: 38px; margin: 0; padding: 0 16px; border: 0; border-radius: 999px; background: var(--pill); font: 500 13px/1 var(--f-ui); color: var(--ink); white-space: nowrap; cursor: pointer; }
.rd #simple-calc :is(.ld-chip, .mk-chip):hover { background: var(--accent-soft); }
.rd #simple-calc :is(.ld-chip, .mk-chip):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd #simple-calc :is(.ld-copy, .mk-copy) { margin: 16px 0 0; }
.rd #simple-calc :is(.kb-copy__note, .bin-copy-note, .ss-copy-note) { color: var(--good); }
.rd #simple-calc :is(.kb-copy__note, .ss-copy-note) { flex: 1 0 100%; min-height: 16px; }
.rd #simple-calc :is(.kb-copy__note, .ss-copy-note):empty { flex: 0 0 0; min-height: 0; margin-left: -8px; }

/* ===== строки вывода и шаги ===== */
.rd #simple-calc :is(.kb-extra, .bin-extra) { display: flex; flex-direction: column; }
.rd #simple-calc #res-extra:has(.ss-row), .rd #simple-calc .rc-res-extra { display: flex; flex-direction: column; }
.rd #simple-calc :is(.kb-extra__row, .bin-extra__row, .ss-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.4 var(--f-ui); color: var(--ink); }
.rd #simple-calc :is(.kb-extra__row, .bin-extra__row, .ss-row):first-child { border-top: 0; padding-top: 0; }
.rd #simple-calc :is(.kb-extra__row, .bin-extra__row, .ss-row) span { color: var(--mute); white-space: nowrap; }
.rd #simple-calc :is(.kb-extra__row, .bin-extra__row, .ss-row) b { font-weight: 600; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.rd #simple-calc :is(.ld-step, .mk-step) { display: block; padding: 3px 0; }
.rd #simple-calc :is(.ld-extra, .mk-extra) { color: var(--mute); }
.rd #simple-calc :is(.ld-mut, .mk-mut, .bin-note) { color: var(--mute); }
.rd #simple-calc .bin-steps { margin: 8px 0 0 18px; padding: 0; }
.rd #simple-calc .bin-steps li { margin: 0 0 4px; }
.rd #simple-calc :is(.kb-lead, .bin-lead) { margin: 0; font: 400 13px/1.5 var(--f-ui); color: var(--mute); }

/* ===== таблицы в калькуляторе ===== */
.rd #simple-calc :is(.ld-scroll, .bin-table-wrap, .kb-batch__out, .kp-all-wrap) { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rd #simple-calc :is(.ld-all, .kp-all, .kb-table, .bin-tbl) { width: 100%; margin: 0; border-collapse: collapse; background: none; font: 400 14px/1.4 var(--f-ui); color: var(--ink); }
.rd #simple-calc :is(.ld-all, .kp-all, .kb-table, .bin-tbl) :is(th, td) { padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; vertical-align: top; }
.rd #simple-calc :is(.ld-all, .kp-all) :is(th, td) { padding-left: 0; }
.rd #simple-calc :is(.ld-all, .kp-all) :is(th, td):last-child { padding-right: 0; }
.rd #simple-calc :is(.ld-all, .kp-all, .kb-table, .bin-tbl) th { font: 400 11px/1.3 var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--mute); }
.rd #simple-calc :is(.ld-all, .kp-all, .kb-table, .bin-tbl) tr:last-child td { border-bottom: 0; }
.rd #simple-calc :is(td.ld-val, .kp-all td:last-child) { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd #simple-calc tr.ld-grp td { padding-top: 16px; font: 400 11px/1.3 var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--mute); }
.rd #simple-calc tr.ld-grp:first-child td { padding-top: 0; }
.rd #simple-calc tr.ld-act td { background: var(--accent-soft); }
.rd #simple-calc tr.ld-act td:first-child { padding-left: 10px; border-radius: 10px 0 0 10px; }
.rd #simple-calc tr.ld-act td:last-child { padding-right: 10px; border-radius: 0 10px 10px 0; }
.rd #simple-calc .kp-grp { margin: 16px 0 6px; font: 400 11px/1.3 var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--mute); }
.rd #simple-calc .kp-grp:first-child { margin-top: 0; }
.rd #simple-calc .bin-tbl { font-size: 13px; }
.rd #simple-calc .bin-tbl td:last-child { font-family: var(--f-mono); }
.rd #simple-calc .bin-table-wrap:not(:empty) { margin-top: 16px; }

/* ===== площадь: крупный ответ и таблица единиц ===== */
.rd #simple-calc #kp-main { margin: 0; font: 400 14px/1.4 var(--f-ui); color: var(--ink); overflow-wrap: anywhere; }
.rd #simple-calc #kp-main .kp-eq { display: block; margin: 0 0 6px; color: var(--mute); }
.rd #simple-calc #kp-main .kp-res { font: 600 32px/1.2 var(--f-ui); }
.rd #simple-calc #kp-toggle { margin: 16px 0 0; }
.rd #simple-calc .kp-all-wrap { margin: 16px 0 0; }

/* ===== вкладки ===== */
.rd #simple-calc :is(.input-tabs, .rc-tabs) { display: inline-flex; align-self: flex-start; flex-wrap: wrap; gap: 0; margin: 0; padding: 4px; border: 0; border-radius: 999px; background: var(--tile); }
.rd #simple-calc :is(.input-tabs .tab-button, .rc-tab) { flex: none; width: auto; height: auto; margin: 0; padding: 10px 18px; border: 0; border-radius: 999px; background: none; font: 500 14px/1.2 var(--f-ui); color: var(--mute); cursor: pointer; }
.rd #simple-calc :is(.input-tabs .tab-button, .rc-tab):hover { color: var(--ink); }
.rd #simple-calc :is(.input-tabs .tab-button.active, .rc-tab[aria-selected="true"]) { background: var(--ink); color: #fff; }
.rd #simple-calc :is(.input-tabs .tab-button, .rc-tab):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd #simple-calc .kb-std { display: flex; flex-direction: column; align-items: flex-start; }
.rd #simple-calc #perevod-v-dvoichnyj-kod, .rd #simple-calc section.calculator:has(#pane-text) > .input-tabs { margin: 0 0 20px; }

/* ===== двоичный код: поля текста, панели режимов ===== */
.rd #simple-calc :is(#pane-text, #pane-num) > * + * { margin-top: 18px; }
.rd #simple-calc :is(#pane-text, #pane-num) > :is(.calc-error, .bin-copy-note):empty { margin-top: 0; }
.rd #simple-calc #pane-text > .bin-chips { margin-top: 18px; }
.rd #simple-calc #pane-text > .bin-copy-note { margin-top: 8px; }
.rd #simple-calc #pane-num > .form-group[style] { margin-top: 18px !important; }
.rd #simple-calc #pane-num > p { margin: 18px 0 0; font: 400 15px/1.4 var(--f-ui); color: var(--mute); }
.rd #simple-calc #num-bin-out { font: 600 17px/1.4 var(--f-mono); color: var(--ink); overflow-wrap: anywhere; }
.rd #simple-calc #num-result .bin-copy-note { margin: 8px 0 0; }
.rd #simple-calc :is(.bin-fields, .bin-params) { display: flex; flex-wrap: wrap; gap: 16px; }
.rd #simple-calc .bin-fields > .form-group { flex: 1 1 260px; min-width: 0; }
.rd #simple-calc .bin-params > * { flex: 1 1 200px; min-width: 0; }
.rd #simple-calc :is(.kb-batch textarea, textarea.bin-area) { display: block; box-sizing: border-box; width: 100%; min-height: 130px; margin: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--tile); font: 400 15px/1.5 var(--f-ui); color: var(--ink); resize: vertical; }
.rd #simple-calc .kb-batch textarea { min-height: 96px; }
.rd #simple-calc :is(.kb-batch textarea, textarea.bin-area):focus { border-color: var(--accent); outline: none; }
.rd #simple-calc #bin-code { font: 400 13px/1.6 var(--f-mono); }

/* ===== килобайты: пакетный перевод ===== */
.rd #simple-calc .kb-batch { margin: 16px 0 0; }
.rd #simple-calc #batch-block { margin: 12px 0 0; }
.rd #simple-calc #batch-block > * + * { margin-top: 12px; }
.rd #simple-calc .kb-batch .kb-actions { margin-top: 12px; }
.rd #simple-calc .kb-batch__out:not(:empty) { font: 400 14px/1.5 var(--f-ui); }

/* ===== римские цифры ===== */
.rd #simple-calc section.calculator:has(.rc-tabs) > .rc-tabs { margin: 0 0 20px; }
.rd #simple-calc [id^="rc-panel-"] { display: flex; flex-direction: column; gap: 18px; }
.rd #simple-calc .rc-kb + .rc-kb { margin-top: -12px; }
.rd #simple-calc .rc-kb { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin: 0; }
.rd #simple-calc .rc-key { display: inline-flex; align-items: center; justify-content: center; width: auto; height: 40px; margin: 0; padding: 0 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: 500 14px/1 var(--f-ui); color: var(--ink); cursor: pointer; }
.rd #simple-calc .rc-key:hover { border-color: var(--accent-mid); background: #fff; }
.rd #simple-calc .rc-key:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd #simple-calc .rc-key--fn { background: var(--pill); border-color: var(--pill); color: var(--mute); }
.rd #simple-calc .rc-kb--over .rc-key { height: 36px; font-size: 13px; }
.rd #simple-calc .rc-ov { text-decoration: overline; text-decoration-thickness: 1.5px; }
.rd #simple-calc .rc-kb-note { margin: -6px 0 0; font: 400 13px/1.5 var(--f-ui); color: var(--mute); }
.rd #simple-calc .rc-res-steps .pr-step:last-child { margin-bottom: 0; }
.rd #simple-calc .rc-res-steps small { display: block; font: 400 12px/1.4 var(--f-ui); color: var(--mute); }
.rd #simple-calc .rc-segs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.rd #simple-calc .rc-seg { display: inline-flex; align-items: center; justify-content: center; height: 38px; margin: 0; padding: 0 16px; border: 0; border-radius: 999px; background: var(--pill); font: 500 13px/1 var(--f-ui); color: var(--ink); cursor: pointer; }
.rd #simple-calc .rc-seg:hover { background: var(--accent-soft); }
.rd #simple-calc .rc-seg[aria-pressed="true"] { background: var(--ink); color: #fff; }
.rd #simple-calc .rc-seg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd #simple-calc .rc-segs--ops .rc-seg { min-width: 48px; font-size: 16px; }
.rd #simple-calc .rc-check { display: flex; align-items: center; gap: 8px; margin: 0; font: 400 15px/1.4 var(--f-ui); color: var(--ink); cursor: pointer; }
.rd #simple-calc .rc-check input { appearance: auto; -webkit-appearance: auto; flex: none; width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--ink); }
.rd #simple-calc .rc-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rd #simple-calc .rc-pair > * { min-width: 0; margin: 0; }
.rd #simple-calc .rc-fix { display: inline-flex; align-items: center; height: 30px; margin: 6px 0 0; padding: 0 12px; border: 1px solid var(--bad); border-radius: 999px; background: #fff; font: 500 13px/1 var(--f-ui); color: var(--bad); cursor: pointer; }
.rd #simple-calc .rc-fix:hover { background: var(--bad-soft); }

/* ===== килограммы в граммы: два поля и кнопка обмена ===== */
.rd #simple-calc .form-group__wrapper:has(.new-swap) { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 12px; }
.rd #simple-calc .form-group__wrapper:has(.new-swap) > .form-group { min-width: 0; margin: 0; }
.rd #simple-calc :is(#inpt1, #inpt2) { display: block; box-sizing: border-box; width: 100%; height: 48px; margin: 0; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--tile); font: 500 16px/1 var(--f-ui); color: var(--ink); appearance: none; -moz-appearance: textfield; }
.rd #simple-calc :is(#inpt1, #inpt2)::-webkit-inner-spin-button, .rd #simple-calc :is(#inpt1, #inpt2)::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.rd #simple-calc #inpt1:focus { border-color: var(--accent); outline: none; }
.rd #simple-calc #inpt2 { font-weight: 600; }
.rd #simple-calc .new-swap { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: var(--pill); cursor: pointer; }
.rd #simple-calc .new-swap:hover { background: var(--accent-soft); }
.rd #simple-calc .new-swap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd #simple-calc .new-swap svg { display: block; width: 16px; height: 16px; }
.rd #simple-calc .new-swap svg path[fill="black"] { fill: var(--ink); }
.rd #simple-calc #but { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; height: 46px; margin: 0; padding: 0 28px; border: 0; border-radius: 999px; background: var(--ink); font: 500 14px/1 var(--f-ui); color: #fff; cursor: pointer; }
.rd #simple-calc #but:hover { opacity: .85; }
.rd #simple-calc #but:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== HTML-редактор ===== */
.rd #simple-calc #he-app { --he-font: 14px; margin: 0; font-family: var(--f-ui); color: var(--ink); }
.rd #simple-calc #he-app :is(input, select, textarea, button) { box-sizing: border-box; font-family: inherit; }
.rd #simple-calc #he-app input[type="checkbox"] { appearance: auto; -webkit-appearance: auto; flex: none; width: 16px; height: 16px; min-height: 0; margin: 0; border: 0; border-radius: 0; accent-color: var(--ink); vertical-align: -3px; }
.rd #simple-calc #he-app input[type="color"] { min-height: 0; }
.rd #simple-calc #he-app input[type="text"] { min-height: 0; height: auto; }

.rd #simple-calc .he-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.rd #simple-calc .he-tabs { display: inline-flex; gap: 0; padding: 4px; border: 0; border-radius: 999px; background: var(--tile); overflow: visible; }
.rd #simple-calc .he-tab { appearance: none; margin: 0; padding: 9px 16px; border: 0; border-radius: 999px; background: none; font: 500 14px/1.2 var(--f-ui); color: var(--mute); cursor: pointer; }
.rd #simple-calc .he-tab + .he-tab { border-left: 0; }
.rd #simple-calc .he-tab:hover { color: var(--ink); }
.rd #simple-calc .he-tab.is-active { background: var(--ink); color: #fff; }
.rd #simple-calc .he-top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }

.rd #simple-calc .he-btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; height: auto; margin: 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: 500 13px/1.2 var(--f-ui); color: var(--ink); white-space: nowrap; cursor: pointer; }
.rd #simple-calc .he-btn:hover { border-color: var(--accent-mid); }
.rd #simple-calc .he-btn:focus-visible, .rd #simple-calc .he-tab:focus-visible, .rd #simple-calc .he-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd #simple-calc .he-btn--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.rd #simple-calc .he-btn--primary:hover { border-color: var(--ink); opacity: .85; }

.rd #simple-calc .he-menu { position: relative; }
.rd #simple-calc .he-menu-list { display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 250px; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 12px 32px rgba(13, 13, 13, .12); }
.rd #simple-calc .he-menu-list.is-open { display: block; }
.rd #simple-calc .he-menu-list button { display: block; width: 100%; height: auto; margin: 0; padding: 10px 12px; border: 0; border-radius: 10px; background: none; font: 400 14px/1.3 var(--f-ui); color: var(--ink); text-align: left; cursor: pointer; }
.rd #simple-calc .he-menu-list button:hover { background: var(--accent-soft); }
.rd #simple-calc .he-menu-sep { height: 1px; margin: 6px 4px; background: var(--line); }
.rd #simple-calc .he-menu-cap { padding: 8px 12px 4px; font: 400 11px/1.3 var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--mute); }

.rd #simple-calc .he-find { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--tile); }
.rd #simple-calc .he-find[hidden] { display: none !important; }
.rd #simple-calc #he-app .he-find input[type="text"] { flex: 1 1 160px; min-width: 160px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: 400 13px/1 var(--f-mono); color: var(--ink); }
.rd #simple-calc #he-app .he-find input[type="text"]:focus { border-color: var(--accent); outline: none; }
.rd #simple-calc .he-find label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font: 400 13px/1.3 var(--f-ui); color: var(--ink); cursor: pointer; }
.rd #simple-calc .he-find__opts { display: inline-flex; flex-wrap: wrap; gap: 12px; }

.rd #simple-calc .he-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.rd #simple-calc .he-pane { display: flex; flex-direction: column; min-width: 0; min-height: 460px; }
.rd #simple-calc .he-pane--editor { border-right: 0; border-bottom: 1px solid var(--line); }
.rd #simple-calc .he-pane__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 48px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--tile); }
.rd #simple-calc .he-pane__title { margin: 0 6px 0 4px; font: 400 11px/1.3 var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--mute); }

.rd #simple-calc .he-wysiwyg-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.rd #simple-calc .he-tool { appearance: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: 0; padding: 0; border: 1px solid transparent; border-radius: 10px; background: #fff; font: 400 14px/1 Georgia, "Times New Roman", serif; color: var(--ink); cursor: pointer; }
.rd #simple-calc .he-tool:hover { border-color: var(--line); background: var(--accent-soft); }
.rd #simple-calc .he-tool[data-cmd="bold"] { font-weight: 800; }
.rd #simple-calc .he-tool[data-cmd="italic"] { font-style: italic; }
.rd #simple-calc .he-tool[data-cmd="underline"] { text-decoration: underline; }
.rd #simple-calc .he-tool[data-cmd="strikeThrough"] { text-decoration: line-through; }
/* «↶ ↷» берутся из запасного шрифта тонкими штрихами и выглядят бледнее соседних кнопок — рисуем стрелки маской цвета текста, символ в разметке остаётся */
.rd #simple-calc .he-tool:is([data-cmd="undo"], [data-cmd="redo"]) { font-size: 0; }
.rd #simple-calc .he-tool:is([data-cmd="undo"], [data-cmd="redo"])::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--he-arrow) center / contain no-repeat; mask: var(--he-arrow) center / contain no-repeat; }
.rd #simple-calc .he-tool[data-cmd="undo"] { --he-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14 4 9l5-5'/%3E%3Cpath d='M4 9h10.5a5.5 5.5 0 0 1 0 11H11'/%3E%3C/svg%3E"); }
.rd #simple-calc .he-tool[data-cmd="redo"] { --he-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 14 5-5-5-5'/%3E%3Cpath d='M20 9H9.5a5.5 5.5 0 0 0 0 11H13'/%3E%3C/svg%3E"); }
/* «⤢» той же беды — тонкий символ запасного шрифта */
.rd #simple-calc #he-preview-open { display: inline-flex; align-items: center; justify-content: center; font-size: 0; padding-inline: 9.5px; } /* поля под иконку 16px: ширина 37px, как у кнопки с символом */
.rd #simple-calc #he-preview-open::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6'/%3E%3Cpath d='M20 4l-7 7'/%3E%3Cpath d='M10 20H4v-6'/%3E%3Cpath d='M4 20l7-7'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6'/%3E%3Cpath d='M20 4l-7 7'/%3E%3Cpath d='M10 20H4v-6'/%3E%3Cpath d='M4 20l7-7'/%3E%3C/svg%3E") center / contain no-repeat; }
.rd #simple-calc .he-wysiwyg-toolbar .he-btn.he-tool--text { height: 32px; padding: 0 10px; font-size: 12px; }
.rd #simple-calc .he-sep { width: 1px; height: 22px; margin: 0 3px; background: var(--line); }
.rd #simple-calc #he-formatblock { width: auto; height: 32px; margin: 0; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: 400 12px/1 var(--f-ui); color: var(--ink); }
.rd #simple-calc .he-color { position: relative; display: inline-flex; align-items: center; }
.rd #simple-calc .he-color input[type="color"] { width: 32px; height: 32px; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.rd #simple-calc .he-code-toolbar { display: flex; align-items: center; gap: 4px; }

.rd #simple-calc .he-visual-wrap { display: flex; flex: 1; min-height: 0; }
.rd #simple-calc #he-visual-frame { flex: 1; width: 100%; min-height: 400px; border: 0; background: #fff; }

.rd #simple-calc .he-code { position: relative; display: flex; flex: 1; min-height: 0; background: #fff; font-size: var(--he-font); }
.rd #simple-calc .he-code.is-dark { background: #1e1e2a; }
.rd #simple-calc .he-gutter { flex: 0 0 auto; min-width: 34px; margin: 0; padding: 12px 8px 12px 10px; overflow: hidden; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: var(--tile); font-family: var(--f-mono); font-size: var(--he-font); line-height: 1.5; color: var(--mute); text-align: right; white-space: pre; user-select: none; }
.rd #simple-calc .he-code.is-dark .he-gutter { background: #171722; border-color: #2a2a3a; color: #5a5a72; }
.rd #simple-calc .he-code-scroll { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.rd #simple-calc #he-app :is(#he-highlight, #he-source) { position: absolute; inset: 0; box-sizing: border-box; width: auto; height: auto; min-height: 0; margin: 0; padding: 12px 14px; border: 0; border-radius: 0; font-family: var(--f-mono); font-size: var(--he-font); font-weight: 400; line-height: 1.5; letter-spacing: 0; tab-size: 2; -moz-tab-size: 2; white-space: pre; word-wrap: normal; overflow-wrap: normal; }
.rd #simple-calc #he-highlight { z-index: 1; overflow: hidden; background: none; color: var(--ink); pointer-events: none; }
.rd #simple-calc #he-source { z-index: 2; overflow: auto; resize: none; background: transparent; color: transparent; caret-color: var(--ink); outline: none; box-shadow: none; }
.rd #simple-calc .he-code.is-dark #he-highlight { color: #e6e6e6; }
.rd #simple-calc .he-code.is-dark #he-source { caret-color: #fff; }
.rd #simple-calc #he-source::selection { background: rgba(79, 91, 213, .28); }

.rd #simple-calc .tok-com { color: #9aa0a6; font-style: italic; }
.rd #simple-calc .tok-doctype { color: #9aa0a6; }
.rd #simple-calc .tok-punct { color: #444; }
.rd #simple-calc .tok-name { color: #1a7f37; font-weight: 600; }
.rd #simple-calc .tok-attr { color: #953800; }
.rd #simple-calc .tok-str { color: #0a53be; }
.rd #simple-calc .tok-ent { color: #8250df; }
.rd #simple-calc .he-code.is-dark .tok-punct { color: #c7c7d1; }
.rd #simple-calc .he-code.is-dark .tok-name { color: #7ee787; }
.rd #simple-calc .he-code.is-dark .tok-attr { color: #ffa657; }
.rd #simple-calc .he-code.is-dark .tok-str { color: #a5d6ff; }
.rd #simple-calc .he-code.is-dark .tok-ent { color: #d2a8ff; }
.rd #simple-calc .he-code.is-dark :is(.tok-com, .tok-doctype) { color: #8b949e; }

.rd #simple-calc .he-device { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; padding: 3px; border-radius: 999px; background: var(--pill); }
.rd #simple-calc .he-device button { appearance: none; height: auto; margin: 0; padding: 6px 10px; border: 0; border-radius: 999px; background: none; font: 500 12px/1.2 var(--f-ui); color: var(--mute); cursor: pointer; }
.rd #simple-calc .he-device button:hover { color: var(--ink); }
.rd #simple-calc .he-device button.is-active { background: var(--ink); color: #fff; }
.rd #simple-calc .he-preview-frame { display: flex; flex: 1; justify-content: center; overflow: auto; background: var(--tile); }
.rd #simple-calc #he-preview { width: 100%; height: 100%; min-height: 400px; border: 0; background: #fff; }
.rd #simple-calc .he-preview-frame[data-device="tablet"] #he-preview { width: 768px; max-width: 100%; margin: 12px 0; box-shadow: 0 0 0 1px var(--line); }
.rd #simple-calc .he-preview-frame[data-device="phone"] #he-preview { width: 375px; max-width: 100%; margin: 12px 0; box-shadow: 0 0 0 1px var(--line); }

.rd #simple-calc .he-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 0 0; padding: 10px 12px 10px 16px; border-radius: 16px; background: var(--tile); font: 400 13px/1.3 var(--f-ui); color: var(--mute); }
.rd #simple-calc .he-status b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.rd #simple-calc .he-status .he-copy { margin-left: auto; }

.rd #simple-calc .he-toast { position: fixed; left: 50%; bottom: 26px; z-index: 9999; padding: 12px 18px; border-radius: 14px; background: var(--ink); font: 500 14px/1.3 var(--f-ui); color: #fff; opacity: 0; transform: translateX(-50%) translateY(12px); transition: opacity .2s, transform .2s; pointer-events: none; }
.rd #simple-calc .he-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== таблицы и код в тексте статьи ===== */
html body.rd :is(.kp-table-scroll, .rc-scroll, .he-tablewrap) { margin: 24px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
html body.rd :is(.kp-table-scroll, .rc-scroll, .he-tablewrap) > table { min-width: 100%; margin: 0; }
html body.rd .rd-article__body > :is(.kp-table-scroll, .rc-scroll, .he-tablewrap) { max-width: none; }
html body.rd .rd-article__body .rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; max-width: none; margin: 0 0 24px; padding: 0; list-style: none; }
html body.rd .rd-article__body .rc-grid li { display: flex; justify-content: space-between; gap: 6px; margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--tile); font: 400 14px/1.3 var(--f-ui); }
html body.rd .rd-article__body .rc-grid li::before { content: none; }
html body.rd .rd-article__body .rc-grid li span { color: var(--mute); }
html body.rd .rd-article__body .rc-grid li b { font-weight: 600; }
html body.rd .rd-article__body .rc-grid li.rc-top { background: var(--accent-soft); }
html body.rd .rd-article__body .rc-ov { text-decoration: overline; }
html body.rd .rd-article__body .kb-code { max-width: 100%; margin: 16px 0 24px; padding: 16px 20px; overflow-x: auto; border: 0; border-radius: 14px; background: var(--tile); font: 400 13px/1.6 var(--f-mono); color: var(--ink); }
html body.rd .rd-article__body code { font-family: var(--f-mono); font-size: .9em; }
html body.rd .rd-article__body .kb-code code { display: block; padding: 0; background: none; font: inherit; white-space: pre; }
html body.rd .rd-article__body :is(.kb-lead, .bin-lead) { font: 400 14px/1.5 var(--f-ui); color: var(--mute); }

/* ===== адаптив ===== */
@media (max-width: 900px) {
    .rd #simple-calc .he-pane { min-height: 340px; }
    .rd #simple-calc .he-top-actions { width: 100%; margin-left: 0; }
}
@media (max-width: 639px) {
    .rd #simple-calc :is(.ld-2col, .mk-2col, .rc-pair) { grid-template-columns: minmax(0, 1fr); }
    .rd #simple-calc #kp-main .kp-res { font-size: 26px; }
    .rd #simple-calc :is(.kb-extra__row, .bin-extra__row, .ss-row) { font-size: 13px; }
    .rd #simple-calc :is(.ld-all, .kp-all, .kb-table) { font-size: 13px; }
    .rd #simple-calc :is(.kb-table, .bin-tbl) :is(th, td) { padding: 8px 6px; }
    .rd #simple-calc .rc-kb { gap: 4px; }
    .rd #simple-calc .rc-key { height: 44px; border-radius: 10px; }
    .rd #simple-calc .rc-kb--over .rc-key { height: 40px; }
    .rd #simple-calc .rc-tab { padding: 10px 12px; font-size: 13px; }
    .rd #simple-calc .form-group__wrapper:has(.new-swap) { gap: 8px; }
    .rd #simple-calc .new-swap { width: 44px; height: 44px; }

    .rd #simple-calc .he-topbar { gap: 6px; }
    .rd #simple-calc .he-tabs { flex: 1 1 100%; }
    .rd #simple-calc .he-tab { flex: 1; padding: 9px 8px; }
    .rd #simple-calc .he-btn { padding: 8px 12px; font-size: 13px; }
    .rd #simple-calc .he-pane__head { gap: 4px; }
    /* «Предпросмотр», переключатель ширины и кнопка не входят в одну строку и разваливались на три — заголовок отдельной строкой, остальное второй */
    .rd #simple-calc .he-pane--preview .he-pane__title { flex: 1 1 100%; }
    .rd #simple-calc .he-pane--preview .he-device { flex: 1 1 auto; margin-left: 0; }
    .rd #simple-calc .he-pane--preview .he-device button { flex: 1 1 auto; }
    .rd #simple-calc .he-pane { min-height: 300px; }
    .rd #simple-calc :is(#he-visual-frame, #he-preview, .he-code) { min-height: 280px; }
    .rd #simple-calc .he-menu-list { left: 0; right: auto; width: max-content; min-width: 0; max-width: calc(100vw - 56px); }
    .rd #simple-calc .he-menu-list button { white-space: normal; }
    .rd #simple-calc :is(.he-tool, .he-color input[type="color"]) { width: 44px; height: 44px; }
    .rd #simple-calc .he-tool { font-size: 15px; }
    .rd #simple-calc :is(#he-formatblock, .he-wysiwyg-toolbar .he-btn.he-tool--text) { height: 44px; }
    .rd #simple-calc .he-sep { height: 30px; }
    .rd #simple-calc :is(.he-btn, .he-tab, .he-device button) { min-height: 44px; }
    .rd #simple-calc :is(.he-device button, #he-preview-open) { min-width: 44px; }
    .rd #simple-calc .he-status .he-copy { flex: 1 1 100%; margin-left: 0; }
}
@media (max-width: 379px) {
    /* на 320px переключателю с кнопкой «⤢» не хватало 12px — сужаем поля кнопок переключателя */
    .rd #simple-calc .he-pane--preview .he-device button { padding-inline: 6px; }
    .rd #simple-calc :is(.input-tabs, .rc-tabs) { display: flex; align-self: stretch; flex-wrap: nowrap; }
    .rd #simple-calc :is(.input-tabs .tab-button, .rc-tab) { flex: 1 1 auto; padding: 10px 8px; font-size: 13px; white-space: nowrap; }
}
@media (max-width: 359px) {
    .rd #simple-calc .rc-kb { gap: 3px; }
    .rd #simple-calc .rc-key { padding: 0 2px; font-size: 13px; }
    .rd #simple-calc .rc-tab { padding: 10px 9px; }
    .rd #simple-calc #he-app .he-find input[type="text"] { min-width: 0; }
    .rd #simple-calc :is(td.ld-val, .kp-all td:last-child) { white-space: normal; }
    .rd #simple-calc :is(.ld-all, .kp-all, .kb-table) { font-size: 12px; }
    .rd #simple-calc .formula-wrapper:has(> .ld-scroll) { padding-left: 12px; padding-right: 12px; }
}
