/* «Ночной атлас знаний»: вход, верхняя панель, каталог, курс, занятие, окна, адаптив. */

/* --- Общее ------------------------------------------------------------------ */

.page { position: relative; min-height: 100vh; overflow: hidden; padding-bottom: 88px; }

.view { position: relative; }

.grain {
  position: absolute; inset: 0; z-index: 30; width: 100%; height: 100%;
  opacity: .08; pointer-events: none; mix-blend-mode: overlay;
}

.brand { font: italic 600 26px/1 var(--serif); color: var(--text); white-space: nowrap; }

.display { font: 500 clamp(64px, 8.4vw, 136px)/.86 var(--serif); letter-spacing: -.03em; overflow-wrap: anywhere; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 16px; }
.section-head h2 { font-size: 56px; }
.section-note { font: 400 14px/1.5 var(--font); color: var(--muted); }

.loading { padding: 64px var(--gutter); color: var(--muted); }

.empty { display: grid; justify-items: start; gap: 16px; padding: 96px var(--gutter); }
.empty h1 { font-size: 56px; }
.empty p { max-width: 520px; color: var(--text-3); }

.outline-num {
  font: 500 132px/.78 var(--mono); letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 1px rgba(200, 241, 105, .6);
}

.tag {
  display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 12px;
  border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(240, 237, 228, .3);
  font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; color: var(--text-3);
}
.tag.is-lime { color: var(--lime); box-shadow: inset 0 0 0 1px rgba(200, 241, 105, .4); }
.tag.is-glow { background: var(--lime-soft); }
.glow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }

/* Пилюли материалов */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--text); text-decoration: none; font: 600 14px/1 var(--font); white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--lime); color: var(--text); }
.chip svg { width: 16px; height: 16px; }
.chip.is-small { padding: 0 13px; font-size: 13px; border-color: rgba(240, 237, 228, .2); }
.chip.is-small:hover { border-color: var(--text); }
.chip.is-private { border-style: dashed; color: var(--text-3); }

/* --- Верхняя панель (на телефоне навигация уходит вниз) ------------------------- */

.bar {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 20px var(--gutter); border-bottom: 1px solid rgba(240, 237, 228, .1);
}
.bar-meta { min-width: 0; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }

.tnav { display: flex; gap: 6px; }
.tnav a, .tnav button {
  display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 18px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--text-3); text-decoration: none; font: 600 14px/1 var(--font); white-space: nowrap; cursor: pointer;
}
.tnav a:hover, .tnav button:hover { color: var(--text); background: rgba(240, 237, 228, .07); }
.tnav a[aria-current="page"] { color: var(--bg); background: var(--text); }

/* --- Вход ------------------------------------------------------------------------ */

.login-body { background: var(--bg-deep); }
.login { position: relative; min-height: 100vh; overflow: hidden; display: flex; flex-direction: column; }

.login-art { position: absolute; inset: 0; pointer-events: none; }
.login-orbit { position: absolute; right: -14%; top: -18%; width: min(1100px, 82vw); height: auto; }

.login-top {
  position: relative; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 28px var(--gutter);
}

.login-main {
  position: relative; flex: 1;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 48px;
  padding: 0 var(--gutter) 56px;
}
.login-intro { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; padding-bottom: 12px; }
.login-title { font: 500 clamp(96px, 15vw, 232px)/.8 var(--serif); letter-spacing: -.035em; }
.login-title em { padding-left: .42em; }
.login-lead { max-width: 460px; font: 400 18px/1.6 var(--font); color: var(--text-3); }

.login-card {
  flex: 0 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 24px; padding: 32px;
  border: 1px solid rgba(240, 237, 228, .16); border-radius: 24px;
  background: rgba(23, 72, 59, .28); box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.login-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.login-card-head h2 { font-size: 40px; font-weight: 600; }
.login-form { display: flex; flex-direction: column; gap: 22px; }
.btn-wide { width: 100%; min-height: 52px; font-size: 16px; }

.segmented {
  display: flex; gap: 4px; padding: 4px;
  border: 1px solid rgba(240, 237, 228, .2); border-radius: 999px; background: rgba(11, 12, 10, .6);
}
.segmented button {
  flex: 1 1 0; min-height: 46px; border: 0; border-radius: 999px;
  background: transparent; color: var(--text-3); font: 700 15px/1 var(--font); cursor: pointer;
}
.segmented button[aria-selected="true"] { background: var(--text); color: var(--bg); }

.course-pick { margin: 0; padding: 0; border: 0; min-width: 0; }
.course-pick legend { padding: 0; margin-bottom: 12px; }
.course-options { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.option {
  display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 10px 16px;
  border: 1px solid rgba(240, 237, 228, .14); border-radius: 12px; cursor: pointer;
}
.option:hover { border-color: rgba(240, 237, 228, .4); }
.option:has(input:checked) { border-color: var(--lime); background: rgba(200, 241, 105, .07); }
.option input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--lime); }
.option-num { font: 500 13px/1 var(--mono); color: var(--muted); }
.option:has(input:checked) .option-num { color: var(--lime); }
.option-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.option-title { font: 600 16px/1.2 var(--font); overflow-wrap: anywhere; }
.option-meta { font: 400 13px/1 var(--mono); color: var(--muted); overflow-wrap: anywhere; }

.login-foot { position: relative; display: flex; align-items: center; gap: 16px; padding: 0 var(--gutter) 28px; font-size: 11px; color: var(--faint); }
.login-foot-rule { flex: 1; height: 1px; background: repeating-linear-gradient(90deg, rgba(240, 237, 228, .3) 0 1px, transparent 1px 24px); }

/* --- Обложки (hero) ------------------------------------------------------------------- */

.hero { position: relative; display: flex; align-items: flex-end; padding: 72px var(--gutter) 64px; }
.hero-content { position: relative; display: flex; flex-direction: column; gap: 26px; max-width: 980px; min-width: 0; }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; }
.hero-lead { max-width: 460px; font: 400 17px/1.6 var(--font); color: var(--text-2); }
.hero-note { max-width: 520px; font: 400 15px/1.5 var(--font); color: var(--text-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Студент: курс */
.hero-course { min-height: 680px; padding-top: 96px; padding-bottom: 72px; }
.hero-band { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; background: var(--forest); border-top: 1px solid rgba(240, 237, 228, .18); }
.hero-orbit { position: absolute; right: -12%; top: -140px; width: min(1080px, 78vw); height: auto; pointer-events: none; }
.hero-side {
  position: absolute; right: var(--gutter); top: 72px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px; font-size: 11px;
}
.hero-side-rule { width: 120px; height: 1px; background: rgba(240, 237, 228, .4); }
.hero-manage .hero-lead { max-width: 560px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.hero-course .hero-lead { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.hero-course .display { font-size: clamp(64px, 10vw, 168px); line-height: .84; letter-spacing: -.035em; }

/* Преподаватель: курс на обложке каталога */
.hero-feature { min-height: 700px; padding-top: 340px; }
.hero-feature.is-empty { min-height: 520px; }
.feature-plane { position: absolute; right: 0; top: 0; bottom: 0; width: 58%; background: var(--forest); clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%); }
.feature-contour { position: absolute; right: 0; top: 0; width: 58%; height: 100%; opacity: .55; pointer-events: none; }
.feature-orbit { position: absolute; right: 4%; top: -120px; width: min(760px, 56vw); height: auto; pointer-events: none; }
.hero-num {
  position: absolute; left: clamp(8px, 3vw, 40px); top: 24px;
  font-size: clamp(160px, 20vw, 300px); line-height: 1; -webkit-text-stroke-color: rgba(240, 237, 228, .14);
}

/* Преподаватель: управление курсом */
.hero-manage {
  min-height: 460px; flex-wrap: wrap; justify-content: space-between; gap: 32px;
  padding: 56px var(--gutter); background: var(--forest); overflow: hidden;
}
.manage-contour { position: absolute; right: -6%; top: -30%; width: min(1000px, 74vw); height: auto; pointer-events: none; }
.hero-manage .hero-content { gap: 20px; max-width: 860px; }
.hero-manage .display { font-size: clamp(56px, 7.6vw, 124px); }
.hero-meta { color: var(--text-2); letter-spacing: .08em; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; margin: -12px 0; color: var(--text-3); }
.crumbs a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--text-2); }
.hero-count { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.count-big { font: 500 clamp(96px, 10vw, 168px)/.8 var(--serif); color: var(--lime); text-shadow: 0 0 40px rgba(200, 241, 105, .4); }
.count-big small { font-size: .45em; color: rgba(240, 237, 228, .5); text-shadow: none; }
.hero-count .kicker { color: var(--text-2); }

/* --- Каталог: указатель и загрузка ------------------------------------------------------ */

.index { position: relative; display: flex; flex-direction: column; gap: 20px; padding: 24px var(--gutter) 0; }
.index-list { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.index-row {
  display: grid; grid-template-columns: 56px 112px minmax(0, 1fr) auto 32px; align-items: center; gap: 28px;
  padding: 28px 8px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.index-row:hover { background: rgba(23, 72, 59, .22); color: var(--text); }
.index-num { font: 500 14px/1 var(--mono); color: var(--muted); }
.index-name { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.index-title { font: 500 clamp(30px, 3vw, 44px)/1 var(--serif); overflow-wrap: anywhere; }
.index-meta { font: 400 13px/1.2 var(--mono); color: var(--muted); text-transform: uppercase; overflow-wrap: anywhere; }
.index-arrow svg { width: 24px; height: 24px; }

.dropzone {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 32px;
  margin: 56px var(--gutter) 0; padding: 40px;
  border: 1px dashed rgba(200, 241, 105, .45); border-radius: 24px; background: rgba(23, 72, 59, .18);
  transition: background .15s, border-color .15s;
}
.dropzone.is-over { border-color: var(--lime); background: rgba(23, 72, 59, .4); }
.dropzone-text { flex: 1 1 380px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dropzone-text h2 { font-size: 44px; }
.dropzone-text p { max-width: 560px; font-size: 16px; line-height: 1.6; color: var(--text-3); }

/* --- Студент: маршрут курса --------------------------------------------------------------- */

.course-grid { position: relative; display: flex; flex-wrap: wrap; gap: 56px; padding: 72px var(--gutter) 0; }
.route { flex: 2 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 36px; }
.route:focus { outline: none; }
.route .section-head h2 { font-size: 64px; }
.stops { margin: 0; padding: 0; list-style: none; }
.stop { position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 24px; padding-bottom: 48px; }
.stop-rail { position: relative; display: flex; justify-content: center; }
.stop-rail::before { content: ""; position: absolute; top: 28px; bottom: -4px; width: 1px; background: rgba(240, 237, 228, .3); }
.stop:last-child .stop-rail::before { background: repeating-linear-gradient(180deg, var(--lime) 0 4px, transparent 4px 10px); bottom: -60px; }
.stop-num {
  position: relative; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--text); color: var(--bg); font: 500 15px/1 var(--mono);
}
.stop.is-hot .stop-num { background: var(--lime); box-shadow: 0 0 0 8px rgba(200, 241, 105, .12), 0 0 40px rgba(200, 241, 105, .55); }
.stop-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding-top: 2px; }
.stop-body h3 { font-size: 46px; overflow-wrap: anywhere; }
.stop-body h3 a { color: inherit; text-decoration: none; }
.stop-body h3 a:hover { color: var(--lime); }
.stop.is-hot .stop-body {
  margin-top: -20px; padding: 22px 24px 24px;
  border: 1px solid rgba(200, 241, 105, .28); border-radius: 20px; background: rgba(23, 72, 59, .4);
}
.stop.is-hot .stop-body h3 { font-size: 52px; }
.stop.is-hot .chip:first-child { background: var(--text); border-color: var(--text); color: var(--bg); }
.route-note { margin-left: 96px; font: 500 13px/1.5 var(--mono); letter-spacing: .06em; color: var(--muted); }

.course-aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; padding-top: 12px; }
.info-card {
  display: flex; flex-direction: column; gap: 12px; padding: 28px;
  border: 1px solid rgba(240, 237, 228, .14); border-radius: 20px; background: rgba(240, 237, 228, .03);
}
.info-card.is-plain { background: transparent; }
.info-card .kicker { font-size: 11px; }
.info-card h2 { font-size: 32px; line-height: 1.05; }
.info-card p { color: var(--text-3); line-height: 1.6; }

/* --- Преподаватель: видимость занятий и панели --------------------------------------------- */

.manage-grid { position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 48px; padding: 56px var(--gutter) 0; }
.lessons { flex: 2 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.lessons .section-head h2 { font-size: 52px; }
.vis-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid rgba(240, 237, 228, .14); }
.vis-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; padding: 22px 4px; border-bottom: 1px solid rgba(240, 237, 228, .14); }
.vis-num { display: flex; align-items: center; gap: 10px; flex: 0 0 56px; font: 500 14px/1 var(--mono); color: var(--muted); }
.vis-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--faint); }
.vis-main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.vis-title { display: flex; align-items: center; align-self: flex-start; min-height: var(--tap); font: 500 30px/1.05 var(--serif); color: var(--text-3); text-decoration: none; overflow-wrap: anywhere; }
.vis-title:hover { color: var(--lime); }
.vis-switch { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.vis-label { width: 64px; text-align: right; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.vis-row.is-on .vis-num { color: var(--text); }
.vis-row.is-on .vis-dot { background: var(--lime); box-shadow: 0 0 12px var(--lime); }
.vis-row.is-on .vis-title { color: var(--text); }
.vis-row.is-on .vis-label { color: var(--lime); }

.switch {
  position: relative; flex: 0 0 56px; width: 56px; height: var(--tap); padding: 0;
  border: 0; background: transparent; cursor: pointer;
}
.switch::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 32px; transform: translateY(-50%);
  border-radius: 999px; box-shadow: inset 0 0 0 1.5px rgba(240, 237, 228, .4); transition: background .15s, box-shadow .15s;
}
.switch-knob {
  position: absolute; top: 50%; left: 4px; width: 24px; height: 24px; transform: translateY(-50%);
  border-radius: 50%; background: var(--text-3); transition: left .15s, background .15s;
}
.switch[aria-checked="true"]::before { background: var(--lime); box-shadow: 0 0 20px rgba(200, 241, 105, .35); }
.switch[aria-checked="true"] .switch-knob { left: 28px; background: var(--bg); }
.switch:disabled { opacity: .6; cursor: progress; }
.switch:focus-visible { outline-offset: 2px; border-radius: 999px; }

.manage-aside { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.panel {
  display: flex; flex-direction: column; gap: 14px; padding: 28px;
  border: 1px solid rgba(240, 237, 228, .14); border-radius: 22px; background: rgba(240, 237, 228, .04);
}
.panel .kicker { font-size: 11px; }
.panel h2 { font-size: 34px; }
.panel p { font-size: 14px; line-height: 1.55; color: var(--text-3); }
.panel > .btn { align-self: flex-start; }
.panel-form { display: flex; flex-direction: column; gap: 14px; }
.panel-form .field label { font-size: 13px; color: var(--text-2); }
.panel.is-danger { border-color: var(--danger); background: repeating-linear-gradient(135deg, rgba(232, 102, 74, .07) 0 10px, transparent 10px 20px); }
.panel.is-danger .kicker { color: var(--danger-text); }
.panel.is-danger h2 { color: #ffd7cc; }
.panel.is-danger p { color: #e9d3cc; }
.panel.is-danger .field label { color: #f5e3de; font-weight: 500; line-height: 1.5; }
.panel.is-danger strong { color: #fff; overflow-wrap: anywhere; }

/* --- Занятие ------------------------------------------------------------------------------ */

.lesson-head {
  position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 28px;
  padding: 44px var(--gutter) 0;
}
.view.is-lesson::before {
  content: ""; position: absolute; left: -200px; top: 40px; width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(23, 72, 59, .7), rgba(16, 17, 15, 0) 70%); pointer-events: none;
}
.lesson-name { display: flex; align-items: flex-end; gap: 28px; min-width: 0; }
.lesson-name-text { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lesson-name h1 { font-size: clamp(44px, 5.6vw, 88px); line-height: .9; letter-spacing: -.02em; overflow-wrap: anywhere; }

.stepper { display: flex; align-items: center; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 6px;
  color: var(--text-3); text-decoration: none; font: 500 13px/1 var(--mono);
}
.step:hover { color: var(--text); }
.step-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--text); }
.step[aria-current="page"] { color: var(--text); }
.step[aria-current="page"] .step-dot { background: var(--lime); box-shadow: 0 0 14px var(--lime); }
.step-line { width: 40px; height: 1px; background: rgba(240, 237, 228, .35); }
.step-line.is-dashed { width: 32px; background: repeating-linear-gradient(90deg, rgba(240, 237, 228, .35) 0 3px, transparent 3px 8px); }

.tabs {
  position: relative; display: flex; gap: 32px; margin: 28px var(--gutter) 0;
  overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid rgba(240, 237, 228, .14);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; min-height: 52px; margin-bottom: -1px; flex: none;
  border-bottom: 2px solid transparent; color: var(--text-3); text-decoration: none; font: 600 15px/1 var(--font); white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-private { color: var(--muted); text-decoration: underline dashed rgba(240, 237, 228, .35); text-underline-offset: 6px; }
.tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--lime); }
.tab:focus-visible { outline-offset: -2px; }

/* Презентация в рамке с метками обреза */
.stage { position: relative; display: flex; flex-direction: column; gap: 18px; padding: 28px var(--gutter) 0; }
.slide-frame {
  position: relative; padding: clamp(18px, 2.6vw, 40px);
  border: 1px solid rgba(240, 237, 228, .1); border-radius: 6px; background: var(--surface);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .55);
}
.slide-frame iframe {
  display: block; width: min(100%, calc((100vh - 120px) * 16 / 9)); aspect-ratio: 16 / 9; margin: 0 auto;
  border: 0; background: #fff;
}
.crop { position: absolute; width: 22px; height: 22px; border: 0 solid var(--lime); }
.crop-tl { left: 10px; top: 10px; border-left-width: 1.5px; border-top-width: 1.5px; }
.crop-tr { right: 10px; top: 10px; border-right-width: 1.5px; border-top-width: 1.5px; }
.crop-bl { left: 10px; bottom: 10px; border-left-width: 1.5px; border-bottom-width: 1.5px; }
.crop-br { right: 10px; bottom: 10px; border-right-width: 1.5px; border-bottom-width: 1.5px; }

.stage-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.stage-progress { display: flex; align-items: center; gap: 18px; }
.stage-count { font: 500 15px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.stage-count b { font-size: 28px; font-weight: 500; color: var(--text); }
.stage-line { width: min(220px, 18vw); height: 1px; background: linear-gradient(90deg, var(--lime) 0 var(--p), rgba(240, 237, 228, .2) var(--p)); }
.stage-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.stage-actions .btn { min-height: 46px; padding: 0 20px; font-size: 14px; }

/* Задания, ответы, заметки — на светлом листе */
.doc-layout { position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px; padding: 36px var(--gutter) 0; }
.paper {
  flex: 999 1 620px; min-width: 0; padding: 10px;
  border-radius: 4px; background: var(--text); box-shadow: 0 40px 100px rgba(0, 0, 0, .5);
}
.paper iframe { display: block; width: 100%; height: max(560px, calc(100vh - 140px)); border: 0; background: #fff; }
.doc-aside { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.next-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 24px;
  border-radius: 20px; background: var(--forest); color: var(--text); text-decoration: none;
}
.next-card:hover { color: var(--text); box-shadow: inset 0 0 0 1px rgba(200, 241, 105, .45); }
.next-card .rings { position: absolute; right: -50px; bottom: -60px; }
.next-card > span { position: relative; }
.next-card .kicker { font-size: 11px; }
.next-card-title { font: 500 34px/1 var(--serif); overflow-wrap: anywhere; }
.next-card-meta { font-size: 14px; line-height: 1.45; color: var(--text-2); }

.file-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px 18px;
  border: 1px solid rgba(240, 237, 228, .16); border-radius: 16px; color: var(--text); text-decoration: none;
}
.file-card:hover { border-color: var(--lime); color: var(--text); }
.file-card > span { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.file-card-title { font: 600 14px/1.2 var(--font); }
.file-card-meta { font: 400 12px/1.2 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.file-card svg { width: 20px; height: 20px; flex: none; }

/* --- Окна, прогресс, уведомления ------------------------------------------------------------- */

.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0;
  border: 1px solid rgba(240, 237, 228, .16); border-radius: 24px;
  background: #141a16; color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.modal::backdrop { background: rgba(5, 6, 5, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal form { display: flex; flex-direction: column; gap: 20px; padding: 32px; }
.modal h2 { margin-top: -8px; font-size: 40px; font-weight: 600; }
.modal-text { color: var(--text-3); line-height: 1.55; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.progress { height: 6px; overflow: hidden; border-radius: 999px; background: rgba(240, 237, 228, .12); }
.progress span { display: block; width: 0; height: 100%; background: var(--lime); box-shadow: 0 0 12px var(--lime); transition: width .2s; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px); padding: 14px 20px;
  border: 1px solid rgba(200, 241, 105, .4); border-radius: 14px;
  background: #18241c; color: var(--text); font: 500 14px/1.45 var(--font); box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.toast.is-error { border-color: var(--danger); background: #2a1612; }

/* --- Адаптив --------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .index-row { grid-template-columns: 40px 72px minmax(0, 1fr); gap: 12px 16px; padding: 22px 4px; }
  .index-row .pictogram { width: 72px; height: 52px; }
  .index-tag { grid-column: 3; }
  .index-arrow { display: none; }
  .hero-feature { min-height: 0; padding-top: 200px; }
  .feature-plane, .feature-contour { width: 72%; }
}

@media (max-width: 760px) {
  .page { padding-bottom: calc(var(--bnav-h) + 32px); }
  .bar { padding-top: 16px; padding-bottom: 16px; }
  .bar-meta { max-width: 50vw; font-size: 11px; }

  .tnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    justify-content: space-around; gap: 4px; padding: 8px 8px 12px;
    background: rgba(16, 17, 15, .96); border-top: 1px solid var(--line);
  }
  .tnav a, .tnav button {
    flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 5px;
    min-height: 56px; padding: 0 4px; border-radius: 14px; font-size: 12px;
  }
  .tnav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .tnav svg { width: 22px; height: 22px; }

  .display { font-size: clamp(52px, 15vw, 80px); }
  .section-head h2, .route .section-head h2, .lessons .section-head h2 { font-size: 44px; }

  .login-main { gap: 32px; padding-bottom: 32px; }
  .login-intro { flex-basis: 100%; gap: 20px; }
  .login-title { font-size: clamp(80px, 27vw, 120px); }
  .login-title em { padding-left: 1.1em; }
  .login-lead { font-size: 16px; }
  .login-top .kicker { font-size: 11px; }
  .login-card { flex-basis: 100%; padding: 24px 20px; border-radius: 20px; }
  .login-orbit { right: -40%; top: -6%; width: 150vw; }

  .hero { padding-top: 48px; padding-bottom: 40px; }
  .hero-course { min-height: 560px; padding-top: 120px; }
  .hero-course .hero-lead { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.hero-course .display { font-size: clamp(52px, 17vw, 76px); }
  .hero-orbit { left: -60px; right: auto; top: -110px; width: 640px; max-width: none; }
  .hero-side { top: 24px; }
  .hero-side-rule { width: 64px; }
  .hero-course .actions .btn-lime { flex: 1 1 100%; justify-content: space-between; min-height: 54px; }
  .hero-num { font-size: 140px; }
  .hero-course .hero-lead { -webkit-line-clamp: 3; }
  .feature-orbit { width: 120vw; right: -30%; top: -60px; }
  .hero-manage { padding-top: 40px; padding-bottom: 40px; }
  .hero-count { align-items: flex-start; }
  .count-big { font-size: 96px; }

  .index-title { font-size: 28px; }
  .dropzone { padding: 28px 20px; gap: 20px; margin-top: 40px; }
  .dropzone .upload-art { width: 80px; height: 80px; }
  .dropzone-text h2 { font-size: 34px; }
  .dropzone .btn { width: 100%; }

  .course-grid { padding-top: 40px; gap: 40px; }
  .stop { grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding-bottom: 36px; }
  .stop-num { width: 40px; height: 40px; font-size: 13px; }
  .stop-rail::before { top: 24px; }
  .stop-body h3 { font-size: 34px; }
  .stop.is-hot .stop-body { margin-top: -14px; padding: 18px; }
  .stop.is-hot .stop-body h3 { font-size: 38px; }
  .chip { padding: 0 14px; font-size: 13px; }
  .route-note { margin-left: 54px; font-size: 12px; }

  .manage-grid { padding-top: 40px; gap: 40px; }
  .vis-row { gap: 12px 14px; }
  .vis-num { flex-basis: 48px; }
  .vis-main { flex-basis: calc(100% - 64px); }
  .vis-title { font-size: 26px; }
  .vis-switch { margin-left: 62px; }
  .vis-label { width: auto; text-align: left; }
  .panel { padding: 22px 20px; }

  .lesson-head { padding-top: 24px; gap: 18px; }
  .lesson-name { gap: 14px; }
  .outline-num { font-size: 84px; }
  .lesson-name h1 { font-size: clamp(36px, 11vw, 48px); }
  .tabs { gap: 8px; margin-left: 0; margin-right: 0; padding: 0 var(--gutter); border-bottom: 0; }
  .tab {
    min-height: var(--tap); margin: 0; padding: 0 18px;
    border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; color: var(--text-2);
  }
  .tab[aria-current="page"] { background: var(--text); border-color: var(--text); color: var(--bg); }
  .tab.is-private { text-decoration: none; border-style: dashed; }
  .tab.is-private[aria-current="page"] { border-style: solid; }

  .stage { padding: 20px 0 0; }
  .slide-frame { padding: 18px 14px; border-left: 0; border-right: 0; border-radius: 0; }
  .crop { width: 16px; height: 16px; }
  .crop-tl, .crop-bl { left: 6px; } .crop-tr, .crop-br { right: 6px; }
  .crop-tl, .crop-tr { top: 6px; } .crop-bl, .crop-br { bottom: 6px; }
  .stage-bar { padding: 0 var(--gutter); }
  .stage-progress { width: 100%; }
  .stage-line { flex: 1; width: auto; }
  .stage-actions { width: 100%; }
  .stage-actions .btn { flex: 1 1 auto; }
  .stage-actions .btn-lime { flex-basis: 100%; }

  .doc-layout { padding-top: 20px; gap: 24px; }
  .paper { padding: 6px; }
  .paper iframe { height: max(520px, calc(100vh - 200px)); }

  .modal form { padding: 24px 20px; }
  .modal h2 { font-size: 34px; }
  .modal-actions .btn { flex: 1 1 auto; }
  .toast { bottom: calc(var(--bnav-h) + 16px); }
}

@media (max-width: 420px) {
  .brand { font-size: 22px; }
  .stepper { display: none; }
  .hero-side { display: none; }
  .login-top .kicker { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
