/* Demo App UI — mobile-first, dark, Aira-style */
:root {
    --primary: #6366f1; --primary-dark: #4f46e5; --secondary: #8b5cf6;
    --success: #10b981; --warning: #f59e0b; --danger: #ef4444; --info: #0ea5e9;
    --bg-dark: #0f172a; --bg-card: #1e293b; --text-primary: #f1f5f9; --text-secondary: #94a3b8; --border: #334155;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body.demo-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1e1b4b 100%);
    min-height: 100vh; color: var(--text-primary); line-height: 1.6;
}
.demo-container { max-width: 920px; margin: 0 auto; padding: 1.25rem; padding-bottom: 6rem; }
.demo-page { display: flex; flex-direction: column; gap: 1.25rem; }

/* Topbar */
.demo-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.25rem; }
.demo-topbar-left { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.demo-avatar {
    width: 42px; height: 42px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.12);
    background: linear-gradient(135deg, var(--warning) 0%, var(--danger) 100%);
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; color: #fff;
}
.demo-greeting { font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-subtitle { font-size: 0.85rem; color: var(--text-secondary); }
.demo-icon-btn {
    width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
    background: rgba(30,41,59,0.75); color: var(--text-primary); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
}

/* Stories */
.demo-stories { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.25rem; scroll-snap-type: x mandatory; }
.demo-stories::-webkit-scrollbar { height: 6px; }
.demo-stories::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }
.demo-story {
    flex: 0 0 auto; width: 120px; height: 78px; border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08); padding: 0.9rem;
    display: flex; align-items: flex-end; font-weight: 600; color: var(--text-primary); scroll-snap-align: start; cursor: pointer;
}
.demo-story:nth-child(1) { background: radial-gradient(circle at 30% 30%, rgba(245,158,11,0.55), rgba(30,41,59,0.35)); }
.demo-story:nth-child(2) { background: radial-gradient(circle at 30% 30%, rgba(16,185,129,0.55), rgba(30,41,59,0.35)); }
.demo-story:nth-child(3) { background: radial-gradient(circle at 30% 30%, rgba(99,102,241,0.55), rgba(30,41,59,0.35)); }
.demo-story:nth-child(4) { background: radial-gradient(circle at 30% 30%, rgba(139,92,246,0.55), rgba(30,41,59,0.35)); }
.demo-story:nth-child(5) { background: radial-gradient(circle at 30% 30%, rgba(14,165,233,0.55), rgba(30,41,59,0.35)); }

/* Section head */
.demo-section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.demo-section-title { font-size: 1.05rem; font-weight: 700; }
.demo-link { color: var(--warning); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.demo-link:hover { text-decoration: underline; }

/* AI box (home page) */
.demo-ai-box { border-radius: 18px; border: 1px solid rgba(255,255,255,0.08); background: rgba(30,41,59,0.65); padding: 1rem; }
.demo-ai-input { display: grid; grid-template-columns: 1fr 44px; gap: 0.75rem; align-items: center; }
.demo-input {
    width: 100%; border-radius: 14px; border: 1px solid var(--border);
    background: rgba(15,23,42,0.55); color: var(--text-primary); padding: 0.9rem 1rem; outline: none; font-size: 0.95rem;
}
.demo-input::placeholder { color: rgba(148,163,184,0.9); }
.demo-send-btn {
    width: 44px; height: 44px; border-radius: 14px; border: 1px solid rgba(99,102,241,0.35);
    background: rgba(99,102,241,0.18); color: var(--text-primary); cursor: pointer; font-size: 1.1rem;
}

/* ────── Chat page (full-screen) ────── */
.demo-chat-page {
    display: flex; flex-direction: column; height: 100vh; height: 100dvh;
    background: rgba(15,23,42,0.92); overflow: hidden; position: relative;
}

.dchat-header {
    display: flex; align-items: center; padding: 12px 15px;
    background: rgba(30,41,59,0.92); border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0; box-shadow: 0 2px 10px rgba(0,0,0,0.35); z-index: 100;
}
.dchat-btn-circle {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(15,23,42,0.55); border: 1px solid rgba(255,255,255,0.08);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-primary); font-size: 16px;
    transition: background 0.15s, transform 0.15s;
}
.dchat-btn-circle:hover { transform: translateY(-1px); background: rgba(99,102,241,0.12); }
.dchat-ai-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; color: #fff; margin: 0 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.dchat-header-info h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text-primary); }
.dchat-header-info p  { margin: 0; font-size: 11px; color: var(--text-secondary); }
.dchat-header-actions { display: flex; gap: 8px; margin-left: auto; }

/* Messages */
.dchat-messages {
    flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 12px;
    scroll-behavior: smooth; overscroll-behavior: none;
}
.dchat-msg {
    max-width: 85%; padding: 12px 16px; border-radius: 18px; line-height: 1.5;
    position: relative; box-shadow: 0 1px 2px rgba(0,0,0,0.35); word-wrap: break-word;
}
.dchat-msg--user {
    align-self: flex-end; background: rgba(139,92,246,0.95); color: #fff;
    border-bottom-right-radius: 6px;
}
.dchat-msg--ai {
    align-self: flex-start; background: rgba(30,41,59,0.75); color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.08); border-bottom-left-radius: 6px;
}
/* Чат поддержки: сообщения поддержки слева, пользователя справа */
.dchat-msg--support {
    align-self: flex-start; background: rgba(30,41,59,0.75); color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.08); border-bottom-left-radius: 6px;
}
.dchat-msg-header { font-weight: 700; font-size: 12px; color: rgba(255,255,255,0.9); margin-bottom: 4px; }
.dchat-msg-text { font-size: 15px; line-height: 1.5; }
.dchat-msg-time { font-size: 11px; color: rgba(148,163,184,0.9); text-align: right; margin-top: 4px; }
.dchat-msg--user .dchat-msg-time { color: rgba(255,255,255,0.7); }

/* Typing indicator */
.dchat-typing {
    align-self: flex-start; background: rgba(30,41,59,0.75); border: 1px solid rgba(255,255,255,0.08);
    padding: 12px 16px; border-radius: 18px; border-bottom-left-radius: 6px;
    display: none; margin: 0 15px 8px;
}
.dchat-typing-dots { display: flex; gap: 5px; }
.dchat-dot {
    width: 8px; height: 8px; background: rgba(148,163,184,0.9); border-radius: 50%;
    animation: dchat-bounce 1.4s infinite ease-in-out; display: block;
}
.dchat-dot:nth-child(2) { animation-delay: 0.2s; }
.dchat-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dchat-bounce { 0%,60%,100%{ transform:translateY(0); } 30%{ transform:translateY(-4px); } }

/* Input area */
.dchat-input-area {
    flex-shrink: 0; padding: 10px 15px 14px;
    background: rgba(30,41,59,0.92); border-top: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.35);
}
.dchat-input-row {
    display: flex; gap: 8px; align-items: flex-end;
    background: rgba(15,23,42,0.55); border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.08); padding: 5px; max-width: 800px; margin: 0 auto;
}
.dchat-toolbar-btn {
    width: 36px; height: 36px; border-radius: 50%; background: transparent; border: none;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    color: var(--text-primary); font-size: 16px; transition: background 0.15s;
    flex-shrink: 0;
}
.dchat-toolbar-btn:hover { background: rgba(99,102,241,0.12); }
.dchat-stop { display: none; }
.dchat-input-wrap { position: relative; flex: 1; display: flex; align-items: center; min-width: 0; }
.dchat-textarea {
    width: 100%; padding: 10px 48px 10px 14px; border-radius: 18px; border: none;
    background: transparent; color: var(--text-primary); font-size: 15px; resize: none;
    min-height: 36px; max-height: 120px; outline: none; font-family: inherit; line-height: 1.4;
    overflow-y: hidden;
}
.dchat-textarea::placeholder { color: rgba(148,163,184,0.7); }
.dchat-send {
    position: absolute; right: 6px; bottom: 50%; transform: translateY(50%);
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: #fff; border: none; display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px; box-shadow: 0 2px 6px rgba(0,0,0,0.35); z-index: 2;
    transition: transform 0.15s;
}
.dchat-send:hover { transform: translateY(50%) scale(1.05); }
.dchat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Attachments row */
.dchat-attachments {
    max-width: 800px; margin: 0 auto 8px; display: none; gap: 8px; flex-wrap: wrap; padding: 0 2px;
}
.dchat-attachments.has-items { display: flex; }
.dchat-attach-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08); background: rgba(15,23,42,0.55);
    color: var(--text-primary); font-size: 12px; max-width: 200px;
}
.dchat-attach-chip .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dchat-attach-chip .remove {
    border: none; background: transparent; color: rgba(148,163,184,0.95);
    cursor: pointer; font-size: 14px; padding: 0; line-height: 1;
}
.dchat-attach-chip .remove:hover { color: #fff; }

/* Quick-actions dropdown */
.dchat-dropdown-wrap { position: relative; }
.dchat-dropdown {
    position: absolute; top: 45px; right: 0; background: rgba(15,23,42,0.95);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5); padding: 8px; width: 240px;
    z-index: 1000; display: none;
}
.dchat-dropdown.open { display: block; }
.dchat-dropdown-item {
    padding: 11px 14px; border-radius: 10px; cursor: pointer; font-size: 14px;
    color: var(--text-primary); transition: background 0.15s, transform 0.15s; margin-bottom: 4px;
}
.dchat-dropdown-item:last-child { margin-bottom: 0; }
.dchat-dropdown-item:hover { background: rgba(255,255,255,0.06); transform: translateX(2px); }

/* Conversation drawer */
.dchat-drawer-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200;
    opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s;
}
.dchat-drawer-overlay.open { opacity: 1; visibility: visible; }
.dchat-drawer {
    position: fixed; top: 0; left: 0; bottom: 0; width: 280px;
    background: rgba(15,23,42,0.98); border-right: 1px solid rgba(255,255,255,0.08);
    z-index: 210; display: flex; flex-direction: column;
    transform: translateX(-100%); transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
}
.dchat-drawer.open { transform: translateX(0); }
.dchat-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dchat-drawer-header h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--text-primary); }
.dchat-drawer-close { width: 32px; height: 32px; font-size: 14px; }
.dchat-new-chat-btn {
    margin: 12px 16px; padding: 10px; border-radius: 12px; border: 1px dashed rgba(255,255,255,0.15);
    background: transparent; color: var(--primary); font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background 0.15s;
}
.dchat-new-chat-btn:hover { background: rgba(99,102,241,0.1); }
.dchat-conv-list { flex: 1; overflow-y: auto; padding: 0 8px 16px; }
.dchat-conv-item {
    display: flex; align-items: center; gap: 10px; padding: 12px;
    border-radius: 12px; cursor: pointer; transition: background 0.15s;
    margin-bottom: 2px;
}
.dchat-conv-item:hover { background: rgba(255,255,255,0.05); }
.dchat-conv-item.active { background: rgba(99,102,241,0.15); }
.dchat-conv-item-icon {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #fff; flex-shrink: 0;
}
.dchat-conv-item-info { flex: 1; min-width: 0; }
.dchat-conv-item-title {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dchat-conv-item-date { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.dchat-conv-item-delete {
    flex-shrink: 0; width: 24px; height: 24px; border: none; border-radius: 50%;
    background: transparent; color: var(--text-secondary); cursor: pointer;
    opacity: 0.5; transition: opacity 0.15s, background 0.15s, color 0.15s;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; line-height: 1; padding: 0;
}
.dchat-conv-item-delete::after { content: "×"; }
.dchat-conv-item:hover .dchat-conv-item-delete,
.dchat-conv-item-delete:hover { opacity: 1; }
.dchat-conv-item-delete:hover {
    background: rgba(239, 68, 68, 0.15); color: var(--danger, #ef4444);
}

/* Welcome screen */
.dchat-welcome {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 1; text-align: center; padding: 40px 20px; gap: 12px;
}
.dchat-welcome-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 28px; color: #fff;
    box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}
.dchat-welcome h2 { margin: 0; font-size: 22px; font-weight: 700; color: var(--text-primary); }
.dchat-welcome p { margin: 0; font-size: 14px; color: var(--text-secondary); max-width: 300px; line-height: 1.5; }

.dchat-trial-btn {
    margin-top: 12px; padding: 14px 32px; border: none; border-radius: 16px; cursor: pointer;
    font-size: 15px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--secondary, #6366f1), var(--primary, #a855f7));
    box-shadow: 0 4px 20px rgba(99,102,241,0.35);
    transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
}
.dchat-trial-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(99,102,241,0.45); }
.dchat-trial-btn:active { transform: scale(0.97); }
.dchat-trial-btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.dchat-trial-hint { font-size: 13px; color: var(--warning, #f59e0b); max-width: 300px; margin-top: 4px; }

/* Error message */
.dchat-msg--error .dchat-msg-text { color: var(--danger, #ef4444); }

@media (max-width: 480px) {
    .dchat-messages { padding: 10px; gap: 10px; }
    .dchat-msg { max-width: 90%; padding: 10px 14px; }
    .dchat-input-area { padding: 8px 10px 12px; }
    .dchat-textarea { padding: 8px 44px 8px 12px; font-size: 14px; }
    .dchat-send { width: 32px; height: 32px; right: 5px; }
    .dchat-drawer { width: 260px; }
}

/* Prompt grid */
.demo-prompt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.demo-prompt {
    border-radius: 14px; border: 1px solid rgba(255,255,255,0.08); background: rgba(30,41,59,0.65);
    padding: 0.6rem 0.75rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.82rem; text-align: center; line-height: 1.3;
    transition: transform 0.15s, background 0.15s;
}
.demo-prompt:hover { transform: translateY(-1px); background: rgba(99,102,241,0.12); }

.demo-rating-pill {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.55rem 1.6rem; border-radius: 999px;
    background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(245,158,11,0.12));
    border: 1px solid rgba(245,158,11,0.35); color: var(--warning);
    font-weight: 700; font-size: 0.9rem; cursor: pointer;
    transition: transform 0.15s;
}
.demo-rating-pill:hover { transform: scale(1.03); }

/* Carousel / Lessons */
.demo-carousel { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.25rem; }
.demo-lesson-card {
    flex: 0 0 auto; width: 280px; border-radius: 18px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(30,41,59,0.65); padding: 1rem; text-decoration: none; color: inherit; display: block;
}
.demo-lesson-card .meta { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 0.35rem; }
.demo-lesson-card .name { font-weight: 800; margin-bottom: 0.65rem; }
.demo-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.demo-progress { height: 10px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; flex: 1; }
.demo-progress > div { height: 100%; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.demo-kpi { font-weight: 800; min-width: 48px; text-align: right; }

/* Rating stub */
.demo-rating-block {
    border-radius: 18px; border: 1px solid rgba(255,255,255,0.08); background: rgba(30,41,59,0.55);
    padding: 1rem; text-align: center;
}
.demo-rating-stars { font-size: 1.8rem; letter-spacing: 0.2rem; margin: 0.5rem 0; }

/* Module list (lessons page) */
.demo-module-list { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
.demo-lesson-item {
    border-radius: 16px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(30,41,59,0.55); padding: 0.85rem; display: flex; gap: 0.75rem; align-items: center;
    text-decoration: none; color: inherit;
}
.demo-lesson-item .thumb {
    width: 92px; height: 56px; border-radius: 12px; background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center;
    font-weight: 900; color: rgba(241,245,249,0.9); flex: 0 0 auto;
}
.demo-lesson-item .info { flex: 1; min-width: 0; }
.demo-lesson-item .info .t { font-weight: 900; margin-bottom: 0.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-lesson-item .info .d { color: var(--text-secondary); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-lesson-item--locked {
    opacity: 0.5; cursor: default; pointer-events: none;
}

/* Page header */
.demo-page-header { display: flex; align-items: center; justify-content: space-between; margin-top: 0.25rem; }
.demo-back {
    display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.9rem;
    border-radius: 999px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(30,41,59,0.55); color: var(--text-primary); text-decoration: none; font-weight: 700;
}

/* Muted text */
.demo-muted { color: var(--text-secondary); }

/* Lesson detail */
.demo-lesson-detail {
    border-radius: 18px; border: 1px solid rgba(255,255,255,0.08); background: rgba(30,41,59,0.55); padding: 1.25rem;
}
.demo-lesson-detail h2 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.demo-lesson-detail .text-content { color: var(--text-secondary); line-height: 1.7; white-space: pre-wrap; }
.demo-lesson-detail .assignment { margin-top: 1rem; padding: 1rem; border-radius: 14px; border: 1px solid rgba(245,158,11,0.25); background: rgba(245,158,11,0.08); }
.demo-video-block {
    border-radius: 18px; border: 1px solid rgba(255,255,255,0.08); background: rgba(30,41,59,0.35);
    padding: 0.75rem; margin-bottom: 1rem; cursor: pointer; text-align: center;
}

/* Bottom nav */
.demo-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(30,41,59,0.95); border-top: 1px solid var(--border);
    padding: 0.75rem 0; display: flex; justify-content: space-around; align-items: center;
    z-index: 1000; backdrop-filter: blur(10px); box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.demo-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
    padding: 0.5rem 1rem; text-decoration: none; color: var(--text-secondary);
    border-radius: 12px; min-width: 60px; position: relative; transition: color 0.2s;
}
.demo-nav-item:hover { color: var(--primary); background: rgba(99,102,241,0.1); }
.demo-nav-item.active { color: var(--primary); }
.demo-nav-item.active::before {
    content: ''; position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 3px; background: var(--primary); border-radius: 0 0 4px 4px;
}
.demo-nav-icon { font-size: 1.5rem; line-height: 1; }
.demo-nav-label { font-size: 0.75rem; font-weight: 500; }

/* Profile */
.demo-profile-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.75rem; margin-top: 0.75rem; }
.demo-profile-hero .name { font-weight: 900; font-size: 1.15rem; }
.demo-avatar--lg {
    width: 90px; height: 90px; border-radius: 50%; border: 3px solid rgba(245,158,11,0.45);
    font-size: 2rem; object-fit: cover; background: linear-gradient(135deg, var(--warning) 0%, var(--danger) 100%);
}
img.demo-avatar--lg { display: block; }
.demo-pencil {
    position: absolute; bottom: 2px; right: 2px; width: 28px; height: 28px;
    border-radius: 50%; background: var(--warning); color: #111; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    border: 2px solid var(--bg-dark); font-weight: 900;
}

/* Pill row */
.demo-pill-row { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.demo-pill {
    padding: 0.45rem 0.9rem; border-radius: 999px; background: rgba(30,41,59,0.65);
    border: 1px solid rgba(255,255,255,0.08); font-size: 0.85rem; color: var(--text-primary);
}
.demo-pill--muted { color: var(--text-secondary); }
.demo-pill-edit {
    position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
    color: var(--warning); text-decoration: none; font-size: 0.9rem;
}

/* Goals grid in sheet */
.demo-goals-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.demo-goal-field {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.65rem 0.85rem;
    border-radius: 14px; background: rgba(15,23,42,0.5);
    border: 1px solid rgba(255,255,255,0.06); cursor: pointer;
    position: relative;
}
.demo-goal-label { font-size: 0.78rem; color: var(--text-secondary); min-width: 120px; flex-shrink: 0; }
.demo-goal-value { font-weight: 700; color: var(--text-primary); flex: 1; font-size: 0.9rem; }
.demo-goal-edit { color: var(--warning); font-size: 0.9rem; flex-shrink: 0; }

/* Action button (edit profile, tracking) */
.demo-btn-action {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 1.5rem; border-radius: 999px; border: 2px solid var(--warning);
    background: transparent; color: var(--warning); text-decoration: none;
    font-weight: 900; font-size: 0.9rem; cursor: pointer; align-self: center;
    transition: background 0.2s;
}
.demo-btn-action:hover { background: rgba(245,158,11,0.1); }
.demo-btn-action--filled { background: var(--warning); color: #111; }
.demo-btn-action--filled:hover { filter: brightness(0.92); }

/* Social row */
.demo-social-row {
    display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center;
}
.demo-social-btn {
    width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.1);
    background: rgba(30,41,59,0.55); color: var(--text-primary); cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
    transition: background 0.2s;
}
.demo-social-btn:hover { background: rgba(99,102,241,0.18); }

/* Menu */
.demo-menu {
    margin-top: 0.25rem; border-radius: 18px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(30,41,59,0.45); overflow: hidden;
}
.demo-menu-item {
    display: grid; grid-template-columns: 22px 1fr 18px; gap: 0.75rem; align-items: center;
    padding: 0.9rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.06);
    color: var(--text-primary); text-decoration: none; cursor: pointer;
}
.demo-menu-item:last-child { border-bottom: none; }
.demo-menu-item .label { font-weight: 800; }
.demo-menu-item .chev { color: var(--text-secondary); font-weight: 900; }

/* Bottom cards */
.demo-bottom-cards { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.25rem; }
.demo-bottom-card {
    padding: 0.6rem 1.4rem; border-radius: 999px; background: rgba(30,41,59,0.65);
    border: 1px solid rgba(255,255,255,0.08); color: var(--text-primary); cursor: pointer;
    font-weight: 700; font-size: 0.85rem; text-decoration: none; transition: background 0.2s;
}
.demo-bottom-card:hover { background: rgba(99,102,241,0.12); }
.demo-bottom-card.secondary { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.2); }
.demo-bottom-card.secondary:hover { background: rgba(245,158,11,0.22); }

/* Sheets (style selector, goals) */
.demo-sheet-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    z-index: 2000; backdrop-filter: blur(4px);
}
.demo-sheet-overlay.open { display: block; }
.demo-sheet {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 2001;
    padding: 0 0.75rem 1rem; max-height: 70vh; overflow-y: auto;
    transition: transform 0.3s ease-out;
}
.demo-sheet.open { display: block; }
.demo-sheet-card {
    border-radius: 22px; background: rgba(30,41,59,0.97); border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
}
.demo-sheet-item {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1rem 1.15rem; border-bottom: 1px solid rgba(255,255,255,0.06); cursor: pointer;
}
.demo-sheet-item:last-child { border-bottom: none; }

/* Toggle switch */
.demo-toggle {
    width: 48px; height: 28px; border-radius: 999px; background: rgba(255,255,255,0.12);
    position: relative; flex-shrink: 0; cursor: pointer; transition: background 0.2s;
}
.demo-toggle::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
    border-radius: 50%; background: #fff; transition: transform 0.2s;
}
.demo-toggle.active { background: var(--warning); }
.demo-toggle.active::after { transform: translateX(20px); }

/* Profile edit page */
.demo-edit-field {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.85rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.06); cursor: pointer;
}
.demo-edit-field:last-child { border-bottom: none; }
.demo-edit-field .lbl { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0.1rem; }
.demo-edit-field .val { font-weight: 700; color: var(--text-primary); }
.demo-edit-field .pencil { color: var(--warning); font-size: 1rem; flex-shrink: 0; }

/* Inline edit input */
.demo-inline-edit {
    display: none; width: 100%; padding: 0.6rem 0.75rem; border-radius: 12px;
    border: 1px solid var(--warning); background: rgba(15,23,42,0.8);
    color: var(--text-primary); font-size: 0.95rem; outline: none;
}
.demo-inline-edit.open { display: block; }

/* Select inline */
.demo-inline-select {
    display: none; width: 100%; padding: 0.6rem 0.75rem; border-radius: 12px;
    border: 1px solid var(--warning); background: rgba(15,23,42,0.8);
    color: var(--text-primary); font-size: 0.95rem; outline: none; cursor: pointer;
}
.demo-inline-select.open { display: block; }
.demo-inline-select option { background: var(--bg-dark); color: var(--text-primary); }

/* Subscriptions page */
.demo-subs-tabs {
    display: flex; gap: 0; border-radius: 16px; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08); background: rgba(30,41,59,0.45);
}
.demo-subs-tab {
    flex: 1; padding: 0.75rem 0.5rem; text-align: center; font-weight: 800;
    font-size: 0.85rem; color: var(--text-secondary); cursor: pointer;
    border-right: 1px solid rgba(255,255,255,0.06); transition: all 0.2s;
}
.demo-subs-tab:last-child { border-right: none; }
.demo-subs-tab.active { background: rgba(245,158,11,0.18); color: var(--warning); }
.demo-subs-tab:hover:not(.active) { background: rgba(255,255,255,0.04); }

.demo-plan-card {
    border-radius: 18px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(30,41,59,0.55); overflow: hidden;
}
.demo-plan-header { padding: 1rem 1.15rem 0.5rem; }
.demo-plan-name { font-weight: 900; font-size: 1rem; margin-bottom: 0.25rem; }
.demo-plan-desc { color: var(--text-secondary); font-size: 0.85rem; }

.demo-variant-list { display: flex; flex-direction: column; }
.demo-variant-row {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.85rem 1.15rem; border-top: 1px solid rgba(255,255,255,0.05);
}
.demo-variant-period { font-weight: 700; }
.demo-variant-days { font-size: 0.8rem; color: var(--text-secondary); }
.demo-variant-btn {
    padding: 0.55rem 1.1rem; border-radius: 999px; border: none;
    background: var(--warning); color: #111; font-weight: 900; font-size: 0.9rem;
    cursor: pointer; min-width: 100px; text-align: center; transition: filter 0.2s, transform 0.15s;
}
.demo-variant-btn:hover { filter: brightness(0.92); transform: translateY(-1px); }
.demo-variant-btn:disabled { background: rgba(148,163,184,0.22); color: rgba(241,245,249,0.6); cursor: not-allowed; transform: none; }

.demo-payment-notice {
    padding: 0.85rem 1rem; border-radius: 14px; background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2); color: var(--text-secondary); font-size: 0.82rem;
    line-height: 1.5;
}

/* Status card */
.demo-status-card {
    border-radius: 18px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(30,41,59,0.55); padding: 1rem 1.15rem;
}
.demo-status-badge {
    display: inline-block; padding: 0.25rem 0.7rem; border-radius: 999px;
    font-size: 0.8rem; font-weight: 700;
}
.demo-status-badge.active { background: rgba(16,185,129,0.2); color: var(--success); }
.demo-status-badge.inactive { background: rgba(148,163,184,0.15); color: var(--text-secondary); }

/* Invoice modal */
.demo-modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.65);
    z-index: 3000; padding: 1rem; overflow: auto; backdrop-filter: blur(6px);
}
.demo-modal-overlay.open { display: flex; align-items: center; justify-content: center; }
.demo-modal-card {
    max-width: 420px; width: 100%; border-radius: 22px; background: rgba(30,41,59,0.98);
    border: 1px solid rgba(255,255,255,0.08); padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.demo-modal-header {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding-bottom: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 1rem;
}
.demo-modal-title { font-weight: 900; font-size: 1.1rem; }
.demo-modal-close {
    width: 32px; height: 32px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(15,23,42,0.55); color: var(--text-primary); cursor: pointer;
    font-size: 1rem; display: flex; align-items: center; justify-content: center;
}
.demo-modal-body { color: var(--text-secondary); line-height: 1.6; }
.demo-modal-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.7rem 1.5rem; border-radius: 999px; border: none;
    background: var(--success); color: #fff; font-weight: 900; cursor: pointer;
    font-size: 0.95rem; transition: filter 0.2s; text-decoration: none;
}
.demo-modal-btn:hover { filter: brightness(0.92); }
.demo-modal-btn.secondary { background: rgba(148,163,184,0.18); color: var(--text-primary); }

/* Lesson detail page */
.demo-lesson-section {
    border-radius: 18px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(30,41,59,0.45); padding: 1rem 1.15rem; margin-bottom: 0;
}
.demo-lesson-section-title {
    font-size: 1rem; font-weight: 900; margin-bottom: 0.65rem; color: var(--text-primary);
}
.demo-lesson-text {
    color: var(--text-secondary); line-height: 1.75; white-space: pre-wrap; font-size: 0.92rem;
}
.demo-lesson-assignment {
    padding: 0.85rem; border-radius: 14px; border: 1px solid rgba(245,158,11,0.2);
    background: rgba(245,158,11,0.06);
}

/* Media grid (videos / examples) */
.demo-media-grid {
    display: flex; gap: 0.65rem; overflow-x: auto; padding-bottom: 0.25rem;
}
.demo-media-grid::-webkit-scrollbar { height: 6px; }
.demo-media-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 999px; }
.demo-media-thumb {
    flex: 0 0 auto; width: 140px; height: 100px; border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1); background: rgba(15,23,42,0.55);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.25rem; cursor: pointer; color: var(--text-primary); font-weight: 700;
    font-size: 0.82rem; text-align: center; padding: 0.5rem;
    transition: border-color 0.2s, background 0.2s;
}
.demo-media-thumb:hover { border-color: var(--warning); background: rgba(245,158,11,0.08); }
.demo-media-thumb.active { border-color: var(--warning); border-width: 2px; }
.demo-media-thumb .icon { font-size: 1.6rem; }
.demo-media-thumb img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 12px;
}

/* Video tabs */
.demo-media-tabs {
    display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem;
}
.demo-media-tab {
    padding: 0.45rem 0.85rem; border-radius: 10px; cursor: pointer; font-size: 0.82rem;
    background: rgba(30,41,59,0.65); border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary); transition: all 0.2s;
}
.demo-media-tab:hover { border-color: var(--primary); color: var(--text-primary); }
.demo-media-tab.active { background: var(--warning); border-color: var(--warning); color: #111; font-weight: 700; }

/* Rating interactive */
.demo-rating-row {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.demo-rating-interactive {
    display: flex; gap: 0.25rem;
}
.demo-star-btn {
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(30,41,59,0.55); cursor: pointer; font-size: 1.3rem;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, transform 0.15s;
}
.demo-star-btn:hover { transform: scale(1.1); background: rgba(245,158,11,0.15); }
.demo-star-btn.filled { background: rgba(245,158,11,0.25); border-color: var(--warning); }

/* Homework */
.demo-hw-card {
    border-radius: 14px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(30,41,59,0.55); padding: 0.85rem; margin-bottom: 0.75rem;
}
.demo-hw-card .hw-header {
    display: flex; align-items: center; gap: 0.65rem; margin-bottom: 0.5rem;
}
.demo-hw-card .hw-header .avatar {
    width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--warning), var(--danger));
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; color: #fff;
}
.demo-hw-card .hw-header .name { font-weight: 700; }
.demo-hw-card .hw-body { color: var(--text-secondary); line-height: 1.6; white-space: pre-wrap; }
.demo-hw-card .hw-status {
    margin-top: 0.5rem; font-size: 0.82rem; font-weight: 700;
}

.demo-hw-input-row {
    display: flex; gap: 0.65rem; align-items: flex-start;
}
.demo-hw-textarea {
    flex: 1; border-radius: 14px; border: 1px solid rgba(255,255,255,0.1);
    background: rgba(15,23,42,0.55); color: var(--text-primary); padding: 0.75rem;
    font-size: 0.92rem; resize: vertical; min-height: 60px; outline: none;
    font-family: inherit; line-height: 1.5;
}
.demo-hw-textarea::placeholder { color: rgba(148,163,184,0.7); }
.demo-hw-textarea:focus { border-color: var(--warning); }

/* Notification badge on bell */
.demo-icon-btn { position: relative; }
.demo-notif-badge {
    position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
    border-radius: 999px; background: var(--danger); color: #fff;
    font-size: 0.65rem; font-weight: 900; display: flex; align-items: center;
    justify-content: center; padding: 0 4px; border: 2px solid var(--bg-dark);
}

/* Notification cards */
.demo-notif-card {
    display: flex; gap: 0.75rem; align-items: flex-start;
    padding: 0.85rem 1rem; border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06); background: rgba(30,41,59,0.35);
    transition: background 0.2s;
}
.demo-notif-card.unread {
    background: rgba(30,41,59,0.65); border-color: rgba(245,158,11,0.15);
    cursor: pointer;
}
.demo-notif-card.unread:hover { background: rgba(245,158,11,0.06); }
.demo-notif-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; margin-top: 0.1rem; }
.demo-notif-body { flex: 1; min-width: 0; }
.demo-notif-title { font-weight: 800; font-size: 0.92rem; margin-bottom: 0.15rem; }
.demo-notif-text {
    color: var(--text-secondary); font-size: 0.85rem; line-height: 1.45;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.demo-notif-time { color: var(--text-secondary); font-size: 0.75rem; margin-top: 0.3rem; opacity: 0.7; }
.demo-notif-dot {
    width: 10px; height: 10px; border-radius: 50%; background: var(--warning);
    flex-shrink: 0; margin-top: 0.35rem;
}

/* Order cards */
.demo-order-card {
    border-radius: 16px; padding: 1rem 1.1rem; background: rgba(30,41,59,0.4);
    border: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.demo-order-header {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap;
}
.demo-order-body {
    font-size: 0.85rem; color: var(--text-secondary); line-height: 1.8;
}
.demo-order-body strong { color: var(--text-primary); font-weight: 600; }
.demo-order-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }

/* Toast */
.demo-toast {
    position: fixed; bottom: 5.5rem; left: 50%; transform: translateX(-50%);
    padding: 0.65rem 1.5rem; border-radius: 999px; background: rgba(30,41,59,0.97);
    border: 1px solid rgba(245,158,11,0.2); color: var(--text-primary);
    font-weight: 700; font-size: 0.85rem; z-index: 4000;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.demo-toast.show { opacity: 1; }

/* Video player */
.demo-video-player {
    position: relative; width: 100%; max-height: 70vh; margin-bottom: 0.75rem;
    border-radius: 16px; overflow: hidden; background: #000;
}
.demo-video-player video {
    display: block; width: 100%; max-height: 70vh; object-fit: contain;
    border-radius: 16px; background: #000;
}

/* Referral page */
.ref-copy-btn {
    width: 100%; padding: 1rem 1.25rem; border-radius: 18px; border: none;
    background: linear-gradient(135deg, rgba(245,158,11,0.35), rgba(245,158,11,0.12));
    border: 1px solid rgba(245,158,11,0.3); color: var(--text-primary);
    font-weight: 800; font-size: 0.95rem; cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    transition: background 0.2s, transform 0.15s;
}
.ref-copy-btn:hover { background: linear-gradient(135deg, rgba(245,158,11,0.45), rgba(245,158,11,0.22)); transform: translateY(-1px); }
.ref-copy-btn:active { transform: scale(0.98); }

.ref-income-bar {
    padding: 0.9rem 1.15rem; border-radius: 18px;
    background: linear-gradient(135deg, rgba(245,158,11,0.22), rgba(245,158,11,0.06));
    border: 1px solid rgba(245,158,11,0.2);
    font-weight: 800; text-align: center; font-size: 1rem;
}

.ref-support-link {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.9rem 1.15rem; border-radius: 18px;
    background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.04));
    border: 1px solid rgba(245,158,11,0.18);
    color: var(--text-primary); text-decoration: none;
    transition: background 0.2s;
}
.ref-support-link:hover { background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(245,158,11,0.1)); }

.ref-tx-list { display: flex; flex-direction: column; }
.ref-tx-card {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.85rem 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ref-tx-card:last-child { border-bottom: none; }
.ref-tx-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1rem; color: #fff;
    background: linear-gradient(135deg, var(--warning), var(--danger));
}
.ref-tx-info { flex: 1; min-width: 0; }
.ref-tx-name { font-weight: 700; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ref-tx-desc { font-size: 0.82rem; color: var(--text-secondary); }
.ref-tx-amount { font-weight: 900; font-size: 0.95rem; flex-shrink: 0; white-space: nowrap; }

.ref-notice {
    padding: 0.75rem; border-radius: 12px;
    background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2);
    color: var(--warning); font-size: 0.88rem; line-height: 1.5;
}

@media (max-width: 640px) {
    .demo-container { padding: 1.25rem; padding-bottom: 6rem; }
    .demo-subs-tab { font-size: 0.78rem; padding: 0.65rem 0.25rem; }
    .demo-variant-btn { min-width: 90px; padding: 0.5rem 0.85rem; font-size: 0.85rem; }
}
