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

:root {
    --bg-0: #0a0b0f;
    --bg-1: #111318;
    --bg-2: #161922;
    --bg-3: #1c1f2a;
    --bg-4: #232734;
    --border: #2a2e3b;
    --border-light: #353a4a;
    --text-hi: #f1f5f9;
    --text-mid: #cbd5e1;
    --text-low: #64748b;
    --text-muted: #475569;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-dim: rgba(99, 102, 241, 0.12);
    --accent-glow: rgba(99, 102, 241, 0.25);
    --good: #34d399;
    --bad: #f87171;
    --warning: #fbbf24;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.2), 0 12px 24px rgba(0, 0, 0, 0.3);
}

html, body { height: 100%; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-0);
    color: var(--text-mid);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo, .btn-primary, .nav-item {
    font-family: 'Sora', 'Inter', sans-serif;
}

a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background: var(--bg-1);
    padding: 24px 16px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-height: 0;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    padding-left: 8px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-hi);
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.logo:hover { opacity: 0.8; }
.logo-highlight { color: var(--accent); }
.logo-cursor {
    display: inline-block;
    width: 2px;
    height: 20px;
    background: var(--accent);
    animation: blink 1.1s steps(1) infinite;
    border-radius: 1px;
    margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.user-box {
    margin: 4px 8px 20px 8px;
    font-size: 13px;
    color: var(--text-low);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.user-box a { color: var(--accent); text-decoration: none; font-weight: 500; transition: color 0.15s; }
.user-box a:hover { color: var(--accent-hover); }
.user-box .username { color: var(--text-mid); font-weight: 600; }

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-low);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    position: relative;
}
.nav-item:hover { background: var(--bg-3); color: var(--text-mid); }
.nav-item.active {
    background: var(--accent-dim);
    color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
}
.nav-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    width: 22px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.nav-item.active .nav-num { color: var(--accent); }
.nav-mark {
    margin-left: auto;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    color: var(--good);
    line-height: 1;
}
.nav-item.status-attempted { color: var(--text-mid); }
.nav-item.status-attempted .nav-num { color: var(--accent); }
.nav-item.active.status-attempted { color: var(--accent); }

.user-progress {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-low);
}
.progress-bar {
    margin-top: 8px;
    height: 4px;
    background: var(--bg-3);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.top-bar {
    padding: 18px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-0);
    flex-shrink: 0;
    gap: 16px;
}
.top-bar h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-hi);
    letter-spacing: -0.3px;
}
.status-badge {
    background: var(--bg-2);
    padding: 5px 14px;
    border-radius: 40px;
    font-size: 12px;
    color: var(--text-low);
    white-space: nowrap;
    border: 1px solid var(--border);
}
.menu-toggle {
    display: none;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-mid);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s;
}
.menu-toggle:hover { background: var(--bg-3); }

.split-layout {
    display: flex;
    flex: 1;
    min-height: 0;
}

.theory-panel {
    width: 45%;
    padding: 28px 32px;
    overflow-y: auto;
    background: var(--bg-0);
    border-right: 1px solid var(--border);
}

.theory-content {
    font-size: 15.5px;
    line-height: 1.8;
    color: var(--text-mid);
}
.theory-content h2 {
    color: var(--text-hi);
    font-size: 24px;
    margin-bottom: 16px;
    margin-top: 8px;
    font-weight: 600;
    letter-spacing: -0.5px;
}
.theory-content h3 {
    color: var(--text-hi);
    font-size: 18px;
    margin: 24px 0 12px;
    font-weight: 600;
}
.theory-content p { margin-bottom: 16px; }
.theory-content pre {
    background: var(--bg-1);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 20px 0;
    border: 1px solid var(--border);
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13.5px;
    line-height: 1.7;
    transition: border-color 0.2s;
}
.theory-content pre:hover { border-color: var(--border-light); }
.theory-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13.5px;
    color: #a5b4fc;
    background: var(--bg-2);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}
.theory-content pre code {
    background: transparent;
    padding: 0;
    border: none;
    font-size: 13.5px;
    color: #b9c2d4;
}
.theory-content ul, .theory-content ol {
    margin: 12px 0 16px 20px;
    color: var(--text-mid);
}
.theory-content li { margin-bottom: 6px; }
.theory-content strong { color: var(--text-hi); font-weight: 600; }

.task-block {
    margin-top: 32px;
    background: var(--bg-2);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
}
.task-block h3 {
    color: var(--text-hi);
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}
.task-block p { font-size: 15px; color: var(--text-mid); margin-bottom: 0; line-height: 1.7; }

.hint-box { margin-top: 20px; }
.hint-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--accent);
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.hint-btn:hover { background: var(--accent-dim); border-color: var(--accent); }
.hint-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.hint-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.hint-item {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-left: 3px solid var(--warning);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: #fde68a;
    white-space: pre-wrap;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    line-height: 1.6;
}

.editor-panel {
    width: 55%;
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    background: var(--bg-1);
    min-height: 0;
}

.editor-wrapper {
    background: var(--bg-0);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 180px;
    box-shadow: var(--shadow);
}
.editor-header {
    padding: 10px 16px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot.red { background: #f87171; }
.dot.yellow { background: #fbbf24; }
.dot.green { background: #34d399; }

#code-editor {
    flex: 1;
    background: var(--bg-0);
    color: #d4d4d4;
    border: none;
    padding: 20px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 14.5px;
    line-height: 1.7;
    resize: none;
    outline: none;
    tab-size: 4;
    min-height: 220px;
}

.resize-handle {
    height: 12px;
    margin: 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: row-resize;
    flex-shrink: 0;
    touch-action: none;
    border-radius: 6px;
    transition: background 0.15s;
}
.resize-handle:hover { background: var(--bg-2); }
.resize-grip {
    width: 40px;
    height: 3px;
    border-radius: 4px;
    background: var(--border-light);
    transition: background 0.15s;
}
.resize-handle:hover .resize-grip,
.resize-handle.active .resize-grip {
    background: var(--accent);
}

.output-wrapper {
    background: var(--bg-0);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 200px;
    min-height: 90px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.output-header {
    padding: 10px 16px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-low);
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    border: none;
    color: white;
    padding: 7px 22px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
    filter: brightness(1.1);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

#output-area {
    padding: 14px 16px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    color: var(--text-mid);
    flex: 1;
    margin: 0;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: transparent;
    min-height: 0;
    line-height: 1.6;
}

#feedback-message {
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 500;
    white-space: pre-wrap;
    border-top: 1px solid var(--border);
    background: var(--bg-0);
}
.feedback.success { color: var(--good); }
.feedback.error { color: var(--bad); }

.CodeMirror {
    height: 100% !important;
    font-size: 14.5px;
    line-height: 1.7;
    background: var(--bg-0) !important;
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
}
.CodeMirror-gutters { background: var(--bg-0) !important; border-right: 1px solid var(--border) !important; }
.CodeMirror-linenumber { color: #475569 !important; }
.CodeMirror-cursor { border-left: 2px solid var(--accent) !important; }

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 0%, #1c1f2e 0%, var(--bg-0) 60%);
    padding: 20px;
}
.auth-card {
    width: 400px;
    max-width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
}
.auth-card .logo { justify-content: center; margin-bottom: 32px; cursor: pointer; }
.auth-card h1 { font-size: 20px; color: var(--text-hi); margin-bottom: 24px; text-align: center; font-weight: 600; letter-spacing: -0.3px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--text-low); margin-bottom: 6px; font-weight: 500; }
.field input {
    width: 100%;
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-hi);
    font-size: 14.5px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.auth-card .btn-primary { width: 100%; padding: 12px; font-size: 15px; margin-top: 8px; }
.auth-switch { margin-top: 20px; text-align: center; font-size: 14px; color: var(--text-low); }
.auth-switch a { color: var(--accent); font-weight: 600; text-decoration: none; transition: color 0.15s; }
.auth-switch a:hover { color: var(--accent-hover); }

.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 18px;
    font-weight: 500;
}
.flash.error { background: rgba(248, 113, 113, 0.08); color: var(--bad); border: 1px solid rgba(248, 113, 113, 0.2); }
.flash.success { background: rgba(52, 211, 153, 0.08); color: var(--good); border: 1px solid rgba(52, 211, 153, 0.2); }

.notfound-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-0);
    color: var(--text-mid);
    gap: 16px;
    text-align: center;
    padding: 20px;
}
.notfound-page h1 { font-size: 80px; color: var(--accent); font-weight: 700; letter-spacing: -2px; line-height: 1; }
.notfound-page p { font-size: 18px; color: var(--text-low); }
.notfound-page a {
    color: var(--accent);
    font-weight: 600;
    padding: 10px 24px;
    border: 1px solid var(--border);
    border-radius: 40px;
    margin-top: 8px;
    transition: all 0.15s;
}
.notfound-page a:hover { background: var(--accent-dim); border-color: var(--accent); }

.admin-add-form { margin: 0 8px 14px 8px; }
.admin-add-btn {
    width: 100%;
    background: var(--bg-3);
    border: 1px solid var(--border-light);
    color: var(--accent);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Sora', 'Inter', sans-serif;
    transition: all 0.15s;
}
.admin-add-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }

.top-bar-actions { display: flex; align-items: center; gap: 12px; }
.admin-edit-btn {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--accent);
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
}
.admin-edit-btn:hover { background: var(--accent-dim); border-color: var(--accent); }

.admin-edit-page {
    min-height: 100vh;
    background: var(--bg-0);
    padding: 40px 20px;
    display: flex;
    justify-content: center;
}
.admin-edit-card {
    width: 100%;
    max-width: 800px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-lg);
}
.admin-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.admin-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--bg-0);
    background: var(--accent);
    padding: 2px 8px;
    border-radius: 40px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.admin-cancel-link { color: var(--accent); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: color 0.15s; }
.admin-cancel-link:hover { color: var(--accent-hover); }
.admin-edit-card h1 { font-size: 20px; color: var(--text-hi); margin-bottom: 24px; font-weight: 600; letter-spacing: -0.3px; }

.admin-edit-form .field { margin-bottom: 20px; }
.admin-edit-form label {
    display: block;
    font-size: 13px;
    color: var(--text-low);
    margin-bottom: 6px;
    font-weight: 500;
}
.admin-edit-form textarea,
.admin-edit-form input[type="text"] {
    width: 100%;
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-hi);
    font-size: 14px;
    outline: none;
    resize: vertical;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.admin-edit-form textarea.mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 13.5px; }
.admin-edit-form textarea:focus,
.admin-edit-form input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.admin-edit-actions { display: flex; gap: 12px; margin-top: 8px; }
.admin-edit-actions .btn-primary { padding: 10px 28px; }
.admin-cancel-btn {
    padding: 10px 24px;
    border-radius: 40px;
    color: var(--text-mid);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: all 0.15s;
}
.admin-cancel-btn:hover { background: var(--bg-3); border-color: var(--border-light); }

.admin-delete-form { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.admin-delete-btn {
    background: transparent;
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--bad);
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.admin-delete-btn:hover { background: rgba(248, 113, 113, 0.1); border-color: var(--bad); }

.tg-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #0088cc, #00a8e8);
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 13.5px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 136, 204, 0.25);
    border: none;
    cursor: pointer;
}
.tg-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 136, 204, 0.35);
    filter: brightness(1.1);
}
.tg-btn svg { width: 16px; height: 16px; fill: currentColor; }

.tg-btn-large {
    padding: 12px 32px;
    font-size: 15px;
}

.landing-header {
    padding: 18px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: rgba(17, 19, 24, 0.85);
    flex-wrap: wrap;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}
.landing-header .logo { margin-bottom: 0; padding-left: 0; }
.landing-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px 80px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}
.landing-hero h1 {
    font-size: 52px;
    font-weight: 700;
    color: var(--text-hi);
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -1.5px;
}
.landing-hero .hero-accent {
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.landing-hero .hero-accent .old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.5em;
    opacity: 0.7;
}
.landing-hero .hero-accent .badge {
    font-size: 0.4em;
    background: var(--bad);
    color: #fff;
    padding: 3px 14px;
    border-radius: 40px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.landing-hero p {
    font-size: 18px;
    color: var(--text-low);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 560px;
}
.landing-hero .hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}
.landing-hero .hero-buttons .btn-outline {
    color: var(--text-mid);
    text-decoration: none;
    padding: 14px 32px;
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: 40px;
    font-weight: 600;
    transition: all 0.2s;
}
.landing-hero .hero-buttons .btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.hero-stats {
    margin-top: 48px;
    display: flex;
    gap: 56px;
    flex-wrap: wrap;
    justify-content: center;
}
.hero-stats .stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-hi);
    font-variant-numeric: tabular-nums;
}
.hero-stats .stat-label {
    color: var(--text-low);
    font-size: 13px;
    margin-top: 4px;
}

.section-title {
    text-align: center;
    font-size: 30px;
    color: var(--text-hi);
    margin-bottom: 48px;
    font-weight: 600;
    letter-spacing: -0.5px;
}
.section-title span { color: var(--accent); }

.landing-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 20px;
}

.demo-grid {
    background: var(--bg-2);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: center;
    box-shadow: var(--shadow-lg);
}
.demo-grid > div:first-child {
    padding: 56px 48px;
}
.demo-grid .demo-tag {
    display: inline-block;
    background: var(--accent-dim);
    color: var(--accent);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.demo-grid h2 {
    font-size: 28px;
    color: var(--text-hi);
    margin-bottom: 16px;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.5px;
}
.demo-grid p {
    color: var(--text-low);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 28px;
}
.demo-terminal-wrapper {
    background: var(--bg-0);
    padding: 32px;
    border-left: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    line-height: 1.8;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.advantage-card {
    background: var(--bg-2);
    border-radius: var(--radius-md);
    padding: 32px 28px;
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}
.advantage-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
}
.advantage-card .icon {
    font-size: 32px;
    margin-bottom: 16px;
    display: block;
}
.advantage-card h3 {
    color: var(--text-hi);
    font-size: 17px;
    margin-bottom: 10px;
    font-weight: 600;
}
.advantage-card p {
    color: var(--text-low);
    font-size: 14px;
    line-height: 1.65;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.step-card {
    text-align: center;
    padding: 40px 28px;
    background: var(--bg-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}
.step-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
}
.step-card .step-num {
    width: 52px;
    height: 52px;
    background: var(--accent-dim);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    border: 2px solid var(--accent);
}
.step-card h3 {
    color: var(--text-hi);
    font-size: 17px;
    margin-bottom: 10px;
    font-weight: 600;
}
.step-card p {
    color: var(--text-low);
    font-size: 14px;
    line-height: 1.65;
}

.price-compare {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    text-align: center;
}
.price-card {
    background: var(--bg-2);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}
.price-card:hover { transform: translateY(-3px); border-color: var(--border-light); }
.price-card .price-label {
    color: var(--text-low);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}
.price-card .price-value {
    color: var(--text-hi);
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}
.price-card .price-desc {
    color: var(--text-muted);
    font-size: 12px;
}
.price-card.best {
    background: var(--bg-3);
    border: 2px solid var(--accent);
    position: relative;
    box-shadow: var(--shadow-lg);
}
.price-card.best .best-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 3px 16px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.price-card.best .price-value { color: var(--accent); font-size: 30px; }

.landing-footer {
    padding: 28px 40px;
    border-top: 1px solid var(--border);
    background: var(--bg-1);
    text-align: center;
    color: var(--text-low);
    font-size: 13px;
}

.cta-section {
    padding: 80px 20px;
    text-align: center;
    background: var(--bg-1);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.cta-section h2 {
    color: var(--text-hi);
    font-size: 30px;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: -0.5px;
}
.cta-section p {
    color: var(--text-low);
    font-size: 16px;
    margin-bottom: 32px;
}

@media (max-width: 900px) {
    .app-container { flex-direction: column; }
    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        padding: 14px 16px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        position: relative;
    }
    .logo { margin-bottom: 0; }
    .user-box { display: none; }
    .user-progress { display: none; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 62px;
        left: 0;
        right: 0;
        background: var(--bg-1);
        border-bottom: 1px solid var(--border);
        padding: 10px 14px 16px;
        z-index: 20;
        max-height: 70vh;
    }
    .nav-menu.open { display: flex; }
    .menu-toggle { display: block; margin-left: auto; }

    .split-layout { flex-direction: column; }
    .theory-panel, .editor-panel { width: 100%; }
    .theory-panel { border-right: none; border-bottom: 1px solid var(--border); max-height: 46vh; }
    .editor-panel { padding: 16px; }
    .top-bar { padding: 16px 18px; }
    .top-bar h1 { font-size: 17px; }

    .demo-grid { grid-template-columns: 1fr !important; }
    .demo-grid > div:first-child { padding: 28px 24px !important; order: 2; }
    .demo-grid > div:last-child { padding: 24px !important; border-left: none !important; border-bottom: 1px solid var(--border); min-height: 200px !important; order: 1; }
    .price-compare { grid-template-columns: 1fr !important; gap: 12px !important; max-width: 320px; margin: 0 auto; }
    .price-card.best { order: -1; }
}

@media (max-width: 768px) {
    .landing-header { padding: 14px 20px; }
    .landing-header .logo { font-size: 18px; }
    .landing-hero { padding: 60px 16px 40px; }
    .landing-hero h1 { font-size: 32px !important; }
    .landing-hero p { font-size: 16px; padding: 0 10px; }
    .landing-hero .hero-buttons .btn-primary { padding: 12px 32px !important; font-size: 15px; }
    .landing-hero .hero-buttons .btn-outline { padding: 12px 24px; font-size: 14px; }
    .hero-stats { gap: 32px; }
    .hero-stats .stat-value { font-size: 28px; }
    .section-title { font-size: 24px; margin-bottom: 32px; }
    .landing-section { padding: 48px 16px; }
    .advantages-grid { grid-template-columns: 1fr !important; }
    .advantage-card { padding: 24px 20px; }
    .steps-grid { grid-template-columns: 1fr !important; }
    .step-card { padding: 28px 20px; }
    .cta-section { padding: 48px 16px; }
    .cta-section h2 { font-size: 24px; }
    .landing-footer { padding: 20px; }

    .editor-panel { display: none !important; }
    .theory-panel { width: 100% !important; border-right: none !important; max-height: none !important; padding: 20px 16px !important; }
    .split-layout { flex-direction: column !important; }
    .mobile-editor-hint { display: block !important; }
    .top-bar { padding: 14px 16px !important; }
    .top-bar h1 { font-size: 16px !important; }
    .status-badge { font-size: 11px !important; padding: 4px 10px !important; }
    .theory-content { font-size: 15px !important; }
    .theory-content h2 { font-size: 20px !important; }
    .task-block { padding: 16px !important; }
    .task-block h3 { font-size: 15px !important; }
    .nav-item { padding: 10px 12px !important; font-size: 13px !important; }
    .nav-num { width: 18px !important; font-size: 10px !important; }
}

@media (max-width: 480px) {
    .landing-hero h1 { font-size: 26px !important; }
    .landing-hero p { font-size: 14px !important; }
    .demo-grid h2 { font-size: 20px !important; }
    .demo-grid p { font-size: 14px !important; }
    .demo-terminal-wrapper { font-size: 11px !important; padding: 16px !important; min-height: 160px !important; }
    .price-card .price-value { font-size: 22px !important; }
    .auth-card { padding: 28px 20px; }
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}
