/* ========================================
   CSS VARIABLES & RESET
======================================== */
:root {
    --bg-gradient-start: #0f0f1a;
    --bg-gradient-end: #1a1a2e;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #8b5cf6;
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.4);
    --accent-orange: #f59e0b;
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px var(--primary-glow);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* ── Premium Design Tokens ── */
    --prem-bg: #1a1a2c;
    --prem-surface: rgba(255, 255, 255, 0.04);
    --prem-surface-hover: rgba(255, 255, 255, 0.07);
    --prem-border: rgba(105, 136, 132, 0.25);
    --prem-border-hover: rgba(105, 136, 132, 0.55);
    --prem-glow: rgba(105, 136, 132, 0.15);
    --prem-glow-hover: rgba(105, 136, 132, 0.30);
    --prem-accent: #698884;
    --prem-accent-bright: #8ab5b0;
    --prem-text: #dedcda;
    --prem-text-sub: rgba(222, 220, 218, 0.55);
    --prem-radius: 20px;
    --prem-icon-size: 52px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #0a0a12 0%, #12121f 50%, #0f0f1a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

input, textarea, select, button {
    color: inherit;
    font-family: inherit;
}

/* ========================================
   PHONE FRAME
======================================== */

/* ========================================
   SPLASH SCREEN
======================================== */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #0f0f1a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
    animation: splashFadeIn 0.6s ease forwards;
}

.splash-logo {
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin-bottom: 20px;
    animation: splashPulse 1.2s ease-in-out infinite;
    filter: drop-shadow(0 4px 20px rgba(99, 102, 241, 0.3));
    image-rendering: auto;
    -webkit-image-rendering: auto;
}

.splash-title {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.splash-tagline {
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

@keyframes splashFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes splashPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}

/* ========================================
   WELCOME CAROUSEL
======================================== */
.welcome-carousel {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(180deg, #0f0f1a 0%, #1a1a2e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px 24px;
    animation: carouselIn 0.4s ease;
}

@keyframes carouselIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.carousel-slides {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 360px;
    position: relative;
}

.carousel-slide {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    animation: slideFadeIn 0.35s ease;
}

.carousel-slide.active {
    display: flex;
}

@keyframes slideFadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.carousel-image {
    width: 160px;
    height: 160px;
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 16px rgba(99, 102, 241, 0.25));
    image-rendering: auto;
    -webkit-image-rendering: auto;
}

.carousel-emoji {
    font-size: 72px;
    margin-bottom: 8px;
}

.carousel-slide h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.carousel-slide p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 300px;
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 360px;
    padding: 20px 0;
}

.carousel-dots {
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: all 0.25s ease;
}

.carousel-dot.active {
    background: var(--primary);
    width: 20px;
    border-radius: 4px;
}

.carousel-next {
    min-width: 100px;
}

.carousel-skip {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 8px 16px;
    margin-top: 4px;
    transition: color 0.2s;
}

.carousel-skip:hover {
    color: var(--text-secondary);
}

/* ========================================
   ONBOARDING SKIP LINK
======================================== */
.onboarding-skip-link {
    display: inline-block;
    color: var(--text-muted);
    font-size: 12px;
    text-decoration: none;
    margin-top: -4px;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.onboarding-skip-link:hover {
    color: var(--text-secondary);
    text-decoration: underline;
}

.phone-frame {
    width: 100%;
    max-width: 430px;
    height: 800px;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    border-radius: var(--radius-xl);
    box-shadow: 
        0 0 0 2px rgba(255, 255, 255, 0.1),
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 100px -20px var(--primary-glow);
    overflow: hidden;
    position: relative;
}

/* Notch */
.phone-frame::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 28px;
    background: #000;
    border-radius: 20px;
    z-index: 100;
}

/* Home indicator */
.phone-frame::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 134px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    z-index: 100;
}

.screen-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* ========================================
   SCREENS
======================================== */
.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    padding: 50px 20px 30px;
    overflow-y: auto;
    transition: transform var(--transition-slow), opacity var(--transition-slow);
    scrollbar-width: none;
}

.screen::-webkit-scrollbar {
    display: none;
}

.screen.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
}

.screen.inactive-left {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.screen.inactive-right {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   TYPOGRAPHY
======================================== */
.screen-title {
    font-size: 26px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.screen-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.section-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0;
    margin-bottom: 12px;
}

/* ========================================
   PROGRESS BAR
======================================== */
.progress-container {
    margin-bottom: 24px;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 3px;
    transition: width var(--transition-normal);
}

.progress-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: right;
}

/* ========================================
   CARDS
======================================== */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* ========================================
   GOAL SELECTION (Radio Cards)
======================================== */
.goal-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.goal-option {
    position: relative;
    cursor: pointer;
}

.goal-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.goal-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--glass-bg);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all var(--transition-fast);
}

.goal-option input:checked + .goal-card {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    box-shadow: var(--shadow-glow);
}

.goal-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

.goal-option input:checked + .goal-card:hover {
    background: rgba(99, 102, 241, 0.2);
}

.goal-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.goal-icon.fat { background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%); }
.goal-icon.muscle { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); }
.goal-icon.performance { background: linear-gradient(135deg, #06b6d4 0%, #10b981 100%); }

.goal-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.goal-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.goal-check {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.goal-option input:checked + .goal-card .goal-check {
    background: var(--primary);
    border-color: var(--primary);
}

.goal-check::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-fast);
}

.goal-option input:checked + .goal-card .goal-check::after {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   ACTIVITY CHIPS
======================================== */
.activity-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.activity-chip {
    position: relative;
    cursor: pointer;
}

.activity-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    user-select: none;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

.chip:active {
    transform: scale(0.95);
}

.activity-chip input:checked + .chip {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.chip-icon {
    font-size: 16px;
}

/* ========================================
   BUTTONS
======================================== */
.btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px var(--primary-glow);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Button shimmer effect */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

/* ========================================
   SCREEN 2 - CHECK-IN
======================================== */

/* Coach Summary Card */
.coach-summary {
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 20px;
}

.coach-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.coach-summary-icon {
    font-size: 16px;
}

.coach-summary-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coach-summary-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.coach-summary-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}

.coach-label {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 60px;
}

.coach-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.coach-activities {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.coach-activity-tag {
    font-size: 11px;
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    color: var(--text-primary);
}

/* ========================================
   DASHBOARD TABS
======================================== */
.dashboard-tabs {
    display: flex;
    gap: 4px;
    background: var(--glass-bg);
    padding: 4px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.dashboard-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dashboard-tab .tab-icon {
    font-size: 18px;
    display: none;
}

.dashboard-tab .tab-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.dashboard-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dashboard-tab.active {
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.dashboard-tab.active .tab-label {
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
    padding-bottom: 100px;
}

.tab-content.active {
    display: block;
}

/* Profile Mini */
.profile-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.profile-goal {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

.profile-divider {
    color: var(--text-muted);
    font-size: 10px;
}

.profile-activities {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.profile-activity {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    color: var(--text-secondary);
}

/* Check-in Card */
.checkin-card {
    margin-bottom: 16px;
}

.checkin-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* Check-in Actions */
.checkin-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-icon-sm {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-icon-sm:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-generate {
    flex: 1;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 13px;
    color: var(--text-muted);
}

/* Stats Inline */
.stats-inline {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Weekly Chart in Stats Tab */
.weekly-chart-container {
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.chart-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.weekly-chart {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 100px;
    gap: 8px;
}

.weekly-chart .day-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.weekly-chart .bar {
    width: 100%;
    max-width: 30px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
}

.weekly-chart .day-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Refresh Button */
.btn-refresh {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: rotate(180deg);
}

/* Updated Tasks Header */
.tasks-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-text .done {
    color: var(--accent-green);
}

.question-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.question-icon {
    font-size: 24px;
    margin-bottom: 12px;
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.journal-textarea {
    width: 100%;
    min-height: 100px;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    font-size: 14px;
    color: var(--text-primary);
    resize: none;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.journal-textarea::placeholder {
    color: var(--text-muted);
}

.journal-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Collapsed journal state (when tasks are active) */
.checkin-card.checkin-collapsed {
    margin-bottom: 8px;
}
.checkin-card.checkin-collapsed .checkin-label {
    display: none;
}
.checkin-card.checkin-collapsed .journal-textarea {
    min-height: 0;
    height: 40px;
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.12);
}
.checkin-card.checkin-collapsed .journal-textarea::placeholder {
    font-size: 13px;
}
.checkin-actions.checkin-collapsed {
    margin-bottom: 12px;
}

/* ========================================
   TASKS SECTION
======================================== */
.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.tasks-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.tasks-hint {
    display: none; /* Hidden - using drag handle instead */
}

/* Progress Ring */
.progress-ring-container {
    position: relative;
    width: 44px;
    height: 44px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 3;
}

.progress-ring-fill {
    fill: none;
    stroke: url(#progress-gradient);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 113.1;
    stroke-dashoffset: 113.1;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-ring-text .done {
    color: var(--accent-green);
}

.tasks-counter {
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--glass-bg);
    padding: 6px 12px;
    border-radius: 50px;
}

.tasks-counter .done {
    color: var(--accent-green);
    font-weight: 600;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all var(--transition-normal);
    cursor: pointer;
    animation: taskSlideIn 0.4s ease backwards;
    position: relative;
    touch-action: pan-y;
}

/* Drag and Drop Styles */
.task-card.dragging {
    opacity: 0.8;
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.task-card.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.task-card .drag-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    cursor: grab;
    transition: opacity var(--transition-fast);
}

.task-card:hover .drag-handle {
    opacity: 0.6;
}

.task-card .drag-handle svg {
    width: 12px;
    height: 12px;
    color: var(--text-muted);
}

/* Swipe Styles */
.task-card.swiping {
    transition: none;
}

.task-card .swipe-action {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.task-card .swipe-action.complete {
    left: 0;
    background: linear-gradient(90deg, var(--accent-green) 0%, transparent 100%);
    color: white;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.task-card .swipe-action.dismiss {
    right: 0;
    background: linear-gradient(270deg, #ef4444 0%, transparent 100%);
    color: white;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.task-card.swipe-right .swipe-action.complete,
.task-card.swipe-left .swipe-action.dismiss {
    opacity: 1;
}

@keyframes taskSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.task-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.task-card.completed {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 20px var(--accent-green-glow);
    animation: taskComplete 0.4s ease;
}

@keyframes taskComplete {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.task-check {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    margin-top: 2px;
}

.task-check svg {
    width: 16px;
    height: 16px;
    stroke: transparent;
    stroke-width: 3;
    fill: none;
    transition: all var(--transition-fast);
}

.task-card.completed .task-check {
    background: var(--accent-green);
    border-color: var(--accent-green);
    box-shadow: 0 0 15px var(--accent-green-glow);
}

.task-card.completed .task-check svg {
    stroke: white;
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-text {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
    transition: color var(--transition-fast);
}

.task-card.completed .task-text {
    color: var(--text-secondary);
}

.task-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.task-tag.warmup { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.task-tag.strength { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.task-tag.cardio { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.task-tag.mobility { background: rgba(6, 182, 212, 0.2); color: #67e8f9; }
.task-tag.recovery { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.task-tag.mindset { background: rgba(236, 72, 153, 0.2); color: #f9a8d4; }

/* Task Tips (for simple activities) */
.task-tips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.task-tip {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1.3;
}

/* ========================================
   TASK VIDEO BUTTON
======================================== */
.task-video-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px var(--primary-glow);
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
}

.task-video-btn svg {
    width: 18px;
    height: 18px;
    color: white;
    margin-left: 2px; /* Optical centering for play icon */
    pointer-events: none;
}

.task-video-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.task-video-btn:active {
    transform: scale(0.95);
}

.task-card.completed .task-video-btn {
    background: linear-gradient(135deg, var(--accent-green) 0%, #059669 100%);
    box-shadow: 0 4px 15px var(--accent-green-glow);
}

/* ========================================
   LOADING STATE
======================================== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 15px;
    color: var(--text-secondary);
}

/* ========================================
   TOAST / SNACKBAR
======================================== */
.toast-container {
    position: absolute;
    bottom: 40px;
    left: 20px;
    right: 20px;
    z-index: 200;
    pointer-events: none;
}

.toast {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-normal);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-title {
    font-size: 15px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.toast-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   BACK BUTTON
======================================== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 16px;
    transition: color var(--transition-fast);
}

.back-btn:hover {
    color: var(--text-primary);
}

.back-btn svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   ERROR STATE
======================================== */
.error-message {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    color: #fca5a5;
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ========================================
   HELP BUTTON
======================================== */
.help-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.help-btn svg {
    flex-shrink: 0;
}

/* ========================================
   MODAL OVERLAY
======================================== */
.modal-overlay,
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: 20px;
}

.modal-overlay.show,
.video-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   EXERCISE MODAL
======================================== */
.modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--card-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-normal);
    overflow: hidden;
}

.modal-overlay.show .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--card-border);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: var(--glass-bg);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

/* Search Bar */
.modal-search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--glass-bg);
    margin: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
}

.modal-search svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.modal-search input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}

.modal-search input::placeholder {
    color: var(--text-muted);
}

/* Category Tabs */
.modal-tabs {
    display: flex;
    gap: 8px;
    padding: 0 20px 16px;
    overflow-x: auto;
    scrollbar-width: none;
}

.modal-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-color: transparent;
    color: white;
}

/* Exercise List */
.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
    scrollbar-width: none;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

.exercise-category {
    margin-bottom: 24px;
}

.category-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

/* Exercise Card */
.exercise-card {
    display: flex;
    gap: 14px;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.exercise-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
    border-color: var(--primary);
}

.exercise-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.exercise-info {
    flex: 1;
    min-width: 0;
}

.exercise-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.exercise-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.exercise-play {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}

.exercise-play svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   VIDEO MODAL
======================================== */
.video-modal {
    width: 100%;
    max-width: 640px;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--card-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-normal);
    overflow: hidden;
    position: relative;
}

.video-modal-overlay.show .video-modal {
    transform: translateY(0) scale(1);
}

.video-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    z-index: 10;
    transition: all var(--transition-fast);
}

.video-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.demo-image-container {
    position: relative;
    background: #111;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#demo-image {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    display: none;
}

.demo-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
    width: 100%;
}

.demo-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: demoSpin 0.75s linear infinite;
}

@keyframes demoSpin {
    to { transform: rotate(360deg); }
}

.demo-placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    width: 100%;
}

.demo-placeholder-icon {
    font-size: 44px;
    line-height: 1;
}

.demo-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.video-info {
    padding: 20px;
}

.video-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.video-tips {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.video-tip::before {
    content: '✓';
    color: var(--accent-green);
    font-weight: bold;
    flex-shrink: 0;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.no-results svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-results p {
    font-size: 15px;
}

/* ========================================
   RESPONSIVE
======================================== */
/* Native Capacitor app — always fullscreen, no fake phone frame */
body.capacitor-app {
    padding: 0;
}

body.capacitor-app .phone-frame {
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
}

body.capacitor-app .phone-frame::before,
body.capacitor-app .phone-frame::after {
    display: none;
}

body.capacitor-app .screen {
    padding: 20px 16px;
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
}

body.capacitor-app .premium-view-header {
    padding-top: calc(16px + env(safe-area-inset-top));
}

body.capacitor-app .premium-view-overlay {
    padding-top: 0;
}

body.capacitor-app .video-modal-close {
    top: calc(12px + env(safe-area-inset-top));
}

/* Force exercise/video modals full-screen on native */
body.capacitor-app .modal-overlay,
body.capacitor-app .video-modal-overlay {
    padding: 0;
}

body.capacitor-app .modal,
body.capacitor-app .video-modal {
    max-width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    height: 100%;
    border-radius: 0;
}

body.capacitor-app .video-modal {
    padding-top: env(safe-area-inset-top);
    background: #111;       /* match image-container bg behind status bar */
}

body.capacitor-app .modal-header {
    padding-top: calc(20px + env(safe-area-inset-top));
}

body.capacitor-app .welcome-carousel {
    padding-top: calc(40px + env(safe-area-inset-top));
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .phone-frame {
        max-width: 100%;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        border-radius: 0;
    }

    .phone-frame::before,
    .phone-frame::after {
        display: none;
    }

    .screen {
        padding: 20px 16px;
        padding-bottom: 100px; /* Space for fixed elements */
    }

    /* Dashboard tabs - smaller on mobile */
    .dashboard-tabs {
        gap: 2px;
        padding: 3px;
    }

    .dashboard-tab {
        padding: 8px 6px;
    }

    .dashboard-tab .tab-icon {
        font-size: 16px;
    }

    .dashboard-tab .tab-label {
        font-size: 10px;
    }

    /* Profile mini - wrap better */
    .profile-mini {
        padding: 10px 12px;
        gap: 6px;
    }

    .profile-goal {
        font-size: 12px;
    }

    .profile-activity {
        font-size: 10px;
        padding: 2px 6px;
    }

    /* Journal textarea */
    .journal-textarea {
        min-height: 100px;
        font-size: 14px;
        padding: 12px;
    }

    /* Stats inline - 3 columns still but smaller */
    .stats-inline {
        gap: 8px;
    }

    .stat-card {
        padding: 12px 8px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-label {
        font-size: 10px;
    }

    /* Timer - bottom left, smaller */
    .workout-timer {
        bottom: 16px;
        left: 16px;
    }

    .timer-toggle-btn {
        width: 48px;
        height: 48px;
    }

    .timer-toggle-btn svg {
        width: 22px;
        height: 22px;
    }

    .timer-panel {
        width: 260px;
        bottom: 60px;
        left: 0;
        padding: 12px;
    }

    .timer-display {
        font-size: 40px;
    }

    /* Mascot - bottom right, smaller */
    .mascot-container {
        bottom: 80px;
        right: 16px;
    }

    .mascot-body {
        width: 50px;
        height: 50px;
    }

    .mascot-emoji {
        font-size: 24px;
    }

    .mascot-speech-bubble {
        min-width: 100px;
        max-width: 150px;
        padding: 8px 10px;
        bottom: 58px;
    }

    .speech-text {
        font-size: 11px;
    }

    /* Task cards */
    .task-card {
        padding: 12px;
        gap: 10px;
    }

    .task-check {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }

    .task-text {
        font-size: 14px;
    }

    .task-tag {
        font-size: 10px;
        padding: 3px 8px;
    }

    .task-video-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }

    .task-video-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Drag handle smaller */
    .drag-handle {
        width: 16px;
        min-width: 16px;
        margin-right: -4px;
    }

    /* Modal adjustments */
    .modal-overlay,
    .video-modal-overlay {
        padding: 0;
    }

    .modal,
    .video-modal {
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        height: 100%;
        border-radius: 0;
    }

    .exercise-image {
        width: 60px;
        height: 60px;
    }

    /* Progress ring smaller */
    .tasks-progress .progress-ring {
        width: 40px;
        height: 40px;
    }

    .progress-text {
        font-size: 16px;
    }

    /* Back button */
    .back-btn {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .screen {
        padding: 16px 12px;
        padding-bottom: 100px;
    }

    .dashboard-tab .tab-label {
        font-size: 9px;
    }

    .stat-value {
        font-size: 20px;
    }

    .timer-panel {
        width: 240px;
    }

    .mascot-container {
        bottom: 70px;
    }

    .mascot-body {
        width: 44px;
        height: 44px;
    }

    .mascot-emoji {
        font-size: 20px;
    }
}

/* YouTube Search Link */
.youtube-search-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 12px;
    color: #ff6b6b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.youtube-search-link:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.5);
    transform: translateY(-1px);
}

.youtube-search-link svg {
    flex-shrink: 0;
}

/* ========================================
   WORKOUT TIMER
======================================== */
.workout-timer {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.timer-toggle-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px var(--primary-glow);
    transition: all var(--transition-fast);
}

.timer-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px var(--primary-glow);
}

.timer-panel {
    position: absolute;
    bottom: 70px;
    left: 0;
    width: 280px;
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all var(--transition-normal);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.timer-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Timer panel on TOP of screen - show panel BELOW */
.workout-timer.pos-top .timer-panel {
    bottom: auto;
    top: 70px;
}

.workout-timer.pos-top .timer-panel.show {
    transform: translateY(0) scale(1);
}

/* Timer panel on RIGHT side of screen - show panel to the LEFT */
.workout-timer.pos-right .timer-panel {
    left: auto;
    right: 0;
}

.timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.timer-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.timer-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.timer-close:hover {
    color: var(--text-primary);
}

.timer-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.timer-mode-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.timer-mode-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-color: transparent;
    color: white;
}

.timer-display {
    font-size: 48px;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Fira Code', monospace;
    margin-bottom: 16px;
    transition: all var(--transition-fast);
}

.timer-display.timer-complete {
    color: var(--accent-green);
    animation: timerPulse 0.5s ease infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.timer-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.preset-btn {
    flex: 1;
    min-width: calc(33% - 6px);
    padding: 8px 12px;
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.preset-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    color: var(--text-primary);
}

.timer-controls {
    display: flex;
    gap: 8px;
}

.timer-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.timer-btn-start {
    background: linear-gradient(135deg, var(--accent-green) 0%, #059669 100%);
    color: white;
}

.timer-btn-start:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.timer-btn-pause {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.timer-btn-pause:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.timer-btn-reset {
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
}

.timer-btn-reset:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ========================================
   PROGRESS STATS
======================================== */
.stats-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 12px;
}

.stats-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--primary);
}

.stats-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: 20px;
}

.stats-panel-overlay.show {
    opacity: 1;
    visibility: visible;
}

.stats-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 380px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.95);
    transition: all var(--transition-normal);
}

.stats-panel-overlay.show .stats-panel {
    transform: translateY(0) scale(1);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--card-border);
}

.stats-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.stats-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.stats-close:hover {
    color: var(--text-primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 20px;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-streak .stat-value { color: #f59e0b; }
.stat-best .stat-value { color: #8b5cf6; }
.stat-total .stat-value { color: #10b981; }
.stat-workouts .stat-value { color: #ec4899; }

.stats-section {
    padding: 0 20px 20px;
}

.stats-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.week-progress {
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    padding: 16px;
}

.week-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.week-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.week-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.activity-chart {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 100px;
    padding: 16px;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
}

.chart-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.bar-container {
    position: relative;
    width: 20px;
    height: 60px;
    margin-bottom: 8px;
}

.bar-bg {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.bar-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 4px;
    transition: height 0.5s ease;
}

.chart-bar.has-activity .bar-fill {
    min-height: 4px;
}

.chart-bar.today .bar-label {
    color: var(--primary);
    font-weight: 600;
}

.bar-label {
    font-size: 10px;
    color: var(--text-muted);
}

/* ========================================
   REST DAY BANNER
======================================== */
.rest-day-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    margin: 20px 0 20px 0;
    animation: fadeIn 0.5s ease;
}

.rest-banner-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.rest-banner-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #c4b5fd;
    margin: 0 0 4px 0;
}

.rest-banner-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}


/* ========================================
   ANIMATED MASCOT / COACH AVATAR
======================================== */
.mascot-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 1000;
    pointer-events: none;
}

.mascot-character {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mascot-body {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 
        0 4px 20px rgba(99, 102, 241, 0.4),
        0 0 0 4px rgba(255, 255, 255, 0.1);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.mascot-body:hover {
    transform: scale(1.1);
    box-shadow: 
        0 6px 30px rgba(99, 102, 241, 0.6),
        0 0 0 6px rgba(255, 255, 255, 0.15);
}

.mascot-body:active {
    transform: scale(0.95);
}

.mascot-emoji {
    font-size: 28px;
    line-height: 1;
}

/* Speech Bubble */
.mascot-speech-bubble {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    min-width: 120px;
    max-width: 180px;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transition: all var(--transition-normal);
    pointer-events: none;
}

.mascot-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--glass-bg);
}

/* Speech bubble on LEFT side of screen - show bubble to the RIGHT */
.mascot-container.pos-left .mascot-speech-bubble {
    right: auto;
    left: 0;
}

.mascot-container.pos-left .mascot-speech-bubble::after {
    right: auto;
    left: 20px;
}

/* Speech bubble on TOP of screen - show bubble BELOW */
.mascot-container.pos-top .mascot-speech-bubble {
    bottom: auto;
    top: 70px;
}

.mascot-container.pos-top .mascot-speech-bubble::after {
    bottom: auto;
    top: -8px;
    border-top: none;
    border-bottom: 8px solid var(--glass-bg);
}

.mascot-speech-bubble.speech-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.speech-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    display: block;
}

/* Mascot Positions */
.mascot-container.mascot-left {
    right: auto;
    left: 20px;
}

.mascot-container.mascot-center {
    right: 50%;
    transform: translateX(50%);
}

/* Draggable states */
.mascot-container.dragging,
.workout-timer.dragging {
    cursor: grabbing !important;
    z-index: 10000 !important;
    opacity: 0.9;
}

.mascot-container.dragging .mascot-body,
.workout-timer.dragging .timer-toggle-btn {
    cursor: grabbing !important;
    transform: scale(1.15);
    box-shadow: 
        0 8px 40px rgba(99, 102, 241, 0.6),
        0 0 0 3px rgba(255, 255, 255, 0.3);
}

.mascot-body,
.timer-toggle-btn {
    cursor: grab;
}

/* Hint indicator for draggable elements */
.mascot-container::before,
.workout-timer::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mascot-container:hover::before,
.workout-timer:hover::before {
    opacity: 1;
}

/* ========================================
   MASCOT ANIMATIONS
======================================== */

/* Idle bounce */
@keyframes mascot-bounce-anim {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.mascot-bounce {
    animation: mascot-bounce-anim 2s ease-in-out infinite;
}

/* Encouraging pump */
@keyframes mascot-pump-anim {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(-5deg); }
    50% { transform: scale(1); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.mascot-pump {
    animation: mascot-pump-anim 1s ease-in-out infinite;
}

/* Celebration dance */
@keyframes mascot-dance-anim {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(-15deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-10px) rotate(15deg); }
}

.mascot-dance {
    animation: mascot-dance-anim 0.5s ease-in-out infinite;
}

/* Rest/sleep */
@keyframes mascot-rest-anim {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.95); opacity: 0.8; }
}

.mascot-rest {
    animation: mascot-rest-anim 3s ease-in-out infinite;
}

/* Cheering */
@keyframes mascot-cheer-anim {
    0%, 100% { transform: translateY(0) scale(1); }
    20% { transform: translateY(-15px) scale(1.1); }
    40% { transform: translateY(0) scale(1); }
    60% { transform: translateY(-15px) scale(1.1); }
    80% { transform: translateY(0) scale(1); }
}

.mascot-cheer {
    animation: mascot-cheer-anim 1.5s ease-in-out;
}

/* Thinking */
@keyframes mascot-think-anim {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.mascot-think {
    animation: mascot-think-anim 2s ease-in-out infinite;
}

/* Pop on click */
@keyframes mascot-pop-anim {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.mascot-pop {
    animation: mascot-pop-anim 0.3s ease-out;
}

/* Sparkle effect for celebrations */
.mascot-body::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.mascot-dance::before,
.mascot-cheer::before {
    opacity: 1;
    animation: sparkle 1s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.5); opacity: 0; }
}

/* ========================================
   CALENDAR VIEW
======================================== */
.calendar-container {
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 20px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-month {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-nav {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.calendar-nav:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 4px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    position: relative;
}

.calendar-day.other-month {
    color: var(--text-muted);
    opacity: 0.4;
}

.calendar-day.today {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    font-weight: 600;
}

.calendar-day.has-workout::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
}

.calendar-day.has-workout.today::after {
    background: var(--primary);
}

/* ========================================
   WORKOUT HISTORY
======================================== */
.history-container {
    margin-bottom: 20px;
}

.history-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.history-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-completed {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-green);
}

.history-total {
    font-size: 12px;
    color: var(--text-muted);
}

.history-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ========================================
   SETTINGS
======================================== */
.settings-container {
    margin-bottom: 20px;
}

.settings-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
}

.settings-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    border-radius: calc(var(--radius-lg) - 4px);
}

.settings-tab:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
}

.settings-tab.active {
    color: #fff;
    background: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.settings-tab-lock {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.settings-tab-lock svg {
    opacity: 0.7;
}

.settings-tab-lock.hidden {
    display: none;
}

/* Tab Content */
.settings-tab-content {
    display: none;
    position: relative;
}

.settings-tab-content.active {
    display: block;
    animation: settingsTabFade 0.2s ease;
}

@keyframes settingsTabFade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Premium locked overlay for settings */
.settings-premium-locked-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(15, 15, 25, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
}

.settings-premium-locked-overlay.hidden {
    display: none;
}

.settings-locked-content {
    text-align: center;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.settings-locked-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(105, 136, 132, 0.12);
    border: 1px solid rgba(105, 136, 132, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.settings-locked-content strong {
    color: var(--text-primary);
    font-size: 14px;
}

.settings-locked-content p {
    color: var(--text-muted);
    font-size: 12px;
    max-width: 200px;
    line-height: 1.4;
}

.settings-list {
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--card-border);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-label {
    font-size: 14px;
    color: var(--text-primary);
}

.setting-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.setting-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.toggle-track {
    display: block;
    width: 44px;
    height: 26px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 13px;
    position: relative;
    transition: background var(--transition-fast);
}

.toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.setting-toggle[data-enabled="true"] .toggle-track {
    background: var(--primary);
}

.setting-toggle[data-enabled="true"] .toggle-thumb {
    transform: translateX(18px);
}

.setting-time-input {
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.setting-time-input:focus {
    border-color: var(--primary);
}

/* ========================================
   FAVORITE EXERCISES
======================================== */
.exercise-card {
    position: relative;
}

.favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 5;
}

.favorite-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.favorite-btn svg {
    width: 18px;
    height: 18px;
    stroke: white;
    fill: none;
    transition: all var(--transition-fast);
}

.favorite-btn.active svg {
    fill: #f59e0b;
    stroke: #f59e0b;
}

.favorites-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.favorites-empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.favorites-empty p {
    font-size: 14px;
}

/* Favorites tab highlight */
.modal-tabs .tab-btn[data-category="favorites"] {
    color: #f59e0b;
}

.modal-tabs .tab-btn[data-category="favorites"].active {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* ========================================
   DASHBOARD HEADER
======================================== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.dashboard-header .back-btn {
    margin-bottom: 0;
}

/* Match border weight to level pill (1px) — consistent outline language across header */
.account-btn {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: none;
}

.account-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
}

/* Crown badge — thin 1px stroke matches account-btn border weight */
.premium-crown-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--prem-accent, #698884), var(--prem-accent-bright, #8ab5b0));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 1px 4px var(--prem-glow, rgba(105, 136, 132, 0.35));
    animation: crownPulse 2s ease-in-out infinite;
    border: 1px solid var(--bg-gradient-start);
}

@keyframes crownPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 8px var(--prem-glow, rgba(105, 136, 132, 0.4));
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 4px 16px var(--prem-glow-hover, rgba(105, 136, 132, 0.7));
    }
}

.account-btn-avatar {
    font-size: 20px;
    line-height: 1;
}

.account-btn-avatar.signed-in {
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
}

/* ========================================
   AUTH MODAL
======================================== */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.auth-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 380px;
    padding: 32px 24px;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.auth-modal-overlay.active .auth-modal {
    transform: scale(1) translateY(0);
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    transition: color var(--transition-fast);
}

.auth-modal-close:hover {
    color: var(--text-primary);
}

.auth-content {
    text-align: center;
}

.auth-header {
    margin-bottom: 32px;
}

.auth-logo {
    font-size: 48px;
    margin-bottom: 16px;
}

.auth-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    width: 100%;
}

.btn-google {
    background: #fff;
    color: #333;
}

.btn-google:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-guest {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}

.btn-guest:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--text-secondary);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

.auth-divider span {
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
}

.auth-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 16px;
}

.auth-terms {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 24px;
    line-height: 1.5;
}

.auth-terms a {
    color: var(--primary);
    text-decoration: none;
}

.auth-terms a:hover {
    text-decoration: underline;
}

/* Email Auth Form */
.auth-email-section {
    margin-bottom: 4px;
}

.auth-form-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: 16px;
}

.auth-form-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: calc(var(--radius-md) - 2px);
    transition: all var(--transition-fast);
}

.auth-form-tab.active {
    background: var(--primary);
    color: #fff;
}

.auth-form-tab:not(.active):hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.auth-input-group {
    margin-bottom: 12px;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    box-sizing: border-box;
}

.auth-input::placeholder {
    color: var(--text-muted);
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.auth-input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.btn-email-submit {
    background: var(--primary);
    color: #fff;
    margin-top: 4px;
}

.btn-email-submit:hover {
    background: var(--primary-hover, #5558e6);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-email-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-forgot-link {
    display: inline-block;
    margin-top: 12px;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.auth-forgot-link:hover {
    text-decoration: underline;
}

.auth-message {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 14px;
    text-align: left;
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.auth-message.success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* ========================================
   ACCOUNT MENU
======================================== */
.account-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.account-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.account-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 320px;
    padding: 20px;
    transition: transform var(--transition-normal);
}

.account-menu-overlay.active .account-menu {
    transform: translate(-50%, -50%) scale(1);
}

.account-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 16px;
}

.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.account-avatar.signed-in {
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.account-info {
    flex: 1;
    min-width: 0;
}

.account-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-email {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
    width: 100%;
    text-align: left;
}

.account-option:hover {
    background: var(--glass-bg);
}

.account-option svg {
    color: var(--text-secondary);
}

#btn-upgrade {
    color: var(--accent-orange);
}

#btn-upgrade svg {
    color: var(--accent-orange);
}

#btn-signout {
    color: #ef4444;
}

#btn-signout svg {
    color: #ef4444;
}

/* Delete Account button + modal */
.account-option-danger {
    color: #ef4444 !important;
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 16px !important;
}

.account-option-danger svg {
    color: #ef4444 !important;
}

.delete-account-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 20px;
}

.delete-account-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.delete-account-modal {
    background: linear-gradient(180deg, #1e1e2e 0%, #151521 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    max-width: 380px;
    width: 100%;
    animation: scaleIn 0.3s ease;
    overflow: hidden;
}

.delete-account-header {
    text-align: center;
    padding: 24px 24px 12px;
}

.delete-account-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.delete-account-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.delete-account-body {
    padding: 0 24px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.delete-account-body ul {
    margin: 8px 0;
    padding-left: 20px;
}

.delete-account-body li {
    margin-bottom: 4px;
}

.delete-account-warning {
    color: #ef4444;
    font-weight: 600;
    margin-top: 12px;
}

.delete-account-confirm-field {
    margin-top: 16px;
}

.delete-account-confirm-field label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.delete-account-confirm-field input {
    width: 100%;
    padding: 10px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}

.delete-account-confirm-field input:focus {
    border-color: #ef4444;
}

.delete-account-actions {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
}

.delete-account-actions .btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-danger:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================
   CAPABILITIES / TIER GATING UI
======================================== */

/* Locked Overlay for Stats Tab (Guest mode) */
.locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    z-index: 50;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.locked-icon {
    margin-bottom: 16px;
    line-height: 0;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.locked-overlay h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.locked-overlay p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    max-width: 280px;
}

.locked-overlay .btn-primary {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
}

.locked-overlay-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--glass-bg);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.locked-overlay-close:hover {
    background: var(--card-border);
    color: var(--text-primary);
}

.btn-text-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    margin-top: 12px;
    padding: 8px;
    transition: color var(--transition-fast);
}

.btn-text-link:hover {
    color: var(--text-secondary);
}

/* Tab Locked Indicator */
.tab-locked .nav-tab {
    position: relative;
}

.tab-locked .nav-tab::after {
    content: '🔒';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 10px;
}

/* ========================================
   UPSELL TOAST
======================================== */
.upsell-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    max-width: 90%;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.upsell-toast.show {
    display: flex;
    opacity: 1;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; pointer-events: none; }
}

.upsell-toast .upsell-message {
    font-size: 13px;
    color: white;
    font-weight: 500;
}

.upsell-toast .upsell-cta {
    background: white;
    color: var(--primary);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: transform var(--transition-fast);
}

.upsell-toast .upsell-cta:hover {
    transform: scale(1.05);
}

.upsell-toast .upsell-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

/* ========================================
   GENERATION BLOCKED MODAL
======================================== */
.blocked-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.blocked-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.blocked-modal {
    background: linear-gradient(180deg, #1e1e2e 0%, #151521 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.blocked-modal .blocked-icon {
    margin-bottom: 16px;
    line-height: 0;
}

.blocked-modal-icon {
    margin-bottom: 16px;
    line-height: 0;
}

.blocked-modal h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.blocked-modal p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.blocked-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blocked-modal .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
}

.blocked-modal .btn-secondary {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.blocked-modal .btn-secondary:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

/* ========================================
   UPGRADE MODAL
======================================== */
.upgrade-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.upgrade-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.upgrade-modal {
    background: linear-gradient(180deg, #1e1e2e 0%, #151521 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    max-width: 380px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
    position: relative;
}

.upgrade-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--glass-bg);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
    line-height: 1;
}

.upgrade-modal-close:hover {
    background: var(--card-border);
    color: var(--text-primary);
}

.upgrade-header {
    text-align: center;
    padding: 32px 24px 20px;
}

.upgrade-header .upgrade-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.upgrade-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upgrade-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.upgrade-features {
    padding: 0 24px 20px;
}

.upgrade-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--card-border);
}

.upgrade-feature:last-child {
    border-bottom: none;
}

.upgrade-feature .feature-icon {
    font-size: 24px;
    width: 44px;
    height: 44px;
    background: rgba(105, 136, 132, 0.1);
    border: 1px solid rgba(105, 136, 132, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
}

.upgrade-feature .feature-icon svg {
    width: 22px;
    height: 22px;
    color: var(--prem-accent-bright);
}

.upgrade-feature div {
    flex: 1;
}

.upgrade-feature strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

.upgrade-feature p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.upgrade-pricing {
    padding: 16px 24px 20px;
    display: flex;
    gap: 12px;
}

.upgrade-option {
    flex: 1;
    background: var(--glass-bg);
    border: 2px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    position: relative;
}

.upgrade-option:hover {
    border-color: var(--prem-accent);
    background: rgba(105, 136, 132, 0.1);
}

.upgrade-option.best-value {
    border-color: var(--prem-accent);
    background: rgba(105, 136, 132, 0.1);
}

.upgrade-option.best-value:hover {
    background: rgba(105, 136, 132, 0.18);
    border-color: var(--prem-accent-bright);
}

.upgrade-option .badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--prem-accent);
    color: #0f0f1a;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.upgrade-option .price {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.upgrade-option .period {
    font-size: 12px;
    color: var(--text-secondary);
}

.upgrade-option .savings {
    display: block;
    font-size: 11px;
    color: var(--accent-green);
    font-weight: 600;
    margin-top: 4px;
}

.upgrade-note {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 24px 24px;
    margin: 0;
}

/* ========================================
   PREMIUM FEATURES SECTION
======================================== */
.premium-features-container {
    margin-top: 24px;
    padding: 0 4px;
}

.premium-features-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--prem-text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.premium-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.premium-icon svg {
    width: 16px;
    height: 16px;
    color: var(--prem-accent);
}

.premium-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.premium-feature-card {
    background: var(--prem-surface);
    border: 1px solid var(--prem-border);
    border-radius: var(--prem-radius);
    padding: 24px 12px 18px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.25s ease,
                box-shadow 0.25s ease,
                background 0.25s ease;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15),
               inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.premium-feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--prem-border-hover);
    box-shadow: 0 6px 24px var(--prem-glow-hover),
               0 0 0 1px var(--prem-border-hover),
               inset 0 1px 0 rgba(255, 255, 255, 0.06);
    background: var(--prem-surface-hover);
}

.premium-feature-card:active {
    transform: translateY(0px);
    transition-duration: 0.08s;
}

.premium-feature-card.feature-locked {
    opacity: 0.85;
}

.premium-feature-card.feature-locked:hover {
    border-color: var(--prem-border-hover);
    box-shadow: 0 6px 24px var(--prem-glow-hover),
               0 0 0 1px var(--prem-border-hover);
}

.premium-feature-card.feature-unlocked {
    border-color: var(--prem-accent);
    box-shadow: 0 2px 16px var(--prem-glow);
}

.premium-feature-card.feature-unlocked:hover {
    border-color: var(--prem-accent-bright);
    box-shadow: 0 6px 28px var(--prem-glow-hover),
               0 0 0 1px var(--prem-accent-bright);
}

.lock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(105, 136, 132, 0.15);
    color: var(--prem-accent);
    padding: 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.lock-badge svg {
    width: 12px;
    height: 12px;
}

.feature-unlocked .lock-badge {
    display: none;
}

.feature-icon-wrap {
    width: var(--prem-icon-size);
    height: var(--prem-icon-size);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 14px;
    background: rgba(105, 136, 132, 0.08);
    border: 1px solid rgba(105, 136, 132, 0.12);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.premium-feature-card:hover .feature-icon-wrap {
    background: rgba(105, 136, 132, 0.14);
    border-color: rgba(105, 136, 132, 0.25);
}

.feature-icon-wrap svg {
    width: 24px;
    height: 24px;
    color: var(--prem-accent-bright);
    stroke-width: 1.75;
}

/* Legacy .feature-icon (emoji fallback) */
.feature-icon {
    font-size: 32px;
    margin-bottom: 10px;
    display: none; /* hidden — using .feature-icon-wrap now */
    line-height: 1;
}

.premium-feature-card h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--prem-text);
    margin-bottom: 4px;
    line-height: 1.3;
}

.premium-feature-card p {
    font-size: 10.5px;
    color: var(--prem-text-sub);
    line-height: 1.35;
    margin: 0;
}

/* Premium active card subtle pulse — no bouncing */
.premium-feature-card.feature-unlocked .feature-icon-wrap {
    animation: iconGlow 3s ease-in-out infinite;
}

@keyframes iconGlow {
    0%, 100% { box-shadow: 0 0 0 0 transparent; }
    50% { box-shadow: 0 0 12px var(--prem-glow); }
}

/* ========================================
   GENERATION COUNTER BADGE
======================================== */
.generation-counter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--glass-bg);
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
}

.generation-counter.low {
    color: var(--accent-orange);
    background: rgba(245, 158, 11, 0.15);
}

.generation-counter.exhausted {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

/* ========================================
   TIER BADGES
======================================== */
.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-badge.guest {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.tier-badge.free {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.tier-badge.premium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(249, 115, 22, 0.2));
    color: var(--accent-orange);
}

/* ========================================
   PREMIUM VIEW (Full-Screen Modals)
======================================== */
.premium-view-overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-gradient-start);
    z-index: 3000;
    display: none !important;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.premium-view-overlay.active {
    display: block !important;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.premium-view {
    min-height: 100%;
    padding: 0 0 100px 0;
}

.premium-view-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.premium-view-back {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.premium-view-back:hover {
    background: var(--glass-bg);
}

.premium-view-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.premium-badge {
    background: linear-gradient(135deg, rgba(105, 136, 132, 0.2), rgba(138, 181, 176, 0.15));
    color: var(--prem-accent-bright, #8ab5b0);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.spacer {
    width: 40px;
}

/* ========================================
   PROGRAMS VIEW
======================================== */
.active-program-banner {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    margin: 16px;
    padding: 16px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.active-program-info .active-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
    display: block;
}

.active-program-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.active-program-info p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.programs-list {
    padding: 8px 16px;
}

.program-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.program-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* AI-Created Program Badge */
.ai-created-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(105, 136, 132, 0.2), rgba(138, 181, 176, 0.15));
    color: var(--prem-accent-bright, #8ab5b0);
    margin-left: 8px;
    vertical-align: middle;
}

/* Delete button on custom program cards */
.program-delete-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-md);
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    margin-left: auto;
}

.program-delete-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: scale(1.1);
}

.program-delete-btn:active {
    transform: scale(0.95);
}

/* Chat Program-Created Card */
.chat-program-created {
    padding: 4px 12px;
    margin: 6px 0;
    max-width: 90%;
}

.chat-program-created-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(105, 136, 132, 0.15), rgba(138, 181, 176, 0.08));
    border: 1px solid rgba(105, 136, 132, 0.3);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    overflow: hidden;
    min-width: 0;
}

.chat-program-created-inner svg {
    flex-shrink: 0;
    color: var(--prem-accent-bright, #8ab5b0);
    width: 20px;
    height: 20px;
}

.chat-program-created-inner .program-created-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-program-created-inner strong {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-program-created-inner span {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.chat-program-created-inner .btn {
    flex-shrink: 0;
    width: auto;
    font-size: 11px;
    padding: 6px 14px;
    white-space: nowrap;
    border-radius: 8px;
}

.program-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.program-icon {
    width: 48px;
    height: 48px;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.program-card-info {
    flex: 1;
}

.program-card-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.program-card-info p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.program-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.program-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.program-meta-item svg {
    width: 14px;
    height: 14px;
}

.difficulty-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.difficulty-badge.beginner {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.difficulty-badge.intermediate {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.difficulty-badge.advanced {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Program Detail */
.program-detail-content {
    padding: 20px;
}

.program-detail-hero {
    text-align: center;
    padding: 24px 0;
}

.program-detail-hero .program-icon {
    width: 80px;
    height: 80px;
    font-size: 40px;
    margin: 0 auto 16px;
}

.program-detail-hero h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.program-detail-hero p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 300px;
    margin: 0 auto;
}

.program-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.program-stat {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
}

.program-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.program-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.program-detail-section {
    margin-bottom: 24px;
}

.program-detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.program-week {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 8px;
}

.program-week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.program-week-header span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.program-week-header small {
    font-size: 11px;
    color: var(--text-secondary);
}

.program-action {
    padding: 20px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, var(--bg-gradient-start) 20%);
    z-index: 10;
}

.btn-full {
    width: 100%;
}

/* ========================================
   COACH VIEW
======================================== */
.coach-status-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.coach-avatar {
    font-size: 40px;
    width: 60px;
    height: 60px;
    background: var(--glass-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coach-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.coach-section {
    padding: 0 16px;
    margin-bottom: 24px;
}

.coach-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.adjustment-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.adjustment-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.adjustment-card.deload {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
}

.adjustment-card.progress {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
}

.adjustment-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.adjustment-content p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feedback-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.feedback-item-date {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 60px;
}

.feedback-item-rpe {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--glass-bg);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.feedback-item-soreness {
    font-size: 18px;
}

.feedback-item-notes {
    flex: 1;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feedback-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.coach-action {
    padding: 16px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, var(--bg-gradient-start) 20%);
}

/* ========================================
   FEEDBACK MODAL
======================================== */
.feedback-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    padding: 20px;
}

.feedback-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.feedback-modal {
    background: linear-gradient(180deg, #1e1e2e 0%, #151521 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    max-width: 380px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.3s ease;
}

.feedback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
}

.feedback-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.feedback-modal-close {
    background: var(--glass-bg);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-form {
    padding: 20px;
}

.feedback-field {
    margin-bottom: 24px;
}

.feedback-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.rpe-slider-container {
    padding: 0 8px;
}

.rpe-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--glass-bg);
    border-radius: 4px;
    outline: none;
}

.rpe-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.rpe-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.rpe-value {
    text-align: center;
    margin-top: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.soreness-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.soreness-option {
    background: var(--glass-bg);
    border: 2px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.soreness-option:hover {
    border-color: var(--primary);
}

.soreness-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
}

.feedback-field textarea {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 14px;
    color: var(--text-primary);
    resize: none;
    height: 80px;
    font-family: inherit;
}

.feedback-field textarea::placeholder {
    color: var(--text-muted);
}

.feedback-field textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* ========================================
   INSIGHTS VIEW
======================================== */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}

.insight-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
}

.insight-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.insight-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.insight-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insights-section {
    padding: 0 16px;
    margin-bottom: 24px;
}

.insights-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recommendation-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.recommendation-item::before {
    content: '💡';
    font-size: 16px;
}

.effort-chart {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    height: 180px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 8px;
}

.chart-bar {
    flex: 1;
    max-width: 32px;
    background: linear-gradient(to top, var(--primary), var(--secondary));
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.5s ease;
}

.chart-bar::after {
    content: attr(data-day);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--text-muted);
}

.chart-bar.empty {
    background: var(--glass-bg);
}

.insights-empty {
    text-align: center;
    padding: 40px 20px;
}

.insights-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.insights-empty h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.insights-empty p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========================================
   AI COACH CHAT
======================================== */
.coach-chat-section {
    margin: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.coach-chat-messages {
    height: 280px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    display: flex;
    gap: 10px;
    max-width: 90%;
    animation: chatFadeIn 0.3s ease;
}

@keyframes chatFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--glass-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-message.user .chat-avatar {
    background: var(--primary);
    color: white;
    font-size: 14px;
}

.chat-bubble {
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    border-top-left-radius: 4px;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chat-bubble p {
    margin: 0 0 10px 0;
}

.chat-bubble p:last-child {
    margin-bottom: 0;
}

.chat-bubble strong,
.chat-bubble b {
    color: var(--prem-accent-bright, #8ab5b0);
    font-weight: 600;
}

.chat-bubble ul,
.chat-bubble ol {
    margin: 6px 0 10px 0;
    padding-left: 18px;
}

.chat-bubble li {
    margin-bottom: 4px;
}

.chat-bubble h3,
.chat-bubble h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--prem-accent-bright, #8ab5b0);
    margin: 12px 0 6px 0;
}

.chat-bubble h3:first-child,
.chat-bubble h4:first-child {
    margin-top: 0;
}

.chat-message.user .chat-bubble {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 16px;
    border-top-right-radius: 4px;
}

.chat-bubble.typing {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

.coach-chat-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--card-border);
}

.coach-chat-input input {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

.coach-chat-input input::placeholder {
    color: var(--text-muted);
}

.coach-chat-input input:focus {
    border-color: var(--primary);
}

.coach-chat-send {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.coach-chat-send:hover {
    transform: scale(1.05);
    background: var(--secondary);
}

.coach-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Quick Question Buttons */
.coach-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 16px;
}

.quick-question-btn {
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-question-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

/* Create Program quick action — highlighted variant */
.quick-question-btn.create-program-btn {
    background: linear-gradient(135deg, rgba(105, 136, 132, 0.2), rgba(138, 181, 176, 0.1));
    border: 1px solid rgba(105, 136, 132, 0.5);
    color: var(--prem-accent-bright, #8ab5b0);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    order: -1;
}

.quick-question-btn.create-program-btn svg {
    flex-shrink: 0;
}

.quick-question-btn.create-program-btn:hover {
    background: linear-gradient(135deg, rgba(105, 136, 132, 0.35), rgba(138, 181, 176, 0.2));
    border-color: var(--prem-accent-bright, #8ab5b0);
    color: #fff;
}

/* Programs — Create with AI CTA card */
.program-create-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(105, 136, 132, 0.12), rgba(138, 181, 176, 0.06));
    border: 1px dashed rgba(105, 136, 132, 0.4);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.program-create-cta:hover {
    background: linear-gradient(135deg, rgba(105, 136, 132, 0.22), rgba(138, 181, 176, 0.12));
    border-color: var(--prem-accent-bright, #8ab5b0);
    transform: translateY(-1px);
}

.program-create-cta:active {
    transform: translateY(0);
}

.program-create-cta-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(105, 136, 132, 0.25), rgba(138, 181, 176, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--prem-accent-bright, #8ab5b0);
}

.program-create-cta-text {
    flex: 1;
    min-width: 0;
}

.program-create-cta-text h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--prem-accent-bright, #8ab5b0);
    margin: 0 0 4px 0;
}

.program-create-cta-text p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.program-create-cta-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(105, 136, 132, 0.3);
    background: rgba(105, 136, 132, 0.1);
    color: var(--prem-accent-bright, #8ab5b0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.program-create-cta:hover .program-create-cta-btn {
    background: var(--prem-accent-bright, #8ab5b0);
    color: #fff;
    border-color: var(--prem-accent-bright, #8ab5b0);
}

/* ========================================
   ENHANCED INSIGHTS
======================================== */
.insights-ai-summary {
    margin: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    padding: 16px;
    overflow: hidden;
}

.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}

.ai-summary-icon {
    font-size: 18px;
}

.ai-summary-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.ai-summary-content.loading {
    color: var(--text-muted);
    font-style: italic;
}

/* Body Balance Chart */
.body-balance-chart {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.balance-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.balance-bar:last-child {
    margin-bottom: 0;
}

.balance-label {
    width: 80px;
    font-size: 12px;
    color: var(--text-secondary);
}

.balance-track {
    flex: 1;
    height: 10px;
    background: var(--glass-bg);
    border-radius: 5px;
    overflow: hidden;
}

.balance-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 5px;
    transition: width 0.5s ease;
}

.balance-value {
    width: 40px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Streak Info */
.streak-info {
    display: flex;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.streak-current,
.streak-best,
.streak-total {
    flex: 1;
    text-align: center;
}

.streak-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.streak-current .streak-number {
    color: var(--accent-orange);
}

.streak-best .streak-number {
    color: var(--accent-green);
}

.streak-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Balance fill variants */
.balance-fill-cardio {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}
.balance-fill-flex {
    background: linear-gradient(90deg, #a78bfa, #8b5cf6);
}

/* ========================================
   AI WEEKLY REPORT
======================================== */
.weekly-report-container {
    margin: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.weekly-report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--card-border);
    background: linear-gradient(135deg, rgba(105, 136, 132, 0.1), rgba(138, 181, 176, 0.08));
}

.weekly-report-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.weekly-report-title svg {
    color: var(--prem-accent, #698884);
}

.weekly-report-generate-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--prem-accent, #698884), var(--prem-accent-bright, #8ab5b0));
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.weekly-report-generate-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.weekly-report-generate-btn:disabled {
    opacity: 0.7;
    cursor: default;
    transform: none;
}

.weekly-report-generate-btn .spin-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.weekly-report-content {
    padding: 16px;
}

.weekly-report-empty {
    text-align: center;
    padding: 24px 16px;
}

.weekly-report-empty-icon {
    margin-bottom: 12px;
}

.weekly-report-empty h4 {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.weekly-report-empty p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 300px;
    margin: 0 auto;
}

/* Report Card Styles */
.weekly-report-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.report-grade-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-grade {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    flex-shrink: 0;
}

.report-grade-explanation {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.report-summary {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    padding: 12px;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--prem-accent, #698884);
}

.report-section {
    padding: 12px;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
}

.report-section-highlight {
    background: linear-gradient(135deg, rgba(105, 136, 132, 0.12), rgba(138, 181, 176, 0.08));
    border: 1px solid rgba(105, 136, 132, 0.2);
}

.report-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--prem-accent-bright, #8ab5b0);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-stats-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.report-stat {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--card-border);
}

.report-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.report-stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

.report-detail-line {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 4px;
}

.report-detail-line strong {
    color: var(--text-primary);
    font-weight: 600;
}

.report-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.report-status-on-track,
.report-status-good,
.report-status-ahead {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.report-status-behind,
.report-status-watch-out,
.report-status-needs-attention {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.report-status-no-active-program,
.report-status-unknown {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.report-achievements {
    list-style: none;
    padding: 0;
    margin: 0;
}

.report-achievements li {
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-achievements li::before {
    content: '🏆';
    font-size: 14px;
}

.report-achievements li:last-child {
    border-bottom: none;
}

.report-plan {
    list-style: none;
    padding: 0;
    margin: 0;
}

.report-plan li {
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(105, 136, 132, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.report-plan li::before {
    content: '→';
    color: var(--prem-accent-bright, #8ab5b0);
    font-weight: 700;
    flex-shrink: 0;
}

.report-plan li:last-child {
    border-bottom: none;
}

.report-motivational {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--prem-accent-bright, #8ab5b0);
    padding: 12px;
    background: linear-gradient(135deg, rgba(105, 136, 132, 0.08), rgba(138, 181, 176, 0.05));
    border-radius: var(--radius-md);
    font-style: italic;
}

/* ── Insights Program Progress Card ── */
.insights-program-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.insights-program-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.insights-program-progress-bar {
    height: 10px;
    background: var(--glass-bg);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.insights-program-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.insights-program-details {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.insights-program-last-completed {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ========================================
   ENHANCED PROGRAMS VIEW
======================================== */
.program-icon-large {
    font-size: 48px;
    margin-bottom: 12px;
}

.program-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.program-tag {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.program-progress-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin: 16px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-percent {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-green);
}

.progress-bar-track {
    height: 8px;
    background: var(--glass-bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.program-preview {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 8px;
}

.program-weeks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.program-week-item {
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.program-week-item:hover {
    border-color: var(--primary);
}

.program-week-item.completed {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
}

.program-week-item.current {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
}

.week-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.week-number {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.week-theme {
    flex: 1;
    font-size: 12px;
    color: var(--text-secondary);
}

.week-check {
    color: var(--accent-green);
    font-weight: bold;
}

.program-today-workout {
    padding: 0 16px;
    margin-bottom: 24px;
}

.program-today-workout h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.program-equipment {
    padding: 0 16px;
    margin-bottom: 24px;
}

.program-equipment h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.equipment-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.equipment-tag {
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========================================
   WHY PREMIUM PANEL
======================================== */
/* ── Why Premium Modal ── */
.why-premium-modal-inner {
    background: linear-gradient(170deg, #1c1c30 0%, #141422 55%, #11111d 100%);
    border: 1px solid var(--prem-border);
    border-radius: var(--radius-xl);
    max-width: 380px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 28px 20px 24px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(105, 136, 132, 0.08);
}
.why-premium-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
    padding: 0;
}
.why-premium-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
.why-premium-context {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 16px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.why-premium-panel {
    padding: 0;
}
.why-premium-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
    text-align: center;
    letter-spacing: -0.3px;
}
.why-premium-features {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.why-premium-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}
.why-premium-item.highlighted {
    border-left-color: var(--prem-accent-bright);
    background: rgba(105, 136, 132, 0.1);
}
.why-premium-icon-wrap {
    flex-shrink: 0;
}
.why-premium-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(105, 136, 132, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(105, 136, 132, 0.18);
}
.why-premium-icon svg {
    width: 18px;
    height: 18px;
    color: var(--prem-accent-bright);
}
.why-premium-info {
    flex: 1;
    min-width: 0;
}
.why-premium-info strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.why-premium-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.45;
}
.why-premium-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Why Premium Pricing Buttons ── */
.why-premium-pricing {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.why-premium-price-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 18px 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.why-premium-price-btn:hover {
    border-color: var(--prem-accent);
    background: rgba(105, 136, 132, 0.08);
}
.why-premium-price-btn.why-premium-best-value {
    border-color: var(--prem-accent);
    background: rgba(105, 136, 132, 0.08);
    box-shadow: 0 0 20px rgba(105, 136, 132, 0.1);
}
.why-premium-price-btn.why-premium-best-value:hover {
    background: rgba(105, 136, 132, 0.15);
    border-color: var(--prem-accent-bright);
    box-shadow: 0 0 28px rgba(105, 136, 132, 0.18);
}
.why-premium-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--prem-accent);
    color: #0f0f1a;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    white-space: nowrap;
    letter-spacing: 0.3px;
}
.why-premium-price-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1.2;
}
.why-premium-price-period {
    font-size: 12px;
    color: var(--text-secondary);
}
.why-premium-savings {
    display: block;
    font-size: 11px;
    color: var(--accent-green);
    font-weight: 600;
    margin-top: 4px;
}
.why-premium-note {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin: 14px 0 0;
}

/* ========================================
   SWAP EXERCISE CHOOSER
======================================== */
.task-swap-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.task-swap-btn:hover, .task-swap-btn:active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
}
.swap-chooser-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 1100;
    opacity: 0; transition: opacity 0.25s;
}
.swap-chooser-overlay.active { opacity: 1; }
.swap-chooser {
    width: 100%; max-width: 480px; max-height: 80vh;
    background: var(--card-bg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
.swap-chooser-overlay.active .swap-chooser { transform: translateY(0); }
.swap-chooser-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--card-border);
}
.swap-chooser-header h3 {
    font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0;
}
.swap-chooser-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 24px; cursor: pointer; padding: 4px 8px;
}
.swap-search-bar {
    padding: 10px 18px;
    border-bottom: 1px solid var(--card-border);
}
.swap-search-bar input {
    width: 100%; padding: 10px 14px;
    background: var(--glass-bg); border: 1px solid var(--card-border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 14px; outline: none;
}
.swap-search-bar input:focus { border-color: var(--primary); }
.swap-list {
    flex: 1; overflow-y: auto; padding: 8px 18px 18px;
}
.swap-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; background: var(--glass-bg);
    border-radius: var(--radius-sm); margin-bottom: 8px;
    cursor: pointer; border: 1px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}
.swap-item:hover, .swap-item:active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}
.swap-item-icon { font-size: 20px; flex-shrink: 0; }
.swap-item-info { flex: 1; }
.swap-item-name {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
}
.swap-item-reason {
    font-size: 11px; color: var(--text-muted); margin-top: 2px;
}
.swap-empty {
    text-align: center; padding: 30px 0; color: var(--text-muted); font-size: 13px;
}

/* ========================================
   READINESS BANNER
======================================== */
.readiness-banner {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; margin: 20px 0 16px 0;
    border-radius: var(--radius-md);
    font-size: 13px;
}
.readiness-banner.deload {
    background: rgba(251, 191, 36, 0.12);
    border-left: 3px solid #fbbf24;
}
.readiness-banner.maintain {
    background: rgba(99, 102, 241, 0.10);
    border-left: 3px solid #6366f1;
}
.readiness-banner.progress {
    background: rgba(52, 211, 153, 0.12);
    border-left: 3px solid #34d399;
}
.readiness-icon { font-size: 22px; flex-shrink: 0; }
.readiness-info { flex: 1; }
.readiness-type {
    font-weight: 700; font-size: 13px; margin-bottom: 2px;
}
.readiness-banner.deload .readiness-type { color: #fbbf24; }
.readiness-banner.maintain .readiness-type { color: #6366f1; }
.readiness-banner.progress .readiness-type { color: #34d399; }
.readiness-msg {
    color: var(--text-secondary); font-size: 12px; line-height: 1.4;
}

/* ========================================
   WEEKLY REVIEW CARD
======================================== */
.weekly-review-card {
    background: var(--glass-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}
.weekly-review-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 14px;
}
.weekly-review-header h4 {
    font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 0;
}
.weekly-review-stats {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
    margin-bottom: 14px;
}
.weekly-review-stat {
    text-align: center; padding: 10px 6px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: var(--radius-sm);
}
.weekly-review-stat .wr-value {
    font-size: 18px; font-weight: 700; color: var(--primary);
}
.weekly-review-stat .wr-label {
    font-size: 10px; color: var(--text-muted); margin-top: 2px;
}
.weekly-review-actions {
    list-style: none; padding: 0; margin: 0 0 12px;
}
.weekly-review-actions li {
    padding: 6px 0; font-size: 13px; color: var(--text-secondary);
    border-bottom: 1px solid var(--card-border);
}
.weekly-review-actions li:last-child { border-bottom: none; }
.weekly-review-ai-btn {
    width: 100%; padding: 10px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white; border: none; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: opacity 0.2s;
}
.weekly-review-ai-btn:hover { opacity: 0.9; }
.weekly-review-ai-content {
    margin-top: 12px; padding: 12px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text-secondary);
    line-height: 1.5;
}

/* ===================================================
   BODY METRICS
   =================================================== */
#metrics-section { margin-bottom: 20px; }
.metrics-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.metrics-header h3 { margin: 0; font-size: 16px; }
#metrics-log-btn {
    padding: 6px 14px; font-size: 12px; font-weight: 600;
    background: var(--primary); color: #fff; border: none;
    border-radius: var(--radius-sm); cursor: pointer;
}
.metrics-summary {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px; margin-bottom: 14px;
}
.metrics-card {
    background: var(--card-bg); border-radius: var(--radius-sm);
    padding: 10px; text-align: center;
}
.metrics-card .label { font-size: 11px; color: var(--text-secondary); }
.metrics-card .value { font-size: 20px; font-weight: 700; margin-top: 2px; }
.metrics-card .delta { font-size: 11px; margin-top: 2px; }
.metrics-card .delta.up { color: var(--success); }
.metrics-card .delta.down { color: var(--error); }
.metrics-chart {
    height: 120px; background: var(--card-bg);
    border-radius: var(--radius-sm); overflow: hidden;
    position: relative; margin-bottom: 14px;
}
.metrics-chart canvas { width: 100%; height: 100%; }
.metrics-photos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.metrics-photo {
    width: 80px; height: 80px; border-radius: var(--radius-sm);
    object-fit: cover; flex-shrink: 0;
}

/* Metrics Log Modal */
#metrics-modal {
    position: fixed; inset: 0; z-index: 3100;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center; justify-content: center;
    padding: 20px;
}
#metrics-modal.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}
.metrics-modal-card {
    background: linear-gradient(180deg, #1e1e2e 0%, #151521 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    width: 100%; max-width: 380px;
    max-height: 90vh; overflow-y: auto;
    animation: scaleIn 0.3s ease;
}
.metrics-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
}
.metrics-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.metrics-modal-close {
    background: var(--glass-bg);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.metrics-modal-close:hover {
    background: var(--card-border);
    color: var(--text-primary);
}
.metrics-form {
    padding: 20px;
}
.metrics-field { margin-bottom: 20px; }
.metrics-field label {
    display: block; font-size: 13px; font-weight: 500;
    color: var(--text-primary); margin-bottom: 8px;
}
.metrics-field input[type="number"] {
    width: 100%; padding: 12px 14px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    color: var(--text-primary); font-size: 15px;
    -webkit-appearance: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.metrics-field input[type="number"]::placeholder {
    color: var(--text-muted);
}
.metrics-field input[type="number"]:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.metrics-photo-upload {
    border: 2px dashed var(--card-border); border-radius: var(--radius-md);
    cursor: pointer; overflow: hidden;
    transition: border-color var(--transition-fast);
}
.metrics-photo-upload:hover { border-color: var(--primary); }
.metrics-photo-preview {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 24px; color: var(--text-muted);
}
.metrics-photo-preview span { font-size: 13px; }
.metrics-photo-preview img {
    width: 100%; max-height: 180px; object-fit: cover; border-radius: var(--radius-sm);
}
.metrics-photo-preview.has-photo { padding: 0; }
.metrics-photo-preview.has-photo svg,
.metrics-photo-preview.has-photo span { display: none; }
#metrics-save-btn {
    width: 100%; padding: 14px; font-size: 15px; font-weight: 600;
    margin-top: 4px;
}

/* ===================================================
   STARTER PLAN
   =================================================== */
#starter-plan-card {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 16px; margin-bottom: 14px;
    border: 1px dashed rgba(99, 102, 241, 0.35);
}
.starter-plan-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.starter-plan-header h3 {
    margin: 0; font-size: 15px;
}
.starter-plan-progress {
    display: flex; gap: 6px;
}
.starter-plan-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--border);
    transition: background 0.3s;
}
.starter-plan-dot.current {
    background: var(--primary); box-shadow: 0 0 6px rgba(99,102,241,0.5);
}
.starter-plan-dot.completed {
    background: var(--success);
}
#starter-plan-desc {
    font-size: 13px; color: var(--text-secondary);
    margin-bottom: 10px;
}
#starter-plan-btn {
    padding: 10px 18px; font-size: 13px; font-weight: 600;
    background: var(--primary); color: #fff; border: none;
    border-radius: var(--radius-sm); cursor: pointer; width: 100%;
}

/* Starter plan day modal (fallback) */
.starter-day-modal {
    position: fixed; inset: 0; z-index: 5000;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center; justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.starter-day-card {
    background: linear-gradient(180deg, #1e1e2e 0%, #151521 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    max-width: 380px;
    width: 100%;
    animation: scaleIn 0.3s ease;
    overflow: hidden;
}
.starter-day-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.starter-day-card .starter-day-focus {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px;
}
.starter-day-header {
    padding: 24px 24px 0;
}
.starter-day-body {
    padding: 0 24px;
}
.starter-day-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px 24px 24px;
}
.starter-plan-exercises {
    list-style: none; padding: 0; margin: 0;
}
.starter-plan-exercises li {
    padding: 8px 0; border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.starter-plan-exercises li:last-child { border-bottom: none; }

/* ===================================================
   WHAT'S NEW
   =================================================== */
#whats-new-modal {
    display: none; position: fixed; inset: 0; z-index: 1200;
    background: rgba(0,0,0,0.55); align-items: center; justify-content: center;
}
.whats-new-card {
    background: var(--bg); border-radius: var(--radius-lg);
    padding: 24px; width: 90%; max-width: 380px; text-align: center;
}
.whats-new-badge {
    display: inline-block; padding: 4px 10px; font-size: 11px;
    font-weight: 700; border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff; margin-bottom: 6px;
}
.whats-new-version {
    font-size: 12px; color: var(--text-secondary);
    margin-bottom: 14px; display: block;
}
#whats-new-list {
    list-style: none; padding: 0; margin: 0 0 18px; text-align: left;
}
#whats-new-list li {
    padding: 6px 0; font-size: 14px;
    border-bottom: 1px solid var(--border);
}
#whats-new-list li:last-child { border-bottom: none; }
#whats-new-dismiss {
    padding: 12px 28px; font-size: 14px; font-weight: 600;
    background: var(--primary); color: #fff; border: none;
    border-radius: var(--radius-sm); cursor: pointer;
}

/* ===================================================
   SMART NOTIFICATION SETTINGS
   =================================================== */
#streak-protector-container,
#evening-reminder-container {
    display: none; /* shown by JS when notifications enabled */
}
}

/* ========================================
   FLOATING XP FEEDBACK
======================================== */
.xp-float {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 800;
    color: #ffbe0b;
    text-shadow: 0 1px 4px rgba(255, 190, 11, 0.4);
    pointer-events: none;
    animation: xpFloat 1.2s ease-out forwards;
    z-index: 10;
}
@keyframes xpFloat {
    0%   { opacity: 1; transform: translateY(-50%) scale(1); }
    30%  { opacity: 1; transform: translateY(-130%) scale(1.15); }
    100% { opacity: 0; transform: translateY(-200%) scale(0.9); }
}

/* ========================================
   CHALLENGES
======================================== */
.programs-challenges-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.programs-challenges-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 14px;
}
.challenge-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.10), rgba(139, 92, 246, 0.10));
    border: 1px solid rgba(99, 102, 241, 0.20);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
}
.challenge-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.challenge-title {
    font-size: 14px; font-weight: 700; color: var(--text-primary);
    display: flex; align-items: center; gap: 6px;
}
.challenge-badge {
    font-size: 10px; padding: 2px 8px;
    background: var(--primary); color: white;
    border-radius: 99px; font-weight: 600;
}
.challenge-progress-track {
    height: 8px; background: var(--glass-bg);
    border-radius: 4px; overflow: hidden; margin-bottom: 8px;
}
.challenge-progress-fill {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
    transition: width 0.4s ease;
}
.challenge-meta {
    display: flex; justify-content: space-between;
    font-size: 11px; color: var(--text-muted);
}
.challenge-start-btn {
    margin-top: 10px; width: 100%; padding: 10px;
    background: var(--primary); color: white;
    border: none; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; cursor: pointer;
}
.challenge-complete-banner {
    text-align: center; padding: 14px;
    background: rgba(52, 211, 153, 0.12);
    border-radius: var(--radius-sm);
    color: var(--accent-green); font-weight: 600; font-size: 14px;
    margin-top: 8px;
}

/* ========================================
   POST-WORKOUT SAVE STREAK MODAL
======================================== */
.save-streak-modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 28px 22px;
    max-width: 340px;
    width: 90%;
    text-align: center;
}
.save-streak-modal .streak-fire { font-size: 48px; margin-bottom: 12px; }
.save-streak-modal h3 {
    font-size: 18px; font-weight: 700; color: var(--text-primary);
    margin: 0 0 8px;
}
.save-streak-modal p {
    font-size: 13px; color: var(--text-secondary);
    margin: 0 0 20px; line-height: 1.5;
}
.save-streak-actions {
    display: flex; flex-direction: column; gap: 10px;
}
.save-streak-actions .btn-google-cta {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px; background: var(--primary); color: white;
    border: none; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; cursor: pointer;
}
.save-streak-actions .btn-guest-skip {
    background: none; border: none;
    color: var(--text-muted); font-size: 13px; cursor: pointer;
    padding: 8px;
}

/* ========================================
   XP & LEVELING SYSTEM
======================================== */

/* ── Header Star Badge ── */
/* Same 1px visual weight as account-btn border */
.xp-header-star {
    position: absolute;
    bottom: -4px;
    left: -4px;
    width: 22px;
    height: 22px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.xp-header-star svg {
    position: absolute;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.xp-header-star-num {
    position: relative;
    z-index: 1;
    font-size: 8px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
    margin-top: 0px;
}
.xp-header-star.xp-tier-bronze svg { color: #cd7f32; }
.xp-header-star.xp-tier-silver svg { color: #c0c0c0; }
.xp-header-star.xp-tier-gold   svg { color: #ffd700; }
.xp-header-star.xp-tier-platinum svg { color: #8ab5b0; }

/* ── Account Menu: Level Star (right of profile) ── */
.xp-level-star {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.xp-star-ring {
    position: absolute;
    inset: 0;
}
.xp-ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 3;
}
.xp-ring-fill {
    fill: none;
    stroke: #ffd700;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 125.66;
    stroke-dashoffset: 125.66;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                stroke 0.4s ease;
}

.xp-star-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffd700;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.35));
}
.xp-star-level {
    position: absolute;
    font-size: 11px;
    font-weight: 800;
    color: #1a1a2e;
    text-shadow: none;
    margin-top: 1px;
}

/* Star tier colors */
.xp-level-star.xp-tier-bronze .xp-star-icon  { color: #cd7f32; filter: drop-shadow(0 0 6px rgba(205,127,50,0.3)); }
.xp-level-star.xp-tier-bronze .xp-ring-fill  { stroke: #cd7f32; }
.xp-level-star.xp-tier-silver .xp-star-icon  { color: #c0c0c0; filter: drop-shadow(0 0 6px rgba(192,192,192,0.3)); }
.xp-level-star.xp-tier-silver .xp-ring-fill  { stroke: #c0c0c0; }
.xp-level-star.xp-tier-gold .xp-star-icon    { color: #ffd700; filter: drop-shadow(0 0 8px rgba(255,215,0,0.4)); }
.xp-level-star.xp-tier-gold .xp-ring-fill    { stroke: #ffd700; }
.xp-level-star.xp-tier-platinum .xp-star-icon { color: #8ab5b0; filter: drop-shadow(0 0 8px rgba(138,181,176,0.4)); }
.xp-level-star.xp-tier-platinum .xp-ring-fill { stroke: #8ab5b0; }

/* ── Account Menu: XP Progress Row ── */
.xp-account-section {
    padding: 0 16px 12px;
    margin-top: -4px;
}

.xp-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.xp-progress-bar {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.xp-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: #ffd700;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                background-color 0.4s ease;
    min-width: 0;
}

.xp-progress-text {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.xp-meta-row {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.xp-badge-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffd700;
    opacity: 0.7;
}
.xp-badge-label.xp-tier-bronze   { color: #cd7f32; }
.xp-badge-label.xp-tier-silver   { color: #c0c0c0; }
.xp-badge-label.xp-tier-gold     { color: #ffd700; }
.xp-badge-label.xp-tier-platinum { color: #8ab5b0; }

.xp-slots-label {
    font-size: 10px;
    color: var(--text-muted);
}

/* ── Inline XP Indicator (header — Variant A: compact, no pill border) ── */
/* Align star vertically with bar centre for consistent left-to-right scan */
.xp-inline-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    margin-right: 12px;
    padding: 0;
    background: none;
    border: none;
}

/* Star container */
.xp-inline-star {
    position: relative;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffd700;
}
.xp-inline-star.xp-tier-bronze   { color: #d4944c; }
.xp-inline-star.xp-tier-silver   { color: #d0d0d0; }
.xp-inline-star.xp-tier-gold     { color: #ffbe0b; }
.xp-inline-star.xp-tier-platinum  { color: #8ab5b0; }

/* Level number chip (sits on top of star) */
.xp-inline-level {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(10, 10, 20, 0.65);
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-top: 1px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Progress bar — slightly taller for readability on dark BG */
.xp-inline-bar {
    flex: 1;
    height: 8px;
    min-width: 56px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 4px;
    overflow: hidden;
}

.xp-inline-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: #ffbe0b;
    transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Tier-colored fills */
.xp-inline-indicator.xp-tier-bronze .xp-inline-bar-fill  { background: #d4944c; }
.xp-inline-indicator.xp-tier-silver .xp-inline-bar-fill  { background: #d0d0d0; }
.xp-inline-indicator.xp-tier-gold .xp-inline-bar-fill    { background: #ffbe0b; }
.xp-inline-indicator.xp-tier-platinum .xp-inline-bar-fill { background: #8ab5b0; }

/* ── Spark pulse (plays once on XP earn) ── */
@keyframes xpSpark {
    0%   { transform: scale(1);   filter: brightness(1); }
    30%  { transform: scale(1.25); filter: brightness(1.5); }
    60%  { transform: scale(0.95); filter: brightness(1.1); }
    100% { transform: scale(1);   filter: brightness(1); }
}
.xp-inline-star.xp-spark {
    animation: xpSpark 0.5s ease-out;
}

/* ── Level-up tier flash ── */
@keyframes xpTierFlash {
    0%   { filter: brightness(2) saturate(1.4); transform: scale(1.3); }
    100% { filter: brightness(1) saturate(1);   transform: scale(1); }
}
.xp-inline-star.xp-tier-flash {
    animation: xpTierFlash 0.8s ease-out;
}

/* ── XP Toast Enhancements ── */
.toast.xp-toast {
    border-left: 3px solid #ffd700;
}
.toast.xp-toast.xp-levelup {
    border-left-color: #ffd700;
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.12) 0%,
        rgba(30, 30, 50, 0.95) 40%);
}

/* ── XP Level-Up Glow Animation ── */
@keyframes xpLevelGlow {
    0%   { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.5); }
    50%  { box-shadow: 0 0 20px 4px rgba(255, 215, 0, 0.3); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

.toast.xp-levelup {
    animation: xpLevelGlow 1.2s ease-out;
}

/* ========================================
   FAVORITE WORKOUTS
======================================== */

/* Heart toggle button in tasks header */
.btn-fav-heart {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}
.btn-fav-heart:active {
    transform: scale(1.25);
}
.btn-fav-heart .heart-icon {
    color: var(--text-muted);
    transition: color 0.2s ease, fill 0.2s ease;
}
.btn-fav-heart.favorited .heart-icon {
    color: #ef4444;
    fill: #ef4444;
}

/* Favorites list inside overlay */
.favorites-list {
    padding: 4px 0;
}
.favorites-empty {
    text-align: center;
    padding: 48px 24px;
}
.fav-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.fav-card:active {
    background: rgba(255,255,255,0.04);
}
.fav-card-body {
    flex: 1;
    min-width: 0;
}
.fav-card-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.fav-card-goal {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fav-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.fav-card-delete {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: color 0.15s;
}
.fav-card-delete:hover {
    color: #ef4444;
}

/* Favorite preview modal */
#fav-preview-overlay {
    z-index: 3500;
}
.fav-preview-modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    max-width: 420px;
    width: 92%;
    max-height: 80vh;
    overflow-y: auto;
}
.fav-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.fav-preview-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: capitalize;
    margin: 0;
}
.fav-preview-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.fav-preview-tasks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.fav-preview-task {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--glass-bg);
    border-radius: var(--radius-sm);
}
.fav-preview-check {
    color: var(--accent-green);
    font-size: 13px;
    flex-shrink: 0;
}
.fav-preview-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}
.fav-preview-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========================================
   CALENDAR DAY DETAILS
======================================== */
#calendar-day-overlay {
    z-index: 2500;
}
.calendar-day-modal {
    background: radial-gradient(circle at 20% 20%, rgba(138, 181, 176, 0.12), rgba(26, 26, 44, 0.95) 55%),
                linear-gradient(160deg, rgba(26, 26, 44, 0.95), rgba(18, 18, 31, 0.98));
    border: 1px solid var(--prem-border);
    border-radius: var(--prem-radius);
    padding: 22px 20px 18px;
    max-width: 440px;
    width: 92%;
    max-height: 82vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 24px var(--prem-glow);
    animation: calendarModalIn 0.35s ease;
}
.calendar-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.calendar-day-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--prem-text);
    margin: 0;
}
.calendar-day-meta {
    font-size: 12px;
    color: var(--prem-text-sub);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--prem-border);
}
.calendar-day-tasks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.calendar-task-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: var(--prem-surface);
    border: 1px solid transparent;
    border-radius: 14px;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.calendar-task-text {
    font-size: 13px;
    color: var(--prem-text);
    flex: 1;
}
.calendar-task-empty {
    font-size: 12px;
    color: var(--prem-text-sub);
    text-align: center;
    padding: 12px;
}

/* Subtle premium hover state */
.calendar-task-row:hover {
    background: var(--prem-surface-hover);
    border-color: var(--prem-border-hover);
}

/* Calendar day click animation */
.calendar-day-press {
    animation: calendarDayPulse 0.35s ease;
}

@keyframes calendarDayPulse {
    0%   { transform: scale(1); box-shadow: 0 0 0 rgba(138, 181, 176, 0.0); }
    45%  { transform: scale(1.08); box-shadow: 0 0 12px rgba(138, 181, 176, 0.5); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(138, 181, 176, 0.0); }
}

@keyframes calendarModalIn {
    0%   { transform: translateY(10px) scale(0.97); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* =============================================
   OFFLINE BANNER & SYNC WARNING
============================================= */
.offline-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f59e0b22, #f59e0b11);
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    font-size: 12px;
    font-weight: 500;
    z-index: 200;
    position: relative;
}
.offline-banner svg {
    flex-shrink: 0;
    color: #fbbf24;
}
.sync-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(239, 68, 68, 0.1);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    z-index: 200;
    position: relative;
    transition: background var(--transition-fast);
}
.sync-warning:hover {
    background: rgba(239, 68, 68, 0.15);
}
.sync-warning svg {
    flex-shrink: 0;
    color: #f87171;
}

/* =============================================
   TODAY'S PLAN CARD
============================================= */
.todays-plan-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}
.todays-plan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.todays-plan-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.todays-plan-greeting {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}
.todays-plan-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}
.plan-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}
.plan-stat-value {
    font-weight: 600;
    color: var(--text-primary);
}
.plan-stat svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}
.plan-program-name {
    font-size: 12px;
    color: var(--prem-accent-bright, #8ab5b0);
    background: rgba(138, 181, 176, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 12px;
}
.plan-start-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.plan-start-btn:active {
    transform: scale(0.98);
}

/* =============================================
   LOCKED PROGRAM CARDS (Free users)
============================================= */
.program-card-locked {
    position: relative;
    opacity: 0.7;
    pointer-events: auto;
}
.program-card-locked::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(15, 15, 26, 0.8));
    border-radius: inherit;
    pointer-events: none;
}
.program-unlock-tag {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(138, 181, 176, 0.15);
    border: 1px solid rgba(138, 181, 176, 0.25);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    color: var(--prem-accent-bright, #8ab5b0);
    font-weight: 500;
}
.program-unlock-tag svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.program-unlock-desc {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* =============================================
   BLURRED INSIGHT CHARTS (Free)
============================================= */
.insight-blurred {
    position: relative;
    filter: blur(5px);
    user-select: none;
}
.insight-locked-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    text-align: center;
    padding: 20px;
    cursor: pointer;
    pointer-events: auto;
    filter: none;
}
.insight-locked-overlay svg {
    width: 28px;
    height: 28px;
    color: var(--prem-accent-bright, #8ab5b0);
    margin-bottom: 8px;
}
.insight-locked-overlay p {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 220px;
    line-height: 1.4;
}

/* =============================================
   QUICK PROGRESS SUMMARY (Today tab)
============================================= */
.quick-progress {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 10px 8px;
    margin-bottom: 12px;
}
.quick-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.quick-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.quick-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* =============================================
   CONTEXTUAL SIGN-IN PROMPT
============================================= */
.contextual-signin-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1e1e32, #16162a);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 5000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideUpIn 0.3s ease;
    max-width: 340px;
    width: 90%;
}
.contextual-signin-toast p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    flex: 1;
}
.contextual-signin-toast button {
    padding: 6px 14px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
@keyframes slideUpIn {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}