/* Сумма прописью на макете редизайна. Разметка, id и подписи прежние, скрипты
   public/js/finansovie/summa-propisyu.js, money-format.js и custom-select.js не менялись.
   Файл грузится раньше rd.css, поэтому селекторы начинаются с .rd #simple-calc.
   Скрипт переключает вкладки классом active и инлайновым display, тост показывает классом is-visible.
   redesign.css сбрасывает всем input оформление, а p делает inline-block с прозрачностью .7 —
   поля и строки результата нарисованы здесь заново. */

.rd #simple-calc .calculator { position: relative; display: flex; flex-direction: column; gap: 24px; margin: 0; }

/* вкладки */
.rd #simple-calc .tabs { display: inline-flex; align-self: flex-start; max-width: 100%; box-sizing: border-box; gap: 0; margin: 0; padding: 3px; border-radius: 999px; background: var(--pill); }
.rd #simple-calc .tab-button { display: inline-flex; align-items: center; justify-content: center; height: 38px; margin: 0; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; font: 400 13px/1.2 var(--f-ui); color: var(--mute); white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.rd #simple-calc .tab-button:hover { background: rgba(247, 248, 249, .55); color: var(--ink); }
.rd #simple-calc .tab-button.active { background: var(--tile); font-weight: 500; color: var(--ink); }
.rd #simple-calc .tab-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.rd #simple-calc .tab-content { display: none; margin: 0; }
.rd #simple-calc .tab-content.active { display: flex !important; flex-direction: column; gap: 20px; }

/* сумма и валюта в один ряд */
.rd #simple-calc .form-group__wrapper { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: end; margin: 0; }
.rd #simple-calc .form-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; }
.rd #simple-calc .form-group > label,
.rd #simple-calc .label-text { display: block; position: static; margin: 0; padding: 0; transform: none; font: 400 11px/1.3 var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--mute); opacity: 1; }
.rd #simple-calc .calculator__input { display: block; -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 100%; height: 48px; margin: 0; padding: 0 16px; background: 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); }
.rd #simple-calc .calculator__input:focus { border-color: var(--accent); }

/* выбор валюты */
.rd #simple-calc .custom-select { position: relative; width: auto; height: auto; min-height: 0; margin: 0; padding: 0; border: 0; background: none; }
.rd #simple-calc .custom-select__selected { box-sizing: border-box; position: relative; display: flex; align-items: center; height: 48px; min-height: 0; margin: 0; padding: 0 44px 0 16px; background: var(--tile); border: 1px solid var(--line); border-radius: 14px; font: 500 15px/1.35 var(--f-ui); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.rd #simple-calc .custom-select__selected:hover { border-color: var(--accent-mid); }
.rd #simple-calc .custom-select.open .custom-select__selected { border-color: var(--accent); }
.rd #simple-calc .custom-select__selected::after { content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border: solid var(--ink); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); background: none; transition: transform .15s; }
.rd #simple-calc .custom-select.open .custom-select__selected::after { margin-top: -2px; transform: rotate(-135deg); }
.rd #simple-calc .custom-select__options { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; max-height: 360px; overflow-y: auto; box-sizing: border-box; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 32px rgba(13, 13, 13, .12); }
.rd #simple-calc .custom-select.open .custom-select__options { display: block; }
.rd #simple-calc .custom-select__option { padding: 10px 12px; border-radius: 10px; font: 400 14px/1.35 var(--f-ui); color: var(--ink); cursor: pointer; background: none; }
.rd #simple-calc .custom-select__option:hover,
.rd #simple-calc .custom-select__option.selected { background: var(--accent-soft); }

/* род числа — чипы */
.rd #simple-calc .propis-gender { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.rd #simple-calc .propis-gender__options { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.rd #simple-calc .propis-chip { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.rd #simple-calc .propis-chip input { position: absolute; width: 0; height: 0; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.rd #simple-calc .propis-chip__box { 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.2 var(--f-ui); color: var(--ink); white-space: nowrap; transition: background .15s, color .15s; }
.rd #simple-calc .propis-chip__box::before { display: none; }
.rd #simple-calc .propis-chip:hover .propis-chip__box { background: var(--accent-soft); }
.rd #simple-calc .propis-chip input:checked + .propis-chip__box { background: var(--ink); color: #fff; }
.rd #simple-calc .propis-chip input:focus-visible + .propis-chip__box { outline: 2px solid var(--accent); outline-offset: 2px; }

/* результат: первая строка крупно, остальные форматы под ней через линию */
.rd #simple-calc .calculator__result { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 28px; border: 0; border-radius: 20px; background: var(--tile); }
.rd #simple-calc .calculator__result > .label-text { margin: 0 0 14px; }
.rd #simple-calc .propis-row { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 16px 0; border: 0; border-top: 1px solid var(--line); }
.rd #simple-calc .label-text + .propis-row { padding-top: 0; border-top: 0; }
.rd #simple-calc .propis-row:last-child { padding-bottom: 0; }
.rd #simple-calc .propis-row__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; }
.rd #simple-calc .propis-row__cap { font: 400 13px/1.35 var(--f-ui); color: var(--mute); opacity: 1; }
.rd #simple-calc .propis-out { display: block; margin: 0; padding: 0; font: 500 16px/1.5 var(--f-ui); color: var(--ink); opacity: 1; overflow-wrap: anywhere; }
.rd #simple-calc .label-text + .propis-row .propis-out { font: 600 24px/1.3 var(--f-ui); letter-spacing: -.3px; }
.rd #simple-calc .propis-copy { display: inline-flex; align-items: center; justify-content: center; flex: none; width: auto; height: auto; margin: 0; padding: 8px 14px; border: 0; border-radius: 999px; background: var(--pill); font: 500 12px/1.3 var(--f-ui); color: var(--ink); white-space: nowrap; cursor: pointer; transition: background .15s; }
.rd #simple-calc .propis-copy:hover { background: var(--line); }
.rd #simple-calc .propis-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* тост «Скопировано» */
.rd #simple-calc .propis-toast { position: fixed; left: 50%; bottom: 32px; z-index: 1000; margin: 0; padding: 10px 18px; border-radius: 999px; background: var(--ink); font: 500 13px/1.3 var(--f-ui); color: #fff; opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(20px); transition: opacity .25s, transform .25s; }
.rd #simple-calc .propis-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 639px) {
    .rd #simple-calc .calculator { gap: 20px; }
    .rd #simple-calc .tabs { display: flex; align-self: stretch; }
    .rd #simple-calc .tab-button { flex: 1 1 0; min-width: 0; padding: 0 8px; }
    .rd #simple-calc .tab-content.active { gap: 16px; }
    .rd #simple-calc .form-group__wrapper { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .rd #simple-calc .calculator__result { padding: 18px 16px; }
    .rd #simple-calc .propis-row { padding: 14px 0; }
    .rd #simple-calc .propis-out { font-size: 15px; }
    .rd #simple-calc .label-text + .propis-row .propis-out { font-size: 20px; letter-spacing: 0; }
}

/* источники и дисклеймер в боковой колонке статьи */
.rd .rda-src h2.rd-label { margin: 0; padding: 0; border: 0; font: 400 11px/1.4 var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--mute); scroll-margin-top: 16px; }
.rd .rda-src__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rd .rda-src__list li { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rd .rda-src__list li:first-child { padding-top: 0; }
.rd .rda-src__list li:last-child { padding-bottom: 0; border-bottom: 0; }
.rd .rda-src__list li::before { display: none; }
.rd .rda-src__list b { font: 600 14px/1.35 var(--f-ui); color: var(--ink); }
.rd .rda-src__list span { font: 400 13px/1.45 var(--f-ui); color: var(--mute); }
.rd .rda-src__list a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent-mid); text-underline-offset: 2px; }
.rd .rd-article__aside .ymyl-disclaimer { margin: 0; padding: 24px; border-radius: 22px; }
.rd .rd-article__aside .ymyl-disclaimer strong { display: block; margin-bottom: 10px; font: 400 11px/1.4 var(--f-mono); letter-spacing: 1px; text-transform: uppercase; color: var(--ink); }
@media (max-width: 639px) {
    .rd .rd-article__aside .ymyl-disclaimer { padding: 20px; border-radius: 20px; }
}
