/* Skeleton Loader */
.skeleton-text {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    height: 1.2em;
    margin-bottom: 0.5em;
    opacity: 0.7;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

:root {
    /* Telegram Theme → Fallback Dark Theme */
    --bg-color: var(--tg-theme-bg-color, #0f172a);
    --text-color: var(--tg-theme-text-color, #f1f5f9);
    --primary-color: var(--tg-theme-button-color, #3b82f6);
    --primary-gradient: linear-gradient(135deg, var(--primary-color) 0%, color-mix(in srgb, var(--primary-color), #000 20%) 100%);
    --secondary-bg: var(--tg-theme-secondary-bg-color, #1e293b);
    --card-bg: var(--tg-theme-secondary-bg-color, rgba(30, 41, 59, 0.7));
    --hint-color: var(--tg-theme-hint-color, #94a3b8);
    --text-secondary: var(--hint-color);
    --link-color: var(--tg-theme-link-color, #3b82f6);
    --btn-text-color: var(--tg-theme-button-text-color, #ffffff);
    --glass-border: 1px solid rgba(128, 128, 128, 0.15);
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --processing-color: #eab308;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.15), 0 2px 4px -1px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-full: 24px;

    /* Profile Redesign Tokens */
    --profile-accent: #6366f1;
    --profile-accent-glow: rgba(99, 102, 241, 0.4);
    --profile-glass-bg: rgba(255, 255, 255, 0.04);
    --profile-glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --profile-premium-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

    /* Light Theme Tokens (переопределяются ниже) */
    --lt-surface: rgba(0, 0, 0, 0.06);
    --lt-surface-hover: rgba(0, 0, 0, 0.1);
    --lt-surface-active: rgba(0, 0, 0, 0.15);
    --lt-border: rgba(0, 0, 0, 0.12);
    --lt-border-strong: rgba(0, 0, 0, 0.2);
    --lt-input-bg: rgba(0, 0, 0, 0.05);
    --lt-divider: rgba(0, 0, 0, 0.08);
    --lt-text-on-dark-btn: #fff;
}

* {
    box-sizing: border-box;
}

/* --- VIEW TRANSITION SYSTEM --- */
#listView,
#detailView {
    will-change: transform, opacity;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
    opacity: 1;
}

#listView.view-exit {
    transform: translateX(-30px);
    opacity: 0;
    pointer-events: none;
}

#detailView.view-exit {
    transform: translateX(30px);
    opacity: 0;
    pointer-events: none;
}

#listView.view-enter {
    animation: slideFromLeft 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#detailView.view-enter {
    animation: slideFromRight 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideFromLeft {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideFromRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- PAGE EXIT ANIMATION --- */
body.page-exit {
    animation: pageExit 0.2s ease-in forwards;
    pointer-events: none;
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
    padding:
        max(20px, calc(var(--tg-content-safe-top, 0px) + 12px))
        max(20px, calc(var(--tg-content-safe-right, 0px) + 12px))
        max(20px, calc(var(--tg-content-safe-bottom, 0px) + 12px))
        max(20px, calc(var(--tg-content-safe-left, 0px) + 12px));
    background-color: var(--bg-color);
    color: var(--text-color);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    min-height: var(--app-viewport-height, 100dvh);
    overflow-x: hidden;
}

/* PROFILE REDESIGN CORE */
.profile-container {
    padding: 0 4px 100px 4px;
    /* Space for bottom content */
    animation: fadeInContainer 0.4s ease-out;
}

@keyframes fadeInContainer {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-section {
    margin-bottom: 24px;
    opacity: 0;
    animation: slideUpSection 0.5s ease-out forwards;
}

.profile-section:nth-child(1) {
    animation-delay: 0.1s;
}

.profile-section:nth-child(2) {
    animation-delay: 0.2s;
}

.profile-section:nth-child(3) {
    animation-delay: 0.3s;
}

.profile-section:nth-child(4) {
    animation-delay: 0.2s;
}

.profile-section:nth-child(n+5) {
    animation-delay: 0.25s;
}

@keyframes slideUpSection {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-card {
    background: var(--profile-glass-bg);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: var(--profile-glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.glass-card:active {
    transform: scale(0.99);
}

.section-label {
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--hint-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

h2,
h3 {
    text-align: center;
    margin-bottom: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

h2 small {
    display: block;
    margin-top: 5px;
    opacity: 0.7;
    font-weight: 400;
}

/* Main Header with Profile Button */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.main-header h2 {
    margin: 0;
}

.profile-btn {
    background: var(--primary-color);
    border: none;
    border-radius: 12px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    color: white;
}

.profile-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.profile-btn:active {
    transform: scale(0.95);
}

.profile-text {
    font-weight: 600;
    font-size: 0.95rem;
}

/* NEW PROFILE HEADER */
.profile-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 30px;
    padding-top: 20px;
}


/* PREMIUM CARD */
.premium-accent {
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 15px 35px rgba(245, 158, 11, 0.08);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(245, 158, 11, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.plan-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.plan-badge {
    padding: 6px 14px;
    background: var(--profile-premium-gradient);
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    color: white;
}

.plan-expiry-tag {
    font-size: 0.75em;
    color: var(--hint-color);
    margin-top: 6px;
}

.upgrade-action-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: white;
    font-weight: 600;
    font-size: 0.85em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.upgrade-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 20px 0;
}

/* LIMITS UI */
.limits-engagement {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.limits-header-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    font-weight: 500;
    color: var(--hint-color);
}

.limits-progress-wrapper {
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 5px;
    overflow: hidden;
}

.limits-progress-bar {
    height: 100%;
    background: var(--profile-premium-gradient);
    border-radius: 5px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.limits-footer-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    font-weight: 600;
}

.highlight {
    color: var(--success-color);
}

/* LANGUAGE CONTROL */
.language-segment-control {
    display: flex;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 12px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.segment-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    font-weight: 600;
    z-index: 1;
    cursor: pointer;
    transition: color 0.3s;
    color: var(--hint-color);
}

.segment-option.active {
    color: white;
}

.segment-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#profileView[data-lang="ru"] .segment-slider {
    transform: translateX(0);
}

#profileView[data-lang="en"] .segment-slider {
    transform: translateX(calc(100% + 8px));
}

/* REFERRAL HERO */
.referral-hero {
    border-top: 3px solid #f97316;
}

.referral-stats-mini {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}

.mini-stat {
    flex: 1;
    background: rgba(0, 0, 0, 0.15);
    padding: 12px;
    border-radius: 12px;
    text-align: center;
}

.mini-val {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
}

.mini-lbl {
    font-size: 0.7em;
    color: var(--hint-color);
    text-transform: uppercase;
}

.referral-actions-grid {
    display: flex;
    gap: 10px;
}

.referral-main-btn {
    flex: 1;
    background: var(--profile-accent);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
}

.referral-copy-btn {
    width: 50px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 12px;
    cursor: pointer;
}

/* KEY INPUT MODERN */
.key-input-wrapper {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.key-input-modern {
    background: transparent;
    border: none;
    color: white;
    padding: 10px;
    flex: 1;
    font-family: monospace;
    font-size: 1.1em;
}

.key-submit-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0 16px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

/* FOOTER CARD */
.support-footer-card {
    padding: 10px !important;
}

.footer-row {
    display: flex;
    gap: 10px;
}

.footer-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    padding: 14px;
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.footer-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* FAQ ACCORDION */
.faq-accordion .faq-item {
    margin-bottom: 8px;
}

.faq-accordion summary {
    background: rgba(255, 255, 255, 0.04);
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    font-weight: 500;
}

.faq-accordion summary::-webkit-details-marker {
    display: none;
}

.faq-accordion .chevron {
    font-size: 0.7em;
    opacity: 0.5;
    transition: transform 0.3s;
}

.faq-accordion details[open] .chevron {
    transform: rotate(180deg);
}

.faq-accordion .faq-answer {
    padding: 14px 16px;
    color: var(--hint-color);
    font-size: 0.85em;
    line-height: 1.5;
}

/* HISTORY MODERN */
.history-details-modern summary {
    text-align: center;
    color: var(--hint-color);
    font-size: 0.9em;
    cursor: pointer;
    list-style: none;
    padding: 10px;
}

.history-details-modern summary .chevron {
    font-size: 0.7em;
    margin-left: 5px;
}

/* Remove unused usage container styles if needed, but keeping for now if they are used elsewhere */


/* Cards — без backdrop-filter для производительности на iPhone 15 */
.recording-item,
.detail-card,
.glass-panel {
    background: var(--tg-theme-secondary-bg-color, var(--card-bg));
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    contain: layout style paint;
}

.recording-item {
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    /* Быстрый stagger — только 3 первые карточки, остальные без задержки */
    opacity: 0;
    animation: cardFadeIn 0.2s ease-out forwards;
}

.recording-item:nth-child(1) {
    animation-delay: 0.02s;
}

.recording-item:nth-child(2) {
    animation-delay: 0.04s;
}

.recording-item:nth-child(3) {
    animation-delay: 0.06s;
}

.recording-item:nth-child(n+4) {
    animation-delay: 0.08s;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recording-item:active {
    transform: scale(0.97);
    transition: transform 0.1s ease-out;
}

.detail-card {
    padding: 24px;
    margin-bottom: 24px;
}

.result-empty-card {
    padding: 40px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.result-empty-card .section-title {
    text-align: center;
    color: var(--hint-color);
    margin-bottom: 15px;
}

/* Premium Buttons с Ripple-эффектом */
.btn {
    display: block;
    width: 100%;
    padding: 16px;
    margin: 12px 0;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease-out, opacity 0.15s ease-out, box-shadow 0.15s ease-out;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Ripple-эффект (CSS-only) */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: width 0.5s ease-out, height 0.5s ease-out, opacity 0.4s ease-out;
}

.btn:active::after {
    width: 300px;
    height: 300px;
    opacity: 0;
    transition: 0s;
}

.btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.btn-loading {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}

.btn-loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    will-change: transform;
}

.btn-primary {
    background: var(--tg-theme-button-color, var(--primary-gradient));
    color: var(--tg-theme-button-text-color, #fff);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--tg-theme-text-color, inherit);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--tg-theme-hint-color, rgba(255, 255, 255, 0.2));
    color: var(--tg-theme-hint-color, inherit);
}

/* Usage Bar */
.usage-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.usage-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    padding: 0 8px 4px 8px;
    color: rgba(255, 255, 255, 0.6);
}

.usage-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease-out;
    /* Smoother transition */
    min-width: 5px;
    /* Ensure it's always slightly visible if > 0 */
}

/* Premium Transcribe Button */
.btn-premium {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border: none;
    padding: 18px;
    width: 100%;
    border-radius: 16px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-premium:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-premium:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.usage-bar-fill.danger {
    background: var(--danger-color);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    box-sizing: border-box;
    overflow-y: auto;
    padding:
        max(12px, var(--tg-content-safe-top, 0px))
        max(12px, var(--tg-content-safe-right, 0px))
        max(12px, var(--tg-content-safe-bottom, 0px))
        max(12px, var(--tg-content-safe-left, 0px));
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    max-height: calc(var(--app-viewport-height, 100dvh) - 24px - var(--tg-content-safe-top, 0px) - var(--tg-content-safe-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.pro-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}

/* --- iPhone SE & Small Screens Optimization --- */
@media screen and (max-width: 375px) {
    :root {
        --radius-lg: 16px;
    }

    .main-container {
        padding: 12px;
    }

    .pricing-card {
        padding: 16px;
    }

    .pc-price-value {
        font-size: 1.8em;
    }

    .profile-header h1 {
        font-size: 1.2rem;
    }

    .back-btn {
        padding: 4px 10px;
        font-size: 0.8em;
    }
}

/* Fix for overlapping back button on very small screens */
@media screen and (max-width: 320px) {

    .profile-header,
    .pricing-header {
        padding-top: 60px;
    }

    .back-btn,
    .back-btn-pricing {
        left: 50%;
        top: 20px;
        transform: translateX(-50%);
    }

    .back-btn:active,
    .back-btn-pricing:active {
        transform: translateX(-50%) scale(0.95);
    }
}

.hidden {
    display: none !important;
}

/* Анимированное скрытие для view-элементов (используется JS) */
.view-hidden {
    display: none !important;
}

/* --- ПУЛЬСАЦИЯ КНОПКИ ЗАПИСИ --- */
.btn-danger.recording-active {
    animation: recordPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

@keyframes recordPulse {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
    }

    50% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.6), 0 0 60px rgba(239, 68, 68, 0.2);
    }
}

/* --- ПЛАВНОЕ ПОЯВЛЕНИЕ RECORDING UI --- */
#recordingUI {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

#recordingUI:not(.hidden) {
    animation: recUIEnter 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes recUIEnter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Status Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-done {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.status-processing {
    background: rgba(234, 179, 8, 0.2);
    color: #facc15;
}

.status-queued,
.status-finalizing {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.status-recording {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

.status-rate_limited {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.status-error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.status-uploaded {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* Loader */
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin: 30px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader,
.status-spinner-only {
    will-change: transform;
}

/* Indeterminate Loader — без pulse-shadow (PERF: анимация box-shadow тяжёлая для GPU) */
.loader-indeterminate {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

/* Clean Delete Button */
.btn-delete-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 24px;
    padding: 14px 16px;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-delete-action:active {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(0.98);
}

.delete-icon {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* List Delete Button */
.delete-btn-list {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn-list:hover {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

/* Title Editing */
.detail-header-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.detail-title {
    margin: 0;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edit-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 1rem;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.edit-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

.title-edit-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    width: 100%;
}

.title-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    width: 100%;
    max-width: 250px;
    text-align: center;
}

.title-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.save-btn,
.cancel-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.list-edit-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0 4px;
    margin-left: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}

.list-edit-btn:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

.cancel-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Transcript Copy Button */
.transcript-copy-btn {
    background: transparent;
    border: none;
    color: var(--hint-color);
    cursor: pointer;
    font-size: 1rem;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    /* Push to right if in flex container */
    pointer-events: auto;
    /* Ensure clickable */
}

.transcript-copy-btn:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.transcript-copy-btn:active {
    transform: scale(0.95);
}

/* --- NEW: Circular Progress & Status Styles --- */

#status {
    position: relative;
    width: 100%;
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
    min-height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* Hide original loader completely if we reuse the ID */
#status.loader {
    width: auto;
    height: auto;
    border: none;
    border-radius: 0;
    margin: 20px 0;
    animation: none;
}

/* Override loader styles specifically for #status so old class doesn't break things */
.status-spinner-only {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 18px;
    /* space between spinner and text */
}

/* Progress Container */
.progress-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring-bg {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.05);
    /* Track */
}

.progress-ring-fill {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    /* We'll use conic-gradient via inline style */
    -webkit-mask: radial-gradient(transparent 58%, #000 60%);
    mask: radial-gradient(transparent 58%, #000 60%);
}

.progress-text-center {
    position: relative;
    z-index: 2;
    font-size: 0.9em;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.status-label {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
}

.status-error-box {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9em;
    width: 100%;
    max-width: 300px;
}


/* --- PREMIUM PLAYER UI (v2) --- */
.custom-player {
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.custom-player:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.3);
}

.play-pause-btn {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    /* Squircle style */
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.play-pause-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.player-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-color);
    opacity: 0.9;
}

/* Improved Scrubber */
.player-progress-container {
    height: 12px;
    /* Taller for easier touch */
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    overflow: visible;
    /* Allow thumb to overflow if needed, but usually inside */
    margin-top: 5px;
    touch-action: none;
    /* Prevent scroll while dragging */
}

.player-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
    pointer-events: none;
    /* Let clicks pass to container */
}

.player-progress-thumb {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform 0.1s;
    z-index: 2;
}

.player-progress-container:active .player-progress-thumb {
    transform: translate(-50%, -50%) scale(1.2);
}

.player-actions {
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    color: var(--text-color);
}

.player-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.player-action-btn:active {
    transform: scale(0.95);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.2);
    pointer-events: none;
}

/* --- PROFILE & PRICING (SPA MERGED) --- */

.profile-container,
.pricing-screen {
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.profile-header,
.pricing-header {
    position: relative;
    margin-bottom: 24px;
    text-align: center;
    padding-top: 50px;
    /* Отступ для кнопки назад */
}

.profile-header h1,
.pricing-header h1 {
    font-size: 1.4rem;
    margin: 0;
}

.profile-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--hint-color);
    margin-bottom: 12px;
    text-align: left;
}

/* Plan Card */
.plan-card {
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.plan-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.plan-name {
    font-size: 1.4rem;
    font-weight: 700;
}

.plan-name.plan-free {
    color: var(--hint-color);
}

.plan-name.plan-basic {
    color: #60a5fa;
}

.plan-name.plan-pro {
    background: linear-gradient(135deg, #f59e0b, #eab308);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.plan-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.plan-status.active {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

/* Limits Card */
.limits-card {
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.limits-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.limits-bar {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* History */
.history-list {
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.history-item {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-item:last-child {
    border-bottom: none;
}

.history-info {
    display: flex;
    flex-direction: column;
}

.history-type {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.history-date {
    font-size: 0.75rem;
    color: var(--hint-color);
}

.history-amount {
    font-size: 0.9rem;
    font-weight: 600;
}

.history-empty {
    padding: 30px;
    text-align: center;
    color: var(--hint-color);
}

/* Pricing Cards */
.pricing-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pricing-card {
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    position: relative;
}

.pricing-card.highlighted {
    border: 1px solid var(--primary-color);
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.1) 0%, var(--card-bg) 100%);
}

.pricing-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

.pricing-tier-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

.pricing-price-block {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 16px;
}

.pricing-price {
    font-size: 1.8rem;
    font-weight: 800;
}

.pricing-period {
    opacity: 0.6;
    font-size: 0.9rem;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.pricing-features li {
    font-size: 0.85rem;
    padding: 6px 0;
    padding-left: 24px;
    position: relative;
    opacity: 0.8;
}

.pricing-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
}

.btn-outline-crypto {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

.back-btn,
.back-btn-pricing {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 15px;
}

/* Key Input */
.key-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 14px;
    color: white;
    margin-bottom: 10px;
}

.key-result {
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.key-result.success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.key-result.error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.pricing-footer-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}


/* --- FAQ / Base Knowledge --- */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item[open] {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.faq-item summary {
    padding: 16px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    -webkit-user-select: none;
    user-select: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '＋';
    font-size: 1.2rem;
    color: var(--hint-color);
    transition: transform 0.3s ease;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
    color: var(--primary-color);
}

.faq-answer {
    padding: 0 16px 16px 16px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-color);
    opacity: 0.9;
}

.profile-section {
    margin-bottom: 32px;
}

/* --- ADMIN DASHBOARD --- */
.admin-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.admin-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}

.admin-stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--hint-color);
    margin-bottom: 4px;
}

.admin-stat-card .stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
}

.admin-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    font-size: 0.95rem;
}

.admin-actions {
    margin-top: 10px;
}

.history-item.admin-user {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
}

.admin-user-info {
    font-size: 0.9rem;
}

.admin-user-meta {
    font-size: 0.75rem;
    color: var(--hint-color);
}

/* --- Action Grid & Collapsible Transcript (Added) --- */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.action-grid> :last-child:nth-child(odd) {
    grid-column: span 2;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    /* Glass effect */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    width: 100%;
    /* Ensure full grid cell width */
    color: var(--text-color);
}

.action-btn:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.1);
}

.action-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.action-btn span {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Collapsible Transcript */
.transcript-details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    /* Remove default triangle */
    padding: 10px 0;
}

.transcript-details summary::-webkit-details-marker {
    display: none;
}

.transcript-details summary h3 {
    margin: 0;
    text-align: left;
    /* Override centered h3 */
}

.transcript-details .chevron {
    transition: transform 0.3s ease;
    font-size: 12px;
    color: var(--text-secondary);
}

.transcript-details[open] .chevron {
    transform: rotate(180deg);
}

.transcript-details .content-text {
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- LIGHT THEME FIXES --- */

/* Back Button - Make it visible */
.back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
    z-index: 10;
    min-width: 44px;
    min-height: 44px;
}

.back-btn:active {
    transform: translateY(-50%) scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}

/* Stats in Profile/Referral */
.stat-value {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--text-color);
}

.stat-label {
    font-size: 0.8em;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Referral Stats Container */
.referral-stats {
    background: var(--tg-theme-secondary-bg-color, rgba(0, 0, 0, 0.05)) !important;
    border: 1px solid var(--glass-border);
}

/* Trash Icon in List */
.delete-btn-list {
    color: var(--hint-color);
}

.delete-btn-list:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

/* Usage Bar Text */
.usage-text {
    color: var(--text-color);
}

/* ============================================
   PRICING SCREEN — Premium Conversion Design
   ============================================ */

.pricing-screen {
    padding: 0 16px 30px;
    overflow-y: auto;

}

.pricing-header {
    position: relative;
    text-align: center;
    padding: 50px 16px 20px;
    /* Увеличен padding-top для отступа от кнопки Назад */
}

.pricing-header h1 {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #e2e8f0, #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pricing-subtitle {
    color: var(--hint-color);
    font-size: 0.9em;
    margin: 0;
}

.back-btn-pricing {
    position: absolute;
    left: 16px;
    top: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    z-index: 10;
}

.back-btn-pricing:hover {
    background: rgba(255, 255, 255, 0.15);
}

.back-btn-pricing:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}

/* --- Pricing Cards Container --- */
.pricing-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 420px;
    margin: 0 auto;
}

/* --- Base Card --- */
.pricing-card {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-2px);
}

/* --- Popular Card (Basic) --- */
.pricing-card.pc-popular {
    background: rgba(99, 102, 241, 0.06);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    overflow: visible;
}

.pricing-card.pc-popular::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    padding: 2px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa, #6366f1);
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderShift 4s ease infinite;
    z-index: 0;
    pointer-events: none;
}

/* Контент карточки поверх анимированного бордера */
.pricing-card.pc-popular>* {
    position: relative;
    z-index: 1;
}

.pricing-card.pc-popular:hover {
    box-shadow: 0 8px 40px rgba(99, 102, 241, 0.25);
}

/* --- Premium Card (Pro) --- */
.pricing-card.pc-premium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(217, 119, 6, 0.04));
    border-color: rgba(245, 158, 11, 0.2);
}

.pricing-card.pc-premium:hover {
    box-shadow: 0 8px 40px rgba(245, 158, 11, 0.2);
}

/* --- Badge --- */
.pricing-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 2;
}

.pricing-badge.badge-popular {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    animation: badgePulse 2s ease infinite;
}

.pricing-badge.badge-premium {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

/* --- Card Header --- */
.pc-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 16px;
}

.pc-tier-name {
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text-color);
}

.pc-popular .pc-tier-name {
    color: #a78bfa;
}

.pc-premium .pc-tier-name {
    color: #fbbf24;
}

/* --- Price --- */
.pc-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 18px;
}

.pc-price-value {
    font-size: 2.2em;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.pc-popular .pc-price-value {
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pc-premium .pc-price-value {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pc-price-period {
    font-size: 0.85em;
    color: var(--hint-color);
}

/* --- Features List --- */
.pc-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pc-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88em;
    color: #cbd5e1;
}

.pc-features li .feat-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
}

.pricing-card .feat-icon {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

.pc-popular .feat-icon {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.pc-premium .feat-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

/* --- CTA Button --- */
.pc-cta {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 14px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.pc-cta-free {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pc-cta-free:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

.pc-cta-popular {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    animation: ctaGlow 2.5s ease infinite;
}

.pc-cta-popular:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
}

.pc-cta-premium {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
}

.pc-cta-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 30px rgba(245, 158, 11, 0.45);
}

/* --- Alternative Payment Row --- */
.pc-alt-payments {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.pc-alt-btn {
    flex: 1;
    padding: 10px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    font-size: 0.78em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-family: inherit;
    white-space: nowrap;
    min-height: 44px;
}

.pc-alt-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.2);
}

.pc-alt-btn.alt-ton {
    border-color: rgba(0, 152, 234, 0.3);
    color: #0098EA;
}

.pc-alt-btn.alt-ton:hover {
    background: rgba(0, 152, 234, 0.1);
}

[data-payment-action]:disabled {
    cursor: wait;
    opacity: 0.58;
    transform: none !important;
    box-shadow: none;
}

[data-payment-action].payment-action-busy {
    opacity: 0.9;
}

.payment-feedback {
    position: fixed;
    z-index: 12000;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    width: min(420px, calc(100vw - 32px));
    box-sizing: border-box;
    padding: 13px 16px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    box-shadow: 0 16px 48px rgba(2, 6, 23, 0.32);
    font-size: 0.9rem;
    line-height: 1.45;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.payment-feedback.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.payment-feedback-error { border-color: rgba(248, 113, 113, 0.4); }
.payment-feedback-success { border-color: rgba(52, 211, 153, 0.4); }

/* --- Subscription checkout sheet --- */
.payment-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    box-sizing: border-box;
    overflow-y: auto;
    padding:
        max(12px, var(--tg-content-safe-top, 0px))
        max(12px, var(--tg-content-safe-right, 0px))
        max(12px, var(--tg-content-safe-bottom, 0px))
        max(12px, var(--tg-content-safe-left, 0px));
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.payment-sheet-overlay.is-visible { opacity: 1; }

body:has(.payment-sheet-overlay),
body:has(#upgradeModal.active) {
    overflow: hidden;
    overscroll-behavior: none;
}

.payment-sheet {
    position: relative;
    width: min(100%, 480px);
    padding: 26px;
    border: 1px solid var(--vx-border, rgba(148, 163, 184, 0.18));
    border-radius: 26px;
    background: var(--vx-surface, #11131a);
    color: var(--vx-text, #f8fafc);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    box-sizing: border-box;
    max-height: calc(var(--app-viewport-height, 100dvh) - 24px - var(--tg-content-safe-top, 0px) - var(--tg-content-safe-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.payment-sheet-kicker { margin-bottom: 6px; color: var(--vx-brand, #818cf8); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.payment-sheet h2 { margin: 0; padding-right: 36px; color: var(--vx-text, #f8fafc); font-size: 1.45rem; line-height: 1.2; }
.payment-sheet-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--vx-muted, #94a3b8); font-size: 30px; cursor: pointer; }
.payment-sheet-close:hover { background: rgba(148, 163, 184, .1); }
.payment-order-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0; padding: 14px 16px; border-radius: 16px; background: var(--vx-surface-raised, rgba(255,255,255,.06)); }
.payment-order-summary > span, .payment-order-summary small { display: block; }
.payment-order-summary strong { color: var(--vx-text, #f8fafc); font-size: .96rem; }
.payment-order-summary > strong { white-space: nowrap; font-size: 1.08rem; }
.payment-order-summary small { margin-top: 3px; color: var(--vx-muted, #94a3b8); font-size: .76rem; }
.payment-methods { margin: 0 0 17px; padding: 0; border: 0; }
.payment-methods legend { margin-bottom: 8px; color: var(--vx-muted, #cbd5e1); font-size: .8rem; font-weight: 700; }
.payment-method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.payment-method-card { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; gap: 9px; align-items: center; min-height: 62px; padding: 10px; border: 1px solid var(--vx-border, rgba(148, 163, 184, .2)); border-radius: 15px; background: var(--vx-surface, #11131a); cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.payment-method-card:has(input:checked) { border-color: var(--vx-brand, #6366f1); background: rgba(99, 102, 241, .09); box-shadow: inset 0 0 0 1px var(--vx-brand, #6366f1); }
.payment-method-card input { position: absolute; opacity: 0; pointer-events: none; }
.payment-method-card:has(input:focus-visible) { outline: 3px solid rgba(99,102,241,.22); outline-offset: 2px; }
.payment-method-card strong, .payment-method-card small { display: block; overflow: hidden; text-overflow: ellipsis; }
.payment-method-card strong { color: var(--vx-text, #f8fafc); font-size: .84rem; white-space: nowrap; }
.payment-method-card small { margin-top: 2px; color: var(--vx-muted, #94a3b8); font-size: .68rem; line-height: 1.25; }
.payment-method-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--vx-surface-raised, rgba(255,255,255,.07)); font-size: 18px; }
.payment-method-icon-sbp { background: linear-gradient(145deg, #f1f5ff, #e5f8f4); color: #1e293b; font-size: .67rem; font-weight: 900; letter-spacing: -.02em; }
.payment-method-check { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--vx-brand, #6366f1); color: white; font-size: 11px; opacity: 0; transform: scale(.7); transition: .16s ease; }
.payment-method-card:has(input:checked) .payment-method-check { opacity: 1; transform: scale(1); }
.payment-sheet-field { display: grid; gap: 7px; color: var(--vx-muted, #cbd5e1); font-size: 0.8rem; font-weight: 700; }
.payment-sheet-field input { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--vx-border, rgba(148, 163, 184, 0.22)); border-radius: 12px; outline: none; background: var(--vx-surface-raised, rgba(255,255,255,0.045)); color: var(--vx-text, #f8fafc); font: inherit; font-weight: 500; }
.payment-sheet-field input:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.16); }
.payment-renew-toggle { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; margin: 14px 0 0; padding: 13px; border: 1px solid rgba(129,140,248,.28); border-radius: 14px; background: rgba(99,102,241,.08); cursor: pointer; }
.payment-renew-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.payment-toggle-ui { width: 42px; height: 24px; padding: 2px; border-radius: 999px; background: #475569; transition: .18s ease; box-sizing: border-box; }
.payment-toggle-ui::after { content: ''; display: block; width: 20px; height: 20px; border-radius: 50%; background: white; transition: .18s ease; }
.payment-renew-toggle input:checked + .payment-toggle-ui { background: #6366f1; }
.payment-renew-toggle input:checked + .payment-toggle-ui::after { transform: translateX(18px); }
.payment-renew-toggle:has(input:focus-visible) { outline: 3px solid rgba(99,102,241,.2); outline-offset: 2px; }
.payment-renew-toggle strong, .payment-renew-toggle small { display: block; }
.payment-renew-toggle strong { color: var(--vx-text, #f8fafc); font-size: .88rem; }
.payment-renew-toggle small { margin-top: 3px; color: var(--vx-muted, #94a3b8); font-size: .72rem; line-height: 1.35; }
.payment-method-context { min-height: 30px; margin: 8px 2px 0; color: var(--vx-muted, #94a3b8); font-size: .7rem; line-height: 1.35; }
.payment-sheet-error { min-height: 18px; margin: 2px 0; color: #fda4af; font-size: .78rem; }
.payment-sheet-submit { width: 100%; min-height: 50px; padding: 13px 16px; border: 0; border-radius: 14px; background: linear-gradient(135deg,#596cf6,#7547e8); box-shadow: 0 10px 24px rgba(89,108,246,.25); color: white; font: inherit; font-weight: 800; line-height: 1.25; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.payment-sheet-submit:hover { transform: translateY(-1px); box-shadow: 0 13px 28px rgba(89,108,246,.32); }
.payment-sheet-submit:active { transform: translateY(0); }
.payment-sheet-note { margin: 11px 6px 0; text-align: center; color: var(--vx-muted, #64748b); font-size: .68rem; line-height: 1.4; }
.payment-sheet-note a { color: var(--vx-brand, #818cf8); }

body.tg-light .payment-sheet-overlay { background: rgba(34, 43, 66, .46); }
body.tg-light .payment-sheet { box-shadow: 0 24px 80px rgba(38, 49, 80, .24); }
body.tg-light .payment-method-card:has(input:checked) { background: #f0f3ff; }
body.tg-light .payment-renew-toggle { background: #f3f5ff; }

@media (min-width: 640px) {
    .payment-sheet-overlay { align-items: center; }
}

.auto-renew-profile { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 8px; color: #86efac; font-size: .76rem; }
.auto-renew-profile button { border: 0; padding: 4px 7px; border-radius: 7px; background: rgba(244,63,94,.12); color: #fda4af; font: inherit; cursor: pointer; }

/* --- Pricing Divider --- */
.pricing-divider {
    text-align: center;
    color: var(--hint-color);
    font-size: 0.8em;
    margin: 4px 0;
    opacity: 0.6;
}

/* --- Payment Reordering for English -- */
body.lang-en .pricing-pay-container {
    display: flex !important;
    flex-direction: column-reverse !important;
    gap: 10px;
}

body.lang-en .pricing-pay-container .pc-cta {
    margin-top: 0 !important;
}

body.lang-en .pricing-pay-container .pc-alt-payments {
    margin-top: 5px !important;
}

/* --- Pricing Animations --- */
@keyframes borderShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(99, 102, 241, 0.6);
    }
}

@keyframes ctaGlow {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    }

    50% {
        box-shadow: 0 6px 35px rgba(99, 102, 241, 0.55);
    }
}

/* --- Upgrade Modal Enhanced --- */
.modal-content .upgrade-icon {
    font-size: 3em;
    margin-bottom: 12px;
    animation: floatIcon 3s ease-in-out infinite;
}

.modal-content .upgrade-remaining {
    display: inline-block;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-content .upgrade-features {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.modal-content .upgrade-features li {
    padding: 8px 0;
    color: #cbd5e1;
    font-size: 0.92em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-cta-primary {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    font-size: 1.05em;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    transition: all 0.25s ease;
    font-family: inherit;
    animation: ctaGlow 2.5s ease infinite;
}

.modal-cta-primary.cta-basic {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.modal-cta-primary.cta-pro {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.modal-cta-secondary {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: transparent;
    color: var(--hint-color);
    font-size: 0.9em;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.modal-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* --- Save Badge (скидка или экономия) --- */
.pc-save-badge {
    display: inline-block;
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    font-size: 0.72em;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 8px;
}

/* --- AI REPORT UI REDESIGN --- */
.ai-report-card {
    background: var(--card-bg);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 24px 20px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.report-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-section:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 24px;
}

.report-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text-color);
    letter-spacing: -0.3px;
}

.report-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.1em;
}

.icon-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.icon-amber {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.icon-green {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.icon-red {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.icon-purple {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.icon-indigo {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.report-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.95em;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.report-bullet {
    margin-top: 4px;
    /* Align with first line of text */
    flex-shrink: 0;
    font-size: 0.8em;
}

/* Specific bullet colors matching the section theme */
.bullet-blue {
    color: #60a5fa;
}

.bullet-amber {
    color: #fbbf24;
}

.bullet-green {
    color: #4ade80;
}

.bullet-red {
    color: #f87171;
}

.bullet-purple {
    color: #a78bfa;
}

/* AI Report Summary Text */
.report-summary-text {
    font-size: 1.05em;
    line-height: 1.6;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Tasks Table specific for AI Report */
.report-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    text-align: left;
}

.report-table th,
.report-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.report-table th {
    font-weight: 500;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.03);
}

.report-table tr:last-child td {
    border-bottom: none;
}

.report-table td {
    color: #e2e8f0;
}

/* --- PREMIUM CHAT UI --- */
.premium-chat-card {
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.4) 0%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.premium-chat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #8b5cf6, #3b82f6, transparent);
    opacity: 0.7;
}

.premium-ai-message {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%) !important;
    border: 1px solid rgba(167, 139, 250, 0.3) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.premium-input-wrapper {
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 8px;
    transition: all 0.3s ease;
}

.premium-input-wrapper:focus-within {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
    background: rgba(0, 0, 0, 0.3);
}

.premium-chat-input {
    flex: 1;
    font-size: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: white;
    outline: none;
}

.premium-send-btn {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    color: white;
}

.premium-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

/* =============================================
   UTILITY CLASSES (вынесено из inline-стилей)
   ============================================= */

/* Подзаголовок приложения в header */
.app-subtitle {
    font-size: 0.6em;
    font-weight: normal;
    color: var(--hint-color);
}

/* Блок записи (UI таймер + предупреждения) */
#recordingUI {
    text-align: center;
    margin-top: 10px;
}

/* Отображение таймера */
.timer-display {
    font-size: 2em;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

/* Текст «Лимит: 10 мин» */
.recording-limit-text {
    font-size: 0.8em;
    color: #888;
}

/* Предупреждение «Не выключайте экран» */
.recording-warning {
    display: none;
    color: #f59e0b;
    font-size: 0.8em;
    margin-top: 5px;
    padding: 5px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 6px;
}

/* Разделитель «или» */
.or-separator {
    text-align: center;
    margin: 15px 0;
    color: #999;
    font-size: 0.9em;
}

/* Скрытый file input */
.file-input-hidden {
    display: none;
}

/* Заголовок «Мои записи» */
.recordings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.recordings-header h3 {
    margin: 0;
}

/* Контейнер поиска */
.search-container {
    margin-bottom: 15px;
}

/* Поле поиска */
.search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    outline: none;
    font-size: 0.95em;
}

/* Skeleton width-варианты */
.skel-w-60 {
    width: 60%;
}

.skel-w-40 {
    width: 40%;
}

.skel-w-55 {
    width: 55%;
}

.skel-w-35 {
    width: 35%;
}

.skel-w-65 {
    width: 65%;
}

.skel-w-45 {
    width: 45%;
}

/* Описание в модалке upgrade */
.upgrade-desc {
    margin-bottom: 16px;
    color: #94a3b8;
    font-size: 0.9em;
}

/* Юридический блок (модалка, pricing footer) */
.legal-footer {
    margin-top: 16px;
    font-size: 0.7em;
    color: #64748b;
    opacity: 0.8;
}

.legal-link {
    color: var(--primary-color);
}

/* Кнопка «Назад» (detail view) */
.btn-back-detail {
    margin-bottom: 15px;
}

/* Статус кошелька TON */
.wallet-status {
    margin-top: 8px;
    font-size: 0.85em;
}

/* Скрытый referral link input */
.referral-link-hidden {
    display: none;
}

/* Pricing footer */
.pricing-footer {
    text-align: center;
    margin-top: 30px;
    padding-bottom: 20px;
}

.pricing-legal {
    font-size: 0.8em;
    color: var(--hint-color);
    margin-bottom: 15px;
}

.pricing-legal-link {
    color: var(--hint-color);
    text-decoration: underline;
    margin: 0 10px;
}

.pricing-version {
    font-size: 0.7em;
    color: var(--hint-color);
    opacity: 0.5;
}

/* Метрика noscript-пиксель */
.noscript-pixel {
    position: absolute;
    left: -9999px;
}

/* =========================================================
   VORTEX 2026 — локальный редизайн основного сценария
   ========================================================= */
:root {
    --vx-bg: #090d18;
    --vx-surface: #121827;
    --vx-surface-raised: #171e2d;
    --vx-border: #222b3e;
    --vx-text: #f7f8fc;
    --vx-muted: #8c97ad;
    --vx-brand: #6f84ff;
    --vx-record: #ff3d5d;
    --vx-success: #61d9a5;
}

body:not(.tg-light) {
    background: var(--vx-bg);
    color: var(--vx-text);
}

#listView {
    max-width: 430px;
    margin: 0 auto;
    padding: 26px 24px 36px;
    box-sizing: border-box;
    min-height: var(--app-viewport-height, 100dvh);
    overflow: hidden;
    position: relative;
}

#listView::before {
    content: "";
    position: absolute;
    width: 440px;
    height: 440px;
    left: 50%;
    top: 190px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(55, 75, 255, .18), transparent 67%);
    pointer-events: none;
}

.main-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 38px;
}

.app-identity { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--vx-text); }
.app-identity-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid rgba(111,132,255,.24); border-radius: 11px; background: rgba(111,132,255,.1); color: #91a0ff; }
.app-identity-icon svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.app-identity-title { overflow: hidden; color: var(--vx-text); font-size: 15px; font-weight: 750; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }

.profile-btn {
    width: auto !important;
    height: 40px !important;
    min-width: 0;
    padding: 0 14px 0 11px !important;
    border-radius: 13px !important;
    border: 1px solid var(--vx-border) !important;
    background: var(--vx-surface-raised) !important;
    color: var(--vx-text) !important;
    box-shadow: none !important;
    gap: 7px;
}
.profile-btn:hover { border-color: rgba(111,132,255,.5) !important; background: color-mix(in srgb, var(--vx-surface-raised), var(--vx-brand) 8%) !important; box-shadow: none; }
.profile-btn:focus-visible, #btnUpload:focus-visible { outline: 3px solid color-mix(in srgb, var(--vx-brand), transparent 65%); outline-offset: 3px; }
.profile-icon { display: grid; place-items: center; width: 19px; height: 19px; flex: 0 0 19px; color: #91a0ff; }
.profile-icon svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-text { display: inline; color: inherit; font-size: 13px; font-weight: 650; }

.recorder-intro { position: relative; z-index: 2; margin-bottom: 34px; }
.recorder-intro h1 { margin: 0; color: var(--vx-text); font-size: clamp(30px, 8vw, 36px); line-height: 1.14; letter-spacing: -.035em; }
.recorder-intro p { max-width: 350px; margin: 14px 0 0; color: var(--vx-muted); font-size: 15px; line-height: 1.55; }

.recorder-controls { position: relative; z-index: 2; text-align: center; margin-bottom: 54px; }
#btnStart {
    display: flex;
    width: 174px;
    height: 174px;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    padding: 40px 24px;
    background: radial-gradient(circle at 50% 38%, #ff7187 0, var(--vx-record) 47%, #9e1737 100%) !important;
    color: white;
    font-size: 15px;
    line-height: 1.3;
    box-shadow: 0 18px 42px rgba(255, 61, 93, .34), inset 0 1px 1px rgba(255,255,255,.35);
    flex-direction: column;
    gap: 12px;
}
#btnStart::before {
    content: "";
    width: 25px;
    height: 32px;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Crect x='7' y='1' width='10' height='19' rx='5' fill='white' stroke='white'/%3E%3Cpath d='M3 15v1a9 9 0 0 0 18 0v-1M12 25v6M7 31h10'/%3E%3C/svg%3E");
}
#btnStart:active { transform: scale(.96); }
#btnStart.limit-reached {
    opacity: 1 !important;
    background: linear-gradient(145deg, #7888ff 0%, #5667df 52%, #3946a8 100%) !important;
    box-shadow: 0 18px 42px rgba(86, 103, 223, .38), inset 0 1px 1px rgba(255,255,255,.35);
    font-size: 14px;
    cursor: pointer;
}
#btnStart.limit-reached::before {
    content: "↗";
    width: auto;
    height: auto;
    background: none;
    font-size: 32px;
    line-height: 1;
}
#btnStop {
    width: 168px;
    min-height: 54px;
    margin: 20px auto 0;
    border: 0;
    border-radius: 18px;
    padding: 15px 20px;
    background: var(--vx-record) !important;
    box-shadow: 0 14px 34px rgba(255,61,93,.3);
    font-size: 15px;
    font-weight: 700;
    transition: transform .18s ease, opacity .18s ease, background .18s ease;
}
#btnStop::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px; border-radius: 3px; background: currentColor; vertical-align: -1px; }
#btnStop.recording-active { animation: none; }
#btnStop:active:not(:disabled) { transform: scale(.97); }
#btnStop.is-saving { width: 190px; background: #283149 !important; box-shadow: none; color: #cbd3e6; }
#btnStop.is-saving::before { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; background: transparent; animation: vxSpin .8s linear infinite; }

#listView:has(#recordingUI:not(.hidden)) .recorder-intro { display: none; }
#listView:has(#recordingUI:not(.hidden)) .main-header { margin-bottom: 20px; }
#listView:has(#recordingUI:not(.hidden)) .recorder-controls { margin-top: 12px; }
#listView:has(#recordingUI:not(.hidden)) .or-separator,
#listView:has(#recordingUI:not(.hidden)) .recorder-privacy { display: none; }
.recorder-privacy { margin-top: 14px; color: #687389; font-size: 12px; }
.or-separator { margin: 24px 0 12px; color: #5f6a80; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
#btnUpload {
    display: inline-flex;
    width: auto;
    min-width: 210px;
    min-height: 50px;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid rgba(111,132,255,.32);
    border-radius: 15px;
    background: rgba(111,132,255,.1) !important;
    color: #cbd3ff !important;
    box-shadow: 0 7px 22px rgba(0,0,0,.12);
    font-size: 14px;
    font-weight: 700;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
#btnUpload:hover { border-color: rgba(111,132,255,.58); background: rgba(111,132,255,.16) !important; box-shadow: 0 9px 26px rgba(0,0,0,.16); transform: translateY(-1px); }
#btnUpload:active { background: rgba(111,132,255,.2) !important; transform: scale(.98); }
.upload-icon { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 20px; }
.upload-icon svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

#recordingUI:not(.hidden) { margin: 8px 0 2px; }
.recording-start-status { display:flex; align-items:center; gap:12px; width:min(100%, 330px); padding:13px 15px; border:1px solid rgba(111,132,255,.24); border-radius:16px; background:rgba(111,132,255,.08); color:var(--vx-text); text-align:left; box-sizing:border-box; }
.recording-start-spinner { flex:0 0 22px; width:22px; height:22px; border:2px solid rgba(111,132,255,.2); border-top-color:var(--vx-brand); border-radius:50%; animation:vxSpin .8s linear infinite; }
.recording-start-title { font-size:14px; font-weight:700; line-height:1.3; }
.recording-start-hint { margin-top:3px; color:var(--vx-muted); font-size:11px; line-height:1.35; }
#btnStart:disabled:not(.limit-reached) { color:transparent !important; cursor:wait; opacity:.82; }
#btnStart:disabled:not(.limit-reached)::before { width:32px; height:32px; border:3px solid rgba(255,255,255,.28); border-top-color:#fff; border-radius:50%; background:none; animation:vxSpin .8s linear infinite; }
.recording-live-badge { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 24px; padding: 8px 12px; border-radius: 999px; background: rgba(255,61,93,.12); color: #ff7890; font-size: 11px; font-weight: 750; letter-spacing: .08em; }
.recording-live-badge span { width: 8px; height: 8px; border-radius: 50%; background: var(--vx-record); animation: vxLive 1.5s ease-in-out infinite; }
.timer-display { color: var(--vx-text); font-size: 62px; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.recording-waveform { height: 112px; margin: 28px auto 18px; padding: 0 18px; display: flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid var(--vx-border); border-radius: 24px; background: rgba(18,24,39,.72); }
.recording-waveform i { width: 5px; height: 20px; border-radius: 999px; background: linear-gradient(#ff7890, var(--vx-record)); animation: vxWave 1.15s ease-in-out infinite; transform-origin: center; }
.recording-waveform i:nth-child(2n) { animation-delay: -.2s; }
.recording-waveform i:nth-child(3n) { animation-delay: -.45s; }
.recording-waveform i:nth-child(4n) { animation-delay: -.7s; }
.recording-limit-text { color: #ff7890; margin-top: 10px; }
.recording-warning { max-width: 330px; margin: 14px auto 0; padding: 11px 14px; border: 1px solid rgba(111,132,255,.18); border-radius: 12px; background: rgba(111,132,255,.07); color: #8f9bb0; line-height: 1.4; }

@keyframes vxSpin { to { transform: rotate(360deg); } }
@keyframes vxLive { 0%,100% { opacity:.45; transform:scale(.8); } 50% { opacity:1; transform:scale(1); } }
@keyframes vxWave { 0%,100% { height:18px; opacity:.55; } 50% { height:72px; opacity:1; } }

.recordings-header { position: relative; z-index: 2; margin: 0 0 14px; }
.recordings-header h3 { color: var(--vx-text); font-size: 19px; letter-spacing: -.02em; }
.recordings-link { color: #91a0ff; font-size: 13px; font-weight: 600; }
.search-container { position: relative; z-index: 2; }
.search-input { padding: 13px 16px; border-color: var(--vx-border); background: var(--vx-surface); color: var(--vx-text); }
#recordingsList { position: relative; z-index: 2; }
.recording-item {
    border: 1px solid var(--vx-border) !important;
    border-radius: 20px !important;
    background: var(--vx-surface) !important;
    box-shadow: none !important;
    padding: 17px 16px !important;
}
.recording-title { color: var(--vx-text) !important; font-weight: 650; }
.recording-date { color: var(--vx-muted) !important; }
.status-badge.status-ready, .status-badge.completed, .status-badge.ready { color: var(--vx-success) !important; }

#detailView { max-width: 430px; margin: 0 auto; padding: 24px; box-sizing: border-box; }
.btn-back-detail { width: 44px !important; height: 44px; padding: 0 !important; border-radius: 50% !important; font-size: 0 !important; }
.btn-back-detail::before { content: "‹"; font-size: 32px; color: var(--vx-muted); }
.detail-header-wrapper { margin: 18px 0 22px; }
.detail-title { color: var(--vx-text); font-size: 28px; letter-spacing: -.035em; }
.detail-card, .ai-report-card { border: 1px solid var(--vx-border) !important; border-radius: 20px !important; background: var(--vx-surface) !important; box-shadow: none !important; }
.ai-report-card { gap: 0 !important; padding: 4px 20px !important; overflow: hidden; }
.report-section { border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; padding: 20px 0 !important; }
.report-section:not(:last-child) { border-bottom: 1px solid var(--vx-border) !important; }
.report-header { font-size: 16px !important; color: var(--vx-text) !important; }
.report-icon { width: 34px !important; height: 34px !important; flex: 0 0 34px; font-size: 16px !important; border-radius: 11px !important; background: #1c2742 !important; }
.icon-amber { background: rgba(245,158,11,.12) !important; }
.icon-green { background: rgba(97,217,165,.12) !important; }
.icon-red { background: rgba(255,84,113,.12) !important; }
.icon-purple { background: rgba(168,85,247,.12) !important; }
.report-list { margin: 2px 0 0 !important; padding: 0 !important; }
.report-list-item { align-items: flex-start !important; padding: 8px 0 !important; color: #b3bdd0 !important; line-height: 1.5; }
.report-bullet { margin-top: 7px; font-size: 7px !important; }
.transcript-details .content-text { margin-top: 18px !important; border: 1px solid var(--vx-border); background: #0e1421 !important; }
.section-title { color: var(--vx-text) !important; font-weight: 700; }
.report-summary-text, .content-text { color: #b2bbce !important; line-height: 1.6; }
.report-overview { font-size: 14px; line-height: 1.72 !important; }
.report-overview p { margin: 0 0 14px; }
.report-overview p:last-child { margin-bottom: 0; }
.action-list .report-list-item { gap: 12px !important; }
.action-check { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid #5274ff; border-radius: 7px; background: rgba(82,116,255,.08); }
.attention-item { display: grid !important; grid-template-columns: auto 1fr; gap: 10px !important; }
.attention-tag { align-self: start; min-width: 50px; padding: 4px 7px; border-radius: 7px; font-size: 10px; font-weight: 750; text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.attention-tag.is-risk { color: #ff8ba0; background: rgba(255,84,113,.12); }
.attention-tag.is-question { color: #b4a2ff; background: rgba(148,121,255,.12); }
.premium-chat-container { border: 1px solid rgba(111,132,255,.35) !important; border-radius: 22px !important; background: linear-gradient(145deg, #151d33, #111727) !important; }

.flow-stage-card { padding: 22px !important; text-align: left; overflow: hidden; }
.flow-timeline { display: grid; grid-template-columns: repeat(4,1fr); position: relative; margin-bottom: 28px; }
.flow-timeline::before { content:""; position:absolute; left: 11%; right: 11%; top: 11px; height: 2px; background: var(--vx-border); }
.flow-step { position: relative; z-index: 1; display:flex; flex-direction:column; align-items:center; gap:8px; color:#637087; font-size:11px; font-weight:650; text-align:center; }
.flow-step-dot { display:grid; place-items:center; width:22px; height:22px; border:2px solid var(--vx-border); border-radius:50%; background:var(--vx-surface); color:#08130e; font-size:11px; }
.flow-step.is-complete { color:#7d8aa0; }
.flow-step.is-complete .flow-step-dot { border-color:var(--vx-success); background:var(--vx-success); }
.flow-step.is-current { color:#b9c4ff; }
.flow-step.is-current .flow-step-dot { border-color:var(--vx-brand); box-shadow:0 0 0 5px rgba(111,132,255,.12); }
.flow-stage-main { display:flex; align-items:center; gap:16px; }
.flow-orbit { display:grid; place-items:center; flex:0 0 48px; width:48px; height:48px; border:2px solid rgba(111,132,255,.18); border-top-color:var(--vx-brand); border-radius:50%; animation:vxSpin 1s linear infinite; }
.flow-orbit span { width:12px; height:12px; border-radius:50%; background:var(--vx-brand); box-shadow:0 0 18px rgba(111,132,255,.7); }
.flow-orbit.is-static { border-color:rgba(97,217,165,.28); animation:none; color:var(--vx-success); }
.flow-orbit.is-static span { width:auto; height:auto; background:none; box-shadow:none; }
.flow-stage-copy { min-width:0; }
.flow-stage-title { color:var(--vx-text); font-size:17px; font-weight:750; }
.flow-stage-detail { margin-top:5px; color:#929db2; font-size:13px; line-height:1.5; }
.flow-progress { height:7px; margin-top:22px; overflow:hidden; border-radius:999px; background:#20283a; }
.flow-progress span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#536dff,#8c9dff); transition:width .45s ease; }
.flow-progress-value { margin-top:7px; color:#93a2ff; font-size:12px; font-weight:700; text-align:right; }
.flow-stage-meta { margin-top:18px; color:#78849a; font-size:12px; }
.flow-stage-updated { margin-top:4px; color:#5f6b80; font-size:11px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; }
    .recording-live-badge span,
    .recording-start-spinner,
    .recording-waveform i,
    .flow-orbit,
    #btnStop.is-saving::before,
    .pc-cta-popular,
    .pricing-card,
    .popular-badge { animation: none !important; }
    .view-enter, .view-exit { animation: none !important; transition: none !important; }
}

@media (max-width: 420px) {
    #listView, #detailView { padding-left: 20px; padding-right: 20px; }
    .recorder-controls { margin-bottom: 46px; }
    #btnStart { width: 164px; height: 164px; }
}

/* === ADMIN VIEW === */

/* Заголовок блока логов */
.admin-logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.admin-logs-header .section-title {
    margin: 0;
}

/* Кнопка «Обновить» логи */
.admin-logs-refresh-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Визуализатор логов (терминал) */
.admin-log-viewer {
    background: #000;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    padding: 12px;
    border-radius: 12px;
    height: 200px;
    overflow-y: auto;
    border: 1px solid #333;
}

/* Плейсхолдер в логах */
.admin-log-placeholder {
    opacity: 0.5;
}

/* Select ключей (admin) */
.admin-key-select {
    margin-bottom: 10px;
}

/* ============================================================
   LIGHT THEME — полная поддержка Telegram Light Mode
   Активируется через: body.tg-light или prefers-color-scheme
   ============================================================ */

/* Автоопределение через CSS media (браузер/превью) */
@media (prefers-color-scheme: light) {
    :root {
        --profile-glass-bg: rgba(0, 0, 0, 0.04);
        --profile-glass-border: 1px solid rgba(0, 0, 0, 0.1);
    }
}

/* --- Основной триггер: класс body.tg-light --- */
body.tg-light {
    color-scheme: light;
}

/* --- Автоопределение для браузера --- */
@media (prefers-color-scheme: light) {
    body {
        color-scheme: light;
    }
}

/* Блок-вспомогательный: переопределяем все "тёмные" паттерны */
body.tg-light .glass-card,
body.tg-light .recording-item,
body.tg-light .detail-card,
body.tg-light .glass-panel,
body.tg-light .plan-card,
body.tg-light .limits-card,
body.tg-light .history-list,
body.tg-light .pricing-card,
body.tg-light .modal-content,
body.tg-light .custom-player,
body.tg-light .ai-report-card,
body.tg-light .premium-chat-card,
body.tg-light .key-card {
    background: var(--tg-theme-secondary-bg-color, #f1f5f9);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Профильные glass-карточки */
body.tg-light .glass-card {
    background: var(--tg-theme-secondary-bg-color, #f8fafc);
    border: 1px solid rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* Кнопка "Назад" — была белый текст на белом фоне */
body.tg-light .back-btn,
body.tg-light .back-btn-pricing {
    background: rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: var(--tg-theme-text-color, #1e293b);
}

body.tg-light .back-btn:hover,
body.tg-light .back-btn-pricing:hover {
    background: rgba(0, 0, 0, 0.12);
}

body.tg-light .back-btn:active {
    transform: translateY(-50%) scale(0.95);
    background: rgba(0, 0, 0, 0.16);
}

body.tg-light .back-btn-pricing:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.16);
}

/* Кнопка Профиль в header */
body.tg-light .profile-btn {
    background: var(--tg-theme-button-color, #3b82f6);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

/* Кнопка "Улучшить тариф" (upgrade-action-btn) */
body.tg-light .upgrade-action-btn {
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--tg-theme-text-color, #1e293b);
}

body.tg-light .upgrade-action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Разделитель */
body.tg-light .divider {
    background: rgba(0, 0, 0, 0.08);
}

/* Прогресс-бар трек */
body.tg-light .limits-progress-wrapper,
body.tg-light .usage-bar-bg,
body.tg-light .limits-bar-container {
    background: rgba(0, 0, 0, 0.08);
}

/* Языковой переключатель */
body.tg-light .language-segment-control {
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.tg-light .segment-option {
    color: var(--tg-theme-hint-color, #64748b);
}

body.tg-light .segment-option.active {
    color: var(--tg-theme-text-color, #1e293b);
}

body.tg-light .segment-slider {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Мини-статы реферала */
body.tg-light .mini-stat {
    background: rgba(0, 0, 0, 0.05);
}

body.tg-light .mini-val {
    color: var(--tg-theme-text-color, #1e293b);
}

/* Кнопка копирования реферала */
body.tg-light .referral-copy-btn {
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--tg-theme-text-color, #374151);
}

body.tg-light .referral-copy-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Поле активации ключа */
body.tg-light .key-input-wrapper {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.tg-light .key-input-modern {
    color: var(--tg-theme-text-color, #1e293b);
}

/* Кнопки поддержки/admin в футере */
body.tg-light .footer-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--tg-theme-text-color, #374151);
}

body.tg-light .footer-btn:hover {
    background: rgba(0, 0, 0, 0.09);
}

/* FAQ аккордеон */
body.tg-light .faq-accordion summary,
body.tg-light .faq-item {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

body.tg-light .faq-item[open] {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
}

body.tg-light .faq-answer,
body.tg-light .faq-accordion .faq-answer {
    color: var(--tg-theme-hint-color, #64748b);
}

/* История операций */
body.tg-light .history-details-modern summary {
    color: var(--tg-theme-hint-color, #64748b);
}

body.tg-light .history-item {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.tg-light .history-type {
    color: var(--tg-theme-text-color, #1e293b);
}

/* Поле поиска */
body.tg-light .search-input {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--tg-theme-text-color, #1e293b);
}

body.tg-light .search-input::placeholder {
    color: var(--tg-theme-hint-color, #94a3b8);
}

body.tg-light .search-input:focus {
    border-color: var(--tg-theme-button-color, #3b82f6);
    background: rgba(0, 0, 0, 0.03);
}

/* Основные кнопки списка (btn-secondary, btn-outline) */
body.tg-light .btn-secondary {
    background: rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--tg-theme-text-color, #1e293b);
}

body.tg-light .btn-outline {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: var(--tg-theme-text-color, #374151);
}

/* Запись — список items */
body.tg-light .recording-item {
    background: var(--tg-theme-secondary-bg-color, #f8fafc);
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

body.tg-light .recording-item:hover {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Кнопки удаления/редактирования в списке */
body.tg-light .delete-btn-list {
    color: rgba(0, 0, 0, 0.3);
}

body.tg-light .delete-btn-list:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

body.tg-light .list-edit-btn {
    color: rgba(0, 0, 0, 0.3);
}

body.tg-light .list-edit-btn:hover {
    color: var(--tg-theme-button-color, #3b82f6);
    background: rgba(0, 0, 0, 0.05);
}

/* Кнопка редактирования в detail */
body.tg-light .edit-btn {
    color: rgba(0, 0, 0, 0.3);
}

body.tg-light .edit-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--tg-theme-button-color, #3b82f6);
}

/* Поле ввода названия */
body.tg-light .title-input {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: var(--tg-theme-text-color, #1e293b);
}

body.tg-light .key-input {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--tg-theme-text-color, #1e293b);
}

/* Скелетон */
body.tg-light .skeleton-text {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 25%, rgba(0, 0, 0, 0.12) 50%, rgba(0, 0, 0, 0.06) 75%);
}

/* Пустая карточка */
body.tg-light .result-empty-card {
    background: rgba(0, 0, 0, 0.03);
    border: 1px dashed rgba(0, 0, 0, 0.12);
}

/* Статус label */
body.tg-light .status-label {
    color: rgba(0, 0, 0, 0.6);
}

/* Loader ring */
body.tg-light .loader,
body.tg-light .loader-indeterminate,
body.tg-light .status-spinner-only {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--tg-theme-button-color, #3b82f6);
}

/* Прогресс ring */
body.tg-light .progress-ring-bg {
    border-color: rgba(0, 0, 0, 0.08);
}

/* Action grid (detail view) */
body.tg-light .action-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--tg-theme-text-color, #374151);
}

body.tg-light .action-btn:active {
    background: rgba(0, 0, 0, 0.1);
}

/* Плеер */
body.tg-light .player-progress-container {
    background: rgba(0, 0, 0, 0.08);
}

body.tg-light .player-action-btn {
    background: rgba(0, 0, 0, 0.07);
}

body.tg-light .player-action-btn:hover {
    background: rgba(0, 0, 0, 0.12);
}

/* ============================================
   PRICING — Light Theme
   ============================================ */

/* Заголовок price с gradient текстом → сделать видимым */
body.tg-light .pricing-header h1 {
    background: linear-gradient(135deg, #1e293b, #475569);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Базовая price карточка */
body.tg-light .pricing-card {
    background: var(--tg-theme-secondary-bg-color, #f8fafc);
    border: 1px solid rgba(0, 0, 0, 0.09);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

/* Popular карточка */
body.tg-light .pricing-card.pc-popular {
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

/* Premium карточка */
body.tg-light .pricing-card.pc-premium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.07), rgba(217, 119, 6, 0.04));
    border-color: rgba(245, 158, 11, 0.2);
}

/* Цена */
body.tg-light .pc-price-value {
    color: var(--tg-theme-text-color, #1e293b);
}

/* Список фич */
body.tg-light .pc-features li {
    color: var(--tg-theme-text-color, #374151);
}

body.tg-light .pricing-card .feat-icon {
    background: rgba(0, 0, 0, 0.06);
    color: #64748b;
}

/* Free CTA — был почти невидим */
body.tg-light .pc-cta-free {
    background: rgba(0, 0, 0, 0.07);
    color: var(--tg-theme-hint-color, #64748b);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

body.tg-light .pc-cta-free:hover {
    background: rgba(0, 0, 0, 0.11);
    color: var(--tg-theme-text-color, #1e293b);
}

/* Alt-кнопки оплаты (Stars, Крипто) */
body.tg-light .pc-alt-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--tg-theme-text-color, #374151);
}

body.tg-light .pc-alt-btn:hover {
    background: rgba(0, 0, 0, 0.09);
    color: var(--tg-theme-text-color, #1e293b);
    border-color: rgba(0, 0, 0, 0.18);
}

/* TON кнопка — оставляем акцентный цвет */
body.tg-light .pc-alt-btn.alt-ton {
    border-color: rgba(0, 152, 234, 0.35);
    color: #0098EA;
    background: rgba(0, 152, 234, 0.05);
}

body.tg-light .pc-alt-btn.alt-ton:hover {
    background: rgba(0, 152, 234, 0.1);
}

/* Pricing footer */
body.tg-light .pricing-legal-link {
    color: var(--tg-theme-hint-color, #64748b);
}

/* ============================================
   MODAL — Light Theme
   ============================================ */

body.tg-light .modal-content {
    background: var(--tg-theme-secondary-bg-color, #fff);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

body.tg-light .modal-cta-secondary {
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--tg-theme-hint-color, #64748b);
}

body.tg-light .modal-cta-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.tg-light .upgrade-desc {
    color: var(--tg-theme-hint-color, #64748b);
}

body.tg-light .modal-content .upgrade-features li {
    color: var(--tg-theme-text-color, #374151);
}

/* ============================================
   ADMIN — Light Theme
   ============================================ */

body.tg-light .admin-stat-card {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.09);
}

body.tg-light .admin-stat-row {
    background: rgba(0, 0, 0, 0.03);
}

body.tg-light .admin-logs-refresh-btn {
    background: rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: var(--tg-theme-text-color, #1e293b);
}

/* AI Report */
body.tg-light .report-list-item {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--tg-theme-text-color, #374151);
}

body.tg-light .report-summary-text {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--tg-theme-text-color, #374151);
}

body.tg-light .report-table-wrapper {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.tg-light .report-table th {
    color: var(--tg-theme-hint-color, #64748b);
    background: rgba(0, 0, 0, 0.03);
}

body.tg-light .report-table th,
body.tg-light .report-table td {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.tg-light .report-table td {
    color: var(--tg-theme-text-color, #374151);
}

/* Premium Chat */
body.tg-light .premium-chat-card {
    background: linear-gradient(180deg, rgba(240, 240, 255, 0.6) 0%, rgba(248, 250, 252, 0.8) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}

body.tg-light .premium-input-wrapper {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.tg-light .premium-input-wrapper:focus-within {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(0, 0, 0, 0.02);
}

body.tg-light .premium-chat-input {
    color: var(--tg-theme-text-color, #1e293b);
}

body.tg-light .premium-chat-input::placeholder {
    color: var(--tg-theme-hint-color, #94a3b8);
}

/* OR-separator */
body.tg-light .or-separator {
    color: var(--tg-theme-hint-color, #94a3b8);
}

/* Recording warning */
body.tg-light .recording-limit-text {
    color: var(--tg-theme-hint-color, #64748b);
}

/* Status error box */
body.tg-light .status-error-box {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

/* btn-delete */
body.tg-light .btn-delete-action {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

body.tg-light .btn-delete-action:active {
    background: rgba(239, 68, 68, 0.14);
}

/* transcript copy btn */
body.tg-light .transcript-copy-btn {
    color: var(--tg-theme-hint-color, #94a3b8);
}

body.tg-light .transcript-copy-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--tg-theme-button-color, #3b82f6);
}

/* ============================================================
   DETAIL / TRANSCRIPTION — unified Vortex theme
   Keep this reconciliation layer after the legacy light rules:
   the 2026 detail redesign intentionally uses !important values.
   ============================================================ */

.transcript-card {
    padding: 20px !important;
}

.transcript-details summary {
    padding: 0;
    border-radius: 10px;
    background: transparent;
}

.transcript-heading {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
}

.transcript-heading .section-title {
    margin: 0;
    font-size: 1.05rem;
}

.transcript-heading .chevron {
    margin-left: auto;
}

.transcript-text {
    margin-top: 16px !important;
    padding: 17px 16px;
    border-radius: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.95rem;
}

.premium-chat-header {
    justify-content: center;
    margin-bottom: 5px;
}

.premium-chat-icon {
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #a855f7) !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.32);
}

.premium-chat-title {
    color: #c4ccff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.premium-chat-lock-card {
    width: 85%;
    padding: 15px 20px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    text-align: center;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.premium-chat-lock-title {
    margin-bottom: 5px;
    color: var(--vx-text);
    font-size: 1.05em;
    font-weight: 650;
}

.flow-status-notice {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.1);
    text-align: left;
}

.flow-status-notice-title {
    margin-bottom: 6px;
    color: var(--vx-text);
    font-weight: 650;
}

.flow-status-notice-message {
    color: var(--vx-muted);
    font-size: 0.9em;
    line-height: 1.45;
}

.flow-status-refresh {
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid var(--vx-border);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--vx-text);
    cursor: pointer;
    font-weight: 650;
}

.detail-meta {
    margin-bottom: 20px;
    color: var(--vx-muted);
    font-size: 0.9em;
    text-align: center;
}

.detail-footer-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.detail-footer-action {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 700;
}

.detail-footer-action-primary {
    border: 0;
    background: var(--vx-brand);
    color: #fff;
}

.detail-footer-action-secondary {
    border: 1px solid var(--vx-border);
    background: var(--vx-surface-raised);
    color: var(--vx-text);
}

.transcription-offer {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid rgba(111, 132, 255, 0.28);
    border-radius: 12px;
    background: rgba(111, 132, 255, 0.08);
}

.transcription-offer-title {
    margin-bottom: 5px;
    color: #9dacff;
    font-size: 1.1em;
    font-weight: 650;
}

.transcription-offer-cost {
    margin: 5px 0;
    color: var(--vx-text);
    font-size: 0.9em;
}

.transcription-offer-description,
.detail-state-message {
    color: var(--vx-muted);
}

.transcription-offer-description {
    margin: 0;
    font-size: 0.8em;
}

.detail-state-message {
    display: block;
    margin-top: 10px;
}

body.tg-light {
    --bg-color: var(--tg-theme-bg-color, #f5f7fb);
    --text-color: var(--tg-theme-text-color, #182033);
    --secondary-bg: var(--tg-theme-secondary-bg-color, #eef2f8);
    --card-bg: var(--tg-theme-secondary-bg-color, #ffffff);
    --hint-color: var(--tg-theme-hint-color, #657087);
    --vx-bg: var(--tg-theme-bg-color, #f5f7fb);
    --vx-surface: var(--tg-theme-secondary-bg-color, #ffffff);
    --vx-surface-raised: #eef2f8;
    --vx-border: rgba(15, 23, 42, 0.12);
    --vx-text: var(--tg-theme-text-color, #182033);
    --vx-muted: var(--tg-theme-hint-color, #657087);
    --vx-brand: var(--tg-theme-button-color, #536dfe);
    --vx-success: #168a5b;
    --text-secondary: var(--vx-muted);
    background: var(--vx-bg);
    color: var(--vx-text);
}

body.tg-light #listView {
    background: var(--vx-bg);
}

body.tg-light .app-identity-icon {
    border-color: rgba(83, 109, 254, 0.2);
    background: #edf1ff;
    color: #4960d1;
}

body.tg-light .profile-icon {
    color: #4960d1;
}

body.tg-light #btnUpload {
    border-color: #aebaff;
    background: #eef1ff !important;
    color: #354bb6 !important;
    box-shadow: 0 7px 20px rgba(58, 76, 161, 0.12);
}

body.tg-light #btnUpload:hover {
    border-color: #8798f5;
    background: #e3e8ff !important;
    box-shadow: 0 9px 24px rgba(58, 76, 161, 0.17);
}

body.tg-light #btnUpload:active {
    background: #dbe2ff !important;
}

body.tg-light #detailView {
    color: var(--vx-text);
}

body.tg-light .detail-title,
body.tg-light .section-title,
body.tg-light .report-header,
body.tg-light .flow-stage-title,
body.tg-light .flow-status-notice-title {
    color: var(--vx-text) !important;
}

body.tg-light .detail-card,
body.tg-light .ai-report-card {
    border-color: var(--vx-border) !important;
    background: var(--vx-surface) !important;
    box-shadow: 0 8px 24px rgba(31, 43, 68, 0.06) !important;
}

body.tg-light .report-section:not(:last-child) {
    border-bottom-color: var(--vx-border) !important;
}

body.tg-light .report-summary-text,
body.tg-light .report-list-item,
body.tg-light .content-text,
body.tg-light .flow-stage-detail,
body.tg-light .flow-stage-meta,
body.tg-light .flow-stage-updated {
    color: var(--vx-muted) !important;
}

body.tg-light .report-summary-text,
body.tg-light .report-list-item {
    border-color: transparent;
    background: transparent;
}

body.tg-light .transcript-details .content-text {
    border-color: var(--vx-border) !important;
    background: #f5f7fb !important;
    color: #344057 !important;
}

body.tg-light .btn-back-detail {
    border-color: var(--vx-border) !important;
    background: var(--vx-surface-raised) !important;
}

body.tg-light .btn-back-detail::before {
    color: var(--vx-muted);
}

body.tg-light .flow-timeline::before,
body.tg-light .flow-progress {
    background: #e5e9f1;
}

body.tg-light .flow-step {
    color: #778298;
}

body.tg-light .flow-step-dot {
    border-color: #cbd2df;
    background: var(--vx-surface);
}

body.tg-light .flow-step.is-complete {
    color: #527261;
}

body.tg-light .flow-step.is-current {
    color: #4258cf;
}

body.tg-light .flow-orbit {
    border-color: rgba(83, 109, 254, 0.18);
    border-top-color: var(--vx-brand);
}

body.tg-light .flow-progress span {
    background: linear-gradient(90deg, #536dfe, #7d8fff);
}

body.tg-light .flow-status-notice {
    border-color: rgba(180, 111, 12, 0.24);
    background: #fff8e8;
}

body.tg-light .flow-status-refresh {
    border-color: var(--vx-border);
    background: var(--vx-surface-raised);
    color: var(--vx-text);
}

body.tg-light .detail-footer-action-secondary {
    border-color: var(--vx-border);
    background: var(--vx-surface-raised);
    color: var(--vx-text);
}

body.tg-light .transcription-offer {
    border-color: rgba(83, 109, 254, 0.2);
    background: #f1f4ff;
}

body.tg-light .transcription-offer-title {
    color: #3f57ce;
}

body.tg-light .transcription-offer-cost {
    color: var(--vx-text);
}

body.tg-light .premium-chat-card {
    border-color: rgba(83, 109, 254, 0.2) !important;
    background: linear-gradient(145deg, #f7f8ff, #ffffff) !important;
}

body.tg-light .premium-chat-title {
    color: #4e5fc7;
}

body.tg-light .premium-chat-lock-card {
    border-color: rgba(83, 109, 254, 0.2);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 28px rgba(48, 61, 102, 0.16);
}

body.tg-light .premium-chat-lock-title {
    color: var(--vx-text);
}

body.tg-light .status-processing,
body.tg-light .status-queued,
body.tg-light .status-finalizing {
    background: #fff3d5;
    color: #8a5900;
}

body.tg-light .status-done {
    background: #e6f7ef;
    color: #13764e;
}

body.tg-light .status-recording,
body.tg-light .status-uploaded {
    background: #e9efff;
    color: #3653c4;
}

/* key input block */
body.tg-light .key-input-group .key-input {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--tg-theme-text-color, #1e293b);
}

/* btn tiny (admin refresh) */
body.tg-light .btn-xs {
    background: rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: var(--tg-theme-text-color, #1e293b);
}

/* ONBOARDING OVERLAY */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    min-height: var(--app-viewport-height, 100dvh);
    height: var(--app-viewport-height, 100dvh);
    background: var(--bg-color);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    padding:
        max(20px, var(--tg-content-safe-top, 0px))
        max(20px, var(--tg-content-safe-right, 0px))
        max(20px, var(--tg-content-safe-bottom, 0px))
        max(20px, var(--tg-content-safe-left, 0px));
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.onboarding-overlay.hidden {
    display: none !important;
}

.onboarding-overlay.closing {
    opacity: 0;
    pointer-events: none;
}

.onboarding-content {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.onboarding-slider {
    width: 100%;
    position: relative;
    height: 350px;
}

.onboarding-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.onboarding-slide.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.onboarding-slide.prev {
    opacity: 0;
    transform: translateX(-20px);
}

.onboarding-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    color: white;
}

.onboarding-slide h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.onboarding-slide p {
    font-size: 16px;
    color: var(--hint-color);
    line-height: 1.5;
    padding: 0 15px;
}

@media (max-height: 620px) {
    .modal-overlay { align-items: flex-start; }
    .payment-sheet { padding: 18px; border-radius: 18px; }
    .payment-sheet-kicker { margin-bottom: 3px; font-size: .68rem; }
    .payment-sheet h2 { font-size: 1.22rem; }
    .payment-order-summary { margin: 12px 0; padding: 10px 12px; }
    .payment-methods { margin-bottom: 12px; }
    .payment-method-card { min-height: 54px; padding: 7px; }
    .payment-renew-toggle { margin-top: 10px; padding: 10px; }
    .payment-method-context { min-height: 20px; margin-top: 6px; }
    .payment-sheet-error:empty { min-height: 0; margin: 0; }
    .onboarding-overlay { align-items: flex-start; overflow-y: auto; }
    .onboarding-slider { height: min(300px, 62vh); }
    .onboarding-icon { width: 60px; height: 60px; margin-bottom: 14px; font-size: 30px; }
    .onboarding-dots { margin-bottom: 18px; }
}

@media (max-width: 380px) and (max-height: 620px) {
    .payment-method-card { grid-template-columns: 30px minmax(0, 1fr) 18px; min-height: 48px; gap: 7px; }
    .payment-method-icon { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }
    .payment-method-icon-sbp { font-size: .58rem; }
    .payment-method-card small { display: none; }
    .payment-sheet-field { gap: 4px; }
    .payment-sheet-field input { padding-block: 10px; }
    .payment-renew-toggle small { font-size: .68rem; }
    .payment-sheet-note { margin-top: 8px; }
}

@media (max-width: 600px) {
    .search-input,
    .key-input,
    .key-input-modern,
    .payment-sheet-field input { font-size: 16px; }
}

.onboarding-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 40px;
}

.onboarding-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.onboarding-dots .dot.active {
    background: var(--primary-color);
    width: 24px;
}

.onboarding-actions {
    width: 100%;
}

.onboarding-actions .btn {
    border-radius: var(--radius-full);
}
