:root {
  --bg: #eef2f8;
  --card: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e6eaf2;
  --accent: #4f7cff;
  --accent-soft: #eaf0ff;
  --green: #12b76a;
  --green-soft: #e8f8f0;
  --amber: #f79009;
  --amber-soft: #fff5e6;
  --red: #f04438;
  --red-soft: #fdecea;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.45;
}

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); }

.wrap { padding: 20px 16px 34px; }
.wrap:has(.nav) { padding-bottom: 96px; }

h1 { font-size: 22px; margin: 0 0 2px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }

.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.top h1 { font-size: 24px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card.soft { background: #f7f9fe; box-shadow: none; border: 1px solid var(--line); }

.big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }

/* стартовый экран */
.start { padding-top: 40px; }
.hero { text-align: center; margin-bottom: 26px; }
.hero h1 { font-size: 30px; }
.logo {
  width: 74px; height: 74px; border-radius: 22px; margin: 0 auto 14px;
  display: grid; place-items: center; font-size: 38px;
  background: linear-gradient(145deg, #4f7cff, #7aa2ff);
  box-shadow: 0 12px 26px rgba(79, 124, 255, .35);
}
.role-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.role {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 16px; box-shadow: var(--shadow); cursor: pointer;
  font: inherit; color: inherit; text-align: left;
  transition: transform .12s ease, border-color .12s ease;
}
.role:active { transform: scale(.985); }
.role-ico { font-size: 28px; width: 44px; height: 44px; display: grid; place-items: center; background: var(--accent-soft); border-radius: 14px; }
.role-txt { display: flex; flex-direction: column; flex: 1; }
.role-txt b { font-size: 17px; }
.role-txt small { color: var(--muted); }
.chev { color: #b6c0d4; font-size: 26px; line-height: 1; }

.label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }
.input {
  flex: 1; width: 100%; font: inherit; color: inherit;
  border: 1px solid var(--line); background: #f8fafd; border-radius: 12px;
  padding: 12px 14px; outline: none;
}
.input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(79, 124, 255, .12); }
.input.num { font-size: 20px; font-weight: 700; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px;
  border: 0; border-radius: 14px; padding: 12px 16px; cursor: pointer;
  background: #f2f5fb; color: var(--ink);
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 18px rgba(79, 124, 255, .28); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-tiny { padding: 7px 12px; font-size: 13px; background: var(--accent-soft); color: var(--accent); }
.btn-wide { display: flex; width: 100%; margin-bottom: 10px; }
.btn-danger { color: var(--red); }
.btn:disabled { opacity: .5; }

.chip-btn { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }

.pill { font-size: 12.5px; color: var(--muted); background: #f2f5fb; border-radius: 999px; padding: 4px 10px; }
.pill.warn { background: var(--amber-soft); color: #b54708; }

/* прогресс-кольцо */
.progress-card { padding: 20px 18px; }
.ring { position: relative; width: 84px; height: 84px; flex: 0 0 auto; }
.ring svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #eef2f8; stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; }
.ring-label b { font-size: 18px; }
.ring-label small { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.progress-info { flex: 1; margin-left: 18px; }
.progress-info .big { font-size: 30px; }

/* призыв к проверке */
.cta { display: flex; align-items: center; gap: 12px; }
.cta-ico { font-size: 30px; width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; background: var(--accent-soft); border-radius: 16px; }
.cta-txt { flex: 1; display: flex; flex-direction: column; }
.cta-txt b { font-size: 16px; }
.cta-txt small { color: var(--muted); font-size: 13px; }
.cta .btn { flex: 0 0 auto; padding: 11px 15px; }
.cards-cta { display: flex; flex-direction: column; }

/* маршрут */
.next-topic { display: flex; gap: 12px; align-items: center; margin: 14px 0; }
.subject-dot {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 14px;
  display: grid; place-items: center; font-size: 20px; color: #fff;
}
.subject-dot.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 15px; }
.next-txt { display: flex; flex-direction: column; gap: 2px; }
.next-txt b { font-size: 16px; line-height: 1.25; }

.stats { display: flex; gap: 10px; margin-bottom: 16px; }
.stat { flex: 1; background: var(--card); border-radius: 16px; padding: 12px 10px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat b { font-size: 20px; }

/* нижняя навигация */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: min(560px, 100%); display: flex; gap: 6px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); z-index: 20;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 11.5px;
  padding: 8px 4px; border-radius: 12px; cursor: pointer;
}
.nav-btn span { font-size: 20px; }
.nav-btn.on { color: var(--accent); background: var(--accent-soft); }

/* списки */
.row-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 13px 14px; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.row-item.tight { border: 0; border-radius: 12px; padding: 10px 10px; background: transparent; }
.row-item.tight:active { background: #f2f5fb; }
.row-item.static { cursor: default; }
.row-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.row-txt b { font-weight: 600; line-height: 1.3; }
.row-txt small { font-size: 12.5px; }

.chip { flex: 0 0 auto; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.chip.ok { background: var(--green-soft); color: var(--green); }
.chip.gap { background: var(--red-soft); color: var(--red); }
.chip.mid { background: var(--amber-soft); color: #b54708; }
.chip.idle { background: #f2f5fb; color: #98a2b3; }

.bar { height: 8px; background: #eef2f8; border-radius: 999px; overflow: hidden; margin: 8px 0; }
.bar.thick { height: 10px; margin: 0 0 12px; }
.bar.mini { height: 6px; margin: 6px 0 0; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s ease; }

/* вопросы */
.q-topic { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.q-text { font-size: 19px; line-height: 1.35; margin: 0 0 16px; }
.opts { display: flex; flex-direction: column; gap: 9px; }
.opts.two { flex-direction: row; }
.opts.two .opt { flex: 1; }
.opt {
  text-align: left; font: inherit; font-size: 15.5px; cursor: pointer;
  background: #f8fafd; border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 15px; color: var(--ink); transition: border-color .12s ease, background .12s ease;
}
.opts.two .opt { text-align: center; font-weight: 600; }
.opt:active { border-color: var(--accent); background: var(--accent-soft); }
.answer-row { display: flex; gap: 10px; }

.fb { border-radius: 14px; padding: 14px; margin-top: 6px; }
.fb b { display: block; margin-bottom: 4px; }
.fb.good { background: var(--green-soft); color: #05603a; }
.fb.bad { background: var(--red-soft); color: #912018; }
.fb p { font-size: 14px; }

/* урок */
.lesson-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.icon-btn {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; font-size: 18px; cursor: pointer; color: var(--ink);
}
.lesson-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lesson-title small { font-size: 12px; }
.lesson-title b { font-size: 16px; line-height: 1.25; }
.dots { display: flex; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #dde3ee; }
.dot.on { background: var(--accent); }
.dot.done { background: var(--accent); opacity: .45; }

.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.badge { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); background: var(--accent-soft); padding: 4px 9px; border-radius: 8px; }
.theory-p { font-size: 15.5px; line-height: 1.5; display: flex; gap: 10px; margin-bottom: 12px; }
.theory-text { flex: 1 1 auto; min-width: 0; }
.num-badge { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 2px; }
.problem { font-weight: 600; background: #f8fafd; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.steps { margin: 0; padding-left: 20px; }
.steps li { font-size: 15px; margin-bottom: 8px; line-height: 1.45; }

/* картинка к абзацу теории: график или схема с подписью */
.theory-fig {
  margin: 2px 0 14px; padding: 10px 10px 8px;
  background: #f7f9ff; border: 1px solid #e4ebfb; border-radius: 14px;
}
.theory-fig svg { display: block; width: 100%; height: auto; }
.theory-fig figcaption { margin-top: 6px; font-size: 12px; line-height: 1.4; color: var(--muted); }

/* родитель */
.stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.scard { background: var(--card); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.scard b { font-size: 24px; display: block; }
.scard small { color: var(--muted); font-size: 12.5px; }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; margin-top: 14px; }
.cb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.cb-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.cb-bar i { display: block; width: 100%; border-radius: 6px 6px 3px 3px; background: #e6ecf8; min-height: 4px; transition: height .5s ease; }
.cb-bar i.has { background: linear-gradient(180deg, #7aa2ff, #4f7cff); }
.cb span { font-size: 11px; color: var(--muted); height: 14px; }
.cb small { font-size: 10px; color: #98a2b3; }

.subj-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.subj-main { flex: 1; min-width: 0; }
.subj-row + .subj-row { border-top: 1px solid #f2f5fb; }

.subj-block { background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); margin-bottom: 12px; }
.subj-head { display: flex; align-items: center; gap: 9px; padding: 2px 4px 8px; font-size: 14.5px; }
.subj-head .muted { margin-left: auto; }

.feed { display: flex; gap: 10px; padding: 8px 0; }
.feed + .feed { border-top: 1px solid #f2f5fb; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; background: #dde3ee; }
.feed-dot.ok { background: var(--green); }
.feed-dot.warn { background: var(--amber); }
.feed-txt { display: flex; flex-direction: column; }
.feed-txt .small { line-height: 1.3; }

#sync { margin-top: 10px; }
#sync.off { color: var(--amber); }

/* блок призыва к проверке */
.cta-card { padding: 16px; }
.cta-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.cta-card .btn { margin-bottom: 0; }
.cta-ico.ok { background: var(--green-soft); }

/* ---------------------------------------------------------------- алмазы */
.top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.gem-pill {
  display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 14px;
  border: 1px solid #d7e3ff; background: #f2f7ff; color: #2f4fa8;
  border-radius: 999px; padding: 6px 12px; cursor: pointer; white-space: nowrap;
}
.gem-pill b { font-size: 15px; }
.gem-pill:active { transform: scale(.97); }
.gem-gain { font-size: 13px; font-weight: 700; color: #1f7a4d; background: #d9f5e6; border-radius: 999px; padding: 3px 9px; }
.fb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.fb-head b { margin: 0; }
.gem-line { margin-top: 10px; font-weight: 700; color: #2f4fa8; }

.block-title { font-size: 15px; margin: 4px 2px 10px; color: var(--muted); font-weight: 600; }
.route-list { margin-bottom: 0; }
.list.route-list .row-item + .row-item { border-top: 1px solid #f2f5fb; border-radius: 12px; }

/* ---------------------------------------------------------------- дом */
.house-card { padding: 10px 12px 16px; }
.house-svg { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto 6px; }
.hp { animation: hpIn .5s cubic-bezier(.2, .9, .3, 1.25) both; transform-box: fill-box; transform-origin: bottom center; }
.hp.ghost { opacity: .55; animation: none; }
.hp.ghost * { fill: none; stroke: #9fb2d4; stroke-width: 1.6; stroke-dasharray: 6 5; }
@keyframes hpIn { from { opacity: 0; transform: translateY(7px) scale(.94); } to { opacity: 1; transform: none; } }

.gem-rules { display: flex; gap: 8px; margin-top: 12px; }
.gem-rules > div { flex: 1; background: #fff; border-radius: 12px; padding: 10px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.gem-rules b { font-size: 18px; color: #2f4fa8; }
.gem-rules small { font-size: 11px; color: var(--muted); line-height: 1.25; }

.house-item { background: var(--card); }
.house-item.own { background: #f4fbf7; border-color: #cdeedb; }
.house-item:disabled { cursor: default; opacity: 1; }
.house-item:disabled:not(.own) { background: #f7f9fd; }
.hi-ico { font-size: 22px; width: 34px; flex: 0 0 auto; text-align: center; }
.cost { flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 6px 11px; }
.cost.low { color: #98a2b3; background: #f2f5fb; }
.cost.own { color: var(--green); background: var(--green-soft); }

.gems-row { display: flex; gap: 6px; margin: 12px 0 4px; }
.gems-row > div { flex: 1; text-align: center; display: flex; flex-direction: column; }
.gems-row b { font-size: 18px; }
.gems-row small { font-size: 10.5px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%);
  background: #101828; color: #fff; font-size: 14px; font-weight: 600;
  padding: 10px 16px; border-radius: 999px; z-index: 50;
  animation: toastIn .22s ease both; box-shadow: 0 10px 24px rgba(16, 24, 40, .25);
}
.toast.out { animation: toastOut .4s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, 8px); } }

.nav { gap: 2px; }
.nav-btn { font-size: 11px; }

/* ---------------------------------------------------------------- видео */
.badge.vid { color: #c2410c; background: #fff1e6; }
.video-card { padding: 16px 18px; }
.video-card .card-head { margin-bottom: 8px; }
.video-card p { margin-bottom: 12px; }
.video-card .video-title { font-size: 15.5px; font-weight: 600; margin: 0 0 4px; line-height: 1.35; }
.video-card .video-meta { margin: 0 0 12px; color: var(--muted); }
.video-card .video-q { font-size: 13px; color: #9a3412; background: #fff7f0; border-radius: 10px; padding: 8px 10px; margin: 0 0 12px; }
.video-card .video-note { margin: 10px 0 2px; color: #c2410c; }
.video-more { margin: 12px 0 2px; }
.video-more b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.video-more-link { display: block; font-size: 13.5px; color: var(--accent); text-decoration: none; padding: 8px 0; border-top: 1px solid #f0f4fc; }
.video-more-link::before { content: "▶ "; font-size: 10px; color: #c2410c; }
.video-card .text-link { display: inline-block; margin-top: 8px; }
a.btn { text-decoration: none; }
a.btn-soft { color: var(--accent); }

/* ---------------------------------------------------------------- порталы */
.portal-card { padding: 16px 18px; }
.portal-card .card-head { margin-bottom: 8px; }
.portal-card p { margin-bottom: 12px; }
.portal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.portal-btn {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  padding: 9px 10px; border-radius: 14px; text-decoration: none;
  background: var(--pbg, var(--accent-soft)); color: var(--ink);
  border: 1px solid rgba(16, 24, 40, .05);
}
.portal-btn:active { transform: scale(.98); }
.portal-mark {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  background: var(--pc, var(--accent)); color: #fff;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800; letter-spacing: .01em;
}
.portal-text { display: flex; flex-direction: column; min-width: 0; }
.portal-text b { font-size: 12.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-text small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- всплывающие окна */
body.has-sheet { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 55; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--card); border-radius: 22px 22px 0 0;
  padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(16, 24, 40, .18);
}
@media (min-width: 560px) {
  .sheet { left: 50%; right: auto; transform: translateX(-50%); width: 520px; border-radius: 22px; bottom: 24px; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-title { font-size: 20px; margin: 0 0 8px; }
.sheet .term { margin-bottom: 8px; }
.sheet .theory-p { margin-bottom: 10px; }
.sheet .btn-wide { margin-top: 12px; }

/* слово-термин в тексте вопроса: нажал — объяснение */
.term-link {
  font: inherit; color: var(--accent); background: none; border: 0; padding: 0;
  border-bottom: 1px dashed rgba(79, 124, 255, .55); cursor: pointer; line-height: inherit;
}
.term-link:active { opacity: .6; }

/* «мне непонятно» под абзацем теории */
.help-link {
  display: block; margin: -2px 0 12px auto; padding: 2px 0;
  background: none; border: 0; color: var(--accent); font-size: 12px; cursor: pointer;
  text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px;
}
.help-opts { display: grid; gap: 8px; margin-top: 6px; }
/* вопрос, который разбираем: виден в помощнике, чтобы не потерять условие */
.helper-q {
  font-size: 13.5px; font-weight: 600; line-height: 1.4; color: var(--ink);
  background: #f8fafd; border-left: 3px solid var(--accent); border-radius: 8px;
  padding: 8px 10px; margin: 0 0 8px;
}
.help-opt {
  text-align: left; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bg); font: inherit; color: var(--ink); cursor: pointer;
}
.help-opt:active { transform: scale(.99); }

/* ---------------------------------------------------------------- практика */
.q-ask { font-weight: 700; margin: 14px 0 8px; }
.done-steps { margin: 0 0 12px; padding-left: 20px; }
.done-steps li { font-size: 15px; margin-bottom: 6px; color: var(--muted); }
.hint-box { background: var(--amber-soft); color: #7a4a06; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.err.small { font-size: 13px; }
/* ---------------------------------------------------------------- тетрадь */
.photo-file { display: none; }
.photo-prev { width: 100%; border-radius: 14px; margin-top: 12px; display: block; }
.sol { margin-bottom: 14px; }
.sol-img { width: 100%; border-radius: 14px; margin: 8px 0; display: block; border: 1px solid var(--line); }
/* ---------------------------------------------------------------- профили */
.err { color: var(--red); }

/* ---------------------------------------------------------------- профиль в углу */
.start { padding-top: 14px; }
.start-bar { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.profile-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 14px 4px 4px; box-shadow: var(--shadow); cursor: default;
}
.profile-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(145deg, #4f7cff, #7aa2ff);
}
.pc-txt { display: flex; flex-direction: column; line-height: 1.1; }
.pc-txt b { font-size: 14px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-txt small { font-size: 10.5px; color: var(--muted); }
.start .hero { margin-top: 6px; }

/* ---------------------------------------------------------------- теория 2.0 */
.short-box { background: #eef4ff; border-radius: 14px; padding: 12px 14px; margin-top: 12px; }
.short-box b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 4px; }
.short-box p { font-size: 15px; font-weight: 600; line-height: 1.4; }
.terms-box { margin-top: 14px; border-top: 1px solid #f2f5fb; padding-top: 12px; }
.terms-box > b { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.term { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; }
.term-t { font-weight: 700; font-size: 14.5px; }
.term-d { font-size: 13.5px; color: var(--muted); }

/* ---------------------------------------------------------------- рассказ */
.speak-box {
  background: #f7f9fe; border: 1px dashed #cbd8f2; border-radius: 14px;
  padding: 12px 14px; font-size: 14.5px; line-height: 1.45; min-height: 72px; margin-bottom: 10px;
}
.speak-input { font-size: 14.5px; resize: vertical; }
.talk { padding: 10px 0; }
.talk + .talk { border-top: 1px solid #f2f5fb; }
.talk p { margin: 4px 0 4px; line-height: 1.45; }

/* ---------------------------------------------------------------- ВПР */
.vpr-chip {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  background: #fff1e6; color: #c2410c; border-radius: 6px; padding: 2px 6px;
  text-transform: none; vertical-align: middle;
}

/* ---------------------------------------------------------------- оценки рассказа */
.talk-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.marks { display: flex; gap: 6px; }
.mark {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  width: 34px; height: 30px; font-size: 15px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; opacity: .55;
}
.mark.on { opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.mark-big { font-size: 22px; }

/* кнопка минуса рядом с ответом */
.sign-btn { flex: 0 0 auto; width: 46px; padding: 12px 0; font-size: 20px; font-weight: 700; }
.answer-row .input.num { min-width: 0; }

/* полоска «есть новая версия» */
.update-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 104px; z-index: 60;
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 24px); white-space: nowrap;
  background: #101828; color: #fff; border-radius: 999px; padding: 8px 8px 8px 16px;
  font-size: 13px; box-shadow: 0 12px 26px rgba(16, 24, 40, .3);
}
.update-bar button {
  border: 0; border-radius: 999px; padding: 7px 14px; font: inherit; font-weight: 700;
  background: #4f7cff; color: #fff; cursor: pointer;
}

.text-link { display: inline-block; margin-top: 12px; font-size: 13.5px; color: var(--accent); text-decoration: none; }
.text-link:active { opacity: .7; }

.exam-row { padding: 8px 0; }
.exam-row + .exam-row { border-top: 1px solid #f2f5fb; }

/* ---------------------------------------------------------------- четверти */
.quarters {
  display: flex; gap: 6px; background: #e7ecf7; border-radius: 14px; padding: 4px; margin: 0 0 14px;
}
.q-tab {
  flex: 1; min-width: 0; border: 0; background: transparent; border-radius: 11px; padding: 7px 6px;
  font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; line-height: 1.15;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.q-tab b { font-size: 14px; color: var(--ink); }
.q-tab small { font-size: 10.5px; opacity: .75; }
.q-tab.on { background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.hero .quarters { max-width: 320px; margin: 12px auto 4px; }

/* ------------------------------------------------------------ порядок тем */
.quarter-note { margin: -6px 0 12px; }
.row-item.locked .row-txt b { color: var(--muted); }
.row-item.locked .chev { opacity: .35; }
.lock-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.lock-head .cta-ico { margin: 0; }
.lock-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.lock-row {
  display: flex; align-items: center; gap: 10px; background: #f7f9fe;
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px;
}
.row-txt b { display: block; }
.lock-row.next { border-color: var(--accent); background: var(--accent-soft); }
.lock-row.target { opacity: .75; border-style: dashed; }

/* ------------------------------------------------------------ код профиля */
.code-big { display: flex; justify-content: center; gap: 8px; margin: 6px 0 12px; }
.code-big span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 58px; border-radius: 14px;
  background: #f2f5fb; border: 1px solid var(--line);
  font-size: 30px; font-weight: 800; letter-spacing: 0; color: var(--ink);
}

/* ------------------------------------- просмотр уроков ребёнка (родитель) */
.preview-bar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px;
  background: var(--amber-soft);
  border-bottom: 1px solid #f6d9a8;
  color: #8a4b00;
  font-size: 13px; line-height: 1.25;
}
.preview-bar .btn-tiny { background: #fff; color: #8a4b00; flex: 0 0 auto; white-space: nowrap; }
.preview-cta { border: 1px dashed #c9d6f5; background: #fbfcff; }
