/* ---------- Fonts (self-hosted, без внешнего CDN) ---------- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/InterVariable.woff2') format('woff2');
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/JetBrainsMono-Regular.woff2') format('woff2');
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/JetBrainsMono-SemiBold.woff2') format('woff2');
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/JetBrainsMono-Bold.woff2') format('woff2');
}

:root {
    /* Поверхности (точно из прототипа) */
    --bg: #0a0d14;
    --bg-2: #0d111a;
    --surface: #141822;
    --surface-2: #1b2130;
    --surface-hover: #1b2130;
    --line: rgba(255, 255, 255, 0.06);
    --line-strong: rgba(255, 255, 255, 0.12);
    /* Текст */
    --text: #f4f6fa;
    --text-2: rgba(244, 246, 250, 0.5);
    --text-3: rgba(244, 246, 250, 0.35);
    --text-4: rgba(244, 246, 250, 0.3);
    /* Акценты */
    --blue: #3b82f6;
    --blue-2: #2563eb;
    --blue-lite: #7cacff;
    --blue-dim: rgba(59, 130, 246, 0.14);
    --green: #34d399;
    --green-dim: rgba(52, 211, 153, 0.14);
    --amber: #f5a623;
    --amber-dim: rgba(245, 166, 35, 0.14);
    --red: #f87171;
    --red-2: #ef4444;
    --red-dim: rgba(248, 113, 113, 0.14);
    --tg: #2aabee;
    --tg-2: #229ed9;
    /* Геометрия */
    --radius: 18px;
    --radius-sm: 12px;
    --radius-md: 14px;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-pop: 0 4px 14px rgba(37, 99, 235, 0.35);
    --shadow-pop-hover: 0 6px 20px rgba(37, 99, 235, 0.5);
    --sidebar-w: 232px;
    --content-max: 640px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --tnum: "tnum" 1, "lnum" 1;
}

/* ---------- Keyframes (из прототипа) ---------- */
@keyframes gt-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.35; }
    100% { opacity: 1; }
}

@keyframes gt-ring {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.35); }
    70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

@keyframes gt-confetti {
    0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
    100% { opacity: 0; transform: translate(var(--tx, 20px), var(--ty, -40px)) scale(0.4) rotate(200deg); }
}

@keyframes gt-banner-in {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(37, 99, 235, 0.10), transparent 60%),
        var(--bg);
    min-height: 100dvh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.tnum {
    font-variant-numeric: tabular-nums;
    font-feature-settings: var(--tnum);
}

.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: var(--tnum);
}

/* ---------- App shell ---------- */
.app {
    min-height: 100dvh;
}

.app--center {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.sidebar {
    display: none;
}

.sidebar-expand {
    display: none;
}

/* ---------- Icon buttons ---------- */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.icon-btn:active {
    transform: scale(0.9);
}

.icon-btn--sm {
    width: 22px;
    height: 22px;
    color: var(--text-3);
}

.icon-btn--sm:hover {
    background: transparent;
    opacity: 0.6;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

/* ---------- Nav dots (badges) ---------- */
.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-left: auto;
}

.nav-dot--blue {
    background: var(--blue);
}

.nav-dot--green {
    background: var(--green);
    animation: gt-pulse 1.4s infinite;
}

/* ---------- Balance hidden state (звёздочки вместо блюра — заменяет JS) ---------- */
.is-balance-hidden .balance-val {
    user-select: none;
    letter-spacing: 1px;
}

/* ---------- Auth shell (login / onboarding / register) ---------- */
.auth-body {
    min-height: 100dvh;
}

.auth-shell {
    min-height: 100dvh;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
}

/* ---------- Confetti pieces ---------- */
.gt-celebrate {
    position: relative;
}

.gt-confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    pointer-events: none;
    animation: gt-confetti 1s ease-out forwards;
    z-index: 5;
}

.main {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px 10px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px);
}

.topbar__side {
    display: flex;
    align-items: center;
    min-width: 32px;
}

.topbar__side--end {
    justify-content: flex-end;
}

.topbar__title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.topbar__title--desktop {
    display: none;
}

.topbar-link {
    color: var(--text-2);
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 10px;
    transition: background 0.18s ease, color 0.18s ease;
}

.topbar-link:hover {
    background: var(--surface);
    color: var(--text);
}

.brand {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 0.2px;
    background: linear-gradient(90deg, #fff, #c9d6ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand--big {
    font-size: 34px;
    text-align: center;
    margin-bottom: 8px;
}

.content {
    flex: 1;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Плотный вертикальный список внутри секции (история, реквизиты, строки) */
.stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.muted-label {
    color: var(--text-2);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 600;
}

/* ---------- Balance card ---------- */
.balance-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    padding: 22px 20px;
    margin: 10px 0 20px;
    background:
        radial-gradient(400px 160px at 88% -20%, rgba(59, 130, 246, 0.22), transparent 70%),
        linear-gradient(165deg, #182238, #10151f);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-card);
}

.balance-card__head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.balance-card__amount {
    font-size: clamp(40px, 12vw, 52px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.balance-card__amount span {
    font-size: 0.42em;
    color: var(--text-2);
    font-weight: 600;
    margin-left: 4px;
}

.balance-card__equiv {
    color: var(--text-2);
    margin-top: 10px;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.pill {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 11px;
    border-radius: 999px;
}

.pill--up {
    color: var(--green);
    background: var(--green-dim);
}

/* ---------- Action tiles ---------- */
.actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 22px;
}

.action,
.feed-item,
.balance-card {
    min-width: 0;
}

.actions--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.action:hover {
    transform: translateY(-2px);
    background: var(--surface-hover);
    border-color: var(--line-strong);
}

.action--tile {
    align-items: flex-start;
    text-align: left;
    padding: 18px;
    gap: 12px;
    min-height: 128px;
    justify-content: space-between;
}

.action--tile small {
    color: var(--text-2);
    font-size: 12px;
    font-weight: 400;
}

.action__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, 0.14);
    border-radius: 12px;
    color: var(--blue);
}

.action__icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action--primary {
    background: linear-gradient(135deg, var(--blue), var(--blue-2));
    border: none;
    color: #fff;
    box-shadow: var(--shadow-pop);
}

.action--primary:hover {
    background: linear-gradient(135deg, #4c8dff, var(--blue-2));
}

.action--primary .action__icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ---------- Sections & feed ---------- */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 22px 2px 12px;
}

.section-head h2 {
    font-size: 18px;
    margin: 0;
    font-weight: 700;
}

.section-head__link {
    color: var(--blue);
    font-size: 14px;
    font-weight: 500;
}

.feed {
    display: grid;
    gap: 10px;
}

.feed-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

a.feed-item:hover {
    transform: translateY(-2px);
    background: var(--surface-hover);
    border-color: var(--line-strong);
}

.feed-item__rate {
    color: var(--green);
    font-weight: 700;
    font-size: 18px;
    margin-right: 8px;
    font-variant-numeric: tabular-nums;
}

.feed-item__amount {
    color: var(--text-2);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.feed-item__title {
    font-weight: 600;
}

.feed-item__meta {
    color: var(--text-2);
    font-size: 13px;
    margin-top: 4px;
}

.feed-item__value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.feed-item__value.pos {
    color: var(--green);
}

.feed-item__value.neg {
    color: var(--red);
}

.empty {
    color: var(--text-2);
    text-align: center;
    padding: 40px 0;
    border: 1px dashed var(--line);
    border-radius: 16px;
}

.status {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 11px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-2);
    white-space: nowrap;
}

.status--completed {
    color: var(--green);
    background: var(--green-dim);
}

.status--disputed,
.status--expired {
    color: var(--red);
    background: var(--red-dim);
}

/* ---------- Bottom tabbar (mobile) ---------- */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
}

.tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    color: var(--text-3);
    font-size: 11px;
    font-weight: 500;
    transition: color 0.16s ease;
}

/* Бейдж-точка над иконкой (слева-сверху), а не в углу таба */
.tab .nav-dot {
    position: absolute;
    top: 2px;
    left: calc(50% - 15px);
    margin: 0;
}

.tab svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tab.is-active {
    color: var(--blue);
}

/* ---------- Detail / kv / toggle ---------- */
.kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 10px;
}

.kv span:last-child {
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: right;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
}

.switch {
    border: none;
    border-radius: 999px;
    padding: 9px 18px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: filter 0.16s ease;
}

.switch:hover {
    filter: brightness(1.1);
}

.switch--on {
    background: var(--green-dim);
    color: var(--green);
}

.switch--off {
    background: var(--surface-2);
    color: var(--text-2);
}

.detail-amount {
    font-size: 34px;
    font-weight: 800;
    margin: 6px 0 2px;
    font-variant-numeric: tabular-nums;
}

.back-link {
    display: inline-block;
    color: var(--text-2);
    font-size: 14px;
    margin-bottom: 8px;
    padding: 6px 0;
}

.back-link:hover {
    color: var(--text);
}

/* ---------- Buttons / inputs ---------- */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.btn {
    display: block;
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: transform 0.14s ease, filter 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.btn:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.6);
    outline-offset: 2px;
}

.btn--primary {
    background: linear-gradient(135deg, var(--blue), var(--blue-2));
    color: #fff;
    box-shadow: var(--shadow-pop);
}

/* Кнопка недоступна, пока не выполнено условие (напр. «Я перевёл» без прикреплённого чека) —
   серая, без тени, курсор запрета. */
.btn:disabled,
.btn--primary:disabled {
    background: var(--surface);
    color: var(--text-2);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.75;
}

.btn--ghost {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
}

.input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    padding: 15px;
    color: var(--text);
    font-size: 16px;
    margin: 14px 0 12px;
    transition: border-color 0.16s ease;
}

.input:focus {
    outline: none;
    border-color: var(--blue);
}

.login {
    width: min(360px, 100%);
}

/* ---------- Auth / onboarding ---------- */
.auth-flex {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 10px 0;
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
}

.auth-sub {
    margin-top: 6px;
    font-size: 13.5px;
    color: var(--text-2);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.field-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.field-box {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text);
    font-size: 15px;
    transition: border-color 0.15s ease;
}

.field-box:focus {
    outline: none;
    border-color: var(--blue);
}

input.field-box::placeholder {
    color: var(--text-3);
}

.divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-3);
    font-size: 12px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line-strong);
}

.btn--tg {
    background: linear-gradient(135deg, var(--tg), var(--tg-2));
    color: #fff;
    box-shadow: 0 4px 14px rgba(34, 158, 217, 0.35);
}

.btn--surface {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-card);
}

.legal {
    font-size: 11.5px;
    color: var(--text-3);
    line-height: 1.5;
}

/* Onboarding */
.ob-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0 2px;
}

.ob-dots {
    display: flex;
    gap: 6px;
}

.ob-dot {
    width: 22px;
    height: 4px;
    border-radius: 2px;
    background: var(--line-strong);
    transition: background 0.2s ease;
}

.ob-dot.is-active {
    background: var(--blue);
}

.ob-skip {
    font-size: 13px;
    color: var(--text-2);
}

.ob-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 24px 0;
}

.ob-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: grid;
    place-items: center;
}

.ob-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ob-icon--blue {
    background: linear-gradient(135deg, var(--blue), var(--blue-2));
    color: #fff;
}

.ob-icon--blue-soft {
    background: var(--blue-dim);
    color: var(--blue-lite);
}

.ob-icon--green {
    background: var(--green-dim);
    color: var(--green);
}

.ob-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.25;
}

.ob-text {
    font-size: 14.5px;
    color: var(--text-2);
    line-height: 1.55;
}

.ob-nav {
    display: flex;
    gap: 10px;
    padding-bottom: 6px;
}

.ob-nav .btn {
    width: auto;
}

/* ---------- Home: header ---------- */
.home-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0 2px;
}

.home-id {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue), var(--blue-2));
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    flex: none;
}

.home-role {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Безымянная обёртка имени внутри .home-id: без min-width:0 nowrap-имя задаёт ей min-content ширину
   и вся шапка растягивается за экран (эллипсис на .home-name не срабатывает без сжатия предков). */
.home-id > div {
    min-width: 0;
}

.home-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.home-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    /* Длинное имя/email не должно выталкивать иконки шапки за экран — сжимаем и режем эллипсисом. */
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    white-space: nowrap;
}

.badge--level {
    background: var(--blue-dim);
    color: var(--blue-lite);
}

.badge--trust {
    background: var(--green-dim);
    color: var(--green);
}

.home-actions {
    display: flex;
    gap: 10px;
    flex: none;
}

.icon-btn--lg {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface);
    position: relative;
}

.icon-btn--lg:hover {
    background: var(--surface-2);
}

.icon-btn--lg svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.8;
}

.icon-btn__dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
}

/* ---------- Balance card (flat, прототип) ---------- */
.bcard {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
}

.bcard__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.bcard__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--text-3);
}

.bcard__amount {
    margin-top: 10px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--font-mono);
}

.bcard__amount b {
    font-size: 38px;
    font-weight: 700;
    color: var(--text);
}

.bcard__amount span {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-3);
}

.bcard__rub {
    margin-top: 4px;
    font-size: 14px;
    color: var(--text-2);
    font-family: var(--font-mono);
}

/* ---------- Quick actions ---------- */
.quick {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.quick__item {
    background: var(--surface);
    border-radius: 14px;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-card);
    color: var(--text);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
    position: relative;
}

.quick__item:hover {
    background: var(--surface-2);
    transform: translateY(-2px);
}

.quick__item:active {
    transform: translateY(0) scale(0.95);
}

.quick__icon {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--blue-lite);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.quick__label {
    font-size: 10.5px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.quick__item--primary {
    background: linear-gradient(135deg, var(--blue), var(--blue-2));
    box-shadow: var(--shadow-pop);
}

.quick__item--primary .quick__icon {
    stroke: #fff;
}

.quick__item--primary .quick__label {
    color: #fff;
}

.quick__item--soon {
    cursor: default;
    opacity: 0.65;
}

.quick__item--soon:hover {
    transform: none;
    background: var(--surface);
}

.quick__soon {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 8px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ---------- Active deal cards ---------- */
.deal-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-card);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.deal-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.deal-card--out {
    border-color: rgba(59, 130, 246, 0.3);
}

.deal-card--in {
    border-color: rgba(245, 166, 35, 0.35);
}

.deal-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex: none;
}

.deal-card__icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.deal-card__icon--out {
    background: var(--blue-dim);
    color: var(--blue-lite);
}

.deal-card__icon--in {
    background: var(--amber-dim);
    color: var(--amber);
    animation: gt-pulse 1.4s infinite;
}

.deal-card__body {
    flex: 1;
    min-width: 0;
}

.deal-card__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.tag {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
}

.tag--blue {
    color: var(--blue-lite);
    background: var(--blue-dim);
}

.deal-card__meta {
    font-size: 12.5px;
    color: var(--text-2);
    font-family: var(--font-mono);
    margin-top: 2px;
}

.deal-card__meta .clock {
    color: var(--amber);
}

.deal-card__meta .clock.is-urgent {
    color: var(--red);
}

.progress {
    margin-top: 8px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress__bar {
    height: 100%;
    background: var(--amber);
    border-radius: 2px;
    transition: width 1s linear;
}

.deal-card__profit {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--green);
    font-size: 15px;
    flex: none;
}

.deal-card__chevron {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--text-3);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

/* ---------- Sort chips ---------- */
.row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.row-head__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.row-head__link {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-lite);
}

.sorts {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.sorts::-webkit-scrollbar {
    display: none;
}

.sort {
    flex: none;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 9px;
    background: var(--surface);
    color: var(--text-2);
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.sort:hover {
    color: var(--text);
}

.sort.is-active {
    background: var(--blue-dim);
    color: var(--blue-lite);
}

/* ---------- Pool filters ---------- */
.pool-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.pool-filters__input {
    flex: 1 1 120px;
    min-width: 0;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 9px;
    border: 1px solid var(--surface);
    background: var(--surface);
    color: var(--text);
}

.pool-filters__btn {
    flex: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 9px;
    border: none;
    background: var(--blue-dim);
    color: var(--blue-lite);
    cursor: pointer;
}

.pool-more {
    width: 100%;
    grid-column: 1 / -1;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 10px;
    border-radius: 9px;
    border: none;
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
}

.pool-more:hover {
    color: var(--text);
}

/* ---------- Deal list (feed) ---------- */
.list {
    display: grid;
    gap: 8px;
}

.deal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--surface);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: var(--shadow-card);
    transition: transform 0.15s ease, background 0.15s ease;
}

a.deal:hover {
    background: var(--surface-2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.deal__main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.deal__pct {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--green);
    font-size: 15px;
}

.deal__amount {
    font-family: var(--font-mono);
    color: var(--text);
    font-size: 14px;
}

.deal__meta {
    font-size: 12px;
    color: var(--text-3);
}

.deal__right {
    text-align: right;
    flex: none;
}

.deal__profit {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--green);
    font-size: 14px;
}

.deal__profit-label {
    font-size: 10px;
    color: var(--text-3);
}

.deal--take {
    cursor: default;
}

.deal__take {
    flex: none;
    border: none;
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--blue-2));
    box-shadow: var(--shadow-pop);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.deal__take:hover {
    box-shadow: var(--shadow-pop-hover);
    transform: translateY(-1px);
}

.deal__take:active {
    transform: scale(0.96);
}

/* Заявка видна, но взять нельзя без реквизита — ведём на добавление реквизита */
.deal--locked {
    text-decoration: none;
    color: inherit;
}

.deal__take--locked {
    background: var(--surface-2, #eceff3);
    color: var(--text-2, #667);
    box-shadow: none;
    white-space: nowrap;
}

.empty-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 26px 18px;
    text-align: center;
}

.empty-card__text {
    font-size: 13.5px;
    color: var(--text-2);
    line-height: 1.5;
}

.empty-card__btn {
    margin-top: 12px;
    display: inline-block;
    background: var(--blue-dim);
    color: var(--blue-lite);
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 9px;
    cursor: pointer;
}

/* ---------- Exchange (Биржа) ---------- */
.page-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 0 2px;
}

.page-title__text {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.live {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--green-dim);
    color: var(--green);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 7px;
}

.live__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: gt-pulse 1.6s infinite;
}

.spread-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 18px;
}

.spread-card__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-3);
    margin-bottom: 12px;
}

.spread-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 0;
    gap: 12px;
}

.spread-row__name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-2);
}

.spread-row__name--in {
    color: var(--green);
}

.spread-row__vals {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.spread-row__vals--in {
    color: var(--green);
}

.hr {
    height: 1px;
    background: var(--line);
    margin: 8px 0;
}

.best-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border-left: 3px solid var(--green);
    border-radius: 14px;
    padding: 14px 16px;
}

.best-banner__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--green-dim);
    color: var(--green);
    display: grid;
    place-items: center;
    flex: none;
}

.best-banner__icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.best-banner__title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
}

.best-banner__sub {
    font-size: 12px;
    color: var(--text-3);
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-top: 2px;
}

.tariff {
    background: var(--surface);
    border-radius: 16px;
    padding: 16px 0;
}

.tariff--in {
    border: 1px solid rgba(52, 211, 153, 0.18);
}

.tariff__title {
    padding: 0 18px 2px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-2);
}

.tariff__title--in {
    color: var(--green);
}

.tariff__sub {
    padding: 0 18px 10px;
    font-size: 11px;
    color: var(--text-3);
}

.tariff__row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr);
    gap: 8px;
    align-items: center;
    padding: 11px 18px;
}

.tariff__row--head {
    padding: 8px 18px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text-4);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.tariff__row--t1 {
    background: rgba(248, 113, 113, 0.07);
}

.tariff__row--t2 {
    background: rgba(245, 166, 35, 0.07);
}

.tariff__cell-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}

.tariff__cell-pct {
    font-family: var(--font-mono);
    font-weight: 700;
    text-align: right;
}

.tariff__cell-pct--t1 {
    color: var(--red);
}

.tariff__cell-pct--t2 {
    color: var(--amber);
}

.tariff__cell-pct--t3 {
    color: var(--blue-lite);
}

.tariff__cell-rate {
    font-family: var(--font-mono);
    color: var(--text);
    font-weight: 700;
    text-align: right;
}

.text-right {
    text-align: right;
}

/* ---------- Deals: tabs ---------- */
.tabs {
    display: flex;
    gap: 6px;
    background: var(--surface);
    padding: 4px;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    transition: background 0.15s ease, color 0.15s ease;
}

.tab-btn.is-active {
    background: var(--surface-2);
    color: var(--text);
}

/* Active deal cards (reuse deal-card) — dispute link */
.deal-card__dispute {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(248, 113, 113, 0.85);
}

/* Closed deal rows */
.closed-group__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text-3);
    margin: 0 2px 8px;
    text-transform: uppercase;
}

.closed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--surface);
    border-radius: 12px;
    padding: 13px 16px;
}

.closed-row__title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}

.closed-row__meta {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

.closed-row__right {
    text-align: right;
    flex: none;
}

.closed-row__profit {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13.5px;
}

.stat-plate {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.stat-plate__item {
    background: var(--surface);
    border-radius: 12px;
    padding: 14px 16px;
}

.stat-plate__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text-3);
}

.stat-plate__value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    margin-top: 4px;
}

/* ---------- Deal detail ---------- */
.detail-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
}

.detail-card--live {
    border-color: rgba(245, 166, 35, 0.35);
}

.detail-card__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-3);
}

.detail-card__amount {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    margin-top: 6px;
}

.detail-card__profit {
    font-size: 13px;
    color: var(--green);
    font-weight: 700;
    margin-top: 4px;
}

.copy-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    margin-top: 12px;
}

.copy-box__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text-3);
    margin-bottom: 6px;
}

.copy-box__value {
    font-family: var(--font-mono);
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
    /* Длинные неразрывные значения (номер реквизита, uid, хэш) обязаны переноситься, а не обрезаться
       под body{overflow-x:hidden} на узких экранах — иначе трейдер не увидит часть номера для перевода. */
    overflow-wrap: anywhere;
}

.copy-box__value[data-copy] {
    cursor: pointer;
    user-select: all;
}

.copy-box__sub {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 4px;
}

.note {
    font-size: 12.5px;
    color: var(--text-2);
    line-height: 1.5;
    padding: 4px 2px;
}

.note--warn {
    color: rgba(248, 113, 113, 0.85);
}

.dispute-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}

.file-input {
    width: 100%;
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    padding: 14px;
    color: var(--text-2);
    font-size: 14px;
}

.collect-details summary {
    list-style: none;
    cursor: pointer;
}

.collect-details summary::-webkit-details-marker {
    display: none;
}

/* ---------- Deal confirm / success ---------- */
.success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 24px 0 8px;
}

.success__badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--green-dim);
    color: var(--green);
    display: grid;
    place-items: center;
    animation: gt-ring 1.6s ease-out;
}

.success__badge svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.success__title {
    font-size: 22px;
    font-weight: 800;
}

.success__sub {
    font-size: 14px;
    color: var(--green);
    font-weight: 700;
    font-family: var(--font-mono);
}

.summary {
    width: 100%;
    background: var(--surface);
    border-radius: 16px;
    padding: 4px 0;
    margin-top: 6px;
}

.summary__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    font-size: 13.5px;
}

.summary__row + .summary__row {
    border-top: 1px solid var(--line);
}

.summary__row span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: right;
}

.summary__row span:first-child {
    color: var(--text-2);
}

.summary__row span:last-child {
    font-family: var(--font-mono);
    font-weight: 700;
}

/* ---------- In Tips (советы по продаже) ---------- */
.tip {
    display: flex;
    gap: 12px;
    background: var(--surface);
    border-radius: 16px;
    padding: 16px;
}

.tip__icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex: none;
}

.tip__icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tip__icon--green {
    background: var(--green-dim);
    color: var(--green);
}

.tip__icon--amber {
    background: var(--amber-dim);
    color: var(--amber);
}

.tip__icon--blue {
    background: var(--blue-dim);
    color: var(--blue-lite);
}

.tip__title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
}

.tip__text {
    font-size: 12.5px;
    color: var(--text-2);
    line-height: 1.5;
    margin-top: 4px;
}

/* ---------- Incoming progress (htmx polling) ---------- */
.income-progress {
    margin-top: 8px;
}

.income-progress__label {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    font-family: var(--font-mono);
    color: var(--text-2);
    margin-bottom: 6px;
}

.income-progress__bar {
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.income-progress__fill {
    height: 100%;
    background: var(--amber);
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* ---------- Wallet ---------- */
.work-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
}

.work-row__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.work-row__sub {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 2px;
}

.work-row__sub--on {
    color: var(--green);
}

.switch2 {
    width: 46px;
    height: 27px;
    border-radius: 999px;
    border: none;
    background: var(--surface-2);
    position: relative;
    cursor: pointer;
    flex: none;
    transition: background 0.18s ease;
}

.switch2::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.18s ease;
}

.switch2.is-on {
    background: var(--green);
}

.switch2.is-on::after {
    transform: translateX(19px);
}

.wallet-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.wtile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border-radius: 14px;
    padding: 14px;
    box-shadow: var(--shadow-card);
    color: var(--text);
    transition: transform 0.15s ease, background 0.15s ease;
}

.wtile:hover {
    background: var(--surface-2);
    transform: translateY(-2px);
}

.wtile--soon {
    opacity: 0.65;
    cursor: default;
}

.wtile--soon:hover {
    transform: none;
    background: var(--surface);
}

/* «Дыхание» — плитка советов всегда чуть подсвечена амбер-ореолом и мягко пульсирует, чтобы притянуть
   взгляд. Анимируем только свечение (не transform), чтобы не конфликтовать с hover-подъёмом плитки. */
.wtile--breathe {
    animation: gt-breathe 3s ease-in-out infinite;
}

@keyframes gt-breathe {
    0%, 100% { box-shadow: var(--shadow-card), 0 0 0 1px rgba(245, 166, 35, 0.12); }
    50% { box-shadow: var(--shadow-card), 0 0 16px 2px rgba(245, 166, 35, 0.32); }
}

@media (prefers-reduced-motion: reduce) {
    /* Без анимации оставляем постоянную лёгкую подсветку — плитка всё равно выделяется. */
    .wtile--breathe {
        animation: none;
        box-shadow: var(--shadow-card), 0 0 0 1px rgba(245, 166, 35, 0.18);
    }
}

.wtile__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: none;
    background: var(--blue-dim);
    color: var(--blue-lite);
}

.wtile__icon--amber {
    background: var(--amber-dim);
    color: var(--amber);
}

.wtile__icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wtile__title {
    font-size: 13px;
    font-weight: 700;
}

.wtile__sub {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 1px;
}

.hist {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border-radius: 12px;
    padding: 13px 16px;
}

.hist__icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    flex: none;
}

.hist__icon svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hist__title {
    font-size: 13.5px;
    font-weight: 600;
}

.hist__when {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

.hist__amount {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13.5px;
    margin-left: auto;
}

/* ---------- Profile ---------- */
.pcard {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
}

.pcard .avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 18px;
}

.pcard__name {
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    overflow-wrap: anywhere;
}

.pcard__sub {
    font-size: 12.5px;
    color: var(--text-3);
    margin: 2px 0 8px;
}

.pcard__badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.stats3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stat3 {
    background: var(--surface);
    border-radius: 14px;
    padding: 16px 12px;
    text-align: center;
}

.stat3__value {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.stat3__label {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 4px;
}

.settings {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
}

.set-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease;
}

.set-row + .set-row {
    border-top: 1px solid var(--line);
}

a.set-row:hover {
    background: var(--surface-2);
}

.set-row__icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    flex: none;
    color: var(--text-2);
}

.set-row__icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.set-row__chevron {
    margin-left: auto;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--text-3);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.set-row__tag {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-3);
}

.set-row--danger {
    color: var(--red);
}

/* Кнопка выхода внутри set-row (logout — POST-форма, не ссылка) */
.set-row__logout {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-align: left;
    flex: 1;
}

/* Requisites */
.req-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border-radius: 14px;
    padding: 14px 16px;
}

.req-item__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--blue-dim);
    color: var(--blue-lite);
    display: grid;
    place-items: center;
    flex: none;
}

.req-item__icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.req-item__bank {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.req-item__holder {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}

.req-item__default {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    color: var(--green);
    background: var(--green-dim);
    padding: 3px 8px;
    border-radius: 6px;
}

.req-static {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    padding: 2px;
}

.check-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--blue);
    flex: none;
    cursor: pointer;
}

/* ---------- Modal (CSS checkbox hack) ---------- */
.modal-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 7, 12, 0.72);
}

.modal-toggle:checked + .modal {
    display: flex;
}

.modal__box {
    background: var(--surface);
    border-radius: 18px;
    padding: 22px;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    animation: gt-banner-in 0.2s ease;
}

.modal__title {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text);
}

.modal__desc {
    margin-top: 8px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-2);
}

.modal__row {
    margin-top: 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12.5px;
}

.modal__row span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text);
}

.modal__actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
}

.modal__btn {
    flex: 1;
    text-align: center;
    padding: 13px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

.modal__btn--cancel {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.modal__btn--danger {
    background: linear-gradient(135deg, var(--red), var(--red-2));
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.modal__btn--primary {
    background: linear-gradient(135deg, var(--blue), var(--blue-2));
    color: #fff;
    box-shadow: var(--shadow-pop);
}

/* ---------- Support ---------- */
.support-context {
    display: inline-flex;
    align-self: center;
    gap: 6px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12px;
    font-family: var(--font-mono);
    padding: 6px 12px;
    border-radius: 8px;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.chat {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
}

.bubble {
    max-width: 82%;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.bubble--support {
    align-self: flex-start;
    background: var(--surface);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.bubble--user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--blue), var(--blue-2));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bubble__time {
    display: block;
    margin-top: 4px;
    font-size: 10.5px;
    opacity: 0.6;
    text-align: right;
}

.thread-history__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-top: 8px;
    background: var(--surface);
    border-radius: 12px;
    color: var(--text);
    font-size: 13px;
    text-decoration: none;
    min-width: 0;
    overflow-wrap: anywhere;
}

.thread-history__status {
    opacity: 0.6;
    font-size: 11px;
    flex: none;
}

/* ---------- FAQ (аккордеон на нативных <details>) ---------- */
.faq {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.faq__item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.faq__q {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    overflow-wrap: anywhere;
}

.faq__q::-webkit-details-marker {
    display: none;
}

.faq__q::after {
    content: '+';
    color: var(--text-3);
    font-size: 18px;
    line-height: 1;
    flex: none;
}

.faq__item[open] .faq__q::after {
    content: '−';
}

.faq__a {
    padding: 0 16px 14px;
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.quick-q__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text-3);
    margin: 14px 2px 8px;
}

.quick-q {
    display: block;
    background: var(--surface);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 13.5px;
    color: var(--text);
    margin-bottom: 8px;
    transition: background 0.15s ease;
}

.quick-q:hover {
    background: var(--surface-2);
}

button.quick-q {
    width: 100%;
    border: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

/* Композер чата */
.composer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.composer__input {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 16px;
    color: var(--text);
    font-size: 14px;
}

.composer__input:focus {
    outline: none;
    border-color: var(--blue);
}

.composer__input::placeholder {
    color: var(--text-3);
}

.composer__send {
    flex: none;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue), var(--blue-2));
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-pop);
    transition: transform 0.12s ease;
}

.composer__send:active {
    transform: scale(0.94);
}

.composer__send svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Notifications feed ---------- */
.notif {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--surface);
    border-radius: 12px;
    padding: 13px 16px;
}

.notif.is-new {
    background: rgba(59, 130, 246, 0.08);
    box-shadow: inset 3px 0 0 var(--blue);
}

.notif__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex: none;
    background: var(--text-3);
}

.notif__dot--deal_status,
.notif__dot--promo {
    background: var(--blue-lite);
}

.notif__dot--support {
    background: var(--green);
}

.notif__dot--dispute {
    background: var(--red);
}

.notif__dot--freeze {
    background: var(--amber);
}

.notif__body {
    flex: 1;
    min-width: 0;
}

.notif__text {
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.45;
}

.notif__time {
    font-size: 11.5px;
    color: var(--text-3);
    margin-top: 3px;
}

.notif__new {
    flex: none;
    font-size: 10px;
    font-weight: 700;
    color: var(--blue-lite);
    background: var(--blue-dim);
    padding: 3px 8px;
    border-radius: 6px;
}

/* ---------- Desktop: sidebar layout ---------- */
@media (min-width: 1024px) {
    .app:not(.app--center) {
        display: flex;
        align-items: stretch;
    }

    .app .main {
        flex: 1;
        min-width: 0;
    }

    .sidebar {
        position: sticky;
        top: 0;
        height: 100dvh;
        width: var(--sidebar-w);
        flex: none;
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 22px 14px;
        background: var(--bg-2);
        border-right: 1px solid var(--line);
    }

    .sidebar__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 6px 6px 22px 10px;
    }

    .sidebar__head .brand {
        font-size: 17px;
        font-weight: 800;
    }

    .sidebar__nav {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .sidebar__link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 12px;
        border-radius: 12px;
        color: var(--text-2);
        font-size: 13.5px;
        font-weight: 600;
        transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
    }

    .sidebar__link svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
        stroke-linecap: round;
        stroke-linejoin: round;
        flex: none;
    }

    .sidebar__link:hover {
        background: rgba(59, 130, 246, 0.1);
        color: var(--text);
        transform: translateX(2px);
    }

    .sidebar__link.is-active {
        background: var(--blue-dim);
        color: #dbe6ff;
    }

    .sidebar__link--muted {
        color: var(--text-3);
    }

    /* logout в сайдбаре — POST-форма, оформленная под sidebar__link */
    .sidebar__logout-form {
        margin: 0;
    }

    .sidebar__logout-btn {
        appearance: none;
        background: none;
        border: 0;
        width: 100%;
        font: inherit;
        cursor: pointer;
    }

    .sidebar__spacer {
        flex: 1;
    }

    .sidebar__balance {
        padding: 12px 10px 6px;
        border-top: 1px solid var(--line);
        margin: 6px 4px 2px;
    }

    .sidebar__balance-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 11px;
        color: var(--text-3);
        margin-bottom: 4px;
    }

    .sidebar__balance-usdt {
        font-size: 16px;
        font-weight: 700;
        color: var(--text);
    }

    .sidebar__balance-usdt small {
        font-size: 11px;
        color: var(--text-3);
        font-weight: 600;
    }

    .sidebar__balance-rub {
        font-size: 11.5px;
        color: var(--text-3);
        margin-top: 2px;
    }

    .tabbar {
        display: none;
    }

    .content {
        padding: 8px 24px 48px;
    }

    .topbar__title--mobile {
        display: none;
    }

    .topbar__title--desktop {
        display: block;
        text-align: left;
        font-size: 15px;
    }

    /* Свёрнутый сайдбар */
    .is-sidebar-collapsed .sidebar {
        display: none;
    }

    .is-sidebar-collapsed .sidebar-expand {
        display: inline-flex;
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 40;
        width: 32px;
        height: 32px;
        align-items: center;
        justify-content: center;
        border: none;
        border-radius: 8px;
        background: var(--surface);
        color: var(--text);
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }

    .is-sidebar-collapsed .sidebar-expand svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* use desktop width: feed and actions breathe */
    .feed--grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

/* Flash-сообщения (django.contrib.messages) — рендер в base.html над контентом */
.flash {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--text);
}

.flash--warning {
    background: var(--amber-dim);
    border-color: rgba(245, 166, 35, 0.35);
}

.flash--error {
    background: var(--red-dim);
    border-color: rgba(248, 113, 113, 0.35);
}

.flash--success {
    background: var(--green-dim);
    border-color: rgba(52, 211, 153, 0.35);
}
