* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: linear-gradient(135deg, #764ba2 0%, #521193 100%);
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
        }

        .header {
            text-align: center;
            color: white;
            margin-bottom: 30px;
        }

        .header h1 {
        }

        .header .logo {
            height: 60px;
            width: 60px;
            vertical-align: middle;
            margin-right: 15px;
            filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.2));
            font-size: 36px;
            margin-bottom: 10px;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
        }

        .header p {
            font-size: 18px;
            opacity: 0.95;
        }

        .header .user-info {
            margin-top: 15px;
            font-size: 14px;
            opacity: 0.9;
        }

        .header .user-info button {
            background: rgba(255,255,255,0.2);
            border: none;
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            cursor: pointer;
            margin-left: 10px;
            transition: all 0.2s;
        }

        .header .user-info button:hover {
            background: rgba(255,255,255,0.3);
        }

        /* Book-Style Plan Viewer */
        .plan-book-nav {
            background: linear-gradient(135deg, #667eea, #764ba2);
            padding: 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            color: white;
        }

        .plan-book-nav h2 {
            margin: 0;
            font-size: 24px;
        }

        .plan-book-nav .nav-controls {
            display: flex;
            gap: 10px;
        }

        .nav-btn {
            background: rgba(255,255,255,0.2);
            border: none;
            color: white;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s;
        }

        .nav-btn:hover:not(:disabled) {
            background: rgba(255,255,255,0.3);
            transform: translateY(-2px);
        }

        .nav-btn:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }

        .plan-page-selector {
            background: #f8f9fa;
            padding: 20px;
            border-bottom: 2px solid #e0e0e0;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
        }

        .page-tab {
            padding: 12px 20px;
            background: white;
            border: 2px solid #e0e0e0;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: 600;
            color: #666;
            min-width: 120px;
            text-align: center;
        }

        .page-tab:hover {
            border-color: #667eea;
            color: #667eea;
            transform: translateY(-2px);
        }

        .page-tab.active {
            background: linear-gradient(135deg, #667eea, #764ba2);
            border-color: #667eea;
            color: white;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }

        .plan-page-content {
            padding: 40px;
            min-height: 500px;
            max-height: 600px;
            overflow-y: auto;
        }

        .week-page {
            background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
            padding: 30px;
            border-radius: 15px;
            border-left: 5px solid #667eea;
        }

        .week-page h2 {
            color: #667eea;
            margin-bottom: 20px;
            font-size: 28px;
        }

        .week-page .week-goal {
            background: #e3f2fd;
            padding: 15px;
            border-radius: 10px;
            margin-bottom: 20px;
            border-left: 4px solid #2196f3;
        }

        .workout-day {
            background: white;
            padding: 20px;
            margin-bottom: 15px;
            border-radius: 10px;
            border-left: 4px solid #764ba2;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

        .workout-day h4 {
            color: #764ba2;
            margin-bottom: 10px;
            font-size: 18px;
        }

        /* Plan content styling */
        .plan-content {
            background: #f8f9fa; /* Light gray background */
            border-radius: 10px;
            padding: 30px;
            line-height: 1.8;
            color: #333;
        }

        .plan-content h1 {
            color: #deefa5;
            margin-top: 30px;
            margin-bottom: 15px;
            font-size: 28px;
            border-bottom: 3px solid #667eea;
            padding-bottom: 10px;
        }

        .plan-content h2 {
            color: #deefa5;
            margin-top: 25px;
            margin-bottom: 15px;
            font-size: 22px;
            border-bottom: 2px solid #e0e0e0;
            padding-bottom: 8px;
        }

        .plan-content h3 {
            color: #deefa5;
            margin-top: 20px;
            margin-bottom: 10px;
            font-size: 18px;
        }

        .plan-content ul, .plan-content ol {
            margin-left: 30px;
            margin-bottom: 15px;
        }

        .plan-content li {
            margin-bottom: 8px;
            line-height: 1.6;
        }

        /* Navigation Tabs */
        .nav-tabs {
            display: flex;
            gap: 15px;
            margin-bottom: 30px;
            background: rgba(255, 255, 255, 0.1);
            padding: 10px;
            border-radius: 15px;
        }

        .nav-tab {
            flex: 1;
            padding: 15px 25px;
            border: none;
            border-radius: 10px;
            background: transparent;
            color: white;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .nav-tab:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .nav-tab.active {
            background: rgb(171, 245, 158);
            color: #667eea;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        }

        /* Sunrise/orange color for My Training Plans button (second nav-tab) */
        .nav-tab:nth-child(2) {
            background: linear-gradient(135deg, #f4a081 0%, #f5a64d 100%);
            color: white;
        }

        .nav-tab:nth-child(2):hover {
            background: linear-gradient(135deg, #eead62 0%, #f6ac91 100%);
            box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
        }

        .nav-tab:nth-child(2).active {
            background: linear-gradient(135deg, #f6ac91 0%, #eead62 100%);
            color: white;
            box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
        }

        .main-content {
            background: white;
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            overflow: hidden;
        }

        .tab-content {
            padding: 40px;
            display: none;
        }

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

        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            overflow-y: auto;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: white;
            padding: 40px;
            border-radius: 20px;
            max-width: 1100px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            margin: 20px;
        }

        .modal-content.small {
            max-width: 400px;
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 20px;
            border-bottom: 2px solid #e0e0e0;
        }

        .close-modal {
            background: none;
            border: none;
            font-size: 32px;
            color: #999;
            cursor: pointer;
            transition: color 0.2s;
            padding: 0;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .close-modal:hover {
            color: #333;
        }

        /* Dashboard Filter Tabs */
        .dashboard-filter-tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 30px;
            justify-content: center;
        }

        .filter-tab {
            padding: 12px 30px;
            background: white;
            border: 2px solid #e0e0e0;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: 600;
            color: #666;
        }

        .filter-tab:hover {
            border-color: #667eea;
            color: #667eea;
        }

        .filter-tab.active {
            background: linear-gradient(135deg, #667eea, #764ba2);
            border-color: #667eea;
            color: white;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }

        .filter-tab .count {
            display: inline-block;
            background: rgba(255,255,255,0.3);
            padding: 2px 8px;
            border-radius: 12px;
            margin-left: 8px;
            font-size: 12px;
        }

        /* Form Sections - Keep all your original styles */
        .form-section {
            background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
            border-radius: 20px;
            padding: 35px;
            margin-bottom: 30px;
            position: relative;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            transition: all 0.3s ease;
        }

        .form-section::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 6px;
            background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
        }

        .form-section:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
        }

        .section-header {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 25px;
            padding-bottom: 15px;
            border-bottom: 2px solid #e0e0e0;
        }

        .section-icon {
            width: 50px;
            height: 50px;
            border-radius: 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
        }

        .section-title h3 {
            margin: 0;
            font-size: 22px;
            font-weight: 700;
            background: linear-gradient(135deg, #667eea, #764ba2);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .section-title p {
            margin: 5px 0 0 0;
            font-size: 14px;
            color: #666;
        }

        .form-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
        }

        .form-group {
            position: relative;
        }

        .form-group label {
            display: block;
            font-weight: 600;
            color: #333;
            margin-bottom: 8px;
            font-size: 14px;
        }

        .form-group .required {
            color: #f44336;
            margin-left: 4px;
        }

        .form-group .hint {
            display: block;
            font-size: 12px;
            color: #999;
            font-weight: 400;
            margin-top: 3px;
        }

        .form-group input[type="text"],
        .form-group input[type="email"],
        .form-group input[type="number"],
        .form-group input[type="date"],
        .form-group select,
        .form-group textarea {
            width: 100%;
            padding: 14px 18px;
            border: 2px solid #e0e0e0;
            border-radius: 12px;
            font-size: 15px;
            font-family: inherit;
            transition: all 0.3s ease;
            background: white;
        }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
            transform: translateY(-2px);
        }

        .form-group textarea {
            resize: vertical;
            min-height: 100px;
        }

        .checkbox-group {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 12px;
            margin-top: 10px;
        }

        .info-card {
            background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
            padding: 20px;
            border-radius: 15px;
            margin-bottom: 20px;
            border-left: 5px solid #667eea;
        }

        .info-card h4 {
            margin: 0 0 10px 0;
            color: #667eea;
            font-size: 16px;
        }

        .info-card p {
            margin: 0;
            color: #666;
            font-size: 14px;
            line-height: 1.6;
        }

        /* Dashboard Styles */
        .user-profile-card {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            padding: 30px;
            border-radius: 15px;
            margin-bottom: 30px;
        }

        .user-profile-card h2 {
            margin-bottom: 20px;
            font-size: 28px;
        }

        .user-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .stat-box {
            background: rgba(255, 255, 255, 0.2);
            padding: 20px;
            border-radius: 10px;
            text-align: center;
        }

        .stat-box h3 {
            font-size: 32px;
            margin-bottom: 5px;
        }

        .stat-box p {
            font-size: 14px;
            opacity: 0.9;
        }

        .plans-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 25px;
            margin-top: 30px;
        }

        .plan-card {
            background: white;
            border: 2px solid #e0e0e0;
            border-radius: 15px;
            padding: 25px;
            transition: all 0.3s ease;
            position: relative;
        }

        .plan-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            border-color: #667eea;
        }

        .plan-card.active {
            border-color: #4caf50;
            border-width: 3px;
            background: linear-gradient(135deg, #e8f5e9, #f3e5f5);
        }

        .plan-badge {
            position: absolute;
            top: 15px;
            right: 15px;
            background: #4caf50;
            color: white;
            padding: 5px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
        }

        .plan-card h3 {
            color: #667eea;
            margin-bottom: 10px;
            font-size: 20px;
        }

        .plan-card p {
            color: #666;
            font-size: 14px;
            margin-bottom: 4px;
            line-height: 1.4;
        }

        .plan-actions {
            display: flex;
            gap: 10px;
            margin-top: 15px;
            flex-wrap: wrap;
        }

        .plan-action-btn {
            flex: 1;
            min-width: 100px;
            padding: 10px;
            border: none;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .plan-action-btn.primary {
            background: #667eea;
            color: white;
        }

        .plan-action-btn.secondary {
            background: #f0f0f0;
            color: #666;
        }

        .plan-action-btn.success {
            background: #4caf50;
            color: white;
        }

        .plan-action-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }

        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: #999;
        }

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

        /* Buttons */
        .button-group {
            display: flex;
            gap: 15px;
            justify-content: center;
            margin-top: 40px;
            flex-wrap: wrap;
        }

        .btn {
            padding: 18px 45px;
            border: none;
            border-radius: 50px;
            font-size: 17px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            gap: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .btn:hover:not(:disabled) {
            transform: translateY(-3px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
        }

        .btn-secondary {
            background: white;
            color: #efb349;
            border: 3px solid #ea8e66;
        }

        .btn-secondary:hover:not(:disabled) {
            background: #ea9d66;
            color: rgb(236, 166, 109);
        }

        .btn-success {
            background: #4caf50;
            color: white;
        }

        /* Chat Styles */
        .chat-container {
            max-height: 500px;
            overflow-y: auto;
            padding: 20px;
            background: #f8f9fa;
            border-radius: 15px;
            margin-bottom: 20px;
        }

        .chat-message {
            margin-bottom: 20px;
            animation: slideIn 0.3s ease;
        }

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

        .chat-message.user {
            text-align: right;
        }

        .message-bubble {
            display: inline-block;
            padding: 15px 20px;
            border-radius: 18px;
            max-width: 70%;
            line-height: 1.6;
        }

        .message-bubble.user {
            background: linear-gradient(135deg, #d9a641, #d9a641);
            color: rgb(245, 243, 240);
        }

        .message-bubble.agent {
            background: white;
            border: 1px solid #e0e0e0;
            color: #333;
        }

        .chat-input-container {
            background: white;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .chat-input-row {
            display: flex;
            gap: 10px;
        }

        .chat-input-row input {
            flex: 1;
            padding: 15px 20px;
            border: 2px solid #e0e0e0;
            border-radius: 25px;
            font-size: 15px;
        }

        .chat-input-row input:focus {
            outline: none;
            border-color: #667eea;
        }

        .quick-actions {
            display: flex;
            gap: 10px;
            justify-content: center;
            flex-wrap: wrap;
            margin-bottom: 15px;
        }

        .quick-action-btn {
            padding: 10px 24px;
            border: 2px solid #667eea;
            background: white;
            color: #667eea;
            border-radius: 20px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .quick-action-btn:hover {
            background: #667eea;
            color: white;
            transform: translateY(-2px);
        }

        .quick-action-btn.primary {
            background: #667eea;
            color: white;
        }

        /* Alert Boxes */
        .alert {
            padding: 20px;
            border-radius: 10px;
            margin-bottom: 20px;
        }

        .alert-warning {
            background: #fff3cd;
            border: 2px solid #ffc107;
            color: #856404;
        }

        .alert-danger {
            background: #ffebee;
            border: 2px solid #f44336;
            color: #c62828;
        }

        .alert-success {
            background: #e8f5e9;
            border: 2px solid #4caf50;
            color: #2e7d32;
        }

        /* Loading */
        .loading {
            text-align: center;
            padding: 40px;
        }

        .spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #667eea;
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

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

        /* Typing Indicator */
        .typing-indicator {
            display: none;
            padding: 15px 20px;
            background: white;
            border-radius: 18px;
            border: 1px solid #e0e0e0;
            max-width: 70px;
        }

        .typing-indicator.active {
            display: block;
        }

        .typing-indicator span {
            height: 10px;
            width: 10px;
            background: #667eea;
            border-radius: 50%;
            display: inline-block;
            margin: 0 2px;
            animation: typing 1.4s infinite;
        }

        .typing-indicator span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-indicator span:nth-child(3) {
            animation-delay: 0.4s;
        }

        @keyframes typing {
            0%, 60%, 100% {
                transform: translateY(0);
            }
            30% {
                transform: translateY(-10px);
            }
        }

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

        /* Responsive */
        @media (max-width: 768px) {
            .header h1 {
        }

        .header .logo {
            height: 60px;
            width: 60px;
            vertical-align: middle;
            margin-right: 15px;
            filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.2));
                font-size: 28px;
            }

            .form-section {
                padding: 25px 20px;
            }

            .tab-content {
                padding: 30px 20px;
            }

            .form-grid {
                grid-template-columns: 1fr;
            }

            .checkbox-group {
                grid-template-columns: 1fr;
            }

            .btn {
                width: 100%;
                justify-content: center;
            }

            .nav-tabs {
                flex-direction: column;
            }

            .plans-grid {
                grid-template-columns: 1fr;
            }

            .modal-content {
                padding: 25px;
                width: 95%;
            }

            .plan-action-btn {
                flex: 1 1 100%;
            }

            .plan-page-selector {
                overflow-x: auto;
                justify-content: flex-start;
            }
            
            .page-tab {
                min-width: 100px;
                font-size: 12px;
            }
        }
        /* Horizontal plan details layout */
        .plan-details-row {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            font-size: 13px;
            color: #555;
            margin-bottom: 8px;
        }

        .plan-details-row > span {
            white-space: nowrap;
        }

        .plan-details-row strong { 
            color: #333;
        }

        #errorNotification {
            padding: 15px 25px;
            border-radius: 10px;
            font-size: 16px;
            font-weight: 600;
            color: #721c24; /* Dark red text */
            background-color: #f8d7da; /* Light red background */
            border: 1px solid #f5c6cb; /* Red border */
        }

        /* --- RAG "Ask the Coach" Modal --- */
        .rag-modal {
            display: none;
            position: fixed;
            z-index: 2000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.5);
            backdrop-filter: blur(5px);
        }

        .rag-modal-content {
            background-color: #fefefe;
            margin: 10% auto;
            max-width: 600px;
            border-radius: 10px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.3);
            display: flex;
            flex-direction: column;
            max-height: 80vh;
        }

        .rag-modal-header {
            padding: 15px 20px;
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border-radius: 10px 10px 0 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .rag-modal-header h3 {
            margin: 0;
            font-size: 18px;
        }
        .rag-close-btn {
            background: none;
            border: none;
            color: white;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
            opacity: 0.8;
        }
        .rag-close-btn:hover {
            opacity: 1;
        }

        .rag-modal-body {
            padding: 20px;
            overflow-y: auto;
            flex: 1;
            min-height: 200px;
            background: #f9f9f9;
        }

        .rag-message {
            margin-bottom: 12px;
            padding: 10px 15px;
            border-radius: 8px;
            max-width: 85%;
            line-height: 1.5;
            font-size: 14px;
        }
        .rag-message.user {
            background: #e3f2fd;
            color: #333;
            margin-left: auto;
            text-align: right;
        }
        .rag-message.agent {
            background: #f1f1f1;
            color: #222;
            margin-right: auto;
        }
        .rag-message.loading {
            background: #f1f1f1;
            color: #777;
            font-style: italic;
            text-align: center;
            max-width: 100%;
        }
        .rag-message.error {
            background: #ffebee;
            color: #b71c1c;
            border: 1px solid #ef9a9a;
        }

        .rag-modal-footer {
            padding: 15px;
            border-top: 1px solid #e0e0e0;
            background: #fff;
            border-radius: 0 0 10px 10px;
            display: flex;
            gap: 10px;
        }
        #ragQueryInput {
            flex: 1;
            padding: 10px 12px;
            border: 1px solid #ccc;
            border-radius: 5px;
            font-size: 14px;
        }
        #sendRagQueryBtn {
            padding: 10px 15px;
            font-size: 14px;
            background: #667eea;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        #sendRagQueryBtn:disabled {
            background: #aaa;
            cursor: not-allowed;
        }
        /* In your style.css file */

        #ragBackBtn {
            padding: 10px 15px;
            font-size: 14px;
            background: #6c757d; /* A neutral gray */
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        #ragBackBtn:hover {
            background: #5a6268;
        }

        /* Update the disabled state to catch both buttons */
        #ragBackBtn:disabled,
        #sendRagQueryBtn:disabled {
            background: #aaa;
            cursor: not-allowed;
        }
        /* Add this to your style.css file */

        .brand-vit {
            letter-spacing: 1px;
            color: #f6c607; /* Yellow */
            font-weight: 700;
        }

        .brand-ai {
            letter-spacing: 1px;
            background: linear-gradient(90deg, #FFD93D, #f69953, #A3FF12);
            background-size: 200%;
            animation: aiGlow 3s linear infinite;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            }

            @keyframes aiGlow {
            0% { background-position: 0%; }
            100% { background-position: 200%; }
            }

        .brand-nspire {
            letter-spacing: 1px;
            color: #03f43b;
            font-weight: 700;
        }

        /* Style for RAG messages with markdown content */
        .rag-message.agent ul,
        .rag-message.agent ol {
            margin: 8px 0;
            padding-left: 24px;
            list-style-position: outside;
        }

        .rag-message.agent ul {
            list-style-type: disc;
        }

        .rag-message.agent li {
            margin: 3px 0;
            line-height: 1.6;
        }

        .rag-message.agent strong {
            color: #1a1a1a;
            font-weight: 600;
        }

        .rag-message.agent p {
            margin: 8px 0;
            line-height: 1.6;
        }

        /* Style for section headings (bold text followed by colon) */
        .rag-message.agent p strong {
            display: inline;
            margin-top: 12px;
            margin-bottom: 6px;
            font-size: 16px;
            color: #2563eb;
        }

        /* Ensure proper spacing between paragraphs and lists */
        .rag-message.agent p + ul,
        .rag-message.agent ul + p {
            margin-top: 12px;
        }

        /* Make warning/important text stand out */
        .rag-message.agent p:first-child strong {
            color: #dc2626;
        }

        /* Improve readability on mobile */
        @media (max-width: 768px) {
            .rag-message.agent ul,
            .rag-message.agent ol {
                padding-left: 20px;
            }
            
            .rag-message.agent li {
                margin: 6px 0;
            }
        }
        /* Styles for RAG elements: text, images, tables */
        /* Collapsible RAG Context */
        .rag-elements-container {
            margin-top: 15px;
            border: 1px solid #eee;
            border-radius: 8px;
            overflow: hidden;
        }

        .rag-elements-container h4 {
            background: #f5f5f5;
            padding: 10px 15px;
            margin: 0;
            font-size: 13px;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .rag-elements-container h4::after {
            content: '▼';
            font-size: 10px;
        }

        /* Initially hide the content elements */
        .rag-element {
            display: none; 
        }

        /* Class to toggle visibility via JS */
        .rag-elements-container.expanded .rag-element {
            display: block;
        }
        .rag-elements-container.expanded h4::after {
            content: '▲';
        }
        .rag-source {
            background: #f8f9fa;
            padding: 8px 12px;
            font-size: 13px;
            color: #555;
            border-bottom: 1px solid #ddd;
        }
        .rag-source strong {
            color: #000;
        }
        
        /* Text styling */
        .rag-text-container .rag-content {
            padding: 12px;
            margin: 0;
            font-size: 14px;
            line-height: 1.6;
            color: #333;
        }

        /* Image styling */
        .rag-image-wrapper {
            padding: 10px;
            background: #f0f0f0;
            text-align: center;
        }
        .rag-image-container img {
            max-width: 100%;
            height: auto;
            border-radius: 4px;
            border: 1px solid #ccc;
        }
        .rag-image-summary {
            padding: 12px;
            font-size: 14px;
            color: #333;
            margin: 0;
        }

        /* Table styling */
        .rag-table-container {
            padding: 12px;
            overflow-x: auto; /* Allows table to scroll horizontally if needed */
        }
        .rag-table-container table {
            width: 100%;
            border-collapse: collapse;
            font-size: 14px;
        }
        .rag-table-container th,
        .rag-table-container td {
            border: 1px solid #ddd;
            padding: 8px;
            text-align: left;
        }
        .rag-table-container th {
            background-color: #f2f2f2;
        }
        .skip-conversation-btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            transition: all 0.3s ease;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            margin-top: 10px;
        }

        .skip-conversation-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(0,0,0,0.15);
            background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
        }

        .skip-conversation-btn:active {
            transform: translateY(0);
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        #chatActions {
            margin-top: 15px;
            padding: 0 10px;
        }

        /* ============================================================================
        ONBOARDING SCREEN STYLES
        ============================================================================ */

        .onboarding-container {
            display: block;
            animation: fadeIn 1s ease-out 2s forwards;
            opacity: 1;
        }
        .onboarding-container.initial-load {
            animation: fadeIn 1s ease-out 2s forwards;
            opacity: 0;
        }
        .onboarding-container.visible {
            display: block !important;
            opacity: 1 !important;
            visibility: visible !important;
        }

        .onboarding-options {
            display: flex;  /* was grid */
            gap: 16px;  /* was 12px */
            margin: 20px auto;
            max-width: 1200px;
            overflow-x: auto;
            scroll-snap-type: x mandatory;
            padding: 20px 10px 40px;
            -webkit-overflow-scrolling: touch;
        }

        .onboarding-options::-webkit-scrollbar {
            height: 8px;
        }

        .onboarding-options::-webkit-scrollbar-track {
            background: rgba(255,255,255,0.1);
            border-radius: 10px;
        }

        .onboarding-options::-webkit-scrollbar-thumb {
            background: rgba(255,255,255,0.3);
            border-radius: 10px;
        }

        @media (max-width: 768px) {
            .onboarding-options {
                grid-template-columns: 1fr;
                gap: 20px;
            }
        }

        .option-card {
            flex: 0 0 calc(33.333% - 14px);
            min-width: 200px;
            max-width: 320px;
            background: white;
            border-radius: 14px;
            padding: 18px;
            scroll-snap-align: start;
            box-shadow: 0 6px 20px rgba(0,0,0,0.12);
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
        }

        .option-card:hover {
            transform: translateY(-5px) scale(1.02);
            box-shadow: 0 12px 32px rgba(0,0,0,0.2);
        }

        .option-card:hover::after {
            opacity: 1;
        }

        .option-card:active {
            transform: scale(0.98);
        }

        .option-icon {
            font-size: 32px;  /* was 48px or 20px */
            margin-bottom: 8px;  /* was 4px */
            display: block;
        }

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

        .option-badge {
            display: inline-block;
            background: #FFD93D;
            color: #333;
            font-size: 12px;  /* was 7px */
            font-weight: 700;
            padding: 3px 10px;  /* was 2px 6px */
            border-radius: 10px;  /* was 8px */
            margin-bottom: 8px;  /* was 3px */
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .option-title {
            font-size: 18px;  /* was 14px or 24px */
            font-weight: 700;
            color: #333;
            margin-bottom: 4px;  /* was 3px */
        }

        .option-description {
            font-size: 12px;  /* was 9px or 14px */
            color: #777;
            line-height: 1.4;  /* was 1.3 */
            margin-bottom: 10px;  /* was 5px */
        }

        .option-description {
            font-size: 14px;
            color: #4a5568;
            line-height: 1.7;
            margin-bottom: 25px;
            min-height: 60px;
            position: relative;
            z-index: 1;
        }

        .option-features {
            list-style: none;
            padding: 0;
            margin: 4px 0 24px 0;  /* added bottom margin */
            text-align: left;
        }

        .option-features li {
            font-size: 11px;  /* was 9px */
            color: #555;
            padding: 4px 0 4px 16px;  /* was 2px 0 2px 14px */
            position: relative;
            line-height: 1.3;
        }

        .option-features li::before {
            content: '•';  /* Simple bullet instead of ✓ */
            position: absolute;
            left: 4px;  /* was 0 */
            color: #667eea;
            font-weight: bold;
            font-size: 14px;
        }

        .option-card:hover .option-features li {
            padding-left: 35px;
        }

        .option-button {
            display: none !important;  /* Hide all option buttons */
        }

        .option-button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
            transition: left 0.5s ease;
        }

        .option-button:hover::before {
            left: 100%;
        }

        .option-button:hover {
            transform: scale(1.05);
            box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
        }

        .option-button:active {
            transform: scale(0.98);
        }

        /* ============================================================================
        SPECIAL STYLING FOR COACH CARD
        ============================================================================ */

        .option-card-coach .option-icon {
            animation: pulse 2s ease-in-out infinite;
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1) translateY(0px); }
            50% { transform: scale(1.1) translateY(-5px); }
        }


        /* ============================================================================
        FORM VISIBILITY HELPERS
        ============================================================================ */

        .form-section {
            transition: all 0.3s ease;
        }

        .form-section[style*="display: none"] {
            display: none !important;
        }

        .form-group {
            transition: all 0.3s ease;
        }

        .form-group[style*="display: none"] {
            display: none !important;
        }

        /* ============================================================================
        NAVIGATION TABS IMPROVEMENTS
        ============================================================================ */

        .nav-tabs {
            background: rgba(255, 255, 255, 0.15);
            border-radius: 15px;
            padding: 10px;
            display: flex;
            gap: 10px;
            margin-bottom: 30px;
            backdrop-filter: blur(10px);
            flex-wrap: wrap;
        }

        @media (max-width: 768px) {
            .nav-tabs {
                flex-direction: column;
            }
        }

        .nav-tab {
            flex: 1;
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            padding: 14px 20px;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s ease;
            font-weight: 600;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            min-width: 150px;
        }

        .nav-tab:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateY(-2px);
        }

        .nav-tab.active {
            background: white;
            color: #667eea;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }

        .nav-tab span:first-child {
            font-size: 20px;
        }

        /* ============================================================================
        MODAL IMPROVEMENTS
        ============================================================================ */

        .modal {
            display: none;
            position: fixed;
            z-index: 3000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(5px);
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.3s ease;
        }

        .modal-content {
            background: white;
            border-radius: 20px;
            padding: 40px;
            max-width: 500px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            animation: slideUp 0.4s ease;
            position: relative;
        }

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

        .modal-content.small {
            max-width: 450px;
        }

        .modal-header h2 {
            font-size: 28px;
            color: #2d3748;
            margin-bottom: 10px;
        }

        .close-modal {
            background: rgba(0, 0, 0, 0.1);
            border: none;
            color: #2d3748;
            font-size: 28px;
            line-height: 1;
            cursor: pointer;
            border-radius: 50%;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .close-modal:hover {
            background: rgba(0, 0, 0, 0.2);
            transform: rotate(90deg);
        }

        /* ============================================================================
        BUTTON STYLES
        ============================================================================ */

        .btn {
            padding: 14px 28px;
            border: none;
            border-radius: 30px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 15px;
            position: relative;
            overflow: hidden;
        }

        .btn-primary {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
        }

        .btn-secondary:hover {
            background: rgba(0, 0, 0, 0.1);
        }

        /* ============================================================================
        RESPONSIVE DESIGN
        ============================================================================ */

        @media (max-width: 768px) {
            .option-card {
                padding: 25px 20px;
            }
            
            .option-title {
                font-size: 22px;
            }
            
            .option-icon {
                font-size: 48px;
            }
            
            .option-description {
                font-size: 13px;
                min-height: auto;
            }
        }

        /* ============================================================================
        UTILITY CLASSES
        ============================================================================ */

        .full-width {
            grid-column: 1 / -1;
        }

        .hidden {
            display: none !important;
        }

        .visible {
            display: block !important;
        }

        /* ============================================================================
        ANIMATIONS
        ============================================================================ */

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

        @keyframes glowPulse {
            0%, 100% {
                text-shadow: 0 0 4px rgba(255, 243, 180, 0.5);
            }
            50% {
                text-shadow: 0 0 10px rgba(255, 243, 180, 0.9);
            }
        }

        /* Animated gradient for AI letters */
        @keyframes gradientShift {
            0% {
                background-position: 0% 50%;
            }
            50% {
                background-position: 100% 50%;
            }
            100% {
                background-position: 0% 50%;
            }
        }

        .brand-ai {
            background: linear-gradient(90deg, #FFD93D, #f69953, #A3FF12, #4ECDC4, #667eea, #FFD93D);
            background-size: 300% 100%;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            animation: gradientShift 3s ease-in-out infinite;
            font-weight: 800;
        }

        /* Force planOptions to be visible when it has .visible class */
        #planOptions.visible {
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
            min-height: 400px !important;
            position: relative !important;
            z-index: 100 !important;
            margin: 20px 0 !important;
        }

        /* Ensure all children of planOptions are visible */
        #planOptions.visible > * {
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
        }

        /* Make sure conversationSection doesn't hide its children */
        #conversationSection {
            position: relative !important;
        }

        /* Override any potential CSS that might be hiding these elements */
        #conversationSection[style*="display: block"] #planOptions {
            /* When parent is visible, planOptions should be controllable */
            position: relative;
        }
        /* Conversation Section Layout Fixes */
        #conversationSection {
            margin-top: 30px;
            padding: 20px;
            background: white;
            border-radius: 15px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        #conversationSection h2 {
            color: #667eea;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid #e0e0e0;
        }

        #safetyAlert {
            margin-bottom: 20px;
        }

        #chatMessages {
            min-height: 200px;
            max-height: 400px;
            overflow-y: auto;
            margin-bottom: 20px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 10px;
        }


        /* ✅ CRITICAL FIX: Improve chat input layout */
        #chatInputContainer {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 20px;
            padding: 15px;
            background: #ffffff;
            border-radius: 10px;
            border: 2px solid #e0e0e0;
        }

        #chatInput {
            width: 100%;
            padding: 12px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            font-size: 15px;
            resize: vertical;
            min-height: 60px;
        }

        #chatInput:focus {
            outline: none;
            border-color: #667eea;
        }

        /* Button row */
        #chatInputContainer .button-row {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }

        #sendChatBtn, #skipConversationBtn {
            padding: 10px 20px;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        #sendChatBtn {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
        }

        #sendChatBtn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        }

        #skipConversationBtn {
            background: #f0f0f0;
            color: #666;
        }

        #skipConversationBtn:hover {
            background: #e0e0e0;
            color: #333;
        }

        /* Plan options should be clearly separated */
        #planOptions {
            margin-top: 30px;
            padding: 20px;
        }
        .option-card:nth-child(1) .option-features li::before {
            color: #FF6B6B;  /* Quick Start - Red */
        }

        .option-card:nth-child(2) .option-features li::before {
            color: #4ECDC4;  /* Smart Fit - Teal */
        }

        .option-card:nth-child(3) .option-features li::before {
            color: #FFD93D;  /* Fully Yours - Yellow */
        }

        .option-card:nth-child(4) .option-features li::before {
            color: #A78BFA;  /* Saved Plans - Purple */
        }

        .option-card:nth-child(5) .option-features li::before {
            color: #F97316;  /* Ask Coach - Orange */
        }

        @media (max-width: 768px) {
            .onboarding-options {
                grid-template-columns: 1fr;
                gap: 20px;
                padding: 0 15px;
            }
            
            .option-card {
                padding: 28px 22px;
                min-height: 300px;
            }
            
            .option-icon {
                font-size: 52px;
            }
            
            .option-title {
                font-size: 20px;
            }
            
            .option-subtitle {
                font-size: 14px;
            }
            
            .option-description {
                font-size: 13px;
            }
            
            .option-features li {
                font-size: 12px;
                padding: 5px 0;
            }
        }

        @media (max-width: 480px) {
            .option-card {
                padding: 24px 18px;
                min-height: 280px;
            }
            
            .option-icon {
                font-size: 48px;
                margin-bottom: 12px;
            }
            
            .option-title {
                font-size: 19px;
            }
            
            .option-subtitle {
                font-size: 13px;
            }
            
            .option-description {
                font-size: 12px;
            }
            
            .option-features li {
                font-size: 11px;
            }
        }

        /* White background only when plan section is visible */
        #planSection:not([style*="display: none"]) {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgb(150, 154, 166);
            z-index: 999;
            overflow-y: auto;
            padding: 20px;
        }
    
        /* ========== PLAN ACTION BUTTONS STYLING ========== */

        /* Download PDF button - Green */
        .form-actions button:nth-child(1) {
            background: linear-gradient(135deg, #10b981, #059669) !important;
            color: white !important;
            border: none !important;
        }

        /* Email Plan button - Blue */
        .form-actions button:nth-child(2) {
            background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
            color: white !important;
            border: none !important;
        }

        /* Hover effects for both buttons */
        .form-actions button:nth-child(1):hover,
        .form-actions button:nth-child(2):hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0,0,0,0.2);
        }

        /* ============================================================================
        MOBILE UX FIXES
        ============================================================================ */

        /* 1. Prevent iOS Zoom on inputs */
        @media screen and (max-width: 768px) {
            input[type="text"],
            input[type="number"],
            input[type="email"],
            input[type="date"],
            input[type="tel"],
            select,
            textarea {
                font-size: 16px !important; /* Critical for iOS */
            }
        }

        /* 2. Increase Touch Targets for Buttons */
        .btn, 
        .nav-tab, 
        .option-card, 
        .inspiration-option {
            min-height: 48px; /* Recommended minimum touch target size */
            cursor: pointer;
        }

        /* 3. Safe Area Padding (for iPhone X/11/12/etc notches and home bars) */
        body {
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
            padding-bottom: env(safe-area-inset-bottom);
        }

        /* 4. Prevent Modal Scrolling Issues on Mobile */
        .modal {
            -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        }

        /* 5. Better Spacing for Mobile Cards */
        @media (max-width: 480px) {
            .option-card, .inspiration-card {
                margin-bottom: 15px;
                padding: 20px; /* slightly reduced padding */
            }
            
            /* Make headings smaller on small screens to prevent wrapping */
            h1 { font-size: 28px !important; }
            h2 { font-size: 24px !important; }
}

/* ============================================================================
   GENERATED PLAN BEAUTIFICATION
   ============================================================================ */

/* The main container for the plan */
#planContent.markdown-content {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #333;
    line-height: 1.7;
    font-size: 16px;
}

/* ---------------- HEADINGS ---------------- */

/* Main Title (e.g., "Marathon Plan") */
#planContent h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 32px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
    letter-spacing: -0.5px;
}

/* Week Headers (e.g., "Week 1") */
#planContent h2 {
    background: linear-gradient(to right, #f3f4f6, #ffffff);
    color: #4a5568;
    padding: 12px 15px;
    border-left: 5px solid #667eea;
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 22px;
    border-radius: 0 8px 8px 0;
}

/* Day/Section Headers (e.g., "Monday", "Nutrition") */
#planContent h3 {
    color: #764ba2;
    font-size: 18px;
    margin-top: 25px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

/* Add a bullet point before H3s for clarity */
#planContent h3::before {
    content: '•';
    color: #a0aec0;
    margin-right: 10px;
    font-size: 24px;
    line-height: 0;
}

/* ---------------- CONTENT & LISTS ---------------- */

/* Paragraphs */
#planContent p {
    margin-bottom: 15px;
    color: #4a5568;
}

/* Bold text (likely Key stats like distance/pace) */
#planContent strong {
    color: #2d3748;
    font-weight: 700;
    background: rgba(102, 126, 234, 0.1); /* Subtle highlight */
    padding: 0 4px;
    border-radius: 4px;
}

/* Lists (Workouts) */
#planContent ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 20px;
}

#planContent li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    color: #555;
}

/* Custom checkmark/bullet for lists */
#planContent li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* Blockquotes (often used for tips/rationale) */
#planContent blockquote {
    background: #fffaf0; /* Warm/paper background */
    border-left: 4px solid #ed8936; /* Orange accent */
    margin: 20px 0;
    padding: 15px 20px;
    font-style: italic;
    color: #7c5e43;
    border-radius: 4px;
}

/* ---------------- MOBILE ADJUSTMENTS ---------------- */
@media (max-width: 768px) {
    #planContent.markdown-content {
        padding: 20px;
    }
    #planContent h1 {
        font-size: 24px;
    }
    #planContent h2 {
        font-size: 18px;
    }
}

/* ============================================================================
   GENERATED PLAN BEAUTIFICATION (Magazine Style)
   ============================================================================ */

/* 1. Main Container */
#planContent {
    background: #ffffff;
    padding: 50px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    font-family: 'Segoe UI', 'Roboto', 'Helvetica', sans-serif;
    color: #333;
    line-height: 1.8;
    font-size: 16px;
    max-width: 900px;
    margin: 0 auto;
}

/* 2. Main Title (Plan Name) */
#planContent h1 {
    text-align: center;
    font-size: 36px;
    font-weight: 800;
    color: #2d3748;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    border: none; /* Reset default */
}

/* Subtitle/Intro text appearing right after H1 */
#planContent h1 + p {
    text-align: center;
    font-size: 18px;
    color: #718096;
    margin-bottom: 40px;
    border-bottom: 4px solid #667eea;
    display: inline-block;
    padding-bottom: 10px;
    width: 100%;
}

/* 3. Week Headers (The big dividers) */
#planContent h2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    margin-top: 50px;
    margin-bottom: 25px;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
}

#planContent h2::before {
    content: '📅';
    margin-right: 15px;
    font-size: 24px;
}

/* 4. Day Headers (Monday, Tuesday...) */
#planContent h3 {
    color: #2d3748;
    font-size: 19px;
    font-weight: 700;
    margin-top: 25px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #edf2f7;
}

/* 5. Workouts (Lists) */
#planContent ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

#planContent li {
    position: relative;
    padding: 15px 20px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 5px solid #cbd5e0; /* Default gray border */
    transition: transform 0.2s ease;
}

#planContent li:hover {
    transform: translateX(5px);
}

/* Dynamic Borders based on keywords (simulated via CSS) */
/* Note: Pure CSS can't read text content, so we use a generic nice style, 
   but if you wrapped types in classes via JS, you could color code them.
   For now, we stick to a clean default. */

#planContent li strong {
    color: #4a5568;
    font-weight: 800;
    display: block; /* Make bold text (like "Run:") stand on its own line if needed */
    margin-bottom: 4px;
}

/* 6. Nutrition & Rationale Boxes (Blockquotes) */
#planContent blockquote {
    background: #fffaf0; /* Creamy background */
    border-left: 5px solid #ed8936; /* Orange accent */
    margin: 20px 0;
    padding: 20px;
    border-radius: 0 8px 8px 0;
    color: #744210;
    font-style: normal; /* Reset italic */
    font-size: 15px;
}

#planContent blockquote strong {
    color: #c05621;
    display: inline;
}

/* 7. Mobile Optimization */
@media (max-width: 768px) {
    #planContent {
        padding: 25px;
    }
    #planContent h1 { font-size: 28px; }
    #planContent h2 { font-size: 18px; padding: 12px 15px; }
    #planContent li { padding: 12px 15px; }
}