/* Компоненты экранов. Стили нейтральны к скину, всё через переменные. */

/* ---------- Вход и PIN ---------- */
/* position тут не задаём: .screen уже даёт absolute + inset:0, а перебивка
   на relative снимала растяжку, экран схлопывался по содержимому и снизу
   торчала полоса голого фона. Containing block для свечения ниже даёт всё
   тот же absolute. */
.auth { background: var(--bg); overflow: hidden; }
.auth.auth-out { animation: authOut 380ms var(--ease) forwards; }
@keyframes authOut { to { opacity: 0; transform: scale(1.04); } }
/* Мягкое свечение фона позади всего, как у остальных экранов с акцентом */
.auth::before {
    content: '';
    position: absolute;
    top: -14%; left: 50%;
    width: 380px; height: 380px;
    transform: translateX(-50%);
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent), transparent 72%);
    pointer-events: none;
}
.auth > .scroll { position: relative; z-index: 1; }

.auth-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 11vh 0 26px;
}
/* Тот же приём, что у лого на главной: маска на псевдоэлементе, свечение
   на самом .auth-logo, иначе filter: drop-shadow вместе с mask не рисуется. */
.auth-logo {
    position: relative;
    width: 74px; height: 74px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 60%, transparent))
            drop-shadow(0 10px 26px color-mix(in srgb, var(--accent) 45%, transparent));
    animation: authLogoIn 560ms cubic-bezier(.3, 1.2, .4, 1) both;
}
.auth-logo::before {
    content: '';
    position: absolute; inset: 0;
    background-color: var(--accent);
    -webkit-mask: url('../assets/logo-mark.png') center / contain no-repeat;
            mask: url('../assets/logo-mark.png') center / contain no-repeat;
}
@keyframes authLogoIn {
    from { opacity: 0; transform: scale(.55) rotate(-10deg); }
    to { opacity: 1; transform: none; }
}
.auth-title { font-size: 26px; font-weight: 700; margin: 0 0 6px; letter-spacing: -.01em; animation: staggerIn 420ms var(--ease) 80ms both; }
.auth-sub { font-size: 14px; color: var(--text-mute); margin: 0; animation: staggerIn 420ms var(--ease) 130ms both; }
/* ---------- Карточка входа ----------
   По краю карточки медленно ходит луч акцентного цвета: под ней вращается
   конический градиент, а сверху лежит заливка цвета поверхности, поэтому
   видно только полоску по самой кромке. При фокусе луч ярче и быстрее.
   Отрицательный z-index у слоёв работает благодаря isolation: карточка
   делает свой контекст наложения, и слои не всплывают на весь экран. */
.auth-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--surface);
    border: var(--card-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 22px 18px 18px;
    transition: border-color 260ms, box-shadow 260ms;
    animation: authCardIn 620ms var(--ease) 150ms both;
}
@keyframes authCardIn {
    from { opacity: 0; transform: translateY(20px) scale(.965); }
    to { opacity: 1; transform: none; }
}
/* Заливка обязана быть НЕПРОЗРАЧНОЙ, иначе луч видно сквозь неё на всю
   карточку. Переменная --surface в тёмных темах полупрозрачная, поэтому
   кладём её поверх непрозрачного фона экрана: цвет тот же, дырок нет. */
.auth-card::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 1.5px;
    border-radius: inherit;
    background: linear-gradient(var(--surface), var(--surface)), var(--bg);
}
.auth-ring {
    position: absolute;
    z-index: -2;
    inset: -80%;
    background: conic-gradient(from 0deg,
        transparent 0 71%,
        color-mix(in srgb, var(--accent) 85%, transparent) 78%,
        transparent 85% 100%);
    opacity: .55;
    animation: authRing 9s linear infinite;
    transition: opacity 300ms;
}
@keyframes authRing { to { transform: rotate(1turn); } }
.auth-card:focus-within .auth-ring { opacity: 1; animation-duration: 4.5s; }

/* Блик, который изредка проходит по карточке наискось */
.auth-sheen {
    position: absolute;
    top: 0; bottom: 0; left: -60%;
    width: 42%;
    background: linear-gradient(100deg, transparent,
        color-mix(in srgb, var(--text) 5%, transparent), transparent);
    transform: skewX(-14deg);
    pointer-events: none;
    animation: authSheen 9s var(--ease) 1.6s infinite;
}
@keyframes authSheen { 0% { left: -60%; } 18%, 100% { left: 130%; } }

/* Поле: иконка, плавающая подпись, подчёркивание из центра */
.afield {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: calc(var(--input-h) + 6px);
    margin-bottom: 14px;
    padding: 0 12px;
    background: var(--input-bg);
    border: var(--input-border);
    border-radius: var(--radius-input);
    overflow: hidden;
    transition: border-color 220ms, box-shadow 220ms, background 220ms;
    animation: authFieldIn 520ms var(--ease) var(--d, 0ms) both;
}
@keyframes authFieldIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}
.afield:focus-within { border-color: var(--accent); box-shadow: var(--input-focus-shadow); }

.afield-ico {
    flex: none;
    display: grid;
    place-items: center;
    width: 20px;
    color: var(--text-mute);
    transition: color 220ms, transform 260ms var(--ease);
}
.afield-ico svg { width: 18px; height: 18px; }
.afield:focus-within .afield-ico { color: var(--accent); transform: scale(1.12); }

.ainput {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding-top: 15px;
    font-size: 16px;
    color: var(--text);
    background: none;
    border: 0;
}

.afield-label {
    position: absolute;
    left: 42px;
    top: 50%;
    transform: translateY(-50%);
    transform-origin: left center;
    font-size: 15px;
    color: var(--text-mute);
    pointer-events: none;
    transition: transform 260ms var(--ease), color 220ms;
}
.afield:focus-within .afield-label,
.ainput:not(:placeholder-shown) + .afield-label {
    transform: translateY(calc(-50% - 12px)) scale(.76);
}
.afield:focus-within .afield-label { color: var(--accent); }

.afield-line {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 340ms var(--ease);
}
.afield:focus-within .afield-line { transform: scaleX(1); }

.afield .input-eye { position: static; flex: none; width: 34px; height: 34px; }

/* Кнопка: редкий проблеск и кольцо загрузки вместо подписи. Текст не
   подменяем, иначе прыгает ширина. Цвет на успехе не меняем. */
.auth-btn {
    position: relative;
    overflow: hidden;
    margin-top: 8px;
    animation: authFieldIn 520ms var(--ease) var(--d, 0ms) both;
}
.auth-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 44%,
        color-mix(in srgb, var(--accent-fg) 14%, transparent) 50%, transparent 56%);
    transform: translateX(-100%);
    animation: authBtnShine 7s ease-in-out 2s infinite;
    pointer-events: none;
}
@keyframes authBtnShine { 0% { transform: translateX(-100%); } 22%, 100% { transform: translateX(100%); } }
.auth-btn-text { transition: opacity 160ms; }
.auth-btn.loading .auth-btn-text { opacity: 0; }
.auth-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--accent-fg) 32%, transparent);
    border-top-color: var(--accent-fg);
    animation: authBtnSpin 620ms linear infinite;
}
@keyframes authBtnSpin { to { transform: rotate(1turn); } }

/* Ошибка: карточка краснеет и луч по кромке гаснет */
.auth-card.bad { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent); }
.auth-card.bad .auth-ring { opacity: 0; }
/* Плашка ошибки не появляется рывком: она свёрнута в ноль высоты и
   разворачивается вместе с отступами, поэтому карточка растёт плавно.
   Через атрибут hidden так нельзя, display: none обрывает переходы,
   поэтому показ через класс show. */
.auth-error {
    overflow: hidden;
    max-height: 0;
    margin: 0 4px;
    padding: 0 14px;
    opacity: 0;
    transform: translateY(-5px);
    font-size: 13.5px;
    line-height: 1.35;
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    border-radius: var(--radius-input);
    transition: max-height 340ms var(--ease), opacity 260ms var(--ease),
                transform 340ms var(--ease), margin 340ms var(--ease),
                padding 340ms var(--ease);
}
.auth-error.show {
    max-height: 96px;
    margin: 4px 4px 12px;
    padding: 11px 14px;
    opacity: 1;
    transform: none;
}

/* Мягкий толчок вместо тряски. Общий .shake остаётся точкам PIN-кода. */
.auth-card.nudge { animation: authNudge 400ms var(--ease); }
@keyframes authNudge {
    22% { transform: translateX(-3px); }
    48% { transform: translateX(3px); }
    74% { transform: translateX(-2px); }
    100% { transform: none; }
}
.auth-note {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 26px 4px 20px;
    font-size: 12.5px;
    color: var(--text-mute);
    line-height: 1.4;
    animation: staggerIn 420ms var(--ease) 220ms both;
}
.auth-note svg { width: 17px; height: 17px; flex: none; }

.shake { animation: shake 420ms ease; }
@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-7px); }
    40%, 60% { transform: translateX(7px); }
}

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-right: 46px; }
.input-eye {
    position: absolute; right: 6px;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    color: var(--text-mute);
}
.input-eye svg { width: 19px; height: 19px; }
.input-at {
    position: absolute; right: 14px;
    font-size: 16px; color: var(--text-mute);
    pointer-events: none;
}
.input-wrap .input-at ~ .input, .input-wrap .input:has(~ .input-at) { padding-right: 34px; }

.pin-dots { display: flex; justify-content: center; gap: 18px; margin: 6px 0 34px; }
.pin-dots span {
    width: 13px; height: 13px;
    border-radius: 50%;
    border: 1.6px solid var(--text-mute);
    transition: all var(--dur) var(--ease);
}
.pin-dots span.on { background: var(--accent); border-color: var(--accent); transform: scale(1.18); }

/* Клавиатура крупная и прижата вниз: сверху остаётся воздух, внизу пустоты
   больше нет, а до кнопок дотягивается большой палец. */
.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 340px;
    margin: auto auto 0;
    padding-bottom: calc(var(--safe-bottom) + 26px);
}
.key {
    aspect-ratio: 1;
    display: grid; place-items: center;
    font-size: 28px;
    font-weight: 500;
    border-radius: var(--radius-card);
    background: var(--surface);
    color: var(--text);
    transition: transform var(--dur-fast) var(--ease), background var(--dur-fast);
}
[data-skin="ios"] .key, [data-skin="hyperos"] .key { border-radius: 50%; }
.key:active { transform: scale(.93); background: var(--press); }
.key-flat { background: transparent; font-size: 16px; color: var(--text-dim); }
.key-flat svg { width: 27px; height: 27px; }

/* ---------- Главный экран ---------- */
.home-nav { gap: 10px; padding-inline: 16px 8px; }
.home-avatar {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 50%;
    font-size: 14px; font-weight: 600; color: #fff;
    flex: none;
}
.home-hello { flex: 1; min-width: 0; }
.home-hello-sub { font-size: 11.5px; color: var(--text-mute); }
.home-hello-name { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.home-nav .nav-btn { color: var(--text); }

.balance-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 6px; }
.balance-info { min-width: 0; }
.balance-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--text-mute);
}
.balance-eye { color: var(--text-mute); display: grid; place-items: center; }
.balance-eye svg { width: 15px; height: 15px; }
.balance-value {
    font-size: 32px; font-weight: 700; letter-spacing: -.02em;
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
    /* При огромном балансе цифры раньше просто вылезали за свой блок и
       прятались под карточкой справа (та рисуется поверх, позже в
       разметке). Обрезать многоточием нельзя, баланс должен быть виден
       целиком — вместо этого home.js сам уменьшает font-size, пока число
       не влезет; overflow:hidden тут просто подстраховка на случай, если
       даже у минимального размера строка чуть-чуть не поместится. */
    overflow: hidden; white-space: nowrap; max-width: 100%;
}
.balance-acc {
    font-size: 12px; color: var(--text-mute); margin-top: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.balance-info.blurred .balance-value,
.balance-info.blurred .balance-acc { filter: blur(9px); user-select: none; }

.mini-scene { flex: none; perspective: 900px; }
.mini-flip {
    position: relative;
    width: 174px; height: 124px;
    transform-style: preserve-3d;
    transition: transform 620ms cubic-bezier(.2, .8, .2, 1);
}
.mini-flip:active { transform: scale(.97) rotateY(var(--mini-ry, 0deg)); }
.mini-flip.flipped { --mini-ry: 180deg; transform: rotateY(180deg); }
.mini-flip.flipped:active { transform: scale(.97) rotateY(180deg); }
.mini-face {
    position: absolute; inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex; flex-direction: column;
    border-radius: 16px;
    color: #fff;
    background: var(--card-grad), linear-gradient(150deg, #241014 0%, #12060a 48%, #08080e 100%);
    box-shadow: var(--card-glow), 0 4px 14px rgba(0, 0, 0, .4);
}
.mini-front { justify-content: space-between; padding: 12px 10px 11px 8px; }
.mini-back {
    transform: rotateY(180deg);
    align-items: center; justify-content: center;
    gap: 6px;
    padding: 10px;
}
.mini-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.mini-brand { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.mini-org { font-size: 6px; letter-spacing: .02em; opacity: .55; margin-top: 2px; line-height: 1.3; text-transform: uppercase; }
.mini-chip {
    width: 19px; height: 13px; border-radius: 3px;
    background: linear-gradient(135deg, #f5d78e, #b98b3a 60%, #f0d191);
    flex: none;
}
.mini-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.mini-num { font-size: 8.3px; letter-spacing: .02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-holder { font-size: 6.3px; opacity: .55; margin-top: 3px; text-transform: uppercase; letter-spacing: .03em; }
.mini-cur { font-size: 13px; font-weight: 600; opacity: .55; flex: none; }
.mini-qr {
    width: 74px; height: 74px;
    padding: 5px;
    background: #fff;
    border-radius: 8px;
    display: grid; place-items: center;
}
.mini-qr img, .mini-qr canvas { display: block; width: 64px; height: 64px; }
.mini-qr-hint { font-size: 10px; color: rgba(255, 255, 255, .65); text-align: center; }

.alert-block {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    margin: 22px 0 18px;
    padding: 13px 15px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    border-radius: var(--radius-card);
}
.alert-block svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.alert-block b { display: block; margin-bottom: 2px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    background: var(--surface);
    border: var(--card-border);
    border-radius: var(--radius-card);
}
.stat-ico {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: var(--radius-ico);
    flex: none;
}
.stat-ico svg { width: 17px; height: 17px; }
.stat-ico.in { background: color-mix(in srgb, var(--income) 18%, transparent); color: var(--income); }
.stat-ico.out { background: var(--accent-soft); color: var(--accent); }
.stat-label { font-size: 11.5px; color: var(--text-mute); }
.stat-value { font-size: 15px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 4px 10px; }
.link-btn {
    display: flex; align-items: center; gap: 2px;
    font-size: 13.5px; color: var(--accent);
}
.link-btn svg { width: 15px; height: 15px; }

/* ---------- Перевод ---------- */
.balance-hint {
    font-size: 13.5px;
    color: var(--text-dim);
    margin: 0 4px 8px;
}
.balance-hint b { color: var(--text); font-weight: 600; }

.favs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 4px 6px; scrollbar-width: none; }
.favs::-webkit-scrollbar { display: none; }
.fav {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    min-width: 62px;
    transition: transform var(--dur-fast) var(--ease);
}
.fav:active { transform: scale(.92); }
/* Аватар спокойный и одноцветный, без разноцветных кружков на каждого
   человека: банк, а не мессенджер. Подложка от поверхности, инициалы
   приглушённые, по краю волосяная линия. Цветными остаются только чужие
   банки, у них свой класс (например .pulse-avatar). */
.fav-avatar {
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border-radius: 50%;
    font-size: 17px; font-weight: 600; letter-spacing: .02em;
    color: var(--text-dim);
    flex: none;
    background: var(--surface-2);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent);
}
.fav-avatar.big { width: 62px; height: 62px; font-size: 25px; }
.fav-avatar svg { width: 20px; height: 20px; }
.fav-name {
    font-size: 11.5px; color: var(--text-dim);
    max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.preview {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px;
    margin: 0 0 6px;
    background: var(--surface);
    border: var(--card-border);
    border-radius: var(--radius-card);
}
.preview.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); font-size: 13.5px; }
.preview.bad svg { width: 19px; height: 19px; flex: none; }
/* Появление карточки — через JS (popIn в ui.js), не CSS @keyframes. */
.preview-name { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; }
.preview-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Небольшая отметка «свой человек» рядом с именем, вместо крупного зелёного
   значка сбоку: акцентная, в цвет банка, и не тянет на себя внимание. */
.preview-ok {
    flex: none;
    display: grid; place-items: center;
    width: 16px; height: 16px;
    border-radius: 50%;
    color: var(--accent-fg);
    background: var(--accent);
}
.preview-ok svg { width: 10px; height: 10px; stroke-width: 3.4; }
.preview-sub { font-size: 12.5px; color: var(--text-mute); margin-top: 3px; font-variant-numeric: tabular-nums; }
.tag {
    font-size: 11px; padding: 4px 9px; border-radius: 10px;
    background: var(--surface-2); color: var(--text-dim);
}
.tag.ok { background: color-mix(in srgb, var(--income) 18%, transparent); color: var(--income); display: grid; place-items: center; padding: 5px; }
.tag.ok svg { width: 14px; height: 14px; }
.tag.warn { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }

.amount-box {
    display: flex; align-items: baseline; gap: 8px;
    padding: 16px 18px;
    background: var(--surface);
    border: var(--card-border);
    border-radius: var(--radius-card);
}
.amount-input {
    flex: 1; min-width: 0;
    font-size: 34px; font-weight: 700;
    letter-spacing: -.02em;
    background: none;
    font-variant-numeric: tabular-nums;
}
.amount-input::placeholder { color: var(--text-mute); opacity: .5; }
.amount-cur { font-size: 24px; font-weight: 600; color: var(--text-mute); }
.amount-quick { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.amount-quick::-webkit-scrollbar { display: none; }
.amount-quick .chip { flex: none; }

/* ---------- Сегменты (запросы) ---------- */
.segmented {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 3px;
    background: var(--surface-2);
    border-radius: var(--radius-chip);
    margin-bottom: 16px;
}
.seg {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px;
    font-size: 13.5px; font-weight: 500;
    color: var(--text-dim);
    transition: color var(--dur-fast);
}
.seg.active { color: var(--text); font-weight: 600; }
.seg-thumb {
    position: absolute;
    top: 3px; left: 3px;
    width: calc((100% - 6px) / 3);
    height: 34px;
    background: var(--surface);
    border-radius: calc(var(--radius-chip) - 3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
    transition: transform var(--dur) var(--ease);
}
.seg-badge {
    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;
}

.req-list { display: flex; flex-direction: column; gap: 12px; }
.req-card {
    padding: 14px;
    background: var(--surface);
    border: var(--card-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}
/* Анимация появления карточки сделана через JS (popIn в ui.js, обычный
   transition + двойной requestAnimationFrame), не через CSS @keyframes —
   так время старта полностью под контролем и не зависит от того, что в
   этот момент делает анимация самого экрана. */
.req-head { display: flex; align-items: center; gap: 12px; }
.req-name { font-size: 15px; font-weight: 600; }
.req-sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.req-amount { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.req-comment {
    display: flex; gap: 8px; align-items: center;
    margin-top: 11px; padding: 9px 11px;
    font-size: 13px; color: var(--text-dim);
    background: var(--surface-2);
    border-radius: calc(var(--radius-card) - 8px);
}
.req-comment svg { width: 15px; height: 15px; flex: none; opacity: .6; }
.req-actions { display: flex; gap: 9px; margin-top: 13px; }
.req-actions .btn { height: 42px; font-size: 14.5px; }
.req-status {
    margin-top: 11px;
    font-size: 12.5px; font-weight: 500;
    color: var(--text-mute);
}
.req-status.ok { color: var(--income); }
.req-status.bad { color: var(--danger); }

/* ---------- История ---------- */
.search-wrap {
    position: relative;
    display: flex; align-items: center;
    margin-bottom: 12px;
}
.search-wrap svg {
    position: absolute; left: 13px;
    width: 17px; height: 17px;
    color: var(--text-mute);
}
.search-input {
    width: 100%; height: 42px;
    padding: 0 14px 0 38px;
    font-size: 15px;
    background: var(--surface-2);
    border-radius: var(--radius-input);
    color: var(--text);
}
.filters { display: flex; gap: 8px; margin-bottom: 14px; }
.hs-summary {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px; margin-bottom: 6px;
    padding: 13px;
    background: var(--surface);
    border: var(--card-border);
    border-radius: var(--radius-card);
}
.hs-sum-item { display: flex; flex-direction: column; gap: 3px; }
.hs-sum-item span { font-size: 11px; color: var(--text-mute); }
.hs-sum-item b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hs-sum-item b.in { color: var(--income); }

.detail-head { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 0 4px; }
.detail-amount { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.detail-amount.in { color: var(--income); }
.detail-name { font-size: 15px; color: var(--text-dim); }

/* ---------- Профиль ---------- */
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0 4px; }
.profile-avatar-wrap { position: relative; margin-bottom: 6px; }
/* Свой аватар остаётся цветным, но в цвет банка, а не случайный из палитры,
   чтобы не спорить с общим спокойным видом. Фото по-прежнему перекрывает фон. */
.profile-avatar {
    width: 78px; height: 78px;
    display: grid; place-items: center;
    border-radius: 50%;
    font-size: 27px; font-weight: 700; letter-spacing: -.01em;
    color: var(--accent-fg);
    background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 90%, #fff 10%), var(--accent));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent),
                0 10px 24px -12px color-mix(in srgb, var(--accent) 60%, transparent);
    background-size: cover; background-position: center;
}
.avatar-edit-btn {
    position: absolute; right: -2px; bottom: 4px;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text);
    box-shadow: 0 0 0 3px var(--bg), 0 2px 8px rgba(0, 0, 0, .35);
}
.avatar-edit-btn svg { width: 14px; height: 14px; }
.avatar-edit-btn:active { transform: scale(.92); }
.profile-name { font-size: 20px; font-weight: 700; }
.profile-login { font-size: 13.5px; color: var(--text-mute); }
.profile-badges { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 8px; }
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 11px;
    font-size: 11.5px; font-weight: 500;
    color: var(--text-dim);
    background: var(--surface-2);
    border-radius: 12px;
}
.badge svg { width: 13px; height: 13px; }
.badge.admin { background: color-mix(in srgb, #f39c12 20%, transparent); color: #f39c12; }
.badge.blocked { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }

/* Карточки выбора скина */
.skins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.skin-card {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 12px 8px 11px;
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: var(--radius-card);
    transition: border-color var(--dur-fast), transform var(--dur-fast) var(--ease);
}
.skin-card:active { transform: scale(.96); }
.skin-card.active { border-color: var(--accent); }
.skin-name { font-size: 13px; font-weight: 600; }
.skin-desc { font-size: 10px; color: var(--text-mute); text-align: center; line-height: 1.25; }
.skin-check {
    position: absolute; top: 7px; right: 7px;
    width: 18px; height: 18px;
    display: none; place-items: center;
    background: var(--accent); color: var(--accent-fg);
    border-radius: 50%;
}
.skin-check svg { width: 12px; height: 12px; }
.skin-card.active .skin-check { display: grid; }

/* Мини-превью каждого скина */
.skin-preview {
    position: relative;
    width: 100%; aspect-ratio: .62;
    margin-bottom: 6px;
    overflow: hidden;
    display: block;
}
.sp-bar, .sp-card, .sp-line, .sp-tabs { position: absolute; display: block; }
.sp-bar { top: 6%; left: 12%; right: 12%; height: 7%; }
.sp-card { top: 20%; left: 10%; right: 10%; height: 26%; }
.sp-line { left: 12%; right: 30%; height: 5%; top: 54%; }
.sp-line.short { top: 64%; right: 46%; }
.sp-tabs { bottom: 6%; left: 10%; right: 10%; height: 11%; }

.skin-preview-ios { background: #000; border-radius: 12px; }
.skin-preview-ios .sp-bar { background: rgba(255, 255, 255, .22); border-radius: 3px; }
.skin-preview-ios .sp-card { background: #1c1c1e; border-radius: 8px; }
.skin-preview-ios .sp-line { background: rgba(255, 255, 255, .18); border-radius: 3px; }
.skin-preview-ios .sp-tabs { background: rgba(255, 255, 255, .1); border-radius: 6px; }

.skin-preview-material { background: #131215; border-radius: 14px; }
.skin-preview-material .sp-bar { background: #ffb4a8; border-radius: 4px; opacity: .5; }
.skin-preview-material .sp-card { background: #211f23; border-radius: 14px; }
.skin-preview-material .sp-line { background: #4a2b25; border-radius: 4px; }
.skin-preview-material .sp-tabs { background: #1e1c20; border-radius: 14px; }

.skin-preview-hyperos { background: #000; border-radius: 15px; }
.skin-preview-hyperos .sp-bar { background: rgba(255, 255, 255, .3); border-radius: 5px; }
.skin-preview-hyperos .sp-card { background: linear-gradient(140deg, #ff4b3e, #7a1610); border-radius: 12px; }
.skin-preview-hyperos .sp-line { background: #212126; border-radius: 5px; }
.skin-preview-hyperos .sp-tabs { background: #17171a; border-radius: 12px; }

.theme-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme-btn {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 13px 4px;
    font-size: 11.5px;
    color: var(--text-dim);
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: var(--radius-card);
    transition: all var(--dur-fast);
}
.theme-btn:active { transform: scale(.95); }
.theme-btn.active { border-color: var(--accent); color: var(--text); }
.theme-dot {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(128, 128, 128, .35);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.footer-note {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-mute);
    margin: 22px 0 8px;
}
.pin-set { margin-top: 16px; }

/* ---------- Подсказки, QR ---------- */
.hint-card {
    display: flex; gap: 11px; align-items: flex-start;
    padding: 13px 15px;
    font-size: 13px; line-height: 1.45;
    color: var(--text-dim);
    background: var(--surface);
    border: var(--card-border);
    border-radius: var(--radius-card);
}
.hint-card svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--accent); }

.qr-card {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 24px 18px 20px;
    background: var(--surface);
    border: var(--card-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}
.qr-box {
    width: 196px; height: 196px;
    display: grid; place-items: center;
    padding: 10px;
    background: #fff;
    border-radius: 16px;
}
.qr-box img, .qr-box canvas { display: block; width: 176px; height: 176px; }
.qr-name { font-size: 17px; font-weight: 600; margin-top: 6px; }
.qr-acc { font-size: 14px; color: var(--text-dim); font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.qr-hint { font-size: 12px; color: var(--text-mute); text-align: center; margin-top: 4px; max-width: 240px; line-height: 1.4; }

/* ---------- Центр уведомлений ---------- */
.notif-feed { display: flex; flex-direction: column; gap: 9px; }
.notif-static { pointer-events: none; animation: none; }
.notif-static.notif { animation: staggerIn 380ms var(--ease) both; }

/* ---------- Галочка успеха ---------- */
.success-stage { position: relative; width: 62px; height: 62px; }
.success-mark {
    position: relative; z-index: 1;
    width: 62px; height: 62px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--income) 18%, transparent);
    color: var(--income);
    animation: markPop 520ms var(--ease) both;
}
.success-mark svg { width: 32px; height: 32px; stroke-width: 2.4; }
@keyframes markPop {
    0% { transform: scale(.3); opacity: 0; }
    60% { transform: scale(1.12); opacity: 1; }
    100% { transform: scale(1); }
}
.success-ring {
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 2px solid var(--income);
    animation: ringOut 780ms cubic-bezier(.2, .7, .3, 1) 80ms both;
}
@keyframes ringOut {
    0% { transform: scale(.7); opacity: .6; }
    100% { transform: scale(1.55); opacity: 0; }
}
.success-amount {
    font-size: 26px; font-weight: 700;
    animation: amountIn 420ms var(--ease) 160ms both;
}
@keyframes amountIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Момент успеха на весь экран ----------
   Кольцо и галочка рисуются штрихом через stroke-dashoffset: длина
   окружности при r=23 это примерно 145, длина ломаной галочки примерно 33.
   Дальше текст всплывает лесенкой, всё держится полторы секунды и уходит. */
.succ {
    position: fixed;
    inset: 0;
    z-index: 9600;
    display: grid;
    place-items: center;
    padding: 0 32px;
    text-align: center;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: succIn 220ms var(--ease) both;
}
.succ.out { animation: succOut 240ms var(--ease) both; }
@keyframes succIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes succOut { to { opacity: 0; transform: scale(1.02); } }

.succ-body { display: flex; flex-direction: column; align-items: center; gap: 9px; }

.succ-mark {
    width: 92px; height: 92px;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 20px color-mix(in srgb, var(--income) 45%, transparent));
}
.succ-ring {
    fill: none;
    stroke: var(--income);
    stroke-width: 2.4;
    stroke-dasharray: 145;
    stroke-dashoffset: 145;
    transform-origin: center;
    transform: rotate(-90deg);
    animation: succDraw 820ms var(--ease) 120ms forwards;
}
.succ-check {
    fill: none;
    stroke: var(--income);
    stroke-width: 3.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: succDrawCheck 470ms var(--ease) 780ms forwards;
}
@keyframes succDraw { to { stroke-dashoffset: 0; } }
@keyframes succDrawCheck { to { stroke-dashoffset: 0; } }

.succ-amount {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    animation: succRise 480ms var(--ease) 980ms both;
}
.succ-title { font-size: 16px; font-weight: 600; animation: succRise 480ms var(--ease) 1090ms both; }
.succ-text { font-size: 13.5px; color: var(--text-dim); line-height: 1.4; animation: succRise 480ms var(--ease) 1190ms both; }
@keyframes succRise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Потянуть, чтобы обновить ---------- */
.ptr {
    position: absolute;
    top: calc(var(--safe-top) + var(--nav-h) - 26px);
    left: 50%;
    margin-left: -16px;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    background: var(--surface-2);
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
    opacity: 0;
    pointer-events: none;
    z-index: 3;
}
.ptr-ring {
    width: 16px; height: 16px;
    border: 2.2px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
}
.ptr.spin .ptr-ring { animation: ptrSpin 700ms linear infinite; }
@keyframes ptrSpin { to { transform: rotate(360deg); } }

/* ---------- Приветствие после входа ---------- */
.greeting {
    position: fixed;
    inset: 0;
    z-index: 950;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: var(--bg);
    background-image: var(--bg-image);
    animation: greetIn 460ms var(--ease) both;
}
.greeting.out { animation: greetOut 520ms var(--ease) forwards; }
.greeting-logo {
    width: 84px; height: 84px;
    background: url('../assets/logo-tile.png') center / cover no-repeat;
    border-radius: var(--radius-logo);
    box-shadow: 0 18px 46px -14px var(--accent);
    animation: greetPop 620ms var(--ease) both;
}
.greeting-text {
    font-size: 21px; font-weight: 700;
    letter-spacing: -.01em;
    animation: staggerIn 520ms 140ms var(--ease) both;
}
@keyframes greetIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes greetOut { to { opacity: 0; transform: scale(1.05); } }
@keyframes greetPop { from { opacity: 0; transform: scale(.75); } to { opacity: 1; transform: none; } }

/* ---------- Плавная смена скина ---------- */
.skin-switching, .skin-switching * {
    transition: background-color 320ms ease, color 320ms ease, border-color 320ms ease !important;
}
