:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#00033d;background:#f4f5fb;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer;border:0;min-height:48px}button:disabled{opacity:.45;cursor:default}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #977dff;outline-offset:4px}[hidden]{display:none!important}.lesson-shell{max-width:940px;margin:auto;padding:0 28px}header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:26px 0;border-bottom:1px solid #e3e5f0;font-size:14px}.brand{font-size:24px;font-weight:700;letter-spacing:-1px}.brand-dot{color:#0033ff}.tag{font-size:12px;color:#65677c}main{max-width:700px;margin:36px auto 0}.intro{padding:30px 32px;color:#fff;background:radial-gradient(ellipse at 95% 0%,#977dff,#254cdd 45%,#00033d);border-radius:26px;margin-bottom:18px}.eyebrow{font-size:11px;font-weight:700;letter-spacing:.14em;opacity:.8}h1{font-size:38px;letter-spacing:-1.7px;margin:14px 0}p{line-height:1.6}h2{font-size:27px;line-height:1.2;letter-spacing:-.8px;margin:0 0 16px}.intro>p:last-child{margin-bottom:0;color:#e0e6ff}.preview-note{background:#eeecfc;border:1px solid #e2ddfb;border-radius:14px;padding:13px 16px;font-size:13px;line-height:1.5;color:#514477}nav{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:24px 0}nav button{border:1px solid #e1e4ef;border-radius:16px;background:#fff;padding:16px;text-align:left;color:#65677c;font-size:13px;line-height:1.45}nav button span{display:block;font-size:11px;margin-bottom:6px}nav button[aria-current=true]{color:#0033ff;border-color:#0033ff;background:#eef1ff}.progress-row{display:flex;justify-content:space-between;gap:15px;font-size:12px;color:#65677c;margin-bottom:8px}progress{display:block;width:100%;height:5px;border:0;border-radius:5px;overflow:hidden;accent-color:#0033ff;margin-bottom:20px}progress::-webkit-progress-bar{background:#e4e6f2}progress::-webkit-progress-value{background:#0033ff}.screen{min-height:310px;border:1px solid #e1e4ef;background:white;border-radius:24px;padding:32px}.screen>p{color:#565b77}.words{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.word{border-radius:18px;background:#f5f6fc;border:1px solid #eceef7;padding:18px}.word strong{display:block;font-size:25px;margin:10px 0 4px}.word p{font-size:12px;color:#65677c;margin:8px 0 0}.word svg{width:90px;height:62px;color:#7060d5}.word .meaning{font-size:14px;color:#353963}.audio-pending{font-size:12px;color:#68617c;background:#f3f0fc;padding:12px 14px;border-radius:12px;margin-top:18px}.parts{display:flex;flex-wrap:wrap;gap:10px;margin:32px 0}.part{display:flex;flex-direction:column;gap:10px;border:1px solid #d9ddfa;background:#f2f4ff;padding:18px 22px;border-radius:17px;font-size:26px;animation:emphasis 1.5s ease both}.part:nth-child(2){animation-delay:1.5s}.part:nth-child(3){animation-delay:3s}.part small{font-size:12px;color:#65677c}.cue{background:#f2efff;border-radius:17px;padding:24px;font-size:23px;line-height:1.5;margin:24px 0;color:#332164}.cue[data-layout=message],.cue[data-layout=message_composer]{margin-left:18px;border-bottom-right-radius:4px}.options,.tiles{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0}.options{flex-direction:column}.choice,.tile{border:1px solid #dce0f0;background:#fff;border-radius:13px;color:#00033d;padding:14px 20px;text-align:left}.choice[aria-pressed=true]{border-color:#0033ff;background:#eef1ff}.answer-label{display:block;margin:20px 0 9px;font-size:13px;color:#65677c}input{width:100%;border:1px solid #cbd1e6;border-radius:14px;background:#fafbff;padding:17px;font-size:22px;color:#00033d}.assembled{min-height:70px;border:1px dashed #b7bedd;border-radius:14px;padding:16px;font-size:23px;margin-bottom:8px}.primary{background:#0033ff;color:#fff;padding:15px 24px;border-radius:14px}.quiet{background:#eceefa;color:#353965;padding:15px 20px;border-radius:14px}.feedback{margin-top:24px;padding:20px;border-radius:17px;background:#eff4ff;border:1px solid #d4def5;line-height:1.6}.feedback[data-correct=false]{background:#fff3ea;border-color:#f2dbc6}.feedback[data-correct=null]{background:#f2f0f8;border-color:#e0dbea}.feedback strong{display:block}.feedback p{margin:8px 0}.feedback details{margin-top:10px;font-size:14px}.feedback summary{cursor:pointer}.feedback .model{font-size:23px}footer{display:flex;justify-content:space-between;gap:15px;margin:20px 0}.footnote{text-align:center;font-size:12px;color:#73768b;margin-bottom:40px}#error{background:#fff0f0;color:#85233d;padding:16px;border-radius:12px;margin:15px 0}.checkpoint-symbol{width:64px;height:64px;border-radius:20px;background:#eeecff;color:#7357d6;display:grid;place-items:center;font-size:30px;margin-bottom:24px}@keyframes emphasis{50%{background:#dce3ff;border-color:#977dff;transform:translateY(-4px)}}@media(prefers-reduced-motion:reduce){.part{animation:none}}@media(max-width:600px){.lesson-shell{padding:0 16px}header{padding:20px 0}.brand{font-size:21px}main{margin-top:22px}.intro{padding:25px 23px;border-radius:22px}h1{font-size:32px}nav{gap:6px}nav button{padding:12px 9px;font-size:12px}.screen{padding:24px 20px}.word{padding:13px}.word strong{font-size:23px}.parts{gap:7px}.part{padding:15px 13px;font-size:23px}.cue{font-size:21px;padding:20px}.tag{font-size:11px}}
.command-symbol{width:56px;height:48px;background:#eae6ff;color:#6d50cf;border-radius:14px;display:grid;place-items:center;font-size:30px;margin-bottom:12px}
.audio-play{display:inline-flex;align-items:center;justify-content:center;margin-top:14px;padding:10px 16px;min-height:42px;border-radius:12px;background:#0033ff;color:#fff;font-size:14px;font-weight:650}
.audio-play:hover{background:#254cdd}.audio-source{font-size:12px;color:#68617c;margin-top:14px}.word .audio-play{width:100%}
.choice[data-result=correct],.choice[aria-pressed=true][data-result=correct],#answer[data-result=correct]{border:2px solid #148366;background:#f0fbf6;box-shadow:0 0 0 3px #14836618}
.choice[data-result=incorrect],.choice[aria-pressed=true][data-result=incorrect],#answer[data-result=incorrect]{border:2px solid #c43d52;background:#fff5f6;box-shadow:0 0 0 3px #c43d5218}
.choice[data-result=uncertain],.choice[aria-pressed=true][data-result=uncertain],#answer[data-result=uncertain]{border:2px solid #7060a0;background:#f8f6ff}
.choice[data-result=incorrect]:focus-visible{outline-color:#c43d52}
.choice[data-result=correct]:focus-visible{outline-color:#148366}
.choice:disabled[data-result],#answer:disabled[data-result]{opacity:1}
.answer-feedback{display:flex;align-items:center;gap:9px;min-height:30px;margin:7px 0 14px;font-size:14px;line-height:1.4;color:#8e283b}
.answer-feedback[data-result=correct]{color:#116c53}.answer-feedback[data-result=uncertain]{color:#605484}
.answer-mark{display:inline-grid;place-items:center;width:23px;height:23px;flex:none;border-radius:50%;background:currentColor;color:inherit;font-size:0}
.answer-mark::after{content:'!';color:white;font-size:15px;font-weight:700}.answer-feedback[data-result=correct] .answer-mark::after{content:'✓'}.answer-feedback[data-result=uncertain] .answer-mark::after{content:'?'}

/* Keep the exercise itself in focus: one prompt, one cue, one action. */
body{background:radial-gradient(circle at 15% 0%,#efedff 0,transparent 36%),#f6f7fc}
main{max-width:720px}
.intro{background:radial-gradient(circle at 90% 5%,#9f8dff 0,#4b65e9 33%,#102068 70%,#00033d 100%);box-shadow:0 14px 38px #26377d25}
.preview-note{background:#f7f5ff;border-color:#e9e4ff;color:#615987}
.screen{border:1px solid #e7e9f4;box-shadow:0 18px 50px #1827580d;padding:36px;border-radius:28px}
body[data-step=task] .intro{padding:20px 26px;margin-bottom:12px;border-radius:20px}
body[data-step=task] .intro h1{font-size:26px;letter-spacing:-1px;margin:5px 0}
body[data-step=task] .intro>p:last-child{display:none}
body[data-step=task] nav{margin:16px 0}
.task-type{display:inline-flex;align-items:center;padding:7px 11px;border-radius:999px;background:#eeeaff;color:#6451b7;font-size:11px;font-weight:800;letter-spacing:.11em;margin-bottom:14px}
.screen .task-type+h2{font-size:29px;line-height:1.18;letter-spacing:-1px;margin-bottom:20px}
.cue{position:relative;overflow:hidden;display:flex;flex-direction:column;gap:11px;background:linear-gradient(125deg,#f4f0ff,#f2f5ff);border:1px solid #e9e4ff;border-radius:20px;padding:24px 28px;margin:0 0 24px;color:#17245c;box-shadow:inset 0 1px #fff9}
.cue::after{content:'';position:absolute;right:-42px;top:-48px;width:160px;height:160px;border-radius:50%;background:radial-gradient(circle,#cfc9ff99,transparent 70%);pointer-events:none}
.cue-label{position:relative;z-index:1;font-size:11px;line-height:1;font-weight:800;letter-spacing:.12em;color:#7167a3}
.cue-text{position:relative;z-index:1;font-size:25px;line-height:1.35;font-weight:650;letter-spacing:-.5px}
.cue[data-layout=message],.cue[data-layout=message_composer]{margin-left:0;border-bottom-right-radius:20px}
.options{gap:12px;margin:0}
.choice{width:100%;display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:64px;border:1.5px solid #dfe3f2;border-radius:17px;background:#fff;padding:16px 20px;font-size:18px;font-weight:600;box-shadow:0 4px 14px #14265d08;transition:border-color .18s,background .18s,transform .18s,box-shadow .18s}
.choice::after{content:'→';font-size:20px;color:#8b90bb;flex:none}
.choice:not(:disabled):hover{transform:translateY(-2px);border-color:#8f87ed;box-shadow:0 8px 22px #352c951b}
.choice[data-result=correct]::after{content:'✓';color:#148366}
.choice[data-result=incorrect]::after{content:'×';color:#c43d52}
.choice[data-result=uncertain]::after{content:'?';color:#7060a0}
.tiles{gap:11px;margin:18px 0 14px}
.tile{border:1px solid #cfd7f7;background:#f5f7ff;border-radius:14px;min-width:72px;min-height:54px;text-align:center;font-size:19px;font-weight:650;box-shadow:0 4px 10px #26377d0b}
.tile:not(:disabled):hover{background:#eaefff;border-color:#748af6}
.assembled{display:flex;align-items:center;min-height:76px;border:1.5px dashed #b8c2e4;border-radius:17px;background:#fbfbff;padding:18px 20px;font-size:22px;color:#253260;margin:0}
.answer-label{margin:0 0 10px;font-weight:650;color:#424d76}
#answer{min-height:62px;border:1.5px solid #cfd6ed;background:#fff;border-radius:17px;padding:16px 20px}
#answer::placeholder{color:#9aa1ba}
.primary{background:#0033ff;border-radius:14px;font-weight:650;box-shadow:0 6px 16px #0033ff26}
.quiet{border-radius:14px}
.word{background:#fbfbff;border:1px solid #e7e9f5;border-radius:20px;box-shadow:0 5px 20px #2830750b}
.words{grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px}
.word strong{margin:10px 0 4px}
.word .meaning{font-size:15px}
.command-symbol{background:linear-gradient(135deg,#ece9ff,#e7f1ff)}
.part{background:#f5f4ff;border-color:#e1def9}
.audio-source{color:#817da1}
@media(max-width:600px){
  main{margin-top:18px}
  .screen{padding:24px 20px;border-radius:22px;min-height:260px}
  body[data-step=task] .intro{padding:16px 20px}
  body[data-step=task] .intro h1{font-size:23px}
  body[data-step=task] nav{gap:6px;margin:14px 0}
  body[data-step=task] nav button{padding:10px 8px}
  .screen .task-type+h2{font-size:25px;margin-bottom:16px}
  .cue{padding:20px;margin-bottom:18px;border-radius:18px}
  .cue-text{font-size:22px}
  .choice{min-height:60px;padding:14px 16px;font-size:17px}
  .words{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .word{padding:13px}
  .word strong{font-size:22px}
  .word .meaning{font-size:13px}
  footer{margin-top:16px}
}
@media(prefers-reduced-motion:reduce){.choice{transition:none}}

.file-launch{max-width:520px;margin:12vh auto;padding:42px;border:1px solid #e7e9f4;border-radius:28px;background:#fff;box-shadow:0 18px 50px #18275816}
.file-launch-brand{font-size:24px;font-weight:800;letter-spacing:-1px;color:#0033ff}
.file-launch h1{font-size:34px;line-height:1.15;margin:28px 0 14px}
.file-launch p{color:#4d5575;margin:0 0 26px}
.file-launch-button{display:inline-flex;align-items:center;justify-content:center;min-height:54px;padding:14px 22px;border-radius:14px;background:#0033ff;color:#fff;font-weight:700}
.file-launch-help{font-size:13px;margin:24px 0 0!important}
@media(max-width:600px){.file-launch{margin:8vh 16px;padding:30px 24px}.file-launch h1{font-size:29px}}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.preview-tools{display:flex;align-items:center;gap:12px;min-height:36px;margin:-12px 0 14px;font-size:12px;color:#566184}
.preview-tools button{min-height:34px;padding:5px 10px;background:transparent;border:1px solid #d9deef;border-radius:10px;color:#566184;font-size:12px;font-weight:650}
.preview-tools button:hover{border-color:#8f96d4;color:#252f71;background:#f7f7ff}
.preview-tools button:disabled{opacity:.5}
body[data-step=task] .preview-tools{margin-top:-8px}
.part,.part:nth-child(2),.part:nth-child(3){animation:none;transition:transform .2s ease,background .2s ease,border-color .2s ease,box-shadow .2s ease}
.part.is-speaking{background:#e2e8ff;border-color:#617cff;transform:translateY(-8px) scale(1.035);box-shadow:0 12px 24px #3954c529}
@media(prefers-reduced-motion:reduce){.part,.part:nth-child(2),.part:nth-child(3){transition:none}.part.is-speaking{transform:none}}
.assembled{flex-wrap:wrap;gap:9px;transition:background .2s ease,border-color .2s ease}
.assembled[data-result=correct]{background:#f0f9f3;border-color:#b8dcc8}
.assembled-placeholder{color:#8992b2;font-size:17px}
.placed-word{display:inline-flex;align-items:center;min-height:42px;padding:5px 13px;border:1px solid #abd9c2;border-radius:12px;background:#e9f7ef;color:#16634b;font-weight:650;transition:background .18s,border-color .18s,color .18s}
.assembled[data-result=correct] .placed-word{border-color:#168564;background:#c8efdc;color:#07583d;box-shadow:0 2px 7px #1685641a}
.assembled[data-result=incorrect] .placed-word{border-color:#d44b61;background:#ffe1e6;color:#9c233b;transition:none}
.assembled[data-result=uncertain] .placed-word{border-color:#8a79b7;background:#f0ecfb;color:#5b4c83}
.placed-word.is-entering{animation:word-in .22s cubic-bezier(.2,.8,.2,1) both}
.tile.is-picked{visibility:hidden}
.assembled .placed-word.is-returning{animation:word-reject .62s ease-in both}
@keyframes word-in{from{opacity:0;transform:translateY(18px) scale(.94)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes answer-shake{0%,100%{transform:translateX(0)}15%{transform:translateX(-11px)}30%{transform:translateX(9px)}45%{transform:translateX(-7px)}60%{transform:translateX(5px)}75%{transform:translateX(-3px)}}
@keyframes word-reject{0%{opacity:1;transform:translate(0,0) scale(1)}16%{transform:translate(-9px,0)}32%{transform:translate(8px,0)}48%{transform:translate(-6px,0)}64%{opacity:1;transform:translate(3px,0)}100%{opacity:0;transform:translate(0,46px) scale(.9)}}
@media(prefers-reduced-motion:reduce){.placed-word.is-entering,.assembled .placed-word.is-returning{animation:none}}
.number-symbol{display:grid;place-items:center;width:58px;height:48px;border-radius:14px;background:#eae6ff;color:#5843ad;font-size:25px;font-weight:800}
.grammar-symbol{display:grid;place-items:center;width:58px;height:48px;border-radius:14px;background:#eae6ff;color:#5843ad;font-size:25px;font-weight:800}
.vocab-symbol{display:grid;place-items:center;width:58px;height:48px;border-radius:14px;background:#e4edff;color:#3155b8;font-size:25px;font-weight:800}
.numeric-display{display:flex;align-items:center;justify-content:center;min-height:78px;margin:16px 0;border:2px solid #cdd5ef;border-radius:18px;background:#fbfcff;color:#17245c;font-size:32px;font-weight:750;letter-spacing:.12em;font-variant-numeric:tabular-nums}
.numeric-display[data-result=correct]{border-color:#148366;background:#f0fbf6;color:#116c53}
.numeric-display[data-result=incorrect]{border-color:#c43d52;background:#fff5f6;color:#9a2a40}
.numeric-display.is-shaking{animation:answer-shake .43s cubic-bezier(.36,.07,.19,.97) both}
.number-pad{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:16px auto;max-width:330px}
.number-key{min-height:60px;border:1px solid #d7def5;border-radius:16px;background:#fff;color:#17245c;font-size:25px;font-weight:700;box-shadow:0 4px 12px #26377d0c}
.number-key:hover{background:#eef2ff;border-color:#8797eb}
.number-key:active{transform:scale(.96)}
@media(prefers-reduced-motion:reduce){.numeric-display.is-shaking{animation:none}.number-key:active{transform:none}}

/* New vocabulary is read as one English–Russian pair per row. */
.words{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.word{overflow:hidden;padding:0;border:1px solid #dfe3f4;background:#fff;border-radius:19px;box-shadow:0 6px 20px #26377d0b}
.word-top{display:flex;align-items:center;gap:14px;padding:17px 18px}
.word-term{min-width:0;flex:1}
.word-caption{display:block;color:#706899;font-size:10px;font-weight:800;letter-spacing:.12em;line-height:1.3}
.word strong{display:block;margin:3px 0 0;color:#00033d;font-size:26px;line-height:1.25;overflow-wrap:anywhere}
.word-translation{display:flex;flex-direction:column;gap:4px;padding:13px 18px 16px;border-top:1px solid #e5e3f5;background:#f3f1ff}
.word .meaning{display:block;color:#302961;font-size:18px;font-weight:650;line-height:1.35;overflow-wrap:anywhere}
.word-media{flex:none;display:grid;place-items:center;width:46px;height:46px;border-radius:13px;background:#eef1ff;color:#5263bd}
.word-media svg,.word svg{width:43px;height:40px}
.word .vocab-symbol{font-size:25px}
.word .word-audio{flex:none;display:grid;place-items:center;width:48px;height:48px;min-height:48px;margin:0;padding:0;border-radius:14px;font-size:20px}
@media(max-width:600px){.words{grid-template-columns:minmax(0,1fr);gap:10px}.word{padding:0}.word-top{gap:12px;padding:15px 16px}.word strong{font-size:24px}.word-translation{padding:12px 16px 15px}.word .meaning{font-size:17px}}

.rule-card{display:grid;gap:8px;margin:16px 0 22px;padding:18px 20px;border:1px solid #dcd9fb;border-left:4px solid #6d57df;border-radius:17px;background:#f3f1ff;color:#25245d}
.rule-label{color:#6250ac;font-size:11px;font-weight:800;letter-spacing:.12em}
.rule-text{margin:0;color:#25245d;font-size:17px;font-weight:600;line-height:1.45}
.rule-example{width:fit-content;max-width:100%;padding:8px 11px;border-radius:10px;background:#fff;color:#25245d;font-size:15px;font-weight:700;line-height:1.4;overflow-wrap:anywhere}
@media(max-width:600px){.rule-card{padding:15px 16px;margin:14px 0 18px}.rule-text{font-size:16px}.rule-example{font-size:14px}}

/* Telegram fullscreen leaves its status bar and close controls over the WebView. */
:root{
  --safe-top:max(env(safe-area-inset-top,0px),calc(var(--tg-safe-area-inset-top,0px) + var(--tg-content-safe-area-inset-top,0px)));
  --safe-bottom:max(env(safe-area-inset-bottom,0px),calc(var(--tg-safe-area-inset-bottom,0px) + var(--tg-content-safe-area-inset-bottom,0px)));
  --safe-left:max(env(safe-area-inset-left,0px),calc(var(--tg-safe-area-inset-left,0px) + var(--tg-content-safe-area-inset-left,0px)));
  --safe-right:max(env(safe-area-inset-right,0px),calc(var(--tg-safe-area-inset-right,0px) + var(--tg-content-safe-area-inset-right,0px)));
}
.telegram-mini-app .lesson-shell{padding-top:var(--safe-top);padding-bottom:var(--safe-bottom);padding-left:calc(28px + var(--safe-left));padding-right:calc(28px + var(--safe-right))}
@media(max-width:600px){.telegram-mini-app .lesson-shell{padding-left:calc(16px + var(--safe-left));padding-right:calc(16px + var(--safe-right))}}
html.telegram-mini-app,html.telegram-mini-app body{overscroll-behavior-y:contain}
