/* ==========================================================================
   C# Interactive Course — Stylesheet
   Extracted from monolithic index.html at Stage 1 of refactor.
   No functional changes — pure move from inline <style> to external file.
   ========================================================================== */

:root{
  --bg:#0e0e10;
  --surface:#18181b;
  --surface-2:#222226;
  --surface-3:#2a2a2f;
  --border:#33333a;
  --border-soft:#26262b;
  --text:#fafafa;
  --text-2:#a8a8b3;
  --text-3:#6f6f78;
  --accent:#fb923c;
  --accent-soft:#fb923c22;
  --accent-2:#f59e0b;
  --success:#4ade80;
  --success-soft:#4ade8022;
  --error:#f87171;
  --error-soft:#f8717122;
  --info:#60a5fa;
  --info-soft:#60a5fa22;
  --kw:#c084fc;
  --str:#fbbf24;
  --num:#67e8f9;
  --com:#71717a;
  --type:#5eead4;
  --fn:#fb923c;
  --radius:14px;
  --radius-sm:10px;
  --safe-bottom:env(safe-area-inset-bottom,0);
  --safe-top:env(safe-area-inset-top,0);
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:'Manrope',sans-serif;-webkit-font-smoothing:antialiased;overscroll-behavior:none}
body{min-height:100vh;min-height:100dvh;line-height:1.6;font-size:16px}

/* App shell */
.app{
  max-width:680px;
  margin:0 auto;
  min-height:100vh;
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  position:relative;
}

/* Header */
.header{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(14,14,16,.92);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border-bottom:1px solid var(--border-soft);
  padding-top:var(--safe-top);
}
.header-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
}
.menu-btn{
  width:44px;height:44px;
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text);
  border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  font-size:0;
  flex-shrink:0;
  transition:transform .15s,background .15s;
}
.menu-btn:active{transform:scale(.94);background:var(--surface-2)}
.menu-btn svg{width:22px;height:22px}
.title-block{flex:1;min-width:0}
.title-eyebrow{
  font-size:11px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--accent);
  font-weight:700;
  margin-bottom:2px;
}
.title-main{
  font-family:'Fraunces',serif;
  font-size:18px;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:var(--text);
}
.progress-bar{
  height:3px;
  background:var(--border-soft);
  overflow:hidden;
}
.progress-fill{
  height:100%;
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  width:0%;
  transition:width .4s cubic-bezier(.4,0,.2,1);
}

/* Main */
.main{
  flex:1;
  padding:24px 16px 140px;
  animation:fadeIn .3s ease;
}
@keyframes fadeIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* Lesson header */
.lesson-num{
  font-family:'JetBrains Mono',monospace;
  font-size:12px;
  letter-spacing:.1em;
  color:var(--accent);
  font-weight:500;
  margin-bottom:10px;
  display:flex;
  align-items:center;
  gap:8px;
}
.lesson-num::before{
  content:"";
  width:24px;height:1px;background:var(--accent);
}
.lesson-title{
  font-family:'Fraunces',serif;
  font-size:34px;
  line-height:1.1;
  font-weight:600;
  letter-spacing:-.01em;
  margin:0 0 26px;
  color:var(--text);
}
.lesson-title em{
  font-style:italic;
  color:var(--accent);
}

/* Content blocks */
.block{margin-bottom:20px;animation:slideUp .35s ease backwards}
.block:nth-child(1){animation-delay:.02s}
.block:nth-child(2){animation-delay:.06s}
.block:nth-child(3){animation-delay:.10s}
.block:nth-child(4){animation-delay:.14s}
.block:nth-child(5){animation-delay:.18s}
@keyframes slideUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

.text-block{
  font-size:17px;
  line-height:1.65;
  color:var(--text);
}
.text-block p{margin:0 0 14px}
.text-block p:last-child{margin-bottom:0}
.text-block strong{color:var(--accent);font-weight:700}
.text-block em{color:var(--text);font-style:italic}
.text-block code{
  font-family:'JetBrains Mono',monospace;
  font-size:14px;
  background:var(--surface-2);
  padding:2px 7px;
  border-radius:6px;
  color:var(--type);
  border:1px solid var(--border-soft);
}

.section-head{
  font-family:'Fraunces',serif;
  font-size:22px;
  font-weight:600;
  margin:30px 0 14px;
  color:var(--text);
  letter-spacing:-.005em;
}

/* Special blocks */
.analogy{
  background:linear-gradient(135deg,var(--surface) 0%,var(--surface-2) 100%);
  border:1px solid var(--border);
  border-left:3px solid var(--accent);
  border-radius:var(--radius);
  padding:18px 18px 18px 20px;
  position:relative;
}
.analogy-label{
  font-size:11px;
  font-weight:700;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--accent);
  margin-bottom:8px;
  display:flex;
  align-items:center;
  gap:6px;
}
.analogy-label::before{content:"◆";font-size:9px}
.analogy-text{font-size:16px;line-height:1.6;color:var(--text)}
.analogy-text em{color:var(--accent);font-style:italic;font-weight:600}

.note{
  background:var(--info-soft);
  border:1px solid var(--info);
  border-radius:var(--radius);
  padding:14px 16px;
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.note-icon{
  width:22px;height:22px;
  flex-shrink:0;
  border-radius:50%;
  background:var(--info);
  color:var(--bg);
  display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:13px;
  font-family:'Fraunces',serif;
  font-style:italic;
}
.note-text{font-size:15px;line-height:1.55;color:var(--text)}

.warn{
  background:var(--error-soft);
  border:1px solid var(--error);
  border-radius:var(--radius);
  padding:14px 16px;
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.warn-icon{
  width:22px;height:22px;
  flex-shrink:0;
  border-radius:50%;
  background:var(--error);
  color:var(--bg);
  display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:14px;
}
.warn-text{font-size:15px;line-height:1.55;color:var(--text)}

/* ===== PRACTICE — hands-on game-dev exercises with hint/solution toggles ===== */
.practice{
  background:linear-gradient(135deg,var(--surface) 0%,var(--surface-2) 100%);
  border:1px solid var(--border);
  border-left:3px solid var(--accent);
  border-radius:var(--radius);
  padding:18px 18px 18px 20px;
  position:relative;
}
.practice-badge{
  display:inline-flex;
  align-items:center;
  gap:7px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--accent);
  margin-bottom:16px;
}
.practice-badge::before{
  content:"▶";
  font-size:9px;
  transform:translateY(-0.5px);
}
.practice-section{margin-top:14px}
.practice-section:first-of-type{margin-top:0}
.practice-section-title{
  font-size:11px;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--text-2);
  margin-bottom:8px;
  display:flex;
  align-items:center;
  gap:8px;
}
.practice-section-title::before{
  content:"";
  width:14px;
  height:1px;
  background:var(--accent);
  flex-shrink:0;
}
.practice-section-body{
  font-size:15px;
  line-height:1.6;
  color:var(--text);
}
.practice-section-body em{color:var(--accent);font-style:italic;font-weight:600}
.practice-section-body strong{color:var(--accent);font-weight:700}
.practice-section-body code{
  font-family:'JetBrains Mono',monospace;
  font-size:13px;
  background:rgba(255,255,255,.05);
  padding:1px 6px;
  border-radius:4px;
  color:var(--type);
}
.practice-code-block{
  background:#0a0a0c;
  border:1px solid var(--border);
  border-radius:var(--radius);
  font-family:'JetBrains Mono',monospace;
  font-size:13.5px;
  line-height:1.7;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.practice-code-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 14px;
  border-bottom:1px solid var(--border-soft);
  background:rgba(255,255,255,.02);
}
.practice-code-dots{display:flex;gap:5px}
.practice-code-dots span{
  width:9px;height:9px;border-radius:50%;background:var(--border);
}
.practice-code-dots span:nth-child(1){background:#4a2a2a}
.practice-code-dots span:nth-child(2){background:#4a402a}
.practice-code-dots span:nth-child(3){background:#2a4a2a}
.practice-code-lang{
  font-size:11px;
  color:var(--text-3);
  letter-spacing:.1em;
  text-transform:uppercase;
  font-weight:500;
}
.practice-code-body{
  padding:14px 16px;
  white-space:pre;
  color:var(--text);
}
.practice-controls{
  margin-top:20px;
  padding-top:16px;
  border-top:1px dashed var(--border);
  display:flex;
  flex-direction:column;
  gap:10px;
}
.practice-toggle{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:rgba(251,146,60,.06);
  border:1px solid var(--accent-soft);
  border-radius:8px;
  padding:12px 14px;
  font-family:inherit;
  font-size:13px;
  font-weight:600;
  color:var(--accent);
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease,transform .1s ease;
  -webkit-tap-highlight-color:transparent;
  text-align:left;
  min-height:46px;
}
.practice-toggle:hover{
  background:rgba(251,146,60,.12);
  border-color:var(--accent);
}
.practice-toggle:active{transform:scale(.99)}
.practice-toggle-label{
  letter-spacing:.04em;
  flex:1;
}
.practice-toggle-sign{
  width:22px;
  height:22px;
  border-radius:50%;
  background:var(--accent);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  position:relative;
}
.practice-toggle-sign::before,
.practice-toggle-sign::after{
  content:"";
  position:absolute;
  background:var(--bg);
  border-radius:1px;
}
.practice-toggle-sign::before{
  width:10px;
  height:2px;
}
.practice-toggle-sign::after{
  width:2px;
  height:10px;
  transition:opacity .2s ease;
}
.practice-toggle.is-open .practice-toggle-sign::after{
  opacity:0;
}
.practice-reveal{display:none}
.practice-reveal.is-open{
  display:block;
  padding-top:12px;
  animation:practiceFadeIn .25s ease;
}
@keyframes practiceFadeIn{
  from{opacity:0;transform:translateY(-4px)}
  to{opacity:1;transform:translateY(0)}
}

/* Practice EDITOR — tappable textarea where student writes code */
.practice-editor{
  background:#0a0a0c;
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  transition:border-color .15s;
}
.practice-editor:focus-within{border-color:var(--accent)}
.practice-editor-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 14px;
  border-bottom:1px solid var(--border-soft);
  background:rgba(255,255,255,.02);
}
.practice-editor-reset{
  background:none;
  border:1px solid transparent;
  font-family:inherit;
  font-size:11px;
  color:var(--text-3);
  cursor:pointer;
  padding:4px 10px;
  border-radius:4px;
  letter-spacing:.04em;
  text-transform:uppercase;
  font-weight:500;
  transition:color .15s,background .15s,border-color .15s;
  -webkit-tap-highlight-color:transparent;
}
.practice-editor-reset:hover{
  color:var(--accent);
  background:rgba(251,146,60,.06);
  border-color:var(--accent-soft);
}
.practice-editor-reset:active{transform:scale(.96)}
.practice-editor-textarea{
  display:block;
  width:100%;
  box-sizing:border-box;
  background:transparent;
  border:none;
  outline:none;
  padding:14px 16px;
  font-family:'JetBrains Mono',monospace;
  font-size:13.5px;
  line-height:1.7;
  color:var(--text);
  resize:vertical;
  min-height:160px;
  max-height:600px;
  white-space:pre;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  caret-color:var(--accent);
  tab-size:4;
  -moz-tab-size:4;
}
.practice-editor-textarea:focus{outline:none}
.practice-editor-textarea::selection{background:rgba(251,146,60,.25)}
.practice-editor-textarea::-webkit-scrollbar{width:6px;height:6px}
.practice-editor-textarea::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}

/* Practice RUN — execute user code in mini C# interpreter and show output */
.practice-run-wrap{margin-top:14px}
.practice-run-btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:var(--accent);
  border:none;
  border-radius:8px;
  padding:13px 14px;
  font-family:inherit;
  font-size:13px;
  font-weight:700;
  color:#0a0a0c;
  cursor:pointer;
  letter-spacing:.08em;
  text-transform:uppercase;
  transition:opacity .15s,transform .1s;
  -webkit-tap-highlight-color:transparent;
  min-height:46px;
}
.practice-run-btn:hover{opacity:.92}
.practice-run-btn:active{transform:scale(.99)}
.practice-run-btn::before{content:"▶";font-size:11px}

.practice-output{
  margin-top:10px;
  background:#0a0a0c;
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  animation:practiceFadeIn .2s ease;
}
.practice-output-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 14px;
  border-bottom:1px solid var(--border-soft);
  background:rgba(255,255,255,.02);
}
.practice-output-label{
  font-size:11px;
  color:var(--text-3);
  letter-spacing:.1em;
  text-transform:uppercase;
  font-weight:600;
}
.practice-output-status{
  font-size:11px;
  font-weight:700;
  letter-spacing:.04em;
}
.practice-output-status.is-ok{color:#4ade80}
.practice-output-status.is-fail{color:#f87171}
.practice-output-status.is-error{color:#fbbf24}
.practice-output-status.is-waiting{color:var(--accent);animation:pulse 1.4s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:.6}50%{opacity:1}}
/* Interactive input row внутри консоли — появляется при Console.ReadLine() */
.practice-output-inputrow{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:6px;
  padding:4px 0;
}
.practice-output-caret{
  color:var(--accent);
  font-weight:700;
  user-select:none;
}
.practice-output-input{
  flex:1;
  background:transparent;
  border:none;
  border-bottom:1.5px solid var(--accent);
  outline:none;
  padding:2px 0;
  font-family:'JetBrains Mono',monospace;
  font-size:13.5px;
  color:var(--text);
  caret-color:var(--accent);
}
.practice-output-input::placeholder{color:var(--text-3);font-style:italic}
.practice-output-body{
  padding:14px 16px;
  font-family:'JetBrains Mono',monospace;
  font-size:13.5px;
  line-height:1.7;
  color:var(--text);
  white-space:pre-wrap;
  word-wrap:break-word;
  min-height:30px;
  overflow-x:auto;
}
.practice-output-error{
  color:#fbbf24;
  font-style:italic;
  margin-top:8px;
  padding-top:8px;
  border-top:1px dashed var(--border);
}
.practice-output-diff{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-top:12px;
  padding-top:12px;
  border-top:1px dashed var(--border);
  font-size:12.5px;
}
.practice-output-diff-side{display:flex;flex-direction:column;gap:4px}
.practice-output-diff-label{
  font-size:10px;
  color:var(--text-3);
  letter-spacing:.1em;
  text-transform:uppercase;
  font-weight:600;
}
.practice-output-diff-content{
  white-space:pre-wrap;
  word-wrap:break-word;
  color:var(--text-2);
  font-family:'JetBrains Mono',monospace;
}
@media (max-width:520px){
  .practice-output-diff{grid-template-columns:1fr}
}

/* Practice FULLSCREEN — singleton overlay for comfortable code editing */
.practice-fullscreen{
  position:fixed;
  inset:0;
  background:#0a0a0c;
  z-index:1000;
  display:flex;
  flex-direction:column;
}
.practice-fullscreen[hidden]{display:none}
.practice-fullscreen-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 14px;
  border-bottom:1px solid var(--border);
  background:var(--surface);
  flex-shrink:0;
}
.practice-fullscreen-close,
.practice-fullscreen-run{
  display:flex;
  align-items:center;
  gap:6px;
  border:none;
  border-radius:8px;
  padding:10px 14px;
  font-family:inherit;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:opacity .15s,transform .1s;
  min-height:42px;
  letter-spacing:.04em;
}
.practice-fullscreen-close{
  background:rgba(255,255,255,.06);
  color:var(--text);
}
.practice-fullscreen-close:hover{background:rgba(255,255,255,.1)}
.practice-fullscreen-run{
  background:var(--accent);
  color:#0a0a0c;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:12px;
}
.practice-fullscreen-run:hover{opacity:.92}
.practice-fullscreen-close:active,
.practice-fullscreen-run:active{transform:scale(.97)}
.practice-fullscreen-title{
  flex:1;
  text-align:center;
  font-size:11px;
  font-weight:700;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--text-3);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.practice-fullscreen-textarea{
  flex:1;
  width:100%;
  box-sizing:border-box;
  background:#0a0a0c;
  border:none;
  outline:none;
  padding:16px;
  font-family:'JetBrains Mono',monospace;
  font-size:14px;
  line-height:1.7;
  color:var(--text);
  resize:none;
  white-space:pre;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  caret-color:var(--accent);
  tab-size:4;
  -moz-tab-size:4;
}
.practice-fullscreen-textarea::selection{background:rgba(251,146,60,.25)}
.practice-fullscreen-output{
  border-top:1px solid var(--border);
  background:#0a0a0c;
  flex-shrink:0;
  max-height:38vh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.practice-fullscreen-output[hidden]{display:none}
.practice-fullscreen-output-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 14px;
  border-bottom:1px solid var(--border-soft);
  background:rgba(255,255,255,.02);
  flex-shrink:0;
}
.practice-fullscreen-output-label{
  font-size:11px;
  color:var(--text-3);
  letter-spacing:.1em;
  text-transform:uppercase;
  font-weight:600;
}
.practice-fullscreen-status{font-size:11px;font-weight:700}
.practice-fullscreen-status.is-ok{color:#4ade80}
.practice-fullscreen-status.is-fail{color:#f87171}
.practice-fullscreen-status.is-error{color:#fbbf24}
.practice-fullscreen-output-body{
  padding:14px 16px;
  font-family:'JetBrains Mono',monospace;
  font-size:13.5px;
  line-height:1.7;
  color:var(--text);
  white-space:pre-wrap;
  word-wrap:break-word;
  overflow:auto;
  flex:1;
}

/* Fullscreen button in editor header */
.practice-editor-actions{
  display:flex;
  gap:6px;
  align-items:center;
}
.practice-editor-fullscreen{
  background:none;
  border:1px solid transparent;
  font-family:inherit;
  font-size:14px;
  color:var(--text-3);
  cursor:pointer;
  padding:4px 8px;
  border-radius:4px;
  transition:color .15s,background .15s,border-color .15s;
  -webkit-tap-highlight-color:transparent;
  min-width:32px;
  min-height:28px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.practice-editor-fullscreen:hover{
  color:var(--accent);
  background:rgba(251,146,60,.06);
  border-color:var(--accent-soft);
}
.practice-editor-fullscreen:active{transform:scale(.96)}

/* Step blocks for tutorials */
.steps{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin:8px 0;
}
.step{
  display:flex;
  gap:14px;
  align-items:flex-start;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px 16px;
}
.step-num{
  width:28px;height:28px;
  border-radius:50%;
  background:var(--accent);
  color:#0a0a0c;
  font-weight:700;
  font-family:'JetBrains Mono',monospace;
  font-size:13px;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
  margin-top:2px;
}
.step-text{
  flex:1;
  font-size:15.5px;
  line-height:1.55;
  color:var(--text);
}
.step-text strong{color:var(--accent);font-weight:700}
.step-text code{
  font-family:'JetBrains Mono',monospace;
  font-size:13px;
  background:var(--surface-2);
  padding:2px 7px;
  border-radius:6px;
  color:var(--type);
  border:1px solid var(--border-soft);
  white-space:nowrap;
}
.path{
  display:inline-block;
  font-family:'JetBrains Mono',monospace;
  font-size:13px;
  background:var(--surface-3);
  padding:3px 9px;
  border-radius:6px;
  color:var(--accent);
  border:1px solid var(--border);
  font-weight:500;
  white-space:nowrap;
  margin:0 1px;
}

/* Code blocks */
.code-block{
  background:#0a0a0c;
  border:1px solid var(--border);
  border-radius:var(--radius);
  font-family:'JetBrains Mono',monospace;
  font-size:13.5px;
  line-height:1.7;
  overflow-x:auto;
  position:relative;
  -webkit-overflow-scrolling:touch;
}
.code-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 14px;
  border-bottom:1px solid var(--border-soft);
  background:rgba(255,255,255,.02);
}
.code-dots{display:flex;gap:5px}
.code-dots span{
  width:9px;height:9px;border-radius:50%;background:var(--border);
}
.code-dots span:nth-child(1){background:#4a2a2a}
.code-dots span:nth-child(2){background:#4a402a}
.code-dots span:nth-child(3){background:#2a4a2a}
.code-lang{
  font-size:11px;
  color:var(--text-3);
  letter-spacing:.1em;
  text-transform:uppercase;
  font-weight:500;
}
.code-body{
  padding:14px 16px;
  white-space:pre;
  color:var(--text);
}
.kw{color:var(--kw);font-weight:500}
.str{color:var(--str)}
.num{color:var(--num)}
.com{color:var(--com);font-style:italic}
.type{color:var(--type)}
.fn{color:var(--fn)}

.output-block{
  background:#08080a;
  border:1px solid var(--border);
  border-radius:var(--radius);
  margin-top:-12px;
  padding:12px 16px;
  font-family:'JetBrains Mono',monospace;
  font-size:13px;
  color:var(--success);
}
.output-label{
  font-size:10px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--text-3);
  margin-bottom:6px;
  font-weight:600;
  font-family:'Manrope',sans-serif;
}

/* Task block */
.task{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:18px 18px 20px;
  margin:24px 0;
  position:relative;
}
.task::before{
  content:"";
  position:absolute;
  top:-1px;left:18px;
  width:48px;height:3px;
  background:var(--accent);
  border-radius:0 0 3px 3px;
}
.task-label{
  font-size:11px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--accent);
  font-weight:700;
  margin-bottom:12px;
  display:flex;
  align-items:center;
  gap:8px;
}
.task-question{
  font-size:17px;
  line-height:1.5;
  margin-bottom:18px;
  color:var(--text);
  font-weight:500;
}
.task-question code{
  font-family:'JetBrains Mono',monospace;
  font-size:14px;
  background:var(--surface-2);
  padding:2px 7px;
  border-radius:6px;
  color:var(--type);
}
.task-code{
  background:#0a0a0c;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:12px 14px;
  font-family:'JetBrains Mono',monospace;
  font-size:13px;
  line-height:1.7;
  margin-bottom:18px;
  overflow-x:auto;
  white-space:pre;
  -webkit-overflow-scrolling:touch;
}

/* Options */
.options{display:flex;flex-direction:column;gap:10px}
.option{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  background:var(--surface-2);
  border:1.5px solid var(--border);
  border-radius:var(--radius-sm);
  cursor:pointer;
  transition:all .15s;
  min-height:54px;
  font-size:15px;
  line-height:1.4;
  color:var(--text);
  text-align:left;
  width:100%;
  font-family:inherit;
}
.option:active{transform:scale(.98)}
.option-letter{
  width:28px;height:28px;
  border-radius:8px;
  background:var(--surface-3);
  border:1px solid var(--border);
  display:flex;align-items:center;justify-content:center;
  font-family:'JetBrains Mono',monospace;
  font-weight:600;
  font-size:13px;
  color:var(--text-2);
  flex-shrink:0;
  transition:all .15s;
}
.option-text{flex:1}
.option-text code{
  font-family:'JetBrains Mono',monospace;
  background:rgba(255,255,255,.06);
  padding:1px 6px;
  border-radius:4px;
  font-size:13px;
  color:var(--type);
}
.option.selected{
  border-color:var(--accent);
  background:var(--accent-soft);
}
.option.selected .option-letter{
  background:var(--accent);
  color:#000;
  border-color:var(--accent);
}
.option.correct{
  border-color:var(--success);
  background:var(--success-soft);
}
.option.correct .option-letter{
  background:var(--success);
  color:#000;
  border-color:var(--success);
}
.option.wrong{
  border-color:var(--error);
  background:var(--error-soft);
}
.option.wrong .option-letter{
  background:var(--error);
  color:#000;
  border-color:var(--error);
}
.option:disabled{cursor:default}

/* Fill input */
.fill-input{
  width:100%;
  padding:14px 16px;
  background:var(--surface-2);
  border:1.5px solid var(--border);
  border-radius:var(--radius-sm);
  color:var(--text);
  font-family:'JetBrains Mono',monospace;
  font-size:16px;
  outline:none;
  transition:border-color .15s;
}
.fill-input:focus{border-color:var(--accent)}
.fill-input.correct{border-color:var(--success);background:var(--success-soft)}
.fill-input.wrong{border-color:var(--error);background:var(--error-soft)}

/* Check button */
.check-btn{
  margin-top:16px;
  width:100%;
  padding:14px;
  background:var(--accent);
  color:#0a0a0c;
  border:none;
  border-radius:var(--radius-sm);
  font-weight:700;
  font-size:15px;
  letter-spacing:.02em;
  cursor:pointer;
  font-family:inherit;
  min-height:50px;
  transition:transform .12s,opacity .15s;
}
.check-btn:active{transform:scale(.98)}
.check-btn:disabled{opacity:.4;cursor:not-allowed}

/* Feedback */
.feedback{
  margin-top:16px;
  padding:14px 16px;
  border-radius:var(--radius-sm);
  font-size:15px;
  line-height:1.55;
  animation:slideUp .25s ease;
}
.feedback.correct{
  background:var(--success-soft);
  border:1px solid var(--success);
  color:var(--text);
}
.feedback.wrong{
  background:var(--error-soft);
  border:1px solid var(--error);
  color:var(--text);
}
.feedback-head{
  font-weight:700;
  margin-bottom:6px;
  display:flex;
  align-items:center;
  gap:8px;
}
.feedback-head svg{width:18px;height:18px}
.feedback code{
  font-family:'JetBrains Mono',monospace;
  background:rgba(0,0,0,.3);
  padding:1px 6px;
  border-radius:4px;
  font-size:13px;
}

/* Bottom nav */
.bottom{
  position:fixed;
  bottom:0;left:0;right:0;
  z-index:40;
  background:linear-gradient(to top,var(--bg) 70%,transparent);
  padding:14px 16px calc(14px + var(--safe-bottom));
  display:flex;
  gap:10px;
  max-width:680px;
  margin:0 auto;
}
.nav-btn{
  flex:1;
  padding:14px 18px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text);
  font-weight:600;
  font-size:15px;
  cursor:pointer;
  font-family:inherit;
  min-height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  transition:transform .12s,background .15s;
}
.nav-btn:active{transform:scale(.97)}
.nav-btn:disabled{opacity:.35;cursor:not-allowed}
.nav-btn.primary{
  background:var(--accent);
  color:#0a0a0c;
  border-color:var(--accent);
  flex:1.5;
}
.nav-btn svg{width:18px;height:18px}

/* Menu overlay */
.menu-overlay{
  position:fixed;
  inset:0;
  z-index:100;
  background:rgba(0,0,0,.6);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  display:none;
  opacity:0;
  transition:opacity .25s;
}
.menu-overlay.open{display:block;opacity:1}
.menu-panel{
  position:fixed;
  top:0;left:0;bottom:0;
  width:88%;
  max-width:360px;
  background:var(--surface);
  border-right:1px solid var(--border);
  padding:calc(20px + var(--safe-top)) 0 calc(20px + var(--safe-bottom));
  transform:translateX(-100%);
  transition:transform .3s cubic-bezier(.4,0,.2,1);
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}
.menu-overlay.open .menu-panel{transform:translateX(0)}
.menu-head{
  padding:0 22px 18px;
  border-bottom:1px solid var(--border-soft);
}
.menu-eyebrow{
  font-size:11px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--accent);
  font-weight:700;
  margin-bottom:4px;
}
.menu-title{
  font-family:'Fraunces',serif;
  font-size:24px;
  font-weight:600;
  margin:0;
  line-height:1.15;
}
.menu-progress-text{
  margin-top:14px;
  font-size:13px;
  color:var(--text-2);
}
.menu-progress-text b{color:var(--accent)}
.menu-list{
  padding:8px 12px 14px;
  flex:1;
}
/* Lesson complete */
.complete{
  text-align:center;
  padding:40px 20px;
  background:linear-gradient(135deg,var(--surface),var(--surface-2));
  border:1px solid var(--border);
  border-left:3px solid var(--success);
  border-radius:var(--radius);
  margin:30px 0;
}
.complete-icon{
  width:64px;height:64px;
  margin:0 auto 16px;
  border-radius:50%;
  background:var(--success-soft);
  border:2px solid var(--success);
  display:flex;align-items:center;justify-content:center;
}
.complete-icon svg{width:32px;height:32px;color:var(--success)}
.complete-title{
  font-family:'Fraunces',serif;
  font-size:24px;
  margin:0 0 8px;
  font-weight:600;
}
.complete-text{
  font-size:15px;
  color:var(--text-2);
  max-width:280px;
  margin:0 auto;
}

/* Welcome screen */
.welcome{
  text-align:center;
  padding:50px 10px 30px;
}
.welcome-badge{
  display:inline-block;
  padding:6px 14px;
  background:var(--accent-soft);
  border:1px solid var(--accent);
  border-radius:100px;
  font-size:11px;
  letter-spacing:.18em;
  text-transform:uppercase;
  font-weight:700;
  color:var(--accent);
  margin-bottom:24px;
}
.welcome-title{
  font-family:'Fraunces',serif;
  font-size:42px;
  line-height:1.05;
  font-weight:600;
  margin:0 0 20px;
  letter-spacing:-.015em;
}
.welcome-title em{color:var(--accent);font-style:italic}
.welcome-sub{
  font-size:17px;
  line-height:1.55;
  color:var(--text-2);
  margin:0 auto 32px;
  max-width:420px;
}
.welcome-features{
  display:flex;
  flex-direction:column;
  gap:14px;
  margin:0 auto 32px;
  max-width:380px;
  text-align:left;
}
.feature{
  display:flex;
  gap:14px;
  align-items:flex-start;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:14px 16px;
}
.feature-icon{
  width:38px;height:38px;
  border-radius:10px;
  background:var(--accent-soft);
  border:1px solid var(--accent);
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
  color:var(--accent);
}
.feature-icon svg{width:20px;height:20px}
.feature-content{flex:1}
.feature-title{font-weight:600;font-size:15px;margin-bottom:2px}
.feature-text{font-size:13.5px;color:var(--text-2);line-height:1.45}
.start-btn{
  padding:16px 36px;
  background:var(--accent);
  color:#0a0a0c;
  border:none;
  border-radius:14px;
  font-weight:700;
  font-size:16px;
  cursor:pointer;
  font-family:inherit;
  min-height:54px;
  letter-spacing:.01em;
  transition:transform .12s;
}
.start-btn:active{transform:scale(.97)}

/* Small adjustments */
@media (max-width:380px){
  .lesson-title{font-size:28px}
  .welcome-title{font-size:34px}
  .text-block{font-size:16px}
}

/* Scrollbar */
::-webkit-scrollbar{width:0;height:0}

/* Selection */
::selection{background:var(--accent);color:#000}

/* ==========================================================================
   Paywall (Stage 4) — shown when AccessDeniedError bubbles up during lesson
   navigation. CTA button hook is inline in ui.js#renderPaywall.
   ========================================================================== */
.paywall{
  max-width:520px;
  margin:5rem auto;
  padding:3rem 2rem;
  text-align:center;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:20px;
  font-family:'Manrope',sans-serif;
}
.paywall-icon{
  width:64px;height:64px;
  margin:0 auto 1.5rem;
  border-radius:50%;
  background:rgba(251,146,60,.12);
  color:var(--accent);
  display:flex;align-items:center;justify-content:center;
}
.paywall-icon svg{width:32px;height:32px}
.paywall-title{
  font-family:'Fraunces',serif;
  font-size:1.75rem;
  font-weight:700;
  color:var(--text);
  margin:0 0 .75rem;
}
.paywall-lead{
  color:var(--text-2);
  font-size:1rem;
  line-height:1.5;
  margin:0 0 .5rem;
}
.paywall-lesson{
  color:var(--text-3);
  font-size:.875rem;
  font-family:'JetBrains Mono',monospace;
  margin:0 0 2rem;
}
.paywall-cta{
  display:inline-block;
  padding:.9rem 2rem;
  border:none;
  border-radius:12px;
  background:var(--accent);
  color:#000;
  font-family:'Manrope',sans-serif;
  font-size:1rem;
  font-weight:700;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease;
}
.paywall-cta:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 20px rgba(251,146,60,.35);
}
.paywall-cta:active{
  transform:translateY(0);
}
.paywall-fine{
  color:var(--text-3);
  font-size:.75rem;
  margin-top:1.5rem;
}
/* ==========================================================================
   LANDING PAGE (Welcome screen) — premium SaaS feel
   ==========================================================================
   Activated by body.is-landing class (added in renderWelcome, removed on
   navigation to any lesson). Takes over the whole viewport and hides all
   app chrome (top-navbar, sidebar, bottom nav).

   Structure:
   - Animated orange radial gradient background (3 blobs, ~20-30s cycles)
   - Header: Syrax Academy brand + Notifications + User
   - Hero: Left (badge, title, desc, CTAs, stats) + Right (IDE mockup)
   - Features row: 4 cards with icons
   - Entrance animations: staggered fade+translateY
   - Hover animations: buttons scale, cards lift, editor glow, icons brighter
   ========================================================================== */

/* ─── When landing is active, hide all app chrome and let landing take over */
body.is-landing {
  overflow-y: auto;
  overflow-x: hidden;
}
body.is-landing .top-navbar,
body.is-landing .header,
body.is-landing .menu-overlay,
body.is-landing .col-resizer,
body.is-landing .bottom {
  display: none !important;
}
body.is-landing .app {
  display: block;
  height: auto;
  min-height: 100vh;
  max-width: none;
  margin: 0;
}
body.is-landing .main {
  grid-area: unset;
  width: 100%;
  height: auto;
  padding: 0;
  overflow: visible;
  display: block;
  animation: none;
}

/* Also reset the html/body hidden-scroll rule from desktop layout on landing */
body.is-landing,
body.is-landing html {
  height: auto;
  overflow: auto;
}

/* ─── Landing root ──────────────────────────────────────────────────────── */
.landing {
  position: relative;
  min-height: 100vh;
  padding: 32px 5vw 48px;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  overflow: hidden;
  isolation: isolate;                     /* contain the blur blobs */
}

/* ─── Animated orange gradient background ───────────────────────────────── */
.landing-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.landing-bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  will-change: transform, opacity;
}
.landing-bg-blob-1 {
  width: 900px; height: 900px;
  top: -250px; left: -200px;
  background: radial-gradient(circle at center, rgba(251, 146, 60, 0.35), rgba(251, 146, 60, 0) 65%);
  opacity: 0.6;
  animation: blob-drift-1 26s ease-in-out infinite;
}
.landing-bg-blob-2 {
  width: 700px; height: 700px;
  top: 30%; right: -180px;
  background: radial-gradient(circle at center, rgba(234, 88, 12, 0.28), rgba(234, 88, 12, 0) 65%);
  opacity: 0.5;
  animation: blob-drift-2 22s ease-in-out infinite;
}
.landing-bg-blob-3 {
  width: 650px; height: 650px;
  bottom: -200px; left: 40%;
  background: radial-gradient(circle at center, rgba(251, 191, 36, 0.22), rgba(251, 191, 36, 0) 65%);
  opacity: 0.45;
  animation: blob-drift-3 30s ease-in-out infinite;
}

@keyframes blob-drift-1 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33%      { transform: translate3d(120px, 80px, 0) scale(1.08); }
  66%      { transform: translate3d(-40px, 140px, 0) scale(0.95); }
}
@keyframes blob-drift-2 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.5; }
  50%      { transform: translate3d(-80px, -60px, 0) scale(1.12); opacity: 0.4; }
}
@keyframes blob-drift-3 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  40%      { transform: translate3d(60px, -100px, 0) scale(1.05); }
  70%      { transform: translate3d(-50px, -40px, 0) scale(0.92); }
}

/* Everything else in landing sits above the background */
.landing > *:not(.landing-bg) {
  position: relative;
  z-index: 1;
}

/* ─── Header ────────────────────────────────────────────────────────────── */
.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 32px;
  margin-bottom: 24px;
  animation: landing-fade-in 0.5s ease-out both;
}

.landing-brand {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  cursor: default;
}
.landing-brand::first-letter {
  color: var(--accent);
}

.landing-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.landing-notify-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: var(--text-2);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.landing-notify-btn svg {
  width: 20px; height: 20px;
  transition: transform 0.2s ease, color 0.2s ease;
}
.landing-notify-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}
.landing-notify-btn:hover svg {
  color: var(--accent);
  transform: rotate(-10deg);
}

.landing-user-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.landing-user-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  transform: translateY(-1px);
}
.landing-avatar {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}
.landing-userinfo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.landing-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.landing-user-plan {
  font-size: 12px;
  color: var(--text-3);
}
.landing-user-btn svg {
  width: 14px; height: 14px;
  color: var(--text-3);
}

/* ─── Hero grid: left content + right editor ────────────────────────────── */
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 80px;
  align-items: start;
  padding-top: 40px;
  padding-bottom: 40px;
}

.landing-left { min-width: 0; }
.landing-right { min-width: 0; }

/* ─── Badge ─────────────────────────────────────────────────────────────── */
.landing-badge {
  display: inline-block;
  padding: 8px 18px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 40px;
  animation: landing-fade-up 0.6s 0.1s ease-out both;
  background: rgba(251, 146, 60, 0.04);
}

/* ─── Title ─────────────────────────────────────────────────────────────── */
.landing-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(40px, 4vw, 60px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 32px;
}
.landing-title-line {
  display: block;
  animation: landing-fade-up 0.7s ease-out both;
}
.landing-title-line:nth-child(1) { animation-delay: 0.2s; }
.landing-title-line:nth-child(2) { animation-delay: 0.32s; }
.landing-title-line:nth-child(3) { animation-delay: 0.44s; }

.landing-accent-cs,
.landing-accent-unity {
  color: var(--accent);
  font-style: italic;
  font-weight: 700;
}

/* ─── Description ───────────────────────────────────────────────────────── */
.landing-desc {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-2);
  margin: 0 0 44px;
  max-width: 520px;
  animation: landing-fade-up 0.6s 0.55s ease-out both;
}

/* ─── CTAs ──────────────────────────────────────────────────────────────── */
.landing-ctas {
  display: flex;
  gap: 16px;
  margin-bottom: 56px;
  flex-wrap: wrap;
  animation: landing-fade-up 0.6s 0.7s ease-out both;
}

.landing-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border-radius: 14px;
  border: none;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.22s ease,
              background 0.2s ease,
              border-color 0.2s ease;
}
.landing-btn svg {
  width: 20px; height: 20px;
  transition: transform 0.3s ease;
}

.landing-btn-primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 6px 20px rgba(251, 146, 60, 0.28);
}
.landing-btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 32px rgba(251, 146, 60, 0.45);
}
.landing-btn-primary:hover svg {
  transform: translate(2px, -2px) rotate(-10deg);
}
.landing-btn-primary:active {
  transform: translateY(0) scale(0.99);
}

.landing-btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.landing-btn-secondary svg {
  color: var(--accent);
}
.landing-btn-secondary:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--accent);
  background: rgba(251, 146, 60, 0.05);
}
.landing-btn-secondary:hover svg {
  transform: scale(1.15);
}

/* ─── Stats ─────────────────────────────────────────────────────────────── */
.landing-stats {
  display: flex;
  gap: 48px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  animation: landing-fade-up 0.6s 0.85s ease-out both;
}

.landing-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.25s ease;
}
.landing-stat:hover {
  transform: translateY(-2px);
}
.landing-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: transform 0.3s ease;
}
.landing-stat-icon svg {
  width: 28px; height: 28px;
}
.landing-stat:hover .landing-stat-icon {
  transform: scale(1.15) rotate(-4deg);
}
.landing-stat-num {
  font-family: 'Fraunces', serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.landing-stat-label {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
}

.landing-tagline {
  font-size: 14px;
  color: var(--text-3);
  margin: 32px 0 0;
  animation: landing-fade-up 0.6s 1s ease-out both;
}

/* ─── Right side: editor mockup ─────────────────────────────────────────── */
.landing-right {
  animation: landing-fade-in-right 0.8s 0.4s ease-out both;
}

.landing-editor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  position: relative;
}
.landing-editor::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  background: linear-gradient(135deg, transparent, rgba(251, 146, 60, 0), transparent);
  opacity: 0;
  transition: opacity 0.4s ease, background 0.4s ease;
  z-index: -1;
  pointer-events: none;
}
.landing-editor:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5),
              0 0 60px rgba(251, 146, 60, 0.15);
}

.landing-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.landing-editor-dots {
  display: flex;
  gap: 8px;
}
.landing-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.landing-dot-r { background: #ff5f57; }
.landing-dot-y { background: #febc2e; }
.landing-dot-g { background: #28c840; }

.landing-editor-lang {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-3);
  font-weight: 600;
}

.landing-editor-body {
  padding: 24px 8px 24px 0;
  background: var(--surface);
}
.landing-code {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.85;
  color: var(--text);
  white-space: pre;
  overflow-x: auto;
}
.landing-code-line {
  display: block;
  padding-right: 20px;
}
.landing-code-lnum {
  display: inline-block;
  width: 48px;
  text-align: right;
  padding-right: 20px;
  color: var(--text-3);
  user-select: none;
  font-weight: 500;
}
/* Reuse existing syntax token classes: .kw .type .fn .str .num .com */

.landing-console {
  border-top: 1px solid var(--border);
  background: #0a0a0c;
}
.landing-console-header {
  padding: 14px 24px;
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}
.landing-console-body {
  padding: 4px 24px 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.7;
}
.landing-console-prompt {
  color: var(--text-3);
  margin-right: 8px;
}
.landing-console-out {
  color: #4ade80;
}
.landing-console-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--text);
  margin-left: 4px;
  vertical-align: middle;
  animation: landing-cursor-blink 1s steps(2, jump-none) infinite;
}

@keyframes landing-cursor-blink {
  50% { opacity: 0; }
}

/* ─── Features row ──────────────────────────────────────────────────────── */
.landing-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  padding-top: 24px;
}

.landing-feature {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.landing-feature:nth-child(1) { animation: landing-fade-up 0.5s 1.0s ease-out both; }
.landing-feature:nth-child(2) { animation: landing-fade-up 0.5s 1.1s ease-out both; }
.landing-feature:nth-child(3) { animation: landing-fade-up 0.5s 1.2s ease-out both; }
.landing-feature:nth-child(4) { animation: landing-fade-up 0.5s 1.3s ease-out both; }

.landing-feature:hover {
  transform: translateY(-4px);
  border-color: rgba(251, 146, 60, 0.4);
  background: rgba(24, 24, 27, 0.85);
}

.landing-feature-icon {
  width: 44px; height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 146, 60, 0.12);
  color: var(--accent);
  border-radius: 12px;
  transition: transform 0.3s ease, background 0.3s ease;
}
.landing-feature-icon svg {
  width: 22px; height: 22px;
}
.landing-feature:hover .landing-feature-icon {
  transform: scale(1.08) rotate(-5deg);
  background: rgba(251, 146, 60, 0.2);
}

.landing-feature-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}
.landing-feature-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-3);
}

/* ─── Entrance animation keyframes ──────────────────────────────────────── */
@keyframes landing-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes landing-fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes landing-fade-in-right {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Reduced motion — respect user preference ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .landing-bg-blob,
  .landing-badge,
  .landing-title-line,
  .landing-desc,
  .landing-ctas,
  .landing-stats,
  .landing-right,
  .landing-feature,
  .landing-header,
  .landing-tagline,
  .landing-console-cursor {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

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

/* Tablet: stack hero vertically */
@media (max-width: 1023px) {
  .landing { padding: 24px 4vw 32px; }
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .landing-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .landing-header {
    padding-bottom: 24px;
    margin-bottom: 16px;
  }
  .landing-user-btn .landing-userinfo { display: none; }
  .landing-user-btn svg { display: none; }
  .landing-notify-btn span { display: none; }
  .landing-title { font-size: clamp(32px, 8vw, 44px); }
}

/* Mobile: single column features */
@media (max-width: 640px) {
  .landing { padding: 16px 4vw 24px; }
  .landing-features {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .landing-hero { gap: 40px; }
  .landing-stats { gap: 24px; }
  .landing-stat-num { font-size: 24px; }
  .landing-brand { font-size: 22px; }
  .landing-badge { margin-bottom: 24px; }
  .landing-desc { margin-bottom: 32px; }
  .landing-ctas { margin-bottom: 40px; }
  .landing-btn { padding: 14px 22px; font-size: 14px; }
}

/* Wide desktop 1920+ */
@media (min-width: 1600px) {
  .landing {
    padding: 40px 80px 56px;
  }
  .landing-hero {
    max-width: 1440px;
    margin: 0 auto;
    gap: 100px;
  }
  .landing-features {
    max-width: 1440px;
    margin: 0 auto;
  }
  .landing-header {
    max-width: 1440px;
    margin: 0 auto 24px;
  }
}

/* Ultra-wide 2560+ */
@media (min-width: 2200px) {
  .landing-hero,
  .landing-features,
  .landing-header {
    max-width: 1600px;
  }
  .landing-title { font-size: 72px; }
  .landing-desc { font-size: 19px; }
}

/* ==========================================================================
   "How it works?" modal — reveal on landing "howBtn" click
   ========================================================================== */
.how-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.how-modal.how-modal-open {
  opacity: 1;
  pointer-events: auto;
}
.how-modal.how-modal-closing {
  opacity: 0;
}

.how-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.how-modal-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 40px 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(24px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.how-modal.how-modal-open .how-modal-panel {
  transform: translateY(0) scale(1);
}

.how-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.how-modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.how-modal-close svg { width: 20px; height: 20px; pointer-events: none; }

.how-modal-title {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 12px;
}
.how-modal-intro {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
  margin: 0 0 32px;
}

.how-steps {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.how-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  animation: how-step-in 0.5s var(--step-delay, 0s) ease-out both;
}
@keyframes how-step-in {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.how-step-num {
  width: 36px; height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #000;
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 700;
  border-radius: 50%;
}
.how-step-content { flex: 1; }
.how-step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.how-step-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
}

.how-modal-cta {
  width: 100%;
  padding: 16px 24px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 12px;
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.how-modal-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(251, 146, 60, 0.35);
}
.how-modal-cta:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .how-modal-panel { padding: 28px 20px 20px; border-radius: 20px; }
  .how-modal-title { font-size: 24px; }
  .how-step-num { width: 30px; height: 30px; font-size: 15px; }
}

/* ==========================================================================
   AUTH WIDGET (Stage 8) — Google sign-in button + user dropdown menu
   ==========================================================================
   Renders in two slots:
     #topnavUser      — inside .top-navbar on desktop (course view)
     #landingUserSlot — inside .landing-header on welcome screen

   Two variants toggle spacing/typography:
     .auth-widget-topnav   — compact for the header bar
     .auth-widget-landing  — larger for the landing hero header
   ========================================================================== */

/* ─── Sign-in button (anonymous state) ───────────────────────────────────── */
.auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fff;
  color: #1f1f1f;
  border: none;
  border-radius: 12px;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  background: #f9f9f9;
}
.auth-btn:active { transform: translateY(0); }
.auth-btn svg { flex-shrink: 0; }
.auth-btn-landing { padding: 12px 20px; font-size: 15px; border-radius: 14px; }

/* ─── User widget (signed-in state) ──────────────────────────────────────── */
.auth-widget {
  position: relative;
}

.auth-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.auth-user-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.auth-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.auth-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.auth-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
}

.auth-userinfo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  min-width: 0;
}
.auth-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-user-plan {
  font-size: 11px;
  color: var(--text-3);
}
.auth-widget-landing .auth-avatar     { width: 40px; height: 40px; font-size: 15px; }
.auth-widget-landing .auth-user-name  { font-size: 14px; }
.auth-widget-landing .auth-user-plan  { font-size: 12px; }

.auth-chevron {
  width: 14px; height: 14px;
  color: var(--text-3);
  transition: transform 0.2s ease;
}
.auth-user-btn[aria-expanded="true"] .auth-chevron {
  transform: rotate(180deg);
}

/* ─── Dropdown menu ──────────────────────────────────────────────────────── */
.auth-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  z-index: 1000;
  animation: auth-dropdown-in 0.15s ease-out;
}
.auth-dropdown[hidden] { display: none; }

@keyframes auth-dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.auth-dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-dropdown-email {
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}
.auth-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.auth-dropdown-item svg {
  width: 16px; height: 16px;
  color: var(--text-3);
  flex-shrink: 0;
}
.auth-dropdown-item:hover svg { color: var(--accent); }

/* ─── Landing slot: shift dropdown so it aligns with landing header ─── */
.landing-user-slot { display: flex; align-items: center; }
.landing-user-slot .auth-dropdown { top: calc(100% + 12px); }

/* ─── Mobile header slot: account access inside a lesson on phones ───────── */
.header-user-slot { display: flex; align-items: center; flex-shrink: 0; }
.header-user-slot .auth-dropdown { top: calc(100% + 10px); right: 0; }
/* Header variant is always avatar-only (the header row is tight). */
.auth-widget-header .auth-userinfo,
.auth-widget-header .auth-chevron { display: none; }
.auth-widget-header .auth-user-btn { padding: 2px; gap: 0; }
/* Signed-out: compact Google-icon button (text label preserved via aria-label). */
.auth-btn-header { padding: 9px; border-radius: 12px; }
.auth-btn-header span { display: none; }

/* ─── Topnav slot: fit inside the 56px navbar ─────────────────────────── */
.topnav-user-slot { display: flex; align-items: center; }

/* ─── Responsive: on narrow screens hide username, keep avatar+chevron ── */
@media (max-width: 640px) {
  .auth-userinfo { display: none; }
  .auth-user-btn { padding: 4px; }
  .auth-btn span { display: none; }
  .auth-btn { padding: 10px; }
}

/* ==========================================================================
   DESKTOP LAYOUT ≥1024px — pixel-accurate to reference mockup (Stage 9)
   ==========================================================================

   ┌─────────────────────────────────────────────────────────────────┐
   │  top-navbar  (Syrax Academy logo | Курс tab | 🔔 | avatar)             │
   ├──────────┬─────────────────────────────┬────────────────────────┤
   │          │                             │  РЕДАКТОР КОДА ▶ ЗАП.  │
   │ sidebar  │  breadcrumbs  Урок 02/07    │  ┌──────────────────┐  │
   │  280px   │                             │  │ line-numbered code│ │
   │          │  Title (Fraunces + italic)  │  │  65%              │  │
   │  progress│                             │  └──────────────────┘  │
   │  bar     │  Body copy paragraph        │  КОНСОЛЬ               │
   │          │                             │  ┌──────────────────┐  │
   │  БЛОК 0  │  ▲ Что происходит? callout  │  │ output 35%       │  │
   │  ЧАСТЬ 1 │                             │  └──────────────────┘  │
   │          │                             │                        │
   │  lessons │  ← Назад       Далее →      │                        │
   │  list    │  (space-between, not flex)  │                        │
   └──────────┴─────────────────────────────┴────────────────────────┘
                              100vh (no page scroll)
   ========================================================================== */

/* Hide desktop-only chrome on mobile */
.top-navbar { display: none; }

@media (min-width: 1024px) {

  /* ─── 1. Root — kill page scroll ────────────────────────────────────── */
  html, body { height: 100vh; overflow: hidden; }

  /* ─── 2. App master grid ────────────────────────────────────────────── */
  .app {
    max-width: none;
    margin: 0;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 500px;
    grid-template-rows: 56px 1fr;
    grid-template-areas:
      "navbar navbar  navbar"
      "side   center  work";
    height: 100vh;
    min-height: 0;
  }

  /* ─── 3. Top navbar ─────────────────────────────────────────────────── */
  .top-navbar {
    grid-area: navbar;
    display: flex;
    align-items: center;
    background: #0a0a0c;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    gap: 32px;
    height: 56px;
    z-index: 100;                       /* stays under auth dropdown (1500) */
  }
  .topnav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 232px;
  }
  .syrax-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .syrax-wordmark {
    font-family: 'Fraunces', serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
  }

  .topnav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;   /* the removed tab strip used to provide this push */
  }
  .topnav-notify {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-2);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
  }
  .topnav-notify:hover { background: var(--surface); color: var(--text); }
  .topnav-notify svg { width: 20px; height: 20px; }

  /* Mobile chrome — hide */
  .header { display: none !important; }
  .menu-btn { display: none; }

  /* ─── 4. Sidebar — repurpose .menu-overlay as pinned left column ────── */
  .menu-overlay {
    position: static;
    inset: auto;
    display: block;
    opacity: 1;
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    grid-area: side;
    height: 100%;
    overflow: hidden;
    border-right: 1px solid var(--border);
    z-index: auto;
    pointer-events: auto;
    transition: none;
  }
  .menu-panel {
    position: static;
    inset: auto;
    transform: none;
    width: 100%;
    max-width: none;
    height: 100%;
    padding: 0;
    border-right: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .menu-head {
    flex: 0 0 auto;
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border);
  }
  .menu-eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 12px;
  }
  .menu-title { display: none; }        /* eyebrow acts as title on desktop */
  .menu-progress-text { display: none; } /* replaced by richer .sm-progress card */

  .menu-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0 12px 24px;
  }

  /* ─── 5. Center panel — theory, 720px max-width, own scroll ─────────── */
  .main {
    grid-area: center;
    max-width: none;
    padding: 0;
    animation: none;
    min-height: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .main > .lesson-num,
  .main > .lesson-title {
    flex: 0 0 auto;
    max-width: 720px;
    width: 100%;
    padding-left: 40px;
    padding-right: 40px;
    margin-left: auto;
    margin-right: auto;
  }
  .main > .lesson-num { padding-top: 32px; }

  .lesson-split {
    flex: 1 1 auto;
    min-height: 0;
    display: contents;
  }
  .lesson-theory {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 40px 96px;             /* bottom padding = room for pinned nav */
    scrollbar-gutter: stable;
  }
  .lesson-theory > * {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }

  /* ─── 6. Right workspace — grid-area 'work' ─────────────────────────── */
  .lesson-workspace {
    grid-area: work;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border-left: 1px solid var(--border);
  }
  .lesson-workspace:empty { display: none; }
  .app:has(.lesson-workspace:empty) {
    grid-template-columns: 280px 1fr 0;
  }

  /* ─── 7. Bottom nav — pinned inside center column ────────────────────── */
  .bottom {
    grid-area: unset;
    position: absolute;
    left: var(--col-side, 280px);
    right: var(--col-work, 500px);
    bottom: 0;
    padding: 16px 40px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    max-width: none;
    z-index: 5;
    gap: 0;
  }
  .app:has(.lesson-workspace:empty) .bottom { right: 0; }

  /* Nav buttons — no flex:1 (they should be compact, not stretched) */
  .bottom .nav-btn {
    flex: 0 0 auto;
    min-width: 140px;
    padding: 14px 24px;
    border-radius: 12px;
    min-height: 48px;
    font-weight: 700;
    font-size: 14.5px;
  }

  /* ─── 8. Workspace internals — editor 65% + console 35% ──────────────── */
  .lesson-workspace .practice {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
  }
  .lesson-workspace .practice-badge,
  .lesson-workspace .practice-section,
  .lesson-workspace .practice-toggle { display: none; }

  .lesson-workspace .practice-editor {
    flex: 65 1 0;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: none;
    border-radius: 0;
    overflow: hidden;
    position: relative;
  }
  .lesson-workspace .practice-editor::before {
    content: "Редактор кода";
    display: block;
    padding: 14px 20px;
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex: 0 0 auto;
  }
  .lesson-workspace .practice-editor-textarea {
    flex: 1 1 auto;
    min-height: 0;
    padding-left: 52px !important;
    background: var(--surface);
    border: none;
    border-radius: 0;
    resize: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    line-height: 1.7;
  }
  .lesson-workspace .practice-editor::after {
    content: "1\A 2\A 3\A 4\A 5\A 6\A 7\A 8\A 9\A 10\A 11\A 12\A 13\A 14\A 15\A 16\A 17\A 18\A 19\A 20\A 21\A 22\A 23\A 24\A 25\A 26\A 27\A 28\A 29\A 30\A 31\A 32\A 33\A 34\A 35\A 36\A 37\A 38\A 39\A 40";
    position: absolute;
    left: 0;
    top: 44px;
    bottom: 0;
    width: 40px;
    padding: 12px 8px 12px 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-3);
    white-space: pre;
    pointer-events: none;
    overflow: hidden;
    user-select: none;
  }
  .lesson-workspace .practice-run-wrap {
    position: absolute;
    top: 6px;
    right: 16px;
    z-index: 2;
    padding: 0;
    margin: 0;
    background: transparent;
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .lesson-workspace .practice-run-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 8px;
  }
  .lesson-workspace .practice-output {
    flex: 35 1 0;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    background: #0a0a0c;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
  }
  .lesson-workspace .practice-output-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: #0a0a0c;
  }
  .lesson-workspace .practice-output-header::before {
    content: "Консоль";
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-2);
  }
  .lesson-workspace .practice-output-status { display: none; }
  .lesson-workspace .practice-output-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
    background: #0a0a0c;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    line-height: 1.7;
    max-height: none;
  }

  /* ─── Paywall — centered inside center column ────────────────────────── */
  .main .paywall { margin: auto; max-width: 520px; }
}

/* ─── Ultra-wide (≥1440px): more room ─────────────────────────────────── */
@media (min-width: 1440px) {
  .app {
    grid-template-columns: 300px minmax(0, 1fr) 560px;
  }
  .bottom { left: var(--col-side, 300px); right: var(--col-work, 560px); }
  .lesson-theory { padding-left: 56px; padding-right: 56px; }
  .lesson-theory > * { max-width: 760px; }
  .main > .lesson-num,
  .main > .lesson-title { padding-left: 56px; padding-right: 56px; }
}

/* ==========================================================================
   TIER LOCK OVERLAYS (Stage 9)
   ==========================================================================
   Shown inside .practice-locked (practice.js) and .task-locked (ui.js)
   containers when the user's plan doesn't grant access to that feature.
   ========================================================================== */
.tier-lock {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px;
  background: linear-gradient(180deg, rgba(251,146,60,0.06), rgba(24,24,27,0.4));
  border: 1px solid rgba(251, 146, 60, 0.3);
  border-radius: 16px;
  margin: 8px 0 16px;
}
.tier-lock-icon {
  width: 56px; height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 146, 60, 0.12);
  color: var(--accent);
  border-radius: 50%;
  margin-bottom: 16px;
}
.tier-lock-icon svg { width: 28px; height: 28px; }
.tier-lock-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.tier-lock-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  max-width: 380px;
  margin-bottom: 20px;
}
.tier-lock-cta {
  padding: 12px 24px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 10px;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.tier-lock-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(251, 146, 60, 0.35);
}

/* Workspace editor lock — overlay covering the editor area for non-Pro users */
.workspace-editor-lock {
  position: absolute;
  inset: 44px 0 0 0;  /* below the "РЕДАКТОР КОДА" header */
  background: rgba(24, 24, 27, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* ==========================================================================
   AUTH DROPDOWN — bump z-index above workspace (fixes overlap bug)
   ========================================================================== */
.auth-dropdown { z-index: 2000; }

/* ==========================================================================
   LANDING PAGE — Stage 9 overrides
   ==========================================================================
   Fixes from prior stage:
   - Force fit into 100vh on desktop (no scroll)
   - Syrax Academy logo (SVG + wordmark) instead of plain text
   - Animated "#" watermark on the right
   - Ensure blob animations actually run (was: opacity/transform got squashed)
   ========================================================================== */

/* Syrax Academy logo styling in landing header */
.landing-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.landing-brand::first-letter { color: inherit; }   /* revert old orange-first-letter hack */
.landing-brand .syrax-logo { display: inline-flex; }
.landing-brand .syrax-wordmark {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 700;
}

/* Animated giant "#" watermark on the right side of landing */
.landing-watermark {
  position: absolute;
  top: 3vh;
  right: -3vw;
  font-family: 'Fraunces', serif;
  font-size: clamp(280px, 42vw, 640px);
  font-weight: 700;
  color: var(--accent);
  opacity: 0.08;
  line-height: 0.85;
  user-select: none;
  pointer-events: none;
  will-change: transform, opacity;
  animation: watermark-float 18s ease-in-out infinite;
  z-index: 0;
}
@keyframes watermark-float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg);   opacity: 0.06; }
  50%      { transform: translate3d(-40px, 30px, 0) rotate(-3deg); opacity: 0.10; }
}

/* Force landing to fit into a single viewport on desktop (no scroll) */
@media (min-width: 1024px) {
  body.is-landing,
  body.is-landing html {
    height: 100vh;
    overflow: hidden;                   /* the *landing itself* doesn't scroll */
  }
  .landing {
    height: 100vh;
    max-height: 100vh;
    min-height: 0;
    overflow: hidden;
    padding: 20px 4vw 20px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 16px;
  }
  .landing-header {
    margin: 0;
    padding: 0;
    animation: landing-fade-in 0.4s ease-out both;
  }
  .landing-hero {
    padding: 0;
    align-items: center;
    gap: 48px;
    min-height: 0;
  }
  .landing-features {
    padding: 0;
    margin-top: 0;
  }

  /* Slightly compress title on shorter screens */
  .landing-title { font-size: clamp(34px, 3.4vw, 52px); margin-bottom: 20px; }
  .landing-desc  { margin-bottom: 28px; font-size: 15.5px; }
  .landing-ctas  { margin-bottom: 32px; }
  .landing-stats { margin-bottom: 12px; gap: 36px; }
  .landing-tagline { margin-top: 20px; }

  /* Editor mockup: cap max height so it doesn't blow up the vertical budget */
  .landing-editor { max-height: 60vh; }

  /* Feature cards more compact */
  .landing-feature {
    padding: 16px 18px;
    gap: 14px;
  }
  .landing-feature-icon {
    width: 40px; height: 40px;
  }
  .landing-feature-icon svg { width: 20px; height: 20px; }
  .landing-feature-title { font-size: 14px; margin-bottom: 4px; }
  .landing-feature-desc  { font-size: 12.5px; line-height: 1.45; }
}

/* Even shorter screens (like 1366×768) — squeeze further */
@media (min-width: 1024px) and (max-height: 800px) {
  .landing-title { font-size: 34px; margin-bottom: 14px; }
  .landing-desc  { margin-bottom: 20px; font-size: 14.5px; line-height: 1.55; }
  .landing-ctas  { margin-bottom: 22px; }
  .landing-stats { margin-bottom: 8px; gap: 28px; }
  .landing-stat-num { font-size: 24px; }
  .landing-tagline { margin-top: 14px; font-size: 13px; }
  .landing-badge { margin-bottom: 20px; padding: 6px 14px; font-size: 12px; }
  .landing-editor { max-height: 52vh; }
  .landing-editor-body { padding: 14px 8px 14px 0; }
  .landing-code { font-size: 13px; line-height: 1.7; }
  .landing-feature { padding: 12px 14px; }
  .landing-feature-title { font-size: 13.5px; }
  .landing-feature-desc  { font-size: 12px; }
}

/* Make sure the animated blobs REALLY run — some older CSS may inherit
   animation: none. Explicit re-declaration wins in cascade. */
.landing-bg-blob { animation-play-state: running !important; }

/* ==========================================================================
   PRICING MODAL (Stage 10) — 4-plan comparison + Paddle checkout trigger
   ==========================================================================
   Opens over the whole app. Backdrop blur, centered card, entrance from
   translateY. Same animation timing as .how-modal for consistency.
   ========================================================================== */

.pricing-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;                       /* above auth dropdown (2000) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.pricing-modal.pricing-modal-open   { opacity: 1; pointer-events: auto; }
.pricing-modal.pricing-modal-closing { opacity: 0; }

.pricing-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}

.pricing-modal-panel {
  position: relative;
  width: 100%;
  max-width: 1120px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 40px 32px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  transform: translateY(24px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pricing-modal.pricing-modal-open .pricing-modal-panel {
  transform: translateY(0) scale(1);
}

.pricing-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.pricing-modal-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.pricing-modal-close svg { width: 20px; height: 20px; }

.pricing-modal-head {
  text-align: center;
  margin-bottom: 32px;
}
.pricing-modal-title {
  font-family: 'Fraunces', serif;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 12px;
}
.pricing-modal-subtitle {
  font-size: 16px;
  color: var(--text-2);
  margin: 0;
}

.pricing-reason-banner {
  padding: 14px 20px;
  margin-bottom: 24px;
  background: rgba(251, 146, 60, 0.12);
  border: 1px solid rgba(251, 146, 60, 0.4);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  text-align: center;
}

/* ─── Grid of plans ─────────────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 1024px) {
  .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

.pricing-card {
  position: relative;
  padding: 28px 22px 24px;
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.pricing-card:hover {
  transform: translateY(-3px);
  border-color: rgba(251, 146, 60, 0.35);
}
.pricing-card-highlight {
  border-color: var(--accent);
  background: rgba(251, 146, 60, 0.04);
  box-shadow: 0 12px 32px rgba(251, 146, 60, 0.15);
}
.pricing-card-current {
  border-color: rgba(74, 222, 128, 0.4);
}

.pricing-recommended-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  white-space: nowrap;
}
.pricing-launch-badge {
  padding: 4px 10px;
  background: rgba(251, 146, 60, 0.15);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 6px;
  align-self: flex-start;
  margin-bottom: 8px;
}

.pricing-card-head { margin-bottom: 20px; }
.pricing-card-name {
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.pricing-card-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.pricing-card-price-num {
  font-family: 'Fraunces', serif;
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}
.pricing-card-price-cadence {
  font-size: 13px;
  color: var(--text-3);
}

.pricing-features {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pricing-feature {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
}
.pricing-feature-check {
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}
.pricing-feature-limit { color: var(--text-3); }
.pricing-feature-cross {
  color: var(--text-3);
  font-weight: 700;
  flex-shrink: 0;
}

.pricing-cta {
  padding: 14px 20px;
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
}
.pricing-cta-current {
  background: transparent;
  color: var(--text-3);
  cursor: not-allowed;
  border-color: var(--border);
}
.pricing-cta-upgrade {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.pricing-cta-upgrade:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(251, 146, 60, 0.35);
}
.pricing-card-highlight .pricing-cta-upgrade {
  box-shadow: 0 6px 20px rgba(251, 146, 60, 0.25);
}

.pricing-modal-fine {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  margin: 8px 0 0;
}

/* ==========================================================================
   PURCHASE SUCCESS TOAST — bottom-right slide-in
   ========================================================================== */
.pricing-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 4000;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px 16px 16px;
  background: var(--surface);
  border: 1px solid rgba(74, 222, 128, 0.4);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  max-width: 380px;
}
.pricing-toast.pricing-toast-open {
  transform: translateX(0);
  opacity: 1;
}
.pricing-toast-icon {
  width: 40px; height: 40px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border-radius: 50%;
}
.pricing-toast-icon svg { width: 20px; height: 20px; }
.pricing-toast-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.pricing-toast-desc  { font-size: 12.5px; color: var(--text-2); }

/* ==========================================================================
   LOCK ICON in sidebar menu items (Stage 10)
   ========================================================================== */
/* ==========================================================================
   PERSISTENT SCRATCH WORKSPACE (Stage 11)
   ==========================================================================
   Shown in .lesson-workspace when the current lesson has no `practice` block.
   Ensures the IDE layout is visible on every lesson, matching Image 2.
   ========================================================================== */

.scratch-workspace {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* Fullscreen mode — same element, just repositioned (state fully preserved). */
.scratch-workspace.is-fullscreen {
  position: fixed;
  inset: 0;
  height: auto;
  z-index: 2000;
  background: var(--surface);
}

/* Icon-only toolbar button (fullscreen toggle) */
.scratch-btn-icon { padding: 8px; }
.scratch-btn-icon svg { width: 14px; height: 14px; }
.scratch-btn-icon .ic-compress { display: none; }
.scratch-workspace.is-fullscreen .scratch-btn-icon .ic-expand { display: none; }
.scratch-workspace.is-fullscreen .scratch-btn-icon .ic-compress { display: inline; }

/* "Открыть редактор" launcher — shown after the editor is closed */
.scratch-reopen {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 120px;
  background: var(--surface);
  border: none;
  color: var(--text-2);
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.scratch-reopen:hover { background: var(--surface-2); color: var(--text); }
.scratch-reopen svg { width: 16px; height: 16px; }
.scratch-reopen[hidden] { display: none; }

.scratch-editor {
  flex: 65 1 0;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
  position: relative;
}

.scratch-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex: 0 0 auto;
}
.scratch-editor-label {
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}
.scratch-editor-actions {
  display: flex;
  gap: 8px;
}
.scratch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font-family: 'Manrope', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.scratch-btn svg {
  width: 12px; height: 12px;
}
.scratch-btn-secondary {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.scratch-btn-secondary:hover {
  background: var(--surface-2);
  color: var(--text);
}
.scratch-btn-primary {
  background: var(--accent);
  color: #000;
}
.scratch-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(251, 146, 60, 0.35);
}
.scratch-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.scratch-editor-textarea {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  padding: 16px 20px 16px 52px;      /* line-numbers overlay space */
  background: var(--surface);
  color: var(--text);
  border: none;
  outline: none;
  resize: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 1.7;
  tab-size: 4;
}
.scratch-editor-textarea:read-only {
  color: var(--text-2);
  cursor: not-allowed;
}

/* Line numbers gutter — same technique as practice editor */
.scratch-editor::after {
  content: "1\A 2\A 3\A 4\A 5\A 6\A 7\A 8\A 9\A 10\A 11\A 12\A 13\A 14\A 15\A 16\A 17\A 18\A 19\A 20\A 21\A 22\A 23\A 24\A 25\A 26\A 27\A 28\A 29\A 30";
  position: absolute;
  left: 0;
  top: 42px;
  bottom: 0;
  width: 40px;
  padding: 16px 8px 0 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-3);
  white-space: pre;
  pointer-events: none;
  overflow: hidden;
  user-select: none;
}

.scratch-console {
  flex: 35 1 0;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  background: #0a0a0c;
  border-top: 1px solid var(--border);
  overflow: hidden;
}
.scratch-console-header {
  padding: 12px 20px;
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.scratch-console-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
}
.scratch-console-prompt { color: var(--text-3); margin-right: 6px; }
.scratch-console-out    { color: #4ade80; }
.scratch-console-cursor {
  display: inline-block;
  width: 7px; height: 14px;
  background: var(--text);
  vertical-align: middle;
  animation: landing-cursor-blink 1s steps(2, jump-none) infinite;
}
/* Inline input row for Console.ReadLine() in the scratch console */
.scratch-console-inputrow { display: flex; align-items: center; }
.scratch-console-input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #4ade80;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 1.7;
  caret-color: var(--accent);
  padding: 0;
}
.scratch-console-input::placeholder { color: var(--text-3); opacity: 0.55; }

/* Ensure workspace column stays visible when scratch is rendered */
.app:has(.lesson-workspace:not(:empty)) .bottom {
  right: 500px;
}

/* ==========================================================================
   SIDEBAR SAFETY RULES (Stage 11)
   ==========================================================================
   Defensive overrides — ensure the desktop sidebar is always visible and
   sized correctly, even if other rules cascade weird.
   ========================================================================== */
@media (min-width: 1024px) {
  .app > .menu-overlay,
  .menu-overlay {
    display: block !important;
    grid-area: side !important;
    height: 100% !important;
    width: auto !important;
  }
  /* Fail-safe: if renderMenu didn't populate, at least show the eyebrow label
     so the user sees the sidebar exists (helps debug). */
  .menu-list:empty::before {
    content: "Загрузка программы курса…";
    display: block;
    padding: 20px 16px;
    font-size: 12px;
    color: var(--text-3);
    font-style: italic;
  }
}


/* ==========================================================================
   WORKSPACE COLUMN (Stage 12 fix) — DOM restructure
   ==========================================================================
   .workspace-column is a direct child of .app now (sibling of <main>). It
   receives grid-area: work. Practice/scratch content still uses the old
   .lesson-workspace class name for content styling; we alias here so nothing
   breaks and the layout works.
   ========================================================================== */

.workspace-column {
  /* Mirror .lesson-workspace layout semantics */
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  border-left: 1px solid var(--border);
}
.workspace-column:empty { display: none; }

@media (min-width: 1024px) {
  .workspace-column {
    grid-area: work;
    height: 100%;
  }
  /* Every .practice or .scratch-workspace inside the column follows the same
     rules as the old .lesson-workspace children. */
  .workspace-column .practice {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
  }
  .workspace-column .practice-badge,
  .workspace-column .practice-section,
  .workspace-column .practice-toggle { display: none; }
  .workspace-column .practice-editor {
    flex: 65 1 0;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: none;
    border-radius: 0;
    overflow: hidden;
    position: relative;
  }
  .workspace-column .practice-editor::before {
    content: "Редактор кода";
    display: block;
    padding: 14px 20px;
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex: 0 0 auto;
  }
  .workspace-column .practice-editor-textarea {
    flex: 1 1 auto;
    min-height: 0;
    padding-left: 52px !important;
    background: var(--surface);
    border: none;
    border-radius: 0;
    resize: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    line-height: 1.7;
  }
  .workspace-column .practice-editor::after {
    content: "1\A 2\A 3\A 4\A 5\A 6\A 7\A 8\A 9\A 10\A 11\A 12\A 13\A 14\A 15\A 16\A 17\A 18\A 19\A 20\A 21\A 22\A 23\A 24\A 25\A 26\A 27\A 28\A 29\A 30";
    position: absolute;
    left: 0;
    top: 44px;
    bottom: 0;
    width: 40px;
    padding: 12px 8px 12px 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-3);
    white-space: pre;
    pointer-events: none;
    overflow: hidden;
    user-select: none;
  }
  .workspace-column .practice-run-wrap {
    position: absolute;
    top: 6px;
    right: 16px;
    z-index: 2;
    padding: 0;
    margin: 0;
    background: transparent;
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .workspace-column .practice-output {
    flex: 35 1 0;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    background: #0a0a0c;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
  }
  .workspace-column .practice-output-header::before {
    content: "Консоль";
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-2);
  }
  .workspace-column .practice-output-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
    background: #0a0a0c;
  }
}

/* Also — the old .lesson-split wrapper no longer exists. Remove any style
   dependency by giving .lesson-theory a direct parent (main). */
@media (min-width: 1024px) {
  .main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .main > .lesson-theory {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 40px 96px;
    scrollbar-gutter: stable;
  }
  .main > .lesson-theory > * {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Empty workspace column on mobile: collapse it entirely */
@media (max-width: 1023px) {
  /* The scratch editor (right IDE column on desktop) was fully hidden on mobile,
     which removed the whole editor + console + ReadLine + fullscreen stack from
     phones. On mobile the .app is a flex column, so the panel simply stacks
     below the lesson body. It reuses the exact same editor/console/fullscreen/
     close-reopen code — only sized for a stacked, scrollable layout here. */
  .workspace-column {
    display: flex;
    height: auto;
    overflow: visible;
    border-left: none;
    border-top: 1px solid var(--border);
    /* clear the fixed bottom nav so the Run button / console never hide under it */
    margin-bottom: calc(96px + var(--safe-bottom));
  }
  .workspace-column:empty { display: none; }   /* keep hidden on the landing screen */

  .scratch-workspace {
    height: 72vh;
    min-height: 420px;
  }

  /* Fullscreen mode on phones — respect the notch / home-indicator safe areas. */
  .scratch-workspace.is-fullscreen {
    height: auto;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    margin-bottom: 0;
  }
}


/* ==========================================================================
   STAGE 13 FIXES — sidebar polish + defensive rules
   ========================================================================== */

/* Defensive: make sure scratch-editor is a positioning parent for its overlays */
.scratch-editor {
  position: relative;
}

/* Sidebar eyebrow polish */
@media (min-width: 1024px) {
  .menu-eyebrow {
    color: var(--text-3);
    font-size: 10.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 700;
  }
}


/* ==========================================================================
   Resizable columns (Task #2) — desktop only. Widths driven by CSS vars,
   overrides the fixed grid-template-columns above (same specificity, later).
   ========================================================================== */
@media (min-width: 1024px) {
  .app {
    position: relative;
    grid-template-columns: var(--col-side, 280px) minmax(0, 1fr) var(--col-work, 500px);
  }
  .col-resizer {
    position: absolute;
    top: 56px;              /* below the navbar row */
    bottom: 0;
    width: 10px;
    transform: translateX(-50%);
    cursor: col-resize;
    z-index: 50;
    background: transparent;
    touch-action: none;
  }
  .col-resizer::after {
    content: '';
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    width: 1px;
    transform: translateX(-50%);
    background: var(--border);
    transition: background .15s ease, width .15s ease;
  }
  .col-resizer:hover::after,
  .col-resizer:active::after { width: 3px; background: var(--accent); }
  .col-resizer-left  { left: var(--col-side, 280px); }
  .col-resizer-right { left: auto; right: var(--col-work, 500px); }
}
@media (max-width: 1023px) {
  .col-resizer { display: none; }
}

/* ==========================================================================
   Syntax-highlight overlay (Task #3) — transparent textarea over a
   highlighted <pre>. Glyph metrics are copied from the textarea in JS.
   ========================================================================== */
.hl-wrap { position: relative; display: block; }
.hl-layer {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  box-sizing: border-box;
  background: transparent;
  border: 0;
}
.hl-layer > code {
  display: block;
  box-sizing: border-box;
  white-space: pre;
  width: max-content;
  min-width: 100%;
  margin: 0;
  background: transparent;
  will-change: transform;
}
.hl-wrap > textarea {
  position: relative;
  z-index: 1;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: var(--accent);
}
.hl-wrap > textarea::selection { background: rgba(251,146,60,.28); }
.hl-wrap > textarea::-moz-selection { background: rgba(251,146,60,.28); }

/* Line-number gutter (rendered + scroll-synced by highlight.js). Replaces the
   old static CSS ::after gutters, which used a fixed number list and a guessed
   offset and drifted out of sync. */
.hl-gutter {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 44px;
  overflow: hidden;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 2;
  pointer-events: none;
  box-sizing: border-box;
}
.hl-gutter-lines {
  position: absolute;
  top: 0; left: 0; right: 8px;
  margin: 0;
  text-align: right;
  white-space: pre;
  color: var(--text-3);
  will-change: transform;
}
/* Retire the old static gutters — the synced .hl-gutter above replaces them. */
.scratch-editor::after,
.lesson-workspace .practice-editor::after,
.workspace-column .practice-editor::after { content: none !important; }

/* ==========================================================================
   FEEDBACK — user form + owner admin panel.
   Shares the pricing/how-modal chrome (same tokens, radius, pop-in). Additive:
   all classes are new (.feedback-modal / .fb-*), nothing existing is touched.
   ========================================================================== */
.feedback-modal {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.feedback-modal.feedback-modal-open    { opacity: 1; pointer-events: auto; }
.feedback-modal.feedback-modal-closing { opacity: 0; }

.feedback-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}
.feedback-modal-panel {
  position: relative;
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px 32px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  transform: translateY(24px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.feedback-modal.feedback-modal-open .feedback-modal-panel { transform: translateY(0) scale(1); }
.feedback-modal--admin .feedback-modal-panel { max-width: 900px; }

.feedback-modal-close {
  position: absolute; top: 20px; right: 20px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 10px;
  color: var(--text-2); cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.feedback-modal-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.feedback-modal-close svg { width: 20px; height: 20px; }

.feedback-modal-title {
  font-family: 'Fraunces', serif; font-size: 28px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text); margin: 0 0 8px;
}
.feedback-modal-subtitle { font-size: 14.5px; color: var(--text-2); margin: 0 0 24px; line-height: 1.5; }

/* ── User form ── */
.fb-label {
  display: block; font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); margin: 18px 0 8px;
}
.fb-optional { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-3); }

.fb-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-cat {
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: transparent; color: var(--text-2);
  font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.fb-cat:hover { color: var(--text); border-color: var(--text-3); }
.fb-cat.is-active { background: var(--accent); border-color: var(--accent); color: #0a0a0c; }

.fb-input, .fb-textarea {
  width: 100%; box-sizing: border-box; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-family: 'Manrope', sans-serif; font-size: 14.5px;
  outline: none; transition: border-color .15s;
}
.fb-input:focus, .fb-textarea:focus { border-color: var(--accent); }
.fb-textarea { resize: vertical; min-height: 110px; line-height: 1.5; }

.fb-stars { display: flex; gap: 6px; }
.fb-star {
  width: 38px; height: 38px; padding: 0; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer; color: var(--text-3);
  transition: transform .1s ease, color .12s ease;
}
.fb-star:hover { transform: scale(1.12); }
.fb-star svg { width: 26px; height: 26px; }
.fb-star.is-on { color: var(--accent); }

.fb-shot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fb-shot-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
  border: 1px dashed var(--border); border-radius: 10px; color: var(--text-2);
  font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.fb-shot-btn:hover { border-color: var(--accent); color: var(--text); }
.fb-shot-preview { position: relative; }
.fb-shot-preview img { max-height: 64px; border-radius: 8px; border: 1px solid var(--border); display: block; }
.fb-shot-remove {
  position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: #ef4444; color: #fff; font-size: 14px; line-height: 1; cursor: pointer;
}

.fb-error {
  margin-top: 14px; padding: 10px 14px; border-radius: 10px;
  background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5; font-size: 13.5px;
}
.fb-submit {
  width: 100%; margin-top: 22px; padding: 14px; border: none; border-radius: 12px;
  background: var(--accent); color: #0a0a0c;
  font-family: 'Manrope', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform .12s ease, opacity .15s ease;
}
.fb-submit:hover:not(:disabled) { transform: translateY(-1px); }
.fb-submit:disabled { opacity: .6; cursor: default; }

.fb-success { text-align: center; padding: 20px 0 8px; }
.fb-success-icon {
  width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(251, 146, 60, 0.15); color: var(--accent);
}
.fb-success-icon svg { width: 32px; height: 32px; }

/* ── Owner admin ── */
.fb-admin-head { margin-bottom: 20px; }
.fb-admin-controls { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-top: 16px; }
.fb-admin-filters, .fb-admin-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fb-chip {
  padding: 7px 13px; border-radius: 9px; border: 1px solid var(--border);
  background: transparent; color: var(--text-2);
  font-family: 'Manrope', sans-serif; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s; white-space: nowrap;
}
.fb-chip:hover { color: var(--text); border-color: var(--text-3); }
.fb-chip.is-active { background: var(--accent); border-color: var(--accent); color: #0a0a0c; }
.fb-chip-danger { color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.fb-chip-danger:hover { background: rgba(239, 68, 68, 0.12); color: #ef4444; border-color: #ef4444; }
.fb-search { width: 220px; max-width: 100%; padding: 8px 12px; font-size: 13px; }

.fb-admin-list { display: flex; flex-direction: column; gap: 14px; }
.fb-admin-empty { text-align: center; color: var(--text-3); padding: 40px 0; font-size: 14px; }

.fb-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; background: var(--surface-2); }
.fb-card.is-read { opacity: .62; }
.fb-card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.fb-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.fb-badge-bug     { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.fb-badge-feature { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.fb-badge-general { background: rgba(251, 146, 60, 0.15); color: var(--accent); }
.fb-badge-other   { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.fb-card-stars { color: var(--accent); font-size: 14px; letter-spacing: 2px; }
.fb-card-date { color: var(--text-3); font-size: 12.5px; margin-left: auto; }
.fb-card-readtag { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.fb-card-title { font-family: 'Manrope', sans-serif; font-size: 15.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.fb-card-desc { font-size: 14px; color: var(--text-2); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.fb-card-shot { display: inline-block; margin-top: 10px; }
.fb-card-shot img { max-height: 120px; border-radius: 10px; border: 1px solid var(--border); display: block; }
.fb-card-meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3);
}
.fb-card-meta b { color: var(--text-2); font-weight: 600; }
.fb-card-ua { flex-basis: 100%; word-break: break-all; }
.fb-card-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ── Responsive: full-screen sheet on phones ── */
@media (max-width: 600px) {
  .feedback-modal { padding: 0; align-items: stretch; }
  .feedback-modal-panel,
  .feedback-modal--admin .feedback-modal-panel {
    max-width: none; border-radius: 0; max-height: none; min-height: 100vh;
    padding: calc(28px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  }
  .feedback-modal-title { font-size: 24px; }
  .fb-admin-controls { flex-direction: column; align-items: stretch; }
  .fb-search { width: 100%; }
  .fb-card-date { margin-left: 0; }
}

/* ==========================================================================
   SETTINGS — full account settings modal (5 sections).
   Shares the pricing/feedback modal chrome + tokens. Additive: all classes are
   new (.settings-modal / .set-*), nothing existing is touched.
   ========================================================================== */
.settings-modal {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.settings-modal.settings-modal-open    { opacity: 1; pointer-events: auto; }
.settings-modal.settings-modal-closing { opacity: 0; }

.settings-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}
.settings-modal-panel {
  position: relative;
  width: 100%; max-width: 640px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 36px 32px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  transform: translateY(24px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.settings-modal.settings-modal-open .settings-modal-panel { transform: translateY(0) scale(1); }

.settings-modal-close {
  position: absolute; top: 20px; right: 20px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 10px;
  color: var(--text-2); cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.settings-modal-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.settings-modal-close svg { width: 20px; height: 20px; }

.settings-modal-title {
  font-family: 'Fraunces', serif; font-size: 30px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text); margin: 0 0 20px;
}

/* ── Tabs ── */
.set-tabs {
  display: flex; gap: 6px; margin-bottom: 22px;
  border-bottom: 1px solid var(--border); padding-bottom: 2px;
  overflow-x: auto; scrollbar-width: none;
}
.set-tabs::-webkit-scrollbar { display: none; }
.set-tab {
  padding: 9px 14px; border: none; background: transparent;
  color: var(--text-2); font-family: 'Manrope', sans-serif; font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -3px;
  transition: color .15s ease, border-color .15s ease;
}
.set-tab:hover { color: var(--text); }
.set-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Cards ── */
.set-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px;
}
.set-field-label {
  display: block; font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); margin: 18px 0 8px;
}
.set-field-label:first-child { margin-top: 0; }
.set-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-family: 'Manrope', sans-serif; font-size: 14.5px;
  outline: none; transition: border-color .15s ease;
}
.set-input:focus { border-color: var(--accent); }
.set-hint { font-size: 12.5px; color: var(--text-3); margin-top: 10px; line-height: 1.5; }

/* ── Buttons ── */
.set-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; cursor: pointer;
  font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 700;
  border: 1px solid transparent; transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.set-btn:disabled { opacity: .6; cursor: default; }
.set-btn-primary { background: var(--accent); color: #0a0a0c; }
.set-btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.set-btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.set-btn-ghost:hover { color: var(--text); border-color: var(--text-3); }
.set-btn-danger { background: transparent; border-color: rgba(239,68,68,0.4); color: #fca5a5; }
.set-btn-danger:hover { background: rgba(239,68,68,0.12); color: #ef4444; border-color: #ef4444; }
.set-btn-block { width: 100%; margin-bottom: 10px; }
.set-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ── Profile: avatar ── */
.set-profile-top { display: flex; align-items: center; gap: 18px; margin-bottom: 6px; }
.set-avatar {
  width: 76px; height: 76px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
}
.set-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.set-avatar-fallback { font-family: 'Fraunces', serif; font-size: 30px; font-weight: 700; color: var(--accent); }
.set-profile-actions { min-width: 0; }

/* ── Subscription ── */
.set-plan-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-plan-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.set-plan-name { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 700; color: var(--text); }
.set-plan-badge { padding: 5px 12px; border-radius: 20px; background: rgba(251,146,60,0.15); color: var(--accent); font-size: 13px; font-weight: 700; white-space: nowrap; }
.set-plan-expiry { margin-top: 12px; font-size: 13.5px; color: var(--text-2); }
.set-plan-expiry b { color: var(--text); }
.set-plan-features { list-style: none; margin: 16px 0 20px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.set-plan-features li { position: relative; padding-left: 26px; font-size: 14px; color: var(--text-2); line-height: 1.45; }
.set-plan-features li::before {
  content: ''; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(251,146,60,0.15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fb923c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/12px no-repeat;
}
.set-plan-row + .set-btn, .set-plan-features + .set-btn { margin-top: 4px; }

/* ── Toggle switches ── */
.set-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.set-toggle:last-of-type { border-bottom: none; }
.set-toggle-label { font-size: 14.5px; color: var(--text); }
.set-switch { position: relative; flex-shrink: 0; width: 44px; height: 26px; }
.set-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.set-switch-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  transition: background .18s ease, border-color .18s ease;
}
.set-switch-track::before {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-2); transition: transform .18s ease, background .18s ease;
}
.set-switch input:checked + .set-switch-track { background: var(--accent); border-color: var(--accent); }
.set-switch input:checked + .set-switch-track::before { transform: translateX(18px); background: #0a0a0c; }

/* ── Language ── */
.set-lang { display: flex; gap: 8px; }
.set-lang-btn {
  flex: 1; padding: 11px; border-radius: 12px; border: 1px solid var(--border);
  background: transparent; color: var(--text-2);
  font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.set-lang-btn:hover { color: var(--text); border-color: var(--text-3); }
.set-lang-btn.is-active { background: var(--accent); border-color: var(--accent); color: #0a0a0c; }

.set-divider { height: 1px; background: var(--border); margin: 18px 0; }
.set-acct-email { font-size: 14px; color: var(--text-2); margin-bottom: 16px; word-break: break-word; }
.set-error { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.4); color: #fca5a5; font-size: 13.5px; }

/* ── Responsive: full-screen sheet on phones ── */
@media (max-width: 600px) {
  .settings-modal { padding: 0; align-items: stretch; }
  .settings-modal-panel {
    max-width: none; border-radius: 0; max-height: none; min-height: 100vh;
    padding: calc(28px + var(--safe-top)) 18px calc(24px + var(--safe-bottom));
  }
  .settings-modal-title { font-size: 26px; }
  .set-actions { flex-direction: column-reverse; }
  .set-actions .set-btn { width: 100%; }
}

/* ==========================================================================
   ОТЗЫВЫ ОБ УРОКАХ И БЛОКАХ (reviews.js)
   Префикс .lr-* — намеренно новый: от прежней системы (.rev-*) не осталось
   ни одного селектора, чтобы старые стили не могли «протечь» в новую вёрстку.
   Переиспользуются токены темы и .set-tab для вкладок.
   ========================================================================== */

/* ── Модалка ── */
.lr-modal {
  position: fixed; inset: 0; z-index: 3200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.75);
  animation: lr-fade-in .18s ease;
}
.lr-modal-closing { animation: lr-fade-out .16s ease forwards; }

@keyframes lr-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes lr-fade-out { from { opacity: 1; } to { opacity: 0; } }

.lr-card {
  position: relative;
  width: 100%; max-width: 440px;
  max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 26px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  animation: lr-rise .22s cubic-bezier(.2, .8, .3, 1);
}
@keyframes lr-rise { from { transform: translateY(14px) scale(.98); opacity: 0; } }

.lr-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; padding: 6px;
  background: transparent; border: none; border-radius: 8px;
  color: var(--text-3); cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.lr-close:hover { color: var(--text); background: var(--surface-2); }
.lr-close svg { width: 100%; height: 100%; }

.lr-title {
  margin: 0 0 4px;
  font-family: 'Manrope', sans-serif; font-size: 20px; font-weight: 700;
  color: var(--text); letter-spacing: -.01em;
}
.lr-subtitle {
  margin: 0 0 20px;
  font-size: 13px; color: var(--text-3); line-height: 1.45;
}

.lr-field { margin-bottom: 18px; }
.lr-label {
  display: block; margin-bottom: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
}

/* ── Звёзды ── */
.lr-stars { display: flex; align-items: center; gap: 4px; }

.lr-star {
  width: 34px; height: 34px; padding: 4px;
  background: transparent; border: none; border-radius: 8px;
  color: var(--surface-3); cursor: pointer;
  transition: color .12s ease, transform .12s ease;
}
.lr-star:hover  { transform: scale(1.12); }
.lr-star:active { transform: scale(.96); }
.lr-star.is-on  { color: var(--accent); }
.lr-star svg    { width: 100%; height: 100%; fill: currentColor; }
.lr-star:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lr-star-caption {
  margin-left: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--text-3);
  min-height: 1em;   /* без прыжка вёрстки, пока подпись пуста */
}

/* ── Комментарий ── */
.lr-textarea {
  width: 100%; box-sizing: border-box;
  padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text);
  font-family: 'Manrope', sans-serif; font-size: 14px; line-height: 1.5;
  resize: vertical; min-height: 74px;
  transition: border-color .15s ease;
}
.lr-textarea::placeholder { color: var(--text-3); }
.lr-textarea:focus { outline: none; border-color: var(--accent); }

.lr-error {
  margin: 0 0 12px; padding: 9px 12px;
  background: var(--error-soft); border-radius: 8px;
  color: var(--error); font-size: 13px;
}

/* ── Кнопки ── */
.lr-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 22px;
}
.lr-btn-ghost, .lr-btn-primary {
  padding: 10px 18px; border-radius: 10px;
  font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s ease, opacity .15s ease;
}
.lr-btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text-2);
}
.lr-btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.lr-btn-primary {
  background: var(--accent); border: 1px solid var(--accent); color: #1a1200;
}
.lr-btn-primary:hover:not(:disabled) { background: var(--accent-2); }
.lr-btn-primary:disabled { opacity: .6; cursor: default; }

/* ── Тост ── */
.lr-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 3300;
  transform: translate(-50%, 12px);
  padding: 11px 18px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text);
  font-size: 14px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  opacity: 0; transition: opacity .22s ease, transform .22s ease;
}
.lr-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

/* ── Вкладки «Мои отзывы» в Feedback ── */
.lr-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.lr-list { display: flex; flex-direction: column; gap: 6px; }

.lr-empty {
  margin: 0; padding: 26px 16px;
  text-align: center; color: var(--text-3);
  font-size: 13.5px; line-height: 1.55;
}

.lr-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: 10px;
  color: var(--text); text-align: left; cursor: pointer;
  font-family: 'Manrope', sans-serif;
  transition: border-color .15s ease, background .15s ease;
}
.lr-row:hover { background: var(--surface-3); border-color: var(--border); }

.lr-row-main  { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lr-row-title {
  font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lr-row-meta  { font-size: 12px; color: var(--text-3); }

.lr-row-action {
  flex-shrink: 0;
  font-size: 12.5px; font-weight: 700; color: var(--accent);
}
.lr-row-action.is-rated { color: var(--success); }

/* ── Админка владельца ── */
.lr-admin-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 14px;
}
.lr-stat-card {
  padding: 13px 15px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: 12px;
}
.lr-stat-label {
  margin-bottom: 8px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-3);
}
.lr-stat-row {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text-2); padding: 2px 0;
}
.lr-stat-row b { color: var(--text); font-weight: 700; }

.lr-admin-search {
  width: 100%; box-sizing: border-box;
  padding: 9px 13px; margin-bottom: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: 'Manrope', sans-serif; font-size: 13.5px;
}
.lr-admin-search:focus { outline: none; border-color: var(--accent); }

.lr-admin-list { display: flex; flex-direction: column; gap: 8px; }

.lr-admin-item {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: 10px;
}
.lr-admin-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.lr-admin-target { font-size: 13.5px; font-weight: 700; color: var(--text); }
.lr-admin-rating { font-size: 12.5px; color: var(--text-3); }
.lr-admin-del {
  margin-left: auto; padding: 5px 10px;
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-3); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.lr-admin-del:hover { color: var(--error); border-color: var(--error); }

.lr-admin-comment {
  margin: 0 0 6px;
  font-size: 13.5px; line-height: 1.5; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}
.lr-admin-date { font-size: 11.5px; color: var(--text-3); }

/* ── Мобильная адаптация ── */
@media (max-width: 600px) {
  .lr-modal { padding: 12px; align-items: flex-end; }
  .lr-card {
    max-width: 100%; padding: 22px 18px 18px;
    border-radius: 16px 16px 0 0;
    max-height: calc(100vh - 24px);
  }
  .lr-actions { flex-direction: column-reverse; }
  .lr-btn-ghost, .lr-btn-primary { width: 100%; }
  .lr-star { width: 40px; height: 40px; }       /* палец, а не курсор */
  .lr-star-caption { margin-left: 6px; font-size: 12px; }
  .lr-admin-stats { grid-template-columns: 1fr; }
}

/* ==========================================================================
   COURSE MENU v2 — redesign (Stage 2)
   Accordion of blocks → parts → lessons with per-level progress.
   Replaces the old flat list. The former .sidebar-block / .sidebar-part /
   .menu-item rules are now orphaned (markup uses sm-* classes); they will be
   removed in the mobile-adaptation sweep of this stylesheet.
   ========================================================================== */

/* The static "Завершено: X из Y" line in .menu-head is superseded by the
   richer progress card below — on every viewport now, not just desktop. */
.menu-progress-text{display:none}

/* ── Overall course progress card ── */
.sm-progress{
  background:var(--surface-2);
  border:1px solid var(--border-soft);
  border-radius:var(--radius-sm);
  padding:12px 14px;
  margin:10px 4px 12px;
}
.sm-progress-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  font-size:12.5px;
  color:var(--text-2);
  margin-bottom:9px;
}
.sm-progress-row b{color:var(--text);font-weight:700}
.sm-progress-pct{
  font-family:'JetBrains Mono',monospace;
  font-size:12px;
  font-weight:700;
  color:var(--accent);
}
.sm-progress-bar{
  height:6px;
  background:var(--surface-3);
  border-radius:999px;
  overflow:hidden;
}
.sm-progress-fill{
  height:100%;
  background:linear-gradient(90deg,var(--accent-2),var(--accent));
  border-radius:999px;
  transition:width .3s ease;
}

/* ── Block card (accordion section) ── */
.sm-block{
  background:var(--surface-2);
  border:1px solid var(--border-soft);
  border-radius:var(--radius-sm);
  margin:0 4px 10px;
  overflow:hidden;
}
.sm-block.is-current{border-color:#fb923c55}

.sm-block-head{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  padding:13px 14px;
  background:transparent;
  border:none;
  cursor:pointer;
  text-align:left;
  color:var(--text);
  font-family:inherit;
  transition:background .15s;
}
@media (hover:hover){ .sm-block-head:hover{background:var(--surface-3)} }
.sm-block-head:active{background:var(--surface-3)}

.sm-block-info{display:flex;flex-direction:column;gap:3px;min-width:0}
.sm-block-num{
  font-size:10px;
  font-weight:800;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--text-3);
}
.sm-block.is-current .sm-block-num{color:var(--accent)}
.sm-block-title{
  font-family:'Fraunces',serif;
  font-size:17px;
  font-weight:600;
  line-height:1.2;
  letter-spacing:-.01em;
}
.sm-block-meta{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
  flex-shrink:0;
}
.sm-block-count{
  font-family:'JetBrains Mono',monospace;
  font-size:11.5px;
  font-weight:600;
  color:var(--text-3);
}
.sm-block.is-done .sm-block-count{color:var(--success)}
.sm-chevron{
  width:16px;height:16px;
  color:var(--text-3);
  transition:transform .28s cubic-bezier(.4,0,.2,1);
}
.sm-block.is-open .sm-chevron{transform:rotate(180deg)}

/* Thin per-block progress strip under the head */
.sm-block-bar{height:3px;background:var(--surface-3)}
.sm-block-bar-fill{
  height:100%;
  background:var(--accent);
  transition:width .3s ease;
}
.sm-block.is-done .sm-block-bar-fill{background:var(--success)}

/* Collapsible body — grid-rows trick animates to content height */
.sm-block-body{
  display:grid;
  grid-template-rows:0fr;
  transition:grid-template-rows .32s cubic-bezier(.4,0,.2,1);
}
.sm-block.is-open .sm-block-body{grid-template-rows:1fr}
.sm-block-inner{
  overflow:hidden;
  min-height:0;
  padding:0 6px 8px;
}
.sm-block-desc{
  font-size:12.5px;
  color:var(--text-3);
  line-height:1.5;
  padding:10px 8px 2px;
}

/* ── Part section ── */
.sm-part{margin-top:4px}
.sm-part-head{
  display:flex;
  align-items:baseline;
  gap:8px;
  padding:12px 8px 6px;
}
.sm-part-num{
  font-size:10px;
  font-weight:700;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--accent);
  white-space:nowrap;
}
.sm-part-title{
  font-size:13.5px;
  font-weight:700;
  color:var(--text);
  line-height:1.3;
  min-width:0;
}
.sm-part-count{
  margin-left:auto;
  font-family:'JetBrains Mono',monospace;
  font-size:10.5px;
  font-weight:600;
  color:var(--text-3);
  white-space:nowrap;
}

/* ── Lesson row ── */
.sm-item{
  position:relative;
  display:flex;
  align-items:center;
  gap:11px;
  width:100%;
  min-height:44px;             /* comfortable touch target */
  padding:9px 10px;
  background:transparent;
  border:none;
  border-radius:10px;
  cursor:pointer;
  text-align:left;
  color:var(--text);
  font-family:inherit;
  font-size:14.5px;
  line-height:1.35;
  margin-bottom:2px;
  transition:background .15s;
}
@media (hover:hover){ .sm-item:hover{background:var(--surface-3)} }
.sm-item:active{background:var(--surface-3)}

.sm-item-num{
  display:flex;align-items:center;justify-content:center;
  width:26px;height:26px;
  border-radius:8px;
  background:var(--surface-3);
  border:1px solid var(--border-soft);
  font-family:'JetBrains Mono',monospace;
  font-size:12px;
  font-weight:600;
  color:var(--text-3);
  flex-shrink:0;
}
.sm-item-title{flex:1;font-weight:500;min-width:0}

/* Completed */
.sm-item.done .sm-item-num{
  background:var(--success-soft);
  border-color:transparent;
  color:var(--success);
}
.sm-item.done .sm-item-title{color:var(--text-2)}

/* Current */
.sm-item.active{background:var(--accent-soft)}
.sm-item.active::before{
  content:"";
  position:absolute;
  left:0;top:8px;bottom:8px;
  width:3px;
  border-radius:3px;
  background:var(--accent);
}
.sm-item.active .sm-item-num{
  background:var(--accent);
  border-color:var(--accent);
  color:#000;
}
.sm-item.active .sm-item-title{font-weight:700}

/* Locked */
.sm-item.locked{opacity:.55}
.sm-item.locked:active{opacity:.75}
.sm-item-lock{
  width:15px;height:15px;
  color:var(--text-3);
  flex-shrink:0;
  margin-left:4px;
}

/* ── Desktop sidebar density ── */
@media (min-width:1024px){
  .sm-progress{margin:14px 0 12px}
  .sm-block{margin:0 0 10px}
  .sm-block-title{font-size:16px}
  .sm-item{font-size:13.5px;min-height:38px;padding:8px 10px}
  .sm-item-num{width:24px;height:24px;font-size:11.5px}
}

/* Tiny screens */
@media (max-width:360px){
  .sm-block-title{font-size:15.5px}
  .sm-item{font-size:14px}
}

/* ==========================================================================
   STAGE 3 — MOBILE ADAPTATION (320 / 360 / 390 / 412 / 768)
   Closes the gaps between the historical breakpoints: pricing modal had no
   phone treatment, nothing below 380px was tuned, tablets 768–1023 wasted
   width, and sub-16px form fields triggered iOS focus-zoom.
   ========================================================================== */

/* ── Tablets 768–1023: phone layout, but use the extra width ── */
@media (min-width: 768px) and (max-width: 1023px) {
  .app    { max-width: 720px; }
  .bottom { max-width: 720px; }
  .main   { padding-left: 24px; padding-right: 24px; }
}

/* ── Phones ≤600: pricing modal becomes a fullscreen sheet,
      consistent with the feedback/settings modals ── */
@media (max-width: 600px) {
  .pricing-modal { padding: 0; align-items: stretch; }
  .pricing-modal-panel {
    max-width: none;
    border-radius: 0;
    max-height: none;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(28px + var(--safe-top)) 18px calc(24px + var(--safe-bottom));
  }
  .pricing-modal-title { font-size: 26px; }
  .pricing-modal-close { top: calc(12px + var(--safe-top)); right: 12px; }
}

/* ── Touch devices: 16px form fields stop iOS Safari focus-zoom.
      Code editors (mono textareas) are deliberately NOT included. ── */
@media (max-width: 768px) {
  .lr-textarea,
  .fb-input, .fb-textarea,
  .set-input {
    font-size: 16px;
  }
  /* Account dropdown must never poke past a narrow viewport */
  .auth-dropdown { max-width: calc(100vw - 24px); }
}

/* ── ≤480: paywall + fullscreen-editor density ── */
@media (max-width: 480px) {
  .paywall { margin: 2.5rem auto; padding: 2.25rem 1.25rem; }
  .practice-fullscreen-header { padding: 8px 10px; }
  .practice-fullscreen-close,
  .practice-fullscreen-run { padding: 9px 12px; }
}

/* ── ≤360: compaction pass for 320–360px devices ── */
@media (max-width: 360px) {
  .header-row { padding: 12px 12px; gap: 10px; }
  .menu-btn   { width: 40px; height: 40px; }
  .title-main { font-size: 16.5px; }
  .title-eyebrow { font-size: 10px; }

  .main { padding: 20px 12px 132px; }
  .lesson-title  { font-size: 26px; }
  .welcome-title { font-size: 30px; }
  .text-block    { font-size: 15.5px; }

  .bottom  { padding: 12px 12px calc(12px + var(--safe-bottom)); gap: 8px; }
  .nav-btn { padding: 12px 14px; font-size: 14px; min-height: 48px; }

  .practice-fullscreen-title { font-size: 12px; }

  .lr-card { padding: 20px 14px 16px; }
  .feedback-modal-panel,
  .settings-modal-panel,
  .pricing-modal-panel {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* ==========================================================================
   STAGE 4/5 — NOTES & NOTIFICATIONS
   Shared right-side sheet (fullscreen on phones) + notes cards/editor,
   notification items, unread dot, owner compose form.
   ========================================================================== */

/* ── Mobile header tool buttons (notes + bell) ── */
.header-tools{display:flex;align-items:center;gap:6px;flex-shrink:0}
.header-tool-btn{
  position:relative;
  width:40px;height:40px;
  display:flex;align-items:center;justify-content:center;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:12px;
  color:var(--text-2);
  cursor:pointer;
  transition:background .15s,color .15s;
}
.header-tool-btn:active{background:var(--surface-2);color:var(--text)}
.header-tool-btn svg{width:19px;height:19px}
@media (max-width:360px){
  .header-tools{gap:4px}
  .header-tool-btn{width:36px;height:36px;border-radius:10px}
  .header-tool-btn svg{width:17px;height:17px}
}
@media (min-width:1024px){ .header-tools{display:none} }
.topnav-notify{position:relative}

/* Unread dot on either bell */
.notify-dot{
  position:absolute;
  top:7px;right:7px;
  width:8px;height:8px;
  border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 2px var(--bg);
  pointer-events:none;
}

/* ── Shared sheet (notes / notifications) ── */
.sheet-overlay{
  position:fixed;
  inset:0;
  z-index:2500;                 /* above auth dropdown (1000/2000), below pricing (3000) */
  background:rgba(0,0,0,.6);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
.sheet-overlay[hidden]{display:none}
.sheet-panel{
  position:absolute;
  top:0;right:0;bottom:0;
  width:100%;
  max-width:420px;
  background:var(--surface);
  border-left:1px solid var(--border);
  display:flex;
  flex-direction:column;
  animation:sheet-in .25s cubic-bezier(.4,0,.2,1);
}
@keyframes sheet-in{from{transform:translateX(24px);opacity:0}to{transform:none;opacity:1}}
.sheet-head{
  display:flex;
  align-items:center;
  gap:10px;
  padding:calc(16px + var(--safe-top)) 16px 14px;
  border-bottom:1px solid var(--border-soft);
  flex-shrink:0;
}
.sheet-title{
  font-family:'Fraunces',serif;
  font-size:21px;
  font-weight:600;
  flex:1;
  min-width:0;
}
.sheet-action{
  display:flex;align-items:center;gap:4px;
  padding:9px 14px;
  background:var(--accent);
  border:none;
  border-radius:10px;
  color:#000;
  font-family:inherit;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  transition:opacity .15s;
}
.sheet-action:active{opacity:.85}
.sheet-action:disabled{opacity:.5;cursor:default}
.sheet-close{
  width:36px;height:36px;
  display:flex;align-items:center;justify-content:center;
  background:transparent;
  border:none;
  border-radius:10px;
  color:var(--text-2);
  font-size:15px;
  cursor:pointer;
  transition:background .15s,color .15s;
}
.sheet-close:active{background:var(--surface-2);color:var(--text)}
.sheet-body{
  flex:1;
  min-height:0;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding:12px 12px calc(16px + var(--safe-bottom));
}
.sheet-empty{
  padding:36px 18px;
  text-align:center;
  font-size:14px;
  color:var(--text-3);
  line-height:1.5;
}

/* ── Notes ── */
.note-card{
  display:flex;
  align-items:flex-start;
  gap:8px;
  padding:13px 12px;
  background:var(--surface-2);
  border:1px solid var(--border-soft);
  border-radius:var(--radius-sm);
  margin-bottom:8px;
  cursor:pointer;
  transition:border-color .15s,background .15s;
}
@media (hover:hover){ .note-card:hover{border-color:var(--border)} }
.note-card:active{background:var(--surface-3)}
.note-card-main{flex:1;min-width:0}
.note-card-title{
  font-size:14.5px;
  font-weight:700;
  line-height:1.3;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.note-card-preview{
  font-size:12.5px;
  color:var(--text-2);
  line-height:1.4;
  margin-top:3px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.note-card-date{
  font-family:'JetBrains Mono',monospace;
  font-size:10.5px;
  color:var(--text-3);
  margin-top:6px;
}
.note-card-del{
  width:32px;height:32px;
  display:flex;align-items:center;justify-content:center;
  background:transparent;
  border:none;
  border-radius:8px;
  color:var(--text-3);
  cursor:pointer;
  flex-shrink:0;
  transition:background .15s,color .15s;
}
.note-card-del:active{background:var(--error-soft);color:var(--error)}
@media (hover:hover){ .note-card-del:hover{background:var(--error-soft);color:var(--error)} }
.note-card-del svg{width:15px;height:15px}

.note-editor{display:flex;flex-direction:column;height:100%;min-height:0}
.note-editor-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:2px 2px 10px;
}
.note-editor-back{
  background:transparent;
  border:none;
  color:var(--accent);
  font-family:inherit;
  font-size:13.5px;
  font-weight:700;
  cursor:pointer;
  padding:6px 4px;
}
.note-editor-hint{font-size:11px;color:var(--text-3)}
.note-editor-area{
  flex:1;
  min-height:260px;
  width:100%;
  resize:none;
  background:var(--surface-2);
  border:1px solid var(--border-soft);
  border-radius:var(--radius-sm);
  padding:14px;
  color:var(--text);
  font-family:'Manrope',sans-serif;
  font-size:16px;             /* no iOS focus-zoom */
  line-height:1.55;
}
.note-editor-area:focus{outline:none;border-color:var(--accent)}
.note-editor-area::placeholder{color:var(--text-3)}

/* Owner compose form */
.nf-compose{
  padding:14px 12px 12px;
  background:var(--surface-2);
  border:1px solid var(--border-soft);
  border-radius:var(--radius-sm);
  margin-bottom:14px;
}
.nf-compose-input,.nf-compose-area,.nf-compose-select{
  width:100%;
  background:var(--surface);
  border:1px solid var(--border-soft);
  border-radius:10px;
  padding:10px 12px;
  color:var(--text);
  font-family:'Manrope',sans-serif;
  font-size:16px;
  margin-bottom:8px;
}
.nf-compose-input:focus,.nf-compose-area:focus,.nf-compose-select:focus{outline:none;border-color:var(--accent)}
.nf-compose-area{resize:vertical;min-height:64px;line-height:1.5}
.nf-compose-row{display:flex;gap:8px;align-items:stretch}
.nf-compose-row .nf-compose-select{flex:1;margin-bottom:0}

/* ==========================================================================
   STAGE 6 — notes resizer/fullscreen, pinned cheat-sheets, notif dismiss
   ========================================================================== */

/* Fullscreen toggle exists only where it makes sense — desktop */
.sheet-full-btn{display:none}
.sheet-full-btn svg{width:16px;height:16px}

/* Edge resizer (desktop) */
.sheet-resizer{display:none}

@media (min-width:1024px){
  .sheet-full-btn{display:flex}
  #notesOverlay .sheet-panel{
    max-width:none;
    width:min(var(--sheet-w,420px),90vw);
  }
  #notesOverlay .sheet-panel.is-full{width:100%}
  #notesOverlay .sheet-panel.is-full .sheet-resizer{display:none}
  .sheet-resizer{
    display:block;
    position:absolute;
    top:0;left:-4px;bottom:0;
    width:9px;
    cursor:col-resize;
    z-index:5;
  }
  .sheet-resizer:hover,
  .sheet-resizer:active{
    background:linear-gradient(to right,transparent 3px,var(--accent) 3px,var(--accent) 5px,transparent 5px);
  }
  #notesOverlay .sheet-panel{position:absolute}
  #notesOverlay .sheet-panel.is-full .sheet-body{max-width:880px;width:100%;margin:0 auto}
}

/* Pin button on note cards */
.note-card-pin{
  width:32px;height:32px;
  display:flex;align-items:center;justify-content:center;
  background:transparent;border:none;border-radius:8px;
  color:var(--text-3);cursor:pointer;flex-shrink:0;
  transition:background .15s,color .15s;
}
.note-card-pin svg{width:15px;height:15px}
@media (hover:hover){ .note-card-pin:hover{background:var(--accent-soft);color:var(--accent)} }
.note-card-pin:active{background:var(--accent-soft);color:var(--accent)}
.note-card-pin.is-pinned{color:var(--accent)}

/* Pinned cheat-sheet widget */
.pinned-note{
  position:fixed;
  z-index:60;                     /* above content, below sheets/modals */
  width:264px;
  background:var(--surface);
  border:1px solid var(--border);
  border-left:3px solid var(--accent);
  border-radius:12px;
  box-shadow:0 12px 36px rgba(0,0,0,.5);
  overflow:hidden;
}
.pinned-note.is-dragging{opacity:.92;box-shadow:0 18px 48px rgba(0,0,0,.6)}
.pinned-note-head{
  display:flex;
  align-items:center;
  gap:6px;
  padding:8px 8px 8px 6px;
  background:var(--surface-2);
  border-bottom:1px solid var(--border-soft);
  cursor:grab;
  touch-action:none;              /* pointer-drag works on touch too */
  user-select:none;
}
.pinned-note.is-dragging .pinned-note-head{cursor:grabbing}
.pinned-note-grip{width:14px;height:14px;color:var(--text-3);flex-shrink:0}
.pinned-note-title{
  flex:1;
  min-width:0;
  font-size:12.5px;
  font-weight:700;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.pinned-note-btn{
  width:26px;height:26px;
  display:flex;align-items:center;justify-content:center;
  background:transparent;border:none;border-radius:7px;
  color:var(--text-3);font-size:12px;cursor:pointer;flex-shrink:0;
  transition:background .15s,color .15s;
}
.pinned-note-btn svg{width:13px;height:13px}
.pinned-note-btn:active{background:var(--surface-3);color:var(--text)}
@media (hover:hover){ .pinned-note-btn:hover{background:var(--surface-3);color:var(--text)} }
.pinned-note-body{
  padding:10px 12px;
  font-size:13px;
  line-height:1.5;
  color:var(--text-2);
  white-space:pre-line;
  max-height:38vh;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}
@media (max-width:600px){
  .pinned-note{width:232px}
  .pinned-note-body{max-height:30vh}
}



/* ==========================================================================
   STAGE 7 — REBRAND: landing footer with legal links
   ========================================================================== */
.site-footer{
  margin-top:56px;
  padding:22px 4px calc(10px + var(--safe-bottom));
  border-top:1px solid var(--border-soft);
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:12px 20px;
}
.site-footer-brand{
  font-size:12.5px;
  color:var(--text-3);
  font-weight:600;
}
.site-footer-links{
  display:flex;
  flex-wrap:wrap;
  gap:8px 18px;
}
.site-footer-links a{
  font-size:12.5px;
  color:var(--text-2);
  text-decoration:none;
  transition:color .15s;
}
.site-footer-links a:hover{color:var(--accent)}
@media (max-width:600px){
  .site-footer{flex-direction:column;align-items:flex-start;gap:12px;margin-top:40px}
}

/* ==========================================================================
   STAGE 8 — legal links in menu & settings, home navigation, sub management
   ========================================================================== */

/* Back-to-landing */
.topnav-brand{cursor:pointer}
.menu-home-btn{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:7px 10px;
  margin:0 0 10px -10px;
  background:transparent;
  border:none;
  border-radius:9px;
  color:var(--text-2);
  font-family:inherit;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  transition:background .15s,color .15s;
}
.menu-home-btn svg{width:15px;height:15px}
@media (hover:hover){ .menu-home-btn:hover{background:var(--surface-2);color:var(--text)} }
.menu-home-btn:active{background:var(--surface-2);color:var(--text)}

/* Legal links pinned to the bottom of the course menu */
.menu-legal{
  margin-top:auto;
  padding:14px 20px 0;
  border-top:1px solid var(--border-soft);
  display:flex;
  flex-wrap:wrap;
  gap:6px 16px;
}
.menu-legal a{
  font-size:11.5px;
  color:var(--text-3);
  text-decoration:none;
  transition:color .15s;
}
.menu-legal a:hover{color:var(--accent)}

/* Subscription management in settings */
.set-sub-hint{
  margin-top:14px;
  font-size:12.5px;
  color:var(--text-3);
  line-height:1.5;
}
.set-sub-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.set-legal-links{
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--border-soft);
  display:flex;
  gap:16px;
  flex-wrap:wrap;
}
.set-legal-links a{
  font-size:12px;
  color:var(--text-3);
  text-decoration:none;
  transition:color .15s;
}
.set-legal-links a:hover{color:var(--accent)}


/* ==========================================================================
   STAGE 9 — navbar cleanup: lone "Курс" tab removed; brand doubles as Home
   ========================================================================== */
@media (min-width:1024px){
  .topnav-brand{
    border-radius:10px;
    padding:6px 10px;
    margin-left:-10px;
    transition:background .15s;
  }
  .topnav-brand:hover{background:var(--surface-2)}
  .topnav-brand:active{background:var(--surface-3)}
}


/* ==========================================================================
   STAGE 10 — NOTIFICATIONS, premium pass
   Editorial list: typographic category tag, title, body, timestamp,
   hairline dividers. No icon tiles. Unread = accent dot + brighter title.
   ========================================================================== */

/* Owner toolbar (publish toggle) */
.nf-toolbar{display:flex;justify-content:flex-end;margin:0 2px 10px}
.nf-toolbar-btn{
  background:transparent;
  border:1px solid var(--border-soft);
  border-radius:9px;
  padding:7px 12px;
  color:var(--text-2);
  font-family:inherit;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  transition:border-color .15s,color .15s,background .15s;
}
.nf-toolbar-btn:hover,
.nf-toolbar-btn.is-open{border-color:var(--border);color:var(--text);background:var(--surface-2)}

/* Editorial list */
.nf-list{border-top:1px solid var(--border-soft)}
.nf-row{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:5px;
  width:100%;
  padding:15px 34px 15px 2px;
  border-bottom:1px solid var(--border-soft);
  text-align:left;
  color:var(--text);
  font-family:inherit;
  background:transparent;
  border-left:none;border-right:none;border-top:none;
}
button.nf-row{cursor:pointer}
@media (hover:hover){ .nf-row-action:hover{background:var(--surface-2)} }
.nf-row-action:active{background:var(--surface-2)}

.nf-row-top{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
}
.nf-tag{
  font-size:10px;
  font-weight:800;
  letter-spacing:.16em;
  text-transform:uppercase;
}
.nf-tag-news{color:var(--accent)}
.nf-tag-lessons{color:var(--info)}
.nf-tag-courses{color:var(--kw)}
.nf-tag-discounts{color:var(--success)}
.nf-tag-system{color:var(--text-3)}

.nf-row-date{
  font-family:'JetBrains Mono',monospace;
  font-size:10px;
  color:var(--text-3);
  white-space:nowrap;
}
.nf-row-title{
  font-size:14.5px;
  font-weight:600;
  line-height:1.35;
  color:var(--text-2);
  letter-spacing:-.005em;
}
.nf-row.is-new .nf-row-title{color:var(--text);font-weight:700}
.nf-dot{
  display:inline-block;
  width:6px;height:6px;
  border-radius:50%;
  background:var(--accent);
  margin-right:8px;
  vertical-align:2px;
}
.nf-row-body{
  font-size:13px;
  color:var(--text-3);
  line-height:1.5;
  white-space:pre-line;
}
.nf-row.is-new .nf-row-body{color:var(--text-2)}

/* Dismiss/delete: ghost, revealed on hover on desktop, quiet on touch */
.nf-row-del{
  position:absolute;
  top:13px;right:2px;
  width:26px;height:26px;
  display:flex;align-items:center;justify-content:center;
  background:transparent;border:none;border-radius:7px;
  color:var(--text-3);
  font-size:12px;
  cursor:pointer;
  opacity:.45;
  transition:opacity .15s,background .15s,color .15s;
}
@media (hover:hover){
  .nf-row-del{opacity:0}
  .nf-row:hover .nf-row-del{opacity:1}
  .nf-row-del:hover{background:var(--surface-3);color:var(--text)}
}
.nf-row-del:active{background:var(--surface-3);color:var(--text);opacity:1}

/* Refined empty state */
.sheet-empty-icon{
  width:30px;height:30px;
  color:var(--text-3);
  opacity:.6;
  margin:0 auto 12px;
  display:block;
}

/* ==========================================================================
   STAGE 11 — launch pricing: struck-through regular price on plan cards
   ========================================================================== */
.pricing-card-price-old{
  font-family:'JetBrains Mono',monospace;
  font-size:16px;
  font-weight:600;
  color:var(--text-3);
  text-decoration-color:var(--accent);
  text-decoration-thickness:2px;
  margin-right:8px;
  vertical-align:6px;
}

/* ==========================================================================
   STAGE 12 — pricing card polish + locale reload prompt
   ========================================================================== */

/* Launch badge: was a full-width block that pushed the plan name down and
   wrapped over three lines. Now an inline pill above the name. */
.pricing-launch-badge{
  display:inline-block;
  width:auto;
  max-width:100%;
  padding:4px 9px;
  border-radius:999px;
  background:var(--accent-soft);
  color:var(--accent);
  font-size:9.5px;
  font-weight:800;
  letter-spacing:.1em;
  text-transform:uppercase;
  line-height:1.35;
  white-space:normal;
  margin-bottom:10px;
}

/* Price row: old + new on one baseline, cadence never orphaned */
.pricing-card-price{
  display:flex;
  align-items:baseline;
  flex-wrap:wrap;
  gap:4px 8px;
}
.pricing-card-price-old{
  order:-1;
  font-size:15px;
  vertical-align:baseline;
  margin-right:0;
}
.pricing-card-price-num{line-height:1.05}
.pricing-card-price-cadence{white-space:nowrap}

/* Locale change → reload prompt */
.set-reload-note{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  margin-top:12px;
  padding:12px 14px;
  background:var(--accent-soft);
  border:1px solid #fb923c40;
  border-radius:var(--radius-sm);
  font-size:12.5px;
  color:var(--text-2);
  line-height:1.45;
}
.set-reload-note span{flex:1;min-width:180px}
.set-reload-note .set-btn{flex-shrink:0}

/* ==========================================================================
   STAGE 13 — webhook activation: waiting toast spinner
   ========================================================================== */
.pricing-toast-spinner{
  width:22px;height:22px;
  border:2.5px solid var(--surface-3);
  border-top-color:var(--accent);
  border-radius:50%;
  animation:spin .8s linear infinite;
  flex-shrink:0;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ==========================================================================
   STAGE 15 — paid plan accent + STREAK («огонёк»)
   ========================================================================== */

/* Paid plans are no longer grey next to the avatar */
.auth-user-plan.is-paid{
  color:var(--accent);
  font-weight:700;
}

/* ── Flame button (topnav + mobile header) ───────────────────────────────── */
.streak-btn{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:3px;
}
.streak-btn[hidden]{display:none}
.streak-flame{
  width:19px;height:19px;
  fill:currentColor;
  transition:filter .3s ease;
}
.header-tool-btn.streak-btn .streak-flame{width:18px;height:18px}
.streak-flame-core{opacity:.45;fill:#fff7ed}
.streak-count{
  font-family:'JetBrains Mono',monospace;
  font-size:11px;
  font-weight:700;
  line-height:1;
}

/* Tier colours — the flame grows hotter with the streak */
.streak-off{color:var(--text-3)}
.streak-off .streak-flame{opacity:.55}
.streak-off .streak-flame-core{opacity:0}
.streak-off .streak-count{opacity:.7}

.streak-amber{color:#fbbf24}
.streak-orange{color:#fb923c}
.streak-hot{color:#f97316}
.streak-crimson{color:#ef4444}
.streak-legend{color:#c084fc}

.streak-amber   .streak-flame{filter:drop-shadow(0 0 4px rgba(251,191,36,.55));animation:flame-flicker 2.4s ease-in-out infinite}
.streak-orange  .streak-flame{filter:drop-shadow(0 0 6px rgba(251,146,60,.65));animation:flame-flicker 2s ease-in-out infinite}
.streak-hot     .streak-flame{filter:drop-shadow(0 0 8px rgba(249,115,22,.75));animation:flame-flicker 1.7s ease-in-out infinite}
.streak-crimson .streak-flame{filter:drop-shadow(0 0 10px rgba(239,68,68,.8));animation:flame-flicker 1.4s ease-in-out infinite}

/* Legend tier — purple, animated hue + halo */
.streak-legend .streak-flame{
  animation:flame-flicker 1.2s ease-in-out infinite, legend-hue 4s linear infinite;
  filter:drop-shadow(0 0 10px rgba(192,132,252,.9));
}
.streak-legend::after{
  content:"";
  position:absolute;
  inset:-3px;
  border-radius:inherit;
  background:conic-gradient(from 0deg,#c084fc,#6366f1,#e879f9,#c084fc);
  opacity:.22;
  filter:blur(7px);
  animation:legend-spin 6s linear infinite;
  pointer-events:none;
  z-index:-1;
}
@keyframes flame-flicker{
  0%,100%{transform:scale(1) translateY(0)}
  35%    {transform:scale(1.07) translateY(-.5px)}
  60%    {transform:scale(.97) translateY(.5px)}
  80%    {transform:scale(1.04)}
}
@keyframes legend-hue{
  0%,100%{color:#c084fc}
  33%    {color:#818cf8}
  66%    {color:#e879f9}
}
@keyframes legend-spin{to{transform:rotate(360deg)}}

@media (prefers-reduced-motion:reduce){
  .streak-flame,.streak-legend::after{animation:none !important}
}

/* ── Panel ───────────────────────────────────────────────────────────────── */
.streak-hero{
  text-align:center;
  padding:22px 12px 18px;
  border-bottom:1px solid var(--border-soft);
  margin-bottom:16px;
}
.streak-hero-flame{position:relative;display:inline-block}
.streak-hero .streak-flame{width:76px;height:76px}
.streak-hero-days{
  font-family:'Fraunces',serif;
  font-size:46px;
  font-weight:700;
  line-height:1;
  margin-top:4px;
  color:var(--text);
}
.streak-hero-label{
  font-size:12px;
  color:var(--text-3);
  margin-top:4px;
}
.streak-hero-tier{
  display:inline-block;
  margin-top:12px;
  padding:4px 12px;
  border-radius:999px;
  background:currentColor;
  font-size:10px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
}
.streak-hero-tier{color:inherit}
.streak-hero .streak-hero-tier{
  background:color-mix(in srgb, currentColor 16%, transparent);
}

.streak-today{margin:0 2px 16px}
.streak-today-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  font-size:13px;
  color:var(--text-2);
  margin-bottom:8px;
}
.streak-today-num{
  font-family:'JetBrains Mono',monospace;
  font-size:12px;
  font-weight:700;
  color:var(--accent);
}
.streak-bar{height:8px;background:var(--surface-3);border-radius:999px;overflow:hidden}
.streak-bar-fill{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#fbbf24,#fb923c);
  transition:width .4s ease;
}
.streak-hint{margin-top:9px;font-size:12.5px;color:var(--text-3);line-height:1.5}

.streak-stats{display:flex;gap:10px;margin:0 2px 16px}
.streak-stat{
  flex:1;
  padding:12px 14px;
  background:var(--surface-2);
  border:1px solid var(--border-soft);
  border-radius:var(--radius-sm);
  text-align:center;
}
.streak-stat b{
  display:block;
  font-family:'JetBrains Mono',monospace;
  font-size:20px;
  font-weight:700;
  color:var(--text);
}
.streak-stat span{display:block;margin-top:4px;font-size:11px;color:var(--text-3);line-height:1.35}

.streak-restore{
  margin:0 2px 16px;
  padding:14px;
  background:var(--accent-soft);
  border:1px solid #fb923c40;
  border-radius:var(--radius-sm);
}
.streak-restore-text{font-size:13px;color:var(--text-2);line-height:1.5;margin-bottom:12px}

.streak-rules{margin:0 2px}
.streak-rules-title{
  font-size:10px;
  font-weight:800;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--text-3);
  margin-bottom:10px;
}
.streak-rules ul{margin:0;padding-left:18px}
.streak-rules li{font-size:12.5px;color:var(--text-3);line-height:1.6}

/* ── Earned-a-day toast ──────────────────────────────────────────────────── */
.streak-toast{
  position:fixed;
  left:50%;
  bottom:calc(24px + var(--safe-bottom));
  transform:translateX(-50%);
  z-index:4000;
  display:flex;
  align-items:center;
  gap:12px;
  padding:13px 18px 13px 14px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:0 16px 44px rgba(0,0,0,.55);
  animation:streak-toast-in .35s cubic-bezier(.2,.9,.3,1.3);
}
.streak-toast .streak-flame{width:30px;height:30px}
.streak-toast-title{font-size:14px;font-weight:700;color:var(--text)}
.streak-toast-sub{font-size:12px;color:var(--text-3);margin-top:2px}
.streak-toast.is-out{animation:streak-toast-out .5s ease forwards}
@keyframes streak-toast-in{from{opacity:0;transform:translate(-50%,16px) scale(.94)}to{opacity:1;transform:translate(-50%,0) scale(1)}}
@keyframes streak-toast-out{to{opacity:0;transform:translate(-50%,10px)}}

/* ==========================================================================
   STAGE 16 — PRACTICE HUB (Pro-only task ladder)
   ========================================================================== */

/* Entry button in the course menu */
.menu-practice-btn{
  width:100%;
  justify-content:flex-start;
  margin-bottom:14px;
  color:var(--text);
}
.menu-practice-tag{
  margin-left:auto;
  padding:2px 7px;
  border-radius:999px;
  background:var(--accent-soft);
  color:var(--accent);
  font-size:9px;
  font-weight:800;
  letter-spacing:.12em;
}

/* Shell */
.practice-overlay{
  position:fixed;
  inset:0;
  z-index:2600;
  background:rgba(0,0,0,.72);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}
.practice-overlay[hidden]{display:none}
.practice-shell{
  width:100%;
  max-width:820px;
  max-height:100%;
  display:flex;
  flex-direction:column;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  animation:sheet-in .25s cubic-bezier(.4,0,.2,1);
}
.practice-head{
  display:flex;
  align-items:center;
  gap:10px;
  padding:16px 16px 14px;
  border-bottom:1px solid var(--border-soft);
  flex-shrink:0;
}
.practice-head-title{
  font-family:'Fraunces',serif;
  font-size:20px;
  font-weight:600;
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.practice-back{
  background:transparent;
  border:none;
  color:var(--accent);
  font-family:inherit;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  padding:6px 8px 6px 0;
  flex-shrink:0;
}
.practice-body{
  flex:1;
  min-height:0;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding:16px;
}

/* Ladder */
.practice-intro-text{font-size:13px;color:var(--text-3);line-height:1.55;margin-bottom:14px}
.practice-progress{margin-bottom:18px}
.practice-progress-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  font-size:12.5px;
  color:var(--text-2);
  margin-bottom:8px;
}
.practice-progress-row b{color:var(--text)}
.practice-progress-pct{
  font-family:'JetBrains Mono',monospace;
  font-size:12px;
  font-weight:700;
  color:var(--accent);
}
.practice-paywall{
  padding:16px;
  margin-bottom:16px;
  background:var(--accent-soft);
  border:1px solid #fb923c40;
  border-radius:var(--radius-sm);
}
.practice-paywall-title{font-size:15px;font-weight:700;margin-bottom:6px}
.practice-paywall-text{font-size:13px;color:var(--text-2);line-height:1.5;margin-bottom:12px}

.practice-list{display:flex;flex-direction:column;gap:8px}
.practice-card{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  padding:13px 14px;
  background:var(--surface-2);
  border:1px solid var(--border-soft);
  border-radius:var(--radius-sm);
  text-align:left;
  color:var(--text);
  font-family:inherit;
  cursor:pointer;
  transition:border-color .15s,background .15s,transform .12s;
}
.practice-card.is-open:hover{border-color:var(--accent);transform:translateX(2px)}
.practice-card.is-locked{opacity:.45;cursor:not-allowed}
.practice-card.is-solved{border-color:#22c55e40}
.practice-card-num{
  display:flex;align-items:center;justify-content:center;
  width:30px;height:30px;
  border-radius:9px;
  background:var(--surface-3);
  border:1px solid var(--border-soft);
  font-family:'JetBrains Mono',monospace;
  font-size:13px;
  font-weight:700;
  color:var(--text-3);
  flex-shrink:0;
}
.practice-card.is-solved .practice-card-num{background:var(--success-soft);border-color:transparent;color:var(--success)}
.practice-card.is-open  .practice-card-num{background:var(--accent-soft);border-color:transparent;color:var(--accent)}
.practice-card-main{flex:1;min-width:0}
.practice-card-title{display:block;font-size:14.5px;font-weight:700;line-height:1.3}
.practice-card-brief{display:block;font-size:12px;color:var(--text-3);margin-top:3px}
.practice-card-diff{
  font-size:9px;
  letter-spacing:2px;
  color:var(--accent);
  flex-shrink:0;
  opacity:.75;
}

/* Task view */
.practice-task-meta{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
  flex-wrap:wrap;
}
.practice-task-num{
  font-size:10px;
  font-weight:800;
  letter-spacing:.16em;
  text-transform:uppercase;
  color:var(--text-3);
}
.practice-solved-badge{
  padding:3px 10px;
  border-radius:999px;
  background:var(--success-soft);
  color:var(--success);
  font-size:10px;
  font-weight:800;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.practice-task-desc{
  font-size:14.5px;
  line-height:1.65;
  color:var(--text-2);
  margin-bottom:16px;
}
.practice-task-desc code{
  font-family:'JetBrains Mono',monospace;
  font-size:13px;
  padding:2px 6px;
  border-radius:5px;
  background:var(--surface-3);
  color:var(--accent);
}
.practice-task-desc b{color:var(--text)}

.practice-hints{
  margin-bottom:16px;
  border:1px solid var(--border-soft);
  border-radius:var(--radius-sm);
  background:var(--surface-2);
  padding:10px 14px;
}
.practice-hints summary{
  cursor:pointer;
  font-size:13px;
  font-weight:700;
  color:var(--text-2);
  list-style:none;
}
.practice-hints summary::-webkit-details-marker{display:none}
.practice-hints summary::before{content:"💡 ";}
.practice-hints ul{margin:10px 0 2px;padding-left:20px}
.practice-hints li{font-size:13px;color:var(--text-3);line-height:1.6}

.practice-editor-wrap{
  border:1px solid var(--border-soft);
  border-radius:var(--radius-sm);
  overflow:hidden;
  margin-bottom:12px;
}
.practice-editor-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:9px 12px;
  background:var(--surface-2);
  border-bottom:1px solid var(--border-soft);
  font-size:11px;
  font-weight:700;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--text-3);
}
.practice-reset{
  background:transparent;border:none;
  color:var(--text-3);
  font-family:inherit;font-size:11px;font-weight:700;
  cursor:pointer;text-transform:none;letter-spacing:0;
}
.practice-reset:hover{color:var(--accent)}
.practice-editor{
  width:100%;
  min-height:220px;
  resize:vertical;
  border:none;
  background:var(--bg);
  color:var(--text);
  font-family:'JetBrains Mono',monospace;
  font-size:13.5px;
  line-height:1.6;
  padding:14px;
  display:block;
}
.practice-editor:focus{outline:none}

.practice-actions{display:flex;gap:10px;margin-bottom:12px;flex-wrap:wrap}
.practice-btn{
  padding:11px 20px;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--surface-2);
  color:var(--text);
  font-family:inherit;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  transition:background .15s,border-color .15s,opacity .15s;
}
.practice-btn:hover{border-color:var(--accent)}
.practice-btn-primary{background:var(--accent);border-color:var(--accent);color:#000}
.practice-btn-primary:hover{opacity:.9}
.practice-btn:disabled{opacity:.55;cursor:default}

.practice-console{
  padding:13px 14px;
  border-radius:var(--radius-sm);
  background:var(--bg);
  border:1px solid var(--border-soft);
  font-family:'JetBrains Mono',monospace;
  font-size:13px;
  line-height:1.6;
  color:var(--text-2);
  white-space:pre-wrap;
  word-break:break-word;
  margin-bottom:12px;
  max-height:260px;
  overflow-y:auto;
}
.practice-console.is-error{border-color:#ef444455;color:#fca5a5}

.practice-verdict{
  padding:14px;
  border-radius:var(--radius-sm);
  font-size:13.5px;
  line-height:1.55;
}
.practice-verdict.is-wait{background:var(--surface-2);color:var(--text-3)}
.practice-verdict.is-pass{background:var(--success-soft);color:var(--success)}
.practice-verdict.is-fail{background:rgba(239,68,68,.12);color:#fca5a5}
.practice-verdict-dim{opacity:.75;font-size:12.5px}

.practice-confetti{
  position:fixed;
  left:50%;top:42%;
  transform:translate(-50%,-50%);
  z-index:5000;
  font-size:76px;
  color:var(--success);
  pointer-events:none;
  animation:practice-pop 1.4s cubic-bezier(.2,.9,.3,1.3) forwards;
}
@keyframes practice-pop{
  0%  {opacity:0;transform:translate(-50%,-50%) scale(.4)}
  35% {opacity:1;transform:translate(-50%,-50%) scale(1.1)}
  70% {opacity:1;transform:translate(-50%,-50%) scale(1)}
  100%{opacity:0;transform:translate(-50%,-70%) scale(.95)}
}

@media (max-width:768px){
  .practice-overlay{padding:0}
  .practice-shell{max-width:none;border-radius:0;border:none;height:100%;max-height:none}
  .practice-head{padding:calc(14px + var(--safe-top)) 14px 12px}
  .practice-body{padding:14px 14px calc(20px + var(--safe-bottom))}
  .practice-editor{font-size:13px;min-height:190px}
  .practice-btn{flex:1;padding:12px 14px;min-height:48px}
}

/* ==========================================================================
   STAGE 19 — практикум по темам уроков
   ========================================================================== */
.practice-topic{
  margin-bottom:22px;
  padding-bottom:4px;
  border-bottom:1px solid var(--border-soft);
}
.practice-topic:last-child{border-bottom:none}
.practice-topic-head{
  display:flex;
  align-items:flex-start;
  gap:12px;
  margin-bottom:10px;
}
.practice-topic-main{flex:1;min-width:0}
.practice-topic-eyebrow{
  font-size:9.5px;
  font-weight:800;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--text-3);
  margin-bottom:4px;
}
.practice-topic-title{
  font-family:'Fraunces',serif;
  font-size:19px;
  font-weight:600;
  line-height:1.2;
  letter-spacing:-.01em;
}
.practice-topic-desc{
  font-size:12.5px;
  color:var(--text-3);
  line-height:1.5;
  margin-top:5px;
}
.practice-topic-count{
  font-family:'JetBrains Mono',monospace;
  font-size:12px;
  font-weight:700;
  color:var(--text-3);
  padding-top:14px;
  flex-shrink:0;
}
.practice-topic.is-complete .practice-topic-count{color:var(--success)}
.practice-topic.is-complete .practice-topic-eyebrow{color:var(--success)}
@media (max-width:600px){
  .practice-topic-title{font-size:17px}
  .practice-topic{margin-bottom:18px}
}

/* ==========================================================================
   STAGE 33 — огонёк без «коробки» кнопки (стиль TikTok)
   --------------------------------------------------------------------------
   Блок намеренно стоит В САМОМ КОНЦЕ файла. Причина: правила ниже по тексту
   выигрывают при равной специфичности, и в stage30 этот же фикс, вставленный
   в середину секции STAGE 15, был перебит идущим ниже
   `.header-tool-btn.streak-btn .streak-flame{width:18px}` — увеличение пламени
   молча не применялось. Ничего не дописывай после этого блока.

   Что снимаем: .streak-btn получает класс .header-tool-btn (мобильная шапка)
   или .topnav-notify (десктоп). Первый даёт фон, рамку и жёсткие 40×40 —
   из-за них пламя и выглядело «внутри кнопки».
   ========================================================================== */

.header-tool-btn.streak-btn,
.topnav-notify.streak-btn{
  width:auto;
  min-width:0;
  height:auto;
  padding:4px 6px;          /* область нажатия остаётся, рамки нет */
  background:transparent;
  border:none;
  border-radius:999px;      /* ореол .streak-legend::after наследует радиус */
  gap:4px;
}
.header-tool-btn.streak-btn:hover,
.header-tool-btn.streak-btn:active,
.topnav-notify.streak-btn:hover,
.topnav-notify.streak-btn:active{
  background:transparent;
}

/* Пламя — теперь это весь элемент, поэтому крупнее и ярче. */
.header-tool-btn.streak-btn .streak-flame,
.topnav-notify.streak-btn .streak-flame{
  width:24px;
  height:24px;
}
.header-tool-btn.streak-btn .streak-count,
.topnav-notify.streak-btn .streak-count{
  font-size:13px;
  font-weight:800;
}

@media (max-width:360px){
  .header-tool-btn.streak-btn{padding:4px}
  .header-tool-btn.streak-btn .streak-flame{width:21px;height:21px}
  .header-tool-btn.streak-btn .streak-count{font-size:12px}
}
