/* Mystical space theme stylesheet */

:root {
    --bg-dark: #07050f;
    --bg-card: rgba(20, 16, 38, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.06);
    
    --purple-glow: #6355d8;
    --purple-light: #9c8eff;
    --gold: #f3c473;
    --gold-glow: #ffdf9e;
    --text-primary: #f0ecfc;
    --text-secondary: #9993b0;
    --text-muted: #6e678a;
    
    --success: #3ef2b8;
    --error: #ff5773;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    height: var(--tg-viewport-height, 100vh);
    min-height: var(--tg-viewport-height, 100vh);
    width: 100vw;
    position: relative;
}

/* Nebula Background & Glows */
.nebula-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 20%, #171033 0%, var(--bg-dark) 80%);
    z-index: -3;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: -2;
}

.orb-1 {
    top: -10%;
    right: -20%;
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(99, 85, 216, 0.15) 0%, rgba(99, 85, 216, 0) 70%);
}

.orb-2 {
    bottom: -20%;
    left: -20%;
    width: 100vw;
    height: 100vw;
    background: radial-gradient(circle, rgba(43, 23, 84, 0.2) 0%, rgba(43, 23, 84, 0) 70%);
}

/* Application Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: var(--tg-viewport-height, 100vh);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* App Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    padding-top: calc(16px + env(safe-area-inset-top));
    background: rgba(7, 5, 15, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-glass);
    z-index: 10;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-emoji {
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(156, 142, 255, 0.6));
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #fff 0%, var(--purple-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text .subtitle {
    font-size: 11.5px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-balance-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 85, 216, 0.2);
    border: 1px solid rgba(99, 85, 216, 0.4);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 15.5px;
    color: var(--purple-light);
    box-shadow: 0 0 12px rgba(99, 85, 216, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.header-balance-badge:active {
    transform: scale(0.95);
}

.key-icon {
    width: 14px;
    height: 14px;
    color: var(--gold);
    filter: drop-shadow(0 0 4px var(--gold));
}

/* App Main Content */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 20px; /* Changed from 90px since navbar is no longer absolute */
    position: relative;
}

/* Scrollbar styling */
.app-content::-webkit-scrollbar {
    width: 4px;
}
.app-content::-webkit-scrollbar-track {
    background: transparent;
}
.app-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Tab Views management */
.tab-content {
    display: none;
    animation: fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active {
    display: block;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title-group {
    margin-bottom: 20px;
}

.section-title-group h2 {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.section-desc {
    font-size: 14.5px;
    color: var(--text-secondary);
}

/* Navigation Navbar */
.app-navbar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
    width: 100%;
    height: 70px;
    background: rgba(10, 8, 22, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-glass);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 10;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    height: 100%;
    transition: all 0.3s ease;
}

.nav-item i {
    width: 20px;
    height: 20px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item.active {
    color: var(--purple-light);
}

.nav-item.active i {
    color: var(--purple-light);
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px rgba(156, 142, 255, 0.5));
}

/* Timelines and Journal Lock Banner */
.subscription-lock-banner {
    background: linear-gradient(135deg, rgba(30, 20, 60, 0.6) 0%, rgba(13, 9, 28, 0.8) 100%);
    border: 1px solid rgba(99, 85, 216, 0.3);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    margin-top: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lock-icon-container {
    background: rgba(243, 196, 115, 0.1);
    border: 1px solid rgba(243, 196, 115, 0.3);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--gold);
    filter: drop-shadow(0 0 10px rgba(243, 196, 115, 0.3));
}

.lock-icon {
    width: 28px;
    height: 28px;
}

.subscription-lock-banner h3 {
    font-size: 18px;
    color: #fff;
    margin-bottom: 10px;
}

.subscription-lock-banner p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    width: auto;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background: var(--purple-glow);
    color: #fff;
}

.btn-premium {
    background: linear-gradient(135deg, var(--gold) 0%, #db9a35 100%);
    color: #3e2600;
    box-shadow: 0 4px 15px rgba(243, 196, 115, 0.3);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-premium:active {
    box-shadow: 0 2px 5px rgba(243, 196, 115, 0.3);
}

.btn-glowing {
    box-shadow: 0 0 16px var(--purple-glow);
}

.btn-glowing:hover {
    box-shadow: 0 0 24px var(--purple-glow);
}

.btn:active {
    transform: scale(0.98);
}

.stars-label {
    font-weight: bold;
    color: var(--gold);
    margin-left: 2px;
}

/* Journal Area */
.search-box-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.search-box-container input {
    width: 100%;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 12px 16px 12px 42px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.search-box-container input:focus {
    border-color: rgba(156, 142, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 12px rgba(156, 142, 255, 0.15);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.journal-stats-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
}

.stat-val {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.stat-lbl {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Timeline of dreams */
.journal-timeline {
    position: relative;
    padding-left: 20px;
    margin-top: 10px;
}

.journal-timeline::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 2px;
    height: calc(100% - 10px);
    background: rgba(99, 85, 216, 0.3);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--purple-glow);
    border: 2px solid var(--bg-dark);
    box-shadow: 0 0 8px var(--purple-glow);
}

.timeline-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--purple-light);
    margin-bottom: 6px;
}

.timeline-body {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeline-body:active {
    transform: scale(0.99);
    background: rgba(30, 24, 56, 0.6);
}

.timeline-body h4 {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-body p {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Dreams Feed Tab */
.dreams-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dream-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dream-card:active {
    transform: scale(0.99);
}

.dream-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.dream-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--purple-light);
}

.read-badge {
    font-size: 9px;
    background: rgba(62, 242, 184, 0.15);
    border: 1px solid rgba(62, 242, 184, 0.3);
    color: var(--success);
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.dream-card-content h3 {
    font-size: 16.5px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.dream-card-content p {
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dream-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 12px;
    font-size: 12px;
    color: var(--purple-light);
    font-weight: 600;
    gap: 4px;
}

.dream-card-footer i {
    width: 14px;
    height: 14px;
}

/* Loading Spiner */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid rgba(156, 142, 255, 0.1);
    border-top: 3px solid var(--purple-glow);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Shop and packages layout */
.sub-showcase-card {
    position: relative;
    background: linear-gradient(135deg, rgba(99, 85, 216, 0.35) 0%, rgba(30, 20, 60, 0.8) 100%);
    border: 1px solid rgba(243, 196, 115, 0.4);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 30px rgba(99, 85, 216, 0.25);
    overflow: hidden;
}

.sub-badge-premium {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--gold);
    color: #402800;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.sub-showcase-card h3 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    padding-right: 75px; /* Резервируем место под абсолютную плашку (PREMIUM / АКТИВНА) */
}

.sub-pricing {
    font-size: 32px;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 16px;
    display: flex;
    align-items: baseline;
}

.sub-pricing .per-month {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 6px;
}

.sub-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.sub-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    color: var(--text-primary);
}

.check-icon {
    width: 16px;
    height: 16px;
    color: var(--success);
    flex-shrink: 0;
}

.star-char {
    color: var(--gold);
    font-weight: bold;
}

.shop-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.shop-card {
    position: relative;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    overflow: hidden;
}

.shop-card.popular {
    border-color: rgba(99, 85, 216, 0.5);
    box-shadow: 0 0 15px rgba(99, 85, 216, 0.15);
}

.popular-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--purple-glow);
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    padding: 3px 10px;
    border-bottom-left-radius: 10px;
}

.card-inner {
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.pkg-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-top: 4px;
}

.pkg-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
}

.badge-micro { background: rgba(99, 85, 216, 0.15); color: var(--purple-light); }
.badge-standard { background: rgba(62, 242, 184, 0.15); color: var(--success); }
.badge-deep { background: rgba(243, 196, 115, 0.15); color: var(--gold); }
.badge-infinite { background: rgba(0, 229, 255, 0.15); color: #00e5ff; }

.pkg-description {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 10px 0 14px;
    line-height: 1.4;
    flex: 1;
}

.btn-shop {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    color: var(--gold);
    border-radius: 10px;
}

.btn-shop:active {
    background: rgba(255, 255, 255, 0.08);
}

.shop-card.popular .btn-shop {
    background: var(--purple-glow);
    border-color: var(--purple-glow);
    color: #fff;
}

/* Profile Tab Design */
.profile-header-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 16px 20px;
    margin-bottom: 16px;
    gap: 16px;
}

.profile-user-details {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, var(--purple-glow) 0%, var(--purple-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 0 15px rgba(99, 85, 216, 0.4);
    flex-shrink: 0;
}

.profile-user-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

#profile-username {
    font-size: 16.5px;
    font-weight: 700;
    color: #fff;
}

.profile-status-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    padding: 2px 8px;
    border-radius: 20px;
    color: var(--text-secondary);
    white-space: nowrap; /* Предотвращаем перенос названия подписки на две строки */
}

.profile-status-badge.active-sub {
    background: rgba(243, 196, 115, 0.15);
    border-color: rgba(243, 196, 115, 0.3);
    color: var(--gold);
}

.profile-stats-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: right;
    align-items: flex-end;
}

.profile-stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.profile-stat-item .stat-lbl {
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.profile-stat-val {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

#profile-balance {
    color: var(--gold);
}

/* Referral Program Styling */
.referral-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 18px 20px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.referral-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px 0;
}

.referral-card p {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0 0 16px 0;
}

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

.referral-actions .btn {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-share {
    background: var(--purple-light);
    color: #fff;
}

.btn-share:active {
    transform: scale(0.97);
    background: rgba(99, 85, 216, 0.8);
}

.btn-copy {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #fff;
}

.btn-copy:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.08);
}

.info-list-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 16px;
}

.info-item {
    display: flex;
    gap: 12px;
}

.info-icon {
    width: 20px;
    height: 20px;
    color: var(--purple-light);
    flex-shrink: 0;
}

.info-text h4 {
    font-size: 14.5px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.info-text p {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 3, 10, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: 100%;
    max-width: 600px;
    background: var(--bg-card);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 0;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
}

.modal-overlay.open .modal-card {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.modal-body {
    padding: 16px 20px 24px 20px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--purple-light);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.close-btn i {
    width: 20px;
    height: 20px;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section h4 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gold);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.dream-narrative {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    padding: 12px;
    border-left: 3px solid var(--purple-glow);
    font-style: italic;
}

.dream-analysis {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-line;
}

/* --- Premium Journal Calendar Styles --- */
.journal-subnavigation {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: 4px;
    border-radius: 12px;
}

.subnav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.subnav-btn.active {
    background: rgba(99, 85, 216, 0.2);
    color: #fff;
    border: 1px solid rgba(99, 85, 216, 0.3);
}

.calendar-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: 10px 16px;
    border-radius: 14px;
}

.calendar-title-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 6px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-title-btn:active {
    transform: scale(0.97);
}

.calendar-title-btn:focus {
    border-color: var(--purple-light);
    background: rgba(99, 85, 216, 0.1);
}

.calendar-grid.months-mode {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.calendar-month-item {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-month-item:active {
    transform: scale(0.95);
}

.calendar-month-item.current-selected {
    background: rgba(99, 85, 216, 0.2);
    border-color: var(--purple-light);
    color: #fff;
    box-shadow: 0 0 12px rgba(99, 85, 216, 0.3);
}

.calendar-month-item.today-month {
    border: 1px dashed var(--gold);
    color: var(--gold);
    box-shadow: inset 0 0 6px rgba(243, 196, 115, 0.1);
    position: relative;
}

.calendar-month-item.today-month::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--gold);
    box-shadow: 0 0 4px var(--gold);
}

.calendar-month-item.today-month.current-selected {
    border-style: solid;
    border-color: var(--gold);
    background: rgba(243, 196, 115, 0.15);
    color: #fff;
    box-shadow: 0 0 12px rgba(243, 196, 115, 0.25);
}

.calendar-month-item.has-dreams-in-month {
    border-color: rgba(243, 196, 115, 0.3); /* Gold indicator for months with dreams */
}

.cal-nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.cal-nav-btn i {
    width: 20px;
    height: 20px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.calendar-day.empty {
    background: transparent;
    border: none;
    pointer-events: none;
}

.calendar-day.today-day {
    border: 1px dashed var(--gold);
    color: var(--gold);
    font-weight: 700;
    box-shadow: 0 0 8px rgba(243, 196, 115, 0.15);
}

.calendar-day.has-dream {
    cursor: pointer;
    font-weight: bold;
    color: #fff;
    border-width: 1px;
}

.calendar-day.has-dream:active {
    transform: scale(0.85);
}

/* Свечение: Кошмары (Красный) */
.calendar-day.dream-anxious {
    background: rgba(255, 87, 115, 0.15);
    border-color: rgba(255, 87, 115, 0.6);
    box-shadow: 0 0 10px rgba(255, 87, 115, 0.3);
}

/* Свечение: Хорошие сны (Зеленый) */
.calendar-day.dream-positive {
    background: rgba(62, 242, 184, 0.15);
    border-color: rgba(62, 242, 184, 0.6);
    box-shadow: 0 0 10px rgba(62, 242, 184, 0.3);
}

/* Свечение: Мистические/Нейтральные сны (Фиолетовый) */
.calendar-day.dream-neutral {
    background: rgba(99, 85, 216, 0.2);
    border-color: rgba(156, 142, 255, 0.6);
    box-shadow: 0 0 10px rgba(156, 142, 255, 0.3);
}

/* --- Premium Analytics Monthly Report --- */
.analysis-summary-card {
    background: linear-gradient(135deg, rgba(30, 20, 60, 0.6) 0%, rgba(13, 9, 28, 0.8) 100%);
    border: 1px solid rgba(156, 142, 255, 0.2);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.analysis-summary-card h3 {
    font-size: 17.5px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 12px;
}

.analysis-summary-card p {
    font-size: 14.5px;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-line;
}

.analytics-widgets-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-card-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.stat-card-widget h4 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.widget-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.radar-chart-placeholder, .mood-chart-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

/* Стили линий диаграмм */
.chart-bar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}

.chart-bar-label {
    width: 90px;
    color: var(--text-secondary);
}

.chart-bar-outer {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin: 0 10px;
    overflow: hidden;
}

.chart-bar-inner {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.chart-bar-val {
    width: 35px;
    text-align: right;
    font-weight: 600;
    color: #fff;
}

/* Premium Toast Notification System */
.toast-container {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 90%;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: rgba(20, 16, 38, 0.95);
    border: 1px solid rgba(156, 142, 255, 0.2);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 15px rgba(99, 85, 216, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: toast-fade-in-out 3.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: auto;
}

@keyframes toast-fade-in-out {
    0% { opacity: 0; transform: translateY(15px) scale(0.95); }
    10% { opacity: 1; transform: translateY(0) scale(1); }
    90% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-15px) scale(0.95); }
}

/* ==========================================================================
   Pricing Grid styling for Profile Tab (UX Update)
   ========================================================================== */

.info-item-vertical {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.info-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.pricing-grid {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.pricing-header-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(156, 142, 255, 0.08);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--purple-light);
    border-bottom: 1px solid var(--border-glass);
}

.pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-glass);
    transition: background 0.2s ease;
}

.pricing-row:last-child {
    border-bottom: none;
}

.pricing-row:active {
    background: rgba(255, 255, 255, 0.02);
}

.pricing-action {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
}

.action-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.action-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.action-desc {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.pricing-cost {
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
    text-align: right;
    white-space: nowrap;
    text-shadow: 0 0 8px rgba(243, 196, 115, 0.2);
}

.cost-unit {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Profile Expandable Menu List & Accordions */
.profile-menu-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-list-item {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    overflow: hidden;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.menu-list-item:active {
    background: rgba(30, 24, 56, 0.6);
}

.menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    cursor: pointer;
}

.menu-item-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-item-title span {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.menu-icon {
    width: 20px;
    height: 20px;
    color: var(--purple-light);
}

.chevron-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.menu-item-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(255, 255, 255, 0.01);
}

.accordion-item.expanded .menu-item-content {
    max-height: 400px;
}

.accordion-item .chevron-icon {
    transition: transform 0.3s ease;
}

.accordion-item.expanded .chevron-icon {
    transform: rotate(90deg);
}

.menu-item-content .pricing-grid {
    margin: 0 16px 16px 16px;
}

.developer-info-card {
    transition: background 0.2s ease;
}

.info-help-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.info-help-btn:active {
    transform: scale(0.85);
    color: var(--gold);
    background: rgba(255, 255, 255, 0.05);
}

/* Payment Method Selector (Glassmorphism Segmented Control) */
.payment-method-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 3px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pay-toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px; /* Сделали компактнее по высоте */
    border-radius: 9px;
    font-family: inherit;
    font-weight: 600;
    font-size: 13.5px; /* Чуть уменьшили шрифт */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pay-toggle-btn:active {
    transform: scale(0.97);
}

.pay-toggle-btn.active {
    background: linear-gradient(135deg, var(--purple-glow) 0%, rgba(99, 85, 216, 0.6) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 85, 216, 0.4);
}

/* Смена шрифта для символа рубля (без засечек) */
.rub-char {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 500;
}

/* Loading button spinner */
.loading-btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Стили даты окончания подписки на вкладке магазина */
.sub-expiry-shop {
    font-size: 13.5px;
    color: var(--gold);
    font-weight: 600;
    margin-top: 8px;
    margin-bottom: 12px;
    text-align: center;
    text-shadow: 0 0 8px rgba(243, 196, 115, 0.3);
}

/* Active badge premium shop active status */
.sub-badge-premium.active-sub-badge {
    background: var(--success);
    color: #07050f;
    box-shadow: 0 0 10px var(--success);
}

/* Media query for narrow mobile screens (e.g. iPhone 13 mini, iPhone SE) */
@media (max-width: 400px) {
    .profile-header-card {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 16px;
    }

    .profile-stats-panel {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding-top: 12px;
        width: 100%;
    }

    .profile-stat-item:first-child {
        align-items: flex-start;
        text-align: left;
    }

    .profile-stat-item:last-child {
        align-items: flex-end;
        text-align: right;
    }

    .sub-showcase-card h3 {
        font-size: 19px;
        padding-right: 80px;
    }
}

/* Checkout Modal Elements */
.checkout-input {
    width: 100%;
    background: rgba(14, 11, 31, 0.8) !important;
    border: 1px solid rgba(156, 142, 255, 0.25) !important;
    border-radius: 12px;
    padding: 14px 18px;
    color: #fff !important;
    font-family: inherit;
    font-size: 16px; /* Предотвращает авто-зум на iOS */
    outline: none;
    transition: all 0.3s ease;
}

.checkout-input:focus {
    border-color: var(--purple-light) !important;
    background: rgba(20, 16, 42, 0.9) !important;
    box-shadow: 0 0 12px rgba(156, 142, 255, 0.3) !important;
}

.checkout-input.error {
    border-color: var(--error) !important;
    box-shadow: 0 0 12px rgba(255, 87, 115, 0.3) !important;
}

/* Стилизация автозаполнения для предотвращения белого фона */
.checkout-input:-webkit-autofill,
.checkout-input:-webkit-autofill:hover, 
.checkout-input:-webkit-autofill:focus, 
.checkout-input:-webkit-autofill:active {
    -webkit-text-fill-color: #fff !important;
    transition: background-color 5000000s ease-in-out 0s;
    box-shadow: inset 0 0 0 50px #0e0b1f !important;
}

.checkout-terms-link {
    color: var(--purple-light);
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.checkout-terms-link:hover {
    color: #fff;
}

/* Browser Stub Styles */
.stub-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 20%, #171033 0%, #07050f 80%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #f0ecfc;
    font-family: 'Outfit', sans-serif;
}

.stub-card {
    width: 100%;
    max-width: 440px;
    background: rgba(20, 16, 38, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 85, 216, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stub-logo {
    font-size: 64px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 15px rgba(156, 142, 255, 0.4));
    animation: pulseLogo 3s ease-in-out infinite alternate;
}

@keyframes pulseLogo {
    0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(156, 142, 255, 0.3)); }
    100% { transform: scale(1.05); filter: drop-shadow(0 0 25px rgba(156, 142, 255, 0.6)); }
}

.stub-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.stub-subtitle {
    font-size: 14px;
    color: var(--purple-light);
    margin-bottom: 24px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.stub-description {
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
}

.stub-btn {
    width: 100%;
    padding: 16px 32px;
    font-size: 16px;
    text-decoration: none;
    border-radius: 16px;
    margin-bottom: 32px;
}

.stub-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    width: 100%;
}

.stub-legal-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12.5px;
}

.stub-link {
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.stub-link:hover {
    color: var(--purple-light);
    text-decoration: underline;
}

.stub-divider {
    color: rgba(255, 255, 255, 0.1);
}

.stub-developer {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* --- Demo Version Styles --- */
.journal-demo-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(99, 85, 216, 0.15) 0%, rgba(243, 196, 115, 0.05) 100%);
    border: 1px dashed rgba(243, 196, 115, 0.3);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 16px;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.demo-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.4;
}

.demo-sparkle-icon {
    width: 18px;
    height: 18px;
    color: var(--gold);
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px var(--gold));
}

/* Locked card in timeline */
.timeline-item-locked {
    opacity: 0.8;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-item-locked:active {
    transform: scale(0.98);
}

.locked-diary-card {
    background: linear-gradient(135deg, rgba(20, 16, 38, 0.4) 0%, rgba(10, 8, 20, 0.6) 100%) !important;
    border: 1px dashed rgba(243, 196, 115, 0.25) !important;
    position: relative;
    padding: 18px 16px !important;
    text-align: center;
}

.locked-diary-card p {
    display: block !important;
    overflow: visible !important;
    -webkit-line-clamp: unset !important;
}

.locked-card-icon {
    width: 24px;
    height: 24px;
    color: var(--gold);
    margin-bottom: 8px;
    filter: drop-shadow(0 0 6px var(--gold));
}

.locked-card-action {
    display: inline-block;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* CTA block under Monthly Analysis report */
.demo-analysis-cta {
    background: linear-gradient(135deg, rgba(99, 85, 216, 0.15) 0%, rgba(20, 16, 38, 0.7) 100%);
    border: 1px solid rgba(243, 196, 115, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-top: 24px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(99, 85, 216, 0.05);
}

.demo-analysis-cta h4 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.demo-analysis-cta p {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 16px;
}

.demo-analysis-cta .btn {
    width: 100%;
    max-width: 280px;
    padding: 10px 20px;
    font-size: 13.5px;
}




