/* Mini App «Учить» — v2. Спокойный, сфокусированный интерфейс.
   Все цвета — токены на :root; тёмная тема переопределяет те же токены. */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --bg: #F6F3EE;
  --card: #FFFFFF;
  --card-2: #EFEBE4;
  --track: #E8E3DA;
  --text: #1C1B18;
  --text-2: #6B665D;
  --text-3: #A09B91;
  --line: rgba(28, 27, 24, .08);
  --line-2: rgba(28, 27, 24, .16);
  --accent: #4352D9;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(67, 82, 217, .10);
  --ok: #138553;
  --ok-ink: #0E6B41;
  --ok-soft: #E3F3EA;
  --on-ok: #FFFFFF;
  --no: #CF4132;
  --no-ink: #B03125;
  --no-soft: #FCE9E5;
  --on-no: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(60, 40, 10, .05), 0 2px 8px -2px rgba(60, 40, 10, .06);
  --shadow: 0 1px 2px rgba(60, 40, 10, .04), 0 10px 28px -10px rgba(60, 40, 10, .14);
  --shadow-lg: 0 2px 4px rgba(60, 40, 10, .04), 0 24px 48px -16px rgba(60, 40, 10, .22);
  --scrim: rgba(24, 20, 12, .34);
  --gut: 20px;
  --safe-top: calc(env(safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #131311;
  --card: #21201D;
  --card-2: #2D2B28;
  --track: #2D2C29;
  --text: #F3F0EA;
  --text-2: #A8A398;
  --text-3: #6F6B62;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .18);
  --accent: #909BFF;
  --accent-ink: #0F1235;
  --accent-soft: rgba(144, 155, 255, .15);
  --ok: #4FC98A;
  --ok-ink: #7FE0AB;
  --ok-soft: #14261C;
  --on-ok: #08261A;
  --no: #FF8D7C;
  --no-ink: #FFA797;
  --no-soft: #2D1B18;
  --on-no: #3A0F09;
  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, .05);
  --shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 12px 28px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 0 0 1px rgba(255, 255, 255, .07), 0 24px 48px -16px rgba(0, 0, 0, .7);
  --scrim: rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body { background: var(--bg); color: var(--text); }
body {
  font: 400 17px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
  min-height: 100vh;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; touch-action: manipulation; }
button:disabled { cursor: default; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.i { display: block; flex: none; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; overflow-x: hidden; }

.screen {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  animation: enter .26s var(--ease) both;
}
.screen.still { animation: none; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- общие элементы */

.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.muted { color: var(--text-2); }

.topbar {
  display: flex; align-items: center; gap: 4px;
  padding: calc(var(--safe-top) + 6px) 8px 0;
  min-height: calc(var(--safe-top) + 56px);
}
.topbar-title { flex: 1; text-align: center; font-size: 15px; font-weight: 600; color: var(--text-2); letter-spacing: -.005em; }
.topbar-spacer { width: 44px; height: 44px; flex: none; }
.topbar-right { min-width: 44px; height: 44px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.iconbtn { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); transition: background .15s, color .15s; }
.iconbtn:active { background: var(--card-2); color: var(--text); }

.pbar { height: 4px; margin: 4px var(--gut) 0; border-radius: 2px; background: var(--track); overflow: hidden; }
.pbar i { display: block; height: 100%; width: 100%; border-radius: 2px; background: var(--accent); transform-origin: left center; transition: transform .45s var(--ease); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 56px; padding: 0 22px; border-radius: 18px;
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
  transition: transform .15s var(--ease), background .15s, opacity .15s;
  user-select: none; -webkit-user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:disabled { background: var(--card-2); color: var(--text-3); }
.btn-soft { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-ok { background: var(--ok); color: var(--on-ok); }
.btn-no { background: var(--no); color: var(--on-no); }
.btn-block { width: 100%; }
.btn-round { width: 56px; padding: 0; flex: none; }
.btn:disabled.btn-soft { opacity: .45; box-shadow: none; }
.linkbtn { min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 15px; font-weight: 500; color: var(--text-2); border-radius: 12px; }
.linkbtn:active { color: var(--text); }
.linkbtn.accent { color: var(--accent); }

.speaker {
  position: relative; display: grid; place-items: center; flex: none;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  transition: transform .15s var(--ease), background .15s;
}
.speaker:active { transform: scale(.94); }
.speaker.md { width: 56px; height: 56px; }
.speaker.lg { width: 76px; height: 76px; }
.speaker.xl { width: 128px; height: 128px; }
.speaker.sm { width: 44px; height: 44px; }
.speaker::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid var(--accent); opacity: 0; pointer-events: none;
}
.speaker.playing::after { animation: ring 1.1s ease-out infinite; }
@keyframes ring { from { transform: scale(.92); opacity: .55; } to { transform: scale(1.18); opacity: 0; } }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; top: calc(var(--safe-top) + 12px); transform: translate(-50%, -12px);
  max-width: calc(100% - 40px); padding: 12px 18px; border-radius: 16px;
  background: var(--text); color: var(--bg); font-size: 15px; font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0; z-index: 200; pointer-events: none;
  transition: opacity .2s, transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* слово с ударением */
.wd .st { color: var(--accent); font-weight: 800; }

/* ---------------------------------------------------------------- главный */

.home { padding: calc(var(--safe-top) + 24px) var(--gut) calc(var(--safe-bottom) + 28px); }
.home-head { margin-bottom: 20px; }
.topic-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  margin: 0 -10px; padding: 0 10px; border-radius: 14px;
  font-size: 26px; font-weight: 650; letter-spacing: -.028em; line-height: 1.18; text-align: left;
}
.topic-btn svg { color: var(--text-2); margin-top: 3px; }
.topic-btn:active { background: var(--card-2); }
.topic-btn.single { pointer-events: none; }

.banner {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 18px 18px 18px 20px; margin-bottom: 14px; border-radius: 24px;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: transform .15s var(--ease);
}
.banner:active { transform: scale(.985); }
.banner-main { flex: 1; min-width: 0; }
.banner-title { display: block; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.banner-sub { display: block; margin-top: 2px; font-size: 14px; opacity: .78; }
.banner .go { background: color-mix(in srgb, var(--accent-ink) 18%, transparent); color: var(--accent-ink); }

.stages { display: flex; flex-direction: column; gap: 12px; }
.stage {
  display: block; width: 100%; padding: 18px; border-radius: 24px;
  background: var(--card); box-shadow: var(--shadow);
  transition: transform .15s var(--ease), opacity .15s;
}
.stage:active:not(:disabled) { transform: scale(.985); }
.stage-top { display: flex; align-items: center; gap: 12px; }
.num { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 700; }
.stage-title { font-size: 22px; font-weight: 650; letter-spacing: -.022em; }
.cont { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 9px; letter-spacing: .01em; }
.go { margin-left: auto; width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--text); }
.stage-meta { display: block; margin-top: 12px; font-size: 15px; line-height: 1.4; color: var(--text-2); }
.stage-meta b { font-weight: 600; color: var(--text); }
.bar { display: block; height: 4px; border-radius: 2px; margin-top: 14px; background: var(--track); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); transition: width .6s var(--ease); }

.stage.off { background: transparent; box-shadow: none; border: 1.5px dashed var(--line-2); padding: 16.5px; }
.stage.off .num { background: var(--card-2); color: var(--text-2); }
.stage.off .stage-title { color: var(--text-2); }
.stage.off .go { background: transparent; color: var(--text-2); }
.stage.off .bar i { background: var(--text-3); }
.stage.off .stage-meta b { color: var(--text-2); }
.stage:disabled { opacity: .7; }

.home-foot { margin-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.home-note { font-size: 14px; color: var(--text-2); text-align: center; }
.stage.loading .go svg { display: none; }
.stage.loading .go::after, .banner.loading .go::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: currentColor; animation: spin .7s linear infinite; }

.skel { border-radius: 24px; background: var(--card); height: 124px; margin-bottom: 12px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, var(--accent-soft) 50%, transparent 80%); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------------------------------------------------------------- bottom sheet (общий слой) */

.layer { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.layer .scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .22s ease-out; pointer-events: auto; }
.layer.open .scrim { opacity: 1; }
.layer.light .scrim { background: transparent; }
.sheet {
  position: relative; width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto;
  border-radius: 28px 28px 0 0; background: var(--card); box-shadow: var(--shadow-lg);
  padding: 22px var(--gut) calc(var(--safe-bottom) + 20px);
  transform: translateY(100%); transition: transform .26s var(--ease); pointer-events: auto;
}
.layer.open .sheet { transform: none; }
.sheet.ok { background: var(--ok-soft); }
.sheet.no { background: var(--no-soft); }
.sheet-grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: -10px auto 14px; }
.sheet-title { font-size: 20px; font-weight: 650; letter-spacing: -.02em; margin-bottom: 8px; }

.topic-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 4px; border-radius: 14px; }
.topic-row + .topic-row { border-top: 1px solid var(--line); }
.topic-row-main { flex: 1; min-width: 0; }
.topic-row-title { display: block; font-size: 17px; font-weight: 600; }
.topic-row-sub { display: block; font-size: 14px; color: var(--text-2); }
.topic-row .tick { color: var(--accent); }

.res { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.res-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.ok .res-dot { background: var(--ok); color: var(--on-ok); }
.no .res-dot { background: var(--no); color: var(--on-no); }
.res-title { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.ok .res-title { color: var(--ok-ink); }
.no .res-title { color: var(--no-ink); }
.res-answer { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.res-answer-text { flex: 1; min-width: 0; }
.res-en { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; overflow-wrap: anywhere; }
.res-ru { margin-top: 2px; font-size: 16px; color: var(--text-2); }
.res-said { margin-top: 12px; font-size: 15px; color: var(--text-2); }
.res-said s { text-decoration-color: var(--no); text-decoration-thickness: 2px; }
.res-msg { margin-top: 10px; font-size: 15px; line-height: 1.45; color: var(--text); opacity: .85; }
.sheet .btn { margin-top: 18px; }
.sheet-timer { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: color-mix(in srgb, var(--ok) 22%, transparent); overflow: hidden; border-radius: 28px 28px 0 0; }
.sheet-timer i { display: block; height: 100%; background: var(--ok); transform-origin: left; animation: drain linear forwards; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------------------------------------------------------------- знакомство */

.intro .stack {
  position: relative; flex: 1; min-height: 360px; margin: 14px var(--gut) 0; padding-bottom: 30px;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.icard {
  position: absolute; left: 0; right: 0; top: 0; bottom: 30px;
  display: flex; flex-direction: column; padding: 28px 24px 18px;
  border-radius: 30px; background: var(--card); box-shadow: var(--shadow);
  transform-origin: 50% 100%; will-change: transform;
  transition: transform .3s var(--ease), opacity .22s ease-out, visibility 0s;
}
.stack.dragging .icard { transition: none; }
.icard[data-d="0"] { transform: none; z-index: 10; }
.icard[data-d="1"] { transform: translateY(16px) scale(.94); z-index: 9; }
.icard[data-d="2"] { transform: translateY(30px) scale(.88); z-index: 8; opacity: .9; }
.icard[data-d="3"] { transform: translateY(30px) scale(.88); z-index: 7; opacity: 0; }
.icard[data-d="-1"] { transform: translateX(-130%) rotate(-9deg); opacity: 0; visibility: hidden; z-index: 20; transition: transform .3s var(--ease), opacity .22s ease-out, visibility 0s .3s; }
.icard > * { transition: opacity .22s ease-out; }
.icard[data-d="1"] > *, .icard[data-d="2"] > *, .icard[data-d="3"] > * { opacity: 0; }

.icard-main { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0; }
.iword { font-weight: 600; letter-spacing: -.04em; line-height: 1.08; overflow-wrap: anywhere; }
.iword.word { font-size: 46px; }
.iword.phrase { font-size: 34px; letter-spacing: -.034em; }
.istress { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.itrans { margin-top: 14px; font-size: 21px; font-weight: 500; letter-spacing: -.012em; line-height: 1.3; max-width: 100%; text-wrap: balance; }
.iuses { margin-top: 12px; font-size: 14px; color: var(--text-2); }
.iuses b { font-weight: 600; color: var(--text); }
.iaudio { margin-top: 26px; }
.ihint { margin-top: 16px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); }
.ichip { margin-top: 16px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 4px 10px; }

.icard-foot { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 4px; }
.extoggle { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.extoggle svg { transition: transform .2s var(--ease); }
.icard.open .extoggle svg { transform: rotate(180deg); }
.exwrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s var(--ease); }
.icard.open .exwrap, .exwrap.always { grid-template-rows: 1fr; }
.exwrap > div { overflow: hidden; min-height: 0; }
.ex { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0 4px; text-align: left; }
.ex-text { flex: 1; min-width: 0; }
.ex-en { font-size: 16px; line-height: 1.4; }
.ex-ru { margin-top: 2px; font-size: 14px; color: var(--text-2); line-height: 1.4; }
.ex-note { margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--text-2); text-align: left; padding-bottom: 4px; }
.exwrap.always .extoggle { display: none; }

.controls { display: flex; gap: 10px; padding: 12px var(--gut) calc(var(--safe-bottom) + 18px); }
.controls .btn-primary { flex: 1; }

/* ---------------------------------------------------------------- вопросы */

.q .qbody { flex: 1; display: flex; flex-direction: column; padding: 12px var(--gut) 8px; min-height: 0; }
.stim { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0; padding: 12px 0 20px; }
.prompt { font-size: 15px; color: var(--text-2); margin-bottom: 14px; max-width: 28ch; text-wrap: balance; }
.bigword { font-weight: 600; letter-spacing: -.04em; line-height: 1.1; font-size: 42px; overflow-wrap: anywhere; }
.bigru { font-weight: 600; letter-spacing: -.028em; line-height: 1.2; font-size: 30px; text-wrap: balance; }
.bigru.sm { font-size: 26px; }
.stim .speaker { margin-top: 22px; }
.caption { margin-top: 16px; font-size: 14px; color: var(--text-2); }
.hintline { margin-top: 12px; font-size: 14px; color: var(--text-2); font-variant-ligatures: none; letter-spacing: .02em; }

.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: center; min-height: 60px; padding: 12px 18px; border-radius: 18px;
  background: var(--card); box-shadow: var(--shadow-sm); border: 2px solid transparent;
  font-size: 18px; font-weight: 500; letter-spacing: -.012em; line-height: 1.3;
  transition: transform .15s var(--ease), background .18s, border-color .18s;
}
.opt:active:not(:disabled) { transform: scale(.985); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--no); background: var(--no-soft); }
.opt:disabled:not(.sel):not(.right):not(.wrong) { opacity: .5; }

.qactions { padding: 12px var(--gut) calc(var(--safe-bottom) + 14px); display: flex; flex-direction: column; gap: 4px; }
.qactions .skip { align-self: center; }
.qactions .row { display: flex; gap: 10px; }
.qactions .row .btn { flex: 1; }
.qactions .row .btn-soft { flex: 0 0 auto; padding: 0 24px; }

.field {
  display: block; width: 100%; padding: 16px 18px; border-radius: 18px;
  background: var(--card); border: 2px solid transparent; box-shadow: var(--shadow-sm);
  font-size: 22px; font-weight: 500; letter-spacing: -.015em; line-height: 1.3;
  outline: none; resize: none; transition: border-color .15s;
}
.field:focus { border-color: var(--accent); }
.field::placeholder { color: var(--text-3); }
textarea.field { font-size: 19px; min-height: 124px; }
.fieldwrap { margin-top: 4px; }

.blank { display: inline-block; min-width: 76px; margin: 0 4px; border-bottom: 3px solid var(--accent); transform: translateY(-3px); }
.cloze { font-size: 25px; font-weight: 550; letter-spacing: -.02em; line-height: 1.5; text-wrap: balance; }
.cloze-ru { margin-top: 12px; font-size: 15px; color: var(--text-2); }
.quote { font-size: 26px; font-weight: 600; letter-spacing: -.028em; line-height: 1.25; text-wrap: balance; }

/* сборка из плиток */
.build-top { padding: 8px 0 22px; text-align: center; }
.build-top .prompt { margin-bottom: 10px; max-width: none; }
.answer-line {
  min-height: 108px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px 8px;
  background-image: linear-gradient(var(--line-2) 1.5px, transparent 1.5px);
  background-size: 100% 52px; background-position: 0 50px; background-repeat: repeat-y;
}
.bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 30px; }
.tile {
  height: 44px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 14px;
  background: var(--card); box-shadow: var(--shadow-sm); border: 1.5px solid transparent;
  font-size: 18px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap;
  transition: transform .15s var(--ease), opacity .15s;
}
.tile:active:not(:disabled) { transform: scale(.96); }
.tile.in { animation: pop .18s var(--ease); }
.tile.in:active { transform: scale(.96); }
@keyframes pop { from { transform: scale(.88); opacity: .4; } to { transform: none; opacity: 1; } }
.tile.used { background: transparent; box-shadow: none; border: 1.5px dashed var(--line); color: transparent; pointer-events: none; }
.build-alt { display: flex; justify-content: center; margin-top: 14px; }

/* диалог */
.sit { background: var(--card); border-radius: 26px; padding: 22px 22px 20px; box-shadow: var(--shadow); }
.sit .eyebrow { margin-bottom: 10px; }
.sit-text { font-size: 23px; font-weight: 600; letter-spacing: -.025em; line-height: 1.3; }
.sit-say { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 7px 14px 7px 12px; }
.model { margin-top: 12px; background: var(--card); border-radius: 26px; padding: 20px 20px 18px; box-shadow: var(--shadow); animation: enter .26s var(--ease) both; }
.model-row { display: flex; align-items: flex-start; gap: 12px; }
.model-en { flex: 1; font-size: 22px; font-weight: 600; letter-spacing: -.022em; line-height: 1.3; }
.model-alt { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 15px; color: var(--text-2); line-height: 1.45; }
.model-alt div + div { margin-top: 4px; }
.bubble-wrap { margin-top: 12px; animation: enter .26s var(--ease) both; }
.bubble-who { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin: 0 0 8px 6px; }
.bubble { background: var(--card-2); border-radius: 24px 24px 24px 8px; padding: 18px 18px 16px 20px; }
.bubble-row { display: flex; align-items: flex-start; gap: 12px; }
.bubble-en { flex: 1; font-size: 21px; font-weight: 550; letter-spacing: -.02em; line-height: 1.32; }
.bubble-ru { margin-top: 10px; font-size: 15px; line-height: 1.45; color: var(--text-2); }
.ask { margin: 18px 4px 4px; text-align: center; font-size: 15px; color: var(--text-2); }
.dialog-fill { flex: 1; }

/* ---------------------------------------------------------------- итог */

.summary { padding: calc(var(--safe-top) + 48px) var(--gut) calc(var(--safe-bottom) + 20px); }
.sum-main { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; }
.sum-mark { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); margin-bottom: 24px; }
.sum-mark.info { background: var(--accent-soft); color: var(--accent); }
.sum-text { font-size: 22px; font-weight: 600; letter-spacing: -.024em; line-height: 1.32; max-width: 22ch; text-wrap: balance; }
.sum-stats { display: flex; gap: 10px; width: 100%; margin-top: 32px; }
.stat { flex: 1; padding: 16px 14px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow-sm); text-align: left; }
.stat-n { display: block; font-size: 28px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-n small { font-size: 16px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.stat-l { display: block; margin-top: 4px; font-size: 13px; color: var(--text-2); }
.sum-next { margin-top: 14px; width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow-sm); text-align: left; font-size: 15px; color: var(--text-2); }
.sum-next svg { color: var(--accent); }
.sum-next b { display: block; font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.sum-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 28px; }
.sum-actions .row { display: flex; gap: 10px; }
.sum-actions .row .btn { flex: 1; }

/* ---------------------------------------------------------------- шпаргалка */

.cheat-title { padding: 4px var(--gut) 0; font-size: 28px; font-weight: 650; letter-spacing: -.028em; line-height: 1.15; }
.cheat-sub { padding: 2px var(--gut) 0; font-size: 15px; color: var(--text-2); }
.cheat { padding: 12px var(--gut) calc(var(--safe-bottom) + 32px); }
.cgroup { margin-top: 22px; }
.cgroup .eyebrow { padding: 0 4px 8px; }
.clist { background: var(--card); border-radius: 22px; box-shadow: var(--shadow-sm); overflow: hidden; }
.crow { display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-height: 56px; }
.crow + .crow { border-top: 1px solid var(--line); }
.crow-main { flex: 1; min-width: 0; }
.crow-en { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.012em; overflow-wrap: anywhere; }
.crow-ru { display: block; font-size: 14px; color: var(--text-2); line-height: 1.35; margin-top: 1px; }
.tag { flex: none; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--card-2); border-radius: 999px; padding: 3px 9px; }
.tag.hear { color: var(--accent); background: var(--accent-soft); }

/* ---------------------------------------------------------------- ошибки */

.errscreen { padding: calc(var(--safe-top) + 24px) var(--gut) calc(var(--safe-bottom) + 24px); align-items: center; justify-content: center; text-align: center; }
.err-mark { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--text-2); margin-bottom: 22px; }
.err-title { font-size: 24px; font-weight: 650; letter-spacing: -.026em; }
.err-text { margin-top: 8px; font-size: 16px; color: var(--text-2); max-width: 28ch; line-height: 1.45; }
.errscreen .btn { margin-top: 28px; min-width: 200px; }

@media (max-height: 640px) {
  .iword.word { font-size: 40px; }
  .stim { padding: 4px 0 12px; }
  .iaudio { margin-top: 18px; }
}
@media (min-width: 481px) {
  .app { box-shadow: 0 0 0 1px var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
