/* Milliy Mock — мягкий «школьный» стиль: тетрадная клетка, пастель, округлый шрифт */
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap");

:root {
  color-scheme: light;  /* всегда светлая «тетрадь», даже при тёмной теме телефона */
  --bg: #f7f5ff; --grid: rgba(108, 99, 255, .07);
  --card: #ffffff; --ink: #2b2a3d; --muted: #7b7a92; --line: #ebe8f7;
  --accent: #6c63ff; --accent-2: #8f7bff; --accent-ink: #fff; --accent-soft: #eeecff;
  --mint: #2fb98f; --mint-soft: #e3f7ef; --peach: #ff9f7a; --peach-soft: #fff0e8;
  --sky: #4aa8f0; --sky-soft: #e6f3fd; --lilac: #a07cf0; --lilac-soft: #f2ecfe;
  --ok: #2fb98f; --ok-bg: #e3f7ef; --bad: #f0657a; --bad-bg: #fdecef;
  --chip: #f1effb; --shadow: 0 6px 20px rgba(84, 72, 180, .08), 0 1px 3px rgba(84, 72, 180, .06);
  --r: 18px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100%; }
body {
  margin: 0; color: var(--ink); background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
  font: 16px/1.6 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button { font: inherit; cursor: pointer; color: inherit; -webkit-tap-highlight-color: transparent; }
button:active { transform: scale(.98); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--bad); }

/* шапка */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 900; font-size: 19px; letter-spacing: -.01em; }
.brand::before { content: "🎓"; margin-right: 6px; }
.brand span { color: var(--accent); }
.timer { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 800; padding: 4px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); }
.timer.low { background: var(--bad-bg); color: var(--bad); }
.langs { margin-left: auto; display: flex; gap: 4px; background: var(--chip); padding: 3px; border-radius: 999px; }
.timer:not(.hidden) + .langs { margin-left: 0; }
.langs button { border: 0; background: none; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 800; color: var(--muted); }
.langs button.on { background: var(--card); color: var(--accent); box-shadow: var(--shadow); }

/* главная */
.view { max-width: 820px; margin: 0 auto; padding: 16px; }
.hero { padding: 22px 20px; margin: 14px 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(23px, 5vw, 34px); line-height: 1.2; margin: 0 0 8px; font-weight: 900; }
#home .h-test h1::before { content: "📝 "; }
#home .h-train h1::before { content: "🎯 "; }
#home .h-train .primary { width: 100%; margin-top: 6px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.facts div { border-radius: 14px; padding: 12px; }
.facts div:nth-child(1) { background: var(--sky-soft); }
.facts div:nth-child(2) { background: var(--peach-soft); }
.facts div:nth-child(3) { background: var(--mint-soft); }
.facts b { display: block; font-size: 26px; font-weight: 900; line-height: 1.1; }
.facts div:nth-child(1) b { color: var(--sky); } .facts div:nth-child(2) b { color: var(--peach); } .facts div:nth-child(3) b { color: var(--mint); }
.facts span { color: var(--muted); font-size: 13px; font-weight: 600; }
.label { font-weight: 800; margin: 18px 0 8px; }
.langpick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick, .primary { border: 0; color: var(--accent-ink); border-radius: 999px; padding: 14px 18px; font-weight: 800; font-size: 17px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 16px rgba(108, 99, 255, .28); }
.pick:disabled { opacity: .6; }
.ghost { margin-top: 12px; width: 100%; border: 2px dashed var(--line); background: var(--card); border-radius: 999px; padding: 12px;
  font-weight: 700; color: var(--accent); }

/* сетка номеров в тесте */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; margin: 4px 0 16px; }
.grid a { display: block; text-align: center; padding: 7px 0; border-radius: 12px; background: var(--card); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.grid a.done { background: var(--mint); color: #fff; }
.grid a.half { box-shadow: 0 0 0 2px var(--mint) inset; }
.grid a.none { opacity: .35; }

/* карточка задачи */
.q { background: var(--card); border-radius: var(--r); padding: 18px; margin-bottom: 14px; scroll-margin-top: 70px; box-shadow: var(--shadow); }
.qhead { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.qnum { flex: none; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center;
  font-weight: 900; background: var(--accent-soft); color: var(--accent); }
.qtopic { color: var(--muted); font-size: 13px; font-weight: 700; }
.stmt { margin: 6px 0 12px; overflow-x: auto; font-size: 16.5px; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; border: 2px solid var(--line); background: var(--card);
  border-radius: 14px; padding: 10px 12px; overflow-x: auto; transition: border-color .15s, background .15s; }
.opt b { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); font-size: 14px; font-weight: 900; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt.on b { background: var(--accent); color: var(--accent-ink); }
.mlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin: 8px 0 14px; }
.mlist div { background: var(--peach-soft); border-radius: 12px; padding: 6px 10px; }
.mrow { margin: 10px 0; }
.mrow p { margin: 0 0 6px; }
.letters { display: flex; gap: 6px; flex-wrap: wrap; }
.letters button { width: 42px; height: 42px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font-weight: 900; }
.letters button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.part { margin: 12px 0; padding: 10px 12px; background: var(--lilac-soft); border-radius: 14px; }
.part p { margin: 0 0 6px; }
.part input { width: 100%; font: inherit; font-weight: 700; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--card); color: var(--ink); }
.part input:focus { outline: none; border-color: var(--accent); }
.finishbar { position: sticky; bottom: 0; padding: 12px 0 16px; display: grid; gap: 8px;
  background: linear-gradient(transparent, var(--bg) 40%); }
.finishbar .primary { width: 100%; }
.finishbar .ghost { margin-top: 0; }
.mathpad { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 6px; justify-content: center; padding: 8px;
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(84, 72, 180, .08); }
.mathpad button { min-width: 44px; height: 42px; border-radius: 12px; border: 0; background: var(--accent-soft); color: var(--accent);
  font-size: 18px; font-weight: 800; }

/* результат */
.score { text-align: center; padding: 28px 16px; border-radius: 24px; box-shadow: var(--shadow);
  background: linear-gradient(160deg, var(--accent-soft), var(--card) 70%); }
.score .big { font-size: 60px; font-weight: 900; line-height: 1; color: var(--accent); }
.score .big small { font-size: 22px; color: var(--muted); font-weight: 700; }
.score .grade { display: inline-block; margin-top: 12px; padding: 5px 16px; border-radius: 999px; font-weight: 900; font-size: 20px; background: var(--chip); }
.score .grade.pass { background: var(--ok-bg); color: var(--ok); }
.score .grade.pass::before { content: "🏅 "; }
.score .grade.fail { background: var(--bad-bg); color: var(--bad); }
.note { font-size: 13px; color: var(--muted); margin-top: 12px; }
h2 { font-size: 18px; font-weight: 900; margin: 24px 0 10px; }
.bars { background: var(--card); border-radius: var(--r); padding: 6px 16px; box-shadow: var(--shadow); }
.bars div { margin: 10px 0; }
.bar { height: 10px; border-radius: 999px; background: var(--chip); overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--mint), var(--sky)); }
.rev { border-radius: 14px; margin: 8px 0; background: var(--card); box-shadow: var(--shadow); }
.rev summary { padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.rev .mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 900; }
.rev.ok .mark { background: var(--ok-bg); color: var(--ok); }
.rev.bad .mark { background: var(--bad-bg); color: var(--bad); }
.rev .body { padding: 0 14px 14px; overflow-x: auto; }
.rev .pts { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* рисунки */
.fig { text-align: center; margin: 12px 0; }
.fig img { max-width: 100%; height: auto; background: #fff; border-radius: 14px; padding: 8px; border: 1px solid var(--line); }

/* тренировка: плитки номеров — цвет по части экзамена */
.topics h2 { margin-top: 10px; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.topic { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px 14px; min-width: 0;
  border-radius: 16px; border: 0; background: var(--card); color: inherit; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.topic::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--sky); }
.topic b { font-size: 15px; font-weight: 900; min-width: 32px; height: 28px; padding: 0 8px; border-radius: 999px;
  display: inline-grid; place-items: center; background: var(--sky-soft); color: var(--sky); }
.topic span { font-size: 13px; font-weight: 700; color: var(--muted); overflow-wrap: anywhere; }
.topic[data-num="33"]::before { background: var(--peach); }
.topic[data-num="33"] b { background: var(--peach-soft); color: var(--peach); }
.topic[data-num="36"]::before, .topic[data-num="37"]::before, .topic[data-num="38"]::before, .topic[data-num="39"]::before,
.topic[data-num="40"]::before, .topic[data-num="41"]::before, .topic[data-num="42"]::before, .topic[data-num="43"]::before,
.topic[data-num="44"]::before, .topic[data-num="45"]::before { background: var(--lilac); }
.topic[data-num="36"] b, .topic[data-num="37"] b, .topic[data-num="38"] b, .topic[data-num="39"] b, .topic[data-num="40"] b,
.topic[data-num="41"] b, .topic[data-num="42"] b, .topic[data-num="43"] b, .topic[data-num="44"] b, .topic[data-num="45"] b {
  background: var(--lilac-soft); color: var(--lilac); }
.verdict { font-weight: 900; font-size: 18px; margin: 14px 0 8px; padding: 10px 14px; border-radius: 14px; }
.verdict.ok { color: var(--ok); background: var(--ok-bg); }
.verdict.bad { color: var(--bad); background: var(--bad-bg); }
#tres p.muted { background: var(--chip); border-radius: 14px; padding: 10px 14px; color: var(--ink); }

/* нижнее меню: Подготовка · Моки · Профиль */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(84, 72, 180, .08); }
.tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px;
  border-radius: 16px; color: var(--muted); font-weight: 800; font-size: 12.5px; transition: background .15s, color .15s; }
.tabbar button i { font-style: normal; font-size: 22px; line-height: 1.1; filter: grayscale(1); opacity: .65; transition: transform .15s; }
.tabbar button.on { color: var(--accent); background: var(--accent-soft); }
.tabbar button.on i { filter: none; opacity: 1; transform: translateY(-1px) scale(1.08); }
body.tabs { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
body.tabs .finishbar { bottom: calc(66px + env(safe-area-inset-bottom)); }
body:not(.tabs) .tabbar { display: none; }

/* шаги урока */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0; }
.stepper button { border: 0; border-radius: 14px; padding: 8px 4px; background: var(--card); box-shadow: var(--shadow); font-weight: 800;
  font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.2; }
.stepper button b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); font-size: 13px; }
.stepper button.done b { background: var(--mint); color: #fff; }
.stepper button.active { color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.stepper button.active b { background: var(--accent); color: #fff; }
.stepper button:disabled { opacity: .45; }
.lockedtask { display: flex; gap: 10px; align-items: center; color: var(--muted); font-weight: 700; background: var(--chip);
  border-radius: 14px; padding: 10px 14px; margin: 8px 0; }
details.passed { background: var(--card); border-radius: 14px; margin: 8px 0; box-shadow: var(--shadow); }
details.passed summary { padding: 10px 14px; cursor: pointer; font-weight: 700; }
details.passed .body { padding: 0 14px 12px; overflow-x: auto; }
.infobox { background: var(--sky-soft); border-radius: 14px; padding: 10px 14px; margin: 10px 0; font-size: 15px; }
.target:disabled { opacity: .4; }
.stepno { color: var(--muted); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }

/* общие карточки подготовки */
.card { background: var(--card); border-radius: var(--r); padding: 16px 18px; margin: 12px 0; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 8px; }
.chip { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--chip); font-weight: 800; font-size: 13px; }
.chip.xp { background: var(--peach-soft); color: var(--peach); }
.chip.fire { background: var(--bad-bg); color: var(--bad); }
.chip.goal { background: var(--accent-soft); color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.linkbtn { border: 0; background: none; color: var(--accent); font-weight: 800; padding: 4px 0; }
.back { border: 0; background: none; color: var(--muted); font-weight: 800; padding: 6px 0; }
.back::before { content: "← "; }

/* выбор цели */
.targets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.target { text-align: left; border: 2px solid var(--line); background: var(--card); border-radius: 16px; padding: 14px; }
.target b { display: block; font-size: 28px; font-weight: 900; color: var(--accent); line-height: 1.1; }
.target span { display: block; font-weight: 800; }
.target small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 4px; }
.target.on { border-color: var(--accent); background: var(--accent-soft); }

/* план */
.plan h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; }
.pitem { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; background: var(--card);
  border-radius: 16px; padding: 12px 14px; margin: 8px 0; box-shadow: var(--shadow); }
.pitem .num { flex: none; min-width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 900;
  background: var(--sky-soft); color: var(--sky); }
.pitem.t-medium .num { background: var(--lilac-soft); color: var(--lilac); }
.pitem.t-hard .num, .pitem.t-open .num { background: var(--peach-soft); color: var(--peach); }
.pitem.mastered .num { background: var(--mint); color: #fff; }
.pitem .info { flex: 1; min-width: 0; }
.pitem .info b { display: block; font-weight: 800; line-height: 1.3; }
.pitem .info small { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.pitem .bar { margin-top: 6px; height: 7px; }
.pitem.next { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.tag { font-size: 11.5px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 4px; }

/* урок */
.theory h3 { font-size: 16px; font-weight: 900; margin: 16px 0 4px; }
.theory p { margin: 6px 0; }
.theory .f { overflow-x: auto; padding: 4px 0; }
.tip { background: var(--peach-soft); border-radius: 14px; padding: 10px 14px; margin: 10px 0; }
.tip::before { content: "⚠️ "; }
.ex { border-left: 4px solid var(--sky); background: var(--sky-soft); border-radius: 0 14px 14px 0; padding: 10px 14px; margin: 10px 0; }
.ex ol { margin: 6px 0; padding-left: 20px; }
.ex .ans { font-weight: 800; color: var(--sky); }
details.fold > summary { cursor: pointer; font-weight: 900; font-size: 18px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
details.fold:not([open]) > summary::after { content: "▸"; }
.lvl { margin: 18px 0 6px; display: flex; align-items: center; gap: 8px; }
.lvl b { font-size: 18px; font-weight: 900; }
.lvl.locked { opacity: .55; }
.lockmsg { color: var(--muted); font-size: 14px; background: var(--chip); border-radius: 14px; padding: 10px 14px; }
.task { background: var(--card); border-radius: 16px; padding: 14px 16px; margin: 10px 0; box-shadow: var(--shadow); }
.task.ok { box-shadow: 0 0 0 2px var(--ok), var(--shadow); }
.task .stmt { margin: 0 0 10px; }
.answerline { display: flex; gap: 8px; }
.answerline input { flex: 1; min-width: 0; font: inherit; font-weight: 700; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--card); color: var(--ink); }
.answerline input:focus { outline: none; border-color: var(--accent); }
.answerline .primary { padding: 10px 16px; font-size: 15px; }
.taskbtns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.soft { border: 0; border-radius: 999px; padding: 7px 14px; font-weight: 800; font-size: 14px; background: var(--chip); color: var(--ink); }
.soft.hint { background: #fff6d6; color: #a07800; }
.hintbox { background: #fff6d6; border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-size: 15px; }
.hintbox::before { content: "💡 "; }
.solbox { background: var(--ok-bg); border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-size: 15px; overflow-x: auto; }
.badmsg { color: var(--bad); font-weight: 800; margin-top: 6px; }

/* профиль */
.phead { display: flex; gap: 14px; align-items: center; }
.avatar { flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 900;
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--sky)); }
.phead h1 { margin: 0; font-size: 22px; font-weight: 900; line-height: 1.2; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { background: var(--card); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.tile b { display: block; font-size: 24px; font-weight: 900; line-height: 1.15; }
.tile span { color: var(--muted); font-size: 13px; font-weight: 700; }
.tlist div { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tlist div:last-child { border-bottom: 0; }
.tlist b { font-size: 18px; font-weight: 900; color: var(--accent); min-width: 48px; }

/* моки */
#home .h-mocks h1::before { content: "🗂 "; }
.mockgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin-top: 12px; }
.mock { border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 8px 4px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; }
.mock b { font-size: 18px; font-weight: 900; }
.mock small { font-size: 11px; color: var(--muted); font-weight: 700; line-height: 1.2; text-align: center; }
.mock.done { border-color: var(--mint); background: var(--mint-soft); }
.mock.done small { color: var(--ok); }
.mock.open { border-color: var(--accent); background: var(--accent-soft); }
.mock.open small { color: var(--accent); }

/* нижнее окно «продолжить?» */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(30, 25, 60, .35); display: flex; align-items: flex-end; justify-content: center; }
.sheetbox { width: 100%; max-width: 560px; background: var(--card); border-radius: 22px 22px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .15); }
.sheetbox h2 { margin-top: 0; }

/* конспект и совет */
.konspekt ol { margin: 6px 0 0; padding-left: 22px; }
.konspekt li { margin: 6px 0; }
.tipnote { background: #fff6d6; border-radius: 12px; padding: 8px 12px; font-size: 14px; margin-bottom: 8px; }
.tipnote .linkbtn { display: block; font-size: 13px; padding-top: 4px; }
.tag.base { background: var(--mint-soft); color: var(--ok); }
.pitem.t-base .num { background: var(--mint-soft); font-size: 20px; }
.targets.one { grid-template-columns: 1fr; }
.topic small { font-size: 12px; }
.topic .bar { width: 100%; height: 6px; margin-top: 4px; }

/* профиль: цель дня, активность, прогноз, достижения, рейтинг */
.goalcard { display: flex; gap: 14px; align-items: center; }
.ring { --p: 0; flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--mint) calc(var(--p) * 1%), var(--chip) 0); }
.ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.tiles { grid-template-columns: repeat(3, 1fr); }
.tile b { font-size: 20px; }
.days, .scorebars { display: flex; gap: 4px; align-items: flex-end; height: 90px; }
.dbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.dbar i { width: 100%; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); min-height: 3px; }
.dbar i.zero { background: var(--chip); }
.dbar span { font-size: 10px; color: var(--muted); font-weight: 700; }
.big2 { font-size: 40px; font-weight: 900; color: var(--accent); line-height: 1.1; }
.big2 small { font-size: 16px; color: var(--muted); }
.achs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ach { text-align: center; border-radius: 14px; padding: 8px 4px; background: var(--chip); opacity: .45; filter: grayscale(1); }
.ach.got { opacity: 1; filter: none; background: var(--peach-soft); }
.ach i { display: block; font-style: normal; font-size: 26px; }
.ach b { display: block; font-size: 12px; line-height: 1.2; }
.ach small { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.2; margin-top: 2px; }
.lbrow { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.lbrow:last-child { border-bottom: 0; }
.lbrow b { width: 24px; text-align: center; font-weight: 900; color: var(--muted); }
.lbrow.me { background: var(--accent-soft); border-radius: 10px; padding: 7px 8px; }

.infobox.warn { background: var(--peach-soft); }
.tabbar button { font-size: 11.5px; padding: 6px 2px; }

/* чат с ИИ-учителем */
#chat { padding-bottom: 150px; }
.chathead { position: sticky; top: 56px; z-index: 5; }
.chattask { background: var(--chip); border-radius: 12px; padding: 8px 12px; font-size: 14px; margin-top: 8px; max-height: 120px; overflow: auto; }
.msgs { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; line-height: 1.5; overflow-x: auto; box-shadow: var(--shadow); }
.msg.user { align-self: flex-end; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; background: var(--card); border-bottom-left-radius: 6px; }
.msg.typing { color: var(--muted); font-style: italic; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.quick button { border: 0; border-radius: 999px; padding: 6px 12px; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px; }
.chatbar { position: fixed; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 25; display: flex; gap: 8px;
  padding: 8px 12px; background: color-mix(in srgb, var(--card) 96%, transparent); border-top: 1px solid var(--line); }
.chatbar textarea { flex: 1; resize: none; font: inherit; border: 2px solid var(--line); border-radius: 16px; padding: 8px 12px; height: 44px;
  max-height: 120px; background: var(--card); color: var(--ink); }
.chatbar textarea:focus { outline: none; border-color: var(--accent); }
.chatbar .primary { padding: 0 16px; font-size: 18px; }
.pick-task { width: 100%; text-align: left; border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 12px; margin: 6px 0; }
.pick-task b { display: block; font-size: 13px; color: var(--muted); }
.pick-task span { font-size: 14px; }
.sheetbox { max-height: 80vh; overflow-y: auto; }
.soft.ai { background: var(--lilac-soft); color: var(--lilac); margin-top: 8px; }
.pitem.t-basics .num { background: var(--mint-soft); color: var(--ok); }

/* поддержка «разобрать попроще» */
.soft.easy { background: var(--mint-soft); color: var(--ok); margin-top: 8px; }
.dots { display: flex; gap: 6px; }
.dots i { flex: 1; height: 7px; border-radius: 999px; background: var(--chip); }
.dots i.done { background: var(--mint); }
.dots i.now { background: var(--accent); }
.card.center { text-align: center; }
.badmsg .soft.easy { font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }

@media (max-width: 380px) { .tiles, .achs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) {
  .tgrid { grid-template-columns: 1fr 1fr; }
  .facts { gap: 6px; } .facts div { padding: 10px; } .facts b { font-size: 22px; }
  .hero { padding: 18px 16px; }
}
