/* ==========================================================================
   Python Основы — Неоморфный дизайн интерактивного учебника и компилятора
   ========================================================================== */

@font-face {
  font-family: "LessonFlaticonOutline";
  src: url("./vendor/flaticon/uicons-regular-rounded.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

.pb-icon,
[data-flaticon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: -0.12em;
  flex-shrink: 0;
  font-style: normal;
}

[data-flaticon]::before {
  display: inline-block;
  font-family: "LessonFlaticonOutline" !important;
  font-weight: 400 !important;
  font-style: normal !important;
  font-size: 1em !important;
  line-height: 1;
  text-transform: none;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[data-flaticon="arrow-comparison"]::before { content: "\f187"; }
[data-flaticon="arrow-left"]::before { content: "\f197"; }
[data-flaticon="arrow-right"]::before { content: "\f19b"; }
[data-flaticon="arrow-small-left"]::before { content: "\f19d"; }
[data-flaticon="arrow-small-right"]::before { content: "\f19e"; }
[data-flaticon="arrow-up-right-from-square"]::before { content: "\f1b3"; }
[data-flaticon="binary"]::before { content: "\f24e"; }
[data-flaticon="bolt"]::before { content: "\f26c"; }
[data-flaticon="book-alt"]::before { content: "\f274"; }
[data-flaticon="brain"]::before { content: "\f2de"; }
[data-flaticon="bulb"]::before { content: "\f304"; }
[data-flaticon="calculator"]::before { content: "\f31f"; }
[data-flaticon="camera"]::before { content: "\f348"; }
[data-flaticon="chart-histogram"]::before { content: "\f3a2"; }
[data-flaticon="chart-line-up"]::before { content: "\f3a5"; }
[data-flaticon="check"]::before { content: "\f3c8"; }
[data-flaticon="cloud"]::before { content: "\f479"; }
[data-flaticon="cloud-sun"]::before { content: "\f476"; }
[data-flaticon="comment-alt"]::before { content: "\f4a1"; }
[data-flaticon="comments"]::before { content: "\f4bc"; }
[data-flaticon="computer"]::before { content: "\f4cc"; }
[data-flaticon="credit-card"]::before { content: "\f4ee"; }
[data-flaticon="cross"]::before { content: "\f4f7"; }
[data-flaticon="database"]::before { content: "\f525"; }
[data-flaticon="download"]::before { content: "\f591"; }
[data-flaticon="edit"]::before { content: "\f5c1"; }
[data-flaticon="eye"]::before { content: "\f5f8"; }
[data-flaticon="flag"]::before { content: "\f695"; }
[data-flaticon="flask"]::before { content: "\f69b"; }
[data-flaticon="folder"]::before { content: "\f6ba"; }
[data-flaticon="gamepad"]::before { content: "\f6df"; }
[data-flaticon="globe"]::before { content: "\f705"; }
[data-flaticon="graduation-cap"]::before { content: "\f70f"; }
[data-flaticon="heart"]::before { content: "\f7a0"; }
[data-flaticon="home"]::before { content: "\f7b8"; }
[data-flaticon="interrogation"]::before { content: "\f81e"; }
[data-flaticon="language"]::before { content: "\f868"; }
[data-flaticon="layers"]::before { content: "\f87c"; }
[data-flaticon="link"]::before { content: "\f8ba"; }
[data-flaticon="list"]::before { content: "\f8c4"; }
[data-flaticon="list-check"]::before { content: "\f8c0"; }
[data-flaticon="loading"]::before { content: "\f8c8"; }
[data-flaticon="lock"]::before { content: "\f8d5"; }
[data-flaticon="magic-wand"]::before { content: "\f8e1"; }
[data-flaticon="memory"]::before { content: "\f924"; }
[data-flaticon="microchip"]::before { content: "\f941"; }
[data-flaticon="microphone"]::before { content: "\f944"; }
[data-flaticon="mobile-notch"]::before { content: "\f952"; }
[data-flaticon="network"]::before { content: "\f9a1"; }
[data-flaticon="paint-brush"]::before { content: "\f9ea"; }
[data-flaticon="pen-clip"]::before { content: "\fa1d"; }
[data-flaticon="pen-nib"]::before { content: "\fa22"; }
[data-flaticon="pencil"]::before { content: "\fa29"; }
[data-flaticon="picture"]::before { content: "\fa78"; }
[data-flaticon="play"]::before { content: "\fa9e"; }
[data-flaticon="plus"]::before { content: "\faac"; }
[data-flaticon="presentation"]::before { content: "\fad1"; }
[data-flaticon="print"]::before { content: "\fad6"; }
[data-flaticon="puzzle"]::before { content: "\faec"; }
[data-flaticon="refresh"]::before { content: "\fb34"; }
[data-flaticon="robot"]::before { content: "\fb61"; }
[data-flaticon="satellite-dish"]::before { content: "\fb8e"; }
[data-flaticon="scale"]::before { content: "\fb97"; }
[data-flaticon="school"]::before { content: "\fba1"; }
[data-flaticon="search"]::before { content: "\fbba"; }
[data-flaticon="settings-sliders"]::before { content: "\fbd1"; }
[data-flaticon="shield-check"]::before { content: "\fbdb"; }
[data-flaticon="sign-out-alt"]::before { content: "\fc0c"; }
[data-flaticon="sitemap"]::before { content: "\fc24"; }
[data-flaticon="smile"]::before { content: "\fc48"; }
[data-flaticon="snowflake"]::before { content: "\fc54"; }
[data-flaticon="star"]::before { content: "\fce9"; }
[data-flaticon="stethoscope"]::before { content: "\fcf4"; }
[data-flaticon="tachometer-fast"]::before { content: "\fd4b"; }
[data-flaticon="tags"]::before { content: "\fd51"; }
[data-flaticon="target"]::before { content: "\fd5f"; }
[data-flaticon="text"]::before { content: "\fd85"; }
[data-flaticon="time-fast"]::before { content: "\fda4"; }
[data-flaticon="time-past"]::before { content: "\fdaa"; }
[data-flaticon="triangle-warning"]::before { content: "\fe33"; }
[data-flaticon="trophy"]::before { content: "\fe39"; }
[data-flaticon="unlock"]::before { content: "\fe6f"; }
[data-flaticon="upload"]::before { content: "\fe75"; }
[data-flaticon="user"]::before { content: "\fea0"; }
[data-flaticon="user-check"]::before { content: "\fe7d"; }
[data-flaticon="user-gear"]::before { content: "\fe82"; }
[data-flaticon="user-shield"]::before { content: "\fe97"; }
[data-flaticon="users"]::before { content: "\fea6"; }
[data-flaticon="users-alt"]::before { content: "\fea1"; }
[data-flaticon="volume"]::before { content: "\fed0"; }
[data-flaticon="wifi"]::before { content: "\ff08"; }

.snake-mascot .pb-icon {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  color: var(--accent);
  font-size: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.section-icon.blue   { background: linear-gradient(135deg, #3d7fff20, #e7ebf3); color: var(--accent); }
.section-icon.orange { background: linear-gradient(135deg, #ff6b3520, #e7ebf3); color: var(--accent2); }
.section-icon.green  { background: linear-gradient(135deg, #22c55e20, #e7ebf3); color: var(--accent3); }
.section-icon.red    { background: linear-gradient(135deg, #ef444420, #e7ebf3); color: #ef4444; }
.section-icon.purple { background: linear-gradient(135deg, #8b5cf622, #e7ebf3); color: var(--purple); }
.section-icon.yellow { background: linear-gradient(135deg, #f59e0b22, #e7ebf3); color: var(--yellow); }

.tool-icon .pb-icon {
  color: var(--accent);
  font-size: 22px;
}

.quiz-q .pb-icon {
  color: var(--accent);
  margin-right: 6px;
}

.try-icon .pb-icon {
  font-size: 28px;
  color: white;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.status-dot.red { background: #ef4444; }
.status-dot.yellow { background: #eab308; }
.status-dot.orange { background: #f97316; }
.status-dot.blue { background: #3b82f6; }
.status-dot.green { background: #10b981; }

:root {
  --bg: #e7ebf3;
  --surface: #e7ebf3;
  --surface2: #edf1f8;
  --accent: #536dfe;
  --accent-hover: #3d5afe;
  --accent2: #ff6b35;
  --accent3: #10b981;
  --purple: #8b5cf6;
  --yellow: #d97706;
  --text: #263248;
  --text2: #4a5568;
  --text3: #748097;
  --border: rgba(163, 174, 195, 0.38);
  --border-light: rgba(255, 255, 255, 0.72);
  --snake: #ffd700;
  --code-bg: #dfe4ec;
  --code-text: #263248;
  --code-green: #059669;
  --code-blue: #3e55d8;
  --code-yellow: #b45309;
  --code-red: #dc2626;
  --code-comment: #748097;
  --shadow: 8px 8px 18px rgba(163, 174, 195, 0.42), -8px -8px 18px rgba(255, 255, 255, 0.78);
  --shadow-soft: 4px 4px 10px rgba(163, 174, 195, 0.34), -4px -4px 10px rgba(255, 255, 255, 0.68);
  --shadow-in: inset 4px 4px 9px rgba(163, 174, 195, 0.32), inset -4px -4px 9px rgba(255, 255, 255, 0.72);
  --shadow-pressed: inset 3px 3px 6px rgba(163, 174, 195, 0.38), inset -3px -3px 6px rgba(255, 255, 255, 0.74);
  --editor-font-size: 13px;
  --editor-line-height: 21.45px;
}

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

code, pre {
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

body {
  font-family: 'Geologica', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── TOP BAR (NEUMORPHIC) ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 4px 14px rgba(163, 174, 195, 0.28);
  flex-shrink: 0;
  z-index: 30;
}

.brand-logo-group {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: all 0.2s ease;
}
.brand-logo-group:hover .brand-icon-box {
  background: #e1e6f0;
  box-shadow:
    inset 2.5px 2.5px 5px rgba(151, 164, 190, 0.58),
    inset -2.5px -2.5px 5px rgba(255, 255, 255, 0.92);
}
.brand-book-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-logo {
  display: inline-flex;
  align-items: center;
  font-weight: 900;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: -0.5px;
  text-decoration: none;
  white-space: nowrap;
}
.topbar-logo span { color: var(--accent2); }

/* Lesson selector dropdown in topbar */
.lesson-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.topbar-badge {
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Geologica', sans-serif;
  transition: all .2s;
}
.topbar-badge:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.topbar-badge.open {
  box-shadow: var(--shadow-pressed);
}

.lesson-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 280px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(38, 50, 72, 0.18), var(--shadow);
  padding: 8px;
  display: none;
  z-index: 100;
}
.lesson-dropdown.open { display: block; }
.lesson-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text2);
  font-size: 12.5px;
  font-weight: 600;
  transition: all .15s;
}
.lesson-dropdown-item:hover {
  background: rgba(83, 109, 254, 0.1);
  color: var(--accent);
}
.lesson-dropdown-item.current {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 10px rgba(83, 109, 254, 0.3);
}
.lesson-dropdown-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(83, 109, 254, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lesson-dropdown-item.current .lesson-dropdown-num {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.topbar-nav-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-nav-btn {
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  color: var(--text2);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .2s;
}
.topbar-nav-btn:hover:not(.disabled) {
  color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.topbar-nav-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.topbar-progress {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar .python-account-link {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  text-decoration: none;
}
.topbar .python-account-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.python-account { position: relative; flex: 0 0 auto; }
.python-account-link { cursor: pointer; }
.python-account-menu { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: min(250px, calc(100vw - 32px)); padding: 8px; border: 1px solid var(--border-light); border-radius: 16px; background: var(--surface); box-shadow: 6px 6px 18px rgba(151,164,190,.4), -4px -4px 14px rgba(255,255,255,.8); }
.python-account-menu[hidden] { display: none; }
.python-account-heading { display: flex; flex-direction: column; gap: 5px; padding: 10px; border-bottom: 1px solid var(--border-light); overflow-wrap: anywhere; }
.python-account-heading strong { color: var(--text); font-size: 14px; }
.python-account-heading span { color: var(--text3); font-size: 11px; }
.python-account-action { display: flex; align-items: center; gap: 10px; box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: left; text-decoration: none; cursor: pointer; }
.python-account-action svg { flex-shrink: 0; color: var(--accent); }
.python-account-action:hover { background: var(--border-light); }
.python-account-action:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.progress-label {
  font-size: 12px;
  color: var(--text3);
  font-weight: 600;
}
.progress-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-in);
}
.progress-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(163, 174, 195, 0.5);
  transition: all .25s;
  cursor: pointer;
  border: none;
}
.progress-dots .dot:hover {
  transform: scale(1.25);
}
.progress-dots .dot.active {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(83, 109, 254, 0.5);
}
.progress-dots .dot.done {
  background: var(--accent3);
}

/* ── LAYOUT ── */
.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ── LEFT PANEL ── */
.left-panel {
  flex: 0 0 62%;
  min-width: 320px;
  max-width: calc(100% - 300px);
  overflow-y: auto;
  background: var(--bg);
  scroll-behavior: smooth;
}

/* ── DIVIDER ── */
.divider {
  width: 10px;
  background: var(--bg);
  cursor: col-resize;
  flex-shrink: 0;
  position: relative;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.divider::before {
  content: '';
  width: 4px;
  height: 48px;
  border-radius: 4px;
  background: var(--surface);
  box-shadow:
    inset 1.5px 1.5px 3px rgba(151, 164, 190, 0.55),
    inset -1.5px -1.5px 3px rgba(255, 255, 255, 0.9);
  transition: all .2s;
}
.divider:hover::before, .divider.dragging::before {
  height: 72px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(83, 109, 254, 0.45);
}

/* ── RIGHT PANEL (NEUMORPHIC COMPILER) ── */
.right-panel {
  flex: 1;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  padding: 14px 16px 16px 10px;
  gap: 12px;
}

.right-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.right-header-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 170px;
}
.rh-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.rh-btn {
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  border-radius: 11px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Geologica', sans-serif;
  color: var(--text2);
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.rh-btn:hover {
  color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.rh-btn:active {
  box-shadow: var(--shadow-pressed);
  transform: translateY(0);
}
.rh-btn.run-btn {
  background: linear-gradient(135deg, var(--accent), #3d5afe);
  border-color: rgba(255, 255, 255, 0.35);
  color: white;
  padding: 6px 15px;
  box-shadow:
    4px 4px 10px rgba(83, 109, 254, 0.35),
    -3px -3px 8px rgba(255, 255, 255, 0.8);
}
.rh-btn.run-btn:hover {
  background: linear-gradient(135deg, #3d5afe, #2a45e8);
  color: white;
  box-shadow:
    6px 6px 14px rgba(83, 109, 254, 0.45),
    -3px -3px 8px rgba(255, 255, 255, 0.85);
}
.rh-btn.run-btn:active {
  box-shadow: inset 2px 2px 6px rgba(20, 35, 130, 0.45);
}
.rh-btn.stop-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
  padding: 6px 15px;
  box-shadow:
    4px 4px 10px rgba(239, 68, 68, 0.35),
    -3px -3px 8px rgba(255, 255, 255, 0.8);
}
.rh-btn.stop-btn:hover {
  background: #b91c1c;
  color: white;
}

.live-badge {
  background: #e1e6f0;
  color: #059669;
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 9px;
  letter-spacing: 0.5px;
  box-shadow:
    inset 2px 2px 4px rgba(151, 164, 190, 0.55),
    inset -2px -2px 4px rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.45} }

/* ── PYODIDE STATUS ── */
.py-status {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 9px;
  background: #e1e6f0;
  color: var(--text3);
  box-shadow:
    inset 2px 2px 4px rgba(151, 164, 190, 0.52),
    inset -2px -2px 4px rgba(255, 255, 255, 0.88);
}
.py-status.ready {
  color: #059669;
}

/* ── COMPILER LAYOUT ── */
.compiler-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  min-height: 0;
}

/* Virtual files bar (used in Lesson 15 or when files are created) */
.vfs-bar {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: var(--shadow-in);
  font-size: 11.5px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.vfs-bar.visible {
  display: flex;
}
.vfs-label {
  font-weight: 700;
  color: var(--text2);
  margin-right: 4px;
}
.vfs-file-pill {
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  border-radius: 8px;
  padding: 3px 9px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: all .15s;
}
.vfs-file-pill:hover {
  background: var(--accent);
  color: white;
}

/* ── EDITOR AREA (SUNKEN NEUMORPHIC WELL) ── */
.editor-area {
  flex: 1;
  display: flex;
  overflow: hidden;
  border-radius: 18px;
  background: #e1e6f0;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 5px 5px 11px rgba(151, 164, 190, 0.55),
    inset -5px -5px 11px rgba(255, 255, 255, 0.9);
  min-height: 0;
}

.editor-gutter {
  width: 46px;
  flex-shrink: 0;
  background: rgba(151, 164, 190, 0.14);
  border-right: 1px solid rgba(151, 164, 190, 0.28);
  font-family: 'JetBrains Mono', monospace;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  font-size: var(--editor-font-size, 13px);
  line-height: var(--editor-line-height, 22px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color: #748097;
  text-align: right;
  padding: 14px 8px 48px 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}
.editor-gutter div {
  height: var(--editor-line-height, 22px);
  line-height: var(--editor-line-height, 22px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 2px;
}
.editor-gutter div.err-line {
  background: rgba(239, 68, 68, 0.22);
  color: #dc2626;
  font-weight: 800;
  border-radius: 4px;
}

/* ── FONT SIZE DROPDOWN ── */
.font-size-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.font-size-btn {
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  border-radius: 11px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Geologica', sans-serif;
  color: var(--text2);
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.font-size-btn:hover { color: var(--accent); box-shadow: var(--shadow); }
.font-size-btn:active { box-shadow: var(--shadow-pressed); }
.font-size-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 6px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(38, 50, 72, 0.15), var(--shadow);
  z-index: 100;
  display: none;
  min-width: 190px;
}
.font-size-dropdown.open { display: block; }
.font-size-opt {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Geologica', sans-serif;
  color: var(--text2);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
}
.font-size-opt:hover { background: rgba(83, 109, 254, 0.1); color: var(--accent); }
.font-size-opt.active {
  color: var(--accent);
  background: #e1e6f0;
  box-shadow:
    inset 2px 2px 4px rgba(151, 164, 190, 0.5),
    inset -2px -2px 4px rgba(255, 255, 255, 0.85);
  font-weight: 700;
}

/* ── SYNTAX HIGHLIGHT OVERLAY ── */
.editor-wrap {
  flex: 1;
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  background: transparent;
}
.editor-highlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  font-size: var(--editor-font-size, 13px);
  line-height: var(--editor-line-height, 22px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  letter-spacing: 0px;
  color: #263248;
  background: transparent;
  padding: 14px 16px 48px;
  margin: 0;
  border: none;
  tab-size: 4;
  white-space: pre;
  overflow: hidden;
  z-index: 1;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}
.editor-highlight .code-line {
  display: block;
  height: var(--editor-line-height, 22px);
  min-height: var(--editor-line-height, 22px);
  line-height: var(--editor-line-height, 22px);
}
.editor-highlight .code-line span {
  line-height: var(--editor-line-height, 22px);
}
.editor-highlight .code-line.err-line {
  background: rgba(239, 68, 68, 0.15);
  border-radius: 4px;
}
.editor-input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  font-size: var(--editor-font-size, 13px);
  line-height: var(--editor-line-height, 22px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  letter-spacing: 0px;
  color: transparent;
  background: transparent;
  padding: 14px 16px 48px;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
  caret-color: var(--accent);
  position: relative;
  z-index: 2;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  -webkit-text-fill-color: transparent;
}
.editor-input::selection {
  background: rgba(83, 109, 254, 0.22);
  -webkit-text-fill-color: transparent;
}

/* Syntax token colors — Neumorphic Contrast Palette */
.tk-kw    { color: #7c3aed; font-weight: 700; }
.tk-bi    { color: #0284c7; font-weight: 600; }
.tk-str   { color: #059669; }
.tk-num   { color: #b45309; font-weight: 600; }
.tk-op    { color: #3d5afe; font-weight: 600; }
.tk-cm    { color: #748097; font-style: italic; }
.tk-paren { color: #263248; font-weight: 600; }
.tk-bool  { color: #e11d48; font-weight: 700; }
.tk-self  { color: #e11d48; }

/* ── OUTPUT (NEUMORPHIC CONSOLE CARD + SUNKEN TERMINAL) ── */
.output-area {
  height: 40%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 10px 12px 12px;
  gap: 8px;
  overflow: hidden;
}
.output-header {
  padding: 2px 6px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text3);
  background: transparent;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.output-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.clear-out-btn {
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  font-family: 'Geologica', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  transition: all .15s;
}
.clear-out-btn:hover {
  color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.clear-out-btn:active {
  box-shadow: var(--shadow-pressed);
  transform: translateY(0);
}
.output-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  padding: 3px 9px;
  border-radius: 8px;
}
.output-status:not(:empty) {
  background: #e1e6f0;
  box-shadow:
    inset 2px 2px 4px rgba(151, 164, 190, 0.52),
    inset -2px -2px 4px rgba(255, 255, 255, 0.88);
}
.output-status.ok { color: var(--accent3); }
.output-status.err { color: #e45649; }
.output-status.running { color: var(--accent); }

.output-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
  background: #e1e6f0;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 4px 4px 9px rgba(151, 164, 190, 0.52),
    inset -4px -4px 9px rgba(255, 255, 255, 0.88);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.out-line {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  color: #263248;
  padding: 0;
}
.out-hint {
  color: var(--text3);
  font-style: italic;
  font-family: 'Geologica', sans-serif;
  font-size: 12px;
  padding: 2px 0;
}

/* Input prompt (neumorphic) */
.out-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent);
  border-radius: 11px;
  box-shadow: var(--shadow-soft);
}
.out-input-prompt {
  color: var(--accent);
  font-weight: 700;
  white-space: pre-wrap;
  flex-shrink: 0;
}
.out-input-field {
  border: 1px solid rgba(83, 109, 254, 0.3);
  outline: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  background: #e1e6f0;
  color: var(--text);
  padding: 5px 10px;
  min-width: 120px;
  flex: 1;
  border-radius: 8px;
  box-shadow:
    inset 2.5px 2.5px 5px rgba(151, 164, 190, 0.55),
    inset -2.5px -2.5px 5px rgba(255, 255, 255, 0.9);
}
.out-input-field:focus {
  border-color: var(--accent);
}
.out-input-submit {
  background: linear-gradient(135deg, var(--accent), #3d5afe);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  font-family: 'Geologica', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(83, 109, 254, 0.3);
}
.out-input-done {
  color: var(--accent3);
  font-weight: 700;
  white-space: pre-wrap;
}

/* Error block (neumorphic) */
.out-error-block {
  background: var(--surface);
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-left: 4px solid #ef4444;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 4px 0;
  box-shadow: var(--shadow-soft);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.out-error-type {
  color: #dc2626;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.out-error-location {
  color: #b45309;
  font-size: 11px;
  margin-bottom: 6px;
}
.out-error-msg {
  color: #b91c1c;
  white-space: pre-wrap;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #e1e6f0;
  box-shadow:
    inset 2px 2px 5px rgba(151, 164, 190, 0.5),
    inset -2px -2px 5px rgba(255, 255, 255, 0.85);
}
.out-error-tip {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 9px 12px;
  box-shadow: var(--shadow-soft);
  font-family: 'Geologica', sans-serif;
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.55;
}
.out-error-tip-label {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--accent);
}

/* ── LEFT CONTENT (THEORY & PRACTICE) ── */
.lesson-content {
  padding: 32px 36px 64px;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.lesson-hero {
  margin-bottom: 32px;
  animation: fadeUp .5s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.lesson-num {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.lesson-num::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.lesson-title {
  font-size: clamp(26px, 3.8vw, 36px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
  color: var(--text);
}
.lesson-title span { color: var(--accent); }

.lesson-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text2);
  max-width: 650px;
}

.snake-mascot {
  font-size: 52px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.12));
  animation: float 4s ease-in-out infinite;
  display: inline-block;
  margin-bottom: 12px;
}
@keyframes float {
  0%,100%{ transform: translateY(0) rotate(-3deg); }
  50%{ transform: translateY(-8px) rotate(3deg); }
}

/* Subtopic navigation pills */
.subtopic-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  animation: fadeUp .5s .08s ease both;
}
.subtopic-btn {
  padding: 8px 15px;
  border: 1px solid var(--border-light);
  background: var(--surface);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: all .2s;
  font-family: 'Geologica', sans-serif;
}
.subtopic-btn:hover {
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.subtopic-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(83, 109, 254, 0.35);
}

.section {
  margin-bottom: 44px;
  animation: fadeUp .45s ease both;
  scroll-margin-top: 20px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.section-meta {
  display: flex;
  flex-direction: column;
}
.section-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-light);
}
.section-icon.blue   { background: linear-gradient(135deg, #3d7fff20, #e7ebf3); }
.section-icon.orange { background: linear-gradient(135deg, #ff6b3520, #e7ebf3); }
.section-icon.green  { background: linear-gradient(135deg, #22c55e20, #e7ebf3); }
.section-icon.red    { background: linear-gradient(135deg, #ef444420, #e7ebf3); }
.section-icon.purple { background: linear-gradient(135deg, #8b5cf622, #e7ebf3); }
.section-icon.yellow { background: linear-gradient(135deg, #f59e0b22, #e7ebf3); }

.section-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 3px;
}
.section-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

/* Neumorphic Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow .25s, transform .25s;
}
.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.card p {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text2);
}
.card p + p { margin-top: 10px; }
.card strong { color: var(--text); font-weight: 700; }
.card.highlight {
  border-color: #3d7fff33;
  background: linear-gradient(135deg, #3d7fff0a, #edf1f8);
}
.card.highlight-orange {
  border-color: #ff6b3533;
  background: linear-gradient(135deg, #ff6b350a, #edf1f8);
}
.card.highlight-green {
  border-color: #22c55e33;
  background: linear-gradient(135deg, #22c55e0a, #edf1f8);
}
.card.highlight-purple {
  border-color: #8b5cf633;
  background: linear-gradient(135deg, #8b5cf60c, #edf1f8);
}

/* Code Blocks in Theory (raised card + sunken code well) */
.code-block {
  background: var(--surface);
  border-radius: 16px;
  padding: 10px 12px 12px;
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 8px;
  background: transparent;
  gap: 8px;
}
.code-block-lang {
  font-size: 11px;
  font-weight: 800;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.code-block-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.copy-btn, .run-inline-btn {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text2);
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 9px;
  transition: all .15s;
  font-family: 'Geologica', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.copy-btn:hover, .run-inline-btn:hover {
  color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.copy-btn:active, .run-inline-btn:active {
  box-shadow: var(--shadow-pressed);
  transform: translateY(0);
}
.run-inline-btn {
  color: var(--accent);
}
.copy-btn.copied {
  color: var(--code-green);
}
.code-block pre {
  padding: 14px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--code-text);
  background: #e1e6f0;
  border-radius: 12px;
  box-shadow:
    inset 3.5px 3.5px 8px rgba(151, 164, 190, 0.52),
    inset -3.5px -3.5px 8px rgba(255, 255, 255, 0.88);
  overflow-x: auto;
}

/* Theory code highlight classes (both schemes supported) */
.ck { color: var(--code-blue); font-weight: 600; }
.cf, .bi { color: #0184bc; font-weight: 600; }
.cs { color: #059669; }
.cc { color: var(--code-comment); font-style: italic; }
.ce { color: var(--code-red); }
.cn { color: #b45309; font-weight: 600; }

/* Inline code badges (вдавленные неоморфные элементы) */
.ic, .ic-green, .ic-orange, .ic-bool, .lesson-content :not(pre) > code {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.35;
  padding: 2px 9px;
  margin: 0 1px;
  border-radius: 8px;
  font-weight: 600;
  background: #e1e6f0;
  border: none;
  box-shadow:
    inset 2.5px 2.5px 5px rgba(151, 164, 190, 0.58),
    inset -2.5px -2.5px 5px rgba(255, 255, 255, 0.92);
}
.ic, .lesson-content :not(pre) > code {
  color: var(--accent);
}
.ic-green {
  color: #059669;
}
.ic-orange {
  color: #d94e1f;
}
.ic-bool {
  color: #7c3aed;
}

/* Output preview block (вдавленный неоморфный вывод в теории) */
.output-preview {
  background: #e1e6f0;
  border-radius: 14px;
  padding: 14px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text);
  margin: 10px 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 4px 4px 9px rgba(151, 164, 190, 0.52),
    inset -4px -4px 9px rgba(255, 255, 255, 0.88);
}
.output-preview .op-prompt { color: var(--text3); user-select: none; }
.output-preview .op-out { color: #059669; font-weight: 600; }
.output-preview .op-label { color: var(--accent); font-style: italic; font-size: 11px; font-weight: 700; margin-bottom: 4px; }

/* Params table */
.params-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13.5px;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.params-table th {
  background: rgba(163, 174, 195, 0.2);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.params-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  line-height: 1.55;
  vertical-align: top;
}
.params-table tr:last-child td { border-bottom: none; }
.params-table tr:hover td { background: #3d7fff06; }
.params-table .param-name {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
}
.params-table .param-default {
  font-family: 'JetBrains Mono', monospace;
  color: #986801;
  font-size: 12px;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 14px 0;
}
.compare-item {
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  border-radius: 14px;
  padding: 16px 18px;
}
.compare-item-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}
.compare-item p {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text2);
}

/* Practice Steps & Interactive Tasks */
.steps {
  list-style: none;
  margin: 14px 0;
}
.steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 15px 18px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  border-radius: 14px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text2);
  transition: all .2s;
}
.steps li:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.steps li.task-done {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.07), var(--surface));
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  box-shadow: 0 3px 8px rgba(83, 109, 254, 0.3);
}
.steps li.task-done .step-num {
  background: var(--accent3);
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}
.task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.task-solve-btn, .task-check-btn {
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: 'Geologica', sans-serif;
  color: var(--accent);
  cursor: pointer;
  transition: all .15s;
}
.task-solve-btn:hover, .task-check-btn:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.task-check-btn {
  color: var(--text3);
}
.steps li.task-done .task-check-btn {
  color: var(--accent3);
}

/* Error anatomy box in Lesson 1 */
.error-anatomy {
  background: #e1e6f0;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 16px;
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
  margin: 14px 0;
  position: relative;
  box-shadow:
    inset 4px 4px 9px rgba(151, 164, 190, 0.52),
    inset -4px -4px 9px rgba(255, 255, 255, 0.88);
}
.error-line-1 { color: #e45649; font-weight: 600; }
.error-line-2 { color: #986801; }
.error-line-3 { color: #383a42; }
.error-line-4 { color: #e45649; font-weight: 700; }
.error-annotation {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ann-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: 'Geologica', sans-serif;
  font-size: 13px;
  color: var(--text2);
}
.ann-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e45649;
  margin-top: 5px;
  flex-shrink: 0;
}
.ann-dot.yellow { background: #986801; }
.ann-dot.white { background: #383a42; }

/* Try card */
.try-card {
  background: linear-gradient(135deg, #3d7fff, #6366f1);
  border-radius: 16px;
  padding: 20px 24px;
  color: white;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  border: none;
  width: 100%;
  font-family: 'Geologica', sans-serif;
  text-align: left;
  box-shadow: 0 6px 20px rgba(61, 127, 255, 0.28);
}
.try-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(61, 127, 255, 0.4);
}
.try-icon { font-size: 30px; flex-shrink: 0; }
.try-text-title { font-size: 15px; font-weight: 800; margin-bottom: 3px; }
.try-text-sub { font-size: 12.5px; opacity: .88; }
.try-arrow { margin-left: auto; font-size: 20px; opacity: .8; }

/* Quiz card */
.quiz-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  border-radius: 18px;
  padding: 22px 24px;
  margin-top: 16px;
}
.quiz-q {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
}
.quiz-opts {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.quiz-opt {
  padding: 11px 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  border-radius: 12px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'Geologica', sans-serif;
  background: var(--surface);
  color: var(--text2);
  text-align: left;
  transition: all .2s;
}
.quiz-opt:hover:not(:disabled) {
  color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.quiz-opt.correct {
  border-color: rgba(16, 185, 129, 0.45);
  background: #e1e6f0;
  color: #059669;
  box-shadow:
    inset 3px 3px 6px rgba(151, 164, 190, 0.55),
    inset -3px -3px 6px rgba(255, 255, 255, 0.9);
}
.quiz-opt.wrong {
  border-color: rgba(239, 68, 68, 0.45);
  background: #e1e6f0;
  color: #dc2626;
  box-shadow:
    inset 3px 3px 6px rgba(151, 164, 190, 0.55),
    inset -3px -3px 6px rgba(255, 255, 255, 0.9);
}
.quiz-feedback {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 11px;
  display: none;
  line-height: 1.6;
  background: #e1e6f0;
  box-shadow:
    inset 2.5px 2.5px 5px rgba(151, 164, 190, 0.52),
    inset -2.5px -2.5px 5px rgba(255, 255, 255, 0.88);
}
.quiz-feedback.show { display: block; }
.quiz-feedback.ok { color: #059669; }
.quiz-feedback.no { color: #dc2626; }

.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 38px 0;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.tool-card {
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--surface);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tool-icon { font-size: 24px; margin-bottom: 6px; }
.tool-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.tool-desc { font-size: 11px; color: var(--text3); }

/* Bottom lesson navigation card */
.lesson-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.lesson-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  transition: all .2s;
}
.lesson-footer-btn:hover {
  color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.lesson-footer-btn.next {
  margin-left: auto;
  background: linear-gradient(135deg, var(--accent), #3d5afe);
  color: white;
  border-color: var(--accent);
}
.lesson-footer-btn.next:hover {
  color: white;
  box-shadow: 0 8px 20px rgba(83, 109, 254, 0.35);
}

@media (max-width: 820px) {
  body { overflow: auto; height: auto; }
  .layout { flex-direction: column; height: auto; overflow: visible; }
  .left-panel { flex: none !important; width: 100% !important; max-width: 100% !important; min-width: unset; overflow: visible; height: auto; }
  .divider { display: none; }
  .subtopic-nav { flex-direction: column; align-items: stretch; gap: 8px; }
  .subtopic-btn { width: 100%; text-align: left; box-sizing: border-box; padding: 10px 16px; font-size: 13px; }
  .right-panel { width: 100% !important; min-width: unset; height: auto !important; min-height: 760px; flex-shrink: 0; border-top: 2px solid var(--border); padding: 14px; }
  .right-header { gap: 10px; }
  .rh-actions { width: 100%; display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
  .rh-actions .rh-btn-text { display: none; }
  .font-size-btn { height: 38px; padding: 0 11px; white-space: nowrap; }
  #resetCodeBtn, #clearCodeBtn { width: 38px; height: 38px; padding: 0; justify-content: center; flex-shrink: 0; }
  #runStopBtn { flex: 1; min-width: 76px; height: 38px; padding: 0 18px; justify-content: center; font-size: 14px; }
  .compiler-wrap { overflow: visible; flex: none; }
  .editor-area { min-height: 320px; height: 320px; flex: none; }
  .output-area { min-height: 260px; height: 260px; flex: none; }
  .lesson-content { padding: 24px 18px 44px; }
  .compare-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
}

.left-panel::-webkit-scrollbar { width: 6px; }
.left-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.output-body::-webkit-scrollbar { width: 6px; }
.output-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.editor-input::-webkit-scrollbar { width: 6px; height: 6px; }
.editor-input::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

