/* components.css — Recovery24 UI Components */

        /* Hero Header */
        .ap-hero {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin: 0 -16px;
            padding: 14px 16px 10px;
            background: var(--ap-bg);
            border-bottom: 1px solid var(--ap-border);
        }

        .ap-hero-content h1 {
            font-size: 22px;
            font-weight: 800;
            margin: 0;
            color: var(--ap-text);
            letter-spacing: -0.3px;
        }

        .ap-hero-content p {
            font-size: 13px;
            color: var(--ap-text-muted);
            margin: 2px 0 0;
        }

        /* Risk Comparison Banner */
        .ap-stats-banner {
            background: linear-gradient(135deg, #2DA89B, #4DB8A4);
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
            position: relative;
            overflow: hidden;
        }

        .ap-stats-banner::after {
            content: '';
            position: absolute;
            top: -50%;
            right: -10%;
            width: 200px;
            height: 200px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 50%;
        }

        .ap-stats {
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: relative;
            z-index: 1;
        }

        .ap-stat {
            text-align: center;
            flex: 1;
        }

        .ap-stat-value {
            font-size: 28px;
            font-weight: 800;
            color: white;
        }

        .ap-stat-label {
            font-size: 15px;
            letter-spacing: 0.03em;
            color: rgba(255, 255, 255, 0.8);
            margin-top: 4px;
        }

        .ap-stat-arrow {
            font-size: 20px;
            color: rgba(255, 255, 255, 0.4);
            padding: 0 10px;
        }

        .ap-reduction-box {
            background: rgba(16, 185, 129, 0.2);
            border: 1px solid rgba(16, 185, 129, 0.3);
            border-radius: 12px;
            padding: 8px 16px;
            text-align: center;
        }

        .ap-reduction-value {
            font-size: 22px;
            font-weight: 800;
            color: #2D8A4E;
        }

        .ap-reduction-label {
            font-size: 15px;
            color: #2D8A4E;
            font-weight: 700;
        }

        /* Progress Section */
        .ap-progress-section {
            background: var(--ap-card);
            border-radius: var(--ap-radius-md);
            padding: 20px;
            margin-bottom: 24px;
        }

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

        .progress-title {
            font-size: 16px;
            font-weight: 600;
        }

        .progress-week {
            font-size: 15px;
            color: var(--ap-text-secondary);
        }

        .progress-bar-bg {
            height: 8px;
            background: #e2e8f0;
            border-radius: 4px;
            overflow: hidden;
        }

        .progress-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, #2D8A4E, #4CAF6E);
            border-radius: 4px;
            transition: width 1s ease;
        }

        /* Milestones */
        .section-title {
            font-size: 18px;
            font-weight: 700;
            margin: 28px 0 18px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .milestone-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 16px;
        }

        .milestone-card {
            background: var(--ap-card);
            border-radius: var(--ap-radius-md);
            padding: 20px;
            border-left: 4px solid var(--ap-primary);
        }

        .milestone-card.smoking {
            border-left-color: #C53D3D;
        }

        .milestone-card.weight {
            border-left-color: #3b82f6;
        }

        .milestone-card.muscle {
            border-left-color: #D4841C;
        }

        .milestone-card.diabetes {
            border-left-color: #4DB8A4;
        }

        .milestone-card.exercise {
            border-left-color: #2D8A4E;
        }

        .mc-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 12px;
        }

        .mc-icon {
            font-size: 24px;
        }

        .mc-weeks {
            font-size: 15px;
            color: var(--ap-text-secondary);
            font-weight: 600;
            text-transform: uppercase;
        }

        .milestone-card h3 {
            font-size: 18px;
            margin: 0 0 4px;
        }

        .mc-dates {
            font-size: 15px;
            color: var(--ap-primary);
            font-weight: 600;
            margin-bottom: 12px;
        }

        .mc-impact {
            display: inline-block;
            padding: 4px 10px;
            background: rgba(13, 115, 119, 0.1);
            color: #3DBCC0;
            border-radius: 10px;
            font-size: 15px;
            font-weight: 700;
        }

        /* Tissue Healing Timeline */
        .tissue-timeline {
            background: var(--ap-card);
            border-radius: var(--ap-radius-md);
            padding: 16px 20px;
            margin-bottom: 20px;
        }

        .tissue-timeline h3 {
            font-size: 16px;
            font-weight: 700;
            margin: 0 0 12px;
            color: var(--ap-text);
        }

        .tl-track {
            display: flex;
            gap: 0;
            margin-bottom: 8px;
            border-radius: 8px;
            overflow: hidden;
        }

        .tl-stage {
            flex: 1;
            padding: 6px 3px;
            text-align: center;
            font-size: 12px;
            font-weight: 600;
            color: var(--ap-text-muted);
            background: #f1f5f9;
            border-right: 1px solid #e2e8f0;
            transition: all 0.3s;
            line-height: 1.3;
            min-width: 0;
        }

        .tl-stage:last-child {
            border-right: none;
        }

        .tl-stage.active {
            background: linear-gradient(135deg, #2DA89B, #4DB8A4);
            color: white;
            font-weight: 700;
            box-shadow: 0 2px 8px rgba(13, 115, 119, 0.3);
        }

        .tl-stage.passed {
            background: #D0EDE6;
            color: #0A6B6F;
        }

        .tl-stage .tl-label {
            display: block;
            font-size: 12px;
            margin-top: 1px;
            white-space: normal;
            word-break: keep-all;
            line-height: 1.3;
        }

        .tl-stage .tl-days {
            display: block;
            font-size: 11px;
            opacity: 0.8;
            margin-top: 2px;
            white-space: nowrap;
        }

        .tl-tensile {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 8px;
        }

        .tl-tensile-bar {
            flex: 1;
            height: 6px;
            background: #e2e8f0;
            border-radius: 3px;
            overflow: hidden;
        }

        .tl-tensile-fill {
            height: 100%;
            border-radius: 3px;
            transition: width 0.5s ease;
        }

        .tl-tensile-text {
            font-size: 15px;
            font-weight: 700;
            color: var(--ap-text);
            white-space: nowrap;
        }


        /* Exercise Reference Links */
        .mc-checklist .item-ref {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 15px;
            font-weight: 600;
            color: #2DA89B;
            text-decoration: none;
            margin-left: 8px;
            padding: 3px 10px;
            background: rgba(13, 115, 119, 0.06);
            border-radius: 12px;
            transition: all 0.2s;
            white-space: nowrap;
        }

        .mc-checklist .item-ref:hover {
            background: rgba(13, 115, 119, 0.15);
            color: #2DA89B;
        }

        /* Exercise Illustration Thumbnails */
        .ex-thumb-wrap {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-left: auto;
            flex-shrink: 0;
        }

        .ex-thumb {
            width: 48px;
            height: 48px;
            border-radius: 10px;
            object-fit: cover;
            border: 1.5px solid #e2e8f0;
            cursor: pointer;
            transition: all 0.2s;
            background: white;
        }

        .ex-thumb:hover {
            border-color: #2DA89B;
            box-shadow: 0 2px 10px rgba(13, 115, 119, 0.2);
            transform: scale(1.08);
        }

        /* Exercise Illustration Modal */
        .ex-modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.6);
            z-index: 9999;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        .ex-modal-overlay.show {
            display: flex;
        }

        .ex-modal {
            background: white;
            border-radius: 20px;
            max-width: 420px;
            width: 100%;
            overflow: hidden;
            box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
            animation: exModalIn 0.25s ease;
        }

        @keyframes exModalIn {
            from {
                transform: scale(0.9);
                opacity: 0;
            }

            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        .ex-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            border-bottom: 1px solid #e2e8f0;
        }

        .ex-modal-header h4 {
            font-size: 16px;
            font-weight: 700;
            color: var(--ap-text);
            margin: 0;
        }

        .ex-modal-close {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            border: none;
            background: #f1f5f9;
            font-size: 18px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--ap-text-secondary);
        }

        .ex-modal-close:hover {
            background: #e2e8f0;
        }

        .ex-modal-img {
            width: 100%;
            display: block;
            padding: 16px;
        }

        .ex-modal-footer {
            padding: 12px 20px 16px;
            border-top: 1px solid #e2e8f0;
            display: flex;
            gap: 8px;
        }

        .ex-modal-yt {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 10px;
            background: #FDF0F0;
            color: #dc2626;
            border: 1px solid #fecaca;
            border-radius: 10px;
            font-size: 15px;
            font-weight: 600;
            text-decoration: none;
            transition: background 0.2s;
        }

        .ex-modal-yt:hover {
            background: #fecaca;
        }

        /* Exercise Prescription Card */
        .ex-rx-card { padding: 12px 20px; background: #f0fdf4; border-top: 1px solid #e2e8f0; }
        .ex-rx-header { font-size: 13px; font-weight: 700; color: #15803d; margin-bottom: 10px; }
        .ex-rx-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
        .ex-rx-item { background: white; border-radius: 10px; padding: 8px 4px; border: 1px solid #dcfce7; }
        .ex-rx-num { display: block; font-size: 20px; font-weight: 800; color: #16a34a; }
        .ex-rx-item small { font-size: 11px; color: #6b7280; }
        .ex-rx-note { margin-top: 8px; font-size: 12px; color: #4b5563; background: white; border-radius: 8px; padding: 8px 10px; }
        .ex-steps { padding: 12px 20px; border-top: 1px solid #e2e8f0; }
        .ex-steps-header { font-size: 13px; font-weight: 700; color: var(--ap-text); margin-bottom: 8px; }
        .ex-steps-list { padding-left: 20px; margin: 0; }
        .ex-steps-list li { font-size: 13px; color: #374151; margin-bottom: 6px; line-height: 1.5; }
        .ex-caution { padding: 10px 20px; background: #fffbeb; border-top: 1px solid #fde68a; font-size: 13px; color: #92400e; display: flex; align-items: center; gap: 6px; }
        .ex-modal { max-height: 85vh; overflow-y: auto; }

        /* ── Phase 4: Recovery Guide Card ── */
        .recovery-guide-card { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 12px; margin: 12px 0; overflow: hidden; }
        .recovery-guide-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; cursor: pointer; }
        .recovery-guide-title { font-weight: 600; font-size: 15px; color: #0c4a6e; }
        .recovery-guide-toggle { font-size: 12px; color: #7dd3fc; }
        .recovery-guide-detail { padding: 0 16px 16px; }
        .rg-item { margin-bottom: 10px; }
        .rg-item p { margin: 4px 0 0; font-size: 13px; color: #334155; line-height: 1.5; }
        .rg-item ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: #334155; }
        .rg-item ul li { margin-bottom: 3px; }
        .rg-label { font-size: 12px; font-weight: 600; color: #0369a1; }
        .rg-warning { background: #fef3c7; padding: 8px 10px; border-radius: 8px; }
        .rg-warning .rg-label { color: #92400e; }
        .rg-encourage { background: #ecfdf5; padding: 8px 10px; border-radius: 8px; }
        .rg-encourage .rg-label { color: #065f46; }

        /* ── Phase 4: Education Grid ── */
        .education-grid { display: flex; flex-direction: column; gap: 0; margin: 8px 0 20px; }
        .edu-card {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            padding: 18px 12px;
            background: var(--ap-card);
            border-radius: var(--ap-radius-md);
            cursor: pointer;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            text-align: center;
            box-shadow: var(--ap-shadow-sm);
        }
        .edu-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--ap-shadow-md);
            border-color: var(--ap-primary);
        }
        .edu-card:active { transform: scale(0.97); }
        .edu-card.edu-relevant {
            border-color: var(--ap-primary);
            background: var(--ap-card);
            box-shadow: 0 0 0 2px rgba(13, 115, 119, 0.15), var(--ap-shadow-sm);
        }
        .edu-card.edu-relevant::before {
            content: '추천';
            position: absolute;
            top: 6px;
            right: 6px;
            font-size: 9px;
            font-weight: 800;
            background: var(--ap-gradient-primary);
            color: #fff;
            padding: 2px 6px;
            border-radius: 6px;
            letter-spacing: 0.5px;
        }
        .edu-card-icon { font-size: 32px; }
        .edu-card-title { font-size: 12px; font-weight: 600; color: var(--ap-text); line-height: 1.3; }
        .edu-badge { position: absolute; top: 6px; right: 6px; background: #C53D3D; color: #fff; font-size: 9px; font-weight: 700; padding: 2px 5px; border-radius: 8px; }

        /* ── Phase 4: Education Modal — Card News Style ── */
        .edu-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 12px; }
        .edu-modal { background: #fff; border-radius: 20px; max-width: 420px; width: 100%; height: 85vh; overflow: hidden; box-shadow: 0 25px 60px rgba(0,0,0,0.35); display: flex; flex-direction: column; }
        /* Hero header */
        .edu-modal-hero { position: relative; padding: 24px 24px 18px; border-radius: 20px 20px 0 0; flex-shrink: 0; }
        .edu-modal-hero-icon { font-size: 40px; display: block; margin-bottom: 8px; }
        .edu-modal-hero h3 { font-size: 21px; font-weight: 800; color: #fff; margin: 0 0 4px; line-height: 1.3; }
        .edu-modal-hero-sub { font-size: 14px; color: rgba(255,255,255,0.8); }
        .edu-modal-close { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,0.2); border: none; font-size: 18px; color: #fff; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
        .edu-modal-close:hover { background: rgba(255,255,255,0.35); }
        /* Dot indicator */
        .edu-dots { display: flex; justify-content: center; gap: 6px; padding: 0 24px 14px; }
        .edu-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.35); cursor: pointer; transition: all 0.3s; }
        .edu-dot.active { background: #fff; width: 20px; border-radius: 4px; }
        /* TTS bar */
        .edu-tts-bar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--ap-bg); border-bottom: 1px solid #e2e8f0; flex-shrink: 0; }
        .edu-tts-btn { display: flex; align-items: center; gap: 4px; padding: 6px 14px; border-radius: 16px; border: 1px solid #cbd5e1; background: #fff; font-size: 14px; font-weight: 600; color: #475569; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
        .edu-tts-btn:hover { background: #f1f5f9; }
        .edu-tts-btn.playing { background: #2DA89B; color: #fff; border-color: #2DA89B; }
        .edu-tts-label { font-size: 13px; color: var(--ap-text-muted); flex: 1; text-align: right; }
        /* Card news body — single card visible */
        .edu-card-container { flex: 1; position: relative; overflow: hidden; }
        .edu-card-track { display: flex; transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); height: 100%; }
        .edu-card-slide { min-width: 100%; box-sizing: border-box; padding: 24px 24px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
        .edu-slide-num { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; background: #2DA89B; color: #fff; font-size: 13px; font-weight: 700; border-radius: 50%; margin-right: 8px; }
        .edu-slide-heading { font-size: 19px; font-weight: 800; color: var(--ap-text); margin-bottom: 16px; display: flex; align-items: center; line-height: 1.4; }
        .edu-slide-body { font-size: 16px; color: #374151; line-height: 1.9; white-space: pre-line; }
        .edu-slide-body strong { color: var(--ap-text); font-weight: 700; }
        .edu-slide-body em { display: block; margin-top: 14px; padding: 12px 16px; background: #f0fdf4; border-left: 3px solid #22c55e; border-radius: 0 10px 10px 0; font-style: normal; font-size: 15px; color: #166534; line-height: 1.7; }
        /* Card illustration */
        .edu-slide-illust { display: flex; justify-content: center; margin-bottom: 16px; }
        .edu-slide-illust svg { width: 100%; max-width: 320px; height: auto; }
        /* Nav buttons */
        .edu-nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 16px; flex-shrink: 0; border-top: 1px solid #f1f5f9; }
        .edu-nav-btn { display: flex; align-items: center; gap: 4px; padding: 10px 20px; border-radius: 12px; border: 1px solid #e2e8f0; background: #fff; font-size: 15px; font-weight: 700; color: #475569; cursor: pointer; transition: all 0.2s; }
        .edu-nav-btn:hover { background: var(--ap-bg); }
        .edu-nav-btn:disabled { opacity: 0.3; cursor: default; }
        .edu-nav-btn.primary { background: #2DA89B; color: #fff; border-color: #2DA89B; }
        .edu-nav-btn.primary:hover { background: #0A6B6F; }
        .edu-nav-counter { font-size: 14px; color: var(--ap-text-muted); font-weight: 600; }
        /* Hero color themes per module (fallback for unmapped modules) */
        .edu-modal-hero { background: linear-gradient(135deg, #1E8F85 0%, #2DA89B 100%); }
        .edu-hero-nutrition { background: linear-gradient(135deg, #059669 0%, #2D8A4E 100%); }
        .edu-hero-spine_structure { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); }
        .edu-hero-pain_types { background: linear-gradient(135deg, #ea580c 0%, #f97316 100%); }
        .edu-hero-sleep { background: linear-gradient(135deg, #2DA89B 0%, #4DB8A4 100%); }
        .edu-hero-posture { background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%); }
        .edu-hero-warning_signs { background: linear-gradient(135deg, #dc2626 0%, #C53D3D 100%); }
        .edu-hero-mental_health { background: linear-gradient(135deg, #4DB8A4 0%, #4DB8A4 100%); }
        .edu-hero-return_to_work { background: linear-gradient(135deg, #0d9488 0%, #2dd4bf 100%); }
        .edu-hero-recurrence_prevention { background: linear-gradient(135deg, #b91c1c 0%, #e11d48 100%); }
        .edu-hero-walking_exercise { background: linear-gradient(135deg, #15803d 0%, #22c55e 100%); }
        .edu-hero-daily_life_faq { background: linear-gradient(135deg, #2DA89B 0%, #7DD4C4 100%); }
        .edu-hero-wound_care { background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%); }
        .edu-hero-hardware_faq { background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%); }
        .edu-hero-core_exercise_p12 { background: linear-gradient(135deg, #ea580c 0%, #fb923c 100%); }
        .edu-hero-strength_exercise_p34 { background: linear-gradient(135deg, #b91c1c 0%, #C53D3D 100%); }
        .edu-hero-stretching_flexibility { background: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%); }
        .edu-hero-medication_management { background: linear-gradient(135deg, #0A6B6F 0%, #2DA89B 100%); }
        .edu-hero-travel_guide { background: linear-gradient(135deg, #0369a1 0%, #38bdf8 100%); }
        .edu-hero-sexual_activity { background: linear-gradient(135deg, #be185d 0%, #f472b6 100%); }
        .edu-hero-forbidden_postures { background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%); }
        .edu-hero-hobby_return { background: linear-gradient(135deg, #15803d 0%, #4ade80 100%); }
        .edu-hero-sports_return { background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%); }
        .edu-hero-work_return_detail { background: linear-gradient(135deg, #92400e 0%, #D4841C 100%); }
        .edu-hero-gym_equipment { background: linear-gradient(135deg, #7c2d12 0%, #ea580c 100%); }
        .edu-hero-constipation_management { background: linear-gradient(135deg, #854d0e 0%, #ca8a04 100%); }
        .edu-hero-smoking_spine { background: linear-gradient(135deg, #78350f 0%, #d97706 100%); }
        .edu-hero-alcohol_recovery { background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%); }
        .edu-hero-anxiety_depression_deep { background: linear-gradient(135deg, #0A5558 0%, #4DB8A4 100%); }
        .edu-hero-weight_spine { background: linear-gradient(135deg, #065f46 0%, #2D8A4E 100%); }

        /* Pain Classification Engine */
        .pain-classify-section {
            margin-top: 16px;
        }

        .pain-options {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-top: 8px;
        }

        .pain-opt {
            flex: 1;
            min-width: 80px;
            padding: 10px 8px;
            text-align: center;
            font-size: 15px;
            font-weight: 600;
            border: 2px solid #e2e8f0;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s;
            background: var(--ap-card);
        }

        .pain-opt:hover {
            border-color: var(--ap-text-muted);
        }

        .pain-opt.selected {
            border-color: #2DA89B;
            background: rgba(13, 115, 119, 0.08);
            color: #2DA89B;
        }

        .pain-result {
            margin-top: 16px;
            padding: 14px 16px;
            border-radius: 12px;
            font-size: 15px;
            font-weight: 600;
            display: none;
        }

        .pain-result.green {
            background: #ecfdf5;
            color: #059669;
            border: 1px solid #a7f3d0;
            display: block;
        }

        .pain-result.yellow {
            background: #fefce8;
            color: #ca8a04;
            border: 1px solid #fde68a;
            display: block;
        }

        .pain-result.red {
            background: #FDF0F0;
            color: #dc2626;
            border: 1px solid #fecaca;
            display: block;
        }

        .pain-result .pr-icon {
            font-size: 18px;
            margin-right: 6px;
        }

        .pain-result .pr-action {
            display: block;
            margin-top: 6px;
            font-weight: 400;
            font-size: 15px;
        }

        /* Phase 4 Goals Grid */
        .phase-goals {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 6px;
            margin-top: 10px;
        }

        .phase-goals .goal-item {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 15px;
            font-weight: 600;
            color: #475569;
            background: rgba(255, 255, 255, 0.5);
            padding: 5px 8px;
            border-radius: 8px;
        }

        .phase-goals .goal-icon {
            font-size: 15px;
        }

        /* Card UX v2 — Action-Evidence Split */
        .mc-phase-tag {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 15px;
            font-weight: 700;
            color: #2DA89B;
            background: rgba(13, 115, 119, 0.08);
            padding: 4px 10px;
            border-radius: 20px;
            margin-bottom: 6px;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        /* Load thresholds — compact pills inline with phase */
        .load-threshold {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            margin: 8px 0 14px;
        }

        .lt-item {
            font-size: 15px;
            font-weight: 600;
            padding: 3px 8px;
            border-radius: 20px;
            background: rgba(239, 68, 68, 0.05);
            color: #b91c1c;
            border: 1px solid rgba(239, 68, 68, 0.12);
            letter-spacing: -0.01em;
        }

        .lt-item.caution {
            background: rgba(245, 158, 11, 0.05);
            color: #b45309;
            border-color: rgba(245, 158, 11, 0.12);
        }

        .lt-item.safe {
            background: rgba(16, 185, 129, 0.05);
            color: #047857;
            border-color: rgba(16, 185, 129, 0.12);
        }

        /* Section divider inside card */
        .mc-section-label {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 15px;
            font-weight: 700;
            color: #334155;
            margin: 16px 0 10px;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .mc-section-label::after {
            content: '';
            flex: 1;
            height: 1px;
            background: linear-gradient(to right, #e2e8f0, transparent);
        }

        /* Checklist — clean actions */
        .mc-checklist {
            list-style: none;
            padding: 0;
            margin: 0 0 4px;
        }

        .mc-checklist li {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 15px;
            font-weight: 500;
            color: var(--ap-text);
            padding: 10px 14px;
            background: var(--ap-bg);
            border-radius: 10px;
            margin-bottom: 6px;
            border: 1px solid #f1f5f9;
            transition: all 0.2s;
        }

        .mc-checklist li:hover {
            background: #f1f5f9;
            border-color: #e2e8f0;
        }

        .mc-checklist input[type="checkbox"] {
            width: 18px;
            height: 18px;
            accent-color: #2DA89B;
            flex-shrink: 0;
        }

        /* Decision boundary — prominent alert */
        .decision-boundary {
            margin-top: 16px;
            padding: 14px 16px;
            background: linear-gradient(135deg, #FDF0F0, #fff7ed);
            border: 1.5px solid #fca5a5;
            border-radius: 12px;
            font-size: 15px;
            color: #7f1d1d;
            line-height: 1.7;
            position: relative;
            box-shadow: 0 2px 8px rgba(239, 68, 68, 0.08);
        }

        .decision-boundary::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background: linear-gradient(to bottom, #C53D3D, #D4841C);
            border-radius: 12px 0 0 12px;
        }

        .decision-boundary strong {
            color: #dc2626;
            font-weight: 700;
        }

        /* Evidence toggle — collapsible rationale */
        .mc-evidence-toggle {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 15px;
            font-weight: 600;
            color: var(--ap-text-muted);
            cursor: pointer;
            padding: 10px 0 4px;
            border: none;
            background: none;
            width: 100%;
            text-align: left;
            transition: color 0.2s;
        }

        .mc-evidence-toggle:hover {
            color: #2DA89B;
        }

        .mc-evidence-toggle .arrow {
            transition: transform 0.3s;
            font-size: 14px;
        }

        .mc-evidence-toggle.open .arrow {
            transform: rotate(90deg);
        }

        .mc-evidence-toggle.open {
            color: #2DA89B;
        }

        .mc-evidence-content {
            display: none;
            margin-top: 8px;
            padding: 16px;
            background: linear-gradient(135deg, #f8fafc, #fefce8 40%, #f0fdf4);
            border-radius: 12px;
            border: 1px solid #e2e8f0;
            animation: fadeSlideIn 0.3s ease;
        }

        .mc-evidence-content.show {
            display: block;
        }

        .mc-evidence-content .ev-hook {
            font-size: 15px;
            font-weight: 700;
            color: var(--ap-text);
            margin-bottom: 10px;
            line-height: 1.5;
            padding-left: 10px;
            border-left: 3px solid #2DA89B;
        }

        .mc-evidence-content .ev-mechanism {
            font-size: 15px;
            color: #475569;
            line-height: 1.7;
            margin-bottom: 12px;
        }

        .mc-evidence-content .ev-mechanism strong {
            color: var(--ap-text);
        }

        .mc-evidence-content .ev-rationale {
            list-style: none;
            padding: 0;
            margin: 0 0 10px;
        }

        .mc-evidence-content .ev-rationale li {
            font-size: 14px;
            color: var(--ap-text-secondary);
            padding: 4px 8px;
            line-height: 1.5;
            border-bottom: 1px dashed #e2e8f0;
        }

        .mc-evidence-content .ev-rationale li:last-child {
            border-bottom: none;
        }

        .mc-evidence-content .ev-rationale .ev-label {
            font-weight: 600;
            color: #475569;
        }

        .mc-evidence-content .ev-deep {
            font-size: 15px;
            color: var(--ap-text-secondary);
            line-height: 1.7;
            padding: 10px 12px;
            background: rgba(255, 255, 255, 0.7);
            border-radius: 8px;
            border: 1px dashed #cbd5e1;
        }

        @keyframes fadeSlideIn {
            from {
                opacity: 0;
                transform: translateY(-8px);
            }

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


        .phase-meta {
            display: flex;
            gap: 12px;
            margin-top: 6px;
            flex-wrap: wrap;
        }

        .phase-meta-item {
            font-size: 15px;
            font-weight: 600;
            opacity: 0.9;
            display: flex;
            align-items: center;
            gap: 4px;
        }


        /* Week Tracker Grid */
        .week-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 8px;
        }

        .week-cell {
            aspect-ratio: 1;
            background: var(--ap-card);
            border-radius: var(--ap-radius-sm);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
        }

        .week-cell.active {
            border-color: var(--ap-primary);
            background: rgba(13, 115, 119, 0.1);
            animation: weekPulse 2s ease-in-out infinite;
        }

        @keyframes weekPulse {

            0%,
            100% {
                box-shadow: 0 0 0 0 rgba(13, 115, 119, 0.3);
            }

            50% {
                box-shadow: 0 0 0 6px rgba(13, 115, 119, 0);
            }
        }

        .week-cell.completed {
            background: var(--ap-success);
            border-color: var(--ap-success);
            color: white;
        }

        .week-cell.future {
            opacity: 0.4;
            cursor: default;
        }

        .week-cell .wc-check {
            font-size: 14px;
            position: absolute;
            top: 3px;
            right: 4px;
        }

        .wc-num {
            font-size: 15px;
            font-weight: 700;
        }

        .wc-date {
            font-size: 14px;
            opacity: 0.7;
        }

        /* PROM Survey Milestone Cell */
        .week-cell.survey {
            background: linear-gradient(135deg, #E0F5F0, #D0EDE6);
            border: 2px solid #4DB8A4;
            cursor: pointer;
            aspect-ratio: auto;
            padding: 8px 4px;
        }

        .week-cell.survey:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
        }

        .week-cell.survey .wc-survey-icon {
            font-size: 18px;
            margin-bottom: 2px;
        }

        .week-cell.survey .wc-num {
            font-size: 11px;
            font-weight: 600;
            color: #4DB8A4;
        }

        .week-cell.survey.done {
            background: linear-gradient(135deg, #d1fae5, #D0EDE6);
            border-color: #2D8A4E;
        }

        .week-cell.survey.done .wc-num {
            color: #059669;
        }

        /* PROM Survey Banner */
        .prom-banner {
            display: none;
            align-items: center;
            gap: 12px;
            background: linear-gradient(135deg, #2DA89B, #4DB8A4);
            border-radius: 16px;
            padding: 16px;
            margin: 0 16px 12px;
            box-shadow: 0 4px 15px rgba(13, 115, 119, 0.3);
            animation: promPulse 2s ease infinite;
        }

        @keyframes promPulse {

            0%,
            100% {
                box-shadow: 0 4px 15px rgba(13, 115, 119, 0.3);
            }

            50% {
                box-shadow: 0 4px 25px rgba(13, 115, 119, 0.5);
            }
        }

        .prom-banner-icon {
            font-size: 2rem;
        }

        .prom-banner-content {
            flex: 1;
        }

        .prom-banner-title {
            font-size: 0.95rem;
            font-weight: 700;
            color: #fff;
        }

        .prom-banner-desc {
            font-size: 0.8rem;
            color: rgba(255, 255, 255, 0.8);
            margin-top: 2px;
        }

        .prom-banner-reward {
            display: inline-block;
            margin-top: 4px;
            font-size: 0.75rem;
            font-weight: 600;
            color: #E6A040;
            background: rgba(251, 191, 36, 0.15);
            padding: 2px 8px;
            border-radius: 10px;
        }

        .prom-banner-actions {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
        }

        .prom-badge {
            font-size: 0.7rem;
            font-weight: 600;
            background: rgba(239, 68, 68, 0.2);
            color: #fca5a5;
            padding: 2px 8px;
            border-radius: 10px;
        }

        .prom-badge.done {
            background: rgba(16, 185, 129, 0.2);
            color: #6DD492;
        }

        .prom-start-btn {
            background: white;
            color: #2DA89B;
            padding: 8px 16px;
            border-radius: 10px;
            font-size: 0.85rem;
            font-weight: 700;
            text-decoration: none;
            white-space: nowrap;
            transition: transform 0.2s;
        }

        .prom-start-btn:hover {
            transform: scale(1.05);
        }

        /* Floating Check-in Button — removed, now in tab bar */
        /* checkin-trigger: JS에서 display 제어 (!important 제거) */
        .checkin-trigger {
            /* display managed by switchTab() and renderDashboard() */
        }

        /* Number pill buttons for checkin */
        .num-pills {
            display: flex;
            gap: 6px;
            flex-wrap: nowrap;
            margin-top: 8px;
        }

        .num-pill {
            flex: 1;
            min-width: 0;
            height: 38px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            border: 1.5px solid #e2e8f0;
            background: #ffffff;
            color: #334155;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.15s;
            -webkit-tap-highlight-color: transparent;
        }

        .num-pill.selected {
            background: #2DA89B;
            color: #ffffff;
            border-color: #2DA89B;
            box-shadow: 0 2px 8px rgba(13, 115, 119, 0.3);
        }

        /* Checkin Overlay */
        .checkin-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--ap-bg-secondary);
            z-index: 1000;
            display: none;
            padding: 24px;
            overflow-y: auto;
        }

        .checkin-overlay.show {
            display: block;
        }

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

        .btn-close {
            background: none;
            border: none;
            color: var(--ap-text-secondary);
            font-size: 24px;
            cursor: pointer;
        }

        .co-card {
            background: var(--ap-card);
            border-radius: var(--ap-radius-md);
            padding: 20px;
            margin-bottom: 16px;
        }

        .q-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 16px;
            color: var(--ap-text);
        }

        .radio-options {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .opt {
            padding: 14px;
            background: #ffffff;
            border-radius: 12px;
            border: 2px solid #e2e8f0;
            font-size: 15px;
            cursor: pointer;
            color: #334155;
        }

        .opt.selected {
            border-color: #2DA89B;
            background: rgba(13, 115, 119, 0.08);
        }

        .pain-slider {
            width: 100%;
            height: 10px;
            border-radius: 5px;
            -webkit-appearance: none;
            appearance: none;
            margin: 20px 0;
            background: linear-gradient(to right, #2D8A4E 0%, #2D8A4E 30%, #D4841C 30%, #D4841C 60%, #C53D3D 60%, #C53D3D 100%);
        }

        .flare-zone {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 12px;
            border-radius: 10px;
            font-size: 15px;
            font-weight: 600;
            margin-top: 8px;
            transition: all 0.3s;
        }

        .flare-zone.green {
            background: rgba(16, 185, 129, 0.1);
            color: #059669;
        }

        .flare-zone.yellow {
            background: rgba(245, 158, 11, 0.1);
            color: #d97706;
        }

        .flare-zone.red {
            background: rgba(239, 68, 68, 0.1);
            color: #dc2626;
        }

        .pain-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 24px;
            height: 24px;
            background: #2DA89B;
            border-radius: 50%;
            cursor: pointer;
        }

        .pain-val {
            font-size: 32px;
            font-weight: 800;
            text-align: center;
            color: #2DA89B;
        }

        .btn-save {
            width: 100%;
            padding: 18px;
            background: #2D8A4E;
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 700;
            margin-top: 24px;
            cursor: pointer;
        }

        /* Success State */
        .success-view {
            text-align: center;
            padding: 40px 0;
        }

        .sv-icon {
            font-size: 64px;
            margin-bottom: 20px;
        }

        .sv-title {
            font-size: 24px;
            font-weight: 800;
            margin-bottom: 12px;
        }

        .sv-msg {
            color: var(--ap-text-secondary);
            font-size: 15px;
            margin-bottom: 32px;
        }

        /* Skeleton */
        .skeleton {
            background: #e2e8f0;
            height: 20px;
            border-radius: 4px;
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0% {
                opacity: 0.5;
            }

            50% {
                opacity: 0.8;
            }

            100% {
                opacity: 0.5;
            }
        }

        /* Phase Banner */
        .phase-banner {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 18px 20px;
            border-radius: 16px;
            margin-bottom: 20px;
            font-size: 16px;
            font-weight: 700;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .phase-banner.commitment {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(249, 115, 22, 0.15));
            color: #f97316;
        }

        .phase-banner.lock {
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(13, 115, 119, 0.15));
            color: #2DA89B;
        }

        .phase-banner.maintenance {
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.15));
            color: #2D8A4E;
        }

        .phase-banner .phase-icon {
            font-size: 22px;
        }

        .phase-banner .phase-sub {
            font-size: 15px;
            font-weight: 500;
            opacity: 0.8;
            margin-top: 4px;
        }

        .adherence-section {
            background: var(--ap-card);
            border-radius: var(--ap-radius-md);
            padding: 20px;
            margin-bottom: 20px;
            text-align: center;
        }

        .adherence-gauge {
            position: relative;
            width: 180px;
            height: 180px;
            margin: 0 auto 16px;
        }

        .adherence-gauge canvas {
            width: 180px;
            height: 180px;
        }

        .adherence-value {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
        }

        .adherence-value .score {
            font-size: 42px;
            font-weight: 800;
        }

        .adherence-value .label {
            font-size: 15px;
            color: var(--ap-text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .adherence-level {
            font-size: 15px;
            font-weight: 600;
            margin-top: 4px;
        }

        .adherence-level.excellent {
            color: #2D8A4E;
        }

        .adherence-level.good {
            color: #2DA89B;
        }

        .adherence-level.needs-work {
            color: #D4841C;
        }

        .adherence-level.low {
            color: #C53D3D;
        }

        /* Contribution Breakdown */
        .contrib-section {
            background: var(--ap-card);
            border-radius: var(--ap-radius-md);
            padding: 20px;
            margin-bottom: 20px;
        }

        .contrib-title {
            font-size: 15px;
            font-weight: 700;
            margin-bottom: 14px;
            color: var(--ap-text);
        }

        .contrib-item {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
        }

        .contrib-item:last-child {
            margin-bottom: 0;
        }

        .contrib-icon {
            font-size: 16px;
            width: 24px;
            text-align: center;
        }

        .contrib-label {
            font-size: 15px;
            font-weight: 600;
            min-width: 70px;
            color: var(--ap-text);
        }

        .contrib-bar-bg {
            flex: 1;
            height: 10px;
            background: rgba(0, 0, 0, 0.06);
            border-radius: 5px;
            overflow: hidden;
        }

        .contrib-bar-fill {
            height: 100%;
            border-radius: 5px;
            transition: width 0.8s ease;
        }

        .contrib-value {
            font-size: 15px;
            font-weight: 700;
            min-width: 36px;
            text-align: right;
        }

        /* Accountability Badge */
        .accountability-badge {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            margin-top: 12px;
            padding: 8px 16px;
            background: rgba(13, 115, 119, 0.08);
            border-radius: 20px;
            font-size: 15px;
            font-weight: 600;
            color: #2DA89B;
        }

        /* Phase Dividers in Week Grid */
        .phase-divider {
            grid-column: 1 / -1;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 4px 0;
            margin-top: 4px;
        }

        .phase-divider-label {
            font-size: 15px;
            font-weight: 700;
            white-space: nowrap;
            color: var(--ap-text-secondary);
        }

        .phase-divider-line {
            flex: 1;
            height: 1px;
            background: var(--ap-border);
        }

        /* Risk Trend */
        .risk-trend-section {
            background: var(--ap-card);
            border-radius: var(--ap-radius-md);
            padding: 20px;
            margin-bottom: 20px;
        }

        .risk-trend-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .risk-trend-header h3 {
            font-size: 15px;
            font-weight: 700;
            margin: 0;
        }

        .risk-trend-header .change {
            font-size: 15px;
            font-weight: 600;
        }

        .risk-trend-header .change.down {
            color: #2D8A4E;
        }

        .risk-trend-header .change.up {
            color: #C53D3D;
        }

        #riskTrendCanvas {
            width: 100%;
            height: 100px;
        }

        /* Google Fit Summary Cards */
        .gfit-summary-card {
            background: var(--ap-card);
            border-radius: var(--ap-radius-md);
            padding: 14px 16px;
            text-align: left;
            box-shadow: var(--ap-shadow-sm);
            position: relative;
            overflow: hidden;
        }
        .gfit-summary-card::after {
            content: '';
            position: absolute;
            bottom: 0; left: 0; right: 0;
            height: 3px;
            border-radius: 0 0 16px 16px;
        }
        .gfit-summary-card:nth-child(1)::after { background: var(--ap-gradient-success); }
        .gfit-summary-card:nth-child(2)::after { background: linear-gradient(90deg, #3DBCC0, #4DB8A4); }
        .gfit-summary-card:nth-child(3)::after { background: linear-gradient(90deg, #f43f5e, #fb7185); }
        .gfit-summary-card:nth-child(4)::after { background: var(--ap-gradient-accent); }
        .gfit-card-header {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 8px;
        }
        .gfit-card-icon { font-size: 20px; }
        .gfit-card-label { font-size: 12px; font-weight: 600; color: var(--ap-text-secondary); }
        .gfit-card-value {
            font-size: 26px;
            font-weight: 800;
            color: var(--ap-text);
            line-height: 1.1;
            font-variant-numeric: tabular-nums;
        }
        .gfit-card-sparkline {
            height: 24px;
            margin-top: 6px;
            opacity: 0.6;
        }

        /* ── Intensity Guide Card ── */
        .intensity-guide {
            margin: 12px 0;
            padding: 16px;
            border-radius: 16px;
            border-left: 5px solid var(--primary);
            background: rgba(255, 255, 255, 0.06);
            display: none;
        }

        .intensity-guide .ig-label {
            font-size: 18px;
            font-weight: 700;
            margin-bottom: 6px;
        }

        .intensity-guide .ig-action {
            font-size: 15px;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        /* ── Condition-Specific Guide Card ── */
        .condition-guide-card {
            margin: 12px 0;
            padding: 18px;
            border-radius: 16px;
            background: linear-gradient(135deg, rgba(13, 115, 119, 0.08), rgba(139, 92, 246, 0.05));
            border: 1px solid rgba(13, 115, 119, 0.2);
        }

        .cg-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
        }

        .cg-badge {
            font-size: 15px;
            font-weight: 700;
            padding: 3px 10px;
            border-radius: 20px;
            background: rgba(239, 68, 68, 0.15);
            color: #C53D3D;
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .cg-title {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-primary);
        }

        .cg-summary {
            font-size: 15px;
            color: var(--text-primary);
            line-height: 1.6;
            margin-bottom: 10px;
        }

        .cg-why {
            padding: 10px 14px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 12px;
            margin-bottom: 10px;
        }

        .cg-why-label {
            font-size: 15px;
            font-weight: 700;
            color: #3DBCC0;
            margin-bottom: 4px;
        }

        .cg-why-text {
            font-size: 15px;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        .cg-detail {
            font-size: 15px;
            color: var(--text-secondary);
            line-height: 1.5;
            padding: 10px 14px;
            background: rgba(255, 255, 255, 0.03);
            border-radius: 10px;
            margin-bottom: 10px;
        }

        .cg-section-label {
            font-size: 15px;
            font-weight: 700;
            margin-bottom: 6px;
            color: #2D8A4E;
        }

        .cg-section-label.cg-contra-label {
            color: #C53D3D;
            margin-top: 10px;
        }

        .cg-action-item {
            font-size: 15px;
            color: var(--text-secondary);
            padding: 2px 0;
        }

        .cg-contra-item {
            font-size: 15px;
            color: #fca5a5;
            padding: 2px 0;
        }

        .cg-toggle {
            display: block;
            margin-top: 8px;
            background: none;
            border: none;
            color: #3DBCC0;
            font-size: 15px;
            cursor: pointer;
            padding: 0;
        }

        /* ── Phase Progress Bar (3-phase) ── */
        .phase-progress-section {
            margin: 12px 0;
            padding: 14px 16px;
            background: rgba(255, 255, 255, 0.04);
            border-radius: 16px;
        }

        .phase-progress-track {
            position: relative;
            height: 10px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 5px;
            overflow: hidden;
            margin: 10px 0 6px;
        }

        .phase-progress-fill {
            height: 100%;
            border-radius: 5px;
            transition: width 0.6s ease;
            background: linear-gradient(90deg, #EF4444, #F59E0B 40%, #3B82F6);
        }

        .phase-markers {
            display: flex;
            justify-content: space-between;
            font-size: 14px;
            color: var(--text-secondary);
        }

        .phase-markers span {
            text-align: center;
        }

        .phase-markers span.active {
            color: var(--text-primary);
            font-weight: 700;
        }

        /* ── Achievement Badges ── */
        .achievement-badges {
            display: flex;
            gap: 6px;
            margin: 8px 0 4px;
            flex-wrap: wrap;
        }

        .badge {
            padding: 4px 10px;
            border-radius: 16px;
            font-size: 15px;
            font-weight: 600;
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.1);
            opacity: 0.4;
        }

        .badge.earned {
            opacity: 1;
            background: rgba(16, 185, 129, 0.15);
            border-color: #10B981;
            color: #10B981;
        }

        /* ── Absolute Red Flags Emergency Modal ── */
        .redflag-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, .75);
            z-index: 10000;
            align-items: center;
            justify-content: center;
        }

        .redflag-modal-overlay.show {
            display: flex;
        }

        .redflag-modal {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            border: 2px solid #dc2626;
            border-radius: 20px;
            padding: 32px 24px;
            max-width: 380px;
            text-align: center;
            color: #fff;
            animation: redflagPulse 2s infinite;
        }

        @keyframes redflagPulse {

            0%,
            100% {
                box-shadow: 0 0 20px rgba(220, 38, 38, .4)
            }

            50% {
                box-shadow: 0 0 40px rgba(220, 38, 38, .8)
            }
        }

        .redflag-modal .rf-icon {
            font-size: 56px;
            margin-bottom: 12px;
        }

        .redflag-modal h2 {
            font-size: 20px;
            color: #C53D3D;
            margin: 0 0 12px;
        }

        .redflag-modal p {
            font-size: 15px;
            line-height: 1.6;
            color: #e2e8f0;
            margin: 0 0 8px;
        }

        .redflag-modal .rf-symptoms {
            text-align: left;
            background: rgba(220, 38, 38, .15);
            border-radius: 12px;
            padding: 16px;
            margin: 16px 0;
        }

        .redflag-modal .rf-symptoms li {
            font-size: 15px;
            color: #fca5a5;
            margin-bottom: 8px;
            list-style: none;
        }

        .redflag-modal .rf-symptoms li::before {
            content: '\1F6A8 ';
        }

        .redflag-modal .rf-action {
            background: #dc2626;
            color: #fff;
            border: none;
            border-radius: 12px;
            padding: 14px 28px;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            width: 100%;
            margin-top: 12px;
        }

        .redflag-modal .rf-dismiss {
            background: transparent;
            color: var(--ap-text-muted);
            border: 1px solid #334155;
            border-radius: 12px;
            padding: 10px 20px;
            font-size: 15px;
            cursor: pointer;
            width: 100%;
            margin-top: 8px;
        }

        /* ── Risk-Level message banner ── */
        .risk-level-msg {
            border-radius: 12px;
            padding: 14px 16px;
            margin: 12px 0;
            font-size: 15px;
            line-height: 1.5;
        }

        .risk-level-msg.high {
            background: rgba(220, 38, 38, .12);
            border-left: 4px solid #dc2626;
            color: #fca5a5;
        }

        .risk-level-msg.medium {
            background: rgba(245, 158, 11, .12);
            border-left: 4px solid #D4841C;
            color: #fcd34d;
        }

        .risk-level-msg.low {
            background: rgba(16, 185, 129, .12);
            border-left: 4px solid #2D8A4E;
            color: #6DD492;
        }

        /* ── Phase Coach Card ── */
        .phase-coach-card {
            background: linear-gradient(135deg, #2DA89B 0%, #2A8A8E 50%, #4DB8A4 100%);
            border-radius: 16px;
            padding: 20px;
            margin: 12px 0;
            color: white;
            position: relative;
            animation: coachSlideIn 0.5s ease-out;
            box-shadow: 0 4px 20px rgba(13, 115, 119, 0.3);
        }

        @keyframes coachSlideIn {
            from {
                opacity: 0;
                transform: translateY(-12px);
            }

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

        .pc-dismiss {
            position: absolute;
            top: 12px;
            right: 12px;
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            font-size: 15px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .pc-title {
            font-size: 16px;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .pc-body {
            font-size: 15px;
            line-height: 1.5;
            opacity: 0.95;
            margin-bottom: 10px;
        }

        .pc-tip {
            background: rgba(255, 255, 255, 0.15);
            border-radius: 10px;
            padding: 10px 12px;
            font-size: 15px;
            line-height: 1.5;
        }

        .pc-tip strong {
            display: block;
            margin-bottom: 4px;
        }

        .pc-caution {
            margin-top: 8px;
            font-size: 15px;
            opacity: 0.8;
            padding: 6px 10px;
            background: rgba(239, 68, 68, 0.2);
            border-radius: 8px;
        }

        /* ── Intelligence Card (Layer 2) ── */
        .intel-card {
            background: #1e1e2e;
            border: 1px solid rgba(13, 115, 119, 0.3);
            border-radius: 16px;
            padding: 18px;
            margin: 16px 0;
        }

        /* ── Agent Loop Card ── */
        .agent-loop-card {
            background: linear-gradient(135deg, #0f172a, #0A2E30);
            border: 1px solid rgba(13, 115, 119, 0.25);
            border-radius: 16px;
            padding: 18px;
            margin: 12px 0 16px;
        }

        /* ── Weekly Goal Card (Phase 8 — Adaptive) ── */
        /* Phase 9-B: Weekly Achievement Trend Chart */
        .weekly-trend-chart {
            background: var(--card-bg);
            border-radius: 16px;
            padding: 16px 14px;
            margin-bottom: 16px;
            border: 1px solid rgba(255, 255, 255, 0.06);
        }

        .trend-header {
            font-size: 0.9rem;
            font-weight: 700;
            margin-bottom: 14px;
            color: var(--text-primary);
        }

        .trend-bars {
            display: flex;
            align-items: flex-end;
            gap: 6px;
            height: 100px;
            padding-bottom: 24px;
            position: relative;
        }

        .trend-bar-col {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        .trend-bar {
            width: 100%;
            max-width: 32px;
            border-radius: 4px 4px 0 0;
            transition: height 0.4s ease;
            min-height: 4px;
        }

        .trend-bar.achieved {
            background: linear-gradient(180deg, #34D399, #10B981);
        }

        .trend-bar.partial {
            background: linear-gradient(180deg, #FBBF24, #F59E0B);
        }

        .trend-bar.missed {
            background: linear-gradient(180deg, #F87171, #EF4444);
        }

        .trend-bar.active {
            background: linear-gradient(180deg, #60A5FA, #3B82F6);
        }

        .trend-score {
            font-size: 0.65rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .trend-week {
            font-size: 0.6rem;
            color: var(--text-secondary);
            position: absolute;
            bottom: 0;
        }

        .weekly-goal-card {
            background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
            border: 1px solid #bbf7d0;
            border-left: 4px solid #2D8A4E;
            border-radius: 16px;
            padding: 18px 20px;
            margin-bottom: 16px;
            position: relative;
            overflow: hidden;
        }

        .weekly-goal-card::after {
            content: '';
            position: absolute;
            top: -20px;
            right: -20px;
            width: 80px;
            height: 80px;
            background: rgba(16, 185, 129, 0.08);
            border-radius: 50%;
        }

        .wg-header {
            font-size: 16px;
            font-weight: 700;
            color: var(--ap-text);
            margin-bottom: 6px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .wg-direction {
            font-size: 15px;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 12px;
        }

        .wg-direction.up {
            background: #dbeafe;
            color: #2563eb;
        }

        .wg-direction.down {
            background: #fef3c7;
            color: #d97706;
        }

        .wg-direction.same {
            background: #f1f5f9;
            color: var(--ap-text-secondary);
        }

        .wg-target {
            font-size: 28px;
            font-weight: 800;
            color: #059669;
            margin: 8px 0 4px;
        }

        .wg-target-unit {
            font-size: 16px;
            font-weight: 600;
            color: #6b7280;
        }

        .wg-prev {
            font-size: 15px;
            color: var(--ap-text-muted);
            margin-bottom: 10px;
        }

        .wg-coach-msg {
            font-size: 15px;
            line-height: 1.6;
            color: #334155;
            padding: 10px 14px;
            background: rgba(255, 255, 255, 0.7);
            border-radius: 10px;
            margin-bottom: 12px;
        }

        .wg-history {
            display: flex;
            gap: 4px;
            align-items: flex-end;
            margin-bottom: 14px;
        }

        .wg-bar {
            width: 16px;
            border-radius: 4px 4px 0 0;
            min-height: 4px;
            transition: height 0.3s;
        }

        .wg-bar.achieved {
            background: #2D8A4E;
        }

        .wg-bar.partial {
            background: #D4841C;
        }

        .wg-bar.missed {
            background: #e2e8f0;
        }

        .wg-bar.active {
            background: #2DA89B;
            animation: pulse-bar 2s infinite;
        }

        @keyframes pulse-bar {
            50% {
                opacity: 0.6;
            }
        }

        .wg-complete-btn {
            width: 100%;
            padding: 12px;
            border: none;
            border-radius: 12px;
            background: linear-gradient(135deg, #2D8A4E, #059669);
            color: white;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            transition: transform 0.15s, box-shadow 0.15s;
        }

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

        .wg-complete-btn.done {
            background: #d1fae5;
            color: #059669;
        }

        .wg-body {
            font-size: 15px;
            line-height: 1.6;
            color: #334155;
        }

        .wg-messages {
            margin-top: 10px;
            display: none;
        }

        /* ── Coach Message Card (standalone, high-visibility) ── */
        .coach-msg-card {
            background: linear-gradient(135deg, #2DA89B 0%, #2A8A8E 50%, #4DB8A4 100%);
            border-radius: 16px;
            padding: 18px 20px;
            margin-bottom: 16px;
            position: relative;
            overflow: hidden;
            box-shadow: 0 4px 20px rgba(13, 115, 119, 0.25);
        }

        .coach-msg-card::before {
            content: '';
            position: absolute;
            top: -30px;
            right: -30px;
            width: 100px;
            height: 100px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 50%;
        }

        .coach-msg-card .coach-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 12px;
        }

        .coach-msg-card .coach-avatar {
            width: 36px;
            height: 36px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            flex-shrink: 0;
        }

        .coach-msg-card .coach-label {
            font-size: 15px;
            font-weight: 700;
            color: rgba(255, 255, 255, 0.9);
            letter-spacing: 0.3px;
        }

        .coach-msg-card .coach-sublabel {
            font-size: 15px;
            color: rgba(255, 255, 255, 0.55);
            margin-top: 1px;
        }

        .coach-msg-card .coach-body {
            font-size: 16px;
            line-height: 1.65;
            color: #ffffff;
            font-weight: 500;
            margin-bottom: 14px;
        }

        .coach-msg-card .coach-buttons {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .coach-msg-card .coach-btn {
            font-size: 15px;
            font-weight: 600;
            padding: 8px 20px;
            border-radius: 24px;
            background: rgba(255, 255, 255, 0.2);
            color: #ffffff;
            border: 1.5px solid rgba(255, 255, 255, 0.3);
            cursor: pointer;
            transition: all 0.2s;
            backdrop-filter: blur(4px);
        }

        .coach-msg-card .coach-btn:active {
            background: rgba(255, 255, 255, 0.35);
            transform: scale(0.97);
        }

        @keyframes coachPulse {

            0%,
            100% {
                box-shadow: 0 4px 20px rgba(13, 115, 119, 0.25);
            }

            50% {
                box-shadow: 0 4px 28px rgba(13, 115, 119, 0.45);
            }
        }

        .coach-msg-card.fresh {
            animation: coachPulse 2s ease-in-out 3;
        }

        /* ── Push Notification Opt-in Banner ── */
        .push-banner {
            background: linear-gradient(135deg, #2DA89B, #4DB8A4);
            border-radius: 14px;
            padding: 14px 18px;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            box-shadow: 0 2px 12px rgba(13, 115, 119, 0.2);
        }

        .push-banner:active {
            transform: scale(0.98);
        }

        .push-banner .push-icon {
            font-size: 28px;
            flex-shrink: 0;
        }

        .push-banner .push-text {
            flex: 1;
        }

        .push-banner .push-title {
            font-size: 15px;
            font-weight: 700;
            color: #fff;
        }

        .push-banner .push-desc {
            font-size: 15px;
            color: rgba(255, 255, 255, 0.7);
            margin-top: 2px;
        }

        .push-banner .push-arrow {
            font-size: 18px;
            color: rgba(255, 255, 255, 0.6);
        }

        .agent-loop-card .alc-header {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 15px;
            font-weight: 700;
            color: #B2E0D6;
            margin-bottom: 16px;
        }

        .agent-loop-card .alc-header .alc-state {
            margin-left: auto;
            font-size: 15px;
            font-weight: 600;
            padding: 3px 10px;
            border-radius: 20px;
        }

        .alc-state.stable {
            background: rgba(16, 185, 129, 0.15);
            color: #6DD492;
        }

        .alc-state.motivation {
            background: rgba(251, 191, 36, 0.15);
            color: #fcd34d;
        }

        .alc-state.clinical {
            background: rgba(96, 165, 250, 0.15);
            color: #93c5fd;
        }

        .alc-state.critical {
            background: rgba(239, 68, 68, 0.15);
            color: #fca5a5;
        }

        /* Engagement Ring */
        .alc-engagement {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 16px;
        }

        .alc-ring {
            position: relative;
            width: 70px;
            height: 70px;
            flex-shrink: 0;
        }

        .alc-ring svg {
            width: 70px;
            height: 70px;
            transform: rotate(-90deg);
        }

        .alc-ring .ring-bg {
            fill: none;
            stroke: rgba(255, 255, 255, 0.08);
            stroke-width: 6;
        }

        .alc-ring .ring-fg {
            fill: none;
            stroke-width: 6;
            stroke-linecap: round;
            transition: stroke-dashoffset 0.8s ease;
        }

        .alc-ring-label {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
        }

        .alc-ring-label .score {
            font-size: 18px;
            font-weight: 800;
            color: #e2e8f0;
        }

        .alc-ring-label .label {
            font-size: 14px;
            color: var(--ap-text-muted);
            text-transform: uppercase;
        }

        .alc-bars {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .alc-bar-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .alc-bar-item .bar-label {
            font-size: 14px;
            color: var(--ap-text-muted);
            width: 40px;
        }

        .alc-bar-item .bar-track {
            flex: 1;
            height: 5px;
            background: rgba(255, 255, 255, 0.06);
            border-radius: 3px;
            overflow: hidden;
        }

        .alc-bar-item .bar-fill {
            height: 100%;
            border-radius: 3px;
            transition: width 0.6s ease;
        }

        .alc-bar-item .bar-val {
            font-size: 14px;
            color: #cbd5e1;
            width: 24px;
            text-align: right;
        }

        /* Micro-goal */
        .alc-microgoal {
            background: rgba(13, 115, 119, 0.08);
            border: 1px solid rgba(13, 115, 119, 0.15);
            border-radius: 12px;
            padding: 12px 14px;
            margin-bottom: 12px;
        }

        .alc-microgoal .mg-title {
            font-size: 15px;
            font-weight: 600;
            color: #7DD4C4;
            margin-bottom: 6px;
        }

        .alc-microgoal .mg-body {
            font-size: 15px;
            color: #e2e8f0;
            line-height: 1.5;
        }

        /* Agent Message */
        .alc-messages {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .alc-msg {
            background: rgba(255, 255, 255, 0.04);
            border-radius: 12px;
            padding: 10px 14px;
        }

        .alc-msg .msg-body {
            font-size: 15px;
            color: #cbd5e1;
            line-height: 1.5;
        }

        .alc-msg .msg-buttons {
            display: flex;
            gap: 6px;
            margin-top: 8px;
            flex-wrap: wrap;
        }

        .alc-msg .msg-btn {
            font-size: 15px;
            font-weight: 600;
            padding: 5px 14px;
            border-radius: 20px;
            background: rgba(13, 115, 119, 0.15);
            color: #7DD4C4;
            border: 1px solid rgba(13, 115, 119, 0.2);
            cursor: pointer;
            transition: all 0.2s;
        }

        .alc-msg .msg-btn:hover {
            background: rgba(13, 115, 119, 0.3);
            color: #B2E0D6;
        }

        .alc-delta {
            font-size: 14px;
            margin-left: 4px;
        }

        .alc-delta.up {
            color: #6DD492;
        }

        .alc-delta.down {
            color: #fca5a5;
        }

        .intel-header {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 15px;
            font-weight: 700;
            color: #e2e8f0;
            margin-bottom: 14px;
        }

        .intel-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        }

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

        .intel-label {
            font-size: 15px;
            color: var(--ap-text-muted);
        }

        .intel-value {
            font-size: 15px;
            font-weight: 600;
        }

        .intel-value.low {
            color: #2D8A4E;
        }

        .intel-value.moderate {
            color: #D4841C;
        }

        .intel-value.high {
            color: #f97316;
        }

        .intel-value.critical {
            color: #C53D3D;
        }

        .intel-msg {
            margin-top: 10px;
            font-size: 15px;
            line-height: 1.5;
            color: #cbd5e1;
            padding: 10px 12px;
            background: rgba(13, 115, 119, 0.1);
            border-radius: 10px;
        }

        /* ════════════════════════════════════════════════════════
           Phase 4: Gamification System
           ════════════════════════════════════════════════════════ */

        /* XP Bar */
        .xp-bar-container {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 0 4px;
        }
        .xp-level-badge {
            background: var(--ap-gradient-accent);
            color: #fff;
            font-size: 11px;
            font-weight: 800;
            padding: 3px 8px;
            border-radius: 10px;
            white-space: nowrap;
            letter-spacing: 0.5px;
        }
        .xp-bar-track {
            flex: 1;
            height: 6px;
            background: var(--ap-border);
            border-radius: 3px;
            overflow: hidden;
        }
        .xp-bar-fill {
            height: 100%;
            background: var(--ap-gradient-success);
            border-radius: 3px;
            transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
            width: 0%;
        }
        .xp-text {
            font-size: 11px;
            font-weight: 600;
            color: var(--ap-text-muted);
            white-space: nowrap;
        }

        /* Streak Counter */
        .streak-counter {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-weight: 800;
        }
        .streak-flame {
            display: inline-block;
            animation: flamePulse 1.5s ease-in-out infinite;
        }
        @keyframes flamePulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.2); }
        }

        /* Daily Mission Card */
        .daily-mission-card {
            background: var(--ap-card);
            border-radius: var(--ap-radius-md);
            padding: 16px;
            box-shadow: var(--ap-shadow-md);
            margin-bottom: 16px;
            border-left: 4px solid var(--ap-accent);
        }
        .dm-header {
            font-size: 14px;
            font-weight: 800;
            color: var(--ap-accent);
            margin-bottom: 8px;
        }
        .dm-description {
            font-size: 15px;
            font-weight: 600;
            color: var(--ap-text);
            margin-bottom: 8px;
        }
        .dm-reward {
            font-size: 12px;
            font-weight: 700;
            color: var(--ap-success);
            margin-bottom: 12px;
        }
        .dm-complete-btn {
            width: 100%;
            padding: 10px;
            border: none;
            border-radius: var(--ap-radius-sm);
            background: var(--ap-gradient-accent);
            color: #fff;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
        }

        /* Badge unlock animation */
        @keyframes badgeUnlock {
            0% { transform: scale(0); opacity: 0; }
            60% { transform: scale(1.2); opacity: 1; }
            100% { transform: scale(1); opacity: 1; }
        }
        .badge.just-earned {
            animation: badgeUnlock 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        }

        /* Confetti */
        .confetti-container {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            pointer-events: none;
            z-index: 9999;
            overflow: hidden;
        }
        .confetti-piece {
            position: absolute;
            width: 8px;
            height: 8px;
            border-radius: 2px;
            top: -10px;
            animation: confettiFall 2.5s ease-in forwards;
        }
        @keyframes confettiFall {
            0% { transform: translateY(0) rotate(0deg); opacity: 1; }
            100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
        }

        /* ════════════════════════════════════════════════════════
           Phase 5: Micro-interactions & Motion
           ════════════════════════════════════════════════════════ */

        /* Staggered card entry */
        .stagger-enter {
            opacity: 0;
            transform: translateY(12px);
            animation: staggerIn 0.4s ease-out forwards;
        }
        @keyframes staggerIn {
            to { opacity: 1; transform: translateY(0); }
        }

        /* Number count-up glow */
        .value-updated {
            animation: valueGlow 0.6s ease;
        }
        @keyframes valueGlow {
            0% { color: var(--ap-success); transform: scale(1.05); }
            100% { color: inherit; transform: scale(1); }
        }

        /* Checkin success checkmark */
        .check-draw {
            stroke-dasharray: 60;
            stroke-dashoffset: 60;
            animation: drawCheck 0.5s ease forwards 0.2s;
        }
        @keyframes drawCheck {
            to { stroke-dashoffset: 0; }
        }

        /* Float up XP notification */
        .xp-float {
            position: fixed;
            bottom: 120px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--ap-gradient-success);
            color: #fff;
            padding: 8px 20px;
            border-radius: 20px;
            font-size: 14px;
            font-weight: 800;
            z-index: 10000;
            animation: floatUp 1.5s ease forwards;
            pointer-events: none;
        }
        @keyframes floatUp {
            0% { opacity: 1; transform: translateX(-50%) translateY(0); }
            70% { opacity: 1; }
            100% { opacity: 0; transform: translateX(-50%) translateY(-60px); }
        }

        /* ════════════════════════════════════════════════════════
           Daily Login Reward Toast
           ════════════════════════════════════════════════════════ */
        .daily-reward-toast {
            position: fixed;
            top: 0; left: 0; right: 0;
            z-index: 10002;
            display: flex;
            justify-content: center;
            padding: 0 20px;
            pointer-events: none;
            animation: rewardSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        }
        .daily-reward-inner {
            background: linear-gradient(135deg, #1E8F85, #2DA89B);
            color: #fff;
            padding: 20px 28px;
            border-radius: 0 0 24px 24px;
            text-align: center;
            box-shadow: 0 12px 40px rgba(13,115,119,0.3);
            min-width: 260px;
        }
        .daily-reward-streak {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-bottom: 6px;
        }
        .daily-reward-fire { font-size: 24px; }
        .daily-reward-days {
            font-size: 20px;
            font-weight: 800;
            letter-spacing: -0.5px;
        }
        .daily-reward-label {
            font-size: 13px;
            opacity: 0.85;
            margin-bottom: 8px;
        }
        .daily-reward-xp {
            display: inline-block;
            background: rgba(255,255,255,0.2);
            padding: 4px 16px;
            border-radius: 999px;
            font-size: 14px;
            font-weight: 800;
            letter-spacing: 0.5px;
        }
        .daily-reward-exit {
            animation: rewardSlideOut 0.4s ease forwards;
        }
        @keyframes rewardSlideIn {
            from { transform: translateY(-100%); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        @keyframes rewardSlideOut {
            from { transform: translateY(0); opacity: 1; }
            to { transform: translateY(-100%); opacity: 0; }
        }

        /* ════════════════════════════════════════════════════════
           Celebration Confetti & Effects
           ════════════════════════════════════════════════════════ */
        .celebration-toast {
            position: fixed;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%) scale(0.3);
            z-index: 10002;
            background: #fff;
            border-radius: 28px;
            padding: 32px 40px;
            text-align: center;
            box-shadow: 0 24px 60px rgba(0,0,0,0.15);
            pointer-events: none;
            animation: celebPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        }
        .celebration-toast.exit {
            animation: celebExit 0.3s ease forwards;
        }
        .celebration-emoji { font-size: 48px; margin-bottom: 8px; }
        .celebration-title {
            font-size: 20px; font-weight: 800; color: #1a1c1b;
            margin-bottom: 4px;
        }
        .celebration-sub {
            font-size: 13px; color: #6e7979;
        }
        .celebration-xp {
            display: inline-block;
            margin-top: 12px;
            background: linear-gradient(135deg, #2DA89B, #4DB8A4);
            color: #fff;
            padding: 6px 20px;
            border-radius: 999px;
            font-size: 14px;
            font-weight: 800;
        }
        @keyframes celebPop {
            from { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
            to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
        }
        @keyframes celebExit {
            from { transform: translate(-50%, -50%) scale(1); opacity: 1; }
            to { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
        }

        /* ════════════════════════════════════════════════════════
           Recovery Score Ring (Oura-inspired)
           ════════════════════════════════════════════════════════ */
        .recovery-ring-card {
            display: flex;
            align-items: center;
            gap: 20px;
            padding: 20px;
            background: var(--ap-card);
            border-radius: var(--ap-radius-lg);
            box-shadow: var(--ap-shadow-md);
            margin-bottom: 16px;
        }
        .recovery-ring-svg {
            width: 110px;
            height: 110px;
            flex-shrink: 0;
            transform: rotate(-90deg);
        }
        .recovery-ring-bg {
            fill: none;
            stroke: var(--ap-border);
            stroke-width: 8;
        }
        .recovery-ring-fill {
            fill: none;
            stroke-width: 8;
            stroke-linecap: round;
            transition: stroke-dashoffset 1.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                        stroke 0.4s ease;
        }
        .recovery-ring-center {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) rotate(90deg);
            text-align: center;
        }
        .recovery-score-value {
            font-size: 32px;
            font-weight: 800;
            line-height: 1;
            color: var(--ap-text);
        }
        .recovery-score-label {
            font-size: 11px;
            font-weight: 600;
            color: var(--ap-text-muted);
            margin-top: 2px;
            letter-spacing: 0.5px;
        }
        .recovery-ring-details {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .recovery-ring-title {
            font-size: 16px;
            font-weight: 700;
            color: var(--ap-text);
        }
        .recovery-ring-subtitle {
            font-size: 13px;
            color: var(--ap-text-secondary);
            line-height: 1.4;
        }
        .recovery-ring-metrics {
            display: flex;
            gap: 16px;
        }
        .recovery-metric {
            display: flex;
            flex-direction: column;
        }
        .recovery-metric-value {
            font-family: 'Outfit', sans-serif;
            font-size: 18px;
            font-weight: 700;
            color: var(--ap-text);
            font-variant-numeric: tabular-nums;
        }
        .recovery-metric-label {
            font-size: 11px;
            color: var(--ap-text-muted);
        }

        @keyframes ringDraw {
            from { stroke-dashoffset: 282.74; }
        }

        /* ── Missing Keyframes ── */
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        @keyframes tabFadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* ── Coach Tooltip ── */
        .coach-tooltip {
            position: absolute;
            bottom: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            background: #1f2937;
            color: #fff;
            padding: 8px 14px;
            border-radius: 10px;
            font-size: 13px;
            font-weight: 600;
            white-space: nowrap;
            z-index: 100;
            animation: fadeIn 0.3s ease;
        }
        .coach-tooltip::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border: 6px solid transparent;
            border-top-color: #1f2937;
        }

        /* ── Profile Menu Items ── */
        .pm-item {
            display: flex;
            align-items: center;
            padding: 16px 20px;
            cursor: pointer;
            transition: background 0.15s;
            border-bottom: 1px solid var(--ap-border);
        }
        .pm-item:last-child { border-bottom: none; }
        .pm-item:active { background: rgba(0,0,0,0.03); }
        .pm-icon { font-size: 18px; width: 28px; text-align: center; margin-right: 12px; }
        .pm-label { flex: 1; font-size: 16px; font-weight: 500; color: var(--ap-text); }
        .pm-arrow { font-size: 18px; color: var(--ap-text-muted); }
        .pm-toggle { font-size: 13px; font-weight: 600; color: var(--ap-primary); }

        @keyframes slideInRight {
            from { transform: translateX(100%); }
            to { transform: translateX(0); }
        }
        @keyframes slideOutRight {
            from { transform: translateX(0); }
            to { transform: translateX(100%); }
        }


/* ═══════════════════════════════════════════════════════════
   HOME TAB — Stitch Design System Upgrade
   Principles: No-Line, Tonal Layering, Ambient Shadow
   ═══════════════════════════════════════════════════════════ */

/* ── Hero Section ── */
.home-hero {
    background: var(--ap-surface-1);
    border-radius: var(--ap-radius-lg);
    padding: 24px 20px 20px;
    margin-bottom: 16px;
    box-shadow: var(--ap-shadow-sm);
}
.home-hero__greeting {
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-text-muted);
    margin-bottom: 2px;
}
.home-hero__name {
    font-size: 24px;
    font-weight: 800;
    color: var(--ap-text);
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}
.home-hero__day-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--ap-gradient-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-left: 8px;
    vertical-align: middle;
}
.home-hero__journey {
    background: var(--ap-surface-2);
    border-radius: var(--ap-radius-md);
    padding: 14px;
    margin-top: 12px;
}
.home-hero__journey-bar {
    height: 6px;
    background: var(--ap-surface-0);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}
.home-hero__journey-fill {
    height: 100%;
    background: var(--ap-gradient-primary);
    border-radius: 3px;
    transition: width 0.8s ease;
}
.home-hero__journey-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ap-text-muted);
}
.home-hero__phase {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.home-hero__phase-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--ap-surface-0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: var(--ap-shadow-sm);
}
.home-hero__phase-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ap-text);
}
.home-hero__phase-desc {
    font-size: 12px;
    color: var(--ap-text-muted);
    margin-top: 1px;
}

/* ── Coach Message Card (Stitch) ── */
.home-coach {
    background: var(--ap-surface-1);
    border-radius: var(--ap-radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--ap-shadow-sm);
    position: relative;
    overflow: hidden;
}
.home-coach::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--ap-gradient-primary);
    border-radius: 4px 0 0 4px;
}
.home-coach__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.home-coach__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: var(--ap-shadow-sm);
    object-fit: contain;
    background: var(--ap-surface-2);
    padding: 4px;
}
.home-coach__label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ap-primary);
}
.home-coach__sublabel {
    font-size: 11px;
    color: var(--ap-text-muted);
}
.home-coach__body {
    background: var(--ap-surface-2);
    border-radius: var(--ap-radius-sm);
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--ap-text);
    margin-bottom: 14px;
}
.home-coach__confirm {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px;
    background: var(--ap-gradient-primary);
    color: #fff;
    border: none;
    border-radius: var(--ap-radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--ap-shadow-sm);
    transition: transform 0.15s, box-shadow 0.15s;
}
.home-coach__confirm:active {
    transform: scale(0.97);
    box-shadow: none;
}
.home-coach__confirm--done {
    background: var(--ap-surface-2);
    color: var(--ap-text-muted);
    box-shadow: none;
}

/* ── Recovery Ring Card (Stitch) ── */
.home-ring {
    background: var(--ap-surface-1);
    border-radius: var(--ap-radius-lg);
    padding: 24px 20px;
    margin-bottom: 16px;
    box-shadow: var(--ap-shadow-sm);
    text-align: center;
}
.home-ring__svg {
    width: 120px;
    height: 120px;
    margin: 0 auto 12px;
}
.home-ring__score {
    font-size: 36px;
    font-weight: 900;
    color: var(--ap-text);
    letter-spacing: -1px;
}
.home-ring__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ap-text);
    margin-top: 4px;
}
.home-ring__msg {
    font-size: 13px;
    color: var(--ap-text-secondary);
    margin-top: 4px;
}
.home-ring__metrics {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}
.home-ring__metric {
    background: var(--ap-surface-2);
    border-radius: 12px;
    padding: 8px 16px;
    text-align: center;
}
.home-ring__metric-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--ap-text);
    font-variant-numeric: tabular-nums;
}
.home-ring__metric-label {
    font-size: 11px;
    color: var(--ap-text-muted);
}

/* ── CTA Cards (Exercise + Learning) ── */
.home-cta {
    border-radius: var(--ap-radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--ap-shadow-md);
    position: relative;
    overflow: hidden;
}
.home-cta--exercise {
    background: linear-gradient(135deg, #0A6B6F 0%, #2DA89B 40%, #4DB8A4 100%);
    color: #fff;
}
.home-cta--learn {
    background: linear-gradient(135deg, #1A5068 0%, #1B5E7B 40%, #3D8FA0 100%);
    color: #fff;
}
.home-cta--success {
    background: linear-gradient(135deg, #236B3E, #2D8A4E, #4CAF6E);
}
.home-cta__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    margin-bottom: 10px;
}
.home-cta__title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}
.home-cta__desc {
    font-size: 13px;
    opacity: 0.85;
    line-height: 1.5;
    margin-bottom: 14px;
}
.home-cta__items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.home-cta__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}
.home-cta__item:active {
    transform: scale(0.98);
    background: rgba(255,255,255,0.18);
}
.home-cta__item--done {
    background: rgba(255,255,255,0.06);
    opacity: 0.7;
}
.home-cta__item-icon {
    font-size: 18px;
    flex-shrink: 0;
}
.home-cta__item-title {
    font-size: 14px;
    font-weight: 700;
}
.home-cta__item-desc {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.home-cta__item-xp {
    font-size: 12px;
    opacity: 0.5;
    flex-shrink: 0;
    margin-left: auto;
}
.home-cta__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 14px;
    background: rgba(255,255,255,0.95);
    color: var(--ap-primary);
    border: none;
    border-radius: var(--ap-radius-sm);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.15s, box-shadow 0.15s;
}
.home-cta__btn:active {
    transform: scale(0.97);
    box-shadow: none;
}
.home-cta__duration {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}
.home-cta__progress {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    opacity: 0.8;
    margin-left: auto;
}

/* ── Stagger Animation ── */
.home-stagger > * {
    opacity: 0;
    transform: translateY(12px);
    animation: homeStaggerIn 0.4s ease forwards;
}
.home-stagger > *:nth-child(1) { animation-delay: 0ms; }
.home-stagger > *:nth-child(2) { animation-delay: 80ms; }
.home-stagger > *:nth-child(3) { animation-delay: 160ms; }
.home-stagger > *:nth-child(4) { animation-delay: 240ms; }
.home-stagger > *:nth-child(5) { animation-delay: 320ms; }
.home-stagger > *:nth-child(6) { animation-delay: 400ms; }

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

/* ── Dark Mode Overrides ── */
[data-theme="dark"] .home-cta__btn {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
[data-theme="dark"] .home-cta__item {
    background: rgba(255,255,255,0.08);
}
[data-theme="dark"] .home-coach__body {
    background: var(--ap-surface-2);
}
