/* ── Design Tokens ─────────────────────────────────────────────────────────── */

:root {
    /* Colors */
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-tertiary: #242837;
    --bg-card: #1e2233;
    --bg-card-hover: #252a3a;

    --text-primary: #e8eaf0;
    --text-secondary: #9ba3b5;
    --text-muted: #6b7280;

    --accent-primary: #6c5ce7;
    --accent-primary-hover: #7c6ff7;
    --accent-secondary: #00cec9;
    --accent-success: #00b894;
    --accent-warning: #fdcb6e;
    --accent-error: #e17055;

    --border-color: #2d3348;
    --border-light: #3d4460;

    /* Typography */
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Borders */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(108, 92, 231, 0.3);
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-primary-hover);
}

/* ── Navbar ───────────────────────────────────────────────────────────────── */

.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-md) var(--space-xl);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-logo:hover {
    color: var(--text-primary);
}

.logo-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 2px solid var(--accent-primary);
}

.nav-name {
    font-weight: 500;
    color: var(--text-primary);
}

.nav-xp {
    color: var(--accent-warning);
    font-weight: 600;
    font-size: 0.85rem;
}

.nav-plan {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-free {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.plan-pro {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    color: white;
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

/* ── Flash Messages ───────────────────────────────────────────────────────── */

.flash-container {
    max-width: 1200px;
    margin: var(--space-md) auto;
    padding: 0 var(--space-xl);
}

.flash {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: flashIn 0.3s ease;
}

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

.flash-success {
    background: rgba(0, 184, 148, 0.15);
    border: 1px solid var(--accent-success);
    color: var(--accent-success);
}

.flash-error {
    background: rgba(225, 112, 85, 0.15);
    border: 1px solid var(--accent-error);
    color: var(--accent-error);
}

.flash-info {
    background: rgba(108, 92, 231, 0.15);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.7;
}

.flash-close:hover {
    opacity: 1;
}

/* ── Main Content ─────────────────────────────────────────────────────────── */

.main-content {
    flex: 1;
}

/* ── Hero Section ─────────────────────────────────────────────────────────── */

.hero {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    background: radial-gradient(ellipse at center top, rgba(108, 92, 231, 0.15) 0%, transparent 60%);
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
}

.highlight {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    line-height: 1.7;
}

.google-btn {
    font-size: 1rem;
}

.google-icon {
    flex-shrink: 0;
}

/* ── Features Section ─────────────────────────────────────────────────────── */

.features {
    padding: var(--space-3xl) var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    text-align: center;
    transition: all 0.3s;
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: var(--space-sm);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ── Pricing Section ──────────────────────────────────────────────────────── */

.pricing {
    padding: var(--space-3xl) var(--space-xl);
    max-width: 900px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: var(--space-2xl);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    position: relative;
    transition: all 0.3s;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.pricing-featured {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: var(--radius-full);
    letter-spacing: 1px;
}

.pricing-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.pricing-header h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 800;
}

.pricing-price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.pricing-features {
    list-style: none;
    margin-bottom: var(--space-xl);
}

.pricing-features li {
    padding: var(--space-sm) 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: var(--space-xl);
}

.pricing-features li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--accent-success);
    font-weight: 700;
}

/* ── Landing FAQ ──────────────────────────────────────────────────────────── */

.faq {
    padding: var(--space-3xl) var(--space-xl);
    max-width: 800px;
    margin: 0 auto;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.faq .faq-item {
    padding: 0;
}

.faq .faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: var(--space-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq .faq-item summary::-webkit-details-marker {
    display: none;
}

.faq .faq-item summary::after {
    content: "+";
    color: var(--accent-primary);
    font-size: 1.25rem;
    line-height: 1;
}

.faq .faq-item[open] summary::after {
    content: "\2212";
}

.faq .faq-item p {
    padding: 0 var(--space-lg) var(--space-lg);
}

/* ── Dashboard ────────────────────────────────────────────────────────────── */

.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl);
}

.dash-welcome {
    margin-bottom: var(--space-2xl);
}

.dash-welcome-content {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.dash-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    border: 3px solid var(--accent-primary);
}

.dash-welcome h1 {
    font-size: 1.8rem;
    margin-bottom: var(--space-xs);
}

.dash-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.plan-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xp-badge {
    color: var(--accent-warning);
    font-weight: 600;
}

/* ── Stats Cards ──────────────────────────────────────────────────────────── */

.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: var(--space-xs);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Quick Actions ────────────────────────────────────────────────────────── */

.dash-actions h2 {
    font-size: 1.4rem;
    margin-bottom: var(--space-lg);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.action-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.action-disabled {
    opacity: 0.6;
    cursor: default;
}

.action-disabled:hover {
    transform: none;
    border-color: var(--border-color);
    background: var(--bg-card);
}

.action-icon {
    font-size: 2rem;
    margin-bottom: var(--space-md);
}

.action-card h3 {
    margin-bottom: var(--space-xs);
}

.action-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.action-badge {
    display: inline-block;
    margin-top: var(--space-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-warning);
    background: rgba(253, 203, 110, 0.1);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

/* ── Toast Notifications ──────────────────────────────────────────────────── */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    min-width: 300px;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.toast-error {
    border-color: var(--accent-error);
}

.toast-success {
    border-color: var(--accent-success);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

/* ── Course Form ──────────────────────────────────────────────────────────── */

.form-page {
    display: flex;
    justify-content: center;
    padding: var(--space-2xl) var(--space-xl);
}

.form-container {
    max-width: 600px;
    width: 100%;
}

.form-container h1 {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.form-subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
}

.course-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-family);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.form-group select {
    cursor: pointer;
}

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

/* ── Dashboard Courses ────────────────────────────────────────────────────── */

.dash-courses {
    margin-bottom: var(--space-2xl);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.section-header h2 {
    font-size: 1.4rem;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    transition: all 0.3s;
}

.course-card:hover {
    border-color: var(--border-light);
}

.course-card-link {
    display: block;
    color: var(--text-primary);
    text-decoration: none;
}

.course-card-link:hover {
    color: var(--text-primary);
}

.course-card-link h3 {
    margin-bottom: var(--space-sm);
}

.course-card-meta {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.course-card-meta span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.course-progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-top: var(--space-xs);
}

.course-completed-tag {
    display: inline-block;
    margin-top: var(--space-sm);
    color: var(--accent-success);
    font-weight: 600;
    font-size: 0.85rem;
}

/* Course generating state */
.course-generating {
    text-align: center;
    padding: var(--space-md) 0;
}

.course-generating h3 {
    margin: var(--space-md) 0 var(--space-sm);
}

.course-generating p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.course-gen-eta {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: calc(var(--space-sm) * -0.5);
    font-variant-numeric: tabular-nums;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.course-failed {
    text-align: center;
}

.fail-icon {
    font-size: 2rem;
}

.course-failed p {
    color: var(--accent-error);
    font-size: 0.85rem;
    margin-top: var(--space-sm);
}

.empty-state {
    text-align: center;
    padding: var(--space-3xl);
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: var(--space-lg);
}

/* ── Progress Bar ─────────────────────────────────────────────────────────── */

.progress-bar-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    height: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar-container.progress-sm {
    height: 6px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
    display: block;
}

/* ── Course View Page ─────────────────────────────────────────────────────── */

.course-page {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-xl);
}

.course-header {
    margin-bottom: var(--space-2xl);
}

.back-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: inline-block;
    margin-bottom: var(--space-md);
}

.course-header h1 {
    font-size: 2rem;
    margin-bottom: var(--space-md);
}

.course-meta {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}

.meta-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.status-active { color: var(--accent-success); }
.status-completed { color: var(--accent-secondary); }
.status-generating { color: var(--accent-warning); }
.status-failed { color: var(--accent-error); }

/* ── Module Cards ─────────────────────────────────────────────────────────── */

.modules-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.module-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.module-locked {
    opacity: 0.5;
}

.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    cursor: pointer;
    transition: background 0.2s;
}

.module-header:hover {
    background: var(--bg-card-hover);
}

.module-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.module-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.module-info h3 {
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.module-item-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.module-status {
    font-size: 1.2rem;
}

.chevron {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.module-expanded .chevron {
    transform: rotate(180deg);
}

/* Module items (collapsed by default) */
.module-items {
    display: none;
    border-top: 1px solid var(--border-color);
}

.module-expanded .module-items {
    display: block;
}

.module-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

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

.module-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.item-completed {
    opacity: 0.7;
}

.item-type-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.item-info {
    flex: 1;
}

.item-title {
    display: block;
    font-weight: 500;
}

.item-type {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.item-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.item-check {
    color: var(--accent-success);
    font-weight: 700;
}

.item-xp {
    font-size: 0.8rem;
    color: var(--accent-warning);
    font-weight: 600;
}

/* ── Content Pages (Lesson/Quiz/Project) ──────────────────────────────────── */

.content-page {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-xl);
}

.content-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
}

.content-breadcrumb a {
    color: var(--text-secondary);
}

.content-type-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-md);
}

.badge-lesson {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-primary);
}

.badge-quiz {
    background: rgba(0, 206, 201, 0.15);
    color: var(--accent-secondary);
}

.badge-project {
    background: rgba(253, 203, 110, 0.15);
    color: var(--accent-warning);
}

.content-layout h1 {
    font-size: 1.8rem;
    margin-bottom: var(--space-xl);
}

.content-error {
    background: rgba(225, 112, 85, 0.1);
    border: 1px solid var(--accent-error);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    color: var(--accent-error);
    text-align: center;
}

/* ── Lesson Content ───────────────────────────────────────────────────────── */

.lesson-section {
    margin-bottom: var(--space-2xl);
}

.lesson-section h2 {
    font-size: 1.3rem;
    margin-bottom: var(--space-md);
    color: var(--accent-secondary);
}

.lesson-body {
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-wrap;
}

.code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: var(--space-md);
}

.code-block-header {
    background: var(--bg-tertiary);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.code-block pre {
    padding: var(--space-md);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ── Code Editor ──────────────────────────────────────────────────────────── */

.editor-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: var(--space-lg);
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.code-editor {
    width: 100%;
    min-height: 200px;
}

/* CodeMirror overrides */
.CodeMirror {
    height: auto;
    min-height: 200px;
    max-height: 500px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.output-panel {
    border-top: 1px solid var(--border-color);
}

.output-header {
    background: var(--bg-tertiary);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.output-content {
    padding: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-height: 60px;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.output-content.output-error {
    color: var(--accent-error);
}

/* ── Exercise ─────────────────────────────────────────────────────────────── */

.lesson-exercise {
    margin-top: var(--space-2xl);
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--border-color);
}

.lesson-exercise h2 {
    color: var(--accent-warning);
    margin-bottom: var(--space-md);
}

.exercise-instructions {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.7;
}

.hints-container {
    margin-bottom: var(--space-lg);
}

.hints-list {
    display: none;
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.hints-visible {
    display: block;
}

.hint {
    color: var(--text-secondary);
    padding: var(--space-xs) 0;
    font-size: 0.9rem;
}

.expected-output {
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.expected-output strong {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.expected-output pre {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-success);
}

/* ── Content Navigation ───────────────────────────────────────────────────── */

.content-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-color);
}

.complete-btn {
    background: var(--accent-success);
}

.complete-btn:hover {
    background: #00d1a0;
    color: white;
    box-shadow: 0 0 20px rgba(0, 184, 148, 0.3);
}

.completed-badge {
    color: var(--accent-success);
    font-weight: 700;
    font-size: 1rem;
}

/* ── Quiz ─────────────────────────────────────────────────────────────────── */

.quiz-instructions {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.quiz-completed-banner {
    background: rgba(0, 184, 148, 0.1);
    border: 1px solid var(--accent-success);
    color: var(--accent-success);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xl);
    font-weight: 600;
}

.quiz-question {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.question-number {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    margin-bottom: var(--space-sm);
}

.question-text {
    font-size: 1.05rem;
    margin-bottom: var(--space-lg);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.option-label {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.option-label:hover {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.option-label input[type="radio"] {
    accent-color: var(--accent-primary);
}

.option-correct {
    border-color: var(--accent-success) !important;
    background: rgba(0, 184, 148, 0.1) !important;
}

.option-wrong {
    border-color: var(--accent-error) !important;
    background: rgba(225, 112, 85, 0.1) !important;
}

.question-result {
    margin-top: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.question-result.result-correct {
    background: rgba(0, 184, 148, 0.1);
    color: var(--accent-success);
}

.question-result.result-wrong {
    background: rgba(225, 112, 85, 0.1);
    color: var(--accent-error);
}

.quiz-submit-btn {
    margin-top: var(--space-md);
}

.quiz-results {
    margin-top: var(--space-xl);
    text-align: center;
}

.quiz-score h2 {
    margin-bottom: var(--space-md);
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    margin: 0 auto var(--space-md);
    border: 4px solid var(--accent-primary);
}

.score-circle.score-pass {
    border-color: var(--accent-success);
    color: var(--accent-success);
}

.score-circle.score-fail {
    border-color: var(--accent-error);
    color: var(--accent-error);
}

/* ── Project ──────────────────────────────────────────────────────────────── */

.project-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-xl);
    white-space: pre-wrap;
}

.project-requirements {
    margin-bottom: var(--space-xl);
}

.project-requirements h2 {
    font-size: 1.2rem;
    margin-bottom: var(--space-md);
    color: var(--accent-warning);
}

.project-requirements ul {
    list-style: none;
    padding: 0;
}

.project-requirements li {
    padding: var(--space-sm) 0;
    padding-left: var(--space-xl);
    position: relative;
    color: var(--text-secondary);
}

.project-requirements li::before {
    content: "\25B8";
    position: absolute;
    left: 0;
    color: var(--accent-warning);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.footer {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .nav-container {
        flex-direction: column;
        gap: var(--space-md);
    }

    .nav-user {
        flex-wrap: wrap;
        justify-content: center;
    }

    .dash-welcome-content {
        flex-direction: column;
        text-align: center;
    }

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

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .features-grid,
    .actions-grid,
    .dash-stats {
        grid-template-columns: 1fr;
    }
}


/* ══════════════════════════════════════════════════════════════════════════════
   PHASE 3 — XP / Levels / Profile / Rewards / Chat
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Nav Updates ──────────────────────────────────────────────────────────── */

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-profile-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    text-decoration: none;
    color: var(--text-primary);
}

.nav-profile-link:hover {
    color: var(--accent-primary);
}

.nav-level {
    font-size: 0.75rem;
    color: var(--accent-secondary);
    font-weight: 600;
}

/* ── Level Progress ──────────────────────────────────────────────────────── */

.level-badge {
    background: var(--accent-secondary);
    color: var(--bg-primary);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
}

.level-progress {
    margin-top: var(--space-sm);
    max-width: 400px;
}

.level-progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.level-progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* ── Profile Page ────────────────────────────────────────────────────────── */

.profile-page {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.profile-header {
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    margin-bottom: var(--space-xl);
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
}

.profile-header-content {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    object-fit: cover;
}

.profile-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
}

.profile-icon {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 1.5rem;
}

.profile-info h1 {
    margin: 0 0 var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.profile-badge {
    font-size: 1.2rem;
}

.profile-meta {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: wrap;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.profile-cosmetics {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.profile-cosmetics h2 {
    margin-bottom: var(--space-md);
}

.cosmetics-display {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.cosmetic-slot {
    flex: 1;
    min-width: 150px;
    text-align: center;
}

.cosmetic-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
}

.cosmetic-item {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.cosmetic-empty {
    padding: var(--space-sm) var(--space-md);
    color: var(--text-muted);
    font-style: italic;
}

.profile-courses {
    margin-bottom: var(--space-xl);
}

.profile-courses h2 {
    margin-bottom: var(--space-md);
}

/* ── Rewards Shop ────────────────────────────────────────────────────────── */

.rewards-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.rewards-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.rewards-header h1 {
    margin-bottom: var(--space-sm);
}

.rewards-balance {
    font-size: 1.2rem;
    color: var(--accent-secondary);
}

.rewards-section {
    margin-bottom: var(--space-2xl);
}

.rewards-section h2 {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}

.reward-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.reward-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.reward-card.reward-owned {
    border-color: var(--accent-success);
}

.reward-preview {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.reward-card h3 {
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.reward-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.reward-cost {
    font-weight: 700;
    color: var(--accent-warning);
    margin-bottom: var(--space-sm);
}

.btn-accent {
    background: var(--accent-secondary);
    color: var(--bg-primary);
    font-weight: 600;
}

.btn-accent:hover {
    filter: brightness(1.1);
}

.btn-disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.equip-btn.equipped {
    border-color: var(--accent-success);
    color: var(--accent-success);
}

.btn-danger-outline {
    border-color: var(--accent-error);
    color: var(--accent-error);
}

.btn-danger-outline:hover {
    background: var(--accent-error);
    color: white;
}

/* ── Cosmetic Previews (icons, badges, backgrounds) ──────────────────────── */

/* Badge cosmetics */
.cosmetic-badge-first-steps::before { content: "🌱"; }
.cosmetic-badge-quiz-master::before { content: "🧠"; }
.cosmetic-badge-code-warrior::before { content: "⚔️"; }
.cosmetic-badge-scholar::before { content: "🎓"; }
.cosmetic-badge-grandmaster::before { content: "👑"; }
.cosmetic-badge-legend::before { content: "🏆"; }

/* Icon cosmetics */
.cosmetic-icon-python::before { content: "🐍"; }
.cosmetic-icon-lightning::before { content: "⚡"; }
.cosmetic-icon-rocket::before { content: "🚀"; }
.cosmetic-icon-brain::before { content: "🧠"; }
.cosmetic-icon-crown::before { content: "👑"; }
.cosmetic-icon-diamond::before { content: "💎"; }

/* Background cosmetics */
.reward-preview.bg-midnight,
.bg-midnight { background: linear-gradient(135deg, #0c1445, #1a237e); }
.reward-preview.bg-sunset,
.bg-sunset { background: linear-gradient(135deg, #e65100, #ad1457); }
.reward-preview.bg-forest,
.bg-forest { background: linear-gradient(135deg, #1b5e20, #004d40); }
.reward-preview.bg-nebula,
.bg-nebula { background: linear-gradient(135deg, #4a148c, #880e4f); }
.reward-preview.bg-aurora,
.bg-aurora { background: linear-gradient(135deg, #006064, #1a237e, #4a148c); }
.reward-preview.bg-holographic,
.bg-holographic {
    background: linear-gradient(135deg, #ff0080, #7928ca, #0070f3, #00dfd8);
    background-size: 300% 300%;
    animation: holographic 4s ease infinite;
}

@keyframes holographic {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Default reward preview for badges/icons */
.reward-preview.cosmetic-badge-first-steps::before,
.reward-preview.cosmetic-badge-quiz-master::before,
.reward-preview.cosmetic-badge-code-warrior::before,
.reward-preview.cosmetic-badge-scholar::before,
.reward-preview.cosmetic-badge-grandmaster::before,
.reward-preview.cosmetic-badge-legend::before,
.reward-preview.cosmetic-icon-python::before,
.reward-preview.cosmetic-icon-lightning::before,
.reward-preview.cosmetic-icon-rocket::before,
.reward-preview.cosmetic-icon-brain::before,
.reward-preview.cosmetic-icon-crown::before,
.reward-preview.cosmetic-icon-diamond::before {
    font-size: 2.5rem;
}

/* ── Chat Home ───────────────────────────────────────────────────────────── */

.chat-home {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.chat-home-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.chat-home-header h1 {
    margin-bottom: var(--space-sm);
}

.chat-home-header p {
    color: var(--text-secondary);
}

.create-group-section {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.create-group-section h2 {
    margin-bottom: var(--space-md);
}

.create-group-form .form-row {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.create-group-form .form-input {
    flex: 1;
}

.chat-groups-section {
    margin-bottom: var(--space-2xl);
}

.chat-groups-section h2 {
    margin-bottom: var(--space-md);
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}

.group-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    transition: border-color 0.2s;
}

.group-card:hover {
    border-color: var(--accent-primary);
}

.group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.group-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.group-members-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.group-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.group-creator {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.group-card-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.inline-form {
    display: inline;
}

/* ── Chat Room ───────────────────────────────────────────────────────────── */

.chat-room-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px);
    max-width: 1100px;
    margin: 0 auto;
}

.chat-room-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.chat-room-info {
    flex: 1;
}

.chat-room-info h1 {
    font-size: 1.2rem;
    margin: 0;
}

.chat-room-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.chat-room-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.chat-msg {
    display: flex;
    gap: var(--space-sm);
    max-width: 80%;
}

.chat-msg-own {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg-avatar img,
.chat-msg-avatar .avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-placeholder {
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.chat-msg-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    min-width: 0;
}

.chat-msg-own .chat-msg-content {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.chat-msg-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-bottom: 2px;
}

.chat-msg-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent-secondary);
    text-decoration: none;
}

.chat-msg-name:hover {
    text-decoration: underline;
}

.chat-msg-own .chat-msg-name {
    color: rgba(255, 255, 255, 0.8);
}

.chat-msg-level {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.chat-msg-own .chat-msg-level {
    color: rgba(255, 255, 255, 0.6);
}

.chat-msg-badge {
    font-size: 0.8rem;
}

.chat-msg-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
}

.chat-msg-own .chat-msg-time {
    color: rgba(255, 255, 255, 0.5);
}

.chat-msg-body {
    font-size: 0.9rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chat-notice {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: var(--space-xs);
}

/* Members Panel */
.chat-members-panel {
    width: 220px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: var(--space-md);
    overflow-y: auto;
    display: none;
}

.chat-members-panel.panel-open {
    display: block;
}

.chat-members-panel h3 {
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
    color: var(--text-muted);
    text-transform: uppercase;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.member-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.member-item:hover {
    background: var(--bg-tertiary);
}

.member-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.member-info {
    display: flex;
    flex-direction: column;
}

.member-name {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.member-level {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Chat Input */
.chat-input-area {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.chat-input-form {
    display: flex;
    gap: var(--space-sm);
}

.chat-text-input {
    flex: 1;
}

/* ── Nav Upgrade Link ────────────────────────────────────────────────────── */

.nav-upgrade {
    color: var(--accent-secondary) !important;
    font-weight: 700;
    border: 1px solid var(--accent-secondary);
    border-radius: var(--radius-sm);
    padding: 4px 12px !important;
    transition: background 0.2s, color 0.2s;
}

.nav-upgrade:hover {
    background: var(--accent-secondary);
    color: var(--bg-primary) !important;
}

/* ── Subscribe Page ─────────────────────────────────────────────────────── */

.subscribe-page {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.subscribe-hero {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.subscribe-hero h1 {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.text-accent {
    color: var(--accent-secondary);
}

.subscribe-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Plans Comparison */
.plans-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.plan-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}

.plan-card:hover {
    transform: translateY(-4px);
}

.plan-card-pro {
    border-color: var(--accent-secondary);
}

.plan-popular-tag {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-secondary);
    color: var(--bg-primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 16px;
    border-radius: 999px;
}

.plan-card-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.plan-card-header h2 {
    margin-bottom: var(--space-sm);
    font-size: 1.5rem;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.price-period {
    font-size: 1rem;
    color: var(--text-muted);
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-lg);
}

.plan-features li {
    padding: var(--space-xs) 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.feature-icon {
    font-size: 1rem;
    min-width: 20px;
    text-align: center;
}

.plan-features li .feature-icon {
    color: var(--success);
}

.feature-disabled {
    color: var(--text-muted);
}

.feature-disabled .feature-icon {
    color: var(--text-muted) !important;
}

.plan-current-badge {
    text-align: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.1rem;
}

.btn-accent {
    background: var(--accent-secondary);
    color: var(--bg-primary);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-accent:hover {
    opacity: 0.9;
}

.btn-danger {
    background: var(--error);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-danger:hover {
    opacity: 0.9;
}

/* FAQ */
.subscribe-faq {
    margin-bottom: var(--space-2xl);
}

.subscribe-faq h2 {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.faq-item h3 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

.faq-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Manage Subscription Page ───────────────────────────────────────────── */

.manage-sub-page {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.manage-sub-page h1 {
    margin-bottom: var(--space-lg);
}

.sub-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.sub-active {
    border-color: var(--success);
}

.sub-cancelled {
    border-color: var(--warning, #f59e0b);
}

.sub-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.sub-plan-name {
    font-size: 1.3rem;
    font-weight: 700;
}

.sub-status {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
}

.sub-status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.sub-status-cancelled {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.sub-status-free {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.sub-details {
    margin-bottom: var(--space-md);
}

.sub-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

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

.sub-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.sub-value {
    font-size: 0.9rem;
    font-weight: 600;
}

.sub-id {
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sub-actions {
    margin-top: var(--space-md);
}

.sub-back {
    margin-top: var(--space-md);
}

/* Action card upgrade highlight */
.action-upgrade {
    border: 2px solid var(--accent-secondary) !important;
}

.action-upgrade:hover {
    background: rgba(251, 191, 36, 0.08) !important;
}

/* ── Responsive for Phase 4 ──────────────────────────────────────────────── */

@media (max-width: 768px) {
    .plans-comparison {
        grid-template-columns: 1fr;
    }

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

    .sub-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ── Responsive for Phase 3 ──────────────────────────────────────────────── */

@media (max-width: 768px) {
    .profile-header-content {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .cosmetics-display {
        flex-direction: column;
    }

    .rewards-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .create-group-form .form-row {
        flex-direction: column;
    }

    .chat-msg {
        max-width: 95%;
    }

    .chat-members-panel {
        position: fixed;
        right: 0;
        top: 0;
        height: 100%;
        z-index: 100;
        box-shadow: var(--shadow-lg);
    }
}

/* ── LearnForge Multi-File IDE ─────────────────────────────────────────────────
   Inspired by VS Code's three-column layout but rebranded with the LearnForge
   violet / teal accents, rounded corners, and a custom title bar across the top.
   Layout:
       [    title bar (full width)                         ]
       [ act | sidebar | tabs / editor / toolbar / output ]
       [    status bar (full width)                        ]
   ─────────────────────────────────────────────────────────────────────────── */

:root {
    --lfi-bg-editor:    #1a1a24;
    --lfi-bg-sidebar:   #20202c;
    --lfi-bg-tabs:      #262633;
    --lfi-bg-activity:  #1a1a24;
    --lfi-bg-titlebar:  #16161e;
    --lfi-bg-panel:     #15151d;
    --lfi-bg-input:     #2a2a38;
    --lfi-border:       #2e2e3e;
    --lfi-border-soft:  #25252f;
    --lfi-fg:           #d6d6e0;
    --lfi-fg-muted:     #8a8aa0;
    --lfi-fg-strong:    #ffffff;
    --lfi-violet:       #6c5ce7;
    --lfi-violet-hi:    #8475ee;
    --lfi-teal:         #00cec9;
    --lfi-grad:         linear-gradient(135deg, #6c5ce7, #00cec9);
    --lfi-stderr:       #ff6b6b;
    --lfi-stdout:       #d6d6e0;
    --lfi-stdin:        #00cec9;
    --lfi-info:         #6e6e80;
    --lfi-mono:         "Cascadia Code", "JetBrains Mono", "Fira Code",
                         Consolas, "Courier New", monospace;
    --lfi-ui:           -apple-system, BlinkMacSystemFont, "Segoe UI",
                         system-ui, sans-serif;
}

.lf-ide {
    /* Break out of content-page's narrow max-width and center over viewport. */
    width: min(96vw, 1500px);
    margin-left: 50%;
    transform: translateX(-50%);
    margin-top: 1.75rem;

    display: grid;
    grid-template-columns: 56px 260px 1fr;
    grid-template-rows: 36px 1fr 26px;
    border: 1px solid var(--lfi-border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--lfi-bg-editor);
    min-height: 760px;
    font-family: var(--lfi-ui);
    color: var(--lfi-fg);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45),
                0 0 0 1px rgba(108, 92, 231, 0.08);
    position: relative;
}

/* ── Title bar (full-width, brand gradient stripe + window dots) ──────────── */

.lf-ide-titlebar {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.9rem;
    background: var(--lfi-bg-titlebar);
    border-bottom: 1px solid var(--lfi-border-soft);
    font-size: 0.78rem;
    color: var(--lfi-fg-muted);
    user-select: none;
    position: relative;
}

.lf-ide-titlebar::before {
    /* Slim brand-gradient accent at the very top of the IDE chrome */
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--lfi-grad);
}

.lf-title-dots {
    display: flex;
    gap: 6px;
    margin-right: 0.5rem;
}

.lf-title-dots span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #2e2e3e;
}

.lf-title-dots span:nth-child(1) { background: #ff6b6b; }
.lf-title-dots span:nth-child(2) { background: #fdcb6e; }
.lf-title-dots span:nth-child(3) { background: #00cec9; }

.lf-title-brand {
    font-weight: 600;
    color: var(--lfi-fg);
    letter-spacing: 0.02em;
}

.lf-title-brand b {
    background: var(--lfi-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lf-title-meta {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--lfi-fg-muted);
    font-family: var(--lfi-mono);
}

/* ── Activity bar (vertical icon strip with brand-violet active indicator) ── */

.lf-ide-activitybar {
    background: var(--lfi-bg-activity);
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.7rem 0;
    gap: 0.35rem;
    border-right: 1px solid var(--lfi-border-soft);
}

.lf-act-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lfi-fg-muted);
    font-size: 1.25rem;
    cursor: default;
    border-radius: 8px;
    position: relative;
    transition: color 0.15s, background 0.15s;
    user-select: none;
}

.lf-act-icon:hover { color: var(--lfi-fg-strong); background: rgba(108, 92, 231, 0.10); }
.lf-act-icon.active {
    color: var(--lfi-fg-strong);
    background: rgba(108, 92, 231, 0.15);
}
.lf-act-icon.active::before {
    content: '';
    position: absolute;
    left: -8px; top: 8px; bottom: 8px;
    width: 3px;
    border-radius: 2px;
    background: var(--lfi-grad);
}

/* ── Sidebar (file explorer) ──────────────────────────────────────────────── */

.lf-ide-sidebar {
    background: var(--lfi-bg-sidebar);
    grid-column: 2;
    grid-row: 2;
    border-right: 1px solid var(--lfi-border-soft);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lf-ide-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--lfi-fg-muted);
    flex-shrink: 0;
}

.lf-new-file-btn {
    background: rgba(108, 92, 231, 0.12);
    border: none;
    color: var(--lfi-fg);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.lf-new-file-btn:hover { background: var(--lfi-violet); color: #fff; }

.lf-file-tree {
    list-style: none;
    padding: 0.25rem 0.4rem 0.5rem;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}

.lf-file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    font-size: 0.84rem;
    color: var(--lfi-fg);
    position: relative;
    line-height: 1.5;
    border-radius: 6px;
    margin-bottom: 1px;
    transition: background 0.1s, color 0.1s;
}

.lf-file-item:hover  { background: rgba(108, 92, 231, 0.08); }
.lf-file-item.active {
    background: rgba(108, 92, 231, 0.18);
    color: var(--lfi-fg-strong);
}
.lf-file-item.active::before {
    content: '';
    position: absolute;
    left: -0.4rem; top: 6px; bottom: 6px;
    width: 3px;
    border-radius: 2px;
    background: var(--lfi-grad);
}

.lf-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-file-icon { font-size: 0.95rem; flex-shrink: 0; }

.lf-delete-file {
    background: none;
    border: none;
    color: var(--lfi-fg-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
    opacity: 0;
    border-radius: 4px;
    transition: opacity 0.1s, background 0.1s, color 0.1s;
}

.lf-file-item:hover .lf-delete-file { opacity: 1; }
.lf-delete-file:hover { color: #ff6b6b; background: rgba(255, 107, 107, 0.12); }

/* ── Main editor area ─────────────────────────────────────────────────────── */

.lf-ide-main {
    grid-column: 3;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--lfi-bg-editor);
}

.lf-ide-tabs {
    display: flex;
    background: var(--lfi-bg-tabs);
    border-bottom: 1px solid var(--lfi-border-soft);
    overflow-x: auto;
    flex-shrink: 0;
    height: 38px;
    padding: 0 0.5rem;
    gap: 2px;
}

.lf-ide-tabs::-webkit-scrollbar { height: 0; }

.lf-tab {
    background: transparent;
    border: none;
    color: var(--lfi-fg-muted);
    padding: 0 1.1rem;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    border-radius: 6px 6px 0 0;
}

.lf-tab:hover { color: var(--lfi-fg-strong); background: rgba(255, 255, 255, 0.03); }
.lf-tab.active {
    background: var(--lfi-bg-editor);
    color: var(--lfi-fg-strong);
}
.lf-tab.active::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: var(--lfi-grad);
    border-radius: 2px 2px 0 0;
}

.lf-ide-editor-wrap {
    flex: 1;
    overflow: hidden;
    min-height: 420px;
    background: var(--lfi-bg-editor);
}

.lf-ide-editor-wrap .CodeMirror {
    height: 100%;
    min-height: 420px;
    font-size: 0.95rem;
    font-family: var(--lfi-mono);
    background: var(--lfi-bg-editor);
    color: var(--lfi-fg);
    line-height: 1.6;
}

.lf-ide-editor-wrap .CodeMirror-gutters {
    background: var(--lfi-bg-editor);
    border-right: 1px solid var(--lfi-border-soft);
    padding-right: 10px;
}

.lf-ide-editor-wrap .CodeMirror-linenumber { color: #4a4a5e; font-size: 0.85rem; }
.lf-ide-editor-wrap .CodeMirror-cursor { border-left-color: var(--lfi-teal); border-left-width: 2px; }
.lf-ide-editor-wrap .CodeMirror-selected { background: rgba(108, 92, 231, 0.25) !important; }

.lf-editor-textarea { display: none; }

/* ── Toolbar (gradient Run button) ────────────────────────────────────────── */

.lf-ide-toolbar {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 1rem;
    background: var(--lfi-bg-sidebar);
    border-top: 1px solid var(--lfi-border-soft);
    border-bottom: 1px solid var(--lfi-border-soft);
    flex-shrink: 0;
}

.lf-run-btn {
    background: var(--lfi-grad) !important;
    background-size: 200% 200% !important;
    border: none !important;
    color: #fff !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    padding: 0.45rem 1.2rem !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: background-position 0.3s, box-shadow 0.15s, transform 0.05s !important;
    box-shadow: 0 2px 10px rgba(108, 92, 231, 0.35) !important;
}
.lf-run-btn:hover  { background-position: 100% 100% !important; box-shadow: 0 3px 14px rgba(108, 92, 231, 0.45) !important; }
.lf-run-btn:active { transform: translateY(1px) !important; }

.lf-stop-btn {
    background: #ff6b6b;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    padding: 0.45rem 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.35);
}
.lf-stop-btn:hover { background: #ff8585; }

.lf-run-status {
    font-size: 0.78rem;
    color: var(--lfi-fg-muted);
    font-family: var(--lfi-mono);
}

/* ── Output panel (terminal / preview / visual) ───────────────────────────── */

.lf-ide-output-wrap {
    background: var(--lfi-bg-panel);
    max-height: 340px;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--lfi-border-soft);
}

.lf-output-tabs {
    display: flex;
    background: var(--lfi-bg-sidebar);
    border-bottom: 1px solid var(--lfi-border-soft);
    height: 34px;
    flex-shrink: 0;
    padding: 0 0.4rem;
    gap: 4px;
}

.lf-out-tab {
    background: none;
    border: none;
    color: var(--lfi-fg-muted);
    padding: 0 0.9rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    transition: color 0.1s, background 0.1s;
    border-radius: 6px 6px 0 0;
}

.lf-out-tab:hover { color: var(--lfi-fg-strong); background: rgba(255,255,255,0.03); }
.lf-out-tab.active { color: var(--lfi-fg-strong); }
.lf-out-tab.active::after {
    content: '';
    position: absolute;
    left: 0.5rem; right: 0.5rem; bottom: -1px;
    height: 2px;
    background: var(--lfi-grad);
    border-radius: 2px 2px 0 0;
}

.lf-output-panel { flex: 1; overflow: auto; background: var(--lfi-bg-panel); }

.lf-term-output {
    margin: 0;
    padding: 0.85rem 1rem;
    font-family: var(--lfi-mono);
    font-size: 0.85rem;
    color: var(--lfi-stdout);
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 100px;
    line-height: 1.6;
}

.lf-term-stdout { color: var(--lfi-stdout); }
.lf-term-stderr { color: var(--lfi-stderr); }
.lf-term-stdin  { color: var(--lfi-stdin); font-style: italic; }
.lf-term-info   { color: var(--lfi-info); }

.lf-preview-frame {
    width: 100%;
    height: 340px;
    border: none;
    background: white;
}

.lf-plots-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.6rem;
    background: var(--lfi-bg-panel);
}

.lf-plot-img {
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid var(--lfi-border);
}

/* ── Terminal input (interactive stdin) ───────────────────────────────────── */

.lf-term-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem;
    background: var(--lfi-bg-input);
    border-top: 1px solid var(--lfi-border-soft);
}

.lf-term-prompt {
    color: var(--lfi-teal);
    font-family: var(--lfi-mono);
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
    user-select: none;
}

.lf-term-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--lfi-fg-strong);
    font-family: var(--lfi-mono);
    font-size: 0.9rem;
    padding: 0.2rem 0;
    caret-color: var(--lfi-teal);
}

.lf-term-input::placeholder { color: #5a5a72; font-style: italic; }

/* ── CLI mode terminal header ─────────────────────────────────────────────── */

.lf-terminal-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.45rem 1rem;
    background: var(--lfi-bg-sidebar);
    border-bottom: 1px solid var(--lfi-border-soft);
    height: 34px;
    flex-shrink: 0;
}

.lf-terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lf-terminal-dot:nth-child(1) { background: #ff6b6b; }
.lf-terminal-dot:nth-child(2) { background: #fdcb6e; }
.lf-terminal-dot:nth-child(3) { background: var(--lfi-teal); }

.lf-terminal-title {
    font-size: 0.7rem;
    color: var(--lfi-fg-muted);
    font-weight: 700;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* CLI mode — taller terminal */
.lf-ide--cli .lf-ide-output-wrap { max-height: 420px; min-height: 320px; }
.lf-ide--cli .lf-term-output     { min-height: 240px; }

/* Hybrid mode (python/java/matlab/r) */
.lf-ide--hybrid .lf-ide-output-wrap { max-height: 380px; }

.lf-visual-panel {
    flex: 1;
    overflow: auto;
    background: var(--lfi-bg-panel);
}

/* Preview mode (html/css/js/ts/php/react) */
.lf-ide--preview .lf-ide-output-wrap { max-height: 560px; min-height: 360px; }
.lf-ide--preview .lf-preview-frame   { height: 520px; }
.lf-ide--preview .lf-term-output     { min-height: 80px; }

/* ── Status bar (full-width brand gradient) ───────────────────────────────── */

.lf-ide-statusbar {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--lfi-grad);
    color: #ffffff;
    height: 26px;
    padding: 0 1rem;
    font-size: 0.72rem;
    font-family: var(--lfi-ui);
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.lf-status-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    height: 100%;
    padding: 0 0.6rem;
    cursor: default;
    border-radius: 4px;
    transition: background 0.1s;
}

.lf-status-item:hover { background: rgba(255, 255, 255, 0.12); }
.lf-status-item.lf-status-spacer { flex: 1; }
.lf-status-item.lf-status-spacer:hover { background: transparent; }
.lf-status-item.lf-status-lang { font-weight: 700; text-transform: uppercase; }

/* ── Mobile / narrow ──────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .lf-ide {
        width: calc(100vw - 2rem);
        grid-template-columns: 1fr;
        grid-template-rows: 36px auto auto 1fr 26px;
        min-height: 600px;
    }
    .lf-ide-titlebar    { grid-column: 1; grid-row: 1; }
    .lf-ide-activitybar { display: none; }
    .lf-ide-sidebar     { grid-column: 1; grid-row: 2; max-height: 140px; border-right: none; border-bottom: 1px solid var(--lfi-border-soft); }
    .lf-ide-main        { grid-column: 1; grid-row: 3 / 5; }
    .lf-ide-statusbar   { grid-column: 1; grid-row: 5; }
    .lf-file-tree       { display: flex; flex-wrap: wrap; flex-direction: row; padding: 0.3rem; }
    .lf-file-item       { padding: 0.25rem 0.6rem; }
    .lf-ide--preview .lf-preview-frame { height: 320px; }
}

/* ---- SEO / marketing pages (course landings, hub, blog) ---- */

.seo-page {
    max-width: 820px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-xl) var(--space-3xl);
}

.seo-draft-banner {
    background: rgba(253, 203, 110, 0.1);
    border: 1px solid var(--accent-warning);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-xl);
    color: var(--accent-warning);
    font-size: 0.9rem;
    line-height: 1.6;
}

.seo-draft-banner code {
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.3);
    padding: 0.1em 0.35em;
    border-radius: var(--radius-sm);
}

.seo-draft-tag {
    display: inline-block;
    vertical-align: middle;
    margin-left: var(--space-sm);
    padding: 0.15em 0.5em;
    border-radius: var(--radius-full);
    background: rgba(253, 203, 110, 0.15);
    border: 1px solid var(--accent-warning);
    color: var(--accent-warning);
    font-size: 0.65rem;
    letter-spacing: 0.05em;
}

.seo-breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.seo-breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.seo-breadcrumb a:hover { color: var(--accent-primary); }

.seo-hero { margin-bottom: var(--space-3xl); }

.seo-eyebrow {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.seo-chip {
    padding: 0.25em 0.75em;
    border-radius: var(--radius-full);
    background: rgba(108, 92, 231, 0.15);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    font-size: 0.8rem;
    font-weight: 600;
}

.seo-chip-muted {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
}

.seo-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
}

.seo-intro {
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.seo-cta-note {
    margin-top: var(--space-md);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.seo-section { margin-bottom: var(--space-3xl); }

.seo-section h2 {
    font-size: 1.6rem;
    margin-bottom: var(--space-md);
}

.seo-section-note {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.seo-tag-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.seo-tag {
    padding: 0.35em 0.85em;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.seo-curriculum {
    list-style: none;
    counter-reset: seo-module;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.seo-module {
    counter-increment: seo-module;
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg) var(--space-lg) var(--space-lg) var(--space-3xl);
}

.seo-module::before {
    content: counter(seo-module);
    position: absolute;
    left: var(--space-lg);
    top: var(--space-lg);
    width: 1.6rem;
    height: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.seo-module-title { font-size: 1.05rem; margin-bottom: var(--space-sm); }
.seo-module-detail { color: var(--text-secondary); line-height: 1.7; font-size: 0.95rem; }

.seo-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-md);
}

.seo-related-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.seo-related-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.seo-related-reason {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
    font-weight: 600;
}

.seo-related-title { color: var(--text-primary); font-weight: 600; line-height: 1.4; }
.seo-related-meta { font-size: 0.8rem; color: var(--text-muted); }

.seo-link-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-sm); }
.seo-link-list a { color: var(--accent-secondary); }

.seo-final-cta {
    text-align: center;
    padding: var(--space-2xl);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.seo-final-cta h2 { font-size: 1.5rem; margin-bottom: var(--space-md); }
.seo-final-cta p {
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 520px;
    margin: 0 auto var(--space-xl);
}

/* Blog */

.seo-post-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-md); }

.seo-post-link {
    display: block;
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.seo-post-link:hover { background: var(--bg-card-hover); border-color: var(--accent-primary); }

.seo-post-title { font-size: 1.2rem; color: var(--text-primary); margin-bottom: var(--space-sm); line-height: 1.4; }
.seo-post-excerpt { color: var(--text-secondary); line-height: 1.7; font-size: 0.95rem; margin-bottom: var(--space-sm); }
.seo-post-date { font-size: 0.8rem; color: var(--text-muted); }

.seo-article-header { margin-bottom: var(--space-2xl); }
.seo-article-header h1 { font-size: 2.3rem; line-height: 1.2; margin-bottom: var(--space-md); }

.seo-article-body { font-size: 1.05rem; line-height: 1.8; color: var(--text-secondary); }
.seo-article-body h2 { font-size: 1.5rem; color: var(--text-primary); margin: var(--space-2xl) 0 var(--space-md); }
.seo-article-body h3 { font-size: 1.2rem; color: var(--text-primary); margin: var(--space-xl) 0 var(--space-sm); }
.seo-article-body p { margin-bottom: var(--space-lg); }
.seo-article-body ul, .seo-article-body ol { margin: 0 0 var(--space-lg) var(--space-xl); }
.seo-article-body li { margin-bottom: var(--space-sm); }
.seo-article-body a { color: var(--accent-secondary); }
.seo-article-body code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-tertiary);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}
.seo-article-body pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    overflow-x: auto;
    margin-bottom: var(--space-lg);
}
.seo-article-body pre code { background: none; padding: 0; }
.seo-article-body blockquote {
    border-left: 3px solid var(--accent-primary);
    padding-left: var(--space-lg);
    margin: 0 0 var(--space-lg);
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .seo-page { padding: var(--space-xl) var(--space-md) var(--space-2xl); }
    .seo-hero h1 { font-size: 1.9rem; }
    .seo-article-header h1 { font-size: 1.8rem; }
    .seo-intro { font-size: 1.05rem; }
}


/* ---- Homepage featured course paths + footer links ---- */

.featured-paths {
    padding: var(--space-3xl) var(--space-xl);
    max-width: 1100px;
    margin: 0 auto;
}

.featured-paths-intro {
    text-align: center;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 640px;
    margin: calc(var(--space-2xl) * -0.5) auto var(--space-xl);
}

.featured-paths-more {
    text-align: center;
    margin-top: var(--space-xl);
}

.featured-paths-more a {
    color: var(--accent-secondary);
    font-weight: 600;
    text-decoration: none;
}

.featured-paths-more a:hover { text-decoration: underline; }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover { color: var(--accent-primary); }

/* Visually hidden, still announced by screen readers. Used to carry meaning
   that is conveyed graphically -- the check/cross glyphs in the plan
   comparison, where the glyph is the only thing distinguishing an included
   feature from an excluded one. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
