:root {
    --bg-color: #0a0a0f;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-color: #ffffff;
    --hint-color: rgba(255, 255, 255, 0.55);
    --button-bg: rgba(255, 255, 255, 0.12);
    --accent-color: #0a84ff;
    --success-color: #30d158;
    --bottom-nav-height: 80px;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #0a0a0f;
    color: var(--text-color);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -webkit-overflow-scrolling: touch;
}

/* Soft warm golden glow at the top of every screen */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 320px;
    background:
        radial-gradient(ellipse 75% 100% at 50% 0%,
            rgba(255, 200, 90, 0.18) 0%,
            rgba(255, 175, 60, 0.09) 28%,
            rgba(255, 160, 40, 0.04) 55%,
            transparent 80%);
    pointer-events: none;
    z-index: 0;
}

#app {
    /* Normal block layout — body itself is the scroll container.
       This is the only reliable scroll behaviour in iOS Telegram WebView. */
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    box-sizing: border-box;
    position: relative;
    /* padding-top  ~ clears Telegram top pill in fullscreen (~54px) + small breathing
       padding-bottom ~ clears floating nav (bottom:40 + height:80 = 120) + ~60px buffer */
    padding: 60px 20px 200px;
    z-index: 1;
}

/* Main tab keeps a taller top spacing so the big "RESTORE MESSAGE" title
   sits roughly where it was before (≈120px from top). */
#tab-main > header {
    margin-top: 60px;
}

/* Subtle ambient glow */
#app::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(10, 132, 255, 0.08) 0%, transparent 70%);
    filter: blur(60px);
    z-index: -1;
    pointer-events: none;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 36px;
    padding: 28px 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.tab-content {
    display: none;
    animation: fadeIn 0.25s ease;
    margin: 0;
    padding: 0;
}

.tab-content.active {
    display: block;
}

header {
    text-align: center;
    padding: 4px 0 14px;
}

header h1, header h2 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(180deg, #ffffff 0%, #aaaaaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--hint-color);
    font-size: 15px;
    margin-top: 10px;
    line-height: 1.4;
}

.text-content {
    border-radius: 24px;
    padding: 24px;
}

.text-content h3 {
    margin-top: 0;
    font-size: 18px;
    font-weight: 600;
}

.text-content p {
    color: var(--hint-color);
    line-height: 1.5;
    margin-bottom: 20px;
    font-size: 15px;
}

.text-content p:last-child {
    margin-bottom: 0;
}

.input-group {
    margin-bottom: 24px;
}

input[type="text"] {
    width: 100%;
    padding: 20px 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    font-size: 18px;
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: center;
}

input[type="text"]:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(10, 132, 255, 0.3);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.tg-button {
    width: 100%;
    padding: 20px;
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    background: var(--button-bg);
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tg-button:active {
    transform: scale(0.96);
}

.tg-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.tg-button.primary {
    background: var(--accent-color);
    border: none;
    box-shadow: 0 4px 20px rgba(10, 132, 255, 0.4);
}

.tg-button.primary:active {
    background: #007aff;
}

.tg-button.success-btn {
    background: var(--success-color);
    border: none;
    box-shadow: 0 4px 20px rgba(48, 209, 88, 0.4);
    color: #000;
}

.hidden {
    display: none !important;
}

#resultContainer {
    margin-top: 10px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-card {
    text-align: center;
    margin-bottom: 24px;
}

.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
}

.profile-card img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.profile-card h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.id-display {
    margin: 0;
    color: var(--hint-color);
    font-size: 15px;
    font-family: 'SF Mono', ui-monospace, monospace;
}

.payment-card {
    margin-bottom: 24px;
    text-align: center;
    padding: 24px;
}

.payment-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
}

.stats-hint {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--hint-color);
    line-height: 1.4;
}

.policy-check {
    display: flex;
    align-items: flex-start;
    text-align: left;
    margin-bottom: 20px;
    gap: 10px;
}

.policy-check input[type="checkbox"] {
    appearance: none;
    background-color: rgba(255,255,255,0.1);
    margin: 3px 0 0 0;
    font: inherit;
    color: var(--accent-color);
    width: 20px;
    height: 20px;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    display: grid;
    place-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.policy-check input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--accent-color);
    background-color: var(--accent-color);
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.policy-check input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.policy-check label {
    font-size: 13px;
    color: var(--hint-color);
    line-height: 1.4;
    cursor: pointer;
}

.policy-check a {
    color: var(--accent-color);
    text-decoration: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    max-width: 400px;
    width: 100%;
}

.modal-content h3 {
    margin-top: 0;
    font-size: 20px;
}

.modal-text {
    max-height: 65vh;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 6px;
}

.modal-text h4 {
    margin: 18px 0 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text-color);
}

.modal-text h4:first-child {
    margin-top: 0;
}

.modal-text p {
    font-size: 13px;
    color: var(--hint-color);
    line-height: 1.55;
    margin: 0 0 8px;
}

.modal-text strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Custom scrollbar inside the policy modal */
.modal-text::-webkit-scrollbar {
    width: 6px;
}
.modal-text::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}
.modal-text::-webkit-scrollbar-track {
    background: transparent;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 40px;
    left:   16px;
    right:  16px;
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    padding: 10px;
    border-radius: 40px;
    z-index: 50;
    height: var(--bottom-nav-height);
    box-sizing: border-box;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--hint-color);
    transition: all 0.2s;
    flex: 1 1 0;
    min-width: 0;
    padding: 0 4px;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    margin-bottom: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.nav-item.active {
    color: var(--accent-color);
}

.nav-item.active svg {
    transform: translateY(-2px);
}

/* Success Screen */
.success-card {
    text-align: center;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(48, 209, 88, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: var(--success-color);
}

.success-card h2 {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 600;
    color: var(--success-color);
}

.success-text {
    margin: 0 0 24px;
    font-size: 15px;
    color: var(--hint-color);
    line-height: 1.5;
}

/* Loading State */
.tg-button.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.tg-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); filter: blur(10px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Preloader */
#preloader {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, #0e0e1a 0%, #050509 70%, #000 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    overflow: hidden;
    isolation: isolate;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-glow {
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(10,132,255,0.35) 0%, rgba(10,132,255,0.08) 40%, transparent 70%);
    filter: blur(40px);
    animation: glowPulse 2.6s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

.preloader-content {
    position: relative;
    text-align: center;
    z-index: 1;
}

.preloader-video-wrap {
    width: 220px;
    height: 220px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    isolation: isolate;
}

.preloader-video-wrap::after {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(10,132,255,0.25), transparent 65%);
    filter: blur(20px);
    z-index: -1;
    animation: glowPulse 2.6s ease-in-out infinite;
}

.preloader-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    /* SVG filter превращает чёрный фон видео в реальную прозрачность */
    filter: drop-shadow(0 8px 30px rgba(10,132,255,0.4));
    -webkit-filter: drop-shadow(0 8px 30px rgba(10,132,255,0.4));
}

.preloader-text {
    margin-top: 26px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 4px;
    background: linear-gradient(90deg, #fff 0%, #8ab6ff 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2.4s linear infinite;
}

.preloader-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.preloader-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 12px rgba(10,132,255,0.8);
    animation: bounce 1.2s infinite ease-in-out;
}

.preloader-dots span:nth-child(2) { animation-delay: 0.15s; }
.preloader-dots span:nth-child(3) { animation-delay: 0.30s; }

@keyframes glowPulse {
    0%, 100% { opacity: 0.55; transform: scale(0.95); }
    50%      { opacity: 1;    transform: scale(1.08); }
}

@keyframes shimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0);   opacity: 0.5; }
    50%      { transform: translateY(-8px); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* App hidden state */
.app-hidden {
    opacity: 0;
    pointer-events: none;
}

#app {
    transition: opacity 0.5s ease;
}

/* Tab video container -- "transparent" videos via screen blend */
.tab-video-container {
    margin: 6px 0 22px;
    display: flex;
    justify-content: center;
    isolation: isolate; /* needed so mix-blend-mode blends against page bg */
    position: relative;
}

.tab-video-container::before {
    /* Soft ambient glow behind the video */
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(10,132,255,0.18), transparent 65%);
    filter: blur(28px);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
}

.tab-video {
    width: 160px;
    height: 160px;
    object-fit: contain;
    background: transparent;
    border-radius: 24px;
    /* SVG-фильтр убирает чёрный фон, drop-shadow добавляет мягкое свечение */
    filter: drop-shadow(0 10px 26px rgba(10,132,255,0.3));
    -webkit-filter: drop-shadow(0 10px 26px rgba(10,132,255,0.3));
}

/* Stack glass-panels with a consistent gap so they never touch */
.tab-content > .glass-panel + .glass-panel,
.tab-content > .glass-panel + .step-block,
.tab-content > .step-block  + .glass-panel {
    margin-top: 14px;
}


/* ===== Profile tab ===== */

/* Stack profile panels with a consistent gap so they don't collide */
#tab-profile .glass-panel {
    margin: 0 0 16px;
}
#tab-profile .glass-panel:last-child {
    margin-bottom: 0;
}

/* Profile header card */
#tab-profile .profile-card {
    padding: 32px 24px 28px;
}

#tab-profile .profile-card .avatar-container {
    width: 110px;
    height: 110px;
    margin-bottom: 18px;
}

#tab-profile .profile-card h2 {
    margin: 0 0 6px;
    font-size: 22px;
    line-height: 1.2;
    background: linear-gradient(180deg, #ffffff 0%, #aaaaaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#tab-profile .profile-card .id-display {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}

#tab-profile .profile-card .id-display + .id-display {
    margin-top: 2px;
}

#tab-profile h3 {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.info-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 14px;
    min-height: 24px;
}

.info-list li:first-child {
    padding-top: 0;
}

.info-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-list li > span {
    color: var(--hint-color);
    flex: 0 0 auto;
}

.info-list li > strong {
    color: var(--text-color);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
    max-width: 60%;
    line-height: 1.3;
}

.info-list li > strong.badge-premium {
    background: linear-gradient(90deg, #ffb84d, #ff7e3c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Orders */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.orders-empty {
    color: var(--hint-color);
    font-size: 14px;
    text-align: center;
    margin: 4px 0 0;
}

.order-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-card .order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.order-card .order-target {
    font-weight: 600;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.order-card .order-amount {
    color: var(--success-color);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.order-card .order-meta {
    color: var(--hint-color);
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.order-card .order-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(48, 209, 88, 0.15);
    color: var(--success-color);
}

.order-status.pending {
    background: rgba(255, 184, 77, 0.15);
    color: #ffb84d;
}


/* ===== Waiting-for-payment screen ===== */
#waitingContainer {
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.waiting-card {
    text-align: center;
    padding: 30px 24px;
    position: relative;
    isolation: isolate;
}

.waiting-video-wrap {
    width: 160px;
    height: 160px;
    margin: 0 auto 18px;
    position: relative;
    isolation: isolate;
}

.waiting-video-wrap::after {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(10,132,255,0.30), transparent 65%);
    filter: blur(24px);
    z-index: -1;
    animation: glowPulse 2.6s ease-in-out infinite;
}

.waiting-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    /* Cut the black background with the same SVG luminance-to-alpha filter */
    filter: drop-shadow(0 10px 30px rgba(10,132,255,0.4));
    -webkit-filter: drop-shadow(0 10px 30px rgba(10,132,255,0.4));
}

.waiting-card h2 {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(90deg, #fff 0%, #8ab6ff 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2.4s linear infinite;
}

.waiting-text {
    color: var(--hint-color);
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 18px;
}

.waiting-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 22px;
}

.waiting-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 12px rgba(10,132,255,0.8);
    animation: bounce 1.2s infinite ease-in-out;
}

.waiting-dots span:nth-child(2) { animation-delay: 0.15s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.30s; }

.waiting-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    font-size: 13px;
}

.waiting-meta span { color: var(--hint-color); }
.waiting-meta strong {
    font-family: 'SF Mono', ui-monospace, monospace;
    color: var(--text-color);
    font-weight: 600;
}

#waitingContainer .tg-button + .tg-button { margin-top: 10px; }

.tg-button.ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--hint-color);
    box-shadow: none;
}

.tg-button.ghost:active {
    background: rgba(255, 255, 255, 0.04);
}


/* ===== Step blocks (multi-step payment flow) ===== */
.step-block {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-block.hidden { display: none; }

#confirmProfileStep .tg-button + .tg-button {
    margin-top: 10px;
}

.confirm-hint {
    margin: 14px 0 0;
    color: var(--hint-color);
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

/* ===== Payment step (payt.mp4 + amount) ===== */
.payment-hero {
    text-align: center;
    margin-bottom: 16px;
    padding: 24px 20px 20px;
    position: relative;
    isolation: isolate;
}

.payment-video-wrap {
    width: 140px;
    height: 140px;
    margin: 0 auto 14px;
    position: relative;
    isolation: isolate;
}

.payment-video-wrap::after {
    content: '';
    position: absolute;
    inset: -22px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(48,209,88,0.30), transparent 65%);
    filter: blur(24px);
    z-index: -1;
    animation: glowPulse 2.6s ease-in-out infinite;
}

.payment-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    /* Same SVG filter — turn black background into real transparency */
    filter: drop-shadow(0 10px 28px rgba(48,209,88,0.35));
    -webkit-filter: drop-shadow(0 10px 28px rgba(48,209,88,0.35));
}

.payment-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(180deg, #ffffff 0%, #aaaaaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.payment-sub {
    margin: 0 0 14px;
    color: var(--hint-color);
    font-size: 14px;
    line-height: 1.4;
}

.payment-sub strong {
    color: var(--text-color);
    font-weight: 600;
}

.payment-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--success-color);
    letter-spacing: -0.5px;
    margin-top: 4px;
    text-shadow: 0 4px 20px rgba(48, 209, 88, 0.35);
}

#paymentStep .payment-card .tg-button + .tg-button {
    margin-top: 10px;
}

/* ===== Standalone terms.html page ===== */
.terms-body {
    background: #0a0a0f;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

.terms-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 24px 20px 60px;
    position: relative;
}

.terms-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--hint-color);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 0;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.terms-back:hover { color: var(--text-color); }
.terms-back svg { width: 18px; height: 18px; }

.terms-header {
    text-align: center;
    padding: 16px 0 28px;
}

.terms-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(180deg, #ffffff 0%, #aaaaaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.terms-header .subtitle {
    color: var(--hint-color);
    font-size: 14px;
    margin-top: 8px;
}

.terms-article {
    padding: 28px 24px;
    border-radius: 28px;
    margin-bottom: 24px;
}

.terms-article h2 {
    margin: 26px 0 10px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--text-color);
}

.terms-article h2:first-child { margin-top: 0; }

.terms-article p {
    font-size: 14px;
    color: var(--hint-color);
    line-height: 1.6;
    margin: 0 0 8px;
}

.terms-article strong {
    color: var(--text-color);
    font-weight: 600;
}

.terms-footnote {
    margin-top: 24px !important;
    padding-top: 18px;
    border-top: 1px solid var(--glass-border);
    font-style: italic;
    opacity: 0.85;
    font-size: 13px !important;
}

.terms-bottom-back {
    display: block;
    max-width: 360px;
    margin: 0 auto;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
}


/* Hide the decorative Home.mp4 once the user moves past the username
   input — keeps the flow clean on the confirm / payment / waiting / success
   screens. Uses :has() so it stays purely reactive to step state. */
#tab-main:has(#inputSection.hidden) .tab-video-container {
    display: none;
}


/* ===== FAQ accordion in the Help tab ===== */
.faq-item {
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 18px;
    margin-top: 12px;
    overflow: hidden;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.faq-item:first-of-type { margin-top: 12px; }

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { display: none; }

.faq-item summary > span {
    flex: 1;
    line-height: 1.4;
}

.faq-chevron {
    width: 18px;
    height: 18px;
    color: var(--hint-color);
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
    color: var(--accent-color);
}

.faq-item[open] {
    background: rgba(10, 132, 255, 0.06);
    border-color: rgba(10, 132, 255, 0.25);
}

.faq-body {
    padding: 0 18px 16px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--hint-color);
    animation: faqExpand 0.25s ease;
}

@keyframes faqExpand {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ===== Payment method picker (Card/SberPay vs CryptoBot) ===== */
.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.pay-method {
    display: block;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pay-method input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pay-method-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    transition: all 0.2s ease;
    text-align: left;
}

.pay-method input[type="radio"]:checked + .pay-method-card {
    background: rgba(10, 132, 255, 0.12);
    border-color: rgba(10, 132, 255, 0.5);
    box-shadow: 0 0 0 1px rgba(10, 132, 255, 0.25), 0 8px 24px rgba(10, 132, 255, 0.15);
}

.pay-method-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    flex-shrink: 0;
}

.pay-method-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.pay-method-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.2;
}

.pay-method-sub {
    font-size: 12px;
    color: var(--hint-color);
    line-height: 1.3;
}

.pay-method-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    color: transparent;
}

.pay-method-check svg {
    width: 14px;
    height: 14px;
    transition: color 0.2s;
}

.pay-method input[type="radio"]:checked + .pay-method-card .pay-method-check {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}


/* ===== Admin panel ===== */
/* Hidden until JS confirms the current user is an admin */
.admin-only { display: none !important; }
body.is-admin .admin-only { display: flex !important; }
body.is-admin .nav-item.admin-only { display: flex !important; }
body.is-admin #tab-admin.admin-only { display: none !important; }
body.is-admin #tab-admin.admin-only.active { display: block !important; }

.admin-section {
    margin-bottom: 16px;
}

.admin-greeting {
    text-align: center;
    padding: 8px 0 18px;
}

.admin-greeting h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(180deg, #ffffff 0%, #aaaaaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-greeting p {
    margin: 6px 0 0;
    color: var(--hint-color);
    font-size: 13px;
}

/* KPI grid */
.kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.kpi-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.kpi-card .kpi-label {
    font-size: 12px;
    color: var(--hint-color);
    margin-bottom: 6px;
}

.kpi-card .kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.1;
}

.kpi-card.accent .kpi-value { color: var(--success-color); }
.kpi-card .kpi-sub {
    font-size: 11px;
    color: var(--hint-color);
    margin-top: 4px;
}

/* Period chips */
.period-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.period-card {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px;
    text-align: center;
}

.period-card .period-name {
    font-size: 11px;
    color: var(--hint-color);
    margin-bottom: 4px;
}

.period-card .period-rev {
    font-size: 16px;
    font-weight: 700;
    color: var(--success-color);
}

.period-card .period-cnt {
    font-size: 11px;
    color: var(--hint-color);
    margin-top: 2px;
}

/* Mini bar chart (14 days) */
.admin-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 90px;
    padding: 12px 4px 4px;
}

.admin-chart .bar {
    flex: 1;
    background: linear-gradient(180deg, var(--accent-color), rgba(10,132,255,0.25));
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
    position: relative;
}

.admin-chart .bar:hover { opacity: 0.85; }

/* Filters */
.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.admin-filters select,
.admin-filters input {
    flex: 1;
    min-width: 100px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.25);
    color: var(--text-color);
    font-size: 13px;
    outline: none;
}

/* Order rows */
.admin-order {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 8px;
}

.admin-order .ao-main { min-width: 0; flex: 1; }
.admin-order .ao-target { font-weight: 600; font-size: 14px; }
.admin-order .ao-meta {
    font-size: 11px;
    color: var(--hint-color);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-order .ao-right { text-align: right; flex-shrink: 0; }
.admin-order .ao-amount { font-weight: 700; font-size: 14px; }

.ao-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    margin-top: 4px;
}
.ao-badge.paid    { background: rgba(48,209,88,0.15);  color: var(--success-color); }
.ao-badge.pending { background: rgba(255,184,77,0.15); color: #ffb84d; }

.method-pill {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    color: var(--hint-color);
}

/* Admins management */
.admin-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.admin-add-row input {
    flex: 1;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.25);
    color: var(--text-color);
    font-size: 14px;
    outline: none;
}
.admin-add-row button {
    flex-shrink: 0;
    padding: 0 18px;
    border-radius: 14px;
    border: none;
    background: var(--accent-color);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.admin-person {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 8px;
}
.admin-person .ap-name { font-weight: 600; font-size: 14px; }
.admin-person .ap-id { font-size: 11px; color: var(--hint-color); font-family: 'SF Mono', monospace; }
.admin-person .ap-remove {
    background: rgba(255,69,58,0.15);
    color: #ff453a;
    border: none;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
.admin-person .ap-super {
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg,#ffb84d,#ff7e3c);
    color: #1a1a1a;
    font-weight: 700;
    flex-shrink: 0;
}

.admin-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    background: rgba(0,0,0,0.2);
    padding: 4px;
    border-radius: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab-btn {
    flex: 1 0 auto;
    white-space: nowrap;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--hint-color);
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.admin-tab-btn.active {
    background: var(--accent-color);
    color: #fff;
}

.admin-subview { display: none; }
.admin-subview.active { display: block; animation: fadeIn 0.3s ease; }

.admin-empty {
    text-align: center;
    color: var(--hint-color);
    font-size: 13px;
    padding: 20px 0;
}


/* ===== "Open in Telegram" gate (shown in non-Telegram browsers) ===== */
#notInTelegram {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 24px;
    box-sizing: border-box;
    background: radial-gradient(ellipse at center, #0e0e1a 0%, #050509 75%, #000 100%);
}
.nit-card {
    text-align: center;
    padding: 36px 28px;
    max-width: 420px;
    border-radius: 28px;
}
.nit-logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 3px;
    background: linear-gradient(90deg, #fff 0%, #8ab6ff 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2.4s linear infinite;
    margin-bottom: 18px;
}
.nit-text {
    color: var(--hint-color);
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 24px;
}
.nit-btn {
    display: inline-block;
    text-decoration: none;
    box-sizing: border-box;
}


/* ===== "Self-recovery is not possible" screen ===== */
#selfBlockContainer { animation: slideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1); }

.self-block-card {
    text-align: center;
    padding: 32px 24px 26px;
    isolation: isolate;
}

.self-block-video-wrap {
    width: 160px;
    height: 160px;
    margin: 0 auto 18px;
    position: relative;
    isolation: isolate;
}

.self-block-video-wrap::after {
    content: '';
    position: absolute;
    inset: -24px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 69, 58, 0.25), transparent 65%);
    filter: blur(26px);
    z-index: -1;
    animation: glowPulse 2.4s ease-in-out infinite;
}

.self-block-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    filter: drop-shadow(0 10px 26px rgba(255, 69, 58, 0.4));
    -webkit-filter: drop-shadow(0 10px 26px rgba(255, 69, 58, 0.4));
}

.self-block-title {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(90deg, #ff453a, #ffb84d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.self-block-text {
    color: var(--hint-color);
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 22px;
}


/* ===== Promocode input on payment screen ===== */
.promo-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.promo-row input {
    flex: 1;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-color);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    outline: none;
    transition: all 0.2s;
    text-align: center;
}

.promo-row input:focus {
    border-color: rgba(10, 132, 255, 0.5);
    box-shadow: 0 0 0 1px rgba(10, 132, 255, 0.25);
}

.promo-btn {
    flex-shrink: 0;
    padding: 0 18px;
    font-size: 13px;
    min-width: 100px;
    width: auto;
}

.promo-msg {
    margin: 4px 4px 14px;
    font-size: 13px;
    line-height: 1.4;
    min-height: 16px;
}

.promo-msg.ok    { color: var(--success-color); }
.promo-msg.err   { color: #ff453a; }
.promo-msg .strike { text-decoration: line-through; color: var(--hint-color); margin-right: 6px; }

.faq-link {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dashed rgba(10,132,255,0.4);
}


/* ===== Admin promocodes ===== */
.promo-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}
.promo-form input,
.promo-form select {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.25);
    color: var(--text-color);
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}
.promo-form #pcCode    { grid-column: 1 / -1; text-transform: uppercase; letter-spacing: 1px; }
.promo-form #pcMax     { grid-column: 1 / -1; }
.promo-form #pcExpires { grid-column: 1 / -1; }
.promo-form button     { grid-column: 1 / -1; }

.promo-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 8px;
}
.promo-card .pc-code {
    font-family: 'SF Mono', monospace;
    font-weight: 700;
    color: var(--text-color);
}
.promo-card .pc-meta {
    font-size: 12px;
    color: var(--hint-color);
    margin-top: 2px;
}
.promo-card .pc-remove {
    background: rgba(255,69,58,0.15);
    color: #ff453a;
    border: none;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}


/* ===== Channel join requests ===== */
.jr-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 8px;
}
.jr-card .jr-main { min-width: 0; flex: 1; }
.jr-card .jr-name { font-weight: 600; font-size: 14px; }
.jr-card .jr-meta {
    font-size: 11px;
    color: var(--hint-color);
    margin-top: 2px;
    font-family: 'SF Mono', monospace;
}
.jr-card .jr-actions { display: flex; gap: 6px; flex-shrink: 0; }
.jr-btn {
    border: none;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.jr-btn.approve { background: rgba(48,209,88,0.15); color: var(--success-color); }
.jr-btn.decline { background: rgba(255,69,58,0.15); color: #ff453a; }


/* ===== "Deep scan" animated analysis screen ===== */
#analysisContainer { animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

.analysis-card {
    text-align: center;
    padding: 32px 24px 26px;
    position: relative;
    isolation: isolate;
}

.analysis-avatar-wrap {
    width: 130px;
    height: 130px;
    margin: 0 auto 18px;
    position: relative;
    isolation: isolate;
}

.analysis-avatar-wrap img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.18);
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 30px rgba(10,132,255,0.35);
}

.analysis-orbit {
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    border: 2px solid rgba(10,132,255,0.4);
    border-top-color: transparent;
    border-right-color: transparent;
    animation: orbitSpin 1.6s linear infinite;
}
.analysis-orbit.slow {
    inset: -26px;
    border-color: rgba(10,132,255,0.2);
    border-bottom-color: transparent;
    border-left-color: transparent;
    animation: orbitSpin 3s linear infinite reverse;
}

@keyframes orbitSpin { to { transform: rotate(360deg); } }

.analysis-title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(90deg, #fff 0%, #8ab6ff 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2.4s linear infinite;
}

.analysis-target {
    color: var(--hint-color);
    font-size: 14px;
    margin: 0 0 22px;
    font-family: 'SF Mono', monospace;
}

.analysis-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    text-align: left;
}

.analysis-steps li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin-bottom: 4px;
    font-size: 13px;
    color: rgba(255,255,255,0.35);
    background: transparent;
    border-radius: 10px;
    opacity: 0.4;
    transition: all 0.35s ease;
}

.analysis-steps li.active {
    opacity: 1;
    color: var(--text-color);
    background: rgba(10, 132, 255, 0.08);
}

.analysis-steps li.done {
    opacity: 0.85;
    color: var(--text-color);
    background: rgba(48, 209, 88, 0.07);
}

.as-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    position: relative;
}

li.active .as-icon {
    border-color: var(--accent-color);
    border-top-color: transparent;
    animation: orbitSpin 0.7s linear infinite;
}

li.done .as-icon {
    border-color: var(--success-color);
    background: var(--success-color);
}

li.done .as-icon::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 4px;
    height: 8px;
    border: solid #0a0a0f;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.analysis-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 18px;
}

.analysis-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-color), #4dabf7);
    transition: width 0.5s ease;
    box-shadow: 0 0 12px rgba(10,132,255,0.6);
}

/* Result block — shown when scan completes */
.analysis-result {
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.analysis-result.hidden { display: none; }

.ar-label {
    color: var(--hint-color);
    font-size: 13px;
    margin-bottom: 4px;
}

.ar-percent {
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(180deg, #30d158 0%, #2ab84d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(48, 209, 88, 0.35);
    margin-bottom: 4px;
    letter-spacing: -2px;
}
.ar-percent small {
    font-size: 22px;
    font-weight: 700;
    margin-left: 2px;
    -webkit-text-fill-color: var(--success-color);
}

.ar-meta {
    color: var(--hint-color);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 18px;
}


/* ===== Locked chat preview (after analysis) ===== */
.chat-preview-wrap {
    position: relative;
    margin: 22px -8px 18px;
    border-radius: 18px;
    overflow: hidden;
    isolation: isolate;
    background: rgba(0,0,0,0.18);
}

.chat-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 12px;
    filter: blur(6px) saturate(0.85);
    -webkit-filter: blur(6px) saturate(0.85);
    pointer-events: none;
    user-select: none;
    min-height: 260px;
}

.chat-msg {
    max-width: 78%;
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.35;
    color: #fff;
    word-break: break-word;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    animation: chatPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes chatPop {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-msg.in {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.10);
    border-bottom-left-radius: 6px;
}

.chat-msg.out {
    align-self: flex-end;
    background: linear-gradient(135deg, #2b7cff, #0a84ff);
    border-bottom-right-radius: 6px;
}

.chat-msg .chat-time {
    display: block;
    font-size: 10px;
    opacity: 0.7;
    margin-top: 2px;
    text-align: right;
}

/* The lock overlay sits on top of the blurred messages */
.chat-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px;
    background: linear-gradient(180deg,
        rgba(10,10,15,0.45) 0%,
        rgba(10,10,15,0.65) 50%,
        rgba(10,10,15,0.85) 100%);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

.chat-lock-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: rgba(10, 132, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    box-shadow: 0 0 24px rgba(10, 132, 255, 0.5),
                inset 0 0 16px rgba(10, 132, 255, 0.2);
    animation: glowPulse 2.4s ease-in-out infinite;
}
.chat-lock-icon svg { width: 24px; height: 24px; }

.chat-lock-text {
    font-size: 15px;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}
.chat-lock-text strong {
    color: var(--success-color);
    font-weight: 800;
}

.chat-lock-sub {
    font-size: 12px;
    color: var(--hint-color);
    line-height: 1.4;
    max-width: 240px;
}


/* ===== Preview-lock card (separate step after analysis) ===== */
#previewLockContainer { animation: slideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1); }

.preview-lock-card {
    text-align: center;
    padding: 28px 22px 22px;
}

.preview-lock-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(180deg, #fff 0%, #c4c4c4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.preview-lock-sub {
    color: var(--hint-color);
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 4px;
}

.preview-lock-card .tg-button + .tg-button { margin-top: 10px; }

/* ===== Voice-message bubble inside the blurred chat ===== */
.chat-msg.voice {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
    padding: 8px 12px;
}

.chat-msg.voice .v-play {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.chat-msg.voice .v-play::after {
    content: '';
    border-style: solid;
    border-width: 6px 0 6px 10px;
    border-color: transparent transparent transparent #fff;
    margin-left: 2px;
}

.chat-msg.voice .v-wave {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 22px;
}
.chat-msg.voice .v-wave span {
    flex: 1;
    background: rgba(255,255,255,0.7);
    border-radius: 1px;
    min-height: 4px;
}

.chat-msg.voice .v-time {
    font-size: 10px;
    opacity: 0.75;
    margin-left: 4px;
    white-space: nowrap;
}

/* ===== "Glitch reveal" animation on the main RESTORE MESSAGE title ===== */
.reveal-title .dud {
    color: rgba(10,132,255,0.85);
    text-shadow: 0 0 6px rgba(10,132,255,0.5);
}


/* ===== Marketing media library (admin) ===== */
.mk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.mk-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.mk-card img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: #0a0a0f;
}
.mk-card .mk-meta {
    padding: 8px 10px;
    font-size: 11px;
    color: var(--hint-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
.mk-card .mk-meta a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}


/* Profile tab has no decorative video — keep avatar circle as the visual anchor. */
#tab-profile .tab-video-container {
    display: none !important;
}


/* ===== Broadcast preset chips (admin) ===== */
.bc-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.bc-preset-btn {
    background: rgba(255,255,255,0.07);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}
.bc-preset-btn:hover {
    background: rgba(10, 132, 255, 0.18);
    border-color: rgba(10, 132, 255, 0.5);
}
.bc-preset-btn:active {
    transform: scale(0.96);
    background: rgba(10, 132, 255, 0.32);
}


/* ===== Broadcast GIF picker + Rich Message editor ===== */
.bc-gif-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    margin-bottom: 6px;
}
.bc-gif-empty {
    font-size: 12px;
    color: var(--hint-color);
    padding: 6px 0;
}
.bc-gif-tile {
    position: relative;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    color: var(--text-color);
    font-family: inherit;
    transition: transform 0.12s ease, border-color 0.18s ease, background 0.18s ease;
    aspect-ratio: 4 / 5;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
}
.bc-gif-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    flex: 1;
    min-height: 0;
}
.bc-gif-tile span {
    display: block;
    padding: 5px 6px;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    color: rgba(255,255,255,0.75);
    background: rgba(0,0,0,0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bc-gif-tile.bc-gif-none {
    aspect-ratio: 4 / 5;
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 8px, rgba(255,255,255,0.02) 8px 16px);
    align-items: center;
    justify-content: center;
}
.bc-gif-tile.bc-gif-none span {
    background: transparent;
    font-size: 11px;
}
.bc-gif-tile:active { transform: scale(0.97); }
.bc-gif-tile.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(10,132,255,0.35) inset;
    background: rgba(10,132,255,0.10);
}

.bc-mode-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}
.bc-mode-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}
.bc-mode-row label:has(input:checked) {
    background: rgba(10,132,255,0.18);
    border-color: rgba(10,132,255,0.5);
}
.bc-mode-row input[type=radio] { accent-color: var(--accent-color); }

.bc-rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
    padding: 10px;
    background: rgba(0,0,0,0.18);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}
.bc-rich-toolbar.hidden { display: none; }
.bc-rich-btn {
    background: rgba(255,255,255,0.07);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}
.bc-rich-btn:hover { background: rgba(10,132,255,0.18); border-color: rgba(10,132,255,0.5); }
.bc-rich-btn:active { transform: scale(0.96); }


/* ===== Broadcast split editor (textarea + live preview) ===== */
.bc-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 12px;
    align-items: stretch;
}
@media (max-width: 720px) {
    .bc-editor-grid {
        grid-template-columns: 1fr;
    }
}
.bc-textarea {
    width: 100%;
    min-height: 220px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.28);
    color: #fff;
    font-size: 13px;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
}
.bc-preview-pane {
    background: rgba(0,0,0,0.28);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.bc-preview-frame {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 220px;
}
.bc-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid var(--glass-border);
    font-size: 11px;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.bc-preview-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    box-shadow: 0 0 8px rgba(48,209,88,0.7);
}
.bc-preview-body {
    flex: 1;
    padding: 16px;
    background:
        linear-gradient(180deg, rgba(20,30,45,0.55), rgba(10,15,25,0.55));
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
}

/* The "Telegram bubble" wrapper */
.bc-preview-body .rp-body {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 12px 14px;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.bc-preview-body .rp-empty {
    color: var(--hint-color);
    font-style: italic;
    text-align: center;
    margin-top: 60px;
    font-size: 13px;
}

/* Rich-content rendering inside preview */
.bc-preview-body .rp-body h1,
.bc-preview-body .rp-body h2,
.bc-preview-body .rp-body h3,
.bc-preview-body .rp-body h4,
.bc-preview-body .rp-body h5,
.bc-preview-body .rp-body h6 {
    margin: 14px 0 6px;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}
.bc-preview-body .rp-body h1 { font-size: 22px; }
.bc-preview-body .rp-body h2 { font-size: 19px; }
.bc-preview-body .rp-body h3 { font-size: 17px; }
.bc-preview-body .rp-body h4 { font-size: 15px; }
.bc-preview-body .rp-body h5 { font-size: 14px; opacity: 0.95; }
.bc-preview-body .rp-body h6 { font-size: 13px; opacity: 0.9; }
.bc-preview-body .rp-body p  { margin: 6px 0; }
.bc-preview-body .rp-body hr {
    border: 0; height: 1px;
    background: rgba(255,255,255,0.15);
    margin: 12px 0;
}
.bc-preview-body .rp-body a {
    color: var(--accent-color);
    text-decoration: none;
}
.bc-preview-body .rp-body a:hover { text-decoration: underline; }
.bc-preview-body .rp-body code {
    background: rgba(0,0,0,0.4);
    padding: 1px 6px;
    border-radius: 5px;
    font-family: ui-monospace, 'SF Mono', monospace;
    font-size: 0.92em;
}
.bc-preview-body .rp-body pre {
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 10px 12px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 8px 0;
}
.bc-preview-body .rp-body pre code {
    background: transparent;
    padding: 0;
    font-size: 12px;
    color: #e4e8ff;
}
.bc-preview-body .rp-body blockquote {
    border-left: 3px solid var(--accent-color);
    padding: 4px 12px;
    margin: 8px 0;
    background: rgba(10,132,255,0.06);
    border-radius: 0 8px 8px 0;
    color: rgba(255,255,255,0.92);
}
.bc-preview-body .rp-body aside {
    border-left: 3px solid #ffb454;
    padding: 8px 12px;
    margin: 8px 0;
    background: rgba(255,180,84,0.07);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: rgba(255,255,255,0.9);
}
.bc-preview-body .rp-body aside cite {
    display: block;
    font-style: normal;
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    margin-top: 4px;
}
.bc-preview-body .rp-body ul,
.bc-preview-body .rp-body ol {
    margin: 6px 0;
    padding-left: 22px;
}
.bc-preview-body .rp-body li { margin: 3px 0; }
.bc-preview-body .rp-body input[type=checkbox] {
    accent-color: var(--accent-color);
    margin-right: 4px;
}
.bc-preview-body .rp-body table {
    border-collapse: collapse;
    margin: 10px 0;
    width: 100%;
    font-size: 12px;
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    overflow: hidden;
}
.bc-preview-body .rp-body th,
.bc-preview-body .rp-body td {
    border: 1px solid rgba(255,255,255,0.12);
    padding: 6px 10px;
    text-align: left;
}
.bc-preview-body .rp-body th {
    background: rgba(10,132,255,0.15);
    font-weight: 700;
    color: #fff;
}
.bc-preview-body .rp-body tr:nth-child(even) td {
    background: rgba(255,255,255,0.03);
}
.bc-preview-body .rp-body figure {
    margin: 10px 0;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0,0,0,0.25);
}
.bc-preview-body .rp-body figure img,
.bc-preview-body .rp-body figure video {
    display: block;
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: #000;
}
.bc-preview-body .rp-body figure figcaption {
    padding: 6px 12px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}
.bc-preview-body .rp-body details {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 6px 12px;
    margin: 8px 0;
}
.bc-preview-body .rp-body details summary {
    cursor: pointer;
    font-weight: 600;
    padding: 4px 0;
}
.bc-preview-body .rp-body tg-spoiler {
    background: #555a6a;
    color: transparent;
    border-radius: 3px;
    transition: color 0.25s;
    padding: 0 2px;
}
.bc-preview-body .rp-body tg-spoiler:hover { color: #fff; background: rgba(255,255,255,0.1); }
.bc-preview-body .rp-body mark {
    background: rgba(255,200,84,0.35);
    color: #fff;
    padding: 0 3px;
    border-radius: 3px;
}
.bc-preview-body .rp-body sub,
.bc-preview-body .rp-body sup { font-size: 0.75em; }
.bc-preview-body .rp-body s,
.bc-preview-body .rp-body del { color: rgba(255,255,255,0.55); }
.bc-preview-body .rp-body u,
.bc-preview-body .rp-body ins {
    text-decoration: underline;
    text-underline-offset: 3px;
}
.bc-preview-body .rp-body .rp-math {
    background: rgba(123,89,255,0.18);
    color: #cfc2ff;
    padding: 0 4px;
    border-radius: 4px;
    font-family: ui-monospace, monospace;
    font-size: 0.92em;
}

/* Action row under editor: test user id + buttons */
.bc-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}
.bc-userid-input {
    flex: 0 1 180px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.25);
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    min-width: 0;
}
.bc-userid-input:focus { border-color: var(--accent-color); }
.bc-action-row .tg-button { width: auto; margin: 0; }


/* ============================================================
 * BroadcastEditor (`.bcx-*`) — interactive WYSIWYG-style editor
 * ============================================================ */
.bcx {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.bcx-hdr {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}
.bcx-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.bcx-count {
    font-size: 13px;
    color: var(--hint-color);
}
.bcx-count strong { color: var(--accent-color); }

.bcx-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--hint-color);
    margin: 6px 0 -4px;
    font-weight: 600;
}

/* Strategic preset chips */
.bcx-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.bcx-preset {
    background: rgba(255,255,255,0.07);
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}
.bcx-preset:hover {
    background: rgba(10,132,255,0.18);
    border-color: rgba(10,132,255,0.5);
}
.bcx-preset:active { transform: scale(0.96); }

/* GIF picker */
.bcx-gif-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}
.bcx-loading {
    grid-column: 1/-1;
    color: var(--hint-color);
    font-size: 12px;
    padding: 8px 0;
}
.bcx-empty {
    color: var(--hint-color);
    font-size: 13px;
    font-style: italic;
    padding: 8px 0;
}
.bcx-gif {
    position: relative;
    background: rgba(255,255,255,0.05);
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform 0.12s ease, border-color 0.2s ease;
}
.bcx-gif:active { transform: scale(0.97); }
.bcx-gif img {
    flex: 1;
    width: 100%;
    object-fit: cover;
    min-height: 0;
    background: #000;
}
.bcx-gif span {
    display: block;
    padding: 4px 6px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bcx-gif.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(10,132,255,0.35) inset;
}
.bcx-gif-none {
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 6px, transparent 6px 12px);
    align-items: center;
    justify-content: center;
}
.bcx-gif-none span { background: transparent; font-size: 11px; }

/* Tab strip for format mode */
.bcx-tabs {
    display: flex;
    gap: 6px;
    background: rgba(0,0,0,0.25);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    flex-wrap: wrap;
}
.bcx-tab {
    flex: 1 1 100px;
    background: transparent;
    color: var(--text-color);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 9px 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
    white-space: nowrap;
}
.bcx-tab:hover { background: rgba(255,255,255,0.05); }
.bcx-tab.active {
    background: var(--accent-color);
    color: #fff;
    border-color: rgba(255,255,255,0.18);
    box-shadow: 0 4px 12px rgba(10,132,255,0.35);
}

/* Always-visible icon toolbar */
.bcx-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    background: rgba(0,0,0,0.28);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 6px;
}
.bcx-tool {
    background: rgba(255,255,255,0.06);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 8px;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.16s ease, transform 0.1s ease;
}
.bcx-tool:hover { background: rgba(10,132,255,0.22); border-color: rgba(10,132,255,0.45); }
.bcx-tool:active { transform: scale(0.92); }
.bcx-tool-sep {
    width: 1px;
    height: 22px;
    background: rgba(255,255,255,0.12);
    margin: 0 4px;
}

/* Preview pane (above textarea) */
.bcx-pane {
    background: rgba(0,0,0,0.28);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    overflow: hidden;
}
.bcx-pane-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid var(--glass-border);
    font-size: 12px;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.bcx-pane-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #30d158;
    box-shadow: 0 0 8px rgba(48,209,88,0.7);
}
.bcx-pane-mode {
    margin-left: auto;
    background: rgba(10,132,255,0.2);
    color: var(--accent-color);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    letter-spacing: 0.4px;
}
.bcx-pane-body { padding: 14px; min-height: 140px; }
.bcx-bubble {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px 16px 16px 4px;
    padding: 12px 16px;
    color: #fff;
    line-height: 1.45;
    font-size: 15px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    word-break: break-word;
}
.bcx-bubble-media {
    margin: -12px -16px 10px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    background: #000;
}
.bcx-bubble-media img,
.bcx-bubble-media video {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
}

/* The rich content renderer (RichPreview) output lives inside .bcx-bubble */
.bcx-bubble .rp-body h1,
.bcx-bubble .rp-body h2,
.bcx-bubble .rp-body h3,
.bcx-bubble .rp-body h4,
.bcx-bubble .rp-body h5,
.bcx-bubble .rp-body h6 {
    margin: 12px 0 5px;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}
.bcx-bubble .rp-body h1 { font-size: 21px; }
.bcx-bubble .rp-body h2 { font-size: 18px; }
.bcx-bubble .rp-body h3 { font-size: 16px; }
.bcx-bubble .rp-body p  { margin: 6px 0; }
.bcx-bubble .rp-body hr { border:0; height:1px; background:rgba(255,255,255,0.15); margin:10px 0; }
.bcx-bubble .rp-body a { color: var(--accent-color); text-decoration: none; }
.bcx-bubble .rp-body code {
    background: rgba(0,0,0,0.4); padding: 1px 6px;
    border-radius: 5px; font-family: 'SF Mono', monospace; font-size: 0.92em;
}
.bcx-bubble .rp-body pre {
    background: rgba(0,0,0,0.45); border:1px solid rgba(255,255,255,0.08);
    border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 8px 0;
}
.bcx-bubble .rp-body pre code { background: transparent; padding:0; font-size: 12.5px; }
.bcx-bubble .rp-body blockquote {
    border-left: 3px solid var(--accent-color);
    padding: 4px 12px; margin: 8px 0; background: rgba(10,132,255,0.08);
    border-radius: 0 8px 8px 0;
}
.bcx-bubble .rp-body ul,
.bcx-bubble .rp-body ol { margin: 6px 0; padding-left: 22px; }
.bcx-bubble .rp-body li { margin: 3px 0; }
.bcx-bubble .rp-body input[type=checkbox] { accent-color: var(--accent-color); margin-right: 4px; }
.bcx-bubble .rp-body table {
    border-collapse: collapse; margin: 10px 0; width: 100%;
    background: rgba(0,0,0,0.25); border-radius: 8px; overflow: hidden;
}
.bcx-bubble .rp-body th,
.bcx-bubble .rp-body td { border: 1px solid rgba(255,255,255,0.12); padding: 6px 10px; text-align: left; }
.bcx-bubble .rp-body th { background: rgba(10,132,255,0.15); font-weight: 700; }
.bcx-bubble .rp-body figure {
    margin: 10px 0; border-radius: 10px; overflow: hidden; background: rgba(0,0,0,0.25);
}
.bcx-bubble .rp-body figure img,
.bcx-bubble .rp-body figure video {
    display: block; width: 100%; max-height: 240px; object-fit: cover; background: #000;
}
.bcx-bubble .rp-body figure figcaption {
    padding: 6px 12px; font-size: 12px; color: rgba(255,255,255,0.7);
}
.bcx-bubble .rp-body details {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px; padding: 8px 12px; margin: 8px 0;
}
.bcx-bubble .rp-body details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.bcx-bubble .rp-body tg-spoiler {
    background: #555a6a; color: transparent; border-radius: 4px; padding: 0 2px;
}
.bcx-bubble .rp-body tg-spoiler:hover { color: #fff; background: rgba(255,255,255,0.1); }
.bcx-bubble .rp-body mark {
    background: rgba(255,200,84,0.35); color: #fff; padding: 0 4px; border-radius: 3px;
}
.bcx-bubble .rp-body s,
.bcx-bubble .rp-body del { color: rgba(255,255,255,0.55); }

/* Editable source textarea */
.bcx-source {
    width: 100%;
    min-height: 200px;
    box-sizing: border-box;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--glass-border);
    color: #fff;
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 13.5px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease;
}
.bcx-source:focus { border-color: var(--accent-color); }

/* Bottom action row */
.bcx-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 4px;
}
.bcx-userid {
    flex: 0 1 200px;
    min-width: 0;
    padding: 11px 14px;
    border-radius: 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    color: #fff;
    font-size: 14px;
    outline: none;
}
.bcx-userid:focus { border-color: var(--accent-color); }
.bcx-btn {
    flex: 1 1 180px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.18s ease;
}
.bcx-btn:active { transform: scale(0.97); }
.bcx-btn-ghost {
    background: rgba(255,255,255,0.07);
    color: #fff;
    border-color: var(--glass-border);
}
.bcx-btn-ghost:hover { background: rgba(255,255,255,0.13); }
.bcx-btn-primary {
    background: linear-gradient(135deg, #0a84ff, #0066cc);
    color: #fff;
    box-shadow: 0 4px 14px rgba(10,132,255,0.4);
}
.bcx-btn-primary:hover { background: linear-gradient(135deg, #0c8eff, #0072e0); }
.bcx-result {
    margin-top: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--glass-border);
    color: var(--hint-color);
    font-size: 13px;
    min-height: 20px;
    white-space: pre-wrap;
}
.bcx-result:empty { display: none; }

/* ========== App Footer ========== */
.app-footer {
    text-align: center;
    padding: 24px 16px 16px;
    font-size: 13px;
    color: var(--hint-color);
}

.app-footer a {
    color: var(--hint-color);
    text-decoration: none;
    transition: color 0.2s;
}

.app-footer a:hover {
    color: var(--accent-color);
}

.footer-sep {
    margin: 0 8px;
    opacity: 0.5;
}

