/* Личный кабинет ученика. Телефон — главное; с 900px — боковое меню и шире колонка.
   Цвета и радиусы — как на сайте (дизайн-система «Bichun»). */
:root {
  --navy: #1d4f91; --navy-d: #163d70; --accent: #2a62b0; --light: #e9eff8; --ink: #16191d; --muted: #5b6168;
  --soft: #8a9097; --grey: #f5f6f7; --border: #e4e6e8; --dark: #101214; --ok: #1e6b43; --warn: #b45309; --logo: #ff3333;
  --r-btn: 14px; --r-card: 18px; --shadow: 0 2px 12px rgba(22,25,29,.08);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--grey); font-size: 16px; line-height: 1.5; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-d); }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 20px; }
.tiny { font-size: 13px; line-height: 18px; }
.over { font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ok { color: var(--ok); }
.ico { width: 20px; height: 20px; flex-shrink: 0; }

/* Каркас */
.cab { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.cab__top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.cab__logo { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: var(--ink); min-height: 44px; margin-right: auto; }
.cab__logo svg { width: 28px; height: 26px; }
.cab__main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 20px 16px 104px; display: flex; flex-direction: column; gap: 16px; }
.cab__side { display: none; }
.cab--guest .cab__main { padding-bottom: 32px; }
.round { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--border); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); flex-shrink: 0; }
.round--me { background: var(--navy); border-color: var(--navy); color: #fff; font-size: 15px; font-weight: 600; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); background: #fff; border-top: 1px solid var(--border); padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; font-size: 12px; color: var(--muted); }
.tabbar a[aria-current] { color: var(--navy); font-weight: 600; }
.tabbar svg { width: 24px; height: 24px; }
.in-app .cab__top, .in-app .tabbar { display: none; } /* внутри мини-приложения мессенджера (позже) */

@media (min-width: 900px) {
  .cab { display: grid; grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .cab__top { grid-column: 1 / -1; padding: 14px max(24px, calc((100vw - 1140px) / 2)); }
  .cab__side { display: flex; flex-direction: column; gap: 4px; padding: 28px 16px 28px max(24px, calc((100vw - 1140px) / 2)); }
  .cab__side a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--ink); font-size: 15px; }
  .cab__side a[aria-current] { background: #fff; border: 1px solid var(--border); color: var(--navy); font-weight: 600; }
  .cab__main { max-width: 900px; margin: 0; padding: 28px 24px 64px; }
  .cab--guest { display: flex; }
  .cab--guest .cab__main { max-width: 480px; margin: 0 auto; }
  .tabbar { display: none; }
  .wide { max-width: none; }
}

/* Карточки и кнопки */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); }
a.card:hover { border-color: #c9d3e2; color: var(--ink); }
.card--shadow { box-shadow: var(--shadow); }
.card--dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.card--dark .muted, .card--dark .over { color: rgba(255,255,255,.7); }
.card--tint { background: var(--light); border-color: var(--light); }
.card--dashed { border-style: dashed; }
.card--current { border: 2px solid var(--navy); box-shadow: var(--shadow); padding: 0; overflow: hidden; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cards { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 900px) { .cards--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; } }
.tag { align-self: flex-start; font-size: 13px; line-height: 18px; font-weight: 600; border-radius: 999px; padding: 4px 10px; background: var(--light); color: var(--navy); }
.tag--grey { background: var(--grey); color: var(--ink); }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.title { font-size: 18px; line-height: 25px; font-weight: 600; }
.h1 { font-size: 28px; line-height: 36px; font-weight: 700; }
.h2 { font-size: 19px; line-height: 26px; font-weight: 600; margin-top: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 20px; border-radius: var(--r-btn); border: 1px solid transparent; font-size: 16px; font-weight: 600; line-height: 22px; text-align: center; cursor: pointer; background: var(--navy); color: #fff; width: 100%; }
.btn:hover { background: var(--navy-d); color: #fff; }
.btn--light { background: #fff; color: var(--navy); }
.btn--light:hover { background: var(--light); color: var(--navy); }
.btn--line { background: #fff; color: var(--ink); border-color: var(--border); }
.btn--line:hover { background: var(--grey); color: var(--ink); }
.btn--small { min-height: 44px; padding: 8px 16px; font-size: 15px; width: auto; }
.btn--tint { background: var(--light); color: var(--ink); }
.btn--tint:hover { background: #dce6f4; color: var(--ink); }
.btn[disabled] { background: var(--border); color: var(--muted); cursor: default; }
.linkish { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: 14px; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
.linkish:hover { color: var(--navy); }
.bar { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--navy); }
.card--dark .bar { background: rgba(255,255,255,.18); }
.card--dark .bar > i { background: #fff; }
.ring { width: 48px; height: 48px; border-radius: 999px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ring span { width: 38px; height: 38px; border-radius: 999px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.flash { background: var(--light); color: var(--ink); border-radius: 14px; padding: 12px 14px; font-size: 15px; }
.err { color: var(--navy-d); font-size: 14px; }

/* Формы */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 14px; font-weight: 600; }
.input { height: 52px; border: 1px solid var(--border); border-radius: 6px; padding: 0 14px; font-size: 16px; background: #fff; width: 100%; }
.input:focus, textarea.input:focus { outline: 2px solid var(--navy); outline-offset: -1px; border-color: var(--navy); }
textarea.input { height: auto; padding: 12px 14px; line-height: 22px; resize: vertical; }
.input--code { font-size: 26px; letter-spacing: .5em; text-align: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 20px; }
.check input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked), .chip[aria-pressed="true"] { border: 2px solid var(--navy); background: var(--light); color: var(--navy); font-weight: 600; }

/* Лента */
.lrow { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px; color: var(--ink); }
.lrow:hover { color: var(--ink); border-color: #c9d3e2; }
.lrow__thumb { width: 88px; height: 60px; flex-shrink: 0; border-radius: 12px; background: #2a2e33; display: flex; align-items: center; justify-content: center; color: #fff; }
.lrow__thumb--done { background: var(--dark); }
.lrow__thumb--q { width: 44px; height: 44px; border-radius: 999px; background: var(--light); color: var(--navy); }
.lrow--locked { opacity: .55; }
.lrow--test { background: var(--dark); border-color: var(--dark); color: #fff; }
.lrow--test .muted { color: rgba(255,255,255,.75); }
.cur__video { aspect-ratio: 16 / 9; background: var(--dark); display: flex; align-items: center; justify-content: center; position: relative; }
.cur__body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.play { width: 64px; height: 64px; border-radius: 999px; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; color: var(--ink); }
.badge-here { position: absolute; top: 12px; left: 12px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 4px 10px; }

/* Урок */
.player { aspect-ratio: 16 / 9; background: var(--dark); border-radius: 0; overflow: hidden; position: relative; margin: -20px -16px 0; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player__stub { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; color: rgba(255,255,255,.7); font-size: 14px; text-align: center; padding: 16px; }
@media (min-width: 900px) { .player { margin: 0; border-radius: var(--r-card); } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button { height: 44px; padding: 0 12px; border: 0; background: none; color: var(--muted); font-size: 15px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--navy); font-weight: 600; box-shadow: inset 0 -2px 0 var(--navy); }
.tabpanel[hidden] { display: none; }
.points { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: p; }
.points li { display: flex; gap: 10px; font-size: 15px; line-height: 22px; counter-increment: p; }
.points li::before { content: counter(p); color: var(--navy); font-weight: 700; }
.chapters a { display: flex; align-items: center; min-height: 48px; border-bottom: 1px solid var(--border); color: var(--ink); font-size: 15px; gap: 12px; }
.chapters b { width: 56px; color: var(--navy); font-variant-numeric: tabular-nums; }
.next-bar { position: sticky; bottom: 76px; display: flex; gap: 8px; }
@media (min-width: 900px) { .next-bar { position: static; } }
.speed { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.speed button { height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 14px; cursor: pointer; }
.speed button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }

/* Вопрос */
.opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: #fff; text-align: left; font-size: 16px; line-height: 22px; cursor: pointer; }
.opt input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--navy); }
.opt:has(input:checked) { border: 2px solid var(--ink); }
.opt--right { border: 2px solid var(--ok) !important; }
.opt--wrong { border: 2px solid var(--navy) !important; }
.verdict { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--ok); font-size: 15px; line-height: 22px; }
.verdict--no { border-color: var(--navy); }

/* Модальное окно (<dialog>) */
dialog.sheet { border: 0; padding: 0; width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; margin: auto auto 0; max-height: 90vh; }
dialog.sheet::backdrop { background: rgba(16,18,20,.5); }
@media (min-width: 900px) { dialog.sheet { border-radius: 18px; margin: auto; } }
.sheet__in { padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.sheet__grip { align-self: center; width: 40px; height: 4px; border-radius: 999px; background: var(--border); }

/* Знакомство с АБ */
.hello { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #fff; }
.hello__hero { background: var(--light); display: flex; align-items: flex-end; justify-content: center; position: relative; height: 250px; flex-shrink: 0; }
.hello__hero--big { height: 420px; }
.hello__hero img { height: calc(100% - 16px); width: auto; object-fit: contain; object-position: center bottom; }
.hello__top { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; }
.dots { display: flex; gap: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 999px; background: rgba(29,79,145,.25); }
.dots i.on { background: var(--navy); }
.dots i.cur { width: 20px; background: var(--navy); }
.hello__body { flex: 1; width: 100%; max-width: 520px; margin: -28px auto 0; padding: 0 16px 28px; display: flex; flex-direction: column; gap: 16px; position: relative; }
.bubble { background: #fff; border: 1px solid var(--border); border-radius: 18px; border-top-left-radius: 6px; padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.bubble b { font-size: 13px; color: var(--navy); }
.bubble p { font-size: 18px; line-height: 26px; white-space: pre-line; }
.hello__actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 900px) {
  .hello { flex-direction: row; background: var(--grey); align-items: center; justify-content: center; padding: 48px; }
  .hello__wrap { display: flex; width: 100%; max-width: 900px; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); min-height: 520px; }
  .hello__hero, .hello__hero--big { height: auto; width: 360px; flex-shrink: 0; }
  .hello__body { margin: 0; padding: 32px; max-width: none; }
}

/* Фокус */
.focus { background: var(--dark); color: #fff; min-height: 100vh; }
.focus .muted { color: rgba(255,255,255,.65); }
.focus__bar { height: 4px; background: rgba(255,255,255,.15); position: sticky; top: 0; z-index: 7; }
.focus__bar i { display: block; height: 100%; background: #fff; width: 0; transition: width 1s linear; }

/* Поиск */
mark { background: var(--light); color: var(--navy); font-weight: 600; border-radius: 4px; padding: 0 2px; }
.vnote { font-size: 14px; line-height: 20px; color: var(--warn); background: #fdf6ec; border-radius: 10px; padding: 8px 12px; margin-top: 4px; }

/* Задания с проверкой */
.task-st { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; }
.task-st .ico { width: 22px; height: 22px; flex-shrink: 0; }
.task-st b { display: block; font-size: 16px; line-height: 22px; }
.task-st span { font-size: 14px; line-height: 20px; }
.task-st--pending { background: #e9eff8; } .task-st--pending b, .task-st--pending .ico { color: #1d4f91; }
.task-st--revision { background: #fdf3e8; } .task-st--revision b, .task-st--revision .ico { color: #b45309; }
.task-st--accepted { background: #e8f3ec; } .task-st--accepted b, .task-st--accepted .ico { color: #1e6b43; }
.task-text { font-size: 15px; line-height: 23px; white-space: pre-line; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 22px; display: flex; flex-direction: column; gap: 6px; }
.msg__who { font-size: 13px; line-height: 18px; color: var(--muted, #5b6168); }
.msg__text { white-space: pre-line; overflow-wrap: anywhere; }
.msg--me { align-self: flex-end; background: #fff; border: 1px solid #e4e6e8; border-bottom-right-radius: 4px; }
.msg--them { align-self: flex-start; background: #e9eff8; border-bottom-left-radius: 4px; }
.msg--accept { border-left: 3px solid #1e6b43; } .msg--revision { border-left: 3px solid #b45309; }
.att { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #e4e6e8; border-radius: 12px; background: #fff; font-size: 14px; min-height: 44px; }
.att audio { flex: 1; min-width: 0; height: 36px; }
.att a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att__x { margin-left: auto; width: 32px; height: 32px; border: 0; background: transparent; font-size: 20px; color: #5b6168; cursor: pointer; }
.task-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rec--on { border-color: #b45309 !important; color: #b45309 !important; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #b45309; animation: rec 1s infinite; }
@keyframes rec { 50% { opacity: .3; } }
.qlist { display: flex; flex-direction: column; border: 1px solid #e4e6e8; border-radius: 18px; background: #fff; overflow: hidden; }
.qrow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid #e4e6e8; color: inherit; text-decoration: none; }
.qrow:first-child { border-top: 0; }
.qrow:hover { background: #f5f6f7; }
.qrow__wait--late { color: #b45309; font-weight: 600; }
@media (max-width: 700px) { .qrow { grid-template-columns: minmax(0, 1fr) auto; } .qrow__lesson { grid-column: 1 / -1; order: 3; } }
.check-grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.check-grid > section { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.check-grid > aside { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.btn--ok { background: #1e6b43 !important; color: #fff !important; }
.btn--warn { background: #fff !important; color: #b45309 !important; border: 1px solid #b45309 !important; }
.ref { background: #fffaf0; border: 1px solid #f1e3c8; }
