:root {
    --bg-primary: #0b0b0f;
    --bg-secondary: #14141a;
    --bg-card: #1c1c24;
    --bg-card-hover: #252532;
    --accent: #0a84ff;
    --accent-light: #5aa8ff;
    --accent-dark: #0060df;
    --text-primary: #ffffff;
    --text-secondary: #c7c7cc;
    --text-muted: #8e8e93;
    --success: #32d74b;
    --warning: #ff9f0a;
    --danger: #ff453a;
    --gradient-btn: linear-gradient(180deg, #5aa8ff 0%, #0a84ff 100%);
    --radius: 18px;
    --radius-sm: 12px;
    --shadow-card: 0 14px 28px rgba(0, 0, 0, 0.35);
    --shadow-float: 0 10px 26px rgba(10, 132, 255, 0.28);
    --ease-ios: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: radial-gradient(circle at 20% 10%, rgba(20, 26, 48, 0.55), transparent 45%),
                radial-gradient(circle at 80% 0%, rgba(10, 132, 255, 0.18), transparent 40%),
                var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    height: 100dvh;
}

.app-container {
    width: 100%;
    max-width: 430px;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 932px;
    background: radial-gradient(circle at 15% 15%, rgba(20, 26, 48, 0.35), transparent 45%),
                radial-gradient(circle at 85% 0%, rgba(10, 132, 255, 0.12), transparent 40%),
                var(--bg-primary);
    position: relative;
    overflow: hidden;
}

@supports not (height: 100dvh) {
    body {
        min-height: 100vh;
        height: 100vh;
    }

    .app-container {
        min-height: 100vh;
        height: 100vh;
    }
}

@media (min-width: 431px) {
    .app-container {
        border-radius: 40px;
        border: 1px solid rgba(255,255,255,0.08);
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    }
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 10px; /* space for nav bar */
    z-index: 10;
}

.screen.active {
    display: flex !important;
    z-index: 20 !important;
}

.screen::-webkit-scrollbar { display: none; }

.screen.onboarding {
    justify-content: center;
    align-items: center;
    text-align: center;
    bottom: 0;
}

/* Nav Bar */
.nav-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    min-height: 70px;
    background: rgba(18, 18, 24, 0.9);
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    backdrop-filter: blur(30px) saturate(1.3);
    -webkit-backdrop-filter: blur(30px) saturate(1.3);
    display: none;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 6px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 3000;
    pointer-events: auto;
}

/* Status Bar */

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

/* Typography */
h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 32px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 15px 16px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.45s var(--ease-ios), box-shadow 0.45s var(--ease-ios), background 0.45s var(--ease-ios);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary {
    background: var(--gradient-btn);
    color: #fff;
    box-shadow: var(--shadow-float);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: var(--shadow-card);
}

.btn-small {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 12px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: var(--shadow-card);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 12px;
    transition: all 0.2s;
}

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

.nav-item svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    opacity: 0.8;
}

.nav-item.active svg {
    opacity: 1;
}

/* ============ SPLASH ============ */
#screen-splash {
    background: #000;
    background-image: url('/static/img/splash_screen.png');
    background-size: cover;
    background-position: center;
    justify-content: center;
    align-items: center;
    padding: 0;
}

/* ============ ONBOARDING ============ */
#screen-onboarding-1 {
    background: #000;
    background-image: url('/static/img/onboarding.png');
    background-size: cover;
    background-position: center;
    padding: 0;
    justify-content: flex-end;
    align-items: center;
}

#screen-onboarding-1 .onboarding-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 24px 50px 24px;
    z-index: 10;
}

#screen-onboarding-1 .onboarding-content .btn {
    border-radius: 10px;
    font-size: 18px;
    padding: 18px;
}

.step-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}

.step-dot {
    width: 8px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.25);
}

.step-dot.active {
    width: 24px;
    background: #ffffff;
}

/* ============ ONBOARDING BUTTON ============ */
#screen-onboarding-1 .onboarding-content .btn {
    border-radius: 10px;
    font-size: 18px;
    padding: 18px;
    background: rgb(55, 69, 216);
}

#screen-onboarding-1 .btn:hover {
    background: rgb(65, 79, 230);
}

/* ============ LINK ACCOUNTS ============ */
#screen-onboarding-2 {
    background: #000;
    background-image: url('/static/img/link_account.png');
    background-size: cover;
    background-position: center;
    padding: 0;
    justify-content: flex-end;
    align-items: center;
}

#screen-onboarding-2 .link-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 24px 50px 24px;
    z-index: 10;
}

#screen-onboarding-2 .social-btn {
    width: 100%;
    padding: 18px 20px;
    background: rgb(27, 28, 46);
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

#screen-onboarding-2 .social-btn:active {
    background: rgb(35, 37, 60);
}

#screen-onboarding-2 .social-btn .left {
    display: flex;
    align-items: center;
    gap: 14px;
}

#screen-onboarding-2 .social-btn .left .icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

#screen-onboarding-2 .social-btn.hidden {
    display: none;
}

#screen-onboarding-2 .arrow {
    color: rgb(209, 207, 218);
    font-size: 20px;
}

#screen-onboarding-2 .username-input {
    display: none;
    width: 100%;
    padding: 18px 20px;
    background: rgb(27, 28, 46);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 17px;
    margin-bottom: 12px;
}

#screen-onboarding-2 .username-input.show {
    display: block;
}

#screen-onboarding-2 .username-input::placeholder {
    color: rgb(160, 160, 170);
}

#screen-onboarding-2 .hint-text {
    font-size: 13px;
    color: rgb(209, 207, 218);
    text-align: center;
    margin-top: 16px;
}

#screen-onboarding-2 .step-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}

#screen-onboarding-2 .step-dot {
    width: 8px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.25);
}

#screen-onboarding-2 .step-dot.active {
    width: 24px;
    background: #ffffff;
}

/* ============ ANALYZE ============ */
#screen-onboarding-3 {
    background: #000;
    background-image: url('/static/img/analyze.png');
    background-size: cover;
    background-position: center;
    justify-content: center;
    align-items: center;
    padding: 0;
}

#screen-onboarding-3 .analyze-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 24px 50px 24px;
    z-index: 10;
}

.analyze-progress {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 24px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analyze-progress svg {
    position: absolute;
    width: 140px;
    height: 140px;
    transform: rotate(-90deg);
}

.analyze-progress circle {
    fill: none;
    stroke-width: 6;
}

.analyze-progress .bg {
    stroke: rgb(27, 28, 46);
}

.analyze-progress .progress {
    stroke: #3730a3;
    stroke-linecap: round;
    stroke-dasharray: 408;
    stroke-dashoffset: 408;
    transition: stroke-dashoffset 0.5s ease;
}

.analyze-progress .progress.show {
    stroke-dashoffset: 98;
}

.analyze-percent {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
}

.analyze-label {
    font-size: 14px;
    color: rgb(160, 160, 170);
    text-align: center;
    position: absolute;
    bottom: 50px;
    left: 0;
    right: 0;
}

.step-dot.active {
    width: 24px;
    background: #fff;
}

/* ============ ONBOARDING ============ */
.onboarding-icon {
    width: 200px;
    height: 140px;
    background: var(--bg-card);
    border-radius: 20px;
    margin: 32px 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: var(--shadow-card);
}

.onboarding-icon::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 40px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.1));
    border-radius: 12px;
}

.onboarding-icon::after {
    content: '📈';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
}

.step-dots {
    display: flex;
    gap: 6px;
    margin-top: 32px;
}

.step-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.step-dot.active {
    width: 20px;
    border-radius: 3px;
    background: var(--accent-light);
}

/* Social Buttons */
.social-btn {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.social-btn:active { background: var(--bg-card-hover); }

.social-btn .left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.social-btn .icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.social-btn .icon.ig { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); }
.social-btn .icon.tt { background: #010101; border: 1px solid rgba(255,255,255,0.2); }

.social-btn .arrow { color: var(--text-muted); font-size: 18px; }

.hint-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 20px;
}

/* Goal Options */
.goal-option {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    text-align: left;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.goal-option.selected {
    border-color: var(--accent);
    background: rgba(79, 70, 229, 0.1);
}

/* ============ PROGRESS / ANALYSIS ============ */
.progress-wrap {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 32px auto;
}

.progress-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(#3730a3 0deg, #3730a3 273deg, #111118 273deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(55, 48, 131, 0.4);
}

.progress-ring::after {
    content: '76%';
    width: 130px;
    height: 130px;
    background: #0a0a0f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 800;
    color: #fff;
}

.progress-label {
    font-size: 14px;
    color: rgb(160,160,170);
    text-align: center;
    margin-top: 24px;
}

.step-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
}

.step-dot {
    width: 8px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.25);
}

.step-dot.active {
    width: 24px;
    background: #ffffff;
}

.progress-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(var(--accent-light) 0deg, var(--accent-light) 273deg, var(--bg-card) 273deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.2);
}

.progress-ring::after {
    content: '76%';
    width: 130px;
    height: 130px;
    background: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 800;
    color: #fff;
}

.progress-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* Strategy Items */
.strategy-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.strategy-item:last-child { border-bottom: none; }

.strategy-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.strategy-icon.pink { background: rgba(236, 72, 153, 0.15); }
.strategy-icon.green { background: rgba(34, 197, 94, 0.15); }
.strategy-icon.orange { background: rgba(245, 158, 11, 0.15); }
.strategy-icon.blue { background: rgba(59, 130, 246, 0.15); }

.strategy-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.strategy-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============ DASHBOARD ============ */
.ios-dashboard-card {
    background: linear-gradient(180deg, rgba(34, 34, 44, 0.92), rgba(24, 24, 32, 0.92));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    box-shadow: 0 16px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
    backdrop-filter: blur(24px) saturate(1.25);
    -webkit-backdrop-filter: blur(24px) saturate(1.25);
}

.ios-stat-card {
    background: linear-gradient(180deg, rgba(36, 36, 46, 0.95), rgba(28, 28, 36, 0.95));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    box-shadow: 0 12px 26px rgba(0,0,0,0.32);
}

.ios-insights-hero {
    padding: 18px 16px;
    margin-bottom: 16px;
    text-align: center;
}

.ios-insights-hero-avatar {
    width: 74px;
    height: 74px;
    margin: 0 auto 12px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-card);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 6px rgba(10, 132, 255, 0.1);
}

.ios-insights-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.ios-insights-metric {
    padding: 10px 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
}

.ios-insight-card {
    padding: 16px;
    margin-bottom: 12px;
}

.ios-insight-icon {
    font-size: 30px;
    margin-bottom: 10px;
}

.ios-insight-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.ios-insight-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.ios-insight-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ios-insight-list-item {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
}

.ios-insight-list-item.accent {
    background: rgba(10,132,255,0.08);
    border-color: rgba(10,132,255,0.18);
}

.ios-insight-list-item.success {
    background: rgba(50,215,75,0.08);
    border-color: rgba(50,215,75,0.2);
}

.ios-insight-list-item.warning {
    background: rgba(255,159,10,0.08);
    border-color: rgba(255,159,10,0.2);
}

.ios-insight-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ios-insight-bullet {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.ios-insight-bullet.accent { background: var(--accent-light); }
.ios-insight-bullet.success { background: var(--success); }
.ios-insight-bullet.warning { background: var(--warning); }

.ios-posts-header {
    margin-top: 22px;
    margin-bottom: 14px;
}

.ios-posts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ios-post-card {
    background: linear-gradient(180deg, rgba(34, 34, 44, 0.95), rgba(24, 24, 32, 0.95));
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 22px rgba(0,0,0,0.3);
}

.growth-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.growth-score {
    font-size: 56px;
    font-weight: 900;
    letter-spacing: -3px;
    line-height: 1;
}

.growth-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-size: 14px;
    font-weight: 600;
    margin-top: 6px;
}

.growth-chart {
    width: 100px;
    height: 40px;
    position: relative;
}

.growth-chart svg {
    width: 100%;
    height: 100%;
}

/* Alert Card */
.alert-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 20px;
    padding: 16px;
    margin: 0 20px 16px 20px;
    position: relative;
}

.alert-card .alert-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.alert-card .alert-icon {
    width: 28px;
    height: 28px;
    background: rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.alert-card .alert-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--warning);
}

.alert-card .alert-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.alert-card .alert-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--warning);
    cursor: pointer;
    border: none;
}

/* Today Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
}

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

.today-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

/* ============ CONTENT ============ */
.tabs {
    display: flex;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 3px;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

.tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
}

.content-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: var(--shadow-card);
}

.content-idea {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.content-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.hooks-section {
    margin-bottom: 16px;
}

.hooks-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.hook-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.hook-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-muted);
    border-radius: 5px;
    flex-shrink: 0;
    margin-top: 1px;
}

.hook-check.checked {
    background: var(--accent);
    border-color: var(--accent);
}

.hook-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

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

.content-actions .btn { flex: 1; }

/* Video Preview */
.video-preview {
    width: 100%;
    aspect-ratio: 9/16;
    max-height: 280px;
    background: linear-gradient(135deg, #1a1a2e, #101018);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.video-text {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.video-subtitles {
    position: absolute;
    bottom: 60px;
    left: 16px;
    right: 16px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(10px);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    color: #fff;
    line-height: 1.4;
}

/* ============ PLANNING ============ */
.plan-header {
    margin-bottom: 20px;
}

.plan-title {
    font-size: 18px;
    font-weight: 700;
}

.plan-sub {
    font-size: 13px;
    color: var(--text-secondary);
}

.plan-day {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.plan-day:last-child { border-bottom: none; }

.plan-day-name {
    width: 36px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.plan-day-date {
    width: 50px;
    font-size: 12px;
    color: var(--text-muted);
}

.plan-day-count {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.plan-day-time {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

.plan-day-videos {
    display: flex;
    gap: 6px;
}

.plan-video-thumb {
    width: 36px;
    height: 48px;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.plan-ideas-rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 10px;
    margin-bottom: 14px;
    scrollbar-width: none;
}

.plan-ideas-rail::-webkit-scrollbar { display: none; }

.plan-ideas-chip {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.35s var(--ease-ios);
}

.plan-ideas-chip.active {
    background: rgba(10,132,255,0.22);
    border-color: rgba(10,132,255,0.35);
    color: #fff;
}

.plan-day-card {
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(33,33,42,0.95), rgba(24,24,32,0.95));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

.plan-day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.plan-day-badge {
    font-size: 11px;
    color: var(--accent-light);
    background: rgba(10,132,255,0.18);
    border: 1px solid rgba(10,132,255,0.3);
    padding: 4px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.plan-idea-row {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.03);
    margin-bottom: 8px;
}

.plan-idea-row:last-child { margin-bottom: 0; }

/* ============ INSIGHTS ============ */
.insight-card {
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 12px;
}

.insight-card.red {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.insight-card.green {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.insight-metric {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.insight-metric.red { color: var(--danger); }
.insight-metric.green { color: var(--success); }

.insight-change {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.insight-problem {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.insight-solution {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.insight-btn {
    display: inline-block;
    padding: 8px 14px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
}

/* ============ CHAT ============ */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chat-header h2 { margin-bottom: 0; }

.chat-close {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    font-size: 18px;
}

.chat-msg-user {
    background: var(--accent);
    color: #fff;
    padding: 12px 16px;
    border-radius: 16px 16px 4px 16px;
    font-size: 14px;
    margin-bottom: 16px;
    align-self: flex-end;
    max-width: 80%;
}

.chat-idea-block {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: var(--shadow-card);
}

.chat-idea-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.chat-idea-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.chat-idea-icon {
    width: 24px;
    height: 24px;
    background: rgba(245, 158, 11, 0.15);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.chat-idea-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
}

.chat-create-btn {
    width: 100%;
    padding: 14px;
    background: var(--gradient-btn);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
}

.chat-input-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.chat-send {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============ PAYWALL ============ */
.paywall-header {
    text-align: center;
    margin-bottom: 24px;
}

.paywall-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.paywall-sub {
    font-size: 14px;
    color: var(--text-secondary);
}

.paywall-cards {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.paywall-card {
    min-width: 140px;
    flex: 1;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    padding: 16px 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.paywall-card.popular {
    border-color: var(--accent);
    background: rgba(79, 70, 229, 0.08);
    position: relative;
}

.paywall-card.popular::before {
    content: 'Популярный';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 10px;
    background: var(--accent);
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
}

.paywall-plan {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.paywall-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.paywall-features {
    list-style: none;
    text-align: left;
    font-size: 11px;
    color: var(--text-secondary);
}

.paywall-features li {
    margin-bottom: 4px;
    padding-left: 14px;
    position: relative;
}

.paywall-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
}

.paywall-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

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

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Dashboard Account Header */
.account-header {
    display: flex;
    align-items: center;
    padding: 24px 20px;
    gap: 16px;
    margin-bottom: 10px;
}

.account-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-card);
    background-size: cover;
    background-position: center;
    border: 3px solid var(--accent);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

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

.account-info {
    flex: 1;
}

.account-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.account-stats {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

.growth-score-wrap {
    text-align: center;
}

.growth-score {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-light);
}

.growth-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

#dashboard-chart {
    padding: 0 20px;
    margin-bottom: 20px;
}

/* Chat Screen - Modern */
#screen-chat .chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    padding: 16px;
}

.chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.chat-suggestion {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-suggestion:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255,255,255,0.12);
}

.chat-suggestion-icon {
    font-size: 20px;
}

.chat-suggestion-text {
    font-size: 14px;
    color: var(--text-primary);
    flex: 1;
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.chat-msg {
    margin-bottom: 16px;
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    animation: msgPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes msgPop {
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg.user {
    background: var(--gradient-btn);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    box-shadow: var(--shadow-float);
}

.chat-msg.assistant {
    background: var(--bg-card);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: var(--shadow-card);
}

.chat-input-wrap {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.06);
    border-radius: 24px;
    margin-top: auto;
}

.chat-input-wrap .chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.chat-input-wrap .chat-send {
    background: var(--accent);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* Alert Card - Dynamic */
.alert-card {
    margin: 0 20px 20px 20px;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    border-left: 4px solid var(--warning);
    box-shadow: var(--shadow-card);
}

.alert-card.success {
    border-left-color: var(--success);
}

.alert-card.danger {
    border-left-color: var(--danger);
}

/* Chat Header */
.chat-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.chat-header-title h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.chat-header-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.chat-close {
    background: rgba(255,255,255,0.08);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
}

/* Account Header in Dashboard (additional) */
@media (max-width: 430px) {
    .account-header {
        background: var(--bg-secondary);
    }
}

.back-btn {
    background: rgba(255,255,255,0.08);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    margin-right: 12px;
        right: 25px;
}

.platform-back-btn {
    position: absolute;
    top: -56px;
    right: calc(10px + env(safe-area-inset-right));
    width: 42px;
    height: 42px;
    margin-right: 0;
    border-radius: 14px;
    background: rgba(28, 28, 36, 0.82);
    border: 1px solid rgba(255,255,255,0.16);
    backdrop-filter: blur(16px) saturate(1.25);
    -webkit-backdrop-filter: blur(16px) saturate(1.25);
    box-shadow: 0 10px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
    font-size: 20px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 24;
    right:25px;
}

.platform-back-btn:active {
    transform: scale(0.96);
    background: rgba(36, 36, 46, 0.9);
}

/* iOS-like motion */
.screen.active {
    animation: screenIn 0.6s var(--ease-ios);
}

.card,
.content-card,
.today-card,
.chat-idea-block,
.insight-card,
.paywall-card,
.social-btn,
.goal-option,
.tab,
.nav-item,
.chat-suggestion {
    transition: transform 0.5s var(--ease-ios), box-shadow 0.5s var(--ease-ios), background 0.5s var(--ease-ios), border-color 0.5s var(--ease-ios);
}

.card:active,
.content-card:active,
.today-card:active,
.chat-idea-block:active,
.insight-card:active,
.paywall-card:active,
.social-btn:active,
.goal-option:active,
.tab:active,
.chat-suggestion:active {
    transform: scale(0.98);
}

.nav-item:active {
    transform: translateY(1px) scale(0.98);
}

.btn,
.chat-send,
.alert-action,
.insight-btn,
.back-btn,
.chat-close {
    transition: transform 0.45s var(--ease-ios), box-shadow 0.45s var(--ease-ios), background 0.45s var(--ease-ios), color 0.45s var(--ease-ios);
}

.fade-in {
    animation: fadeIn 0.7s var(--ease-ios);
}

@keyframes screenIn {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
.screen-header {
    display: flex;
    align-items: center;
}
