/* Стили экранов второй очереди: услуги, кредиты, поддержка,
   международные переводы, админка, сканер QR. */

/* ============ Услуги банка на главной ============ */
.services { display: flex; flex-direction: column; gap: 7px; }
.service {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 11px 13px;
    background: var(--surface);
    border: var(--card-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    transition: transform var(--dur-fast) var(--ease), background var(--dur-fast);
}
.service:active { transform: scale(.98); background: var(--press); }
.service-ico {
    flex: none;
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: var(--radius-ico);
    background: var(--accent-soft);
    color: var(--accent);
}
.service-ico svg { width: 19px; height: 19px; }
.service-body { flex: 1; min-width: 0; display: block; }
.service-name { display: block; font-size: 15px; font-weight: 500; }
.service-sub { display: block; font-size: 12.5px; color: var(--text-mute); margin-top: 2px; }

/* ============ Кредиты ============ */
.credit-active {
    padding: 18px;
    margin-bottom: 18px;
    border-radius: var(--radius-card);
    background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--surface));
    border: var(--card-border);
    box-shadow: var(--shadow-card);
}
.credit-active-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.credit-label { font-size: 12px; color: var(--text-mute); }
.credit-sum { font-size: 26px; font-weight: 700; margin: 3px 0; font-variant-numeric: tabular-nums; }
.credit-sub { font-size: 12.5px; color: var(--text-dim); line-height: 1.4; }
.credit-timer {
    flex: none;
    display: flex; align-items: center; gap: 5px;
    padding: 6px 11px;
    font-size: 12px; font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 14px;
}
.credit-timer svg { width: 14px; height: 14px; }

.tier-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px;
    margin-bottom: 4px;
    border-radius: var(--radius-card);
    background: color-mix(in srgb, var(--tier) 12%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--tier) 32%, transparent);
}
.tier-ico {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: var(--radius-ico);
    background: color-mix(in srgb, var(--tier) 22%, transparent);
    color: var(--tier);
}
.tier-ico svg { width: 18px; height: 18px; }
.tier-name { font-size: 15px; font-weight: 600; }
.tier-max { font-size: 12.5px; color: var(--text-mute); margin-top: 2px; }

.terms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.term {
    padding: 12px 4px;
    font-size: 12.5px;
    color: var(--text-dim);
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: var(--radius-card);
    transition: all var(--dur-fast);
}
.term.active { border-color: var(--accent); color: var(--text); font-weight: 600; }
.term:active { transform: scale(.95); }
.credit-terms-card {
    margin-top: 18px;
    background: var(--surface);
    border-radius: var(--radius-card);
    overflow: hidden;
}

/* ============ Поддержка и чат ============ */
.ticket-head { padding: 2px 2px 14px; }
.ticket-subject { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.ticket-meta { display: flex; align-items: center; gap: 9px; margin-top: 7px; font-size: 12.5px; color: var(--text-mute); }
.tag.ok-text { background: color-mix(in srgb, var(--income) 16%, transparent); color: var(--income); }

.screen.chat-screen .scroll { padding-bottom: calc(var(--safe-bottom) + 78px); }
.chat { display: flex; flex-direction: column; gap: 9px; }
.msg {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.4;
    animation: staggerIn 320ms var(--ease) both;
}
.msg.out { align-self: flex-end; background: var(--accent); color: var(--accent-fg); border-bottom-right-radius: 6px; }
.msg.in { align-self: flex-start; background: var(--surface-2); color: var(--text); border-bottom-left-radius: 6px; }
.msg-author { font-size: 11.5px; font-weight: 600; opacity: .65; margin-bottom: 3px; }
.msg-text { white-space: pre-wrap; word-break: break-word; }
.msg-time { font-size: 10.5px; opacity: .55; text-align: right; margin-top: 3px; }

.msg.typing { padding: 12px 14px; }
.typing-dots { display: flex; gap: 4px; align-items: center; height: 8px; }
.typing-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: .4;
    animation: typingBounce 1.1s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30% { transform: translateY(-4px); opacity: .9; }
}

.chat-bar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    display: flex;
    gap: 9px;
    padding: 10px 14px calc(10px + var(--safe-bottom));
    background: var(--nav-bg);
    backdrop-filter: var(--nav-blur);
    -webkit-backdrop-filter: var(--nav-blur);
    border-top: 1px solid var(--divider);
}
.chat-input {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    font-size: 15px;
    color: var(--text);
    background: var(--surface-2);
    border-radius: 22px;
}
.chat-send {
    flex: none;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-fg);
    transition: transform var(--dur-fast) var(--ease);
}
.chat-send:active { transform: scale(.9); }
.chat-send svg { width: 19px; height: 19px; }
.chat-attach {
    flex: none;
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-dim);
    transition: transform var(--dur-fast) var(--ease);
}
.chat-attach:active { transform: scale(.9); }
.chat-attach svg { width: 20px; height: 20px; }
.msg-image {
    display: block;
    max-width: 100%;
    border-radius: 12px;
    cursor: zoom-in;
}
.msg.has-image { padding: 6px; }
.msg.has-image .msg-text { padding: 4px 7px 0; }
.msg.has-image .msg-time { padding: 0 7px 2px; }

.img-viewer {
    position: fixed; inset: 0;
    z-index: 9500;
    background: rgba(0, 0, 0, .92);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    animation: staggerIn 180ms ease both;
}
.img-viewer img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ============ Международные переводы ============ */
.country-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.country {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 14px 6px;
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: var(--radius-card);
    transition: all var(--dur-fast);
}
.country.active { border-color: var(--accent); }
.country:active { transform: scale(.96); }
.country-name { font-size: 11.5px; color: var(--text-dim); text-align: center; }
.flag {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    font-size: 10px; font-weight: 900;
}

.bank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.bank {
    display: flex; align-items: center; gap: 9px;
    padding: 12px;
    text-align: left;
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: var(--radius-card);
    transition: all var(--dur-fast);
}
.bank.active { border-color: var(--accent); }
.bank:active { transform: scale(.97); }
.bank-name { font-size: 12px; line-height: 1.25; color: var(--text-dim); }
.bank-badge {
    display: inline-flex; align-items: center; justify-content: center;
    flex: none;
    border-radius: 50%;
    color: #fff; font-weight: 800;
}

/* ============ Админка ============ */
.segmented-4 { grid-template-columns: repeat(4, 1fr); }
.segmented-4 .seg-thumb { width: calc((100% - 6px) / 4); }
.segmented-4 .seg { font-size: 12.5px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-grid .stat-value { font-size: 14px; }
.mini-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    font-size: 10px; font-weight: 600;
    border-radius: 7px;
    vertical-align: middle;
}
.mini-tag.admin { background: color-mix(in srgb, #f39c12 22%, transparent); color: #f39c12; }
.mini-tag.blocked { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }

/* ============ PULSE Bank (межбанк) ============ */
.pulse-avatar { background: linear-gradient(135deg, #0088ff, #00b4ff); color: #fff; }
.tag.pulse {
    background: rgba(0, 180, 255, .12);
    color: #00b4ff;
    font-weight: 600;
}
.seg-thumb-2 { width: calc((100% - 6px) / 2); }
.segmented:has(.seg-thumb-2) { grid-template-columns: repeat(2, 1fr); }
.hint-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -6px 4px 12px;
    font-size: 12px;
    line-height: 1.35;
    color: var(--text-mute);
}
.hint-inline svg { width: 15px; height: 15px; flex: none; }

/* ============ Сканер QR ============ */
.scan-box {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-card);
    overflow: hidden;
    background: #000;
}
.scan-box video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 12%; }
.scan-frame span {
    position: absolute;
    width: 34px; height: 34px;
    border: 3px solid var(--accent);
}
.scan-frame span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.scan-frame span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.scan-frame span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.scan-frame span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.scan-hint {
    margin-top: 16px;
    font-size: 13.5px;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.45;
}
