/* ==========================================================================
   МАК КАРТЫ — Luxury Soft Pastel Pink Design System
   Refined Rose Quartz, Silk Velvet Glassmorphism, 3D Animations
   ========================================================================== */

:root {
    /* Palette: Soft Silk Rose Quartz */
    --bg-main: #FDF9FA;
    --bg-card: rgba(255, 255, 255, 0.96);
    --bg-glass: rgba(255, 250, 252, 0.9);
    --bg-accent-soft: #FDEBF2;
    --bg-accent-warm: #FFF6F8;

    --text-main: #341D2E;
    --text-muted: #7E6175;
    --text-light: #A4899C;

    --primary-pastel: #F48BA7;
    --primary-gradient: linear-gradient(135deg, #F6A5BC 0%, #E87A99 50%, #DE6D8E 100%);
    --hero-gradient: linear-gradient(135deg, #FFF7FA 0%, #FDEBF2 50%, #FBDDE7 100%);
    --secondary-gradient: linear-gradient(135deg, #FDE2EC 0%, #E8D5F9 100%);
    --gold-gradient: linear-gradient(135deg, #F8E1A1 0%, #E8B472 100%);
    --gold-border: rgba(235, 175, 195, 0.45);

    --accent-purple: #C8386D;
    --accent-rose: #E86B91;
    --accent-gold: #C07D2C;

    --shadow-soft: 0 10px 28px -5px rgba(190, 110, 135, 0.12);
    --shadow-glass: 0 12px 34px 0 rgba(200, 120, 145, 0.12);
    --shadow-card: 0 18px 36px rgba(45, 20, 38, 0.08);

    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-full: 9999px;

    --font-heading: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    --font-body: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Telegram Native Theme Sync */
body.telegram-theme {
    background-color: var(--tg-theme-bg-color, var(--bg-main));
    color: var(--tg-theme-text-color, var(--text-main));
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(255, 210, 225, 0.4) 0px, transparent 55%),
        radial-gradient(at 100% 0%, rgba(255, 220, 230, 0.35) 0px, transparent 55%),
        radial-gradient(at 50% 100%, rgba(255, 235, 240, 0.4) 0px, transparent 60%),
        radial-gradient(at 85% 85%, rgba(235, 215, 255, 0.22) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    position: relative;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
}

/* Header & Profile Bar (With Safe Area Insets for POCO / Xiaomi / Notches) */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding-top: max(16px, env(safe-area-inset-top, 0px));
    padding-bottom: 16px;
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(253, 249, 250, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(235, 195, 210, 0.45);
}

/* Dedicated rules for native Capacitor Android app on devices with notch / status bar overlap */
html.capacitor-native .app-header {
    padding-top: calc(14px + max(28px, env(safe-area-inset-top, 0px)));
}

html.capacitor-native .screen-header {
    padding-top: calc(14px + max(28px, env(safe-area-inset-top, 0px)));
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(255, 111, 145, 0.4);
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #3D1830 0%, #D81B60 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coin-badge {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 140, 175, 0.5);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 800;
    color: var(--accent-gold);
    box-shadow: 0 4px 14px rgba(255, 111, 145, 0.12);
    cursor: pointer;
    transition: var(--transition-bounce);
}

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

.coin-icon {
    font-size: 15px;
    animation: pulseGold 2s infinite ease-in-out;
}

@keyframes pulseGold {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.profile-avatar-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    border: 2px solid #FF85A1;
    box-shadow: 0 4px 16px rgba(255, 111, 145, 0.45);
    overflow: hidden;
    background: var(--primary-gradient);
    transition: var(--transition-bounce);
}

.profile-avatar-btn:hover, .profile-avatar-btn:active {
    transform: scale(1.08);
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #FFF;
    font-size: 16px;
    text-transform: uppercase;
}

.avatar-guest-svg {
    width: 20px;
    height: 20px;
    stroke: #FFF;
    stroke-width: 2.2;
    display: block;
    margin: auto;
}

.avatar-guest-svg-large {
    width: 28px;
    height: 28px;
    stroke: #FFF;
    stroke-width: 2.2;
    display: block;
    margin: auto;
}

.pro-badge-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10B981;
    border: 2px solid #FFF;
}

/* Hero Banner */
.hero-banner {
    margin: 20px;
    padding: 24px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #FFF8FA 0%, #FDF0F4 50%, #FCE8EE 100%);
    border: 1px solid rgba(235, 195, 210, 0.55);
    box-shadow: 0 14px 34px rgba(200, 120, 145, 0.1);
    position: relative;
    overflow: hidden;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    background: #FDEBF2;
    color: var(--accent-purple);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(200, 56, 109, 0.08);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.hero-card-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

@media (max-width: 420px) {
    .hero-card-preview {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .btn-hero {
        width: 100%;
        justify-content: center;
    }
}

.card-deck-stack {
    position: relative;
    width: 90px;
    height: 120px;
    perspective: 1000px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.deck-mini-card {
    position: absolute;
    width: 80px;
    height: 110px;
    border-radius: 12px;
    background-image: url('assets/card_back_pastel_pink.jpg');
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(235, 195, 210, 0.6);
    box-shadow: 0 6px 16px rgba(45, 20, 38, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-bounce);
}

.deck-mini-card:nth-child(1) { transform: rotate(-8deg) translateY(0); z-index: 1; }
.deck-mini-card:nth-child(2) { transform: rotate(0deg) translateY(-4deg); z-index: 2; }
.deck-mini-card:nth-child(3) { transform: rotate(8deg) translateY(-8deg); z-index: 3; }

.btn-hero {
    background: var(--primary-gradient);
    color: #FFFFFF;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(222, 109, 142, 0.3);
    cursor: pointer;
    transition: var(--transition-bounce);
}

.btn-hero:hover, .btn-hero:active {
    transform: scale(1.04);
    box-shadow: 0 12px 30px rgba(222, 109, 142, 0.45);
}

/* Technique Grid */
.section-title {
    padding: 0 24px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
}

.section-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.techniques-grid {
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.technique-card {
    background: rgba(255, 255, 255, 0.94);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 182, 203, 0.45);
    box-shadow: 0 10px 26px rgba(255, 111, 145, 0.09);
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: var(--transition-bounce);
    overflow: hidden;
}

.technique-card:hover, .technique-card:active {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 36px rgba(255, 111, 145, 0.24);
    border-color: rgba(255, 111, 145, 0.65);
}

.technique-preview-img-box {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: var(--bg-accent-soft);
}

.technique-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-bounce);
}

.technique-card:hover .technique-preview-img {
    transform: scale(1.08);
}

.cost-tag-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(46, 25, 40, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #FFE3EE;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 182, 203, 0.4);
}

.technique-card-content {
    padding: 14px 16px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.technique-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.technique-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 14px;
}

.technique-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cost-tag {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-gold);
    background: rgba(217, 119, 6, 0.08);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.start-arrow {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-accent-soft);
    color: var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition-bounce);
}

.technique-card:hover .start-arrow {
    background: var(--accent-purple);
    color: #FFF;
}

/* Screens */
.screen {
    display: none;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out forwards;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}

.screen-title-group h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
}

.screen-title-group p {
    font-size: 12px;
    color: var(--text-muted);
}

/* 3D Card Area */
.card-interactive-area {
    margin: 24px auto 20px auto;
    width: 260px;
    height: 360px;
    perspective: 1200px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-3d-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 36px rgba(45, 20, 38, 0.14);
}

.card-3d-wrapper.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-face-back {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FAF5F0;
    transform: rotateY(0deg);
    border: 2px solid rgba(244, 216, 197, 0.95);
    box-shadow: 
        inset 0 0 24px rgba(238, 203, 171, 0.25),
        0 12px 30px rgba(194, 146, 126, 0.2);
}

.card-face-front {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotateY(180deg);
    background: #FFF;
    border: 1.5px solid rgba(235, 195, 210, 0.6);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.tap-hint-overlay {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(52, 29, 46, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #FFF6F2;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 18px;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
    border: 1px solid rgba(238, 203, 171, 0.5);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18), 0 0 14px rgba(238, 203, 171, 0.35);
    white-space: nowrap;
    z-index: 10;
}

.card-image-real {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Reflection Box */
.reflection-box {
    margin: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-glass);
}

.question-prompt {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.reflection-textarea {
    width: 100%;
    min-height: 100px;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(255, 255, 255, 0.9);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-main);
    resize: none;
    outline: none;
    transition: var(--transition-fast);
}

.reflection-textarea:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.btn-submit-reflection {
    width: 100%;
    margin-top: 14px;
    background: var(--primary-gradient);
    color: #FFF;
    border: none;
    padding: 16px;
    border-radius: var(--radius-full);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(184, 158, 239, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-bounce);
}

.btn-submit-reflection:hover, .btn-submit-reflection:active {
    transform: scale(1.02);
}

/* AI Loading & Result */
.ai-loading-box {
    margin: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.ai-orb-spinner {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    position: relative;
    animation: orbPulse 2.5s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 35px rgba(245, 198, 236, 0.6);
    border: 3px solid #FFFFFF;
    overflow: hidden;
    background: var(--primary-gradient);
}

.spinner-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transform: scale(1.05);
}

@keyframes orbPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 25px rgba(245, 198, 236, 0.5); }
    50% { transform: scale(1.12); box-shadow: 0 0 45px rgba(184, 158, 239, 0.8); }
}

.ai-result-box {
    margin: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Luxury Connected Timeline Container for AI Sections */
.ai-content-timeline {
    position: relative;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 10px;
}

/* Glowing timeline thread connecting the steps */
.ai-content-timeline::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 40px;
    left: 8px;
    width: 3px;
    background: linear-gradient(180deg, var(--accent-purple) 0%, var(--accent-gold) 100%);
    border-radius: 3px;
    opacity: 0.5;
}

.ai-section-card {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    border: 1px solid rgba(255, 182, 203, 0.45);
    box-shadow: 0 10px 28px rgba(255, 111, 145, 0.08);
    transition: var(--transition-fast);
}

.ai-section-card::before {
    content: '';
    position: absolute;
    top: 22px;
    left: -18px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--accent-purple);
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 8px rgba(216, 27, 96, 0.5);
}

/* Special styling for final recommendation section */
.ai-section-card.final-synthesis {
    background: linear-gradient(135deg, #FFF5F8 0%, #FFE2EE 100%);
    border: 1px solid rgba(255, 140, 175, 0.6);
    box-shadow: 0 12px 32px rgba(255, 111, 145, 0.18);
}

.ai-section-card.final-synthesis::before {
    background: var(--accent-gold);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.8);
}

.ai-section-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-accent-soft);
    color: var(--accent-purple);
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.ai-section-card.final-synthesis .ai-section-badge {
    background: #FFF0F5;
    color: var(--accent-gold);
}

.ai-section-title {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.ai-section-body {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-main);
}

.ai-section-body p {
    margin: 0 0 10px 0;
}

.ai-section-body p:last-child {
    margin-bottom: 0;
}

.ai-section-body strong {
    color: #4A1E35;
    font-weight: 700;
}

.ai-section-body em {
    font-style: italic;
    color: #5D2A42;
}

.ai-section-body ul, .ai-section-body ol {
    margin: 6px 0 10px 0;
    padding-left: 20px;
}

.ai-section-body li {
    margin-bottom: 4px;
}

.action-buttons-group {
    margin: 20px;
    display: flex;
    gap: 12px;
}

.btn-secondary {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 111, 145, 0.35);
    padding: 14px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Profile Modal & History */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(46, 25, 40, 0.45);
    backdrop-filter: blur(8px);
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.profile-drawer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: linear-gradient(180deg, #FFF0F5 0%, #FFFFFF 100%);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    border-top: 1px solid rgba(255, 182, 203, 0.5);
    padding: 24px;
    overflow-y: auto;
    box-shadow: 0 -10px 40px rgba(46, 25, 40, 0.2);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 101;
}

.modal-backdrop.active .profile-drawer {
    transform: translateX(-50%) translateY(0);
}

/* Stacking Contexts for Modals */
#profile-modal {
    z-index: 100;
}
#profile-modal .profile-drawer {
    z-index: 101;
}

#author-modal {
    z-index: 200;
}
#author-modal .profile-drawer {
    z-index: 201;
}

#history-detail-modal {
    z-index: 300;
}
#history-detail-modal .profile-drawer {
    z-index: 301;
}

#support-modal {
    z-index: 350;
}
#support-modal .profile-drawer {
    z-index: 351;
}

/* Centered Modal Style for Spread Review Modal */
#spread-review-modal {
    z-index: 450;
}
#spread-review-modal .profile-drawer {
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%) scale(0.95);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 440px;
    max-height: 88vh;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    z-index: 451;
}
#spread-review-modal.active .profile-drawer {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Centered Modal Style for Auth Modal - Highest Priority Modal */
#auth-modal {
    z-index: 500;
}

#auth-modal .profile-drawer {
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%) scale(0.95);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    z-index: 501;
}

#auth-modal.active .profile-drawer {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* OAuth Providers Group & Buttons */
.auth-providers-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-auth-provider {
    width: 100%;
    padding: 12px 18px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    border: 1px solid rgba(235, 195, 210, 0.55);
    background: rgba(255, 255, 255, 0.98);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: 0 4px 14px rgba(190, 110, 135, 0.08);
}

.btn-auth-provider:hover, .btn-auth-provider:active {
    transform: translateY(-2px) scale(1.01);
    border-color: #E8839E;
    box-shadow: 0 8px 22px rgba(220, 110, 145, 0.16);
}

.auth-provider-chip {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background: transparent;
}

.auth-provider-svg {
    width: 28px;
    height: 28px;
    display: block;
}

.auth-provider-text {
    flex: 1;
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.auth-provider-arrow {
    font-size: 14px;
    color: var(--text-light);
    transition: var(--transition-fast);
}

.btn-auth-provider:hover .auth-provider-arrow {
    color: var(--accent-purple);
    transform: translateX(3px);
}

.security-privacy-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-accent-warm);
    border: 1px solid rgba(235, 195, 210, 0.45);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    text-align: left;
}

.security-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* Author Banner Bar */
.author-badge-banner {
    margin: 0 20px 20px 20px;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #FFF7FA 0%, #FDEBF2 100%);
    border: 1px solid rgba(235, 175, 195, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(200, 120, 145, 0.1);
    transition: var(--transition-bounce);
}

.author-badge-banner:hover, .author-badge-banner:active {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(200, 120, 145, 0.18);
    border-color: rgba(220, 130, 160, 0.7);
}

.author-banner-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.author-sparkle {
    font-size: 16px;
}

.author-bonus-pill {
    background: var(--primary-gradient);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 12px rgba(222, 109, 142, 0.35);
    white-space: nowrap;
}

/* Author Profile Modal */
.author-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 12px auto;
    background: var(--primary-gradient);
    border: 3px solid #F6A5BC;
    box-shadow: 0 6px 20px rgba(200, 120, 145, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.author-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
}

.author-avatar-mini {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%;
    border: 2px solid #F6A5BC;
    box-shadow: 0 4px 12px rgba(200, 120, 145, 0.25);
    flex-shrink: 0;
}

.author-avatar-tiny {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%;
    border: 1px solid #F6A5BC;
    flex-shrink: 0;
}

.author-subtitle-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-purple);
    background: var(--bg-accent-soft);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    margin-top: 4px;
}

.author-bonus-card {
    background: linear-gradient(135deg, #FFF7FA 0%, #FDEBF2 100%);
    border: 1px solid rgba(235, 185, 205, 0.5);
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    box-shadow: 0 6px 18px rgba(200, 120, 145, 0.08);
}

.bonus-card-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
}

.bonus-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.btn-claim-bonus {
    background: var(--primary-gradient);
    color: #FFFFFF;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(222, 109, 142, 0.35);
    white-space: nowrap;
    transition: var(--transition-bounce);
}

.btn-claim-bonus:hover {
    transform: scale(1.03);
}

.btn-claim-bonus:disabled,
.btn-claim-bonus.claimed {
    background: #E8DCE1;
    color: #8C707F;
    box-shadow: none;
    cursor: not-allowed;
    transform: none !important;
    opacity: 0.85;
}

.author-consult-card {
    margin-top: 24px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #FFF7FA 0%, #FDEBF2 100%);
    border: 1px solid rgba(235, 175, 195, 0.45);
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 8px 24px rgba(200, 120, 145, 0.1);
}

.author-consult-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.author-consult-info {
    flex: 1;
    text-align: left;
}

.author-consult-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.35;
}

.author-consult-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 4px;
}

.btn-author-action {
    width: 100%;
    background: var(--primary-gradient);
    color: #FFF;
    border: none;
    padding: 12px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 6px 18px rgba(222, 109, 142, 0.3);
    transition: var(--transition-bounce);
}

.btn-author-action:hover, .btn-author-action:active {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(222, 109, 142, 0.45);
}

/* Author Links Group */
.btn-author-contact {
    width: 100%;
    padding: 13px 20px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition-bounce);
    text-decoration: none;
}

.btn-author-contact.primary-contact {
    background: var(--primary-gradient);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 8px 22px rgba(222, 109, 142, 0.3);
}

.btn-author-contact.primary-contact:hover, .btn-author-contact.primary-contact:active {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(222, 109, 142, 0.45);
}

.btn-author-contact.secondary-contact {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-main);
    border: 1px solid rgba(235, 195, 210, 0.6);
    box-shadow: 0 4px 14px rgba(190, 110, 135, 0.08);
}

.btn-author-contact.secondary-contact:hover, .btn-author-contact.secondary-contact:active {
    transform: translateY(-2px);
    border-color: #E8839E;
    color: var(--accent-purple);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.drawer-header h3 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
}

.btn-close-drawer {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.95);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border: 1px solid rgba(255, 182, 203, 0.4);
    box-shadow: 0 4px 14px rgba(255, 111, 145, 0.08);
}

.profile-large-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: 3px solid #FF85A1;
    box-shadow: 0 4px 16px rgba(255, 111, 145, 0.45);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #FFF;
}

.profile-details h4 {
    font-size: 18px;
    font-weight: 700;
}

.profile-details p {
    font-size: 13px;
    color: var(--text-muted);
}

.tariff-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.tariff-item {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(235, 195, 210, 0.55);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: 0 4px 14px rgba(190, 110, 135, 0.06);
}

.tariff-item:hover, .tariff-item:active {
    transform: translateY(-2px);
    border-color: #E8839E;
    box-shadow: 0 8px 22px rgba(220, 110, 145, 0.15);
}

.tariff-item.popular {
    border-color: #E8839E;
    background: linear-gradient(135deg, #FFF7FA 0%, #FDEBF2 100%);
    position: relative;
}

.tariff-item.popular::after {
    content: '🔥 Популярно';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-gradient);
    color: #FFF;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 10px rgba(222, 109, 142, 0.35);
}

.tariff-item.pro-tariff {
    border-color: rgba(232, 180, 114, 0.7);
    background: linear-gradient(135deg, #FFFDF7 0%, #FFF5E8 100%);
}

.tariff-coins {
    font-size: 17px;
    font-weight: 800;
    color: var(--accent-purple);
    margin-bottom: 4px;
}

.tariff-price {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 700;
}

.referral-box {
    background: var(--bg-accent-warm);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 182, 203, 0.35);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ref-text h5 {
    font-size: 14px;
    font-weight: 700;
}

.ref-text p {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-copy-ref {
    background: #FFF;
    border: 1px solid var(--gold-border);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-gold);
    cursor: pointer;
}

/* History Items */
.history-section {
    margin-top: 10px;
}

.history-item {
    background: #FFF;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 182, 203, 0.3);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-main);
}

.history-item-technique {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.empty-history {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 10px;
}

/* Toast notification */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(46, 25, 40, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #FFF;
    padding: 12px 22px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    z-index: 9999;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 182, 203, 0.3);
    text-align: center;
    max-width: 90vw;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Legal Links */
.legal-link-item {
    display: block;
    padding: 10px 14px;
    background: #FFF;
    border: 1px solid rgba(255, 182, 203, 0.3);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition-fast);
}

.legal-link-item:hover, .legal-link-item:active {
    background: var(--bg-accent-soft);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

/* Multi-Card & Techniques List Styling */
.techniques-list-container {
    padding: 0 20px 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.technique-item-card {
    background: rgba(255, 255, 255, 0.94);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    border: 1px solid rgba(255, 182, 203, 0.4);
    box-shadow: 0 8px 22px rgba(255, 111, 145, 0.08);
    cursor: pointer;
    transition: var(--transition-bounce);
}

.technique-item-card:hover, .technique-item-card:active {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(255, 111, 145, 0.2);
    border-color: rgba(255, 111, 145, 0.6);
}

.technique-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.technique-item-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.technique-item-badge {
    font-size: 11px;
    font-weight: 700;
    background: var(--bg-accent-soft);
    color: var(--accent-purple);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.technique-item-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.btn-redraw {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 111, 145, 0.4);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-purple);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 111, 145, 0.12);
    transition: var(--transition-bounce);
}

.btn-redraw:hover, .btn-redraw:active {
    transform: scale(1.05);
    background: var(--bg-accent-warm);
}

.step-question-box {
    margin: 0 20px 10px 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #FFF8FB 0%, #FFEBF2 100%);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 182, 203, 0.45);
    text-align: center;
    box-shadow: 0 8px 22px rgba(255, 111, 145, 0.1);
}

.step-question-text {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.35;
}

/* Modern Sleek Step Navigation Buttons */
.step-nav-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    align-items: center;
}

.btn-step-prev {
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--accent-purple);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-step-prev:hover, .btn-step-prev:active {
    background: var(--bg-accent-soft);
    border-color: var(--accent-purple);
}

.btn-step-next {
    flex: 1;
    background: var(--primary-gradient);
    color: #FFFFFF;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(184, 158, 239, 0.4);
    transition: var(--transition-bounce);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-step-next:hover, .btn-step-next:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 158, 239, 0.6);
}

.btn-skip-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    transition: var(--transition-fast);
    text-decoration: underline;
    text-decoration-color: rgba(0, 0, 0, 0.15);
}

.btn-skip-link:hover, .btn-skip-link:active {
    color: var(--accent-purple);
    text-decoration-color: var(--accent-purple);
}

/* Card Skeleton Loader */
.card-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #F5EBF7 0%, #E8DFEE 50%, #F5EBF7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

.skeleton-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.7) 50%, transparent 100%);
    animation: skeletonShimmer 1.4s infinite;
}

@keyframes skeletonShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skeleton-icon {
    font-size: 36px;
    opacity: 0.45;
    animation: skeletonPulse 1.4s infinite ease-in-out;
}

@keyframes skeletonPulse {
    0%, 100% { transform: scale(1); opacity: 0.35; }
    50% { transform: scale(1.15); opacity: 0.65; }
}

/* ==========================================================================
   Full Screen Interactive Card Zoom Lightbox Modal
   ========================================================================== */
.card-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.card-zoom-modal.active {
    opacity: 1;
    visibility: visible;
}

.zoom-modal-header {
    width: 100%;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    z-index: 10002;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0));
}

.zoom-modal-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
}

.btn-close-zoom {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.btn-close-zoom:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.3);
}

.zoom-viewport {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

.zoom-viewport:active {
    cursor: grabbing;
}

.zoom-card-img {
    max-width: 90vw;
    max-height: 75vh;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
    transform-origin: center center;
    will-change: transform;
    transition: transform 0.05s linear;
}

.zoom-controls {
    display: flex;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 30px;
    margin-bottom: 8px;
    z-index: 10002;
}

.zoom-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.zoom-btn:active {
    background: rgba(255, 255, 255, 0.25);
}

.zoom-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
    z-index: 10002;
    text-align: center;
}

.zoom-trigger-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    color: white;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}

/* ==========================================================================
   Interactive History Sessions & Detail Drawer
   ========================================================================== */
.history-item {
    background: #FFFFFF;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid rgba(139, 92, 246, 0.12);
    box-shadow: 0 4px 14px rgba(74, 62, 107, 0.05);
    cursor: pointer;
    transition: var(--transition-bounce);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item:hover, .history-item:active {
    transform: translateY(-2px);
    border-color: var(--accent-purple);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.15);
    background: var(--bg-accent-soft);
}

.history-item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-item-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-item-sub {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.history-badge-ai {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-purple);
    font-weight: 700;
}

.history-badge-base {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 6px;
    background: rgba(234, 88, 12, 0.12);
    color: #ea580c;
    font-weight: 600;
}

.history-item-action {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-purple);
    background: #FFF;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* History Detail Drawer Styling */
#history-detail-modal .profile-drawer {
    z-index: 105;
    max-height: 88vh;
    background: #FAF7F5;
}

.history-cards-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 2px 14px 2px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.history-card-item {
    flex: 0 0 220px;
    scroll-snap-align: start;
    background: #FFFFFF;
    border-radius: var(--radius-md);
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-card-img-wrapper {
    position: relative;
    width: 100%;
    height: 240px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.history-card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.history-card-img-wrapper:active img {
    transform: scale(1.05);
}

.history-card-question {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-purple);
    line-height: 1.3;
}

.history-card-response {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.4;
    background: #F8F5F2;
    padding: 8px 10px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-gold);
}

/* ==========================================
   ORGANIC FONT SIZE SCALING SYSTEM & READER CONTROLS
   ========================================== */

:root {
    --font-scale: 1;
}

body[data-font-size="small"] { --font-scale: 0.88; }
body[data-font-size="medium"] { --font-scale: 1.0; }
body[data-font-size="large"] { --font-scale: 1.16; }
body[data-font-size="xlarge"] { --font-scale: 1.32; }

/* Smooth font scaling transitions across readable text elements */
.ai-section-body,
.ai-section-title,
.step-question-text,
.reflection-textarea,
.custom-question-input,
.history-ai-container,
.history-cards-container,
.history-card-response {
    transition: font-size 0.25s ease, line-height 0.25s ease;
}

.ai-section-body {
    font-size: calc(15px * var(--font-scale)) !important;
    line-height: calc(1.65 * 1) !important;
}

.ai-section-title {
    font-size: calc(18px * var(--font-scale)) !important;
}

.step-question-text {
    font-size: calc(18px * var(--font-scale)) !important;
}

.reflection-textarea {
    font-size: calc(15px * var(--font-scale)) !important;
}

.custom-question-input {
    font-size: calc(14px * var(--font-scale)) !important;
}

.history-card-response {
    font-size: calc(13px * var(--font-scale)) !important;
}

/* Organic Reader Toolbar (AI Interpretation Card) */
.reader-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(139, 92, 246, 0.15);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.06);
    margin-bottom: 12px;
}

.reader-toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.reader-font-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(139, 92, 246, 0.07);
    padding: 3px;
    border-radius: var(--radius-full);
}

.reader-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-left: 6px;
    margin-right: 2px;
}

.font-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-fast);
}

.font-btn:active {
    transform: scale(0.92);
}

.font-btn.active {
    background: #FFFFFF;
    color: var(--accent-purple);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

/* Profile Settings Drawer Card */
.settings-group-card {
    margin-top: 16px;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-md);
    border: 1px solid rgba(139, 92, 246, 0.12);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.settings-group-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.segmented-font-selector {
    display: flex;
    background: rgba(139, 92, 246, 0.08);
    padding: 3px;
    border-radius: var(--radius-sm);
    gap: 4px;
}

.segmented-btn {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 4px;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
}

.segmented-btn.active {
    background: #FFFFFF;
    color: var(--accent-purple);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   BASE / FREE CARD INTERPRETATION STYLES
   ========================================== */
.base-card-section {
    margin-bottom: 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(255, 111, 145, 0.08);
}

.base-card-preview-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.base-card-preview-thumb {
    width: 78px;
    height: 110px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(216, 27, 96, 0.18);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
}

.base-card-preview-thumb:active {
    transform: scale(0.95);
}

.base-keywords-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.base-keyword-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 235, 242, 0.95);
    color: var(--accent-purple);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(216, 27, 96, 0.15);
}

.base-reflection-box {
    margin-top: 12px;
    background: linear-gradient(135deg, rgba(255, 245, 248, 0.9) 0%, rgba(255, 238, 245, 0.6) 100%);
    border-left: 3px solid var(--accent-purple);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.5;
}

.base-upsell-card {
    background: linear-gradient(135deg, #FFF0F5 0%, #FFE2EE 100%);
    border: 2px dashed rgba(216, 27, 96, 0.35);
    border-radius: var(--radius-md);
    padding: 22px 18px;
    text-align: center;
    box-shadow: 0 10px 28px rgba(255, 111, 145, 0.12);
    margin-top: 16px;
}

.base-upsell-card h3 {
    font-family: var(--font-heading);
    font-size: 19px;
    color: var(--text-main);
    margin-bottom: 6px;
}

.base-upsell-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Review System Styles */
.review-view-card {
    background: #FFF8FA;
    border: 1px solid rgba(235, 195, 210, 0.9);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 4px 14px rgba(255, 111, 145, 0.06);
}

.review-form-card {
    background: #FFF8FA;
    border: 1px solid rgba(235, 195, 210, 0.9);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 4px 14px rgba(255, 111, 145, 0.06);
}

.star-rating-selector {
    display: flex;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.star-rating-selector .star-item {
    color: #E5E7EB;
    transition: color 0.18s ease, transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
    cursor: pointer;
    line-height: 1;
}

.star-rating-selector .star-item.active {
    color: #F59E0B;
}

.star-rating-selector .star-item:hover,
.star-rating-selector .star-item:active {
    transform: scale(1.22);
}

/* History Pagination */
.history-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(235, 195, 210, 0.6);
}

.btn-history-page {
    background: #FFF8FA;
    border: 1px solid rgba(255, 111, 145, 0.4);
    color: var(--primary);
    border-radius: 10px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-history-page:hover:not(:disabled) {
    background: rgba(255, 111, 145, 0.1);
    border-color: var(--primary);
}

.btn-history-page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-muted);
}

.history-page-info {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

