/* ============================================
   БАЛАНС — виджет в шапке, модалка пополнения, покупка подписки, история
   ============================================

   Палитра и радиусы — те же, что у соседей по шапке (см. css/header.css): #1A1A1A на
   подложке, #2A2A2A на рамке, #00E599 акцентом. Никакого backdrop-filter: живое размытие
   заметно тормозит на машине владельца (проверено), поэтому «стекло» здесь плоское.

   Все суммы набираются табличными цифрами: в истории и в списке цен числа стоят столбиком,
   и без tabular-nums разряды не совпадают между строками. */

/* ===== ВИДЖЕТ В ШАПКЕ ===== */
.balance-widget {
    position: relative;
    display: none; /* показывается из balance.js только авторизованным */
    align-items: center;
}
.balance-widget.is-ready { display: flex; }

.balance-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none; /* стал ссылкой на историю операций — подчёркивание тут ни к чему */
    background: rgba(var(--ms-fg-rgb), 0.04);
    border: 1px solid var(--ms-line-solid);
    border-radius: 12px;
    padding: 5px 8px 5px 12px;
    cursor: pointer;
    font-family: inherit;
    color: var(--ms-t1);
    transition: border-color 0.2s ease, background 0.2s ease;
}
.balance-trigger:hover {
    border-color: rgba(var(--ms-acc-rgb), 0.4);
    background: rgba(var(--ms-acc-rgb), 0.06);
}
.balance-trigger:focus-visible {
    outline: 2px solid var(--ms-acc);
    outline-offset: 2px;
}
.balance-amounts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}
.balance-primary {
    font-size: 0.88rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.balance-secondary {
    font-size: 0.68rem;
    color: var(--ms-t3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.balance-caret {
    color: var(--ms-t3);
    font-size: 0.6rem;
    transition: transform 0.2s ease;
}
.balance-widget.open .balance-caret { transform: rotate(180deg); }

.balance-topup-btn {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: none;
    background: var(--ms-acc);
    color: var(--ms-ink);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.balance-topup-btn:hover {
    box-shadow: 0 0 16px rgba(var(--ms-acc-rgb), 0.45);
    transform: scale(1.06);
}
.balance-topup-btn:focus-visible {
    outline: 2px solid var(--ms-acc);
    outline-offset: 2px;
}

/* ----- выпадающее меню ----- */
.balance-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 244px;
    background: var(--ms-s2);
    border: 1px solid var(--ms-line-solid);
    border-radius: 14px;
    padding: 14px 14px 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8), 0 0 40px rgba(var(--ms-acc-rgb), 0.05);
    z-index: 120;
    display: none;
    flex-direction: column;
}
.balance-widget.open .balance-dropdown { display: flex; }

.balance-dropdown-amount {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.balance-dropdown-eq {
    font-size: 0.74rem;
    color: var(--ms-t3);
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
    margin-bottom: 12px;
}
.balance-menu-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--ms-t1);
    font-family: inherit;
    font-size: 0.83rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.balance-menu-row:hover { background: rgba(var(--ms-fg-rgb), 0.05); }
.balance-menu-row.accent { color: var(--ms-acc-text); }
.balance-menu-row.accent:hover { background: rgba(var(--ms-acc-rgb), 0.1); }
.balance-menu-row .ico { width: 16px; text-align: center; flex-shrink: 0; }
.balance-menu-row .tail { margin-left: auto; color: var(--ms-t3); font-size: 0.75rem; }

/* =====================================================================================================
   ОКНО ПОПОЛНЕНИЯ (frontend/balance.js), вариант P по примерам владельца (22.11, страница 8BrSDgF6UR4drfbyhM1JyR):
   слева способы карточками (живой — карта, остальные «Скоро»), справа «Сумма зачисления», быстрые суммы и панель итога:
   «Комиссия 5%» красным, «К оплате» с комиссией сверху, кнопка «Оплатить». Тексты белые, вторые строки мягче; акцент только
   на выбранном способе, выбранной сумме и кнопке. Шрифты окна — Unbounded (заголовок, суммы, кнопка) и Manrope (остальное),
   свои файлы в /fonts (OFL), начертания 400–600 (700–800 владелец не любит). Только внутри окна: сайт остаётся на Inter.
   Крючки вкладки «Баланс» (balance-tab.js quickTopup): #balanceModal.open, #topupCur, .balance-chip[data-amount].
   ===================================================================================================== */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/manrope-cyrillic-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/manrope-cyrillic-wght-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/manrope-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/manrope-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/unbounded-cyrillic-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/unbounded-cyrillic-wght-normal.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/unbounded-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/unbounded-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

.tp-ov {
    --tp-font: 'Manrope', var(--ms-font);
    --tp-display: 'Unbounded', 'Manrope', var(--ms-font);
    --tp-t1: #FFFFFF;
    --tp-t2: rgba(255, 255, 255, 0.64);
    --tp-t3: rgba(255, 255, 255, 0.5);
    --tp-card: rgba(255, 255, 255, 0.04);
    --tp-card-hover: rgba(255, 255, 255, 0.065);
    --tp-edge: rgba(255, 255, 255, 0.075);
    --tp-edge2: rgba(255, 255, 255, 0.14);
    --tp-acc-edge: rgba(var(--ms-acc-rgb), 0.55);
    position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 24px;
    background: var(--ms-overlay); opacity: 0; visibility: hidden;
    transition: opacity var(--ms-dur-3, 220ms) var(--ms-ease, ease), visibility 0s linear var(--ms-dur-3, 220ms);
}
.tp-ov.open { opacity: 1; visibility: visible; transition-delay: 0s; }
.tp {
    position: relative; width: min(880px, 100%); max-height: calc(100dvh - 48px); display: grid; grid-template-rows: auto minmax(0, 1fr);
    background: linear-gradient(180deg, #151817 0%, #111312 42%); border: 1px solid var(--tp-edge); border-radius: 22px; overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 64px rgba(0, 0, 0, 0.6), 0 2px 10px rgba(0, 0, 0, 0.35);
    color: var(--tp-t1); font-family: var(--tp-font); text-align: left;
    transform: translateY(10px) scale(0.985); opacity: 0;
    transition: transform var(--ms-dur-3, 220ms) var(--ms-ease, ease), opacity var(--ms-dur-3, 220ms) var(--ms-ease, ease);
}
.tp-ov.open .tp { transform: none; opacity: 1; }

/* шапка: знак сайта и заголовок */
.tp-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 18px 22px; border-bottom: 1px solid var(--tp-edge); }
.tp-brand { width: 30px; height: 30px; flex: none; object-fit: contain; }
.tp-head h2 { flex: 1; margin: 0; font: 600 20px/1.2 var(--tp-display); letter-spacing: -0.01em; color: var(--tp-t1); }
.tp-x { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--tp-card); color: var(--tp-t1); cursor: pointer;
    transition: background var(--ms-dur-2, 160ms) var(--ms-ease, ease); }
.tp-x:hover { background: var(--tp-card-hover); }
.tp-x svg { width: 16px; height: 16px; }

.tp-body { display: grid; grid-template-columns: 316px minmax(0, 1fr); min-height: 0; overflow-y: auto; }
.tp-label { display: block; margin: 0 0 12px; font: 600 14px/1.3 var(--tp-font); color: var(--tp-t1); }

/* способы: карточки */
.tp-side { padding: 20px 18px 22px 22px; background: rgba(0, 0, 0, 0.16); border-right: 1px solid var(--tp-edge); min-width: 0; }
.tp-methods { position: relative; display: grid; gap: 6px; }
.tp-hl { position: absolute; left: 0; top: 0; z-index: 0; border: 1px solid var(--tp-acc-edge); border-radius: 14px; pointer-events: none; opacity: 0;
    background: linear-gradient(90deg, rgba(var(--ms-acc-rgb), 0.12), rgba(var(--ms-acc-rgb), 0.035));
    transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1), width 320ms cubic-bezier(0.2, 0.8, 0.2, 1), height 320ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 160ms ease; }
.tp-hl.is-instant { transition: none; }
.tp-m {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) 20px; align-items: center; gap: 12px; width: 100%; height: 54px; padding: 0 14px 0 8px;
    border: 1px solid var(--tp-edge); border-radius: 14px; background: var(--tp-card); color: inherit; text-align: left; cursor: pointer; font: inherit;
    transition: background var(--ms-dur-2, 160ms) var(--ms-ease, ease), border-color var(--ms-dur-2, 160ms) var(--ms-ease, ease);
}
.tp-m:hover { background: var(--tp-card-hover); }
.tp-m { position: relative; z-index: 1; }
.tp-m.is-on { border-color: transparent; background: transparent; }
.tp-m:disabled { cursor: default; }
.tp-m:focus-visible, .tp-chip:focus-visible, .tp-pay:focus-visible, .tp-x:focus-visible { outline: none; box-shadow: var(--ms-focus); }
.tp-m__logo { display: grid; place-items: center; width: 44px; height: 32px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.tp-m__logo.is-light { background: #FFFFFF; }
.tp-m__txt { display: grid; gap: 2px; min-width: 0; }
.tp-m__txt b { font: 600 14px/1.25 var(--tp-font); color: var(--tp-t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-m__txt i { font: 500 12px/1.25 var(--tp-font); font-style: normal; color: var(--tp-t2); white-space: nowrap; }
.tp-m__short { display: none; }
.tp-m__mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--tp-edge2); color: var(--ms-ink);
    transition: background var(--ms-dur-2, 160ms) var(--ms-ease, ease), border-color var(--ms-dur-2, 160ms) var(--ms-ease, ease); }
.tp-m__mark svg { width: 12px; height: 12px; opacity: 0; transform: scale(0.6); transition: opacity var(--ms-dur-2, 160ms) var(--ms-ease, ease), transform var(--ms-dur-2, 160ms) var(--ms-ease, ease); }
.tp-m.is-on .tp-m__mark { background: var(--ms-acc); border-color: var(--ms-acc); }
.tp-m.is-on .tp-m__mark svg { opacity: 1; transform: none; }
.tp-m.is-on .tp-m__mark { animation: tp-pop 300ms cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes tp-pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.tp-m:active { transform: scale(0.985); }

/* логотипы в плашке 44×32 (images/pay: theSVG MIT, Simple Icons CC0 — images/pay/LICENSES.txt) */
.tp-logo { display: inline-flex; align-items: center; justify-content: center; height: 18px; max-width: 38px; }
.tp-logo img, .tp-logo svg { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.tp-logo.is-plate { height: 21px; }
.tp-logo.is-invert img { filter: invert(1); }
.tp-pair { display: flex; align-items: center; gap: 3px; }
.tp-pair .tp-logo { height: 15px; max-width: 22px; }
.tp-pair .tp-logo.is-plate { height: 13px; }
.tp-stack { display: flex; align-items: center; }
.tp-stack .tp-logo { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 1.5px #1c201e; background: #1c201e; }
.tp-stack .tp-logo + .tp-logo { margin-left: -5px; }
.tp-ico { display: grid; place-items: center; color: var(--tp-t1); }
.tp-ico svg { width: 16px; height: 16px; }

/* сумма */
.tp-main { display: flex; flex-direction: column; padding: 20px 24px; min-width: 0; }
.tp-amt {
    --tp-amt-size: 26px;
    position: relative; display: flex; align-items: center; height: 60px; padding: 0 18px; border-radius: 14px; background: var(--tp-card); border: 1px solid var(--tp-edge);
    cursor: text; overflow: hidden;
    transition: border-color var(--ms-dur-2, 160ms) var(--ms-ease, ease), box-shadow var(--ms-dur-2, 160ms) var(--ms-ease, ease);
}
.tp-amt:focus-within { border-color: var(--tp-acc-edge); box-shadow: 0 0 0 4px rgba(var(--ms-acc-rgb), 0.08); }
/* «500₽» слитно (владелец 22.11): цифры, знак и мерка — один шрифт, размер и цвет; ширину поля по цифрам ставит fitAmount */
.tp-amt input, .tp-amt__cur, .tp-amt__fit { font: 600 var(--tp-amt-size)/1 var(--tp-display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: var(--tp-t1); }
.tp-amt input { flex: none; width: 1ch; max-width: calc(100% - 1.2em); min-width: 0; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; outline: 0; background: transparent; box-shadow: none; }
/* 22.11: кольцо фокуса — у поля целиком (.tp-amt:focus-within), у самого ввода его нет; сильнее общего input:focus кабинета */
.tp-amt input:focus, .tp-amt input:focus-visible { border: 0; outline: 0; box-shadow: none; background: transparent; }
.tp-amt input::placeholder { color: rgba(255, 255, 255, 0.28); opacity: 1; }
.tp-amt__cur { flex: none; margin-left: 0.06em; user-select: none; transition: color var(--ms-dur-2, 160ms) var(--ms-ease, ease); }
.tp-amt.is-empty .tp-amt__cur { color: rgba(255, 255, 255, 0.28); }
.tp-amt__fit { position: absolute; left: 0; top: 0; visibility: hidden; white-space: pre; pointer-events: none; }
.tp-amt.is-off { opacity: 0.6; cursor: default; }
.tp-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.tp-chip {
    height: 44px; border-radius: 12px; border: 1px solid var(--tp-edge); background: var(--tp-card); color: var(--tp-t1); cursor: pointer;
    font: 600 15px/1 var(--tp-font); font-variant-numeric: tabular-nums;
    transition: background var(--ms-dur-2, 160ms) var(--ms-ease, ease), border-color var(--ms-dur-2, 160ms) var(--ms-ease, ease), transform var(--ms-dur-1, 100ms) var(--ms-ease, ease);
}
.tp-chip:hover { background: var(--tp-card-hover); }
.tp-chip:active { transform: scale(0.97); }
.tp-chip.is-on { border-color: var(--tp-acc-edge); background: rgba(var(--ms-acc-rgb), 0.08); }
.tp-chip:disabled { cursor: default; opacity: 0.5; }
.tp-note { margin: 12px 0 0; font: 500 13px/1.45 var(--tp-font); color: var(--tp-t2); }
.tp-note b { font-weight: 600; color: var(--tp-t1); font-variant-numeric: tabular-nums; }
.tp-note.is-warn { color: var(--ms-warn); }
.tp-note[hidden] { display: none; }

/* итог отдельной панелью */
.tp-sum { margin-top: auto; padding-top: 20px; display: grid; gap: 10px; }
.tp-panel { display: grid; gap: 0; padding: 16px 18px 18px; border-radius: 16px; background: var(--tp-card); border: 1px solid var(--tp-edge); }
.tp-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font: 500 14px/1.3 var(--tp-font); color: var(--tp-t1); }
.tp-row__val { color: var(--tp-t1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-row .tp-neg, .tp-row__val.tp-neg { color: var(--ms-neg); }
.tp-row--fee { color: var(--tp-t2); }
.tp-pct { display: inline-block; }
.tp-row--main { align-items: center; margin-top: 8px; font: 600 16px/1.2 var(--tp-font); }
.tp-row--main .tp-row__val { display: inline-block; font: 600 26px/1.1 var(--tp-display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; transform-origin: right center; }

/* согласие галочкой (владелец 22.11): без неё «Оплатить» недоступна */
.tp-agree { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 12px; cursor: pointer; font: 500 13px/1.45 var(--tp-font); color: var(--tp-t2); user-select: none; }
.tp-agree__in { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.tp-agree__box { flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: -1px; border-radius: 6px; border: 1.5px solid var(--tp-edge2); background: transparent; color: var(--ms-ink);
    transition: background var(--ms-dur-2, 160ms) var(--ms-ease, ease), border-color var(--ms-dur-2, 160ms) var(--ms-ease, ease), transform var(--ms-dur-1, 100ms) var(--ms-ease, ease); }
.tp-agree__box svg { width: 13px; height: 13px; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 240ms var(--ms-ease, ease) 40ms; }
.tp-agree:hover .tp-agree__box { border-color: rgba(255, 255, 255, 0.3); }
.tp-agree__in:checked + .tp-agree__box { background: var(--ms-acc); border-color: var(--ms-acc); }
.tp-agree__in:checked + .tp-agree__box svg { stroke-dashoffset: 0; }
.tp-agree:active .tp-agree__box { transform: scale(0.92); }
.tp-agree__in:focus-visible + .tp-agree__box { box-shadow: var(--ms-focus); }
.tp-agree__in:disabled + .tp-agree__box { opacity: 0.5; }
.tp-agree a { color: var(--tp-t1); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.3); text-underline-offset: 2px; border-radius: 3px; }
.tp-agree a:hover { text-decoration-color: var(--tp-t1); }
.tp-agree a:focus-visible { outline: none; box-shadow: var(--ms-focus); }

/* «≈ 1 050₽» под «К оплате», когда платёжка списывает не в валюте сайта (рубли — в долларах); место держится и без суммы */
.tp-approx { margin: 4px 0 0; text-align: right; font: 500 13px/1.3 var(--tp-font); color: var(--tp-t2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-approx.is-empty { visibility: hidden; }
.tp-approx[hidden] { display: none; }

/* окно «Как работают валюты» (22.11): те же шапка, галочка и кнопка, что у окна пополнения, только узкое */
.tp--note { width: min(460px, 100%); grid-template-rows: auto auto; }
.tp-cn-ico { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: rgba(var(--ms-acc-rgb), 0.12); color: var(--ms-acc); }
.tp-cn-ico svg { width: 17px; height: 17px; }
.tp-cn { padding: 18px 22px 22px; }
.tp-cn__text { margin: 0; font: 500 14px/1.55 var(--tp-font); color: var(--tp-t2); }
.tp-cn .tp-agree { margin: 16px 0 16px; color: var(--tp-t1); font-size: 14px; }
.tp-cn .tp-pay { margin-top: 0; }

/* при рублях и тенге: сколько это долларов на балансе (баланс сайта в долларах) */
.tp-conv { margin: 12px 0 0; font: 500 13px/1.45 var(--tp-font); color: var(--tp-t2); font-variant-numeric: tabular-nums; }
.tp-conv b { font-weight: 600; color: var(--tp-t1); }
.tp-conv[hidden] { display: none; }
.tp-pay {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 56px; margin-top: 2px;
    border: 0; border-radius: 14px; background: var(--ms-acc); color: var(--ms-ink); cursor: pointer; font: 600 16px/1 var(--tp-display);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: background var(--ms-dur-2, 160ms) var(--ms-ease, ease), transform var(--ms-dur-1, 100ms) var(--ms-ease, ease), color var(--ms-dur-2, 160ms) var(--ms-ease, ease);
}
.tp-pay:hover { background: var(--ms-acc-hi); }
.tp-pay { overflow: hidden; }
.tp-pay.is-lit::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%); transform: translateX(-100%); animation: tp-shine 700ms ease-out forwards; pointer-events: none; }
@keyframes tp-shine { to { transform: translateX(100%); } }
.tp-pct.is-swap { animation: tp-swap 260ms ease-out; }
@keyframes tp-swap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tp-row__val.is-bump { animation: tp-bump 260ms ease-out; }
@keyframes tp-bump { 0% { transform: scale(1); } 40% { transform: scale(1.035); } 100% { transform: scale(1); } }
/* открытие: карточки способов по очереди */
.tp-ov.is-entering .tp-m { animation: tp-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 28ms + 60ms); }
.tp-ov.is-entering .tp-main > * { animation: tp-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both 120ms; }
@keyframes tp-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tp-pay:active { transform: scale(0.99); }
.tp-pay svg { width: 17px; height: 17px; flex: none; }
.tp-pay:disabled { background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.42); box-shadow: none; cursor: not-allowed; transform: none; }
.tp-pay.is-busy { background: var(--ms-acc); color: var(--ms-ink); cursor: progress; }
.tp-spin { width: 17px; height: 17px; border-radius: 50%; border: 2px solid rgba(10, 10, 10, 0.25); border-top-color: var(--ms-ink); animation: tp-spin 0.8s linear infinite; }
@keyframes tp-spin { to { transform: rotate(360deg); } }

/* телефон: лист снизу, способы плитками в две колонки */
@media (max-width: 600px) {
    .tp-ov { place-items: end stretch; padding: 0; }
    .tp { width: 100%; max-height: calc(100dvh - 16px); border-radius: 22px 22px 0 0; border-bottom: 0; transform: translateY(24px); }
    .tp-head { padding: 14px 12px 14px 16px; gap: 10px; }
    .tp-brand { width: 26px; height: 26px; }
    .tp-head h2 { font-size: 18px; }
    .tp-body { grid-template-columns: minmax(0, 1fr); overscroll-behavior: contain; }
    .tp-side { padding: 14px 16px 6px; background: none; border-right: 0; }
    .tp-label { margin-bottom: 10px; }
    .tp-methods { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .tp-m { grid-template-columns: 36px minmax(0, 1fr); gap: 9px; height: 58px; padding: 0 10px 0 8px; }
    .tp-m__mark { display: none; }
    .tp-m__logo { width: 36px; height: 28px; }
    .tp-stack .tp-logo { width: 15px; height: 15px; }
    .tp-stack .tp-logo + .tp-logo { margin-left: -6px; }
    .tp-m__txt b { font-size: 13px; }
    .tp-m__txt i { font-size: 11px; }
    .tp-m__full { display: none; }
    .tp-m__short { display: inline; }
    .tp-main { padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
    .tp-amt { --tp-amt-size: 22px; height: 56px; }
    .tp-chip { height: 42px; font-size: 14px; }
    .tp-sum { padding-top: 16px; }
    .tp-panel { padding: 14px; }
    .tp-row--main .tp-row__val { font-size: 22px; }
    .tp--note { width: 100%; }
    .tp-cn { padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
    .tp-ov, .tp, .tp-m, .tp-chip, .tp-pay, .tp-m__mark, .tp-m__mark svg, .tp-hl, .tp-agree__box, .tp-agree__box svg { transition-duration: 1ms !important; }
    .tp-m.is-on .tp-m__mark, .tp-pay.is-lit::after, .tp-pct.is-swap, .tp-row__val.is-bump, .tp-ov.is-entering .tp-m, .tp-ov.is-entering .tp-main > * { animation: none !important; }
    .tp-spin { animation-duration: 1.6s; }
}
html.ms-reduce-motion .tp-ov, html.ms-reduce-motion .tp, html.ms-reduce-motion .tp-m, html.ms-reduce-motion .tp-chip, html.ms-reduce-motion .tp-pay, html.ms-reduce-motion .tp-hl, html.ms-reduce-motion .tp-agree__box, html.ms-reduce-motion .tp-agree__box svg { transition-duration: 1ms !important; }
html.ms-reduce-motion .tp-m.is-on .tp-m__mark, html.ms-reduce-motion .tp-pay.is-lit::after, html.ms-reduce-motion .tp-pct.is-swap, html.ms-reduce-motion .tp-row__val.is-bump, html.ms-reduce-motion .tp-ov.is-entering .tp-m, html.ms-reduce-motion .tp-ov.is-entering .tp-main > * { animation: none !important; }

@media (max-width: 768px) {
    /* В шапке телефона рублёвый эквивалент — первое, чем можно пожертвовать:
       доллар остаётся, а строка перестаёт распирать и без того тесную шапку. */
    .balance-secondary { display: none; }
    .balance-dropdown { right: -10px; width: 230px; }
}

/* Окно отмены: снизу по центру, выезжает мягко; цифра секунд в круге, полоса снизу убывает за --dur (css/look/subscription.css). */
.undo-toast {
    position: fixed;
    z-index: 1200;
    left: 50%;
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(460px, calc(100vw - 32px));
    padding: 12px 12px 12px 14px;
    border-radius: 16px;
    background: var(--ms-s2);
    border: 1px solid var(--ms-line-solid);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 24px) scale(0.98);
    transition: opacity 0.25s ease, transform 0.35s cubic-bezier(.2, .8, .2, 1), visibility 0.35s;
}
.undo-toast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
.undo-ring { position: relative; flex: none; width: 40px; height: 40px; }
.undo-ring span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--ms-t1);
}
.undo-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.undo-txt b { font-size: 0.88rem; color: var(--ms-t1); }
.undo-txt span { font-size: 0.78rem; color: var(--ms-t2); line-height: 1.4; }
.undo-btn {
    flex: none;
    border: 1px solid var(--ms-line-solid);
    background: var(--ms-s3);
    color: var(--ms-t1);
    border-radius: 11px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.undo-btn:hover:not(:disabled) { border-color: rgba(var(--ms-acc-rgb), 0.5); color: var(--ms-acc-text); }
.undo-btn:disabled { opacity: 0.6; cursor: default; }
.undo-done {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(var(--ms-acc-rgb), 0.12);
    color: var(--ms-acc-text);
    animation: undo-pop 0.4s cubic-bezier(.2, .8, .2, 1);
}
.undo-done svg { width: 20px; height: 20px; }
@keyframes undo-pop { from { transform: scale(0.6); opacity: 0; } }
@media (max-width: 480px) {
    .undo-toast { gap: 11px; }
    .undo-btn { padding: 9px 11px; }
}
@media (prefers-reduced-motion: reduce) {
    .undo-done { animation: none; }
    .undo-toast { transition: opacity 0.2s ease; }
}

/* =====================================================================================================
   ВАЛЮТА ПОКАЗА (22.11, владелец: «выбрана валюта — она главная»): цены тарифов в долларах при любой валюте (как у CSBoard),
   рядом мелко «≈ 1 846₽» в валюте сайта по курсу дня — вкладки «Баланс» (frontend/balance-tab.js) и «Тариф и оплата»
   (settings.html: под итогом чека, в рядах тарифов — второй строкой цены). Вид по просьбе 3b: --ms-t3, мелкий кегль,
   тот же край, без переноса и многоточия.
   ===================================================================================================== */
.bal-approx { color: var(--ms-t3); font-size: var(--ms-fs-12, 12px); font-weight: var(--ms-fw-regular, 400); white-space: nowrap; }
.sub-check__approx { margin-top: -6px; text-align: right; font: var(--ms-fw-regular, 400) var(--ms-fs-13, 13px)/1.3 var(--ms-font); color: var(--ms-t3); white-space: nowrap; }
.sub-check__approx:empty { display: none; }
.sub-tier__price small { white-space: nowrap; }
/* телефон (форма в две строки): «≈ 738₽» без «в месяц» — иначе столбец цены шире и «10 Steam · 2 Telegram» переносится */
@container subform (max-width: 600px) { .sub-tier__price .sub-approx + .sub-per { display: none; } }
