/* Кабинет практикума — компоненты поверх дизайн-системы app.css:
   шапка курса, «следующий шаг», уроки и их состояния, карта настройки,
   переписка, расписание, форматы участия, таблица потока со светофором. */

.brand .logo { background: linear-gradient(135deg, #1478f0, #55a4ff); }
.nav-bell { position: relative; display: inline-flex; align-items: center; color: var(--c-text-2);
  padding: .35rem; border-radius: 8px; }
.nav-bell:hover { color: var(--c-text); background: var(--c-bg); text-decoration: none; }
.nav-bell .cnt, .tab .cnt { position: absolute; top: -2px; right: -4px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 99px; background: var(--c-danger); color: #fff; font-size: .68rem;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Шапка курса ---------- */
.course-head { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.course-head .titles { flex: 1; min-width: 16rem; }
.course-head h1 { margin-bottom: .2rem; }
.course-meta { display: flex; gap: .5rem 1.1rem; flex-wrap: wrap; color: var(--c-text-2); font-size: .88rem;
  margin-top: .45rem; }
.course-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.ring { --pct: 0; width: 84px; height: 84px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--c-primary) calc(var(--pct) * 1%), var(--c-border) 0); }
.ring span { width: 66px; height: 66px; border-radius: 50%; background: var(--c-surface); display: grid;
  place-items: center; font-weight: 800; font-size: 1.15rem; }
.kpis { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.kpi { min-width: 7.5rem; }
.kpi b { font-size: 1.15rem; }
.kpi small { display: block; }
.bar { height: 6px; border-radius: 99px; background: var(--c-border); overflow: hidden; margin-top: .3rem; }
.bar i { display: block; height: 100%; background: var(--c-primary); border-radius: 99px; }
.bar.green i { background: var(--c-success); }

/* вкладки курса */
.tabs { display: flex; gap: .25rem; margin: 1.1rem 0 1.25rem; border-bottom: 1px solid var(--c-border);
  overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: .4rem; padding: .6rem .85rem;
  color: var(--c-text-2); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--c-text); text-decoration: none; }
.tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.tab .cnt { position: static; margin-left: .15rem; }

/* ---------- Следующий шаг ---------- */
.next { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  border-color: #cfe0f7; background: linear-gradient(135deg, #eef5fe, #fff 70%); }
:root[data-theme="dark"] .next { background: linear-gradient(135deg, #1b2336, #171a21 70%); border-color: #2c3550; }
.next .ic-big { width: 46px; height: 46px; border-radius: 12px; background: var(--c-primary); color: #fff;
  display: grid; place-items: center; flex: none; }
.next .txt { flex: 1; min-width: 14rem; }
.next .txt h2 { margin: 0 0 .2rem; }
.next .txt p { margin: 0; color: var(--c-text-2); }

/* ---------- Список уроков ---------- */
.module + .module { margin-top: 1.1rem; }
.module-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-text-3);
  font-weight: 700; margin: 0 0 .4rem; }
.lessons { display: flex; flex-direction: column; }
.lrow { display: flex; align-items: center; gap: .75rem; padding: .65rem .5rem; border-radius: 10px;
  color: var(--c-text); }
.lrow + .lrow { border-top: 1px solid var(--c-border); }
a.lrow:hover { background: var(--c-bg); text-decoration: none; }
.lrow .st { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--c-bg); color: var(--c-text-3); }
.lrow.done .st { background: var(--c-success-soft); color: var(--c-success); }
.lrow.progress .st, .lrow.open .st { background: var(--c-primary-soft); color: var(--c-primary); }
.lrow.locked { color: var(--c-text-3); }
.lrow .lt { flex: 1; min-width: 0; }
.lrow .lt b { font-weight: 600; display: block; }
.lrow .lt small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .side { flex: none; display: flex; gap: .4rem; align-items: center; }

/* ---------- Урок ---------- */
.lesson-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.25rem; align-items: start; }
.lesson-grid > * { min-width: 0; }
@media (max-width: 980px) { .lesson-grid { grid-template-columns: 1fr; } .side-stick { position: static; } }
@media (max-width: 560px) { .lrow .side { display: none; } .course-head .kpis { width: 100%; }
  .card { padding: 1rem; } .bubble { max-width: 92%; } }
.crumbs { font-size: .85rem; color: var(--c-text-3); margin-bottom: .35rem; display: flex; gap: .4rem;
  flex-wrap: wrap; align-items: center; }
.crumbs a { color: var(--c-text-2); }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: #0d1117; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .wm { position: absolute; right: 12px; bottom: 44px; color: rgba(255,255,255,.35); font-size: .75rem;
  pointer-events: none; user-select: none; }
.player-empty { aspect-ratio: 16 / 9; border-radius: var(--radius); border: 1px dashed var(--c-border);
  display: grid; place-items: center; text-align: center; color: var(--c-text-3); padding: 1rem; }
.timecodes { display: flex; flex-direction: column; gap: .15rem; margin: .5rem 0 0; }
.timecodes button { text-align: left; background: none; border: none; font: inherit; color: var(--c-text);
  padding: .3rem .4rem; border-radius: 8px; cursor: pointer; display: flex; gap: .6rem; }
.timecodes button:hover { background: var(--c-bg); }
.timecodes code { color: var(--c-primary); }
.prose { line-height: 1.65; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
/* своя кнопка выбора файла вместо системной (та подписана языком браузера) */
.file-btn { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; font-size: .85rem;
  color: var(--c-text-2); border: 1px dashed var(--c-border); border-radius: var(--radius-sm);
  padding: .45rem .7rem; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-btn:hover { color: var(--c-primary); border-color: var(--c-primary); }
.file-btn.has { color: var(--c-primary); border-style: solid; }
.prose h2 { font-size: 1.15rem; margin: 1.4rem 0 .5rem; }
.prose h3 { font-size: 1rem; margin: 1.1rem 0 .4rem; }
.prose pre { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 10px; padding: .8rem 1rem;
  overflow-x: auto; position: relative; }
.prose code { font-family: var(--mono); font-size: .86em; }
.prose :not(pre) > code { background: var(--c-bg); padding: .1rem .35rem; border-radius: 6px; }
.prose img { max-width: 100%; border-radius: 10px; border: 1px solid var(--c-border); }
.prose table { margin: .8rem 0; }
.copy-btn { position: absolute; top: .4rem; right: .4rem; }
.checklist { list-style: none; padding: 0; margin: .3rem 0 0; }
.checklist li { display: flex; gap: .55rem; align-items: flex-start; padding: .35rem 0; }
.checklist input { margin-top: .3rem; width: auto; }
.result-line { display: flex; gap: .5rem; align-items: flex-start; padding: .7rem .9rem; border-radius: 12px;
  background: var(--c-success-soft); color: var(--c-success); font-weight: 600; margin: .9rem 0 0; }
.note { padding: .7rem .9rem; border-radius: 12px; background: var(--c-warn-soft); color: var(--c-warn);
  font-size: .9rem; }
.note.info { background: var(--c-primary-soft); color: var(--c-primary); }
.side-stick { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 1rem; }
.task-head { display: flex; justify-content: space-between; gap: .75rem; align-items: center; flex-wrap: wrap; }

/* ---------- Переписка ---------- */
.thread { display: flex; flex-direction: column; gap: .55rem; }
.bubble { max-width: 82%; padding: .55rem .85rem; border-radius: 14px; white-space: pre-wrap;
  word-break: break-word; font-size: .93rem; }
.bubble.me { align-self: flex-end; background: var(--c-primary-soft); border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; background: var(--c-bg); border: 1px solid var(--c-border);
  border-bottom-left-radius: 4px; }
.bubble.stuck { border-left: 3px solid var(--c-danger); }
.bubble.review { border-left: 3px solid var(--c-success); }
.bubble.report { border-left: 3px solid var(--c-primary); }
.bubble .meta { display: block; font-size: .72rem; color: var(--c-text-3); margin-top: .25rem; }
.bubble .file { display: inline-flex; gap: .3rem; align-items: center; margin-top: .3rem; font-size: .88rem; }
.composer { display: flex; gap: .5rem; align-items: flex-end; margin-top: .9rem; flex-wrap: wrap; }
.composer textarea { flex: 1; min-width: 14rem; min-height: 2.8rem; }
.composer .file-pick { font-size: .82rem; color: var(--c-text-2); }
.composer input[type=file] { max-width: 15rem; font-size: .82rem; }

/* ---------- Карта настройки ---------- */
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: .9rem; padding: .85rem .3rem; align-items: flex-start; }
.step + .step { border-top: 1px solid var(--c-border); }
.step .num { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: .85rem; background: var(--c-bg); color: var(--c-text-2); border: 1px solid var(--c-border); }
.step.self .num { background: var(--c-warn-soft); color: var(--c-warn); border-color: transparent; }
.step.done .num { background: var(--c-success); color: #fff; border-color: transparent; }
.step .body { flex: 1; min-width: 0; }
.step .body b { display: block; }
.step .acts { flex: none; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.mini-steps { display: flex; gap: 4px; margin-top: .5rem; }
.mini-steps i { flex: 1; height: 6px; border-radius: 99px; background: var(--c-border); }
.mini-steps i.self { background: #f5c36a; }
.mini-steps i.done { background: var(--c-success); }

/* ---------- Расписание ---------- */
.event { display: flex; gap: 1rem; align-items: center; padding: .8rem .3rem; flex-wrap: wrap; }
.event + .event { border-top: 1px solid var(--c-border); }
.event .when { width: 6.5rem; flex: none; }
.event .when b { display: block; font-size: 1.05rem; }
.event .what { flex: 1; min-width: 12rem; }
.event .acts { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* ---------- Форматы участия ---------- */
.tariffs { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.tariff { display: flex; flex-direction: column; }
.tariff.current { border-color: var(--c-primary); box-shadow: 0 0 0 1px var(--c-primary) inset, var(--shadow); }
.tariff ul { padding-left: 1.1rem; margin: .6rem 0; flex: 1; }
.tariff li { margin: .25rem 0; }
.price { font-size: 1.3rem; font-weight: 800; }
.price s { color: var(--c-text-3); font-weight: 500; font-size: .95rem; margin-left: .3rem; }

/* ---------- Куратор ---------- */
.feed-sec h2 { display: flex; align-items: center; gap: .45rem; }
.frow { display: flex; gap: .75rem; align-items: center; padding: .6rem .35rem; color: var(--c-text); flex-wrap: wrap; }
.frow + .frow { border-top: 1px solid var(--c-border); }
a.frow:hover { background: var(--c-bg); text-decoration: none; border-radius: 8px; }
.frow .who { font-weight: 600; min-width: 9rem; }
.frow .what { flex: 1; min-width: 12rem; color: var(--c-text-2); overflow: hidden; text-overflow: ellipsis; }
.frow .side { flex: none; display: flex; gap: .4rem; align-items: center; }
.matrix td, .matrix th { padding: .45rem .5rem; text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix th.step-h { writing-mode: vertical-rl; transform: rotate(180deg); text-transform: none; letter-spacing: 0;
  font-size: .75rem; height: 12.5rem; vertical-align: bottom; white-space: nowrap; }
.cell { width: 18px; height: 18px; border-radius: 5px; display: inline-block; background: var(--c-border); }
.cell.self { background: #f5c36a; }
.cell.confirmed { background: var(--c-success); }
.reasons { font-size: .78rem; color: var(--c-text-2); }
.light { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .82rem; }
.kv { display: grid; grid-template-columns: 9rem 1fr; gap: .35rem .9rem; font-size: .92rem; }
.kv dt { color: var(--c-text-3); }
.kv dd { margin: 0; }

/* ---------- Вход ---------- */
.auth-wrap { max-width: 26rem; margin: 3rem auto; }
.auth-wrap .card { padding: 1.75rem; }
.code-input { font-size: 1.6rem !important; letter-spacing: .5rem; text-align: center; font-family: var(--mono) !important; }
.dev-code { font-family: var(--mono); font-size: 1.4rem; font-weight: 800; letter-spacing: .3rem; }

/* ---------- Админ ---------- */
.admin-list .item { display: flex; align-items: center; gap: .6rem; padding: .5rem .3rem; }
.admin-list .item + .item { border-top: 1px solid var(--c-border); }
.admin-list .item .grow { flex: 1; min-width: 0; }
.funnel td.num { font-family: var(--mono); text-align: right; }
.hbar { height: 8px; border-radius: 99px; background: var(--c-primary); min-width: 2px; display: block; }
details.box { border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: .6rem .8rem; }
details.box + details.box { margin-top: .6rem; }
details.box summary { cursor: pointer; font-weight: 600; }
.sec-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.sec-title h2 { margin: 0; }
