:root {
  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-2: #f0f2ef;
  --text: #1c2321;
  --muted: #66706c;
  --line: #e2e6e3;
  --accent: #22a06b;
  --accent-ink: #ffffff;
  --accent-soft: #e3f4ec;
  --bad: #d64545;
  --bad-soft: #fdecec;
  --warn: #c98a12;
  --warn-soft: #fbf1dc;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 16px rgba(20, 30, 25, .05);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121615;
    --surface: #1b201f;
    --surface-2: #232a28;
    --text: #e8ecea;
    --muted: #96a19c;
    --line: #2d3532;
    --accent: #34c184;
    --accent-ink: #08130e;
    --accent-soft: #173a2a;
    --bad: #f07272;
    --bad-soft: #3a1d1d;
    --warn: #e7b04a;
    --warn-soft: #3a2f17;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #121615;
    --surface: #1b201f;
    --surface-2: #232a28;
    --text: #e8ecea;
    --muted: #96a19c;
    --line: #2d3532;
    --accent: #34c184;
    --accent-ink: #08130e;
    --accent-soft: #173a2a;
    --bad: #f07272;
    --bad-soft: #3a1d1d;
    --warn: #e7b04a;
    --warn-soft: #3a2f17;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 .4rem; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; margin: 0 0 .5rem; }
h3 { font-size: 1.05rem; margin: 0; }
h1 small, h3 small { color: var(--muted); font-weight: 500; font-size: .6em; margin-left: .3em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 1rem; max-width: 60ch; }
.ico { width: 1em; height: 1em; vertical-align: -0.12em; flex: none; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(16px, calc((100vw - 1080px) / 2));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.1rem; }
.logo:hover { text-decoration: none; }
.logo b { color: var(--accent); }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 800;
}
.top nav { display: flex; gap: 4px; align-items: center; }
.nav-link, .nav-btn {
  color: var(--muted); padding: 6px 12px; border-radius: 999px; font: inherit; font-weight: 500; font-size: .95rem;
  white-space: nowrap; background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.nav-link:hover, .nav-btn:hover, .nav-group.open .nav-btn { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav-link.active, .nav-group.active .nav-btn { color: var(--text); background: var(--surface-2); }
.nav-group.active .nav-btn { box-shadow: inset 0 -2px 0 var(--accent); }
.nav-caret { font-size: .7em; opacity: .7; transition: transform .15s; }
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-btn .count { margin-left: 2px; }
.nav-group { position: relative; }
.nav-btn.has-due::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-left: 2px; }
/* padding-top bridges the gap so the menu stays open while the mouse moves down */
.nav-menu {
  position: absolute; top: 100%; right: 0; z-index: 20; padding-top: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .12s, transform .12s, visibility .12s;
}
.nav-menu::before { content: ''; position: absolute; inset: 8px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(20, 30, 25, .14); z-index: -1; }
.nav-group.open .nav-menu { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) {
  .nav-group:hover:not(.shut) .nav-menu { opacity: 1; visibility: visible; transform: none; }
  .nav-group:hover:not(.shut) .nav-caret { transform: rotate(180deg); }
}
.nav-menu a {
  display: flex; align-items: flex-start; gap: 12px; width: 290px; padding: 10px 12px; margin: 6px;
  border-radius: 10px; color: var(--text);
}
.nav-menu a:hover, .nav-menu a:focus-visible { background: var(--surface-2); text-decoration: none; }
.nav-menu a.active { background: var(--accent-soft); }
.nav-menu b { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .95rem; }
.nav-menu small { display: block; color: var(--muted); font-size: .82rem; margin-top: 1px; }
.nav-ico { font-size: 1.25rem; line-height: 1.3; width: 1.5rem; text-align: center; flex: none; }
.count { background: var(--bad); color: #fff; border-radius: 999px; font-size: .72rem; padding: 1px 7px; margin-left: 4px; font-weight: 700; }

main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 16px 48px; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: .82rem; padding: 20px 16px 28px; }

/* ---------- generic ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: .95rem; padding: 10px 18px; border-radius: 10px;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn:focus-visible, .chip:focus-visible, .icon-btn:focus-visible, .flash:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; font-size: .9rem; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--bad); }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--accent); cursor: pointer; font-size: 1.05rem;
  vertical-align: middle;
}
.icon-btn:hover { background: var(--accent-soft); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack.row { flex-direction: row; flex-wrap: wrap; }
.section-title { margin: 32px 0 12px; }
.small-note { font-size: .85rem; margin-top: 18px; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }
.notice { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; background: var(--warn-soft); color: var(--text); margin: 16px 0; }
.notice .ico { color: var(--warn); }
.notice.ok { background: var(--accent-soft); }
.notice.ok .ico { color: var(--accent); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; background: var(--lv, var(--accent)); border-radius: inherit; transition: width .3s; }
.bar.thin { height: 5px; margin: 10px 0 18px; }

.badge {
  display: inline-grid; place-items: center; min-width: 52px; height: 52px; border-radius: 14px;
  background: color-mix(in srgb, var(--lv) 16%, var(--surface)); color: var(--lv);
  font-weight: 800; font-size: 1.15rem; flex: none;
}
.badge.big { min-width: 72px; height: 72px; font-size: 1.6rem; border-radius: 18px; }
.badge.sm { min-width: 34px; height: 26px; font-size: .8rem; border-radius: 7px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-size: .82rem; font-weight: 600; white-space: nowrap;
}
.pill.ok { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: end; margin-bottom: 20px; }
.hero h1 { font-size: 2.3rem; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-row.wide { grid-template-columns: repeat(4, 1fr); margin: 16px 0 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .8rem; }
.stat.good b { color: var(--accent); }

.continue { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; margin-bottom: 12px; color: var(--text); border-left: 4px solid var(--accent); }
.continue.due { border-left-color: var(--warn); }
.continue:hover { text-decoration: none; border-color: var(--accent); }
.continue small { display: block; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.continue b { display: block; font-size: 1.05rem; }
.continue span:not(.btn) { color: var(--muted); font-size: .88rem; }

.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.level { display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s; }
.level:hover { border-color: color-mix(in srgb, var(--lv) 50%, var(--line)); }
.level-main { display: flex; gap: 14px; padding: 18px 18px 12px; color: var(--text); position: relative; flex: 1; }
.level-main:hover { text-decoration: none; }
.level-main p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.level .lock { position: absolute; top: 16px; right: 16px; color: var(--muted); }
.level.locked .badge { filter: grayscale(1); opacity: .6; }
.level-foot { display: flex; align-items: center; gap: 12px; padding: 10px 18px 16px; font-size: .85rem; }

/* ---------- level ---------- */
.level-head { display: flex; gap: 20px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.level-head > div:nth-child(2) { flex: 1; min-width: 240px; }
.level-head .lead { margin: 0; }
.level-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.topics { display: grid; gap: 10px; margin-top: 18px; }
.topic { display: flex; align-items: center; gap: 16px; padding: 14px 18px; color: var(--text); transition: border-color .15s, transform .1s; }
.topic:hover { text-decoration: none; border-color: var(--accent); }
.topic .num {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; flex: none; font-size: .9rem;
}
.topic .num[style] { color: #fff; border-radius: 10px; font-size: .78rem; }
.topic-body { flex: 1; min-width: 0; }
.topic-body p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.topic.locked { opacity: .62; }
.topic.locked .num { background: var(--surface-2); color: var(--muted); }

/* ---------- topic ---------- */
.topic-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.theory { padding: 28px 30px; }
.eyebrow { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.theory-body { margin-top: 14px; }
.theory-body p { margin: .6rem 0; }
.formula {
  background: var(--surface-2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 0 10px 10px 0;
  margin: 10px 0; font-size: .97rem;
}
.ex { padding-left: 0; list-style: none; margin: 14px 0; }
.ex li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ex li:last-child { border-bottom: 0; }
.tip { background: var(--warn-soft); padding: 10px 14px; border-radius: 10px; font-size: .94rem; }
.tip::before { content: "💡 "; }
.side { display: grid; gap: 14px; position: sticky; top: 80px; }
.side-card { padding: 18px; }
.side-card h3 { margin-bottom: 10px; }
.kv { list-style: none; padding: 0; margin: 0 0 16px; font-size: .92rem; }
.kv li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv li span { color: var(--muted); }
.custom-list { list-style: none; padding: 0; margin: 0; font-size: .9rem; display: grid; gap: 10px; }
.custom-list li { display: grid; gap: 2px; }
.custom-list small { color: var(--muted); }
.custom-list .link { justify-self: start; font-size: .82rem; }
.locked-screen { padding: 40px 24px; text-align: center; max-width: 560px; margin: 0 auto; }
.lock-big { font-size: 2.6rem; color: var(--muted); }

/* ---------- trainer ---------- */
.trainer { max-width: 760px; margin: 0 auto; }
.trainer-top { display: flex; align-items: center; gap: 12px; }
.trainer-title { flex: 1; font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.counters { display: flex; gap: 12px; font-size: .92rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.counters span { display: inline-flex; align-items: center; gap: 3px; }
.counters b { color: var(--text); }
.counters .ok { color: var(--accent); }
.counters .bad { color: var(--bad); }
.task { padding: 28px 30px 24px; }
.task-label { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.ru { font-size: 1.6rem; font-weight: 600; line-height: 1.3; margin: 8px 0 18px; }
.hint { margin: -6px 0 14px; color: var(--warn); font-size: .95rem; }
.answer {
  width: 100%; font: inherit; font-size: 1.15rem; padding: 14px 16px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--surface); color: var(--text); outline: none; transition: border-color .15s;
}
.answer:focus { border-color: var(--accent); }
.answer.wrong { border-color: var(--bad); }
.answer.right { border-color: var(--accent); background: var(--accent-soft); }
.answer.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.task-actions { display: flex; justify-content: space-between; margin-top: 12px; gap: 10px; }
.feedback { margin-top: 18px; padding: 16px 18px; border-radius: 12px; }
.feedback.good { background: var(--accent-soft); }
.feedback.bad { background: var(--bad-soft); }
.fb-title { font-weight: 700; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.feedback.good .fb-title { color: var(--accent); }
.feedback.bad .fb-title { color: var(--bad); }
.answer-line { font-size: 1.12rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.answer-line mark { background: color-mix(in srgb, var(--bad) 22%, transparent); color: inherit; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.feedback details { margin-top: 8px; font-size: .92rem; }
.feedback summary { cursor: pointer; color: var(--muted); }
.feedback ul { margin: 6px 0 0; padding-left: 20px; }
.feedback p { margin: 8px 0 0; font-size: .9rem; }
.fb-actions { margin-top: 8px; }

/* ---------- done ---------- */
.done { padding: 36px 28px; text-align: center; max-width: 680px; margin: 0 auto; }
.score-ring {
  --p: 0; width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center;
  background: conic-gradient(var(--warn) calc(var(--p) * 1%), var(--surface-2) 0);
}
.score-ring.pass { background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); }
.score-ring span { width: 94px; height: 94px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; }
.done h1 { font-size: 1.5rem; }
.done-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.schedule { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.schedule h3 { margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 7px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .9rem; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- flashcards ---------- */
.cards-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flash-wrap { max-width: 520px; margin: 20px auto 0; }
.flash { display: block; width: 100%; height: 260px; perspective: 1000px; background: none; border: 0; padding: 0; cursor: pointer; position: relative; font: inherit; color: var(--text); }
.flash .face {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  backface-visibility: hidden; transition: transform .45s; padding: 20px;
}
.flash .back { transform: rotateY(180deg); background: var(--accent-soft); }
.flash.flipped .front { transform: rotateY(-180deg); }
.flash.flipped .back { transform: rotateY(0); }
.flash small { position: absolute; top: 14px; right: 18px; color: var(--muted); }
.flash b { font-size: 1.9rem; text-align: center; }
.flash em { color: var(--muted); font-style: normal; font-size: .9rem; }
.flash-actions { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; }
.flash-actions .btn { min-width: 130px; }

/* ---------- profile ---------- */
.table-card { overflow-x: auto; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
tr.dim { opacity: .5; }
td .ico { color: var(--accent); }

/* ---------- modal & toast ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(10, 15, 13, .45); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; padding: 24px; max-width: 440px; width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal p { color: var(--muted); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: .92rem; transition: .25s; z-index: 60;
  max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .topic-layout { grid-template-columns: 1fr; }
  .side { position: static; }
  .stat-row.wide { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  h1 { font-size: 1.5rem; }
  .top { flex-wrap: wrap; gap: 8px; }
  .top nav { width: 100%; position: relative; justify-content: space-between; }
  .nav-link, .nav-btn { padding: 8px 10px; font-size: .92rem; }
  .nav-group { position: static; }
  .nav-menu { left: 0; right: 0; }
  .nav-menu a { width: auto; }
  .levels { grid-template-columns: 1fr; }
  .theory, .task { padding: 20px 18px; }
  .ru { font-size: 1.3rem; }
  .trainer-title { display: none; }
  .trainer-top { justify-content: space-between; }
  .topic { padding: 12px 14px; gap: 12px; }
  .topic .pill { display: none; }
  .level-foot { flex-wrap: wrap; }
  .stat b { font-size: 1.25rem; }
  .flash-actions .btn { min-width: 0; flex: 1; }
}

/* ---------- course progress & quick links ---------- */
.course-progress { display: flex; align-items: center; gap: 12px; font-size: .88rem; color: var(--muted); max-width: 420px; }
.course-progress b { color: var(--text); font-variant-numeric: tabular-nums; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.quick-item { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; color: var(--text); }
.quick-item:hover { text-decoration: none; border-color: var(--accent); }
.quick-item span { color: var(--muted); font-size: .86rem; }

/* ---------- trainer extras ---------- */
.aux { display: flex; align-items: center; gap: 14px; }
.link[disabled] { color: var(--muted); cursor: not-allowed; text-decoration: none; }
.icon-btn.slow { width: auto; padding: 0 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.answer-line > span { margin-right: 2px; }
.explain { margin-top: 12px; padding-top: 12px; border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent); display: grid; gap: 8px; }
.ex-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: .94rem; }
.ex-label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; padding-top: 2px; }
.feedback .explain details { margin-top: 0; }
.listen-box { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0 22px; }
.play-big {
  width: 76px; height: 76px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 2rem; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .1s;
}
.play-big:active { transform: scale(.95); }
.play-big .ico { margin-left: 4px; }

/* ---------- confetti ---------- */
.confetti { position: fixed; left: 0; right: 0; top: 45%; height: 0; pointer-events: none; z-index: 70; }
.confetti i {
  position: absolute; width: 8px; height: 12px; border-radius: 2px; opacity: 0;
  animation: pop 1.2s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes pop {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  60% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 260px)) rotate(var(--r)); }
}

/* ---------- chips row, listening, my topics ---------- */
.chips.left { justify-content: flex-start; margin: 4px 0 8px; }
a.chip { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.chip.off { color: var(--muted); cursor: default; opacity: .7; display: inline-flex; align-items: center; gap: 4px; }
.topic .num .ico { font-size: 1.1rem; }
.topic .num.tag { color: #fff; border-radius: 10px; font-size: .78rem; }
.add-form { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; margin: 18px 0; }
.add-form input, .modal .answer {
  font: inherit; font-size: .95rem; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); outline: none; width: 100%;
}
.add-form input:focus, .modal .answer:focus { border-color: var(--accent); }
.mine-items { padding-left: 22px; margin: 0 0 18px; display: grid; gap: 8px; }
.mine-items li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.mine-items li > div { display: inline-flex; flex-direction: column; margin-right: 10px; }
.mine-items span { color: var(--muted); font-size: .92rem; }
.center .link { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 820px) {
  .quick { grid-template-columns: 1fr; }
  .add-form { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .ex-row { grid-template-columns: 1fr; gap: 2px; }
  .aux { gap: 10px; }
}
.tag-sit { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--warn); background: var(--warn-soft); border-radius: 6px; padding: 0 6px; margin-right: 2px; }
.voice-card { margin-bottom: 16px; }
.voice-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.voice-row select {
  flex: 1; min-width: 220px; font: inherit; font-size: .95rem; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}

/* ---------- speaking: toolbar, mic, timer ---------- */
.train-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 12px; }
.mic-box { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.mic {
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.6rem; flex: none;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .1s;
}
.mic:active { transform: scale(.95); }
.mic.on { background: var(--bad); animation: pulse 1.1s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 55%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }
.live { color: var(--muted); font-size: 1rem; min-height: 1.4em; }
.timer { position: relative; height: 22px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 14px; }
.timer i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 45%, transparent); transition: width .1s linear; }
.timer i.low { background: color-mix(in srgb, var(--bad) 55%, transparent); }
.timer span { position: relative; display: block; text-align: center; font-size: .78rem; font-weight: 700; line-height: 22px; font-variant-numeric: tabular-nums; }

/* ---------- dialogues ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.bubble { display: flex; align-items: flex-end; gap: 8px; max-width: 82%; }
.bubble p { margin: 0; }
.bubble > div, .bubble.you { padding: 10px 14px; border-radius: 16px; }
.bubble.them > div { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.them small, .bubble.you small { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.bubble.you { align-self: flex-end; flex-direction: column; align-items: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.bubble.you.skipped { background: var(--surface-2); color: var(--text); border: 1px dashed var(--line); }
.your-turn .ru { font-size: 1.15rem; }
.routine { padding: 18px 22px; margin: 8px 0 4px; }
.routine ol { margin: 10px 0; padding-left: 20px; display: grid; gap: 6px; }
.level-sub { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; }
.quick-item.talk { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* ---------- shadowing ---------- */
.shadow-text { font-size: 1.5rem; font-weight: 600; line-height: 1.4; margin: 8px 0 4px; }
.shadow-text .w.ok { color: var(--accent); }
.shadow-text .w.miss { color: var(--bad); text-decoration: underline wavy color-mix(in srgb, var(--bad) 60%, transparent); }

@media (min-width: 821px) { .quick { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) {
  .bubble { max-width: 94%; }
  .shadow-text { font-size: 1.25rem; }
  .mic { width: 52px; height: 52px; }
}

/* ---------- my words (Notion) ---------- */
.words { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: .95rem; }
.words td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: normal; }
.words td:first-child { width: 45%; }
.words small { display: block; color: var(--muted); font-size: .84rem; margin-top: 2px; }
.icon-btn.sm { width: 26px; height: 26px; font-size: .8rem; margin-left: 4px; }
.level.deck .badge { font-size: 1.5rem; }
.level.deck:hover { text-decoration: none; }
.quick { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important; }

/* inline mic inside the answer field */
.input-wrap { position: relative; }
.input-wrap.has-mic .answer { padding-right: 64px; }
.mic.inline {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; font-size: 1.2rem; box-shadow: none;
}
.mic.inline:active { transform: translateY(-50%) scale(.95); }

/* fireworks overlay for 90%+ */
.fireworks { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 80; cursor: pointer; }
.great { color: var(--warn); font-weight: 700; margin: -4px 0 6px; }
.focus { margin: -10px 0 16px; color: var(--muted); font-size: .95rem; }
.focus b { color: var(--accent); font-weight: 600; }

/* tomatoes for results below 50% */
.tomatoes { position: fixed; inset: 0; z-index: 80; cursor: pointer; overflow: hidden; transition: opacity .8s; }
.tomatoes.fade { opacity: 0; }
.tomato {
  position: absolute; width: 90px; height: 90px; opacity: 0; transform: translate(-50%, -50%);
  animation: tomato-fly .55s cubic-bezier(.35, .1, .7, 1) forwards;
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .35));
}
.tomato svg, .splash svg { width: 100%; height: 100%; display: block; overflow: visible; }
@keyframes tomato-fly {
  0% { opacity: 1; transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) rotate(0) scale(.35); }
  92% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--rot)) scale(1.35); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--rot)) scale(1.6); }
}
.splash {
  position: absolute; width: 190px; height: 316px; margin: -95px 0 0 -95px; opacity: 0;
  transform: rotate(var(--r)) scale(0); transform-origin: 95px 95px;
  animation: splash .3s cubic-bezier(.2, 1.6, .4, 1) forwards;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3));
}
@keyframes splash {
  0% { opacity: 1; transform: rotate(var(--r)) scale(calc(var(--s) * .3)); }
  100% { opacity: .96; transform: rotate(var(--r)) scale(var(--s)); }
}
.splash .drip { transform-box: fill-box; transform-origin: top; transform: scaleY(0); animation: drip 2.4s ease-in forwards; }
@keyframes drip { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.tomato-msg {
  position: absolute; left: 50%; bottom: 10vh; transform: translateX(-50%); max-width: calc(100vw - 32px);
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 18px; font-weight: 600; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  animation: fade .3s 1.6s both;
}
@media (prefers-reduced-motion: reduce) { .tomato { display: none; } .splash { animation-duration: .01s; animation-delay: 0s !important; } .splash .drip { animation: none; transform: none; } }

/* bananas for results between 50% and the pass mark */
.bananas { position: fixed; inset: 0; z-index: 80; cursor: pointer; overflow: hidden; transition: opacity .8s; }
.bananas.fade { opacity: 0; }
.banana {
  position: absolute; width: 120px; height: 80px; opacity: 0; transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 6px rgba(0, 0, 0, .35));
  animation: banana-fly .55s cubic-bezier(.35, .1, .7, 1) forwards, banana-smack .25s ease-out forwards, banana-slide 2.6s ease-in forwards;
}
.banana svg, .splotch svg { width: 100%; height: 100%; display: block; overflow: visible; }
@keyframes banana-fly {
  0% { opacity: 1; transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) rotate(0) scale(.4); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--rot)) scale(1.3); }
}
@keyframes banana-smack {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--end)) scale(1.4, 1.1); }
  50% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--end)) scale(1.55, .75); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--end)) scale(1.35, .9); }
}
@keyframes banana-slide {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--end)) scale(1.35, .9); }
  100% { opacity: 1; transform: translate(-50%, calc(-50% + 70vh)) rotate(calc(var(--end) + 25deg)) scale(1.35, .9); }
}
.splotch {
  position: absolute; width: 170px; height: 140px; margin: -70px 0 0 -85px; opacity: 0; transform: scale(0);
  animation: splash .3s cubic-bezier(.2, 1.6, .4, 1) forwards;
}
.splotch { --r: 0deg; --s: 1; }
@media (prefers-reduced-motion: reduce) { .banana { animation: none; opacity: 1; } .splotch { animation-duration: .01s; } }

/* ---------- header goal pill ---------- */
.goal-pill { margin-left: auto; margin-right: 8px; font-size: .85rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.goal-pill:hover { text-decoration: none; color: var(--text); }
.goal-pill.done { background: var(--accent-soft); color: var(--accent); }

/* ---------- today plan + goal ---------- */
.today { padding: 18px 20px; margin: 0 0 12px; border-left: 4px solid var(--accent); }
.today-head small { color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: .78rem; font-weight: 700; }
.today-head h2 { margin: 2px 0 14px; font-size: 1.6rem; }
.today { padding: 24px; }
.today-go { font-size: 1.15rem; padding: 14px 28px; border-radius: 14px; box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent); }
.today-next { color: var(--muted); margin: 10px 0 18px; font-size: .92rem; }
.steps.compact li, .steps.compact li.done { padding: 7px 10px; }
.steps.compact .st { width: 28px; height: 28px; font-size: .9rem; }
.steps.compact b { font-size: .92rem; font-weight: 600; }
.steps.compact small { font-size: .8rem; }
.steps li.next { box-shadow: inset 0 0 0 1px var(--accent); }
@media (max-width: 560px) { .today-go { display: block; text-align: center; } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.steps li.done { opacity: .7; padding: 10px 12px; text-align: left; max-width: none; margin: 0; }
.steps .st { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); flex: none; font-size: 1.05rem; color: var(--accent); }
.steps li > div { flex: 1; min-width: 0; }
.steps b { display: block; }
.steps small { color: var(--muted); font-size: .85rem; }
.goal { padding: 14px 18px; margin-bottom: 12px; }
.goal-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.goal-top span { color: var(--muted); font-variant-numeric: tabular-nums; }
.goal .chips { margin-top: 10px; align-items: center; }
.goal .small-note { margin: 0 0 0 6px; }
.hist { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 6px; }
.hcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.hcol i { width: 100%; max-width: 26px; min-height: 2px; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--accent) 35%, var(--surface-2)); }
.hcol i.hit { background: var(--accent); }
.hcol span { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- mistakes ---------- */
.types { display: grid; gap: 10px; }
.type-row { display: grid; grid-template-columns: minmax(140px, 260px) 1fr 32px; gap: 12px; align-items: center; font-size: .92rem; }
.type-row b { text-align: right; font-variant-numeric: tabular-nums; }
.type-row .bar i { background: var(--bad); }
.mistakes { list-style: none; padding: 6px 0; margin: 0; }
.mistakes li { padding: 12px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 3px; }
.mistakes li:last-child { border-bottom: 0; }
.mk-ru { font-weight: 600; }
.mk-en { display: flex; align-items: center; gap: 6px; }
.mk-you { color: var(--bad); font-size: .92rem; }
.mk-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .82rem; }
.tag { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 1px 7px; font-weight: 600; font-size: .78rem; }

/* ---------- voice recording ---------- */
.rec-row { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 14px; }
.btn.recording { background: var(--bad); border-color: var(--bad); color: #fff; animation: pulse 1.1s infinite; }
.btn[disabled] { opacity: .45; cursor: default; }

/* ---------- stories & quizzes ---------- */
.story { list-style: none; padding: 8px 4px; margin: 14px 0 18px; }
.sent { display: flex; gap: 10px; align-items: flex-start; padding: 8px 14px; border-radius: 10px; transition: background .2s; }
.sent.playing { background: var(--accent-soft); }
.sent .en { cursor: pointer; font-size: 1.05rem; line-height: 1.5; }
.sent .en:hover { text-decoration: underline dotted; }
.sent .ru { display: block; color: var(--muted); font-size: .92rem; margin-top: 2px; }
.options { display: grid; gap: 8px; margin-top: 6px; }
.options.two { grid-template-columns: 1fr 1fr; }
.opt { text-align: left; font: inherit; padding: 12px 16px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.opt:hover:not([disabled]) { border-color: var(--accent); }
.opt.big { text-align: center; font-size: 1.4rem; font-weight: 700; padding: 18px; }
.opt.right { border-color: var(--accent); background: var(--accent-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt[disabled] { cursor: default; }
.pairs td { white-space: normal; vertical-align: middle; }
.pairs td:first-child, .pairs td:nth-child(2) { width: 1%; white-space: nowrap; }

/* ---------- AI partner ---------- */
.ai-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 12px; }
.ai-controls select, .ai-controls .answer { font: inherit; font-size: .95rem; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); width: auto; }
.ai-controls .answer { flex: 1; min-width: 200px; }
.ai-chat { max-height: 58vh; overflow-y: auto; padding: 4px 2px; }
.ai-fix { align-self: flex-end; max-width: 82%; background: var(--warn-soft); border-radius: 12px; padding: 8px 12px; font-size: .9rem; display: grid; gap: 6px; }
.corr s { color: var(--bad); }
.corr b { color: var(--accent); }
.corr small { display: block; color: var(--muted); }
.better i { color: var(--text); }
.tip-ru { color: var(--muted); }
.ai-ok { align-self: flex-end; font-size: .82rem; color: var(--accent); margin-top: -4px; }
.typing p { letter-spacing: 3px; animation: fade 1s infinite alternate; }
.ai-form { display: flex; gap: 8px; }
.ai-form .answer { flex: 1; }
.ai-setup ol { padding-left: 20px; display: grid; gap: 6px; }
.ai-intro { padding: 24px; }
@media (max-width: 560px) {
  .type-row { grid-template-columns: 1fr 1fr 28px; }
  .goal-pill { display: none; }
  .ai-fix { max-width: 94%; }
}

/* AI conversation history */
.ai-history { margin-top: 14px; }
.ai-history summary { cursor: pointer; font-weight: 600; }
.ai-history ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.ai-history li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.ai-history li.current { outline: 2px solid var(--accent); }
.ai-history li .link:first-child { text-align: left; color: var(--text); font-weight: 600; }
.ai-history li small { grid-column: 1; }
.ai-history li .danger { grid-row: 1 / span 2; grid-column: 2; align-self: center; }

/* AI conversation history */
.ai-history { margin-top: 14px; }
.ai-history summary { cursor: pointer; font-weight: 600; }
.ai-history ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.ai-history li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.ai-history li.current { outline: 2px solid var(--accent); }
.ai-history li .link:first-child { text-align: left; color: var(--text); font-weight: 600; }
.ai-history li small { grid-column: 1; }
.ai-history li .danger { grid-row: 1 / span 2; grid-column: 2; align-self: center; }

/* RU / EN switch */
.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface-2); cursor: pointer; margin-right: 8px; font: inherit; }
.lang-toggle span { padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.lang-toggle span.on { background: var(--accent); color: var(--accent-ink); }

/* ---------- 60-day challenge ---------- */
.ch-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px; margin-bottom: 8px; flex-wrap: wrap; }
.ch-hero > div { flex: 1; min-width: 260px; }
.ch-hero small, .ch-head small { color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: .78rem; font-weight: 700; }
.ch-hero h1 { margin: 4px 0 8px; }
.ch-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.ch-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--text); min-height: 66px; }
.ch-tile:hover { text-decoration: none; border-color: var(--accent); }
.ch-tile.locked { opacity: .5; cursor: not-allowed; }
.ch-tile.locked:hover { border-color: var(--line); }
.ch-tile.cur { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.ch-num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); font-weight: 700; color: var(--muted); }
.ch-tile.done .ch-num { background: var(--accent-soft); color: var(--accent); }
.ch-tile.cur .ch-num { background: var(--accent); color: var(--accent-ink); }
.ch-tile-body { min-width: 0; display: flex; flex-direction: column; }
.ch-tile-body small { color: var(--muted); font-size: .75rem; }
.ch-tile-body b { font-size: .9rem; font-weight: 600; line-height: 1.25; }
.ch-tile-body em { font-style: normal; color: var(--accent); font-size: .75rem; font-weight: 700; }
.ch-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ch-head h1 { margin: 2px 0 0; }
.ch-nav { display: flex; gap: 6px; }
.ch-goal { padding: 16px 20px; margin-bottom: 14px; border-left: 4px solid var(--accent); }
.ch-goal h4, .ch-skill h4 { margin: 12px 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ch-goal h4 { margin-top: 0; }
.ch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.ch-skill { padding: 18px 20px; }
.ch-skill h3 { margin: 0 0 6px; }
.ch-skill h3 small { color: var(--muted); font-weight: 500; font-size: .75em; margin-left: 4px; }
.ch-text p { margin: 6px 0; }
.ch-text ul { margin: 4px 0 8px; padding-left: 20px; }
.ch-text li { margin: 2px 0; }
.ch-guide { margin-top: 10px; color: var(--muted); font-size: .92rem; }
.ch-guide summary { cursor: pointer; font-weight: 600; font-size: .85rem; }
.ch-guide p { margin: 6px 0; }
.ch-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ch-write { width: 100%; min-height: 160px; margin-top: 12px; resize: vertical; font: inherit; font-size: 1rem; line-height: 1.5; }
.ch-write-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.ch-fb { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.ch-fb-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.ch-fb p { margin: 6px 0; }
.ch-tips { margin: 8px 0; padding-left: 20px; }
.ch-improved { margin: 8px 0; color: var(--text); line-height: 1.6; }
.ch-extra { padding: 14px 20px; margin-top: 14px; }
.ch-extra summary { cursor: pointer; font-weight: 600; }
.ch-checklist { padding: 18px 20px; margin-top: 14px; }
.ch-checklist h3 { margin: 0 0 10px; }
.ch-checklist h3 small { color: var(--muted); font-weight: 500; }
.ch-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.ch-item:hover { background: var(--surface-2); }
.ch-item input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.ch-item.on span { color: var(--muted); text-decoration: line-through; }
.ch-row { border-bottom: 1px solid var(--line, rgba(127,127,127,.15)); padding: 2px 0 8px; }
.ch-row:last-of-type { border-bottom: 0; }
.ch-how { margin: 0 10px 0 38px; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.ch-how b { color: var(--text); }
.ch-how .ch-guide, .ch-how .ch-note { flex-basis: 100%; }
.ch-how .ch-note { min-height: 70px; font-size: 15px; }
.ch-levels { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 10px; }
.ch-levels .chip { padding: 4px 12px; }
.ch-act { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 10px; }
.ch-act .nb-quick { margin: 0; }
.ch-say { display: flex; gap: 14px; align-items: center; margin: 12px 0 6px; }
.ch-say .mic { flex: none; }
.ch-say-body { flex: 1; min-width: 0; }
.ch-say-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.ch-say-top b { font-size: 20px; font-variant-numeric: tabular-nums; }
.ch-say .bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ch-say .bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s; }
.ch-say .live { margin-top: 8px; min-height: 1.4em; font-size: 14px; color: var(--muted); }
.ch-said { font-size: 14px; line-height: 1.5; }
.ch-vocab { margin-top: 14px; }
.vw-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin: 10px 0; }
.vw { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.vw-ru { flex-basis: 100%; font-weight: 600; }
.vw-in { flex: 1; min-width: 0; padding: 6px 10px; font-size: 15px; }
.vw.ok { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.vw.ok b { color: var(--accent); }
.vw.ok small { flex-basis: 100%; color: var(--muted); }
.ch-tip { color: var(--muted); margin: 12px 0; font-size: .92rem; }
.ch-done { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-weight: 600; }
@media (max-width: 820px) { .ch-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .ch-days { grid-template-columns: 1fr 1fr; } .ch-hero .today-go { width: 100%; } }
.ch-videos { display: grid; gap: 12px; margin: 6px 0 4px; }
.ch-video { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 12px; align-items: center; }
.ch-video:has(.ch-frame) { grid-template-columns: 1fr; }
.ch-thumb { position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: #000; aspect-ratio: 16 / 9; }
.ch-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .15s; }
.ch-thumb:hover img { opacity: .8; }
.ch-play { position: absolute; inset: 0; margin: auto; width: 44px; height: 32px; border-radius: 9px; background: #e33; color: #fff; display: grid; place-items: center; font-size: .9rem; }
.ch-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.ch-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ch-vt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ch-vt b { font-size: .92rem; font-weight: 600; line-height: 1.3; }
.ch-vt a { font-size: .82rem; }
.ch-read { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin: 6px 0; line-height: 1.6; }
.ch-read-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.ch-read p { margin: 6px 0; }
.ch-read .icon-btn { vertical-align: middle; opacity: .6; }
.ch-read p:hover .icon-btn { opacity: 1; }
.ch-line b { color: var(--accent); }
@media (max-width: 560px) { .ch-video { grid-template-columns: 120px minmax(0, 1fr); } }
.continue.ch-home { border-left-color: #f0883e; }

/* =========================================================
   Design refresh (v2): new type, deeper palette, soft depth.
   Overrides the base styles above; layout and markup unchanged.
   ========================================================= */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --text: #0f172a;
  --muted: #64708a;
  --line: #e3e8f1;
  --accent: #10b981;
  --accent-2: #6366f1;
  --accent-ink: #ffffff;
  --accent-soft: #e2f7ef;
  --grad: linear-gradient(135deg, #10b981 0%, #14b8a6 45%, #6366f1 100%);
  --glow-1: rgba(16, 185, 129, .16);
  --glow-2: rgba(99, 102, 241, .14);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -8px rgba(15, 23, 42, .10);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, .04), 0 18px 40px -12px rgba(15, 23, 42, .18);
  --radius: 20px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-head: "Manrope", "Inter", -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17;
    --surface: #131926;
    --surface-2: #1b2232;
    --text: #e7ecf5;
    --muted: #8b95ab;
    --line: #232c3d;
    --accent: #34d399;
    --accent-2: #818cf8;
    --accent-ink: #052016;
    --accent-soft: rgba(52, 211, 153, .12);
    --grad: linear-gradient(135deg, #34d399 0%, #2dd4bf 45%, #818cf8 100%);
    --glow-1: rgba(52, 211, 153, .10);
    --glow-2: rgba(129, 140, 248, .12);
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 48px -16px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
    --bg: #0b0f17;
    --surface: #131926;
    --surface-2: #1b2232;
    --text: #e7ecf5;
    --muted: #8b95ab;
    --line: #232c3d;
    --accent: #34d399;
    --accent-2: #818cf8;
    --accent-ink: #052016;
    --accent-soft: rgba(52, 211, 153, .12);
    --grad: linear-gradient(135deg, #34d399 0%, #2dd4bf 45%, #818cf8 100%);
    --glow-1: rgba(52, 211, 153, .10);
    --glow-2: rgba(129, 140, 248, .12);
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 48px -16px rgba(0, 0, 0, .7);
  }

body {
  font-family: var(--font);
  font-size: 16px;
  letter-spacing: -.005em;
  background:
    radial-gradient(900px 500px at 10% -10%, var(--glow-1), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, var(--glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
h1, h2, h3, .logo, .today-head h2, .stat b, .badge { font-family: var(--font-head); letter-spacing: -.02em; }
h1 { font-size: 2.1rem; font-weight: 800; }
h2 { font-weight: 800; }
h3 { font-weight: 700; }
main { padding-top: 32px; }

/* header */
.top {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.logo { font-weight: 700; }
.logo-mark { background: var(--grad); color: #fff; border-radius: 11px; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.logo b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top nav { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.nav-link, .nav-btn { font-weight: 600; color: var(--muted); }
.nav-link.active, .nav-group.active .nav-btn { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.nav-group.active .nav-btn { box-shadow: var(--shadow); }
.nav-menu::before { border-radius: 18px; box-shadow: var(--shadow-lg); }
.nav-menu a { border-radius: 12px; }
.nav-ico { width: 2.1rem; height: 2.1rem; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 1.05rem; line-height: 1; }
.lang-toggle { background: var(--surface-2); border-color: var(--line); }
.lang-toggle span.on { background: var(--grad); color: #fff; }
.goal-pill { background: var(--surface-2); border: 1px solid var(--line); }

/* cards and controls */
.card { border-color: var(--line); box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
a.card:hover, .topic:hover, .level:hover, .ch-tile:not(.locked):hover, .quick-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); text-decoration: none; }
.btn {
  border-radius: 12px; font-weight: 600; border-color: var(--line); background: var(--surface);
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, filter .18s ease;
}
.btn:hover { background: var(--surface-2); }
.btn.primary {
  background: var(--grad); border: 0; color: #fff;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn.primary:hover { filter: brightness(1.07) saturate(1.05); box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--accent) 85%, transparent); }
.btn.ghost { border-color: var(--line); }
.chip { border-color: var(--line); background: var(--surface); font-weight: 600; transition: all .15s ease; }
.chip.on { background: var(--grad); border-color: transparent; color: #fff; }
.answer { border-radius: 14px; background: var(--surface); border-color: var(--line); transition: border-color .15s, box-shadow .15s; }
.answer:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.bar { background: var(--surface-2); height: 10px; }
.bar i { background: var(--lv, var(--grad)); }
.pill { border-radius: 999px; font-weight: 600; }
.icon-btn { border-radius: 10px; }
.crumbs { font-weight: 500; }
.notice { border-radius: 14px; }
.section-title { font-size: 1.25rem; }

/* stats */
.stat { border-radius: 16px; border-color: var(--line); box-shadow: var(--shadow); }
.stat b { font-weight: 800; font-size: 1.7rem; }
.stat.good b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* home: today's session as a hero card */
.today {
  position: relative; overflow: hidden; border: 0; padding: 28px;
  background:
    radial-gradient(600px 220px at 100% 0%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%),
    radial-gradient(500px 200px at 0% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-lg);
  border-left: 0 !important;
}
.today::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; pointer-events: none; }
.today-head small { color: var(--accent); letter-spacing: .08em; }
.today-head h2 { font-size: 1.9rem; margin: 6px 0 18px; }
.today-go { border-radius: 16px; padding: 16px 30px; font-size: 1.1rem; }
.steps li { background: color-mix(in srgb, var(--surface-2) 75%, transparent); border-radius: 14px; }
.steps .st { background: var(--surface); box-shadow: var(--shadow); }
.steps li.next { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }

.continue { border-left: 0; padding: 18px 22px; position: relative; }
.continue::before { content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.continue.ch-home::before { background: linear-gradient(180deg, #f59e0b, #f43f5e); }
.continue small { font-weight: 700; letter-spacing: .07em; }
.continue b { font-family: var(--font-head); font-size: 1.15rem; margin: 2px 0; }
.goal { padding: 18px 22px; }

/* levels, topics, challenge tiles */
.level { border-radius: var(--radius); }
.level .badge { border-radius: 14px; }
.topic { border-radius: 16px; }
.topic .num { border-radius: 12px; }
.ch-hero { position: relative; overflow: hidden; background: radial-gradient(600px 240px at 100% 0%, rgba(245, 158, 11, .18), transparent 70%), var(--surface); box-shadow: var(--shadow-lg); }
.ch-tile { border-radius: 16px; }
.ch-tile.cur { border-color: transparent; box-shadow: 0 0 0 2px var(--accent), var(--shadow-lg); }
.ch-tile.cur .ch-num { background: var(--grad); color: #fff; }
.ch-num { border-radius: 12px; }
.ch-skill, .ch-goal, .ch-checklist, .ch-extra { border-radius: var(--radius); }
.ch-goal { border-left: 0; background: radial-gradient(500px 200px at 100% 0%, var(--glow-2), transparent 70%), var(--surface); }
.ch-read, .ch-fb { border-radius: 16px; }
.ch-thumb, .ch-frame { border-radius: 14px; }
.ch-play { background: #ff0033; border-radius: 10px; box-shadow: 0 6px 14px -4px rgba(0, 0, 0, .5); }

.foot { opacity: .8; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
@media (max-width: 560px) {
  h1 { font-size: 1.65rem; }
  .today { padding: 22px 18px; }
  .today-head h2 { font-size: 1.5rem; }
  .top nav { border-radius: 16px; }
}
@media (max-width: 560px) {
  .top nav { width: 100%; gap: 0; padding: 3px; }
  .top nav > * { flex: 1 1 auto; }
  .nav-link, .nav-btn { width: 100%; justify-content: center; padding: 8px 6px; font-size: .82rem; }
  .nav-caret { display: none; }
}
@media (max-width: 380px) { .nav-link, .nav-btn { font-size: .76rem; padding: 8px 4px; } }

/* word lookup popup */
.word-pop { position: absolute; z-index: 50; padding: 14px 16px; box-shadow: var(--shadow-lg); border-radius: 16px; font-size: .95rem; }
.word-pop[hidden] { display: none; }
.wp-head { display: flex; align-items: center; gap: 8px; }
.wp-word { font-family: var(--font-head); font-size: 1.15rem; }
.wp-ru { font-weight: 600; margin: 4px 0 6px; }
.wp-note { color: var(--muted); font-size: .88rem; margin: 0 0 8px; }
.wp-ex { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; font-size: .9rem; }
.wp-ex small { display: block; color: var(--muted); }
.wp-err { margin: 0; color: var(--bad); }
.ch-read, .story .en, .bubble.them p { cursor: text; }

.theme-toggle { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; width: 34px; height: 30px; cursor: pointer; margin-right: 8px; font-size: .95rem; display: inline-grid; place-items: center; padding: 0; }
.theme-toggle:hover { border-color: var(--accent); }
.hist-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.hist-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.hist-table td { padding: 8px; border-bottom: 1px solid var(--line); }
.hist-table tr:last-child td { border-bottom: 0; }
#history-box { overflow-x: auto; }
.dlg-sum { margin: 10px 0 14px; } .dlg-sum .stat span { font-size: .8rem; }
.chat .ai-fix, .chat .ai-ok { align-self: flex-end; max-width: 80%; }
.from-notion { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, #6b6bd6 14%, transparent); color: #5b5bc6; font-size: .8rem; font-weight: 600; }
.from-notion.fresh { background: color-mix(in srgb, #14a37f 14%, transparent); color: #0f8a6b; }

/* my notebook */
.nb-add { display: flex; gap: 10px; align-items: flex-end; padding: 14px; margin: 6px 0 14px; }
.nb-add textarea { flex: 1; resize: vertical; font: inherit; }
.nb-list { list-style: none; margin: 14px 0 0; padding: 4px 14px; }
.nb-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.nb-row:last-child { border-bottom: 0; }
.nb-main { min-width: 0; } .nb-main small { display: block; }
.nb-side { display: flex; align-items: flex-start; gap: 6px; flex: none; }
.nb-manual { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .nb-manual .answer { width: 180px; padding: 6px 10px; font-size: .9rem; }
.nb-quick { margin-top: 10px; }
.modal textarea { width: 100%; font: inherit; margin-top: 6px; }
.word-pop .wp-phrase { font-weight: 600; line-height: 1.4; }
.word-pop .wp-parts { margin: 6px 0 10px; padding-left: 18px; font-size: 14px; }
.word-pop .wp-parts li { margin: 2px 0; }
mark.pv { background: color-mix(in srgb, #d9822b 18%, transparent); color: inherit; border-bottom: 2px solid #d9822b; border-radius: 3px; padding: 0 2px; cursor: pointer; }
.pv-particles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pv-p { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.pv-p b { font-size: 1.15rem; color: #d9822b; }
.pv-p em { font-style: normal; font-size: 14px; }
.pv-groups { padding: 14px 18px; }
.pv-groups p { margin: 6px 0; line-height: 1.5; }
.pv-groups b { color: #d9822b; margin-right: 6px; }
.pv-table td small { display: block; }
.srs-line { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.feedback.intro { background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 14px; padding: 16px 18px; margin-top: 14px; }
.feedback.intro .fb-title { color: var(--accent); font-weight: 700; }
.mix-stage { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; margin-bottom: 10px; background: var(--surface-2); color: var(--muted); }
.mix-stage.new { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.mix-stage.mistake, .mix-stage.again { background: color-mix(in srgb, #d64545 12%, transparent); color: #c24141; }
.feedback.intro { margin: 14px 0 12px; }
.strict-note { margin: 6px 0 0; font-size: 15px; }
.strict-note b { color: #1f8a5b; }
.strict-note s { color: #c24141; }
.vw-hint { flex-basis: 100%; font-size: 14px; color: var(--accent); font-weight: 600; letter-spacing: .02em; }
.dlg-alts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.dlg-alts .chip { font-weight: 500; }
.home-course { padding: 18px 20px; margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.hc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hc-head small { display: block; color: var(--muted); font-size: 13px; }
.hc-head b { font-size: 1.1rem; }
.home-course .bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.home-course .bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.hc-levels { display: flex; flex-wrap: wrap; gap: 8px; }
.hc-lv { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); text-decoration: none; color: var(--text); }
.hc-lv small { color: var(--muted); display: inline-flex; }
.hc-lv.locked { opacity: .6; }
.home-course .hc-next { margin: 0; box-shadow: none; border: 1px solid var(--line); }
@media (max-width: 560px) { .hc-head { flex-direction: column; align-items: flex-start; } }
.word-big { display: flex; align-items: center; gap: 10px; }
.word-ex { margin: 4px 0 12px; font-size: 15px; color: var(--muted); }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 10px 0 12px; }
.opts .opt { text-align: left; font: inherit; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.opts .opt:hover:not([disabled]) { border-color: var(--accent); }
.opts .opt.good { border-color: #2f9e6a; background: color-mix(in srgb, #2f9e6a 14%, transparent); }
.opts .opt.bad { border-color: #d64545; background: color-mix(in srgb, #d64545 12%, transparent); }
.opts .opt[disabled] { cursor: default; }
.load-set { margin-top: 10px; }
.load-set summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.load-set .chips { margin-top: 8px; }
.twisters { padding: 6px 16px; }
.tw-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tw-row:last-child { border-bottom: 0; }
.tw-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tw-res { color: #c24141; }
.tw-res.ok { color: #1f8a5b; }
.mic.small { width: 40px; height: 40px; font-size: 18px; }
.breathe-box { padding: 12px 16px; margin-bottom: 12px; }
.breathe-box summary { cursor: pointer; font-weight: 600; }
.breath { display: flex; align-items: center; gap: 16px; margin: 10px 0; min-height: 90px; }
.breath-dot { width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 35%, transparent); transition: transform 4s linear; flex: none; margin: 0 24px; }
.breath-dot.in, .breath-dot.hold { transform: scale(2); }
.breath-dot.out, .breath-dot.hold2 { transform: scale(1); }
.gap-slot { color: var(--accent); font-weight: 700; }
.it-q { padding: 16px 20px; margin-top: 14px; }
.it-q ol { padding-left: 20px; }
.it-q li { margin: 4px 0; }
.it-theory { padding: 12px 18px; margin-bottom: 10px; }
.it-theory summary { cursor: pointer; }
.iv-row { display: flex; gap: 10px; align-items: flex-start; }
.iv-row textarea { flex: 1; }
.iv-q { display: flex; gap: 10px; align-items: center; }
.iv-ru { background: var(--surface-2); border-radius: 12px; padding: 12px 16px; margin: 6px 0 12px; }
.iv-ru-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.iv-ru p { margin: 0; line-height: 1.55; }
.iv-ru-btn { margin-bottom: 12px; }
.story-ai { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 18px; margin-bottom: 8px; }
.story-ai .notice { flex-basis: 100%; }
.more-modes { margin-top: 12px; }
.more-modes > summary { cursor: pointer; color: var(--muted, #6b7280); font-weight: 600; font-size: .92rem; padding: 6px 0; list-style: none; }
.more-modes > summary::-webkit-details-marker { display: none; }
.more-modes > summary::before { content: '▸ '; }
.more-modes[open] > summary::before { content: '▾ '; }
.more-modes > .stack { margin-top: 8px; }
.ai-review { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, #6b6bd6 10%, transparent); line-height: 1.45; }
.ai-review.good { background: color-mix(in srgb, #14a37f 14%, transparent); }
.ai-review.good .btn { margin-left: 6px; }
.ai-review.wait { background: none; padding: 4px 0; color: var(--muted, #6b7280); font-size: .92rem; }
.also-say { margin: 8px 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.feedback.checking { background: color-mix(in srgb, #6b6bd6 9%, transparent); }
.feedback.checking .fb-title { color: inherit; display: flex; align-items: center; gap: 8px; }
.answer.checking { opacity: .8; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.theory-step h2 { margin: 10px 0 6px; }
.theory-step .theory-body { margin: 8px 0 16px; }
.theory-step .task-actions { align-items: center; gap: 12px; flex-wrap: wrap; }
.poops .tomato { width: 100px; height: 100px; }
.splash .stink path { fill: none; stroke: #7fa83a; stroke-width: 3; stroke-linecap: round; opacity: 0; animation: stink 1.6s ease-in-out .9s infinite; }
.splash .stink path:nth-child(2) { animation-delay: 1.2s; }
.splash .stink path:nth-child(3) { animation-delay: 1.5s; }
@keyframes stink { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-14px); } }
.fly { position: absolute; font-size: 22px; animation: fade .2s both, buzz 1.1s linear infinite; }
@keyframes buzz {
  0% { transform: rotate(0) translateX(var(--fr)) rotate(0); }
  50% { transform: rotate(180deg) translateX(calc(var(--fr) * .7)) rotate(-160deg); }
  100% { transform: rotate(360deg) translateX(var(--fr)) rotate(-360deg); }
}
@media (prefers-reduced-motion: reduce) { .fly { display: none; } .splash .stink path { animation: none; opacity: .7; } }
