﻿/* ============================================================
   COIF Bank Mobile, базовый слой.
   Здесь только структура и поведение. Внешний вид (цвета,
   радиусы, шрифты, анимации) задаётся скинами skin-*.css
   через переменные и [data-skin] селекторы.
   ============================================================ */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../assets/fonts/inter-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../assets/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212;
}

*, *::before, *::after { box-sizing: border-box; }

:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --tabbar-h: 58px;
    --nav-h: 52px;

    /* Бренд COIF, общий для всех скинов */
    --brand: #ff3333;
    --brand-2: #cc0000;

    --dur-fast: 160ms;
    --dur: 300ms;
    --dur-slow: 460ms;
    --ease: cubic-bezier(.32, .72, 0, 1);
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    text-size-adjust: 100%;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    text-align: left;
    border: 0;
    background: none;
    outline: none;
}
button { cursor: pointer; padding: 0; }
input { -webkit-user-select: text; user-select: text; }

/* Приложение не веб-страница: текст нигде не выделяется руками, копирование
   только через отдельные кнопки-по-тапу (реквизиты, номер счёта и т.п.).
   Поля ввода это исключение, там выделение должно работать как обычно. */
#app {
    -webkit-user-select: none; user-select: none;
    -webkit-touch-callout: none;
}
#app input, #app textarea {
    -webkit-user-select: text; user-select: text;
    -webkit-touch-callout: default;
}
[hidden] { display: none !important; }

/* ---------- Заставка ---------- */
#boot {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--bg);
    transition: opacity 420ms ease, transform 420ms var(--ease);
}
#boot.done { opacity: 0; transform: scale(1.06); pointer-events: none; }
.boot-logo {
    width: 88px; height: 88px;
    background: url('../assets/logo-tile.png') center / cover no-repeat;
    border-radius: var(--radius-logo);
    box-shadow: 0 18px 50px rgba(255, 51, 51, .35);
    animation: bootPop 700ms var(--ease) both;
}
.boot-name { font-size: 19px; font-weight: 700; letter-spacing: .18em; animation: bootFade 700ms 120ms var(--ease) both; }
.boot-sub { font-size: 12px; color: var(--text-mute); letter-spacing: .06em; animation: bootFade 700ms 220ms var(--ease) both; }
@keyframes bootPop { from { opacity: 0; transform: scale(.7) translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes bootFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Каркас ---------- */
#app { position: fixed; inset: 0; }
#screens { position: absolute; inset: 0; }

/* На широких экранах (десктоп) приложение не растягивается на весь
   вьюпорт, а показывается в рамке телефона по центру */
@media (min-width: 560px) {
    html, body { overflow: auto; }
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100%;
        background: #050507;
    }
    #app {
        position: relative;
        inset: auto;
        width: 412px;
        height: 890px;
        max-height: 94vh;
        border-radius: 44px;
        overflow: hidden;
        box-shadow: 0 50px 120px -24px rgba(0, 0, 0, .7), 0 0 0 9px #000;
    }
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    will-change: transform, opacity;
}
.screen.is-root { z-index: 1; }
.screen.is-pushed { z-index: 5; box-shadow: var(--shadow-push); }

/* Прокручиваемое тело экрана */
.scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 0 var(--gutter) calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
}
.screen.no-tabbar .scroll { padding-bottom: calc(var(--safe-bottom) + 24px); }

/* ---------- Верхняя панель ---------- */
.nav {
    flex: none;
    padding-top: var(--safe-top);
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: calc(var(--nav-h) + var(--safe-top));
    padding-inline: 8px;
    background: var(--nav-bg);
    backdrop-filter: var(--nav-blur);
    -webkit-backdrop-filter: var(--nav-blur);
    border-bottom: var(--nav-border);
    z-index: 2;
}
.nav-title { font-size: var(--nav-title-size); font-weight: var(--nav-title-weight); flex: 1; }

/* Панель без содержимого не занимает место: висит поверх и невидима,
   пока страницу не прокрутили */
.nav.floating {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 4;
    background-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 0;
    pointer-events: none;
    transition: background-color 200ms ease;
}
.nav.floating .nav-title { opacity: 0; transition: opacity 180ms ease; }
.nav.floating .nav-btn { pointer-events: auto; }
.nav.floating.solid {
    /* Полностью непрозрачный фон, как у нижней панели, а не полупрозрачный
       --nav-bg: контент под шапкой раньше просвечивал при скролле. */
    background-color: var(--tabbar-bg);
    border-bottom: var(--nav-border);
    pointer-events: auto;
}
.nav.floating.solid .nav-title { opacity: 1; }
.screen.has-floating-nav .scroll { padding-top: calc(var(--safe-top) + 10px); }
/* Со стрелкой «назад» заголовок должен начинаться ниже неё, а не под ней */
.screen.has-floating-nav.has-back .scroll { padding-top: calc(var(--safe-top) + var(--nav-h) + 2px); }
.nav-btn {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 50%;
    color: var(--nav-icon);
    transition: background var(--dur-fast), transform var(--dur-fast);
}
.nav-btn:active { background: var(--press); transform: scale(.9); }
.nav-btn svg { width: 22px; height: 22px; }
.nav .back svg { width: 24px; height: 24px; }

/* Большой заголовок (iOS-стиль, но доступен всем скинам) */
.large-title {
    font-size: var(--large-title-size);
    font-weight: var(--large-title-weight);
    letter-spacing: var(--large-title-tracking);
    margin: var(--large-title-margin);
}

/* ---------- Нижняя навигация ---------- */
#tabbar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 20;
    display: flex;
    align-items: stretch;
    height: calc(var(--tabbar-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--tabbar-bg);
    backdrop-filter: var(--nav-blur);
    -webkit-backdrop-filter: var(--nav-blur);
    border-top: var(--tabbar-border);
    transition: transform var(--dur) var(--ease);
}
#tabbar.hide { transform: translateY(110%); }
.tab {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--tab-gap);
    color: var(--tab-inactive);
    transition: color var(--dur-fast);
}
.tab.active { color: var(--tab-active); }
.tab-ico { display: grid; place-items: center; position: relative; z-index: 1; }
.tab-ico svg { width: var(--tab-icon-size); height: var(--tab-icon-size); transition: transform var(--dur) var(--ease); }
.tab.active .tab-ico svg { transform: var(--tab-active-icon-transform); }
.tab-label { font-size: var(--tab-label-size); font-weight: var(--tab-label-weight); }
.tab-badge {
    position: absolute;
    top: 4px;
    left: 50%;
    margin-left: 4px;
    min-width: 17px; height: 17px;
    padding: 0 5px;
    display: grid; place-items: center;
    font-size: 10px; font-weight: 700;
    color: #fff;
    background: var(--brand);
    border-radius: 9px;
}
.tab-indicator { display: none; }

/* ---------- Общие компоненты ---------- */
.card {
    background: var(--surface);
    border: var(--card-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}
.section-title {
    font-size: var(--section-title-size);
    font-weight: var(--section-title-weight);
    color: var(--section-title-color);
    text-transform: var(--section-title-transform);
    letter-spacing: var(--section-title-tracking);
    margin: 18px 4px 8px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: var(--btn-h);
    font-size: 16px;
    font-weight: var(--btn-weight);
    border-radius: var(--radius-btn);
    background: var(--accent);
    color: var(--accent-fg);
    transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast), opacity var(--dur-fast);
    box-shadow: var(--btn-shadow);
}
.btn:active { transform: scale(var(--tap-scale)); filter: brightness(.92); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.ghost { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn.danger { background: var(--danger); color: #fff; }
.btn svg { width: 19px; height: 19px; }

/* Список-строки (настройки, детали) */
.list {
    background: var(--surface);
    border: var(--card-border);
    border-radius: var(--radius-card);
    overflow: hidden;
}
.row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--row-h);
    padding: 10px var(--row-pad);
    position: relative;
    transition: background var(--dur-fast);
}
.row + .row::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    left: var(--row-divider-inset);
    border-top: 1px solid var(--divider);
}
.row.tappable:active { background: var(--press); }
.row-ico {
    flex: none;
    width: var(--row-ico-size); height: var(--row-ico-size);
    display: grid; place-items: center;
    border-radius: var(--radius-ico);
    background: var(--row-ico-bg);
    color: var(--row-ico-fg);
}
.row-ico svg { width: 18px; height: 18px; }
.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 15px; font-weight: 500; }
.row-sub { font-size: 12.5px; color: var(--text-mute); margin-top: 2px; }
.row-value { font-size: 14px; color: var(--text-dim); }
.row-chevron { color: var(--text-mute); opacity: .6; }
.row-chevron svg { width: 16px; height: 16px; }

/* Поля ввода */
.field { margin-bottom: 14px; }
.field-label {
    display: block;
    font-size: var(--label-size);
    font-weight: var(--label-weight);
    color: var(--label-color);
    text-transform: var(--label-transform);
    letter-spacing: var(--label-tracking);
    margin: 0 4px 7px;
}
.input {
    width: 100%;
    height: var(--input-h);
    padding: 0 14px;
    font-size: 16px;
    color: var(--text);
    background: var(--input-bg);
    border: var(--input-border);
    border-radius: var(--radius-input);
    transition: border-color var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}
.input::placeholder { color: var(--text-mute); }
.input:focus { border-color: var(--accent); box-shadow: var(--input-focus-shadow); }
textarea.input { height: auto; min-height: 84px; padding: 12px 14px; resize: none; line-height: 1.45; }

.switch {
    flex: none;
    width: 51px; height: 31px;
    border-radius: 16px;
    background: var(--switch-off);
    position: relative;
    transition: background var(--dur) var(--ease);
}
.switch::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 27px; height: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
    transition: transform var(--dur) var(--ease);
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }

.chip {
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    background: var(--surface-2);
    border-radius: var(--radius-chip);
    transition: all var(--dur-fast);
}
.chip.active { background: var(--accent); color: var(--accent-fg); }

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 48px 20px;
    color: var(--text-mute);
    text-align: center;
}
.empty svg { width: 42px; height: 42px; opacity: .35; }
.empty-text { font-size: 14px; }

.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--press) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Банковская карта ---------- */
.card-scene { perspective: 1200px; margin-top: 10px; }
.card-flip {
    position: relative;
    aspect-ratio: 1.78;
    transform-style: preserve-3d;
    transform: rotateY(var(--flip, 0deg)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 820ms cubic-bezier(.2, .8, .2, 1);
}
.card-flip.flipped { --flip: 180deg; }
.card-flip.dragging { transition: transform 90ms linear; }

.bankcard {
    position: absolute;
    inset: 0;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: var(--radius-bankcard);
    background:
        radial-gradient(120% 90% at 88% 8%, rgba(255, 51, 51, .5), transparent 58%),
        linear-gradient(150deg, #241014 0%, #12060a 48%, #08080e 100%);
    color: #fff;
    overflow: hidden;
    backface-visibility: hidden;
    box-shadow: 0 20px 44px -18px rgba(255, 51, 51, .5), 0 4px 16px rgba(0, 0, 0, .45);
}
/* Блик проезжает по карте */
.bankcard.front::after {
    content: '';
    position: absolute;
    top: -60%; bottom: -60%; width: 42%;
    left: -60%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .12), transparent);
    transform: rotate(14deg);
    animation: cardGlare 7s ease-in-out infinite;
    pointer-events: none;
}
@keyframes cardGlare {
    0%, 64% { left: -60%; }
    88%, 100% { left: 130%; }
}

/* Обратная сторона: QR на пополнение */
.bankcard.back {
    transform: rotateY(180deg);
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 16px;
}
.card-qr {
    width: 116px; height: 116px;
    padding: 8px;
    background: #fff;
    border-radius: 12px;
    display: grid; place-items: center;
}
.card-qr img, .card-qr canvas { display: block; width: 100px; height: 100px; }
.card-back-text { font-size: 11.5px; color: rgba(255, 255, 255, .65); text-align: center; line-height: 1.4; }
.card-back-text b { display: block; color: #fff; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.card-hint {
    margin-top: 7px;
    text-align: center;
    font-size: 11px;
    color: var(--text-mute);
}
.card-eye {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .8);
    z-index: 2;
}
.card-eye svg { width: 16px; height: 16px; }
.bankcard-top { display: flex; align-items: flex-start; justify-content: space-between; }
.bankcard-brand { font-size: 12px; font-weight: 700; letter-spacing: .16em; }
.bankcard-org { font-size: 9.5px; letter-spacing: .1em; opacity: .55; margin-top: 3px; }
.bankcard-chip {
    width: 34px; height: 25px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f5d78e, #b98b3a 60%, #f0d191);
    position: relative;
}
.bankcard-chip::before, .bankcard-chip::after {
    content: '';
    position: absolute;
    left: 6px; right: 6px;
    height: 1px;
    background: rgba(0, 0, 0, .28);
}
.bankcard-chip::before { top: 10px; }
.bankcard-chip::after { top: 17px; }
.bankcard-balance { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bankcard-balance-label { font-size: 11px; opacity: .55; margin-bottom: 3px; letter-spacing: .04em; }
.bankcard-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.bankcard-number { font-size: 13px; letter-spacing: .1em; opacity: .85; font-variant-numeric: tabular-nums; }
.bankcard-holder { font-size: 11px; opacity: .55; margin-top: 4px; text-transform: uppercase; letter-spacing: .08em; }
.bankcard.blurred .bankcard-balance,
.bankcard.blurred .bankcard-number { filter: blur(9px); user-select: none; }

/* ---------- Быстрые действия ---------- */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 10px 4px;
    border-radius: var(--radius-card);
    background: var(--surface);
    border: var(--card-border);
    transition: transform var(--dur-fast) var(--ease), background var(--dur-fast);
}
.quick-item:active { transform: scale(.94); background: var(--press); }
.quick-ico {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: var(--radius-ico);
    background: var(--accent-soft);
    color: var(--accent);
}
.quick-ico svg { width: 19px; height: 19px; }
.quick-label { font-size: 11px; color: var(--text-dim); text-align: center; line-height: 1.2; }

/* ---------- Операции ---------- */
.tx {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px var(--row-pad);
    position: relative;
    transition: background var(--dur-fast);
}
.tx:active { background: var(--press); }
.tx + .tx::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    left: calc(var(--row-pad) + var(--row-ico-size) + 12px);
    border-top: 1px solid var(--divider);
}
.tx-avatar {
    flex: none;
    width: var(--row-ico-size); height: var(--row-ico-size);
    display: grid; place-items: center;
    border-radius: var(--radius-ico);
    font-size: 14px; font-weight: 600;
    color: #fff;
}
.tx-avatar svg { width: 18px; height: 18px; }
.tx-body { flex: 1; min-width: 0; }
.tx-name { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-meta { font-size: 12.5px; color: var(--text-mute); margin-top: 2px; }
.tx-amount { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-amount.in { color: var(--income); }
.tx-amount.out { color: var(--text); }

.date-head {
    font-size: 12.5px;
    color: var(--text-mute);
    font-weight: 500;
    margin: 18px 4px 8px;
}

/* ---------- График доход/расход ---------- */
.chart {
    display: flex;
    align-items: stretch;
    gap: 4px;
    height: 124px;
    padding: 4px 2px 0;
}
.chart-col {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}
.chart-tip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(calc(-50% + var(--tip-shift, 0px))) scale(.9);
    background: var(--surface-2);
    border: var(--card-border);
    border-radius: 9px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--text);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 5;
}
.chart-tip.show { opacity: 1; transform: translateX(calc(-50% + var(--tip-shift, 0px))) scale(1); }
.chart-bars {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
}
.chart-bar {
    width: 9px;
    min-height: 3px;
    border-radius: 4px 4px 2px 2px;
    transition: height var(--dur-slow) var(--ease);
}
.chart-bar.in { background: var(--income); opacity: .85; }
.chart-bar.out { background: var(--accent); opacity: .85; }
.chart-label {
    font-size: 10.5px;
    color: var(--text-mute);
    white-space: nowrap;
}
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 12px;
    padding-bottom: 4px;
    font-size: 11.5px;
    color: var(--text-mute);
}
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .dot { width: 8px; height: 8px; border-radius: 50%; }
.chart-legend .dot.in { background: var(--income); }
.chart-legend .dot.out { background: var(--accent); }

/* ---------- Модальные шторки ---------- */
#sheet-layer { position: fixed; inset: 0; z-index: 500; pointer-events: none; }
.sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    opacity: 0;
    transition: opacity var(--dur) var(--ease);
    pointer-events: auto;
}
.sheet-backdrop.show { opacity: 1; }
.sheet {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    max-height: 88%;
    display: flex;
    flex-direction: column;
    padding: var(--sheet-pad);
    padding-bottom: calc(var(--safe-bottom) + 18px);
    background: var(--sheet-bg);
    border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
    transform: translateY(101%);
    transition: transform var(--dur-slow) var(--ease);
    pointer-events: auto;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, .4);
}
.sheet.show { transform: none; }
.sheet-grabber {
    width: 40px; height: 4px;
    border-radius: 2px;
    background: var(--text-mute);
    opacity: .4;
    margin: 0 auto 14px;
}
.sheet-title { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.sheet-text { font-size: 14px; color: var(--text-dim); line-height: 1.5; }
.sheet-body { overflow-y: auto; }
.sheet-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 20px; }

/* ---------- Тосты ---------- */
#toast-layer {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
    z-index: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.toast {
    max-width: 86%;
    padding: 11px 18px;
    font-size: 14px;
    background: var(--toast-bg);
    color: var(--toast-fg);
    border-radius: var(--radius-toast);
    box-shadow: 0 8px 26px rgba(0, 0, 0, .35);
    animation: toastIn var(--dur) var(--ease) both;
}
.toast.out { animation: toastOut var(--dur-fast) ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.96); } }

/* ---------- Уведомления (внешний вид задают скины) ---------- */
#notif-layer {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 800;
    padding: calc(var(--safe-top) + 8px) 10px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.notif {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    cursor: pointer;
    will-change: transform, opacity;
    animation: notifIn var(--dur-slow) var(--ease) both;
}
.notif.out { animation: notifOut var(--dur) var(--ease) forwards; }
.notif-ico {
    flex: none;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: var(--radius-ico);
    background: linear-gradient(140deg, var(--brand), var(--brand-2));
    color: #fff;
}
.notif-ico svg { width: 18px; height: 18px; }
.notif-body { flex: 1; min-width: 0; }
.notif-app { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; opacity: .6; }
.notif-title { font-size: 14px; font-weight: 600; margin-top: 1px; }
.notif-text { font-size: 13px; opacity: .8; margin-top: 2px; line-height: 1.3; }
.notif-time { font-size: 11px; opacity: .5; align-self: flex-start; }
.notif-dismiss {
    flex: none;
    width: 26px; height: 26px;
    display: grid; place-items: center;
    align-self: flex-start;
    border-radius: 50%;
    color: var(--text-mute);
    opacity: .6;
    transition: opacity var(--dur-fast), background var(--dur-fast);
}
.notif-dismiss:active { opacity: 1; background: var(--press); }
.notif-dismiss svg { width: 14px; height: 14px; }
@keyframes notifIn { from { opacity: 0; transform: translateY(-120%) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes notifOut { to { opacity: 0; transform: translateY(-110%) scale(.95); } }

/* ---------- Переходы между экранами ---------- */
@keyframes pushIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes pushOut { to { transform: translateX(-28%); filter: brightness(.72); } }
@keyframes popOut { from { transform: none; } to { transform: translateX(100%); } }
@keyframes popIn { from { transform: translateX(-28%); filter: brightness(.72); } to { transform: none; filter: none; } }

.screen.anim-push-in { animation: pushIn var(--dur-slow) var(--ease) both; }
.screen.anim-push-out { animation: pushOut var(--dur-slow) var(--ease) both; }
.screen.anim-pop-out { animation: popOut var(--dur-slow) var(--ease) both; }
.screen.anim-pop-in { animation: popIn var(--dur-slow) var(--ease) both; }

/* Переключение корневых вкладок */
@keyframes tabIn { from { opacity: 0; transform: var(--tab-in-from); } to { opacity: 1; transform: none; } }
.screen.anim-tab { animation: tabIn var(--dur) var(--ease) both; }

/* Появление содержимого списком */
.stagger > * { animation: staggerIn 420ms var(--ease) both; }
@keyframes staggerIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Разворот блока целиком (перевод за границу: счёт + сумма после выбора банка) */
.rest-in { animation: restIn 380ms var(--ease) both; }
@keyframes restIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
